efficient-easel 4.0.0 → 5.0.1

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.
Files changed (75) hide show
  1. package/README.md +13 -0
  2. package/dist/buckets-Tj-nkBpg.d.ts +28 -0
  3. package/dist/chrome/chrome.css +33 -5
  4. package/dist/chrome/index.js +1 -1
  5. package/dist/chunk-3FZAGTQE.js +5 -0
  6. package/dist/chunk-3ZJSLHHI.js +8 -0
  7. package/dist/chunk-5QSFLWAJ.js +65 -0
  8. package/dist/{chunk-42TMLDSQ.js → chunk-6TOYXESC.js} +1 -1
  9. package/dist/chunk-7EWFXVDJ.js +21 -0
  10. package/dist/chunk-7YMO6R3V.js +1 -0
  11. package/dist/chunk-BXQBCW3P.js +1 -0
  12. package/dist/{chunk-ZHTQCAQ2.js → chunk-F7BYSWRR.js} +1 -1
  13. package/dist/{chunk-TJOUAFJE.js → chunk-G4OCSMYY.js} +1 -1
  14. package/dist/{chunk-D4BUPPPV.js → chunk-H6NYEMLS.js} +3 -3
  15. package/dist/{chunk-2I7MAA2U.js → chunk-HQWQLDCB.js} +1 -1
  16. package/dist/{chunk-XJPNW26S.js → chunk-ITAQX3HT.js} +1 -1
  17. package/dist/{chunk-7GVPKRW2.js → chunk-KEHLCWTG.js} +4 -4
  18. package/dist/chunk-KFV7N2DJ.js +1 -0
  19. package/dist/chunk-MQNBD6AB.js +1 -0
  20. package/dist/chunk-PCMGFPFU.js +5 -0
  21. package/dist/{chunk-5SOSVTVI.js → chunk-PFNIVZPN.js} +1 -1
  22. package/dist/{chunk-QBJJVMVB.js → chunk-R5GKLOIP.js} +1 -1
  23. package/dist/chunk-SF4DL63U.js +1 -0
  24. package/dist/{chunk-GTDLBUOC.js → chunk-UB4TLWVJ.js} +6 -6
  25. package/dist/{chunk-SNMCF2ZD.js → chunk-XHHS6SDM.js} +1 -1
  26. package/dist/copy/copy.css +7 -7
  27. package/dist/copy/index.js +5 -5
  28. package/dist/drag/index.js +1 -1
  29. package/dist/easel/index.d.ts +2 -2
  30. package/dist/fields/fields.css +4 -0
  31. package/dist/fields/index.d.ts +103 -51
  32. package/dist/fields/index.js +1 -1
  33. package/dist/panel/index.d.ts +8 -2
  34. package/dist/panel/index.js +19 -12
  35. package/dist/panel/panel.css +23 -1
  36. package/dist/screen/components/AddBlockRow.js +1 -1
  37. package/dist/screen/components/AddSidePanel.js +1 -1
  38. package/dist/screen/components/MediaSidePanel.js +1 -1
  39. package/dist/screen/components/NodeContextMenu.js +1 -1
  40. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  41. package/dist/screen/components/ScreenChrome.js +1 -1
  42. package/dist/screen/components/ScreenMount.js +1 -1
  43. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  44. package/dist/screen/components/SectionScreenShell.js +14 -14
  45. package/dist/screen/components/SidePanelHead.js +1 -1
  46. package/dist/screen/components/panel-widths.js +1 -1
  47. package/dist/screen/components/usePartBridge.js +1 -1
  48. package/dist/screen/index.js +1 -1
  49. package/dist/screen/lib/puck/field-buckets.d.ts +20 -6
  50. package/dist/screen/lib/puck/field-buckets.js +1 -1
  51. package/dist/screen/lib/puck/style-clipboard.d.ts +14 -5
  52. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  53. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  54. package/dist/screen/lib/screen-parts.js +1 -1
  55. package/dist/screen/screen.css +4 -4
  56. package/dist/strings/catalogue.d.ts +2 -2
  57. package/dist/strings/catalogue.js +1 -1
  58. package/dist/strings/index.d.ts +2 -2
  59. package/dist/strings/index.js +1 -1
  60. package/dist/text-styles/index.js +11 -11
  61. package/dist/text-styles/text-styles.css +2 -2
  62. package/dist/{types-CWxUxPGO.d.ts → types-OUl0mK1k.d.ts} +5 -2
  63. package/dist/{words-BGrHZAJJ.d.ts → words-zH1H0WFw.d.ts} +8 -3
  64. package/package.json +2 -2
  65. package/dist/buckets-CuLM47h9.d.ts +0 -13
  66. package/dist/chunk-4YBMSUPL.js +0 -1
  67. package/dist/chunk-7P6IFCR4.js +0 -1
  68. package/dist/chunk-KFMJ4IM4.js +0 -5
  69. package/dist/chunk-LJOYIXO4.js +0 -65
  70. package/dist/chunk-NJOPEWYN.js +0 -20
  71. package/dist/chunk-QEWRHH6R.js +0 -5
  72. package/dist/chunk-QTLAVDJE.js +0 -1
  73. package/dist/chunk-R2HLPNQF.js +0 -1
  74. package/dist/chunk-WSNVBUPL.js +0 -1
  75. package/dist/chunk-YNOZ5NXW.js +0 -14
@@ -1,2 +1,2 @@
1
- import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-WSNVBUPL.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-WSNVBUPL.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-MCHMF32I.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
1
+ import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-7YMO6R3V.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-7YMO6R3V.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-MCHMF32I.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";import"../chunk-AELNNAFM.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
2
2
  return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
@@ -1,33 +1,33 @@
1
- import{hexReadout as e,ColourWindow as n,typedHex as t}from"../chunk-FPAVNX3Y.js";import{DEFAULT_TEXT_STYLES_WORDS as s}from"../chunk-M6F6LS3H.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import{FieldSelect as i,FieldSlider as a}from"../chunk-OZ72A6MY.js";import"../chunk-FFYXVAAL.js";import{useWords as l}from"../chunk-MFIRYGHW.js";import{withTip as r}from"../chunk-P2VEMZH5.js";import{hsvToHex as o,Tooltip as d,ColorSwatch as c,IconButton as u}from"efficient-shell/ui";import{useState as m,useRef as f,useId as h,useEffect as p,Fragment as v}from"react";import{ChevronIcon as g,TrashIcon as k,BoldIcon as y,ItalicIcon as b,CaseLowerIcon as x,CaseUpperIcon as w,CaseNormalIcon as S}from"efficient-shell/icons/efficient";import{jsxs as N,jsx as C,Fragment as M}from"react/jsx-runtime";var z=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],$=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],O=["heading","body"],A=7,j={heading:3,body:5},F={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},L={size:F,weight:{min:100,max:900,sliderMin:300,sliderMax:900,step:100,shiftStep:100,unit:""},lineSpacing:{min:50,max:250,sliderMin:50,sliderMax:250,step:1,shiftStep:10,unit:"%"},letterSpacing:{min:-10,max:void 0,sliderMin:-5,sliderMax:10,step:.1,shiftStep:1,unit:"px"},paragraphSpacing:{min:0,max:void 0,sliderMin:0,sliderMax:48,step:1,shiftStep:10,unit:"px"},largestSize:F},E=(e,n)=>`${"heading"===e?"Heading":"Body"} ${n}`;function W(e=({kind:e,n:n})=>E(e,n)){return O.flatMap(n=>Array.from({length:j[n]},(t,s)=>({id:`${n}-${s+1}`,kind:n,name:e({kind:n,n:s+1}),values:{}})))}function H(e,n,t=A){return e.filter(e=>e.kind===n).length<t}function B(e,n){const t=new RegExp(`^${n}-([1-9]\\d*)$`).exec(e);return t?Number(t[1]):void 0}function D(e){const n=B(e.id,e.kind);return void 0!==n&&n<=j[e.kind]}function I(e,n,t={}){const{max:s=A,name:i=({kind:e,n:n})=>E(e,n),make:a}=t;if(!H(e,n,s))return null;const l=e.filter(e=>e.kind===n);let r=l.length+1;const o=new Set(e.map(e=>e.name));for(;o.has(i({kind:n,n:r}));)r+=1;const d=new Set(e.map(e=>e.id));let c=Math.max(r,...l.map(e=>(B(e.id,n)??0)+1));for(;d.has(`${n}-${c}`);)c+=1;const u=l.at(-1),m=a?a(n,r):{id:`${n}-${c}`,kind:n,name:i({kind:n,n:r}),values:{...u?.values??{}}},f=u?e.indexOf(u)+1:"heading"===n?0:e.length;return{styles:[...e.slice(0,f),m,...e.slice(f)],added:m}}function R(e,n,t={}){const{name:s=({kind:e,n:n})=>E(e,n)}=t,i=e.find(e=>e.id===n);if(!i||D(i))return null;const a=e.filter(e=>e.kind===i.kind),l=a.indexOf(i),r=/* @__PURE__ */new Map;return a.forEach((e,n)=>{n>l&&e.name===s({kind:e.kind,n:n+1})&&r.set(e,s({kind:e.kind,n:n}))}),{styles:e.filter(e=>e!==i).map(e=>r.has(e)?{...e,name:r.get(e)}:e),removed:i}}function T(e,n){const t=e.find(e=>e.id===n);if(t)return t;for(const t of O){const s=B(n,t);if(void 0===s)continue;let i;for(const n of e){const e=n.kind===t?B(n.id,t):void 0;void 0!==e&&e<s&&(!i||e>i.n)&&(i={n:e,style:n})}return i?.style}}function Y(e,n,t){return e.map(e=>{if(e.id!==n)return e;const s={...e.values};for(const[e,n]of Object.entries(t))void 0===n?delete s[e]:s[e]=n;return{...e,values:s}})}function V(e){return Math.min(20,Math.max(12,Math.round(.5*e+6)))}function q(e,n){const t=n.weights;return[t.thin,t.extraLight,t.light,t.regular,t.medium,t.semibold,t.bold,t.extraBold,t.black][Math.min(8,Math.max(0,Math.round(e/100)-1))]}function P(e,n,t,s={}){const i=n.find(n=>n.value===e.font)?.label??e.font??"",a=void 0===e.size?s.autoSize?t.auto:"":t.px({n:e.size});return t.summary({font:i,size:a,weight:q(e.weight??400,t)})}var X=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>o({h:e,s:1,v:1})).join(", ")})`;function Z({value:t,hex:s,colours:i,label:a,followsWord:l,anyWord:r,onChange:o,readOnly:u=!1}){const[v,g]=m(!1),k=f(null),y=f(null),b=h(),x=void 0!==t&&i.some(e=>e.key===t),w=void 0!==t&&!x;return p(()=>{if(!v)return;const e=k.current?.ownerDocument;if(!e)return;const n=e=>{k.current&&!k.current.contains(e.target)&&g(!1)};return e.addEventListener("click",n,!0),()=>e.removeEventListener("click",n,!0)},[v]),/* @__PURE__ */N("div",{ref:k,className:"es-ts-set","data-ts-setting":"color",children:[
1
+ import{hexReadout as e,ColourWindow as n,typedHex as t}from"../chunk-FPAVNX3Y.js";import{DEFAULT_TEXT_STYLES_WORDS as s}from"../chunk-M6F6LS3H.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import{FieldSelect as i,FieldSlider as a}from"../chunk-OZ72A6MY.js";import"../chunk-FFYXVAAL.js";import{withTip as l}from"../chunk-P2VEMZH5.js";import{useWords as r}from"../chunk-MFIRYGHW.js";import{hsvToHex as o,Tooltip as d,ColorSwatch as c,IconButton as u}from"efficient-shell/ui";import{useState as m,useRef as f,useId as h,useEffect as p,Fragment as v}from"react";import{ChevronIcon as g,TrashIcon as k,BoldIcon as y,ItalicIcon as b,CaseLowerIcon as x,CaseUpperIcon as w,CaseNormalIcon as S}from"efficient-shell/icons/efficient";import{jsxs as N,jsx as C,Fragment as M}from"react/jsx-runtime";var z=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],$=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],O=["heading","body"],A=7,j={heading:3,body:5},F={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},L={size:F,weight:{min:100,max:900,sliderMin:300,sliderMax:900,step:100,shiftStep:100,unit:""},lineSpacing:{min:50,max:250,sliderMin:50,sliderMax:250,step:1,shiftStep:10,unit:"%"},letterSpacing:{min:-10,max:void 0,sliderMin:-5,sliderMax:10,step:.1,shiftStep:1,unit:"px"},paragraphSpacing:{min:0,max:void 0,sliderMin:0,sliderMax:48,step:1,shiftStep:10,unit:"px"},largestSize:F},E=(e,n)=>`${"heading"===e?"Heading":"Body"} ${n}`;function W(e=({kind:e,n:n})=>E(e,n)){return O.flatMap(n=>Array.from({length:j[n]},(t,s)=>({id:`${n}-${s+1}`,kind:n,name:e({kind:n,n:s+1}),values:{}})))}function H(e,n,t=A){return e.filter(e=>e.kind===n).length<t}function B(e,n){const t=new RegExp(`^${n}-([1-9]\\d*)$`).exec(e);return t?Number(t[1]):void 0}function D(e){const n=B(e.id,e.kind);return void 0!==n&&n<=j[e.kind]}function I(e,n,t={}){const{max:s=A,name:i=({kind:e,n:n})=>E(e,n),make:a}=t;if(!H(e,n,s))return null;const l=e.filter(e=>e.kind===n);let r=l.length+1;const o=new Set(e.map(e=>e.name));for(;o.has(i({kind:n,n:r}));)r+=1;const d=new Set(e.map(e=>e.id));let c=Math.max(r,...l.map(e=>(B(e.id,n)??0)+1));for(;d.has(`${n}-${c}`);)c+=1;const u=l.at(-1),m=a?a(n,r):{id:`${n}-${c}`,kind:n,name:i({kind:n,n:r}),values:{...u?.values??{}}},f=u?e.indexOf(u)+1:"heading"===n?0:e.length;return{styles:[...e.slice(0,f),m,...e.slice(f)],added:m}}function R(e,n,t={}){const{name:s=({kind:e,n:n})=>E(e,n)}=t,i=e.find(e=>e.id===n);if(!i||D(i))return null;const a=e.filter(e=>e.kind===i.kind),l=a.indexOf(i),r=/* @__PURE__ */new Map;return a.forEach((e,n)=>{n>l&&e.name===s({kind:e.kind,n:n+1})&&r.set(e,s({kind:e.kind,n:n}))}),{styles:e.filter(e=>e!==i).map(e=>r.has(e)?{...e,name:r.get(e)}:e),removed:i}}function T(e,n){const t=e.find(e=>e.id===n);if(t)return t;for(const t of O){const s=B(n,t);if(void 0===s)continue;let i;for(const n of e){const e=n.kind===t?B(n.id,t):void 0;void 0!==e&&e<s&&(!i||e>i.n)&&(i={n:e,style:n})}return i?.style}}function Y(e,n,t){return e.map(e=>{if(e.id!==n)return e;const s={...e.values};for(const[e,n]of Object.entries(t))void 0===n?delete s[e]:s[e]=n;return{...e,values:s}})}function V(e){return Math.min(20,Math.max(12,Math.round(.5*e+6)))}function q(e,n){const t=n.weights;return[t.thin,t.extraLight,t.light,t.regular,t.medium,t.semibold,t.bold,t.extraBold,t.black][Math.min(8,Math.max(0,Math.round(e/100)-1))]}function P(e,n,t,s={}){const i=n.find(n=>n.value===e.font)?.label??e.font??"",a=void 0===e.size?s.autoSize?t.auto:"":t.px({n:e.size});return t.summary({font:i,size:a,weight:q(e.weight??400,t)})}var X=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>o({h:e,s:1,v:1})).join(", ")})`;function Z({value:t,hex:s,colours:i,label:a,followsWord:l,anyWord:r,onChange:o,readOnly:u=!1}){const[v,g]=m(!1),k=f(null),y=f(null),b=h(),x=void 0!==t&&i.some(e=>e.key===t),w=void 0!==t&&!x;return p(()=>{if(!v)return;const e=k.current?.ownerDocument;if(!e)return;const n=e=>{k.current&&!k.current.contains(e.target)&&g(!1)};return e.addEventListener("click",n,!0),()=>e.removeEventListener("click",n,!0)},[v]),/* @__PURE__ */N("div",{ref:k,className:"es-ts-set","data-ts-setting":"color",children:[
2
2
  /* @__PURE__ */N("div",{className:"es-ts-top",children:[
3
3
  /* @__PURE__ */C("span",{className:"es-ts-sub",children:a}),
4
4
  /* @__PURE__ */C("span",{className:"es-ts-colour-read",children:s?e(s):l})]}),
5
5
  /* @__PURE__ */N("div",{className:"es-ts-swatches",role:"group","aria-label":a,children:[i.map(n=>/* @__PURE__ */C(d,{content:`${n.name} · ${e(n.value)}`,children:/* @__PURE__ */C(c,{color:n.value,size:"sm",className:"es-ts-swatch","aria-label":n.name,selected:t===n.key,disabled:u,onClick:()=>o(n.key)})},n.key)),
6
- /* @__PURE__ */C(d,{content:r,children:/* @__PURE__ */C(c,{ref:y,color:X,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:w,"aria-expanded":v,"aria-controls":v?b:void 0,disabled:u,onClick:()=>g(e=>!e)})})]}),v?/* @__PURE__ */C(n,{id:b,value:s??"",onChange:e=>o(e),label:a,readOnly:u,onClose:()=>{g(!1),y.current?.focus()}}):null]})}function _({styles:e,onChange:n,fonts:t,colours:i=[],settings:a=$,auto:o=[],fallback:d,sample:c,openId:u,defaultOpenId:y=null,onOpenChange:b,onAdd:x,rowActions:w,onRemove:S,max:M=A,readOnly:j=!1}){const F=l("textStyles",s),L=h(),[E,W]=m(y),B=void 0!==u?u:E,T=e=>{void 0===u&&W(e),b?.(e)},q=new Set(o),X=z.filter(e=>a.includes(e)),Z=f(null),[_,U]=m(null);p(()=>{if(!_||!Z.current)return;const e=[...Z.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===_.id),n=e?e.querySelector(".es-ts-row"):Z.current.querySelector(`.es-ts-add[data-ts-kind="${_.kind}"]`);n?.focus(),U(null)},[_]);/* @__PURE__ */
7
- return C("div",{className:"es-ts",ref:Z,children:O.map(s=>{const a=e.filter(e=>e.kind===s),l=`${L}-${s}`,o=!H(e,s,M),u=!j&&!o;/* @__PURE__ */
8
- return N("section",{className:"es-ts-section","aria-labelledby":l,children:[
9
- /* @__PURE__ */C("div",{className:"es-ts-group",id:l,children:F.groups[s]}),a.map(s=>{const a=B===s.id,l={...d?.(s)??{},...s.values},o=t.find(e=>e.value===l.font),u=`${L}-open-${s.id}`,m=w?.(s),f=null!=m&&!1!==m,h=Boolean(S)&&!j&&!D(s),p={fontFamily:o?.family,fontSize:`${V(l.size??16)}px`,fontWeight:l.weight,fontStyle:l.italic?"italic":void 0};/* @__PURE__ */
6
+ /* @__PURE__ */C(d,{content:r,children:/* @__PURE__ */C(c,{ref:y,color:X,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:w,"aria-expanded":v,"aria-controls":v?b:void 0,disabled:u,onClick:()=>g(e=>!e)})})]}),v?/* @__PURE__ */C(n,{id:b,value:s??"",onChange:e=>o(e),label:a,readOnly:u,onClose:()=>{g(!1),y.current?.focus()}}):null]})}function _({styles:e,onChange:n,fonts:t,colours:i=[],settings:a=$,auto:o=[],fallback:d,sample:c,openId:u,defaultOpenId:y=null,onOpenChange:b,onAdd:x,rowActions:w,onRemove:S,max:M=A,readOnly:j=!1}){const F=r("textStyles",s),L=h(),[E,W]=m(y),B=void 0!==u?u:E,T=e=>{void 0===u&&W(e),b?.(e)},q=new Set(o),X=z.filter(e=>a.includes(e)),Z=f(null),[_,U]=m(null);p(()=>{if(!_||!Z.current)return;const e=[...Z.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===_.id),n=e?e.querySelector(".es-ts-row"):Z.current.querySelector(`.es-ts-add[data-ts-kind="${_.kind}"]`);n?.focus(),U(null)},[_]);/* @__PURE__ */
7
+ return C("div",{className:"es-ts",ref:Z,children:O.map(s=>{const a=e.filter(e=>e.kind===s),r=`${L}-${s}`,o=!H(e,s,M),u=!j&&!o;/* @__PURE__ */
8
+ return N("section",{className:"es-ts-section","aria-labelledby":r,children:[
9
+ /* @__PURE__ */C("div",{className:"es-ts-group",id:r,children:F.groups[s]}),a.map(s=>{const a=B===s.id,r={...d?.(s)??{},...s.values},o=t.find(e=>e.value===r.font),u=`${L}-open-${s.id}`,m=w?.(s),f=null!=m&&!1!==m,h=Boolean(S)&&!j&&!D(s),p={fontFamily:o?.family,fontSize:`${V(r.size??16)}px`,fontWeight:r.weight,fontStyle:r.italic?"italic":void 0};/* @__PURE__ */
10
10
  return N(v,{children:[
11
11
  /* @__PURE__ */N("div",{className:"es-ts-item","data-ts-id":s.id,children:[
12
12
  /* @__PURE__ */N("button",{type:"button",className:"es-ts-row","aria-expanded":a,"aria-controls":a?u:void 0,onClick:()=>T(a?null:s.id),children:[
13
13
  /* @__PURE__ */C("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */C(g,{size:12})}),
14
14
  /* @__PURE__ */C("span",{className:"es-ts-name",style:p,children:s.name}),
15
- /* @__PURE__ */C("span",{className:"es-ts-meta",children:P(l,t,F,{autoSize:q.has("size")&&void 0===s.values.size})})]}),h||f?/* @__PURE__ */N("div",{className:"es-ts-actions",children:[h?r(F.remove,/* @__PURE__ */C("button",{type:"button",className:"es-ts-del","aria-label":F.removeNamed({name:s.name}),onClick:()=>(t=>{if(j||!S)return;const s=R(e,t.id,{name:F.styleName});if(!s)return;const i=e.filter(e=>e.kind===t.kind),a=i[i.indexOf(t)+1];B===t.id&&T(null),n(s.styles),S(s.removed),U({id:a?.id??null,kind:t.kind})})(s),children:/* @__PURE__ */C(k,{size:14,"aria-hidden":"true"})})):null,f?m:null]}):null]}),a?/* @__PURE__ */C("div",{className:"es-ts-open",id:u,children:/* @__PURE__ */C(K,{style:s,values:l,fonts:t,colours:i,settings:X,autoSet:q,sample:c??F.sample,words:F,readOnly:j,set:t=>n(Y(e,s.id,t))})}):null]},s.id)}),r(!j&&o?F.full({kind:s,max:M}):void 0,/* @__PURE__ */N("button",{type:"button",className:"es-ts-add","data-ts-kind":s,disabled:j,"aria-disabled":!(j||!o)||void 0,"aria-describedby":!j&&o?`${L}-full-${s}`:void 0,onClick:()=>{u&&(t=>{if(j)return;const s=I(e,t,{max:M,name:F.styleName,make:x});s&&n(s.styles)})(s)},children:[
15
+ /* @__PURE__ */C("span",{className:"es-ts-meta",children:P(r,t,F,{autoSize:q.has("size")&&void 0===s.values.size})})]}),h||f?/* @__PURE__ */N("div",{className:"es-ts-actions",children:[h?l(F.remove,/* @__PURE__ */C("button",{type:"button",className:"es-ts-del","aria-label":F.removeNamed({name:s.name}),onClick:()=>(t=>{if(j||!S)return;const s=R(e,t.id,{name:F.styleName});if(!s)return;const i=e.filter(e=>e.kind===t.kind),a=i[i.indexOf(t)+1];B===t.id&&T(null),n(s.styles),S(s.removed),U({id:a?.id??null,kind:t.kind})})(s),children:/* @__PURE__ */C(k,{size:14,"aria-hidden":"true"})})):null,f?m:null]}):null]}),a?/* @__PURE__ */C("div",{className:"es-ts-open",id:u,children:/* @__PURE__ */C(K,{style:s,values:r,fonts:t,colours:i,settings:X,autoSet:q,sample:c??F.sample,words:F,readOnly:j,set:t=>n(Y(e,s.id,t))})}):null]},s.id)}),l(!j&&o?F.full({kind:s,max:M}):void 0,/* @__PURE__ */N("button",{type:"button",className:"es-ts-add","data-ts-kind":s,disabled:j,"aria-disabled":!(j||!o)||void 0,"aria-describedby":!j&&o?`${L}-full-${s}`:void 0,onClick:()=>{u&&(t=>{if(j)return;const s=I(e,t,{max:M,name:F.styleName,make:x});s&&n(s.styles)})(s)},children:[
16
16
  /* @__PURE__ */C("span",{className:"es-ts-add-word",children:F.add[s]}),
17
- /* @__PURE__ */C("span",{className:"es-ts-count",children:F.count({n:a.length,max:M})})]})),j||!o?null:/* @__PURE__ */C("span",{id:`${L}-full-${s}`,className:"es-vh",children:F.full({kind:s,max:M})})]},s)})})}var U={none:S,upper:w,lower:x},G={none:"none",upper:"uppercase",lower:"lowercase"};function K({style:e,values:n,fonts:s,colours:i,settings:l,autoSet:o,sample:d,words:c,readOnly:m,set:f}){const h=e.values,p=s.find(e=>e.value===n.font),v=function(e,n){return e?n.find(n=>n.key===e)?.value??t(e)??void 0:void 0}(n.color,i),g=e=>"largestSize"===e||o.has(e),k=e=>g(e)?h[e]:n[e],x=k("size"),w=k("lineSpacing"),S=k("letterSpacing"),z=g("letterCase")?h.letterCase:n.letterCase,$={fontFamily:p?.family,fontSize:void 0===x?void 0:`${x}px`,fontWeight:n.weight,fontStyle:n.italic?"italic":void 0,lineHeight:void 0===w?void 0:String(w/100),letterSpacing:void 0===S?void 0:`${S}px`,color:v,textTransform:z?G[z]:void 0},O=e=>{const t=L[e],s=g(e);/* @__PURE__ */
17
+ /* @__PURE__ */C("span",{className:"es-ts-count",children:F.count({n:a.length,max:M})})]})),j||!o?null:/* @__PURE__ */C("span",{id:`${L}-full-${s}`,className:"es-vh",children:F.full({kind:s,max:M})})]},s)})})}var U={none:S,upper:w,lower:x},G={none:"none",upper:"uppercase",lower:"lowercase"};function K({style:e,values:n,fonts:s,colours:i,settings:r,autoSet:o,sample:d,words:c,readOnly:m,set:f}){const h=e.values,p=s.find(e=>e.value===n.font),v=function(e,n){return e?n.find(n=>n.key===e)?.value??t(e)??void 0:void 0}(n.color,i),g=e=>"largestSize"===e||o.has(e),k=e=>g(e)?h[e]:n[e],x=k("size"),w=k("lineSpacing"),S=k("letterSpacing"),z=g("letterCase")?h.letterCase:n.letterCase,$={fontFamily:p?.family,fontSize:void 0===x?void 0:`${x}px`,fontWeight:n.weight,fontStyle:n.italic?"italic":void 0,lineHeight:void 0===w?void 0:String(w/100),letterSpacing:void 0===S?void 0:`${S}px`,color:v,textTransform:z?G[z]:void 0},O=e=>{const t=L[e],s=g(e);/* @__PURE__ */
18
18
  return C("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */C(a,{label:c.settings[e],value:h[e],onChange:n=>f({[e]:n}),min:t.min,max:t.max,step:t.step,shiftStep:t.shiftStep,sliderMin:t.sliderMin,sliderMax:t.sliderMax,unit:t.unit||void 0,styleValue:s?void 0:n[e],auto:s?c.auto:void 0,readOnly:m})},e)};/* @__PURE__ */
19
19
  return N(M,{children:[
20
- /* @__PURE__ */C("div",{className:"es-ts-preview",style:$,"aria-label":c.preview,children:d}),l.map(t=>{switch(t){case"font":/* @__PURE__ */
20
+ /* @__PURE__ */C("div",{className:"es-ts-preview",style:$,"aria-label":c.preview,children:d}),r.map(t=>{switch(t){case"font":/* @__PURE__ */
21
21
  return C(J,{value:h.font,fonts:s,words:c,readOnly:m,set:f},t);case"color":/* @__PURE__ */
22
22
  return C(Q,{value:h.color,hex:v,colours:i,words:c,readOnly:m,set:f},t);case"emphasis":{const e=(n.weight??400)>=600,s=!1!==p?.italic;/* @__PURE__ */
23
23
  return N("div",{className:"es-ts-set","data-ts-setting":t,children:[
24
24
  /* @__PURE__ */C("span",{className:"es-ts-sub",children:c.settings.emphasis}),
25
- /* @__PURE__ */N("div",{className:"es-ts-icons",children:[r(c.bold,/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.bold,"aria-pressed":e,disabled:m,onClick:()=>f({weight:e?400:700}),children:/* @__PURE__ */C(y,{size:16})})),m||s?r(c.italic,/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(n.italic),disabled:m,onClick:()=>f({italic:!n.italic||void 0}),children:/* @__PURE__ */C(b,{size:16})})):/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(n.italic),"aria-disabled":!0,disabledReason:c.italicMissing,children:/* @__PURE__ */C(b,{size:16})})]})]},t)}case"letterCase":/* @__PURE__ */
25
+ /* @__PURE__ */N("div",{className:"es-ts-icons",children:[l(c.bold,/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.bold,"aria-pressed":e,disabled:m,onClick:()=>f({weight:e?400:700}),children:/* @__PURE__ */C(y,{size:16})})),m||s?l(c.italic,/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(n.italic),disabled:m,onClick:()=>f({italic:!n.italic||void 0}),children:/* @__PURE__ */C(b,{size:16})})):/* @__PURE__ */C(u,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(n.italic),"aria-disabled":!0,disabledReason:c.italicMissing,children:/* @__PURE__ */C(b,{size:16})})]})]},t)}case"letterCase":/* @__PURE__ */
26
26
  return C(ee,{value:h.letterCase??n.letterCase,auto:g("letterCase"),words:c,readOnly:m,set:f},t);case"largestSize":return"heading"===e.kind?O(t):null;default:return O(t)}})]})}function J({value:e,fonts:n,words:t,readOnly:s,set:a}){const l=h();/* @__PURE__ */
27
27
  return N("div",{className:"es-ts-set","data-ts-setting":"font",children:[
28
28
  /* @__PURE__ */C("span",{className:"es-ts-sub",id:l,children:t.settings.font}),
29
29
  /* @__PURE__ */C(i,{value:e,options:n.map(e=>({label:e.label,value:e.value})),onChange:e=>a({font:e}),ariaLabelledBy:l,readOnly:s})]})}function Q({value:e,hex:n,colours:t,words:s,readOnly:i,set:a}){/* @__PURE__ */
30
- return C(Z,{value:e,hex:n,colours:t,label:s.settings.color,followsWord:s.colour.follows,anyWord:s.colour.any,readOnly:i,onChange:e=>a({color:e})})}function ee({value:e,auto:n,words:t,readOnly:s,set:i}){const a=n?["auto","none","upper","lower"]:["none","upper","lower"],l=e??(n?"auto":"none"),o=f([]),d=e=>i({letterCase:"auto"===e?void 0:e});/* @__PURE__ */
30
+ return C(Z,{value:e,hex:n,colours:t,label:s.settings.color,followsWord:s.colour.follows,anyWord:s.colour.any,readOnly:i,onChange:e=>a({color:e})})}function ee({value:e,auto:n,words:t,readOnly:s,set:i}){const a=n?["auto","none","upper","lower"]:["none","upper","lower"],r=e??(n?"auto":"none"),o=f([]),d=e=>i({letterCase:"auto"===e?void 0:e});/* @__PURE__ */
31
31
  return N("div",{className:"es-ts-set","data-ts-setting":"letterCase",children:[
32
32
  /* @__PURE__ */C("span",{className:"es-ts-sub",children:t.settings.letterCase}),
33
- /* @__PURE__ */C("div",{className:"es-ts-icons",role:"radiogroup","aria-label":t.settings.letterCase,onKeyDown:e=>{const n="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!n||s)return;e.preventDefault();const t=(a.indexOf(l)+n+a.length)%a.length;d(a[t]),o.current[t]?.focus()},children:a.map((e,n)=>{const i=e===l;if("auto"===e)return r(t.case.autoTitle,/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon es-ts-icon--word","aria-checked":i,"aria-label":t.case.auto,tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:t.case.auto},e));const a=U[e];return r(t.case[e],/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon","aria-checked":i,"aria-label":t.case[e],tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:/* @__PURE__ */C(a,{size:16})},e))})})]})}export{$ as CAMPAIGN_TEXT_STYLE_SETTINGS,Z as ColourSwatchRow,j as TEXT_STYLE_DEFAULT_COUNT,O as TEXT_STYLE_KINDS,A as TEXT_STYLE_MAX,L as TEXT_STYLE_RANGES,z as TEXT_STYLE_SETTINGS,_ as TextStylesList,I as addTextStyle,H as canAddTextStyle,W as defaultTextStyles,P as describeTextStyle,D as isDefaultTextStyle,R as removeTextStyle,T as resolveTextStyle,V as textStyleRowSize,Y as updateTextStyle,q as weightWord};
33
+ /* @__PURE__ */C("div",{className:"es-ts-icons",role:"radiogroup","aria-label":t.settings.letterCase,onKeyDown:e=>{const n="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!n||s)return;e.preventDefault();const t=(a.indexOf(r)+n+a.length)%a.length;d(a[t]),o.current[t]?.focus()},children:a.map((e,n)=>{const i=e===r;if("auto"===e)return l(t.case.autoTitle,/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon es-ts-icon--word","aria-checked":i,"aria-label":t.case.auto,tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:t.case.auto},e));const a=U[e];return l(t.case[e],/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon","aria-checked":i,"aria-label":t.case[e],tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:/* @__PURE__ */C(a,{size:16})},e))})})]})}export{$ as CAMPAIGN_TEXT_STYLE_SETTINGS,Z as ColourSwatchRow,j as TEXT_STYLE_DEFAULT_COUNT,O as TEXT_STYLE_KINDS,A as TEXT_STYLE_MAX,L as TEXT_STYLE_RANGES,z as TEXT_STYLE_SETTINGS,_ as TextStylesList,I as addTextStyle,H as canAddTextStyle,W as defaultTextStyles,P as describeTextStyle,D as isDefaultTextStyle,R as removeTextStyle,T as resolveTextStyle,V as textStyleRowSize,Y as updateTextStyle,q as weightWord};
@@ -240,7 +240,7 @@
240
240
  .es-ts-icon--word {
241
241
  width: auto;
242
242
  padding: 0 var(--es-space-8, 8px);
243
- font-size: 13px;
243
+ font-size: 14px;
244
244
  font-weight: 500;
245
245
  }
246
246
 
@@ -262,7 +262,7 @@
262
262
  justify-content: space-between;
263
263
  gap: var(--es-space-8, 8px);
264
264
  padding: var(--es-space-12, 12px) 0 0;
265
- font-size: 13px;
265
+ font-size: 14px;
266
266
  font-weight: 500;
267
267
  color: var(--es-accent, var(--accent-600, var(--submit-bg)));
268
268
  cursor: pointer;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { S as SettingsBucket } from './buckets-CuLM47h9.js';
2
+ import { S as SettingsBucket } from './buckets-Tj-nkBpg.js';
3
3
 
4
4
  /** What every control shares: an id for its label, a name for screen readers, and a read-only switch. */
5
5
  interface ControlBase {
@@ -158,8 +158,11 @@ interface FieldMeta {
158
158
  label?: string;
159
159
  /** The tab this field opens; inherited by the fields after it (see above). */
160
160
  bucket?: SettingsBucket;
161
- /** Only says where a bucket starts. Draws nothing. */
161
+ /** Only says where a bucket (or, with `fold`, a band) starts. Draws nothing. */
162
162
  marker?: boolean;
163
+ /** On a marker: the title of the folding band that starts here (see above);
164
+ * `false`: the band above ends here and the rows after it stand alone. */
165
+ fold?: string | false;
163
166
  visible?: boolean;
164
167
  /** Drawn before the label. */
165
168
  icon?: ReactNode;
@@ -1,12 +1,13 @@
1
- import { S as SettingsBucket } from './buckets-CuLM47h9.js';
1
+ import { S as SettingsBucket, D as DesignGroup } from './buckets-Tj-nkBpg.js';
2
2
 
3
3
  /**
4
4
  * The settings panel's own words (`efficient-easel/strings`, 0.95.0): what
5
5
  * the tab strip is called, what each tab SAYS, and the Default / Reset part.
6
6
  *
7
- * A bucket's key (`'Content'`, `'Style'`, …) is an identifier — fields name
7
+ * A bucket's key (`'Design'`, `'Animation'`) is an identifier — fields name
8
8
  * their tab with it and `SETTINGS_BUCKETS` orders them — so it never changes
9
- * with the language. `buckets` is the word drawn for each key.
9
+ * with the language. `buckets` is the word drawn for each key. A Design
10
+ * group's key (`DESIGN_GROUPS`) is the same: `designGroups` is its word.
10
11
  *
11
12
  * The panel is hook-free, so nothing here is read from the strings provider:
12
13
  * `SettingsTabs` takes its name as `ariaLabel` and each tab's word as the
@@ -20,6 +21,10 @@ type PanelWords = {
20
21
  settings: string;
21
22
  /** The word each tab shows, by its key. */
22
23
  buckets: Record<SettingsBucket, string>;
24
+ /** The word each Design group's heading says, by its key (4.0.0). The
25
+ * host draws the headings; Content's draws none, and still has a word for
26
+ * a host that names it elsewhere. */
27
+ designGroups: Record<DesignGroup, string>;
23
28
  /** @deprecated Not drawn since option E (2026-10-07): an unchanged setting
24
29
  * shows nothing. Kept so a host's catalogue still type-checks. */
25
30
  followsDefault: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "4.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",
@@ -517,7 +517,7 @@
517
517
  "dist"
518
518
  ],
519
519
  "peerDependencies": {
520
- "efficient-shell": "^5.6.0 || ^6.4.0 || ^7.21.0",
520
+ "efficient-shell": "^7.21.0",
521
521
  "react": ">=18",
522
522
  "react-dom": ">=18"
523
523
  },
@@ -1,13 +0,0 @@
1
- /**
2
- * The settings tab words, in the owner's order (2026-09-11): Content, Style,
3
- * Layout, Animation. A panel shows only the tabs that hold a setting — an empty
4
- * tab is hidden, never drawn (same day).
5
- *
6
- * The website editor wrote this list in `efficient-storefront/lib/puck/field-groups.ts`
7
- * (`BUCKETS`). From 0.43.0 it lives here, so the campaign editor spells its panel
8
- * the same four words in the same order instead of keeping a second list.
9
- */
10
- declare const SETTINGS_BUCKETS: readonly ["Content", "Style", "Layout", "Animation"];
11
- type SettingsBucket = (typeof SETTINGS_BUCKETS)[number];
12
-
13
- export { type SettingsBucket as S, SETTINGS_BUCKETS as a };
@@ -1 +0,0 @@
1
- import{useSectionOps as o}from"./chunk-SNMCF2ZD.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-KFMJ4IM4.js";import{useEasel as p}from"./chunk-FUOZKV7A.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=p(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);c(()=>{k(l)},[k,l]);const K=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(K)},[K,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:K}}export{m as usePartBridge};
@@ -1 +0,0 @@
1
- import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-PAM3NLFL.js";import{BUCKET_KEY as r}from"./chunk-R2HLPNQF.js";import{ANCHOR_FIELD_KEYS as e,foldMetaOf as s,MEDIA_FIELD_MARKER as c,TEXT_FIELD_MARKER as p,LINK_FIELD_MARKER as i}from"./chunk-DUVRZ456.js";import{STYLE_KIND as u,fieldKind as f,copyStyle as a,heldStyle as l,planPaste as m,pasteMessage as y}from"./chunk-V7U33NF2.js";var h=/* @__PURE__ */new Set([r.Style,r.Layout]),j=new Set(Object.values(r)),w=new Set(e),b=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[c,p,i];function L(t){return`site:${t??""}`}function S(t){if(!t||"object"!=typeof t)return null;const n=t,r=o(t)??t,e=n[u]??r[u];if("string"==typeof e)return e;const s=n.options??r.options;if(Array.isArray(s)){return`choice:${s.map(t=>String(t?.value)).sort().join("|")}`}return f(r)}function g(t){const n=t,r=o(t);return k.some(t=>t in n||r&&t in r)}function v(o,r){const e=t(o,r)??{},c=[];let p=!1;for(const[t,o]of Object.entries(e))j.has(t)?p=h.has(t):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(s(o)||w.has(t)||b.has(t)||g(o)||"slot"!==o.type&&c.push({path:[t],kind:S(o),counted:"mobile"!==n(o)?.tier}));return c}function F(t,o,n,r,e){a({scope:n,type:r.type,label:e,rows:t(o,r),props:r.props})}function d(t,o,n,r,e,s){const c=l(n);if(!c)return null;const p=m(c,{type:r.type,rows:t(o,r),props:r.props});return{...p,message:y(p,c.sourceLabel,e,s)}}function A(t,o,n,r){F(v,t,o,n,r)}function N(t,o,n,r,e){return d(v,t,o,n,r,e)}var P={scope:t=>L(t.siteId),rows:(t,o)=>v(t,o),copy:(t,o,n,r)=>A(r,t,o,n),plan:(t,o,n,r)=>N(r,t,o,n)};function I(t,o){if(!t&&!o)return P;const n=t?.rows,r=n?(t,o)=>n(t,o):v;return{scope:t?.scope??P.scope,rows:(t,o)=>r(t,o),copy:t?.copy??((t,o,n,e)=>F(r,e,t,o,n)),plan:t?.plan??((t,n,e,s)=>d(r,s,t,n,e,o))}}export{A as copyNodeStyle,v as nodeStyleRows,N as planNodePaste,S as shopFieldKind,L as siteStyleScope,I as styleClipboardOf};
@@ -1,5 +0,0 @@
1
- import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-FUOZKV7A.js";import{Inspector as i}from"./chunk-NJOPEWYN.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},j={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},w={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},L={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},N={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function P(){/* @__PURE__ */
2
- return s(t,{height:"fill"})}function S(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
3
- return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var C=o({});function D({parts:n,children:e}){/* @__PURE__ */
4
- return s(C.Provider,{value:n,children:e})}function G(){return u(C)}function x(){return(G().useOwnerName??g)()}function A(){return(G().useDocumentLabel??y)()}function B(n,e,t,r){return(G().useBridges??v)(n,e,t,r)}function F(n){return(G().useStandaloneBridges??v)(n)}function I(n,e){(G().useDocumentPass??b)(n,e)}function T(){return G().blockRules??O}function K(){return G().blockLook??j}function R(){return G().devices??w}function V(){return G().leftView??L}function W(){return G().pinned??N}function E(){return G().saveSwitch??!0}function Y(n){e(!0===G().pickFollowsSelection,n)}function Z(){return G().add??h}function H(){return G().storageNamespace||void 0}function J(){return G().styleClipboard??null}function Q(){return G().nodeKeys??!0}function U(){return G().notify??null}function q(){return G().Canvas??P}function z(){return G().CanvasHead??null}function M(){return G().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
5
- return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return G().Inspector??S}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,D as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,Z as useScreenAdd,K as useScreenBlockLook,T as useScreenBlockRules,B as useScreenBridges,M as useScreenCanvasDrag,q as useScreenCanvasFrame,z as useScreenCanvasHead,_ as useScreenCanvasTarget,R as useScreenDevices,A as useScreenDocumentLabel,I as useScreenDocumentPass,nn as useScreenInspectorPanel,V as useScreenLeftView,Q as useScreenNodeKeys,U as useScreenNotify,x as useScreenOwnerName,G as useScreenParts,Y as useScreenPickFollowsSelection,W as useScreenPinned,E as useScreenSaveSwitch,H as useScreenStorageNamespace,J as useScreenStyleClipboard,F as useStandaloneScreenBridges};
@@ -1,65 +0,0 @@
1
- import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-7P6IFCR4.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-X2GNFJRC.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-42TMLDSQ.js";import{usePartBridge as v}from"./chunk-4YBMSUPL.js";import{useSectionOps as w}from"./chunk-SNMCF2ZD.js";import{useNodeClipboard as x,useNodeContextMenu as b}from"./chunk-ZHTQCAQ2.js";import{PageEditGuardNotices as z}from"./chunk-2I7MAA2U.js";import{useScreenDocument as B}from"./chunk-WZMU646D.js";import{requestMediaPick as C}from"./chunk-KG7RJWOK.js";import{heldStyle as O,styleShortcut as I}from"./chunk-V7U33NF2.js";import{AddChildRow as N}from"./chunk-5545A3PC.js";import{AddSidePanel as T}from"./chunk-QEWRHH6R.js";import{SidePanelHead as P,PanelShowStrip as $}from"./chunk-5SOSVTVI.js";import{MediaSidePanel as A}from"./chunk-TJOUAFJE.js";import{useScreenSaveSwitch as M,useScreenNodeKeys as j,useScreenPinned as R,useScreenDocumentLabel as L,useScreenCanvasFrame as E,useScreenInspectorPanel as F,useScreenDevices as V,useScreenPickFollowsSelection as D,useScreenLeftView as H,useScreenAdd as U,SELECTION_MODE as W,sameInspectorMode as G,useScreenBridges as J,useScreenBlockRules as Y,useScreenBlockLook as K,useScreenStorageNamespace as Q,useScreenNotify as X,useScreenCanvasHead as _,isSlotMode as q,useScreenStyleClipboard as Z,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-KFMJ4IM4.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-MCHMF32I.js";import{useEasel as we,useEaselApi as xe}from"./chunk-FUOZKV7A.js";import{TreeRow as be,Subtree as ze,LayersTree as Be,TreeGroupLabel as Ce,TreeRowAction as Oe,TreeSeam as Ie}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as Ne}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Te}from"./chunk-WK3AFPXY.js";import{toItemSelector as Pe,useNodeOps as $e,clickPick as Ae}from"./chunk-UK2FQOUT.js";import{LayersIcon as Me,MediaIcon as je}from"./chunk-4VJATVVR.js";import{DEFAULT_SAVE_WORDS as Re,saveIndicator as Le}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Ee,TopBarRail as Fe,TopBarCluster as Ve,EaselIconButton as De,TopBarDivider as He,DeviceSwitch as Ue,InspectorIconButton as We,PanelResizeHandle as Ge,MAX_PANEL_W as Je,MIN_PANEL_W as Ye,panelWidthVars as Ke,SaveState as Qe,SaveStateToggle as Xe}from"./chunk-GTDLBUOC.js";import{DEFAULT_CHROME_WORDS as _e}from"./chunk-Y2G7CU6A.js";import{useWords as qe}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as Ze}from"./chunk-7GVPKRW2.js";import{DEFAULT_DRAG_WORDS as en}from"./chunk-O2NLQBFX.js";import{createDragSession as nn,useTreeDrag as tn,gapToMoveIndex as on}from"./chunk-67GNT6PF.js";import{zoneKey as rn,ROOT_ID as ln,ROOT_SLOT as sn,parseZoneKey as dn,DataError as cn,find as an}from"./chunk-KRXQM65X.js";import{useCanvasFrame as pn,BLOCK_SELECTOR as un,useCanvasEvent as fn}from"./chunk-PAELDYYS.js";import{useRef as hn,useMemo as mn,useState as gn,useEffect as yn,useCallback as kn,useLayoutEffect as Sn,Fragment as vn}from"react";import{Tooltip as wn,Button as xn,toast as bn}from"efficient-shell/ui";import{UndoIcon as zn,RedoIcon as Bn,TrashIcon as Cn,EyeOffIcon as On,EyeIcon as In,DuplicateIcon as Nn}from"efficient-shell/icons/efficient";import{jsx as Tn,jsxs as Pn,Fragment as $n}from"react/jsx-runtime";function An({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i,words:l,saveWords:s}){if(null!==t)/* @__PURE__ */return Tn(Qe,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
2
- return Tn(Qe,{tone:e.pending?"off-unsaved":"off",label:l.notSaving,role:"status"});const{tone:d,label:c}=Le(e,s),a=e.failed&&!e.paused&&/* @__PURE__ */Tn(xn,{variant:"secondary",size:"sm",onClick:i,children:l.retry});/* @__PURE__ */
3
- return Pn($n,o?{children:[
4
- /* @__PURE__ */Tn(Xe,{pressed:e.paused,onToggle:r,title:e.paused?l.autoSaveOff:l.autoSaveOn,children:/* @__PURE__ */Tn(Qe,{tone:d,label:c})}),a]}:{children:[
5
- /* @__PURE__ */Tn(Qe,{tone:d,label:c,role:"status"}),a]})}function Mn({expand:e}){/* @__PURE__ */
6
- return Tn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Pn($n,e?{children:[
7
- /* @__PURE__ */Tn("path",{d:"M8 9l4-4 4 4"}),
8
- /* @__PURE__ */Tn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
9
- /* @__PURE__ */Tn("path",{d:"M8 4l4 4 4-4"}),
10
- /* @__PURE__ */Tn("path",{d:"M8 20l4-4 4 4"}),
11
- /* @__PURE__ */Tn("path",{d:"M5 12h14"})]})})}function jn(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var Rn="__rungs";var Ln="screen:band",En={duplicate:!0,delete:!0};function Fn(){const Le=ye(),{target:Qe,docId:Xe,capabilities:Fn,currentSlug:Vn,siteId:Dn,onPublish:Hn,saveState:Un,saveConflict:Wn,retrySave:Gn,toggleAutoSave:Jn,readOnly:Yn,readOnlyReason:Kn=null}=B(),Qn=M(),Xn=j(),{mediaEditing:_n,hasEditGuard:qn,hasPinnedChrome:Zn}=Fn,{appState:et,dispatch:nt,history:tt,selectedItem:ot,getSelectorForId:rt,config:it}=we(e=>e),lt=R(),{first:st,firstGroup:dt,lastGroup:ct,isSectionGroup:at,sectionGroupZone:pt,panelOf:ut}=lt,ft=ut(st),ht=e=>oe(lt,e),mt=e=>re(lt,e),gt="node"===lt.firstRow,yt=lt.band??null,kt=qe("screen",ve),St=qe("tree",Ne),vt=qe("drag",en),wt=qe("save",Re),xt=qe("menu",Te),bt=qe("styleClipboard",Se),zt=qe("chrome",_e),Bt=L()??`/${Vn}`,Ct=E(),Ot=F(),It=w({readOnly:Yn}),Nt=w({readOnly:Yn,foldIntoHistory:!0}),Tt=hn(null),Pt=xe(),$t=mn(()=>({...It,select:e=>{Tt.current=e,It.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Pt.config;Tt.current=Pe(e,t,n)}It.commitDocument(e,n)}}),[It,Pt]),At=et.ui,Mt=At.leftSideBarVisible,jt=At.rightSideBarVisible,{options:Rt,widths:Lt,initial:Et,fluid:Ft,fit:Vt}=V(),[Dt,Ht]=gn(Et),Ut=he(),Wt=_n&&null!==Ut,Gt=me(),Jt=ge();D(ot?.props.id);const{read:Yt,write:Kt,forSelection:Qt}=H(),[Xt,_t]=gn(Yt);yn(()=>{Kt(Xt)},[Xt]);const[qt,Zt]=gn(0),eo=hn(null),no=hn(null),to=pn(no,{readySelector:un}),oo=f(no);h(no,to);const[ro,io]=gn(!1),lo=hn(!1),so=hn(!1),[co,ao]=gn(null),po=U(),uo=e=>ao(null===e?null:{zone:le,index:e}),[fo,ho]=gn([]),[mo,go]=gn(W),yo="puck"===mo.kind,ko=ro&&!co&&po.railTarget?po.railTarget(et.data,{node:ot??null,mode:mo}):null,So=ko?{zone:rn(ko),index:ko.index}:null,vo=co??So,wo=vo&&vo.zone===le?vo.index:null,xo=t(mo,ot?.props.id),[bo,zo]=gn(null);yn(()=>{bo&&(o(),zo(null))},[bo]);const Bo=hn(rt);Bo.current=rt;const Co=kn((e,{scroll:n})=>{_t(n=>Qt(e,n)),n&&zo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Bo.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&tr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Oo=hn(null);yn(()=>{const e=Oo.current;Oo.current=null;const n=null==ot?.props.id?null:String(ot.props.id);go(e&&e.id===n?e.mode:ut(ot?.type)??W);const t=ot?.props.id,o=Tt.current;if(Tt.current=null,!t)return;const i=rt(t);Co(String(t),{scroll:!r(o,i??null,le)})},[ot?.props.id,Co]);const Io=kn(e=>{go(n=>G(n,e)?n:e),nt({type:"setUi",ui:{rightSideBarVisible:!0}})},[nt]),No=hn(()=>{});No.current=(e,n)=>{const t=e?Yr(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==ot?.props.id?null:String(ot.props.id);go(e=>G(e,n)?e:n),o!==r&&(Oo.current={id:o,mode:n},$t.select(e))};const To=kn((e,n)=>No.current(e,n),[]),Po={kind:mo.kind,mode:mo,open:Io,show:e=>go(e),reveal:()=>{jt||nt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:To},$o=J(Po,{data:et.data,selected:ot??null,zoneOf:e=>rt(e)?.zone,readOnly:Boolean(Yn),select:e=>{go(W),$t.select({index:e})},replace:(e,n)=>$t.replaceComponent(le,e,n),scrollTo:e=>ki(e)},{device:Dt,refreshes:qt},{setView:_t,reveal:()=>{Mt||nt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Ao=$o.pinnedSource??!1,Mo=$o.resolveLeftView?$o.resolveLeftView(Xt,Wt):"media"===Xt&&Wt?Xt:"sections",jo=Y(),{isLockedBlock:Ro,duplicateBlocked:Lo,nestDepth:Eo,newSectionNode:Fo,canAddTo:Vo,blockIsOffered:Do}=jo,Ho=K(),{labelAtLevel:Uo,Icon:Wo,useProducts:Go}=Ho,Jo=Ho.rowName?(e,n,t)=>Ho.rowName(e,n,t):void 0,Yo=kn(e=>{nt({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),Co(e,{scroll:!0})},[nt,Co]),{selectNode:Ko,openPartId:Qo}=v({mode:mo,setMode:go,onOpenPart:Yo}),[Xo,_o]=gn(null);ke(null!==Xo,()=>_o(null));const qo=y(Q()),Zo=qo.collapsed,er=qo.panelWidths,[nr,tr]=gn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Zo);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
12
- return new Set}});yn(()=>{try{window.localStorage.setItem(Zo,JSON.stringify([...nr]))}catch{}},[nr]);const[or,rr]=gn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(er);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});yn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(er,JSON.stringify(or))}catch{}},300);return()=>clearTimeout(e)},[or]);const ir=kn((e,n)=>rr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),lr=kn(e=>ir("left",e),[ir]),sr=kn(e=>ir("right",e),[ir]),dr=e=>nr.has(e),cr=e=>tr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),ar=hn(!1),pr=hn(null);yn(()=>{if(ar.current&&!ro){const e=pr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??no.current?.querySelector(`button[aria-label="${CSS.escape(kt.add.title)}"]`))?.focus(),pr.current=null}ar.current=ro},[ro]),yn(()=>{if(!ro||!oo)return;const e=e=>{"Escape"===e.key&&Oi()};return oo.addEventListener("keydown",e),()=>oo.removeEventListener("keydown",e)},[ro,oo]),ke(ro,()=>Oi()),yn(()=>{!Mt&&ro&&(io(!1),ao(null),lo.current=!1)},[Mt]),yn(()=>{if(!Gt)return so.current&&nt({type:"setUi",ui:{leftSideBarVisible:!1}}),void(so.current=!1);ro&&(io(!1),ao(null),so.current=lo.current,lo.current=!1),Mt||(so.current=!0,nt({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Gt]),yn(()=>{!Mt&&Gt&&(so.current=!1,Jt())},[Mt]),yn(()=>{if(!Gt||!oo)return;const e=e=>{"Escape"===e.key&&Jt()};return oo.addEventListener("keydown",e),()=>oo.removeEventListener("keydown",e)},[Gt,oo]),ke(null!==Gt,()=>Jt());const ur=X(),fr=(e,n="success")=>{ur?ur(e,"error"===n?"error":"info"):"error"===n?bn.error(e,{duration:3200,sound:!1}):bn.success(e,{duration:1900,sound:!1})},hr=hn(null),[mr,gr]=gn(0),[yr,kr]=gn(0),Sr=_(),vr=hn(null),wr=e=>Math.max(0,e.clientHeight-(vr.current?.offsetHeight??0));yn(()=>{const e=hr.current;if(!e)return;const n=()=>{gr(e.clientWidth),kr(wr(e))};n();const t=new ResizeObserver(n);return t.observe(e),vr.current&&t.observe(vr.current),()=>t.disconnect()},[]),Sn(()=>{hr.current&&(gr(hr.current.clientWidth),kr(wr(hr.current)))},[or,Mt,jt]);const xr=Dt===Ft?mr>0?mr:Lt[Ft]:Lt[Dt],br=mr>0?Math.min(mr/xr,"shrink"===Vt?1:2):1,zr=xr*br,Br=mr>0&&zr>mr+1,Cr={width:zr,height:yr||"100%",flex:"none",position:"relative"},Or={width:xr,height:yr?yr/br:"100%",maxHeight:"none",transform:1!==br?`scale(${br})`:void 0,transformOrigin:"top left"},Ir=()=>nt({type:"setUi",ui:{leftSideBarVisible:!Mt}}),Nr=()=>nt({type:"setUi",ui:{rightSideBarVisible:!jt}}),Tr=e=>{ro&&(io(!1),ao(null),lo.current=!1,Mt&&Xt===e)||Gt&&(so.current=!1,Jt(),Mt&&Xt===e)||(Mt&&Xt===e?Ir():(_t(e),Mt||nt({type:"setUi",ui:{leftSideBarVisible:!0}})))},Pr=()=>{C(Le,{accept:"image/*",title:zt.mediaLibrary})},$r=()=>{go(W),$t.select(null),u()},Ar=()=>{go(ft??W),jt||nt({type:"setUi",ui:{rightSideBarVisible:!0}})},Mr=et.data.content??[],jr=()=>{const e=Mr.findIndex(ht),n=Mr.findIndex(mt);return{floor:e>=0?e+1:0,cap:n>=0?n:Mr.length}},Rr=it,Lr=jo.stripCopy,Er=e=>i(e,Lr),Fr=x(),Vr=$e({data:et.data,config:Rr,readOnly:Boolean(Yn),clipboard:Fr,strip:Lr?e=>Lr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==ln||e.slot!==sn)return{min:0,max:n-1};const{floor:t,cap:o}=jr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&go(W);const t=void 0===n||"node"===n?.kind?n:null;$t.commitDocument(e,t)}}),Dr=e=>Uo(e,"block",it.components[e]?.label??e),Hr=kn(e=>it.components[e]?.defaultProps??{},[it]),Ur=e=>Uo(e,"section",Dr(e)),Wr=e=>l({type:e.type,props:e.props??{}},Ur(e.type),Jo),{nodeAddresses:Gr,zoneItems:Jr}=mn(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=de)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ce(it,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(Mr,le,0),{nodeAddresses:e,zoneItems:n}},[Mr,it]),Yr=kn(e=>Jr.get(e)??[],[Jr]),Kr=e=>{const n=Gr.get(e);return n?Yr(n.zone)[n.index]:void 0},Qr=e=>ie(jo,it,e),Xr=e=>{if(!jo.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Kr(e.slice(0,n));if(!t)return null;const o=Qr(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},_r=(()=>{if(!q(mo))return null;const e=`${mo.nodeId}:${mo.slot}`;return Xr(e)?.slot.panel===mo.kind?e:null})(),qr=hn(null);yn(()=>{const e=qr.current;if(qr.current=null,!_r||!q(mo))return;const n=mo.nodeId;Co(n,{scroll:e!==_r}),tr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[mo]);const Zr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Gr.get(e);n&&(n.zone===le?Si(n.index):Qi(n.zone,n.index,e,Kr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&_r!==i&&(qr.current=i),To(null,r),jt||nt({type:"setUi",ui:{rightSideBarVisible:!0}}),ki(o)},ei=(e,n,t)=>{const o=`${e}:${n}`;if(tr(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;_r!==o&&(qr.current=o);To(null,{kind:t,nodeId:e,slot:n})},ni=(e,n,t)=>{if(Yn||!jo.moveSlot)return;const o=Kr(e),r=o?Qr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Rn,index:n},s=on(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=jo.moveSlot(e,n,s);"string"==typeof d&&ei(e,d,i.panel)},ti=Go(),oi=mn(()=>{const e=/* @__PURE__ */new Map;for(const n of ti??[])e.set(n.slug,n.name);return e},[ti]),ri=e=>s(e,Dr,Ho.plainText,e=>oi.get(e),Ho.rowName),ii=(e,n)=>{const t=it.components[e.type]?.fields,o=n===le||fl(n)?"section":"block",r=n===le&&(ht(e)||mt(e)||at(e.type)),i="block"===o?d(t):r?null:c(t);return Ho.renamePropOf?Ho.renamePropOf(e,o,i):i},li=(e,n,t,o)=>{if(!(!Yn&&Xo?.zone===e&&Xo.index===n))return;const r=(t,o)=>{_o(null),o&&((e,n,t)=>{const o=Yr(e)[n];if(!o)return;const r=ii(o,e);r&&$t.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
13
- return Tn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":kt.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},si=n(Z(),bt),di=si.scope({target:Qe,siteId:Dn,docId:Xe}),ci=it,ai=(e,n)=>n===le?Ur(e):Dr(e),pi=(e,n,t)=>{const o=si.plan(di,t,ai(t.type,e),ci);o&&(o.changed&&$t.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),fr(o.message))},ui=b({nodesIn:Yr,nodeAt:(e,n)=>Yr(e)[n]??null,labelOf:(e,n)=>n===le?Ur(e):Dr(e),renamePropOf:ii,beginRename:(e,n)=>_o({zone:e,index:n}),history:{hasPast:tt.hasPast,hasFuture:tt.hasFuture,back:()=>tt.back(),forward:()=>tt.forward()},openAddSection:()=>{$t.select(null),Bi(null)},openPageSettings:()=>{$t.select(null),go(W)},pageSettingsLabel:kt.pageSettings,words:{menu:xt,styleClipboard:bt,screen:kt.menu},readOnly:Boolean(Yn),collapseAll:()=>tr(new Set(Yr(le).map(e=>String(e.props.id)))),onPasteRefused:e=>fr(e?kt.pasteRefused({name:e.label}):kt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>ml(e,n),menuRows:$o.menuRows,isLocked:e=>Ro(e.type),duplicateBlocked:e=>Lo(et.data,e),permits:e=>se(it,e.type),canAddTo:Vo,nodeOps:Vr,isPinned:(e,n)=>n===le&&(ht(e)||mt(e)),sectionBand:jr,openAddInside:(e,n)=>{e===le?Si(n):$t.select({zone:e,index:n}),Bi(null)},locate:e=>Gr.get(e)??null,rowNameOf:(e,n)=>n===le?Wr(e):ri(e),selectAt:(e,n,t,o)=>{e===le?Si(n):Qi(e,n,t,o??"")},slotRung:e=>{const n=Xr(e);return n?.slot.panel?{label:n.slot.label,select:()=>Zr(n.node,n.slot,!1)}:null},style:{held:()=>O(di),canCopy:e=>si.rows(ci,e).some(e=>!1!==e.counted),copy:(e,n)=>si.copy(di,e,ai(e.type,n),ci),paste:(e,n,t)=>pi(e,n,t)},keys:Xn?{target:oo,selected:()=>{const e=et.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>Fr.get(),readOnly:Boolean(Yn),onDone:({done:e,name:n})=>{"copied"===e&&fr(kt.copied({name:n}))}}:void 0},to),fi=hn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});yn(()=>{fi.current={copy:(e,n)=>si.copy(di,e,ai(e.type,n),ci),paste:pi,at:()=>{const e=et.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Yr(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Yn)}});const hi=kn(e=>{const n=I(e);if(!n)return;const t=fi.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);yn(()=>{if(!oo)return;const e=e=>hi(e);return oo.addEventListener("keydown",e),()=>oo.removeEventListener("keydown",e)},[hi,oo]),fn(to,"keydown",hi);const mi=Mr.map(e=>e.props.id).join("|");yn(()=>{const e=to?.document??null,n=to?.window??null;let t=0;const o=[],r=()=>{if(!e)return void ho(e=>e.length?[]:e);const n=Mr.findIndex(mt),t=n>=0?n:Mr.length,o=n=>{const t=Mr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(un)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=jn(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}ho(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[to,mi,Dt,br,Mt,jt,ot?.props.id]);const gi=to?.document??null,yi=to?.window??null;yn(()=>{const e=eo.current;if(!e||!gi||!yi)return;const n=[],t=()=>{const n=gi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&yi.scrollTo({left:yi.scrollX,top:yi.scrollY+t,behavior:"instant"}),!0};return eo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[gi,yi]);const ki=e=>{$o.holdCanvasOn?$o.holdCanvasOn(e):a(e)},Si=e=>{go(W),$t.select({index:e}),$o.sectionPressed?.(Mr[e]);const n=Mr[e]?.props?.id;n&&ki(n)},vi=e=>{const{floor:n,cap:t}=jr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=ot&&mo.kind!==ft?.kind?Mr.findIndex(e=>e.props.id===ot.props.id):-1;return o(r>=0?r+1:t)},wi=(e,n)=>{const{floor:t,cap:o}=jr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:($t.reorderComponent(le,e,i),$t.select({index:i}),{moved:!0,dest:i})},xi=(e,n,t,o)=>{go(W),$t.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),fr(kt.sectionAdded({name:t}))},bi=(e,n)=>{const t=vi(n),o=Fo(e,{nodeDefaults:Hr,newNodeId:fe,sectionLabel:Ur,blockIsOffered:Do}),r=o?$t.insertNode(le,t,o):$t.insertSection(e,t);return xi(t,r,Ur(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:c}of ce(it,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Vo(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:c,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},zi=(e,n,t)=>{const o=vi(t),r=$t.insertNode(le,o,n);return xi(o,r,e),o},Bi=e=>Ci(le,e),Ci=(e,n)=>{pr.current=document.activeElement??null,Gt&&(lo.current=so.current,so.current=!1,Jt()),ao(null===n?null:{zone:e,index:n}),io(!0),Mt||(lo.current=!0,nt({type:"setUi",ui:{leftSideBarVisible:!0}}))},Oi=()=>{io(!1),ao(null),lo.current&&nt({type:"setUi",ui:{leftSideBarVisible:!1}}),lo.current=!1},Ii=(e,n,t)=>{if("section"===e.kind)$t.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;$t.insertNode(n,t,Er(e.template.node))}go(W),$t.select({index:t,zone:n})},Ni=(e,n)=>Ho.rowName?n?ht(e)?Ho.rowName(e,"section",kt.header):mt(e)?Ho.rowName(e,"section",kt.footer):at(e.type)?Ho.rowName(e,"section",Dr(e.type)):Wr(e):ri(e):n?Ur(e.type):Dr(e.type),Ti=e=>n=>{e()},Pi=()=>$o.editPinnedSource?.(),$i=(e,n,t)=>{if(Yn)return null;const o=Yr(e)[n];return o&&!se(it,o.type).delete?null:/* @__PURE__ */Tn(Oe,{kind:"delete",label:kt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Yr(e)[n]?.props?.id;null!=t&&Vr.remove(String(t))})(e,n),children:/* @__PURE__ */Tn(Cn,{size:15})})},Ai=e=>Ho.rowPreview?.(e)||void 0,Mi=e=>Ho.rowMarks?.(e)??void 0,ji=(e,n,t)=>Ho.rowActions?.(e,n,t)??null,Ri=(e,n,t,o)=>{if(Yn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
14
- return Tn(Oe,{kind:"eye",label:r?kt.showNamed({name:o}):kt.hideNamed({name:o}),onClick:()=>Ei(e,n,t),children:/* @__PURE__ */Tn(r?On:In,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},Li=e=>{const n=Ur(Mr[e]?.type??""),t=n?kt.addSectionBefore({name:n}):kt.addSectionHere;return Ll(le,e,()=>Bi(e),t)},Ei=(e,n,t)=>{$t.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Fi=e=>ae(it,e),Vi=e=>ce(it,e),Di=e=>jo.slotsOf?Qr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Vi(e)}],Hi=e=>jo.slotsOf?Di(e).flatMap(e=>e.kids):Vi(e),Ui=e=>Boolean(jo.slotsOf)&&Qr(e).some(e=>e.rung),Wi=(e,n,t)=>null===t?void 0===n?Vo(e):Vo(e,n):Vo(e,n,t),Gi=(e,n,t)=>{const o=ue(it,e.type,n)&&(t||Hi(e).length>0||Ui(e));return{collapsible:o,folded:o&&dr(String(e.props.id))}},Ji=(e,n,t)=>Di(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Gi(e,r,t(e.type)).collapsible?[String(e.props.id),...Ji(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Yi=e=>Hi(e).length>0||Ui(e)||Boolean(Vo(e.type)),Ki=e=>Boolean(Vo(e)),Qi=(e,n,t,o)=>{if(go(W),Vo(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),$t.select({index:n,zone:e}),a(t)}else $t.select({index:n,zone:e}),ki(t)},Xi=(e,n,t,o,r)=>{const i=`${e}:${n}`;$t.insertComponent(i,t,o),Vo(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),$t.select({index:o,zone:i})}):$t.select({index:o,zone:i})},_i=(e,n,t)=>{$t.insertComponent(e,n,t),go(W),$t.select({index:t,zone:e})},qi=hn(/* @__PURE__ */new Set);yn(()=>{Mr.forEach(e=>{const n=Vo(e.type)?.spec;if(!n)return;const t=e.props.id;if(qi.current.has(t))return;qi.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(Hr)).forEach((e,t)=>Nt.seedChild(o,t,n.childType,e))})},[Mr,Nt,Hr]);const Zi=hn(/* @__PURE__ */new Set);yn(()=>{Mr.forEach((n,t)=>{const o=n.props.id;if(Zi.current.has(o))return;const r=e(n,Fi(n.type));Zi.current.add(o),r&&Nt.replaceComponent(le,t,{...n,props:r})})},[Mr,Nt]),ee(Nt,it);const el=Mr.findIndex(mt),nl=el>=0?Mr[el]:null,tl=gt?Mr.findIndex(ht):-1,ol=tl>=0?Mr[tl]:null,rl=Mr.find(e=>e.type===dt)??null,il=Mr.find(e=>e.type===ct)??null,ll=el>=0?el:Mr.length,sl=[];Mr.forEach(e=>{mt(e)||(Yi(e)&&sl.push(String(e.props.id)),sl.push(...Ji(e,1,Ki)))}),nl&&(sl.push(String(nl.props.id)),sl.push(...Ji(nl,1,Ki)));const dl=sl.length>0&&sl.every(e=>nr.has(e)),cl=e=>{const n=Ho.blockRowName(e,Dr);return Ho.rowName?Ho.rowName(e,"block",n):n},al=(e,n,t,o)=>{const r=Yr(e)[t];if(!r)return;const i={...dn(e),index:t},l={...dn(n),index:Math.min(Math.max(o,0),Yr(n).length)},s=on(i,l);if(e!==n||s!==t)try{Vr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof cn))throw e}},pl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Vi(e))n.add(r),t(o)};for(const t of Fi(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ul=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Gr.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},fl=e=>{const n=e.slice(0,e.indexOf(":")),t=Mr.find(e=>at(e.type)&&String(e.props.id)===n);return t&&pt(n)===e?t:null},hl=(e,n,t)=>{if(e.rung){const t=Kr(e.rung.nodeId),o=t?Qr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Rn&&n.index>=0&&n.index<=o}if(n.slot===Rn)return!1;if(e.add)return yl(e.add,n);const o=rn(n);if(at(e.type))return!1;const r=fl(o),i=fl(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Yr(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=jr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Yr(o).length)return!1;if(e.zone===o)return!0;const l=nl&&!lt.lastIsOpen?String(nl.props.id):null;return(!l||ul(e.zone)!==l&&ul(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Yr(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Gr.get(i),s=l?Yr(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&pl(r).has(n))return!1;const d=Vo(s.type,Eo(et?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Yr(n),r))})(e.zone,o,e.index,t)},ml=(e,n)=>{const t=rn(e.from);if(t===rn(n))return!0;const o=e.node;return hl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},gl=e=>{const n=e.slice(0,e.indexOf(":")),t=Gr.get(n),o=t?Yr(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Vo(o.type,Eo(et?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:Dr(r.spec.childType)}]:[]),l=Xr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Ni(o,t.zone===le)}},yl=(e,n)=>{const t=rn(n);if("block"!==e.kind){if(fl(t))return n.index>=0&&n.index<=Yr(t).length;if(t!==le)return!1;const{floor:e,cap:o}=jr();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=gl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Yr(t))},kl=(e,n)=>{e.rung?ni(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&fl(rn(n)))return void Ii(e,rn(n),n.index);if("section"===e.kind)return void bi(e.type,n.index);if("template"===e.kind)return void zi(e.template.name,Er(e.template.node),n.index);const t=rn(n),o=gl(t);o&&(o.target.spec?Xi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):_i(t,e.type,n.index))})(e.add,n):e.zone===le?wi(e.index,n.index):al(e.zone,rn(n),e.index,n.index)},[Sl]=gn(()=>nn()),vl=tn({keyOf:e=>e.id,readOnly:Boolean(Yn),session:Sl,canDrop:hl,onDrop:kl,onStep:(e,n)=>{e.rung?ni(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=Ur(Mr[e]?.type??""),o=wi(e,n<0?e-1:e+2);if(!o.moved)return void fr(n<0?kt.sectionFirst({name:t}):kt.sectionLast({name:t}));const{floor:r,cap:i}=jr();fr(kt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):al(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),wl=kn(e=>{const{floor:n,cap:t}=jr(),o=[];for(const r of e.nodes){const e=rn(r.place),i=Yr(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(ht(i)||mt(i)||Ro(i.type))continue;if(at(i.type))continue;const l=Boolean(fl(e)),s=e===le||l;e===le&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?Ur(i.type):ri(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(gl(rn(e.list))?.choices.length)||Boolean(fl(rn(e.list))))}},[et.data]),xl=null==ot?.props.id?null:String(ot.props.id),bl=kn(e=>{const n=it,t=e=>!e.item.rung&&null!==an(et.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(xl);return i||(r(Ae(et.data,n,o.item.id,xl))??o)},[et.data,it,xl]),zl=e=>{go(W),$t.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},Bl=ne(),Cl=()=>({data:et.data,device:Dt,ops:$t,inspector:Po}),Ol=Bl?.model,Il=mn(()=>Ol?e=>Ol(e,wl(e),Cl()):wl,[Ol,wl,Dt]),Nl=Bl?.measure,Tl=Nl?(e,n)=>Nl(e,n,Cl()):void 0,Pl=Bl?.canDrop,$l=Pl?(e,n)=>Pl(e,n,hl,Cl()):hl,Al=Bl?.drop,Ml=Al?(e,n)=>Al(e,n,kl,Cl()):kl,jl=Bl?.pick,Rl=jl?e=>jl(e,zl,Cl()):zl,Ll=(e,n,t,o)=>/* @__PURE__ */Tn(Ie,{...Yn?{}:vl.seam({place:{...dn(e),index:n}}),onAdd:Yn?void 0:t,label:o},`seam:${e}:${n}`),El={rowClick:Ti,isCollapsed:dr,toggleCollapse:cr},Fl=e=>{const n=String(e.props.id),t=Mr.findIndex(e=>String(e.props.id)===n),o=pt(n),r=Yr(o),i=dr(n),l=Dr(e.type),s=Ho.rowName?Ho.rowName(e,"section",l):l,d=e=>Ll(o,e,()=>Ci(o,e),kt.addSectionHere);/* @__PURE__ */
15
- return Pn($n,{children:[
16
- /* @__PURE__ */Tn(be,{words:St,icon:/* @__PURE__ */Tn(Wo,{type:e.type,size:13}),name:s,preview:Ai(e),marks:Mi(e),onSelect:()=>Si(t),nameSlot:li(le,t,n,s),selected:xo===n,actions:ji(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:Ti(()=>Si(t))},fold:{open:!i,label:"section",onToggle:()=>cr(n)}}),!i&&/* @__PURE__ */Pn(ze,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Wr(n),l=Yi(n),s=l&&dr(r),c=()=>Qi(o,t,r,e.type),{rowProps:a,...p}=vl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...dn(o),index:t}},{"data-node-id":r,onClick:Ti(c)});/* @__PURE__ */
17
- return Pn(vn,{children:[d(t),
18
- /* @__PURE__ */Tn(be,{words:St,icon:/* @__PURE__ */Tn(Wo,{type:n.type,size:13}),name:i,preview:Ai(n),marks:Mi(n),onSelect:c,nameSlot:li(o,t,r,i),selected:xo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>cr(r)}:void 0,actions:/* @__PURE__ */Pn($n,{children:[$i(o,t,i),ji(n,o,t),Ri(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Tn(ze,{children:Hl(n,2)})]},r)}),d(r.length)]})]})},Vl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=vl.dragging,d=!dr(l)&&s?.rung?.nodeId!==i,c={...dn(l),index:0},a=s&&!s.rung&&hl(s,c)?c:void 0,p=()=>Zr(e,n,!0),{rowProps:u,...f}=vl.row({item:{id:`rung:${l}`,zone:`${i}:${Rn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Rn,index:t},into:a,canDrag:Boolean(jo.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Ti(p)}),h=Yn?null:jo.slotActions?.(e,n.slot);/* @__PURE__ */
19
- return Pn(vn,{children:[n.heading,
20
- /* @__PURE__ */Tn(be,{words:St,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:_r===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>cr(l)},actions:h&&h.length>0?/* @__PURE__ */Tn($n,{children:h.map((t,o)=>/* @__PURE__ */Tn(Oe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Yn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&ei(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */Tn(Cn,{size:15}):/* @__PURE__ */Tn(Nn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Tn(ze,{children:r})]},l)},Dl=(e,n)=>{const t=Di(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
21
- return Tn($n,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Wi(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(gl(c)?.choices.length),p=(e,n)=>a?Ll(e,n,()=>Ci(e,n),kt.addBlockHere):Ll(e,n),u=/* @__PURE__ */Pn($n,{children:[i.map(({child:n,zone:t,index:o})=>{const r=xo===String(n.props.id),{collapsible:i,folded:s}=Gi(n,l,Ki(n.type)),d=String(n.props.id),c=cl(n),a=()=>Qi(t,o,d,e.type),{rowProps:u,...f}=vl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...dn(t),index:o}},{"data-node-id":d,onClick:Ti(a)});/* @__PURE__ */
22
- return Pn(vn,{children:[0===o&&p(t,0),
23
- /* @__PURE__ */Tn(be,{words:St,icon:/* @__PURE__ */Tn(Wo,{type:n.type,size:13}),name:c,preview:Ai(n),marks:Mi(n),onSelect:a,nameSlot:li(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>cr(d)}:void 0,actions:/* @__PURE__ */Pn($n,{children:[$i(t,o,c),ji(n,t,o),Ri(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Tn(ze,{children:Dl(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?Vl(e,t.rung,r++,o,u):/* @__PURE__ */Tn(vn,{children:u},t.slot??"")})})},Hl=(e,n)=>{const t=Eo(et?.data,e.type,String(e.props.id)),o=Di(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
24
- return Tn($n,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Wi(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>Xi(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>Ci(n,t):void 0;return Ll(n,t,o,n===f&&c?c.addLabel:kt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Pn($n,{children:[l.map(({child:n,zone:t,index:o})=>{const r=xo===String(n.props.id),i=ri(n),l=String(n.props.id),{collapsible:d,folded:c}=Gi(n,s,Ki(n.type)),a=Fi(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...dn(p),index:Yr(p).length}:void 0,f=vl.dragging,h=u&&f&&hl(f,u)?u:void 0,g=()=>Qi(t,o,l,e.type),{rowProps:y,...k}=vl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...dn(t),index:o},into:h,canDrag:!Ro(n.type)},{"data-node-id":l,onClick:Ti(g)});/* @__PURE__ */
25
- return Pn(vn,{children:[0===o&&m(t,0),
26
- /* @__PURE__ */Tn(be,{words:St,icon:/* @__PURE__ */Tn(Wo,{type:n.type,size:13}),name:i,preview:Ai(n),marks:Mi(n),onSelect:g,nameSlot:li(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>cr(l)}:void 0,actions:Ro(n.type)?ji(n,t,o)??void 0:/* @__PURE__ */Pn($n,{children:[$i(t,o,i),ji(n,t,o),Ri(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Tn(ze,{children:Hl(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
27
- /* @__PURE__ */Tn(N,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>Xi(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?Vl(e,o.rung,i++,r,k):/* @__PURE__ */Tn(vn,{children:k},o.slot??"")})})},Ul=(()=>{if(!ot||!yo)return null;const e=String(ot.type),n=String(ot.props.id),t=Vo(e,Eo(et?.data,e,n));if(!t||"footer"===t.source)return null;const o=Mr.some(e=>String(e.props?.id)===n),r=Array.isArray(ot.props[t.slot])?ot.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Dr(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:Ni(ot,o),choices:i,onPick:o=>{t.spec?Xi(n,t.slot,o,r.length,e):_i(`${n}:${t.slot}`,o,r.length)}}})(),Wl=vo&&vo.zone!==le&&!fl(vo.zone)?vo.zone:null,Gl=!0===po.blocksFirst,Jl=Wl?gl(Wl):Gl&&vo?null:Ul,Yl=Boolean(co&&Wl)||Gl&&Boolean(Jl&&Jl.choices.length>0),Kl=ro||null!==Gt,Ql=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Mt&&!Kl&&Mo===e.id,onSelect:()=>Tr(e.id)}:e,Xl=[{id:"add",label:kt.add.title,icon:/* @__PURE__ */Tn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:ro,onSelect:()=>ro?Oi():Bi(null)},...($o.railLead??[]).map(Ql),{id:"sections",label:kt.layers,icon:/* @__PURE__ */Tn(Me,{}),active:Mt&&!Kl&&"sections"===Mo,onSelect:()=>Tr("sections")},...($o.railTrail??[]).map(Ql)];Wt?Xl.push({id:"media",label:kt.railMedia,icon:/* @__PURE__ */Tn(je,{}),active:Mt&&!ro&&(null!==Gt||"media"===Mo),onSelect:()=>Tr("media")}):_n&&Xl.push({id:"media",label:kt.railMedia,icon:/* @__PURE__ */Tn(je,{}),onSelect:Pr});const _l=[...$o.railLead??[],...$o.railTrail??[]].find(e=>"panel"in e&&e.id===Mo),ql=Boolean(yt?.foldable)&&!Ao,Zl=yt?.label??(qn?kt.pageSections:kt.templateSections),es=ql&&dr(Ln),ns=/* @__PURE__ */Pn($n,{children:[Mr.map((e,n)=>{if(ht(e)||mt(e)||at(e.type))return null;const t=xo===String(e.props.id),o=Boolean(e.props._hidden);Vi(e);const r=String(e.props.id),i=$o.hasOwnRows?.(e)??!1,l=Yi(e)||i,s=l&&dr(r),{rowProps:d,...c}=vl.row({item:{id:r,zone:le,index:n,type:e.type},place:{...dn(le),index:n}},{"data-node-id":r,onClick:Ti(()=>Si(n))});/* @__PURE__ */
28
- return Pn(vn,{children:[n>0&&Li(n),
29
- /* @__PURE__ */Tn(be,{words:St,icon:/* @__PURE__ */Tn(Wo,{type:e.type,size:13}),name:Wr(e),preview:Ai(e),marks:Mi(e),onSelect:()=>Si(n),nameSlot:li(le,n,r,Wr(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>cr(r)}:void 0,actions:/* @__PURE__ */Pn($n,{children:[$i(le,n,Wr(e)),ji(e,le,n),Ri(le,n,e,Wr(e))]}),rowProps:d}),Yi(e)&&!s&&/* @__PURE__ */Pn(ze,{children:[Hl(e,1),$o.partRows?.(e,El)]}),i&&!s&&/* @__PURE__ */Tn(ze,{children:$o.ownRows?.(e,n,El)})]},String(e.props.id??n))}),!Ao&&ll>0&&Li(ll),yt?.addAtEnd&&!Ao&&!Yn&&/* @__PURE__ */Tn(N,{small:!0,label:kt.addSection,blocked:null,onAdd:()=>Bi(ll)})]}),ts=(e,n,t)=>{const o=String(e.props.id),r=Hi(e).length>0||Ui(e)||Boolean(Vo(e.type)),i=r&&dr(o),l="header"===t?kt.header:kt.footer,s=Ho.rowName?Ho.rowName(e,"section",l):l;/* @__PURE__ */
30
- return Pn($n,{children:[
31
- /* @__PURE__ */Tn(be,{words:St,icon:/* @__PURE__ */Tn(Wo,{type:t,size:13}),name:s,preview:Ai(e),marks:Mi(e),onSelect:()=>Si(n),nameSlot:li(le,n,o,s),selected:xo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>cr(o)}:void 0,actions:ji(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:Ti(()=>Si(n))}}),r&&!i&&/* @__PURE__ */Tn(ze,{children:Dl(e,1)})]})};return($o.wrap??(e=>e))(
32
- /* @__PURE__ */Tn(te,{target:to,children:/* @__PURE__ */Pn("div",{ref:no,className:"sf-editor es-editor",style:Ke(or),onContextMenu:ui.onEditorContextMenu,...m(Le),children:[
33
- /* @__PURE__ */Pn(Ee,{children:[
34
- /* @__PURE__ */Tn(Fe,{items:Xl,ariaLabel:kt.bar.views}),
35
- /* @__PURE__ */Pn(Ve,{children:[
36
- /* @__PURE__ */Tn(De,{label:kt.bar.undo,disabled:Boolean(Yn)||!tt.hasPast,onClick:()=>tt.back(),children:/* @__PURE__ */Tn(zn,{})}),
37
- /* @__PURE__ */Tn(De,{label:kt.bar.redo,disabled:Boolean(Yn)||!tt.hasFuture,onClick:()=>tt.forward(),children:/* @__PURE__ */Tn(Bn,{})}),
38
- /* @__PURE__ */Tn(He,{}),
39
- /* @__PURE__ */Tn(Ue,{devices:Rt,value:Dt,onChange:Ht})]}),
40
- /* @__PURE__ */Pn(Ve,{kind:"right",style:{minWidth:300},children:[
41
- /* @__PURE__ */Tn(An,{saveState:Un,notSaving:Boolean(Yn)||null!=Wn,readOnlyReason:Kn,toggle:Qn,onToggle:Jn,onRetry:Gn,words:kt.bar,saveWords:wt}),$o.barLead?.(),
42
- /* @__PURE__ */Tn(wn,{content:kt.bar.refreshTip,side:"bottom",children:/* @__PURE__ */Tn(xn,{variant:"secondary",onClick:()=>{eo.current=(()=>{const e=to?.document;if(!e)return null;const n=Mr.findIndex(mt),t=n>=0?n:Mr.length;let o=null;for(let n=0;n<t;n++){const t=Mr[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=ot?.props?.id??Mr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Zt(e=>e+1)},children:kt.bar.refresh})}),$o.barTrail?.(),$o.barMain?$o.barMain():/* @__PURE__ */Tn(xn,{variant:"primary",disabled:null!==Kn,onClick:()=>{Hn(et.data)},children:kt.done})]})]}),
43
- /* @__PURE__ */Tn(z,{}),
44
- /* @__PURE__ */Pn("div",{className:"sf-body",children:[Mt?/* @__PURE__ */Pn($n,{children:[
45
- /* @__PURE__ */Tn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":kt.leftPanel,children:ro?/* @__PURE__ */Tn(T,{blocks:Jl,blocksOnly:Yl,at:co?{label:(e=>{const n=fl(e.zone);if(n)return kt.add.addingTo({name:Ho.rowName?Ni(n,!0):Dr(n.type)});if(e.zone===le){const n=Mr[e.index];return n&&!mt(n)?kt.add.addingBefore({name:Ni(n,!0)}):kt.add.addingAtEnd}const t=gl(e.zone);return t?kt.add.addingTo({name:t.parentName}):kt.add.addingHere})(co),onClear:()=>ao(null)}:void 0,onAdd:e=>{const n=vo,t=(e,n)=>{co&&ao({zone:e,index:n})};if(n&&"block"!==e.kind&&fl(n.zone))return Ii(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===wo)return void bi(e);const n=bi(e,wo);co&&uo(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===wo)return void zi(e,n);const t=zi(e,n,wo);co&&uo(t+1)})(e.template.name,Er(e.template.node));if(n&&n.zone!==le){const o=gl(n.zone);if(!o)return;return o.target.spec?Xi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):_i(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Ul?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:Sl,siteWide:$o.addPanelRow?.(Oi),onClose:Oi,onHide:Ir,readOnly:Boolean(Yn)}):Gt&&Ut?
46
- /* @__PURE__ */Tn(A,{panel:Ut,pick:Gt,onHide:Ir}):_l?_l.panel({onHide:Ir,notify:fr}):"media"===Mo&&Ut?/* @__PURE__ */Tn(A,{panel:Ut,pick:null,onHide:Ir}):/* @__PURE__ */Pn($n,{children:[
47
- /* @__PURE__ */Tn(P,{icon:/* @__PURE__ */Tn(Me,{}),title:kt.layers,context:Bt,actions:
48
- /* @__PURE__ */Tn(We,{label:dl?kt.expandAll:kt.collapseAll,title:0===sl.length?kt.nothingToFold:void 0,disabled:0===sl.length,onClick:()=>tr(e=>{const n=new Set(sl);return dl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...sl])}),children:/* @__PURE__ */Tn(Mn,{expand:dl})}),onHide:Ir}),
49
- /* @__PURE__ */Pn(Be,{className:"sf-tree sf-scroll",words:St,children:[
50
- /* @__PURE__ */Tn(be,{words:St,icon:/* @__PURE__ */Tn(Wo,{type:"page",size:13}),name:kt.pageSettings,onSelect:$r,selected:!ot&&yo,rowProps:{onClick:Ti($r)}}),rl&&/* @__PURE__ */Pn($n,{children:[
51
- /* @__PURE__ */Tn(Ce,{children:kt.header}),Fl(rl)]}),!Ao&&Zn&&/* @__PURE__ */Pn($n,{children:[
52
- /* @__PURE__ */Tn(Ce,{children:kt.header}),!gt&&/* @__PURE__ */Tn(be,{words:St,icon:/* @__PURE__ */Tn(Wo,{type:"header",size:13}),name:kt.header,onSelect:Ar,selected:mo.kind===ft?.kind,rowProps:{onClick:Ti(Ar)}})]}),!Ao&&ol&&ts(ol,tl,"header"),!Ao&&!ql&&/* @__PURE__ */Tn(Ce,{children:Zl}),ql?/* @__PURE__ */Pn($n,{children:[
53
- /* @__PURE__ */Tn(be,{words:St,icon:null,name:Zl,fold:{open:!es,label:Zl,onToggle:()=>cr(Ln)}}),!es&&/* @__PURE__ */Tn(ze,{children:ns})]}):ns,Zn&&/* @__PURE__ */Tn(Ce,{children:kt.footer}),nl&&ts(nl,el,"footer"),!Ao&&!nl&&Zn&&/* @__PURE__ */Tn(be,{words:St,icon:/* @__PURE__ */Tn(Wo,{type:"footer",size:13}),name:kt.footer,onSelect:Pi,rowProps:{onClick:Ti(Pi),title:kt.editFooter}}),il&&Fl(il),$o.treeFoot?.()]})]})}),
54
- /* @__PURE__ */Tn(Ge,{side:"left",width:or.left,min:Ye,max:Je,defaultWidth:k.left,label:kt.resizeLeftPanel,onResize:lr})]}):/* @__PURE__ */Tn($,{side:"left",onShow:Ir}),
55
- /* @__PURE__ */Pn("div",{ref:hr,className:"sf-center sf-scroll","data-sf-canvas-head":Sr?"":void 0,style:{overflowX:Br?"auto":"hidden",overflowY:"hidden"},children:[Sr&&/* @__PURE__ */Tn("div",{ref:vr,className:"sf-canvas-head",children:/* @__PURE__ */Tn(Sr,{device:Dt})}),
56
- /* @__PURE__ */Tn("div",{className:"sf-frame-scaler",style:Cr,children:/* @__PURE__ */Tn("div",{className:"sf-frame "+(Dt===Ft?"":`sf-frame--${Dt}`),style:Or,children:/* @__PURE__ */Pn("div",{className:"sf-preview-host",children:[
57
- /* @__PURE__ */Tn(Ct,{},qt),
58
- /* @__PURE__ */Tn(Ze,{canvas:to,session:Sl,model:Il,measure:Tl,canDrop:$l,onDrop:Ml,choose:bl,onPick:Rl,onZoneAdd:e=>{const n=rn(e),t=Xr(n);t&&Zr(t.node,t.slot,!1),Ci(n,0)},zoneAddLabel:kt.canvasAddBlock,words:vt.canvas,readOnly:Boolean(Yn),revision:et.data}),fo.length>0&&/* @__PURE__ */Tn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:fo.map(e=>/* @__PURE__ */Pn("button",{type:"button",tabIndex:-1,className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height},onClick:()=>Bi(e.index),children:[
59
- /* @__PURE__ */Tn("span",{className:"sf-preview-gap-line"}),
60
- /* @__PURE__ */Pn("span",{className:"sf-preview-gap-pill",children:[
61
- /* @__PURE__ */Tn("span",{className:"sf-preview-gap-plus",children:"+"}),
62
- /* @__PURE__ */Tn("span",{className:"sf-preview-gap-label",children:kt.addSection})]})]},e.index))})]})})})]}),jt?/* @__PURE__ */Pn($n,{children:[
63
- /* @__PURE__ */Tn(g,{value:{selectChild:Qi,addChild:Xi,childRowName:ri,blockRowName:cl},children:/* @__PURE__ */Tn(Ot,{mode:mo,onOpenWebsiteSettings:$o.openSettings??(()=>{}),onOpenSiteStyles:$o.openStyles,onSelectNode:Ko,onNotify:fr,onHidePanel:Nr,nodeActions:ot?se(it,ot.type):En})}),
64
- /* @__PURE__ */Tn(Ge,{side:"right",width:or.right,min:Ye,max:Je,defaultWidth:k.right,label:kt.resizeSettingsPanel,onResize:sr})]}):
65
- /* @__PURE__ */Tn($,{side:"right",onShow:Nr})]}),ui.menu]})}))}export{Fn as ScreenChrome};
@@ -1,20 +0,0 @@
1
- import{FieldSelect as e}from"./chunk-OZ72A6MY.js";import{TreeSeam as n}from"./chunk-4JSBIW5H.js";import{SettingsField as t,SETTINGS_BUCKETS as l,SettingsTabs as a,SettingsGroup as r}from"./chunk-YNOZ5NXW.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-QTLAVDJE.js";import{EaselMenuItems as s}from"./chunk-EA2HTX37.js";import{FieldNumber as c}from"./chunk-66LWADFP.js";import{SettingsSegmented as d}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as u}from"./chunk-FFYXVAAL.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as h}from"./chunk-67GNT6PF.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as g,SortableList as v,ListRow as y,ContextMenu as x,tabPanelId as k,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as O,useLayoutEffect as C,useId as j}from"react";import{jsx as D,jsxs as I}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as $,MoveUpIcon as P,MoveDownIcon as L,DuplicateIcon as A,TrashIcon as F}from"efficient-shell/icons/efficient";function M({id:e,value:n,onChange:t,placeholder:l,multiline:a=!1,rows:r=3,readOnly:i=!1,ariaLabel:o,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */D(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:l,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>t(e.target.value)}):/* @__PURE__ */D(g,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:l,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>t(e.target.value)})}function T(e,n,t){const l=e.slice();return l.splice(Math.max(0,Math.min(n,l.length)),0,t),l}function E(e,n,t){const l=e.slice(),[a]=l.splice(n,1);return l.splice(Math.max(0,Math.min(t,l.length)),0,a),l}function R(e,n){return e.filter((e,t)=>t!==n)}function z(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var H='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function Y({label:e,icon:t,noun:l,items:a,onChange:r,newItem:o,summary:c,itemName:d,thumb:f,min:g=0,max:k,readOnly:w=!1,open:j,onOpen:M,renderItem:Y,renderRow:J,canRemove:K,lockedReason:V,fixed:W=!1,removeOnRow:X=!0,canDuplicate:G,above:Q,head:Z=!0}){const q=m("fields",u).list,U=m("tree",i),_=l??q.item,ee=!w&&!W&&("number"!=typeof k||a.length<k),ne=a.length<=g,te=e=>!!K&&!K(a[e],e),le=e=>!w&&!W&&X&&!ne&&!te(e),ae=e=>ee&&(!G||G(a[e],e)),re=(e,n)=>d?d(e,n):q.itemName({noun:_,n:n+1}),ie=N([]),oe=N(null),[se,ce]=O(null),de=N(null),[ue,me]=O(null),[pe,he]=O("");C(()=>{const e=oe.current;if(!e)return;oe.current=null;const n=ie.current[e.index]?.querySelectorAll(H)[e.nth]??ie.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const be=(e,n)=>{if(n<0||n>=a.length||n===e)return;const t=ie.current[e],l=t?.ownerDocument.activeElement;if(t&&l&&t.contains(l)){const e=[...t.querySelectorAll(H)].indexOf(l),a=l;oe.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}r(E(a,e,n));const i=function(e,n,t){return null===e?null:e===n?t:n<e&&t>=e?e-1:n>e&&t<=e?e+1:e}(j,e,n);i!==j&&M(i),he(q.moved({n:n+1,total:a.length}))},fe=e=>{ee&&(r(T(a,e,o())),J?(oe.current={index:e,nth:0,start:null,end:null},null!==j&&j>=e&&M(j+1)):M(e))},ge=e=>{le(e)&&(r(R(a,e)),j===e?M(null):null!==j&&j>e&&M(j-1))},ve=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const t=h({...B,index:e},n);t!==e&&be(e,t)},onStep:(e,n)=>be(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:q.moveUp,icon:/* @__PURE__ */D(P,{size:14}),shortcut:"⌥↑",onClick:()=>be(e,e-1)}),e<a.length-1&&n.push({label:q.moveDown,icon:/* @__PURE__ */D(L,{size:14}),shortcut:"⌥↓",onClick:()=>be(e,e+1)}),ae(e)&&n.push({label:q.duplicate,icon:/* @__PURE__ */D(A,{size:14}),onClick:()=>(e=>{ae(e)&&(r(T(a,e+1,z(a[e]))),null!==j&&j>e&&M(j+1))})(e)}),le(e)&&n.push({label:q.delete,icon:/* @__PURE__ */D(F,{size:14}),danger:!0,onClick:()=>ge(e)}),n},xe=(e,n,t,l)=>{w||0===ye(e).length||me({index:e,x:n,y:t,owner:l})},ke=e=>n=>{const t=a.slice();t[e]=n,r(t)};/* @__PURE__ */
2
- return I("div",{className:"es-list",children:[Z?/* @__PURE__ */I("div",{className:"es-list-head",children:[
3
- /* @__PURE__ */I("span",{className:"es-list-label",children:[t?/* @__PURE__ */D("span",{className:"es-field-icon","aria-hidden":"true",children:t}):null,e]}),
4
- /* @__PURE__ */D("span",{className:"es-list-count",children:a.length})]}):null,Q?/* @__PURE__ */D("div",{className:"es-list-above",children:Q}):null,a.length?/* @__PURE__ */I(v,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((e,t)=>{const l=ve.row({item:t,place:{...B,index:t}}),a=l.draggable&&se!==t,r=!J&&j===t,i=!w&&!W&&X&&te(t),o=["es-list-row",J?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",l.dragging?"is-dragging":"",l.drop?`is-drop-${l.drop}`:""].filter(Boolean).join(" ");return[t>0?/* @__PURE__ */D(n,{...ve.seam({place:{...B,index:t}}),onAdd:ee?()=>fe(t):void 0,label:q.addHere({noun:_})},`seam-${t}`):null,
5
- /* @__PURE__ */D(y,{className:o,flat:!!J,active:r,draggable:l.draggable,dragHint:U.dragHint,dragging:l.dragging,drop:"before"===l.drop||"after"===l.drop?l.drop:void 0,onMove:l.draggable?e=>be(t,"up"===e?t-1:t+1):void 0,rowRef:e=>{ie.current[t]=e},rowProps:{...l.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=l.draggable&&!a,de.current=n&&!a?n:null,ce(a?t:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),l.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),xe(t,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,l=e=>e.preventDefault();n.addEventListener("contextmenu",l,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",l,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void xe(t,a.left+24,a.bottom,e.currentTarget)}l.rowProps.onKeyDown?.(e)}},actions:w||W||!X?void 0:i?b(V?V(e,t):q.locked,/* @__PURE__ */D("span",{className:"es-list-lock",role:"img","aria-label":V?V(e,t):q.locked,children:/* @__PURE__ */D($,{size:13})})):b(q.deleteItem({noun:_}),/* @__PURE__ */D("button",{type:"button",className:"es-list-x","aria-label":q.deleteItem({noun:_}),disabled:!le(t),onClick:()=>ge(t),children:"×"})),below:r?/* @__PURE__ */D("div",{className:"es-list-item",children:Y(e,t,ke(t))}):void 0,children:J?/* @__PURE__ */D("div",{className:"es-list-row-main",children:J(e,t,ke(t))}):/* @__PURE__ */I("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>M(r?null:t),children:[f?/* @__PURE__ */D("span",{className:"es-list-thumb","aria-hidden":"true",children:f(e,t)}):null,
6
- /* @__PURE__ */D("span",{className:"es-list-row-name",children:re(e,t)}),/* @__PURE__ */D("span",c?{className:"es-list-row-summary",children:c(e,t)}:{className:"es-list-row-summary"}),
7
- /* @__PURE__ */D(S,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},t)]}),
8
- /* @__PURE__ */D(n,{...ve.seam({place:{...B,index:a.length}})})]}):null,w||W?null:/* @__PURE__ */D("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>fe(a.length),children:q.add({noun:_})}),
9
- /* @__PURE__ */D("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<a.length?
10
- /* @__PURE__ */D(x,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */D(s,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var J=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function K({field:e,name:n,id:t,value:l,onChange:a,readOnly:i,context:o,renderers:s}){const[c,d]=O(!0),u=l&&"object"==typeof l?l:{};/* @__PURE__ */
11
- return D(r,{id:`${t}-group`,title:J(e,n),open:c,onToggle:d,children:Object.entries(e.objectFields).map(([e,l])=>/* @__PURE__ */D(W,{field:l,name:`${n}.${e}`,id:`${t}-${e}`,value:u[e],onChange:n=>a({...u,[e]:n}),readOnly:i,context:o,renderers:s},e))})}function V({field:e,name:n,id:t,value:l,onChange:a,readOnly:r,context:i,renderers:o,openItem:s,onOpenItem:c}){const[d,u]=O(null),m=c?s??null:d,p=c??u,h=Array.isArray(l)?l:[],b=e.getItemSummary;/* @__PURE__ */
12
- return D(Y,{label:J(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>z({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:m,onOpen:p,renderItem:(l,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */D(W,{field:c,name:`${n}[${a}].${e}`,id:`${t}-${a}-${e}`,value:l?.[e],onChange:n=>s({...l,[e]:n}),readOnly:r,context:i,renderers:o},e))})}function W(n){const{field:l,name:a,id:r,value:i,onChange:o,readOnly:s,context:u,renderers:m}=n;if(!l||l.marker||!1===l.visible)return null;const p=m?.[l.type];if(p)return p({field:l,name:a,id:r,value:i,onChange:o,readOnly:s});switch(l.type){case"custom":{const e={...u,field:l,name:a,id:r,value:i,onChange:o,readOnly:s};return l.render(e)}case"text":case"textarea":/* @__PURE__ */
13
- return D(t,{label:J(l,a),htmlFor:r,icon:l.icon,hint:l.hint,children:/* @__PURE__ */D(M,{id:r,value:"string"==typeof i?i:null==i?"":String(i),onChange:o,placeholder:l.placeholder,multiline:"textarea"===l.type,readOnly:s})});case"number":/* @__PURE__ */
14
- return D(t,{label:J(l,a),htmlFor:r,icon:l.icon,hint:l.hint,children:/* @__PURE__ */D(c,{id:r,value:"number"==typeof i?i:void 0,onChange:o,min:l.min,max:l.max,step:l.step,placeholder:l.placeholder,readOnly:s})});case"select":{const n=`${r}-label`;/* @__PURE__ */
15
- return D(t,{label:J(l,a),labelId:n,htmlFor:r,icon:l.icon,hint:l.hint,children:/* @__PURE__ */D(e,{id:r,value:i,options:l.options,onChange:o,readOnly:s,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
16
- return D(t,{label:J(l,a),icon:l.icon,hint:l.hint,children:/* @__PURE__ */D(d,{ariaLabel:J(l,a),value:i,options:l.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||s})),onChange:e=>{s||o(e)}})});case"object":/* @__PURE__ */
17
- return D(K,{...n,field:l});case"array":/* @__PURE__ */
18
- return D(V,{...n,field:l});case"slot":return null}}var X=e=>l.includes(e);function G(e){let n=l[0];const t=[],a=/* @__PURE__ */new Set;for(const[l,r]of Object.entries(e))r&&(X(r.bucket)&&(n=r.bucket),r.marker||!1===r.visible||(t.push({name:l,field:r,bucket:n}),"slot"!==r.type&&a.add(n)));return{rows:t,buckets:l.filter(e=>a.has(e))}}function Q(e){return new Map(G(e).rows.map(e=>[e.name,e.bucket]))}function Z({fields:e,values:n,onChange:t,readOnly:l=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:u,idPrefix:p,ariaLabel:h,children:b}){const f=m("panel",o),g=j(),v=p??`es-insp${g.replace(/:/g,"")}`,y=G(e),[x,N]=O(void 0),C=i??x,S=C&&y.buckets.includes(C)?C:y.buckets[0],[$,P]=O(null),L=$&&$.panel===v&&y.rows.some(e=>e.name===$.name)?$:null,A=c&&y.buckets.length>1,F=A&&S?k(v,S):`${v}-rows`;/* @__PURE__ */
19
- return I("div",{className:"es-insp",children:[A?/* @__PURE__ */D("div",{className:"es-insp-tabs",children:/* @__PURE__ */D(a,{ariaLabel:h??f.settings,activeId:S,onSelect:e=>{const n=e;void 0===i&&N(n),s?.(n)},items:y.buckets.map(e=>({id:e,label:f.buckets[e],icon:d?.[e]})),idPrefix:v})}):null,
20
- /* @__PURE__ */I("div",{className:"es-insp-rows",id:F,role:A?"tabpanel":void 0,"aria-labelledby":A&&S?w(v,S):void 0,children:[y.rows.map(({name:e,field:a,bucket:i})=>/* @__PURE__ */D("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!A||i===S)||void 0,children:/* @__PURE__ */D(W,{field:a,name:e,id:`${v}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:l,context:r,renderers:u,openItem:L&&L.name===e?L.index:null,onOpenItem:n=>P(null===n?null:{panel:v,name:e,index:n})})},e)),b]})]})}export{M as FieldText,Z as Inspector,W as InspectorField,Y as ListField,Q as bucketsOf,z as copyItem,T as insertAt,J as labelOf,E as moveTo,G as planFields,R as removeAt};
@@ -1,5 +0,0 @@
1
- import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-5SOSVTVI.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-KFMJ4IM4.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-MCHMF32I.js";import{useEasel as f}from"./chunk-FUOZKV7A.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-7GVPKRW2.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-O2NLQBFX.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as O,jsxs as $,Fragment as V}from"react/jsx-runtime";var B=e=>`section:${e}`,I=e=>`block:${e}`,v=e=>`template:${e}`;function F({blocks:F,blocksOnly:x,at:A,onAdd:H,itemFor:L,session:M,siteWide:N,onClose:C,onHide:K,readOnly:R}){const S=f(e=>e.config),T=p(),{labelAtLevel:w,categoryLabel:D,firstSection:P,Icon:Q,Thumbnail:W}=T,{blockIsOffered:z}=m(),G=u("screen",d).add,J=u("drag",h).add,Y=l(),[Z,E]=y([]);b(()=>{let t=!1;const o=e=>z(e,Y);return s(Y).list().then(n=>{if(t)return;const i=S.components;E(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[S,Y]);const U=j(()=>t(S,T),[S]),X=e=>({type:B(e.type),label:e.name,cover:/* @__PURE__ */O(W,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:G.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),q=j(()=>{const e=[];if(F&&F.choices.length>0&&a(F.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${G.inside({name:F.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:I(e.type),label:e.label,icon:/* @__PURE__ */O(Q,{type:e.type,size:18}),title:G.tile({name:e.label})}))})}),x)return e;const t=o(U,P);t&&e.push({key:"start",title:G.startBlank,tiles:[X(t)]}),Z.length>0&&e.push({key:"templates",title:G.templates,tiles:Z.map(e=>{return{type:v(e.id),label:e.name,cover:/* @__PURE__ */O(W,{type:e.node.type}),keywords:[(t=e.node.type,w(t,"section",S.components[t]?.label??t)),e.node.type]};var t})});const s=n(U,P);for(const t of Object.keys(S.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(S,t,D),tiles:o.map(X)})}return e},[F,x,Z,U,S,G]),_=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=Z.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
- return $(V,{children:[
3
- /* @__PURE__ */O(r,{icon:/* @__PURE__ */O(g,{size:15}),title:G.title,context:x?G.contextBlocks:G.contextAll,actions:/* @__PURE__ */O(c,{label:G.done,description:G.doneDescription,onClick:C}),onHide:K}),
4
- /* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
5
- /* @__PURE__ */O(k,{groups:q,session:M,itemFor:e=>L(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&H(t)},at:A,hint:x?G.hintBlocks:G.hint,searchLabel:x?G.searchBlocks:G.searchSections,readOnly:R,words:J}),N&&!x?N:null]})]})}export{F as AddSidePanel,I as blockKey,B as sectionKey,v as templateKey};
@@ -1 +0,0 @@
1
- var t={settings:"Settings",buckets:{Content:"Content",Style:"Style",Layout:"Layout",Animation:"Animation"},followsDefault:"Default",reset:"Reset",resetName:({label:t})=>`Reset ${t}`,backToDefault:({detail:t})=>`Back to default: ${t}`,resetTitle:({label:t,detail:e})=>`Reset ${t} (back to ${e})`};export{t as DEFAULT_PANEL_WORDS};
@@ -1 +0,0 @@
1
- var t={Content:"_sContent",Style:"_sStyle",Layout:"_sLayout",Animation:"_sAnimation"};export{t as BUCKET_KEY};
@@ -1 +0,0 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-MCHMF32I.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-AELNNAFM.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-QTLAVDJE.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Y2G7CU6A.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-JZDEIRH4.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var A={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},F=o=>"object"==typeof o&&null!==o;function a(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:F(n)?t[m]=F(c)?a(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?a(o,r):o}export{A as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
@@ -1,14 +0,0 @@
1
- import{DEFAULT_PANEL_WORDS as e}from"./chunk-QTLAVDJE.js";import{SettingsSwitch as a}from"./chunk-QLD57GBB.js";import{Tabs as l,CountBadge as n}from"efficient-shell/ui";import{jsx as i,jsxs as s,Fragment as r}from"react/jsx-runtime";import{isValidElement as t,cloneElement as c}from"react";function d(e){const a=e[0];if(!a?.htmlId||!a.htmlId.endsWith(`-tab-${a.id}`))return;const l=a.htmlId.slice(0,-`-tab-${a.id}`.length);return e.every(e=>e.htmlId===`${l}-tab-${e.id}`)?l:void 0}function o({items:a,activeId:t,onSelect:c,ariaLabel:o=e.settings,idPrefix:u,className:h}){
2
- /* @__PURE__ */
3
- return i("div",{className:"es-tabs-fit",children:/* @__PURE__ */i(l,{variant:"pill","aria-label":o,idPrefix:u??d(a),className:h?`es-tabs ${h}`:"es-tabs",value:t,onChange:c,items:a.map(e=>{const a="number"==typeof e.badge&&e.badge>0?/* @__PURE__ */i(n,{count:e.badge,tone:"accent"}):null;return e.icon?{id:e.id,tooltip:e.label,label:/* @__PURE__ */s(r,{children:[
4
- /* @__PURE__ */s("span",{className:"es-tab-tip",children:[
5
- /* @__PURE__ */i("span",{className:"es-tab-icon","aria-hidden":"true",children:e.icon}),
6
- /* @__PURE__ */i("span",{className:"es-tab-word has-icon",children:e.label})]}),a]})}:{id:e.id,label:/* @__PURE__ */s(r,{children:[
7
- /* @__PURE__ */i("span",{className:"es-tab-word",children:e.label}),a]})}})})})}function u(e){return Array.isArray(e)?e.some(u):t(e)}function h(e,l,n){if(!t(e)||e.type!==a)return e;const i=e.props;return i.ariaLabel||i.ariaLabelledBy?e:c(e,n?{ariaLabelledBy:n}:{ariaLabel:l})}function m({label:e,labelId:a,icon:l,value:n,hint:t,changed:c,htmlFor:d,action:o,children:m,className:p}){const b=u(m),f=u(o);if(!b&&!f)return null;const N=["es-field"];b||N.push("is-inline"),c&&N.push("is-changed"),p&&N.push(p);const g=/* @__PURE__ */s(r,{children:[l?/* @__PURE__ */i("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,
8
- /* @__PURE__ */i("span",{className:"es-field-label",id:a,children:e})]});/* @__PURE__ */
9
- return s("div",{className:N.join(" "),children:[
10
- /* @__PURE__ */s("div",{className:"es-field-head",children:[d?/* @__PURE__ */i("label",{className:"es-field-name",htmlFor:d,children:g}):/* @__PURE__ */i("span",{className:"es-field-name",children:g}),null!=n?/* @__PURE__ */i("span",{className:"es-field-value",children:n}):null,f?h(o,e,a):null]}),b?/* @__PURE__ */i("div",{className:"es-field-ctl",children:m}):null,t?/* @__PURE__ */i("p",{className:"es-field-hint",children:t}):null]})}function p({title:e,open:a,onToggle:l,count:n,id:r,children:t,className:c}){const d=r?`${r}-body`:void 0;/* @__PURE__ */
11
- return s("div",{className:c?`es-group ${c}`:"es-group",children:[
12
- /* @__PURE__ */s("button",{type:"button",id:r,"aria-expanded":a,"aria-controls":d,className:"es-group-head",onClick:()=>l(!a),children:[e,"number"==typeof n&&n>0?/* @__PURE__ */i("span",{className:"es-group-count",children:n}):null,
13
- /* @__PURE__ */i("span",{className:"es-group-sign","aria-hidden":"true"})]}),
14
- /* @__PURE__ */i("div",{id:d,className:"es-group-body",hidden:!a,children:t})]})}var b=Object.freeze(["Content","Style","Layout","Animation"]);export{b as SETTINGS_BUCKETS,m as SettingsField,p as SettingsGroup,o as SettingsTabs};