efficient-easel 24.0.0 → 24.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 +10 -0
- package/dist/{chunk-CMMR6CJS.js → chunk-4ESG53BH.js} +1 -1
- package/dist/{chunk-PDJ5ZALV.js → chunk-75C6WFNF.js} +1 -1
- package/dist/chunk-7RSE6KKY.js +1 -0
- package/dist/{chunk-G7ISR6DI.js → chunk-AAAZ2CQR.js} +1 -1
- package/dist/{chunk-ZYHKXEND.js → chunk-CE5SGCN2.js} +3 -3
- package/dist/{chunk-4RJBW7VC.js → chunk-CMPFUJ26.js} +6 -6
- package/dist/chunk-FJTCSQWK.js +16 -0
- package/dist/{chunk-2AV62DEP.js → chunk-G67G63O5.js} +1 -1
- package/dist/{chunk-HHQZB6IE.js → chunk-MRWVYSU5.js} +44 -44
- package/dist/{chunk-D5GQEUKM.js → chunk-OITNWE52.js} +1 -1
- package/dist/{chunk-Z5BPY2VG.js → chunk-QORC32JO.js} +5 -5
- package/dist/easel/index.d.ts +20 -1
- package/dist/easel/index.js +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.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 +17 -17
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/document/box-fields.js +9 -9
- 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/dist/strings/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-7BW74Y55.js +0 -1
- package/dist/chunk-VBOSOH5M.js +0 -16
|
@@ -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-G67G63O5.js";import{scrollPreviewToSection as n,gotoPreviewSlide as o}from"../../chunk-DDH2DYQP.js";import{useEaselUndoKeys as r}from"../../chunk-75C6WFNF.js";import{SlotChildActionsProvider as t}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as s}from"../../chunk-Y53EKN35.js";import{usePartBridge as i}from"../../chunk-7RSE6KKY.js";import{useSectionOps as c}from"../../chunk-OITNWE52.js";import"../../chunk-RUQOIQWI.js";import{SELECTION_MODE as p,useScreenPinned as l,useScreenCanvasFrame as m,useScreenInspectorPanel as d,useScreenPickFollowsSelection as u,sameInspectorMode as a,useStandaloneScreenBridges as h,useScreenBlockLook as k,useScreenBlockRules as j,isSelectionMode as f,shownChildSlotsOf as S}from"../../chunk-QORC32JO.js";import{MediaPopup as C}from"../../chunk-T2RINM7R.js";import{useScreenDocument as N}from"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import{DEFAULT_SCREEN_WORDS as y}from"../../chunk-IYHO4XQX.js";import{slotChildRowName as A}from"../../chunk-5NHQ452C.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import{slotFieldsOf as x,nestsInTree as O}from"../../chunk-TCAAOYQY.js";import{useEasel as Y}from"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import{LayersTree as R,Subtree as F,TreeRow as P,TreeRowAction as W,TreeSeam as E}from"../../chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as I}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 T,saveIndicator as g}from"../../chunk-H6DDIBQ4.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import{SaveState as M,panelWidthVars as Q}from"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import{useWords as b}from"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import{useTreeDrag as v}from"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import{zoneKey as z,parseZoneKey as B}from"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";import{useState as H,useRef as w,useEffect as D,useCallback as K,Fragment as V}from"react";import{Tooltip as G}from"efficient-shell/ui";import{TrashIcon as J}from"efficient-shell/icons/efficient";import{jsxs as L,jsx as Z,Fragment as X}from"react/jsx-runtime";var U=e=>n=>{n.target.closest("button, input")||e()},$={rowClick:U};function q(){const{saveState:q,readOnly:_,readOnlyReason:ee=null}=N(),ne=c(),{appState:oe,selectedItem:re,config:te}=Y(e=>e),[se,ie]=H(p),ce=b("screen",y),pe=b("tree",I),le=b("save",T),{first:me,last:de,panelOf:ue}=l(),ae=ue(me),he=m(),ke=d(),je=oe.data.content?.[0]??null,fe=je?.props.id??null,Se=je?.type===me,Ce=je?.type===de,Ne=w(null),ye=w(null);r(ye),u(re?.props.id),D(()=>{fe&&Ne.current!==fe&&(Ne.current=fe,Se?ie(ae??p):re||ne.select({index:0}))},[fe,re,ne,Se]);const Ae=K(e=>ie(n=>a(n,e)?n:e),[]),xe=h({kind:se.kind,mode:se,open:Ae,show:e=>ie(e),reveal:()=>{},select:(e,n)=>{ie(e=>a(e,n)?e:n),ne.select(e)}}),{selectNode:Oe}=i({mode:se,setMode:ie,onOpenPart:n}),Ye=k(),{labelAtLevel:Re,Icon:Fe}=Ye,{canAddTo:Pe}=j(),We=e=>Re(e,"block",te.components[e]?.label??e),Ee=e=>Re(e,"section",We(e)),Ie=!Se&&f(se)&&re?.props.id===fe,Te=je?Pe(je.type)?.spec??null:null,ge=je&&Te?`${je.props.id}:${Te.slot}`:null,Me=je&&Te&&Array.isArray(je.props[Te.slot])?je.props[Te.slot]:[],Qe=e=>A(e,We,Ye.plainText),be=(e,r)=>{je&&Te&&ge&&(ie(p),Te.slider?(o(String(je.props.id),e),ne.select({index:e,zone:ge}),n(String(je.props.id))):(ne.select({index:e,zone:ge}),n(r)))},ve=()=>{if(!je||!Te||!ge)return;const e=Me.length;ne.insertComponent(ge,Te.childType,e),ie(p),Te.slider?requestAnimationFrame(()=>{o(String(je.props.id),e),ne.select({index:e,zone:ge})}):ne.select({index:e,zone:ge})},ze=e=>x(te,e),Be=e=>{const{parentId:n,slot:o}=B(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of ze(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(je)?.props[o];return Array.isArray(t)?t.length:0},He=(e,n,o)=>{const r=Math.min(Math.max(o,0),Be(e)),t=n<r?r-1:r;t!==n&&(ne.reorderComponent(e,n,t),ie(p),ne.select({index:t,zone:e}))},we=v({keyOf:e=>e.id,readOnly:Boolean(_),canDrop:(e,n)=>z(n)===e.zone&&n.index>=0&&n.index<=Be(e.zone),onDrop:(e,n)=>He(e.zone,e.index,n.index),onStep:(e,n)=>He(e.zone,e.index,n<0?e.index-1:e.index+2)}),De=(e,n)=>/* @__PURE__ */Z(E,{..._?{}:we.seam({place:{...B(e),index:n}})},`seam:${e}:${n}`),Ke=e=>Ye.blockRowName(e,We),Ve=(e,o,r)=>{ie(p),ne.select({index:o,zone:e}),n(r)},Ge=(e,n,o)=>{ne.insertComponent(e,n,o),ie(p),ne.select({index:o,zone:e})},Je=(n,o,r)=>/* @__PURE__ */Z(e,{choices:r,onPick:e=>Ge(n,e,o)}),Le=(e,n)=>{const o=S(te,e);const r=Pe(e.type),t=r?.choices??null,s="footer"===r?.source?Ke:Qe;/* @__PURE__ */
|
|
2
|
+
return L(X,{children:[o.map(({child:e,zone:o,index:r})=>{const t=re?.props.id===e.props.id,i=O(te,e.type,n),c=s(e),l=String(e.props.id),m=()=>Ve(o,r,l),{rowProps:d,...u}=we.row({item:{id:l,zone:o,index:r},place:{...B(o),index:r}},{onClick:U(m)});/* @__PURE__ */
|
|
3
|
+
return L(V,{children:[0===r&&De(o,0),
|
|
4
|
+
/* @__PURE__ */Z(P,{words:pe,icon:/* @__PURE__ */Z(Fe,{type:e.type,size:13}),name:c,selected:t,onSelect:m,...u,actions:/* @__PURE__ */Z(W,{kind:"delete",label:ce.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,ne.removeComponent(e,n),ie(p),void ne.select(null);var e,n},children:/* @__PURE__ */Z(J,{size:13})}),rowProps:d}),i&&/* @__PURE__ */Z(F,{children:Le(e,n+1)}),De(o,r+1)]},String(e.props.id??`${o}-${r}`))}),r&&t?Je(`${e.props.id}:${r.slot}`,o.length,t):null]})},Ze="HeroSingle"===je?.type,Xe=Boolean(je)&&(Boolean(Pe(je.type))||ze(je.type).length>0),Ue=Boolean(je)&&(Boolean(Te)||Ce||Se||Ze||Xe);/* @__PURE__ */
|
|
5
|
+
return L("div",{ref:ye,className:"sf-editor es-editor",style:Q(s),children:[
|
|
6
|
+
/* @__PURE__ */Z("div",{className:"sf-section-bar",children:/* @__PURE__ */Z(M,null!==ee?{tone:"off",label:ee,role:"status"}:{...g(q,le),role:"status"})}),
|
|
7
|
+
/* @__PURE__ */L("div",{className:"sf-body",children:[Ue&&je&&/* @__PURE__ */L("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:Se?ce.headerSettings:ce.sectionSettings({name:Ee(je.type)}),side:"bottom",children:/* @__PURE__ */Z("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(Ie?"is-selected":""),"aria-pressed":Ie,onClick:()=>{Se?ie(ae??p):(ie(p),ne.select({index:0}))},children:Ee(je.type)})})}),
|
|
9
|
+
/* @__PURE__ */Z(R,{className:"sf-tree sf-scroll",rootProps:we.rootProps(),words:pe,children:/* @__PURE__ */Z(F,{children:Se?
|
|
10
|
+
/* @__PURE__ */Z(P,{words:pe,icon:/* @__PURE__ */Z(Fe,{type:"header",size:13}),name:ce.headerSettings,selected:se.kind===ae?.kind,onSelect:()=>ie(ae??p),rowProps:{onClick:U(()=>ie(ae??p))}}):Te?/* @__PURE__ */L(X,{children:[Me.map((e,n)=>{const o=re?.props.id===e.props.id,r=Qe(e),t=String(e.props.id),s=()=>be(n,t),{rowProps:i,...c}=we.row({item:{id:t,zone:ge,index:n},place:{...B(ge),index:n}},{onClick:U(s)});/* @__PURE__ */
|
|
11
|
+
return L(V,{children:[0===n&&De(ge,0),
|
|
12
|
+
/* @__PURE__ */Z(P,{words:pe,icon:/* @__PURE__ */Z(Fe,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */Z(W,{kind:"delete",label:ce.deleteNamed({name:r}),onClick:()=>{return e=n,void(ge&&(ne.removeComponent(ge,e),ie(p),ne.select(null)));var e},children:/* @__PURE__ */Z(J,{size:13})}),rowProps:i}),De(ge,n+1)]},String(e.props.id??n))}),
|
|
13
|
+
/* @__PURE__ */L("button",{type:"button",className:"sf-add-card",onClick:ve,children:[
|
|
14
|
+
/* @__PURE__ */Z("span",{className:"sf-plus sf-plus--sm",children:"+"}),Te.addLabel]}),fe?xe.partRows?.(je,$):null]}):Le(je,1)})})]}),
|
|
15
|
+
/* @__PURE__ */Z("div",{className:"sf-center",children:/* @__PURE__ */Z("div",{className:"sf-preview-host",children:/* @__PURE__ */Z(he,{})})}),
|
|
16
|
+
/* @__PURE__ */Z(t,{value:{selectChild:(e,n,o,r)=>"section"===Pe(r)?.source?be(n,o):Ve(e,n,o),addChild:(e,n,o,r,t)=>"section"===Pe(t)?.source?ve():Ge(`${e}:${n}`,o,r),childRowName:Qe,blockRowName:Ke},children:/* @__PURE__ */Z(ke,{mode:se,onOpenWebsiteSettings:xe.openSettings??(()=>{}),onSelectNode:Oe,hideNodeActions:!0})})]}),
|
|
17
|
+
/* @__PURE__ */Z(C,{})]})}export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{usePartBridge}from"../../chunk-
|
|
1
|
+
export{usePartBridge}from"../../chunk-7RSE6KKY.js";import"../../chunk-OITNWE52.js";import"../../chunk-QORC32JO.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.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-CZAAGBVL.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-CE5SGCN2.js";import"../chunk-GXQCZJOP.js";import"../chunk-MRWVYSU5.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-75C6WFNF.js";import"../chunk-KCBEE2MC.js";import"../chunk-Y53EKN35.js";import"../chunk-7RSE6KKY.js";import"../chunk-OITNWE52.js";import"../chunk-55KKGABA.js";import"../chunk-RKTF5XLP.js";export{ScreenStoreProvider}from"../chunk-4ESG53BH.js";import"../chunk-5545A3PC.js";import"../chunk-CMPFUJ26.js";import"../chunk-VKPOH6MK.js";import"../chunk-IZGFJWH4.js";import"../chunk-N7E6264U.js";import"../chunk-N3MJOHAG.js";import"../chunk-5PXVT7JY.js";import"../chunk-UMDQ6CLQ.js";import"../chunk-RUQOIQWI.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,shownChildSlotsOf,shownSlotFieldsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-QORC32JO.js";import"../chunk-T2RINM7R.js";import"../chunk-AAAZ2CQR.js";import"../chunk-FRAIEWRC.js";import"../chunk-K7MMLCTT.js";import"../chunk-ISS72IKO.js";import"../chunk-ERR437B5.js";import"../chunk-3FIS2FRS.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-NQW6XCAY.js";import"../chunk-LOMEH6DG.js";import"../chunk-KCOBHPN6.js";import"../chunk-NCXYC7WI.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,FIELD_DESCRIPTION_MARKER,createEaselHost,describedAs,useEaselHost,useHostEscape}from"../chunk-LX23TCTP.js";import"../chunk-XFYFKITX.js";import"../chunk-V7U33NF2.js";import"../chunk-IYHO4XQX.js";import"../chunk-6WY6ZXJG.js";import"../chunk-5NHQ452C.js";import"../chunk-6UAEFOJ4.js";import"../chunk-AJ2SUSET.js";import"../chunk-ANPOR6EY.js";import"../chunk-R4AUZVA3.js";import"../chunk-TCAAOYQY.js";import"../chunk-FJTCSQWK.js";import"../chunk-TBY3DFKS.js";import"../chunk-H4Z2V56N.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-HZSZT3BE.js";import"../chunk-KRL3IUV3.js";import"../chunk-Y2T3JX7K.js";import"../chunk-KFWNGPW3.js";import"../chunk-JACEEVVF.js";import"../chunk-CZAAGBVL.js";import"../chunk-WYTPBF3Q.js";import"../chunk-MJM6SFD3.js";import"../chunk-AJSDWWJW.js";import"../chunk-2OAZYSWJ.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.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,9 +1,9 @@
|
|
|
1
|
-
import{deviceField as e}from"../../../chunk-2FYFAAAK.js";import{noControlField as t,NoControlMark as n}from"../../../chunk-22I55W37.js";import{describedAs as o}from"../../../chunk-LX23TCTP.js";export{FIELD_DESCRIPTION_MARKER,describedAs}from"../../../chunk-LX23TCTP.js";import
|
|
2
|
-
return
|
|
3
|
-
return
|
|
4
|
-
return
|
|
5
|
-
return
|
|
6
|
-
return
|
|
7
|
-
return
|
|
8
|
-
return
|
|
9
|
-
return
|
|
1
|
+
import{deviceField as e}from"../../../chunk-2FYFAAAK.js";import{noControlField as t,NoControlMark as n}from"../../../chunk-22I55W37.js";import{describedAs as o}from"../../../chunk-LX23TCTP.js";export{FIELD_DESCRIPTION_MARKER,describedAs}from"../../../chunk-LX23TCTP.js";import{withStyleKind as l}from"../../../chunk-V7U33NF2.js";import"../../../chunk-IYHO4XQX.js";import"../../../chunk-6WY6ZXJG.js";import{phoneKey as a}from"../../../chunk-E52W3M5I.js";import{foldMetaOf as i,FOLD_FIELD_MARKER as r}from"../../../chunk-ANPOR6EY.js";import{useEasel as s,useSelectedFields as u}from"../../../chunk-FJTCSQWK.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-AGWKB77Q.js";import"../../../chunk-RPMSET77.js";import{SettingsDefaultReset as c,sidesStartEach as d,SidesInput as p,SidesEachToggle as m}from"../../../chunk-TOHOGVAE.js";import"../../../chunk-FM6JO4WF.js";import{DEFAULT_PANEL_WORDS as b}from"../../../chunk-KFV7N2DJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-KRL3IUV3.js";import{FieldSelect as f}from"../../../chunk-KFWNGPW3.js";import"../../../chunk-JACEEVVF.js";import{SettingsSwitch as h}from"../../../chunk-OECWLNKJ.js";import{SettingsField as g,SettingsSegmented as v}from"../../../chunk-CZAAGBVL.js";import{useWords as y}from"../../../chunk-MFIRYGHW.js";import"../../../chunk-YU3WHLGI.js";import"../../../chunk-LF3FUSCQ.js";import"../../../chunk-TGZCD6IP.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";import{useState as k}from"react";import{BoxJustifyIcon as C,WrapIcon as j,GapIcon as x,WidthIcon as F,PlacementIcon as w,NudgeIcon as P,PaddingAllIcon as S,BoxYBetweenIcon as E,BoxYStretchIcon as L,BoxYEndIcon as I,BoxYCenterIcon as O,BoxYStartIcon as T,BoxXBetweenIcon as W,BoxXStretchIcon as K,BoxXEndIcon as A,BoxXCenterIcon as G,BoxXStartIcon as R,BoxItemAlignmentIcon as B}from"efficient-shell/icons/efficient";import{Slider as N,AlignmentGrid as V,PositionInput as Y}from"efficient-shell/ui";import{jsx as J,Fragment as M,jsxs as D}from"react/jsx-runtime";var X=e=>e;function Z(){return null}function H(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
|
|
2
|
+
return J(Z,{},e)}function U(e){return e.type===Z}function _(e){return U(e)?void 0:e}function Q(e){for(const[t,n]of Object.entries(e))n&&"object"==typeof n&&!i(n)&&l(n,`section:${t}`);return e}function z(e,t){return{type:"custom",[r]:{label:e,level:t},marker:!0,fold:e,render:()=>/* @__PURE__ */J(M,{})}}function $(e){return z(e,2)}function q(e){return z(e,1)}var ee=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],te=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],ne="Wrap",oe=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],le="Direction",ae=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],ie={min:-32,max:64,step:2,builtIn:0},re={min:30,max:100,step:5,fallback:60},se=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],ue="bottom-left",ce={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},de=se.map(e=>({value:e,label:ce[e]}));function pe(e,t=ue){return se.includes(e)?e:t}var me=40,be=e=>"number"==typeof e?e:null;function fe(e,t,n){const o={};for(const l of["x","y"])n[l]!==t[l]&&(o[e[l]]=n[l]??void 0);return o}var he=["top","right","bottom","left"],ge={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ve=e=>"number"==typeof e?e:null;function ye(e,t,n){const o={};for(const l of he)n[l]!==t[l]&&(o[e[l]]=n[l]??void 0);return o}function ke(e,{options:t,value:n,onChange:o,ariaLabel:l,disabled:a=!1}){/* @__PURE__ */
|
|
3
|
+
return J(v,{options:t.map(t=>t.picture?{id:t.value,label:t.picture,title:e(t.title??t.label)}:{id:t.value,label:e(t.label),title:void 0===t.title?void 0:e(t.title)}),value:n,onChange:o,ariaLabel:e(l),disabled:a})}function Ce(e,{label:t,value:n,onChange:o,points:l}){const a=l.find(e=>e.disabled),i=l.map(t=>({...t,label:e(t.label),...t.title?{title:e(t.title)}:null}));/* @__PURE__ */
|
|
4
|
+
return J(g,{label:e(t),icon:/* @__PURE__ */J(w,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */J(V,{label:e(t),value:n,points:i,onChange:o})})}function je({say:e,label:t,value:n,onChange:o,pointsFor:l}){const{appState:a,selectedItem:i}=s(e=>e),r=i?.props?.id?String(i.props.id):void 0;return Ce(e,{label:t,value:n,onChange:o,points:l(a?.data,r)})}function xe(){try{return u()}catch{return null}}function Fe({say:e,o:t}){const n=xe(),o=y("panel",b),l=n?.values??{},a={x:be(l[t.keys.x]),y:be(l[t.keys.y])},i=e(t.label??"Position"),r=Boolean(a.x||a.y),s=e=>{const o=fe(t.keys,a,e);Object.keys(o).length&&n?.onChangeMany(o)},u=/* @__PURE__ */J(Y,{label:i,value:a,onChange:s,words:{x:e("Left and right"),y:e("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:t.min,max:t.max,step:t.step??1}),d=/* @__PURE__ */J(c,{words:o,label:i,changed:r,detail:"0 px, 0 px",onReset:()=>s({x:null,y:null})});return null===t.label?/* @__PURE__ */D("div",{className:"sf-position-line",children:[u,d]}):/* @__PURE__ */J(g,{label:i,icon:/* @__PURE__ */J(P,{}),changed:r,action:d,children:u})}var we={x:{start:/* @__PURE__ */J(R,{}),center:/* @__PURE__ */J(G,{}),end:/* @__PURE__ */J(A,{}),stretch:/* @__PURE__ */J(K,{}),between:/* @__PURE__ */J(W,{})},y:{start:/* @__PURE__ */J(T,{}),center:/* @__PURE__ */J(O,{}),end:/* @__PURE__ */J(I,{}),stretch:/* @__PURE__ */J(L,{}),between:/* @__PURE__ */J(E,{})}},Pe=e=>"row"===e?"row":"column";function Se({say:e,kind:t,label:n,options:o,value:l,onChange:a,o:i}){const r=xe(),s="justify"===t==("row"===(i.runs??Pe)(r?.values?.[i.directionKey??"direction"]))?"x":"y";return ke(e,{options:o.map(e=>({label:e.label,value:e.value,picture:we[s][e.value]})),value:l,onChange:a,ariaLabel:n})}function Ee({say:e,tier:t,o:n}){const o=xe(),l=o?.values??{},a="mobile"===t?n.phoneKeys:n.keys,i=Object.fromEntries(he.map(e=>[e,ve(l[a[e]])])),r=Object.fromEntries(he.map(e=>[e,String("mobile"===t?ve(l[n.keys[e]])??n.fallback[e]:n.fallback[e])])),[s,u]=k(()=>d(i,r));/* @__PURE__ */
|
|
5
|
+
return J(g,{label:e("Padding"),icon:/* @__PURE__ */J(S,{}),action:/* @__PURE__ */J(m,{each:s,label:e("Each side"),onChange:u}),children:/* @__PURE__ */J(p,{label:e("Padding"),each:s,value:i,placeholder:r,min:n.min,max:n.max,step:n.step,onChange:e=>{const t=ye(a,i,e);Object.keys(t).length&&o?.onChangeMany(t)},words:{sides:{top:e("Padding top"),right:e("Padding right"),bottom:e("Padding bottom"),left:e("Padding left")},vertical:e("Top and bottom"),horizontal:e("Left and right"),unit:"px"}})})}function Le(l=X){function i(e,t,n,a,i,r,s="",u){return{type:"custom",...o({},{type:"number",label:e}),render:o=>{const c="number"==typeof o.value?o.value:r;/* @__PURE__ */
|
|
6
|
+
return J(g,{label:l(e),icon:_(t),action:u?u("storedValue"in o?o.storedValue:o.value,o.onChange):void 0,children:/* @__PURE__ */J("div",{className:"sf-slider",children:/* @__PURE__ */J(N,{min:n,max:a,step:i,value:c,suffix:s||void 0,showInput:!0,label:l(e),disabled:!1,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null!==e&&e!==c&&o.onChange(e)}})})})}}}function r(e){return ke(l,e)}function s(e,t,n,a){const i=n.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...o({},{type:"radio",label:e,options:i.map(e=>({value:e.value,label:e.label}))}),render:({value:n,onChange:o,field:s})=>/* @__PURE__ */J(g,{label:l(e),icon:_(t),children:r({options:i,value:i.some(e=>e.value===n)?n:n||s?.currentValue||a,onChange:o,ariaLabel:e})})}}function u(e,t,n,a,i,r){return{type:"custom",options:a,fallback:i,...o({},{type:"radio",label:t,options:a.map(e=>({value:e.value,label:e.label}))}),render:({value:o,onChange:s,field:u})=>{const c=u.options??a,d=u.fallback??i,p=c.some(e=>e.value===o)?o:d;/* @__PURE__ */
|
|
7
|
+
return J(g,{label:l(t),icon:_(n),children:/* @__PURE__ */J(Se,{say:l,kind:e,label:t,options:c,value:p,onChange:s,o:r})})}}}function c(e={}){return u("justify","Justify",/* @__PURE__ */J(C,{}),ee,ee[0].value,e)}function d(e={}){return u("align","Item alignment",/* @__PURE__ */J(B,{}),te,"stretch",e)}function p(){const e=ne;return{type:"custom",options:oe,fallback:oe[1].value,...o({},{type:"radio",label:e,options:oe.map(e=>({value:e.value,label:e.label}))}),render:({value:t,onChange:n,id:o,name:a})=>{const i=`${o??a??e}-label`;/* @__PURE__ */
|
|
8
|
+
return J(g,{label:l(e),labelId:i,icon:/* @__PURE__ */J(j,{}),action:/* @__PURE__ */J(h,{checked:(r=t,!0===r||"wrap"===r),onChange:e=>n(e?oe[0].value:oe[1].value),ariaLabelledBy:i})});var r}}}function m({offered:e,fallback:t,resolve:n}){const o=n??(n=>e.some(e=>e.value===n)?n:t),l=s(le,H("`Direction` names how a container’s children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; the shell’s own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),e.map(e=>({label:e.label,value:e.value})),o(void 0));return{type:"custom",render:e=>l.render({...e,value:o(e.value),onChange:t=>e.onChange(t)})}}function b({min:e,max:t,step:n,builtIn:o,resolve:l,action:a,mark:r}){const s=i("Gap",/* @__PURE__ */J(x,{}),e,t,n,o,"px",a),u=l??(e=>"number"==typeof e?e:o);return{...r,type:"custom",render:e=>s.render({...e,value:u(e.value,e.field),storedValue:e.value,onChange:t=>e.onChange(t)})}}function v(e,{fallback:t=ue,pointsFor:n}={}){return{type:"custom",render:({value:o,onChange:a})=>{const i=pe(o,t);return n?/* @__PURE__ */J(je,{say:l,label:e,value:i,onChange:a,pointsFor:n}):Ce(l,{label:e,value:i,onChange:a,points:de})}}}function y(e){return{[e.keys.x]:{type:"custom",render:()=>/* @__PURE__ */J(Fe,{say:l,o:e})},[e.keys.y]:{...t({type:"custom",render:()=>/* @__PURE__ */J(n,{})},"always"),reachedBy:e.keys.x}}}function k(o={}){const i={...ge,...o.keys},r={keys:i,phoneKeys:Object.fromEntries(he.map(e=>[e,a(i[e])])),fallback:{top:0,right:0,bottom:0,left:0,...o.fallback},min:o.min??0,max:o.max??200,step:o.step??4},s=!1!==o.phone,u=t=>{const n={type:"custom",render:()=>/* @__PURE__ */J(Ee,{say:l,tier:t,o:r})};return s?e(t,n):n},c=()=>t({type:"custom",render:()=>/* @__PURE__ */J(n,{})},"always"),d=he.filter(e=>"top"!==e);return Q({...!1===o.group?{}:{_gSpacing:$("Padding")},[r.keys.top]:u("desktop"),...s?{[r.phoneKeys.top]:u("mobile")}:{},...Object.fromEntries(d.map(e=>[r.keys[e],{...c(),reachedBy:r.keys.top}])),...s?Object.fromEntries(d.map(t=>[r.phoneKeys[t],e("mobile",c())])):{}})}return{slider:i,select:function(e,t,n,a,i){return{type:"custom",options:n,fallback:a,...i?{note:i}:{},...o({},{type:"select",label:e}),render:({value:o,onChange:r,field:s})=>{const u=s.options??n,c=s.fallback??a,d=u.some(e=>e.value===o)?o:c;/* @__PURE__ */
|
|
9
|
+
return J(g,{label:l(e),icon:_(t),children:/* @__PURE__ */J(f,{value:d,ariaLabel:l(e),onChange:r,options:[...i?[{label:l(i),value:"\0note",disabled:!0}]:[],...u.map(e=>({label:l(e.label),value:e.value}))]})})}}},Segmented:r,segmented:s,boxJustifyField:c,boxAlignField:d,boxWrapField:p,directionField:m,gapField:b,placementField:v,PlacementGridView:function(e){return Ce(l,e)},positionFields:y,sidesPaddingFields:k,boxFieldSet:function(e={}){const t=e.width??re,n=e.nudge?.limit??40,o=e.direction??{offered:ae,fallback:"column"},l=o.resolve??(e=>o.offered.some(t=>t.value===e)?e:o.fallback),a={runs:e=>"row"===l(e)?"row":"column"};return{_gLayout:$("Layout"),placement:v("Placement",e.placement),width:i("Width",/* @__PURE__ */J(F,{}),t.min,t.max,t.step,t.fallback,"%"),direction:m(o),gap:b(e.gap??ie),justify:c(a),align:d(a),wrap:p(),_gNudge:$("Nudge"),...y({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-n,max:n,label:null}),...k(e.padding)}}}}var{slider:Ie,select:Oe,Segmented:Te,segmented:We,boxJustifyField:Ke,boxAlignField:Ae,boxWrapField:Ge,directionField:Re,gapField:Be,placementField:Ne,PlacementGridView:Ve,positionFields:Ye,sidesPaddingFields:Je,boxFieldSet:Me}=Le();export{te as BOX_ALIGN_POINTS,ae as BOX_DIRECTIONS,le as BOX_DIRECTION_LABEL,ie as BOX_GAP,ee as BOX_JUSTIFY_POINTS,me as BOX_NUDGE_LIMIT,se as BOX_PLACEMENTS,ue as BOX_PLACEMENT_DEFAULT,ce as BOX_PLACEMENT_LABELS,re as BOX_WIDTH,ne as BOX_WRAP_LABEL,oe as BOX_WRAP_POINTS,de as OPEN_PLACEMENT_POINTS,Ve as PlacementGridView,ge as SIDE_PAD_KEYS,Te as Segmented,Ae as boxAlignField,Le as boxFieldBuilders,Me as boxFieldSet,Ke as boxJustifyField,Ge as boxWrapField,Re as directionField,Be as gapField,$ as group,_ as iconOf,U as isNoGlyph,H as noGlyph,pe as normaliseBoxPlacement,Ne as placementField,Ye as positionFields,fe as positionPatch,q as section,We as segmented,Oe as select,Q as sharedStyleKinds,Je as sidesPaddingFields,ye as sidesPaddingPatch,Ie as slider};
|
|
@@ -1 +1 @@
|
|
|
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-
|
|
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-V7U33NF2.js";import"../../../chunk-IYHO4XQX.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-OITNWE52.js";import"../../../chunk-QORC32JO.js";import"../../../chunk-NCXYC7WI.js";import"../../../chunk-LX23TCTP.js";import"../../../chunk-TCAAOYQY.js";import"../../../chunk-FJTCSQWK.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-H4Z2V56N.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-CZAAGBVL.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-75C6WFNF.js";import"../../chunk-LX23TCTP.js";import"../../chunk-FJTCSQWK.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,shownChildSlotsOf,shownSlotFieldsOf,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,shownChildSlotsOf,shownSlotFieldsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-QORC32JO.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-LX23TCTP.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.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-CZAAGBVL.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/dist/strings/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DEFAULT_SCREEN_WORDS as r}from"../chunk-IYHO4XQX.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as o}from"../chunk-6WY6ZXJG.js";import{DEFAULT_TEXT_STYLES_WORDS as n}from"../chunk-OGH6CC3E.js";import{DEFAULT_PICK_WORDS as t}from"../chunk-OFBZOI6W.js";import{DEFAULT_CANVAS_WORDS as c}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as e}from"../chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as m}from"../chunk-WK3AFPXY.js";import{DEFAULT_PANEL_WORDS as i}from"../chunk-KFV7N2DJ.js";import{DEFAULT_SAVE_WORDS as s}from"../chunk-H6DDIBQ4.js";import{
|
|
1
|
+
import{DEFAULT_SCREEN_WORDS as r}from"../chunk-IYHO4XQX.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as o}from"../chunk-6WY6ZXJG.js";import{DEFAULT_TEXT_STYLES_WORDS as n}from"../chunk-OGH6CC3E.js";import{DEFAULT_PICK_WORDS as t}from"../chunk-OFBZOI6W.js";import{DEFAULT_CANVAS_WORDS as c}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as e}from"../chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as m}from"../chunk-WK3AFPXY.js";import{DEFAULT_PANEL_WORDS as i}from"../chunk-KFV7N2DJ.js";import{DEFAULT_SAVE_WORDS as s}from"../chunk-H6DDIBQ4.js";import{DEFAULT_COPY_WORDS as u}from"../chunk-KRL3IUV3.js";import{DEFAULT_FIELDS_WORDS as f}from"../chunk-JACEEVVF.js";import{DEFAULT_CHROME_WORDS as p,DEFAULT_NOTICE_WORDS as l}from"../chunk-AJSDWWJW.js";import{DEFAULT_RAIL_WORDS as h}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as j}from"../chunk-RE4LP46F.js";import{stringsContext as k}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as a}from"../chunk-TQ5Y6S2X.js";import{useContext as Y,useMemo as W}from"react";import{jsx as y}from"react/jsx-runtime";var F={notice:l,lock:j,save:s,chrome:p,rail:h,tree:e,panel:i,fields:f,pick:t,drag:a,menu:m,styleClipboard:o,copy:u,canvas:c,textStyles:n,screen:r},d=r=>"object"==typeof r&&null!==r;function v(r,o){const n={};for(const t of Object.keys(r)){const c=r[t],e=o[t];null==e?n[t]=c:d(c)?n[t]=d(e)?v(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function D(r,o){return o?v(r,o):r}function J({value:r,locale:o,children:n}){const t=k(),c=Y(t),e=c?.strings??F,m=o??c?.locale??"en",i=W(()=>({strings:D(e,r),locale:m}),[e,r,m]);/* @__PURE__ */
|
|
2
2
|
return y(t.Provider,{value:i,children:n})}function O(){return Y(k())?.strings??F}function H(){return Y(k())?.locale??"en"}export{F as DEFAULT_EASEL_STRINGS,J as EaselStringsProvider,D as mergeEaselStrings,H as useEaselLocale,O as useEaselStrings};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.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",
|
package/dist/chunk-7BW74Y55.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-D5GQEUKM.js";import{SELECTION_MODE as e}from"./chunk-Z5BPY2VG.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-VBOSOH5M.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),f=o(),{setSelectedPartId:k,setSelectHandler:l}=p(),I=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(()=>{l(I)},[l,I]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{k(h)},[h,k]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&f.select(r)},[i,u,f]),openPartId:h}}export{m as usePartBridge};
|
package/dist/chunk-VBOSOH5M.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 i,clickPickPart as l,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,upsertCanvasStyle as k,removeCanvasStyle as S,WORDS_CLEAR as C,frameRectToHost as I,CANVAS_TYPING_EVENT as D,drawnBox as E}from"./chunk-YU3WHLGI.js";import{queryAllCopies as x}from"./chunk-LF3FUSCQ.js";import{find as O,ROOT_ID as M,getList as A,remove as R,parseZoneKey as z,move as P,duplicate as $,replaceNode as V,createNode as L,insert as j,normalizeData as N,createResolveCache as B,slotsOf as K,resolveNodeData as Z,ROOT_SLOT as F}from"./chunk-TGZCD6IP.js";import{topLevelSlotKeys as T,fieldsFrom as H,drawnBlockCount as W,defaultsFrom as Y}from"./chunk-KXM6YRG2.js";import{createContext as U,useEffect as q,useContext as G,useRef as Q,useSyncExternalStore as X,useState as J,useReducer as _,useMemo as ee,useCallback as te,useLayoutEffect as ne}from"react";import{jsx as oe,jsxs as re,Fragment as ie}from"react/jsx-runtime";import{createPortal as le}from"react-dom";import{registerModalEscapeInterceptor as se,FloatingBar as ae,TextToolbar as ce,LinkPicker as de}from"efficient-shell/ui";function ue(e){return!["setData","setUi","set"].includes(e.type)}var pe=(e,t,n,o)=>{const r=A(e,t,z(n));return r?.[o]??null},fe=(e,t,n,o,r)=>{const i=pe(e,t,n,o);if(!i)throw new Error(`${r}: nothing at ${n}[${o}]`);return i};function he(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 me(e,t,n){return n?"node"===n.kind?O(e,t,n.id)?n:null:n.parentId===M?A(e,t,n)?n:null:O(e,t,n.parentId)&&A(e,t,n)?n:null:null}function ge(e,t,n,r=!1){const{itemSelector:i,selectedSlot:l,...s}=n;let a=e.selection;var c;return"itemSelector"in n&&(a=o(e.data,t,i??null)),"selectedSlot"in n&&(l?a=(c=l)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===a?.kind&&(a=null)),{...e,selection:a,ui:r?s:{...e.ui,...s}}}function ve(e,t,n){const o=ye(e,t,n);if(o===e)return e;const r=me(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function ye(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 ge(e,n,"function"==typeof t.ui?t.ui(he(e,n)):t.ui);case"set":{const r={data:o,ui:he(e,n)},i="function"==typeof t.state?t.state(r):t.state;let l=i.data?{...e,data:i.data}:e;return i.ui&&(l=ge(l,n,i.ui,!0)),l}case"insert":{const r={...z(t.destinationZone),index:t.destinationIndex},i=L(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:j(o,n,r,i)}}case"replace":{const r=fe(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:V(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=fe(o,n,t.sourceZone,t.sourceIndex,"duplicate"),i=$(o,n,r.props.id),l=pe(i,n,t.sourceZone,t.sourceIndex+1);return{...e,data:i,selection:l?{kind:"node",id:l.props.id}:e.selection}}case"reorder":return ye(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=pe(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const i={...z(t.destinationZone),index:t.destinationIndex};return{...e,data:P(o,n,r.props.id,i)}}case"remove":{const r=fe(o,n,t.zone,t.index,"remove");return{...e,data:R(o,n,r.props.id)}}default:return e}}var we={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},be={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},ke=0,Se=()=>`history-${ke+=1}`;function Ce(e){let t=e.config;const r=e.now??(()=>Date.now()),i=e.historyCoalesceMs??250;let l=e.permissions??{};const s=N(e.data,t);let a=s,c={data:s,selection:null,ui:{...be}};if(e.ui){const{itemSelector:n,selectedSlot:r,...i}=e.ui;c={data:s,selection:r?{kind:"slot",...r}:o(s,t,n??null),ui:{...be,...i}}}let d=[{core:c,at:-1/0,sealed:!0,id:Se()}],u=0;const p=e=>{const t=d[u],n=r();!e&&u===d.length-1&&u>0&&!t.sealed&&n-t.at<i?d=[...d.slice(0,u),{...t,core:c,at:n}]:(d=[...d.slice(0,u+1),{core:c,at:n,sealed:e,id:Se()}],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=ve(c,e,t),c===n)return;const o=e.recordHistory??ue(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=me(c.data,t,e);var r,i;(r=o,i=c.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))||(c={...c,selection:o},k(n,!1))},D=t=>{const n=c;u=t,c=d[u].core,c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},E=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...we,...l,...n}};let x=E();const M=B(),R={resolveCache:M,async resolveAll({trigger:e="load",metadata:n}={}){const o=c.data,r={type:"root",props:{...o.root.props??{}}},i=[...o.content,...Object.values(o.zones??{}).flat()],[l,...s]=await Promise.all([Z(r,t,{cache:M,trigger:e,metadata:n}),...i.map(o=>Z(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 l=i[n].props.id,s=O(r,t,l)?.node;s&&s===O(o,t,l)?.node&&(r=V(r,t,l,e.node))}),l.didChange&&r.root===o.root&&(r={...r,root:{...r.root,props:l.node.props,readOnly:l.node.readOnly??r.root.readOnly}}),r!==c.data&&("load"===e&&c.data===a&&(a=r),c={...c,data:r,selection:me(r,t,c.selection)},k(n,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=O(c.data,t,e)?.node;if(!r)return!1;const i=await Z(r,t,{cache:M,trigger:n,metadata:o});if(!i.didChange)return!1;let l=!1;return C(()=>{const n=c;if(O(c.data,t,e)?.node!==r)return;const o=V(c.data,t,e,i.node);o!==c.data&&(c={...c,data:o,selection:me(o,t,c.selection)},k(n,!1),l=!0)}),l},get config(){return t},get loaded(){return a},getState(){if(h&&m===c)return h;const e=c,o={data:e.data,ui:he(e,t)},r="node"===e.selection?.kind?O(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:he(e.core,t)}})),index:u,setHistoryIndex:e=>{e>=0&&e<d.length&&e!==u&&D(e)}},getPermissions:x,getItemById:n=>O(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return A(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:me(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:me(r,t,n.selection??c.selection)},a=r,n.keepHistory||(d=[{core:c,at:-1/0,sealed:!0,id:Se()}],u=0),c!==o&&w()},undo(){u>0&&D(u-1)},redo(){u<d.length-1&&D(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,l)||(l=e,x=E(),h=null,w())},setConfig(e){e!==t&&(t=e,x=E(),h=null,w())}};return R}function Ie(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 De=U(null),Ee=U(!0);function xe({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return q(()=>{n&&e.resolveAll()},[e,n]),q(()=>{if(t&&"undefined"!=typeof document)return Ie(document,e)},[e,t]),/* @__PURE__ */oe(De.Provider,{value:e,children:/* @__PURE__ */oe(Ee.Provider,{value:t,children:o})})}function Oe(){const e=G(De);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function Me(e){const t=Oe(),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 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 X(t.subscribe,o,o)}function Ae(){return function(e){return Me(e)}}var Re=["--es-accent","--es-accent-tint","--es-accent-tint-strong","--es-accent-line","--es-accent-text","--es-accent-ring","--es-accent-shadow","--es-on-accent","--status-success-solid","--elevation-panel"],ze="host-tokens";function Pe(e,t){const n=function(e){const t=e.ownerDocument.defaultView;if(!t)return"";const n=t.getComputedStyle(e),o=[];for(const e of Re){const t=n.getPropertyValue(e).trim();t&&o.push(`${e}: ${t};`)}return o.length?`:root { ${o.join(" ")} }`:""}(e);n?k(t,ze,n):S(t,ze)}var $e="data-easel-block",Ve="data-easel-dropzone",Le={},je="data-es-mirror",Ne="undefined"==typeof window?q:ne;function Be(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${je}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(je,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function Ke({children:t,id:n="preview-frame",title:o,className:r,style:i,mirrorStyles:l=!0,onDocument:s,height:a="auto",nonce:c}){const d=g("canvas",e),u=Q(null),[p,f]=J(null);return Ne(()=>{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]),Ne(()=>{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(l&&o){Be(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>Be(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}let r=null;const i=u.current;if(i&&o){Pe(i,e);const t=o.defaultView;if(t&&"MutationObserver"in t){r=new t.MutationObserver(()=>Pe(i,e)),r.observe(o.head,{childList:!0,subtree:!0,characterData:!0});const n={attributes:!0,attributeFilter:["class","style","data-theme"]};for(const e of[o.documentElement,o.body,i.closest(".es-editor")])e&&r.observe(e,n)}}return()=>{n?.disconnect(),r?.disconnect(),t.remove(),f(null),s?.(null)}},[]),/* @__PURE__ */oe("iframe",{ref:u,id:n,title:o??d.frame,className:["es-canvas-frame","fill"===a?"is-fill":"",r??""].filter(Boolean).join(" "),style:i,children:p?le(t,p):null})}var Ze=U(null),Fe=U(Le),Te=[];function He({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:i=120}){const l=Oe(),s=Me(n=>A(n.appState.data,l.config,{parentId:e,slot:t})??Te),a=Me(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==M),c=Me(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),d=G(Ze),u=["es-zone"];return s.length&&u.push("has-children"),e===M&&u.push("is-root"),(a||c)&&u.push("is-area-selected"),null!==d&&d===e&&e!==M&&u.push("is-hovering-area"),n&&u.push(n),/* @__PURE__ */oe("div",{className:u.join(" "),[Ve]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${i}px`},children:s.map(e=>/* @__PURE__ */oe(Je,{node:e},e.props.id))})}function We(e,t,n,o){const r=ee(()=>{const n={};for(const o of T(H(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
|
|
2
|
-
return oe(He,{parentId:t,slot:o,...e})},{blockCount:0});return n},[e,t]);for(const e of Object.keys(r))r[e].blockCount=W(n[e],o);return r}function Ye(e){return ee(()=>function({zone:t,...n}){/* @__PURE__ */
|
|
3
|
-
return oe(He,{parentId:e,slot:t,...n})},[e])}var Ue=["top","bottom","zIndex"];function qe(e,t,n){e.style[t]!==n&&(e.style[t]=n)}function Ge(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));qe(e,"position",t?"sticky":"relative");for(const n of Ue)qe(e,n,t?.[n]??"");return!!t}var Qe="data-es-canvas-relative";function Xe(e){e.hasAttribute(Qe)&&("relative"===e.style.position&&(e.style.position=""),e.removeAttribute(Qe));const t=e.ownerDocument.defaultView?.getComputedStyle(e).position;return t&&"static"!==t?"sticky"===t:(e.style.position||(e.style.position="relative",e.setAttribute(Qe,"")),!1)}function Je({node:e}){const t=Oe().config,n=t.components[e.type],o=e.props.id,r=Q(null),i=function(e,t){return ee(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute($e),o.removeAttribute("data-easel-dnd")),t.current=n,n&&(n.setAttribute($e,e),n.setAttribute("data-easel-dnd",e),Xe(n))},[e,t])}(o,r),l=Q(null),s=!!n?.inline;!function(e,t){const n=Q(!1),o=Q(()=>{});o.current=()=>{const o=e(),i=n.current;n.current=!!o&&t(o),i!==n.current&&r.current()};const r=Q(()=>{});Ne(()=>o.current()),Ne(()=>{const t=e(),i=t?.ownerDocument.defaultView;if(!t||!i)return;const l=()=>o.current();i.addEventListener("resize",l);const s=i.ResizeObserver,a=s?new s(l):null;a?.observe(t);let c=null;return r.current=()=>{c?.disconnect(),c=null;const e=t.ownerDocument.documentElement;n.current&&e&&i.MutationObserver&&(c=new i.MutationObserver(l),c.observe(e,{attributes:!0}))},r.current(),()=>{i.removeEventListener("resize",l),a?.disconnect(),c?.disconnect(),r.current=()=>{}}},[])}(()=>s?r.current:l.current,e=>s?Xe(e):Ge(e));const a=G(Fe),c=We(n,o,e.props,t.components),d=Ye(o);if(!n?.render)return null;const u=n.render,p={...Y(n),...e.props,...c},f={renderDropZone:d,isEditing:!0,dragRef:n.inline?i:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */oe(u,{...p,editor:f,editMode:!0}):
|
|
4
|
-
/* @__PURE__ */oe("div",{ref:l,[$e]:o,"data-easel-dnd":o,style:{position:"relative"},children:/* @__PURE__ */oe(u,{...p,editor:f,editMode:!0})})}function _e({metadata:e}){const t=Me(e=>e.config),n=Me(e=>e.appState.data.root).props??{},o=t.root?.render,r=We(t.root,M,n,t.components),i=Ye(M),l=/* @__PURE__ */oe(He,{parentId:M,slot:F}),s=o?/* @__PURE__ */oe(o,{id:"page-root",...n,...r,editor:{renderDropZone:i,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:l}):l;/* @__PURE__ */
|
|
5
|
-
return oe(Fe.Provider,{value:e??Le,children:s})}var et=U(void 0),tt=U(void 0);function nt(e,t,n,o){const r=O(e,t,n);return!!r&&(K(r.node,t).length>0||!1===o.whole)}var ot=U(void 0);function rt({element:e}){const t=Q(null),n=st(t,e?()=>e:null,e);/* @__PURE__ */
|
|
6
|
-
return oe("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 it={"--es-words-clear":`${C}px`};function lt({element:e,words:t=!1}){const n=Q(null),o=st(n,e?()=>e:null,e);/* @__PURE__ */
|
|
7
|
-
return oe("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,...it}:{display:"none"}})}function st(e,t,n){return ct(e,t?e=>{const n=t(e);return n?[n]:[]}:null,n)[0]??null}var at=[];function ct(e,t,n){const[o,r]=J(at),i=Q(t);return i.current=t,Ne(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!i.current)return void r(at);let o=0;const l=()=>{o=0;const n=e.current?.parentElement??null,l=(i.current?i.current(t):[]).map(e=>function(e,t){if(!e||!t)return null;const n=E(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=l)||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:l.length?l:at;var t,n})},s=()=>{o||(o=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(l))};l();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 dt({id:e,kind:t,overlay:n}){const o=Q(null),r=G(tt),i=null!==e&&!0===r?.(e),l=ct(o,e?t=>x(t,`[${$e}="${t.defaultView?.CSS?.escape?t.defaultView.CSS.escape(e):e}"]`):null,e),[s,...a]=l,c=`es-canvas-outline is-${t}${i?" is-shared":""}`,d=e=>({position:"absolute",top:e.top,left:e.left,width:e.width,height:e.height}),u=/* @__PURE__ */re(ie,{children:[
|
|
8
|
-
/* @__PURE__ */oe("div",{ref:o,"aria-hidden":"true",className:c,style:s?d(s):{display:"none"}}),a.map((e,t)=>/* @__PURE__ */oe("div",{"aria-hidden":"true",className:c,style:d(e)},t))]});return n&&e?/* @__PURE__ */oe(n,{componentId:e,kind:t,children:u}):u}function ut(e,t,n){const o=h(e,n),r=o.text.length,i=e.ownerDocument;if(!t)return[r,r];let l=null;const s=i.caretPositionFromPoint?.(t.x,t.y);if(s&&e.contains(s.offsetNode))l=o.at(s.offsetNode,s.offset);else{const n=i.caretRangeFromPoint?.(t.x,t.y);n&&e.contains(n.startContainer)&&(l=o.at(n.startContainer,n.startOffset))}if(null===l)return[r,r];const a=o.text;let c=l,d=l;for(;c>0&&!/\s/.test(a[c-1]);)c-=1;for(;d<a.length&&!/\s/.test(a[d]);)d+=1;return[c,d]}function pt({s:e,element:t,toolbar:n,label:o,keys:r}){const i=g("copy",m),l=e.pressed(),s=new Set(n.offered),f=n.colors&&n.colors.length>0?n.colors:null,h=Q(null),[v,y]=J(!1),[w,b]=J(null),k=v||null!==w,S=()=>{e.hold(),y(!1),b({href:e.pressed().href})},C=()=>{y(!1),b(null),e.resume()};ne(()=>{r.current={escape:()=>!!k&&(C(),!0),link:()=>!!s.has("link")&&(S(),!0)}}),ne(()=>()=>{r.current=null},[r]);const D=Q(C);D.current=C,q(()=>{if(v)return se(e=>{const t=h.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(D.current(),!0)},()=>h.current?.querySelector(".es-copy-colors"))},[v]),q(()=>{const n=h.current;if(!k||!n)return;const o=/* @__PURE__ */new Set([n.ownerDocument]),r=t();r&&o.add(r.ownerDocument);const i=o=>{const r=o.target;if(r&&n.contains(r))return;y(!1),b(null);const i=t();r&&i&&i.contains(r)?e.release():e.stop("outside")};for(const e of o)e.addEventListener("pointerdown",i,!0);return()=>{for(const e of o)e.removeEventListener("pointerdown",i,!0)}},[k,e,t]),ne(()=>{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,i=r&&r.rangeCount>0&&o.contains(r.getRangeAt(0).startContainer)?r.getRangeAt(0):null,l=(i?a(i,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?I(s,{left:l.left,top:l.top,width:l.right-l.left,height:l.bottom-l.top}):{left:l.left,top:l.top,width:l.right-l.left,height:l.bottom-l.top},p=o.getBoundingClientRect(),f=s?I(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 E=f?{run:u(l.color,f),open:v,onToggle:()=>{b(null),v?C():(e.hold(),y(!0))}}:void 0;/* @__PURE__ */
|
|
9
|
-
return oe(ae,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?I(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__ */oe("div",{ref:h,children:/* @__PURE__ */oe(ce,{layout:"row",offered:s,pressed:l.marks,onMark:t=>{"link"===t?S():e.press(t)},color:E,linkOpen:null!==w,list:{pressed:l.list,onList:t=>e.list(t)},clear:l.clearable?{onClear:()=>e.clear()}:void 0,alignment:n.alignment,letterCase:n.letterCase,last:n.lastTool?.({className:"rosh-tb-btn",disabled:!1,selected:l.selected,keepCaret:t=>{t.preventDefault(),e.hold()},insert:t=>e.insert(t)}),windows:/* @__PURE__ */re(ie,{children:[v&&f?/* @__PURE__ */oe(p,{colors:f,current:l.color,words:i.colors??m.colors,onPick:t=>e.color(t)}):null,w?
|
|
10
|
-
/* @__PURE__ */oe(de,{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:C}):null]})})})})}function ft({element:e,which:t}){const n=Q(null),o=st(n,()=>e(),t);/* @__PURE__ */
|
|
11
|
-
return oe("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,...it}:{display:"none"}})}function ht({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 C=Oe(),I=G(et),E=S??I,x=G(Ee),M=g("canvas",e),A=h??x,[R,z]=J(void 0),P=Me(e=>"node"===e.selection?.kind?e.selection.id:null),[$,V]=J(null),[L,j]=J(null),N=G(ot),[,B]=_(e=>e+1,0),Z=e=>{N?.select(e),B()},[F,T]=J(null),H=Q(null),[,W]=J(0),Y=Q(k);Y.current=k;const U=Q(null),X=Q(null),ee=()=>{if(!P)return null;const e=Y.current?.atSelection?.()?.element()??null;if(!e)return null;const t=X.current?.ownerDocument;if(N){const n=N.selected()&&t?N.selectedPart?.(t)??null:null;return n&&w(n.element,e)?n.element:null}const n=O(C.getState().appState.data,C.config,P);return n&&0===K(n.node,C.config).length?e:null},te=Me(e=>e.appState.data),ne=N?.selected()??null;q(()=>{const e=X.current?.ownerDocument,t=e?.defaultView?.CustomEvent;if(!e||!t)return;const n=P&&!F&&Y.current?.atSelection?.()?P:null,o=n?ee():null;e.dispatchEvent(new t(y,{detail:o?{id:n,words:o}:{id:n}}))},[P,F,te,ne]);const ie=e=>{const t=X.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(D,{detail:{typing:e}}))},le=(e,t)=>{H.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=C.group(),r=e.element,i=f({element:r,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:ut(n,t,e.skip),write:e.write,remount:e.remount,onSelect:()=>W(e=>e+1),onEscape:()=>U.current?.escape()??!1,onLinkKey:()=>U.current?.link()??!1,end:e=>{o.close(),H.current?.element===r&&(H.current=null),T(null),ie(!1),Y.current?.onChange?.({typing:!1,why:e})}});if(!i)return o.close(),!1;const l=n.closest?.(`[${$e}]`)?.getAttribute($e);return l&&C.select(l),H.current={s:i,element:r,target:e},T(()=>r),V(null),ie(!0),Y.current?.onChange?.({typing:!0,element:n}),!0};q(()=>()=>H.current?.s.stop("stop"),[]);const se=e=>{const t=H.current?.element();return Boolean(t&&t.contains(e))},ae=(e,t)=>nt(C.getState().appState.data,C.config,e,t),ce=e=>{const t=e.closest?.(`[${$e}]`)?.getAttribute($e);if(!t)return;const n=C.getState(),o="node"===n.selection?.kind?n.selection.id:null,r=N?.partAt(e,t)??null;if(r){const e=l(n.appState.data,C.config,t,r.id,o,N?.selected()??null,E);if(e)return{node:e.node,part:e.part?r:null}}return{node:s(n.appState.data,C.config,t,o,E)??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=Y.current?.atSelection?.();n&&le(n,null)&&e.preventDefault()},ue=X.current?.ownerDocument??null,pe=N?.selected()&&ue&&P?N.selectedPart?.(ue)??null:null,fe=pe&&P&&ae(P,pe)?pe.element:null,he=F?null:ee(),me=/* @__PURE__ */re("div",{ref:X,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 C.select(o.node),void(N&&(o.part?.id??null)!==N.selected()&&Z(o.part?.id??null));t.hasAttribute?.(Ve)||(C.select(null),N?.selected()&&Z(null))},onDoubleClick:e=>{const t=Y.current;if(!t||se(e.target))return;const n=t.at(e.target);n&&le(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!==N?.selected()?t.part:null,r=!t||t.part&&n?null:t.node;r!==$&&V(r),o?.id===L?.id&&o?.element===L?.element||j(o)},onMouseLeave:()=>{V(null),j(null)},children:[
|
|
12
|
-
/* @__PURE__ */oe(Ze.Provider,{value:$,children:/* @__PURE__ */oe(_e,{metadata:r})}),
|
|
13
|
-
/* @__PURE__ */re("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
14
|
-
/* @__PURE__ */oe(dt,{id:!F&&$&&$!==P?$:null,kind:"hover",overlay:v}),N?/* @__PURE__ */oe(rt,{element:F||!L||L.id===N.selected()?null:L.element}):null,he||fe?/* @__PURE__ */oe(lt,{element:F?null:he??fe,words:null!==he}):null,
|
|
15
|
-
/* @__PURE__ */oe(dt,{id:F||fe||he?null:P,kind:"selected",overlay:v}),F?/* @__PURE__ */oe(ft,{element:()=>{const e=F?.()??null;return e?pe&&w(pe.element,e)?pe.element:e:null},which:pe?.element??F}):null]}),b]}),ge=m?/* @__PURE__ */oe(m,{document:R,children:me}):me;q(()=>{if(R&&A)return Ie(R,C)},[R,A,C]),q(()=>{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=C.getState();if("node"!==n.selection?.kind)return;if(N?.selected())return void Z(null);const o=i(n.appState.data,C.config,n.selection);"node"===o?.kind&&C.select(o.id)};return R.addEventListener("keydown",e),()=>R.removeEventListener("keydown",e)},[R,C,N]);/* @__PURE__ */
|
|
16
|
-
return re("div",{className:"es-canvas"+(n?` ${n}`:""),style:o,"data-easel-preview":"","data-es-typing":F?"":void 0,children:[F&&H.current?.target.toolbar?/* @__PURE__ */oe(pt,{s:H.current.s,element:H.current.element,toolbar:H.current.target.toolbar,label:M.textTools,keys:U}):null,t?/* @__PURE__ */oe(Ke,{mirrorStyles:a,onDocument:e=>{z(e??void 0),c?.(e)},height:d,title:u,nonce:p,children:ge}):/* @__PURE__ */oe("div",{id:"preview-frame","data-easel-entry":"",children:ge})]})}function mt(e={}){const t=Oe(),n=Me(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function gt(){return yt(Me(e=>e.selectedItem))}function vt(){return yt(null)}function yt(e){const n=Oe(),o=Me(e=>e.config),r=n.resolveCache,i=Me(e=>e.appState.data.root),l=e?e.props.id:"root",s=i.props??{},a=ee(()=>e||{type:"root",props:s},[e,s]),c=e?o.components[e.type]:o.root,d=n.getState(),u=e?O(d.appState.data,o,l):null,p=u&&"root"!==u.place.parentId?u.place.parentId:null,f=p?d.getItemById(p)??null:null,{fields:h}=t({id:l,node:a,block:c,parent:f,appState:d.appState}),m=Me(t=>!1===t.getPermissions(e?{item:e}:{root:!0}).edit),g=te(e=>{(async()=>{const t=n.getState();if("root"!==l){const i=t.getItemById(l),s=t.getSelectorForId(l);if(!i||!s)return;const a={...i,props:{...i.props,...e}},{node:c}=await Z(a,o,{cache:r,trigger:"replace"}),d=n.getState().getSelectorForId(l);if(!d)return;return void n.dispatch({type:"replace",destinationZone:d.zone??"root:default-zone",destinationIndex:d.index,data:c})}const i=t.appState.data.root.props??{},{node:s}=await Z({type:"root",props:{...i,...e}},o,{cache:r,trigger:"replace"});n.dispatch({type:"replaceRoot",root:{props:s.props,readOnly:s.readOnly},recordHistory:!0})})()},[n,o,r,l]),v=te((e,t)=>g({[e]:t}),[g]);return{id:l,node:a,fields:h,values:a.props,readOnly:m,onChange:v,onChangeMany:g}}export{Ke as CanvasFrame,ot as CanvasPartsContext,et as CanvasPassThroughContext,tt as CanvasSharedContext,be as DEFAULT_UI,ht as EaselCanvas,xe as EaselProvider,_e as EditDocument,Ie as bindUndoKeys,Ce as createEasel,Ae as createUseEasel,nt as partHasOwnBox,ue as recordsByDefault,ve as reduce,he as uiView,Me as useEasel,Oe as useEaselApi,mt as useEaselNodeOps,vt as useRootFields,gt as useSelectedFields,me as validSelection};
|