Operazioni sui layout

2 operazioni di nome layout.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.

Aggiornato il
OperationWhat it doesPermissionConfirmation
layout.readRead the site's layout frames as its draft resolves them: with layoutId (the frame a page names in frame, such as default or scale-canvas) that frame, without it every frame of the theme.site.readnone
layout.updateReplace this site's version of one of the theme's layout frames (layoutId, the frame a page names in frame, such as default or scale-canvas) with layout, the whole frame object (its id is layoutId; read it first with layout.read, which answers it as the site resolves it now).site.structurenone

layout.read

Read the site's layout frames as its draft resolves them: with layoutId (the frame a page names in frame, such as default or scale-canvas) that frame, without it every frame of the theme. Each comes as { layoutId, source, layout }: layout is the whole frame object layout.update takes (its frame with responsiveMode, designWidth and scaleFromWidth, and the header, footer, background, scroll, chrome and overridePolicy layers), source is site when the site already replaced it with layout.update and theme when it is the theme's. Change the frame you read and send it whole to layout.update. A page may still override some layers for itself in meta.layoutOverrides; an unknown layoutId is layout_not_found (404).

permission: site.readreads onlyclass: read

Esempio di input

{
  "layoutId": "default"
}

Input

FieldTypeRequiredNotes
layoutIdstringnoAt least 1 character.

Output

FieldTypeRequiredNotes
layoutsarray of objectyes
layouts[].layoutIdstringyes
layouts[].sourcestringyesOne of "theme", "site".
layouts[].layoutobjectyes

I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.

Provala

yarn splash layout.read '{"layoutId":"default"}' --dry-run

layout.update

Replace this site's version of one of the theme's layout frames (layoutId, the frame a page names in frame, such as default or scale-canvas) with layout, the whole frame object (its id is layoutId; read it first with layout.read, which answers it as the site resolves it now). frame.responsiveMode decides how its pages fit the window: breakpoint reflows them at the site breakpoints, with fluid tokens growing with the window; scale lays them out at designWidth and scales the whole canvas to the window from scaleFromWidth (769 px by default) up, reflowing below it. The other layers are header, footer, background, scroll, chrome and overridePolicy (which meta.layoutOverrides layers a page may apply). Answers the frame as the site now resolves it, with warnings.

permission: site.structurewrites: settingsclass: transactionundo: yes

Esempio di input

{
  "layoutId": "default",
  "layout": {
    "id": "default",
    "label": {
      "en-US": "Default"
    }
  }
}

Input

FieldTypeRequiredNotes
layoutIdstringyesAt least 1 character.
layoutobjectyes
layout.idstringyesAt least 1 character.
layout.labelrecord of stringyes
layout.chromeobjectno
layout.frameobjectno
layout.canvasPresetvalueno
layout.headerobjectno
layout.footerobjectno
layout.backgroundobjectno
layout.scrollobjectno
layout.overridePolicyobjectno
{
  "type": "object",
  "properties": {
    "layoutId": {
      "type": "string",
      "minLength": 1
    },
    "layout": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "chrome": {
          "type": "object",
          "properties": {
            "elements": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema0"
              }
            }
          }
        },
        "frame": {
          "type": "object",
          "properties": {
            "responsiveMode": {
              "type": "string",
              "enum": [
                "breakpoint",
                "scale"
              ]
            },
            "scaleOrigin": {
              "type": "string",
              "enum": [
                "top-left",
                "top-center"
              ]
            },
            "containerMode": {
              "type": "string",
              "enum": [
                "measure",
                "content",
                "wide",
                "full-bleed"
              ]
            },
            "sectionSpacingDefault": {
              "type": "string",
              "enum": [
                "none",
                "sm",
                "md",
                "lg",
                "xl"
              ]
            },
            "designWidth": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "maxWidth": {
              "type": "string"
            },
            "insetX": {
              "type": "string"
            },
            "minHeight": {
              "type": "string"
            },
            "overflowX": {
              "type": "string",
              "enum": [
                "visible",
                "hidden",
                "clip"
              ]
            },
            "minScale": {
              "type": "number"
            },
            "maxScale": {
              "type": "number"
            },
            "scaleFromWidth": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            },
            "scaleRegions": {
              "type": "boolean"
            }
          }
        },
        "canvasPreset": {},
        "header": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "variant": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]*$"
            },
            "palette": {
              "type": "object",
              "properties": {
                "bgColor": {
                  "type": "string"
                },
                "textColor": {
                  "type": "string"
                },
                "navLinkColor": {
                  "type": "string"
                },
                "navLinkHoverColor": {
                  "type": "string"
                },
                "accentBarColor": {
                  "type": "string"
                },
                "scrollFade": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "footer": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "position": {
              "type": "string",
              "enum": [
                "normal",
                "sticky-bottom"
              ]
            },
            "palette": {
              "type": "object",
              "properties": {
                "bgColor": {
                  "type": "string"
                },
                "textColor": {
                  "type": "string"
                },
                "linkColor": {
                  "type": "string"
                }
              }
            }
          }
        },
        "background": {
          "type": "object",
          "properties": {
            "color": {
              "type": "string"
            },
            "image": {
              "type": "object",
              "properties": {
                "src": {
                  "type": "string"
                },
                "repeat": {
                  "type": "string",
                  "enum": [
                    "none",
                    "repeat",
                    "repeat-x",
                    "repeat-y"
                  ]
                },
                "size": {
                  "type": "string"
                },
                "position": {
                  "type": "string"
                },
                "attachment": {
                  "type": "string",
                  "enum": [
                    "scroll",
                    "fixed"
                  ]
                },
                "opacity": {
                  "type": "number"
                }
              }
            },
            "overlay": {
              "type": "object",
              "properties": {
                "color": {
                  "type": "string"
                },
                "opacity": {
                  "type": "number"
                },
                "blendMode": {
                  "type": "string"
                }
              }
            },
            "texture": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "noise",
                    "grain"
                  ]
                },
                "opacity": {
                  "type": "number"
                }
              }
            }
          }
        },
        "scroll": {
          "type": "object",
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "normal",
                "snap-y",
                "magnet"
              ]
            },
            "magnet": {
              "type": "object",
              "properties": {
                "idleMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 5000
                },
                "coarseIdleMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 5000
                },
                "windowVh": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                },
                "minPx": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 500
                },
                "exclude": {
                  "type": "string",
                  "enum": [
                    "first",
                    "none"
                  ]
                },
                "includeFooter": {
                  "type": "boolean"
                }
              }
            },
            "snapType": {
              "type": "string",
              "enum": [
                "mandatory",
                "proximity"
              ]
            },
            "snapAlign": {
              "type": "string",
              "enum": [
                "start",
                "center"
              ]
            },
            "smoothScroll": {
              "type": "boolean"
            }
          }
        },
        "overridePolicy": {
          "type": "object",
          "properties": {
            "allowPageHeaderOverride": {
              "type": "boolean"
            },
            "allowPageFooterOverride": {
              "type": "boolean"
            },
            "allowPageBackgroundOverride": {
              "type": "boolean"
            },
            "allowPageChromeOverride": {
              "type": "boolean"
            },
            "allowPageChromeAdditions": {
              "type": "boolean"
            },
            "allowPageScrollOverride": {
              "type": "boolean"
            }
          }
        }
      },
      "required": [
        "id",
        "label"
      ]
    }
  },
  "required": [
    "layoutId",
    "layout"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/__schema1"
        },
        "type": {
          "$ref": "#/$defs/__schema2"
        },
        "enabled": {
          "$ref": "#/$defs/__schema3"
        },
        "position": {
          "$ref": "#/$defs/__schema4"
        },
        "coordSpace": {
          "$ref": "#/$defs/__schema5"
        },
        "anchor": {
          "$ref": "#/$defs/__schema6"
        },
        "offsetX": {
          "$ref": "#/$defs/__schema7"
        },
        "offsetY": {
          "$ref": "#/$defs/__schema8"
        },
        "zIndex": {
          "$ref": "#/$defs/__schema9"
        },
        "opacity": {
          "$ref": "#/$defs/__schema10"
        },
        "blendMode": {
          "$ref": "#/$defs/__schema11"
        },
        "pointerEvents": {
          "$ref": "#/$defs/__schema12"
        },
        "hideBelow": {
          "$ref": "#/$defs/__schema13"
        },
        "layer": {
          "$ref": "#/$defs/__schema14"
        },
        "positionMode": {
          "$ref": "#/$defs/__schema15"
        },
        "orientation": {
          "$ref": "#/$defs/__schema16"
        },
        "color": {
          "$ref": "#/$defs/__schema17"
        },
        "thickness": {
          "$ref": "#/$defs/__schema18"
        },
        "length": {
          "$ref": "#/$defs/__schema19"
        },
        "shape": {
          "$ref": "#/$defs/__schema20"
        },
        "width": {
          "$ref": "#/$defs/__schema21"
        },
        "height": {
          "$ref": "#/$defs/__schema22"
        },
        "radius": {
          "$ref": "#/$defs/__schema23"
        },
        "rotation": {
          "$ref": "#/$defs/__schema24"
        },
        "src": {
          "$ref": "#/$defs/__schema25"
        },
        "alt": {
          "$ref": "#/$defs/__schema26"
        },
        "objectFit": {
          "$ref": "#/$defs/__schema27"
        },
        "text": {
          "$ref": "#/$defs/__schema28"
        },
        "indicator": {
          "$ref": "#/$defs/__schema29"
        },
        "trackColor": {
          "$ref": "#/$defs/__schema30"
        },
        "edge": {
          "$ref": "#/$defs/__schema31"
        },
        "size": {
          "$ref": "#/$defs/__schema32"
        },
        "showLabel": {
          "$ref": "#/$defs/__schema33"
        }
      },
      "required": [
        "id",
        "type",
        "enabled",
        "position"
      ]
    },
    "__schema1": {
      "type": "string",
      "minLength": 1
    },
    "__schema2": {
      "type": "string",
      "enum": [
        "line",
        "shape",
        "image",
        "text",
        "progress"
      ]
    },
    "__schema3": {
      "type": "boolean"
    },
    "__schema4": {
      "type": "string",
      "enum": [
        "fixed",
        "absolute"
      ]
    },
    "__schema5": {
      "type": "string",
      "enum": [
        "viewport",
        "design"
      ]
    },
    "__schema6": {
      "type": "string",
      "enum": [
        "top-left",
        "top-right",
        "bottom-left",
        "bottom-right",
        "center"
      ]
    },
    "__schema7": {
      "type": "string"
    },
    "__schema8": {
      "type": "string"
    },
    "__schema9": {
      "type": "number"
    },
    "__schema10": {
      "type": "number"
    },
    "__schema11": {
      "type": "string"
    },
    "__schema12": {
      "type": "string",
      "enum": [
        "none",
        "auto"
      ]
    },
    "__schema13": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "sm",
            "md",
            "lg"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "__schema14": {
      "type": "string",
      "enum": [
        "background",
        "foreground"
      ]
    },
    "__schema15": {
      "type": "string",
      "enum": [
        "viewport-fixed",
        "flow"
      ]
    },
    "__schema16": {
      "type": "string",
      "enum": [
        "vertical",
        "horizontal"
      ]
    },
    "__schema17": {
      "type": "string"
    },
    "__schema18": {
      "type": "string"
    },
    "__schema19": {
      "type": "string"
    },
    "__schema20": {
      "type": "string",
      "enum": [
        "rectangle",
        "circle",
        "pill"
      ]
    },
    "__schema21": {
      "type": "string"
    },
    "__schema22": {
      "type": "string"
    },
    "__schema23": {
      "type": "string"
    },
    "__schema24": {
      "type": "string"
    },
    "__schema25": {
      "type": "string"
    },
    "__schema26": {
      "type": "string"
    },
    "__schema27": {
      "type": "string",
      "enum": [
        "contain",
        "cover"
      ]
    },
    "__schema28": {
      "type": "string"
    },
    "__schema29": {
      "type": "string",
      "enum": [
        "bar",
        "ring"
      ]
    },
    "__schema30": {
      "type": "string"
    },
    "__schema31": {
      "type": "string",
      "enum": [
        "top",
        "bottom"
      ]
    },
    "__schema32": {
      "type": "string"
    },
    "__schema33": {
      "type": "boolean"
    }
  }
}

Output

FieldTypeRequiredNotes
oktrueyes
layoutobjectyes
layout.idstringyesAt least 1 character.
layout.labelrecord of stringyes
layout.chromeobjectno
layout.frameobjectno
layout.canvasPresetvalueno
layout.headerobjectno
layout.footerobjectno
layout.backgroundobjectno
layout.scrollobjectno
layout.overridePolicyobjectno
warningsarray of stringyes

I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.

Provala

yarn splash layout.update '{"layoutId":"default","layout":{"id":"default","label":{"en-US":"Default"}}}' --dry-run

Generato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente a6927afe2c466b2f).

Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.

Guida di Libretto

Colophon. Questa guida è un sito Libretto: 70 pagine in due lingue, 21 pagine della guida importate da Markdown e 42 pagine di riferimento generate dal registro delle operazioni. Composta in Softcore, il codice in IBM Plex Mono. La sua struttura:

/it/ Guida di Libretto /it/start Per iniziare /it/start/request-access Richiedere l'accesso /it/start/workspace Il tuo spazio di lavoro /it/start/first-site Il tuo primo sito /it/start/invite-a-client Invitare un cliente /it/start/connect-claude Connettere Claude a Libretto /it/build Costruire /it/build/first-page Costruire una pagina /it/build/layers-and-canvas Livelli e canvas /it/build/site-components Componenti del sito /it/design-system Design system /it/design-system/tokens Colori, spazi e temi /it/design-system/components Componenti e varianti /it/design-system/fonts Tipografia e font /it/motion Movimento /it/motion/scenes Scene e ricette /it/motion/image-sequences Sequenze di immagini /it/motion/reduced-motion Movimento ridotto /it/publish Pubblicazione /it/publish/languages Le lingue del sito /it/publish/versions Pubblicazione e versioni /it/publish/members-and-forms Iscritti e moduli /it/publish/domains Domini /it/publish/redirects Reindirizzamenti /it/handover Consegnare un sito al cliente /it/glossary Glossario /it/agents Agenti e API /it/agents/mcp Server MCP /it/agents/cli CLI /it/agents/batches Batch /it/agents/errors Errori e segnalazioni /it/agents/operations Operazioni /it/search Cerca