efficient-easel 23.0.0 → 23.1.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/README.md +7 -0
- package/dist/chunk-22I55W37.js +2 -0
- package/dist/chunk-2FYFAAAK.js +2 -0
- package/dist/chunk-6QSFJCJT.js +21 -0
- package/dist/chunk-DSKNJXB4.js +1 -0
- package/dist/{chunk-3P735WOM.js → chunk-HNV6HUSQ.js} +1 -1
- package/dist/chunk-JPCOBNYW.js +1 -0
- package/dist/{chunk-HLMQ34GP.js → chunk-JWOBAEBH.js} +1 -1
- package/dist/{chunk-FOOK54T2.js → chunk-LSTOOYG7.js} +1 -1
- package/dist/{chunk-FF54HWSE.js → chunk-NQ7NRYTK.js} +8 -8
- package/dist/{chunk-YHEYJKQL.js → chunk-T3LAGI43.js} +1 -1
- package/dist/chunk-TGSK5VII.js +5 -0
- package/dist/chunk-VBOSOH5M.js +16 -0
- package/dist/{chunk-XJ23ULBP.js → chunk-VHFLOHGQ.js} +1 -1
- package/dist/chunk-YCSZAP7T.js +1 -0
- package/dist/{chunk-VZUXOZGP.js → chunk-Z6V22QRZ.js} +30 -30
- package/dist/easel/easel.css +12 -9
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.d.ts +35 -1
- package/dist/fields/index.js +1 -1
- package/dist/rowMarks-CO5TpfLY.d.ts +44 -0
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +17 -17
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/document/device-fields.d.ts +7 -21
- package/dist/screen/lib/document/device-fields.js +1 -1
- package/dist/screen/lib/document/panel-no-control-mark.d.ts +3 -7
- package/dist/screen/lib/document/panel-no-control-mark.js +1 -1
- package/dist/screen/lib/document/style-clipboard.js +1 -1
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-4YUC7B7E.js +0 -2
- package/dist/chunk-6F5GO337.js +0 -1
- package/dist/chunk-G3HAKQUF.js +0 -1
- package/dist/chunk-GXRS52JD.js +0 -5
- package/dist/chunk-INRERJU4.js +0 -2
- package/dist/chunk-KXTXYINN.js +0 -16
- package/dist/chunk-MXECWHRJ.js +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-HNV6HUSQ.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-Z6V22QRZ.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-T3LAGI43.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-C56MPJBH.js";import"../../chunk-JPCOBNYW.js";import"../../chunk-LSTOOYG7.js";import"../../chunk-PY7OOQEZ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-VHFLOHGQ.js";import"../../chunk-5545A3PC.js";import"../../chunk-NQ7NRYTK.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-SINAM2IT.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-TGSK5VII.js";import"../../chunk-2G6MAXPY.js";import"../../chunk-AT4DDMJS.js";import"../../chunk-GKG3M5QK.js";import"../../chunk-A6ZP5II4.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-BIK3AO2V.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-XFYFKITX.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-SSRYU3YG.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-ZG6PVMC3.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenStoreProvider as default}from"../../chunk-
|
|
1
|
+
export{ScreenStoreProvider as default}from"../../chunk-VHFLOHGQ.js";import"../../chunk-TGSK5VII.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{AddBlockRow as e}from"../../chunk-
|
|
2
|
-
return
|
|
3
|
-
return
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
return
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
return
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
1
|
+
import{AddBlockRow as e}from"../../chunk-JWOBAEBH.js";import{scrollPreviewToSection as n,gotoPreviewSlide as o}from"../../chunk-DDH2DYQP.js";import{useEaselUndoKeys as r}from"../../chunk-T3LAGI43.js";import{SlotChildActionsProvider as t}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as s}from"../../chunk-C56MPJBH.js";import{usePartBridge as i}from"../../chunk-JPCOBNYW.js";import{useSectionOps as c}from"../../chunk-LSTOOYG7.js";import"../../chunk-RUQOIQWI.js";import{SELECTION_MODE as p,useScreenPinned as l,useScreenCanvasFrame as m,useScreenInspectorPanel as d,useScreenPickFollowsSelection as a,sameInspectorMode as u,useStandaloneScreenBridges as h,useScreenBlockLook as k,useScreenBlockRules as j,isSelectionMode as f}from"../../chunk-TGSK5VII.js";import{MediaPopup as S}from"../../chunk-2G6MAXPY.js";import{useScreenDocument as y}from"../../chunk-A6ZP5II4.js";import"../../chunk-77IWWW6X.js";import"../../chunk-ERR437B5.js";import"../../chunk-UNVKPVZW.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-BIK3AO2V.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-MQA7OFRA.js";import{DEFAULT_SCREEN_WORDS as A}from"../../chunk-IYHO4XQX.js";import{slotChildRowName as C}from"../../chunk-SSRYU3YG.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-R4AUZVA3.js";import{slotFieldsOf as N,nestsInTree as O}from"../../chunk-TCAAOYQY.js";import{useEasel as x}from"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import{LayersTree as P,Subtree as Y,TreeRow as B,TreeRowAction as I,TreeSeam as M}from"../../chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as W}from"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as F,saveIndicator as g}from"../../chunk-H6DDIBQ4.js";import{SaveState as H,panelWidthVars as R}from"../../chunk-ZG6PVMC3.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import{useWords as v}from"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import{useTreeDrag as z}from"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import{zoneKey as D,parseZoneKey as E}from"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";import{useState as V,useRef as b,useEffect as w,useCallback as Q,Fragment as T}from"react";import{Tooltip as G}from"efficient-shell/ui";import{TrashIcon as J}from"efficient-shell/icons/efficient";import{jsxs as K,jsx as Z,Fragment as L}from"react/jsx-runtime";var U=e=>n=>{n.target.closest("button, input")||e()},X={rowClick:U};function $(){const{saveState:$,readOnly:q,readOnlyReason:_=null}=y(),ee=c(),{appState:ne,selectedItem:oe,config:re}=x(e=>e),[te,se]=V(p),ie=v("screen",A),ce=v("tree",W),pe=v("save",F),{first:le,last:me,panelOf:de}=l(),ae=de(le),ue=m(),he=d(),ke=ne.data.content?.[0]??null,je=ke?.props.id??null,fe=ke?.type===le,Se=ke?.type===me,ye=b(null),Ae=b(null);r(Ae),a(oe?.props.id),w(()=>{je&&ye.current!==je&&(ye.current=je,fe?se(ae??p):oe||ee.select({index:0}))},[je,oe,ee,fe]);const Ce=Q(e=>se(n=>u(n,e)?n:e),[]),Ne=h({kind:te.kind,mode:te,open:Ce,show:e=>se(e),reveal:()=>{},select:(e,n)=>{se(e=>u(e,n)?e:n),ee.select(e)}}),{selectNode:Oe}=i({mode:te,setMode:se,onOpenPart:n}),xe=k(),{labelAtLevel:Pe,Icon:Ye}=xe,{canAddTo:Be}=j(),Ie=e=>Pe(e,"block",re.components[e]?.label??e),Me=e=>Pe(e,"section",Ie(e)),We=!fe&&f(te)&&oe?.props.id===je,Fe=ke?Be(ke.type)?.spec??null:null,ge=ke&&Fe?`${ke.props.id}:${Fe.slot}`:null,He=ke&&Fe&&Array.isArray(ke.props[Fe.slot])?ke.props[Fe.slot]:[],Re=e=>C(e,Ie,xe.plainText),ve=(e,r)=>{ke&&Fe&&ge&&(se(p),Fe.slider?(o(String(ke.props.id),e),ee.select({index:e,zone:ge}),n(String(ke.props.id))):(ee.select({index:e,zone:ge}),n(r)))},ze=()=>{if(!ke||!Fe||!ge)return;const e=He.length;ee.insertComponent(ge,Fe.childType,e),se(p),Fe.slider?requestAnimationFrame(()=>{o(String(ke.props.id),e),ee.select({index:e,zone:ge})}):ee.select({index:e,zone:ge})},De=e=>N(re,e),Ee=e=>{const{parentId:n,slot:o}=E(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of De(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(ke)?.props[o];return Array.isArray(t)?t.length:0},Ve=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ee(e)),t=n<r?r-1:r;t!==n&&(ee.reorderComponent(e,n,t),se(p),ee.select({index:t,zone:e}))},be=z({keyOf:e=>e.id,readOnly:Boolean(q),canDrop:(e,n)=>D(n)===e.zone&&n.index>=0&&n.index<=Ee(e.zone),onDrop:(e,n)=>Ve(e.zone,e.index,n.index),onStep:(e,n)=>Ve(e.zone,e.index,n<0?e.index-1:e.index+2)}),we=(e,n)=>/* @__PURE__ */Z(M,{...q?{}:be.seam({place:{...E(e),index:n}})},`seam:${e}:${n}`),Qe=e=>xe.blockRowName(e,Ie),Te=(e,o,r)=>{se(p),ee.select({index:o,zone:e}),n(r)},Ge=(e,n,o)=>{ee.insertComponent(e,n,o),se(p),ee.select({index:o,zone:e})},Je=(n,o,r)=>/* @__PURE__ */Z(e,{choices:r,onPick:e=>Ge(n,e,o)}),Ke=(e,n)=>{const o=De((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=Be(e.type),s=t?.choices??null,i="footer"===t?.source?Qe:Re;/* @__PURE__ */
|
|
2
|
+
return K(L,{children:[o.map(({child:e,zone:o,index:r})=>{const t=oe?.props.id===e.props.id,s=O(re,e.type,n),c=i(e),l=String(e.props.id),m=()=>Te(o,r,l),{rowProps:d,...a}=be.row({item:{id:l,zone:o,index:r},place:{...E(o),index:r}},{onClick:U(m)});/* @__PURE__ */
|
|
3
|
+
return K(T,{children:[0===r&&we(o,0),
|
|
4
|
+
/* @__PURE__ */Z(B,{words:ce,icon:/* @__PURE__ */Z(Ye,{type:e.type,size:13}),name:c,selected:t,onSelect:m,...a,actions:/* @__PURE__ */Z(I,{kind:"delete",label:ie.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,ee.removeComponent(e,n),se(p),void ee.select(null);var e,n},children:/* @__PURE__ */Z(J,{size:13})}),rowProps:d}),s&&/* @__PURE__ */Z(Y,{children:Ke(e,n+1)}),we(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Je(`${e.props.id}:${t.slot}`,o.length,s):null]})},Ze="HeroSingle"===ke?.type,Le=Boolean(ke)&&(Boolean(Be(ke.type))||De(ke.type).length>0),Ue=Boolean(ke)&&(Boolean(Fe)||Se||fe||Ze||Le);/* @__PURE__ */
|
|
5
|
+
return K("div",{ref:Ae,className:"sf-editor es-editor",style:R(s),children:[
|
|
6
|
+
/* @__PURE__ */Z("div",{className:"sf-section-bar",children:/* @__PURE__ */Z(H,null!==_?{tone:"off",label:_,role:"status"}:{...g($,pe),role:"status"})}),
|
|
7
|
+
/* @__PURE__ */K("div",{className:"sf-body",children:[Ue&&ke&&/* @__PURE__ */K("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
|
|
8
|
+
/* @__PURE__ */Z("div",{className:"sf-panel-head",children:/* @__PURE__ */Z(G,{content:fe?ie.headerSettings:ie.sectionSettings({name:Me(ke.type)}),side:"bottom",children:/* @__PURE__ */Z("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(We?"is-selected":""),"aria-pressed":We,onClick:()=>{fe?se(ae??p):(se(p),ee.select({index:0}))},children:Me(ke.type)})})}),
|
|
9
|
+
/* @__PURE__ */Z(P,{className:"sf-tree sf-scroll",rootProps:be.rootProps(),words:ce,children:/* @__PURE__ */Z(Y,{children:fe?
|
|
10
|
+
/* @__PURE__ */Z(B,{words:ce,icon:/* @__PURE__ */Z(Ye,{type:"header",size:13}),name:ie.headerSettings,selected:te.kind===ae?.kind,onSelect:()=>se(ae??p),rowProps:{onClick:U(()=>se(ae??p))}}):Fe?/* @__PURE__ */K(L,{children:[He.map((e,n)=>{const o=oe?.props.id===e.props.id,r=Re(e),t=String(e.props.id),s=()=>ve(n,t),{rowProps:i,...c}=be.row({item:{id:t,zone:ge,index:n},place:{...E(ge),index:n}},{onClick:U(s)});/* @__PURE__ */
|
|
11
|
+
return K(T,{children:[0===n&&we(ge,0),
|
|
12
|
+
/* @__PURE__ */Z(B,{words:ce,icon:/* @__PURE__ */Z(Ye,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */Z(I,{kind:"delete",label:ie.deleteNamed({name:r}),onClick:()=>{return e=n,void(ge&&(ee.removeComponent(ge,e),se(p),ee.select(null)));var e},children:/* @__PURE__ */Z(J,{size:13})}),rowProps:i}),we(ge,n+1)]},String(e.props.id??n))}),
|
|
13
|
+
/* @__PURE__ */K("button",{type:"button",className:"sf-add-card",onClick:ze,children:[
|
|
14
|
+
/* @__PURE__ */Z("span",{className:"sf-plus sf-plus--sm",children:"+"}),Fe.addLabel]}),je?Ne.partRows?.(ke,X):null]}):Ke(ke,1)})})]}),
|
|
15
|
+
/* @__PURE__ */Z("div",{className:"sf-center",children:/* @__PURE__ */Z("div",{className:"sf-preview-host",children:/* @__PURE__ */Z(ue,{})})}),
|
|
16
|
+
/* @__PURE__ */Z(t,{value:{selectChild:(e,n,o,r)=>"section"===Be(r)?.source?ve(n,o):Te(e,n,o),addChild:(e,n,o,r,t)=>"section"===Be(t)?.source?ze():Ge(`${e}:${n}`,o,r),childRowName:Re,blockRowName:Qe},children:/* @__PURE__ */Z(he,{mode:te,onOpenWebsiteSettings:Ne.openSettings??(()=>{}),onSelectNode:Oe,hideNodeActions:!0})})]}),
|
|
17
|
+
/* @__PURE__ */Z(S,{})]})}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{usePartBridge}from"../../chunk-
|
|
1
|
+
export{usePartBridge}from"../../chunk-JPCOBNYW.js";import"../../chunk-LSTOOYG7.js";import"../../chunk-TGSK5VII.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.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-HNV6HUSQ.js";import"../chunk-GXQCZJOP.js";import"../chunk-Z6V22QRZ.js";import"../chunk-OXZDSOZV.js";import"../chunk-7OCEPOEJ.js";import"../chunk-DSKNJXB4.js";import"../chunk-UMBNBCL4.js";import"../chunk-5XL2RXFU.js";import"../chunk-2FYFAAAK.js";import"../chunk-22I55W37.js";import"../chunk-3QB2ZQXK.js";import"../chunk-DDH2DYQP.js";import"../chunk-T3LAGI43.js";import"../chunk-KCBEE2MC.js";import"../chunk-C56MPJBH.js";import"../chunk-JPCOBNYW.js";import"../chunk-LSTOOYG7.js";import"../chunk-PY7OOQEZ.js";import"../chunk-RKTF5XLP.js";export{ScreenStoreProvider}from"../chunk-VHFLOHGQ.js";import"../chunk-5545A3PC.js";import"../chunk-NQ7NRYTK.js";import"../chunk-VKPOH6MK.js";import"../chunk-IZGFJWH4.js";import"../chunk-N7E6264U.js";import"../chunk-N3MJOHAG.js";import"../chunk-SINAM2IT.js";import"../chunk-UMDQ6CLQ.js";import"../chunk-RUQOIQWI.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-TGSK5VII.js";import"../chunk-2G6MAXPY.js";import"../chunk-AT4DDMJS.js";import"../chunk-GKG3M5QK.js";import"../chunk-A6ZP5II4.js";import"../chunk-77IWWW6X.js";import"../chunk-ERR437B5.js";import"../chunk-UNVKPVZW.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-BIK3AO2V.js";import"../chunk-LOMEH6DG.js";import"../chunk-KCOBHPN6.js";import"../chunk-FHCKFOCD.js";export{EaselSessionProvider,useEaselSession}from"../chunk-YM4UEGBV.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-SNF5764Q.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-MQA7OFRA.js";import"../chunk-XFYFKITX.js";import"../chunk-IYHO4XQX.js";import"../chunk-V7U33NF2.js";import"../chunk-6WY6ZXJG.js";import"../chunk-SSRYU3YG.js";import"../chunk-AJ2SUSET.js";import"../chunk-ANPOR6EY.js";import"../chunk-6UAEFOJ4.js";import"../chunk-R4AUZVA3.js";import"../chunk-TCAAOYQY.js";import"../chunk-VBOSOH5M.js";import"../chunk-TBY3DFKS.js";import"../chunk-6QSFJCJT.js";import"../chunk-BPXEFVSQ.js";import"../chunk-YCSZAP7T.js";import"../chunk-WHS6Y55E.js";import"../chunk-K56YDHYQ.js";import"../chunk-ZEH6QLBH.js";import"../chunk-AGWKB77Q.js";import"../chunk-ZKY45F5G.js";import"../chunk-FIVU2COQ.js";import"../chunk-P5VYGWYO.js";import"../chunk-WK3AFPXY.js";import"../chunk-RPMSET77.js";import"../chunk-FM6JO4WF.js";import"../chunk-KFV7N2DJ.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-ZG6PVMC3.js";import"../chunk-MJM6SFD3.js";import"../chunk-AJSDWWJW.js";import"../chunk-2OAZYSWJ.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-HZSZT3BE.js";import"../chunk-KRL3IUV3.js";import"../chunk-Y2T3JX7K.js";import"../chunk-KFWNGPW3.js";import"../chunk-JACEEVVF.js";import"../chunk-S3DUFDQ6.js";import"../chunk-MFIRYGHW.js";import"../chunk-LN43DP2A.js";import"../chunk-TQ5Y6S2X.js";import"../chunk-6NJHYXJM.js";import"../chunk-P2VEMZH5.js";import"../chunk-YU3WHLGI.js";import"../chunk-LF3FUSCQ.js";import"../chunk-TGZCD6IP.js";import"../chunk-KXM6YRG2.js";import"../chunk-BSPCSC45.js";import"../chunk-467WWV4I.js";import"../chunk-TIAWIOGD.js";import"../chunk-MGVI67QV.js";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { PreviewDevice } from '../../components/PreviewDeviceContext.js';
|
|
3
|
+
import { D as DeviceFieldTier, a as DeviceTier } from '../../../rowMarks-CO5TpfLY.js';
|
|
4
|
+
export { b as DEVICE_FIELD_MARKER, c as DeviceFieldMeta, d as deviceMetaOf } from '../../../rowMarks-CO5TpfLY.js';
|
|
3
5
|
import '../content/view-tiers.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
@@ -44,9 +46,6 @@ import '../content/view-tiers.js';
|
|
|
44
46
|
* instead of a second DOM pass (so it cannot race the fold's).
|
|
45
47
|
*/
|
|
46
48
|
|
|
47
|
-
/** The two tiers a stored value can belong to. Tablet is not one — see
|
|
48
|
-
* {@link shownTier}. */
|
|
49
|
-
type DeviceTier = "desktop" | "mobile";
|
|
50
49
|
/**
|
|
51
50
|
* Which tier's stored values the panel shows for a given preview device.
|
|
52
51
|
*
|
|
@@ -78,26 +77,13 @@ type AnyCustomField = {
|
|
|
78
77
|
type: "custom";
|
|
79
78
|
render: FieldRender;
|
|
80
79
|
};
|
|
81
|
-
/** Marker carried by every gated field, in the same style as
|
|
82
|
-
* {@link import("./controls").FOLD_FIELD_MARKER}: the tier and the field it
|
|
83
|
-
* wraps live ON the field object, never only inside the render closure. Without
|
|
84
|
-
* it a gated control is opaque to every static walk — and the fold guard in
|
|
85
|
-
* `scripts/test-section-groups.ts` genuinely needs to see the header underneath
|
|
86
|
-
* to check its label against what it draws. The old library ignores extra keys. */
|
|
87
|
-
declare const DEVICE_FIELD_MARKER: "__device";
|
|
88
|
-
/** The payload on {@link DEVICE_FIELD_MARKER}. */
|
|
89
|
-
type DeviceFieldMeta = {
|
|
90
|
-
tier: DeviceTier;
|
|
91
|
-
inner: unknown;
|
|
92
|
-
};
|
|
93
|
-
/** Read a field's device payload, or null when it is not gated. The ONE place
|
|
94
|
-
* that knows the marker's shape. */
|
|
95
|
-
declare function deviceMetaOf(field: unknown): DeviceFieldMeta | null;
|
|
96
80
|
/** The field a gate wraps, or the field itself when it wraps nothing — what a
|
|
97
81
|
* static walk wants to look at. */
|
|
98
82
|
declare function withoutDeviceGate(field: unknown): unknown;
|
|
99
83
|
/**
|
|
100
|
-
* Paint `field` only while the canvas is showing `tier
|
|
84
|
+
* Paint `field` only while the canvas is showing `tier` — or, with `"each"`, in
|
|
85
|
+
* every view, handing the control the tier it writes there (`tier` prop:
|
|
86
|
+
* `"mobile"` in the phone view, `"desktop"` otherwise). See `DeviceFieldTier`.
|
|
101
87
|
*
|
|
102
88
|
* Everything else about the field is preserved by identity-spread — its `type`,
|
|
103
89
|
* its manifest markers, its data keys — so the media and neutralization walks,
|
|
@@ -106,7 +92,7 @@ declare function withoutDeviceGate(field: unknown): unknown;
|
|
|
106
92
|
declare function deviceField<F extends {
|
|
107
93
|
type: "custom";
|
|
108
94
|
render: (p: never) => ReactElement;
|
|
109
|
-
}>(tier:
|
|
95
|
+
}>(tier: DeviceFieldTier, field: F): F;
|
|
110
96
|
/**
|
|
111
97
|
* The panel's device indicator — one quiet line, and only when there is
|
|
112
98
|
* something to say (see {@link DEVICE_NOTE}).
|
|
@@ -125,4 +111,4 @@ declare function deviceField<F extends {
|
|
|
125
111
|
*/
|
|
126
112
|
declare function deviceNote(): AnyCustomField;
|
|
127
113
|
|
|
128
|
-
export {
|
|
114
|
+
export { DEVICE_HIDDEN_ATTR, DEVICE_NOTE, DeviceFieldTier, DeviceTier, deviceField, deviceNote, shownTier, withoutDeviceGate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{DEVICE_HIDDEN_ATTR,DEVICE_NOTE,deviceField,deviceNote,shownTier,withoutDeviceGate}from"../../../chunk-2FYFAAAK.js";import"../../../chunk-22I55W37.js";import"../../../chunk-IYHO4XQX.js";export{DEVICE_FIELD_MARKER,deviceMetaOf}from"../../../chunk-YCSZAP7T.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-BSPCSC45.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
+
import { N as NoControlFieldMeta } from '../../../rowMarks-CO5TpfLY.js';
|
|
3
|
+
export { e as NO_CONTROL_FIELD, n as noControlMetaOf } from '../../../rowMarks-CO5TpfLY.js';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* panel-no-control-mark — what a settings field draws when it draws NO CONTROL
|
|
@@ -58,16 +60,10 @@ declare function NoControlMark(): ReactElement;
|
|
|
58
60
|
* It draws nothing on the section screen unless its prop is STRUCTURAL, which
|
|
59
61
|
* is the one question `SuppressibleText` also asks at render time.
|
|
60
62
|
*/
|
|
61
|
-
declare const NO_CONTROL_FIELD: "__noControl";
|
|
62
|
-
/** The payload on {@link NO_CONTROL_FIELD}. */
|
|
63
|
-
type NoControlFieldMeta = "always" | "authored-copy";
|
|
64
|
-
/** Read a field's no-control payload, or `null` when it draws a control of its
|
|
65
|
-
* own. The ONE place that knows the marker's shape. */
|
|
66
|
-
declare function noControlMetaOf(field: unknown): NoControlFieldMeta | null;
|
|
67
63
|
/** Stamp {@link NO_CONTROL_FIELD} on a field. The cast is here and nowhere else:
|
|
68
64
|
* The old library's field types have no slot for a marker, so an object literal carrying
|
|
69
65
|
* one trips the excess-property check at every call site otherwise — the same
|
|
70
66
|
* reason `group()` and the text/link markers have their own builders. */
|
|
71
67
|
declare function noControlField<F>(field: F, reason: NoControlFieldMeta): F;
|
|
72
68
|
|
|
73
|
-
export { NO_CONTROL_ATTR,
|
|
69
|
+
export { NO_CONTROL_ATTR, NoControlFieldMeta, NoControlMark, noControlField };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{NO_CONTROL_ATTR,
|
|
1
|
+
export{NO_CONTROL_ATTR,NoControlMark,noControlField}from"../../../chunk-22I55W37.js";export{NO_CONTROL_FIELD,noControlMetaOf}from"../../../chunk-YCSZAP7T.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-
|
|
1
|
+
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-DSKNJXB4.js";import"../../../chunk-5XL2RXFU.js";import"../../../chunk-2FYFAAAK.js";import"../../../chunk-22I55W37.js";import"../../../chunk-3QB2ZQXK.js";import"../../../chunk-IYHO4XQX.js";import"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-BSPCSC45.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-LSTOOYG7.js";import"../../../chunk-TGSK5VII.js";import"../../../chunk-FHCKFOCD.js";import"../../../chunk-MQA7OFRA.js";import"../../../chunk-TCAAOYQY.js";import"../../../chunk-VBOSOH5M.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-6QSFJCJT.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-WHS6Y55E.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-ZEH6QLBH.js";import"../../../chunk-AGWKB77Q.js";import"../../../chunk-FIVU2COQ.js";import"../../../chunk-RPMSET77.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-KRL3IUV3.js";import"../../../chunk-Y2T3JX7K.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-S3DUFDQ6.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-6NJHYXJM.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-YU3WHLGI.js";import"../../../chunk-LF3FUSCQ.js";import"../../../chunk-TGZCD6IP.js";import"../../../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-
|
|
1
|
+
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-T3LAGI43.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-RPMSET77.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,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,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-TGSK5VII.js";import"../../chunk-FHCKFOCD.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-VBOSOH5M.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-6QSFJCJT.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-S3DUFDQ6.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.1.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",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"./draw",
|
|
26
26
|
"./draw/client",
|
|
27
27
|
"./blocks",
|
|
28
|
+
"./data",
|
|
28
29
|
"./text-styles/model",
|
|
29
30
|
"./screen/lib/session",
|
|
30
31
|
"./screen/components/PreviewDeviceContext",
|
|
@@ -41,7 +42,6 @@
|
|
|
41
42
|
"./panel",
|
|
42
43
|
"./chrome",
|
|
43
44
|
"./tree",
|
|
44
|
-
"./data",
|
|
45
45
|
"./node-ops",
|
|
46
46
|
"./drag",
|
|
47
47
|
"./pick",
|
package/dist/chunk-4YUC7B7E.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{noControlField as e}from"./chunk-INRERJU4.js";import{DEFAULT_SCREEN_WORDS as n}from"./chunk-IYHO4XQX.js";import{useWords as r}from"./chunk-MFIRYGHW.js";import{usePreviewDevice as t}from"./chunk-BSPCSC45.js";import{jsx as o}from"react/jsx-runtime";function i(e){return"mobile"===e?"mobile":"desktop"}var c={desktop:null,tablet:n.deviceNote.tablet,mobile:n.deviceNote.mobile},u="data-sf-device-hidden";function d(){/* @__PURE__ */
|
|
2
|
-
return o("span",{hidden:!0,[u]:""})}function s({tier:e,render:n,...r}){return i(t())===e?/* @__PURE__ */o(n,{...r}):/* @__PURE__ */o(d,{})}var m="__device";function f(e){const n=e?.[m];return n??null}function l(e){return f(e)?.inner??e}function a(e,n){const r=n.render;return{...n,[m]:{tier:e,inner:n},render:n=>/* @__PURE__ */o(s,{tier:e,render:r,...n})}}function p(){const e=r("screen",n).deviceNote,i=t(),c="desktop"===i?null:e[i];return c?/* @__PURE__ */o("div",{className:"sf-device-scope",children:c}):/* @__PURE__ */o(d,{})}function v(){return e({type:"custom",render:()=>/* @__PURE__ */o(p,{})},"always")}export{m as DEVICE_FIELD_MARKER,u as DEVICE_HIDDEN_ATTR,c as DEVICE_NOTE,a as deviceField,f as deviceMetaOf,v as deviceNote,i as shownTier,l as withoutDeviceGate};
|
package/dist/chunk-6F5GO337.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-FOOK54T2.js";import{SELECTION_MODE as e}from"./chunk-GXRS52JD.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-KXTXYINN.js";import{usePreviewParts as p}from"./chunk-467WWV4I.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{k(l)},[k,l]);const K=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(K)},[K,f]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&I.select(r)},[i,u,I]),openPartId:K}}export{m as usePartBridge};
|
package/dist/chunk-G3HAKQUF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{panelFieldsOf as t}from"./chunk-5XL2RXFU.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-4YUC7B7E.js";import{DESIGN_GROUP_KEY as e,BUCKET_KEY as r}from"./chunk-3QB2ZQXK.js";import{STYLE_KIND as s,fieldKind as c,copyStyle as i,heldStyle as p,planPaste as u,pasteMessage as a}from"./chunk-V7U33NF2.js";import{ANCHOR_FIELD_KEYS as f,foldMetaOf as l,MEDIA_FIELD_MARKER as m,TEXT_FIELD_MARKER as h,LINK_FIELD_MARKER as y}from"./chunk-ANPOR6EY.js";var j=/* @__PURE__ */new Set([e.Size,e.Design,e.Layout,e.Position]),w=new Set(Object.values(e)),b=new Set(Object.values(r)),S=new Set(f),g=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[m,h,y];function v(t){return`site:${t??""}`}function O(t){if(!t||"object"!=typeof t)return null;const n=t,e=o(t)??t,r=n[s]??e[s];if("string"==typeof r)return r;const i=n.options??e.options;if(Array.isArray(i)){return`choice:${i.map(t=>String(t?.value)).sort().join("|")}`}return c(e)}function d(t){const n=t,e=o(t);return k.some(t=>t in n||e&&t in e)}function A(o,e){const s=t(o,e)??{},c=[];let i=!0,p=!1;for(const[t,o]of Object.entries(s))b.has(t)?(i=t===r.Design,p=!1):w.has(t)?i&&(p=j.has(t)):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(l(o)||S.has(t)||g.has(t)||d(o)||"slot"!==o.type&&c.push({path:[t],kind:O(o),counted:"mobile"!==n(o)?.tier}));return c}function F(t,o,n,e,r){i({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function L(t,o,n,e,r,s){const c=p(n);if(!c)return null;const i=u(c,{type:e.type,rows:t(o,e),props:e.props});return{...i,message:a(i,c.sourceLabel,r,s)}}function U(t,o,n,e){F(A,t,o,n,e)}function X(t,o,n,e,r){return L(A,t,o,n,e,r)}var B={scope:t=>v(t.siteId),rows:(t,o)=>A(t,o),copy:(t,o,n,e)=>U(e,t,o,n),plan:(t,o,n,e)=>X(e,t,o,n)};function D(t,o){if(!t&&!o)return B;const n=t?.rows,e=n?(t,o)=>n(t,o):A;return{scope:t?.scope??B.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>F(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>L(e,s,t,n,r,o))}}export{U as copyNodeStyle,A as nodeStyleRows,X as planNodePaste,O as shopFieldKind,v as siteStyleScope,D as styleClipboardOf};
|
package/dist/chunk-GXRS52JD.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{usePickFollowsSelection as n}from"./chunk-FHCKFOCD.js";import{slotFieldsOf as e}from"./chunk-TCAAOYQY.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-KXTXYINN.js";import{Inspector as i}from"./chunk-MXECWHRJ.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:"selection"};function f(n){return"selection"===n.kind}function a(n,e){if(f(n)&&f(e))return!0;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 d(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function p(n,t,r){const i=n.slotsOf?.(r);return i||e(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function m(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function k(n,e){return n.isLast?n.isLast(e):e.type===n.last}var h={},v=()=>h,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},C={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},j={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},w={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},L={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function N(){/* @__PURE__ */
|
|
2
|
-
return s(t,{height:"fill"})}function S(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
|
|
3
|
-
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var D=o({});function F({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return s(D.Provider,{value:n,children:e})}function I(){return u(D)}function P(){return(I().useOwnerName??g)()}function T(){return(I().useDocumentLabel??y)()}function x(n,e,t,r){return(I().useBridges??v)(n,e,t,r)}function A(n){return(I().useStandaloneBridges??v)(n)}function B(n,e){(I().useDocumentPass??b)(n,e)}function G(){return I().blockRules??O}function H(){return I().blockLook??C}function K(){return I().devices??j}function R(){return I().leftView??w}function X(){return I().pinned??L}function Y(){return I().saveSwitch??!0}function E(e){n(!0===I().pickFollowsSelection,e)}function J(){return I().storageNamespace||void 0}function M(){return I().styleClipboard??null}function Q(){return I().nodeKeys??!0}function V(){return I().notify??null}function W(){return I().Canvas??N}function Z(){return I().CanvasHead??null}function q(){return I().canvasDrag??null}var z=o(null);function U({target:n,children:e}){/* @__PURE__ */
|
|
5
|
-
return s(z.Provider,{value:n,children:e})}function $(){return u(z)}function _(){return I().Inspector??S}export{c as SELECTION_MODE,U as ScreenCanvasTargetProvider,F as ScreenPartsProvider,m as isPinnedFirst,k as isPinnedLast,f as isSelectionMode,d as isSlotMode,a as sameInspectorMode,p as screenSlotsOf,H as useScreenBlockLook,G as useScreenBlockRules,x as useScreenBridges,q as useScreenCanvasDrag,W as useScreenCanvasFrame,Z as useScreenCanvasHead,$ as useScreenCanvasTarget,K as useScreenDevices,T as useScreenDocumentLabel,B as useScreenDocumentPass,_ as useScreenInspectorPanel,R as useScreenLeftView,Q as useScreenNodeKeys,V as useScreenNotify,P as useScreenOwnerName,I as useScreenParts,E as useScreenPickFollowsSelection,X as useScreenPinned,Y as useScreenSaveSwitch,J as useScreenStorageNamespace,M as useScreenStyleClipboard,A as useStandaloneScreenBridges};
|
package/dist/chunk-INRERJU4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";var r="data-sf-no-control";function t(){/* @__PURE__ */
|
|
2
|
-
return n("span",{[r]:"",hidden:!0})}var o="__noControl";function u(n){const r=n?.[o];return r??null}function e(n,r){return{...n,[o]:r}}export{r as NO_CONTROL_ATTR,o as NO_CONTROL_FIELD,t as NoControlMark,e as noControlField,u as noControlMetaOf};
|
package/dist/chunk-KXTXYINN.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_CANVAS_WORDS as e}from"./chunk-TBY3DFKS.js";import{useResolvedFields as t}from"./chunk-AGWKB77Q.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r,parentStep as l,clickPickPart as i,clickPick as s}from"./chunk-RPMSET77.js";import{selectionBox as a,placeWindow as c,offsetOrigin as d,colorRunOf as u,ColorWindow as p,startCanvasTyping as f,textMap as h}from"./chunk-HZSZT3BE.js";import{DEFAULT_COPY_WORDS as m}from"./chunk-KRL3IUV3.js";import{useWords as g}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as v,CANVAS_TYPABLE_EVENT as y,related as w,isTypingTarget as b,WORDS_CLEAR as k,frameRectToHost as S,CANVAS_TYPING_EVENT as C,drawnBox as I}from"./chunk-YU3WHLGI.js";import{queryAllCopies as E}from"./chunk-LF3FUSCQ.js";import{find as D,ROOT_ID as x,getList as O,remove as A,parseZoneKey as M,move as R,duplicate as z,replaceNode as P,createNode as $,insert as L,normalizeData as N,createResolveCache as j,slotsOf as B,resolveNodeData as V,ROOT_SLOT as K}from"./chunk-TGZCD6IP.js";import{topLevelSlotKeys as Z,fieldsFrom as T,drawnBlockCount as F,defaultsFrom as H}from"./chunk-KXM6YRG2.js";import{createContext as W,useEffect as Y,useContext as U,useRef as q,useSyncExternalStore as G,useState as Q,useReducer as X,useMemo as J,useCallback as _,useLayoutEffect as ee}from"react";import{jsx as te,jsxs as ne,Fragment as oe}from"react/jsx-runtime";import{createPortal as re}from"react-dom";import{registerModalEscapeInterceptor as le,FloatingBar as ie,TextToolbar as se,LinkPicker as ae}from"efficient-shell/ui";function ce(e){return!["setData","setUi","set"].includes(e.type)}var de=(e,t,n,o)=>{const r=O(e,t,M(n));return r?.[o]??null},ue=(e,t,n,o,r)=>{const l=de(e,t,n,o);if(!l)throw new Error(`${r}: nothing at ${n}[${o}]`);return l};function pe(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 fe(e,t,n){return n?"node"===n.kind?D(e,t,n.id)?n:null:n.parentId===x?O(e,t,n)?n:null:D(e,t,n.parentId)&&O(e,t,n)?n:null:null}function he(e,t,n,r=!1){const{itemSelector:l,selectedSlot:i,...s}=n;let a=e.selection;var c;return"itemSelector"in n&&(a=o(e.data,t,l??null)),"selectedSlot"in n&&(i?a=(c=i)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===a?.kind&&(a=null)),{...e,selection:a,ui:r?s:{...e.ui,...s}}}function me(e,t,n){const o=ge(e,t,n);if(o===e)return e;const r=fe(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function ge(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 he(e,n,"function"==typeof t.ui?t.ui(pe(e,n)):t.ui);case"set":{const r={data:o,ui:pe(e,n)},l="function"==typeof t.state?t.state(r):t.state;let i=l.data?{...e,data:l.data}:e;return l.ui&&(i=he(i,n,l.ui,!0)),i}case"insert":{const r={...M(t.destinationZone),index:t.destinationIndex},l=$(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:L(o,n,r,l)}}case"replace":{const r=ue(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:P(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=ue(o,n,t.sourceZone,t.sourceIndex,"duplicate"),l=z(o,n,r.props.id),i=de(l,n,t.sourceZone,t.sourceIndex+1);return{...e,data:l,selection:i?{kind:"node",id:i.props.id}:e.selection}}case"reorder":return ge(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=de(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const l={...M(t.destinationZone),index:t.destinationIndex};return{...e,data:R(o,n,r.props.id,l)}}case"remove":{const r=ue(o,n,t.zone,t.index,"remove");return{...e,data:A(o,n,r.props.id)}}default:return e}}var ve={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},ye={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},we=0,be=()=>`history-${we+=1}`;function ke(e){let t=e.config;const r=e.now??(()=>Date.now()),l=e.historyCoalesceMs??250;let i=e.permissions??{};const s=N(e.data,t);let a=s,c={data:s,selection:null,ui:{...ye}};if(e.ui){const{itemSelector:n,selectedSlot:r,...l}=e.ui;c={data:s,selection:r?{kind:"slot",...r}:o(s,t,n??null),ui:{...ye,...l}}}let d=[{core:c,at:-1/0,sealed:!0,id:be()}],u=0;const p=e=>{const t=d[u],n=r();!e&&u===d.length-1&&u>0&&!t.sealed&&n-t.at<l?d=[...d.slice(0,u),{...t,core:c,at:n}]:(d=[...d.slice(0,u+1),{core:c,at:n,sealed:e,id:be()}],u=d.length-1)},f=/* @__PURE__ */new Set;let h=null,m=null,g=0,v=null,y=!1;const w=()=>{for(const e of[...f])e()},b=()=>{d=[...d.slice(0,u),{...d[u],core:c},...d.slice(u+1)]},k=(t,n)=>{g>0?y=y||n:(n?p(!1):c!==t&&b(),c.data!==t.data&&e.onChange?.(c.data),c!==t&&w())},S=e=>{const n=c;if(c=me(c,e,t),c===n)return;const o=e.recordHistory??ce(e);k(n,o&&c.data!==n.data)},C=t=>{0===g&&(v=c,y=!1),g+=1;try{t()}catch(e){throw g-=1,0===g&&v&&(c=v,v=null),e}if(g-=1,g>0||!v)return;const n=v;v=null,y&&c.data!==n.data?p(!0):c!==n&&b(),c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},I=e=>{const n=c,o=fe(c.data,t,e);var r,l;(r=o,l=c.selection,r===l||r&&l&&r.kind===l.kind&&("node"===r.kind&&"node"===l.kind?r.id===l.id:"slot"===r.kind&&"slot"===l.kind&&r.parentId===l.parentId&&r.slot===l.slot))||(c={...c,selection:o},k(n,!1))},E=t=>{const n=c;u=t,c=d[u].core,c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},x=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...ve,...i,...n}};let A=x();const M=j(),R={resolveCache:M,async resolveAll({trigger:e="load",metadata:n}={}){const o=c.data,r={type:"root",props:{...o.root.props??{}}},l=[...o.content,...Object.values(o.zones??{}).flat()],[i,...s]=await Promise.all([V(r,t,{cache:M,trigger:e,metadata:n}),...l.map(o=>V(o,t,{cache:M,trigger:e,metadata:n}))]);C(()=>{const n=c;let r=c.data;s.forEach((e,n)=>{if(!e.didChange)return;const i=l[n].props.id,s=D(r,t,i)?.node;s&&s===D(o,t,i)?.node&&(r=P(r,t,i,e.node))}),i.didChange&&r.root===o.root&&(r={...r,root:{...r.root,props:i.node.props,readOnly:i.node.readOnly??r.root.readOnly}}),r!==c.data&&("load"===e&&c.data===a&&(a=r),c={...c,data:r,selection:fe(r,t,c.selection)},k(n,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=D(c.data,t,e)?.node;if(!r)return!1;const l=await V(r,t,{cache:M,trigger:n,metadata:o});if(!l.didChange)return!1;let i=!1;return C(()=>{const n=c;if(D(c.data,t,e)?.node!==r)return;const o=P(c.data,t,e,l.node);o!==c.data&&(c={...c,data:o,selection:fe(o,t,c.selection)},k(n,!1),i=!0)}),i},get config(){return t},get loaded(){return a},getState(){if(h&&m===c)return h;const e=c,o={data:e.data,ui:pe(e,t)},r="node"===e.selection?.kind?D(e.data,t,e.selection.id)?.node??null:null;return h={appState:o,selection:e.selection,selectedItem:r,config:t,dispatch:S,history:{back:()=>R.undo(),forward:()=>R.redo(),hasPast:u>0,hasFuture:u<d.length-1,histories:d.map(e=>({id:e.id,state:{data:e.core.data,ui:pe(e.core,t)}})),index:u,setHistoryIndex:e=>{e>=0&&e<d.length&&e!==u&&E(e)}},getPermissions:A,getItemById:n=>D(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return O(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,h},subscribe:e=>(f.add(e),()=>{f.delete(e)}),dispatch:S,batch:C,group:()=>{const e=u,t=d[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,d[e]?.id!==t)return;if(u<=e+1)return void(u===e+1&&(d=[...d.slice(0,u),{...d[u],sealed:!0},...d.slice(u+1)]));const o=d[u];d=[...d.slice(0,e+1),{...o,sealed:!0},...d.slice(u+1)],u=e+1}}},select:e=>I(e?{kind:"node",id:e}:null),selectSlot:e=>I(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){C(()=>{const n=c,o=void 0===e.select?c.selection:e.select;c={...c,data:e.data,selection:fe(e.data,t,o)},k(n,e.data!==n.data)})},load(e,n={}){const o=c,r=N(e,t);c={...c,data:r,selection:fe(r,t,n.selection??c.selection)},a=r,n.keepHistory||(d=[{core:c,at:-1/0,sealed:!0,id:be()}],u=0),c!==o&&w()},undo(){u>0&&E(u-1)},redo(){u<d.length-1&&E(u+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,i)||(i=e,A=x(),h=null,w())},setConfig(e){e!==t&&(t=e,A=x(),h=null,w())}};return R}function Se(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&&b(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 Ce=W(null),Ie=W(!0);function Ee({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return Y(()=>{n&&e.resolveAll()},[e,n]),Y(()=>{if(t&&"undefined"!=typeof document)return Se(document,e)},[e,t]),/* @__PURE__ */te(Ce.Provider,{value:e,children:/* @__PURE__ */te(Ie.Provider,{value:t,children:o})})}function De(){const e=U(Ce);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function xe(e){const t=De(),n=q({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 l=e(o);return r.has&&Object.is(r.value,l)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:l,has:!0},l)};return G(t.subscribe,o,o)}function Oe(){return function(e){return xe(e)}}var Ae="data-easel-block",Me="data-easel-dropzone",Re={},ze="data-es-mirror",Pe="undefined"==typeof window?Y:ee;function $e(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${ze}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(ze,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function Le({children:t,id:n="preview-frame",title:o,className:r,style:l,mirrorStyles:i=!0,onDocument:s,height:a="auto",nonce:c}){const d=g("canvas",e),u=q(null),[p,f]=Q(null);return Pe(()=>{const e=u.current,t=p?.ownerDocument.defaultView;if("auto"!==a||!e||!p||!t)return;const n=()=>{e.style.height=`${Math.ceil(p.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(p),()=>r?.disconnect()},[p,a]),Pe(()=>{let e=u.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=u.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-easel-entry",""),t.id="frame-root","fill"===a&&t.classList.add("es-frame-fill"),e.body.appendChild(t),v(e,c),f(t),s?.(e);let n=null;const o=u.current?.ownerDocument;if(i&&o){$e(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>$e(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}return()=>{n?.disconnect(),t.remove(),f(null),s?.(null)}},[]),/* @__PURE__ */te("iframe",{ref:u,id:n,title:o??d.frame,className:["es-canvas-frame","fill"===a?"is-fill":"",r??""].filter(Boolean).join(" "),style:l,children:p?re(t,p):null})}var Ne=W(null),je=W(Re),Be=[];function Ve({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:l=120}){const i=De(),s=xe(n=>O(n.appState.data,i.config,{parentId:e,slot:t})??Be),a=xe(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==x),c=xe(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),d=U(Ne),u=["es-zone"];return s.length&&u.push("has-children"),e===x&&u.push("is-root"),(a||c)&&u.push("is-area-selected"),null!==d&&d===e&&e!==x&&u.push("is-hovering-area"),n&&u.push(n),/* @__PURE__ */te("div",{className:u.join(" "),[Me]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${l}px`},children:s.map(e=>/* @__PURE__ */te(Ue,{node:e},e.props.id))})}function Ke(e,t,n,o){const r=J(()=>{const n={};for(const o of Z(T(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
|
|
2
|
-
return te(Ve,{parentId:t,slot:o,...e})},{blockCount:0});return n},[e,t]);for(const e of Object.keys(r))r[e].blockCount=F(n[e],o);return r}function Ze(e){return J(()=>function({zone:t,...n}){/* @__PURE__ */
|
|
3
|
-
return te(Ve,{parentId:e,slot:t,...n})},[e])}var Te=["top","bottom","zIndex"];function Fe(e,t,n){e.style[t]!==n&&(e.style[t]=n)}function He(e){const t=function(e){const t=e?.ownerDocument.defaultView?.getComputedStyle(e);if(!t||"sticky"!==t.position)return null;const n=e=>"auto"===e?"":e;return{top:n(t.top),bottom:n(t.bottom),zIndex:n(t.zIndex)}}(function(e){const t=e.ownerDocument.defaultView;let n=null;for(const o of Array.from(e.children))if("none"!==t?.getComputedStyle(o).display){if(n)return null;n=o}return n}(e));Fe(e,"position",t?"sticky":"relative");for(const n of Te)Fe(e,n,t?.[n]??"");return!!t}var We="data-es-canvas-relative";function Ye(e){e.hasAttribute(We)&&("relative"===e.style.position&&(e.style.position=""),e.removeAttribute(We));const t=e.ownerDocument.defaultView?.getComputedStyle(e).position;return t&&"static"!==t?"sticky"===t:(e.style.position||(e.style.position="relative",e.setAttribute(We,"")),!1)}function Ue({node:e}){const t=De().config,n=t.components[e.type],o=e.props.id,r=q(null),l=function(e,t){return J(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(Ae),o.removeAttribute("data-easel-dnd")),t.current=n,n&&(n.setAttribute(Ae,e),n.setAttribute("data-easel-dnd",e),Ye(n))},[e,t])}(o,r),i=q(null),s=!!n?.inline;!function(e,t){const n=q(!1),o=q(()=>{});o.current=()=>{const o=e(),l=n.current;n.current=!!o&&t(o),l!==n.current&&r.current()};const r=q(()=>{});Pe(()=>o.current()),Pe(()=>{const t=e(),l=t?.ownerDocument.defaultView;if(!t||!l)return;const i=()=>o.current();l.addEventListener("resize",i);const s=l.ResizeObserver,a=s?new s(i):null;a?.observe(t);let c=null;return r.current=()=>{c?.disconnect(),c=null;const e=t.ownerDocument.documentElement;n.current&&e&&l.MutationObserver&&(c=new l.MutationObserver(i),c.observe(e,{attributes:!0}))},r.current(),()=>{l.removeEventListener("resize",i),a?.disconnect(),c?.disconnect(),r.current=()=>{}}},[])}(()=>s?r.current:i.current,e=>s?Ye(e):He(e));const a=U(je),c=Ke(n,o,e.props,t.components),d=Ze(o);if(!n?.render)return null;const u=n.render,p={...H(n),...e.props,...c},f={renderDropZone:d,isEditing:!0,dragRef:n.inline?l:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */te(u,{...p,editor:f,editMode:!0}):
|
|
4
|
-
/* @__PURE__ */te("div",{ref:i,[Ae]:o,"data-easel-dnd":o,style:{position:"relative"},children:/* @__PURE__ */te(u,{...p,editor:f,editMode:!0})})}function qe({metadata:e}){const t=xe(e=>e.config),n=xe(e=>e.appState.data.root).props??{},o=t.root?.render,r=Ke(t.root,x,n,t.components),l=Ze(x),i=/* @__PURE__ */te(Ve,{parentId:x,slot:K}),s=o?/* @__PURE__ */te(o,{id:"page-root",...n,...r,editor:{renderDropZone:l,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:i}):i;/* @__PURE__ */
|
|
5
|
-
return te(je.Provider,{value:e??Re,children:s})}var Ge=W(void 0),Qe=W(void 0);function Xe(e,t,n,o){const r=D(e,t,n);return!!r&&(B(r.node,t).length>0||!1===o.whole)}var Je=W(void 0);function _e({element:e}){const t=q(null),n=nt(t,e?()=>e:null,e);/* @__PURE__ */
|
|
6
|
-
return te("div",{ref:t,"aria-hidden":"true",className:"es-canvas-outline is-hover is-hover-part",style:n?{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height}:{display:"none"}})}var et={"--es-words-clear":`${k}px`};function tt({element:e,words:t=!1}){const n=q(null),o=nt(n,e?()=>e:null,e);/* @__PURE__ */
|
|
7
|
-
return te("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-selected is-selected-part"+(t?" is-words":""),style:o?{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,...et}:{display:"none"}})}function nt(e,t,n){return rt(e,t?e=>{const n=t(e);return n?[n]:[]}:null,n)[0]??null}var ot=[];function rt(e,t,n){const[o,r]=Q(ot),l=q(t);return l.current=t,Pe(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!l.current)return void r(ot);let o=0;const i=()=>{o=0;const n=e.current?.parentElement??null,i=(l.current?l.current(t):[]).map(e=>function(e,t){if(!e||!t)return null;const n=I(e),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(e,n)).filter(e=>null!==e);r(e=>{return(t=e)===(n=i)||t.length===n.length&&t.every((e,t)=>function(e,t){return e===t||!!e&&!!t&&e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height}(e,n[t]))?e:i.length?i:ot;var t,n})},s=()=>{o||(o=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(i))};i();const a="MutationObserver"in n?new n.MutationObserver(s):null;a?.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),()=>{a?.disconnect(),c?.disconnect(),n.removeEventListener("resize",s),o&&(n.cancelAnimationFrame??n.clearTimeout)(o)}},[n]),o}function lt({id:e,kind:t,overlay:n}){const o=q(null),r=U(Qe),l=null!==e&&!0===r?.(e),i=rt(o,e?t=>E(t,`[${Ae}="${t.defaultView?.CSS?.escape?t.defaultView.CSS.escape(e):e}"]`):null,e),[s,...a]=i,c=`es-canvas-outline is-${t}${l?" is-shared":""}`,d=e=>({position:"absolute",top:e.top,left:e.left,width:e.width,height:e.height}),u=/* @__PURE__ */ne(oe,{children:[
|
|
8
|
-
/* @__PURE__ */te("div",{ref:o,"aria-hidden":"true",className:c,style:s?d(s):{display:"none"}}),a.map((e,t)=>/* @__PURE__ */te("div",{"aria-hidden":"true",className:c,style:d(e)},t))]});return n&&e?/* @__PURE__ */te(n,{componentId:e,kind:t,children:u}):u}function it(e,t,n){const o=h(e,n),r=o.text.length,l=e.ownerDocument;if(!t)return[r,r];let i=null;const s=l.caretPositionFromPoint?.(t.x,t.y);if(s&&e.contains(s.offsetNode))i=o.at(s.offsetNode,s.offset);else{const n=l.caretRangeFromPoint?.(t.x,t.y);n&&e.contains(n.startContainer)&&(i=o.at(n.startContainer,n.startOffset))}if(null===i)return[r,r];const a=o.text;let c=i,d=i;for(;c>0&&!/\s/.test(a[c-1]);)c-=1;for(;d<a.length&&!/\s/.test(a[d]);)d+=1;return[c,d]}function st({s:e,element:t,toolbar:n,label:o,keys:r}){const l=g("copy",m),i=e.pressed(),s=new Set(n.offered),f=n.colors&&n.colors.length>0?n.colors:null,h=q(null),[v,y]=Q(!1),[w,b]=Q(null),k=v||null!==w,C=()=>{e.hold(),y(!1),b({href:e.pressed().href})},I=()=>{y(!1),b(null),e.resume()};ee(()=>{r.current={escape:()=>!!k&&(I(),!0),link:()=>!!s.has("link")&&(C(),!0)}}),ee(()=>()=>{r.current=null},[r]);const E=q(I);E.current=I,Y(()=>{if(v)return le(e=>{const t=h.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(E.current(),!0)},()=>h.current?.querySelector(".es-copy-colors"))},[v]),Y(()=>{const n=h.current;if(!k||!n)return;const o=/* @__PURE__ */new Set([n.ownerDocument]),r=t();r&&o.add(r.ownerDocument);const l=o=>{const r=o.target;if(r&&n.contains(r))return;y(!1),b(null);const l=t();r&&l&&l.contains(r)?e.release():e.stop("outside")};for(const e of o)e.addEventListener("pointerdown",l,!0);return()=>{for(const e of o)e.removeEventListener("pointerdown",l,!0)}},[k,e,t]),ee(()=>{const e=h.current,n=e?.querySelector(".rosh-tb-wrap > .es-copy-pop"),o=t();if(!(k&&e&&n&&o))return;const r=o.ownerDocument.defaultView?.getSelection()??null,l=r&&r.rangeCount>0&&o.contains(r.getRangeAt(0).startContainer)?r.getRangeAt(0):null,i=(l?a(l,o):null)??(()=>{const e=o.getBoundingClientRect();return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}})(),s=o.ownerDocument.defaultView?.frameElement,u=s?S(s,{left:i.left,top:i.top,width:i.right-i.left,height:i.bottom-i.top}):{left:i.left,top:i.top,width:i.right-i.left,height:i.bottom-i.top},p=o.getBoundingClientRect(),f=s?S(s,{left:p.left,top:p.top,width:p.width,height:p.height}):{left:p.left,top:p.top,width:p.width,height:p.height},m=(e.closest("[data-floating-bar]")??e).getBoundingClientRect(),g={left:u.left,right:u.left+u.width,top:Math.min(u.top,f.top-6,m.top),bottom:Math.max(u.top+u.height,f.top+f.height+6,m.bottom)},v=e.ownerDocument.documentElement,y=(s??o.closest(".es-canvas")??o).getBoundingClientRect(),w={left:Math.max(0,y.left),top:Math.max(0,y.top),right:Math.min(v.clientWidth||y.right,y.right),bottom:Math.min(v.clientHeight||y.bottom,y.bottom)};if(w.right<=w.left||w.bottom<=w.top||0===n.offsetWidth)return;const b=c({anchor:g,size:{width:n.offsetWidth,height:n.offsetHeight},within:{left:y.left,top:y.top,right:y.right,bottom:y.bottom},clip:w,parent:d(n)});n.style.top=`${b.top}px`,n.style.left=`${b.left}px`,n.style.setProperty("--es-pop-point",`${b.point}px`),n.dataset.side=b.above?"above":"below"});const D=f?{run:u(i.color,f),open:v,onToggle:()=>{b(null),v?I():(e.hold(),y(!0))}}:void 0;/* @__PURE__ */
|
|
9
|
-
return te(ie,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?S(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__ */te("div",{ref:h,children:/* @__PURE__ */te(se,{layout:"row",offered:s,pressed:i.marks,onMark:t=>{"link"===t?C():e.press(t)},color:D,linkOpen:null!==w,list:{pressed:i.list,onList:t=>e.list(t)},clear:i.clearable?{onClear:()=>e.clear()}:void 0,alignment:n.alignment,letterCase:n.letterCase,last:n.lastTool?.({className:"rosh-tb-btn",disabled:!1,selected:i.selected,keepCaret:t=>{t.preventDefault(),e.hold()},insert:t=>e.insert(t)}),windows:/* @__PURE__ */ne(oe,{children:[v&&f?/* @__PURE__ */te(p,{colors:f,current:i.color,words:l.colors??m.colors,onPick:t=>e.color(t)}):null,w?
|
|
10
|
-
/* @__PURE__ */te(ae,{className:"es-copy-link es-copy-pop",value:w.href??"",onApply:t=>{b(null),e.link(t)},onRemove:null!==w.href?()=>{b(null),e.link(null)}:void 0,onCancel:I}):null]})})})})}function at({element:e,which:t}){const n=q(null),o=nt(n,()=>e(),t);/* @__PURE__ */
|
|
11
|
-
return te("div",{ref:n,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:o?{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,...et}:{display:"none"}})}function ct({frame:t=!0,className:n,style:o,metadata:r,mirrorStyles:a,onDocument:c,height:d,title:u,nonce:p,hotkeys:h,frameWrapper:m,overlay:v,children:b,typing:k,passThrough:S}){const I=De(),E=U(Ge),x=S??E,O=U(Ie),A=g("canvas",e),M=h??O,[R,z]=Q(void 0),P=xe(e=>"node"===e.selection?.kind?e.selection.id:null),[$,L]=Q(null),[N,j]=Q(null),V=U(Je),[,K]=X(e=>e+1,0),Z=e=>{V?.select(e),K()},[T,F]=Q(null),H=q(null),[,W]=Q(0),G=q(k);G.current=k;const J=q(null),_=q(null),ee=()=>{if(!P)return null;const e=G.current?.atSelection?.()?.element()??null;if(!e)return null;const t=_.current?.ownerDocument;if(V){const n=V.selected()&&t?V.selectedPart?.(t)??null:null;return n&&w(n.element,e)?n.element:null}const n=D(I.getState().appState.data,I.config,P);return n&&0===B(n.node,I.config).length?e:null},oe=xe(e=>e.appState.data),re=V?.selected()??null;Y(()=>{const e=_.current?.ownerDocument,t=e?.defaultView?.CustomEvent;if(!e||!t)return;const n=P&&!T&&G.current?.atSelection?.()?P:null,o=n?ee():null;e.dispatchEvent(new t(y,{detail:o?{id:n,words:o}:{id:n}}))},[P,T,oe,re]);const le=e=>{const t=_.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(C,{detail:{typing:e}}))},ie=(e,t)=>{H.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=I.group(),r=e.element,l=f({element:r,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:it(n,t,e.skip),write:e.write,remount:e.remount,onSelect:()=>W(e=>e+1),onEscape:()=>J.current?.escape()??!1,onLinkKey:()=>J.current?.link()??!1,end:e=>{o.close(),H.current?.element===r&&(H.current=null),F(null),le(!1),G.current?.onChange?.({typing:!1,why:e})}});if(!l)return o.close(),!1;const i=n.closest?.(`[${Ae}]`)?.getAttribute(Ae);return i&&I.select(i),H.current={s:l,element:r,target:e},F(()=>r),L(null),le(!0),G.current?.onChange?.({typing:!0,element:n}),!0};Y(()=>()=>H.current?.s.stop("stop"),[]);const se=e=>{const t=H.current?.element();return Boolean(t&&t.contains(e))},ae=(e,t)=>Xe(I.getState().appState.data,I.config,e,t),ce=e=>{const t=e.closest?.(`[${Ae}]`)?.getAttribute(Ae);if(!t)return;const n=I.getState(),o="node"===n.selection?.kind?n.selection.id:null,r=V?.partAt(e,t)??null;if(r){const e=i(n.appState.data,I.config,t,r.id,o,V?.selected()??null,x);if(e)return{node:e.node,part:e.part?r:null}}return{node:s(n.appState.data,I.config,t,o,x)??t,part:null}},de=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(H.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=G.current?.atSelection?.();n&&ie(n,null)&&e.preventDefault()},ue=_.current?.ownerDocument??null,pe=V?.selected()&&ue&&P?V.selectedPart?.(ue)??null:null,fe=pe&&P&&ae(P,pe)?pe.element:null,he=T?null:ee(),me=/* @__PURE__ */ne("div",{ref:_,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),H.current){if(se(t))return;H.current.s.stop("outside")}const n=t.ownerDocument?.getSelection?.();n&&n.rangeCount>0&&n.isCollapsed&&n.removeAllRanges();const o=ce(t);if(void 0!==o)return I.select(o.node),void(V&&(o.part?.id??null)!==V.selected()&&Z(o.part?.id??null));t.hasAttribute?.(Me)||(I.select(null),V?.selected()&&Z(null))},onDoubleClick:e=>{const t=G.current;if(!t||se(e.target))return;const n=t.at(e.target);n&&ie(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>de(e),onMouseOver:e=>{if(H.current)return;const t=ce(e.target),n=!!t?.part&&ae(t.node,t.part),o=t?.part&&n&&t.part.id!==V?.selected()?t.part:null,r=!t||t.part&&n?null:t.node;r!==$&&L(r),o?.id===N?.id&&o?.element===N?.element||j(o)},onMouseLeave:()=>{L(null),j(null)},children:[
|
|
12
|
-
/* @__PURE__ */te(Ne.Provider,{value:$,children:/* @__PURE__ */te(qe,{metadata:r})}),
|
|
13
|
-
/* @__PURE__ */ne("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
14
|
-
/* @__PURE__ */te(lt,{id:!T&&$&&$!==P?$:null,kind:"hover",overlay:v}),V?/* @__PURE__ */te(_e,{element:T||!N||N.id===V.selected()?null:N.element}):null,he||fe?/* @__PURE__ */te(tt,{element:T?null:he??fe,words:null!==he}):null,
|
|
15
|
-
/* @__PURE__ */te(lt,{id:T||fe||he?null:P,kind:"selected",overlay:v}),T?/* @__PURE__ */te(at,{element:()=>{const e=T?.()??null;return e?pe&&w(pe.element,e)?pe.element:e:null},which:pe?.element??T}):null]}),b]}),ge=m?/* @__PURE__ */te(m,{document:R,children:me}):me;Y(()=>{if(R&&M)return Se(R,I)},[R,M,I]),Y(()=>{if(!R)return;const e=e=>{if("Enter"===e.key)return void de(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=I.getState();if("node"!==n.selection?.kind)return;if(V?.selected())return void Z(null);const o=l(n.appState.data,I.config,n.selection);"node"===o?.kind&&I.select(o.id)};return R.addEventListener("keydown",e),()=>R.removeEventListener("keydown",e)},[R,I,V]);/* @__PURE__ */
|
|
16
|
-
return ne("div",{className:"es-canvas"+(n?` ${n}`:""),style:o,"data-easel-preview":"","data-es-typing":T?"":void 0,children:[T&&H.current?.target.toolbar?/* @__PURE__ */te(st,{s:H.current.s,element:H.current.element,toolbar:H.current.target.toolbar,label:A.textTools,keys:J}):null,t?/* @__PURE__ */te(Le,{mirrorStyles:a,onDocument:e=>{z(e??void 0),c?.(e)},height:d,title:u,nonce:p,children:ge}):/* @__PURE__ */te("div",{id:"preview-frame","data-easel-entry":"",children:ge})]})}function dt(e={}){const t=De(),n=xe(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function ut(){return ft(xe(e=>e.selectedItem))}function pt(){return ft(null)}function ft(e){const n=De(),o=xe(e=>e.config),r=n.resolveCache,l=xe(e=>e.appState.data.root),i=e?e.props.id:"root",s=l.props??{},a=J(()=>e||{type:"root",props:s},[e,s]),c=e?o.components[e.type]:o.root,d=n.getState(),u=e?D(d.appState.data,o,i):null,p=u&&"root"!==u.place.parentId?u.place.parentId:null,f=p?d.getItemById(p)??null:null,{fields:h}=t({id:i,node:a,block:c,parent:f,appState:d.appState}),m=xe(t=>!1===t.getPermissions(e?{item:e}:{root:!0}).edit),g=_(e=>{(async()=>{const t=n.getState();if("root"!==i){const l=t.getItemById(i),s=t.getSelectorForId(i);if(!l||!s)return;const a={...l,props:{...l.props,...e}},{node:c}=await V(a,o,{cache:r,trigger:"replace"}),d=n.getState().getSelectorForId(i);if(!d)return;return void n.dispatch({type:"replace",destinationZone:d.zone??"root:default-zone",destinationIndex:d.index,data:c})}const l=t.appState.data.root.props??{},{node:s}=await V({type:"root",props:{...l,...e}},o,{cache:r,trigger:"replace"});n.dispatch({type:"replaceRoot",root:{props:s.props,readOnly:s.readOnly},recordHistory:!0})})()},[n,o,r,i]),v=_((e,t)=>g({[e]:t}),[g]);return{id:i,node:a,fields:h,values:a.props,readOnly:m,onChange:v,onChangeMany:g}}export{Le as CanvasFrame,Je as CanvasPartsContext,Ge as CanvasPassThroughContext,Qe as CanvasSharedContext,ye as DEFAULT_UI,ct as EaselCanvas,Ee as EaselProvider,qe as EditDocument,Se as bindUndoKeys,ke as createEasel,Oe as createUseEasel,Xe as partHasOwnBox,ce as recordsByDefault,me as reduce,pe as uiView,xe as useEasel,De as useEaselApi,dt as useEaselNodeOps,pt as useRootFields,ut as useSelectedFields,fe as validSelection};
|
package/dist/chunk-MXECWHRJ.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{fieldIsShown as e,shownFields as n}from"./chunk-BPXEFVSQ.js";import{TreeSeam as t}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as l}from"./chunk-K56YDHYQ.js";import{easelMenuEntries as a}from"./chunk-FIVU2COQ.js";import{SETTINGS_BUCKETS as r,SettingsGroup as o}from"./chunk-FM6JO4WF.js";import{DEFAULT_PANEL_WORDS as i}from"./chunk-KFV7N2DJ.js";import{FieldNumber as s}from"./chunk-Y2T3JX7K.js";import{FieldSelect as c}from"./chunk-KFWNGPW3.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-JACEEVVF.js";import{SettingsField as u,SettingsSegmented as m}from"./chunk-S3DUFDQ6.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as f}from"./chunk-6NJHYXJM.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{Textarea as g,Input as v,ItemCount as y,SortableList as k,ListRow as x,ContextMenu as w,tabPanelId as C,Tabs as N,tabButtonId as O}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as j,useState as $,useLayoutEffect as S,useId as D}from"react";import{jsx as I,jsxs as F}from"react/jsx-runtime";import{ChevronIcon as P,LockIcon as L,MoveUpIcon as E,MoveDownIcon as M,DuplicateIcon as W,TrashIcon as T}from"efficient-shell/icons/efficient";function z({id:e,value:n,onChange:t,placeholder:l,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */I(g,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)}):/* @__PURE__ */I(v,{id:e,size:"md",className:"es-fin",type:"text",value:c,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)})}function R(e,n,t){const l=e.slice();return l.splice(Math.max(0,Math.min(n,l.length)),0,t),l}function A(e,n,t){const l=e.slice(),[a]=l.splice(n,1);return l.splice(Math.max(0,Math.min(t,l.length)),0,a),l}function H(e,n){return e.filter((e,t)=>t!==n)}function J(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var K='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',V={parentId:"list",slot:"items"};function Y({label:e,icon:n,noun:r,items:o,onChange:i,newItem:s,summary:c,itemName:u,thumb:m,min:g=0,max:v,readOnly:C=!1,open:N,onOpen:O,renderItem:D,renderRow:z,canRemove:Y,lockedReason:B,fixed:Q=!1,removeOnRow:X=!0,canDuplicate:U,above:Z,head:q=!0}){const G=h("fields",d).list,_=h("tree",l),ee=r??G.item,ne=!C&&!Q&&("number"!=typeof v||o.length<v),te=o.length<=g,le=e=>!!Y&&!Y(o[e],e),ae=e=>!C&&!Q&&X&&!te&&!le(e),re=e=>ne&&(!U||U(o[e],e)),oe=(e,n)=>u?u(e,n):G.itemName({noun:ee,n:n+1}),ie=j([]),se=j(null),[ce,de]=$(null),ue=j(null),[me,he]=$(null),[pe,fe]=$("");S(()=>{const e=se.current;if(!e)return;se.current=null;const n=ie.current[e.index]?.querySelectorAll(K)[e.nth]??ie.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const be=(e,n)=>{if(n<0||n>=o.length||n===e)return;const t=ie.current[e],l=t?.ownerDocument.activeElement;if(t&&l&&t.contains(l)){const e=[...t.querySelectorAll(K)].indexOf(l),a=l;se.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}i(A(o,e,n));const a=function(e,n,t){return null===e?null:e===n?t:n<e&&t>=e?e-1:n>e&&t<=e?e+1:e}(N,e,n);a!==N&&O(a),fe(G.moved({n:n+1,total:o.length}))},ge=e=>{ne&&(i(R(o,e,s())),z?(se.current={index:e,nth:0,start:null,end:null},null!==N&&N>=e&&O(N+1)):O(e))},ve=e=>{ae(e)&&(i(H(o,e)),N===e?O(null):null!==N&&N>e&&O(N-1))},ye=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===V.parentId&&n.slot===V.slot,onDrop:(e,n)=>{const t=f({...V,index:e},n);t!==e&&be(e,t)},onStep:(e,n)=>be(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<o.length,readOnly:C}),ke=e=>{const n=[];return e>0&&n.push({label:G.moveUp,icon:/* @__PURE__ */I(E,{size:14}),shortcut:"⌥↑",onClick:()=>be(e,e-1)}),e<o.length-1&&n.push({label:G.moveDown,icon:/* @__PURE__ */I(M,{size:14}),shortcut:"⌥↓",onClick:()=>be(e,e+1)}),re(e)&&n.push({label:G.duplicate,icon:/* @__PURE__ */I(W,{size:14}),onClick:()=>(e=>{re(e)&&(i(R(o,e+1,J(o[e]))),null!==N&&N>e&&O(N+1))})(e)}),ae(e)&&n.push({label:G.delete,icon:/* @__PURE__ */I(T,{size:14}),danger:!0,onClick:()=>ve(e)}),n},xe=(e,n,t,l)=>{C||0===ke(e).length||he({index:e,x:n,y:t,owner:l})},we=e=>n=>{const t=o.slice();t[e]=n,i(t)};/* @__PURE__ */
|
|
2
|
-
return F("div",{className:"es-list",children:[q?/* @__PURE__ */F("div",{className:"es-list-head",children:[
|
|
3
|
-
/* @__PURE__ */F("span",{className:"es-list-label",children:[n?/* @__PURE__ */I("span",{className:"es-field-icon","aria-hidden":"true",children:n}):null,e]}),
|
|
4
|
-
/* @__PURE__ */I(y,{count:o.length,label:G.count({noun:ee,n:o.length}),showZero:!0})]}):null,Z?/* @__PURE__ */I("div",{className:"es-list-above",children:Z}):null,o.length?/* @__PURE__ */F(k,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ye.rootProps(),children:[o.map((e,n)=>{const l=ye.row({item:n,place:{...V,index:n}}),a=l.draggable&&ce!==n,r=!z&&N===n,o=!C&&!Q&&X&&le(n),i=["es-list-row",z?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",l.dragging?"is-dragging":"",l.drop?`is-drop-${l.drop}`:""].filter(Boolean).join(" ");return[n>0?/* @__PURE__ */I(t,{...ye.seam({place:{...V,index:n}}),onAdd:ne?()=>ge(n):void 0,label:G.addHere({noun:ee})},`seam-${n}`):null,
|
|
5
|
-
/* @__PURE__ */I(x,{className:i,flat:!!z,active:r,draggable:l.draggable,dragHint:_.dragHint,dragging:l.dragging,drop:"before"===l.drop||"after"===l.drop?l.drop:void 0,onMove:l.draggable?e=>be(n,"up"===e?n-1:n+1):void 0,rowRef:e=>{ie.current[n]=e},rowProps:{...l.rowProps,draggable:a||void 0,onPointerDown:e=>{const t=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!t&&t===t.ownerDocument.activeElement;e.currentTarget.draggable=l.draggable&&!a,ue.current=t&&!a?t:null,de(a?n:null)},onDragStart:e=>{const n=ue.current;ue.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),l.rowProps.onDragStart?.(e)},onContextMenu:e=>{C||(e.preventDefault(),e.stopPropagation(),xe(n,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const t=e.currentTarget.ownerDocument,l=e=>e.preventDefault();t.addEventListener("contextmenu",l,{capture:!0,once:!0}),t.defaultView?.setTimeout(()=>t.removeEventListener("contextmenu",l,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void xe(n,a.left+24,a.bottom,e.currentTarget)}l.rowProps.onKeyDown?.(e)}},actions:C||Q||!X?void 0:o?b(B?B(e,n):G.locked,/* @__PURE__ */I("span",{className:"es-list-lock",role:"img","aria-label":B?B(e,n):G.locked,children:/* @__PURE__ */I(L,{size:13})})):b(G.deleteItem({noun:ee}),/* @__PURE__ */I("button",{type:"button",className:"es-list-x","aria-label":G.deleteItem({noun:ee}),disabled:!ae(n),onClick:()=>ve(n),children:"×"})),below:r?/* @__PURE__ */I("div",{className:"es-list-item",children:D(e,n,we(n))}):void 0,children:z?/* @__PURE__ */I("div",{className:"es-list-row-main",children:z(e,n,we(n))}):/* @__PURE__ */F("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>O(r?null:n),children:[m?/* @__PURE__ */I("span",{className:"es-list-thumb","aria-hidden":"true",children:m(e,n)}):null,
|
|
6
|
-
/* @__PURE__ */I("span",{className:"es-list-row-name",children:oe(e,n)}),/* @__PURE__ */I("span",c?{className:"es-list-row-summary",children:c(e,n)}:{className:"es-list-row-summary"}),
|
|
7
|
-
/* @__PURE__ */I(P,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},n)]}),
|
|
8
|
-
/* @__PURE__ */I(t,{...ye.seam({place:{...V,index:o.length}})})]}):null,C||Q?null:/* @__PURE__ */I("button",{type:"button",className:"es-list-add",disabled:!ne,onClick:()=>ge(o.length),children:G.add({noun:ee})}),
|
|
9
|
-
/* @__PURE__ */I("span",{className:"es-list-said","aria-live":"polite",children:pe}),me&&me.index<o.length?
|
|
10
|
-
/* @__PURE__ */I(w,{at:{x:me.x,y:me.y},owner:me.owner,onClose:()=>he(null),items:a(ke(me.index))}):null]})}var B=e=>e<6?e+1:6,Q=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function X({field:e,name:t,id:l,value:a,onChange:r,readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:u=3}){const[m,h]=$(!0),p=a&&"object"==typeof a?a:{};/* @__PURE__ */
|
|
11
|
-
return I(o,{id:`${l}-group`,title:Q(e,t),open:m,onToggle:h,level:u,children:Object.entries(n(e.objectFields,{values:p,context:c})).map(([e,n])=>/* @__PURE__ */I(Z,{field:n,name:`${t}.${e}`,id:`${l}-${e}`,value:p[e],onChange:n=>r({...p,[e]:n}),readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:B(u)},e))})}function U({field:e,name:t,id:l,value:a,onChange:r,readOnly:o,context:i,showWhenContext:s,renderers:c,openItem:d,onOpenItem:u,headingLevel:m}){const[h,p]=$(null),f=u?d??null:h,b=u??p,g=Array.isArray(a)?a:[],v=e.getItemSummary;/* @__PURE__ */
|
|
12
|
-
return I(Y,{label:Q(e,t),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:g,onChange:r,newItem:()=>J({...e.defaultItemProps??{}}),summary:v?(e,n)=>v(e,n):void 0,min:e.min,max:e.max,readOnly:o,open:f,onOpen:b,renderItem:(a,r,d)=>Object.entries(n(e.arrayFields,{values:a,context:s})).map(([e,n])=>/* @__PURE__ */I(Z,{field:n,name:`${t}[${r}].${e}`,id:`${l}-${r}-${e}`,value:a?.[e],onChange:n=>d({...a,[e]:n}),readOnly:o,context:i,showWhenContext:s,renderers:c,headingLevel:m},e))})}function Z(e){const{field:n,name:t,id:l,value:a,onChange:r,readOnly:o,context:i,renderers:d}=e;if(!n||n.marker||!1===n.visible)return null;const h=d?.[n.type];if(h)return h({field:n,name:t,id:l,value:a,onChange:r,readOnly:o});switch(n.type){case"custom":{const e={...i,field:n,name:t,id:l,value:a,onChange:r,readOnly:o};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
13
|
-
return I(u,{label:Q(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */I(z,{id:l,value:"string"==typeof a?a:null==a?"":String(a),onChange:r,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:o})});case"number":/* @__PURE__ */
|
|
14
|
-
return I(u,{label:Q(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */I(s,{id:l,value:"number"==typeof a?a:void 0,onChange:r,min:n.min,max:n.max,step:n.step,placeholder:n.placeholder,readOnly:o})});case"select":{const e=`${l}-label`;/* @__PURE__ */
|
|
15
|
-
return I(u,{label:Q(n,t),labelId:e,htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */I(c,{id:l,value:a,options:n.options,onChange:r,readOnly:o,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
|
|
16
|
-
return I(u,{label:Q(n,t),icon:n.icon,hint:n.hint,children:/* @__PURE__ */I(m,{ariaLabel:Q(n,t),value:a,options:n.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||o})),onChange:e=>{o||r(e)}})});case"object":/* @__PURE__ */
|
|
17
|
-
return I(X,{...e,field:n});case"array":/* @__PURE__ */
|
|
18
|
-
return I(U,{...e,field:n});case"slot":return null}}var q=e=>r.includes(e);function G(n,t){let l,a=r[0];const o=[],i=/* @__PURE__ */new Set;for(const[r,s]of Object.entries(n))s&&(q(s.bucket)&&((s.marker||s.bucket!==a)&&(l=void 0),a=s.bucket),s.marker&&"string"==typeof s.fold?l={key:r,title:s.fold}:s.marker&&!1===s.fold&&(l=void 0),s.marker||!1===s.visible||t&&!e(s,t)||(o.push(l?{name:r,field:s,bucket:a,fold:l}:{name:r,field:s,bucket:a}),"slot"!==s.type&&i.add(a)));return{rows:o,buckets:r.filter(e=>i.has(e))}}function _(e){return new Map(G(e).rows.map(e=>[e.name,e.bucket]))}function ee(e){const n=[];for(const t of e){const e=n[n.length-1];e&&e.fold?.key===t.fold?.key?e.rows.push(t):n.push({fold:t.fold,rows:[t]})}return n}function ne({fields:e,values:n,onChange:t,readOnly:l=!1,context:a,showWhenContext:r,tab:s,onTab:c,tabs:d=!0,tabIcons:u,renderers:m,idPrefix:p,ariaLabel:f,lead:b,children:g,leadFold:v,closedFolds:y,onFold:k,headingLevel:x=3}){const w=h("panel",i),j=D(),S=p??`es-insp${j.replace(/:/g,"")}`,P=G(e,{values:n,context:r}),[L,E]=$(void 0),M=s??L,W=M&&P.buckets.includes(M)?M:P.buckets[0],[T,z]=$(null),R=T&&T.panel===S&&P.rows.some(e=>e.name===T.name)?T:null,A=d&&P.buckets.length>1,H=A&&W?C(S,W):`${S}-rows`,[J,K]=$(()=>/* @__PURE__ */new Set),V=y??J,Y=(e,n)=>{/* @__PURE__ */return I(o,{title:e.title,open:!V.has(e.key),onToggle:n=>((e,n)=>{void 0===y&&K(t=>{const l=new Set(t);return n?l.delete(e):l.add(e),l}),k?.(e,n)})(e.key,n),id:`${S}-fold-${t=e.key,[...t].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:x,children:n});var t},Q=e=>A&&e!==W,X=({name:e,field:o,bucket:i,fold:s})=>/* @__PURE__ */I("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!!Q(i)||void 0,children:/* @__PURE__ */I(Z,{field:o,name:e,id:`${S}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:l,context:a,showWhenContext:r,renderers:m,openItem:R&&R.name===e?R.index:null,onOpenItem:n=>z(null===n?null:{panel:S,name:e,index:n}),headingLevel:s?B(x):x})},e);/* @__PURE__ */
|
|
19
|
-
return F("div",{className:"es-insp",children:[A?/* @__PURE__ */I("div",{className:"es-insp-tabs",children:/* @__PURE__ */I(N,{variant:"underline",block:!0,"aria-label":f??w.settings,idPrefix:S,value:W,onChange:e=>{const n=e;void 0===s&&E(n),c?.(n)},items:P.buckets.map(e=>{const n=w.buckets[e],t=u?.[e];return t?{id:e,icon:t,label:/* @__PURE__ */I("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
|
|
20
|
-
/* @__PURE__ */F("div",{className:"es-insp-rows",id:H,role:A?"tabpanel":void 0,"aria-labelledby":A&&W?O(S,W):void 0,children:[b?v?/* @__PURE__ */I("div",{className:"es-insp-band","data-fold":v.key,children:Y(v,b)}):b:null,ee(P.rows).map((e,n)=>{if(!e.fold)return e.rows.map(X);const t=e.rows[0].bucket,l=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
|
|
21
|
-
return I("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":t,hidden:!(!Q(t)&&!l)||void 0,children:Y(e.fold,e.rows.map(X))},`fold-${e.fold.key}-${n}`)}),g]})]})}export{z as FieldText,ne as Inspector,Z as InspectorField,Y as ListField,_ as bucketsOf,J as copyItem,R as insertAt,Q as labelOf,A as moveTo,G as planFields,H as removeAt};
|