domma-cms 1.63.0 → 1.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,26 @@
1
- import{FONT_MAP as l}from"../../../public/js/text-style.mjs?v=20261029-all-cms-fonts";import{isLicensedFont as n}from"../../../public/js/font-families.mjs?v=20261029-cms-fonts";import{SHORTCODE_EXPIRY_FIELDS as o}from"../../../public/js/shortcode-expiry.mjs";export const SHORTCODES=[{name:"card",label:"Card",icon:"card",category:"Layout",selfClosing:!1,container:!0,wrappable:!0,template:`[card title="Title"]
1
+ import{BACKGROUND_PRESETS as l}from"../../../public/js/background-style.mjs";import{FONT_MAP as n}from"../../../public/js/text-style.mjs?v=20261029-all-cms-fonts";import{isLicensedFont as o}from"../../../public/js/font-families.mjs?v=20261029-cms-fonts";import{SHORTCODE_EXPIRY_FIELDS as i}from"../../../public/js/shortcode-expiry.mjs";export const SHORTCODES=[{name:"card",label:"Card",icon:"card",category:"Layout",selfClosing:!1,container:!0,wrappable:!0,template:`[card title="Title"]
2
2
  Content
3
- [/card]`,custom:"card",attrs:[{name:"title",type:"text",label:"Title"},{name:"subtitle",type:"text",label:"Subtitle"},{name:"body-align",type:"select",label:"Body alignment",options:[["","Default"],["left","Left"],["center","Centre"],["right","Right"]]},{name:"icon",type:"icon",label:"Icon"},{name:"span",type:"select",label:"Span (in a grid)",options:[["","1 column"],["2","2 columns"],["3","3 columns"],["4","4 columns"],["5","5 columns"],["6","6 columns"],["full","Full row"]]},{name:"icon-layout",type:"select",label:"Icon layout",options:[["inline","Inline"],["stacked","Stacked"]]},{name:"icon-size",type:"text",label:"Icon size (xs, sm, md, lg, xl, 2xl or 48px / 3rem)"},{name:"icon-align",type:"select",label:"Icon alignment",options:[["","Default"],["left","Left"],["center","Centre"],["right","Right"]]},{name:"footer",type:"text",label:"Footer"},{name:"image",type:"image",label:"Image"},{name:"image-position",type:"select",label:"Image position",options:[["","Header (above the title)"],["body","Behind the body"]]},{name:"image-alt",type:"text",label:"Image description (alt)"},{name:"image-height",type:"text",label:"Image height (240px, 15rem, 40vh)"},{name:"overlay",type:"text",label:"Overlay text"},{name:"overlay-position",type:"select",label:"Overlay position",options:[["","Bottom"],["center","Centre"],["top","Top"]]},{name:"variant",type:"select",label:"Variant",options:[["","Default"],["primary","Primary"]]},{name:"collapsible",type:"checkbox",label:"Collapsible"},{name:"hover",type:"checkbox",label:"Hover highlight"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"box",label:"Box",icon:"square",category:"Layout",selfClosing:!1,container:!0,wrappable:!0,template:`[box]
3
+ [/card]`,custom:"card",attrs:[{name:"vertical-align",type:"select",label:"Vertical alignment",options:[["","Default"],["top","Top"],["middle","Middle"],["bottom","Bottom"]],help:"Position the body content vertically inside the card. Header and footer keep their positions. Visible when the body has spare height."},{name:"title",type:"text",label:"Title"},{name:"subtitle",type:"text",label:"Subtitle"},{name:"body-align",type:"select",label:"Body alignment",options:[["","Default"],["left","Left"],["center","Centre"],["right","Right"]]},{name:"icon",type:"icon",label:"Icon"},{name:"span",type:"select",label:"Span (in a grid)",options:[["","1 column"],["2","2 columns"],["3","3 columns"],["4","4 columns"],["5","5 columns"],["6","6 columns"],["full","Full row"]]},{name:"icon-layout",type:"select",label:"Icon layout",options:[["inline","Inline"],["stacked","Stacked"]]},{name:"icon-size",type:"text",label:"Icon size (xs, sm, md, lg, xl, 2xl or 48px / 3rem)"},{name:"icon-align",type:"select",label:"Icon alignment",options:[["","Default"],["left","Left"],["center","Centre"],["right","Right"]]},{name:"footer",type:"text",label:"Footer"},{name:"image",type:"image",label:"Image"},{name:"image-position",type:"select",label:"Image position",options:[["","Header (above the title)"],["body","Behind the body"]]},{name:"image-alt",type:"text",label:"Image description (alt)"},{name:"image-height",type:"text",label:"Image height (240px, 15rem, 40vh)"},{name:"overlay",type:"text",label:"Overlay text"},{name:"overlay-position",type:"select",label:"Overlay position",options:[["","Bottom"],["center","Centre"],["top","Top"]]},{name:"variant",type:"select",label:"Variant",options:[["","Default"],["primary","Primary"]]},{name:"collapsible",type:"checkbox",label:"Collapsible"},{name:"hover",type:"checkbox",label:"Hover highlight"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"box",label:"Box",icon:"square",category:"Layout",selfClosing:!1,container:!0,wrappable:!0,template:`[box]
4
4
  Content
5
- [/box]`,attrs:[{name:"shadow",type:"select",label:"Shadow",options:[["","None (default)"],["md","Medium"],["lg","Large"]]},{name:"rounded",type:"select",label:"Corners",options:[["","2px (default)"],["none","Square"],["sm","Small"],["lg","Large"],["full","Pill"]]},{name:"padding",type:"select",label:"Padding",options:[["","Normal"],["compact","Compact"],["spacious","Spacious"]]},{name:"span",type:"select",label:"Span (in a grid)",options:[["","1 column"],["2","2 columns"],["3","3 columns"],["4","4 columns"],["5","5 columns"],["6","6 columns"],["full","Full row"]]},{name:"borderless",type:"checkbox",label:"No border"},{name:"hover",type:"select",label:"Hover",options:[["","Lift (default)"],["off","Off - stays still"]]},{name:"color",type:"select",label:"Colour (from the theme)",options:[["","None"],["primary","Primary"],["secondary","Secondary"],["success","Success"],["info","Info"],["warning","Warning"],["danger","Danger"]]},{name:"footer",type:"text",label:"Footer"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"grid",label:"Grid",icon:"columns",category:"Layout",selfClosing:!1,container:!0,wrappable:!1,template:`[grid cols="2" gap="3"]
5
+ [/box]`,attrs:[{name:"shadow",type:"select",label:"Shadow",options:[["","None (default)"],["md","Medium"],["lg","Large"]]},{name:"rounded",type:"select",label:"Corners",options:[["","2px (default)"],["none","Square"],["sm","Small"],["lg","Large"],["full","Pill"]]},{name:"padding",type:"select",label:"Padding",options:[["","Normal"],["compact","Compact"],["spacious","Spacious"]]},{name:"span",type:"select",label:"Span (in a grid)",options:[["","1 column"],["2","2 columns"],["3","3 columns"],["4","4 columns"],["5","5 columns"],["6","6 columns"],["full","Full row"]]},{name:"borderless",type:"checkbox",label:"No border"},{name:"hover",type:"select",label:"Hover",options:[["","Lift (default)"],["off","Off - stays still"]]},{name:"color",type:"select",label:"Colour (from the theme)",options:[["","None"],["primary","Primary"],["secondary","Secondary"],["success","Success"],["info","Info"],["warning","Warning"],["danger","Danger"]]},{name:"footer",type:"text",label:"Footer"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"background",label:"Background",icon:"palette",category:"Layout",selfClosing:!1,container:!0,wrappable:!0,template:`[background preset="lavender-haze"]
6
+ Content
7
+ [/background]`,attrs:[{name:"preset",type:"select",label:"Preset",options:[["","Custom"],...l.map(e=>[e.id,e.label])]},{name:"type",type:"select",label:"Background type",options:[["solid","Solid colour"],["linear","Linear gradient"],["radial","Radial gradient"],["glow","Soft glow"]]},{name:"color",type:"colour",label:"Base colour"},{name:"colors",type:"text",label:"Gradient colours"},{name:"angle",type:"number",label:"Angle"},{name:"x",type:"number",label:"Horizontal position"},{name:"y",type:"number",label:"Vertical position"},{name:"spread",type:"number",label:"Spread"},{name:"strength",type:"number",label:"Glow strength"}]},{name:"grid",label:"Grid",icon:"columns",category:"Layout",selfClosing:!1,container:!0,wrappable:!1,template:`[grid cols="2" gap="3"]
6
8
  [col]
7
9
  Left
8
10
  [/col]
9
11
  [col]
10
12
  Right
11
13
  [/col]
12
- [/grid]`,children:{name:"col",min:2,max:6},attrs:[{name:"cols",type:"number",label:"Columns",help:"How many equal columns, 1 to 12. Up to 6, the grid stacks to one column on phones and steps up on wider screens; 7 or more keep their count on every screen."},{name:"gap",type:"number",label:"Gap",help:"Space between cells, across and down: 0 (none) to 6 (2rem). 3 is 0.75rem, 4 is 1rem."},{name:"responsive",type:"select",label:"Responsive stacking",options:[["","On (default)"],["false","Off"]],help:"Off keeps exactly the number of columns on every screen, phones included. Use it for small things that fit side by side anywhere, such as icons or figures."},{name:"fullwidth",type:"checkbox",label:"Break out full-width",help:"The grid leaves the page's text column and runs the width of the window."},{name:"class",type:"text",label:"CSS class",help:"Extra CSS classes on the grid itself, separated by spaces."},{name:"id",type:"text",label:"ID",help:"A name for links (#name) and your own CSS or scripts. One per page."}]},{name:"row",label:"Row",icon:"layout",category:"Layout",selfClosing:!1,container:!0,wrappable:!1,template:`[row gap="3"]
14
+ [/grid]`,children:{name:"col",min:2,max:6},attrs:[{name:"vertical-align",type:"select",label:"Vertical alignment",options:[["","Default"],["top","Top"],["middle","Middle"],["bottom","Bottom"]],help:"Position shorter cells or cards at the top, middle or bottom of each grid row. Default keeps the current stretching behaviour."},{name:"cols",type:"number",label:"Columns",help:"How many equal columns, 1 to 12. Up to 6, the grid stacks to one column on phones and steps up on wider screens; 7 or more keep their count on every screen."},{name:"gap",type:"number",label:"Gap",help:"Space between cells, across and down: 0 (none) to 6 (2rem). 3 is 0.75rem, 4 is 1rem."},{name:"responsive",type:"select",label:"Responsive stacking",options:[["","On (default)"],["false","Off"]],help:"Off keeps exactly the number of columns on every screen, phones included. Use it for small things that fit side by side anywhere, such as icons or figures."},{name:"fullwidth",type:"checkbox",label:"Break out full-width",help:"The grid leaves the page's text column and runs the width of the window."},{name:"class",type:"text",label:"CSS class",help:"Extra CSS classes on the grid itself, separated by spaces."},{name:"id",type:"text",label:"ID",help:"A name for links (#name) and your own CSS or scripts. One per page."}]},{name:"row",label:"Row",icon:"layout",category:"Layout",selfClosing:!1,container:!0,wrappable:!1,template:`[row gap="3"]
13
15
  [col]
14
16
  Left
15
17
  [/col]
16
18
  [col]
17
19
  Right
18
20
  [/col]
19
- [/row]`,children:{name:"col",min:2,max:6},attrs:[{name:"gap",type:"number",label:"Gap",help:"Space between columns: 0 (none) to 6 (2rem). 3 is 0.75rem, 4 is 1rem."},{name:"class",type:"text",label:"CSS class",help:"Extra CSS classes on the row itself, separated by spaces."},{name:"id",type:"text",label:"ID",help:"A name for links (#name) and your own CSS or scripts. One per page."},{name:"reveal",type:"checkbox",label:"Scroll reveal",help:"The columns appear as the row scrolls into view. The settings below shape it and do nothing without this."},{name:"reveal-mode",type:"select",label:"Reveal mode",options:[["stagger","Stagger"],["sequence","Sequence"]],help:"Stagger brings the columns in one after another. Sequence shows each as soon as it is in view, with no wait between them."},{name:"reveal-animation",type:"select",label:"Reveal animation",help:"How each column arrives. Slide up when empty. The swooshes are left out for visitors who ask for reduced motion.",options:[["slide-up","Slide up"],["slide-down","Slide down"],["slide-left","Slide left"],["slide-right","Slide right"],["fade","Fade"],["zoom","Zoom"],["flip","Flip"],["swoosh","Swoosh"],["swoosh-sides","Swoosh from the sides"]]},{name:"reveal-duration",type:"number",label:"Reveal duration (ms)",help:"How long each column takes to arrive, in milliseconds. Empty: 400 (700 for a swoosh)."},{name:"reveal-stagger",type:"number",label:"Reveal stagger (ms)",help:"The wait between one column and the next, in milliseconds. Empty: 60 (90 for a swoosh). Stagger mode only."},{name:"reveal-delay",type:"number",label:"Reveal delay (ms)",help:"A pause before the first column starts, in milliseconds. Empty: none."},{name:"reveal-direction",type:"select",label:"Reveal direction",options:[["ltr","Left to right"],["rtl","Right to left"]],help:"Which end starts in Stagger mode: the first column, or the last."},{name:"reveal-replay",type:"checkbox",label:"Reveal again each time it scrolls back into view",help:"Off, the row reveals once. On, it hides again when it drops below the window and reveals on the way back."},{name:"tilt",type:"checkbox",label:"Cards lean toward the pointer",help:"Each column lifts and leans toward the pointer while it is over it, and settles flat after. Meant for a row of cards."}]},{name:"col",label:"Column",icon:"columns",category:"Layout",child:!0,selfClosing:!1,container:!0,wrappable:!0,template:`[col]
21
+ [/row]`,children:{name:"col",min:2,max:6},attrs:[{name:"vertical-align",type:"select",label:"Vertical alignment",options:[["","Default"],["top","Top"],["middle","Middle"],["bottom","Bottom"]],help:"Position shorter columns or cards at the top, middle or bottom of the row. Default keeps the current stretching behaviour."},{name:"gap",type:"number",label:"Gap",help:"Space between columns: 0 (none) to 6 (2rem). 3 is 0.75rem, 4 is 1rem."},{name:"class",type:"text",label:"CSS class",help:"Extra CSS classes on the row itself, separated by spaces."},{name:"id",type:"text",label:"ID",help:"A name for links (#name) and your own CSS or scripts. One per page."},{name:"reveal",type:"checkbox",label:"Scroll reveal",help:"The columns appear as the row scrolls into view. The settings below shape it and do nothing without this."},{name:"reveal-mode",type:"select",label:"Reveal mode",options:[["stagger","Stagger"],["sequence","Sequence"]],help:"Stagger brings the columns in one after another. Sequence shows each as soon as it is in view, with no wait between them."},{name:"reveal-animation",type:"select",label:"Reveal animation",help:"How each column arrives. Slide up when empty. The swooshes are left out for visitors who ask for reduced motion.",options:[["slide-up","Slide up"],["slide-down","Slide down"],["slide-left","Slide left"],["slide-right","Slide right"],["fade","Fade"],["zoom","Zoom"],["flip","Flip"],["swoosh","Swoosh"],["swoosh-sides","Swoosh from the sides"]]},{name:"reveal-duration",type:"number",label:"Reveal duration (ms)",help:"How long each column takes to arrive, in milliseconds. Empty: 400 (700 for a swoosh)."},{name:"reveal-stagger",type:"number",label:"Reveal stagger (ms)",help:"The wait between one column and the next, in milliseconds. Empty: 60 (90 for a swoosh). Stagger mode only."},{name:"reveal-delay",type:"number",label:"Reveal delay (ms)",help:"A pause before the first column starts, in milliseconds. Empty: none."},{name:"reveal-direction",type:"select",label:"Reveal direction",options:[["ltr","Left to right"],["rtl","Right to left"]],help:"Which end starts in Stagger mode: the first column, or the last."},{name:"reveal-replay",type:"checkbox",label:"Reveal again each time it scrolls back into view",help:"Off, the row reveals once. On, it hides again when it drops below the window and reveals on the way back."},{name:"tilt",type:"checkbox",label:"Cards lean toward the pointer",help:"Each column lifts and leans toward the pointer while it is over it, and settles flat after. Meant for a row of cards."}]},{name:"col",label:"Column",icon:"columns",category:"Layout",child:!0,selfClosing:!1,container:!0,wrappable:!0,template:`[col]
20
22
  Content
21
- [/col]`,attrs:[{name:"span",type:"number",label:"Span",help:"How many of the grid's columns this cell takes: 8 of 12 is two thirds. Empty: one. Only works in a [grid]; a [row] shares its width equally."},{name:"align",type:"select",label:"Content alignment",options:[["","Inherit"],["left","Left"],["center","Centre"],["centre","Centre (alias)"],["right","Right"]],help:"Lines up the text and inline content in this column. Inherit leaves it as the page has it."},{name:"id",type:"text",label:"ID",help:"A name for links (#name) and your own CSS or scripts. One per page."}]},{name:"slideover",label:"Slideover",icon:"panel-right",category:"Layout",selfClosing:!1,container:!0,wrappable:!0,template:`[slideover title="More information" trigger="Read more"]
23
+ [/col]`,attrs:[{name:"vertical-align",type:"select",label:"Vertical alignment",options:[["","Default"],["top","Top"],["middle","Middle"],["bottom","Bottom"]],help:"Position the content inside this column. Visible when the column has spare height, such as beside a taller column."},{name:"span",type:"number",label:"Span",help:"How many of the grid's columns this cell takes: 8 of 12 is two thirds. Empty: one. Only works in a [grid]; a [row] shares its width equally."},{name:"align",type:"select",label:"Content alignment",options:[["","Inherit"],["left","Left"],["center","Centre"],["centre","Centre (alias)"],["right","Right"]],help:"Lines up the text and inline content in this column. Inherit leaves it as the page has it."},{name:"id",type:"text",label:"ID",help:"A name for links (#name) and your own CSS or scripts. One per page."}]},{name:"slideover",label:"Slideover",icon:"panel-right",category:"Layout",selfClosing:!1,container:!0,wrappable:!0,template:`[slideover title="More information" trigger="Read more"]
22
24
  Content
23
25
  [/slideover]`,attrs:[{name:"title",type:"text",label:"Title",domma:"slideover.title"},{name:"trigger",type:"text",label:"Trigger label"},{name:"size",type:"select",label:"Size",options:[["sm","Small"],["md","Medium"],["lg","Large"],["xl","Extra large"],["full","Full width"]],domma:"slideover.size"},{name:"position",type:"select",label:"Position",options:[["right","Right"],["left","Left"],["bottom","Bottom"],["top","Top"]],domma:"slideover.position"}]},{name:"center",label:"Centre",icon:"text-center",category:"Layout",selfClosing:!1,container:!0,wrappable:!0,template:`[center]
24
26
  Centred content
@@ -41,7 +43,7 @@ Optional body content.
41
43
  | Product | Price |
42
44
  | ------- | ----: |
43
45
  | Widget | $9.99 |
44
- [/table]`,attrs:[{name:"striped",type:"checkbox",label:"Striped"},{name:"bordered",type:"checkbox",label:"Bordered"},{name:"compact",type:"checkbox",label:"Compact"},{name:"caption",type:"text",label:"Caption"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"badge",label:"Badge",icon:"badge",category:"Content",selfClosing:!1,container:!1,wrappable:!1,template:'[badge variant="success"]New[/badge]',inline:!0,attrs:[{name:"variant",type:"select",label:"Variant",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"],["light","Light"],["dark","Dark"]]},{name:"pill",type:"checkbox",label:"Pill"},{name:"outline",type:"checkbox",label:"Outline"},{name:"size",type:"select",label:"Size",options:[["","Default"],["small","Small"],["large","Large"]]}]},{name:"text",label:"Text",icon:"text-style",preview:"text",category:"Content",selfClosing:!1,container:!0,wrappable:!0,template:"[text]Styled text[/text]",inline:!0,actions:[{label:"Highlight - gradient with a shine",icon:"star",set:{gradient:"sunset",shine:"hover"}},{label:"Highlight that sweeps by itself",icon:"star",set:{gradient:"sunset",shine:"sweep"}},{label:"Light up as you read",icon:"eye",set:{"light-up":"true"}},{label:"Rise in word by word",icon:"arrow-up",set:{words:"true"}},{label:"Plain - no highlight or motion",icon:"minimize",set:{gradient:null,shine:null,"light-up":null,words:null}}],quickAttrs:["gradient","shine","align","size","bold","color"],attrs:[{name:"size",type:"select",label:"Size",options:[["xs","XS"],["sm","Small"],["base","Base"],["lg","Large"],["xl","XL"],["2xl","2XL"],["3xl","3XL"],["4xl","4XL"]]},{name:"weight",type:"select",label:"Weight",options:[["thin","Thin"],["light","Light"],["normal","Normal"],["medium","Medium"],["semibold","Semibold"],["bold","Bold"],["extrabold","Extra bold"],["black","Black"]]},{name:"point-size",type:"number",label:"Point size"},{name:"bold",type:"checkbox",label:"Bold"},{name:"italic",type:"checkbox",label:"Italic"},{name:"color",type:"colour",label:"Colour"},{name:"font",type:"select",label:"Font",options:Object.keys(l).map(e=>[e,n(e)?`${e} (licensed)`:e])},{name:"transform",type:"select",label:"Transform",options:[["upper","Uppercase"],["lower","Lowercase"],["capitalize","Capitalise"],["none","None"]]},{name:"decoration",type:"select",label:"Decoration",options:[["underline","Underline"],["line-through","Line through"],["none","None"]]},{name:"spacing",type:"select",label:"Letter spacing",options:[["tight","Tight"],["normal","Normal"],["wide","Wide"],["wider","Wider"]]},{name:"align",type:"select",label:"Align",options:[["","None"],["left","Left"],["center","Centre"],["right","Right"],["justify","Justify"]]},{name:"gradient",type:"select",label:"Gradient",options:[["","None"],["brand","Theme"],["sunset","Sunset"],["ocean","Ocean"],["forest","Forest"],["fire","Fire"],["candy","Candy"],["newspaper","Newspaper"],["grey-fire","Grey-fire"],["ice","Ice"],["summer","Summer"],["autumn","Autumn"],["spring","Spring"],["winter","Winter"],["aurora","Aurora"],["twilight","Twilight"],["rose-gold","Rose-gold"],["copper","Copper"],["amethyst","Amethyst"],["lagoon","Lagoon"],["cherry","Cherry"],["lavender","Lavender"],["midnight","Midnight"]]},{name:"shine",type:"select",label:"Shine (gradient)",options:[["","None"],["hover","Follows the pointer"],["sweep","Sweeps across"]]},{name:"light-up",type:"checkbox",label:"Words light up as you scroll"},{name:"words",type:"checkbox",label:"Rise in word by word"},{name:"style",type:"text",label:"Inline CSS"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"button",label:"Button",icon:"btn-insert",category:"Content",selfClosing:!0,container:!1,wrappable:!1,template:'[button href="/contact" variant="primary" label="Get in touch" /]',attrs:[{name:"href",type:"url",label:"Link"},{name:"label",type:"text",label:"Label"},{name:"variant",type:"select",label:"Variant",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"],["outline","Outline"],["ghost","Ghost"],["link","Link"],["outline-success","Outline success"],["outline-danger","Outline danger"],["outline-warning","Outline warning"],["outline-info","Outline info"]]},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"icon",type:"icon",label:"Icon (before)"},{name:"icon-after",type:"icon",label:"Icon (after)"},{name:"target",type:"text",label:"Target"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"link",label:"Link",icon:"link-shortcode",category:"Content",selfClosing:!0,container:!1,wrappable:!1,template:'[link href="/about" label="About us" /]',formats:[{value:"markdown",label:"Markdown link",emit:e=>Object.keys(e).some(t=>t!=="href"&&t!=="label"&&e[t])||!e.href?null:`[${e.label||e.href}](${e.href})`},{value:"shortcode",label:"Link shortcode"}],attrs:[{name:"href",type:"url",label:"Link"},{name:"label",type:"text",label:"Label"},{name:"target",type:"text",label:"Target"},{name:"class",type:"text",label:"CSS class"},{name:"icon",type:"icon",label:"Icon (before)"},{name:"icon-after",type:"icon",label:"Icon (after)"},{name:"id",type:"text",label:"ID"}]},{name:"listgroup",label:"List group",icon:"list",category:"Content",selfClosing:!1,container:!0,wrappable:!1,template:`[listgroup]
46
+ [/table]`,attrs:[{name:"striped",type:"checkbox",label:"Striped"},{name:"bordered",type:"checkbox",label:"Bordered"},{name:"compact",type:"checkbox",label:"Compact"},{name:"caption",type:"text",label:"Caption"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"badge",label:"Badge",icon:"badge",category:"Content",selfClosing:!1,container:!1,wrappable:!1,template:'[badge variant="success"]New[/badge]',inline:!0,attrs:[{name:"variant",type:"select",label:"Variant",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"],["light","Light"],["dark","Dark"]]},{name:"pill",type:"checkbox",label:"Pill"},{name:"outline",type:"checkbox",label:"Outline"},{name:"size",type:"select",label:"Size",options:[["","Default"],["small","Small"],["large","Large"]]}]},{name:"text",label:"Text",icon:"text-style",preview:"text",category:"Content",selfClosing:!1,container:!0,wrappable:!0,template:"[text]Styled text[/text]",inline:!0,actions:[{label:"Highlight - gradient with a shine",icon:"star",set:{gradient:"sunset",shine:"hover"}},{label:"Highlight that sweeps by itself",icon:"star",set:{gradient:"sunset",shine:"sweep"}},{label:"Light up as you read",icon:"eye",set:{"light-up":"true"}},{label:"Rise in word by word",icon:"arrow-up",set:{words:"true"}},{label:"Plain - no highlight or motion",icon:"minimize",set:{gradient:null,shine:null,"light-up":null,words:null}}],quickAttrs:["gradient","shine","align","size","bold","color"],attrs:[{name:"size",type:"select",label:"Size",options:[["xs","XS"],["sm","Small"],["base","Base"],["lg","Large"],["xl","XL"],["2xl","2XL"],["3xl","3XL"],["4xl","4XL"]]},{name:"weight",type:"select",label:"Weight",options:[["thin","Thin"],["light","Light"],["normal","Normal"],["medium","Medium"],["semibold","Semibold"],["bold","Bold"],["extrabold","Extra bold"],["black","Black"]]},{name:"point-size",type:"number",label:"Point size"},{name:"bold",type:"checkbox",label:"Bold"},{name:"italic",type:"checkbox",label:"Italic"},{name:"color",type:"colour",label:"Colour"},{name:"font",type:"select",label:"Font",options:Object.keys(n).map(e=>[e,o(e)?`${e} (licensed)`:e])},{name:"transform",type:"select",label:"Transform",options:[["upper","Uppercase"],["lower","Lowercase"],["capitalize","Capitalise"],["none","None"]]},{name:"decoration",type:"select",label:"Decoration",options:[["underline","Underline"],["line-through","Line through"],["none","None"]]},{name:"spacing",type:"select",label:"Letter spacing",options:[["tight","Tight"],["normal","Normal"],["wide","Wide"],["wider","Wider"]]},{name:"align",type:"select",label:"Align",options:[["","None"],["left","Left"],["center","Centre"],["right","Right"],["justify","Justify"]]},{name:"gradient",type:"select",label:"Gradient",options:[["","None"],["brand","Theme"],["sunset","Sunset"],["ocean","Ocean"],["forest","Forest"],["fire","Fire"],["candy","Candy"],["newspaper","Newspaper"],["grey-fire","Grey-fire"],["ice","Ice"],["summer","Summer"],["autumn","Autumn"],["spring","Spring"],["winter","Winter"],["aurora","Aurora"],["twilight","Twilight"],["rose-gold","Rose-gold"],["copper","Copper"],["amethyst","Amethyst"],["lagoon","Lagoon"],["cherry","Cherry"],["lavender","Lavender"],["midnight","Midnight"]]},{name:"shine",type:"select",label:"Shine (gradient)",options:[["","None"],["hover","Follows the pointer"],["sweep","Sweeps across"]]},{name:"light-up",type:"checkbox",label:"Words light up as you scroll"},{name:"words",type:"checkbox",label:"Rise in word by word"},{name:"style",type:"text",label:"Inline CSS"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"button",label:"Button",icon:"btn-insert",category:"Content",selfClosing:!0,container:!1,wrappable:!1,template:'[button href="/contact" variant="primary" label="Get in touch" /]',attrs:[{name:"href",type:"url",label:"Link"},{name:"label",type:"text",label:"Label"},{name:"variant",type:"select",label:"Variant",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"],["outline","Outline"],["ghost","Ghost"],["link","Link"],["outline-success","Outline success"],["outline-danger","Outline danger"],["outline-warning","Outline warning"],["outline-info","Outline info"]]},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"icon",type:"icon",label:"Icon (before)"},{name:"icon-after",type:"icon",label:"Icon (after)"},{name:"target",type:"text",label:"Target"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"link",label:"Link",icon:"link-shortcode",category:"Content",selfClosing:!0,container:!1,wrappable:!1,template:'[link href="/about" label="About us" /]',formats:[{value:"markdown",label:"Markdown link",emit:e=>Object.keys(e).some(t=>t!=="href"&&t!=="label"&&e[t])||!e.href?null:`[${e.label||e.href}](${e.href})`},{value:"shortcode",label:"Link shortcode"}],attrs:[{name:"href",type:"url",label:"Link"},{name:"label",type:"text",label:"Label"},{name:"target",type:"text",label:"Target"},{name:"class",type:"text",label:"CSS class"},{name:"icon",type:"icon",label:"Icon (before)"},{name:"icon-after",type:"icon",label:"Icon (after)"},{name:"id",type:"text",label:"ID"}]},{name:"listgroup",label:"List group",icon:"list",category:"Content",selfClosing:!1,container:!0,wrappable:!1,template:`[listgroup]
45
47
  [item]First item[/item]
46
48
  [item]Second item[/item]
47
- [/listgroup]`,children:{name:"item",min:1,max:20},attrs:[{name:"variant",type:"select",label:"Variant",options:[["","Default"],["flush","Flush"],["numbered","Numbered"],["horizontal","Horizontal"]]},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"itemvariant",type:"select",label:"Item variant",options:[["","Default"],["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"action",type:"checkbox",label:"Actionable items"}]},{name:"collection",label:"Collection",icon:"database",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[collection slug="enquiries" display="table" /]',attrs:[{name:"slug",type:"lookup",source:"collections",label:"Collection"},{name:"display",type:"select",label:"Display",options:[["table","Table"],["cards","Cards"],["list","List"],["accordion","Accordion"],["timeline","Timeline"],["carousel","Carousel"],["block","Block"]]},{name:"fields",type:"text",label:"Fields (comma-separated)"},{name:"limit",type:"number",label:"Limit"},{name:"sort",type:"lookup",source:"collection-fields",label:"Sort field"},{name:"order",type:"select",label:"Order",options:[["desc","Descending"],["asc","Ascending"]]},{name:"title-field",type:"lookup",source:"collection-fields",label:"Title field"},{name:"image-field",type:"lookup",source:"collection-fields",label:"Image field"},{name:"body-field",type:"lookup",source:"collection-fields",label:"Body field"},{name:"mobile-popup",type:"checkbox",label:"Open carousel cards in a popup on mobile"},{name:"arrow-position",type:"select",label:"Arrow position",options:[["middle","Middle"],["top","Top"],["bottom","Bottom"]]},{name:"background",type:"colour",label:"Carousel background"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"autoplay",type:"checkbox",label:"Autoplay",domma:"carousel.autoplay"},{name:"interval",type:"number",label:"Interval (ms)",domma:"carousel.interval"},{name:"loop",type:"checkbox",label:"Loop",default:!0,domma:"carousel.loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]],domma:"carousel.animation"},{name:"animation-duration",type:"number",label:"Animation duration (ms)",domma:"carousel.animationDuration"},{name:"animation-easing",type:"text",label:"Animation easing",domma:"carousel.animationEasing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]],domma:"carousel.heightMode"},{name:"height",type:"number",label:"Fixed height (px, optional)",domma:"carousel.height"},{name:"columns",type:"number",label:"Card columns"},{name:"search",type:"checkbox",label:"Search (table)",default:!0},{name:"sortable",type:"checkbox",label:"Sortable (table)",default:!0},{name:"exportable",type:"checkbox",label:"CSV export"},{name:"page-size",type:"number",label:"Page size"},{name:"empty",type:"text",label:"Empty message"},{name:"scope",type:"select",label:"Scope",options:[["","All"],["mine","Current user"]]},{name:"cta",type:"lookup",source:"actions",label:"CTA action"},{name:"cta-label",type:"text",label:"CTA label"},{name:"cta-icon",type:"icon",label:"CTA icon"},{name:"cta-style",type:"select",label:"CTA style",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"cta-confirm",type:"text",label:"CTA confirm text"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"view",label:"View",icon:"eye",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[view slug="products" display="table" limit="50" /]',attrs:[{name:"slug",type:"lookup",source:"views",label:"View"},{name:"display",type:"select",label:"Display",options:[["table","Table"],["cards","Cards"],["list","List"],["accordion","Accordion"],["timeline","Timeline"],["carousel","Carousel"],["block","Block"]]},{name:"limit",type:"number",label:"Limit"},{name:"fields",type:"text",label:"Fields (comma-separated)"},{name:"title-field",type:"text",label:"Title field"},{name:"image-field",type:"text",label:"Image field"},{name:"body-field",type:"text",label:"Body field"},{name:"mobile-popup",type:"checkbox",label:"Open carousel cards in a popup on mobile"},{name:"arrow-position",type:"select",label:"Arrow position",options:[["middle","Middle"],["top","Top"],["bottom","Bottom"]]},{name:"background",type:"colour",label:"Carousel background"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"autoplay",type:"checkbox",label:"Autoplay",domma:"carousel.autoplay"},{name:"interval",type:"number",label:"Interval (ms)",domma:"carousel.interval"},{name:"loop",type:"checkbox",label:"Loop",default:!0,domma:"carousel.loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]],domma:"carousel.animation"},{name:"animation-duration",type:"number",label:"Animation duration (ms)",domma:"carousel.animationDuration"},{name:"animation-easing",type:"text",label:"Animation easing",domma:"carousel.animationEasing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]],domma:"carousel.heightMode"},{name:"height",type:"number",label:"Fixed height (px, optional)",domma:"carousel.height"},{name:"columns",type:"number",label:"Card columns"},{name:"empty",type:"text",label:"Empty message"}]},{name:"block",label:"Block",icon:"layout",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[block template="post-card" title="My Post" /]',attrs:[{name:"template",type:"lookup",source:"blocks",label:"Template"}]},{name:"form",label:"Form",icon:"file-text",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[form name="contact" /]',attrs:[{name:"name",type:"lookup",source:"forms",label:"Form"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"cta",label:"CTA",icon:"mouse-pointer",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[cta action="send-welcome" entry="abc123" style="primary" label="Send" /]',attrs:[{name:"action",type:"lookup",source:"actions",label:"Action"},{name:"entry",type:"text",label:"Entry ID"},{name:"style",type:"select",label:"Style",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"icon",type:"icon",label:"Icon"},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"confirm",type:"text",label:"Confirm text"},{name:"label",type:"text",label:"Label"}]},{name:"menu",label:"Menu",icon:"menu",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[menu slug="legal" /]',attrs:[{name:"slug",type:"lookup",source:"menus",label:"Menu"},{name:"location",type:"lookup",source:"menu-locations",label:"Location slot"},{name:"variant",type:"text",label:"Variant"},{name:"class",type:"text",label:"CSS class"},{name:"depth",type:"number",label:"Max depth"},{name:"orientation",type:"select",label:"Orientation",options:[["","Menu default"],["horizontal","Horizontal"],["vertical","Vertical"]]},{name:"float",type:"select",label:"Floating",options:[["","Menu default"],["no","Render inline here"]]}]},{name:"contents",label:"Page contents (this page)",icon:"list",category:"Layout",selfClosing:!0,container:!1,wrappable:!1,template:'[contents numbered="true" /]',actions:[{label:"Number the contents",icon:"hash",set:{numbered:"true"}},{label:"List H2 and H3 headings",icon:"list",set:{headings:"h2h3"}},{label:"Contents on the right",icon:"sidebar-right",set:{side:"right"}},{label:"Collapse the contents to a button",icon:"minimize",set:{collapsible:"true",collapsed:"true"}},{label:"Float the contents",icon:"move",set:{floating:"true","float-anchor":"TR",movable:"true"}},{label:"No contents on this page",icon:"eye-off",set:{hidden:"true"}},{label:"Remove this override",icon:"trash",remove:!0}],quickAttrs:["side","headings","numbered","title","collapsible","floating","hidden"],attrs:[{name:"side",type:"select",label:"Side",options:[["","Layout default"],["left","Left"],["right","Right"]]},{name:"width",type:"number",label:"Width (px, 160-480)"},{name:"headings",type:"select",label:"Headings",options:[["","Layout default"],["auto","Sections (H2s, else H3s)"],["h2","H2 only"],["h3","H3 only"],["h2h3","H2 and H3"]]},{name:"numbered",type:"select",label:"Numbered",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"title",type:"text",label:"Title above the list"},{name:"exclude",type:"text",label:"Leave out (headings, comma separated)"},{name:"sticky",type:"select",label:"Stays in view",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"scroll-spy",type:"select",label:"Marks the section being read",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"collapsible",type:"select",label:"Collapsible to a button",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"collapsed",type:"select",label:"Start collapsed",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"autohide",type:"select",label:"Autohide off its edge",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"floating",type:"select",label:"Floating panel",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"float-anchor",type:"select",label:"Float anchor",options:[["","Layout default"],["TL","Top left"],["TR","Top right"],["BL","Bottom left"],["BR","Bottom right"],["L","Left"],["R","Right"]]},{name:"movable",type:"select",label:"Visitors can move it",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"hidden",type:"select",label:"No contents on this page",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"hover",type:"text",label:"Hover effect"},{name:"selected",type:"text",label:"When selected"},{name:"accent",type:"colour",label:"Accent"},{name:"font",type:"text",label:"Font family"},{name:"font-size",type:"text",label:"Font size"},{name:"font-weight",type:"text",label:"Font weight"}]},{name:"navbar",label:"Navbar settings (this page)",icon:"sliders",category:"Layout",selfClosing:!0,container:!1,wrappable:!1,template:'[navbar collapsed="true" /]',actions:[{label:"Collapse the rail on this page",icon:"chevrons-right",set:{collapsible:"true",collapsed:"true",autohide:"false"}},{label:"Autohide the rail on this page",icon:"eye-off",set:{autohide:"true",collapsed:null}},{label:"Keep the rail open on this page",icon:"eye",set:{autohide:"false",collapsed:"false"}},{label:"Hide the bar on scroll on this page",icon:"arrow-up",set:{"hide-on-scroll":"true"}},{label:"Remove this override",icon:"trash",remove:!0}],quickAttrs:["position","width","collapsible","collapsed","autohide","hide-on-scroll"],attrs:[{name:"position",type:"select",label:"Position",options:[["","Menu default"],["sticky","Sticky"],["fixed","Fixed"],["static","Static"],["floating","Floating"]]},{name:"orientation",type:"select",label:"Orientation",options:[["","Menu default"],["horizontal","Horizontal"],["vertical","Vertical"]]},{name:"side",type:"select",label:"Rail side",options:[["","Menu default"],["left","Left"],["right","Right"]]},{name:"align",type:"select",label:"Alignment",options:[["","Menu default"],["left","Left"],["centre","Centre"],["right","Right"],["spread","Spread"]]},{name:"width",type:"number",label:"Rail width (px, 160-480)"},{name:"collapsible",type:"select",label:"Collapsible to icons",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"collapsed",type:"select",label:"Start collapsed",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"autohide",type:"select",label:"Autohide off-screen",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hide-on-scroll",type:"select",label:"Hide on scroll (bar)",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hover-open",type:"select",label:"Open dropdowns on hover",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"bar",type:"select",label:"Bar shape",options:[["","Menu default"],["pill","Pill"],["segmented","Segmented"],["underline","Underline glide"],["dock","Dock"],["neon","Neon"],["tabs","Tabs"],["tiles","Tiles"],["bubbles","Bubbles"],["brutalist","Brutalist"],["gradient","Gradient band"]]},{name:"shrink",type:"select",label:"Shrink on scroll",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"icons",type:"select",label:"Bar icons",options:[["","Menu default"],["rainbow","Rainbow"],["accent","Accent"]]},{name:"brand",type:"select",label:"Branding shape",options:[["","Menu default"],["pill","Pill"]]},{name:"strip",type:"select",label:"Bar background",options:[["","Menu default"],["none","None - floating pills"],["band","Strip - keep the band"]]},{name:"dropdown",type:"select",label:"Dropdown style",options:[["","Menu default"],["cards","Cards"]]},{name:"tiles",type:"select",label:"Icon tiles (cards)",options:[["","Menu default"],["rainbow","Rainbow"],["accent","Theme colour"],["neutral","Neutral"],["none","No tiles"]]},{name:"morph",type:"select",label:"Slide between cards",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hover",type:"text",label:"Hover effect"},{name:"selected",type:"text",label:"When selected"},{name:"accent",type:"colour",label:"Highlight colour"},{name:"variant",type:"text",label:"Variant"},{name:"font",type:"text",label:"Font family"},{name:"font-size",type:"text",label:"Font size"},{name:"font-weight",type:"text",label:"Font weight"},{name:"letter-spacing",type:"text",label:"Letter spacing"},{name:"icon-size",type:"text",label:"Icon size"},{name:"float-anchor",type:"select",label:"Float anchor",options:[["","Menu default"],["TL","Top left"],["TR","Top right"],["BL","Bottom left"],["BR","Bottom right"],["L","Left"],["R","Right"]]},{name:"float-x",type:"number",label:"Float offset X (px)"},{name:"float-y",type:"number",label:"Float offset Y (px)"},{name:"float-width",type:"number",label:"Float width (px)"},{name:"float-collapsible",type:"select",label:"Float: collapsible",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"float-movable",type:"select",label:"Float: movable",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"class",type:"text",label:"CSS classes"}]},{name:"theme-switcher",label:"Theme switcher",icon:"palette",category:"Components",selfClosing:!0,container:!1,wrappable:!1,template:"[theme-switcher /]",attrs:[{name:"position",type:"select",label:"Position",options:[["","Inline - where the tag is"],["top-left","Top left"],["top-right","Top right"],["left-center","Left, centred"],["right-center","Right, centred"],["bottom-left","Bottom left"],["bottom-right","Bottom right"]]},{name:"offset-x",type:"number",label:"Offset from the side (px, pinned only)"},{name:"offset-y",type:"number",label:"Offset from the top/bottom (px, pinned only)"},{name:"themes",type:"text",label:"Themes (comma list - blank for the site's)"}]},{name:"icon",label:"Icon",icon:"icon-pick",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[icon name="arrow-right" /]',attrs:[{name:"name",type:"icon",label:"Icon name"},{name:"size",type:"number",label:"Size (px)"},{name:"color",type:"colour",label:"Colour"},{name:"class",type:"text",label:"CSS class"}]},{name:"image",label:"Image",icon:"image-add",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[image src="/media/photo.jpg" alt="" /]',custom:"image",quickAttrs:["zoom","align","width","shadow"],attrs:[{name:"src",type:"image",label:"Image",help:"The picture: choose it from Media, or type a /media/\u2026 path or an https:// address."},{name:"alt",type:"text",label:"Description (alt)",help:"What the picture shows, in a few words. Screen readers and search engines read it. Leave empty only for decoration."},{name:"caption",type:"text",label:"Caption",help:"Shown under the picture, and in the zoom view."},{name:"zoom",type:"checkbox",label:"Click to zoom",help:"Visitors click the picture to see it full size in a viewer: fitted first, then actual size with drag to pan. Best for screenshots with small text. Ignored when the picture has a link."},{name:"width",type:"text",label:"Width (480, 60%, 30rem)",help:"How wide the picture shows. A bare number is pixels. Empty: its own size, never wider than the column."},{name:"align",type:"select",label:"Alignment",options:[["","Default (left)"],["center","Centre"],["right","Right"],["float-left","Float left (text wraps)"],["float-right","Float right (text wraps)"]],help:"Floats let the text run beside the picture; on phones they stack."},{name:"group",type:"text",label:"Zoom group",help:"Give zoomable pictures the same group name and the viewer steps between them with arrows - a gallery or a tour."},{name:"zoom-src",type:"image",label:"Full-size file (zoom)",help:"Optional: a larger file for the zoom view, when the page shows a smaller copy."},{name:"title",type:"text",label:"Hover text (title)"},{name:"max-width",type:"text",label:"Max width (800, 50%)"},{name:"height",type:"text",label:"Height (240, 20rem)",help:"A set height crops the picture to fill the box (see Fit)."},{name:"fit",type:"select",label:"Fit (with a height)",options:[["","Fill and crop (default)"],["contain","Show it all"],["fill","Stretch"],["none","Actual size"],["scale-down","Shrink only"]]},{name:"radius",type:"select",label:"Corners",options:[["","Square"],["sm","Slightly rounded"],["md","Rounded"],["lg","Very rounded"],["full","Circle / pill"]]},{name:"border",type:"checkbox",label:"Border"},{name:"shadow",type:"select",label:"Shadow",options:[["","None"],["sm","Small"],["md","Medium"],["lg","Large"]]},{name:"link",type:"url",label:"Link to",help:"Clicking the picture goes here instead of zooming."},{name:"target",type:"select",label:"Open link in",options:[["","Same tab"],["_blank","New tab"]]},{name:"loading",type:"select",label:"Loading",options:[["","When scrolled near (lazy)"],["eager","Straight away (top of page)"]]},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"map",label:"Map",icon:"map-pin",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[map address="10 Downing Street, London" zoom="15" /]',attrs:[{name:"pin",type:"text",label:"Pin (latitude, longitude)"},{name:"lat",type:"number",label:"Latitude"},{name:"lon",type:"number",label:"Longitude"},{name:"address",type:"text",label:"Address"},{name:"postcode",type:"text",label:"Postcode"},{name:"zoom",type:"number",label:"Zoom (1-20)"},{name:"title",type:"text",label:"Title"},{name:"caption",type:"text",label:"Caption"},{name:"ratio",type:"select",label:"Aspect ratio",options:[["16:9","16:9"],["4:3","4:3"],["1:1","1:1"],["21:9","21:9"]]},{name:"width",type:"text",label:"Width"},{name:"align",type:"select",label:"Alignment",options:[["left","Left"],["center","Centre"],["right","Right"]]}]},{name:"embed",label:"Embed",icon:"video",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[embed url="https://youtu.be/dQw4w9WgXcQ" /]',custom:"embed",attrs:[{name:"url",type:"url",label:"URL"},{name:"ratio",type:"select",label:"Aspect ratio",options:[["16:9","16:9"],["4:3","4:3"],["1:1","1:1"],["21:9","21:9"],["9:16","9:16"],["3:4","3:4"]]},{name:"title",type:"text",label:"Title / caption"},{name:"width",type:"text",label:"Width"},{name:"align",type:"select",label:"Alignment",options:[["left","Left"],["center","Centre"],["right","Right"]]},{name:"autoplay",type:"checkbox",label:"Autoplay"},{name:"loop",type:"checkbox",label:"Loop"},{name:"muted",type:"checkbox",label:"Muted"}]}];for(const e of SHORTCODES){e.attrs||(e.attrs=[]);for(const a of o)e.attrs.some(t=>t.name===a.name)||e.attrs.push(a)}export const EDITOR_TOOLS=[{name:"colourpick",label:"Colour picker",icon:"colour-picker",category:"Media",custom:"colourpick"},{name:"component",label:"Component",icon:"component",category:"Components",custom:"component"},{name:"scribe",label:"Scribe",icon:"scribe-insert",category:"Content",custom:"scribe"},{name:"highlight-text",label:"Highlight text",icon:"star",category:"Content",custom:"highlighttext",wrappable:!0}];
49
+ [/listgroup]`,children:{name:"item",min:1,max:20},attrs:[{name:"variant",type:"select",label:"Variant",options:[["","Default"],["flush","Flush"],["numbered","Numbered"],["horizontal","Horizontal"]]},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"itemvariant",type:"select",label:"Item variant",options:[["","Default"],["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"action",type:"checkbox",label:"Actionable items"}]},{name:"collection",label:"Collection",icon:"database",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[collection slug="enquiries" display="table" /]',attrs:[{name:"slug",type:"lookup",source:"collections",label:"Collection"},{name:"display",type:"select",label:"Display",options:[["table","Table"],["cards","Cards"],["list","List"],["accordion","Accordion"],["timeline","Timeline"],["carousel","Carousel"],["block","Block"]]},{name:"fields",type:"text",label:"Fields (comma-separated)"},{name:"limit",type:"number",label:"Limit"},{name:"sort",type:"lookup",source:"collection-fields",label:"Sort field"},{name:"order",type:"select",label:"Order",options:[["desc","Descending"],["asc","Ascending"]]},{name:"title-field",type:"lookup",source:"collection-fields",label:"Title field"},{name:"image-field",type:"lookup",source:"collection-fields",label:"Image field"},{name:"body-field",type:"lookup",source:"collection-fields",label:"Body field"},{name:"mobile-popup",type:"checkbox",label:"Open carousel cards in a popup on mobile"},{name:"arrow-position",type:"select",label:"Arrow position",options:[["middle","Middle"],["top","Top"],["bottom","Bottom"]]},{name:"background",type:"colour",label:"Carousel background"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"autoplay",type:"checkbox",label:"Autoplay",domma:"carousel.autoplay"},{name:"interval",type:"number",label:"Interval (ms)",domma:"carousel.interval"},{name:"loop",type:"checkbox",label:"Loop",default:!0,domma:"carousel.loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]],domma:"carousel.animation"},{name:"animation-duration",type:"number",label:"Animation duration (ms)",domma:"carousel.animationDuration"},{name:"animation-easing",type:"text",label:"Animation easing",domma:"carousel.animationEasing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]],domma:"carousel.heightMode"},{name:"height",type:"number",label:"Fixed height (px, optional)",domma:"carousel.height"},{name:"columns",type:"number",label:"Card columns"},{name:"search",type:"checkbox",label:"Search (table)",default:!0},{name:"sortable",type:"checkbox",label:"Sortable (table)",default:!0},{name:"exportable",type:"checkbox",label:"CSV export"},{name:"page-size",type:"number",label:"Page size"},{name:"empty",type:"text",label:"Empty message"},{name:"scope",type:"select",label:"Scope",options:[["","All"],["mine","Current user"]]},{name:"cta",type:"lookup",source:"actions",label:"CTA action"},{name:"cta-label",type:"text",label:"CTA label"},{name:"cta-icon",type:"icon",label:"CTA icon"},{name:"cta-style",type:"select",label:"CTA style",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"cta-confirm",type:"text",label:"CTA confirm text"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"view",label:"View",icon:"eye",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[view slug="products" display="table" limit="50" /]',attrs:[{name:"slug",type:"lookup",source:"views",label:"View"},{name:"display",type:"select",label:"Display",options:[["table","Table"],["cards","Cards"],["list","List"],["accordion","Accordion"],["timeline","Timeline"],["carousel","Carousel"],["block","Block"]]},{name:"limit",type:"number",label:"Limit"},{name:"fields",type:"text",label:"Fields (comma-separated)"},{name:"title-field",type:"text",label:"Title field"},{name:"image-field",type:"text",label:"Image field"},{name:"body-field",type:"text",label:"Body field"},{name:"mobile-popup",type:"checkbox",label:"Open carousel cards in a popup on mobile"},{name:"arrow-position",type:"select",label:"Arrow position",options:[["middle","Middle"],["top","Top"],["bottom","Bottom"]]},{name:"background",type:"colour",label:"Carousel background"},{name:"arrow-background",type:"colour",label:"Arrow background"},{name:"arrow-color",type:"colour",label:"Arrow colour"},{name:"autoplay",type:"checkbox",label:"Autoplay",domma:"carousel.autoplay"},{name:"interval",type:"number",label:"Interval (ms)",domma:"carousel.interval"},{name:"loop",type:"checkbox",label:"Loop",default:!0,domma:"carousel.loop"},{name:"animation",type:"select",label:"Animation",options:[["slide","Slide"],["fade","Fade"],["crossfade","Crossfade"]],domma:"carousel.animation"},{name:"animation-duration",type:"number",label:"Animation duration (ms)",domma:"carousel.animationDuration"},{name:"animation-easing",type:"text",label:"Animation easing",domma:"carousel.animationEasing"},{name:"height-mode",type:"select",label:"Image height",options:[["crop","Top-aligned crop (shortest image)"],["average","Average of shortest and tallest images"]],domma:"carousel.heightMode"},{name:"height",type:"number",label:"Fixed height (px, optional)",domma:"carousel.height"},{name:"columns",type:"number",label:"Card columns"},{name:"empty",type:"text",label:"Empty message"}]},{name:"block",label:"Block",icon:"layout",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[block template="post-card" title="My Post" /]',attrs:[{name:"template",type:"lookup",source:"blocks",label:"Template"}]},{name:"form",label:"Form",icon:"file-text",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[form name="contact" /]',attrs:[{name:"name",type:"lookup",source:"forms",label:"Form"},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"cta",label:"CTA",icon:"mouse-pointer",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[cta action="send-welcome" entry="abc123" style="primary" label="Send" /]',attrs:[{name:"action",type:"lookup",source:"actions",label:"Action"},{name:"entry",type:"text",label:"Entry ID"},{name:"style",type:"select",label:"Style",options:[["primary","Primary"],["secondary","Secondary"],["success","Success"],["danger","Danger"],["warning","Warning"],["info","Info"]]},{name:"icon",type:"icon",label:"Icon"},{name:"size",type:"select",label:"Size",options:[["","Default"],["sm","Small"],["lg","Large"]]},{name:"confirm",type:"text",label:"Confirm text"},{name:"label",type:"text",label:"Label"}]},{name:"menu",label:"Menu",icon:"menu",category:"Data",selfClosing:!0,container:!1,wrappable:!1,template:'[menu slug="legal" /]',attrs:[{name:"slug",type:"lookup",source:"menus",label:"Menu"},{name:"location",type:"lookup",source:"menu-locations",label:"Location slot"},{name:"variant",type:"text",label:"Variant"},{name:"class",type:"text",label:"CSS class"},{name:"depth",type:"number",label:"Max depth"},{name:"orientation",type:"select",label:"Orientation",options:[["","Menu default"],["horizontal","Horizontal"],["vertical","Vertical"]]},{name:"float",type:"select",label:"Floating",options:[["","Menu default"],["no","Render inline here"]]}]},{name:"contents",label:"Page contents (this page)",icon:"list",category:"Layout",selfClosing:!0,container:!1,wrappable:!1,template:'[contents numbered="true" /]',actions:[{label:"Number the contents",icon:"hash",set:{numbered:"true"}},{label:"List H2 and H3 headings",icon:"list",set:{headings:"h2h3"}},{label:"Contents on the right",icon:"sidebar-right",set:{side:"right"}},{label:"Collapse the contents to a button",icon:"minimize",set:{collapsible:"true",collapsed:"true"}},{label:"Float the contents",icon:"move",set:{floating:"true","float-anchor":"TR",movable:"true"}},{label:"No contents on this page",icon:"eye-off",set:{hidden:"true"}},{label:"Remove this override",icon:"trash",remove:!0}],quickAttrs:["side","headings","numbered","title","collapsible","floating","hidden"],attrs:[{name:"side",type:"select",label:"Side",options:[["","Layout default"],["left","Left"],["right","Right"]]},{name:"width",type:"number",label:"Width (px, 160-480)"},{name:"headings",type:"select",label:"Headings",options:[["","Layout default"],["auto","Sections (H2s, else H3s)"],["h2","H2 only"],["h3","H3 only"],["h2h3","H2 and H3"]]},{name:"numbered",type:"select",label:"Numbered",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"title",type:"text",label:"Title above the list"},{name:"exclude",type:"text",label:"Leave out (headings, comma separated)"},{name:"sticky",type:"select",label:"Stays in view",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"scroll-spy",type:"select",label:"Marks the section being read",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"collapsible",type:"select",label:"Collapsible to a button",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"collapsed",type:"select",label:"Start collapsed",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"autohide",type:"select",label:"Autohide off its edge",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"floating",type:"select",label:"Floating panel",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"float-anchor",type:"select",label:"Float anchor",options:[["","Layout default"],["TL","Top left"],["TR","Top right"],["BL","Bottom left"],["BR","Bottom right"],["L","Left"],["R","Right"]]},{name:"movable",type:"select",label:"Visitors can move it",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"hidden",type:"select",label:"No contents on this page",options:[["","Layout default"],["true","On"],["false","Off"]]},{name:"hover",type:"text",label:"Hover effect"},{name:"selected",type:"text",label:"When selected"},{name:"accent",type:"colour",label:"Accent"},{name:"font",type:"text",label:"Font family"},{name:"font-size",type:"text",label:"Font size"},{name:"font-weight",type:"text",label:"Font weight"}]},{name:"navbar",label:"Navbar settings (this page)",icon:"sliders",category:"Layout",selfClosing:!0,container:!1,wrappable:!1,template:'[navbar collapsed="true" /]',actions:[{label:"Collapse the rail on this page",icon:"chevrons-right",set:{collapsible:"true",collapsed:"true",autohide:"false"}},{label:"Autohide the rail on this page",icon:"eye-off",set:{autohide:"true",collapsed:null}},{label:"Keep the rail open on this page",icon:"eye",set:{autohide:"false",collapsed:"false"}},{label:"Hide the bar on scroll on this page",icon:"arrow-up",set:{"hide-on-scroll":"true"}},{label:"Remove this override",icon:"trash",remove:!0}],quickAttrs:["position","width","collapsible","collapsed","autohide","hide-on-scroll"],attrs:[{name:"position",type:"select",label:"Position",options:[["","Menu default"],["sticky","Sticky"],["fixed","Fixed"],["static","Static"],["floating","Floating"]]},{name:"orientation",type:"select",label:"Orientation",options:[["","Menu default"],["horizontal","Horizontal"],["vertical","Vertical"]]},{name:"side",type:"select",label:"Rail side",options:[["","Menu default"],["left","Left"],["right","Right"]]},{name:"align",type:"select",label:"Alignment",options:[["","Menu default"],["left","Left"],["centre","Centre"],["right","Right"],["spread","Spread"]]},{name:"width",type:"number",label:"Rail width (px, 160-480)"},{name:"collapsible",type:"select",label:"Collapsible to icons",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"collapsed",type:"select",label:"Start collapsed",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"autohide",type:"select",label:"Autohide off-screen",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hide-on-scroll",type:"select",label:"Hide on scroll (bar)",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hover-open",type:"select",label:"Open dropdowns on hover",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"bar",type:"select",label:"Bar shape",options:[["","Menu default"],["pill","Pill"],["segmented","Segmented"],["underline","Underline glide"],["dock","Dock"],["neon","Neon"],["tabs","Tabs"],["tiles","Tiles"],["bubbles","Bubbles"],["brutalist","Brutalist"],["gradient","Gradient band"]]},{name:"shrink",type:"select",label:"Shrink on scroll",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"icons",type:"select",label:"Bar icons",options:[["","Menu default"],["rainbow","Rainbow"],["accent","Accent"]]},{name:"brand",type:"select",label:"Branding shape",options:[["","Menu default"],["pill","Pill"]]},{name:"strip",type:"select",label:"Bar background",options:[["","Menu default"],["none","None - floating pills"],["band","Strip - keep the band"]]},{name:"dropdown",type:"select",label:"Dropdown style",options:[["","Menu default"],["cards","Cards"]]},{name:"tiles",type:"select",label:"Icon tiles (cards)",options:[["","Menu default"],["rainbow","Rainbow"],["accent","Theme colour"],["neutral","Neutral"],["none","No tiles"]]},{name:"morph",type:"select",label:"Slide between cards",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"hover",type:"text",label:"Hover effect"},{name:"selected",type:"text",label:"When selected"},{name:"accent",type:"colour",label:"Highlight colour"},{name:"variant",type:"text",label:"Variant"},{name:"font",type:"text",label:"Font family"},{name:"font-size",type:"text",label:"Font size"},{name:"font-weight",type:"text",label:"Font weight"},{name:"letter-spacing",type:"text",label:"Letter spacing"},{name:"icon-size",type:"text",label:"Icon size"},{name:"float-anchor",type:"select",label:"Float anchor",options:[["","Menu default"],["TL","Top left"],["TR","Top right"],["BL","Bottom left"],["BR","Bottom right"],["L","Left"],["R","Right"]]},{name:"float-x",type:"number",label:"Float offset X (px)"},{name:"float-y",type:"number",label:"Float offset Y (px)"},{name:"float-width",type:"number",label:"Float width (px)"},{name:"float-collapsible",type:"select",label:"Float: collapsible",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"float-movable",type:"select",label:"Float: movable",options:[["","Menu default"],["true","On"],["false","Off"]]},{name:"class",type:"text",label:"CSS classes"}]},{name:"theme-switcher",label:"Theme switcher",icon:"palette",category:"Components",selfClosing:!0,container:!1,wrappable:!1,template:"[theme-switcher /]",attrs:[{name:"position",type:"select",label:"Position",options:[["","Inline - where the tag is"],["top-left","Top left"],["top-right","Top right"],["left-center","Left, centred"],["right-center","Right, centred"],["bottom-left","Bottom left"],["bottom-right","Bottom right"]]},{name:"offset-x",type:"number",label:"Offset from the side (px, pinned only)"},{name:"offset-y",type:"number",label:"Offset from the top/bottom (px, pinned only)"},{name:"themes",type:"text",label:"Themes (comma list - blank for the site's)"}]},{name:"icon",label:"Icon",icon:"icon-pick",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[icon name="arrow-right" /]',attrs:[{name:"name",type:"icon",label:"Icon name"},{name:"size",type:"number",label:"Size (px)"},{name:"color",type:"colour",label:"Colour"},{name:"class",type:"text",label:"CSS class"}]},{name:"image",label:"Image",icon:"image-add",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[image src="/media/photo.jpg" alt="" /]',custom:"image",quickAttrs:["zoom","align","width","shadow"],attrs:[{name:"src",type:"image",label:"Image",help:"The picture: choose it from Media, or type a /media/\u2026 path or an https:// address."},{name:"alt",type:"text",label:"Description (alt)",help:"What the picture shows, in a few words. Screen readers and search engines read it. Leave empty only for decoration."},{name:"caption",type:"text",label:"Caption",help:"Shown under the picture, and in the zoom view."},{name:"zoom",type:"checkbox",label:"Click to zoom",help:"Visitors click the picture to see it full size in a viewer: fitted first, then actual size with drag to pan. Best for screenshots with small text. Ignored when the picture has a link."},{name:"width",type:"text",label:"Width (480, 60%, 30rem)",help:"How wide the picture shows. A bare number is pixels. Empty: its own size, never wider than the column."},{name:"align",type:"select",label:"Alignment",options:[["","Default (left)"],["center","Centre"],["right","Right"],["float-left","Float left (text wraps)"],["float-right","Float right (text wraps)"]],help:"Floats let the text run beside the picture; on phones they stack."},{name:"group",type:"text",label:"Zoom group",help:"Give zoomable pictures the same group name and the viewer steps between them with arrows - a gallery or a tour."},{name:"zoom-src",type:"image",label:"Full-size file (zoom)",help:"Optional: a larger file for the zoom view, when the page shows a smaller copy."},{name:"title",type:"text",label:"Hover text (title)"},{name:"max-width",type:"text",label:"Max width (800, 50%)"},{name:"height",type:"text",label:"Height (240, 20rem)",help:"A set height crops the picture to fill the box (see Fit)."},{name:"fit",type:"select",label:"Fit (with a height)",options:[["","Fill and crop (default)"],["contain","Show it all"],["fill","Stretch"],["none","Actual size"],["scale-down","Shrink only"]]},{name:"radius",type:"select",label:"Corners",options:[["","Square"],["sm","Slightly rounded"],["md","Rounded"],["lg","Very rounded"],["full","Circle / pill"]]},{name:"border",type:"checkbox",label:"Border"},{name:"shadow",type:"select",label:"Shadow",options:[["","None"],["sm","Small"],["md","Medium"],["lg","Large"]]},{name:"link",type:"url",label:"Link to",help:"Clicking the picture goes here instead of zooming."},{name:"target",type:"select",label:"Open link in",options:[["","Same tab"],["_blank","New tab"]]},{name:"loading",type:"select",label:"Loading",options:[["","When scrolled near (lazy)"],["eager","Straight away (top of page)"]]},{name:"class",type:"text",label:"CSS class"},{name:"id",type:"text",label:"ID"}]},{name:"map",label:"Map",icon:"map-pin",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[map address="10 Downing Street, London" zoom="15" /]',attrs:[{name:"pin",type:"text",label:"Pin (latitude, longitude)"},{name:"lat",type:"number",label:"Latitude"},{name:"lon",type:"number",label:"Longitude"},{name:"address",type:"text",label:"Address"},{name:"postcode",type:"text",label:"Postcode"},{name:"zoom",type:"number",label:"Zoom (1-20)"},{name:"title",type:"text",label:"Title"},{name:"caption",type:"text",label:"Caption"},{name:"ratio",type:"select",label:"Aspect ratio",options:[["16:9","16:9"],["4:3","4:3"],["1:1","1:1"],["21:9","21:9"]]},{name:"width",type:"text",label:"Width"},{name:"align",type:"select",label:"Alignment",options:[["left","Left"],["center","Centre"],["right","Right"]]}]},{name:"embed",label:"Embed",icon:"video",category:"Media",selfClosing:!0,container:!1,wrappable:!1,template:'[embed url="https://youtu.be/dQw4w9WgXcQ" /]',custom:"embed",attrs:[{name:"url",type:"url",label:"URL"},{name:"ratio",type:"select",label:"Aspect ratio",options:[["16:9","16:9"],["4:3","4:3"],["1:1","1:1"],["21:9","21:9"],["9:16","9:16"],["3:4","3:4"]]},{name:"title",type:"text",label:"Title / caption"},{name:"width",type:"text",label:"Width"},{name:"align",type:"select",label:"Alignment",options:[["left","Left"],["center","Centre"],["right","Right"]]},{name:"autoplay",type:"checkbox",label:"Autoplay"},{name:"loop",type:"checkbox",label:"Loop"},{name:"muted",type:"checkbox",label:"Muted"}]}];for(const e of SHORTCODES){e.attrs||(e.attrs=[]);for(const a of i)e.attrs.some(t=>t.name===a.name)||e.attrs.push(a)}export const EDITOR_TOOLS=[{name:"colourpick",label:"Colour picker",icon:"colour-picker",category:"Media",custom:"colourpick"},{name:"component",label:"Component",icon:"component",category:"Components",custom:"component"},{name:"scribe",label:"Scribe",icon:"scribe-insert",category:"Content",custom:"scribe"},{name:"highlight-text",label:"Highlight text",icon:"star",category:"Content",custom:"highlighttext",wrappable:!0}];
@@ -1 +1 @@
1
- import{encodeMessageAttribute as p,decodeMessageAttribute as g}from"../../../public/js/celebrations/message-attrs.mjs";import{replaceRange as d}from"./markdown-toolbar.js";export function parseAttrs(n){const e=String(n??""),o={};for(const[,r,c,s]of e.matchAll(/([\w-]+)=(?:"([^"]*)"|'([^']*)')/g))o[r]=r==="message"?g(c??s??""):c??s??"";const f=e.replace(/([\w-]+)=(?:"[^"]*"|'[^']*')/g,r=>" ".repeat(r.length));for(const[,r]of f.matchAll(/\b([\w-]+)\b/g))r in o||(o[r]=!0);return o}export function serialiseTag(n,e,o,{keepEmpty:f=!1}={}){const r=[];for(const[s,t]of Object.entries(e))if(t===!0)r.push(s);else{if(t===!1||t===null||t===void 0||t===""&&!f)continue;r.push(`${s}="${s==="message"?p(t):String(t).replace(/"/g,"&quot;")}"`)}const c=r.length?` ${r.join(" ")}`:"";return o?`[${n}${c} /]`:`[${n}${c}]`}function i(n,e,o,f){const r=n.slice(e,o),c=/\/\s*\]$/.test(r),s=r.match(new RegExp(`^\\[${f}([\\s\\S]*?)\\s*/?\\]$`)),t=s?s[1]:"";return{name:f,openTagStart:e,openTagEnd:o,attrStr:t,attrs:parseAttrs(t),selfClosing:c}}function u(n,e,o){const f=new RegExp(`\\[${o}(?=[\\s\\]/])([^\\]]*)\\]`,"g"),r=new RegExp(`\\[/${o}\\]`,"g"),c=[];for(const l of n.matchAll(f)){if(l.index>=e)break;c.push({type:"open",start:l.index,end:l.index+l[0].length})}for(const l of n.matchAll(r)){if(l.index>=e)break;c.push({type:"close",start:l.index})}c.sort((l,a)=>l.start-a.start);const s=[];for(const l of c)l.type==="open"?s.push(l):s.pop();const t=s.at(-1);return t&&new RegExp(`\\[/${o}\\]`).test(n.slice(e))?{start:t.start,end:t.end}:null}export function findEnclosingShortcode(n,e){const o=n.value,f=n.selectionStart,r=new Map(e.map(t=>[t.name,t]));let c=null;for(const t of o.matchAll(/\[(\/)?([a-zA-Z0-9][\w-]*)((?:[^\]]*?))\]/g)){const l=t.index,a=l+t[0].length;f<l||f>a||f===a&&t[1]||r.has(t[2])&&(c={name:t[2],start:l,end:a,close:!!t[1]})}if(c)if(c.close){const t=u(o,c.start,c.name);if(t)return i(o,t.start,t.end,c.name)}else return i(o,c.start,c.end,c.name);let s=null;for(const t of e){if(t.selfClosing)continue;const l=u(o,f,t.name);l&&(!s||l.start>s.start)&&(s={...l,name:t.name})}return s?i(o,s.start,s.end,s.name):null}export function setAttr(n,e,o,f,r){return setAttrs(n,e,{[o]:f},r)}export function setAttrs(n,e,o,{keepEmpty:f=!1}={}){const r={...e.attrs};for(const[l,a]of Object.entries(o))a===!1||a===null||a===void 0||a===""&&!f?delete r[l]:r[l]=a;const c=serialiseTag(e.name,r,e.selfClosing,{keepEmpty:f}),s=typeof document<"u"?document.activeElement:null;d(n,e.openTagStart,e.openTagEnd,c),s&&s!==n&&typeof s.focus=="function"&&s.focus();const t=e.openTagStart+c.length;return i(n.value,e.openTagStart,t,e.name)}export function effectAttrKeys(n,e){const o=`${e}-`;return Object.keys(n).filter(f=>f===e||f.startsWith(o))}export function boolState(n,e){return n==null?!!e:!(n===!1||n==="false"||n==="0")}export function boolValue(n,e){return e===!!n.default?null:e?"true":"false"}
1
+ import{encodeMessageAttribute as p,decodeMessageAttribute as g}from"../../../public/js/celebrations/message-attrs.mjs";import{replaceRange as d}from"./markdown-toolbar.js";export function parseAttrs(n){const e=String(n??""),o={};for(const[,r,c,s]of e.matchAll(/([\w-]+)=(?:"([^"]*)"|'([^']*)')/g))o[r]=r==="message"?g(c??s??""):c??s??"";const f=e.replace(/([\w-]+)=(?:"[^"]*"|'[^']*')/g,r=>" ".repeat(r.length));for(const[,r]of f.matchAll(/\b([\w-]+)\b/g))r in o||(o[r]=!0);return o}export function serialiseTag(n,e,o,{keepEmpty:f=!1}={}){const r=[];for(const[s,t]of Object.entries(e))if(t===!0)r.push(s);else{if(t===!1||t===null||t===void 0||t===""&&!f)continue;r.push(`${s}="${s==="message"?p(t):String(t).replace(/"/g,"&quot;")}"`)}const c=r.length?` ${r.join(" ")}`:"";return o?`[${n}${c} /]`:`[${n}${c}]`}function a(n,e,o,f){const r=n.slice(e,o),c=/\/\s*\]$/.test(r),s=r.match(new RegExp(`^\\[${f}([\\s\\S]*?)\\s*/?\\]$`)),t=s?s[1]:"";return{name:f,openTagStart:e,openTagEnd:o,attrStr:t,attrs:parseAttrs(t),selfClosing:c}}function u(n,e,o){const f=new RegExp(`\\[${o}(?=[\\s\\]/])([^\\]]*)\\]`,"g"),r=new RegExp(`\\[/${o}\\]`,"g"),c=[];for(const l of n.matchAll(f)){if(l.index>=e)break;/\/\s*\]$/.test(l[0])||c.push({type:"open",start:l.index,end:l.index+l[0].length})}for(const l of n.matchAll(r)){if(l.index>=e)break;c.push({type:"close",start:l.index})}c.sort((l,i)=>l.start-i.start);const s=[];for(const l of c)l.type==="open"?s.push(l):s.pop();const t=s.at(-1);return t&&new RegExp(`\\[/${o}\\]`).test(n.slice(e))?{start:t.start,end:t.end}:null}export function findEnclosingShortcode(n,e){const o=n.value,f=n.selectionStart,r=new Map(e.map(t=>[t.name,t]));let c=null;for(const t of o.matchAll(/\[(\/)?([a-zA-Z0-9][\w-]*)((?:[^\]]*?))\]/g)){const l=t.index,i=l+t[0].length;f<l||f>i||f===i&&t[1]||r.has(t[2])&&(c={name:t[2],start:l,end:i,close:!!t[1]})}if(c)if(c.close){const t=u(o,c.start,c.name);if(t)return a(o,t.start,t.end,c.name)}else return a(o,c.start,c.end,c.name);let s=null;for(const t of e){if(t.selfClosing)continue;const l=u(o,f,t.name);l&&(!s||l.start>s.start)&&(s={...l,name:t.name})}return s?a(o,s.start,s.end,s.name):null}export function setAttr(n,e,o,f,r){return setAttrs(n,e,{[o]:f},r)}export function setAttrs(n,e,o,{keepEmpty:f=!1}={}){const r={...e.attrs};for(const[l,i]of Object.entries(o))i===!1||i===null||i===void 0||i===""&&!f?delete r[l]:r[l]=i;const c=serialiseTag(e.name,r,e.selfClosing,{keepEmpty:f}),s=typeof document<"u"?document.activeElement:null;d(n,e.openTagStart,e.openTagEnd,c),s&&s!==n&&typeof s.focus=="function"&&s.focus();const t=e.openTagStart+c.length;return a(n.value,e.openTagStart,t,e.name)}export function effectAttrKeys(n,e){const o=`${e}-`;return Object.keys(n).filter(f=>f===e||f.startsWith(o))}export function boolState(n,e){return n==null?!!e:!(n===!1||n==="false"||n==="0")}export function boolValue(n,e){return e===!!n.default?null:e?"true":"false"}
@@ -1 +1 @@
1
- import{THEMES as m}from"./themes.js";export const FILL_TOKENS=["--dm-card-bg","--dm-surface"],VISIBLE_TOKENS=[...FILL_TOKENS,"--dm-text","--dm-primary","--dm-background"],SWITCHER_POSITIONS=["right-center","left-center","bottom-right","bottom-left","top-right","top-left"],newOverrideId=()=>`ov-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;export function cloneOverride(e={},t=newOverrideId){return{id:e.id||t(),label:String(e.label??""),enabled:e.enabled!==!1,scope:String(e.scope??""),theme:String(e.theme??""),tokens:{...e.tokens||{}},css:String(e.css??"")}}export function formFromConfig(e={}){const t=e.autoTheme||{},n=e.switcher||{};return{theme:e.theme||"charcoal-dark",adminTheme:e.adminTheme||"charcoal-dark",autoEnabled:!!t.enabled,dayTheme:t.dayTheme||"charcoal-light",nightTheme:t.nightTheme||"charcoal-dark",dayStart:t.dayStart||"07:00",nightStart:t.nightStart||"19:00",fontFamily:e.font?.family||"Roboto",fontSize:String(e.font?.size??16),adminFontFamily:e.font?.adminFamily||"",fontStylesheet:e.font?.stylesheet||"",swEnabled:n.enabled===!0,swAllThemes:!Array.isArray(n.themes)||!n.themes.length,swThemes:Array.isArray(n.themes)?[...n.themes]:[],swFollowSystem:n.followSystem===!0,swLightTheme:n.lightTheme||"charcoal-light",swDarkTheme:n.darkTheme||"charcoal-dark",swPosition:SWITCHER_POSITIONS.includes(n.position)?n.position:"right-center",swOffsetX:String(n.offsetX??32),swOffsetY:String(n.offsetY??32),overrides:(Array.isArray(e.overrides)?e.overrides:[]).map(r=>cloneOverride(r))}}const h=(e,t)=>{const n=Number.parseInt(e,10);return Number.isFinite(n)?n:t};export function payloadFromForm(e,t={}){const n={enabled:!!e.autoEnabled,dayTheme:e.dayTheme||"charcoal-light",nightTheme:e.nightTheme||"charcoal-dark",dayStart:e.dayStart||"07:00",nightStart:e.nightStart||"19:00"};return{theme:n.enabled?n.dayTheme:e.theme,adminTheme:e.adminTheme,autoTheme:n,font:{family:e.fontFamily||"Roboto",size:h(e.fontSize,16)||16,...e.adminFontFamily&&{adminFamily:e.adminFontFamily},..."adminFamily"in(t.font||{})&&!e.adminFontFamily&&{adminFamily:""},...(e.fontStylesheet||"stylesheet"in(t.font||{}))&&{stylesheet:String(e.fontStylesheet||"").trim()}},switcher:{enabled:!!e.swEnabled,position:e.swPosition||"right-center",offsetX:h(e.swOffsetX,0),offsetY:h(e.swOffsetY,0),themes:e.swAllThemes?[]:[...e.swThemes||[]],followSystem:!!e.swFollowSystem,lightTheme:e.swLightTheme||"charcoal-light",darkTheme:e.swDarkTheme||"charcoal-dark"},overrides:(e.overrides||[]).map(r=>({id:r.id,label:String(r.label??"").trim(),enabled:r.enabled!==!1,scope:String(r.scope??"").trim(),theme:r.theme||"",tokens:Object.fromEntries(Object.entries(r.tokens||{}).map(([i,s])=>[String(i).trim(),String(s??"").trim()]).filter(([i,s])=>i&&s)),css:String(r.css??"")}))}}export function snapshot(e,t={}){const n=payloadFromForm(e,t);return JSON.stringify(n)}function l(e){const t=/^(\d{1,2}):(\d{2})$/.exec(String(e||""));return t?Number(t[1])*60+Number(t[2]):null}export function dayOrNight(e={},t=new Date){const n=l(e.dayStart)??420,r=l(e.nightStart)??1140,i=t.getHours()*60+t.getMinutes();return n===r?"day":n<r?i>=n&&i<r?"day":"night":i>=r&&i<n?"night":"day"}export function themeLabel(e,t=[]){if(!e)return"";const n=t.find(i=>i.id===e);if(n)return n.label;const r=m.find(i=>i.id===e);return r?r.admin?`${r.label} ${r.name}`:`${r.label} (${r.dark?"dark":"light"})`:e}export function themeDiff(e,t,n=6){const r=e||{},i=t||{},s=Object.keys(i).filter(a=>String(r[a]??"").toLowerCase()!==String(i[a]).toLowerCase()),o=[...VISIBLE_TOKENS.filter(a=>s.includes(a)),...s.filter(a=>!VISIBLE_TOKENS.includes(a))];return{changed:s.length,total:Object.keys(i).length,keepsFill:!FILL_TOKENS.some(a=>s.includes(a)),shown:o.slice(0,n).map(a=>({name:a,from:r[a]||"",to:i[a]})),more:Math.max(0,o.length-n)}}export const swatchColour=e=>/^#[0-9a-f]{3,8}$/i.test(String(e||""))?String(e):"";export function knownThemeIds(e={}){return new Set([...e.themes||[],...(e.custom||[]).map(t=>t.id)])}export function themeProblems(e,t){if(!t||!t.size)return[];t=new Set([...t,"core-light","core-dark"]);const n=[],r=(i,s)=>{s&&!t.has(s)&&n.push({where:i,id:s})};return e.autoEnabled?(r("Day theme",e.dayTheme),r("Night theme",e.nightTheme)):r("Site theme",e.theme),r("Admin theme",e.adminTheme),(e.overrides||[]).forEach((i,s)=>r(`Override "${i.label||i.scope||s+1}"`,i.theme)),n}export function overrideRow(e,t,{custom:n=[],known:r=null}={}){const i=Object.keys(e.tokens||{}).filter(o=>o&&String(e.tokens[o]??"").trim()).length,s=[e.scope||"no selector yet",e.theme?`adopts ${themeLabel(e.theme,n)}`:"",i?`${i} token${i===1?"":"s"}`:"",String(e.css||"").trim()?"custom CSS":""].filter(Boolean);return{id:e.id,name:e.label||e.scope||`Override ${t+1}`,meta:s.join(" \xB7 "),off:e.enabled===!1,missing:!!(e.theme&&r&&r.size&&!r.has(e.theme)),empty:!e.theme&&!i&&!String(e.css||"").trim()}}export function moveItem(e,t,n){const r=t+n;if(t<0||t>=e.length||r<0||r>=e.length)return e;const i=[...e],[s]=i.splice(t,1);return i.splice(r,0,s),i}
1
+ import{normaliseBackground as h}from"../../../public/js/background-style.mjs";import{THEMES as c}from"./themes.js";export const FILL_TOKENS=["--dm-card-bg","--dm-surface"],VISIBLE_TOKENS=[...FILL_TOKENS,"--dm-text","--dm-primary","--dm-background"],SWITCHER_POSITIONS=["right-center","left-center","bottom-right","bottom-left","top-right","top-left"],newOverrideId=()=>`ov-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;export function cloneOverride(e={},t=newOverrideId){return{id:e.id||t(),label:String(e.label??""),enabled:e.enabled!==!1,scope:String(e.scope??""),theme:String(e.theme??""),tokens:{...e.tokens||{}},css:String(e.css??"")}}export function formFromConfig(e={}){const t=e.autoTheme||{},n=e.switcher||{};return{background:h(e.background),theme:e.theme||"charcoal-dark",adminTheme:e.adminTheme||"charcoal-dark",autoEnabled:!!t.enabled,dayTheme:t.dayTheme||"charcoal-light",nightTheme:t.nightTheme||"charcoal-dark",dayStart:t.dayStart||"07:00",nightStart:t.nightStart||"19:00",fontFamily:e.font?.family||"Roboto",fontSize:String(e.font?.size??16),adminFontFamily:e.font?.adminFamily||"",fontStylesheet:e.font?.stylesheet||"",swEnabled:n.enabled===!0,swAllThemes:!Array.isArray(n.themes)||!n.themes.length,swThemes:Array.isArray(n.themes)?[...n.themes]:[],swFollowSystem:n.followSystem===!0,swLightTheme:n.lightTheme||"charcoal-light",swDarkTheme:n.darkTheme||"charcoal-dark",swPosition:SWITCHER_POSITIONS.includes(n.position)?n.position:"right-center",swOffsetX:String(n.offsetX??32),swOffsetY:String(n.offsetY??32),overrides:(Array.isArray(e.overrides)?e.overrides:[]).map(r=>cloneOverride(r))}}const l=(e,t)=>{const n=Number.parseInt(e,10);return Number.isFinite(n)?n:t};export function payloadFromForm(e,t={}){const n={enabled:!!e.autoEnabled,dayTheme:e.dayTheme||"charcoal-light",nightTheme:e.nightTheme||"charcoal-dark",dayStart:e.dayStart||"07:00",nightStart:e.nightStart||"19:00"};return{theme:n.enabled?n.dayTheme:e.theme,adminTheme:e.adminTheme,autoTheme:n,background:h(e.background),font:{family:e.fontFamily||"Roboto",size:l(e.fontSize,16)||16,...e.adminFontFamily&&{adminFamily:e.adminFontFamily},..."adminFamily"in(t.font||{})&&!e.adminFontFamily&&{adminFamily:""},...(e.fontStylesheet||"stylesheet"in(t.font||{}))&&{stylesheet:String(e.fontStylesheet||"").trim()}},switcher:{enabled:!!e.swEnabled,position:e.swPosition||"right-center",offsetX:l(e.swOffsetX,0),offsetY:l(e.swOffsetY,0),themes:e.swAllThemes?[]:[...e.swThemes||[]],followSystem:!!e.swFollowSystem,lightTheme:e.swLightTheme||"charcoal-light",darkTheme:e.swDarkTheme||"charcoal-dark"},overrides:(e.overrides||[]).map(r=>({id:r.id,label:String(r.label??"").trim(),enabled:r.enabled!==!1,scope:String(r.scope??"").trim(),theme:r.theme||"",tokens:Object.fromEntries(Object.entries(r.tokens||{}).map(([i,a])=>[String(i).trim(),String(a??"").trim()]).filter(([i,a])=>i&&a)),css:String(r.css??"")}))}}export function snapshot(e,t={}){const n=payloadFromForm(e,t);return JSON.stringify(n)}function m(e){const t=/^(\d{1,2}):(\d{2})$/.exec(String(e||""));return t?Number(t[1])*60+Number(t[2]):null}export function dayOrNight(e={},t=new Date){const n=m(e.dayStart)??420,r=m(e.nightStart)??1140,i=t.getHours()*60+t.getMinutes();return n===r?"day":n<r?i>=n&&i<r?"day":"night":i>=r&&i<n?"night":"day"}export function themeLabel(e,t=[]){if(!e)return"";const n=t.find(i=>i.id===e);if(n)return n.label;const r=c.find(i=>i.id===e);return r?r.admin?`${r.label} ${r.name}`:`${r.label} (${r.dark?"dark":"light"})`:e}export function themeDiff(e,t,n=6){const r=e||{},i=t||{},a=Object.keys(i).filter(s=>String(r[s]??"").toLowerCase()!==String(i[s]).toLowerCase()),o=[...VISIBLE_TOKENS.filter(s=>a.includes(s)),...a.filter(s=>!VISIBLE_TOKENS.includes(s))];return{changed:a.length,total:Object.keys(i).length,keepsFill:!FILL_TOKENS.some(s=>a.includes(s)),shown:o.slice(0,n).map(s=>({name:s,from:r[s]||"",to:i[s]})),more:Math.max(0,o.length-n)}}export const swatchColour=e=>/^#[0-9a-f]{3,8}$/i.test(String(e||""))?String(e):"";export function knownThemeIds(e={}){return new Set([...e.themes||[],...(e.custom||[]).map(t=>t.id)])}export function themeProblems(e,t){if(!t||!t.size)return[];t=new Set([...t,"core-light","core-dark"]);const n=[],r=(i,a)=>{a&&!t.has(a)&&n.push({where:i,id:a})};return e.autoEnabled?(r("Day theme",e.dayTheme),r("Night theme",e.nightTheme)):r("Site theme",e.theme),r("Admin theme",e.adminTheme),(e.overrides||[]).forEach((i,a)=>r(`Override "${i.label||i.scope||a+1}"`,i.theme)),n}export function overrideRow(e,t,{custom:n=[],known:r=null}={}){const i=Object.keys(e.tokens||{}).filter(o=>o&&String(e.tokens[o]??"").trim()).length,a=[e.scope||"no selector yet",e.theme?`adopts ${themeLabel(e.theme,n)}`:"",i?`${i} token${i===1?"":"s"}`:"",String(e.css||"").trim()?"custom CSS":""].filter(Boolean);return{id:e.id,name:e.label||e.scope||`Override ${t+1}`,meta:a.join(" \xB7 "),off:e.enabled===!1,missing:!!(e.theme&&r&&r.size&&!r.has(e.theme)),empty:!e.theme&&!i&&!String(e.css||"").trim()}}export function moveItem(e,t,n){const r=t+n;if(t<0||t>=e.length||r<0||r>=e.length)return e;const i=[...e],[a]=i.splice(t,1);return i.splice(r,0,a),i}
@@ -21,9 +21,13 @@
21
21
  </tr>
22
22
  </thead>
23
23
  <tbody>
24
+ <tr>
25
+ <td><code>[background preset="lavender-haze" /]</code></td>
26
+ <td>Page backdrop with solid colours, gradients or soft glow presets. Use a closing <code>[/background]</code> to wrap a section. Insert or edit through the Background slideover.</td>
27
+ </tr>
24
28
  <tr>
25
29
  <td><code>[grid cols="N" gap="N"]...[/grid]</code></td>
26
- <td>CSS Grid container - N columns (1-12), optional gap (1-6)</td>
30
+ <td>CSS Grid container - N columns (1-12), optional gap (1-6). Grids can nest and contain cards inside a parent card; each container keeps its own settings.</td>
27
31
  </tr>
28
32
  <tr>
29
33
  <td><code>[row gap="N"]...[/row]</code></td>
@@ -74,6 +74,13 @@
74
74
  </div>
75
75
  </div>
76
76
 
77
+ <div class="thx-card dm-settings-section">
78
+ <div class="thx-card-title dm-settings-section-title">Site background</div>
79
+ <p class="thx-hint">Set a default backdrop for public pages. A page's [background] tag overrides it.</p>
80
+ <div id="thx-background-preview" class="bg-preview"><strong id="thx-background-label"></strong></div>
81
+ <button id="thx-background-edit" type="button" class="btn btn-secondary" style="margin-top:1rem">Choose background</button>
82
+ </div>
83
+
77
84
  <div class="thx-card dm-settings-section">
78
85
  <div class="thx-card-title dm-settings-section-title"><span data-icon="droplet" data-icon-size="16" aria-hidden="true"></span>Theme switcher</div>
79
86
  <div class="thx-setting">
@@ -1,11 +1,11 @@
1
- import{api as T}from"../api.js";import{enhanceFontSelect as Ke}from"../lib/font-picker.js";import{applyAdminTheme as ut,refreshAdminTheme as ze}from"../lib/admin-theme.js";import{addBannerAction as Be}from"../lib/plugin-chrome.js";import{helpPopovers as _e}from"../lib/help-popover.js";import{onceClosed as pt,openMenuAt as He,sidebarCount as ft}from"../lib/tool-kit.js";import{populateThemeSelect as Ue}from"../lib/themes.js";import{cloneOverride as Q,dayOrNight as vt,formFromConfig as X,knownThemeIds as bt,moveItem as Ve,overrideRow as yt,payloadFromForm as Z,snapshot as ve,swatchColour as Ye,themeDiff as kt,themeLabel as gt,themeProblems as wt}from"../lib/theme-settings-arrange.js";import{fmtDateTime as xt}from"../lib/dates.js";const be=/^\/theme(\?.*)?$/,Et="#/theme",j="theme.draft",St=[{value:"#site-navbar",label:"Navigation bar"},{value:"#site-footer",label:"Footer"},{value:".site-content",label:"Page content area"},{value:".page-body",label:"Page body (inside the container)"},{value:".site-sidebar",label:"Sidebar"},{value:".card",label:"Every card"},{value:".cms-form-embed",label:"Embedded forms"},{value:".cms-collection",label:"Collection displays"}],Tt=`
1
+ import{openBackgroundDesigner as pt}from"../lib/background-builder.js";import{backgroundStyle as ft}from"../../../public/js/background-style.mjs";import{api as T}from"../api.js";import{enhanceFontSelect as Be}from"../lib/font-picker.js";import{applyAdminTheme as vt,refreshAdminTheme as ze}from"../lib/admin-theme.js";import{addBannerAction as Ue}from"../lib/plugin-chrome.js";import{helpPopovers as _e}from"../lib/help-popover.js";import{onceClosed as bt,openMenuAt as He,sidebarCount as yt}from"../lib/tool-kit.js";import{populateThemeSelect as Ve}from"../lib/themes.js";import{cloneOverride as X,dayOrNight as kt,formFromConfig as Z,knownThemeIds as gt,moveItem as Ye,overrideRow as xt,payloadFromForm as ee,snapshot as be,swatchColour as We,themeDiff as wt,themeLabel as Et,themeProblems as St}from"../lib/theme-settings-arrange.js";import{fmtDateTime as Tt}from"../lib/dates.js";const ye=/^\/theme(\?.*)?$/,Ct="#/theme",F="theme.draft",Mt=[{value:"#site-navbar",label:"Navigation bar"},{value:"#site-footer",label:"Footer"},{value:".site-content",label:"Page content area"},{value:".page-body",label:"Page body (inside the container)"},{value:".site-sidebar",label:"Sidebar"},{value:".card",label:"Every card"},{value:".cms-form-embed",label:"Embedded forms"},{value:".cms-collection",label:"Collection displays"}],$t=`
2
2
  <div class="thx-row" data-id="{{id}}" tabindex="0" data-bind-class="off && 'is-off'">
3
3
  <span class="thx-main"><strong>{{name}}</strong><small>{{meta}}</small></span>
4
4
  <span class="thx-chip is-danger" data-bind-hidden="!missing" title="Its theme no longer exists">Theme gone</span>
5
5
  <span class="thx-chip is-warn" data-bind-hidden="!empty" title="No theme, token or CSS - it changes nothing">Empty</span>
6
6
  <span class="thx-chip" data-bind-hidden="!off">Off</span>
7
7
  <button type="button" class="thx-kebab" aria-label="Actions for {{name}}" title="Actions">\u22EE</button>
8
- </div>`,ye=u=>String(u??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function Ct(u){const y=document.createElement("template");return y.innerHTML=u.trim(),y.content.firstElementChild}let C=null,We=!1;function Mt(){We||!window.R?.use||(We=!0,R.use((u,y,c)=>!(be.test(y?.path||"")&&!be.test(u?.path||""))||!C?.dirty()?c():E.confirm("You have unsaved theme changes. Leave anyway? They are kept as a draft for your next visit.").then(h=>{h?c():history.replaceState(null,"","#/theme")})),M.subscribe("router:afterChange",({to:u}={})=>{if(C&&!be.test(u?.path||"")){const y=C;C=null,y.dispose()}}))}export const themeView={templateUrl:"/admin/js/templates/theme.html",async onMount(u){if(Mt(),C){const e=C;C=null,e.dispose()}const y=[],c=e=>(y.push(e),e);let ee=!1;const h=u.get(0).querySelector(".thx")||u.get(0),q=()=>!ee&&h.isConnected,ke=E.loader(u.get(0),{type:"dots"});let F,O;try{[F,O]=await Promise.all([T.theme.get(),T.theme.catalog().catch(()=>({themes:[],tokens:[],custom:[]}))])}catch(e){ke.destroy(),E.toast(`Could not load the theme settings: ${e.message||e}`,{type:"error"});return}if(ke.destroy(),!h.isConnected)return;const te=O.tokens||[],K=Array.isArray(O.custom)?O.custom:[],ge=bt(O),f=M.observable(F),x=X(F),n={};for(const[e,t]of Object.entries(x))n[e]=M.observable(t);const we=()=>Object.fromEntries(Object.keys(n).map(e=>[e,n[e].value])),oe=()=>Object.fromEntries(Object.keys(n).map(e=>[e,n[e].peek()])),z=M.observable(ve(x,F)),B=M.observable(!1),P=M.observable([]),ne=M.observable("(nothing yet)"),ae=M.observable(!1),Je=M.computed(()=>ve(we(),f.value)),_=M.computed(()=>Je.value!==z.value),xe=M.computed(()=>wt(we(),ge)),Ee=M.observable([]);c(M.effect(()=>{Ee.value=n.overrides.value.map((e,t)=>yt(e,t,{custom:K,known:ge}))}));const N=e=>gt(e,K),Ge={...n,saving:B,rows:Ee,cssText:ne,cssError:ae,dirty:_,errorsText:M.computed(()=>P.value.join(" \xB7 ")),problemsText:M.computed(()=>xe.value.length?`${xe.value.map(e=>`${e.where}: "${e.id}"`).join(", ")} - no longer available, so its base theme shows. Pick another.`:""),liveSite:M.computed(()=>{const e=f.value;if(e.autoTheme?.enabled){const t=vt(e.autoTheme)==="day"?"day":"night";return`Site: ${N(e.autoTheme.dayTheme)} by day, ${N(e.autoTheme.nightTheme)} by night (${t} now)`}return`Site: ${N(e.theme||"charcoal-dark")}`}),liveAdmin:M.computed(()=>`Admin: ${N(f.value.adminTheme||"charcoal-dark")}`),liveOverrides:M.computed(()=>{const e=f.value.overrides||[],t=e.filter(o=>o.enabled!==!1).length;return e.length?`${t} override${t===1?"":"s"} on`:""}),liveSwitcher:M.computed(()=>f.value.switcher?.enabled?"Theme switcher on":"")};function Se(e){if(!K.length)return;const t=document.createElement("optgroup");t.label="Custom themes";for(const o of K){const a=document.createElement("option");a.value=o.id,a.textContent=`${o.label} (on ${o.baseTheme})`,t.appendChild(a)}e.appendChild(t)}function se(e,t){if(t&&![...e.options].some(o=>o.value===t)){const o=document.createElement("option");o.value=t,o.textContent=`${t} (not available)`,e.appendChild(o)}}const H=(e,t,o)=>{const a=h.querySelector(e);return Ue(a,o),Se(a),se(a,t),a};H("#thx-site",x.theme),H("#thx-admin",x.adminTheme,{includeAdmin:!0}),H("#thx-day",x.dayTheme),H("#thx-night",x.nightTheme);const U=h.querySelector("#thx-sw-themes");for(const e of O.themes||[]){const t=document.createElement("option");t.value=e,t.textContent=N(e),U.appendChild(t)}U.addEventListener("change",()=>{n.swThemes.value=[...U.selectedOptions].map(e=>e.value)}),c(M.effect(()=>{const e=n.swThemes.value;for(const t of U.options)t.selected=e.includes(t.value)}));for(const[e,t]of[["#thx-sw-light","-light"],["#thx-sw-dark","-dark"]]){const o=h.querySelector(e);for(const a of(O.themes||[]).filter(r=>r.endsWith(t))){const r=document.createElement("option");r.value=a,r.textContent=N(a),o.appendChild(r)}se(o,t==="-light"?x.swLightTheme:x.swDarkTheme)}let re=0;async function Qe(e){const t=++re;try{const o=await T.theme.admin(e);if(t!==re||!q())return;ut(o)}catch{}}let Te=!0;c(M.effect(()=>{const e=n.adminTheme.value||"charcoal-dark";if(Te){Te=!1;return}Qe(e)})),c(()=>{re++,(n.adminTheme.peek()||"charcoal-dark")!==(f.peek().adminTheme||"charcoal-dark")&&ze(T)});let le=null,ie=0;async function V(){const e=++ie;try{const t=await T.theme.compile(Z(oe(),f.peek()));if(e!==ie||!q())return;ne.value=t.css?.trim()||"(no overrides - nothing is injected)",ae.value=!1}catch(t){if(e!==ie||!q())return;ne.value=t.message||String(t),ae.value=!0}}c(M.effect(()=>{n.overrides.value,clearTimeout(le),le=setTimeout(V,400)})),c(()=>clearTimeout(le));async function ce(){if(!B.peek()){if(!n.swAllThemes.peek()&&!n.swThemes.peek().length){P.value=["Choose at least one allowed visitor theme, or offer all built-in themes."],E.toast("Choose the visitor themes before saving.",{type:"error"});return}B.value=!0,P.value=[];try{const e=await T.theme.save(Z(oe(),f.peek()));if(!q())return;f.value=e;const t=X(e);for(const[o,a]of Object.entries(t))n[o].value=a;z.value=ve(t,e);try{S.remove?S.remove(j):S.set(j,null)}catch{}await ze(T),ft(Et),E.toast("Theme saved.",{type:"success"}),V()}catch(e){P.value=e.validation||[e.message||"Could not save the theme."],E.toast("Theme not saved - see the message at the top.",{type:"error"})}finally{B.value=!1}}}async function Xe(){if(!await E.confirm("Throw away your unsaved theme changes?"))return;const e=X(f.peek());for(const[t,o]of Object.entries(e))n[t].value=o;P.value=[]}const Ce=e=>n.overrides.peek().find(t=>t.id===e),$=e=>{n.overrides.value=e},de=(e,t)=>$(n.overrides.peek().map(o=>o.id===e?t:o)),Ze=e=>n.overrides.peek().findIndex(t=>t.id===e),me=new Map;async function Me(e){if(!e)return null;if(me.has(e))return me.get(e);const o=(await T.theme.themeTokens(e).catch(()=>null))?.tokens||null;return me.set(e,o),o}const et=()=>(n.autoEnabled.peek()?n.dayTheme.peek():n.theme.peek())||"charcoal-dark",Y=new Set;function W(e){const t=e?Ce(e):Q({});if(!t)return;const o=!e,a=Q(t),r={label:M.observable(a.label),scope:M.observable(a.scope),enabled:M.observable(a.enabled),theme:M.observable(a.theme),css:M.observable(a.css),tokenErr:M.observable("")},d=E.slideover({title:o?"New override":`Override: ${ye(t.label||t.scope||"untitled")}`,size:"md",position:"right"}),v=Ct(`
8
+ </div>`,ke=u=>String(u??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function Ot(u){const y=document.createElement("template");return y.innerHTML=u.trim(),y.content.firstElementChild}let C=null,Je=!1;function At(){Je||!window.R?.use||(Je=!0,R.use((u,y,c)=>!(ye.test(y?.path||"")&&!ye.test(u?.path||""))||!C?.dirty()?c():E.confirm("You have unsaved theme changes. Leave anyway? They are kept as a draft for your next visit.").then(d=>{d?c():history.replaceState(null,"","#/theme")})),M.subscribe("router:afterChange",({to:u}={})=>{if(C&&!ye.test(u?.path||"")){const y=C;C=null,y.dispose()}}))}export const themeView={templateUrl:"/admin/js/templates/theme.html",async onMount(u){if(At(),C){const e=C;C=null,e.dispose()}const y=[],c=e=>(y.push(e),e);let te=!1;const d=u.get(0).querySelector(".thx")||u.get(0),N=()=>!te&&d.isConnected,ge=E.loader(u.get(0),{type:"dots"});let B,O;try{[B,O]=await Promise.all([T.theme.get(),T.theme.catalog().catch(()=>({themes:[],tokens:[],custom:[]}))])}catch(e){ge.destroy(),E.toast(`Could not load the theme settings: ${e.message||e}`,{type:"error"});return}if(ge.destroy(),!d.isConnected)return;const oe=O.tokens||[],z=Array.isArray(O.custom)?O.custom:[],xe=gt(O),f=M.observable(B),w=Z(B),n={};for(const[e,t]of Object.entries(w))n[e]=M.observable(t);const we=()=>Object.fromEntries(Object.keys(n).map(e=>[e,n[e].value])),ne=()=>Object.fromEntries(Object.keys(n).map(e=>[e,n[e].peek()])),U=M.observable(be(w,B)),_=M.observable(!1),K=M.observable([]),ae=M.observable("(nothing yet)"),se=M.observable(!1),Ge=M.computed(()=>be(we(),f.value)),H=M.computed(()=>Ge.value!==U.value),Ee=M.computed(()=>St(we(),xe)),Se=M.observable([]);c(M.effect(()=>{Se.value=n.overrides.value.map((e,t)=>xt(e,t,{custom:z,known:xe}))}));const D=e=>Et(e,z),Qe={...n,saving:_,rows:Se,cssText:ae,cssError:se,dirty:H,errorsText:M.computed(()=>K.value.join(" \xB7 ")),problemsText:M.computed(()=>Ee.value.length?`${Ee.value.map(e=>`${e.where}: "${e.id}"`).join(", ")} - no longer available, so its base theme shows. Pick another.`:""),liveSite:M.computed(()=>{const e=f.value;if(e.autoTheme?.enabled){const t=kt(e.autoTheme)==="day"?"day":"night";return`Site: ${D(e.autoTheme.dayTheme)} by day, ${D(e.autoTheme.nightTheme)} by night (${t} now)`}return`Site: ${D(e.theme||"charcoal-dark")}`}),liveAdmin:M.computed(()=>`Admin: ${D(f.value.adminTheme||"charcoal-dark")}`),liveOverrides:M.computed(()=>{const e=f.value.overrides||[],t=e.filter(o=>o.enabled!==!1).length;return e.length?`${t} override${t===1?"":"s"} on`:""}),liveSwitcher:M.computed(()=>f.value.switcher?.enabled?"Theme switcher on":"")};$(d).find("#thx-background-edit").on("click",()=>{const e=pt({title:"Site background",value:n.background.peek(),onApply:t=>{n.background.value=t},onReset:()=>{n.background.value=null},onClose:()=>L.delete(e)});L.add(e)}),c(M.effect(()=>{const e=n.background.value;$(d).find("#thx-background-preview").get(0).style.cssText=ft(e),$(d).find("#thx-background-label").text(e?"Custom site background":"Uses the theme background")}));function Te(e){if(!z.length)return;const t=document.createElement("optgroup");t.label="Custom themes";for(const o of z){const a=document.createElement("option");a.value=o.id,a.textContent=`${o.label} (on ${o.baseTheme})`,t.appendChild(a)}e.appendChild(t)}function re(e,t){if(t&&![...e.options].some(o=>o.value===t)){const o=document.createElement("option");o.value=t,o.textContent=`${t} (not available)`,e.appendChild(o)}}const V=(e,t,o)=>{const a=d.querySelector(e);return Ve(a,o),Te(a),re(a,t),a};V("#thx-site",w.theme),V("#thx-admin",w.adminTheme,{includeAdmin:!0}),V("#thx-day",w.dayTheme),V("#thx-night",w.nightTheme);const Y=d.querySelector("#thx-sw-themes");for(const e of O.themes||[]){const t=document.createElement("option");t.value=e,t.textContent=D(e),Y.appendChild(t)}Y.addEventListener("change",()=>{n.swThemes.value=[...Y.selectedOptions].map(e=>e.value)}),c(M.effect(()=>{const e=n.swThemes.value;for(const t of Y.options)t.selected=e.includes(t.value)}));for(const[e,t]of[["#thx-sw-light","-light"],["#thx-sw-dark","-dark"]]){const o=d.querySelector(e);for(const a of(O.themes||[]).filter(r=>r.endsWith(t))){const r=document.createElement("option");r.value=a,r.textContent=D(a),o.appendChild(r)}re(o,t==="-light"?w.swLightTheme:w.swDarkTheme)}let le=0;async function Xe(e){const t=++le;try{const o=await T.theme.admin(e);if(t!==le||!N())return;vt(o)}catch{}}let Ce=!0;c(M.effect(()=>{const e=n.adminTheme.value||"charcoal-dark";if(Ce){Ce=!1;return}Xe(e)})),c(()=>{le++,(n.adminTheme.peek()||"charcoal-dark")!==(f.peek().adminTheme||"charcoal-dark")&&ze(T)});let ie=null,ce=0;async function W(){const e=++ce;try{const t=await T.theme.compile(ee(ne(),f.peek()));if(e!==ce||!N())return;ae.value=t.css?.trim()||"(no overrides - nothing is injected)",se.value=!1}catch(t){if(e!==ce||!N())return;ae.value=t.message||String(t),se.value=!0}}c(M.effect(()=>{n.overrides.value,clearTimeout(ie),ie=setTimeout(W,400)})),c(()=>clearTimeout(ie));async function de(){if(!_.peek()){if(!n.swAllThemes.peek()&&!n.swThemes.peek().length){K.value=["Choose at least one allowed visitor theme, or offer all built-in themes."],E.toast("Choose the visitor themes before saving.",{type:"error"});return}_.value=!0,K.value=[];try{const e=await T.theme.save(ee(ne(),f.peek()));if(!N())return;f.value=e;const t=Z(e);for(const[o,a]of Object.entries(t))n[o].value=a;U.value=be(t,e);try{S.remove?S.remove(F):S.set(F,null)}catch{}await ze(T),yt(Ct),E.toast("Theme saved.",{type:"success"}),W()}catch(e){K.value=e.validation||[e.message||"Could not save the theme."],E.toast("Theme not saved - see the message at the top.",{type:"error"})}finally{_.value=!1}}}async function Ze(){if(!await E.confirm("Throw away your unsaved theme changes?"))return;const e=Z(f.peek());for(const[t,o]of Object.entries(e))n[t].value=o;K.value=[]}const Me=e=>n.overrides.peek().find(t=>t.id===e),A=e=>{n.overrides.value=e},me=(e,t)=>A(n.overrides.peek().map(o=>o.id===e?t:o)),et=e=>n.overrides.peek().findIndex(t=>t.id===e),he=new Map;async function $e(e){if(!e)return null;if(he.has(e))return he.get(e);const o=(await T.theme.themeTokens(e).catch(()=>null))?.tokens||null;return he.set(e,o),o}const tt=()=>(n.autoEnabled.peek()?n.dayTheme.peek():n.theme.peek())||"charcoal-dark",L=new Set;function J(e){const t=e?Me(e):X({});if(!t)return;const o=!e,a=X(t),r={label:M.observable(a.label),scope:M.observable(a.scope),enabled:M.observable(a.enabled),theme:M.observable(a.theme),css:M.observable(a.css),tokenErr:M.observable("")},m=E.slideover({title:o?"New override":`Override: ${ke(t.label||t.scope||"untitled")}`,size:"md",position:"right"}),v=Ot(`
9
9
  <div class="thx-form">
10
10
  <div class="thx-grid">
11
11
  <div>
@@ -22,7 +22,7 @@ import{api as T}from"../api.js";import{enhanceFontSelect as Ke}from"../lib/font-
22
22
  <label class="form-label" for="thx-o-scope">Target selector
23
23
  <span data-help-title="Target selector" data-help="The region to re-theme - a CSS selector. Everything inside it follows. Pick a common region from the list or type your own (#site-navbar, .card, .page-body \u2026)."></span></label>
24
24
  <input id="thx-o-scope" type="text" class="form-input font-mono" list="thx-scope-options" placeholder="#site-navbar" data-model="scope.value">
25
- <datalist id="thx-scope-options">${St.map(s=>`<option value="${s.value}" label="${s.label}"></option>`).join("")}</datalist>
25
+ <datalist id="thx-scope-options">${Mt.map(s=>`<option value="${s.value}" label="${s.label}"></option>`).join("")}</datalist>
26
26
  </div>
27
27
  <div>
28
28
  <label class="form-label" for="thx-o-theme">Adopt a theme here
@@ -52,4 +52,4 @@ import{api as T}from"../api.js";import{enhanceFontSelect as Ke}from"../lib/font-
52
52
  <button type="button" class="btn btn-sm btn-primary" data-on-click="done">
53
53
  <span data-icon="check" data-icon-size="13"></span> ${o?"Add":"Done"}</button>
54
54
  </div>
55
- </div>`),he=v.querySelector("#thx-o-theme");Ue(he,{includeDefault:!0,defaultLabel:"Keep the site theme"}),Se(he),se(he,a.theme);const at=v.querySelector("#thx-token-names");for(const s of te){const i=document.createElement("option");i.value=s,at.appendChild(i)}const ue=v.querySelector(".thx-toks");function De(s="",i=""){const b=document.createElement("div");b.className="thx-tok";const l=document.createElement("input");l.type="text",l.className="form-input font-mono thx-tok-name",l.placeholder="--dm-primary",l.setAttribute("list","thx-token-names"),l.value=s,l.setAttribute("aria-label","Token");const p=document.createElement("input");p.type="text",p.className="form-input thx-tok-value",p.placeholder="#0096c7",p.value=i,p.setAttribute("aria-label","Value");const k=document.createElement("input");k.type="color",k.title="Pick a colour";const g=Ye(i);/^#[0-9a-f]{6}$/i.test(g)&&(k.value=g),k.addEventListener("input",()=>{p.value=k.value});const w=document.createElement("button");return w.type="button",w.className="btn btn-sm btn-ghost",w.textContent="\xD7",w.title="Remove this token",w.addEventListener("click",()=>b.remove()),b.append(l,p,k,w),b}for(const[s,i]of Object.entries(a.tokens))ue.appendChild(De(s,i));function Re(){const s={},i=[];return ue.querySelectorAll(".thx-tok").forEach(b=>{const l=b.querySelector(".thx-tok-name").value.trim(),p=b.querySelector(".thx-tok-value").value.trim();!l||!p||(te.length&&!te.includes(l)&&i.push(l),s[l]=p)}),{tokens:s,bad:i}}const je=()=>({...a,label:r.label.peek(),scope:r.scope.peek(),enabled:r.enabled.peek(),theme:r.theme.peek(),css:r.css.peek(),tokens:Re().tokens}),st=JSON.stringify(Z({overrides:[a]}).overrides),rt=()=>JSON.stringify(Z({overrides:[je()]}).overrides)!==st,pe=v.querySelector(".thx-diff-host");let Pe=0;async function lt(){const s=++Pe;pe.replaceChildren();const i=r.theme.peek();if(!i)return;const b=et(),l=document.createElement("div");if(l.className="thx-diff",l.style.marginTop=".5rem",i===b){const m=document.createElement("p");m.textContent="That is already the site theme, so this changes nothing on its own. Set a token below instead.",l.appendChild(m),pe.appendChild(l);return}const[p,k]=await Promise.all([Me(b),Me(i)]);if(s!==Pe||!p||!k)return;const g=kt(p,k),w=document.createElement("p");if(w.textContent=`Changes ${g.changed} of ${g.total} tokens here.`,l.appendChild(w),g.keepsFill){const m=document.createElement("p");m.className="is-warn",m.textContent="Both themes use the same surface colour, so this region keeps the fill it has now. Set --dm-card-bg (a card) or --dm-surface (most other regions) below to change it.",l.appendChild(m)}const G=document.createElement("div");G.className="thx-diff-list";const Ie=m=>{const D=document.createElement("span");return D.className="thx-sw",D.style.background=Ye(m)||"transparent",D};for(const m of g.shown){const D=document.createElement("span");D.append(Ie(m.from),document.createTextNode(`${m.name} `),Ie(m.to)),G.appendChild(D)}if(g.more){const m=document.createElement("span");m.textContent=`+${g.more} more`,G.appendChild(m)}l.appendChild(G),pe.appendChild(l)}const it=M.effect(()=>{r.theme.value,lt()});let J=!1,fe=!1;const Fe={addToken:()=>{const s=De();ue.appendChild(s),s.querySelector("input").focus()},cancel:()=>d.close(),async remove(){await E.confirm(`Remove the override "${ye(t.label||t.scope||"untitled")}"? It goes when you save.`)&&($(n.overrides.peek().filter(s=>s.id!==t.id)),J=!0,d.close())},done(){const{bad:s}=Re();if(s.length){r.tokenErr.value=`Not a token this Domma defines: ${s.join(", ")}. Pick one from the list.`;return}const i=je();o?$([...n.overrides.peek(),i]):de(t.id,i),J=!0,d.close()}};d.element.appendChild(v);const ct=_e(v),dt=M.applyBindings(r,v,{methods:Fe}),mt=s=>{(s.ctrlKey||s.metaKey)&&s.key==="Enter"&&(s.preventDefault(),Fe.done())};v.addEventListener("keydown",mt),Y.add(d),pt(d,()=>{it(),dt.dispose(),ct(),Y.delete(d)});const ht=d.close.bind(d);d.close=async s=>{if(!J&&s!==!0&&rt()){if(fe)return;fe=!0;const i=await E.confirm("Discard your changes to this override?");if(fe=!1,!i)return}return J=!0,ht()},I.scan(v),d.open(),v.querySelector(o?"#thx-o-scope":"#thx-o-label")?.focus()}function tt(e){const t=Ce(e);if(!t)return[];const o=Ze(e),a=n.overrides.peek().length;return[{header:t.label||t.scope||`Override ${o+1}`},{label:"Edit\u2026",icon:"edit",action:()=>W(e)},t.enabled?{label:"Switch off",icon:"pause",action:()=>de(e,{...t,enabled:!1})}:{label:"Switch on",icon:"play",action:()=>de(e,{...t,enabled:!0})},{label:"Duplicate",icon:"copy",action:()=>{const r=Q({...t,id:"",label:t.label?`${t.label} copy`:""}),d=[...n.overrides.peek()];d.splice(o+1,0,r),$(d)}},{type:"divider"},{label:"Move up",icon:"arrow-up",disabled:o<=0,action:()=>$(Ve(n.overrides.peek(),o,-1))},{label:"Move down",icon:"arrow-down",disabled:o>=a-1,action:()=>$(Ve(n.overrides.peek(),o,1))},{type:"divider"},{label:"Remove\u2026",icon:"trash",danger:!0,action:async()=>{await E.confirm(`Remove the override "${ye(t.label||t.scope||"untitled")}"? It goes when you save.`)&&$(n.overrides.peek().filter(r=>r.id!==e))}}]}const L=h.querySelector(".thx-list");L.innerHTML=Tt,E.tabs(h.querySelector(".thx-tabs"),{tabSelector:".tab-item",panelSelector:".tab-panel"});const ot=M.applyBindings(Ge,h,{methods:{save:ce,discard:Xe,refreshCss:V,addOverride:()=>W(null)}});c(()=>ot.dispose());const Oe=[Ke(h.querySelector("#thx-font"),{label:"Font family",stylesheet:()=>n.fontStylesheet.peek()}),Ke(h.querySelector("#thx-admin-font"),{label:"Admin font family",stylesheet:()=>n.fontStylesheet.peek()})];c(()=>Oe.forEach(e=>e.destroy())),c(M.effect(()=>{n.fontFamily.value,n.adminFontFamily.value,n.fontStylesheet.value,queueMicrotask(()=>{q()&&Oe.forEach(e=>e.refresh())})})),c(_e(h,{position:"bottom"}));const nt=E.contextMenu(L,{cursor:"glyph",match:".thx-row",inherit:!1,density:"compact",items:e=>tt(e.dataset.id)});c(()=>nt?.destroy?.());const $e=e=>{const t=e.target.closest(".thx-row");if(t){if(e.target.closest(".thx-kebab")){He(e.target.closest(".thx-kebab"));return}W(t.dataset.id)}},Ae=e=>{const t=e.target.closest(".thx-row");t&&(e.key==="F10"&&e.shiftKey?(e.preventDefault(),He(t)):e.key==="Enter"&&e.target===t&&W(t.dataset.id))};L.addEventListener("click",$e),L.addEventListener("keydown",Ae),c(()=>{L.removeEventListener("click",$e),L.removeEventListener("keydown",Ae)}),Be(u,{id:"theme-view-site",icon:"external-link",title:"View site",onClick:()=>window.open("/","_blank","noopener")}),Be(u,{id:"theme-save",icon:"save",title:"Save (Ctrl+S)",onClick:()=>ce()});const qe=e=>{!(e.ctrlKey||e.metaKey)||e.key!=="s"||Y.size||(e.preventDefault(),e.stopImmediatePropagation(),ce())};document.addEventListener("keydown",qe,!0),c(()=>document.removeEventListener("keydown",qe,!0));const Ne=()=>{if(_.peek())try{S.set(j,{form:oe(),base:z.peek(),at:new Date().toISOString()})}catch{}},Le=e=>{_.peek()&&(Ne(),e.preventDefault(),e.returnValue="")};window.addEventListener("beforeunload",Le),c(()=>window.removeEventListener("beforeunload",Le)),C={dirty:()=>_.peek(),dispose(){ee=!0,Ne(),[...Y].forEach(e=>{try{e.close(!0)}catch{}}),y.splice(0).reverse().forEach(e=>{try{e()}catch{}})}},I.scan(h),V();let A=null;try{A=S.get(j)}catch{}if(A?.form){try{S.remove?S.remove(j):S.set(j,null)}catch{}const e=A.base&&A.base!==z.peek(),t=A.at?` (${xt(A.at)})`:"",o=e?`You left unsaved theme changes${t}, but the saved settings have changed since. Restore your version anyway?`:`You left unsaved theme changes${t}. Restore them?`;if(await E.confirm(o)&&q()){const a={...X(f.peek()),...A.form};a.overrides=(a.overrides||[]).map(r=>Q(r));for(const[r,d]of Object.entries(a))n[r]&&(n[r].value=d)}}}};
55
+ </div>`),ue=v.querySelector("#thx-o-theme");Ve(ue,{includeDefault:!0,defaultLabel:"Keep the site theme"}),Te(ue),re(ue,a.theme);const st=v.querySelector("#thx-token-names");for(const s of oe){const i=document.createElement("option");i.value=s,st.appendChild(i)}const pe=v.querySelector(".thx-toks");function Re(s="",i=""){const b=document.createElement("div");b.className="thx-tok";const l=document.createElement("input");l.type="text",l.className="form-input font-mono thx-tok-name",l.placeholder="--dm-primary",l.setAttribute("list","thx-token-names"),l.value=s,l.setAttribute("aria-label","Token");const p=document.createElement("input");p.type="text",p.className="form-input thx-tok-value",p.placeholder="#0096c7",p.value=i,p.setAttribute("aria-label","Value");const k=document.createElement("input");k.type="color",k.title="Pick a colour";const g=We(i);/^#[0-9a-f]{6}$/i.test(g)&&(k.value=g),k.addEventListener("input",()=>{p.value=k.value});const x=document.createElement("button");return x.type="button",x.className="btn btn-sm btn-ghost",x.textContent="\xD7",x.title="Remove this token",x.addEventListener("click",()=>b.remove()),b.append(l,p,k,x),b}for(const[s,i]of Object.entries(a.tokens))pe.appendChild(Re(s,i));function je(){const s={},i=[];return pe.querySelectorAll(".thx-tok").forEach(b=>{const l=b.querySelector(".thx-tok-name").value.trim(),p=b.querySelector(".thx-tok-value").value.trim();!l||!p||(oe.length&&!oe.includes(l)&&i.push(l),s[l]=p)}),{tokens:s,bad:i}}const Pe=()=>({...a,label:r.label.peek(),scope:r.scope.peek(),enabled:r.enabled.peek(),theme:r.theme.peek(),css:r.css.peek(),tokens:je().tokens}),rt=JSON.stringify(ee({overrides:[a]}).overrides),lt=()=>JSON.stringify(ee({overrides:[Pe()]}).overrides)!==rt,fe=v.querySelector(".thx-diff-host");let Fe=0;async function it(){const s=++Fe;fe.replaceChildren();const i=r.theme.peek();if(!i)return;const b=tt(),l=document.createElement("div");if(l.className="thx-diff",l.style.marginTop=".5rem",i===b){const h=document.createElement("p");h.textContent="That is already the site theme, so this changes nothing on its own. Set a token below instead.",l.appendChild(h),fe.appendChild(l);return}const[p,k]=await Promise.all([$e(b),$e(i)]);if(s!==Fe||!p||!k)return;const g=wt(p,k),x=document.createElement("p");if(x.textContent=`Changes ${g.changed} of ${g.total} tokens here.`,l.appendChild(x),g.keepsFill){const h=document.createElement("p");h.className="is-warn",h.textContent="Both themes use the same surface colour, so this region keeps the fill it has now. Set --dm-card-bg (a card) or --dm-surface (most other regions) below to change it.",l.appendChild(h)}const Q=document.createElement("div");Q.className="thx-diff-list";const Ke=h=>{const P=document.createElement("span");return P.className="thx-sw",P.style.background=We(h)||"transparent",P};for(const h of g.shown){const P=document.createElement("span");P.append(Ke(h.from),document.createTextNode(`${h.name} `),Ke(h.to)),Q.appendChild(P)}if(g.more){const h=document.createElement("span");h.textContent=`+${g.more} more`,Q.appendChild(h)}l.appendChild(Q),fe.appendChild(l)}const ct=M.effect(()=>{r.theme.value,it()});let G=!1,ve=!1;const Ie={addToken:()=>{const s=Re();pe.appendChild(s),s.querySelector("input").focus()},cancel:()=>m.close(),async remove(){await E.confirm(`Remove the override "${ke(t.label||t.scope||"untitled")}"? It goes when you save.`)&&(A(n.overrides.peek().filter(s=>s.id!==t.id)),G=!0,m.close())},done(){const{bad:s}=je();if(s.length){r.tokenErr.value=`Not a token this Domma defines: ${s.join(", ")}. Pick one from the list.`;return}const i=Pe();o?A([...n.overrides.peek(),i]):me(t.id,i),G=!0,m.close()}};m.element.appendChild(v);const dt=_e(v),mt=M.applyBindings(r,v,{methods:Ie}),ht=s=>{(s.ctrlKey||s.metaKey)&&s.key==="Enter"&&(s.preventDefault(),Ie.done())};v.addEventListener("keydown",ht),L.add(m),bt(m,()=>{ct(),mt.dispose(),dt(),L.delete(m)});const ut=m.close.bind(m);m.close=async s=>{if(!G&&s!==!0&&lt()){if(ve)return;ve=!0;const i=await E.confirm("Discard your changes to this override?");if(ve=!1,!i)return}return G=!0,ut()},I.scan(v),m.open(),v.querySelector(o?"#thx-o-scope":"#thx-o-label")?.focus()}function ot(e){const t=Me(e);if(!t)return[];const o=et(e),a=n.overrides.peek().length;return[{header:t.label||t.scope||`Override ${o+1}`},{label:"Edit\u2026",icon:"edit",action:()=>J(e)},t.enabled?{label:"Switch off",icon:"pause",action:()=>me(e,{...t,enabled:!1})}:{label:"Switch on",icon:"play",action:()=>me(e,{...t,enabled:!0})},{label:"Duplicate",icon:"copy",action:()=>{const r=X({...t,id:"",label:t.label?`${t.label} copy`:""}),m=[...n.overrides.peek()];m.splice(o+1,0,r),A(m)}},{type:"divider"},{label:"Move up",icon:"arrow-up",disabled:o<=0,action:()=>A(Ye(n.overrides.peek(),o,-1))},{label:"Move down",icon:"arrow-down",disabled:o>=a-1,action:()=>A(Ye(n.overrides.peek(),o,1))},{type:"divider"},{label:"Remove\u2026",icon:"trash",danger:!0,action:async()=>{await E.confirm(`Remove the override "${ke(t.label||t.scope||"untitled")}"? It goes when you save.`)&&A(n.overrides.peek().filter(r=>r.id!==e))}}]}const j=d.querySelector(".thx-list");j.innerHTML=$t,E.tabs(d.querySelector(".thx-tabs"),{tabSelector:".tab-item",panelSelector:".tab-panel"});const nt=M.applyBindings(Qe,d,{methods:{save:de,discard:Ze,refreshCss:W,addOverride:()=>J(null)}});c(()=>nt.dispose());const Oe=[Be(d.querySelector("#thx-font"),{label:"Font family",stylesheet:()=>n.fontStylesheet.peek()}),Be(d.querySelector("#thx-admin-font"),{label:"Admin font family",stylesheet:()=>n.fontStylesheet.peek()})];c(()=>Oe.forEach(e=>e.destroy())),c(M.effect(()=>{n.fontFamily.value,n.adminFontFamily.value,n.fontStylesheet.value,queueMicrotask(()=>{N()&&Oe.forEach(e=>e.refresh())})})),c(_e(d,{position:"bottom"}));const at=E.contextMenu(j,{cursor:"glyph",match:".thx-row",inherit:!1,density:"compact",items:e=>ot(e.dataset.id)});c(()=>at?.destroy?.());const Ae=e=>{const t=e.target.closest(".thx-row");if(t){if(e.target.closest(".thx-kebab")){He(e.target.closest(".thx-kebab"));return}J(t.dataset.id)}},qe=e=>{const t=e.target.closest(".thx-row");t&&(e.key==="F10"&&e.shiftKey?(e.preventDefault(),He(t)):e.key==="Enter"&&e.target===t&&J(t.dataset.id))};j.addEventListener("click",Ae),j.addEventListener("keydown",qe),c(()=>{j.removeEventListener("click",Ae),j.removeEventListener("keydown",qe)}),Ue(u,{id:"theme-view-site",icon:"external-link",title:"View site",onClick:()=>window.open("/","_blank","noopener")}),Ue(u,{id:"theme-save",icon:"save",title:"Save (Ctrl+S)",onClick:()=>de()});const Ne=e=>{!(e.ctrlKey||e.metaKey)||e.key!=="s"||L.size||(e.preventDefault(),e.stopImmediatePropagation(),de())};document.addEventListener("keydown",Ne,!0),c(()=>document.removeEventListener("keydown",Ne,!0));const De=()=>{if(H.peek())try{S.set(F,{form:ne(),base:U.peek(),at:new Date().toISOString()})}catch{}},Le=e=>{H.peek()&&(De(),e.preventDefault(),e.returnValue="")};window.addEventListener("beforeunload",Le),c(()=>window.removeEventListener("beforeunload",Le)),C={dirty:()=>H.peek(),dispose(){te=!0,De(),[...L].forEach(e=>{try{e.close(!0)}catch{}}),y.splice(0).reverse().forEach(e=>{try{e()}catch{}})}},I.scan(d),W();let q=null;try{q=S.get(F)}catch{}if(q?.form){try{S.remove?S.remove(F):S.set(F,null)}catch{}const e=q.base&&q.base!==U.peek(),t=q.at?` (${Tt(q.at)})`:"",o=e?`You left unsaved theme changes${t}, but the saved settings have changed since. Restore your version anyway?`:`You left unsaved theme changes${t}. Restore them?`;if(await E.confirm(o)&&N()){const a={...Z(f.peek()),...q.form};a.overrides=(a.overrides||[]).map(r=>X(r));for(const[r,m]of Object.entries(a))n[r]&&(n[r].value=m)}}}};
@@ -252,10 +252,63 @@ A header is never drawn: `title`, `subtitle`, `icon`, `image` and `layout` are i
252
252
 
253
253
  ---
254
254
 
255
+ ## `[background]`
256
+
257
+ Set the page backdrop with a bare or self-closing tag, anywhere in the page body:
258
+
259
+ ```text
260
+ [background preset="lavender-haze" /]
261
+ [background color="#f6f4fc" /]
262
+ ```
263
+
264
+ A page background overrides **Content > Theme > Site background**. Remove the page tag to inherit the
265
+ site default again. With no site background configured, the selected theme supplies its normal background.
266
+ The last valid page background tag wins. Tags in code examples and comments do not affect the page.
267
+
268
+ Use an opening and closing pair for a section. Sections can nest and contain grids, cards and columns:
269
+
270
+ ```text
271
+ [background preset="lavender-haze"]
272
+ [card title="Services"]
273
+ [grid cols="2" gap="3"]
274
+ [card title="Consulting"]First service.[/card]
275
+ [card title="Development"]Second service.[/card]
276
+ [/grid]
277
+ [/card]
278
+ [/background]
279
+ ```
280
+
281
+ In the Page Editor choose **Insert > Layout > Background**, or right-click a background tag and choose
282
+ **Edit Background**. The slideover offers preset swatches, colour pickers, a live preview and page/section
283
+ scope. Selecting content before insertion starts a section around that content. Editing a tag preserves its
284
+ existing body, including nested grids and cards.
285
+
286
+ | Attribute | Values / purpose |
287
+ |---|---|
288
+ | `preset` | `lavender-haze`, `aurora`, `peach-mist`, `ocean`, `sunset`, `spotlight` |
289
+ | `type` | `solid`, `linear`, `radial`, `glow` |
290
+ | `color` | Base hex colour or theme name: `background`, `surface`, `primary`, `secondary`, `success`, `info`, `warning`, `danger` |
291
+ | `colors` | Two to four comma-separated colours; optional stop positions, such as `#41345b 0%,#a8d4e3 65%,#fff 100%` |
292
+ | `angle` | Linear gradient angle in degrees, 0-360 |
293
+ | `x`, `y` | Radial focal position, or the first glow's position, in percent, 0-100; the second glow mirrors `x` |
294
+ | `spread` | Radial/glow spread, 10-150 percent |
295
+ | `strength` | Glow colour strength, 0-100 percent |
296
+
297
+ Preset attributes can be overridden individually, for example `[background preset="lavender-haze" strength="60" /]`.
298
+ Soft glow uses the first two colours. These are static CSS gradients with no image download or animation.
299
+ Backgrounds preserve the page's text colours; choose a preset that suits the active theme and check the preview.
300
+ Custom site CSS retains precedence. Section backgrounds stay within the width of their parent and add responsive padding.
301
+
255
302
  ## `[grid]` / `[row]` with `[col]`
256
303
 
257
304
  Lay out content in multi-column grids using Domma's native CSS Grid system.
258
305
 
306
+ Grids, rows and columns can nest, including `[grid]` inside another `[grid]`. Each grid keeps its own
307
+ columns, gap, responsive stacking and IDs. Cards can sit inside a grid inside another card, directly or
308
+ inside `[col]`. Keep closing tags in reverse opening order. Use the editor's attribute form on the desired
309
+ opening tag to edit that container independently. Balanced structural nesting is supported to 64 levels.
310
+
311
+
259
312
  ### Grid (explicit column count)
260
313
 
261
314
  ```
@@ -1848,7 +1901,7 @@ nesting behaviour:
1848
1901
  28. `[button]`
1849
1902
  29. `[link]`
1850
1903
  30. `[cta]`
1851
- 31. `[grid]` / `[row]` / `[col]`
1904
+ 31. `[background]` sections / `[grid]` / `[row]` / `[col]`
1852
1905
  32. `[card]` / `[box]`
1853
1906
  33. `[banner]`
1854
1907
  34. `[slideover]`
@@ -1862,8 +1915,7 @@ Container tags render their own bodies as they go: effect wrappers, `[tabs]`, `[
1862
1915
  all of them. `[center]` leaves its body as Markdown for the later stages, so anything processed after it works
1863
1916
  inside it. Tags processed before a container (components, collections, views, blocks, menus) are already HTML by
1864
1917
  the time the container sees them, so they can be nested anywhere. `[banner]` runs after `[card]` and `[grid]`, so
1865
- it cannot be nested inside a container that has already rendered its body. Do not nest `[slideover]` inside another `[slideover]`, or a `[box]`
1866
- inside another `[box]`.
1918
+ it cannot be nested inside a container that has already rendered its body. Do not nest `[slideover]` inside another `[slideover]`. Cards, boxes, grids, rows, columns and background sections support balanced nesting.
1867
1919
 
1868
1920
  ### Optional Christmas elf scenes
1869
1921