Operazioni sui punti di interruzione
1 operazione, breakpoints.update. Si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.
| Operation | What it does | Permission | Confirmation |
|---|---|---|---|
| breakpoints.update | Replace the site's style breakpoints, the ids bp:<id> scopes and component cells name. | breakpoints.edit | none |
breakpoints.update
Replace the site's style breakpoints, the ids bp:<id> scopes and component cells name. styleBreakpoints is the whole new list, mobile-first: base first, then each { id, label, minWidth, maxWidth?, condition? } with min widths increasing (a breakpoint may hold only a media condition instead). before is the list as it is now (settings.read styleBreakpoints, or the defaults base, sm 480, md 768, lg 1024, xl 1440 when it is absent); another one is refused as changed elsewhere (409). The ids base, sm, md, lg and xl must stay; add your own, such as { id: "menu", label: "Menu folds", minWidth: 1081 }. A breakpoint a draft node's style still names cannot go (422, with the node ids).
Esempio di input
{
"before": [
{
"id": "base",
"label": "Base"
},
{
"id": "sm",
"label": "Phone landscape",
"minWidth": 480
},
{
"id": "md",
"label": "Tablet",
"minWidth": 768
},
{
"id": "lg",
"label": "Desktop",
"minWidth": 1024
},
{
"id": "xl",
"label": "Wide",
"minWidth": 1440
}
],
"styleBreakpoints": [
{
"id": "base",
"label": "Base"
},
{
"id": "sm",
"label": "Phone landscape",
"minWidth": 480
},
{
"id": "md",
"label": "Tablet",
"minWidth": 768
},
{
"id": "lg",
"label": "Desktop",
"minWidth": 1024
},
{
"id": "xl",
"label": "Wide",
"minWidth": 1600
}
]
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| styleBreakpoints | array of object | yes | |
| styleBreakpoints[].id | string | yes | |
| styleBreakpoints[].label | string | yes | At least 1 character. |
| styleBreakpoints[].minWidth | integer | no | More than 0. |
| styleBreakpoints[].maxWidth | integer | no | More than 0. |
| styleBreakpoints[].condition | object | object | object | object | object | object | object | object | no | |
| before | array of object | yes | |
| before[].id | string | yes | |
| before[].label | string | yes | At least 1 character. |
| before[].minWidth | integer | no | More than 0. |
| before[].maxWidth | integer | no | More than 0. |
| before[].condition | object | object | object | object | object | object | object | object | no |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| settings | record of any JSON | yes |
Provala
yarn splash breakpoints.update '{"before":[{"id":"base","label":"Base"},{"id":"sm","label":"Phone landscape","minWidth":480},{"id":"md","label":"Tablet","minWidth":768},{"id":"lg","label":"Desktop","minWidth":1024},{"id":"xl","label":"Wide","minWidth":1440}],"styleBreakpoints":[{"id":"base","label":"Base"},{"id":"sm","label":"Phone landscape","minWidth":480},{"id":"md","label":"Tablet","minWidth":768},{"id":"lg","label":"Desktop","minWidth":1024},{"id":"xl","label":"Wide","minWidth":1600}]}' --dry-runGenerato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente a06995ab8368938b).
Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.