efficient-easel 8.2.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/index.d.ts +10 -1
- package/dist/canvas/index.js +1 -1
- package/dist/chunk-7CIFWFP2.js +57 -0
- package/dist/{chunk-OHMYY3FX.js → chunk-CWTAS5R6.js} +5 -5
- package/dist/{chunk-R2G64ZNC.js → chunk-D6N77AOS.js} +1 -1
- package/dist/{chunk-IZPIXBQQ.js → chunk-DQZYXC3V.js} +1 -1
- package/dist/{chunk-SSORUDHE.js → chunk-FCLW4LEN.js} +7 -7
- package/dist/{chunk-WMQN4PHH.js → chunk-HA33IXEU.js} +1 -1
- package/dist/{chunk-JIKPYPI3.js → chunk-IEKQTWQG.js} +1 -1
- package/dist/chunk-ILXP5VX5.js +1 -0
- package/dist/chunk-K5744MTM.js +11 -0
- package/dist/chunk-KIA6EKAM.js +5 -0
- package/dist/{chunk-5HG62L3A.js → chunk-NOD4ATKF.js} +1 -1
- package/dist/{chunk-YIZ4YXPY.js → chunk-OWW44DVK.js} +1 -1
- package/dist/{chunk-PEDDDWSG.js → chunk-UCLVWF5E.js} +11 -11
- package/dist/{chunk-JSO6F7IY.js → chunk-VF6TCI62.js} +1 -1
- package/dist/{chunk-LGN4F6HL.js → chunk-ZG5T7RSV.js} +3 -3
- package/dist/drag/index.js +1 -1
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.d.ts +5 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +15 -15
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +10 -0
- package/dist/screen/lib/screen-parts.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-66WCYXIN.js +0 -5
- package/dist/chunk-AWJUYMX7.js +0 -1
- package/dist/chunk-E63CSJUL.js +0 -11
- package/dist/chunk-Q6DCUUTQ.js +0 -57
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{FieldSelect as n}from"./chunk-OZ72A6MY.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsGroup as a}from"./chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as r}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as i}from"./chunk-EA2HTX37.js";import{FieldNumber as s}from"./chunk-66LWADFP.js";import{SettingsSegmented as c}from"./chunk-QLD57GBB.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 D}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as I,MoveUpIcon as L,MoveDownIcon as P,DuplicateIcon as F,TrashIcon as A}from"efficient-shell/icons/efficient";function M({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 T(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function H(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 z(e,n){return e.filter((e,l)=>l!==n)}function E(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var R='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function Y({label:n,icon:l,noun:t,items:a,onChange:o,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:M,renderItem:Y,renderRow:K,canRemove:V,lockedReason:G,fixed:J=!1,removeOnRow:Z=!0,canDuplicate:W,above:X,head:q=!0}){const Q=u("fields",d).list,U=u("tree",r),_=t??Q.item,ee=!w&&!J&&("number"!=typeof x||a.length<x),ne=a.length<=k,le=e=>!!V&&!V(a[e],e),te=e=>!w&&!J&&Z&&!ne&&!le(e),ae=e=>ee&&(!W||W(a[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(R)[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>=a.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(R)].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}}o(H(a,e,n));const r=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);r!==$&&M(r),he(Q.moved({n:n+1,total:a.length}))},be=e=>{ee&&(o(T(a,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&M($+1)):M(e))},ge=e=>{te(e)&&(o(z(a,e)),$===e?M(null):null!==$&&$>e&&M($-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<a.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<a.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(F,{size:14}),onClick:()=>(e=>{ae(e)&&(o(T(a,e+1,E(a[e]))),null!==$&&$>e&&M($+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=a.slice();l[e]=n,o(l)};/* @__PURE__ */
|
|
2
2
|
return D("div",{className:"es-list",children:[q?/* @__PURE__ */D("div",{className:"es-list-head",children:[
|
|
3
|
-
/* @__PURE__ */D("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,
|
|
4
|
-
/* @__PURE__ */j("span",{className:"es-list-count",children:a.length})]}):null,X?/* @__PURE__ */j("div",{className:"es-list-above",children:X}):null,a.length?/* @__PURE__ */D(g,{"aria-label":
|
|
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||J||!Z?void 0:o?h(G?G(
|
|
6
|
-
/* @__PURE__ */j("span",{className:"es-list-row-name",children:re(
|
|
3
|
+
/* @__PURE__ */D("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:a.length})]}):null,X?/* @__PURE__ */j("div",{className:"es-list-above",children:X}):null,a.length?/* @__PURE__ */D(g,{"aria-label":n,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!J&&Z&&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
|
+
/* @__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||J||!Z?void 0:o?h(G?G(n,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":G?G(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:Y(n,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(n,l,xe(l))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>M(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",c?{className:"es-list-row-summary",children:c(n,l)}:{className:"es-list-row-summary"}),
|
|
7
7
|
/* @__PURE__ */j(S,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
|
|
8
|
-
/* @__PURE__ */j(
|
|
8
|
+
/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:a.length}})})]}):null,w||J?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(a.length),children:Q.add({noun:_})}),
|
|
9
9
|
/* @__PURE__ */j("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<a.length?
|
|
10
10
|
/* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(i,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,V=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function G({field:e,name:n,id:l,value:t,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=t&&"object"==typeof t?t:{};/* @__PURE__ */
|
|
11
11
|
return j(a,{id:`${l}-group`,title:V(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */j(Z,{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 J({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(Y,{label:V(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>E({...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(Z,{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 Z(
|
|
12
|
+
return j(Y,{label:V(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>E({...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(Z,{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 Z(e){const{field:t,name:a,id:r,value:o,onChange:i,readOnly:d,context:u,renderers:m}=e;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:o,onChange:i,readOnly:d});switch(t.type){case"custom":{const e={...u,field:t,name:a,id:r,value:o,onChange:i,readOnly:d};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
13
13
|
return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(M,{id:r,value:"string"==typeof o?o:null==o?"":String(o),onChange:i,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:d})});case"number":/* @__PURE__ */
|
|
14
|
-
return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(s,{id:r,value:"number"==typeof o?o:void 0,onChange:i,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:d})});case"select":{const
|
|
15
|
-
return j(l,{label:V(t,a),labelId:
|
|
14
|
+
return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(s,{id:r,value:"number"==typeof o?o:void 0,onChange:i,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:d})});case"select":{const e=`${r}-label`;/* @__PURE__ */
|
|
15
|
+
return j(l,{label:V(t,a),labelId:e,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(n,{id:r,value:o,options:t.options,onChange:i,readOnly:d,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
|
|
16
16
|
return j(l,{label:V(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(c,{ariaLabel:V(t,a),value:o,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||d})),onChange:e=>{d||i(e)}})});case"object":/* @__PURE__ */
|
|
17
|
-
return j(G,{...
|
|
18
|
-
return j(J,{...
|
|
17
|
+
return j(G,{...e,field:t});case"array":/* @__PURE__ */
|
|
18
|
+
return j(J,{...e,field:t});case"slot":return null}}var W=e=>t.includes(e);function X(e){let n,l=t[0];const a=[],r=/* @__PURE__ */new Set;for(const[t,o]of Object.entries(e))o&&(W(o.bucket)&&((o.marker||o.bucket!==l)&&(n=void 0),l=o.bucket),o.marker&&"string"==typeof o.fold?n={key:t,title:o.fold}:o.marker&&!1===o.fold&&(n=void 0),o.marker||!1===o.visible||(a.push(n?{name:t,field:o,bucket:l,fold:n}:{name:t,field:o,bucket:l}),"slot"!==o.type&&r.add(l)));return{rows:a,buckets:t.filter(e=>r.has(e))}}function q(e){return new Map(X(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:t=!1,context:r,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",o),S=$(),I=p??`es-insp${S.replace(/:/g,"")}`,L=X(e),[P,F]=C(void 0),A=i??P,M=A&&L.buckets.includes(A)?A:L.buckets[0],[T,H]=C(null),z=T&&T.panel===I&&L.rows.some(e=>e.name===T.name)?T:null,E=c&&L.buckets.length>1,R=E&&M?k(I,M):`${I}-rows`,[B,Y]=C(()=>/* @__PURE__ */new Set),V=v??B,G=(e,n)=>{/* @__PURE__ */return j(a,{title:e.title,open:!V.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&Y(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},J=e=>E&&e!==M,W=({name:e,field:a,bucket:o,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":o,hidden:!!J(o)||void 0,children:/* @__PURE__ */j(Z,{field:a,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:m,openItem:z&&z.name===e?z.index:null,onOpenItem:n=>H(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
|
|
19
19
|
return D("div",{className:"es-insp",children:[E?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":h??O.settings,idPrefix:I,value:M,onChange:e=>{const n=e;void 0===i&&F(n),s?.(n)},items:L.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__ */D("div",{className:"es-insp-rows",id:R,role:E?"tabpanel":void 0,"aria-labelledby":E&&M?w(I,M):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:G(g,f)}):f:null,Q(L.rows).map((e,n)=>{if(!e.fold)return e.rows.map(W);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:!(!J(l)&&!t)||void 0,children:G(e.fold,e.rows.map(W))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{M as FieldText,U as Inspector,Z as InspectorField,Y as ListField,q as bucketsOf,E as copyItem,T as insertAt,V as labelOf,H as moveTo,X as planFields,z as removeAt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-
|
|
1
|
+
import{useScreenBlockRules as e}from"./chunk-CWTAS5R6.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-K5744MTM.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,7 +1,7 @@
|
|
|
1
|
-
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-
|
|
1
|
+
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-DQZYXC3V.js";import{ScreenChrome as e}from"./chunk-7CIFWFP2.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-THZ46DC5.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-JTUUIVBZ.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 j({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 y({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
|
|
6
|
-
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var N=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=N}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:y}=a(),H=t(()=>s(!g),[g]),
|
|
7
|
-
/* @__PURE__ */u(C,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(j,{onCancel:p,onDiscard:v,onSave:y})):/* @__PURE__ */u("div",{className:"sf-msg",children:
|
|
6
|
+
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var N=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=N}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:y}=a(),H=t(()=>s(!g),[g]),Z=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:Z.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:H,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(j,{onCancel:p,onDiscard:v,onSave:y})):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.waitingForAuthorization})}export{H as DocumentScreen,y as ScreenMount};
|
package/dist/drag/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-
|
|
1
|
+
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-FCLW4LEN.js";import"../chunk-O2NLQBFX.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-67GNT6PF.js";import"../chunk-ILXP5VX5.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CanvasFrame,CanvasPassThroughContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-
|
|
1
|
+
export{CanvasFrame,CanvasPassThroughContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-K5744MTM.js";import"../chunk-TBY3DFKS.js";import"../chunk-YRLPFZW3.js";import"../chunk-ECM5F6JJ.js";import"../chunk-WQASXLXS.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-ILXP5VX5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/fields/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-
|
|
1
|
+
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-UCLVWF5E.js";import"../chunk-4JSBIW5H.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-GZH4UVDH.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";import"../chunk-QLD57GBB.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-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-IEKQTWQG.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.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";
|
|
@@ -34,6 +34,10 @@ type AddSidePanelProps<I> = {
|
|
|
34
34
|
label: string;
|
|
35
35
|
onClear: () => void;
|
|
36
36
|
};
|
|
37
|
+
/** Which sections and saved sections are offered, by the section's type
|
|
38
|
+
* (8.3.0): opened at a group's list, only what the group takes. Absent:
|
|
39
|
+
* every section. */
|
|
40
|
+
sectionAccepts?: (sectionType: string) => boolean;
|
|
37
41
|
/** Add what a tile names. */
|
|
38
42
|
onAdd: (key: AddKey) => void;
|
|
39
43
|
/** The drag item for what a tile names — a drag in the editor's session. */
|
|
@@ -49,6 +53,6 @@ type AddSidePanelProps<I> = {
|
|
|
49
53
|
onHide?: () => void;
|
|
50
54
|
readOnly?: boolean;
|
|
51
55
|
};
|
|
52
|
-
declare function AddSidePanel<I>({ blocks, blocksOnly, at, onAdd, itemFor, session, siteWide, onClose, onHide, readOnly, }: AddSidePanelProps<I>): react.JSX.Element;
|
|
56
|
+
declare function AddSidePanel<I>({ blocks, blocksOnly, at, sectionAccepts, onAdd, itemFor, session, siteWide, onClose, onHide, readOnly, }: AddSidePanelProps<I>): react.JSX.Element;
|
|
53
57
|
|
|
54
58
|
export { type AddKey, type AddSidePanelProps, blockKey, AddSidePanel as default, sectionKey, templateKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-KIA6EKAM.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-XTJCKV6Z.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.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-
|
|
1
|
+
export{MediaSidePanel as default}from"../../chunk-NOD4ATKF.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.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-
|
|
1
|
+
export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-D6N77AOS.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-JTUUIVBZ.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 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-7CIFWFP2.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BRDCD4LK.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-OGCROOTI.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-OWW44DVK.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-DPKWJTNX.js";import"../../chunk-HA33IXEU.js";import"../../chunk-VF6TCI62.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-D6N77AOS.js";import"../../chunk-NCQSBU3O.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-HDUAODXJ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-KIA6EKAM.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-XTJCKV6Z.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-NOD4ATKF.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.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{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-ZG5T7RSV.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-DQZYXC3V.js";import"../../chunk-7CIFWFP2.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BRDCD4LK.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-OGCROOTI.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-OWW44DVK.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-DPKWJTNX.js";import"../../chunk-HA33IXEU.js";import"../../chunk-VF6TCI62.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-D6N77AOS.js";import"../../chunk-NCQSBU3O.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-HDUAODXJ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-KIA6EKAM.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-XTJCKV6Z.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-NOD4ATKF.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.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{ScreenStoreProvider as default}from"../../chunk-
|
|
1
|
+
export{ScreenStoreProvider as default}from"../../chunk-DQZYXC3V.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.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,16 +1,16 @@
|
|
|
1
|
-
import{AddBlockRow as e}from"../../chunk-
|
|
2
|
-
return
|
|
3
|
-
return
|
|
4
|
-
/* @__PURE__ */U(
|
|
5
|
-
return
|
|
6
|
-
/* @__PURE__ */U("div",{className:"sf-section-bar",children:/* @__PURE__ */U(
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */U("div",{className:"sf-panel-head",children:/* @__PURE__ */U(
|
|
9
|
-
/* @__PURE__ */U(
|
|
10
|
-
/* @__PURE__ */U(
|
|
11
|
-
return
|
|
12
|
-
/* @__PURE__ */U(
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */U("span",{className:"sf-plus sf-plus--sm",children:"+"}),
|
|
1
|
+
import{AddBlockRow as e}from"../../chunk-IEKQTWQG.js";import{slotChildRowName as n}from"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import{useEaselUndoKeys as t}from"../../chunk-OWW44DVK.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-DPKWJTNX.js";import{usePartBridge as c}from"../../chunk-HA33IXEU.js";import{useSectionOps as p}from"../../chunk-VF6TCI62.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-NOD4ATKF.js";import{SELECTION_MODE as d,useScreenPinned as a,useScreenCanvasFrame as u,useScreenInspectorPanel as h,useScreenPickFollowsSelection as k,sameInspectorMode as f,useStandaloneScreenBridges as j,useScreenBlockLook as y,useScreenBlockRules as S}from"../../chunk-CWTAS5R6.js";import{slotFieldsOf as N,nestsInTree as C}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as A,usePanelPick as x,useCancelPanelPick as B}from"../../chunk-R6WTQWAC.js";import{useHostEscape as v}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as P}from"../../chunk-JTUUIVBZ.js";import{useEasel as R}from"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import{LayersTree as L,Subtree as O,TreeRow as W,TreeRowAction as g,TreeSeam as D}from"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as E}from"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as T,saveIndicator as w}from"../../chunk-H6DDIBQ4.js";import{SaveState as z,panelWidthVars as F}from"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import{useWords as V}from"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as b}from"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as M,parseZoneKey as H}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as K,useRef as X,useEffect as I,useCallback as J,Fragment as Y}from"react";import{Tooltip as G}from"efficient-shell/ui";import{TrashIcon as Q}from"efficient-shell/icons/efficient";import{jsxs as Z,jsx as U,Fragment as $}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=l(),re=p(),{appState:te,selectedItem:se,config:ie}=R(e=>e),[ce,pe]=K(d),le=V("screen",P),me=V("tree",E),de=V("save",T),{first:ae,last:ue,panelOf:he}=a(),ke=he(ae),fe=u(),je=h(),ye=te.data.content?.[0]??null,Se=ye?.props.id??null,Ne=ye?.type===ae,Ce=ye?.type===ue,Ae=X(null),xe=X(null);t(xe);const Be=A(),ve=x(),Pe=B();k(se?.props.id),I(()=>{const e=xe.current;if(!ve||!e)return;const n=e=>{"Escape"===e.key&&Pe()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[ve]),v(null!==ve,()=>Pe()),I(()=>{Se&&Ae.current!==Se&&(Ae.current=Se,Ne?pe(ke??d):se||re.select({index:0}))},[Se,se,re,Ne]);const Re=J(e=>pe(n=>f(n,e)?n:e),[]),Le=j({kind:ce.kind,mode:ce,open:Re,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>f(e,n)?e:n),re.select(e)}}),{selectNode:Oe}=c({mode:ce,setMode:pe,onOpenPart:o}),We=y(),{labelAtLevel:ge,Icon:De}=We,{canAddTo:Ee}=S(),Te=e=>ge(e,"block",ie.components[e]?.label??e),we=e=>ge(e,"section",Te(e)),ze=!Ne&&"puck"===ce.kind&&se?.props.id===Se,Fe=ye?Ee(ye.type)?.spec??null:null,Ve=ye&&Fe?`${ye.props.id}:${Fe.slot}`:null,be=ye&&Fe&&Array.isArray(ye.props[Fe.slot])?ye.props[Fe.slot]:[],Me=e=>n(e,Te,We.plainText),He=(e,n)=>{ye&&Fe&&Ve&&(pe(d),Fe.slider?(r(String(ye.props.id),e),re.select({index:e,zone:Ve}),o(String(ye.props.id))):(re.select({index:e,zone:Ve}),o(n)))},Ke=()=>{if(!ye||!Fe||!Ve)return;const e=be.length;re.insertComponent(Ve,Fe.childType,e),pe(d),Fe.slider?requestAnimationFrame(()=>{r(String(ye.props.id),e),re.select({index:e,zone:Ve})}):re.select({index:e,zone:Ve})},Xe=e=>N(ie,e),Ie=e=>{const{parentId:n,slot:o}=H(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Xe(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(ye)?.props[o];return Array.isArray(t)?t.length:0},Je=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ie(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(d),re.select({index:t,zone:e}))},Ye=b({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>M(n)===e.zone&&n.index>=0&&n.index<=Ie(e.zone),onDrop:(e,n)=>Je(e.zone,e.index,n.index),onStep:(e,n)=>Je(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ge=(e,n)=>/* @__PURE__ */U(D,{...ne?{}:Ye.seam({place:{...H(e),index:n}})},`seam:${e}:${n}`),Qe=e=>We.blockRowName(e,Te),Ze=(e,n,r)=>{pe(d),re.select({index:n,zone:e}),o(r)},Ue=(e,n,o)=>{re.insertComponent(e,n,o),pe(d),re.select({index:o,zone:e})},$e=(n,o,r)=>/* @__PURE__ */U(e,{choices:r,onPick:e=>Ue(n,e,o)}),qe=(e,n)=>{const o=Xe((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=Ee(e.type),s=t?.choices??null,i="footer"===t?.source?Qe:Me;/* @__PURE__ */
|
|
2
|
+
return Z($,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=C(ie,e.type,n),c=i(e),p=String(e.props.id),l=()=>Ze(o,r,p),{rowProps:m,...a}=Ye.row({item:{id:p,zone:o,index:r},place:{...H(o),index:r}},{onClick:q(l)});/* @__PURE__ */
|
|
3
|
+
return Z(Y,{children:[0===r&&Ge(o,0),
|
|
4
|
+
/* @__PURE__ */U(W,{words:me,icon:/* @__PURE__ */U(De,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */U(g,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(d),void re.select(null);var e,n},children:/* @__PURE__ */U(Q,{size:13})}),rowProps:m}),s&&/* @__PURE__ */U(O,{children:qe(e,n+1)}),Ge(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?$e(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===ye?.type,en=Boolean(ye)&&(Boolean(Ee(ye.type))||Xe(ye.type).length>0),nn=Boolean(ye)&&(Boolean(Fe)||Ce||Ne||_e||en);/* @__PURE__ */
|
|
5
|
+
return Z("div",{ref:xe,className:"sf-editor es-editor",style:F(i),children:[
|
|
6
|
+
/* @__PURE__ */U("div",{className:"sf-section-bar",children:/* @__PURE__ */U(z,null!==oe?{tone:"off",label:oe,role:"status"}:{...w(ee,de),role:"status"})}),
|
|
7
|
+
/* @__PURE__ */Z("div",{className:"sf-body",children:[ve&&Be?/* @__PURE__ */U("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */U(m,{panel:Be,pick:ve})}):nn&&ye&&/* @__PURE__ */Z("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
|
|
8
|
+
/* @__PURE__ */U("div",{className:"sf-panel-head",children:/* @__PURE__ */U(G,{content:Ne?le.headerSettings:le.sectionSettings({name:we(ye.type)}),side:"bottom",children:/* @__PURE__ */U("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(ze?"is-selected":""),"aria-pressed":ze,onClick:()=>{Ne?pe(ke??d):(pe(d),re.select({index:0}))},children:we(ye.type)})})}),
|
|
9
|
+
/* @__PURE__ */U(L,{className:"sf-tree sf-scroll",rootProps:Ye.rootProps(),words:me,children:/* @__PURE__ */U(O,{children:Ne?
|
|
10
|
+
/* @__PURE__ */U(W,{words:me,icon:/* @__PURE__ */U(De,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??d),rowProps:{onClick:q(()=>pe(ke??d))}}):Fe?/* @__PURE__ */Z($,{children:[be.map((e,n)=>{const o=se?.props.id===e.props.id,r=Me(e),t=String(e.props.id),s=()=>He(n,t),{rowProps:i,...c}=Ye.row({item:{id:t,zone:Ve,index:n},place:{...H(Ve),index:n}},{onClick:q(s)});/* @__PURE__ */
|
|
11
|
+
return Z(Y,{children:[0===n&&Ge(Ve,0),
|
|
12
|
+
/* @__PURE__ */U(W,{words:me,icon:/* @__PURE__ */U(De,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */U(g,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Ve&&(re.removeComponent(Ve,e),pe(d),re.select(null)));var e},children:/* @__PURE__ */U(Q,{size:13})}),rowProps:i}),Ge(Ve,n+1)]},String(e.props.id??n))}),
|
|
13
|
+
/* @__PURE__ */Z("button",{type:"button",className:"sf-add-card",onClick:Ke,children:[
|
|
14
|
+
/* @__PURE__ */U("span",{className:"sf-plus sf-plus--sm",children:"+"}),Fe.addLabel]}),Se?Le.partRows?.(ye,_):null]}):qe(ye,1)})})]}),
|
|
15
15
|
/* @__PURE__ */U("div",{className:"sf-center",children:/* @__PURE__ */U("div",{className:"sf-preview-host",children:/* @__PURE__ */U(fe,{})})}),
|
|
16
|
-
/* @__PURE__ */U(s,{value:{selectChild:(e,n,o,r)=>"section"===
|
|
16
|
+
/* @__PURE__ */U(s,{value:{selectChild:(e,n,o,r)=>"section"===Ee(r)?.source?He(n,o):Ze(e,n,o),addChild:(e,n,o,r,t)=>"section"===Ee(t)?.source?Ke():Ue(`${e}:${n}`,o,r),childRowName:Me,blockRowName:Qe},children:/* @__PURE__ */U(je,{mode:ce,onOpenWebsiteSettings:Le.openSettings??(()=>{}),onSelectNode:Oe,hideNodeActions:!0})})]})]})}export{ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{usePartBridge}from"../../chunk-
|
|
1
|
+
export{usePartBridge}from"../../chunk-HA33IXEU.js";import"../../chunk-VF6TCI62.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.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";
|
package/dist/screen/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-
|
|
1
|
+
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-ZG5T7RSV.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-DQZYXC3V.js";import"../chunk-7CIFWFP2.js";import"../chunk-2GVCAIPX.js";import"../chunk-26OOWIJJ.js";import"../chunk-BRDCD4LK.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-OGCROOTI.js";import"../chunk-7F52SZOI.js";import"../chunk-MQNBD6AB.js";import"../chunk-BHRC3ASL.js";import"../chunk-6W7WLPZH.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-OWW44DVK.js";import"../chunk-KCBEE2MC.js";import"../chunk-DPKWJTNX.js";import"../chunk-HA33IXEU.js";import"../chunk-VF6TCI62.js";import"../chunk-IYT6NN2J.js";import"../chunk-D6N77AOS.js";import"../chunk-NCQSBU3O.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-HDUAODXJ.js";import"../chunk-RKTF5XLP.js";import"../chunk-THZ46DC5.js";import"../chunk-GMCZXMOV.js";import"../chunk-CLOS6SSX.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-V7U33NF2.js";import"../chunk-5545A3PC.js";import"../chunk-KIA6EKAM.js";import"../chunk-PA3PNTVV.js";import"../chunk-5ZBY24K7.js";import"../chunk-BVN33R76.js";import"../chunk-XTJCKV6Z.js";import"../chunk-KQMML6JM.js";import"../chunk-KCOBHPN6.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";import"../chunk-HQ4VVRIC.js";import"../chunk-NOD4ATKF.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-CWTAS5R6.js";import"../chunk-PLVEGYK6.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-6WY6ZXJG.js";import"../chunk-JTUUIVBZ.js";import"../chunk-K5744MTM.js";import"../chunk-TBY3DFKS.js";import"../chunk-UCLVWF5E.js";import"../chunk-4JSBIW5H.js";import"../chunk-OZ72A6MY.js";import"../chunk-GZH4UVDH.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-ECM5F6JJ.js";import"../chunk-4VJATVVR.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-QVUVDBGA.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-WQASXLXS.js";import"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-FCLW4LEN.js";import"../chunk-O2NLQBFX.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{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-
|
|
1
|
+
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-OWW44DVK.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-VF6TCI62.js";import"../../../chunk-CWTAS5R6.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-K5744MTM.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-UCLVWF5E.js";import"../../../chunk-4JSBIW5H.js";import"../../../chunk-OZ72A6MY.js";import"../../../chunk-GZH4UVDH.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-ECM5F6JJ.js";import"../../../chunk-WQASXLXS.js";import"../../../chunk-66LWADFP.js";import"../../../chunk-QLD57GBB.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";
|
|
@@ -1084,6 +1084,16 @@ interface ScreenPinnedNodes {
|
|
|
1084
1084
|
* undo says nothing. Absent: nothing is said.
|
|
1085
1085
|
*/
|
|
1086
1086
|
changeNotice?: string;
|
|
1087
|
+
/**
|
|
1088
|
+
* WHAT A GROUP OF SECTIONS TAKES (8.3.0): may a section of `sectionType` go
|
|
1089
|
+
* into a group of `groupType` that holds `countNow` sections BEFORE it goes
|
|
1090
|
+
* in? Asked of every way a section arrives in a group: a new one from Add (a
|
|
1091
|
+
* click on a tile, a drag of one, and which tiles Add shows), a section dragged
|
|
1092
|
+
* there from the other group, and a paste. A section moved within its own group
|
|
1093
|
+
* is not asked: nothing arrives. The website's header takes up to 3 light
|
|
1094
|
+
* sections and its footer up to 6. Absent: a group takes any section, as before.
|
|
1095
|
+
*/
|
|
1096
|
+
groupAccepts?: (groupType: string, sectionType: string, countNow: number) => boolean;
|
|
1087
1097
|
/** The type of the group of sections pinned first, ahead of everything. */
|
|
1088
1098
|
firstGroup: string | null;
|
|
1089
1099
|
/** …and of the one pinned last. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-
|
|
1
|
+
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
package/dist/chunk-66WCYXIN.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{buildPaletteSections as e,pinnedSection as t,paletteWithoutPinned as o,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as i}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-XTJCKV6Z.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-OHMYY3FX.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-JTUUIVBZ.js";import{useEasel as f}from"./chunk-E63CSJUL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-SSORUDHE.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-O2NLQBFX.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as O,jsxs as $,Fragment as B}from"react/jsx-runtime";var v=e=>`section:${e}`,V=e=>`block:${e}`,x=e=>`template:${e}`;function H({blocks:H,blocksOnly:I,at:L,onAdd:C,itemFor:F,session:N,siteWide:S,onClose:T,onHide:A,readOnly:D}){const J=f(e=>e.config),R=p(),{labelAtLevel:U,categoryLabel:Y,firstSection:w,Icon:E,Thumbnail:Q}=R,{blockIsOffered:X}=m(),Z=u("screen",d).add,z=u("drag",h).add,K=l(),[M,P]=y([]);b(()=>{let e=!1;const t=e=>X(e,K);return s(K).list().then(o=>{if(e)return;const n=J.components;P(o.filter(e=>e.node?.type&&n[e.node.type]&&i(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[J,K]);const W=j(()=>e(J,R),[J]),G=e=>({type:v(e.type),label:e.name,cover:/* @__PURE__ */O(Q,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:Z.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),q=j(()=>{const e=[];if(H&&H.choices.length>0&&a(H.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${Z.inside({name:H.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:V(e.type),label:e.label,icon:/* @__PURE__ */O(E,{type:e.type,size:18}),title:Z.tile({name:e.label})}))})}),I)return e;const i=t(W,w);i&&e.push({key:"start",title:Z.startBlank,tiles:[G(i)]}),M.length>0&&e.push({key:"templates",title:Z.templates,tiles:M.map(e=>{return{type:x(e.id),label:e.name,cover:/* @__PURE__ */O(Q,{type:e.node.type}),keywords:[(t=e.node.type,U(t,"section",J.components[t]?.label??t)),e.node.type]};var t})});const s=o(W,w);for(const t of Object.keys(J.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:n(J,t,Y),tiles:o.map(G)})}return e},[H,I,M,W,J,Z]),_=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=M.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
|
|
2
|
-
return $(B,{children:[
|
|
3
|
-
/* @__PURE__ */O(r,{icon:/* @__PURE__ */O(g,{size:15}),title:Z.title,context:I?Z.contextBlocks:Z.contextAll,actions:/* @__PURE__ */O(c,{label:Z.done,description:Z.doneDescription,onClick:T}),onHide:A}),
|
|
4
|
-
/* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
-
/* @__PURE__ */O(k,{groups:q,session:N,itemFor:e=>F(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&C(t)},at:L,hint:I?Z.hintBlocks:Z.hint,searchLabel:I?Z.searchBlocks:Z.searchSections,readOnly:D,words:z}),S&&!I?S:null]})]})}export{H as AddSidePanel,V as blockKey,v as sectionKey,x as templateKey};
|
package/dist/chunk-AWJUYMX7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as e,useEffect as t,useRef as n}from"react";var o=/* @__PURE__ */new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);function r(e){const t=e;if(!t||"string"!=typeof t.tagName)return!1;const n=t.tagName.toUpperCase();if("TEXTAREA"===n||"SELECT"===n)return!0;if("INPUT"===n)return!o.has(String(t.type??"text").toLowerCase());if(t.isContentEditable)return!0;const r=t.closest?.("[contenteditable]");return!(!r||"false"===r.getAttribute("contenteditable"))||null!=t.closest?.('[role="textbox"]')}var c="data-puck-component";function i(e,t=c){const n=e;return n&&"function"==typeof n.closest?n.closest(`[${t}]`)?.getAttribute(t)??null:null}function u(e){const t=e.offsetWidth;if(!t)return 1;const n=e.getBoundingClientRect().width;return n>0?n/t:1}function s(e,t,n){const o=e.getBoundingClientRect(),r=n?.getBoundingClientRect()??{left:0,top:0},c=u(e);return{left:o.left-r.left+t.left*c,top:o.top-r.top+t.top*c,width:t.width*c,height:t.height*c}}function l(e){const t=e.offsetWidth;if(!t)return 1;const n=e.getBoundingClientRect().width;return n>0?n/t:1}function a(e,t,n){const o=s(e,t,n),r=l(n);return{left:o.left/r,top:o.top/r,width:o.width/r,height:o.height/r}}function d(e,t,n){const o=e.getBoundingClientRect(),r=l(e);return{x:(t-o.left)/r,y:(n-o.top)/r}}function f(e,t,n,o){const{left:r,top:c}=s(e,{left:t,top:n,width:0,height:0},o);return{x:r,y:c}}function m({available:e,width:t,maxScale:n=1}){const o=Math.max(0,e);if(!t||t<=0)return{width:o,scale:1,shownWidth:o};const r=o>0?Math.min(o/t,n):1;return{width:t,scale:r,shownWidth:t*r}}var h="data-es-canvas-style",w=/* @__PURE__ */new WeakMap;function b(e,t){t?w.set(e,t):w.delete(e)}function v(e,t,n){const o=e.head??e.documentElement;let r=g(e,t);if(!r){r=e.createElement("style"),r.setAttribute(h,t);const n=w.get(e);n&&r.setAttribute("nonce",n),o.appendChild(r)}return r.textContent!==n&&(r.textContent=n),r}function p(e,t){g(e,t)?.remove()}function g(e,t){for(const n of Array.from(e.querySelectorAll(`style[${h}]`)))if(n.getAttribute(h)===t)return n;return null}var y="[data-puck-component]",E="[data-puck-dropzone]",A="iframe#preview-frame";function L(e){const t=e.contentDocument;if(!t||!e.contentWindow||"loading"===t.readyState||!t.body)return!1;if(e.hasAttribute("srcdoc"))return"about:srcdoc"===t.URL;const n=e.getAttribute("src");return!n||"about:blank"===n||"about:blank"!==t.URL}function C(e,t,{selector:n=A,readySelector:o}={}){let r=null,c=null,i=!1,u=!1,s=null;const l=()=>{s?.observer.disconnect(),s=null},a=()=>{if(u)return;let e=null;if(r&&L(r)){const t=r.contentDocument;(e=>{if(!o||e.querySelector(o))return l(),!0;if(s?.doc!==e){l();const t=e.defaultView?.MutationObserver;if(t){const n=new t(()=>a());n.observe(e,{childList:!0,subtree:!0}),s={doc:e,observer:n}}}return!1})(t)&&(e={frame:r,document:t,window:r.contentWindow})}else l();(e===c||!!e&&!!c&&e.frame===c.frame&&e.document===c.document)&&i||(i=!0,c=e,t(c))},d=()=>a(),f=()=>{const t=e.querySelector?.(n);t!==r?(r?.removeEventListener("load",d),r=t,r?.addEventListener("load",d),a()):a()},m=e.ownerDocument?.defaultView??e.defaultView,h=m?.MutationObserver,w=h?new h(e=>(e=>null!==r&&!r.isConnected||e.some(e=>[...e.addedNodes,...e.removedNodes].some(e=>"IFRAME"===e.nodeName||!!e.querySelector?.("iframe"))))(e)&&f()):null;return w?.observe(e,{childList:!0,subtree:!0}),f(),()=>{u=!0,w?.disconnect(),l(),r?.removeEventListener("load",d),r=null}}function S(n,{selector:o,readySelector:r}={}){const[c,i]=e(null);return t(()=>{const e=n.current;if(!e)return;const t=C(e,i,{selector:o,readySelector:r});return()=>{t(),i(null)}},[n,o,r]),c}var x="easel:canvas-typing";function R(e,o,r,{on:c="document",capture:i=!1}={}){const u=n(r);u.current=r;const s=e?.document??null,l=e?.window??null;t(()=>{const e="window"===c?l:s;if(!e)return;const t=e=>u.current(e);return e.addEventListener(o,t,i),()=>e.removeEventListener(o,t,i)},[s,l,o,c,i])}function M(e,n,o){const r=e?.document??null;t(()=>{if(!r)return;if(!o)return void p(r,n);const e=v(r,n,o),t=r.defaultView?.MutationObserver,c=t?new t(()=>{e.isConnected||v(r,n,o)}):null;return c?.observe(r.head??r.documentElement,{childList:!0}),()=>{c?.disconnect(),p(r,n)}},[r,n,o])}function k(n,{settle:o=[150,450]}={}){const[r,c]=e(0),i=n?.frame??null,u=n?.document??null,s=n?.window??null,l=o.join(",");return t(()=>{if(!i||!u||!s)return;const e=i.ownerDocument.defaultView;let t=!1,n=0;const r=()=>{if(t)return;t=!0;const o=()=>{t=!1,c(e=>e+1)};e?.requestAnimationFrame?n=e.requestAnimationFrame(o):o()},l=[],a=(e,t)=>{e.addEventListener(t,r,!0),l.push(()=>e.removeEventListener(t,r,!0))};a(u,"scroll"),a(s,"resize"),e&&(a(e,"scroll"),a(e,"resize"));const d=e?.ResizeObserver;if(d){const e=new d(r);e.observe(i),u.documentElement&&e.observe(u.documentElement),l.push(()=>e.disconnect())}const f=u.defaultView?.MutationObserver,m=u.body??u.documentElement;if(f&&m){const e=new f(r);e.observe(u===i.ownerDocument?i:m,{childList:!0,subtree:!0}),l.push(()=>e.disconnect())}const h=u.fonts;h&&a(h,"loadingdone");const w=o.map(e=>setTimeout(r,e));return r(),()=>{for(const e of l)e();for(const e of w)clearTimeout(e);n&&e?.cancelAnimationFrame&&e.cancelAnimationFrame(n)}},[i,u,s,l]),r}export{c as BLOCK_ATTRIBUTE,y as BLOCK_SELECTOR,A as CANVAS_SELECTOR,x as CANVAS_TYPING_EVENT,E as LIST_SELECTOR,d as clientPointToLayer,l as elementScale,m as fitCanvas,f as framePointToHost,s as frameRectToHost,a as frameRectToLayer,u as frameScale,L as isFrameReady,r as isTypingTarget,i as nodeIdAt,p as removeCanvasStyle,b as setCanvasNonce,v as upsertCanvasStyle,R as useCanvasEvent,S as useCanvasFrame,k as useCanvasLayout,M as useCanvasStyle,C as watchCanvasFrame};
|
package/dist/chunk-E63CSJUL.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_CANVAS_WORDS as e}from"./chunk-TBY3DFKS.js";import{useResolvedFields as t}from"./chunk-YRLPFZW3.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r,parentStep as i,clickPick as a}from"./chunk-ECM5F6JJ.js";import{startCanvasTyping as s,textMap as l}from"./chunk-WQASXLXS.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as d,isTypingTarget as u,frameRectToHost as p,CANVAS_TYPING_EVENT as f}from"./chunk-AWJUYMX7.js";import{find as h,ROOT_ID as m,getList as g,remove as v,parseZoneKey as y,move as w,duplicate as k,replaceNode as b,createNode as S,insert as I,normalizeData as C,createResolveCache as E,resolveNodeData as x,ROOT_SLOT as D}from"./chunk-KRXQM65X.js";import{topLevelSlotKeys as O,fieldsFrom as A,defaultsFrom as M}from"./chunk-NKB3KVAB.js";import{createContext as P,useEffect as z,useContext as B,useRef as K,useSyncExternalStore as R,useState as $,useMemo as j,useCallback as N,useLayoutEffect as Z}from"react";import{jsx as L,jsxs as F}from"react/jsx-runtime";import{createPortal as V}from"react-dom";import{FloatingBar as T,TextToolbar as H}from"efficient-shell/ui";function W(e){return!["setData","setUi","set"].includes(e.type)}var Y=(e,t,n,o)=>{const r=g(e,t,y(n));return r?.[o]??null},X=(e,t,n,o,r)=>{const i=Y(e,t,n,o);if(!i)throw new Error(`${r}: nothing at ${n}[${o}]`);return i};function q(e,t){const{selection:o}=e;return{...e.ui,itemSelector:n(e.data,t,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function U(e,t,n){return n?"node"===n.kind?h(e,t,n.id)?n:null:n.parentId===m?g(e,t,n)?n:null:h(e,t,n.parentId)&&g(e,t,n)?n:null:null}function J(e,t,n,r=!1){const{itemSelector:i,selectedSlot:a,...s}=n;let l=e.selection;var c;return"itemSelector"in n&&(l=o(e.data,t,i??null)),"selectedSlot"in n&&(a?l=(c=a)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===l?.kind&&(l=null)),{...e,selection:l,ui:r?s:{...e.ui,...s}}}function Q(e,t,n){const o=G(e,t,n);if(o===e)return e;const r=U(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function G(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return J(e,n,"function"==typeof t.ui?t.ui(q(e,n)):t.ui);case"set":{const r={data:o,ui:q(e,n)},i="function"==typeof t.state?t.state(r):t.state;let a=i.data?{...e,data:i.data}:e;return i.ui&&(a=J(a,n,i.ui,!0)),a}case"insert":{const r={...y(t.destinationZone),index:t.destinationIndex},i=S(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:I(o,n,r,i)}}case"replace":{const r=X(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:b(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=X(o,n,t.sourceZone,t.sourceIndex,"duplicate"),i=k(o,n,r.props.id),a=Y(i,n,t.sourceZone,t.sourceIndex+1);return{...e,data:i,selection:a?{kind:"node",id:a.props.id}:e.selection}}case"reorder":return G(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=Y(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const i={...y(t.destinationZone),index:t.destinationIndex};return{...e,data:w(o,n,r.props.id,i)}}case"remove":{const r=X(o,n,t.zone,t.index,"remove");return{...e,data:v(o,n,r.props.id)}}default:return e}}var _={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},ee={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},te=0,ne=()=>`history-${te+=1}`;function oe(e){let t=e.config;const r=e.now??(()=>Date.now()),i=e.historyCoalesceMs??250;let a=e.permissions??{};const s=C(e.data,t);let l={data:s,selection:null,ui:{...ee}};if(e.ui){const{itemSelector:n,selectedSlot:r,...i}=e.ui;l={data:s,selection:r?{kind:"slot",...r}:o(s,t,n??null),ui:{...ee,...i}}}let c=[{core:l,at:-1/0,sealed:!0,id:ne()}],d=0;const u=e=>{const t=c[d],n=r();!e&&d===c.length-1&&d>0&&!t.sealed&&n-t.at<i?c=[...c.slice(0,d),{...t,core:l,at:n}]:(c=[...c.slice(0,d+1),{core:l,at:n,sealed:e,id:ne()}],d=c.length-1)},p=/* @__PURE__ */new Set;let f=null,m=null,v=0,y=null,w=!1;const k=()=>{for(const e of[...p])e()},S=()=>{c=[...c.slice(0,d),{...c[d],core:l},...c.slice(d+1)]},I=(t,n)=>{v>0?w=w||n:(n?u(!1):l!==t&&S(),l.data!==t.data&&e.onChange?.(l.data),l!==t&&k())},D=e=>{const n=l;if(l=Q(l,e,t),l===n)return;const o=e.recordHistory??W(e);I(n,o&&l.data!==n.data)},O=t=>{0===v&&(y=l,w=!1),v+=1;try{t()}catch(e){throw v-=1,0===v&&y&&(l=y,y=null),e}if(v-=1,v>0||!y)return;const n=y;y=null,w&&l.data!==n.data?u(!0):l!==n&&S(),l.data!==n.data&&e.onChange?.(l.data),l!==n&&k()},A=e=>{const n=l,o=U(l.data,t,e);var r,i;(r=o,i=l.selection,r===i||r&&i&&r.kind===i.kind&&("node"===r.kind&&"node"===i.kind?r.id===i.id:"slot"===r.kind&&"slot"===i.kind&&r.parentId===i.parentId&&r.slot===i.slot))||(l={...l,selection:o},I(n,!1))},M=t=>{const n=l;d=t,l=c[d].core,l.data!==n.data&&e.onChange?.(l.data),l!==n&&k()},P=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{..._,...a,...n}};let z=P();const B=E(),K={resolveCache:B,async resolveAll({trigger:e="load",metadata:n}={}){const o=l.data,r={type:"root",props:{...o.root.props??{}}},i=[...o.content,...Object.values(o.zones??{}).flat()],[a,...s]=await Promise.all([x(r,t,{cache:B,trigger:e,metadata:n}),...i.map(o=>x(o,t,{cache:B,trigger:e,metadata:n}))]);O(()=>{const e=l;let n=l.data;s.forEach((e,r)=>{if(!e.didChange)return;const a=i[r].props.id,s=h(n,t,a)?.node;s&&s===h(o,t,a)?.node&&(n=b(n,t,a,e.node))}),a.didChange&&n.root===o.root&&(n={...n,root:{...n.root,props:a.node.props,readOnly:a.node.readOnly??n.root.readOnly}}),n!==l.data&&(l={...l,data:n,selection:U(n,t,l.selection)},I(e,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=h(l.data,t,e)?.node;if(!r)return!1;const i=await x(r,t,{cache:B,trigger:n,metadata:o});if(!i.didChange)return!1;let a=!1;return O(()=>{const n=l;if(h(l.data,t,e)?.node!==r)return;const o=b(l.data,t,e,i.node);o!==l.data&&(l={...l,data:o,selection:U(o,t,l.selection)},I(n,!1),a=!0)}),a},get config(){return t},getState(){if(f&&m===l)return f;const e=l,o={data:e.data,ui:q(e,t)},r="node"===e.selection?.kind?h(e.data,t,e.selection.id)?.node??null:null;return f={appState:o,selection:e.selection,selectedItem:r,config:t,dispatch:D,history:{back:()=>K.undo(),forward:()=>K.redo(),hasPast:d>0,hasFuture:d<c.length-1,histories:c.map(e=>({id:e.id,state:{data:e.core.data,ui:q(e.core,t)}})),index:d,setHistoryIndex:e=>{e>=0&&e<c.length&&e!==d&&M(e)}},getPermissions:z,getItemById:n=>h(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return g(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,t,n),getSelectorForId:o=>{const r=n(e.data,t,{kind:"node",id:o});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},m=e,f},subscribe:e=>(p.add(e),()=>{p.delete(e)}),dispatch:D,batch:O,group:()=>{const e=d,t=c[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,c[e]?.id!==t)return;if(d<=e+1)return void(d===e+1&&(c=[...c.slice(0,d),{...c[d],sealed:!0},...c.slice(d+1)]));const o=c[d];c=[...c.slice(0,e+1),{...o,sealed:!0},...c.slice(d+1)],d=e+1}}},select:e=>A(e?{kind:"node",id:e}:null),selectSlot:e=>A(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){O(()=>{const n=l,o=void 0===e.select?l.selection:e.select;l={...l,data:e.data,selection:U(e.data,t,o)},I(n,e.data!==n.data)})},load(e,n={}){const o=l,r=C(e,t);l={...l,data:r,selection:U(r,t,n.selection??l.selection)},n.keepHistory||(c=[{core:l,at:-1/0,sealed:!0,id:ne()}],d=0),l!==o&&k()},undo(){d>0&&M(d-1)},redo(){d<c.length-1&&M(d+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,a)||(a=e,z=P(),f=null,k())},setConfig(e){e!==t&&(t=e,z=P(),f=null,k())}};return K}function re(e,t,n={}){const o=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const o="KeyZ"===e.code,r="KeyY"===e.code&&!e.shiftKey;(o||r)&&(n.leaveTyping&&u(e.target)||!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),r||e.shiftKey?t.redo():t.undo()))};return e.addEventListener("keydown",o),()=>e.removeEventListener("keydown",o)}var ie=P(null),ae=P(!0);function se({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return z(()=>{n&&e.resolveAll()},[e,n]),z(()=>{if(t&&"undefined"!=typeof document)return re(document,e)},[e,t]),/* @__PURE__ */L(ie.Provider,{value:e,children:/* @__PURE__ */L(ae.Provider,{value:t,children:o})})}function le(){const e=B(ie);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function ce(e){const t=le(),n=K({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const i=e(o);return r.has&&Object.is(r.value,i)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:i,has:!0},i)};return R(t.subscribe,o,o)}function de(){return function(e){return ce(e)}}var ue="data-puck-component",pe="data-puck-dropzone",fe={},he="data-es-mirror",me="undefined"==typeof window?z:Z;function ge(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${he}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(he,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function ve({children:t,id:n="preview-frame",title:o,className:r,style:i,mirrorStyles:a=!0,onDocument:s,height:l="auto",nonce:u}){const p=c("canvas",e),f=K(null),[h,m]=$(null);return me(()=>{const e=f.current,t=h?.ownerDocument.defaultView;if("auto"!==l||!e||!h||!t)return;const n=()=>{e.style.height=`${Math.ceil(h.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(h),()=>r?.disconnect()},[h,l]),me(()=>{let e=f.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=f.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-puck-entry",""),t.id="frame-root","fill"===l&&t.classList.add("es-frame-fill"),e.body.appendChild(t),d(e,u),m(t),s?.(e);let n=null;const o=f.current?.ownerDocument;if(a&&o){ge(o,e,u);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>ge(o,e,u)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}return()=>{n?.disconnect(),t.remove(),m(null),s?.(null)}},[]),/* @__PURE__ */L("iframe",{ref:f,id:n,title:o??p.frame,className:["es-canvas-frame","fill"===l?"is-fill":"",r??""].filter(Boolean).join(" "),style:i,children:h?V(t,h):null})}var ye=P(null),we=P(fe),ke=[];function be({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:i=120}){const a=le(),s=ce(n=>g(n.appState.data,a.config,{parentId:e,slot:t})??ke),l=ce(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==m),c=ce(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),d=B(ye),u=["es-zone"];return s.length&&u.push("has-children"),e===m&&u.push("is-root"),(l||c)&&u.push("is-area-selected"),null!==d&&d===e&&e!==m&&u.push("is-hovering-area"),n&&u.push(n),/* @__PURE__ */L("div",{className:u.join(" "),[pe]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${i}px`},children:s.map(e=>/* @__PURE__ */L(Ce,{node:e},e.props.id))})}function Se(e,t){return j(()=>{const n={};for(const o of O(A(e)))n[o]=function(e={}){/* @__PURE__ */
|
|
2
|
-
return L(be,{parentId:t,slot:o,...e})};return n},[e,t])}function Ie(e){return j(()=>function({zone:t,...n}){/* @__PURE__ */
|
|
3
|
-
return L(be,{parentId:e,slot:t,...n})},[e])}function Ce({node:e}){const t=le().config.components[e.type],n=e.props.id,o=function(e){const t=K(null);return j(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(ue),o.removeAttribute("data-puck-dnd")),t.current=n,n&&(n.setAttribute(ue,e),n.setAttribute("data-puck-dnd",e),n.style.position="relative")},[e])}(n),r=B(we),i=Se(t,n),a=Ie(n);if(!t?.render)return null;const s=t.render,l={...M(t),...e.props,...i},c={renderDropZone:a,isEditing:!0,dragRef:t.inline?o:null,metadata:{...r,...t.metadata}};return t.inline?/* @__PURE__ */L(s,{...l,puck:c,editMode:!0}):/* @__PURE__ */L("div",{[ue]:n,"data-puck-dnd":n,style:{position:"relative"},children:/* @__PURE__ */L(s,{...l,puck:c,editMode:!0})})}function Ee({metadata:e}){const t=ce(e=>e.config),n=ce(e=>e.appState.data.root).props??{},o=t.root?.render,r=Se(t.root,m),i=Ie(m),a=/* @__PURE__ */L(be,{parentId:m,slot:D}),s=o?/* @__PURE__ */L(o,{id:"puck-root",...n,...r,puck:{renderDropZone:i,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:a}):a;/* @__PURE__ */
|
|
4
|
-
return L(we.Provider,{value:e??fe,children:s})}var xe=P(void 0);function De(e,t,n){const[o,r]=$(null),i=K(t);return i.current=t,me(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!i.current)return void r(null);let o=0;const a=()=>{o=0;const n=function(e,t){if(!e||!t)return null;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(i.current?i.current(t):null,e.current?.parentElement??null);r(e=>{return(t=e)===(o=n)||t&&o&&t.top===o.top&&t.left===o.left&&t.width===o.width&&t.height===o.height?e:n;var t,o})},s=()=>{o||(o=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(a))};a();const l="MutationObserver"in n?new n.MutationObserver(s):null;l?.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0});const c="ResizeObserver"in n?new n.ResizeObserver(s):null;return c?.observe(t.documentElement),n.addEventListener("resize",s),()=>{l?.disconnect(),c?.disconnect(),n.removeEventListener("resize",s),o&&(n.cancelAnimationFrame??n.clearTimeout)(o)}},[n]),o}function Oe({id:e,kind:t,overlay:n}){const o=K(null),r=De(o,e?t=>t.querySelector(`[${ue}="${t.defaultView?.CSS?.escape?t.defaultView.CSS.escape(e):e}"]`):null,e),i=/* @__PURE__ */L("div",{ref:o,"aria-hidden":"true",className:`es-canvas-outline is-${t}`,style:r?{position:"absolute",top:r.top,left:r.left,width:r.width,height:r.height}:{display:"none"}});return n&&e?/* @__PURE__ */L(n,{componentId:e,kind:t,children:i}):i}function Ae(e,t,n){const o=l(e,n),r=o.text.length,i=e.ownerDocument;if(!t)return[r,r];let a=null;const s=i.caretPositionFromPoint?.(t.x,t.y);if(s&&e.contains(s.offsetNode))a=o.at(s.offsetNode,s.offset);else{const n=i.caretRangeFromPoint?.(t.x,t.y);n&&e.contains(n.startContainer)&&(a=o.at(n.startContainer,n.startOffset))}if(null===a)return[r,r];const c=o.text;let d=a,u=a;for(;d>0&&!/\s/.test(c[d-1]);)d-=1;for(;u<c.length&&!/\s/.test(c[u]);)u+=1;return[d,u]}function Me({s:e,element:t,toolbar:n,label:o}){const r=e.pressed(),i=new Set(n.offered.filter(e=>"link"!==e));/* @__PURE__ */
|
|
5
|
-
return L(T,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?p(o,{left:n.left,top:n.top,width:n.width,height:n.height}):{left:n.left,top:n.top,width:n.width,height:n.height};return{left:r.left-6,top:r.top-6,right:r.left+r.width+6,bottom:r.top+r.height+6}},bounds:()=>{const e=t(),n=e?.ownerDocument.defaultView?.frameElement,o=(n??e?.closest(".es-canvas")??e)?.getBoundingClientRect();return o?{left:o.left,top:o.top,right:o.right,bottom:o.bottom}:{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}},"aria-label":o,children:/* @__PURE__ */L("div",{style:{width:"18rem"},children:/* @__PURE__ */L(H,{offered:i,pressed:r.marks,onMark:t=>{"link"!==t&&e.press(t)},list:{pressed:r.list,onList:t=>e.list(t)},alignment:n.alignment,letterCase:n.letterCase})})})}function Pe({element:e}){const t=K(null),n=De(t,()=>e(),e);/* @__PURE__ */
|
|
6
|
-
return L("div",{ref:t,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:n?{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height}:{display:"none"}})}function ze({frame:t=!0,className:n,style:o,metadata:r,mirrorStyles:l,onDocument:d,height:u,title:p,nonce:h,hotkeys:m,frameWrapper:g,overlay:v,children:y,typing:w,passThrough:k}){const b=le(),S=B(xe),I=k??S,C=B(ae),E=c("canvas",e),x=m??C,[D,O]=$(void 0),A=ce(e=>"node"===e.selection?.kind?e.selection.id:null),[M,P]=$(null),[R,j]=$(null),N=K(null),[,Z]=$(0),V=K(w);V.current=w;const T=K(null),H=e=>{const t=T.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(f,{detail:{typing:e}}))},W=(e,t)=>{N.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=b.group(),r=e.element,i=s({element:r,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:Ae(n,t,e.skip),write:e.write,remount:e.remount,onSelect:()=>Z(e=>e+1),end:e=>{o.close(),N.current?.element===r&&(N.current=null),j(null),H(!1),V.current?.onChange?.({typing:!1,why:e})}});if(!i)return o.close(),!1;const a=n.closest?.(`[${ue}]`)?.getAttribute(ue);return a&&b.select(a),N.current={s:i,element:r,target:e},j(()=>r),P(null),H(!0),V.current?.onChange?.({typing:!0,element:n}),!0};z(()=>()=>N.current?.s.stop("stop"),[]);const Y=e=>{const t=N.current?.element();return Boolean(t&&t.contains(e))},X=e=>{const t=e.closest?.(`[${ue}]`)?.getAttribute(ue);if(!t)return;const n=b.getState(),o="node"===n.selection?.kind?n.selection.id:null;return a(n.appState.data,b.config,t,o,I)??t},q=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(N.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=V.current?.atSelection?.();n&&W(n,null)&&e.preventDefault()},U=/* @__PURE__ */F("div",{ref:T,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),N.current){if(Y(t))return;N.current.s.stop("outside")}const n=X(t);void 0===n?t.hasAttribute?.(pe)||b.select(null):b.select(n)},onDoubleClick:e=>{const t=V.current;if(!t||Y(e.target))return;const n=t.at(e.target);n&&W(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>q(e),onMouseOver:e=>{if(N.current)return;const t=X(e.target)??null;t!==M&&P(t)},onMouseLeave:()=>P(null),children:[
|
|
7
|
-
/* @__PURE__ */L(ye.Provider,{value:M,children:/* @__PURE__ */L(Ee,{metadata:r})}),
|
|
8
|
-
/* @__PURE__ */F("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
9
|
-
/* @__PURE__ */L(Oe,{id:!R&&M&&M!==A?M:null,kind:"hover",overlay:v}),
|
|
10
|
-
/* @__PURE__ */L(Oe,{id:R?null:A,kind:"selected",overlay:v}),R?/* @__PURE__ */L(Pe,{element:R}):null]}),y]}),J=g?/* @__PURE__ */L(g,{document:D,children:U}):U;z(()=>{if(D&&x)return re(D,b)},[D,x,b]),z(()=>{if(!D)return;const e=e=>{if("Enter"===e.key)return void q(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=b.getState();if("node"!==n.selection?.kind)return;const o=i(n.appState.data,b.config,n.selection);"node"===o?.kind&&b.select(o.id)};return D.addEventListener("keydown",e),()=>D.removeEventListener("keydown",e)},[D,b]);/* @__PURE__ */
|
|
11
|
-
return F("div",{className:"es-canvas"+(n?` ${n}`:""),style:o,"data-puck-preview":"","data-es-typing":R?"":void 0,children:[R&&N.current?.target.toolbar?/* @__PURE__ */L(Me,{s:N.current.s,element:N.current.element,toolbar:N.current.target.toolbar,label:E.textTools}):null,t?/* @__PURE__ */L(ve,{mirrorStyles:l,onDocument:e=>{O(e??void 0),d?.(e)},height:u,title:p,nonce:h,children:J}):/* @__PURE__ */L("div",{id:"preview-frame","data-puck-entry":"",children:J})]})}function Be(e={}){const t=le(),n=ce(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function Ke(){const e=le(),n=ce(e=>e.config),o=e.resolveCache,r=ce(e=>e.selectedItem),i=ce(e=>e.appState.data.root),a=r?r.props.id:"root",s=i.props??{},l=j(()=>r||{type:"root",props:s},[r,s]),c=r?n.components[r.type]:n.root,d=e.getState(),u=r?h(d.appState.data,n,a):null,p=u&&"root"!==u.place.parentId?u.place.parentId:null,f=p?d.getItemById(p)??null:null,{fields:m}=t({id:a,node:l,block:c,parent:f,appState:d.appState}),g=ce(e=>!1===e.getPermissions(r?{item:r}:{root:!0}).edit),v=N((t,r)=>{(async()=>{const i=e.getState();if("root"!==a){const s=i.getItemById(a),l=i.getSelectorForId(a);if(!s||!l)return;const c={...s,props:{...s.props,[t]:r}},{node:d}=await x(c,n,{cache:o,trigger:"replace"}),u=e.getState().getSelectorForId(a);if(!u)return;return void e.dispatch({type:"replace",destinationZone:u.zone??"root:default-zone",destinationIndex:u.index,data:d})}const s=i.appState.data.root.props??{},{node:l}=await x({type:"root",props:{...s,[t]:r}},n,{cache:o,trigger:"replace"});e.dispatch({type:"replaceRoot",root:{props:l.props,readOnly:l.readOnly},recordHistory:!0})})()},[e,n,o,a]);return{id:a,node:l,fields:m,values:l.props,readOnly:g,onChange:v}}export{ve as CanvasFrame,xe as CanvasPassThroughContext,ee as DEFAULT_UI,ze as EaselCanvas,se as EaselProvider,Ee as EditDocument,re as bindUndoKeys,oe as createEasel,de as createUseEasel,W as recordsByDefault,Q as reduce,q as uiView,ce as useEasel,le as useEaselApi,Be as useEaselNodeOps,Ke as useSelectedFields,U as validSelection};
|