efficient-easel 10.3.0 → 11.0.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 +11 -6
- package/dist/{chunk-FCLW4LEN.js → chunk-47RGVCPH.js} +7 -7
- package/dist/{chunk-YMEN4KVE.js → chunk-6FFSDH62.js} +1 -1
- package/dist/chunk-77DQCEEF.js +5 -0
- package/dist/chunk-7LP3OD2E.js +56 -0
- package/dist/{chunk-P4CL4YQI.js → chunk-AFSSKGTD.js} +1 -1
- package/dist/{chunk-74ZFATLG.js → chunk-BGY4Q2SL.js} +1 -1
- package/dist/{chunk-OGCROOTI.js → chunk-DGAXQTDW.js} +1 -1
- package/dist/{chunk-JSPZU7X2.js → chunk-FAAZZXIS.js} +1 -1
- package/dist/chunk-GCCBEY2W.js +2 -0
- package/dist/chunk-GG4FGBFR.js +1 -0
- package/dist/{chunk-ERA3XM2U.js → chunk-GJC6SNQC.js} +1 -1
- package/dist/{chunk-BRDCD4LK.js → chunk-IFS5P7CO.js} +1 -1
- package/dist/{chunk-A5OEGP7B.js → chunk-ISZI4T6A.js} +4 -4
- package/dist/{chunk-IZ2QRXSE.js → chunk-JTOZJXD7.js} +1 -1
- package/dist/{chunk-M32O2WRM.js → chunk-PE6ZY5IW.js} +11 -11
- package/dist/chunk-PPHUWGLZ.js +1 -0
- package/dist/{chunk-TROOTMAD.js → chunk-PZHQVOTU.js} +1 -1
- package/dist/chunk-QOYOE5CU.js +1 -0
- package/dist/{chunk-IL6QCPO6.js → chunk-TJ6NRHYF.js} +1 -1
- package/dist/chunk-VWXUMVCD.js +1 -0
- package/dist/chunk-XZDHQ4DN.js +5 -0
- package/dist/copy/index.js +12 -12
- package/dist/drag/drag.css +11 -1
- package/dist/drag/index.d.ts +9 -3
- package/dist/drag/index.js +1 -1
- package/dist/easel/index.js +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddChildRow.js +4 -1
- package/dist/screen/components/AddSidePanel.d.ts +13 -17
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +3 -15
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.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 +16 -16
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/puck/device-fields.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +6 -62
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/screen.css +2 -8
- package/dist/screen/words.d.ts +16 -23
- package/dist/screen/words.js +1 -1
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5545A3PC.js +0 -4
- package/dist/chunk-7O6MDCDU.js +0 -5
- package/dist/chunk-D6N77AOS.js +0 -1
- package/dist/chunk-FJ3ZJJ5Z.js +0 -57
- package/dist/chunk-ICN6COBK.js +0 -5
- package/dist/chunk-JTUUIVBZ.js +0 -1
- package/dist/chunk-O2NLQBFX.js +0 -1
- package/dist/chunk-OWK7DGWG.js +0 -1
- package/dist/chunk-THZ46DC5.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-7LP3OD2E.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-IFS5P7CO.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-DGAXQTDW.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-BGY4Q2SL.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-TZIIRGVY.js";import"../../chunk-QOYOE5CU.js";import"../../chunk-GJC6SNQC.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PPHUWGLZ.js";import"../../chunk-AFSSKGTD.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-W4U4SHKW.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-GCCBEY2W.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-XZDHQ4DN.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-6FFSDH62.js";import"../../chunk-77DQCEEF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-VWXUMVCD.js";import"../../chunk-PE6ZY5IW.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-TJ6NRHYF.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-47RGVCPH.js";import"../../chunk-GG4FGBFR.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-
|
|
1
|
+
export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-GCCBEY2W.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VWXUMVCD.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-ISZI4T6A.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-JTOZJXD7.js";import"../../chunk-7LP3OD2E.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-IFS5P7CO.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-DGAXQTDW.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-BGY4Q2SL.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-TZIIRGVY.js";import"../../chunk-QOYOE5CU.js";import"../../chunk-GJC6SNQC.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PPHUWGLZ.js";import"../../chunk-AFSSKGTD.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-W4U4SHKW.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-GCCBEY2W.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-XZDHQ4DN.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-PPL7GB7D.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-6FFSDH62.js";import"../../chunk-77DQCEEF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-VWXUMVCD.js";import"../../chunk-PE6ZY5IW.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-TJ6NRHYF.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-47RGVCPH.js";import"../../chunk-GG4FGBFR.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenStoreProvider as default}from"../../chunk-
|
|
1
|
+
export{ScreenStoreProvider as default}from"../../chunk-JTOZJXD7.js";import"../../chunk-77DQCEEF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PE6ZY5IW.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-TJ6NRHYF.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
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__
|
|
1
|
+
import{AddBlockRow as e}from"../../chunk-PZHQVOTU.js";import{slotChildRowName as n}from"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import{useEaselUndoKeys as t}from"../../chunk-BGY4Q2SL.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-TZIIRGVY.js";import{usePartBridge as c}from"../../chunk-QOYOE5CU.js";import{useSectionOps as p}from"../../chunk-GJC6SNQC.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-GCCBEY2W.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-6FFSDH62.js";import{SELECTION_MODE as d,useScreenPinned as a,useScreenCanvasFrame as u,useScreenInspectorPanel as h,useScreenPickFollowsSelection as k,sameInspectorMode as f,useStandaloneScreenBridges as j,useScreenBlockLook as y,useScreenBlockRules as S}from"../../chunk-77DQCEEF.js";import{slotFieldsOf as C,nestsInTree as N}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as R,usePanelPick as x,useCancelPanelPick as E}from"../../chunk-R6WTQWAC.js";import{useHostEscape as P}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as A}from"../../chunk-VWXUMVCD.js";import{useEasel as H}from"../../chunk-PE6ZY5IW.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import{LayersTree as v,Subtree as B,TreeRow as F,TreeRowAction as g,TreeSeam as O}from"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import{DEFAULT_TREE_WORDS as Y}from"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as w,saveIndicator as z}from"../../chunk-H6DDIBQ4.js";import{SaveState as G,panelWidthVars as M}from"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-TJ6NRHYF.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import{useWords as V}from"../../chunk-MFIRYGHW.js";import"../../chunk-47RGVCPH.js";import"../../chunk-GG4FGBFR.js";import{useTreeDrag as W}from"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as b,parseZoneKey as D}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as J,useRef as L,useEffect as I,useCallback as T,Fragment as X}from"react";import{Tooltip as Z}from"efficient-shell/ui";import{TrashIcon as K}from"efficient-shell/icons/efficient";import{jsxs as Q,jsx as $,Fragment as U}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=l(),re=p(),{appState:te,selectedItem:se,config:ie}=H(e=>e),[ce,pe]=J(d),le=V("screen",A),me=V("tree",Y),de=V("save",w),{first:ae,last:ue,panelOf:he}=a(),ke=he(ae),fe=u(),je=h(),ye=te.data.content?.[0]??null,Se=ye?.props.id??null,Ce=ye?.type===ae,Ne=ye?.type===ue,Re=L(null),xe=L(null);t(xe);const Ee=R(),Pe=x(),Ae=E();k(se?.props.id),I(()=>{const e=xe.current;if(!Pe||!e)return;const n=e=>{"Escape"===e.key&&Ae()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Pe]),P(null!==Pe,()=>Ae()),I(()=>{Se&&Re.current!==Se&&(Re.current=Se,Ce?pe(ke??d):se||re.select({index:0}))},[Se,se,re,Ce]);const He=T(e=>pe(n=>f(n,e)?n:e),[]),ve=j({kind:ce.kind,mode:ce,open:He,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>f(e,n)?e:n),re.select(e)}}),{selectNode:Be}=c({mode:ce,setMode:pe,onOpenPart:o}),Fe=y(),{labelAtLevel:ge,Icon:Oe}=Fe,{canAddTo:Ye}=S(),we=e=>ge(e,"block",ie.components[e]?.label??e),ze=e=>ge(e,"section",we(e)),Ge=!Ce&&"puck"===ce.kind&&se?.props.id===Se,Me=ye?Ye(ye.type)?.spec??null:null,Ve=ye&&Me?`${ye.props.id}:${Me.slot}`:null,We=ye&&Me&&Array.isArray(ye.props[Me.slot])?ye.props[Me.slot]:[],be=e=>n(e,we,Fe.plainText),De=(e,n)=>{ye&&Me&&Ve&&(pe(d),Me.slider?(r(String(ye.props.id),e),re.select({index:e,zone:Ve}),o(String(ye.props.id))):(re.select({index:e,zone:Ve}),o(n)))},Je=()=>{if(!ye||!Me||!Ve)return;const e=We.length;re.insertComponent(Ve,Me.childType,e),pe(d),Me.slider?requestAnimationFrame(()=>{r(String(ye.props.id),e),re.select({index:e,zone:Ve})}):re.select({index:e,zone:Ve})},Le=e=>C(ie,e),Ie=e=>{const{parentId:n,slot:o}=D(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Le(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(ye)?.props[o];return Array.isArray(t)?t.length:0},Te=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ie(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(d),re.select({index:t,zone:e}))},Xe=W({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>b(n)===e.zone&&n.index>=0&&n.index<=Ie(e.zone),onDrop:(e,n)=>Te(e.zone,e.index,n.index),onStep:(e,n)=>Te(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ze=(e,n)=>/* @__PURE__ */$(O,{...ne?{}:Xe.seam({place:{...D(e),index:n}})},`seam:${e}:${n}`),Ke=e=>Fe.blockRowName(e,we),Qe=(e,n,r)=>{pe(d),re.select({index:n,zone:e}),o(r)},$e=(e,n,o)=>{re.insertComponent(e,n,o),pe(d),re.select({index:o,zone:e})},Ue=(n,o,r)=>/* @__PURE__ */$(e,{choices:r,onPick:e=>$e(n,e,o)}),qe=(e,n)=>{const o=Le((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=Ye(e.type),s=t?.choices??null,i="footer"===t?.source?Ke:be;/* @__PURE__ */
|
|
2
|
+
return Q(U,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=N(ie,e.type,n),c=i(e),p=String(e.props.id),l=()=>Qe(o,r,p),{rowProps:m,...a}=Xe.row({item:{id:p,zone:o,index:r},place:{...D(o),index:r}},{onClick:q(l)});/* @__PURE__ */
|
|
3
|
+
return Q(X,{children:[0===r&&Ze(o,0),
|
|
4
|
+
/* @__PURE__ */$(F,{words:me,icon:/* @__PURE__ */$(Oe,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */$(g,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(d),void re.select(null);var e,n},children:/* @__PURE__ */$(K,{size:13})}),rowProps:m}),s&&/* @__PURE__ */$(B,{children:qe(e,n+1)}),Ze(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Ue(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===ye?.type,en=Boolean(ye)&&(Boolean(Ye(ye.type))||Le(ye.type).length>0),nn=Boolean(ye)&&(Boolean(Me)||Ne||Ce||_e||en);/* @__PURE__ */
|
|
5
|
+
return Q("div",{ref:xe,className:"sf-editor es-editor",style:M(i),children:[
|
|
6
|
+
/* @__PURE__ */$("div",{className:"sf-section-bar",children:/* @__PURE__ */$(G,null!==oe?{tone:"off",label:oe,role:"status"}:{...z(ee,de),role:"status"})}),
|
|
7
|
+
/* @__PURE__ */Q("div",{className:"sf-body",children:[Pe&&Ee?/* @__PURE__ */$("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */$(m,{panel:Ee,pick:Pe})}):nn&&ye&&/* @__PURE__ */Q("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
|
|
8
|
+
/* @__PURE__ */$("div",{className:"sf-panel-head",children:/* @__PURE__ */$(Z,{content:Ce?le.headerSettings:le.sectionSettings({name:ze(ye.type)}),side:"bottom",children:/* @__PURE__ */$("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(Ge?"is-selected":""),"aria-pressed":Ge,onClick:()=>{Ce?pe(ke??d):(pe(d),re.select({index:0}))},children:ze(ye.type)})})}),
|
|
9
|
+
/* @__PURE__ */$(v,{className:"sf-tree sf-scroll",rootProps:Xe.rootProps(),words:me,children:/* @__PURE__ */$(B,{children:Ce?
|
|
10
|
+
/* @__PURE__ */$(F,{words:me,icon:/* @__PURE__ */$(Oe,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??d),rowProps:{onClick:q(()=>pe(ke??d))}}):Me?/* @__PURE__ */Q(U,{children:[We.map((e,n)=>{const o=se?.props.id===e.props.id,r=be(e),t=String(e.props.id),s=()=>De(n,t),{rowProps:i,...c}=Xe.row({item:{id:t,zone:Ve,index:n},place:{...D(Ve),index:n}},{onClick:q(s)});/* @__PURE__ */
|
|
11
|
+
return Q(X,{children:[0===n&&Ze(Ve,0),
|
|
12
|
+
/* @__PURE__ */$(F,{words:me,icon:/* @__PURE__ */$(Oe,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */$(g,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Ve&&(re.removeComponent(Ve,e),pe(d),re.select(null)));var e},children:/* @__PURE__ */$(K,{size:13})}),rowProps:i}),Ze(Ve,n+1)]},String(e.props.id??n))}),
|
|
13
|
+
/* @__PURE__ */Q("button",{type:"button",className:"sf-add-card",onClick:Je,children:[
|
|
14
|
+
/* @__PURE__ */$("span",{className:"sf-plus sf-plus--sm",children:"+"}),Me.addLabel]}),Se?ve.partRows?.(ye,_):null]}):qe(ye,1)})})]}),
|
|
15
|
+
/* @__PURE__ */$("div",{className:"sf-center",children:/* @__PURE__ */$("div",{className:"sf-preview-host",children:/* @__PURE__ */$(fe,{})})}),
|
|
16
|
+
/* @__PURE__ */$(s,{value:{selectChild:(e,n,o,r)=>"section"===Ye(r)?.source?De(n,o):Qe(e,n,o),addChild:(e,n,o,r,t)=>"section"===Ye(t)?.source?Je():$e(`${e}:${n}`,o,r),childRowName:be,blockRowName:Ke},children:/* @__PURE__ */$(je,{mode:ce,onOpenWebsiteSettings:ve.openSettings??(()=>{}),onSelectNode:Be,hideNodeActions:!0})})]})]})}export{ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{usePartBridge}from"../../chunk-
|
|
1
|
+
export{usePartBridge}from"../../chunk-QOYOE5CU.js";import"../../chunk-GJC6SNQC.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-77DQCEEF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PE6ZY5IW.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-TJ6NRHYF.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
package/dist/screen/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DocumentScreen, default as ScreenMount } from './components/ScreenMount.js';
|
|
2
2
|
export { default as ScreenStoreProvider } from './components/ScreenStoreProvider.js';
|
|
3
|
-
export { NodeDefaults, SELECTION_MODE,
|
|
3
|
+
export { NodeDefaults, SELECTION_MODE, ScreenBlockLook, ScreenBlockRules, ScreenBridges, ScreenCanvas, ScreenCanvasDrag, ScreenCanvasDragContext, ScreenCanvasHeadProps, ScreenCanvasTargetProvider, ScreenDevices, ScreenDocumentOps, ScreenDragItem, ScreenInspector, ScreenInspectorMode, ScreenInspectorPanelProps, ScreenLeftPanel, ScreenLeftView, ScreenLeftViewFrame, ScreenLeftViewRules, ScreenMainAction, ScreenMenuRows, ScreenNewNode, ScreenNode, ScreenNodeActions, ScreenNodeLevel, ScreenNodeMaker, ScreenPartMode, ScreenParts, ScreenPartsProvider, ScreenPinnedBand, ScreenPinnedNodes, ScreenRailItem, ScreenSelector, ScreenSlot, ScreenSlotAction, ScreenSlotMode, ScreenStyleClipboard, ScreenStyleDocument, ScreenStylePastePlan, ScreenToastExtra, ScreenTree, ScreenTreeFolds, ScreenTreeRows, isPinnedFirst, isPinnedLast, 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 './lib/screen-parts.js';
|
|
4
4
|
export { DefaultBackend, EFFICIENT_BACKEND, EaselSession, SessionBackend, SessionBlocks, activateEaselSession, backendOf, createEaselSession, currentEaselSession, deactivateEaselSession, efficientClientOpen, isEfficientBackend, provideDefaultBackend, resetAmbientEaselSession, sessionRegistry, setSessionBridgedSite, setSessionDocumentSite } from './lib/session.js';
|
|
5
5
|
export { EaselSessionProvider, useEaselSession } from './lib/session-context.js';
|
|
6
6
|
export { A as AnyDocumentAddressing, D as DETACHED_EASEL_HOST, a as DocumentAddressing, E as EaselHost, b as EaselHostAddress, c as EaselHostContext, d as EaselHostProvider, e as EaselMessageType, f as EaselToHostMessage, H as HostPickedMedia, g as HostToEaselMessage, I as InboundHostMessage, N as NO_DOCUMENT_ADDRESSING, S as SectionScreenTarget, h as SendToHost, i as createEaselHost, u as useEaselHost, j as useHostEscape } from '../host-Ud6rLpph.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-ISZI4T6A.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-JTOZJXD7.js";import"../chunk-7LP3OD2E.js";import"../chunk-2GVCAIPX.js";import"../chunk-26OOWIJJ.js";import"../chunk-IFS5P7CO.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-DGAXQTDW.js";import"../chunk-7F52SZOI.js";import"../chunk-MQNBD6AB.js";import"../chunk-BHRC3ASL.js";import"../chunk-6W7WLPZH.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-BGY4Q2SL.js";import"../chunk-KCBEE2MC.js";import"../chunk-TZIIRGVY.js";import"../chunk-QOYOE5CU.js";import"../chunk-GJC6SNQC.js";import"../chunk-IYT6NN2J.js";import"../chunk-PPHUWGLZ.js";import"../chunk-AFSSKGTD.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-W4U4SHKW.js";import"../chunk-RKTF5XLP.js";import"../chunk-GCCBEY2W.js";import"../chunk-GMCZXMOV.js";import"../chunk-CLOS6SSX.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-V7U33NF2.js";import"../chunk-XZDHQ4DN.js";import"../chunk-PA3PNTVV.js";import"../chunk-5ZBY24K7.js";import"../chunk-BVN33R76.js";import"../chunk-PPL7GB7D.js";import"../chunk-KQMML6JM.js";import"../chunk-KCOBHPN6.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";import"../chunk-HQ4VVRIC.js";import"../chunk-6FFSDH62.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,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-77DQCEEF.js";import"../chunk-PLVEGYK6.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-6WY6ZXJG.js";import"../chunk-VWXUMVCD.js";import"../chunk-PE6ZY5IW.js";import"../chunk-TBY3DFKS.js";import"../chunk-26GHWMNN.js";import"../chunk-XWFH2NHZ.js";import"../chunk-4JSBIW5H.js";import"../chunk-RC25EGHD.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-ECM5F6JJ.js";import"../chunk-4VJATVVR.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-IE55HNMA.js";import"../chunk-Z6PVRXVY.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-TJ6NRHYF.js";import"../chunk-66LWADFP.js";import"../chunk-65Z5FSAW.js";import"../chunk-XJCMEEBH.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-47RGVCPH.js";import"../chunk-GG4FGBFR.js";import"../chunk-67GNT6PF.js";import"../chunk-ILXP5VX5.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-
|
|
1
|
+
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-BGY4Q2SL.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PE6ZY5IW.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-TJ6NRHYF.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEVICE_FIELD_MARKER,DEVICE_HIDDEN_ATTR,DEVICE_NOTE,deviceField,deviceMetaOf,deviceNote,shownTier,withoutDeviceGate}from"../../../chunk-
|
|
1
|
+
export{DEVICE_FIELD_MARKER,DEVICE_HIDDEN_ATTR,DEVICE_NOTE,deviceField,deviceMetaOf,deviceNote,shownTier,withoutDeviceGate}from"../../../chunk-DGAXQTDW.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-VWXUMVCD.js";import"../../../chunk-MFIRYGHW.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-
|
|
1
|
+
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-IFS5P7CO.js";import"../../../chunk-ZE7I3PLX.js";import"../../../chunk-DGAXQTDW.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-MQNBD6AB.js";import"../../../chunk-DUVRZ456.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-VWXUMVCD.js";import"../../../chunk-MFIRYGHW.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-GJC6SNQC.js";import"../../../chunk-77DQCEEF.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-PE6ZY5IW.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-26GHWMNN.js";import"../../../chunk-XWFH2NHZ.js";import"../../../chunk-4JSBIW5H.js";import"../../../chunk-RC25EGHD.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-ECM5F6JJ.js";import"../../../chunk-TJ6NRHYF.js";import"../../../chunk-66LWADFP.js";import"../../../chunk-65Z5FSAW.js";import"../../../chunk-XJCMEEBH.js";import"../../../chunk-FFYXVAAL.js";import"../../../chunk-546BBOPE.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-ILXP5VX5.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
|
|
@@ -755,8 +755,11 @@ interface ScreenBlockLook {
|
|
|
755
755
|
* key, where the layer has one; undefined, and the registry's own title for
|
|
756
756
|
* the group is its heading. */
|
|
757
757
|
categoryLabel: (id: string) => string | undefined;
|
|
758
|
-
/** The section the Add panel offers
|
|
759
|
-
*
|
|
758
|
+
/** The blank section: the Add panel offers it first in its own group, with
|
|
759
|
+
* the ungrouped blocks after it, and the blocks it takes (and they take)
|
|
760
|
+
* are the blocks Add offers beyond the catalogue (11.0.0). Null: every
|
|
761
|
+
* section stands in its group in the catalogue's order, and the blocks are
|
|
762
|
+
* what every section takes. */
|
|
760
763
|
firstSection: string | null;
|
|
761
764
|
/**
|
|
762
765
|
* What the row of a block says when the block is named by its own content
|
|
@@ -1125,11 +1128,6 @@ interface ScreenPinnedBand {
|
|
|
1125
1128
|
* designer's Body. Absent or false: a group label over the sections, which
|
|
1126
1129
|
* sit at the tree's own depth. */
|
|
1127
1130
|
foldable?: boolean;
|
|
1128
|
-
/** The band ends with an "Add section" row (`screen.addSection`) that opens
|
|
1129
|
-
* Add at the end of the band, where the band's last "+" does. Hidden while
|
|
1130
|
-
* the document is read-only, as every "+" is. Absent or false: the band ends
|
|
1131
|
-
* at its last gap. */
|
|
1132
|
-
addAtEnd?: boolean;
|
|
1133
1131
|
}
|
|
1134
1132
|
/** Is `node` the one the layer pins FIRST — its own test (`isFirst`), else a
|
|
1135
1133
|
* node of the `first` type, the test the screen has always made. */
|
|
@@ -1158,54 +1156,6 @@ interface ScreenLeftViewRules {
|
|
|
1158
1156
|
* view to be on. */
|
|
1159
1157
|
forSelection: (selectedId: string | null | undefined, current: string) => string;
|
|
1160
1158
|
}
|
|
1161
|
-
/**
|
|
1162
|
-
* THE SELECTION, as the screen hands it to a rule that asks where it is
|
|
1163
|
-
* (`ScreenAdd.railTarget`, 0.105.0): the node selected, and the panel the
|
|
1164
|
-
* inspector is showing — the selection's own (`SELECTION_MODE`), or one of the
|
|
1165
|
-
* layer's, such as the campaign designer's column, which is a slot and no
|
|
1166
|
-
* node.
|
|
1167
|
-
*/
|
|
1168
|
-
interface ScreenSelection {
|
|
1169
|
-
node: ScreenNode | null;
|
|
1170
|
-
mode: ScreenInspectorMode;
|
|
1171
|
-
}
|
|
1172
|
-
/**
|
|
1173
|
-
* WHERE ADD PUTS WHAT IT ADDS, where that is the layer's to say (0.105.0, seam
|
|
1174
|
-
* E9). That there is an Add panel, what it lists and where a tile dragged out
|
|
1175
|
-
* of it may land are the screen's. Plain data and a plain function, the same
|
|
1176
|
-
* for the life of a mount, for the reason the block rules are.
|
|
1177
|
-
*/
|
|
1178
|
-
interface ScreenAdd {
|
|
1179
|
-
/**
|
|
1180
|
-
* Where the rail's "+" aims Add: handed the working document and the
|
|
1181
|
-
* selection, the place a BLOCK the panel adds goes — the campaign designer's
|
|
1182
|
-
* last body section's first column, at its end, where its own drawer put a
|
|
1183
|
-
* block — or null for the screen's own. Asked as the panel draws while it is
|
|
1184
|
-
* open at no place of its own (from the rail, or after its place was
|
|
1185
|
-
* cleared), so a place at the end of a list stays at its end as blocks go in.
|
|
1186
|
-
* A place in a slot heads the panel with what that slot takes ("Inside
|
|
1187
|
-
* Section 3"), and a block tile pressed lands there; the sections still
|
|
1188
|
-
* follow, and land where they always did. A place in the top-level list is
|
|
1189
|
-
* where a section or a saved one lands. No "Adding to …" line is drawn for it:
|
|
1190
|
-
* that line is for a place a "+" named. Absent, or null: the rail's "+" opens
|
|
1191
|
-
* Add at no place — the selected container's blocks, then the blank section,
|
|
1192
|
-
* the saved sections and the sections — as it always has.
|
|
1193
|
-
*/
|
|
1194
|
-
railTarget?: (data: unknown, selection: ScreenSelection) => Place | null;
|
|
1195
|
-
/**
|
|
1196
|
-
* Is Add a picker of BLOCKS first, as the campaign designer's drawer is? With
|
|
1197
|
-
* true, where Add offers the blocks of a container — the rail's target, or
|
|
1198
|
-
* the container selected — those blocks are the whole panel, with no
|
|
1199
|
-
* section catalogue after them; and a gap between two sections, where what
|
|
1200
|
-
* goes in is a new section, offers the catalogue alone, with no container's
|
|
1201
|
-
* blocks before it. So one panel never lists the same blocks twice, under the
|
|
1202
|
-
* same headings, for two different places (a container's runs and the
|
|
1203
|
-
* catalogue's groups). A place a "+" names in a slot offers that slot's
|
|
1204
|
-
* blocks alone either way. Absent, false: a container's blocks, then the
|
|
1205
|
-
* catalogue, wherever there is a container to offer — as it always has.
|
|
1206
|
-
*/
|
|
1207
|
-
blocksFirst?: boolean;
|
|
1208
|
-
}
|
|
1209
1159
|
/** What a style clipboard's scope is read off (`ScreenStyleClipboard.scope`):
|
|
1210
1160
|
* the document the screen has open. */
|
|
1211
1161
|
interface ScreenStyleDocument {
|
|
@@ -1332,9 +1282,6 @@ interface ScreenParts {
|
|
|
1332
1282
|
* false: a pick outlives a change of selection, as the website's does.
|
|
1333
1283
|
*/
|
|
1334
1284
|
pickFollowsSelection?: boolean;
|
|
1335
|
-
/** Where Add puts what it adds, and whether it is a picker of blocks first
|
|
1336
|
-
* (0.105.0; `ScreenAdd`). Absent: the screen's Add, as it always was. */
|
|
1337
|
-
add?: ScreenAdd;
|
|
1338
1285
|
/**
|
|
1339
1286
|
* WHERE A PERSON'S PANEL WIDTHS AND TREE FOLDS ARE KEPT (0.106.0): the
|
|
1340
1287
|
* first part of the two `localStorage` keys, `<namespace>-panel-widths` and
|
|
@@ -1463,9 +1410,6 @@ declare function useScreenSaveSwitch(): boolean;
|
|
|
1463
1410
|
* follows the selection (`pickFollowsSelection`). With no layer, a pick
|
|
1464
1411
|
* outlives a change of selection, as it always has. */
|
|
1465
1412
|
declare function useScreenPickFollowsSelection(selection: unknown): void;
|
|
1466
|
-
/** Where Add puts what it adds (`add`). With no layer's, nothing: the
|
|
1467
|
-
* screen's own Add. */
|
|
1468
|
-
declare function useScreenAdd(): ScreenAdd;
|
|
1469
1413
|
/** Where widths and folds are kept (`storageNamespace`), or undefined: the
|
|
1470
1414
|
* website editor's keys. */
|
|
1471
1415
|
declare function useScreenStorageNamespace(): string | undefined;
|
|
@@ -1500,4 +1444,4 @@ declare function useScreenCanvasTarget(): CanvasTarget | null;
|
|
|
1500
1444
|
* engine's plain rows for the selection. */
|
|
1501
1445
|
declare function useScreenInspectorPanel(): ComponentType<ScreenInspectorPanelProps>;
|
|
1502
1446
|
|
|
1503
|
-
export { type NodeDefaults, SELECTION_MODE, type
|
|
1447
|
+
export { type NodeDefaults, SELECTION_MODE, type ScreenBlockLook, type ScreenBlockRules, type ScreenBridges, type ScreenCanvas, type ScreenCanvasDrag, type ScreenCanvasDragContext, type ScreenCanvasHeadProps, ScreenCanvasTargetProvider, type ScreenDevices, type ScreenDocumentOps, type ScreenDragItem, type ScreenInspector, type ScreenInspectorMode, type ScreenInspectorPanelProps, type ScreenLeftPanel, type ScreenLeftView, type ScreenLeftViewFrame, type ScreenLeftViewRules, type ScreenMainAction, type ScreenMenuRows, type ScreenNewNode, type ScreenNode, type ScreenNodeActions, type ScreenNodeLevel, type ScreenNodeMaker, type ScreenPartMode, type ScreenParts, ScreenPartsProvider, type ScreenPinnedBand, type ScreenPinnedNodes, type ScreenRailItem, type ScreenSelector, type ScreenSlot, type ScreenSlotAction, type ScreenSlotMode, type ScreenStyleClipboard, type ScreenStyleDocument, type ScreenStylePastePlan, type ScreenToastExtra, type ScreenTree, type ScreenTreeFolds, type ScreenTreeRows, isPinnedFirst, isPinnedLast, 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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,
|
|
1
|
+
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,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-77DQCEEF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PE6ZY5IW.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-26GHWMNN.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-RC25EGHD.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-TJ6NRHYF.js";import"../../chunk-66LWADFP.js";import"../../chunk-65Z5FSAW.js";import"../../chunk-XJCMEEBH.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
package/dist/screen/screen.css
CHANGED
|
@@ -682,14 +682,8 @@
|
|
|
682
682
|
still load-bearing on it: six 34px buttons fill 204 exactly, and a SEVENTH
|
|
683
683
|
rail button does not fit at 220. `scripts/test-editor-rail-in-topbar.ts`
|
|
684
684
|
holds that arithmetic. */
|
|
685
|
-
/* The "+"
|
|
686
|
-
|
|
687
|
-
this editor is one (`.sf-gap-plus`, `.sf-addcard-plus`, `.sf-plus`). The rail
|
|
688
|
-
sizes SVGs and has nothing to say about text, so its one line is here. */
|
|
689
|
-
.sf-rail-plus {
|
|
690
|
-
font-size: 20px;
|
|
691
|
-
line-height: 1;
|
|
692
|
-
}
|
|
685
|
+
/* The rail's "+" (`.sf-rail-plus`) went in 11.0.0: Add opens from the Layers
|
|
686
|
+
head's "+" and a canvas ➕ (owner ruling A1, amended 2026-10-14). */
|
|
693
687
|
|
|
694
688
|
/* ── Device-aware fields (lib/puck/device-fields.tsx) ─────────────────────────
|
|
695
689
|
A control that belongs to a device the canvas is not showing paints a
|
package/dist/screen/words.d.ts
CHANGED
|
@@ -32,34 +32,32 @@
|
|
|
32
32
|
* word.
|
|
33
33
|
*/
|
|
34
34
|
type ScreenAddWords = {
|
|
35
|
-
/** The panel head's title. */
|
|
35
|
+
/** The panel head's title, and the name of the Layers head's "+" that opens it. */
|
|
36
36
|
title: string;
|
|
37
|
-
/** …its context line
|
|
38
|
-
|
|
39
|
-
/** …and everywhere else. */
|
|
37
|
+
/** …and its context line. One list everywhere since 11.0.0 (the two ways to
|
|
38
|
+
* add), so one line: the place-only "Blocks for this place" went. */
|
|
40
39
|
contextAll: string;
|
|
41
40
|
/** The head's way out, back to the view underneath, and what it does. */
|
|
42
41
|
done: string;
|
|
43
42
|
doneDescription: string;
|
|
44
|
-
/** The group of the section offered first (`blockLook.firstSection`). */
|
|
45
|
-
startBlank: string;
|
|
46
43
|
/** The group of the saved sections. */
|
|
47
44
|
templates: string;
|
|
48
|
-
/** The first heading over a container's blocks, naming it. */
|
|
49
|
-
inside: (v: {
|
|
50
|
-
name: string;
|
|
51
|
-
}) => string;
|
|
52
45
|
/** A tile's title, naming what it adds. */
|
|
53
46
|
tile: (v: {
|
|
54
47
|
name: string;
|
|
55
48
|
}) => string;
|
|
56
|
-
/** The line under the search
|
|
57
|
-
|
|
58
|
-
/** …and everywhere else. */
|
|
49
|
+
/** The line under the search: how a thing is added. It says DRAG only — a
|
|
50
|
+
* press adds only where Add was opened at a place (11.0.0). */
|
|
59
51
|
hint: string;
|
|
60
|
-
/** The search box's name
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
/** The search box's name — one word for the one list (11.0.0). */
|
|
53
|
+
search: string;
|
|
54
|
+
/** Why a tile is dimmed where Add was opened at a place (11.0.0): in the list
|
|
55
|
+
* of sections, where only a section goes… */
|
|
56
|
+
onlySections: string;
|
|
57
|
+
/** …and in a container, or a group's list, that does not take it. */
|
|
58
|
+
notInside: (v: {
|
|
59
|
+
name: string;
|
|
60
|
+
}) => string;
|
|
63
61
|
/** Where the next thing goes: into a container… */
|
|
64
62
|
addingTo: (v: {
|
|
65
63
|
name: string;
|
|
@@ -186,7 +184,6 @@ declare const DEFAULT_SCREEN_SAVE_STATUS_WORDS: ScreenSaveStatusWords;
|
|
|
186
184
|
type ScreenMenuWords = {
|
|
187
185
|
undo: string;
|
|
188
186
|
redo: string;
|
|
189
|
-
addSection: string;
|
|
190
187
|
collapseAll: string;
|
|
191
188
|
selectAll: string;
|
|
192
189
|
/** In place of rows on the pinned Header and Footer. */
|
|
@@ -226,13 +223,9 @@ type ScreenWords = {
|
|
|
226
223
|
pageSections: string;
|
|
227
224
|
/** …and on a document without it (a website's template). */
|
|
228
225
|
templateSections: string;
|
|
229
|
-
/** The
|
|
226
|
+
/** The canvas's door on a page with no section yet. */
|
|
230
227
|
addSection: string;
|
|
231
|
-
/** The
|
|
232
|
-
addSectionBefore: (v: {
|
|
233
|
-
name: string;
|
|
234
|
-
}) => string;
|
|
235
|
-
/** …and in a gap with no section after it. */
|
|
228
|
+
/** The canvas ➕ between two sections (`CanvasInsert`). */
|
|
236
229
|
addSectionHere: string;
|
|
237
230
|
/**
|
|
238
231
|
* The top bar's main button (0.105.0). Owner ruling R3 (Victor Mau,
|
package/dist/screen/words.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-
|
|
1
|
+
export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-VWXUMVCD.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-
|
|
1
|
+
export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-FAAZZXIS.js";import"../chunk-OGH6CC3E.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-VWXUMVCD.js";import"../chunk-TBY3DFKS.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Z6PVRXVY.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-Q6AM43CA.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-GG4FGBFR.js";
|
package/dist/strings/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-
|
|
1
|
+
import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-FAAZZXIS.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-FAAZZXIS.js";import"../chunk-OGH6CC3E.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-VWXUMVCD.js";import"../chunk-TBY3DFKS.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Z6PVRXVY.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-Q6AM43CA.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-GG4FGBFR.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
|
|
2
2
|
return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.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-5545A3PC.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Tooltip as e}from"efficient-shell/ui";import{useId as s}from"react";import{jsxs as i,Fragment as l,jsx as r}from"react/jsx-runtime";function n({label:n,blocked:a,onAdd:d,small:c=!1}){const o=null!==a,t=s(),m=/* @__PURE__ */i("button",{type:"button",className:"sf-add-card","aria-disabled":o||void 0,"aria-describedby":o?t:void 0,onClick:o?void 0:d,children:[
|
|
2
|
-
/* @__PURE__ */r("span",{className:c?"sf-plus sf-plus--sm":"sf-plus",children:"+"}),n]});return o?/* @__PURE__ */i(l,{children:[
|
|
3
|
-
/* @__PURE__ */r(e,{content:a,children:m}),
|
|
4
|
-
/* @__PURE__ */r("span",{id:t,className:"es-vh",children:a})]}):m}export{n as AddChildRow};
|
package/dist/chunk-7O6MDCDU.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-M32O2WRM.js";import{Inspector as i}from"./chunk-26GHWMNN.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},j={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},w={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},L={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},N={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
|
|
2
|
-
return s(t,{height:"fill"})}function C(){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 G=o({});function P({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return s(G.Provider,{value:n,children:e})}function D(){return u(G)}function x(){return(D().useOwnerName??g)()}function B(){return(D().useDocumentLabel??y)()}function I(n,e,t,r){return(D().useBridges??v)(n,e,t,r)}function R(n){return(D().useStandaloneBridges??v)(n)}function T(n,e){(D().useDocumentPass??b)(n,e)}function W(){return D().blockRules??O}function A(){return D().blockLook??j}function F(){return D().devices??w}function M(){return D().leftView??L}function H(){return D().pinned??N}function K(){return D().saveSwitch??!0}function V(n){e(!0===D().pickFollowsSelection,n)}function E(){return D().add??h}function Q(){return D().storageNamespace||void 0}function Y(){return D().styleClipboard??null}function Z(){return D().nodeKeys??!0}function q(){return D().notify??null}function z(){return D().Canvas??S}function J(){return D().CanvasHead??null}function U(){return D().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
|
|
5
|
-
return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return D().Inspector??C}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,P as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,E as useScreenAdd,A as useScreenBlockLook,W as useScreenBlockRules,I as useScreenBridges,U as useScreenCanvasDrag,z as useScreenCanvasFrame,J as useScreenCanvasHead,_ as useScreenCanvasTarget,F as useScreenDevices,B as useScreenDocumentLabel,T as useScreenDocumentPass,nn as useScreenInspectorPanel,M as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,x as useScreenOwnerName,D as useScreenParts,V as useScreenPickFollowsSelection,H as useScreenPinned,K as useScreenSaveSwitch,Q as useScreenStorageNamespace,Y as useScreenStyleClipboard,R as useStandaloneScreenBridges};
|
package/dist/chunk-D6N77AOS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{styleMenuItems as e}from"./chunk-V7U33NF2.js";import{useEaselSession as n}from"./chunk-O7Q4DDJT.js";import{ROOT_ZONE as t}from"./chunk-PLVEGYK6.js";import{useHostEscape as o}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-JTUUIVBZ.js";import{EaselMenuItems as r,menuLabel as i}from"./chunk-EA2HTX37.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{isTypingTarget as d,useCanvasEvent as u,framePointToHost as p}from"./chunk-ILXP5VX5.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as y}from"./chunk-KRXQM65X.js";import{useState as h,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,AddIcon as C,PasteIcon as z,SettingsIcon as P,LayersIcon as O,CopyIcon as A}from"efficient-shell/icons/efficient";import{jsx as S}from"react/jsx-runtime";function D(e,n){const o=[],l=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||l.has(n.props.id))break;if(l.add(n.props.id),o.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===t)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<o.length-1;e+=1)o[e].parentType=o[e+1].node.type;return o}var K=c(),T=/* @__PURE__ */new WeakMap;function X(e){if(e.claimsPage)return K;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",c);let t=T.get(n);return t||(t=c(),T.set(n,t)),t}function j(){return X(n())}function I(e,n,o){if(n===t){const{floor:n,cap:t}=e.sectionBand();return{parentId:y,slot:m,index:Math.min(Math.max(o,n),t)}}const l=n.lastIndexOf(":");return{parentId:n.slice(0,l),slot:n.slice(l+1),index:o}}function M(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function E(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?I(e,t.zone,t.index+1):null;for(const l of D(e,t)){const t=I(e,l.zone,l.index+1);if(o(n,t))return t}return null}function L(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(d(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key||"Backspace"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function U(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=M(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:E(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function V(n,o){const{zone:l,index:r}=o,i=n.nodeAt(l,r);if(!i)return[];const c=i.props.id,a=n.labelOf(i.type,l),d=Boolean(i.props._hidden),u=n.nodeOps,p=n.isPinned(i,l),f=n.isLocked(i),m=!p&&!f&&!n.duplicateBlocked(i),y=n.permits?.(i)??{duplicate:!0,delete:!0},h=M(n,i,l),k=D(n,o),b=u.held,v=b&&!p?E(n,b,o):null,g=!n.readOnly,w=n.style?e({held:g?n.style.held():null,canCopy:n.style.canCopy(i,l),onCopy:()=>n.style?.copy(i,l),onPaste:()=>n.style?.paste(l,r,i),words:n.words?.styleClipboard}):[];return s({title:a,words:n.words?.menu,layer:{group:"pick",items:k.flatMap((e,o)=>{const l={label:n.rowNameOf(e.node,e.zone),checked:0===o,onClick:()=>n.selectAt(e.zone,e.index,e.node.props.id,e.parentType)},r=e.zone===t?null:n.slotRung?.(e.zone)??null;return r?[l,{label:r.label,checked:!1,onClick:r.select}]:[l]})},actions:{addInside:g&&n.canAddTo(i.type)?()=>n.openAddInside(l,r):void 0,duplicate:g&&m&&y.duplicate?()=>u.duplicate(c):void 0,moveUp:g&&u.canStep(c,-1)?()=>u.step(c,-1):void 0,moveDown:g&&u.canStep(c,1)?()=>u.step(c,1):void 0,copy:h.copy?()=>u.copy(c,a):void 0,cut:g&&h.cut?()=>u.cut(c,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>u.paste(v)}:void 0,rename:g&&n.renamePropOf(i,l)?()=>n.beginRename(l,r):void 0,hide:!g||f||p?void 0:{hidden:d,run:()=>u.setProps(c,{_hidden:!d})},delete:g&&m&&y.delete?()=>u.remove(c):void 0},style:w,extras:n.menuRows?.(i,l,r)??void 0,pinnedLine:p?B(n).pinned:void 0})}var B=e=>e.words?.screen??l.menu;function R(e){const n=B(e),o=!e.readOnly,r=[];o&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */S(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */S(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=o?[{label:n.addSection,icon:/* @__PURE__ */S(C,{}),onClick:e.openAddSection}]:[],c=e.nodeOps.held,s=I(e,t,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):f(c.from)===t)){const n=s,t=e.words?.menu??a;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */S(z,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const d=[r,i,[{label:e.pageSettingsLabel??l.pageSettings,icon:/* @__PURE__ */S(P,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */S(O,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),u={label:"—",onClick:()=>{}};return d.flatMap((e,n)=>n?[u,...e]:e)}function Y(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??a,c=B(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */S(A,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */S(z,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const d=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),u={label:"—",onClick:()=>{}};return d.flatMap((e,n)=>n?[u,...e]:e)}function N(e){return e.shiftKey}function F(e,n){const[t,l]=h(null),r=k(()=>l(null),[]);o(null!==t,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=L(e);if(!o)return;const l=t.selected();if(!l)return;const r=U(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),u(n,"keydown",c);const a=k(n=>{if(N(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);u(n,"contextmenu",t=>{if(N(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;t.preventDefault();const c=p(n.frame,t.clientX,t.clientY),s=n.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),u(n,"mousedown",r),u(n,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:t?/* @__PURE__ */S(G,{host:e,target:t,onClose:r}):null,closeMenu:r}}function G({host:e,target:n,onClose:t}){const o="node"===n.kind?V(e,n):"input"===n.kind?Y(e,n.el):R(e);return 0===o.length?null:/* @__PURE__ */S(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":i(o),children:/* @__PURE__ */S(r,{items:o,onClose:t})})}export{K as EASEL_NODE_CLIPBOARD,D as ancestorChain,X as nodeClipboardOf,M as nodeClipboardRules,V as nodeMenuItems,L as nodeShortcut,R as pageMenuItems,E as pastePlace,U as runNodeShortcut,Y as textMenuItems,j as useNodeClipboard,F as useNodeContextMenu};
|