efficient-easel 11.1.0 → 11.1.2

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 (36) hide show
  1. package/dist/{chunk-XAF6J6TB.js → chunk-26GHWMNN.js} +12 -12
  2. package/dist/chunk-5545A3PC.js +4 -0
  3. package/dist/{chunk-3KAQXJVI.js → chunk-6WVCXQJX.js} +1 -1
  4. package/dist/chunk-AFWOZM7K.js +5 -0
  5. package/dist/chunk-AUSN7RET.js +57 -0
  6. package/dist/{chunk-O66SKO3J.js → chunk-EKICPNE4.js} +1 -1
  7. package/dist/{chunk-7GYJG6CL.js → chunk-FAAZZXIS.js} +1 -1
  8. package/dist/{chunk-YXIR3EI3.js → chunk-LWG4DVDR.js} +3 -3
  9. package/dist/{chunk-UB5JFMRN.js → chunk-MJESMPQT.js} +1 -1
  10. package/dist/{chunk-IOZKOGFR.js → chunk-PPHUWGLZ.js} +1 -1
  11. package/dist/{chunk-YJQYO6TA.js → chunk-PQ6ATM4M.js} +1 -1
  12. package/dist/chunk-XQGBZGVP.js +5 -0
  13. package/dist/{chunk-PQMCHTVE.js → chunk-Z23YOUF5.js} +1 -1
  14. package/dist/copy/index.js +1 -1
  15. package/dist/fields/index.js +1 -1
  16. package/dist/screen/components/AddBlockRow.js +1 -1
  17. package/dist/screen/components/AddChildRow.js +1 -4
  18. package/dist/screen/components/AddSidePanel.js +1 -1
  19. package/dist/screen/components/MediaSidePanel.js +1 -1
  20. package/dist/screen/components/NodeContextMenu.js +1 -1
  21. package/dist/screen/components/ScreenChrome.js +1 -1
  22. package/dist/screen/components/ScreenMount.js +1 -1
  23. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  24. package/dist/screen/components/SectionScreenShell.js +16 -16
  25. package/dist/screen/components/usePartBridge.js +1 -1
  26. package/dist/screen/index.js +1 -1
  27. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  28. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  29. package/dist/screen/lib/screen-parts.js +1 -1
  30. package/dist/strings/catalogue.js +1 -1
  31. package/dist/strings/index.js +1 -1
  32. package/dist/text-styles/index.js +19 -19
  33. package/package.json +1 -1
  34. package/dist/chunk-2PTAR4TA.js +0 -56
  35. package/dist/chunk-HUI44HA5.js +0 -5
  36. package/dist/chunk-OHRS7Q3E.js +0 -5
@@ -1,21 +1,21 @@
1
- import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as n}from"./chunk-K56YDHYQ.js";import{SETTINGS_BUCKETS as l,SettingsGroup as t}from"./chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as a}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as r}from"./chunk-EA2HTX37.js";import{FieldNumber as o}from"./chunk-66LWADFP.js";import{FieldSelect as i}from"./chunk-65Z5FSAW.js";import{DEFAULT_FIELDS_WORDS as s}from"./chunk-FFYXVAAL.js";import{SettingsField as c,SettingsSegmented as d}from"./chunk-XJCMEEBH.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as S}from"react/jsx-runtime";import{ChevronIcon as D,LockIcon as I,MoveUpIcon as F,MoveDownIcon as L,DuplicateIcon as P,TrashIcon as A}from"efficient-shell/icons/efficient";function E({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function M(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function T(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function H(e,n){return e.filter((e,l)=>l!==n)}function R(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var z='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function J({label:l,icon:t,noun:a,items:o,onChange:i,newItem:c,summary:d,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:E,renderItem:J,renderRow:K,canRemove:Y,lockedReason:V,fixed:W=!1,removeOnRow:X=!0,canDuplicate:G,above:Z,head:q=!0}){const Q=u("fields",s).list,U=u("tree",n),_=a??Q.item,ee=!w&&!W&&("number"!=typeof x||o.length<x),ne=o.length<=k,le=e=>!!Y&&!Y(o[e],e),te=e=>!w&&!W&&X&&!ne&&!le(e),ae=e=>ee&&(!G||G(o[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(z)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=o.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(z)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}i(T(o,e,n));const a=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);a!==$&&E(a),he(Q.moved({n:n+1,total:o.length}))},be=e=>{ee&&(i(M(o,e,c())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&E($+1)):E(e))},ge=e=>{te(e)&&(i(H(o,e)),$===e?E(null):null!==$&&$>e&&E($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<o.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(F,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<o.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(P,{size:14}),onClick:()=>(e=>{ae(e)&&(i(M(o,e+1,R(o[e]))),null!==$&&$>e&&E($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=o.slice();l[e]=n,i(l)};/* @__PURE__ */
1
+ import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{SETTINGS_BUCKETS as n,SettingsGroup as l}from"./chunk-RC25EGHD.js";import{DEFAULT_TREE_WORDS as t}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as a}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as r}from"./chunk-EA2HTX37.js";import{FieldNumber as o}from"./chunk-66LWADFP.js";import{FieldSelect as i}from"./chunk-65Z5FSAW.js";import{SettingsField as s,SettingsSegmented as c}from"./chunk-XJCMEEBH.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FFYXVAAL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as S}from"react/jsx-runtime";import{ChevronIcon as D,LockIcon as I,MoveUpIcon as F,MoveDownIcon as L,DuplicateIcon as P,TrashIcon as A}from"efficient-shell/icons/efficient";function E({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function M(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function T(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function H(e,n){return e.filter((e,l)=>l!==n)}function R(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var z='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function J({label:n,icon:l,noun:a,items:o,onChange:i,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:E,renderItem:J,renderRow:K,canRemove:Y,lockedReason:V,fixed:W=!1,removeOnRow:X=!0,canDuplicate:G,above:Z,head:q=!0}){const Q=u("fields",d).list,U=u("tree",t),_=a??Q.item,ee=!w&&!W&&("number"!=typeof x||o.length<x),ne=o.length<=k,le=e=>!!Y&&!Y(o[e],e),te=e=>!w&&!W&&X&&!ne&&!le(e),ae=e=>ee&&(!G||G(o[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(z)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=o.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(z)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}i(T(o,e,n));const a=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);a!==$&&E(a),he(Q.moved({n:n+1,total:o.length}))},be=e=>{ee&&(i(M(o,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&E($+1)):E(e))},ge=e=>{te(e)&&(i(H(o,e)),$===e?E(null):null!==$&&$>e&&E($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<o.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(F,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<o.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(P,{size:14}),onClick:()=>(e=>{ae(e)&&(i(M(o,e+1,R(o[e]))),null!==$&&$>e&&E($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=o.slice();l[e]=n,i(l)};/* @__PURE__ */
2
2
  return S("div",{className:"es-list",children:[q?/* @__PURE__ */S("div",{className:"es-list-head",children:[
3
- /* @__PURE__ */S("span",{className:"es-list-label",children:[t?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:t}):null,l]}),
4
- /* @__PURE__ */j("span",{className:"es-list-count",children:o.length})]}):null,Z?/* @__PURE__ */j("div",{className:"es-list-above",children:Z}):null,o.length?/* @__PURE__ */S(g,{"aria-label":l,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[o.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!W&&X&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
3
+ /* @__PURE__ */S("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,n]}),
4
+ /* @__PURE__ */j("span",{className:"es-list-count",children:o.length})]}):null,Z?/* @__PURE__ */j("div",{className:"es-list-above",children:Z}):null,o.length?/* @__PURE__ */S(g,{"aria-label":n,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[o.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!W&&X&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
5
5
  /* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.current[l]=e},rowProps:{...t.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=t.draggable&&!a,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||W||!X?void 0:o?h(V?V(n,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":V?V(n,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:J(n,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(n,l,xe(l))}):/* @__PURE__ */S("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>E(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(n,l)}):null,
6
- /* @__PURE__ */j("span",{className:"es-list-row-name",children:re(n,l)}),/* @__PURE__ */j("span",d?{className:"es-list-row-summary",children:d(n,l)}:{className:"es-list-row-summary"}),
6
+ /* @__PURE__ */j("span",{className:"es-list-row-name",children:re(n,l)}),/* @__PURE__ */j("span",c?{className:"es-list-row-summary",children:c(n,l)}:{className:"es-list-row-summary"}),
7
7
  /* @__PURE__ */j(D,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
8
8
  /* @__PURE__ */j(e,{...ve.seam({place:{...B,index:o.length}})})]}):null,w||W?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(o.length),children:Q.add({noun:_})}),
9
9
  /* @__PURE__ */j("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<o.length?
10
- /* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(r,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,Y=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function V({field:e,name:n,id:l,value:a,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=a&&"object"==typeof a?a:{};/* @__PURE__ */
11
- return j(t,{id:`${l}-group`,title:Y(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */j(X,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:m[e],onChange:n=>r({...m,[e]:n}),readOnly:o,context:i,renderers:s,headingLevel:K(c)},e))})}function W({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:o,renderers:i,openItem:s,onOpenItem:c,headingLevel:d}){const[u,m]=C(null),p=c?s??null:u,h=c??m,f=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
- return j(J,{label:Y(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>R({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(X,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function X(e){const{field:n,name:l,id:t,value:a,onChange:r,readOnly:s,context:u,renderers:m}=e;if(!n||n.marker||!1===n.visible)return null;const p=m?.[n.type];if(p)return p({field:n,name:l,id:t,value:a,onChange:r,readOnly:s});switch(n.type){case"custom":{const e={...u,field:n,name:l,id:t,value:a,onChange:r,readOnly:s};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
13
- return j(c,{label:Y(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(E,{id:t,value:"string"==typeof a?a:null==a?"":String(a),onChange:r,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:s})});case"number":/* @__PURE__ */
14
- return j(c,{label:Y(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(o,{id:t,value:"number"==typeof a?a:void 0,onChange:r,min:n.min,max:n.max,step:n.step,placeholder:n.placeholder,readOnly:s})});case"select":{const e=`${t}-label`;/* @__PURE__ */
15
- return j(c,{label:Y(n,l),labelId:e,htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(i,{id:t,value:a,options:n.options,onChange:r,readOnly:s,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
16
- return j(c,{label:Y(n,l),icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(d,{ariaLabel:Y(n,l),value:a,options:n.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||s})),onChange:e=>{s||r(e)}})});case"object":/* @__PURE__ */
10
+ /* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(r,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,Y=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function V({field:e,name:n,id:t,value:a,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=a&&"object"==typeof a?a:{};/* @__PURE__ */
11
+ return j(l,{id:`${t}-group`,title:Y(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,l])=>/* @__PURE__ */j(X,{field:l,name:`${n}.${e}`,id:`${t}-${e}`,value:m[e],onChange:n=>r({...m,[e]:n}),readOnly:o,context:i,renderers:s,headingLevel:K(c)},e))})}function W({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:o,renderers:i,openItem:s,onOpenItem:c,headingLevel:d}){const[u,m]=C(null),p=c?s??null:u,h=c??m,f=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
+ return j(J,{label:Y(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>R({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(X,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function X(e){const{field:n,name:l,id:t,value:a,onChange:r,readOnly:d,context:u,renderers:m}=e;if(!n||n.marker||!1===n.visible)return null;const p=m?.[n.type];if(p)return p({field:n,name:l,id:t,value:a,onChange:r,readOnly:d});switch(n.type){case"custom":{const e={...u,field:n,name:l,id:t,value:a,onChange:r,readOnly:d};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
13
+ return j(s,{label:Y(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(E,{id:t,value:"string"==typeof a?a:null==a?"":String(a),onChange:r,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:d})});case"number":/* @__PURE__ */
14
+ return j(s,{label:Y(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(o,{id:t,value:"number"==typeof a?a:void 0,onChange:r,min:n.min,max:n.max,step:n.step,placeholder:n.placeholder,readOnly:d})});case"select":{const e=`${t}-label`;/* @__PURE__ */
15
+ return j(s,{label:Y(n,l),labelId:e,htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(i,{id:t,value:a,options:n.options,onChange:r,readOnly:d,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
16
+ return j(s,{label:Y(n,l),icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(c,{ariaLabel:Y(n,l),value:a,options:n.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||d})),onChange:e=>{d||r(e)}})});case"object":/* @__PURE__ */
17
17
  return j(V,{...e,field:n});case"array":/* @__PURE__ */
18
- return j(W,{...e,field:n});case"slot":return null}}var G=e=>l.includes(e);function Z(e){let n,t=l[0];const a=[],r=/* @__PURE__ */new Set;for(const[l,o]of Object.entries(e))o&&(G(o.bucket)&&((o.marker||o.bucket!==t)&&(n=void 0),t=o.bucket),o.marker&&"string"==typeof o.fold?n={key:l,title:o.fold}:o.marker&&!1===o.fold&&(n=void 0),o.marker||!1===o.visible||(a.push(n?{name:l,field:o,bucket:t,fold:n}:{name:l,field:o,bucket:t}),"slot"!==o.type&&r.add(t)));return{rows:a,buckets:l.filter(e=>r.has(e))}}function q(e){return new Map(Z(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:l,readOnly:r=!1,context:o,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",a),D=$(),I=p??`es-insp${D.replace(/:/g,"")}`,F=Z(e),[L,P]=C(void 0),A=i??L,E=A&&F.buckets.includes(A)?A:F.buckets[0],[M,T]=C(null),H=M&&M.panel===I&&F.rows.some(e=>e.name===M.name)?M:null,R=c&&F.buckets.length>1,z=R&&E?k(I,E):`${I}-rows`,[B,J]=C(()=>/* @__PURE__ */new Set),Y=v??B,V=(e,n)=>{/* @__PURE__ */return j(t,{title:e.title,open:!Y.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&J(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${l=e.key,[...l].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var l},W=e=>R&&e!==E,G=({name:e,field:t,bucket:a,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":a,hidden:!!W(a)||void 0,children:/* @__PURE__ */j(X,{field:t,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:r,context:o,renderers:m,openItem:H&&H.name===e?H.index:null,onOpenItem:n=>T(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
18
+ return j(W,{...e,field:n});case"slot":return null}}var G=e=>n.includes(e);function Z(e){let l,t=n[0];const a=[],r=/* @__PURE__ */new Set;for(const[n,o]of Object.entries(e))o&&(G(o.bucket)&&((o.marker||o.bucket!==t)&&(l=void 0),t=o.bucket),o.marker&&"string"==typeof o.fold?l={key:n,title:o.fold}:o.marker&&!1===o.fold&&(l=void 0),o.marker||!1===o.visible||(a.push(l?{name:n,field:o,bucket:t,fold:l}:{name:n,field:o,bucket:t}),"slot"!==o.type&&r.add(t)));return{rows:a,buckets:n.filter(e=>r.has(e))}}function q(e){return new Map(Z(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:t,readOnly:r=!1,context:o,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",a),D=$(),I=p??`es-insp${D.replace(/:/g,"")}`,F=Z(e),[L,P]=C(void 0),A=i??L,E=A&&F.buckets.includes(A)?A:F.buckets[0],[M,T]=C(null),H=M&&M.panel===I&&F.rows.some(e=>e.name===M.name)?M:null,R=c&&F.buckets.length>1,z=R&&E?k(I,E):`${I}-rows`,[B,J]=C(()=>/* @__PURE__ */new Set),Y=v??B,V=(e,n)=>{/* @__PURE__ */return j(l,{title:e.title,open:!Y.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&J(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${t=e.key,[...t].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var t},W=e=>R&&e!==E,G=({name:e,field:l,bucket:a,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":a,hidden:!!W(a)||void 0,children:/* @__PURE__ */j(X,{field:l,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:r,context:o,renderers:m,openItem:H&&H.name===e?H.index:null,onOpenItem:n=>T(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
19
19
  return S("div",{className:"es-insp",children:[R?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":h??O.settings,idPrefix:I,value:E,onChange:e=>{const n=e;void 0===i&&P(n),s?.(n)},items:F.buckets.map(e=>{const n=O.buckets[e],l=d?.[e];return l?{id:e,icon:l,label:/* @__PURE__ */j("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
20
20
  /* @__PURE__ */S("div",{className:"es-insp-rows",id:z,role:R?"tabpanel":void 0,"aria-labelledby":R&&E?w(I,E):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:V(g,f)}):f:null,Q(F.rows).map((e,n)=>{if(!e.fold)return e.rows.map(G);const l=e.rows[0].bucket,t=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
21
21
  return j("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":l,hidden:!(!W(l)&&!t)||void 0,children:V(e.fold,e.rows.map(G))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{E as FieldText,U as Inspector,X as InspectorField,J as ListField,q as bucketsOf,R as copyItem,M as insertAt,Y as labelOf,T as moveTo,Z as planFields,H as removeAt};
@@ -0,0 +1,4 @@
1
+ import{Tooltip as e}from"efficient-shell/ui";import{useId as s}from"react";import{jsxs as i,Fragment as l,jsx as r}from"react/jsx-runtime";function n({label:n,blocked:a,onAdd:d,small:c=!1}){const o=null!==a,t=s(),m=/* @__PURE__ */i("button",{type:"button",className:"sf-add-card","aria-disabled":o||void 0,"aria-describedby":o?t:void 0,onClick:o?void 0:d,children:[
2
+ /* @__PURE__ */r("span",{className:c?"sf-plus sf-plus--sm":"sf-plus",children:"+"}),n]});return o?/* @__PURE__ */i(l,{children:[
3
+ /* @__PURE__ */r(e,{content:a,children:m}),
4
+ /* @__PURE__ */r("span",{id:t,className:"es-vh",children:a})]}):m}export{n as AddChildRow};
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-OHRS7Q3E.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-IE55HNMA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
1
+ import{useScreenOwnerName as e}from"./chunk-AFWOZM7K.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-IE55HNMA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
2
2
  return o(r,{children:[
3
3
  /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
4
4
  /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
@@ -0,0 +1,5 @@
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-I55LUW3C.js";import{Inspector as i}from"./chunk-26GHWMNN.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=()=>k,v=()=>"",g=()=>null,y=()=>{},b={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},L={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},O={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},j={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},w={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function C(){/* @__PURE__ */
2
+ return s(t,{height:"fill"})}function N(){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 S=o({});function G({parts:n,children:e}){/* @__PURE__ */
4
+ return s(S.Provider,{value:n,children:e})}function P(){return u(S)}function D(){return(P().useOwnerName??v)()}function I(){return(P().useDocumentLabel??g)()}function x(n,e,t,r){return(P().useBridges??h)(n,e,t,r)}function B(n){return(P().useStandaloneBridges??h)(n)}function T(n,e){(P().useDocumentPass??y)(n,e)}function W(){return P().blockRules??b}function A(){return P().blockLook??L}function F(){return P().devices??O}function R(){return P().leftView??j}function H(){return P().pinned??w}function K(){return P().saveSwitch??!0}function V(n){e(!0===P().pickFollowsSelection,n)}function E(){return P().storageNamespace||void 0}function M(){return P().styleClipboard??null}function Q(){return P().nodeKeys??!0}function U(){return P().notify??null}function Y(){return P().Canvas??C}function Z(){return P().CanvasHead??null}function q(){return P().canvasDrag??null}var z=o(null);function J({target:n,children:e}){/* @__PURE__ */
5
+ return s(z.Provider,{value:n,children:e})}function X(){return u(z)}function $(){return P().Inspector??N}export{c as SELECTION_MODE,J as ScreenCanvasTargetProvider,G as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,A as useScreenBlockLook,W as useScreenBlockRules,x as useScreenBridges,q as useScreenCanvasDrag,Y as useScreenCanvasFrame,Z as useScreenCanvasHead,X as useScreenCanvasTarget,F as useScreenDevices,I as useScreenDocumentLabel,T as useScreenDocumentPass,$ as useScreenInspectorPanel,R as useScreenLeftView,Q as useScreenNodeKeys,U as useScreenNotify,D as useScreenOwnerName,P as useScreenParts,V as useScreenPickFollowsSelection,H as useScreenPinned,K as useScreenSaveSwitch,E as useScreenStorageNamespace,M as useScreenStyleClipboard,B as useStandaloneScreenBridges};
@@ -0,0 +1,57 @@
1
+ import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-IFS5P7CO.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-BHRC3ASL.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,useEaselSaveKey as m,editorRootFocus as g}from"./chunk-4MPCFKFG.js";import{SlotChildActionsProvider as y}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as S,DEFAULT_PANEL_W as k,clampPanelWidth as v}from"./chunk-TZIIRGVY.js";import{usePartBridge as b}from"./chunk-PQ6ATM4M.js";import{useSectionOps as w}from"./chunk-Z23YOUF5.js";import{useNodeClipboard as x,useNodeContextMenu as z}from"./chunk-PPHUWGLZ.js";import{PageEditGuardNotices as C}from"./chunk-AFSSKGTD.js";import{ScreenSaveIcon as B,ScreenMainButton as I}from"./chunk-W4U4SHKW.js";import{useBrowserOffline as P}from"./chunk-RKTF5XLP.js";import{useScreenDocument as O}from"./chunk-GCCBEY2W.js";import{requestMediaPick as N}from"./chunk-KG7RJWOK.js";import{heldStyle as $,styleShortcut as M}from"./chunk-V7U33NF2.js";import{AddChildRow as j}from"./chunk-5545A3PC.js";import{AddSidePanel as T}from"./chunk-XQGBZGVP.js";import{SidePanelHead as A,PanelShowStrip as L}from"./chunk-PPL7GB7D.js";import{useEaselSession as R}from"./chunk-O7Q4DDJT.js";import{MediaSidePanel as E}from"./chunk-6WVCXQJX.js";import{useScreenSaveSwitch as V,useScreenNodeKeys as F,useScreenPinned as W,useScreenDocumentLabel as G,useScreenCanvasFrame as H,useScreenInspectorPanel as D,useScreenDevices as U,useScreenPickFollowsSelection as J,useScreenLeftView as X,SELECTION_MODE as Y,sameInspectorMode as K,useScreenBridges as Z,useScreenBlockRules as q,useScreenBlockLook as _,useScreenStorageNamespace as Q,useScreenNotify as ee,useScreenCanvasHead as ne,isSlotMode as te,useScreenStyleClipboard as oe,useScreenDocumentPass as re,useScreenCanvasDrag as ie,ScreenCanvasTargetProvider as le,isPinnedFirst as se,isPinnedLast as de,screenSlotsOf as ce}from"./chunk-AFWOZM7K.js";import{ROOT_ZONE as ae,blockNodeActions as pe,TREE_MAX_DEPTH as ue,childSlotsOf as fe,slotFieldsOf as he,slotChildrenIn as me,nestsInTree as ge,newNodeId as ye}from"./chunk-PLVEGYK6.js";import{useMediaPanel as Se,usePanelPick as ke,useCancelPanelPick as ve}from"./chunk-R6WTQWAC.js";import{useEaselHost as be,useHostEscape as we}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as xe}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as ze}from"./chunk-VWXUMVCD.js";import{useEasel as Ce,useEaselApi as Be,CanvasPassThroughContext as Ie}from"./chunk-I55LUW3C.js";import{TreeRow as Pe,Subtree as Oe,LayersTree as Ne,TreeGroupLabel as $e,TreeRowAction as Me,TreeSeam as je}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as Te}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Ae}from"./chunk-WK3AFPXY.js";import{toItemSelector as Le,useNodeOps as Re,clickPick as Ee}from"./chunk-ECM5F6JJ.js";import{LayersIcon as Ve,MediaIcon as Fe}from"./chunk-4VJATVVR.js";import{EaselTopBar as We,TopBarRail as Ge,TopBarCluster as He,EaselIconButton as De,TopBarDivider as Ue,DeviceSwitch as Je,InspectorIconButton as Xe,PanelResizeHandle as Ye,MAX_PANEL_W as Ke,MIN_PANEL_W as Ze,panelWidthVars as qe}from"./chunk-IE55HNMA.js";import{DEFAULT_NOTICE_WORDS as _e,DEFAULT_CHROME_WORDS as Qe}from"./chunk-Z6PVRXVY.js";import{holderOf as en,nameOrSomeone as nn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as tn}from"./chunk-RE4LP46F.js";import{useWords as on}from"./chunk-MFIRYGHW.js";import{insertSeams as rn,CanvasDragLayer as ln,CanvasInsert as sn}from"./chunk-47RGVCPH.js";import{DEFAULT_DRAG_WORDS as dn}from"./chunk-GG4FGBFR.js";import{createDragSession as cn,useTreeDrag as an,gapToMoveIndex as pn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as un,LIST_SELECTOR as fn,BLOCK_SELECTOR as hn,useCanvasEvent as mn,nodeIdAt as gn,frameRectToHost as yn,BLOCK_ATTRIBUTE as Sn,drawnBox as kn}from"./chunk-ILXP5VX5.js";import{ROOT_ID as vn,ROOT_SLOT as bn,zoneKey as wn,parseZoneKey as xn,find as zn,DataError as Cn}from"./chunk-KRXQM65X.js";import{useRef as Bn,useMemo as In,useState as Pn,useEffect as On,useCallback as Nn,useLayoutEffect as $n,Fragment as Mn}from"react";import{ColoredBadge as jn,toast as Tn,groupColors as An}from"efficient-shell/ui";import{UndoIcon as Ln,RedoIcon as Rn,RefreshIcon as En,AddIcon as Vn,TrashIcon as Fn,EyeOffIcon as Wn,EyeIcon as Gn,DuplicateIcon as Hn}from"efficient-shell/icons/efficient";import{jsx as Dn,jsxs as Un,Fragment as Jn}from"react/jsx-runtime";var Xn=/* @__PURE__ */new WeakSet;function Yn(e,n,t){const o=zn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function Kn({canvas:e,tabs:n,onSelect:t}){const o=Bn(null),[r,i]=Pn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return $n(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=yn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),c={};for(const o of n){const n=t.querySelector(`[${Sn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?kn(n):null;if(!i||0===i.height){c[o.id]=null;continue}const s=yn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),a=s.top+s.height;if(a<d.top||s.top>d.top+d.height){c[o.id]=null;continue}const p=o.below?a+4:Math.max(s.top,d.top)+6;c[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(c)},c=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",c,!0),r.addEventListener("resize",c);const a=new r.MutationObserver(c);return a.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",c,!0),r.removeEventListener("resize",c),a.disconnect()}},[e,l]),/* @__PURE__ */Dn("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */Dn("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:/* @__PURE__ */Dn(jn,{colorClass:An("info","solid"),size:"sm",children:e.label})},e.id):null})})}function Zn({expand:e}){/* @__PURE__ */
2
+ return Dn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Un(Jn,e?{children:[
3
+ /* @__PURE__ */Dn("path",{d:"M8 9l4-4 4 4"}),
4
+ /* @__PURE__ */Dn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
5
+ /* @__PURE__ */Dn("path",{d:"M8 4l4 4 4-4"}),
6
+ /* @__PURE__ */Dn("path",{d:"M8 20l4-4 4 4"}),
7
+ /* @__PURE__ */Dn("path",{d:"M5 12h14"})]})})}var qn=`${fn}, ${hn}`;function _n(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var Qn="__rungs";var et="screen:band",nt={duplicate:!0,delete:!0};function tt(){const fn=be(),{target:yn,docId:Sn,capabilities:kn,currentSlug:An,siteId:tt,onPublish:ot,saveState:rt,saveConflict:it,retrySave:lt,toggleAutoSave:st,flushSave:dt,access:ct,saveUnreachable:at=!1,readOnly:pt,readOnlyReason:ut=null}=O(),ft=V(),ht=F(),{mediaEditing:mt,hasEditGuard:gt,hasPinnedChrome:yt}=kn,{appState:St,dispatch:kt,history:vt,selectedItem:bt,getSelectorForId:wt,config:xt}=Ce(e=>e),zt=W(),{first:Ct,firstGroup:Bt,lastGroup:It,isSectionGroup:Pt,sectionGroupZone:Ot,panelOf:Nt}=zt,$t=Nt(Ct),Mt=e=>se(zt,e),jt=e=>de(zt,e),Tt="node"===zt.firstRow,At=zt.band??null,Lt=on("screen",ze),Rt=on("tree",Te),Et=on("drag",dn),Vt=on("notice",_e),Ft=on("lock",tn),Wt=on("menu",Ae),Gt=on("styleClipboard",xe),Ht=on("chrome",Qe),Dt=G()??`/${An}`,Ut=H(),Jt=D(),Xt=w({readOnly:pt}),Yt=w({readOnly:pt,foldIntoHistory:!0}),Kt=Bn(null),Zt=Be(),qt=In(()=>({...Xt,select:e=>{Kt.current=e,Xt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Zt.config;Kt.current=Le(e,t,n)}Xt.commitDocument(e,n)}}),[Xt,Zt]),_t=St.ui,Qt=_t.leftSideBarVisible,eo=_t.rightSideBarVisible,{options:no,widths:to,initial:oo,fluid:ro,fit:io}=U(),[lo,so]=Pn(oo),co=Se(),ao=mt&&null!==co,po=ke(),uo=ve();J(bt?.props.id);const{read:fo,write:ho,forSelection:mo}=X(),[go,yo]=Pn(fo);On(()=>{ho(go)},[go]);const[So,ko]=Pn(0),vo=Bn(null),bo=Bn(null),wo=un(bo,{readySelector:qn}),xo=f(bo);h(bo,wo);const zo=P(),Co=en(ct),Bo={state:rt,offline:zo||rt.failed&&at,readOnlyReason:ut,editing:Co?Vt.editing({name:nn(Co.name,Ft),noun:Lt.noun}):null,conflict:null!=it,notSaving:Lt.bar.notSaving},Io=()=>{pt||(rt.failed?lt():dt())};m(bo,wo,Io);const[Po,Oo]=Pn(!1),No=Bn(!1),$o=Bn(!1),[Mo,jo]=Pn(null),[To,Ao]=Pn([]),[Lo,Ro]=Pn(Y),Eo="puck"===Lo.kind,Vo=o(Lo,bt?.props.id),[Fo,Wo]=Pn(null);On(()=>{Fo&&(r(),Wo(null))},[Fo]);const Go=Bn(wt);Go.current=wt;const Ho=Nn((e,{scroll:n})=>{yo(n=>mo(e,n)),n&&Wo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Go.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&kr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Do=Bn(null);On(()=>{const e=Do.current;Do.current=null;const n=null==bt?.props.id?null:String(bt.props.id);Ro(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Nt(bt?.type)??Y);const t=bt?.props.id,o=Kt.current;if(Kt.current=null,!t)return;const r=wt(t);Ho(String(t),{scroll:!i(o,r??null,ae)})},[bt?.props.id,Ho]);const Uo=Nn(e=>{Ro(n=>K(n,e)?n:e),kt({type:"setUi",ui:{rightSideBarVisible:!0}})},[kt]),Jo=Bn(()=>{});Jo.current=(e,n)=>{const t=e?ui(e.zone??ae)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==bt?.props.id?null:String(bt.props.id);Ro(e=>K(e,n)?e:n),o!==r&&(Do.current={id:o,mode:n},qt.select(e))};const Xo=Nn((e,n)=>Jo.current(e,n),[]),Yo={kind:Lo.kind,mode:Lo,open:Uo,show:e=>Ro(e),reveal:()=>{eo||kt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Xo},Ko=Z(Yo,{data:St.data,selected:bt??null,zoneOf:e=>wt(e)?.zone,readOnly:Boolean(pt),select:e=>{Ro(Y),qt.select({index:e})},replace:(e,n)=>qt.replaceComponent(ae,e,n),scrollTo:e=>Ri(e)},{device:lo,refreshes:So},{setView:yo,reveal:()=>{Qt||kt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Zo=Ko.pinnedSource??!1,qo=Ko.resolveLeftView?Ko.resolveLeftView(go,ao):"media"===go&&ao?go:"sections",_o=q(),{isLockedBlock:Qo,duplicateBlocked:er,nestDepth:nr,newSectionNode:tr,canAddTo:or,blockIsOffered:rr}=_o,ir=_(),{labelAtLevel:lr,Icon:sr,useProducts:dr}=ir,cr=ir.rowName?(e,n,t)=>ir.rowName(e,n,t):void 0,ar=Nn(e=>{kt({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),Ho(e,{scroll:!0})},[kt,Ho]),{selectNode:pr,openPartId:ur}=b({mode:Lo,setMode:Ro,onOpenPart:ar}),[fr,hr]=Pn(null);we(null!==fr,()=>hr(null));const mr=S(Q()),gr=mr.collapsed,yr=mr.panelWidths,[Sr,kr]=Pn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(gr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
8
+ return new Set}});On(()=>{try{window.localStorage.setItem(gr,JSON.stringify([...Sr]))}catch{}},[Sr]);const[vr,br]=Pn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(yr);if(!e)return{...k};const n=JSON.parse(e);return{left:v(Number(n.left)||k.left),right:v(Number(n.right)||k.right)}}catch{return{...k}}});On(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(yr,JSON.stringify(vr))}catch{}},300);return()=>clearTimeout(e)},[vr]);const wr=Nn((e,n)=>br(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),xr=Nn(e=>wr("left",e),[wr]),zr=Nn(e=>wr("right",e),[wr]),Cr=e=>Sr.has(e),Br=e=>kr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Ir=Bn(!1),Pr=Bn(null);On(()=>{if(Ir.current&&!Po){const e=Pr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??bo.current?.querySelector(`button[aria-label="${CSS.escape(Lt.add.title)}"]`))?.focus(),Pr.current=null}Ir.current=Po},[Po]),On(()=>{if(!Po||!xo)return;const e=e=>{"Escape"===e.key&&Ui()};return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[Po,xo]),we(Po,()=>Ui()),On(()=>{!Qt&&Po&&(Oo(!1),jo(null),No.current=!1)},[Qt]),On(()=>{if(!po)return $o.current&&kt({type:"setUi",ui:{leftSideBarVisible:!1}}),void($o.current=!1);Po&&(Oo(!1),jo(null),$o.current=No.current,No.current=!1),Qt||($o.current=!0,kt({type:"setUi",ui:{leftSideBarVisible:!0}}))},[po]),On(()=>{!Qt&&po&&($o.current=!1,uo())},[Qt]),On(()=>{if(!po||!xo)return;const e=e=>{"Escape"===e.key&&uo()};return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[po,xo]),we(null!==po,()=>uo());const Or=ee(),Nr=(e,n="success",t)=>{if(Or)return void(t?Or(e,"error"===n?"error":"info",t):Or(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Tn.error(e,{...o,duration:t?.duration??3200}):Tn.success(e,{...o,duration:t?.duration??1900})},$r=Bn(null),[Mr,jr]=Pn(0),[Tr,Ar]=Pn(0),Lr=ne(),Rr=Bn(null),Er=e=>Math.max(0,e.clientHeight-(Rr.current?.offsetHeight??0));On(()=>{const e=$r.current;if(!e)return;const n=()=>{jr(e.clientWidth),Ar(Er(e))};n();const t=new ResizeObserver(n);return t.observe(e),Rr.current&&t.observe(Rr.current),()=>t.disconnect()},[]),$n(()=>{$r.current&&(jr($r.current.clientWidth),Ar(Er($r.current)))},[vr,Qt,eo]);const Vr=lo===ro?Mr>0?Mr:to[ro]:to[lo],Fr=Mr>0?Math.min(Mr/Vr,"shrink"===io?1:2):1,Wr=Vr*Fr,Gr=Mr>0&&Wr>Mr+1,Hr={width:Wr,height:Tr||"100%",flex:"none",position:"relative"},Dr={width:Vr,height:Tr?Tr/Fr:"100%",maxHeight:"none",transform:1!==Fr?`scale(${Fr})`:void 0,transformOrigin:"top left"},Ur=()=>kt({type:"setUi",ui:{leftSideBarVisible:!Qt}}),Jr=()=>kt({type:"setUi",ui:{rightSideBarVisible:!eo}}),Xr=e=>{Po&&(Oo(!1),jo(null),No.current=!1,Qt&&go===e)||po&&($o.current=!1,uo(),Qt&&go===e)||(Qt&&go===e?Ur():(yo(e),Qt||kt({type:"setUi",ui:{leftSideBarVisible:!0}})))},Yr=()=>{N(fn,{accept:"image/*",title:Ht.mediaLibrary})},Kr=()=>{Ro(Y),qt.select(null),u()},Zr=()=>{Ro($t??Y),eo||kt({type:"setUi",ui:{rightSideBarVisible:!0}})},qr=St.data.content??[],_r=()=>{const e=qr.findIndex(Mt),n=qr.findIndex(jt);return{floor:e>=0?e+1:0,cap:n>=0?n:qr.length}},Qr=xt,ei=_o.stripCopy,ni=n=>e(n,ei),ti=x(),oi=Re({data:St.data,config:Qr,readOnly:Boolean(pt),clipboard:ti,strip:ei?e=>ei(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==vn||e.slot!==bn)return{min:0,max:n-1};const{floor:t,cap:o}=_r();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Ro(Y);const t=void 0===n||"node"===n?.kind?n:null;qt.commitDocument(e,t)}}),ri=e=>{const n=zn(St.data,xt,e);if(!n)return!1;const t=wn(n.place),o=n.node,r=t===ae?ci(o):xi(o);return!!oi.remove(e)&&(Nr(Lt.deleted({name:r}),"success",{duration:8e3,action:{label:Lt.bar.undo,onClick:()=>{oi.restore(n.node,n.place)}}}),!0)},ii={...oi,remove:ri},li=e=>lr(e,"block",xt.components[e]?.label??e),si=Nn(e=>xt.components[e]?.defaultProps??{},[xt]),di=e=>lr(e,"section",li(e)),ci=e=>l({type:e.type,props:e.props??{}},di(e.type),cr),{nodeAddresses:ai,zoneItems:pi}=In(()=>{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>=ue)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of fe(xt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(qr,ae,0),{nodeAddresses:e,zoneItems:n}},[qr,xt]),ui=Nn(e=>pi.get(e)??[],[pi]),fi=e=>{const n=ai.get(e);return n?ui(n.zone)[n.index]:void 0},hi=e=>ce(_o,xt,e),mi=e=>{if(!_o.slotsOf||e===ae)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=fi(e.slice(0,n));if(!t)return null;const o=hi(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}},gi=(()=>{if(!te(Lo))return null;const e=`${Lo.nodeId}:${Lo.slot}`;return mi(e)?.slot.panel===Lo.kind?e:null})(),yi=Bn(null);On(()=>{const e=yi.current;if(yi.current=null,!gi||!te(Lo))return;const n=Lo.nodeId;Ho(n,{scroll:e!==gi}),kr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Lo]);const Si=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=ai.get(e);n&&(n.zone===ae?Ei(n.index):ul(n.zone,n.index,e,fi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&gi!==i&&(yi.current=i),Xo(null,r),eo||kt({type:"setUi",ui:{rightSideBarVisible:!0}}),Ri(o)},ki=(e,n,t)=>{const o=`${e}:${n}`;if(kr(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;gi!==o&&(yi.current=o);Xo(null,{kind:t,nodeId:e,slot:n})},vi=(e,n,t)=>{if(pt||!_o.moveSlot)return;const o=fi(e),r=o?hi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Qn,index:n},s=pn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=_o.moveSlot(e,n,s);"string"==typeof d&&ki(e,d,i.panel)},bi=dr(),wi=In(()=>{const e=/* @__PURE__ */new Map;for(const n of bi??[])e.set(n.slug,n.name);return e},[bi]),xi=e=>s(e,li,ir.plainText,e=>wi.get(e),ir.rowName),zi=(e,n)=>{const t=xt.components[e.type]?.fields,o=n===ae||jl(n)?"section":"block",r=n===ae&&(Mt(e)||jt(e)||Pt(e.type)),i="block"===o?d(t):r?null:c(t);return ir.renamePropOf?ir.renamePropOf(e,o,i):i},Ci=(e,n,t,o)=>{if(!(!pt&&fr?.zone===e&&fr.index===n))return;const r=(t,o)=>{hr(null),o&&((e,n,t)=>{const o=ui(e)[n];if(!o)return;const r=zi(o,e);r&&qt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
9
+ return Dn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Lt.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)},Bi=t(oe(),Gt),Ii=Bi.scope({target:yn,siteId:tt,docId:Sn}),Pi=xt,Oi=(e,n)=>n===ae?di(e):li(e),Ni=(e,n,t)=>{const o=Bi.plan(Ii,t,Oi(t.type,e),Pi);o&&(o.changed&&qt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Nr(o.message))},$i=z({nodesIn:ui,nodeAt:(e,n)=>ui(e)[n]??null,labelOf:(e,n)=>n===ae?di(e):li(e),renamePropOf:zi,beginRename:(e,n)=>hr({zone:e,index:n}),history:{hasPast:vt.hasPast,hasFuture:vt.hasFuture,back:()=>vt.back(),forward:()=>vt.forward()},openPageSettings:()=>{qt.select(null),Ro(Y)},pageSettingsLabel:Lt.pageSettings,words:{menu:Wt,styleClipboard:Gt,screen:Lt.menu},readOnly:Boolean(pt),collapseAll:()=>kr(new Set(ui(ae).map(e=>String(e.props.id)))),onPasteRefused:e=>Nr(e?Lt.pasteRefused({name:e.label}):Lt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Ll(e,n),menuRows:Ko.menuRows,isLocked:e=>Qo(e.type),duplicateBlocked:e=>er(St.data,e),permits:e=>pe(xt,e.type),nodeOps:ii,isPinned:(e,n)=>n===ae&&(Mt(e)||jt(e)),sectionBand:_r,locate:e=>ai.get(e)??null,rowNameOf:(e,n)=>n===ae?ci(e):xi(e),selectAt:(e,n,t,o)=>{e===ae?Ei(n):ul(e,n,t,o??"")},slotRung:e=>{const n=mi(e);return n?.slot.panel?{label:n.slot.label,select:()=>Si(n.node,n.slot,!1)}:null},style:{held:()=>$(Ii),canCopy:e=>Bi.rows(Pi,e).some(e=>!1!==e.counted),copy:(e,n)=>Bi.copy(Ii,e,Oi(e.type,n),Pi),paste:(e,n,t)=>Ni(e,n,t)},keys:ht?{target:xo,selected:()=>{const e=St.ui.itemSelector;return e?{zone:e.zone??ae,index:e.index}:null},held:()=>ti.get(),readOnly:Boolean(pt),onDone:({done:e,name:n})=>{"copied"===e&&Nr(Lt.copied({name:n}))}}:void 0},wo),Mi=Bn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});On(()=>{Mi.current={copy:(e,n)=>Bi.copy(Ii,e,Oi(e.type,n),Pi),paste:Ni,at:()=>{const e=St.ui.itemSelector;if(!e)return null;const n=e.zone??ae,t=ui(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(pt)}});const ji=Nn(e=>{const n=M(e);if(!n)return;const t=Mi.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))},[]);On(()=>{if(!xo)return;const e=e=>ji(e);return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[ji,xo]),mn(wo,"keydown",ji);const Ti=qr.map(e=>e.props.id).join("|");On(()=>{const e=wo?.document??null,n=wo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Ao(e=>e.length?[]:e);const n=qr.findIndex(jt),t=n>=0?n:qr.length,o=n=>{const t=qr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(hn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=qr.length>0&&!Mt(qr[0])?0: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=_n(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Ao(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()}},[wo,Ti,lo,Fr,Qt,eo,bt?.props.id]);const Ai=wo?.document??null,Li=wo?.window??null;On(()=>{const e=vo.current;if(!e||!Ai||!Li)return;const n=[],t=()=>{const n=Ai.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Li.scrollTo({left:Li.scrollX,top:Li.scrollY+t,behavior:"instant"}),!0};return vo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Ai,Li]);const Ri=e=>{Ko.holdCanvasOn?Ko.holdCanvasOn(e):a(e)},Ei=e=>{Ro(Y),qt.select({index:e}),Ko.sectionPressed?.(qr[e]);const n=qr[e]?.props?.id;n&&Ri(n)},Vi=e=>{const{floor:n,cap:t}=_r(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=bt&&Lo.kind!==$t?.kind?qr.findIndex(e=>e.props.id===bt.props.id):-1;return o(r>=0?r+1:t)},Fi=(e,n)=>{const{floor:t,cap:o}=_r(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(qt.reorderComponent(ae,e,i),qt.select({index:i}),{moved:!0,dest:i})},Wi=(e,n,t,o)=>{Ro(Y),qt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),Nr(Lt.sectionAdded({name:t}))},Gi=(e,n)=>{const t=Vi(n),o=tr(e,{nodeDefaults:si,newNodeId:ye,sectionLabel:di,blockIsOffered:rr}),r=o?qt.insertNode(ae,t,o):qt.insertSection(e,t);return Wi(t,r,di(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 fe(xt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=or(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},Hi=e=>Di(ae,e),Di=(e,n)=>{Pr.current=document.activeElement??null,po&&(No.current=$o.current,$o.current=!1,uo()),jo(null===n?null:{zone:e,index:n}),Oo(!0),Qt||(No.current=!0,kt({type:"setUi",ui:{leftSideBarVisible:!0}}))},Ui=()=>{Oo(!1),jo(null),No.current&&kt({type:"setUi",ui:{leftSideBarVisible:!1}}),No.current=!1},Ji=(e,n)=>ir.rowName?n?Mt(e)?ir.rowName(e,"section",Lt.header):jt(e)?ir.rowName(e,"section",Lt.footer):Pt(e.type)?ir.rowName(e,"section",li(e.type)):ci(e):xi(e):n?di(e.type):li(e.type),Xi=e=>n=>{e()},Yi=()=>Ko.editPinnedSource?.(),Ki=(e,n,t)=>{if(pt)return null;const o=ui(e)[n];return o&&!pe(xt,o.type).delete?null:/* @__PURE__ */Dn(Me,{kind:"delete",label:Lt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=ui(e)[n]?.props?.id;null!=t&&ri(String(t))})(e,n),children:/* @__PURE__ */Dn(Fn,{size:15})})},Zi=e=>ir.rowPreview?.(e)||void 0,qi=e=>ir.rowMarks?.(e)??void 0,_i=(e,n,t)=>ir.rowActions?.(e,n,t)??null,Qi=(e,n,t,o)=>{if(pt)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
10
+ return Dn(Me,{kind:"eye",label:r?Lt.showNamed({name:o}):Lt.hideNamed({name:o}),onClick:()=>nl(e,n,t),children:/* @__PURE__ */Dn(r?Wn:Gn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},el=e=>us(ae,e),nl=(e,n,t)=>{qt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},tl=e=>he(xt,e),ol=e=>fe(xt,e),rl=e=>_o.slotsOf?hi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:me(e,n.slot)})):[{slot:null,rung:null,kids:ol(e)}],il=e=>_o.slotsOf?rl(e).flatMap(e=>e.kids):ol(e),ll=e=>Boolean(_o.slotsOf)&&hi(e).some(e=>e.rung),sl=(e,n,t)=>null===t?void 0===n?or(e):or(e,n):or(e,n,t),dl=(e,n,t)=>{const o=ge(xt,e.type,n)&&(t||il(e).length>0||ll(e));return{collapsible:o,folded:o&&Cr(String(e.props.id))}},cl=(e,n,t)=>rl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>dl(e,r,t(e.type)).collapsible?[String(e.props.id),...cl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),al=e=>il(e).length>0||ll(e)||Boolean(or(e.type)),pl=e=>Boolean(or(e)),ul=(e,n,t,o)=>{if(Ro(Y),or(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),qt.select({index:n,zone:e}),a(t)}else qt.select({index:n,zone:e}),Ri(t)},fl=(e,n,t,o,r)=>{const i=`${e}:${n}`;qt.insertComponent(i,t,o),or(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),qt.select({index:o,zone:i})}):qt.select({index:o,zone:i})},hl=Bn(/* @__PURE__ */new Set);On(()=>{qr.forEach(e=>{const n=or(e.type)?.spec;if(!n)return;const t=e.props.id;if(hl.current.has(t))return;hl.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(si)).forEach((e,t)=>Yt.seedChild(o,t,n.childType,e))})},[qr,Yt,si]);const ml=Bn(/* @__PURE__ */new Set);On(()=>{qr.forEach((e,t)=>{const o=e.props.id;if(ml.current.has(o))return;const r=n(e,tl(e.type));ml.current.add(o),r&&Yt.replaceComponent(ae,t,{...e,props:r})})},[qr,Yt]),re(Yt,xt);const gl=qr.findIndex(jt),yl=gl>=0?qr[gl]:null,Sl=Tt?qr.findIndex(Mt):-1,kl=Sl>=0?qr[Sl]:null,vl=zt.groupTab,bl=In(()=>vl?e=>Pt(e.type):void 0,[vl]),wl=Boolean(zt.groupBadge),xl=zt.groupBadge?/* @__PURE__ */Dn("span",{className:"es-tree-group-badge",children:/* @__PURE__ */Dn(jn,{tone:"info",size:"xs",children:zt.groupBadge})}):void 0,zl=qr.find(e=>e.type===Bt)??null,Cl=qr.find(e=>e.type===It)??null,Bl=gl>=0?gl:qr.length,Il=[];qr.forEach(e=>{jt(e)||(al(e)&&Il.push(String(e.props.id)),Il.push(...cl(e,1,pl)))}),yl&&(Il.push(String(yl.props.id)),Il.push(...cl(yl,1,pl)));const Pl=Il.length>0&&Il.every(e=>Sr.has(e)),Ol=e=>{const n=ir.blockRowName(e,li);return ir.rowName?ir.rowName(e,"block",n):n},Nl=(e,n,t,o)=>{const r=ui(e)[t];if(!r)return;const i={...xn(e),index:t},l={...xn(n),index:Math.min(Math.max(o,0),ui(n).length)},s=pn(i,l);if(e!==n||s!==t)try{oi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Cn))throw e}},$l=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of ol(e))n.add(r),t(o)};for(const t of tl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Ml=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=ai.get(n);if(!e)return null;if(e.zone===ae)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},jl=e=>{const n=e.slice(0,e.indexOf(":")),t=qr.find(e=>Pt(e.type)&&String(e.props.id)===n);return t&&Ot(n)===e?t:null},Tl=(e,n)=>{const t=jl(e);return!t||(!zt.groupAccepts||zt.groupAccepts(t.type,n,ui(e).length))},Al=(e,n,t)=>{if(e.rung){const t=fi(e.rung.nodeId),o=t?hi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Qn&&n.index>=0&&n.index<=o}if(n.slot===Qn)return!1;if(e.add)return El(e.add,n);const o=wn(n);if(Pt(e.type))return!1;const r=jl(o),i=jl(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!Tl(o,e.type))&&(n.index>=0&&n.index<=ui(o).length));if(e.zone===ae||o===ae){if(e.zone!==o)return!1;const{floor:t,cap:r}=_r();return n.index>=t&&n.index<=r}if(n.index<0||n.index>ui(o).length)return!1;if(e.zone===o)return!0;const l=yl&&!zt.lastIsOpen?String(yl.props.id):null;return(!l||Ml(e.zone)!==l&&Ml(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??ui(e)[t];if(!r)return!1;const i=n.split(":")[0],l=ai.get(i),s=l?ui(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&$l(r).has(n))return!1;const d=or(s.type,nr(St?.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?.(ui(n),r))})(e.zone,o,e.index,t)},Ll=(e,n)=>{const t=wn(e.from),o=e.node;return t===wn(n)?Tl(t,o.type):Al({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Rl=e=>{const n=e.slice(0,e.indexOf(":")),t=ai.get(n),o=t?ui(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=or(o.type,nr(St?.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:li(r.spec.childType)}]:[]),l=mi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Ji(o,t.zone===ae)}},El=(e,n)=>{const t=wn(n);if("block"!==e.kind){if(jl(t)){const o="section"===e.kind?e.type:e.template.node.type;return Tl(t,o)&&n.index>=0&&n.index<=ui(t).length}if(t!==ae)return!1;const{floor:o,cap:r}=_r();return n.index>=o&&n.index<=r}if(t===ae)return!1;const o=Rl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(ui(t))},Vl=(e,n)=>{if("block"!==e.kind&&jl(wn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&Tl(n,o)){if("section"===e.kind)qt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;qt.insertNode(n,t,ni(e.template.node))}Ro(Y),qt.select({index:t,zone:n})}})(e,wn(n),n.index);if("section"===e.kind)return void Gi(e.type,n.index);if("template"===e.kind)return void((e,n,t)=>{const o=Vi(t),r=qt.insertNode(ae,o,n);Wi(o,r,e)})(e.template.name,ni(e.template.node),n.index);const t=wn(n),o=Rl(t);o&&(o.target.spec?fl(o.parentId,o.target.slot,e.type,n.index,o.parent.type):((e,n,t)=>{qt.insertComponent(e,n,t),Ro(Y),qt.select({index:t,zone:e})})(t,e.type,n.index))},Fl=(e,n)=>{e.rung?vi(e.rung.nodeId,e.index,n.index):e.add?Vl(e.add,n):e.zone===ae?Fi(e.index,n.index):Nl(e.zone,wn(n),e.index,n.index)},[Wl]=Pn(()=>cn()),Gl=an({keyOf:e=>e.id,readOnly:Boolean(pt),session:Wl,canDrop:Al,onDrop:Fl,onStep:(e,n)=>{e.rung?vi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===ae?((e,n)=>{const t=di(qr[e]?.type??""),o=Fi(e,n<0?e-1:e+2);if(!o.moved)return void Nr(n<0?Lt.sectionFirst({name:t}):Lt.sectionLast({name:t}));const{floor:r,cap:i}=_r();Nr(Lt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Nl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Hl=Nn(e=>{const{floor:n,cap:t}=_r(),o=[];for(const r of e.nodes){const e=wn(r.place),i=ui(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Mt(i)||jt(i)||Qo(i.type))continue;if(Pt(i.type))continue;const l=Boolean(jl(e)),s=e===ae||l;e===ae&&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?di(i.type):xi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=wn(e.list);if(n===ae&&0===e.children.length)return[{...e,addLabel:Lt.addSection,addAlways:!0}];const t=Rl(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(jl(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=wn(e.list),t=n===ae||jl(n)?null:Rl(n);return t?.choices.length?rn(e,t.target.spec?.addLabel??Lt.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[St.data]),Dl=null==bt?.props.id?null:String(bt.props.id),Ul=Nn(e=>{const n=xt,t=e=>!e.item.rung&&null!==zn(St.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(Dl);return i||(r(Ee(St.data,n,o.item.id,Dl,bl))??o)},[St.data,xt,Dl,bl]),[Jl,Xl]=Pn(null);mn(wo,"mouseover",e=>{if(!vl)return;const n=gn(e.target),t=n?Yn(St.data,xt,n):null;t!==Jl&&Xl(t)}),mn(wo,"mouseout",e=>{vl&&!e.relatedTarget&&Xl(null)});const Yl=e=>Mt(e)||jt(e)||Pt(e.type),Kl=[];if(vl){const e=Dl?Yn(St.data,xt,Dl):null;for(const n of/* @__PURE__ */new Set([e,Jl])){const e=n?qr.find(e=>String(e.props.id)===n):void 0;if(!e||!Yl(e))continue;const t=vl(e);t&&Kl.push({id:String(e.props.id),label:t,below:Mt(e)||e.type===Bt})}}const Zl=R(),ql=Bn(null);On(()=>{const e=zt.changeNotice;if(!e)return;const n=JSON.stringify(qr.filter(Yl)),t=ql.current;if(ql.current={doc:Sn,bands:n,index:vt.index},!t||t.doc!==Sn||t.bands===n)return;vt.hasPast&&vt.index>=t.index&&!Xn.has(Zl)&&(Xn.add(Zl),Nr(e,"success",{action:{label:Lt.bar.undo,onClick:()=>vt.back()},duration:8e3}))},[qr]);const _l=e=>{Ro(Y),qt.select(e.zone===ae?{index:e.index}:{index:e.index,zone:e.zone})},Ql=ie(),es=()=>({data:St.data,device:lo,ops:qt,inspector:Yo}),ns=Ql?.model,ts=In(()=>ns?e=>ns(e,Hl(e),es()):Hl,[ns,Hl,lo]),os=Ql?.measure,rs=os?(e,n)=>os(e,n,es()):void 0,is=Ql?.canDrop,ls=is?(e,n)=>is(e,n,Al,es()):Al,ss=Ql?.drop,ds=ss?(e,n)=>ss(e,n,Fl,es()):Fl,cs=Ql?.pick,as=cs?e=>cs(e,_l,es()):_l,ps=e=>{const n=wn(e),t=mi(n);t&&Si(t.node,t.slot,!1),Di(n,e.index)},us=(e,n)=>/* @__PURE__ */Dn(je,{...pt?{}:Gl.seam({place:{...xn(e),index:n}})},`seam:${e}:${n}`),fs={rowClick:Xi,isCollapsed:Cr,toggleCollapse:Br},hs=e=>{const n=String(e.props.id),t=qr.findIndex(e=>String(e.props.id)===n),o=Ot(n),r=ui(o),i=Cr(n),l=li(e.type),s=ir.rowName?ir.rowName(e,"section",l):l,d=e=>us(o,e);/* @__PURE__ */
11
+ return Un(Jn,{children:[
12
+ /* @__PURE__ */Dn(Pe,{words:Rt,icon:/* @__PURE__ */Dn(sr,{type:e.type,size:13}),name:s,preview:Zi(e),marks:qi(e),onSelect:()=>Ei(t),nameSlot:Ci(ae,t,n,s),selected:Vo===n,badge:xl,actions:_i(e,ae,t)??void 0,rowProps:{"data-node-id":n,onClick:Xi(()=>Ei(t))},fold:{open:!i,label:"section",onToggle:()=>Br(n)}}),!i&&/* @__PURE__ */Un(Oe,{children:[r.map((n,t)=>{const r=String(n.props.id),i=ci(n),l=al(n),s=l&&Cr(r),c=()=>ul(o,t,r,e.type),{rowProps:a,...p}=Gl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...xn(o),index:t}},{"data-node-id":r,onClick:Xi(c)});/* @__PURE__ */
13
+ return Un(Mn,{children:[d(t),
14
+ /* @__PURE__ */Dn(Pe,{words:Rt,icon:/* @__PURE__ */Dn(sr,{type:n.type,size:13}),name:i,preview:Zi(n),marks:qi(n),onSelect:c,nameSlot:Ci(o,t,r,i),selected:Vo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Br(r)}:void 0,actions:/* @__PURE__ */Un(Jn,{children:[Ki(o,t,i),_i(n,o,t),Qi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Dn(Oe,{children:ys(n,2)})]},r)}),d(r.length)]})]})},ms=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=Gl.dragging,d=!Cr(l)&&s?.rung?.nodeId!==i,c={...xn(l),index:0},a=s&&!s.rung&&Al(s,c)?c:void 0,p=()=>Si(e,n,!0),{rowProps:u,...f}=Gl.row({item:{id:`rung:${l}`,zone:`${i}:${Qn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Qn,index:t},into:a,canDrag:Boolean(_o.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Xi(p)}),h=pt?null:_o.slotActions?.(e,n.slot);/* @__PURE__ */
15
+ return Un(Mn,{children:[n.heading,
16
+ /* @__PURE__ */Dn(Pe,{words:Rt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:gi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Br(l)},actions:h&&h.length>0?/* @__PURE__ */Dn(Jn,{children:h.map((t,o)=>/* @__PURE__ */Dn(Me,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(pt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&ki(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__ */Dn(Fn,{size:15}):/* @__PURE__ */Dn(Hn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Dn(Oe,{children:r})]},l)},gs=(e,n)=>{const t=rl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
17
+ return Dn(Jn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=sl(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=(e,n)=>us(e,n),p=/* @__PURE__ */Un(Jn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Vo===String(n.props.id),{collapsible:i,folded:s}=dl(n,l,pl(n.type)),d=String(n.props.id),c=Ol(n),p=()=>ul(t,o,d,e.type),{rowProps:u,...f}=Gl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...xn(t),index:o}},{"data-node-id":d,onClick:Xi(p)});/* @__PURE__ */
18
+ return Un(Mn,{children:[0===o&&a(t,0),
19
+ /* @__PURE__ */Dn(Pe,{words:Rt,icon:/* @__PURE__ */Dn(sr,{type:n.type,size:13}),name:c,preview:Zi(n),marks:qi(n),onSelect:p,nameSlot:Ci(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Br(d)}:void 0,actions:/* @__PURE__ */Un(Jn,{children:[Ki(t,o,c),_i(n,t,o),Qi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Dn(Oe,{children:gs(n,l+1)}),a(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?a(d,0):null:0!==i.length||!t.rung&&d!==c?null:a(c,0)]});return t.rung?ms(e,t.rung,r++,o,p):/* @__PURE__ */Dn(Mn,{children:p},t.slot??"")})})},ys=(e,n)=>{const t=nr(St?.data,e.type,String(e.props.id)),o=rl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
20
+ return Dn(Jn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=sl(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=(e,n)=>us(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),S=/* @__PURE__ */Un(Jn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Vo===String(n.props.id),i=xi(n),l=String(n.props.id),{collapsible:d,folded:c}=dl(n,s,pl(n.type)),a=tl(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...xn(p),index:ui(p).length}:void 0,f=Gl.dragging,h=u&&f&&Al(f,u)?u:void 0,g=()=>ul(t,o,l,e.type),{rowProps:y,...S}=Gl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...xn(t),index:o},into:h,canDrag:!Qo(n.type)},{"data-node-id":l,onClick:Xi(g)});/* @__PURE__ */
21
+ return Un(Mn,{children:[0===o&&m(t,0),
22
+ /* @__PURE__ */Dn(Pe,{words:Rt,icon:/* @__PURE__ */Dn(sr,{type:n.type,size:13}),name:i,preview:Zi(n),marks:qi(n),onSelect:g,nameSlot:Ci(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...S,fold:d?{open:!c,label:"group",onToggle:()=>Br(l)}:void 0,actions:Qo(n.type)?_i(n,t,o)??void 0:/* @__PURE__ */Un(Jn,{children:[Ki(t,o,i),_i(n,t,o),Qi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Dn(Oe,{children:ys(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
23
+ /* @__PURE__ */Dn(j,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>fl(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?ms(e,o.rung,i++,r,S):/* @__PURE__ */Dn(Mn,{children:S},o.slot??"")})})},Ss=Po||null!==po,ks=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Qt&&!Ss&&qo===e.id,onSelect:()=>Xr(e.id)}:e,vs=[...(Ko.railLead??[]).map(ks),{id:"sections",label:Lt.layers,icon:/* @__PURE__ */Dn(Ve,{}),active:Qt&&!Ss&&"sections"===qo,onSelect:()=>Xr("sections")},...(Ko.railTrail??[]).map(ks)];ao?vs.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Dn(Fe,{}),active:Qt&&!Po&&(null!==po||"media"===qo),onSelect:()=>Xr("media")}):mt&&vs.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Dn(Fe,{}),onSelect:Yr});const bs=[...Ko.railLead??[],...Ko.railTrail??[]].find(e=>"panel"in e&&e.id===qo),ws=Boolean(At?.foldable)&&!Zo,xs=At?.label??(gt?Lt.pageSections:Lt.templateSections),zs=ws&&Cr(et),Cs=/* @__PURE__ */Un(Jn,{children:[qr.map((e,n)=>{if(Mt(e)||jt(e)||Pt(e.type))return null;const t=Vo===String(e.props.id),o=Boolean(e.props._hidden);ol(e);const r=String(e.props.id),i=Ko.hasOwnRows?.(e)??!1,l=al(e)||i,s=l&&Cr(r),d=tl(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...xn(c),index:ui(c).length}:void 0,p=Gl.dragging,u=a&&p&&Al(p,a)?a:void 0,{rowProps:f,...h}=Gl.row({item:{id:r,zone:ae,index:n,type:e.type},place:{...xn(ae),index:n},into:u},{"data-node-id":r,onClick:Xi(()=>Ei(n))});/* @__PURE__ */
24
+ return Un(Mn,{children:[n>0&&el(n),
25
+ /* @__PURE__ */Dn(Pe,{words:Rt,icon:/* @__PURE__ */Dn(sr,{type:e.type,size:13}),name:ci(e),preview:Zi(e),marks:qi(e),onSelect:()=>Ei(n),nameSlot:Ci(ae,n,r,ci(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Br(r)}:void 0,actions:/* @__PURE__ */Un(Jn,{children:[Ki(ae,n,ci(e)),_i(e,ae,n),Qi(ae,n,e,ci(e))]}),rowProps:f}),al(e)&&!s&&/* @__PURE__ */Un(Oe,{children:[ys(e,1),Ko.partRows?.(e,fs)]}),i&&!s&&/* @__PURE__ */Dn(Oe,{children:Ko.ownRows?.(e,n,fs)})]},String(e.props.id??n))}),!Zo&&Bl>0&&el(Bl)]}),Bs=(e,n,t)=>{const o=String(e.props.id),r=il(e).length>0||ll(e)||Boolean(or(e.type)),i=r&&Cr(o),l="header"===t?Lt.header:Lt.footer,s=ir.rowName?ir.rowName(e,"section",l):l;/* @__PURE__ */
26
+ return Un(Jn,{children:[
27
+ /* @__PURE__ */Dn(Pe,{words:Rt,icon:/* @__PURE__ */Dn(sr,{type:t,size:13}),name:s,preview:Zi(e),marks:qi(e),badge:xl,onSelect:()=>Ei(n),nameSlot:Ci(ae,n,o,s),selected:Vo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Br(o)}:void 0,actions:_i(e,ae,n)??void 0,rowProps:{"data-node-id":o,onClick:Xi(()=>Ei(n))}}),r&&!i&&/* @__PURE__ */Dn(Oe,{children:gs(e,1)})]})};return(Ko.wrap??(e=>e))(
28
+ /* @__PURE__ */Dn(le,{target:wo,children:/* @__PURE__ */Un("div",{ref:bo,className:"sf-editor es-editor",style:qe(vr),onContextMenu:$i.onEditorContextMenu,...g(fn),children:[
29
+ /* @__PURE__ */Un(We,{children:[
30
+ /* @__PURE__ */Dn(Ge,{items:vs,ariaLabel:Lt.bar.views}),
31
+ /* @__PURE__ */Un(He,{children:[
32
+ /* @__PURE__ */Dn(De,{label:Lt.bar.undo,disabled:Boolean(pt)||!vt.hasPast,onClick:()=>vt.back(),children:/* @__PURE__ */Dn(Ln,{})}),
33
+ /* @__PURE__ */Dn(De,{label:Lt.bar.redo,disabled:Boolean(pt)||!vt.hasFuture,onClick:()=>vt.forward(),children:/* @__PURE__ */Dn(Rn,{})}),
34
+ /* @__PURE__ */Dn(Ue,{}),
35
+ /* @__PURE__ */Dn(Je,{devices:no,value:lo,onChange:so}),
36
+ /* @__PURE__ */Dn(De,{label:Lt.bar.refresh,tip:Lt.bar.refreshTip,onClick:()=>{vo.current=(()=>{const e=wo?.document;if(!e)return null;const n=qr.findIndex(jt),t=n>=0?n:qr.length;let o=null;for(let n=0;n<t;n++){const t=qr[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=bt?.props?.id??qr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),ko(e=>e+1)},children:/* @__PURE__ */Dn(En,{})})]}),
37
+ /* @__PURE__ */Un(He,{kind:"right",style:{minWidth:300},children:[
38
+ /* @__PURE__ */Dn(B,{input:Bo,words:Lt.saveStatus}),Ko.barLead?.(),Ko.barTrail?.(),Ko.mainAction||!Ko.barMain?/* @__PURE__ */Dn(I,{input:Bo,action:Ko.mainAction??{label:Lt.done,onPress:()=>{ot(St.data)}},readOnly:Boolean(pt),saveSwitch:ft,onToggleAutoSave:st,onSaveNow:Io,bar:Lt.bar,words:Lt.saveStatus}):Ko.barMain()]})]}),
39
+ /* @__PURE__ */Dn(C,{}),
40
+ /* @__PURE__ */Un("div",{className:"sf-body",children:[Qt?/* @__PURE__ */Un(Jn,{children:[
41
+ /* @__PURE__ */Dn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Lt.leftPanel,children:Po?/* @__PURE__ */Dn(T,{at:Mo?{label:(e=>{const n=jl(e.zone);if(n)return Lt.add.addingTo({name:ir.rowName?Ji(n,!0):li(n.type)});if(e.zone===ae){const n=qr[e.index];return n&&!jt(n)?Lt.add.addingBefore({name:Ji(n,!0)}):Lt.add.addingAtEnd}const t=Rl(e.zone);return t?Lt.add.addingTo({name:t.parentName}):Lt.add.addingHere})(Mo),onClear:()=>jo(null)}:void 0,placeBlocks:Mo&&Mo.zone!==ae?Rl(Mo.zone)?.choices:void 0,canTake:Mo?e=>{if(!Mo)return null;const n={...xn(Mo.zone),index:Mo.index};if(El(e,n))return null;const t=jl(Mo.zone);if(t)return Lt.add.notInside({name:Ji(t,!0)});if(Mo.zone===ae)return Lt.add.onlySections;const o=Rl(Mo.zone);return o?Lt.add.notInside({name:o.parentName}):Lt.add.onlySections}:void 0,onPick:Mo?e=>{if(!Mo)return;const n={...xn(Mo.zone),index:Mo.index};El(e,n)&&(Vl(e,n),Ui())}:void 0,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:Wl,siteWide:Ko.addPanelRow?.(Ui),onClose:Ui,onHide:Ur,readOnly:Boolean(pt)}):po&&co?
42
+ /* @__PURE__ */Dn(E,{panel:co,pick:po,onHide:Ur}):bs?bs.panel({onHide:Ur,notify:Nr}):"media"===qo&&co?/* @__PURE__ */Dn(E,{panel:co,pick:null,onHide:Ur}):/* @__PURE__ */Un(Jn,{children:[
43
+ /* @__PURE__ */Dn(A,{icon:/* @__PURE__ */Dn(Ve,{}),title:Lt.layers,context:Dt,actions:/* @__PURE__ */Un(Jn,{children:[!pt&&/* @__PURE__ */Dn(Xe,{label:Lt.add.title,onClick:()=>Hi(null),children:/* @__PURE__ */Dn(Vn,{size:15})}),
44
+ /* @__PURE__ */Dn(Xe,{label:Pl?Lt.expandAll:Lt.collapseAll,title:0===Il.length?Lt.nothingToFold:void 0,disabled:0===Il.length,onClick:()=>kr(e=>{const n=new Set(Il);return Pl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Il])}),children:/* @__PURE__ */Dn(Zn,{expand:Pl})})]}),onHide:Ur}),
45
+ /* @__PURE__ */Un(Ne,{className:"sf-tree sf-scroll",words:Rt,children:[
46
+ /* @__PURE__ */Dn(Pe,{words:Rt,icon:/* @__PURE__ */Dn(sr,{type:"page",size:13}),name:Lt.pageSettings,onSelect:Kr,selected:!bt&&Eo,rowProps:{onClick:Xi(Kr)}}),zl&&/* @__PURE__ */Un(Jn,{children:[!wl&&/* @__PURE__ */Dn($e,{children:Lt.header}),hs(zl)]}),!Zo&&yt&&!(wl&&zl)&&/* @__PURE__ */Un(Jn,{children:[!wl&&/* @__PURE__ */Dn($e,{children:Lt.header}),!Tt&&/* @__PURE__ */Dn(Pe,{words:Rt,icon:/* @__PURE__ */Dn(sr,{type:"header",size:13}),name:Lt.header,badge:xl,onSelect:Zr,selected:Lo.kind===$t?.kind,rowProps:{onClick:Xi(Zr)}})]}),!Zo&&kl&&!(wl&&zl)&&Bs(kl,Sl,"header"),!Zo&&!ws&&/* @__PURE__ */Dn($e,{children:xs}),ws?/* @__PURE__ */Un(Jn,{children:[
47
+ /* @__PURE__ */Dn(Pe,{words:Rt,icon:null,name:xs,fold:{open:!zs,label:xs,onToggle:()=>Br(et)}}),!zs&&/* @__PURE__ */Dn(Oe,{children:Cs})]}):Cs,yt&&!wl&&/* @__PURE__ */Dn($e,{children:Lt.footer}),yl&&!(wl&&Cl)&&Bs(yl,gl,"footer"),!Zo&&!yl&&yt&&!wl&&/* @__PURE__ */Dn(Pe,{words:Rt,icon:/* @__PURE__ */Dn(sr,{type:"footer",size:13}),name:Lt.footer,onSelect:Yi,rowProps:{onClick:Xi(Yi),title:Lt.editFooter}}),Cl&&hs(Cl),Ko.treeFoot?.()]})]})}),
48
+ /* @__PURE__ */Dn(Ye,{side:"left",width:vr.left,min:Ze,max:Ke,defaultWidth:k.left,label:Lt.resizeLeftPanel,onResize:xr})]}):/* @__PURE__ */Dn(L,{side:"left",onShow:Ur}),
49
+ /* @__PURE__ */Un("div",{ref:$r,className:"sf-center sf-scroll","data-sf-canvas-head":Lr?"":void 0,style:{overflowX:Gr?"auto":"hidden",overflowY:"hidden"},children:[Lr&&/* @__PURE__ */Dn("div",{ref:Rr,className:"sf-canvas-head",children:/* @__PURE__ */Dn(Lr,{device:lo})}),
50
+ /* @__PURE__ */Un("div",{className:"sf-frame-scaler",style:Hr,children:[
51
+ /* @__PURE__ */Dn("div",{className:"sf-frame "+(lo===ro?"":`sf-frame--${lo}`),style:Dr,children:/* @__PURE__ */Un("div",{className:"sf-preview-host",children:[
52
+ /* @__PURE__ */Dn(Ie.Provider,{value:bl,children:/* @__PURE__ */Dn(Ut,{},So)}),
53
+ /* @__PURE__ */Dn(ln,{canvas:wo,session:Wl,model:ts,measure:rs,canDrop:ls,onDrop:ds,choose:Ul,onPick:as,onZoneAdd:ps,onSeamAdd:ps,zoneAddLabel:Lt.canvasAddBlock,words:Et.canvas,readOnly:Boolean(pt),revision:St.data}),To.length>0&&/* @__PURE__ */Dn("div",{className:"sf-preview-gaps",children:To.map(e=>
54
+ /* @__PURE__ */Dn(sn,{index:e.index,label:Lt.addSectionHere,onInsert:()=>Hi(e.index),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}},e.index))})]})}),vl?/* @__PURE__ */Dn(Kn,{canvas:wo,tabs:Kl,onSelect:e=>{const n=qr.findIndex(n=>String(n.props.id)===e);n>=0&&Ei(n)}}):null]})]}),eo?/* @__PURE__ */Un(Jn,{children:[
55
+ /* @__PURE__ */Dn(y,{value:{selectChild:ul,addChild:fl,childRowName:xi,blockRowName:Ol},children:/* @__PURE__ */Dn(Jt,{mode:Lo,onOpenWebsiteSettings:Ko.openSettings??(()=>{}),onOpenSiteStyles:Ko.openStyles,onSelectNode:pr,onNotify:Nr,onHidePanel:Jr,nodeActions:bt?pe(xt,bt.type):nt})}),
56
+ /* @__PURE__ */Dn(Ye,{side:"right",width:vr.right,min:Ze,max:Ke,defaultWidth:k.right,label:Lt.resizeSettingsPanel,onResize:zr})]}):
57
+ /* @__PURE__ */Dn(L,{side:"right",onShow:Jr})]}),$i.menu]})}))}export{tt as ScreenChrome};
@@ -1,4 +1,4 @@
1
- import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-OHRS7Q3E.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-VWXUMVCD.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
1
+ import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-AFWOZM7K.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-VWXUMVCD.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
2
2
  /* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(a,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
3
3
  return o(n,{align:"start",triggerClassName:"sf-add-card",items:u,trigger:/* @__PURE__ */c(i,{children:[
4
4
  /* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),m.addBlockMenu]})})}export{l as AddBlockRow};
@@ -1 +1 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-OGH6CC3E.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-VWXUMVCD.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as m}from"./chunk-6WY6ZXJG.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.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-Z6PVRXVY.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-Q6AM43CA.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-GG4FGBFR.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:m,copy:j,canvas:n,textStyles:o,screen:t},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-OGH6CC3E.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-VWXUMVCD.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.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-Z6PVRXVY.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-Q6AM43CA.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-GG4FGBFR.js";var F={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},a=o=>"object"==typeof o&&null!==o;function Y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?Y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?Y(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
@@ -1,7 +1,7 @@
1
- import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-UB5JFMRN.js";import{ScreenChrome as e}from"./chunk-2PTAR4TA.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-GCCBEY2W.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-VWXUMVCD.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var C=r(n),k=r(e);function N({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const C=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
1
+ import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-MJESMPQT.js";import{ScreenChrome as e}from"./chunk-AUSN7RET.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-GCCBEY2W.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-VWXUMVCD.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var C=r(n),k=r(e);function N({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const C=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
2
2
  return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
3
3
  /* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
4
4
  /* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
5
5
  /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{C()},children:i.save})]}),children:i.body})}function j({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
6
- return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function A({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),A=t(()=>s(!g),[g]),M=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
- /* @__PURE__ */u(C,{config:r,data:i,onChange:h,permissions:A,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:M.waitingForAuthorization})}export{A as DocumentScreen,j as ScreenMount};
6
+ return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function M({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),M=t(()=>s(!g),[g]),A=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:A.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
+ /* @__PURE__ */u(C,{config:r,data:i,onChange:h,permissions:M,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:A.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:A.waitingForAuthorization})}export{M as DocumentScreen,j as ScreenMount};
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-OHRS7Q3E.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-I55LUW3C.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
1
+ import{ScreenPartsProvider as t}from"./chunk-AFWOZM7K.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-I55LUW3C.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
2
2
  return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
@@ -1 +1 @@
1
- import{useEaselSession as e}from"./chunk-O7Q4DDJT.js";import{ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useHostEscape as t}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-VWXUMVCD.js";import{styleMenuItems as l}from"./chunk-V7U33NF2.js";import{EaselMenuItems as r,menuLabel as i}from"./chunk-EA2HTX37.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{isTypingTarget as u,useCanvasEvent as d,framePointToHost as p}from"./chunk-ILXP5VX5.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as h}from"./chunk-KRXQM65X.js";import{useState as y,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,PasteIcon as C,SettingsIcon as z,LayersIcon as P,CopyIcon as O}from"efficient-shell/icons/efficient";import{jsx as A}from"react/jsx-runtime";function D(e,t){const o=[],l=/* @__PURE__ */new Set;let r={zone:t.zone,index:t.index};for(;r;){const t=e.nodeAt(r.zone,r.index);if(!t||l.has(t.props.id))break;if(l.add(t.props.id),o.push({zone:r.zone,index:r.index,node:t,parentType:null}),r.zone===n)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var X=c(),K=/* @__PURE__ */new WeakMap;function j(e){if(e.claimsPage)return X;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",c);let t=K.get(n);return t||(t=c(),K.set(n,t)),t}function M(){return j(e())}function S(e,t,o){if(t===n){const{floor:n,cap:t}=e.sectionBand();return{parentId:h,slot:m,index:Math.min(Math.max(o,n),t)}}const l=t.lastIndexOf(":");return{parentId:t.slice(0,l),slot:t.slice(l+1),index:o}}function T(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function V(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?S(e,t.zone,t.index+1):null;for(const l of D(e,t)){const t=S(e,l.zone,l.index+1);if(o(n,t))return t}return null}function E(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(u(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key||"Backspace"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function L(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=T(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:V(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function I(e,t){const{zone:o,index:r}=t,i=e.nodeAt(o,r);if(!i)return[];const c=i.props.id,a=e.labelOf(i.type,o),u=Boolean(i.props._hidden),d=e.nodeOps,p=e.isPinned(i,o),f=e.isLocked(i),m=!p&&!f&&!e.duplicateBlocked(i),h=e.permits?.(i)??{duplicate:!0,delete:!0},y=T(e,i,o),k=D(e,t),b=d.held,v=b&&!p?V(e,b,t):null,g=!e.readOnly,w=e.style?l({held:g?e.style.held():null,canCopy:e.style.canCopy(i,o),onCopy:()=>e.style?.copy(i,o),onPaste:()=>e.style?.paste(o,r,i),words:e.words?.styleClipboard}):[];return s({title:a,words:e.words?.menu,layer:{group:"pick",items:k.flatMap((t,o)=>{const l={label:e.rowNameOf(t.node,t.zone),checked:0===o,onClick:()=>e.selectAt(t.zone,t.index,t.node.props.id,t.parentType)},r=t.zone===n?null:e.slotRung?.(t.zone)??null;return r?[l,{label:r.label,checked:!1,onClick:r.select}]:[l]})},actions:{duplicate:g&&m&&h.duplicate?()=>d.duplicate(c):void 0,moveUp:g&&d.canStep(c,-1)?()=>d.step(c,-1):void 0,moveDown:g&&d.canStep(c,1)?()=>d.step(c,1):void 0,copy:y.copy?()=>d.copy(c,a):void 0,cut:g&&y.cut?()=>d.cut(c,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:g&&e.renamePropOf(i,o)?()=>e.beginRename(o,r):void 0,hide:!g||f||p?void 0:{hidden:u,run:()=>d.setProps(c,{_hidden:!u})},delete:g&&m&&h.delete?()=>d.remove(c):void 0},style:w,extras:e.menuRows?.(i,o,r)??void 0,pinnedLine:p?R(e).pinned:void 0})}var R=e=>e.words?.screen??o.menu;function U(e){const t=R(e),l=!e.readOnly,r=[];l&&e.history.hasPast&&r.push({label:t.undo,icon:/* @__PURE__ */A(w,{}),shortcut:"⌘Z",onClick:e.history.back}),l&&e.history.hasFuture&&r.push({label:t.redo,icon:/* @__PURE__ */A(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=[],c=e.nodeOps.held,s=S(e,n,e.sectionBand().cap);if(l&&c&&(e.canPasteAt?e.canPasteAt(c,s):f(c.from)===n)){const n=s,t=e.words?.menu??a;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[r,i,[{label:e.pageSettingsLabel??o.pageSettings,icon:/* @__PURE__ */A(z,{}),onClick:e.openPageSettings},{label:t.collapseAll,icon:/* @__PURE__ */A(P,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function B(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??a,c=R(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */A(O,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */A(O,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const u=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function Y(e){return e.shiftKey}function N(e,n){const[o,l]=y(null),r=k(()=>l(null),[]);t(null!==o,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=E(e);if(!o)return;const l=t.selected();if(!l)return;const r=L(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),d(n,"keydown",c);const a=k(n=>{if(Y(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);d(n,"contextmenu",t=>{if(Y(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;t.preventDefault();const c=p(n.frame,t.clientX,t.clientY),s=n.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),d(n,"mousedown",r),d(n,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:o?/* @__PURE__ */A(F,{host:e,target:o,onClose:r}):null,closeMenu:r}}function F({host:e,target:n,onClose:t}){const o="node"===n.kind?I(e,n):"input"===n.kind?B(e,n.el):U(e);return 0===o.length?null:/* @__PURE__ */A(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":i(o),children:/* @__PURE__ */A(r,{items:o,onClose:t})})}export{X as EASEL_NODE_CLIPBOARD,D as ancestorChain,j as nodeClipboardOf,T as nodeClipboardRules,I as nodeMenuItems,E as nodeShortcut,U as pageMenuItems,V as pastePlace,L as runNodeShortcut,B as textMenuItems,M as useNodeClipboard,N as useNodeContextMenu};
1
+ import{styleMenuItems as e}from"./chunk-V7U33NF2.js";import{useEaselSession as n}from"./chunk-O7Q4DDJT.js";import{ROOT_ZONE as t}from"./chunk-PLVEGYK6.js";import{useHostEscape as o}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-VWXUMVCD.js";import{EaselMenuItems as r,menuLabel as i}from"./chunk-EA2HTX37.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{isTypingTarget as u,useCanvasEvent as d,framePointToHost as p}from"./chunk-ILXP5VX5.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as h}from"./chunk-KRXQM65X.js";import{useState as y,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,PasteIcon as C,SettingsIcon as z,LayersIcon as P,CopyIcon as O}from"efficient-shell/icons/efficient";import{jsx as A}from"react/jsx-runtime";function D(e,n){const o=[],l=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||l.has(n.props.id))break;if(l.add(n.props.id),o.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===t)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var X=c(),K=/* @__PURE__ */new WeakMap;function j(e){if(e.claimsPage)return X;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",c);let t=K.get(n);return t||(t=c(),K.set(n,t)),t}function M(){return j(n())}function S(e,n,o){if(n===t){const{floor:n,cap:t}=e.sectionBand();return{parentId:h,slot:m,index:Math.min(Math.max(o,n),t)}}const l=n.lastIndexOf(":");return{parentId:n.slice(0,l),slot:n.slice(l+1),index:o}}function T(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function V(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?S(e,t.zone,t.index+1):null;for(const l of D(e,t)){const t=S(e,l.zone,l.index+1);if(o(n,t))return t}return null}function E(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(u(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key||"Backspace"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function L(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=T(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:V(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function I(n,o){const{zone:l,index:r}=o,i=n.nodeAt(l,r);if(!i)return[];const c=i.props.id,a=n.labelOf(i.type,l),u=Boolean(i.props._hidden),d=n.nodeOps,p=n.isPinned(i,l),f=n.isLocked(i),m=!p&&!f&&!n.duplicateBlocked(i),h=n.permits?.(i)??{duplicate:!0,delete:!0},y=T(n,i,l),k=D(n,o),b=d.held,v=b&&!p?V(n,b,o):null,g=!n.readOnly,w=n.style?e({held:g?n.style.held():null,canCopy:n.style.canCopy(i,l),onCopy:()=>n.style?.copy(i,l),onPaste:()=>n.style?.paste(l,r,i),words:n.words?.styleClipboard}):[];return s({title:a,words:n.words?.menu,layer:{group:"pick",items:k.flatMap((e,o)=>{const l={label:n.rowNameOf(e.node,e.zone),checked:0===o,onClick:()=>n.selectAt(e.zone,e.index,e.node.props.id,e.parentType)},r=e.zone===t?null:n.slotRung?.(e.zone)??null;return r?[l,{label:r.label,checked:!1,onClick:r.select}]:[l]})},actions:{duplicate:g&&m&&h.duplicate?()=>d.duplicate(c):void 0,moveUp:g&&d.canStep(c,-1)?()=>d.step(c,-1):void 0,moveDown:g&&d.canStep(c,1)?()=>d.step(c,1):void 0,copy:y.copy?()=>d.copy(c,a):void 0,cut:g&&y.cut?()=>d.cut(c,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:g&&n.renamePropOf(i,l)?()=>n.beginRename(l,r):void 0,hide:!g||f||p?void 0:{hidden:u,run:()=>d.setProps(c,{_hidden:!u})},delete:g&&m&&h.delete?()=>d.remove(c):void 0},style:w,extras:n.menuRows?.(i,l,r)??void 0,pinnedLine:p?R(n).pinned:void 0})}var R=e=>e.words?.screen??l.menu;function U(e){const n=R(e),o=!e.readOnly,r=[];o&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */A(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */A(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=[],c=e.nodeOps.held,s=S(e,t,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):f(c.from)===t)){const n=s,t=e.words?.menu??a;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[r,i,[{label:e.pageSettingsLabel??l.pageSettings,icon:/* @__PURE__ */A(z,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */A(P,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function B(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??a,c=R(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */A(O,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */A(O,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const u=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function Y(e){return e.shiftKey}function N(e,n){const[t,l]=y(null),r=k(()=>l(null),[]);o(null!==t,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=E(e);if(!o)return;const l=t.selected();if(!l)return;const r=L(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),d(n,"keydown",c);const a=k(n=>{if(Y(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);d(n,"contextmenu",t=>{if(Y(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;t.preventDefault();const c=p(n.frame,t.clientX,t.clientY),s=n.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),d(n,"mousedown",r),d(n,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:t?/* @__PURE__ */A(F,{host:e,target:t,onClose:r}):null,closeMenu:r}}function F({host:e,target:n,onClose:t}){const o="node"===n.kind?I(e,n):"input"===n.kind?B(e,n.el):U(e);return 0===o.length?null:/* @__PURE__ */A(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":i(o),children:/* @__PURE__ */A(r,{items:o,onClose:t})})}export{X as EASEL_NODE_CLIPBOARD,D as ancestorChain,j as nodeClipboardOf,T as nodeClipboardRules,I as nodeMenuItems,E as nodeShortcut,U as pageMenuItems,V as pastePlace,L as runNodeShortcut,B as textMenuItems,M as useNodeClipboard,N as useNodeContextMenu};
@@ -1 +1 @@
1
- import{useSectionOps as o}from"./chunk-PQMCHTVE.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-OHRS7Q3E.js";import{useEasel as p}from"./chunk-I55LUW3C.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 h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
1
+ import{useSectionOps as o}from"./chunk-Z23YOUF5.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-AFWOZM7K.js";import{useEasel as p}from"./chunk-I55LUW3C.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 h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
@@ -0,0 +1,5 @@
1
+ import{buildPaletteSections as e,pinnedSection as t,categoryLabel as o}from"./chunk-PA3PNTVV.js";import{blockTypesIn as n}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as i,PanelModeExit as r}from"./chunk-PPL7GB7D.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as c}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as a,useScreenBlockRules as p}from"./chunk-AFWOZM7K.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-VWXUMVCD.js";import{useEasel as d}from"./chunk-I55LUW3C.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{AddPanel as y}from"./chunk-47RGVCPH.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-GG4FGBFR.js";import{useState as u,useEffect as k,useMemo as b}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as j,jsxs as v,Fragment as V}from"react/jsx-runtime";var B=e=>`section:${e}`,O=e=>`block:${e}`,$=e=>`template:${e}`;function w({at:w,placeBlocks:C,canTake:F,onPick:G,itemFor:I,session:L,siteWide:P,onClose:R,onHide:W,readOnly:x}){const A=d(e=>e.config),D=a(),{labelAtLevel:E,categoryLabel:H,firstSection:T,Icon:M,Thumbnail:N}=D,{blockIsOffered:z,canAddTo:K}=p(),Q=f("screen",m).add,S=f("drag",h).add,U=l(),[Y,Z]=u([]);k(()=>{let e=!1;const t=e=>z(e,U);return s(U).list().then(o=>{if(e)return;const s=A.components;Z(o.filter(e=>e.node?.type&&s[e.node.type]&&n(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[A,U]);const J=b(()=>e(A,D),[A]),X=e=>({type:B(e.type),label:e.name,cover:/* @__PURE__ */j(N,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:Q.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),q=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=Y.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null},_=e=>/* @__PURE__ */j("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */j(M,{type:e,size:26})}),ee=b(()=>{const e=t(J,T),n=/* @__PURE__ */new Map,s=e=>{!n.has(e.type)&&z(e.type,U)&&n.set(e.type,e)};for(const t of e?[e]:J){const e=K(t.type)?.choices??[];e.forEach(s),e.forEach(e=>K(e.type,1)?.choices?.forEach(s))}C?.forEach(s);const i=new Set(J.map(e=>e.type)),r=[...n.values()].filter(e=>!i.has(e.type)),l=e=>({type:O(e.type),label:e.label,cover:_(e.type),title:Q.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>n.has(e.type)?{...X(e),cover:_(e.type)}:X(e),p=[];Y.length>0&&p.push({key:"templates",title:Q.templates,tiles:Y.map(e=>{return{type:$(e.id),label:e.name,cover:/* @__PURE__ */j(N,{type:e.node.type}),keywords:[(t=e.node.type,E(t,"section",A.components[t]?.label??t)),e.node.type]};var t})});const m=r.filter(e=>!e.group);let d=!1;for(const t of Object.keys(A.categories??{})){const n=J.filter(e=>e.cat===t);if(0===n.length)continue;const s=e&&n.some(t=>t.type===e.type)?e:null,i=(s?[s,...n.filter(e=>e.type!==s.type)]:n).map(a);s&&!d&&(i.splice(1,0,...m.map(l)),d=!0),p.push({key:`category:${t}`,title:o(A,t,H),tiles:i})}const f=p.find(e=>e.key?.startsWith("category:"));if(!d&&f&&m.length>0&&(f.tiles=[...f.tiles,...m.map(l)],d=!0),c(r.filter(e=>e.group||!d)).forEach((e,t)=>{p.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(l)})}),!F)return p;const y=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=q(e.type),o=t?F(t):null;return o?{...e,disabled:!0,disabledReason:o}:e})})),h=e=>e.tiles.some(e=>!e.disabled);return[...y.filter(h),...y.filter(e=>!h(e))]},[Y,J,A,Q,F,C,U]);/* @__PURE__ */
2
+ return v(V,{children:[
3
+ /* @__PURE__ */j(i,{icon:/* @__PURE__ */j(g,{size:15}),title:Q.title,context:Q.contextAll,actions:/* @__PURE__ */j(r,{label:Q.done,description:Q.doneDescription,onClick:R}),onHide:W}),
4
+ /* @__PURE__ */v("div",{className:"sf-addside sf-scroll",children:[
5
+ /* @__PURE__ */j(y,{groups:ee,session:L,itemFor:e=>I(q(e)??{kind:"section",type:e}),onInsert:G?e=>{const t=q(e);t&&G(t)}:void 0,at:w,hint:Q.hint,searchLabel:Q.search,readOnly:x,words:S}),P??null]})]})}export{w as AddSidePanel,O as blockKey,B as sectionKey,$ as templateKey};
@@ -1 +1 @@
1
- import{useScreenBlockRules as e}from"./chunk-OHRS7Q3E.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-I55LUW3C.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
1
+ import{useScreenBlockRules as e}from"./chunk-AFWOZM7K.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-I55LUW3C.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
@@ -1,4 +1,4 @@
1
- import{selectionToVisible as e,selectionToSource as t,richLayout as n,createHistory as r,colorRunOf as l,textRange as a,selectionBox as o,placeWindow as s,offsetOrigin as i,visibleArea as c,ColorWindow as u,markPress as d,pasteToMarkup as p,richInput as h,editVisible as f,MARKUP_CLIPBOARD_TYPE as m,markupOfRange as g}from"../chunk-FGJSCWUN.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-FGJSCWUN.js";import{DEFAULT_COPY_WORDS as y}from"../chunk-Q6AM43CA.js";import{FieldNumber as v}from"../chunk-66LWADFP.js";import{FieldSelect as b}from"../chunk-65Z5FSAW.js";import"../chunk-FFYXVAAL.js";import{SettingsSegmented as k,SettingsSwitch as S,SettingsField as x}from"../chunk-XJCMEEBH.js";import{GoldTextInput as w}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as E,applyMark as C,markupTools as D,marksIn as N,STANDARD_MARKUP as L,findLink as O,markedAt as T,listIn as z,colorIn as F,spanFor as P,clearStyle as M,toggleMark as R,colorOver as B,setList as K,unlinkAt as j,removeLink as $,linkOver as H,writeLink as V}from"../chunk-546BBOPE.js";import{useWords as A}from"../chunk-MFIRYGHW.js";import{withTip as W}from"../chunk-P2VEMZH5.js";import{IconButton as U,registerModalEscapeInterceptor as I,textToolbarRows as q,TextToolbar as Y,Button as G,LinkPicker as J,Tooltip as Z}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as _,useState as X,useLayoutEffect as Q,useEffect as ee,useId as te}from"react";import{AlignJustifyIcon as ne,AlignRightIcon as re,AlignCenterIcon as le,AlignLeftIcon as ae,ParagraphSpacingIcon as oe,LetterSpacingIcon as se,LineSpacingIcon as ie,TextSizeIcon as ce,ClearMarksIcon as ue,StylesIcon as de,TypeIcon as pe,AlignmentIcon as he,ListFormatIcon as fe,CaseIcon as me,ItalicIcon as ge,LinkIcon as ye,QuietIcon as ve,EmphasisIcon as be,StrikeIcon as ke,BoldIcon as Se,NumberedListIcon as xe,ListIcon as we,ListNoneIcon as Ee,CaseLowerIcon as Ce,CaseCapitalizedIcon as De,CaseUpperIcon as Ne,CaseNormalIcon as Le}from"efficient-shell/icons/efficient";import{jsx as Oe,jsxs as Te,Fragment as ze}from"react/jsx-runtime";var Fe=["left","center","right","justify"],Pe=y.align,Me={left:/* @__PURE__ */Oe(ae,{}),center:/* @__PURE__ */Oe(le,{}),right:/* @__PURE__ */Oe(re,{}),justify:/* @__PURE__ */Oe(ne,{})},Re={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function Be(e,t=Pe){return Fe.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:Me[e],title:t[e]}))}var Ke=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function je(e){if(e.every(e=>e.label===Pe[e.id]))return e.length>3?Re.four:Re.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(Ke.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function $e(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function He(e,t,n,r=C){const{start:l,end:a}=$e(e,n);return r(e,l,a,t)}function Ve(e,t,n){const{start:r,end:l}=$e(e,n),a=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:a,selectionEnd:a}}function Ae(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function We(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const a=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===a)return 0;const o=t.ownerDocument.createRange();o.setStart(e.lines[a],0);try{o.setEnd(n,r)}catch{return l[a].vis}return l[a].vis+Math.min(o.toString().length,l[a].text.length)}function Ue(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const a=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let o=a.nextNode(),s=null;for(;o;){if(l<=o.data.length)return[o,l];l-=o.data.length,s=o,o=a.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Ie({value:r,rules:l,multiline:a,readOnly:o=!1,placeholder:s,ariaLabel:i,handle:c,onEdit:u,onSelect:d,onHistory:y,onFormat:v,pending:b,onCommit:k,onCancel:S}){const x=_(null),w=_(null),E=_(null),C=_(null),D=_(null),N=_(r),[L,O]=X(0),T=_({value:r,rules:l,multiline:a,readOnly:o,pending:b,onEdit:u,onHistory:y,onFormat:v});T.current={value:r,rules:l,multiline:a,readOnly:o,pending:b,onEdit:u,onHistory:y,onFormat:v};const z=()=>{const e=x.current,t=w.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=We(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?We(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},F=(e,t)=>{const n=x.current,r=w.current;if(!n||!r)return;const[l,a]=Ue(r,e),[o,s]=Ue(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,a,o,s)};c.current={getSource(){const e=z(),n=w.current;if(!e||!n)return null;const[r,l]=t(n.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},O(e=>e+1)},focus(){x.current?.focus()},rangeOf(t,n){const r=x.current,l=w.current;if(!r||!l)return null;const[a,o]=e(l.layout,t,n),[s,i]=Ue(l,a),[c,u]=Ue(l,o),d=r.ownerDocument.createRange();return d.setStart(s,i),d.setEnd(c,u),d}},Q(()=>{const t=x.current;if(!t||D.current)return;const a=C.current?null:z();w.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],a=()=>l.length?l[l.length-1].el:r;let o=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(o=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Ae(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);a().appendChild(t),l.push({id:e.marks[r].id,el:t})}o||(o=n.createTextNode(""),a().appendChild(o)),o.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(t,n(r,l)),E.current=r;const o=C.current;if(!o||o.text!==r)return void(a&&t.ownerDocument.activeElement===t&&F(a[0],Math.min(a[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[i,c]=o.vis??e(s,o.src[0],o.src[1]);t.ownerDocument.activeElement!==t&&t.focus(),F(i,c)},[r,l,L]);const P=(e,n,r)=>{const l=w.current,[a,o]=t(l.layout,n[0],n[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==T.current.value?T.current.onEdit(e.text,{start:a,end:o},r):O(e=>e+1)};ee(()=>{const e=x.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:a,pending:o}=T.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),a)return;const s=w.current,i=z();if(!s||!i)return;const c="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=c&&!c.collapsed?[We(s,e,c.startContainer,c.startOffset),We(s,e,c.endContainer,c.endOffset)]:null,d=h({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:i,target:u,pending:o});d&&("history"!==d.kind?"format"!==d.kind?P(d.edit,d.range,d.kind):T.current.onFormat(d.style):T.current.onHistory(d.dir))},n=()=>{D.current||O(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),ee(()=>{const e=x.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=c.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const M=(e,t=!1)=>{const n=z();if(!n||n[0]===n[1])return;e.preventDefault();const a=w.current;e.clipboardData.setData("text/plain",a.layout.text.slice(n[0],n[1])),e.clipboardData.setData(m,g(r,l,n[0],n[1])),t&&!o&&P(f(r,l,n[0],n[1],{text:""}),n,"edit")};/* @__PURE__ */
1
+ import{selectionToVisible as e,selectionToSource as t,richLayout as n,createHistory as r,colorRunOf as l,textRange as a,selectionBox as o,placeWindow as s,offsetOrigin as i,visibleArea as c,ColorWindow as u,markPress as d,pasteToMarkup as p,richInput as h,editVisible as f,MARKUP_CLIPBOARD_TYPE as m,markupOfRange as g}from"../chunk-FGJSCWUN.js";export{ColorWindow,MARKUP_CLIPBOARD_TYPE,TYPING_BURST_MS,colorRunOf,createHistory,editVisible,markupOfRange,newLine,pasteToMarkup,richInput,richLayout,selectionToSource,selectionToVisible,setBullet,startCanvasTyping,textMap,toSource,toSourceStart,toVisible}from"../chunk-FGJSCWUN.js";import{DEFAULT_COPY_WORDS as y}from"../chunk-Q6AM43CA.js";import{FieldNumber as v}from"../chunk-66LWADFP.js";import{FieldSelect as b}from"../chunk-65Z5FSAW.js";import{SettingsSegmented as k,SettingsSwitch as S,SettingsField as x}from"../chunk-XJCMEEBH.js";import"../chunk-FFYXVAAL.js";import{GoldTextInput as w}from"../chunk-2FZJWH24.js";import{RETIRED_MARKS as E,applyMark as C,markupTools as D,marksIn as N,STANDARD_MARKUP as L,findLink as O,markedAt as T,listIn as z,colorIn as F,spanFor as P,clearStyle as M,toggleMark as R,colorOver as B,setList as K,unlinkAt as j,removeLink as $,linkOver as H,writeLink as V}from"../chunk-546BBOPE.js";import{useWords as A}from"../chunk-MFIRYGHW.js";import{withTip as W}from"../chunk-P2VEMZH5.js";import{IconButton as U,registerModalEscapeInterceptor as I,textToolbarRows as q,TextToolbar as Y,Button as G,LinkPicker as J,Tooltip as Z}from"efficient-shell/ui";export{TextToolbar}from"efficient-shell/ui";import{useRef as _,useState as X,useLayoutEffect as Q,useEffect as ee,useId as te}from"react";import{AlignJustifyIcon as ne,AlignRightIcon as re,AlignCenterIcon as le,AlignLeftIcon as ae,ParagraphSpacingIcon as oe,LetterSpacingIcon as se,LineSpacingIcon as ie,TextSizeIcon as ce,ClearMarksIcon as ue,StylesIcon as de,TypeIcon as pe,AlignmentIcon as he,ListFormatIcon as fe,CaseIcon as me,ItalicIcon as ge,LinkIcon as ye,QuietIcon as ve,EmphasisIcon as be,StrikeIcon as ke,BoldIcon as Se,NumberedListIcon as xe,ListIcon as we,ListNoneIcon as Ee,CaseLowerIcon as Ce,CaseCapitalizedIcon as De,CaseUpperIcon as Ne,CaseNormalIcon as Le}from"efficient-shell/icons/efficient";import{jsx as Oe,jsxs as Te,Fragment as ze}from"react/jsx-runtime";var Fe=["left","center","right","justify"],Pe=y.align,Me={left:/* @__PURE__ */Oe(ae,{}),center:/* @__PURE__ */Oe(le,{}),right:/* @__PURE__ */Oe(re,{}),justify:/* @__PURE__ */Oe(ne,{})},Re={three:{labelsPx:94.5,widestLabelPx:39.94},four:{labelsPx:140,widestLabelPx:44}};function Be(e,t=Pe){return Fe.filter(t=>e.includes(t)).map(e=>({id:e,label:t[e],icon:Me[e],title:t[e]}))}var Ke=/[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/;function je(e){if(e.every(e=>e.label===Pe[e.id]))return e.length>3?Re.four:Re.three;const t=e.map(e=>[...e.label].reduce((e,t)=>e+(Ke.test(t)?13:8),0));return{labelsPx:t.reduce((e,t)=>e+t,0),widestLabelPx:Math.max(0,...t)}}function $e(e,t){const n=t?.selectionStart??e.length;return{start:n,end:t?.selectionEnd??n}}function He(e,t,n,r=C){const{start:l,end:a}=$e(e,n);return r(e,l,a,t)}function Ve(e,t,n){const{start:r,end:l}=$e(e,n),a=r+t.length;return{text:e.slice(0,r)+t+e.slice(l),selectionStart:a,selectionEnd:a}}function Ae(e,t,n,r){switch(t){case"bold":return e.createElement("strong");case"italic":return e.createElement("em");case"strike":return e.createElement("s");case"underline":return e.createElement("u");case"sup":return e.createElement("sup");case"sub":return e.createElement("sub");case"color":{const t=e.createElement("span");return t.className="es-rich-color",r&&(t.dataset.color=r,t.title=r.startsWith("#")?r.toUpperCase():r,t.style.color=r.startsWith("#")?r:`var(--es-color-${r}, inherit)`),t}case"link":{const t=e.createElement("a");return t.className="es-rich-link",n&&(t.title=n),t}default:{const n=e.createElement("span");return n.className="highlight"===t||"accent"===t?"es-rich-emphasis":`es-rich-${t}`,n}}}function We(e,t,n,r){const l=e.layout.lines;if(n===t)return r>=e.lines.length?e.layout.text.length:l[r].vis;const a=e.lines.findIndex(e=>e===n||e.contains(n));if(-1===a)return 0;const o=t.ownerDocument.createRange();o.setStart(e.lines[a],0);try{o.setEnd(n,r)}catch{return l[a].vis}return l[a].vis+Math.min(o.toString().length,l[a].text.length)}function Ue(e,t){const n=e.layout.lines;let r=n.length-1;for(let e=0;e<n.length;e+=1)if(t<=n[e].vis+n[e].text.length){r=e;break}let l=Math.max(0,t-n[r].vis);const a=e.lines[r].ownerDocument.createTreeWalker(e.lines[r],4);let o=a.nextNode(),s=null;for(;o;){if(l<=o.data.length)return[o,l];l-=o.data.length,s=o,o=a.nextNode()}return s?[s,s.data.length]:[e.lines[r],0]}function Ie({value:r,rules:l,multiline:a,readOnly:o=!1,placeholder:s,ariaLabel:i,handle:c,onEdit:u,onSelect:d,onHistory:y,onFormat:v,pending:b,onCommit:k,onCancel:S}){const x=_(null),w=_(null),E=_(null),C=_(null),D=_(null),N=_(r),[L,O]=X(0),T=_({value:r,rules:l,multiline:a,readOnly:o,pending:b,onEdit:u,onHistory:y,onFormat:v});T.current={value:r,rules:l,multiline:a,readOnly:o,pending:b,onEdit:u,onHistory:y,onFormat:v};const z=()=>{const e=x.current,t=w.current,n=e?.ownerDocument.getSelection();if(!(e&&t&&n&&0!==n.rangeCount&&n.anchorNode&&e.contains(n.anchorNode)))return null;const r=We(t,e,n.anchorNode,n.anchorOffset),l=n.focusNode&&e.contains(n.focusNode)?We(t,e,n.focusNode,n.focusOffset):r;return r<=l?[r,l]:[l,r]},F=(e,t)=>{const n=x.current,r=w.current;if(!n||!r)return;const[l,a]=Ue(r,e),[o,s]=Ue(r,t);n.ownerDocument.getSelection()?.setBaseAndExtent(l,a,o,s)};c.current={getSource(){const e=z(),n=w.current;if(!e||!n)return null;const[r,l]=t(n.layout,e[0],e[1]);return{start:r,end:l}},setSource(e,t,n){C.current={text:n,src:[e,t]},O(e=>e+1)},focus(){x.current?.focus()},rangeOf(t,n){const r=x.current,l=w.current;if(!r||!l)return null;const[a,o]=e(l.layout,t,n),[s,i]=Ue(l,a),[c,u]=Ue(l,o),d=r.ownerDocument.createRange();return d.setStart(s,i),d.setEnd(c,u),d}},Q(()=>{const t=x.current;if(!t||D.current)return;const a=C.current?null:z();w.current=function(e,t){const n=e.ownerDocument;e.replaceChildren();const r=t.lines.map(t=>{const r=n.createElement("div");r.className=null!=t.number?"es-rich-line is-numbered":t.bullet?"es-rich-line is-bullet":"es-rich-line",null!=t.number&&(r.dataset.number=t.number);const l=[],a=()=>l.length?l[l.length-1].el:r;let o=null;for(const e of t.chars){let t=0;for(;t<l.length&&t<e.marks.length&&l[t].id===e.marks[t].id;)t+=1;(l.length>t||e.marks.length>t)&&(o=null),l.length=t;for(let r=t;r<e.marks.length;r+=1){const t=Ae(n,e.marks[r].kind,e.marks[r].href,e.marks[r].color);a().appendChild(t),l.push({id:e.marks[r].id,el:t})}o||(o=n.createTextNode(""),a().appendChild(o)),o.data+=e.ch}return 0===t.chars.length&&r.appendChild(n.createElement("br")),e.appendChild(r),r});return{layout:t,lines:r}}(t,n(r,l)),E.current=r;const o=C.current;if(!o||o.text!==r)return void(a&&t.ownerDocument.activeElement===t&&F(a[0],Math.min(a[1],w.current.layout.text.length)));C.current=null;const s=w.current.layout,[i,c]=o.vis??e(s,o.src[0],o.src[1]);t.ownerDocument.activeElement!==t&&t.focus(),F(i,c)},[r,l,L]);const P=(e,n,r)=>{const l=w.current,[a,o]=t(l.layout,n[0],n[1]);C.current={text:e.text,vis:[e.caret,e.caret]},e.text!==T.current.value?T.current.onEdit(e.text,{start:a,end:o},r):O(e=>e+1)};ee(()=>{const e=x.current;if(!e)return;const t=t=>{const{value:n,rules:r,multiline:l,readOnly:a,pending:o}=T.current;if("insertCompositionText"===t.inputType)return;if(t.preventDefault(),a)return;const s=w.current,i=z();if(!s||!i)return;const c="function"==typeof t.getTargetRanges?t.getTargetRanges()[0]:void 0,u=c&&!c.collapsed?[We(s,e,c.startContainer,c.startOffset),We(s,e,c.endContainer,c.endOffset)]:null,d=h({value:n,rules:r,multiline:l,inputType:t.inputType,data:t.data??t.dataTransfer?.getData("text/plain")??"",html:t.dataTransfer?.getData("text/html"),doc:e.ownerDocument,sel:i,target:u,pending:o});d&&("history"!==d.kind?"format"!==d.kind?P(d.edit,d.range,d.kind):T.current.onFormat(d.style):T.current.onHistory(d.dir))},n=()=>{D.current||O(e=>e+1)};return e.addEventListener("beforeinput",t),e.addEventListener("input",n),()=>{e.removeEventListener("beforeinput",t),e.removeEventListener("input",n)}},[]),ee(()=>{const e=x.current;if(!e)return;const t=e.ownerDocument,n=()=>{const e=c.current?.getSource();e&&d(e)};return t.addEventListener("selectionchange",n),()=>t.removeEventListener("selectionchange",n)});const M=(e,t=!1)=>{const n=z();if(!n||n[0]===n[1])return;e.preventDefault();const a=w.current;e.clipboardData.setData("text/plain",a.layout.text.slice(n[0],n[1])),e.clipboardData.setData(m,g(r,l,n[0],n[1])),t&&!o&&P(f(r,l,n[0],n[1],{text:""}),n,"edit")};/* @__PURE__ */
2
2
  return Te("div",{className:"es-rich-wrap",children:[s&&""===r?/* @__PURE__ */Oe("div",{className:"es-rich-placeholder","aria-hidden":"true",children:s}):null,
3
3
  /* @__PURE__ */Oe("div",{ref:x,className:`es-rich${a?" is-multiline":" is-single"}${o?" is-off":""}`,contentEditable:!o,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":a,"aria-label":i,"aria-readonly":o||void 0,"aria-placeholder":s,tabIndex:o?-1:0,spellCheck:!0,onFocus:()=>{N.current=r},onBlur:()=>{r!==N.current&&k?.(r),N.current=r},onKeyDown:e=>{if("Escape"===e.key)return e.preventDefault(),S?.(N.current),void(N.current=r);"Enter"!==e.key||a||(e.preventDefault(),r!==N.current&&k?.(r),N.current=r)},onCompositionStart:()=>{const e=z()??[0,0];D.current={from:e[0],to:e[1]}},onCompositionEnd:e=>{const t=D.current;if(D.current=null,!t)return;const{value:n,rules:r,pending:l}=T.current;e.data?P(f(n,r,t.from,t.to,{text:e.data,add:l?.add,drop:l?.drop,color:l?.color}),[t.from,t.to],"type"):O(e=>e+1)},onCopy:e=>M(e),onCut:e=>M(e,!0),onPaste:e=>{if(e.preventDefault(),o)return;const t=z();if(!t)return;const n=e.clipboardData.getData(m),s=n?a?n:n.replace(/\s*\r?\n\s*/g," "):p({html:e.clipboardData.getData("text/html"),text:e.clipboardData.getData("text/plain")},{doc:e.currentTarget.ownerDocument,multiline:a,rules:l});P(f(r,l,t[0],t[1],{markup:s}),t,"edit")}})]})}var qe={fontSize:{key:"fontSize",nameKey:"fontSize",icon:/* @__PURE__ */Oe(ce,{}),unit:"px",step:1,shiftStep:10,min:5},lineHeight:{key:"lineHeight",nameKey:"lineHeight",icon:/* @__PURE__ */Oe(ie,{}),unit:"%",step:1,shiftStep:10,min:50,max:250,scale:100},letterSpacing:{key:"letterSpacing",nameKey:"letterSpacing",icon:/* @__PURE__ */Oe(se,{}),unit:"px",step:.1,shiftStep:1,min:-10},paragraphSpacing:{key:"paragraphSpacing",nameKey:"paragraphSpacing",icon:/* @__PURE__ */Oe(oe,{}),unit:"px",step:1,shiftStep:10,min:0}};function Ye(e,t){return void 0===e?void 0:Number((e*t).toFixed(6))}function Ge({cells:e,words:t,readOnly:n=!1}){const r=t??y.cells,l=te();/* @__PURE__ */
4
4
  return Oe("div",{className:"es-copy-cells-fit",children:/* @__PURE__ */Oe("div",{className:"es-copy-cells",children:e.map(e=>{const t=e.scale??1,a=e.name??(e.nameKey?r[e.nameKey]:e.key),o=e.unit??"",s=e.step??1,i=`${l}-${e.key}`;/* @__PURE__ */
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-XAF6J6TB.js";import"../chunk-4JSBIW5H.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";export{FieldSelect,optionFor}from"../chunk-65Z5FSAW.js";import"../chunk-FFYXVAAL.js";import"../chunk-XJCMEEBH.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-26GHWMNN.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";import"../chunk-4JSBIW5H.js";import"../chunk-RC25EGHD.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";export{FieldSelect,optionFor}from"../chunk-65Z5FSAW.js";import"../chunk-XJCMEEBH.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-O66SKO3J.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-OHRS7Q3E.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VWXUMVCD.js";import"../../chunk-I55LUW3C.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-XAF6J6TB.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-FGJSCWUN.js";import"../../chunk-Q6AM43CA.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{AddBlockRow as default}from"../../chunk-EKICPNE4.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-AFWOZM7K.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VWXUMVCD.js";import"../../chunk-I55LUW3C.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-FGJSCWUN.js";import"../../chunk-Q6AM43CA.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1,4 +1 @@
1
- import{Tooltip as e}from"efficient-shell/ui";import{useId as s}from"react";import{jsxs as l,Fragment as i,jsx as a}from"react/jsx-runtime";function r({label:r,blocked:d,onAdd:n,small:t=!1}){const c=null!==d,o=s(),m=/* @__PURE__ */l("button",{type:"button",className:"sf-add-card","aria-disabled":c||void 0,"aria-describedby":c?o:void 0,onClick:c?void 0:n,children:[
2
- /* @__PURE__ */a("span",{className:t?"sf-plus sf-plus--sm":"sf-plus",children:"+"}),r]});return c?/* @__PURE__ */l(i,{children:[
3
- /* @__PURE__ */a(e,{content:d,children:m}),
4
- /* @__PURE__ */a("span",{id:o,className:"es-vh",children:d})]}):m}export{r as default};
1
+ export{AddChildRow as default}from"../../chunk-5545A3PC.js";
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-HUI44HA5.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-OHRS7Q3E.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VWXUMVCD.js";import"../../chunk-I55LUW3C.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-XAF6J6TB.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-FGJSCWUN.js";import"../../chunk-Q6AM43CA.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-47RGVCPH.js";import"../../chunk-GG4FGBFR.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-XQGBZGVP.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-AFWOZM7K.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VWXUMVCD.js";import"../../chunk-I55LUW3C.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-FGJSCWUN.js";import"../../chunk-Q6AM43CA.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-47RGVCPH.js";import"../../chunk-GG4FGBFR.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{MediaSidePanel as default}from"../../chunk-3KAQXJVI.js";import"../../chunk-OHRS7Q3E.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-I55LUW3C.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-XAF6J6TB.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-FGJSCWUN.js";import"../../chunk-Q6AM43CA.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{MediaSidePanel as default}from"../../chunk-6WVCXQJX.js";import"../../chunk-AFWOZM7K.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-I55LUW3C.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-FGJSCWUN.js";import"../../chunk-Q6AM43CA.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-IOZKOGFR.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VWXUMVCD.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-PPHUWGLZ.js";import"../../chunk-V7U33NF2.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-VWXUMVCD.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";