domma-cms 1.13.2 → 1.15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.15.0] - 2026-10-29
4
+
5
+ - The "Reduce motion" control has its own Site Settings tab, beside Breadcrumbs: show it, its label, and what a new visitor gets (follow their device, full motion, or calm). Placement puts it in the footer as before (a switch or a checkbox), as a floating button in a chosen corner (offsets, size and corners, Search's limits), or at the end of the navbar. A floating button sharing a corner with Search, Back to top or the theme switcher stacks clear of it; it defaults to the bottom left, clear of both. Stored as `site.json` `motion` (`server/services/motionSettings.js`); a site without it keeps reading `footer.showMotionToggle` / `motionDefault` / `motionControl`, which Site Settings still writes as a mirror, so nothing changes until the tab is saved. The visitor's choice is still the one `domma:reduced_motion` preference.
6
+
7
+ ## [1.14.0] - 2026-10-29
8
+
9
+ - Page editor: **Highlight text** is on the Insert and Wrap menus (Content) - the [text] dialog with a gradient and a shine already chosen, its highlight choices first and the colours shown in the preview. Right-click a `[text]` tag for one-click Highlight, sweeping Highlight, Light up as you read, Rise in word by word, and Plain.
10
+
3
11
  ## [1.13.2] - 2026-10-29
4
12
 
5
13
  - Menus: the Segmented thumb and Underline glide measure the bar's layout, not its on-screen box, so a page that fades and scales in no longer leaves the thumb short and off to one side.
@@ -1,3 +1,3 @@
1
- import{SHORTCODES as M}from"./shortcode-registry.js";import{EFFECTS as L,CELEBRATION_THEMES as J,getEffectAttrs as D}from"./effect-defs.js";import{boolState as Q,boolValue as Z,findEnclosingShortcode as ee,setAttr as N,setAttrs as W,effectAttrKeys as te}from"./shortcode-tags.js";import{insertAtCursor as R,replaceRange as ne}from"./markdown-toolbar.js";import{clearLookupCache as oe,lookupOptions as se}from"./shortcode-lookups.js";import{insertMenuGroups as ie,insertShortcodeByName as ae}from"./shortcode-insert.js";import{openShortcodeForm as A}from"./shortcode-form.js";import{pickMedia as ce}from"./media-picker.js";import{blockTagSnippet as le}from"./block-tags.js";import{catalogueNow as re,dommaHelp as de}from"./domma-catalogue.js";function pe(e){return se(e,l?.span?.attrs||{})}const me=M.map(e=>({name:e.name,selfClosing:!!e.selfClosing})),j=new Map(M.map(e=>[e.name,e])),z=new Map(L.map(e=>[e.name,e])),ue=L.map(e=>({name:e.name,selfClosing:!!e.selfClosing})),fe=[...me,...ue],F=new Set(["card","box","hero","banner","col","button"]);let l=null;const Y="position:fixed;z-index:10000;min-width:210px;max-height:70vh;overflow-y:auto;background:var(--dm-surface,#1c1c30);border:1px solid var(--dm-border,#2a2a40);border-radius:6px;box-shadow:var(--dm-shadow-lg);padding:.3rem;font-size:.83rem;color:var(--dm-text,#e5e5e5);",u="display:flex;align-items:center;gap:.5rem;width:100%;text-align:left;padding:.35rem .55rem;border:none;background:transparent;color:inherit;border-radius:4px;cursor:pointer;font-size:.83rem;",T="padding:.3rem .55rem;color:var(--dm-text-muted,#8a8a9a);font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;",P="flex:1;min-width:0;padding:.2rem .4rem;background:var(--dm-input-bg,#12121e);border:1px solid var(--dm-border,#333);border-radius:3px;color:var(--dm-text,#eee);font-size:.8rem;",he="height:1px;background:var(--dm-border,#2a2a40);margin:.3rem .2rem;";function h(e){return e.addEventListener("mouseenter",()=>{e.style.background="var(--dm-primary,#4338ca)",e.style.color="var(--dm-primary-text,#fff)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent",e.style.color="inherit"}),e}export function attachContextMenu(e,{blocks:t=()=>[],openBlock:n=null}={}){const o=()=>{const i=t()||[],s=i.filter(c=>c.shortTag&&!j.has(c.name)&&!z.has(c.name));return{defs:i,specs:[...fe,...s.map(c=>({name:c.name,selfClosing:!0}))]}},a=(i,s)=>{p();const{defs:c,specs:r}=o();V(e,ee(e,r),i,s,c,n)};return typeof Domma>"u"||!Domma.elements?.contextMenu?(e.addEventListener("contextmenu",i=>{i.preventDefault(),a(i.clientX,i.clientY)}),null):Domma.elements.contextMenu(e,{inherit:!1,cursor:!1,render:i=>{a(i.x,i.y)}})}function p(){l&&(k(),l.root.remove(),document.removeEventListener("mousedown",q,!0),document.removeEventListener("keydown",K,!0),window.removeEventListener("scroll",U,!0),l=null)}const q=e=>{l&&!l.root.contains(e.target)&&!(l.submenu&&l.submenu.contains(e.target))&&p()},U=e=>{l&&!l.root.contains(e.target)&&!(l.submenu&&l.submenu.contains(e.target))&&p()},K=e=>{e.key==="Escape"&&p()};function V(e,t,n,o,a=[],i=null){oe();const s=document.createElement("div");s.className="dm-sc-menu",s.style.cssText=Y,l={root:s,textarea:e,span:t,submenu:null,blocks:a,openBlock:i,keepEmpty:!1};const c=new Map(a.map(b=>[b.name,b])),r=t&&(j.get(t.name)||z.get(t.name)),d=t&&(r?t.name==="block"?c.get(String(t.attrs.template||"")):null:c.get(t.name)),x=t&&F.has(t.name)?L.filter(b=>b.name in t.attrs):[];r&&xe(s,r),d&&be(s,d,!!r);for(const b of x)ke(s,b);(r||d||x.length)&&s.appendChild(_()),s.appendChild(y("Celebrations\u2026",()=>Le())),s.appendChild(y("Add effect\u2026",()=>_e())),s.appendChild(y("Insert\u2026",()=>Se()));const m=e.selectionStart!==e.selectionEnd;(t||m)&&s.appendChild(y(m?"Wrap selection in\u2026":"Wrap in\u2026",()=>Ae())),a.length&&(s.appendChild(_()),s.appendChild(y("Add block\u2026",()=>$e()))),document.body.appendChild(s),X(s,n,o),document.addEventListener("mousedown",q,!0),document.addEventListener("keydown",K,!0),window.addEventListener("scroll",U,!0),window.I&&I.scan(s)}function _(){const e=document.createElement("div");return e.style.cssText=he,e}function v(e){const t=document.createElement("div");return t.style.cssText=T,t.textContent=e,t}function xe(e,t){e.appendChild(v(`${t.label} options`));const n=h(document.createElement("button"));n.type="button",n.style.cssText=u,n.innerHTML='<span data-icon="edit" data-icon-size="13" style="display:inline-flex;align-items:center;"></span>',n.appendChild(document.createTextNode(`Edit ${t.label}\u2026`)),n.addEventListener("click",()=>{const{textarea:i,span:s}=l;p(),A(i,{...t,attrs:D(t,s.attrs)},{span:s})}),e.appendChild(n);for(const i of t.actions||[]){const s=h(document.createElement("button"));s.type="button",s.style.cssText=u,s.innerHTML=`<span data-icon="${i.icon||"zap"}" data-icon-size="13" style="display:inline-flex;align-items:center;"></span>`,s.appendChild(document.createTextNode(i.label)),s.addEventListener("click",()=>{const{textarea:c,span:r}=l;if(i.remove){ne(c,r.openTagStart,r.openTagEnd,""),p();return}l.span=W(c,r,i.set||{}),p()}),e.appendChild(s)}const o=Array.isArray(t.quickAttrs)?new Set(t.quickAttrs):null,a=D(t,l.span.attrs).filter(i=>!o||o.has(i.name));(t.actions||[]).length&&a.length&&e.appendChild(_());for(const i of a)e.appendChild(H(i))}function be(e,t,n){const{span:o}=l;if(l.keepEmpty=!0,n&&e.appendChild(_()),e.appendChild(v(n?`${t.name} parameters`:`${t.name} block`)),t.description&&!n){const s=document.createElement("div");s.style.cssText="padding:0 .55rem .3rem;font-size:.75rem;color:var(--dm-text-muted,#9a9aac);max-width:260px;",s.textContent=t.description,e.appendChild(s)}const a=(s,c,r)=>{const d=h(document.createElement("button"));d.type="button",d.style.cssText=u,d.innerHTML=`<span data-icon="${s}" data-icon-size="13" style="display:inline-flex;align-items:center;"></span>`,d.appendChild(document.createTextNode(c)),d.addEventListener("click",r),e.appendChild(d)};t.attrs.length&&a("edit","Edit parameters\u2026",()=>{const{textarea:s}=l;p(),A(s,{...t,name:o.name,label:t.name},{span:o})});const{openBlock:i}=l;a(i?"layout":"external-link",i?"Edit the block":"Open the block",()=>{p(),i?i(t.name):location.hash=`#/blocks/edit/${encodeURIComponent(t.name)}`});for(const s of t.attrs)e.appendChild(H(s));if(!t.attrs.length){const s=document.createElement("div");s.style.cssText=T+"text-transform:none;letter-spacing:0;",s.textContent="This block takes no parameters.",e.appendChild(s)}}function H(e,t=e.name){const n=ye(e,t),o=e.domma?de(re(),e):"";return o&&n&&!n.title&&(n.title=o),n}function ye(e,t){const n=l.span.attrs[t];switch(e.type){case"checkbox":return Ee(e,t,Q(n,e.default));case"select":return ve(e,t,n);case"lookup":return Te(e,t,n);case"colour":return Ce(e,t,n);case"icon":return we(e,t,n);default:return ge(e,t,n)}}function w(e,t){if(l.span=N(l.textarea,l.span,e,l.keepEmpty&&t==null?"":t,{keepEmpty:l.keepEmpty}),e==="theme"){const{textarea:n,span:o,root:a}=l,i=a.getBoundingClientRect(),{blocks:s,openBlock:c}=l;p(),V(n,o,i.left,i.top,s,c)}}function Ee(e,t,n){const o=h(document.createElement("label"));o.style.cssText=u;const a=document.createElement("input");return a.type="checkbox",a.checked=n,a.addEventListener("change",()=>w(t,Z(e,a.checked))),o.appendChild(a),o.appendChild(document.createTextNode(e.label)),o}function ge(e,t,n){const o=document.createElement("div");o.style.cssText=u+"cursor:default;";const a=document.createElement("span");a.textContent=e.label,a.style.cssText="white-space:nowrap;color:var(--dm-text-muted,#9a9aac);";const i=document.createElement("input");i.type=e.type==="number"?"number":"text",i.value=n===!0||n==null?"":n,e.default!=null&&e.default!==""&&(i.placeholder=String(e.default)),i.style.cssText=P;let s=null;if(i.addEventListener("input",()=>{clearTimeout(s),s=setTimeout(()=>w(t,i.value.trim()),180)}),i.addEventListener("mousedown",c=>c.stopPropagation()),o.appendChild(a),o.appendChild(i),e.type==="image"){const c=document.createElement("button");c.type="button",c.textContent="Browse",c.title="Choose from Media",c.style.cssText="padding:2px 8px;background:transparent;border:1px solid var(--dm-border,#333);border-radius:4px;color:inherit;cursor:pointer;flex-shrink:0;font:inherit;",c.addEventListener("mousedown",r=>r.stopPropagation()),c.addEventListener("click",async()=>{const{textarea:r,span:d}=l;p();const x=await ce({current:i.value.trim()});x&&r.isConnected&&N(r,d,t,x)}),o.appendChild(c)}return o}function Ce(e,t,n){const o=document.createElement("div");o.style.cssText=u+"cursor:default;";const a=document.createElement("span");a.textContent=e.label,a.style.flex="1";const i=document.createElement("input");return i.type="color",typeof n=="string"&&/^#/.test(n)?i.value=n:typeof e.default=="string"&&/^#/.test(e.default)&&(i.value=e.default),i.addEventListener("input",()=>w(t,i.value)),o.appendChild(a),o.appendChild(i),o}function ve(e,t,n){const o=n==null||n===!0?e.default??"":n;return y(`${e.label}${o!==""?`: ${o}`:""}`,()=>{const a=g();for(const[i,s]of e.options||[]){const c=h(document.createElement("button"));c.type="button",c.style.cssText=u,c.textContent=s,i===o&&(c.style.fontWeight="700"),c.addEventListener("click",()=>{w(t,i),k()}),a.appendChild(c)}return a})}function we(e,t,n){const o=n==null||n===!0?"":String(n),a=o?`${e.label}: ${o}`:e.label;return y(a,()=>{const i=g();i.style.width="232px";const s=document.createElement("input");s.type="text",s.placeholder="Search icons\u2026",s.style.cssText=P+"margin:6px;width:calc(100% - 12px);",s.addEventListener("mousedown",b=>b.stopPropagation()),i.appendChild(s);const c=h(document.createElement("button"));c.type="button",c.style.cssText=u,c.textContent="- none -",o||(c.style.fontWeight="700"),c.addEventListener("click",()=>{w(t,null),k()}),i.appendChild(c);const r=document.createElement("div");r.style.cssText="display:flex;flex-wrap:wrap;gap:2px;padding:4px 6px;max-height:220px;overflow-y:auto;",i.appendChild(r);const d=96,x=()=>{const b=typeof I<"u"&&typeof I.list=="function"?I.list():[],O=s.value.trim().toLowerCase(),S=O?b.filter(f=>f.toLowerCase().includes(O)):b;r.replaceChildren();for(const f of S.slice(0,d)){const C=h(document.createElement("button"));C.type="button",C.title=f,C.style.cssText="width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid transparent;border-radius:4px;cursor:pointer;color:inherit;",f===o&&(C.style.borderColor="var(--dm-primary,#5b8cff)");const $=document.createElement("span");$.setAttribute("data-icon",f),$.setAttribute("data-icon-size","15"),$.style.cssText="display:inline-flex;align-items:center;",C.appendChild($),C.addEventListener("click",()=>{w(t,f),k()}),r.appendChild(C)}if(S.length>d){const f=document.createElement("div");f.style.cssText=T,f.textContent=`${S.length-d} more - refine search`,r.appendChild(f)}if(!S.length){const f=document.createElement("div");f.style.cssText=T,f.textContent="No icons match",r.appendChild(f)}window.I&&I.scan(r)};let m=null;return s.addEventListener("input",()=>{clearTimeout(m),m=setTimeout(x,120)}),x(),setTimeout(()=>s.focus(),0),i})}function Te(e,t,n){const o=n==null||n===!0?e.default??"":n;return y(`${e.label}${o!==""?`: ${o}`:""}`,()=>{const a=g();a.style.minHeight="48px";const i=typeof E<"u"&&E.loader?E.loader(a,{type:"dots"}):null;return pe(e.source).then(s=>{if(i&&i.destroy(),!l||l.submenu!==a)return;if(a.style.minHeight="",!s.length){const d=document.createElement("div");d.style.cssText=T,d.textContent="Nothing found",a.appendChild(d)}const c=s.some(([d])=>d===o),r=[["","- none -"],...s];o!==""&&!c&&r.push([o,`${o} (missing)`]);for(const[d,x]of r){const m=h(document.createElement("button"));m.type="button",m.style.cssText=u,m.textContent=x,d===o&&(m.style.fontWeight="700"),m.addEventListener("click",()=>{w(t,d===""?null:d),k()}),a.appendChild(m)}}),a})}function ke(e,t){e.appendChild(v(`Effect: ${t.label}`));for(const o of t.attrs||[])e.appendChild(H(o,`${t.name}-${o.name}`));const n=h(document.createElement("button"));n.type="button",n.style.cssText=u,n.innerHTML='<span data-icon="trash" data-icon-size="13" style="display:inline-flex;align-items:center;"></span> Remove effect',n.addEventListener("click",()=>{const o={};for(const a of te(l.span.attrs,t.name))o[a]=null;W(l.textarea,l.span,o),p()}),e.appendChild(n)}function Le(){const e=g();e.appendChild(v("Seasonal themes"));for(const[t,n]of[["auto","Auto (date-detected)"],...Object.entries(J).map(([o,a])=>[o,a.label])]){const o=h(document.createElement("button"));o.type="button",o.style.cssText=u,o.textContent=n,o.addEventListener("click",()=>{R(l.textarea,`[celebrate theme="${t}" /]`),p()}),e.appendChild(o)}e.appendChild(_()),e.appendChild(v("Celebration effects"));for(const t of["butterflies","ticker-tape","firework","fireworks"]){const n=z.get(t),o=h(document.createElement("button"));o.type="button",o.style.cssText=u,o.textContent=n.label,o.addEventListener("click",()=>{const a=l.textarea;p(),A(a,n)}),e.appendChild(o)}return e}function _e(){const e=g(),t=l.span,n=t&&F.has(t.name)?t.name:null;for(const o of[...new Set(L.map(a=>a.category))]){const a=L.filter(i=>i.category===o);if(a.length){e.appendChild(v(o));for(const i of a){const s=n&&(i.hosts||[]).includes(n)&&!(i.name in t.attrs),c=h(document.createElement("button"));if(c.type="button",c.style.cssText=u+"justify-content:space-between;",c.appendChild(document.createTextNode(i.label)),s){const r=document.createElement("span");r.textContent=`inject \u2192 [${n}]`,r.style.cssText="opacity:.6;font-size:.7rem;",c.appendChild(r)}c.addEventListener("click",()=>{if(s)N(l.textarea,l.span,i.name,!0);else{const r=i.selfClosing?`[${i.name} /]`:`[${i.name}]
1
+ import{EDITOR_TOOLS as Q,SHORTCODES as N}from"./shortcode-registry.js";import{EFFECTS as L,CELEBRATION_THEMES as Z,getEffectAttrs as D}from"./effect-defs.js";import{boolState as ee,boolValue as te,findEnclosingShortcode as ne,setAttr as R,setAttrs as W,effectAttrKeys as oe}from"./shortcode-tags.js";import{insertAtCursor as z,replaceRange as se}from"./markdown-toolbar.js";import{clearLookupCache as ie,lookupOptions as ae}from"./shortcode-lookups.js";import{insertMenuGroups as ce,insertShortcodeByName as j}from"./shortcode-insert.js";import{openShortcodeForm as A}from"./shortcode-form.js";import{pickMedia as le}from"./media-picker.js";import{blockTagSnippet as re}from"./block-tags.js";import{catalogueNow as de,dommaHelp as pe}from"./domma-catalogue.js";function me(e){return ae(e,l?.span?.attrs||{})}const ue=N.map(e=>({name:e.name,selfClosing:!!e.selfClosing})),F=new Map(N.map(e=>[e.name,e])),O=new Map(L.map(e=>[e.name,e])),fe=L.map(e=>({name:e.name,selfClosing:!!e.selfClosing})),he=[...ue,...fe],Y=new Set(["card","box","hero","banner","col","button"]);let l=null;const q="position:fixed;z-index:10000;min-width:210px;max-height:70vh;overflow-y:auto;background:var(--dm-surface,#1c1c30);border:1px solid var(--dm-border,#2a2a40);border-radius:6px;box-shadow:var(--dm-shadow-lg);padding:.3rem;font-size:.83rem;color:var(--dm-text,#e5e5e5);",u="display:flex;align-items:center;gap:.5rem;width:100%;text-align:left;padding:.35rem .55rem;border:none;background:transparent;color:inherit;border-radius:4px;cursor:pointer;font-size:.83rem;",T="padding:.3rem .55rem;color:var(--dm-text-muted,#8a8a9a);font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;",P="flex:1;min-width:0;padding:.2rem .4rem;background:var(--dm-input-bg,#12121e);border:1px solid var(--dm-border,#333);border-radius:3px;color:var(--dm-text,#eee);font-size:.8rem;",xe="height:1px;background:var(--dm-border,#2a2a40);margin:.3rem .2rem;";function h(e){return e.addEventListener("mouseenter",()=>{e.style.background="var(--dm-primary,#4338ca)",e.style.color="var(--dm-primary-text,#fff)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent",e.style.color="inherit"}),e}export function attachContextMenu(e,{blocks:t=()=>[],openBlock:n=null}={}){const o=()=>{const i=t()||[],s=i.filter(c=>c.shortTag&&!F.has(c.name)&&!O.has(c.name));return{defs:i,specs:[...he,...s.map(c=>({name:c.name,selfClosing:!0}))]}},a=(i,s)=>{p();const{defs:c,specs:r}=o();G(e,ne(e,r),i,s,c,n)};return typeof Domma>"u"||!Domma.elements?.contextMenu?(e.addEventListener("contextmenu",i=>{i.preventDefault(),a(i.clientX,i.clientY)}),null):Domma.elements.contextMenu(e,{inherit:!1,cursor:!1,render:i=>{a(i.x,i.y)}})}function p(){l&&(k(),l.root.remove(),document.removeEventListener("mousedown",U,!0),document.removeEventListener("keydown",V,!0),window.removeEventListener("scroll",K,!0),l=null)}const U=e=>{l&&!l.root.contains(e.target)&&!(l.submenu&&l.submenu.contains(e.target))&&p()},K=e=>{l&&!l.root.contains(e.target)&&!(l.submenu&&l.submenu.contains(e.target))&&p()},V=e=>{e.key==="Escape"&&p()};function G(e,t,n,o,a=[],i=null){ie();const s=document.createElement("div");s.className="dm-sc-menu",s.style.cssText=q,l={root:s,textarea:e,span:t,submenu:null,blocks:a,openBlock:i,keepEmpty:!1};const c=new Map(a.map(b=>[b.name,b])),r=t&&(F.get(t.name)||O.get(t.name)),d=t&&(r?t.name==="block"?c.get(String(t.attrs.template||"")):null:c.get(t.name)),x=t&&Y.has(t.name)?L.filter(b=>b.name in t.attrs):[];r&&be(s,r),d&&ye(s,d,!!r);for(const b of x)Le(s,b);(r||d||x.length)&&s.appendChild(_()),s.appendChild(y("Celebrations\u2026",()=>_e())),s.appendChild(y("Add effect\u2026",()=>Se())),s.appendChild(y("Insert\u2026",()=>$e()));const m=e.selectionStart!==e.selectionEnd;(t||m)&&s.appendChild(y(m?"Wrap selection in\u2026":"Wrap in\u2026",()=>Me())),a.length&&(s.appendChild(_()),s.appendChild(y("Add block\u2026",()=>Ae()))),document.body.appendChild(s),J(s,n,o),document.addEventListener("mousedown",U,!0),document.addEventListener("keydown",V,!0),window.addEventListener("scroll",K,!0),window.I&&I.scan(s)}function _(){const e=document.createElement("div");return e.style.cssText=xe,e}function v(e){const t=document.createElement("div");return t.style.cssText=T,t.textContent=e,t}function be(e,t){e.appendChild(v(`${t.label} options`));const n=h(document.createElement("button"));n.type="button",n.style.cssText=u,n.innerHTML='<span data-icon="edit" data-icon-size="13" style="display:inline-flex;align-items:center;"></span>',n.appendChild(document.createTextNode(`Edit ${t.label}\u2026`)),n.addEventListener("click",()=>{const{textarea:i,span:s}=l;p(),A(i,{...t,attrs:D(t,s.attrs)},{span:s})}),e.appendChild(n);for(const i of t.actions||[]){const s=h(document.createElement("button"));s.type="button",s.style.cssText=u,s.innerHTML=`<span data-icon="${i.icon||"zap"}" data-icon-size="13" style="display:inline-flex;align-items:center;"></span>`,s.appendChild(document.createTextNode(i.label)),s.addEventListener("click",()=>{const{textarea:c,span:r}=l;if(i.remove){se(c,r.openTagStart,r.openTagEnd,""),p();return}l.span=W(c,r,i.set||{}),p()}),e.appendChild(s)}const o=Array.isArray(t.quickAttrs)?new Set(t.quickAttrs):null,a=D(t,l.span.attrs).filter(i=>!o||o.has(i.name));(t.actions||[]).length&&a.length&&e.appendChild(_());for(const i of a)e.appendChild(H(i))}function ye(e,t,n){const{span:o}=l;if(l.keepEmpty=!0,n&&e.appendChild(_()),e.appendChild(v(n?`${t.name} parameters`:`${t.name} block`)),t.description&&!n){const s=document.createElement("div");s.style.cssText="padding:0 .55rem .3rem;font-size:.75rem;color:var(--dm-text-muted,#9a9aac);max-width:260px;",s.textContent=t.description,e.appendChild(s)}const a=(s,c,r)=>{const d=h(document.createElement("button"));d.type="button",d.style.cssText=u,d.innerHTML=`<span data-icon="${s}" data-icon-size="13" style="display:inline-flex;align-items:center;"></span>`,d.appendChild(document.createTextNode(c)),d.addEventListener("click",r),e.appendChild(d)};t.attrs.length&&a("edit","Edit parameters\u2026",()=>{const{textarea:s}=l;p(),A(s,{...t,name:o.name,label:t.name},{span:o})});const{openBlock:i}=l;a(i?"layout":"external-link",i?"Edit the block":"Open the block",()=>{p(),i?i(t.name):location.hash=`#/blocks/edit/${encodeURIComponent(t.name)}`});for(const s of t.attrs)e.appendChild(H(s));if(!t.attrs.length){const s=document.createElement("div");s.style.cssText=T+"text-transform:none;letter-spacing:0;",s.textContent="This block takes no parameters.",e.appendChild(s)}}function H(e,t=e.name){const n=Ee(e,t),o=e.domma?pe(de(),e):"";return o&&n&&!n.title&&(n.title=o),n}function Ee(e,t){const n=l.span.attrs[t];switch(e.type){case"checkbox":return Ce(e,t,ee(n,e.default));case"select":return we(e,t,n);case"lookup":return ke(e,t,n);case"colour":return ve(e,t,n);case"icon":return Te(e,t,n);default:return ge(e,t,n)}}function w(e,t){if(l.span=R(l.textarea,l.span,e,l.keepEmpty&&t==null?"":t,{keepEmpty:l.keepEmpty}),e==="theme"){const{textarea:n,span:o,root:a}=l,i=a.getBoundingClientRect(),{blocks:s,openBlock:c}=l;p(),G(n,o,i.left,i.top,s,c)}}function Ce(e,t,n){const o=h(document.createElement("label"));o.style.cssText=u;const a=document.createElement("input");return a.type="checkbox",a.checked=n,a.addEventListener("change",()=>w(t,te(e,a.checked))),o.appendChild(a),o.appendChild(document.createTextNode(e.label)),o}function ge(e,t,n){const o=document.createElement("div");o.style.cssText=u+"cursor:default;";const a=document.createElement("span");a.textContent=e.label,a.style.cssText="white-space:nowrap;color:var(--dm-text-muted,#9a9aac);";const i=document.createElement("input");i.type=e.type==="number"?"number":"text",i.value=n===!0||n==null?"":n,e.default!=null&&e.default!==""&&(i.placeholder=String(e.default)),i.style.cssText=P;let s=null;if(i.addEventListener("input",()=>{clearTimeout(s),s=setTimeout(()=>w(t,i.value.trim()),180)}),i.addEventListener("mousedown",c=>c.stopPropagation()),o.appendChild(a),o.appendChild(i),e.type==="image"){const c=document.createElement("button");c.type="button",c.textContent="Browse",c.title="Choose from Media",c.style.cssText="padding:2px 8px;background:transparent;border:1px solid var(--dm-border,#333);border-radius:4px;color:inherit;cursor:pointer;flex-shrink:0;font:inherit;",c.addEventListener("mousedown",r=>r.stopPropagation()),c.addEventListener("click",async()=>{const{textarea:r,span:d}=l;p();const x=await le({current:i.value.trim()});x&&r.isConnected&&R(r,d,t,x)}),o.appendChild(c)}return o}function ve(e,t,n){const o=document.createElement("div");o.style.cssText=u+"cursor:default;";const a=document.createElement("span");a.textContent=e.label,a.style.flex="1";const i=document.createElement("input");return i.type="color",typeof n=="string"&&/^#/.test(n)?i.value=n:typeof e.default=="string"&&/^#/.test(e.default)&&(i.value=e.default),i.addEventListener("input",()=>w(t,i.value)),o.appendChild(a),o.appendChild(i),o}function we(e,t,n){const o=n==null||n===!0?e.default??"":n;return y(`${e.label}${o!==""?`: ${o}`:""}`,()=>{const a=C();for(const[i,s]of e.options||[]){const c=h(document.createElement("button"));c.type="button",c.style.cssText=u,c.textContent=s,i===o&&(c.style.fontWeight="700"),c.addEventListener("click",()=>{w(t,i),k()}),a.appendChild(c)}return a})}function Te(e,t,n){const o=n==null||n===!0?"":String(n),a=o?`${e.label}: ${o}`:e.label;return y(a,()=>{const i=C();i.style.width="232px";const s=document.createElement("input");s.type="text",s.placeholder="Search icons\u2026",s.style.cssText=P+"margin:6px;width:calc(100% - 12px);",s.addEventListener("mousedown",b=>b.stopPropagation()),i.appendChild(s);const c=h(document.createElement("button"));c.type="button",c.style.cssText=u,c.textContent="- none -",o||(c.style.fontWeight="700"),c.addEventListener("click",()=>{w(t,null),k()}),i.appendChild(c);const r=document.createElement("div");r.style.cssText="display:flex;flex-wrap:wrap;gap:2px;padding:4px 6px;max-height:220px;overflow-y:auto;",i.appendChild(r);const d=96,x=()=>{const b=typeof I<"u"&&typeof I.list=="function"?I.list():[],B=s.value.trim().toLowerCase(),S=B?b.filter(f=>f.toLowerCase().includes(B)):b;r.replaceChildren();for(const f of S.slice(0,d)){const g=h(document.createElement("button"));g.type="button",g.title=f,g.style.cssText="width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid transparent;border-radius:4px;cursor:pointer;color:inherit;",f===o&&(g.style.borderColor="var(--dm-primary,#5b8cff)");const $=document.createElement("span");$.setAttribute("data-icon",f),$.setAttribute("data-icon-size","15"),$.style.cssText="display:inline-flex;align-items:center;",g.appendChild($),g.addEventListener("click",()=>{w(t,f),k()}),r.appendChild(g)}if(S.length>d){const f=document.createElement("div");f.style.cssText=T,f.textContent=`${S.length-d} more - refine search`,r.appendChild(f)}if(!S.length){const f=document.createElement("div");f.style.cssText=T,f.textContent="No icons match",r.appendChild(f)}window.I&&I.scan(r)};let m=null;return s.addEventListener("input",()=>{clearTimeout(m),m=setTimeout(x,120)}),x(),setTimeout(()=>s.focus(),0),i})}function ke(e,t,n){const o=n==null||n===!0?e.default??"":n;return y(`${e.label}${o!==""?`: ${o}`:""}`,()=>{const a=C();a.style.minHeight="48px";const i=typeof E<"u"&&E.loader?E.loader(a,{type:"dots"}):null;return me(e.source).then(s=>{if(i&&i.destroy(),!l||l.submenu!==a)return;if(a.style.minHeight="",!s.length){const d=document.createElement("div");d.style.cssText=T,d.textContent="Nothing found",a.appendChild(d)}const c=s.some(([d])=>d===o),r=[["","- none -"],...s];o!==""&&!c&&r.push([o,`${o} (missing)`]);for(const[d,x]of r){const m=h(document.createElement("button"));m.type="button",m.style.cssText=u,m.textContent=x,d===o&&(m.style.fontWeight="700"),m.addEventListener("click",()=>{w(t,d===""?null:d),k()}),a.appendChild(m)}}),a})}function Le(e,t){e.appendChild(v(`Effect: ${t.label}`));for(const o of t.attrs||[])e.appendChild(H(o,`${t.name}-${o.name}`));const n=h(document.createElement("button"));n.type="button",n.style.cssText=u,n.innerHTML='<span data-icon="trash" data-icon-size="13" style="display:inline-flex;align-items:center;"></span> Remove effect',n.addEventListener("click",()=>{const o={};for(const a of oe(l.span.attrs,t.name))o[a]=null;W(l.textarea,l.span,o),p()}),e.appendChild(n)}function _e(){const e=C();e.appendChild(v("Seasonal themes"));for(const[t,n]of[["auto","Auto (date-detected)"],...Object.entries(Z).map(([o,a])=>[o,a.label])]){const o=h(document.createElement("button"));o.type="button",o.style.cssText=u,o.textContent=n,o.addEventListener("click",()=>{z(l.textarea,`[celebrate theme="${t}" /]`),p()}),e.appendChild(o)}e.appendChild(_()),e.appendChild(v("Celebration effects"));for(const t of["butterflies","ticker-tape","firework","fireworks"]){const n=O.get(t),o=h(document.createElement("button"));o.type="button",o.style.cssText=u,o.textContent=n.label,o.addEventListener("click",()=>{const a=l.textarea;p(),A(a,n)}),e.appendChild(o)}return e}function Se(){const e=C(),t=l.span,n=t&&Y.has(t.name)?t.name:null;for(const o of[...new Set(L.map(a=>a.category))]){const a=L.filter(i=>i.category===o);if(a.length){e.appendChild(v(o));for(const i of a){const s=n&&(i.hosts||[]).includes(n)&&!(i.name in t.attrs),c=h(document.createElement("button"));if(c.type="button",c.style.cssText=u+"justify-content:space-between;",c.appendChild(document.createTextNode(i.label)),s){const r=document.createElement("span");r.textContent=`inject \u2192 [${n}]`,r.style.cssText="opacity:.6;font-size:.7rem;",c.appendChild(r)}c.addEventListener("click",()=>{if(s)R(l.textarea,l.span,i.name,!0);else{const r=i.selfClosing?`[${i.name} /]`:`[${i.name}]
2
2
  Content
3
- [/${i.name}]`;R(l.textarea,r)}p()}),e.appendChild(c)}}}return e}function y(e,t){const n=h(document.createElement("button"));n.type="button",n.style.cssText=u+"justify-content:space-between;",n.appendChild(document.createTextNode(e));const o=document.createElement("span");return o.setAttribute("data-icon","chevron-right"),o.setAttribute("data-icon-size","12"),o.style.cssText="opacity:.6;display:inline-flex;align-items:center;flex-shrink:0;",n.appendChild(o),n.addEventListener("mouseenter",()=>G(n,t)),n.addEventListener("click",a=>{a.stopPropagation(),G(n,t)}),n}function g(){const e=document.createElement("div");return e.className="dm-sc-submenu",e.style.cssText=Y,e}function G(e,t){k();const n=t();l.submenu=n,document.body.appendChild(n);const o=e.getBoundingClientRect();X(n,o.right+2,o.top,o.left-2),window.I&&I.scan(n)}function k(){l&&l.submenu&&(l.submenu.remove(),l.submenu=null)}function B(e){const t=h(document.createElement("button"));if(t.type="button",t.style.cssText=u,e.icon){const n=document.createElement("span");n.setAttribute("data-icon",e.icon),n.setAttribute("data-icon-size","14"),n.style.cssText="opacity:.75;display:inline-flex;align-items:center;flex-shrink:0;",t.appendChild(n)}return t.appendChild(document.createTextNode(e.label)),t}function Se(){const e=g();for(const{category:t,items:n}of ie()){e.appendChild(v(t));for(const o of n){const a=B(o);a.addEventListener("click",()=>{const i=l.textarea;p(),ae(o.name,i)}),e.appendChild(a)}}return e}function $e(){const e=g();e.style.maxWidth="320px";const t=document.createElement("input");t.type="text",t.placeholder="Find a block\u2026",t.style.cssText=P+"margin:6px;width:calc(100% - 12px);",t.addEventListener("mousedown",a=>a.stopPropagation());const n=document.createElement("div");e.append(t,n);const o=()=>{const a=t.value.trim().toLowerCase(),i=l.blocks.filter(s=>!a||s.name.includes(a)||s.description.toLowerCase().includes(a));n.replaceChildren();for(const s of i){const c=B(s);if(s.description&&(c.title=s.description),!s.shortTag){const r=document.createElement("small");r.style.cssText="margin-left:auto;opacity:.6;",r.textContent="[block]",r.title='A built-in shortcode has this name, so it goes in as [block template="\u2026"]',c.appendChild(r)}c.addEventListener("click",()=>{const r=l.textarea;p();const d=r.selectionStart,x=le(s);R(r,x);const m=x.indexOf('=""');m>=0&&r.setSelectionRange(d+m+2,d+m+2),r.focus()}),n.appendChild(c)}if(!i.length){const s=document.createElement("div");s.style.cssText=T,s.textContent="No blocks match",n.appendChild(s)}window.I&&I.scan(n)};return t.addEventListener("input",o),o(),setTimeout(()=>t.focus(),0),e}function Ae(){const e=g();for(const t of M.filter(n=>n.wrappable||n.container)){const n=B(t);n.addEventListener("click",()=>{const o=l.textarea;p(),A(o,t)}),e.appendChild(n)}return e}function X(e,t,n,o){e.style.left="0px",e.style.top="0px";const a=e.getBoundingClientRect();let i=t;t+a.width>window.innerWidth-8&&(i=o!=null?o-a.width:t-a.width);let s=n;n+a.height>window.innerHeight-8&&(s=Math.max(8,window.innerHeight-a.height-8)),e.style.left=`${Math.max(8,i)}px`,e.style.top=`${Math.max(8,s)}px`}
3
+ [/${i.name}]`;z(l.textarea,r)}p()}),e.appendChild(c)}}}return e}function y(e,t){const n=h(document.createElement("button"));n.type="button",n.style.cssText=u+"justify-content:space-between;",n.appendChild(document.createTextNode(e));const o=document.createElement("span");return o.setAttribute("data-icon","chevron-right"),o.setAttribute("data-icon-size","12"),o.style.cssText="opacity:.6;display:inline-flex;align-items:center;flex-shrink:0;",n.appendChild(o),n.addEventListener("mouseenter",()=>X(n,t)),n.addEventListener("click",a=>{a.stopPropagation(),X(n,t)}),n}function C(){const e=document.createElement("div");return e.className="dm-sc-submenu",e.style.cssText=q,e}function X(e,t){k();const n=t();l.submenu=n,document.body.appendChild(n);const o=e.getBoundingClientRect();J(n,o.right+2,o.top,o.left-2),window.I&&I.scan(n)}function k(){l&&l.submenu&&(l.submenu.remove(),l.submenu=null)}function M(e){const t=h(document.createElement("button"));if(t.type="button",t.style.cssText=u,e.icon){const n=document.createElement("span");n.setAttribute("data-icon",e.icon),n.setAttribute("data-icon-size","14"),n.style.cssText="opacity:.75;display:inline-flex;align-items:center;flex-shrink:0;",t.appendChild(n)}return t.appendChild(document.createTextNode(e.label)),t}function $e(){const e=C();for(const{category:t,items:n}of ce()){e.appendChild(v(t));for(const o of n){const a=M(o);a.addEventListener("click",()=>{const i=l.textarea;p(),j(o.name,i)}),e.appendChild(a)}}return e}function Ae(){const e=C();e.style.maxWidth="320px";const t=document.createElement("input");t.type="text",t.placeholder="Find a block\u2026",t.style.cssText=P+"margin:6px;width:calc(100% - 12px);",t.addEventListener("mousedown",a=>a.stopPropagation());const n=document.createElement("div");e.append(t,n);const o=()=>{const a=t.value.trim().toLowerCase(),i=l.blocks.filter(s=>!a||s.name.includes(a)||s.description.toLowerCase().includes(a));n.replaceChildren();for(const s of i){const c=M(s);if(s.description&&(c.title=s.description),!s.shortTag){const r=document.createElement("small");r.style.cssText="margin-left:auto;opacity:.6;",r.textContent="[block]",r.title='A built-in shortcode has this name, so it goes in as [block template="\u2026"]',c.appendChild(r)}c.addEventListener("click",()=>{const r=l.textarea;p();const d=r.selectionStart,x=re(s);z(r,x);const m=x.indexOf('=""');m>=0&&r.setSelectionRange(d+m+2,d+m+2),r.focus()}),n.appendChild(c)}if(!i.length){const s=document.createElement("div");s.style.cssText=T,s.textContent="No blocks match",n.appendChild(s)}window.I&&I.scan(n)};return t.addEventListener("input",o),o(),setTimeout(()=>t.focus(),0),e}function Me(){const e=C();for(const t of N.filter(n=>n.wrappable||n.container)){const n=M(t);n.addEventListener("click",()=>{const o=l.textarea;p(),A(o,t)}),e.appendChild(n)}for(const t of Q.filter(n=>n.wrappable)){const n=M(t);n.addEventListener("click",()=>{const o=l.textarea;p(),j(t.name,o)}),e.appendChild(n)}return e}function J(e,t,n,o){e.style.left="0px",e.style.top="0px";const a=e.getBoundingClientRect();let i=t;t+a.width>window.innerWidth-8&&(i=o!=null?o-a.width:t-a.width);let s=n;n+a.height>window.innerHeight-8&&(s=Math.max(8,window.innerHeight-a.height-8)),e.style.left=`${Math.max(8,i)}px`,e.style.top=`${Math.max(8,s)}px`}
@@ -1 +1 @@
1
- import{EDITOR_TOOLS as f,SHORTCODES as b}from"./shortcode-registry.js";import{openShortcodeForm as x}from"./shortcode-form.js";import{insertAtCursor as g}from"./markdown-toolbar.js";const h=["Layout","Content","Components","Data","Media"],p={},m={};export function registerCustomInserters(e){Object.assign(p,e)}export function registerInsertDefaults(e){Object.assign(m,e)}export function insertables(){return[...b.filter(e=>!e.child),...f]}export function insertMenuGroups(){const e=insertables();return h.map(t=>({category:t,items:e.filter(n=>n.category===t).sort((n,r)=>n.label.localeCompare(r.label))})).filter(t=>t.items.length)}export function insertShortcodeByName(e,t){const n=insertables().find(r=>r.name===e);if(n){if(n.custom){v(n.custom,t);return}x(t,n,{defaults:m[e]})}}export const BUILTIN_INSERTERS={component:e=>import("./component-inserter.js").then(t=>t.openComponentSlideover(e)).catch(t=>console.error("Component inserter failed to load",t)),embed:e=>import("./embed-builder.js").then(t=>t.EmbedBuilder.open(e)).catch(t=>console.error("Embed builder failed to load",t)),colourpick:e=>C(e)},HOST_INSERTERS=["image","scribe","card","timeline"];function v(e,t){const n=p[e]||BUILTIN_INSERTERS[e];if(!n){console.warn(`No inserter registered for "${e}"`);return}n(t)}function C(e){const t=e.selectionStart;document.getElementById("dm-colour-overlay")?.remove();const n=document.createElement("div");n.id="dm-colour-overlay",n.style.cssText="position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.5);";const r=document.createElement("div");r.style.cssText="background:var(--dm-surface,#1e1e2e);border:1px solid var(--dm-border,#3a3a5c);border-radius:12px;padding:1.75rem 2rem;display:flex;flex-direction:column;align-items:center;gap:1.25rem;min-width:260px;box-shadow:var(--dm-shadow-lg);";const d=document.createElement("p");d.textContent="Colour Picker",d.style.cssText="margin:0;font-weight:700;font-size:1rem;letter-spacing:.02em;";const i=document.createElement("input");i.type="color",i.value="#000000",i.style.cssText="width:160px;height:110px;cursor:pointer;border:none;background:none;padding:0;border-radius:6px;overflow:hidden;";const c=document.createElement("div");c.style.cssText="display:flex;align-items:center;gap:.5rem;";const o=document.createElement("input");o.type="text",o.value="#000000",o.className="form-input",o.style.cssText="font-family:monospace;width:100px;text-transform:uppercase;letter-spacing:.05em;";const s=document.createElement("button");s.type="button",s.className="btn btn-ghost btn-sm",s.textContent="Copy";const a=document.createElement("button");a.type="button",a.className="btn btn-primary btn-sm",a.textContent="Insert";const l=()=>n.remove();i.addEventListener("input",()=>{o.value=i.value}),o.addEventListener("input",()=>{/^#[0-9a-f]{6}$/i.test(o.value)&&(i.value=o.value)}),s.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(o.value)}catch{}s.textContent="Copied!",setTimeout(()=>{s.textContent="Copy"},1500)}),a.addEventListener("click",()=>{e.selectionStart=e.selectionEnd=t,g(e,o.value),l()}),n.addEventListener("click",u=>{u.target===n&&l()}),c.appendChild(o),c.appendChild(s),c.appendChild(a),r.appendChild(d),r.appendChild(i),r.appendChild(c),n.appendChild(r),document.body.appendChild(n)}
1
+ import{EDITOR_TOOLS as g,SHORTCODES as p}from"./shortcode-registry.js";import{openShortcodeForm as m}from"./shortcode-form.js";import{insertAtCursor as x}from"./markdown-toolbar.js";const b=["Layout","Content","Components","Data","Media"],u={},f={};export function registerCustomInserters(e){Object.assign(u,e)}export function registerInsertDefaults(e){Object.assign(f,e)}export function insertables(){return[...p.filter(e=>!e.child),...g]}export function insertMenuGroups(){const e=insertables();return b.map(t=>({category:t,items:e.filter(n=>n.category===t).sort((n,o)=>n.label.localeCompare(o.label))})).filter(t=>t.items.length)}export function insertShortcodeByName(e,t){const n=insertables().find(o=>o.name===e);if(n){if(n.custom){v(n.custom,t);return}m(t,n,{defaults:f[e]})}}export function highlightTextDef(){const e=p.find(o=>o.name==="text"),t=["gradient","shine","light-up","words"],n=[...t.map(o=>e.attrs.find(a=>a.name===o)).filter(Boolean),...e.attrs.filter(o=>!t.includes(o.name))];return{...e,label:"Highlight text",template:"[text]Highlighted words[/text]",attrs:n}}export const BUILTIN_INSERTERS={component:e=>import("./component-inserter.js").then(t=>t.openComponentSlideover(e)).catch(t=>console.error("Component inserter failed to load",t)),embed:e=>import("./embed-builder.js").then(t=>t.EmbedBuilder.open(e)).catch(t=>console.error("Embed builder failed to load",t)),colourpick:e=>C(e),highlighttext:e=>m(e,highlightTextDef(),{defaults:{gradient:"sunset",shine:"hover"}})},HOST_INSERTERS=["image","scribe","card","timeline"];function v(e,t){const n=u[e]||BUILTIN_INSERTERS[e];if(!n){console.warn(`No inserter registered for "${e}"`);return}n(t)}function C(e){const t=e.selectionStart;document.getElementById("dm-colour-overlay")?.remove();const n=document.createElement("div");n.id="dm-colour-overlay",n.style.cssText="position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.5);";const o=document.createElement("div");o.style.cssText="background:var(--dm-surface,#1e1e2e);border:1px solid var(--dm-border,#3a3a5c);border-radius:12px;padding:1.75rem 2rem;display:flex;flex-direction:column;align-items:center;gap:1.25rem;min-width:260px;box-shadow:var(--dm-shadow-lg);";const a=document.createElement("p");a.textContent="Colour Picker",a.style.cssText="margin:0;font-weight:700;font-size:1rem;letter-spacing:.02em;";const i=document.createElement("input");i.type="color",i.value="#000000",i.style.cssText="width:160px;height:110px;cursor:pointer;border:none;background:none;padding:0;border-radius:6px;overflow:hidden;";const c=document.createElement("div");c.style.cssText="display:flex;align-items:center;gap:.5rem;";const r=document.createElement("input");r.type="text",r.value="#000000",r.className="form-input",r.style.cssText="font-family:monospace;width:100px;text-transform:uppercase;letter-spacing:.05em;";const s=document.createElement("button");s.type="button",s.className="btn btn-ghost btn-sm",s.textContent="Copy";const l=document.createElement("button");l.type="button",l.className="btn btn-primary btn-sm",l.textContent="Insert";const d=()=>n.remove();i.addEventListener("input",()=>{r.value=i.value}),r.addEventListener("input",()=>{/^#[0-9a-f]{6}$/i.test(r.value)&&(i.value=r.value)}),s.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(r.value)}catch{}s.textContent="Copied!",setTimeout(()=>{s.textContent="Copy"},1500)}),l.addEventListener("click",()=>{e.selectionStart=e.selectionEnd=t,x(e,r.value),d()}),n.addEventListener("click",h=>{h.target===n&&d()}),c.appendChild(r),c.appendChild(s),c.appendChild(l),o.appendChild(a),o.appendChild(i),o.appendChild(c),n.appendChild(o),document.body.appendChild(n)}
@@ -1 +1 @@
1
- import{buildTextStyle as r}from"../../../public/js/text-style.mjs?v=20261013-cms-fonts";import{buildScribeStyle as i,loadScribeFont as o}from"../../../public/js/scribe-style.mjs?v=20261013-cms-fonts";export const PREVIEW_RENDERERS={scribe:(e,t)=>(o(e.font),{css:i(e),text:t||"Scribe preview text"}),text:(e,t)=>({css:r(e),text:t||"Preview text"})};
1
+ import{buildTextStyle as o,buildTextMotion as n}from"../../../public/js/text-style.mjs?v=20261029-highlight-text";import{buildScribeStyle as c,loadScribeFont as l}from"../../../public/js/scribe-style.mjs?v=20261013-cms-fonts";export const PREVIEW_RENDERERS={scribe:(t,e)=>(l(t.font),{css:c(t),text:e||"Scribe preview text"}),text:(t,e)=>{const r=n(t),i=r.classes.includes("dm-tg")?`${r.style};background-image:linear-gradient(110deg,var(--dm-tg-a),var(--dm-tg-b));-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent`:"";return{css:[o(t),i].filter(Boolean).join(";"),text:e||"Preview text"}}};
@@ -41,7 +41,7 @@ Optional body content.
41
41
  | Product | Price |
42
42
  | ------- | ----: |
43
43
  | 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,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:[["Georgia","Georgia"],["Arial","Arial"],["Verdana","Verdana"],["Courier New","Courier New"],["Times New Roman","Times New Roman"],["Trebuchet MS","Trebuchet MS"]]},{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"]]},{name:"gradient",type:"select",label:"Gradient",options:[["","None"],["brand","Theme"],["sunset","Sunset"],["ocean","Ocean"],["forest","Forest"],["fire","Fire"],["candy","Candy"]]},{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]
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","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:[["Georgia","Georgia"],["Arial","Arial"],["Verdana","Verdana"],["Courier New","Courier New"],["Times New Roman","Times New Roman"],["Trebuchet MS","Trebuchet MS"]]},{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"]]},{name:"gradient",type:"select",label:"Gradient",options:[["","None"],["brand","Theme"],["sunset","Sunset"],["ocean","Ocean"],["forest","Forest"],["fire","Fire"],["candy","Candy"]]},{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
45
  [item]First item[/item]
46
46
  [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"]]},{name:"shrink",type:"select",label:"Shrink on scroll",options:[["","Menu default"],["true","On"],["false","Off"]]},{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:"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 l)e.attrs.some(t=>t.name===a.name)||e.attrs.push(a)}export const EDITOR_TOOLS=[{name:"image",label:"Image",icon:"image-add",category:"Media",custom:"image"},{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"}];
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"]]},{name:"shrink",type:"select",label:"Shrink on scroll",options:[["","Menu default"],["true","On"],["false","Off"]]},{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:"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 l)e.attrs.some(t=>t.name===a.name)||e.attrs.push(a)}export const EDITOR_TOOLS=[{name:"image",label:"Image",icon:"image-add",category:"Media",custom:"image"},{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,3 +1,3 @@
1
- export const TAB_FIELDS={general:["title","tagline","siteUrl","adminHome","spacerSize","bodyClass"],branding:["brandText","brandLogo","brandIcon","brandUrl","adminBrandTitle","adminBrandLogo","adminBrandIcon"],favicon:["favicon"],seo:["seoTitle","seoSeparator","seoDescription"],footer:["footerCopyright","footerLayout","footerBlurb","footerBlocks","footerMotionToggle","footerMotionDefault","footerMotionControl","footerClass","footerSocialClass","footerLook","footerCtaText","footerCtaHighlight","footerCtaUrl","footerCtaSub","footerWatermark","footerStatus","footerFacts","footerTagline","footerEmail","footerAddress","footerGradFrom","footerGradTo","socialTwitter","socialFacebook","socialInstagram","socialLinkedin","socialGithub","socialYoutube"],email:["smtpHost","smtpPort","smtpUser","smtpPass","smtpSecure","smtpInsecureTLS","smtpFromAddress","smtpFromName"],pageNavigation:["bttEnabled","bttSmooth","bttLabel","bttThreshold","bttPosition","bttOffset","bttBottomOffset","gtbEnabled","gtbSmooth","gtbLabel","gtbThreshold","gtbPosition","gtbOffset","gtbBottomOffset"],cookies:["ccEnabled","ccMessage","ccAcceptAll","ccRejectAll","ccCustomize","ccSavePrefs","ccPrivacyText","ccPrivacyUrl","ccCookieText","ccCookieUrl","ccPosition","ccLayout","ccTheme","ccShowFunctional","ccShowAnalytics","ccShowMarketing","ccVersion","ccSettingsLink","ccSettingsLinkText"],analytics:["gaId"],breadcrumbs:["bcEnabled","bcHomeLabel","bcPosition","bcOffsetX","bcOffsetY"]},SECRET_FIELDS=["smtpPass"],BREADCRUMB_POSITIONS=["TL","TR","BL","BR"];export function footerBlockNames(t){return[...new Set(String(t??"").split(/[\s,]+/).map(r=>r.trim().toLowerCase()).filter(Boolean))]}export function gaIdError(t){const r=o(t).trim();return!r||/^G-[A-Z0-9]{4,20}$/i.test(r)?"":"A measurement ID looks like G-XXXXXXXXXX (Google Analytics > Admin > Data streams)."}export const FOOTER_LAYOUTS=["auto","columns","row"],FOOTER_LOOKS=["","showcase"],FOOTER_FACTS_MAX=4;const l=/^(\/|#|https?:\/\/|mailto:)/,m=/^#[0-9a-f]{6}$/i;export function footerShowcaseErrors(t){const r=[],a=o(t.footerCtaUrl).trim();a&&!l.test(a)&&r.push("The footer call to action link must start with /, #, https:// or mailto: (Footer tab).");for(const[e,i]of[["from",t.footerGradFrom],["to",t.footerGradTo]]){const n=o(i).trim();n&&!m.test(n)&&r.push(`The footer gradient "${e}" colour must look like #f26b3a (Footer tab).`)}return r}const o=(t,r="")=>t==null?r:String(t),s=(t,r)=>{const a=Number.parseInt(t,10);return Number.isFinite(a)?a:r};export function homeValue(t){return/^\/[A-Za-z0-9\-_/]*$/.test(t||"")&&String(t).replace(/\/+$/,"")||"/"}export function formFromSettings(t={}){const r=t.backToTop||{},a=t.goToBottom||{},e=t.cookieConsent||{},i=t.breadcrumbs||{};return{title:o(t.title),tagline:o(t.tagline),siteUrl:o(t.baseUrl),adminHome:homeValue(t.adminHome),spacerSize:o(t.layoutOptions?.spacerSize??40),bodyClass:o(t.bodyClass),brandText:o(t.brand?.text),brandLogo:o(t.brand?.logo),brandIcon:o(t.brand?.icon),brandUrl:o(t.brand?.url,"/"),favicon:o(t.favicon),adminBrandTitle:o(t.adminBrand?.title),adminBrandLogo:o(t.adminBrand?.logo),adminBrandIcon:o(t.adminBrand?.icon),seoTitle:o(t.seo?.defaultTitle),seoSeparator:o(t.seo?.titleSeparator," | "),seoDescription:o(t.seo?.defaultDescription),footerCopyright:o(t.footer?.copyright),footerLayout:FOOTER_LAYOUTS.includes(t.footer?.layout)?t.footer.layout:"auto",footerBlurb:o(t.footer?.blurb),footerBlocks:Array.isArray(t.footer?.blocks)?t.footer.blocks.filter(n=>typeof n=="string").join(", "):"",footerMotionToggle:t.footer?.showMotionToggle!==!1,footerMotionDefault:["off","on"].includes(t.footer?.motionDefault)?t.footer.motionDefault:"system",footerMotionControl:t.footer?.motionControl==="checkbox"?"checkbox":"switch",footerClass:o(t.footer?.class),footerSocialClass:o(t.footer?.socialClass),footerLook:FOOTER_LOOKS.includes(t.footer?.look)?t.footer.look:"",footerCtaText:o(t.footer?.cta?.text),footerCtaHighlight:o(t.footer?.cta?.highlight),footerCtaUrl:o(t.footer?.cta?.url),footerCtaSub:o(t.footer?.cta?.sub),footerWatermark:o(t.footer?.watermark),footerStatus:o(t.footer?.status),footerFacts:Array.isArray(t.footer?.facts)?t.footer.facts.filter(n=>typeof n=="string").join(`
2
- `):"",footerTagline:o(t.footer?.tagline),footerEmail:o(t.footer?.email),footerAddress:o(t.footer?.address),footerGradFrom:o(t.footer?.gradient?.from),footerGradTo:o(t.footer?.gradient?.to),socialTwitter:o(t.social?.twitter),socialFacebook:o(t.social?.facebook),socialInstagram:o(t.social?.instagram),socialLinkedin:o(t.social?.linkedin),socialGithub:o(t.social?.github),socialYoutube:o(t.social?.youtube),smtpHost:o(t.smtp?.host),smtpPort:o(t.smtp?.port||587),smtpUser:o(t.smtp?.user),smtpPass:"",smtpSecure:t.smtp?.secure===!0,smtpInsecureTLS:t.smtp?.allowInsecureTLS===!0,smtpFromAddress:o(t.smtp?.fromAddress),smtpFromName:o(t.smtp?.fromName),bttEnabled:r.enabled!==!1,bttSmooth:r.smooth!==!1,bttLabel:o(r.label),bttThreshold:o(r.scrollThreshold??300),bttPosition:o(r.position,"bottom-right"),bttOffset:o(r.offset??32),bttBottomOffset:o(r.bottomOffset??r.offset??32),gtbEnabled:a.enabled===!0,gtbSmooth:a.smooth!==!1,gtbLabel:o(a.label),gtbThreshold:o(a.scrollThreshold??300),gtbPosition:o(a.position,"bottom-right"),gtbOffset:o(a.offset??32),gtbBottomOffset:o(a.bottomOffset??a.offset??32),ccEnabled:e.enabled!==!1,ccMessage:o(e.message),ccAcceptAll:o(e.acceptAllText,"Accept All"),ccRejectAll:o(e.rejectAllText,"Reject All"),ccCustomize:o(e.customizeText,"Customize"),ccSavePrefs:o(e.savePreferencesText,"Save Preferences"),ccPrivacyText:o(e.privacyPolicyText,"Privacy Policy"),ccPrivacyUrl:o(e.privacyPolicyUrl),ccCookieText:o(e.cookiePolicyText,"Cookie Policy"),ccCookieUrl:o(e.cookiePolicyUrl),ccPosition:o(e.position,"bottom"),ccLayout:o(e.layout,"bar"),ccTheme:o(e.theme,"dark"),ccShowFunctional:e.showFunctional!==!1,ccShowAnalytics:e.showAnalytics!==!1,ccShowMarketing:e.showMarketing!==!1,ccVersion:o(e.consentVersion,"1.0"),ccSettingsLink:e.showSettingsLink!==!1,ccSettingsLinkText:o(e.settingsLinkText,"Cookie settings"),gaId:o(t.googleAnalytics?.measurementId),bcEnabled:i.enabled===!0,bcHomeLabel:o(i.homeLabel,"Home"),bcPosition:BREADCRUMB_POSITIONS.includes(i.position)?i.position:"TL",bcOffsetX:o(i.offsetX??8),bcOffsetY:o(i.offsetY??8)}}export function payloadFromForm(t,r={},{adminHomeReady:a=!0}={}){const e=i=>o(i).trim();return{title:e(t.title),tagline:e(t.tagline),baseUrl:e(t.siteUrl).replace(/\/+$/,""),...a&&{adminHome:e(t.adminHome)||"/"},layoutOptions:{spacerSize:s(t.spacerSize,40)||40},bodyClass:e(t.bodyClass),brand:{...r.brand,text:e(t.brandText),logo:e(t.brandLogo),icon:e(t.brandIcon),url:e(t.brandUrl)||"/"},favicon:e(t.favicon),adminBrand:{...r.adminBrand,title:e(t.adminBrandTitle),logo:e(t.adminBrandLogo),icon:e(t.adminBrandIcon)},seo:{defaultTitle:e(t.seoTitle),titleSeparator:o(t.seoSeparator)||" | ",defaultDescription:e(t.seoDescription)},footer:{copyright:e(t.footerCopyright),layout:FOOTER_LAYOUTS.includes(t.footerLayout)?t.footerLayout:"auto",blurb:e(t.footerBlurb),blocks:footerBlockNames(t.footerBlocks),showMotionToggle:t.footerMotionToggle===!0,links:r.footer?.links||[],motionDefault:["off","on"].includes(t.footerMotionDefault)?t.footerMotionDefault:"system",motionControl:t.footerMotionControl==="checkbox"?"checkbox":"switch",class:e(t.footerClass),socialClass:e(t.footerSocialClass),look:FOOTER_LOOKS.includes(t.footerLook)?t.footerLook:"",cta:{text:e(t.footerCtaText),highlight:e(t.footerCtaHighlight),url:e(t.footerCtaUrl),sub:e(t.footerCtaSub)},watermark:e(t.footerWatermark),status:e(t.footerStatus),facts:String(t.footerFacts??"").split(`
3
- `).map(i=>i.trim()).filter(Boolean).slice(0,FOOTER_FACTS_MAX),tagline:e(t.footerTagline),email:e(t.footerEmail),address:e(t.footerAddress),gradient:{from:e(t.footerGradFrom),to:e(t.footerGradTo)}},social:{twitter:e(t.socialTwitter),facebook:e(t.socialFacebook),instagram:e(t.socialInstagram),linkedin:e(t.socialLinkedin),github:e(t.socialGithub),youtube:e(t.socialYoutube)},smtp:{host:e(t.smtpHost),port:s(t.smtpPort,587)||587,user:e(t.smtpUser),pass:o(t.smtpPass),secure:t.smtpSecure===!0,allowInsecureTLS:t.smtpInsecureTLS===!0,fromAddress:e(t.smtpFromAddress),fromName:e(t.smtpFromName)},backToTop:{enabled:t.bttEnabled===!0,scrollThreshold:s(t.bttThreshold,300),position:o(t.bttPosition)||"bottom-right",offset:s(t.bttOffset,32),bottomOffset:s(t.bttBottomOffset,32),label:e(t.bttLabel),smooth:t.bttSmooth===!0},goToBottom:{enabled:t.gtbEnabled===!0,scrollThreshold:s(t.gtbThreshold,300),position:o(t.gtbPosition)||"bottom-right",offset:s(t.gtbOffset,32),bottomOffset:s(t.gtbBottomOffset,32),label:e(t.gtbLabel),smooth:t.gtbSmooth===!0},cookieConsent:{enabled:t.ccEnabled===!0,message:e(t.ccMessage),acceptAllText:e(t.ccAcceptAll),rejectAllText:e(t.ccRejectAll),customizeText:e(t.ccCustomize),savePreferencesText:e(t.ccSavePrefs),privacyPolicyText:e(t.ccPrivacyText),privacyPolicyUrl:e(t.ccPrivacyUrl),cookiePolicyText:e(t.ccCookieText),cookiePolicyUrl:e(t.ccCookieUrl),position:o(t.ccPosition)||"bottom",layout:o(t.ccLayout)||"bar",theme:o(t.ccTheme)||"dark",showFunctional:t.ccShowFunctional===!0,showAnalytics:t.ccShowAnalytics===!0,showMarketing:t.ccShowMarketing===!0,consentVersion:e(t.ccVersion)||"1.0",showSettingsLink:t.ccSettingsLink===!0,settingsLinkText:e(t.ccSettingsLinkText)||"Cookie settings"},googleAnalytics:{measurementId:e(t.gaId).toUpperCase()},breadcrumbs:{enabled:t.bcEnabled===!0,homeLabel:e(t.bcHomeLabel)||"Home",position:BREADCRUMB_POSITIONS.includes(t.bcPosition)?t.bcPosition:"TL",offsetX:s(t.bcOffsetX,8),offsetY:s(t.bcOffsetY,8)}}}export function siteUrlError(t){const r=o(t).trim().replace(/\/+$/,"");return r?/^https?:\/\//i.test(r)?/^https?:\/\/([a-z0-9.\-]+|\[[0-9a-f:.]+\])(:\d{1,5})?$/i.test(r)?"":"Just the address, like https://example.com - no page path after it.":"Start with https:// (or http://).":""}const c=t=>typeof t=="boolean"?t:o(t);export function snapshot(t){return JSON.stringify(Object.keys(t).sort().map(r=>[r,c(t[r])]))}export function changedTabs(t,r){const a=[];for(const[e,i]of Object.entries(TAB_FIELDS))i.some(n=>c(t[n])!==c(r[n]))&&a.push(e);return a}export function draftOf(t){return Object.fromEntries(Object.entries(t).filter(([r])=>!SECRET_FIELDS.includes(r)))}export function settingsProblems(t){const r=[];return o(t.smtpHost).trim()?o(t.smtpFromAddress).trim()||r.push({tone:"warn",tab:"email",text:"No From address - mail has no sender and many servers refuse it."}):r.push({tone:"danger",tab:"email",text:"No SMTP host - mail goes to a throwaway test inbox and reaches no one (password resets, form notifications)."}),(t.ccEnabled===!0||o(t.gaId).trim())&&!o(t.ccPrivacyUrl).trim()&&r.push({tone:"warn",tab:"cookies",text:"The cookie banner is on but links to no privacy policy."}),r}export function describeCacheKey(t){const r=/^page:(.*?):m\d+:role([^:]*):/.exec(String(t||""));return r?{path:r[1]||"/",role:r[2]||"anon",page:!0}:{path:String(t||""),role:"",page:!1}}export function expiresIn(t,r=Date.now()){if(t==null)return"no expiry";const a=t-r;return a<=0?"expired":a<6e4?`${Math.round(a/1e3)}s`:a<36e5?`${Math.round(a/6e4)}m`:`${Math.round(a/36e5)}h`}
1
+ export const TAB_FIELDS={general:["title","tagline","siteUrl","adminHome","spacerSize","bodyClass"],branding:["brandText","brandLogo","brandIcon","brandUrl","adminBrandTitle","adminBrandLogo","adminBrandIcon"],favicon:["favicon"],seo:["seoTitle","seoSeparator","seoDescription"],footer:["footerCopyright","footerLayout","footerBlurb","footerBlocks","footerClass","footerSocialClass","footerLook","footerCtaText","footerCtaHighlight","footerCtaUrl","footerCtaSub","footerWatermark","footerStatus","footerFacts","footerTagline","footerEmail","footerAddress","footerGradFrom","footerGradTo","socialTwitter","socialFacebook","socialInstagram","socialLinkedin","socialGithub","socialYoutube"],email:["smtpHost","smtpPort","smtpUser","smtpPass","smtpSecure","smtpInsecureTLS","smtpFromAddress","smtpFromName"],pageNavigation:["bttEnabled","bttSmooth","bttLabel","bttThreshold","bttPosition","bttOffset","bttBottomOffset","gtbEnabled","gtbSmooth","gtbLabel","gtbThreshold","gtbPosition","gtbOffset","gtbBottomOffset"],cookies:["ccEnabled","ccMessage","ccAcceptAll","ccRejectAll","ccCustomize","ccSavePrefs","ccPrivacyText","ccPrivacyUrl","ccCookieText","ccCookieUrl","ccPosition","ccLayout","ccTheme","ccShowFunctional","ccShowAnalytics","ccShowMarketing","ccVersion","ccSettingsLink","ccSettingsLinkText"],analytics:["gaId"],breadcrumbs:["bcEnabled","bcHomeLabel","bcPosition","bcOffsetX","bcOffsetY"],motion:["mtEnabled","mtLabel","mtDefault","mtControl","mtPlacement","mtTriggerStyle","mtPosition","mtOffsetX","mtOffsetY","mtIconSize","mtIconRadius","mtClass"]},SECRET_FIELDS=["smtpPass"],BREADCRUMB_POSITIONS=["TL","TR","BL","BR"],MOTION_PLACEMENTS=["footer","floating","navbar"],MOTION_LABEL="Reduce motion";const u=["system","off","on"],c=(t,r,i,e)=>{const n=Number.parseInt(t,10);return Number.isFinite(n)?Math.min(e,Math.max(i,n)):r};export function motionFromSettings(t={}){const r=t.motion&&typeof t.motion=="object"?t.motion:{},i=t.footer||{},e=b=>r[b]!==void 0&&r[b]!==null,n=e("default")?r.default:i.motionDefault,s=e("control")?r.control:i.motionControl,m=c(r.iconSize,52,32,96);return{mtEnabled:(e("enabled")?r.enabled:i.showMotionToggle)!==!1,mtLabel:typeof r.label=="string"&&r.label.trim()?r.label.trim():MOTION_LABEL,mtDefault:u.includes(n)?n:"system",mtControl:s==="checkbox"?"checkbox":"switch",mtPlacement:MOTION_PLACEMENTS.includes(r.placement)?r.placement:"footer",mtTriggerStyle:r.triggerStyle==="icon-text"?"icon-text":"icon",mtPosition:BREADCRUMB_POSITIONS.includes(r.position)?r.position:"BL",mtOffsetX:o(c(r.offsetX,32,0,500)),mtOffsetY:o(c(r.offsetY,32,0,500)),mtIconSize:o(m),mtIconRadius:o(c(r.iconRadius,26,0,Math.floor(m/2))),mtClass:o(r.class)}}export function motionFromForm(t){const r=c(t.mtIconSize,52,32,96);return{enabled:t.mtEnabled===!0,default:u.includes(t.mtDefault)?t.mtDefault:"system",placement:MOTION_PLACEMENTS.includes(t.mtPlacement)?t.mtPlacement:"footer",control:t.mtControl==="checkbox"?"checkbox":"switch",triggerStyle:t.mtTriggerStyle==="icon-text"?"icon-text":"icon",label:o(t.mtLabel).trim().replace(/\s+/g," ").slice(0,40)||MOTION_LABEL,position:BREADCRUMB_POSITIONS.includes(t.mtPosition)?t.mtPosition:"BL",offsetX:c(t.mtOffsetX,32,0,500),offsetY:c(t.mtOffsetY,32,0,500),iconSize:r,iconRadius:c(t.mtIconRadius,26,0,Math.floor(r/2)),class:o(t.mtClass).trim()}}export function footerBlockNames(t){return[...new Set(String(t??"").split(/[\s,]+/).map(r=>r.trim().toLowerCase()).filter(Boolean))]}export function gaIdError(t){const r=o(t).trim();return!r||/^G-[A-Z0-9]{4,20}$/i.test(r)?"":"A measurement ID looks like G-XXXXXXXXXX (Google Analytics > Admin > Data streams)."}export const FOOTER_LAYOUTS=["auto","columns","row"],FOOTER_LOOKS=["","showcase"],FOOTER_FACTS_MAX=4;const d=/^(\/|#|https?:\/\/|mailto:)/,f=/^#[0-9a-f]{6}$/i;export function footerShowcaseErrors(t){const r=[],i=o(t.footerCtaUrl).trim();i&&!d.test(i)&&r.push("The footer call to action link must start with /, #, https:// or mailto: (Footer tab).");for(const[e,n]of[["from",t.footerGradFrom],["to",t.footerGradTo]]){const s=o(n).trim();s&&!f.test(s)&&r.push(`The footer gradient "${e}" colour must look like #f26b3a (Footer tab).`)}return r}const o=(t,r="")=>t==null?r:String(t),a=(t,r)=>{const i=Number.parseInt(t,10);return Number.isFinite(i)?i:r};export function homeValue(t){return/^\/[A-Za-z0-9\-_/]*$/.test(t||"")&&String(t).replace(/\/+$/,"")||"/"}export function formFromSettings(t={}){const r=t.backToTop||{},i=t.goToBottom||{},e=t.cookieConsent||{},n=t.breadcrumbs||{};return{title:o(t.title),tagline:o(t.tagline),siteUrl:o(t.baseUrl),adminHome:homeValue(t.adminHome),spacerSize:o(t.layoutOptions?.spacerSize??40),bodyClass:o(t.bodyClass),brandText:o(t.brand?.text),brandLogo:o(t.brand?.logo),brandIcon:o(t.brand?.icon),brandUrl:o(t.brand?.url,"/"),favicon:o(t.favicon),adminBrandTitle:o(t.adminBrand?.title),adminBrandLogo:o(t.adminBrand?.logo),adminBrandIcon:o(t.adminBrand?.icon),seoTitle:o(t.seo?.defaultTitle),seoSeparator:o(t.seo?.titleSeparator," | "),seoDescription:o(t.seo?.defaultDescription),footerCopyright:o(t.footer?.copyright),footerLayout:FOOTER_LAYOUTS.includes(t.footer?.layout)?t.footer.layout:"auto",footerBlurb:o(t.footer?.blurb),footerBlocks:Array.isArray(t.footer?.blocks)?t.footer.blocks.filter(s=>typeof s=="string").join(", "):"",footerClass:o(t.footer?.class),footerSocialClass:o(t.footer?.socialClass),footerLook:FOOTER_LOOKS.includes(t.footer?.look)?t.footer.look:"",footerCtaText:o(t.footer?.cta?.text),footerCtaHighlight:o(t.footer?.cta?.highlight),footerCtaUrl:o(t.footer?.cta?.url),footerCtaSub:o(t.footer?.cta?.sub),footerWatermark:o(t.footer?.watermark),footerStatus:o(t.footer?.status),footerFacts:Array.isArray(t.footer?.facts)?t.footer.facts.filter(s=>typeof s=="string").join(`
2
+ `):"",footerTagline:o(t.footer?.tagline),footerEmail:o(t.footer?.email),footerAddress:o(t.footer?.address),footerGradFrom:o(t.footer?.gradient?.from),footerGradTo:o(t.footer?.gradient?.to),socialTwitter:o(t.social?.twitter),socialFacebook:o(t.social?.facebook),socialInstagram:o(t.social?.instagram),socialLinkedin:o(t.social?.linkedin),socialGithub:o(t.social?.github),socialYoutube:o(t.social?.youtube),smtpHost:o(t.smtp?.host),smtpPort:o(t.smtp?.port||587),smtpUser:o(t.smtp?.user),smtpPass:"",smtpSecure:t.smtp?.secure===!0,smtpInsecureTLS:t.smtp?.allowInsecureTLS===!0,smtpFromAddress:o(t.smtp?.fromAddress),smtpFromName:o(t.smtp?.fromName),bttEnabled:r.enabled!==!1,bttSmooth:r.smooth!==!1,bttLabel:o(r.label),bttThreshold:o(r.scrollThreshold??300),bttPosition:o(r.position,"bottom-right"),bttOffset:o(r.offset??32),bttBottomOffset:o(r.bottomOffset??r.offset??32),gtbEnabled:i.enabled===!0,gtbSmooth:i.smooth!==!1,gtbLabel:o(i.label),gtbThreshold:o(i.scrollThreshold??300),gtbPosition:o(i.position,"bottom-right"),gtbOffset:o(i.offset??32),gtbBottomOffset:o(i.bottomOffset??i.offset??32),ccEnabled:e.enabled!==!1,ccMessage:o(e.message),ccAcceptAll:o(e.acceptAllText,"Accept All"),ccRejectAll:o(e.rejectAllText,"Reject All"),ccCustomize:o(e.customizeText,"Customize"),ccSavePrefs:o(e.savePreferencesText,"Save Preferences"),ccPrivacyText:o(e.privacyPolicyText,"Privacy Policy"),ccPrivacyUrl:o(e.privacyPolicyUrl),ccCookieText:o(e.cookiePolicyText,"Cookie Policy"),ccCookieUrl:o(e.cookiePolicyUrl),ccPosition:o(e.position,"bottom"),ccLayout:o(e.layout,"bar"),ccTheme:o(e.theme,"dark"),ccShowFunctional:e.showFunctional!==!1,ccShowAnalytics:e.showAnalytics!==!1,ccShowMarketing:e.showMarketing!==!1,ccVersion:o(e.consentVersion,"1.0"),ccSettingsLink:e.showSettingsLink!==!1,ccSettingsLinkText:o(e.settingsLinkText,"Cookie settings"),gaId:o(t.googleAnalytics?.measurementId),bcEnabled:n.enabled===!0,bcHomeLabel:o(n.homeLabel,"Home"),bcPosition:BREADCRUMB_POSITIONS.includes(n.position)?n.position:"TL",bcOffsetX:o(n.offsetX??8),bcOffsetY:o(n.offsetY??8),...motionFromSettings(t)}}export function payloadFromForm(t,r={},{adminHomeReady:i=!0}={}){const e=s=>o(s).trim(),n=motionFromForm(t);return{title:e(t.title),tagline:e(t.tagline),baseUrl:e(t.siteUrl).replace(/\/+$/,""),...i&&{adminHome:e(t.adminHome)||"/"},layoutOptions:{spacerSize:a(t.spacerSize,40)||40},bodyClass:e(t.bodyClass),brand:{...r.brand,text:e(t.brandText),logo:e(t.brandLogo),icon:e(t.brandIcon),url:e(t.brandUrl)||"/"},favicon:e(t.favicon),adminBrand:{...r.adminBrand,title:e(t.adminBrandTitle),logo:e(t.adminBrandLogo),icon:e(t.adminBrandIcon)},seo:{defaultTitle:e(t.seoTitle),titleSeparator:o(t.seoSeparator)||" | ",defaultDescription:e(t.seoDescription)},footer:{copyright:e(t.footerCopyright),layout:FOOTER_LAYOUTS.includes(t.footerLayout)?t.footerLayout:"auto",blurb:e(t.footerBlurb),blocks:footerBlockNames(t.footerBlocks),links:r.footer?.links||[],showMotionToggle:n.enabled,motionDefault:n.default,motionControl:n.control,class:e(t.footerClass),socialClass:e(t.footerSocialClass),look:FOOTER_LOOKS.includes(t.footerLook)?t.footerLook:"",cta:{text:e(t.footerCtaText),highlight:e(t.footerCtaHighlight),url:e(t.footerCtaUrl),sub:e(t.footerCtaSub)},watermark:e(t.footerWatermark),status:e(t.footerStatus),facts:String(t.footerFacts??"").split(`
3
+ `).map(s=>s.trim()).filter(Boolean).slice(0,FOOTER_FACTS_MAX),tagline:e(t.footerTagline),email:e(t.footerEmail),address:e(t.footerAddress),gradient:{from:e(t.footerGradFrom),to:e(t.footerGradTo)}},social:{twitter:e(t.socialTwitter),facebook:e(t.socialFacebook),instagram:e(t.socialInstagram),linkedin:e(t.socialLinkedin),github:e(t.socialGithub),youtube:e(t.socialYoutube)},smtp:{host:e(t.smtpHost),port:a(t.smtpPort,587)||587,user:e(t.smtpUser),pass:o(t.smtpPass),secure:t.smtpSecure===!0,allowInsecureTLS:t.smtpInsecureTLS===!0,fromAddress:e(t.smtpFromAddress),fromName:e(t.smtpFromName)},backToTop:{enabled:t.bttEnabled===!0,scrollThreshold:a(t.bttThreshold,300),position:o(t.bttPosition)||"bottom-right",offset:a(t.bttOffset,32),bottomOffset:a(t.bttBottomOffset,32),label:e(t.bttLabel),smooth:t.bttSmooth===!0},goToBottom:{enabled:t.gtbEnabled===!0,scrollThreshold:a(t.gtbThreshold,300),position:o(t.gtbPosition)||"bottom-right",offset:a(t.gtbOffset,32),bottomOffset:a(t.gtbBottomOffset,32),label:e(t.gtbLabel),smooth:t.gtbSmooth===!0},cookieConsent:{enabled:t.ccEnabled===!0,message:e(t.ccMessage),acceptAllText:e(t.ccAcceptAll),rejectAllText:e(t.ccRejectAll),customizeText:e(t.ccCustomize),savePreferencesText:e(t.ccSavePrefs),privacyPolicyText:e(t.ccPrivacyText),privacyPolicyUrl:e(t.ccPrivacyUrl),cookiePolicyText:e(t.ccCookieText),cookiePolicyUrl:e(t.ccCookieUrl),position:o(t.ccPosition)||"bottom",layout:o(t.ccLayout)||"bar",theme:o(t.ccTheme)||"dark",showFunctional:t.ccShowFunctional===!0,showAnalytics:t.ccShowAnalytics===!0,showMarketing:t.ccShowMarketing===!0,consentVersion:e(t.ccVersion)||"1.0",showSettingsLink:t.ccSettingsLink===!0,settingsLinkText:e(t.ccSettingsLinkText)||"Cookie settings"},googleAnalytics:{measurementId:e(t.gaId).toUpperCase()},breadcrumbs:{enabled:t.bcEnabled===!0,homeLabel:e(t.bcHomeLabel)||"Home",position:BREADCRUMB_POSITIONS.includes(t.bcPosition)?t.bcPosition:"TL",offsetX:a(t.bcOffsetX,8),offsetY:a(t.bcOffsetY,8)},motion:n}}export function siteUrlError(t){const r=o(t).trim().replace(/\/+$/,"");return r?/^https?:\/\//i.test(r)?/^https?:\/\/([a-z0-9.\-]+|\[[0-9a-f:.]+\])(:\d{1,5})?$/i.test(r)?"":"Just the address, like https://example.com - no page path after it.":"Start with https:// (or http://).":""}const l=t=>typeof t=="boolean"?t:o(t);export function snapshot(t){return JSON.stringify(Object.keys(t).sort().map(r=>[r,l(t[r])]))}export function changedTabs(t,r){const i=[];for(const[e,n]of Object.entries(TAB_FIELDS))n.some(s=>l(t[s])!==l(r[s]))&&i.push(e);return i}export function draftOf(t){return Object.fromEntries(Object.entries(t).filter(([r])=>!SECRET_FIELDS.includes(r)))}const p={footerMotionToggle:"mtEnabled",footerMotionDefault:"mtDefault",footerMotionControl:"mtControl"};export function formFromDraft(t,r={}){const i={...r};for(const[n,s]of Object.entries(p))n in i&&!(s in i)&&(i[s]=i[n]),delete i[n];const e={...t};for(const[n,s]of Object.entries(i))n in e&&!SECRET_FIELDS.includes(n)&&(e[n]=s);return e}export function settingsProblems(t){const r=[];return o(t.smtpHost).trim()?o(t.smtpFromAddress).trim()||r.push({tone:"warn",tab:"email",text:"No From address - mail has no sender and many servers refuse it."}):r.push({tone:"danger",tab:"email",text:"No SMTP host - mail goes to a throwaway test inbox and reaches no one (password resets, form notifications)."}),(t.ccEnabled===!0||o(t.gaId).trim())&&!o(t.ccPrivacyUrl).trim()&&r.push({tone:"warn",tab:"cookies",text:"The cookie banner is on but links to no privacy policy."}),r}export function describeCacheKey(t){const r=/^page:(.*?):m\d+:role([^:]*):/.exec(String(t||""));return r?{path:r[1]||"/",role:r[2]||"anon",page:!0}:{path:String(t||""),role:"",page:!1}}export function expiresIn(t,r=Date.now()){if(t==null)return"no expiry";const i=t-r;return i<=0?"expired":i<6e4?`${Math.round(i/1e3)}s`:i<36e5?`${Math.round(i/6e4)}m`:`${Math.round(i/36e5)}h`}
@@ -952,7 +952,15 @@ Body content in **Markdown** is supported.
952
952
  button as attributes: <code>[card reveal reveal-animation="zoom"]</code>. Settings are at
953
953
  <strong>System &gt; Effects</strong>.</p>
954
954
  <h3 id="moving-text">Moving text and swooshing cards</h3>
955
- <p>A few words in a headline can be drawn in a colour gradient, and cards can sweep into view:</p>
955
+ <p>A few words in a headline can be drawn in a colour gradient, and cards can sweep into view.</p>
956
+ <p><strong>Highlight text from the editor:</strong> select the words, right-click and choose
957
+ <strong>Wrap in… › Highlight text</strong> - or <strong>Insert… › Content › Highlight text</strong>
958
+ with nothing selected. The dialog opens with a gradient and a shine already chosen and shows the
959
+ colours as you change them. Right-click any <code>[text]</code> tag for one-click looks:
960
+ <strong>Highlight - gradient with a shine</strong>, <strong>Highlight that sweeps by itself</strong>,
961
+ <strong>Light up as you read</strong>, <strong>Rise in word by word</strong>, and
962
+ <strong>Plain</strong> to take them off again.</p>
963
+ <p>Or write the tags yourself:</p>
956
964
  <ul>
957
965
  <li><code>[text gradient="sunset"]Around the clock.[/text]</code> - the words in a gradient.
958
966
  Named gradients: <code>brand</code> (your theme's colour), <code>sunset</code>,
@@ -42,10 +42,21 @@
42
42
  </tr>
43
43
  <tr>
44
44
  <td>Footer</td>
45
- <td>Copyright text, layout, blurb, social links, and whether visitors get a "Reduce motion"
46
- switch. Footer links are menus - see <a href="#/docs/usage/navigation">Navigation</a>.
45
+ <td>Copyright text, layout, blurb, footer blocks and social links.
46
+ Footer links are menus - see <a href="#/docs/usage/navigation">Navigation</a>.
47
47
  The <a href="#showcase-footer">Showcase footer</a> card adds a big call to action and more.</td>
48
48
  </tr>
49
+ <tr>
50
+ <td>Reduce motion</td>
51
+ <td>The accessibility control that lets visitors turn animations off: whether it is shown,
52
+ its label, and what a visitor who has not chosen gets (follow their device, full motion,
53
+ or calm). <strong>Placement</strong> puts it in the footer (a switch or a checkbox), as a
54
+ floating button in a corner you pick - with its size, corners and distance from the
55
+ edges - or at the end of the navbar (floating where there is no navbar, or on a phone
56
+ when the navbar shows only its menu button). A floating button sharing a corner with Search,
57
+ Back to top or the theme switcher stacks clear of it. Hiding the control does not take
58
+ the choice away from visitors who already made it.</td>
59
+ </tr>
49
60
  <tr>
50
61
  <td>Email</td>
51
62
  <td>The SMTP server the site sends mail through (form notifications, password resets,
@@ -291,7 +291,7 @@
291
291
  </div>
292
292
  <div class="form-group">
293
293
  <label>Staggered entrance
294
- <span data-help-title="Staggered entrance" data-help="The items arrive one after another when the menu is drawn, like a row of cards revealing. A dropdown or footer column staggers in on its own when it opens. Visitors who have asked for less motion (their device setting, or the site's motion switch) see the items straight away."></span></label>
294
+ <span data-help-title="Staggered entrance" data-help="The items arrive one after another when the menu is drawn, like a row of cards revealing. A dropdown or footer column staggers in on its own when it opens. Visitors who have asked for less motion (their device setting, or the site's Reduce motion control) see the items straight away."></span></label>
295
295
  <label style="display:flex;align-items:center;gap:.5rem;font-weight:400;cursor:pointer">
296
296
  <input type="checkbox" id="me-entrance-enabled" name="entranceEnabled" style="width:auto;margin:0">
297
297
  Bring the items in one after another