efficient-easel 21.0.0 → 22.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 +28 -23
- package/dist/{CanvasDragLayer-Cd1o0HQf.d.ts → CanvasDragLayer-B6Yn9S8T.d.ts} +4 -4
- package/dist/{ScreenDocumentContext-CFJeqqKk.d.ts → ScreenDocumentContext-BIK3uWtF.d.ts} +8 -4
- package/dist/blocks/index.d.ts +17 -17
- package/dist/{buckets-Tj-nkBpg.d.ts → buckets-_MGDYJlb.d.ts} +2 -2
- package/dist/canvas/index.d.ts +9 -9
- package/dist/canvas/index.js +1 -1
- package/dist/chunk-467WWV4I.js +1 -0
- package/dist/chunk-4LGROS5L.js +1 -0
- package/dist/{chunk-2GVCAIPX.js → chunk-BDSLF5BR.js} +1 -1
- package/dist/{chunk-U66YKDAR.js → chunk-BIK3AO2V.js} +1 -1
- package/dist/chunk-BTDI7JAA.js +2 -0
- package/dist/chunk-CUZQ2HMA.js +18 -0
- package/dist/chunk-DDH2DYQP.js +1 -0
- package/dist/chunk-GHBK7BKL.js +1 -0
- package/dist/{chunk-FOHHXSOL.js → chunk-IROEWITG.js} +1 -1
- package/dist/chunk-IYYE7VJN.js +65 -0
- package/dist/chunk-KN2TIXUT.js +1 -0
- package/dist/{chunk-MSGZ56QL.js → chunk-KWLHKKZO.js} +1 -1
- package/dist/{chunk-43AEUUNQ.js → chunk-N3MJOHAG.js} +1 -1
- package/dist/{chunk-BVN33R76.js → chunk-N7E6264U.js} +1 -1
- package/dist/{chunk-66JNVRQM.js → chunk-RY5AWQ63.js} +1 -1
- package/dist/chunk-SJMS247S.js +5 -0
- package/dist/chunk-SNF5764Q.js +1 -0
- package/dist/chunk-SSRYU3YG.js +1 -0
- package/dist/{chunk-R4QJ6DC5.js → chunk-SWBADIQT.js} +1 -1
- package/dist/{chunk-GOTN2KY4.js → chunk-TIAWIOGD.js} +1 -1
- package/dist/{chunk-HGCGIRVA.js → chunk-TLN5ZT76.js} +1 -1
- package/dist/chunk-TXR7GC5A.js +8 -0
- package/dist/{chunk-FGNR22NY.js → chunk-UMBNBCL4.js} +1 -1
- package/dist/chunk-WJSEWAWK.js +15 -0
- package/dist/{chunk-V2ULLALL.js → chunk-XWKQP6AE.js} +3 -3
- package/dist/{chunk-EZTP6E2M.js → chunk-YC6KLSW3.js} +1 -1
- package/dist/{chunk-O7Q4DDJT.js → chunk-YM4UEGBV.js} +1 -1
- package/dist/{chunk-N2RISV46.js → chunk-ZOSEBPAI.js} +1 -1
- package/dist/copy/index.d.ts +2 -2
- package/dist/data/index.d.ts +21 -21
- package/dist/drag/index.d.ts +5 -5
- package/dist/drag/index.js +1 -1
- package/dist/draw/client.d.ts +1 -1
- package/dist/draw/client.js +1 -1
- package/dist/draw/index.d.ts +8 -8
- package/dist/draw/index.js +1 -1
- package/dist/easel/easel.css +5 -5
- package/dist/easel/index.d.ts +57 -57
- package/dist/easel/index.js +1 -1
- package/dist/edit-lock/index.d.ts +5 -5
- package/dist/fields/fields.css +1 -1
- package/dist/fields/index.d.ts +17 -17
- package/dist/node-ops/index.d.ts +3 -3
- package/dist/panel/index.d.ts +4 -4
- package/dist/panel/panel.css +1 -1
- package/dist/{plan-CZS902DV.d.ts → plan-CRUh2kVK.d.ts} +5 -5
- package/dist/render/index.d.ts +19 -19
- package/dist/render/index.js +5 -5
- package/dist/{repeat-Czi-6zPX.d.ts → repeat-D65bJS8d.d.ts} +1 -1
- package/dist/{resolve-D68pb3Bx.d.ts → resolve-AJ6WF4EL.d.ts} +5 -5
- package/dist/screen/components/AddBlockRow.d.ts +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.d.ts +4 -4
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +21 -21
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/PreviewDeviceContext.d.ts +1 -1
- package/dist/screen/components/PreviewPartsContext.d.ts +4 -4
- package/dist/screen/components/PreviewPartsContext.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +12 -12
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +6 -6
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +12 -12
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +16 -16
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +17 -17
- package/dist/screen/components/SlotChildActionsContext.d.ts +1 -1
- package/dist/screen/components/usePartBridge.d.ts +14 -14
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +13 -13
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +5 -5
- package/dist/screen/lib/admin-bridge.js +1 -1
- package/dist/screen/lib/content/view-tiers.d.ts +1 -1
- package/dist/screen/lib/{puck → document}/add-target-types.d.ts +1 -1
- package/dist/screen/lib/{puck → document}/block-choice.d.ts +3 -3
- package/dist/screen/lib/document/block-choice.js +1 -0
- package/dist/screen/lib/document/block-types-in.js +1 -0
- package/dist/screen/lib/{puck → document}/content-tree.d.ts +7 -7
- package/dist/screen/lib/{puck → document}/content-tree.js +1 -1
- package/dist/screen/lib/{puck → document}/device-fields.d.ts +8 -8
- package/dist/screen/lib/{puck → document}/device-fields.js +1 -1
- package/dist/screen/lib/{puck → document}/field-buckets.d.ts +3 -3
- package/dist/screen/lib/document/field-buckets.js +1 -0
- package/dist/screen/lib/{puck → document}/field-markers.d.ts +15 -15
- package/dist/screen/lib/{puck → document}/field-markers.js +1 -1
- package/dist/screen/lib/{puck → document}/hidable.d.ts +3 -3
- package/dist/screen/lib/document/hidable.js +1 -0
- package/dist/screen/lib/{puck → document}/palette-sections.d.ts +7 -7
- package/dist/screen/lib/{puck → document}/palette-sections.js +1 -1
- package/dist/screen/lib/{puck → document}/panel-fields.d.ts +6 -6
- package/dist/screen/lib/document/panel-fields.js +1 -0
- package/dist/screen/lib/{puck → document}/panel-no-control-mark.d.ts +5 -6
- package/dist/screen/lib/{puck → document}/panel-no-control-mark.js +1 -1
- package/dist/screen/lib/{puck → document}/part-id.d.ts +3 -3
- package/dist/screen/lib/document/part-id.js +1 -0
- package/dist/screen/lib/{puck → document}/preview-click.d.ts +1 -1
- package/dist/screen/lib/document/preview-click.js +1 -0
- package/dist/screen/lib/{puck → document}/preview-dom.js +1 -1
- package/dist/screen/lib/{puck → document}/preview-events.d.ts +4 -4
- package/dist/screen/lib/document/preview-events.js +1 -0
- package/dist/screen/lib/{puck → document}/preview-selection-context.d.ts +2 -2
- package/dist/screen/lib/{puck → document}/preview-selection-context.js +1 -1
- package/dist/screen/lib/{puck → document}/section-doc.d.ts +5 -5
- package/dist/screen/lib/{puck → document}/section-doc.js +1 -1
- package/dist/screen/lib/{puck → document}/slot-child-name.d.ts +2 -2
- package/dist/screen/lib/document/slot-child-name.js +1 -0
- package/dist/screen/lib/document/slot-heal.js +1 -0
- package/dist/screen/lib/{puck → document}/slot-section-spec.d.ts +3 -3
- package/dist/screen/lib/{puck → document}/style-clipboard.d.ts +9 -9
- package/dist/screen/lib/document/style-clipboard.js +1 -0
- package/dist/screen/lib/{puck → document}/text-control-kinds.d.ts +4 -4
- package/dist/screen/lib/{puck → document}/text-control-kinds.js +1 -1
- package/dist/screen/lib/{puck → document}/tree-reveal.d.ts +6 -6
- package/dist/screen/lib/{puck → document}/tree-reveal.js +1 -1
- package/dist/screen/lib/{puck → document}/use-section-ops.d.ts +6 -6
- package/dist/screen/lib/document/use-section-ops.js +1 -0
- package/dist/screen/lib/document-addressing.d.ts +6 -6
- package/dist/screen/lib/document-hooks.d.ts +4 -4
- package/dist/screen/lib/document-switch.d.ts +1 -1
- package/dist/screen/lib/host.d.ts +6 -6
- package/dist/screen/lib/key-scope.d.ts +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +6 -6
- package/dist/screen/lib/media-picker.d.ts +7 -7
- package/dist/screen/lib/page-lock.d.ts +5 -5
- package/dist/screen/lib/screen-parts.d.ts +30 -26
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-template-types.d.ts +1 -1
- package/dist/screen/lib/section-templates.d.ts +5 -5
- package/dist/screen/lib/section-templates.js +1 -1
- package/dist/screen/lib/session-context.d.ts +5 -5
- package/dist/screen/lib/session-context.js +1 -1
- package/dist/screen/lib/session.d.ts +8 -8
- package/dist/screen/lib/session.js +1 -1
- package/dist/screen/lib/shared-section-types.d.ts +1 -1
- package/dist/screen/lib/shared-sections.d.ts +5 -5
- package/dist/screen/lib/shared-sections.js +1 -1
- package/dist/screen/screen.css +17 -17
- package/dist/{session-DSQFmIvx.d.ts → session-CrWwDt7Z.d.ts} +1 -1
- package/dist/strings/index.d.ts +2 -2
- package/dist/strings/index.js +1 -1
- package/dist/style-clipboard/index.d.ts +2 -2
- package/dist/tree/index.d.ts +1 -1
- package/dist/{types-CDX6vd6A.d.ts → types-BFd8FqQw.d.ts} +3 -3
- package/dist/{types-Cq53lL8d.d.ts → types-DFxBChE3.d.ts} +18 -18
- package/dist/{types-41704JE4.d.ts → types-DlQIM1YO.d.ts} +8 -8
- package/dist/{useNodeOps-fIDWzftn.d.ts → useNodeOps-C_nisDHh.d.ts} +2 -2
- package/dist/{watch-BTYOJpQU.d.ts → watch-D0bNZRtU.d.ts} +5 -5
- package/dist/{words-BeX5eGq7.d.ts → words-fbR9IwxH.d.ts} +1 -1
- package/package.json +145 -145
- package/dist/chunk-2E2SXDYQ.js +0 -1
- package/dist/chunk-2M4T27BI.js +0 -18
- package/dist/chunk-4IJVV7DA.js +0 -1
- package/dist/chunk-7L3NKHEC.js +0 -15
- package/dist/chunk-APVUYICP.js +0 -65
- package/dist/chunk-BHRC3ASL.js +0 -1
- package/dist/chunk-I54UCYOU.js +0 -1
- package/dist/chunk-LXTM2OLQ.js +0 -2
- package/dist/chunk-NA3GMA43.js +0 -5
- package/dist/chunk-OBWDHKLI.js +0 -8
- package/dist/chunk-Q2A7RHG2.js +0 -1
- package/dist/chunk-QIDRJH3S.js +0 -1
- package/dist/chunk-RSCMJIWS.js +0 -1
- package/dist/screen/lib/puck/block-choice.js +0 -1
- package/dist/screen/lib/puck/block-types-in.js +0 -1
- package/dist/screen/lib/puck/field-buckets.js +0 -1
- package/dist/screen/lib/puck/hidable.js +0 -1
- package/dist/screen/lib/puck/panel-fields.js +0 -1
- package/dist/screen/lib/puck/part-id.js +0 -1
- package/dist/screen/lib/puck/preview-click.js +0 -1
- package/dist/screen/lib/puck/preview-events.js +0 -1
- package/dist/screen/lib/puck/slot-child-name.js +0 -1
- package/dist/screen/lib/puck/slot-heal.js +0 -1
- package/dist/screen/lib/puck/style-clipboard.js +0 -1
- package/dist/screen/lib/puck/use-section-ops.js +0 -1
- /package/dist/{chunk-MQNBD6AB.js → chunk-3QB2ZQXK.js} +0 -0
- /package/dist/{chunk-LER7RKTO.js → chunk-5XL2RXFU.js} +0 -0
- /package/dist/{chunk-6W7WLPZH.js → chunk-6UAEFOJ4.js} +0 -0
- /package/dist/{chunk-26OOWIJJ.js → chunk-7OCEPOEJ.js} +0 -0
- /package/dist/{chunk-IQ5TA7AM.js → chunk-AJ2SUSET.js} +0 -0
- /package/dist/{chunk-DUVRZ456.js → chunk-ANPOR6EY.js} +0 -0
- /package/dist/{chunk-5ZBY24K7.js → chunk-CPL43ZLJ.js} +0 -0
- /package/dist/{chunk-PIND6KE7.js → chunk-I6SK6ZDT.js} +0 -0
- /package/dist/{chunk-7F52SZOI.js → chunk-INRERJU4.js} +0 -0
- /package/dist/{chunk-R5L2E7JX.js → chunk-MGVI67QV.js} +0 -0
- /package/dist/{chunk-IYT6NN2J.js → chunk-R4AUZVA3.js} +0 -0
- /package/dist/{chunk-M2Z775ZC.js → chunk-RUQOIQWI.js} +0 -0
- /package/dist/{chunk-PLVEGYK6.js → chunk-TCAAOYQY.js} +0 -0
- /package/dist/{chunk-PA3PNTVV.js → chunk-VKPOH6MK.js} +0 -0
- /package/dist/screen/lib/{puck → document}/add-target-types.js +0 -0
- /package/dist/screen/lib/{puck → document}/block-types-in.d.ts +0 -0
- /package/dist/screen/lib/{puck → document}/preview-dom.d.ts +0 -0
- /package/dist/screen/lib/{puck → document}/slot-heal.d.ts +0 -0
- /package/dist/screen/lib/{puck → document}/slot-section-spec.js +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import{cloneNodeWithFreshIds as e}from"./chunk-BDSLF5BR.js";import{dedupeSlotChildren as n}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as t}from"./chunk-SWBADIQT.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-UMBNBCL4.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s,scrollPreviewToTop as d}from"./chunk-DDH2DYQP.js";import{useEaselKeyTarget as a,useEaselUndoKeys as c,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-TLN5ZT76.js";import{SlotChildActionsProvider as h}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as m,clampPanelWidth as g}from"./chunk-C56MPJBH.js";import{usePartBridge as y}from"./chunk-KN2TIXUT.js";import{useSectionOps as v}from"./chunk-IROEWITG.js";import{ScreenSaveIcon as k,ScreenMainButton as b}from"./chunk-PY7OOQEZ.js";import{useBrowserOffline as S}from"./chunk-RKTF5XLP.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-TXR7GC5A.js";import{keepsSharedSections as z,sharedSectionsOf as C}from"./chunk-N3MJOHAG.js";import{PanelHideButton as B,SidePanelHead as I,PanelShowStrip as N}from"./chunk-SINAM2IT.js";import{offeredChoices as O}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as P,useScreenNodeKeys as $,useScreenPinned as M,useScreenDocumentLabel as T,useScreenCanvasFrame as A,useScreenInspectorPanel as j,useScreenDevices as L,useScreenPickFollowsSelection as E,useScreenLeftView as R,SELECTION_MODE as F,isSelectionMode as D,sameInspectorMode as W,useScreenBridges as H,useScreenBlockRules as V,useScreenBlockLook as U,useScreenStorageNamespace as Y,useScreenNotify as G,useScreenCanvasHead as J,isSlotMode as K,useScreenStyleClipboard as Q,useScreenDocumentPass as X,useScreenCanvasDrag as Z,ScreenCanvasTargetProvider as _,isPinnedFirst as q,isPinnedLast as ee,screenSlotsOf as ne}from"./chunk-SJMS247S.js";import{MediaPopup as te}from"./chunk-2G6MAXPY.js";import{useNodeClipboard as oe,useNodeContextMenu as re}from"./chunk-4LGROS5L.js";import{PageEditGuardNotices as ie}from"./chunk-ZOSEBPAI.js";import{useScreenDocument as le}from"./chunk-BTDI7JAA.js";import{requestMediaPick as se}from"./chunk-UNVKPVZW.js";import{useMediaPanel as de,usePanelPick as ae,useMediaBrowsing as ce,useOpenMediaBrowse as pe,useMediaPlace as ue}from"./chunk-FHCKFOCD.js";import{useEaselSession as he}from"./chunk-YM4UEGBV.js";import{useEaselHost as fe,useHostEscape as me}from"./chunk-MQA7OFRA.js";import{LayersIcon as ge,MediaIcon as ye}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-EB6NI2VK.js";import{heldStyle as ke,styleShortcut as be}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{rootRowName as we,slotChildRowName as xe,slotChildRenameProp as ze,sectionRenameProp as Ce}from"./chunk-SSRYU3YG.js";import{ROOT_ZONE as Be,blockNodeActions as Ie,TREE_MAX_DEPTH as Ne,childSlotsOf as Oe,slotFieldsOf as Pe,newNodeId as $e,slotChildrenIn as Me,nestsInTree as Te}from"./chunk-TCAAOYQY.js";import{useEasel as Ae,useEaselApi as je,CanvasPassThroughContext as Le,CanvasSharedContext as Ee}from"./chunk-WJSEWAWK.js";import{TreeRow as Re,Subtree as Fe,LayersTree as De,TreeGroupLabel as We,TreeRowAction as He,TreeSeam as Ve}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Ue}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Ye}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ge,useNodeOps as Je,clickPick as Ke}from"./chunk-BSHIQIZC.js";import{EaselTopBar as Qe,EaselIconButton as Xe,TopBarCluster as Ze,DeviceSwitch as _e,InspectorIconButton as qe,PanelResizeHandle as en,MAX_PANEL_W as nn,MIN_PANEL_W_BY_SIDE as tn,panelWidthVars as on}from"./chunk-ZG6PVMC3.js";import{DEFAULT_NOTICE_WORDS as rn,DEFAULT_CHROME_WORDS as ln}from"./chunk-AJSDWWJW.js";import{holderOf as sn,nameOrSomeone as dn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as an}from"./chunk-RE4LP46F.js";import{useWords as cn}from"./chunk-MFIRYGHW.js";import{insertSeams as pn,CanvasDragLayer as un,CanvasInsert as hn}from"./chunk-CUZQ2HMA.js";import{DEFAULT_DRAG_WORDS as fn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as mn,useTreeDrag as gn,gapToMoveIndex as yn}from"./chunk-3S5N4HLJ.js";import{useCanvasFrame as vn,LIST_SELECTOR as kn,BLOCK_SELECTOR as bn,useCanvasTyping as Sn,useCanvasEvent as wn,nodeIdAt as xn,frameRectToHost as zn,BLOCK_ATTRIBUTE as Cn,drawnBox as Bn}from"./chunk-GHBK7BKL.js";import{queryMainCopy as In}from"./chunk-LF3FUSCQ.js";import{ROOT_ID as Nn,ROOT_SLOT as On,zoneKey as Pn,parseZoneKey as $n,find as Mn,DataError as Tn}from"./chunk-K7BTCBWD.js";import{useRef as An,useMemo as jn,useState as Ln,useEffect as En,useCallback as Rn,useLayoutEffect as Fn,Fragment as Dn,useId as Wn}from"react";import{ColoredBadge as Hn,Button as Vn,Tabs as Un,toast as Yn,readMediaFileDrag as Gn,Tooltip as Jn,groupColors as Kn,Dialog as Qn,FormField as Xn,Input as Zn,MEDIA_FILE_DRAG_TYPE as _n}from"efficient-shell/ui";import{UndoIcon as qn,RedoIcon as et,RefreshIcon as nt,AddIcon as tt,TrashIcon as ot,EyeOffIcon as rt,EyeIcon as it,SharedIcon as lt,DuplicateIcon as st}from"efficient-shell/icons/efficient";import{jsx as dt,jsxs as at,Fragment as ct}from"react/jsx-runtime";var pt="media-file";function ut({name:e,onMake:n,onCancel:t}){const o=cn("screen",ve).shared,[r,i]=Ln(e),[l,s]=Ln(!1),d=Wn(),a=An(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
+
return dt(Qn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */at(ct,{children:[
|
|
3
|
+
/* @__PURE__ */dt(Vn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
+
/* @__PURE__ */dt(Vn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */dt("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */dt(Xn,{label:o.name,htmlFor:d,children:/* @__PURE__ */dt(Zn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var ht=/* @__PURE__ */new WeakSet;function ft(e,n,t){const o=Mn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function mt({canvas:e,tabs:n,onSelect:t}){const o=An(null),[r,i]=Ln({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Fn(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=zn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=In(t,`[${Cn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?Bn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=zn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),c=s.top+s.height;if(c<d.top||s.top>d.top+d.height){a[o.id]=null;continue}const p=o.below?c+4:Math.max(s.top,d.top)+6;a[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(a)},a=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",a,!0),r.addEventListener("resize",a);const c=new r.MutationObserver(a);return c.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a),c.disconnect()}},[e,l]),/* @__PURE__ */dt("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */dt("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
|
|
5
|
+
/* @__PURE__ */dt(Jn,{content:e.reach,children:/* @__PURE__ */at(Hn,{colorClass:Kn("success","solid"),size:"sm",children:[
|
|
6
|
+
/* @__PURE__ */dt("span",{className:"es-band-tab-mark",children:/* @__PURE__ */dt(lt,{size:12})}),e.label]})}):/* @__PURE__ */dt(Hn,{colorClass:Kn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function gt({expand:e}){/* @__PURE__ */
|
|
7
|
+
return dt("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */at(ct,e?{children:[
|
|
8
|
+
/* @__PURE__ */dt("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
+
/* @__PURE__ */dt("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
+
/* @__PURE__ */dt("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
+
/* @__PURE__ */dt("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
+
/* @__PURE__ */dt("path",{d:"M5 12h14"})]})})}var yt=`${kn}, ${bn}`;function vt(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var kt="__rungs";var bt="screen:band",St={duplicate:!0,delete:!0},wt=()=>null;function xt(){const kn=fe(),zn=kn.panels?.Toolbar,Cn=(kn.panels?.useRight??wt)(),{target:Bn,docId:Wn,capabilities:Jn,currentSlug:Kn,siteId:Qn,onPublish:Xn,saveState:Zn,saveConflict:lt,retrySave:xt,toggleAutoSave:zt,flushSave:Ct,access:Bt,saveUnreachable:It=!1,readOnly:Nt,readOnlyReason:Ot=null}=le(),Pt=P(),$t=$(),{mediaEditing:Mt,hasEditGuard:Tt,hasPinnedChrome:At}=Jn,{appState:jt,dispatch:Lt,history:Et,selectedItem:Rt,getSelectorForId:Ft,config:Dt}=Ae(e=>e),Wt=M(),{first:Ht,firstGroup:Vt,lastGroup:Ut,isSectionGroup:Yt,sectionGroupZone:Gt,panelOf:Jt}=Wt,Kt=Jt(Ht),Qt=e=>q(Wt,e),Xt=e=>ee(Wt,e),Zt="node"===Wt.firstRow,_t=Wt.band??null,qt=cn("screen",ve),eo=cn("tree",Ue),no=cn("drag",fn),to=cn("notice",rn),oo=cn("lock",an),ro=cn("menu",Ye),io=cn("styleClipboard",Se),lo=cn("chrome",ln),so=T()??`/${Kn}`,ao=A(),co=j(),po=v({readOnly:Nt}),uo=v({readOnly:Nt,foldIntoHistory:!0}),ho=An(null),fo=je(),mo=jn(()=>({...po,select:e=>{ho.current=e,po.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=fo.config;ho.current=Ge(e,t,n)}po.commitDocument(e,n)}}),[po,fo]),go=jt.ui,yo=go.leftSideBarVisible,vo=go.rightSideBarVisible,{options:ko,widths:bo,initial:So,fluid:wo,fit:xo}=L(),[zo,Co]=Ln(So),Bo=de(),Io=Mt&&null!==Bo;ae(),ce();const No=pe();E(Rt?.props.id);const{read:Oo,write:Po,forSelection:$o}=R(),[Mo,To]=Ln(Oo);En(()=>{Po(Mo)},[Mo]);const[Ao,jo]=Ln(0),Lo=An(null),Eo=An(null),Ro=vn(Eo,{readySelector:yt}),Fo=Sn(Ro),Do=a(Eo);c(Eo,Ro);const Wo=S(),Ho=sn(Bt),Vo={state:Zn,offline:Wo||Zn.failed&&It,readOnlyReason:Ot,editing:Ho?to.editing({name:dn(Ho.name,oo),noun:qt.noun}):null,conflict:null!=lt,notSaving:qt.bar.notSaving},Uo=()=>{Nt||(Zn.failed?xt():Ct())};p(Eo,Ro,Uo);const[Yo,Go]=Ln(!1),Jo=An(!1),[Ko,Qo]=Ln(null),[Xo,Zo]=Ln([]),[_o,qo]=Ln(F),er=D(_o),nr=o(_o,Rt?.props.id),[tr,or]=Ln(null);En(()=>{tr&&(r(),or(null))},[tr]);const rr=An(Ft);rr.current=Ft;const ir=Rn((e,{scroll:n})=>{To(n=>$o(e,n)),n&&or(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=rr.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Ar(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),lr=An(null);En(()=>{const e=lr.current;lr.current=null;const n=null==Rt?.props.id?null:String(Rt.props.id);qo(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Jt(Rt?.type)??F);const t=Rt?.props.id,o=ho.current;if(ho.current=null,!t)return;const r=Ft(t);ir(String(t),{scroll:!i(o,r??null,Be)})},[Rt?.props.id,ir]);const sr=Rn(e=>{qo(n=>W(n,e)?n:e),Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},[Lt]),dr=An(()=>{});dr.current=(e,n)=>{const t=e?Pi(e.zone??Be)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Rt?.props.id?null:String(Rt.props.id);qo(e=>W(e,n)?e:n),o!==r&&(lr.current={id:o,mode:n},mo.select(e))};const ar=Rn((e,n)=>dr.current(e,n),[]),cr={kind:_o.kind,mode:_o,open:sr,show:e=>qo(e),reveal:()=>{vo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:ar},pr=H(cr,{data:jt.data,selected:Rt??null,zoneOf:e=>Ft(e)?.zone,readOnly:Boolean(Nt),select:e=>{qo(F),mo.select({index:e})},replace:(e,n)=>mo.replaceComponent(Be,e,n),scrollTo:e=>l(e)},{device:zo,refreshes:Ao},{setView:To,reveal:()=>{yo||Lt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),ur=pr.resolveLeftView?pr.resolveLeftView(Mo):"sections",hr=V(),{isLockedBlock:fr,duplicateBlocked:mr,nestDepth:gr,newSectionNode:yr,canAddTo:vr,blockIsOffered:kr}=hr,br=U(),{labelAtLevel:Sr,Icon:wr,useProducts:xr}=br,zr=br.rowName?(e,n,t)=>br.rowName(e,n,t):void 0,Cr=Rn(e=>{Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),ir(e,{scroll:!0})},[Lt,ir]),{selectNode:Br,openPartId:Ir}=y({mode:_o,setMode:qo,onOpenPart:Cr}),[Nr,Or]=Ln(null);me(null!==Nr,()=>Or(null));const Pr=f(Y()),$r=Pr.collapsed,Mr=Pr.panelWidths,[Tr,Ar]=Ln(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem($r);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
+
return new Set}});En(()=>{try{window.localStorage.setItem($r,JSON.stringify([...Tr]))}catch{}},[Tr]);const[jr,Lr]=Ln(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem(Mr);if(!e)return{...m};const n=JSON.parse(e);return{left:g(Number(n.left)||m.left,"left"),right:g(Number(n.right)||m.right,"right")}}catch{return{...m}}});En(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Mr,JSON.stringify(jr))}catch{}},300);return()=>clearTimeout(e)},[jr]);const Er=Rn((e,n)=>Lr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Rr=Rn(e=>Er("left",e),[Er]),Fr=Rn(e=>Er("right",e),[Er]),Dr=e=>Tr.has(e),Wr=e=>Ar(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Hr=An(!1),Vr=An(null);En(()=>{if(Hr.current&&!Yo){const e=Vr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Eo.current?.querySelector(`button[aria-label="${CSS.escape(qt.add.title)}"]`))?.focus(),Vr.current=null}Hr.current=Yo},[Yo]),En(()=>{if(!Yo||!Do)return;const e=e=>{"Escape"===e.key&&dl()};return Do.addEventListener("keydown",e),()=>Do.removeEventListener("keydown",e)},[Yo,Do]),me(Yo,()=>dl()),En(()=>{!yo&&Yo&&(Go(!1),Qo(null),Jo.current=!1)},[yo]);const Ur=G(),Yr=(e,n="success",t)=>{if(Ur)return void(t?Ur(e,"error"===n?"error":"info",t):Ur(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Yn.error(e,{...o,duration:t?.duration??3200}):Yn.success(e,{...o,duration:t?.duration??1900})},Gr=An(null),[Jr,Kr]=Ln(0),[Qr,Xr]=Ln(0),Zr=J(),_r=An(null),qr=e=>Math.max(0,e.clientHeight-(_r.current?.offsetHeight??0));En(()=>{const e=Gr.current;if(!e)return;const n=()=>{Kr(e.clientWidth),Xr(qr(e))};n();const t=new ResizeObserver(n);return t.observe(e),_r.current&&t.observe(_r.current),()=>t.disconnect()},[]),Fn(()=>{Gr.current&&(Kr(Gr.current.clientWidth),Xr(qr(Gr.current)))},[jr,yo,vo]);const ei=zo===wo?Jr>0?Jr:bo[wo]:bo[zo],ni=Jr>0?Math.min(Jr/ei,"shrink"===xo?1:2):1,ti=ei*ni,oi=Jr>0&&ti>Jr+1,ri={width:ti,height:Qr||"100%",flex:"none",position:"relative"},ii={width:ei,height:Qr?Qr/ni:"100%",maxHeight:"none",transform:1!==ni?`scale(${ni})`:void 0,transformOrigin:"top left"},li=()=>Lt({type:"setUi",ui:{leftSideBarVisible:!yo}}),si=()=>Lt({type:"setUi",ui:{rightSideBarVisible:!vo}}),di=e=>{Yo&&(Go(!1),Qo(null),Jo.current=!1,yo&&Mo===e)||(To(e),yo||Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},ai=()=>{qo(F),mo.select(null),d()},ci=()=>{qo(Kt??F),vo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},pi=jt.data.content??[],ui=()=>{const e=pi.findIndex(Qt),n=pi.findIndex(Xt);return{floor:e>=0?e+1:0,cap:n>=0?n:pi.length}},hi=Dt,fi=hr.stripCopy,mi=n=>e(n,fi),gi=oe(),yi=Je({data:jt.data,config:hi,readOnly:Boolean(Nt),clipboard:gi,strip:fi?e=>fi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Nn||e.slot!==On)return{min:0,max:n-1};const{floor:t,cap:o}=ui();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&qo(F);const t=void 0===n||"node"===n?.kind?n:null;mo.commitDocument(e,t)}}),vi=he(),[ki,bi]=Ln(null),Si=e=>{const n=pi.find(n=>String(n.props.id)===e),t=Wt.shared;n&&t&&yi.swap(e,t.detach(n))},wi=e=>{const n=Mn(jt.data,Dt,e);if(!n)return!1;const t=Pn(n.place),o=n.node,r=t===Be?Ii(o):Wi(o),i=t===Be?Wt.shared?.usedOn(o):null;return!!yi.remove(e)&&(Yr(i?qt.shared.removed({count:Math.max(0,i.length-1)}):qt.deleted({name:r}),"success",{duration:8e3,action:{label:qt.bar.undo,onClick:()=>{yi.restore(n.node,n.place)}}}),!0)},xi={...yi,remove:wi},zi=e=>Sr(e,"block",Dt.components[e]?.label??e),Ci=Rn(e=>Dt.components[e]?.defaultProps??{},[Dt]),Bi=e=>Sr(e,"section",zi(e)),Ii=e=>we({type:e.type,props:e.props??{}},Bi(e.type),zr),{nodeAddresses:Ni,zoneItems:Oi}=jn(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=Ne)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Oe(Dt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(pi,Be,0),{nodeAddresses:e,zoneItems:n}},[pi,Dt]),Pi=Rn(e=>Oi.get(e)??[],[Oi]),$i=e=>{const n=Ni.get(e);return n?Pi(n.zone)[n.index]:void 0},Mi=e=>ne(hr,Dt,e),Ti=e=>{if(!hr.slotsOf||e===Be)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=$i(e.slice(0,n));if(!t)return null;const o=Mi(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},Ai=(()=>{if(!K(_o))return null;const e=`${_o.nodeId}:${_o.slot}`;return Ti(e)?.slot.panel===_o.kind?e:null})(),ji=An(null);En(()=>{const e=ji.current;if(ji.current=null,!Ai||!K(_o))return;const n=_o.nodeId;ir(n,{scroll:e!==Ai}),Ar(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[_o]);const Li=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Ni.get(e);n&&(n.zone===Be?nl(n.index):Nl(n.zone,n.index,e,$i(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Ai!==i&&(ji.current=i),ar(null,r),vo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ei=(e,n,t)=>{const o=`${e}:${n}`;if(Ar(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;Ai!==o&&(ji.current=o);ar(null,{kind:t,nodeId:e,slot:n})},Ri=(e,n,t)=>{if(Nt||!hr.moveSlot)return;const o=$i(e),r=o?Mi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:kt,index:n},s=yn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=hr.moveSlot(e,n,s);"string"==typeof d&&Ei(e,d,i.panel)},Fi=xr(),Di=jn(()=>{const e=/* @__PURE__ */new Map;for(const n of Fi??[])e.set(n.slug,n.name);return e},[Fi]),Wi=e=>xe(e,zi,br.plainText,e=>Di.get(e),br.rowName),Hi=(e,n)=>{const t=Dt.components[e.type]?.fields,o=n===Be||es(n)?"section":"block",r=n===Be&&(Qt(e)||Xt(e)||Yt(e.type)),i="block"===o?ze(t):r?null:Ce(t);return br.renamePropOf?br.renamePropOf(e,o,i):i},Vi=(e,n,t,o)=>{if(!(!Nt&&Nr?.zone===e&&Nr.index===n))return;const r=(t,o)=>{Or(null),o&&((e,n,t)=>{const o=Pi(e)[n];if(!o)return;const r=Hi(o,e);r&&mo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
+
return dt("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":qt.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Ui=t(Q(),io),Yi=Ui.scope({target:Bn,siteId:Qn,docId:Wn}),Gi=Dt,Ji=(e,n)=>n===Be?Bi(e):zi(e),Ki=(e,n,t)=>{const o=Ui.plan(Yi,t,Ji(t.type,e),Gi);o&&(o.changed&&mo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Yr(o.message))},Qi=re({nodesIn:Pi,nodeAt:(e,n)=>Pi(e)[n]??null,labelOf:(e,n)=>n===Be?Bi(e):zi(e),renamePropOf:Hi,beginRename:(e,n)=>Or({zone:e,index:n}),history:{hasPast:Et.hasPast,hasFuture:Et.hasFuture,back:()=>Et.back(),forward:()=>Et.forward()},openPageSettings:()=>{mo.select(null),qo(F)},pageSettingsLabel:qt.pageSettings,words:{menu:ro,styleClipboard:io,screen:qt.menu},readOnly:Boolean(Nt),collapseAll:()=>Ar(new Set(Pi(Be).map(e=>String(e.props.id)))),onPasteRefused:e=>Yr(e?qt.pasteRefused({name:e.label}):qt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>os(e,n),menuRows:(e,n,t)=>{const o=pr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Wt.shared;if(!t||n!==Be)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:qt.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return Nt||fr(e.type,e)?n:{...n,change:[{label:qt.shared.detach,onClick:()=>Si(e.props.id)}],remove:[{label:qt.shared.removeFromPage,danger:!0,onClick:()=>{wi(e.props.id)}}]}}return Nt||Qt(e)||Xt(e)||Yt(e.type)?null:z(vi)?{change:[{label:qt.shared.makeShared,onClick:()=>bi({id:e.props.id,name:Ii(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>fr(e.type,e),duplicateBlocked:e=>mr(jt.data,e),permits:e=>{const n=Ie(Dt,e.type);return Wt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:xi,isPinned:(e,n)=>n===Be&&(Qt(e)||Xt(e)),sectionBand:ui,locate:e=>Ni.get(e)??null,rowNameOf:(e,n)=>n===Be?Ii(e):Wi(e),selectAt:(e,n,t,o)=>{e===Be?nl(n):Nl(e,n,t,o??"")},slotRung:e=>{const n=Ti(e);return n?.slot.panel?{label:n.slot.label,select:()=>Li(n.node,n.slot,!1)}:null},style:{held:()=>ke(Yi),canCopy:e=>Ui.rows(Gi,e).some(e=>!1!==e.counted),copy:(e,n)=>Ui.copy(Yi,e,Ji(e.type,n),Gi),paste:(e,n,t)=>Ki(e,n,t)},keys:$t?{target:Do,selected:()=>{const e=jt.ui.itemSelector;return e?{zone:e.zone??Be,index:e.index}:null},held:()=>gi.get(),readOnly:Boolean(Nt),onDone:({done:e,name:n})=>{"copied"===e&&Yr(qt.copied({name:n}))}}:void 0},Ro),Xi=An({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});En(()=>{Xi.current={copy:(e,n)=>Ui.copy(Yi,e,Ji(e.type,n),Gi),paste:Ki,at:()=>{const e=jt.ui.itemSelector;if(!e)return null;const n=e.zone??Be,t=Pi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Nt)}});const Zi=Rn(e=>{const n=be(e);if(!n)return;const t=Xi.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);En(()=>{if(!Do)return;const e=e=>Zi(e);return Do.addEventListener("keydown",e),()=>Do.removeEventListener("keydown",e)},[Zi,Do]),wn(Ro,"keydown",Zi);const _i=pi.map(e=>e.props.id).join("|");En(()=>{const e=Ro?.document??null,n=Ro?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Zo(e=>e.length?[]:e);const n=pi.findIndex(Xt),t=n>=0?n:pi.length,o=n=>{const t=pi[n]?.props?.id;return null==t?null:In(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(bn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=pi.length>0&&!Qt(pi[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=vt(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Zo(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[Ro,_i,zo,ni,yo,vo,Rt?.props.id]);const qi=Ro?.document??null,el=Ro?.window??null;En(()=>{const e=Lo.current;if(!e||!qi||!el)return;const n=[],t=()=>{const n=In(qi,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&el.scrollTo({left:el.scrollX,top:el.scrollY+t,behavior:"instant"}),!0};return Lo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[qi,el]);const nl=e=>{qo(F),mo.select({index:e}),pr.sectionPressed?.(pi[e]);const n=pi[e]?.props?.id;n&&l(n)},tl=e=>{const{floor:n,cap:t}=ui(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Rt&&_o.kind!==Kt?.kind?pi.findIndex(e=>e.props.id===Rt.props.id):-1;return o(r>=0?r+1:t)},ol=(e,n)=>{const{floor:t,cap:o}=ui(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(mo.reorderComponent(Be,e,i),mo.select({index:i}),{moved:!0,dest:i})},rl=(e,n,t,o)=>{qo(F),mo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Yr(qt.sectionAdded({name:t}))},il=(e,n)=>{const t=tl(n),o=yr(e,{nodeDefaults:Ci,newNodeId:$e,sectionLabel:Bi,blockIsOffered:kr}),r=o?mo.insertNode(Be,t,o):mo.insertSection(e,t);return rl(t,r,Bi(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:a}of Oe(Dt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=vr(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:a,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},ll=e=>sl(Be,e),sl=(e,n)=>{Vr.current=document.activeElement??null,Qo(null===n?null:{zone:e,index:n}),Go(!0),yo||(Jo.current=!0,Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},dl=()=>{Go(!1),Qo(null),Jo.current&&Lt({type:"setUi",ui:{leftSideBarVisible:!1}}),Jo.current=!1},al=(e,n)=>br.rowName?n?Qt(e)?br.rowName(e,"section",qt.header):Xt(e)?br.rowName(e,"section",qt.footer):Yt(e.type)?br.rowName(e,"section",zi(e.type)):Ii(e):Wi(e):n?Bi(e.type):zi(e.type),cl=e=>n=>{e()},pl=(e,n,t)=>{if(Nt)return null;const o=Pi(e)[n];return o&&!Ie(Dt,o.type).delete||o&&fr(o.type,o)?null:/* @__PURE__ */dt(He,{kind:"delete",label:e===Be&&o&&Wt.shared?.usedOn(o)?qt.shared.removeFromPage:qt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Pi(e)[n]?.props?.id;null!=t&&wi(String(t))})(e,n),children:/* @__PURE__ */dt(ot,{size:15})})},ul=e=>br.rowPreview?.(e)||void 0,hl=e=>br.rowMarks?.(e)??void 0,fl=(e,n,t)=>br.rowActions?.(e,n,t)??null,ml=(e,n,t,o)=>{if(Nt)return null;if(fr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
+
return dt(He,{kind:"eye",label:r?qt.showNamed({name:o}):qt.hideNamed({name:o}),onClick:()=>yl(e,n,t),children:/* @__PURE__ */dt(r?rt:it,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},gl=e=>Vs(Be,e),yl=(e,n,t)=>{mo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},vl=e=>Pe(Dt,e),kl=e=>Oe(Dt,e),bl=e=>hr.slotsOf?Mi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Me(e,n.slot)})):[{slot:null,rung:null,kids:kl(e)}],Sl=e=>hr.slotsOf?bl(e).flatMap(e=>e.kids):kl(e),wl=e=>Boolean(hr.slotsOf)&&Mi(e).some(e=>e.rung),xl=(e,n,t)=>null===t?void 0===n?vr(e):vr(e,n):vr(e,n,t),zl=(e,n,t)=>{const o=Te(Dt,e.type,n)&&(t||Sl(e).length>0||wl(e));return{collapsible:o,folded:o&&Dr(String(e.props.id))}},Cl=(e,n,t)=>bl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>zl(e,r,t(e.type)).collapsible?[String(e.props.id),...Cl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Bl=e=>Sl(e).length>0||wl(e)||Boolean(vr(e.type)),Il=e=>Boolean(vr(e)),Nl=(e,n,t,o)=>{if(qo(F),vr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),mo.select({index:n,zone:e}),l(t)}else mo.select({index:n,zone:e}),l(t)},Ol=(e,n,t,o,r)=>{const i=`${e}:${n}`;mo.insertComponent(i,t,o),vr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),mo.select({index:o,zone:i})}):mo.select({index:o,zone:i})},Pl=An(/* @__PURE__ */new Set);En(()=>{pi.forEach(e=>{const n=vr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Pl.current.has(t))return;Pl.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(Ci)).forEach((e,t)=>uo.seedChild(o,t,n.childType,e))})},[pi,uo,Ci]);const $l=An(/* @__PURE__ */new Set);En(()=>{pi.forEach((e,t)=>{const o=e.props.id;if($l.current.has(o))return;const r=n(e,vl(e.type));$l.current.add(o),r&&uo.replaceComponent(Be,t,{...e,props:r})})},[pi,uo]),X(uo,Dt);const Ml=pi.findIndex(Xt),Tl=Ml>=0?pi[Ml]:null,Al=Zt?pi.findIndex(Qt):-1,jl=Al>=0?pi[Al]:null,Ll=Wt.groupTab,El=jn(()=>Ll?e=>Yt(e.type):void 0,[Ll]),Rl=Boolean(Wt.groupBadge),Fl=Wt.sharedReach,Dl=e=>Fl?.(e)??void 0,Wl=jn(()=>Fl?new Set(pi.filter(e=>Dl(e)).map(e=>String(e.props.id))):null,[pi,Fl]),Hl=jn(()=>Wl?e=>Wl.has(e):void 0,[Wl]),Vl=Wt.first?Fl?.({type:Wt.first,props:{id:""}})??void 0:void 0,Ul=Wt.groupBadge?/* @__PURE__ */dt("span",{className:"es-tree-group-badge",children:/* @__PURE__ */dt(Hn,{tone:"info",size:"xs",children:Wt.groupBadge})}):void 0,Yl=pi.find(e=>e.type===Vt)??null,Gl=pi.find(e=>e.type===Ut)??null,Jl=Ml>=0?Ml:pi.length,Kl=[];pi.forEach(e=>{Xt(e)||(Bl(e)&&Kl.push(String(e.props.id)),Kl.push(...Cl(e,1,Il)))}),Tl&&(Kl.push(String(Tl.props.id)),Kl.push(...Cl(Tl,1,Il)));const Ql=Kl.length>0&&Kl.every(e=>Tr.has(e)),Xl=e=>{const n=br.blockRowName(e,zi);return br.rowName?br.rowName(e,"block",n):n},Zl=(e,n,t,o)=>{const r=Pi(e)[t];if(!r)return;const i={...$n(e),index:t},l={...$n(n),index:Math.min(Math.max(o,0),Pi(n).length)},s=yn(i,l);if(e!==n||s!==t)try{yi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Tn))throw e}},_l=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of kl(e))n.add(r),t(o)};for(const t of vl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ql=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ni.get(n);if(!e)return null;if(e.zone===Be)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},es=e=>{const n=e.slice(0,e.indexOf(":")),t=pi.find(e=>Yt(e.type)&&String(e.props.id)===n);return t&&Gt(n)===e?t:null},ns=(e,n)=>{const t=es(e);return!t||(!Wt.groupAccepts||Wt.groupAccepts(t.type,n,Pi(e).length))},ts=(e,n,t)=>{if(e.rung){const t=$i(e.rung.nodeId),o=t?Mi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===kt&&n.index>=0&&n.index<=o}if(n.slot===kt)return!1;if(e.add)return ls(e.add,n);const o=Pn(n);if(Yt(e.type))return!1;const r=es(o),i=es(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!ns(o,e.type))&&(n.index>=0&&n.index<=Pi(o).length));if(e.zone===Be||o===Be){if(e.zone!==o)return!1;const{floor:t,cap:r}=ui();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Pi(o).length)return!1;if(e.zone===o)return!0;const l=Tl&&!Wt.lastIsOpen?String(Tl.props.id):null;return(!l||ql(e.zone)!==l&&ql(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Pi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ni.get(i),s=l?Pi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&_l(r).has(n))return!1;const d=vr(s.type,gr(jt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Pi(n),r))})(e.zone,o,e.index,t)},os=(e,n)=>{const t=Pn(e.from),o=e.node;return t===Pn(n)?ns(t,o.type):ts({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},rs=e=>{const n=e.slice(0,e.indexOf(":")),t=Ni.get(n),o=t?Pi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=vr(o.type,gr(jt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=O(r.choices??(r.spec?[{type:r.spec.childType,label:zi(r.spec.childType)}]:[])),l=Ti(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:al(o,t.zone===Be)}},is=(e,n)=>{if("section"!==e.kind)return e;const t=Pn(n);return t===Be||es(t)?e:rs(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ls=(e,n)=>{const t=is(e,n),o=Pn(n);if("shared"===t.kind){if(o!==Be||!Wt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=ui();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(es(o)){const e="section"===t.kind?t.type:t.template.node.type;return ns(o,e)&&n.index>=0&&n.index<=Pi(o).length}if(o!==Be)return!1;const{floor:e,cap:r}=ui();return n.index>=e&&n.index<=r}if(o===Be)return!1;const r=rs(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Pi(o))},ss=(e,n)=>{const t=is(e,n);if("block"!==t.kind&&es(Pn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&ns(n,o)){if("section"===e.kind)mo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;mo.insertNode(n,t,mi(e.template.node))}qo(F),mo.select({index:t,zone:n})}})(t,Pn(n),n.index);if("section"===t.kind)return void il(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=tl(t),r=mo.insertNode(Be,o,n);rl(o,r,e)})(t.template.name,mi(t.template.node),n.index);if("shared"===t.kind){const e=Wt.shared?.nodeOf(t.section);if(!e)return;const o=tl(n.index);return void(yi.restore(e,{parentId:Nn,slot:On,index:o})&&rl(o,e.props.id,t.section.title))}const o=Pn(n),r=rs(o);r&&(r.target.spec?Ol(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{mo.insertComponent(e,n,t),qo(F),mo.select({index:t,zone:e})})(o,t.type,n.index))},ds=(e,n)=>{e.media?function(e){const n=Rs();if(!n||!js)return;Ds(n).then(n=>{n&&function(e,n){if(!js)return;const t=js.create(e,{nodeDefaults:Ci,newNodeId:$e,sectionLabel:Bi,blockIsOffered:kr}),o=Pn(n);if(o===Be){const e=tl(n.index),o=mo.insertNode(Be,e,t);return void rl(e,o,Bi(t.type))}mo.insertNode(o,n.index,t),qo(F),mo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Ri(e.rung.nodeId,e.index,n.index):e.add?ss(e.add,n):e.zone===Be?ol(e.index,n.index):Zl(e.zone,Pn(n),e.index,n.index)},[as]=Ln(()=>mn()),cs=gn({keyOf:e=>e.id,readOnly:Boolean(Nt),session:as,canDrop:ts,onDrop:ds,onStep:(e,n)=>{e.rung?Ri(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Be?((e,n)=>{const t=Bi(pi[e]?.type??""),o=ol(e,n<0?e-1:e+2);if(!o.moved)return void Yr(n<0?qt.sectionFirst({name:t}):qt.sectionLast({name:t}));const{floor:r,cap:i}=ui();Yr(qt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Zl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),ps=Rn(e=>{const{floor:n,cap:t}=ui(),o=[];for(const r of e.nodes){const e=Pn(r.place),i=Pi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Qt(i)||Xt(i)||fr(i.type,i))continue;if(Yt(i.type))continue;const l=Boolean(es(e)),s=e===Be||l;e===Be&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?Bi(i.type):Wi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Pn(e.list);if(n===Be&&0===e.children.length)return[{...e,addLabel:qt.addSection,addAlways:!0}];const t=rs(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(es(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Pn(e.list),t=n===Be||es(n)?null:rs(n);return t?.choices.length?pn(e,t.target.spec?.addLabel??qt.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[jt.data]),us=null==Rt?.props.id?null:String(Rt.props.id),hs=Rn(e=>{const n=Dt,t=e=>!e.item.rung&&null!==Mn(jt.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(us);return i||(r(Ke(jt.data,n,o.item.id,us,El))??o)},[jt.data,Dt,us,El]),[fs,ms]=Ln(null),gs=Boolean(Ll||Fl);wn(Ro,"mouseover",e=>{if(!gs)return;const n=xn(e.target),t=n?ft(jt.data,Dt,n):null;t!==fs&&ms(t)}),wn(Ro,"mouseout",e=>{gs&&!e.relatedTarget&&ms(null)});const ys=e=>Qt(e)||Xt(e)||Yt(e.type),vs=e=>{const n=Yt(e.type)?zi(e.type):Qt(e)?qt.header:Xt(e)?qt.footer:null;return null===n?Ii(e):br.rowName?br.rowName(e,"section",n):n},ks=[];if(gs){const e=us?ft(jt.data,Dt,us):null;for(const n of/* @__PURE__ */new Set([e,fs])){const e=n?pi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Qt(e)||e.type===Vt,o=Dl(e);if(o){ks.push({id:String(e.props.id),label:vs(e),below:t,reach:o});continue}if(!Ll||!ys(e))continue;const r=Ll(e);r&&ks.push({id:String(e.props.id),label:r,below:t})}}const bs=he(),Ss=An(null);En(()=>{const e=Wt.changeNotice;if(!e)return;const n=JSON.stringify(pi.filter(ys)),t=Ss.current;if(Ss.current={doc:Wn,bands:n,index:Et.index},!t||t.doc!==Wn||t.bands===n)return;Et.hasPast&&Et.index>=t.index&&!ht.has(bs)&&(ht.add(bs),Yr(e,"success",{action:{label:qt.bar.undo,onClick:()=>Et.back()},duration:8e3}))},[pi]);const ws=e=>{qo(F),mo.select(e.zone===Be?{index:e.index}:{index:e.index,zone:e.zone})},xs=Z(),zs=()=>({data:jt.data,device:zo,ops:mo,inspector:cr}),Cs=xs?.model,Bs=jn(()=>Cs?e=>Cs(e,ps(e),zs()):ps,[Cs,ps,zo]),Is=xs?.measure,Ns=Is?(e,n)=>Is(e,n,zs()):void 0,Os=xs?.canDrop,Ps=Os?(e,n)=>Os(e,n,ts,zs()):ts,$s=xs?.drop,Ms=$s?(e,n)=>$s(e,n,ds,zs()):ds,Ts=xs?.pick,As=Ts?e=>Ts(e,ws,zs()):ws,js=xs?.media??null,Ls=An(null),Es=jn(()=>js?{id:pt,zone:"",index:-1,type:js.adds.type,add:{kind:js.adds.kind,type:js.adds.type},media:!0}:null,[js]);En(()=>{if(!Es||Nt||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(_n))(e)&&(Ls.current=null,as.start({key:pt,item:Es}))},n=e=>{as.get()?.item.media&&(Ls.current=Gn(e.dataTransfer))},t=()=>{as.get()?.item.media&&as.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[Es,Nt,as]);const Rs=()=>{const e=Ls.current;return Ls.current=null,e},Fs=ue(),Ds=async e=>{if(!Fs)return e;const n=await Fs(e);return n?{...e,id:n.id,url:n.url}:null};const Ws=(e,n)=>{if(!js)return;const t=Mn(fo.getState().appState.data,hi,n);if(!t)return;const o=t.node;mo.replaceComponent(Pn(t.place),t.place.index,{...o,props:{...js.replace(o,e),id:o.props.id}})},Hs=e=>{const n=Pn(e),t=Ti(n);t&&Li(t.node,t.slot,!1),sl(n,e.index)},Vs=(e,n)=>/* @__PURE__ */dt(Ve,{...Nt?{}:cs.seam({place:{...$n(e),index:n}})},`seam:${e}:${n}`),Us={rowClick:cl,isCollapsed:Dr,toggleCollapse:Wr},Ys=e=>{const n=String(e.props.id),t=pi.findIndex(e=>String(e.props.id)===n),o=Gt(n),r=Pi(o),i=Dr(n),l=zi(e.type),s=br.rowName?br.rowName(e,"section",l):l,d=e=>Vs(o,e);/* @__PURE__ */
|
|
16
|
+
return at(ct,{children:[
|
|
17
|
+
/* @__PURE__ */dt(Re,{words:eo,icon:/* @__PURE__ */dt(wr,{type:e.type,size:13}),name:s,preview:ul(e),marks:hl(e),onSelect:()=>nl(t),nameSlot:Vi(Be,t,n,s),selected:nr===n,badge:Dl(e)?void 0:Ul,shared:Dl(e),actions:fl(e,Be,t)??void 0,rowProps:{"data-node-id":n,onClick:cl(()=>nl(t))},fold:{open:!i,label:"section",onToggle:()=>Wr(n)}}),!i&&/* @__PURE__ */at(Fe,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ii(n),l=Bl(n),s=l&&Dr(r),a=()=>Nl(o,t,r,e.type),{rowProps:c,...p}=cs.row({item:{id:r,zone:o,index:t,type:n.type},place:{...$n(o),index:t}},{"data-node-id":r,onClick:cl(a)});/* @__PURE__ */
|
|
18
|
+
return at(Dn,{children:[d(t),
|
|
19
|
+
/* @__PURE__ */dt(Re,{words:eo,icon:/* @__PURE__ */dt(wr,{type:n.type,size:13}),name:i,preview:ul(n),marks:hl(n),onSelect:a,nameSlot:Vi(o,t,r,i),selected:nr===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Wr(r)}:void 0,actions:/* @__PURE__ */at(ct,{children:[pl(o,t,i),fl(n,o,t),ml(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */dt(Fe,{children:Ks(n,2)})]},r)}),d(r.length)]})]})},Gs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=cs.dragging,d=!Dr(l)&&s?.rung?.nodeId!==i,a={...$n(l),index:0},c=s&&!s.rung&&ts(s,a)?a:void 0,p=()=>Li(e,n,!0),{rowProps:u,...h}=cs.row({item:{id:`rung:${l}`,zone:`${i}:${kt}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:kt,index:t},into:c,canDrag:Boolean(hr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:cl(p)}),f=Nt?null:hr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
+
return at(Dn,{children:[n.heading,
|
|
21
|
+
/* @__PURE__ */dt(Re,{words:eo,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Ai===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Wr(l)},actions:f&&f.length>0?/* @__PURE__ */dt(ct,{children:f.map((t,o)=>/* @__PURE__ */dt(He,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Nt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ei(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */dt(ot,{size:15}):/* @__PURE__ */dt(st,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */dt(Fe,{children:r})]},l)},Js=(e,n)=>{const t=bl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
+
return dt(ct,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=xl(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>Vs(e,n),p=/* @__PURE__ */at(ct,{children:[i.map(({child:n,zone:t,index:o})=>{const r=nr===String(n.props.id),{collapsible:i,folded:s}=zl(n,l,Il(n.type)),d=String(n.props.id),a=Xl(n),p=()=>Nl(t,o,d,e.type),{rowProps:u,...h}=cs.row({item:{id:d,zone:t,index:o,type:n.type},place:{...$n(t),index:o}},{"data-node-id":d,onClick:cl(p)});/* @__PURE__ */
|
|
23
|
+
return at(Dn,{children:[0===o&&c(t,0),
|
|
24
|
+
/* @__PURE__ */dt(Re,{words:eo,icon:/* @__PURE__ */dt(wr,{type:n.type,size:13}),name:a,preview:ul(n),marks:hl(n),onSelect:p,nameSlot:Vi(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Wr(d)}:void 0,actions:/* @__PURE__ */at(ct,{children:[pl(t,o,a),fl(n,t,o),ml(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */dt(Fe,{children:Js(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?Gs(e,t.rung,r++,o,p):/* @__PURE__ */dt(Dn,{children:p},t.slot??"")})})},Ks=(e,n)=>{const t=gr(jt?.data,e.type,String(e.props.id)),o=bl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
+
return dt(ct,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=xl(e.type,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),h=a&&!a.fixed?`${u}:${a.slot}`:null,f=p?`${u}:${p.slot}`:null,m=(e,n)=>Vs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),v=/* @__PURE__ */at(ct,{children:[l.map(({child:n,zone:t,index:o})=>{const r=nr===String(n.props.id),i=Wi(n),l=String(n.props.id),{collapsible:d,folded:a}=zl(n,s,Il(n.type)),c=vl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...$n(p),index:Pi(p).length}:void 0,h=cs.dragging,f=u&&h&&ts(h,u)?u:void 0,g=()=>Nl(t,o,l,e.type),{rowProps:y,...v}=cs.row({item:{id:l,zone:t,index:o,type:n.type},place:{...$n(t),index:o},into:f,canDrag:!fr(n.type,n)},{"data-node-id":l,onClick:cl(g)});/* @__PURE__ */
|
|
26
|
+
return at(Dn,{children:[0===o&&m(t,0),
|
|
27
|
+
/* @__PURE__ */dt(Re,{words:eo,icon:/* @__PURE__ */dt(wr,{type:n.type,size:13}),name:i,preview:ul(n),marks:hl(n),onSelect:g,nameSlot:Vi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Wr(l)}:void 0,actions:fr(n.type,n)?fl(n,t,o)??void 0:/* @__PURE__ */at(ct,{children:[pl(t,o,i),fl(n,t,o),ml(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */dt(Fe,{children:Ks(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
+
/* @__PURE__ */dt(w,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>Ol(e.props.id,a.slot,a.childType,c.length,e.type)}),null===g?f&&!l.some(e=>e.zone===f)?m(f,0):null:0!==l.length||(o.rung?y:g!==f)?null:m(g,0)]});return o.rung?Gs(e,o.rung,i++,r,v):/* @__PURE__ */dt(Dn,{children:v},o.slot??"")})})},Qs=Yo,Xs=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:yo&&!Qs&&ur===e.id,onSelect:()=>di(e.id)}:e,Zs=[...(pr.railLead??[]).map(Xs),{id:"sections",label:qt.layers,icon:/* @__PURE__ */dt(ge,{}),active:yo&&!Qs&&"sections"===ur,onSelect:()=>di("sections")},...(pr.railTrail??[]).map(Xs)],_s=Io?{onPress:No}:Mt?{onPress:()=>{se(kn,{accept:"image/*",title:lo.mediaLibrary})}}:null,qs={value:Zs.find(e=>!0===e.active)?.id??"",press:e=>{const n=Zs.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:Zs.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */dt("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},ed=[...pr.railLead??[],...pr.railTrail??[]].find(e=>"panel"in e&&e.id===ur),nd=Boolean(_t?.foldable),td=_t?.label??(Tt?qt.pageSections:qt.templateSections),od=nd&&Dr(bt),rd=/* @__PURE__ */at(ct,{children:[pi.map((e,n)=>{if(Qt(e)||Xt(e)||Yt(e.type))return null;const t=nr===String(e.props.id),o=Boolean(e.props._hidden);kl(e);const r=String(e.props.id),i=pr.hasOwnRows?.(e)??!1,l=Bl(e)||i,s=l&&Dr(r),d=vl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...$n(a),index:Pi(a).length}:void 0,p=cs.dragging,u=c&&p&&ts(p,c)?c:void 0,{rowProps:h,...f}=cs.row({item:{id:r,zone:Be,index:n,type:e.type},place:{...$n(Be),index:n},into:u,canDrag:!fr(e.type,e)},{"data-node-id":r,onClick:cl(()=>nl(n))});/* @__PURE__ */
|
|
29
|
+
return at(Dn,{children:[n>0&&gl(n),
|
|
30
|
+
/* @__PURE__ */dt(Re,{words:eo,icon:/* @__PURE__ */dt(wr,{type:e.type,size:13}),name:Ii(e),preview:ul(e),marks:hl(e),shared:Dl(e),onSelect:()=>nl(n),nameSlot:Vi(Be,n,r,Ii(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Wr(r)}:void 0,actions:/* @__PURE__ */at(ct,{children:[pl(Be,n,Ii(e)),fl(e,Be,n),ml(Be,n,e,Ii(e))]}),rowProps:h}),Bl(e)&&!s&&/* @__PURE__ */at(Fe,{children:[Ks(e,1),pr.partRows?.(e,Us)]}),i&&!s&&/* @__PURE__ */dt(Fe,{children:pr.ownRows?.(e,n,Us)})]},String(e.props.id??n))}),Jl>0&&gl(Jl)]}),id=(e,n,t)=>{const o=String(e.props.id),r=Sl(e).length>0||wl(e)||Boolean(vr(e.type)),i=r&&Dr(o),l="header"===t?qt.header:qt.footer,s=br.rowName?br.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
+
return at(ct,{children:[
|
|
32
|
+
/* @__PURE__ */dt(Re,{words:eo,icon:/* @__PURE__ */dt(wr,{type:t,size:13}),name:s,preview:ul(e),marks:hl(e),badge:Dl(e)?void 0:Ul,shared:Dl(e),onSelect:()=>nl(n),nameSlot:Vi(Be,n,o,s),selected:nr===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Wr(o)}:void 0,actions:fl(e,Be,n)??void 0,rowProps:{"data-node-id":o,onClick:cl(()=>nl(n))}}),r&&!i&&/* @__PURE__ */dt(Fe,{children:Js(e,1)})]})};return(pr.wrap??(e=>e))(
|
|
33
|
+
/* @__PURE__ */dt(_,{target:Ro,children:/* @__PURE__ */at("div",{ref:Eo,className:"sf-editor es-editor",style:on(jr),onContextMenu:Qi.onEditorContextMenu,...u(kn),children:[
|
|
34
|
+
/* @__PURE__ */at(Qe,{children:[
|
|
35
|
+
/* @__PURE__ */at("div",{className:"es-cluster es-cluster--left",children:[_s?/* @__PURE__ */dt(Vn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */dt(ye,{}),onClick:_s.onPress,children:qt.railMedia}):null,
|
|
36
|
+
/* @__PURE__ */dt(Xe,{label:qt.bar.undo,disabled:Boolean(Nt)||!Et.hasPast,onClick:()=>Et.back(),children:/* @__PURE__ */dt(qn,{})}),
|
|
37
|
+
/* @__PURE__ */dt(Xe,{label:qt.bar.redo,disabled:Boolean(Nt)||!Et.hasFuture,onClick:()=>Et.forward(),children:/* @__PURE__ */dt(et,{})})]}),
|
|
38
|
+
/* @__PURE__ */at(Ze,{children:[
|
|
39
|
+
/* @__PURE__ */dt(_e,{devices:ko,value:zo,onChange:Co}),
|
|
40
|
+
/* @__PURE__ */dt(Xe,{label:qt.bar.refresh,tip:qt.bar.refreshTip,onClick:()=>{Lo.current=(()=>{const e=Ro?.document;if(!e)return null;const n=pi.findIndex(Xt),t=n>=0?n:pi.length;let o=null;for(let n=0;n<t;n++){const t=pi[n]?.props?.id;if(null==t)continue;const r=In(e,`[data-easel-block="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Rt?.props?.id??pi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),jo(e=>e+1)},children:/* @__PURE__ */dt(nt,{})}),pr.barView?.()]}),
|
|
41
|
+
/* @__PURE__ */at(Ze,{kind:"right",style:{minWidth:300},children:[
|
|
42
|
+
/* @__PURE__ */dt(k,{input:Vo,words:qt.saveStatus}),zn?/* @__PURE__ */dt(zn,{}):null,pr.barLead?.(),pr.barTrail?.(),pr.mainAction||!pr.barMain?/* @__PURE__ */dt(b,{input:Vo,action:pr.mainAction??{label:qt.done,onPress:()=>{Xn(jt.data)}},readOnly:Boolean(Nt),saveSwitch:Pt,onToggleAutoSave:zt,onSaveNow:Uo,bar:qt.bar,words:qt.saveStatus}):pr.barMain()]})]}),
|
|
43
|
+
/* @__PURE__ */dt(ie,{}),
|
|
44
|
+
/* @__PURE__ */at("div",{className:"sf-body",children:[yo?/* @__PURE__ */at(ct,{children:[
|
|
45
|
+
/* @__PURE__ */at("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":qt.leftPanel,children:[
|
|
46
|
+
/* @__PURE__ */at("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
|
+
/* @__PURE__ */dt(B,{side:"left",onHide:li}),
|
|
48
|
+
/* @__PURE__ */dt("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
|
|
49
|
+
/* @__PURE__ */dt(Un,{variant:"underline",block:!0,"aria-label":qt.bar.views,value:qs.value,onChange:qs.press,items:qs.items})]}),Yo?/* @__PURE__ */dt(x,{at:Ko?{label:(e=>{const n=es(e.zone);if(n)return qt.add.addingTo({name:br.rowName?al(n,!0):zi(n.type)});if(e.zone===Be){const n=pi[e.index];return n&&!Xt(n)?qt.add.addingBefore({name:al(n,!0)}):qt.add.addingAtEnd}const t=rs(e.zone);return t?qt.add.addingTo({name:t.parentName}):qt.add.addingHere})(Ko),onClear:()=>Qo(null)}:void 0,placeBlocks:Ko&&Ko.zone!==Be?rs(Ko.zone)?.choices:void 0,canTake:Ko?e=>{if(!Ko)return null;const n={...$n(Ko.zone),index:Ko.index};if(ls(e,n))return null;if("shared"===e.kind&&Ko.zone===Be&&!Wt.shared?.nodeOf(e.section))return qt.shared.alreadyHere;const t=es(Ko.zone);if(t)return qt.add.notInside({name:al(t,!0)});if(Ko.zone===Be)return qt.add.onlySections;const o=rs(Ko.zone);return o?qt.add.notInside({name:o.parentName}):qt.add.onlySections}:void 0,onPick:Ko?e=>{if(!Ko)return;const n={...$n(Ko.zone),index:Ko.index};ls(e,n)&&(ss(e,n),dl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:e.type,add:e}),session:as,siteWide:pr.addPanelRow?.(dl),onClose:dl,readOnly:Boolean(Nt)}):ed?ed.panel({onHide:li,notify:Yr}):/* @__PURE__ */at(ct,{children:[
|
|
50
|
+
/* @__PURE__ */dt(I,{icon:/* @__PURE__ */dt(ge,{}),title:qt.layers,context:so,actions:/* @__PURE__ */at(ct,{children:[!Nt&&/* @__PURE__ */dt(qe,{label:qt.add.title,onClick:()=>ll(null),children:/* @__PURE__ */dt(tt,{size:15})}),
|
|
51
|
+
/* @__PURE__ */dt(qe,{label:Ql?qt.expandAll:qt.collapseAll,title:0===Kl.length?qt.nothingToFold:void 0,disabled:0===Kl.length,onClick:()=>Ar(e=>{const n=new Set(Kl);return Ql?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Kl])}),children:/* @__PURE__ */dt(gt,{expand:Ql})})]})}),
|
|
52
|
+
/* @__PURE__ */at(De,{className:"sf-tree sf-scroll",words:eo,children:[
|
|
53
|
+
/* @__PURE__ */dt(Re,{words:eo,icon:/* @__PURE__ */dt(wr,{type:"page",size:13}),name:qt.pageSettings,onSelect:ai,selected:!Rt&&er,rowProps:{onClick:cl(ai)}}),Yl&&/* @__PURE__ */at(ct,{children:[!Rl&&/* @__PURE__ */dt(We,{children:qt.header}),Ys(Yl)]}),At&&!(Rl&&Yl)&&/* @__PURE__ */at(ct,{children:[!Rl&&/* @__PURE__ */dt(We,{children:qt.header}),!Zt&&/* @__PURE__ */dt(Re,{words:eo,icon:/* @__PURE__ */dt(wr,{type:"header",size:13}),name:qt.header,badge:Vl?void 0:Ul,shared:Vl,onSelect:ci,selected:_o.kind===Kt?.kind,rowProps:{onClick:cl(ci)}})]}),jl&&!(Rl&&Yl)&&id(jl,Al,"header"),!nd&&/* @__PURE__ */dt(We,{children:td}),nd?/* @__PURE__ */at(ct,{children:[
|
|
54
|
+
/* @__PURE__ */dt(Re,{words:eo,icon:null,name:td,fold:{open:!od,label:td,onToggle:()=>Wr(bt)}}),!od&&/* @__PURE__ */dt(Fe,{children:rd})]}):rd,At&&!Rl&&/* @__PURE__ */dt(We,{children:qt.footer}),Tl&&!(Rl&&Gl)&&id(Tl,Ml,"footer"),Gl&&Ys(Gl),pr.treeFoot?.()]})]})]}),
|
|
55
|
+
/* @__PURE__ */dt(en,{side:"left",width:jr.left,min:tn.left,max:nn,defaultWidth:m.left,label:qt.resizeLeftPanel,onResize:Rr})]}):/* @__PURE__ */dt(N,{side:"left",onShow:li}),
|
|
56
|
+
/* @__PURE__ */at("div",{ref:Gr,className:"sf-center sf-scroll","data-sf-canvas-head":Zr?"":void 0,style:{overflowX:oi?"auto":"hidden",overflowY:"hidden"},children:[Zr&&/* @__PURE__ */dt("div",{ref:_r,className:"sf-canvas-head",children:/* @__PURE__ */dt(Zr,{device:zo})}),
|
|
57
|
+
/* @__PURE__ */at("div",{className:"sf-frame-scaler",style:ri,children:[
|
|
58
|
+
/* @__PURE__ */dt("div",{className:"sf-frame "+(zo===wo?"":`sf-frame--${zo}`),style:ii,children:/* @__PURE__ */at("div",{className:"sf-preview-host",children:[
|
|
59
|
+
/* @__PURE__ */dt(Le.Provider,{value:El,children:/* @__PURE__ */dt(Ee.Provider,{value:Hl,children:/* @__PURE__ */dt(ao,{},Ao)})}),
|
|
60
|
+
/* @__PURE__ */dt(un,{canvas:Ro,session:as,model:Bs,measure:Ns,canDrop:Ps,onDrop:Ms,choose:hs,onPick:As,dropOn:js?{accepts:(e,n)=>{if(!e.media||!js||n.item.rung)return!1;const t=Mn(jt.data,hi,n.item.id);return null!==t&&js.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Rs();n&&js&&Ds(n).then(n=>{n&&Ws(n,e.item.id)})})(n),label:()=>qt.canvasReplaceImage}:void 0,onZoneAdd:Hs,onSeamAdd:Hs,zoneAddLabel:qt.canvasAddBlock,words:no.canvas,readOnly:Boolean(Nt),revision:jt.data}),Xo.length>0&&!Fo&&/* @__PURE__ */dt("div",{className:"sf-preview-gaps",children:Xo.map(e=>
|
|
61
|
+
/* @__PURE__ */dt(hn,{index:e.index,label:qt.addSectionHere,onInsert:()=>ll(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),gs?/* @__PURE__ */dt(mt,{canvas:Ro,tabs:ks,onSelect:e=>{const n=pi.findIndex(n=>String(n.props.id)===e);n>=0&&nl(n)}}):null]})]}),vo?/* @__PURE__ */at(ct,{children:[Cn?
|
|
62
|
+
/* @__PURE__ */dt("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:Cn}):/* @__PURE__ */dt(ct,{children:/* @__PURE__ */dt(h,{value:{selectChild:Nl,addChild:Ol,childRowName:Wi,blockRowName:Xl},children:/* @__PURE__ */dt(co,{mode:_o,onOpenWebsiteSettings:pr.openSettings??(()=>{}),onOpenSiteStyles:pr.openStyles,onSelectNode:Br,onNotify:Yr,onHidePanel:si,nodeActions:Rt?Ie(Dt,Rt.type):St})})}),
|
|
63
|
+
/* @__PURE__ */dt(en,{side:"right",width:jr.right,min:tn.right,max:nn,defaultWidth:m.right,label:qt.resizeSettingsPanel,onResize:Fr})]}):
|
|
64
|
+
/* @__PURE__ */dt(N,{side:"right",onShow:si})]}),Qi.menu,
|
|
65
|
+
/* @__PURE__ */dt(te,{}),ki?/* @__PURE__ */dt(ut,{name:ki.name,onMake:e=>(async(e,n)=>{const t=pi.find(n=>String(n.props.id)===e),o=Wt.shared;if(!t||!o)return;let r;try{r=await C(vi).create(n,t)}catch{return void Yr(qt.shared.makeFailed,"error")}o.adopt(t,r),bi(null)})(ki.id,e),onCancel:()=>bi(null)}):null]})}))}export{xt as ScreenChrome};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useSectionOps as o}from"./chunk-IROEWITG.js";import{SELECTION_MODE as e}from"./chunk-SJMS247S.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-WJSEWAWK.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:I}){const{getSelectorForId:a}=n(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),I?.(n)):i(o=>"part"===o.kind?e:o)},[i,I]);c(()=>{k(l)},[k,l]);const S=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(S)},[S,f]);return{selectNode:d(o=>{i(()=>e);const r=a(o);r&&u.select(r)},[i,a,u]),openPartId:S}}export{m as usePartBridge};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{noControlField as e}from"./chunk-
|
|
1
|
+
import{noControlField as e}from"./chunk-INRERJU4.js";import{DEFAULT_SCREEN_WORDS as n}from"./chunk-EB6NI2VK.js";import{useWords as r}from"./chunk-MFIRYGHW.js";import{usePreviewDevice as t}from"./chunk-BSPCSC45.js";import{jsx as o}from"react/jsx-runtime";function i(e){return"mobile"===e?"mobile":"desktop"}var c={desktop:null,tablet:n.deviceNote.tablet,mobile:n.deviceNote.mobile},u="data-sf-device-hidden";function d(){/* @__PURE__ */
|
|
2
2
|
return o("span",{hidden:!0,[u]:""})}function s({tier:e,render:n,...r}){return i(t())===e?/* @__PURE__ */o(n,{...r}):/* @__PURE__ */o(d,{})}var m="__device";function f(e){const n=e?.[m];return n??null}function l(e){return f(e)?.inner??e}function a(e,n){const r=n.render;return{...n,[m]:{tier:e,inner:n},render:n=>/* @__PURE__ */o(s,{tier:e,render:r,...n})}}function p(){const e=r("screen",n).deviceNote,i=t(),c="desktop"===i?null:e[i];return c?/* @__PURE__ */o("div",{className:"sf-device-scope",children:c}):/* @__PURE__ */o(d,{})}function v(){return e({type:"custom",render:()=>/* @__PURE__ */o(p,{})},"always")}export{m as DEVICE_FIELD_MARKER,u as DEVICE_HIDDEN_ATTR,c as DEVICE_NOTE,a as deviceField,f as deviceMetaOf,v as deviceNote,i as shownTier,l as withoutDeviceGate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WebsiteBackendError as e}from"./chunk-KCOBHPN6.js";import{backendOf as r}from"./chunk-
|
|
1
|
+
import{WebsiteBackendError as e}from"./chunk-KCOBHPN6.js";import{backendOf as r}from"./chunk-SNF5764Q.js";var s=()=>Promise.reject(new e("unavailable","This editor's backend keeps no shared sections.")),o={list:()=>Promise.resolve([]),create:s,remove:s};function t(e){return Boolean(r(e).sharedSections)}var n=e=>r(e).sharedSections??o;function a(e){return e.cache("easel:shared-sections",()=>({list:()=>n(e).list(),create:(r,s)=>n(e).create(r,s),remove:r=>n(e).remove(r)}))}export{t as keepsSharedSections,a as sharedSectionsOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WebsiteBackendError as e}from"./chunk-KCOBHPN6.js";import{backendOf as s}from"./chunk-
|
|
1
|
+
import{WebsiteBackendError as e}from"./chunk-KCOBHPN6.js";import{backendOf as s}from"./chunk-SNF5764Q.js";var r=()=>Promise.reject(new e("unavailable","This editor's backend keeps no section templates.")),t={list:()=>Promise.resolve([]),get:()=>Promise.resolve(null),ensure:r,save:r,update:r,rename:r,remove:r},a=e=>s(e).sectionTemplates??t,n=e=>({list:()=>a(e).list(),get:s=>a(e).get(s),ensure:(s,r,t)=>a(e).ensure(s,r,t),save:(s,r)=>a(e).save(s,r),update:(s,r)=>a(e).update(s,r),rename:(s,r)=>a(e).rename(s,r),remove:s=>a(e).remove(s)}),o=n();function m(e){return e.cache("easel:section-templates",()=>n(e))}export{o as sectionTemplates,m as sectionTemplatesOf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScreenPartsProvider as t}from"./chunk-
|
|
1
|
+
import{ScreenPartsProvider as t}from"./chunk-SJMS247S.js";import{useEaselHost as e}from"./chunk-MQA7OFRA.js";import{createEasel as r,EaselProvider as o}from"./chunk-WJSEWAWK.js";import{useState as n,useEffect as s}from"react";import{jsx as a}from"react/jsx-runtime";function i({config:i,data:c,onChange:m,permissions:p,parts:f,children:u}){const[d]=n(()=>r({config:i,data:c,permissions:p}));s(()=>{d.setConfig(i)},[d,i]),s(()=>{if(!m)return;let t=d.getState().appState.data,e=!1;return d.subscribe(()=>{const r=d.getState().appState.data;r!==t&&(t=r,(e||r!==d.loaded)&&(e=!0,m(r)))})},[d,m]),s(()=>{p&&d.setPermissions(p)},[d,p]);const h=e();/* @__PURE__ */
|
|
2
2
|
return a(o,{easel:d,hotkeys:h.ownsDocument,children:/* @__PURE__ */a(t,{parts:f,children:u})})}export{i as ScreenStoreProvider};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{usePickFollowsSelection as n}from"./chunk-FHCKFOCD.js";import{slotFieldsOf as e}from"./chunk-TCAAOYQY.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-WJSEWAWK.js";import{Inspector as i}from"./chunk-YHFKWV7H.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"selection"};function f(n){return"selection"===n.kind}function a(n,e){if(f(n)&&f(e))return!0;const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function d(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function p(n,t,r){const i=n.slotsOf?.(r);return i||e(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function m(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function k(n,e){return n.isLast?n.isLast(e):e.type===n.last}var h={},v=()=>h,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},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}},C={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},S={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function L(){/* @__PURE__ */
|
|
2
|
+
return s(t,{height:"fill"})}function D(){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 F=o({});function A({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
+
return s(F.Provider,{value:n,children:e})}function N(){return u(F)}function P(){return(N().useOwnerName??g)()}function x(){return(N().useDocumentLabel??y)()}function B(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function G(n){return(N().useStandaloneBridges??v)(n)}function H(n,e){(N().useDocumentPass??b)(n,e)}function I(){return N().blockRules??O}function K(){return N().blockLook??j}function T(){return N().devices??w}function W(){return N().leftView??C}function Y(){return N().pinned??S}function R(){return N().saveSwitch??!0}function V(e){n(!0===N().pickFollowsSelection,e)}function E(){return N().storageNamespace||void 0}function J(){return N().styleClipboard??null}function Q(){return N().nodeKeys??!0}function Z(){return N().notify??null}function q(){return N().Canvas??L}function z(){return N().CanvasHead??null}function M(){return N().canvasDrag??null}var U=o(null);function X({target:n,children:e}){/* @__PURE__ */
|
|
5
|
+
return s(U.Provider,{value:n,children:e})}function $(){return u(U)}function _(){return N().Inspector??D}export{c as SELECTION_MODE,X as ScreenCanvasTargetProvider,A as ScreenPartsProvider,m as isPinnedFirst,k as isPinnedLast,f as isSelectionMode,d as isSlotMode,a as sameInspectorMode,p as screenSlotsOf,K as useScreenBlockLook,I as useScreenBlockRules,B as useScreenBridges,M as useScreenCanvasDrag,q as useScreenCanvasFrame,z as useScreenCanvasHead,$ as useScreenCanvasTarget,T as useScreenDevices,x as useScreenDocumentLabel,H as useScreenDocumentPass,_ as useScreenInspectorPanel,W as useScreenLeftView,Q as useScreenNodeKeys,Z as useScreenNotify,P as useScreenOwnerName,N as useScreenParts,V as useScreenPickFollowsSelection,Y as useScreenPinned,R as useScreenSaveSwitch,E as useScreenStorageNamespace,J as useScreenStyleClipboard,G as useStandaloneScreenBridges};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=/* @__PURE__ */Symbol.for("efficient-web.efficient-backend");function n(n){return!!n&&!0===n[e]}function t(e){return e?.trim()||null}var r=null,i=/* @__PURE__ */new WeakMap,o=/* @__PURE__ */new WeakMap;function l(e){r=e}function u(e=k()){if(e.hostBackend)return e.hostBackend;let n=i.get(e);if(!n){const t=o.get(e)??r;if(!t)throw new Error("efficient-web-builder: this editor was given no backend, and its host named no default one. Pass `backend`, or load the host's default backend first (the storefront's is lib/efficient-backend).");n=t(e),i.set(e,n)}return n}function s(e){if(!e.registry)throw new Error("efficient-web-builder: this editor was mounted with no block registry. Pass `registry` to createEditorSession (the storefront's is lib/document/config).");return e.registry}function d(e={}){const t=e.backend??null,r=null===t?e.defaultBackend??null:null,i=/* @__PURE__ */new Map,l={documentId:null,bridgedId:null},s={hostBackend:t,usesBridgedToken:null===t||n(t),blocks:e.blocks??null,registry:e.registry??null,chrome:e.chrome??null,documentHooks:e.documentHooks??null,claimsPage:e.claimsPage??!0,hostFailures:e.hostFailures??null,auth:{token:null,brandId:null},site:l,siteId:()=>l.documentId??l.bridgedId,cache:(e,n)=>(i.has(e)||i.set(e,n()),i.get(e)),forget(e){void 0===e?i.clear():i.delete(e)}};return r&&(o.set(s,r),Object.defineProperty(s,"usesBridgedToken",{get:()=>n(u(s)),enumerable:!0})),s}function c(e,n){e.site.documentId=t(n)}function a(e,n){e.site.bridgedId=t(n)}var f=d(),b=null,g=/* @__PURE__ */new Set;function k(){return b??f}function h(e){e.claimsPage&&(g.delete(e),b=e)}function m(e){e.claimsPage&&(g.add(e),queueMicrotask(()=>{g.delete(e)&&b===e&&(b=null)}))}function w(){return k().usesBridgedToken}function y(){f=d()}export{e as EFFICIENT_BACKEND,h as activateEaselSession,u as backendOf,d as createEaselSession,k as currentEaselSession,m as deactivateEaselSession,w as efficientClientOpen,n as isEfficientBackend,l as provideDefaultBackend,y as resetAmbientEaselSession,s as sessionRegistry,a as setSessionBridgedSite,c as setSessionDocumentSite};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{textFieldIdentifier as n}from"./chunk-ANPOR6EY.js";import{hidableText as r}from"./chunk-6UAEFOJ4.js";function t(n,t){const o=r(n.props.name);if(o)return o;const e=r(n.props.altName);if(e)return e;const c=n.props.collection?.name;if(c)return c;const u=n.props.source?.title;if(u)return u;const s=n.props.code;return s?t?.(s)??s:""}function o(n,r,o,e,c){const u=o(t(n,e))||r(n.type);return c?c(n,"block",u):u}function e(r){if(!r)return null;for(const t of["name","altName"])if(n(r[t]))return t;return null}function c(r){const t=r?.name;return void 0===t||n(t)?"name":null}function u(n,t,o){const e=r(n.props?.name).trim()||t;return o?o(n,"section",e):e}export{u as rootRowName,c as sectionRenameProp,t as slotChildName,e as slotChildRenameProp,o as slotChildRowName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{panelFieldsOf as t}from"./chunk-
|
|
1
|
+
import{panelFieldsOf as t}from"./chunk-5XL2RXFU.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-KWLHKKZO.js";import{DESIGN_GROUP_KEY as e,BUCKET_KEY as r}from"./chunk-3QB2ZQXK.js";import{STYLE_KIND as s,fieldKind as c,copyStyle as i,heldStyle as p,planPaste as u,pasteMessage as a}from"./chunk-V7U33NF2.js";import{ANCHOR_FIELD_KEYS as f,foldMetaOf as l,MEDIA_FIELD_MARKER as m,TEXT_FIELD_MARKER as h,LINK_FIELD_MARKER as y}from"./chunk-ANPOR6EY.js";var j=/* @__PURE__ */new Set([e.Size,e.Design,e.Layout,e.Position]),w=new Set(Object.values(e)),b=new Set(Object.values(r)),S=new Set(f),g=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[m,h,y];function v(t){return`site:${t??""}`}function O(t){if(!t||"object"!=typeof t)return null;const n=t,e=o(t)??t,r=n[s]??e[s];if("string"==typeof r)return r;const i=n.options??e.options;if(Array.isArray(i)){return`choice:${i.map(t=>String(t?.value)).sort().join("|")}`}return c(e)}function K(t){const n=t,e=o(t);return k.some(t=>t in n||e&&t in e)}function L(o,e){const s=t(o,e)??{},c=[];let i=!0,p=!1;for(const[t,o]of Object.entries(s))b.has(t)?(i=t===r.Design,p=!1):w.has(t)?i&&(p=j.has(t)):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(l(o)||S.has(t)||g.has(t)||K(o)||"slot"!==o.type&&c.push({path:[t],kind:O(o),counted:"mobile"!==n(o)?.tier}));return c}function d(t,o,n,e,r){i({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function A(t,o,n,e,r,s){const c=p(n);if(!c)return null;const i=u(c,{type:e.type,rows:t(o,e),props:e.props});return{...i,message:a(i,c.sourceLabel,r,s)}}function F(t,o,n,e){d(L,t,o,n,e)}function X(t,o,n,e,r){return A(L,t,o,n,e,r)}var D={scope:t=>v(t.siteId),rows:(t,o)=>L(t,o),copy:(t,o,n,e)=>F(e,t,o,n),plan:(t,o,n,e)=>X(e,t,o,n)};function N(t,o){if(!t&&!o)return D;const n=t?.rows,e=n?(t,o)=>n(t,o):L;return{scope:t?.scope??D.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>d(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>A(e,s,t,n,r,o))}}export{F as copyNodeStyle,L as nodeStyleRows,X as planNodePaste,O as shopFieldKind,v as siteStyleScope,N as styleClipboardOf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{runAsPreviewClick as e}from"./chunk-
|
|
1
|
+
import{runAsPreviewClick as e}from"./chunk-MGVI67QV.js";import{useRef as r,useCallback as t,createContext as n,useState as c,useContext as l}from"react";import{jsx as o}from"react/jsx-runtime";function s(){const n=r(()=>{});return{select:t((...r)=>e(()=>n.current(...r)),[]),setSelectHandler:t(e=>{n.current=e},[])}}function u(e){const r=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`,t=(t,n,c,l)=>({[e]:t,[r]:n,select:c,setSelectHandler:l}),u=n(t(null,()=>{},()=>{},()=>{}));return{Provider:function({children:e}){const[r,n]=c(null),{select:l,setSelectHandler:i}=s();/* @__PURE__ */
|
|
2
2
|
return o(u.Provider,{value:t(r,n,l,i),children:e})},useSelection:()=>l(u)}}export{u as createPreviewSelectionContext,s as useSelectHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEaselHost as n}from"./chunk-MQA7OFRA.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-
|
|
1
|
+
import{useEaselHost as n}from"./chunk-MQA7OFRA.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-WJSEWAWK.js";import{useState as r,useEffect as o,useRef as u}from"react";function c(e){const t=n(),[u,c]=r(null);return o(()=>c(e.current),[e]),t.ownsDocument?"undefined"==typeof document?null:document:u}function i(r,u){const i=n(),s=e(),f=c(r);o(()=>{if(!i.ownsDocument&&f)return t(f,s,{leaveTyping:!0})},[i,s,f]);const m=u?.document??null;o(()=>{if(!i.ownsDocument&&m)return t(m,s,{leaveTyping:!0})},[i,s,m])}function s(n){return n.ownsDocument?{}:{tabIndex:-1}}function f(n){return!n.altKey&&!n.shiftKey&&(!(!n.metaKey&&!n.ctrlKey)&&("s"===n.key||"S"===n.key||"KeyS"===n.code))}function m(n,e,t){const r=c(n),i=u(t);o(()=>{i.current=t}),o(()=>{if(!r)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[r]);const s=e?.document??null;o(()=>{if(!s)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return s.addEventListener("keydown",n),()=>s.removeEventListener("keydown",n)},[s])}export{s as editorRootFocus,f as isSaveShortcut,c as useEaselKeyTarget,m as useEaselSaveKey,i as useEaselUndoKeys};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-VKPOH6MK.js";import{blockTypesIn as o}from"./chunk-CPL43ZLJ.js";import{sectionTemplatesOf as l}from"./chunk-N7E6264U.js";import{sharedSectionsOf as r}from"./chunk-N3MJOHAG.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-SINAM2IT.js";import{blockRuns as c}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as a,useScreenBlockRules as d,useScreenPinned as p}from"./chunk-SJMS247S.js";import{useEaselSession as m}from"./chunk-YM4UEGBV.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-EB6NI2VK.js";import{useEasel as u}from"./chunk-WJSEWAWK.js";import{easelMenuEntries as y}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-CUZQ2HMA.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-TQ5Y6S2X.js";import{useState as b,useEffect as v,useMemo as j,useRef as C}from"react";import{SharedIcon as w,AddIcon as I}from"efficient-shell/icons/efficient";import{ContextMenu as M,toast as S,Dialog as E,Button as O}from"efficient-shell/ui";import{jsx as $,jsxs as x,Fragment as A}from"react/jsx-runtime";function T({name:e,pages:t,onDelete:n,onCancel:o}){const l=h("screen",f).shared,[r,i]=b(!1),s=C(null);/* @__PURE__ */
|
|
2
|
+
return $(E,{open:!0,role:"alertdialog",size:"sm",title:l.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */x(A,{children:[
|
|
3
|
+
/* @__PURE__ */$(O,{ref:s,variant:"secondary",onClick:o,children:l.cancel}),
|
|
4
|
+
/* @__PURE__ */$(O,{variant:"danger",loading:r,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:l.deleteShared})]}),children:l.deleteMessage({count:t})})}var W=e=>`section:${e}`,F=e=>`block:${e}`,H=e=>`template:${e}`,L=e=>`shared:${e}`;function N({at:C,placeBlocks:E,canTake:O,onPick:N,itemFor:B,session:Q,siteWide:U,onClose:z,onHide:J,readOnly:K}){const P=u(e=>e.config),V=a(),{labelAtLevel:D,categoryLabel:G,firstSection:R,Icon:Y,Thumbnail:Z}=V,{blockIsOffered:_,canAddTo:X}=d(),q=h("screen",f).add,ee=h("drag",g).add,te=m(),[ne,oe]=b([]);v(()=>{let e=!1;const t=e=>_(e,te);return l(te).list().then(n=>{if(e)return;const l=P.components;oe(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[P,te]);const le=p().shared,re=h("screen",f).shared,[ie,se]=b([]),[ce,ae]=b(0);v(()=>{if(!le)return;let e=!1;const t=e=>_(e,te);return r(te).list().then(n=>{if(e)return;const l=P.components;se(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[P,te,ce]);const[de,pe]=b(null),[me,fe]=b(null),ue=j(()=>e(P,V),[P]),ye=e=>D(e,"section",P.components[e]?.label??e),he=e=>({type:W(e.type),label:e.name,cover:/* @__PURE__ */$(Z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:q.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),ke=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=ne.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=ie.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}return null},ge=e=>/* @__PURE__ */$("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */$(Y,{type:e,size:26})}),be=j(()=>{const e=t(ue,R),o=/* @__PURE__ */new Map,l=e=>{e.retired||o.has(e.type)||!_(e.type,te)||o.set(e.type,e)};for(const t of e?[e]:ue){const e=X(t.type)?.choices??[];e.forEach(l),e.forEach(e=>X(e.type,1)?.choices?.forEach(l))}E?.forEach(l);const r=new Set(ue.map(e=>e.type)),i=[...o.values()].filter(e=>!r.has(e.type)),s=e=>({type:F(e.type),label:e.label,cover:ge(e.type),title:q.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>o.has(e.type)?{...he(e),cover:ge(e.type)}:he(e),d=[];ie.length>0&&d.push({key:"shared",title:re.group,tiles:ie.map(e=>({type:L(e.id),label:e.title,cover:/* @__PURE__ */$(Z,{type:e.node.type}),mark:/* @__PURE__ */$(w,{size:12}),title:re.onPages({count:e.used_on.length}),keywords:[ye(e.node.type),e.node.type]}))}),ne.length>0&&d.push({key:"templates",title:q.templates,tiles:ne.map(e=>({type:H(e.id),label:e.name,cover:/* @__PURE__ */$(Z,{type:e.node.type}),keywords:[ye(e.node.type),e.node.type]}))});const p=i.filter(e=>!e.group);let m=!1;for(const t of Object.keys(P.categories??{})){const o=ue.filter(e=>e.cat===t);if(0===o.length)continue;const l=e&&o.some(t=>t.type===e.type)?e:null,r=(l?[l,...o.filter(e=>e.type!==l.type)]:o).map(a);l&&!m&&(r.splice(1,0,...p.map(s)),m=!0),d.push({key:`category:${t}`,title:n(P,t,G),tiles:r})}const f=d.find(e=>e.key?.startsWith("category:"));if(!m&&f&&p.length>0&&(f.tiles=[...f.tiles,...p.map(s)],m=!0),c(i.filter(e=>e.group||!m)).forEach((e,t)=>{d.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(s)})}),!O)return d;const u=d.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ke(e.type),n=t?O(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),y=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(y),...u.filter(e=>!y(e))]},[ne,ie,re,ue,P,q,O,E,te]);/* @__PURE__ */
|
|
5
|
+
return x(A,{children:[
|
|
6
|
+
/* @__PURE__ */$(i,{icon:/* @__PURE__ */$(I,{size:15}),title:q.title,context:q.contextAll,actions:/* @__PURE__ */$(s,{label:q.done,description:q.doneDescription,onClick:z}),onHide:J}),
|
|
7
|
+
/* @__PURE__ */x("div",{className:"sf-addside sf-scroll",children:[
|
|
8
|
+
/* @__PURE__ */$(k,{groups:be,session:Q,itemFor:e=>B(ke(e)??{kind:"section",type:e}),onInsert:N?e=>{const t=ke(e);t&&N(t)}:void 0,onTileMenu:(e,t)=>{const n=ke(e);return"shared"===n?.kind&&!K&&(pe({section:n.section,...t}),!0)},at:C,hint:q.hint,searchLabel:q.search,readOnly:K,words:ee}),U??null]}),de?/* @__PURE__ */$(M,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>pe(null),"aria-label":de.section.title,items:y([{label:re.deleteShared,danger:!0,onClick:()=>{fe(de.section),pe(null)}}])}):null,me?/* @__PURE__ */$(T,{name:me.title,pages:me.used_on.length,onDelete:()=>(async e=>{try{await r(te).remove(e.id)}catch{return void S.error(re.deleteFailed)}fe(null),le?.removed?.(e),se(t=>t.filter(t=>t.id!==e.id)),ae(e=>e+1)})(me),onCancel:()=>fe(null)}):null]})}export{N as AddSidePanel,F as blockKey,W as sectionKey,L as sharedKey,H as templateKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,n,t){return!(!e||!n)&&(e.index===n.index&&(e.zone??t)===(n.zone??t))}function n(e=("undefined"==typeof document?void 0:document)){const n=e?.querySelector(".es-tree"),t=n?.querySelector(".es-tree-row.is-selected");return!!t&&(function(e,n){if("function"!=typeof e.getBoundingClientRect)return!1;if("function"!=typeof n.getBoundingClientRect)return!1;const t=e.getBoundingClientRect(),o=n.getBoundingClientRect();return!(!t.height||!o.height)&&o.top>=t.top&&o.bottom<=t.bottom}(n,t)||t.scrollIntoView({block:"center",inline:"nearest"}),!0)}function t(e,n){return"part"===e.kind?e.nodeId??null:"
|
|
1
|
+
function e(e,n,t){return!(!e||!n)&&(e.index===n.index&&(e.zone??t)===(n.zone??t))}function n(e=("undefined"==typeof document?void 0:document)){const n=e?.querySelector(".es-tree"),t=n?.querySelector(".es-tree-row.is-selected");return!!t&&(function(e,n){if("function"!=typeof e.getBoundingClientRect)return!1;if("function"!=typeof n.getBoundingClientRect)return!1;const t=e.getBoundingClientRect(),o=n.getBoundingClientRect();return!(!t.height||!o.height)&&o.top>=t.top&&o.bottom<=t.bottom}(n,t)||t.scrollIntoView({block:"center",inline:"nearest"}),!0)}function t(e,n){return"part"===e.kind?e.nodeId??null:"selection"!==e.kind||null==n?null:String(n)}export{t as markedTreeNodeId,n as revealSelectedTreeRow,e as sameSelector};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{DEFAULT_CANVAS_WORDS as e}from"./chunk-TBY3DFKS.js";import{useResolvedFields as t}from"./chunk-IWCKVZHS.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r,parentStep as i,clickPickPart as l,clickPick as s}from"./chunk-BSHIQIZC.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-MZ5GSSZ3.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,isTypingTarget as w,frameRectToHost as b,CANVAS_TYPING_EVENT as k,drawnBox as S}from"./chunk-GHBK7BKL.js";import{queryAllCopies as C}from"./chunk-LF3FUSCQ.js";import{find as I,ROOT_ID as D,getList as E,remove as x,parseZoneKey as O,move as A,duplicate as M,replaceNode as z,createNode as R,insert as B,normalizeData as L,createResolveCache as V,resolveNodeData as $,ROOT_SLOT as j}from"./chunk-K7BTCBWD.js";import{topLevelSlotKeys as K,fieldsFrom as N,drawnBlockCount as P,defaultsFrom as Z}from"./chunk-L55YIXDC.js";import{createContext as F,useEffect as H,useContext as T,useRef as W,useSyncExternalStore as Y,useState as q,useMemo as U,useCallback as G,useLayoutEffect as Q}from"react";import{jsx as X,jsxs as J,Fragment as _}from"react/jsx-runtime";import{createPortal as ee}from"react-dom";import{registerModalEscapeInterceptor as te,FloatingBar as ne,TextToolbar as oe,LinkPicker as re}from"efficient-shell/ui";function ie(e){return!["setData","setUi","set"].includes(e.type)}var le=(e,t,n,o)=>{const r=E(e,t,O(n));return r?.[o]??null},se=(e,t,n,o,r)=>{const i=le(e,t,n,o);if(!i)throw new Error(`${r}: nothing at ${n}[${o}]`);return i};function ae(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 ce(e,t,n){return n?"node"===n.kind?I(e,t,n.id)?n:null:n.parentId===D?E(e,t,n)?n:null:I(e,t,n.parentId)&&E(e,t,n)?n:null:null}function de(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 ue(e,t,n){const o=pe(e,t,n);if(o===e)return e;const r=ce(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function pe(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 de(e,n,"function"==typeof t.ui?t.ui(ae(e,n)):t.ui);case"set":{const r={data:o,ui:ae(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=de(l,n,i.ui,!0)),l}case"insert":{const r={...O(t.destinationZone),index:t.destinationIndex},i=R(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:B(o,n,r,i)}}case"replace":{const r=se(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:z(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=se(o,n,t.sourceZone,t.sourceIndex,"duplicate"),i=M(o,n,r.props.id),l=le(i,n,t.sourceZone,t.sourceIndex+1);return{...e,data:i,selection:l?{kind:"node",id:l.props.id}:e.selection}}case"reorder":return pe(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=le(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const i={...O(t.destinationZone),index:t.destinationIndex};return{...e,data:A(o,n,r.props.id,i)}}case"remove":{const r=se(o,n,t.zone,t.index,"remove");return{...e,data:x(o,n,r.props.id)}}default:return e}}var fe={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},he={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},me=0,ge=()=>`history-${me+=1}`;function ve(e){let t=e.config;const r=e.now??(()=>Date.now()),i=e.historyCoalesceMs??250;let l=e.permissions??{};const s=L(e.data,t);let a=s,c={data:s,selection:null,ui:{...he}};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:{...he,...i}}}let d=[{core:c,at:-1/0,sealed:!0,id:ge()}],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:ge()}],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=ue(c,e,t),c===n)return;const o=e.recordHistory??ie(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()},D=e=>{const n=c,o=ce(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))},x=t=>{const n=c;u=t,c=d[u].core,c.data!==n.data&&e.onChange?.(c.data),c!==n&&w()},O=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...fe,...l,...n}};let A=O();const M=V(),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([$(r,t,{cache:M,trigger:e,metadata:n}),...i.map(o=>$(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=I(r,t,l)?.node;s&&s===I(o,t,l)?.node&&(r=z(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:ce(r,t,c.selection)},k(n,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=I(c.data,t,e)?.node;if(!r)return!1;const i=await $(r,t,{cache:M,trigger:n,metadata:o});if(!i.didChange)return!1;let l=!1;return C(()=>{const n=c;if(I(c.data,t,e)?.node!==r)return;const o=z(c.data,t,e,i.node);o!==c.data&&(c={...c,data:o,selection:ce(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:ae(e,t)},r="node"===e.selection?.kind?I(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:ae(e.core,t)}})),index:u,setHistoryIndex:e=>{e>=0&&e<d.length&&e!==u&&x(e)}},getPermissions:A,getItemById:n=>I(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return E(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=>D(e?{kind:"node",id:e}:null),selectSlot:e=>D(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:ce(e.data,t,o)},k(n,e.data!==n.data)})},load(e,n={}){const o=c,r=L(e,t);c={...c,data:r,selection:ce(r,t,n.selection??c.selection)},a=r,n.keepHistory||(d=[{core:c,at:-1/0,sealed:!0,id:ge()}],u=0),c!==o&&w()},undo(){u>0&&x(u-1)},redo(){u<d.length-1&&x(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,A=O(),h=null,w())},setConfig(e){e!==t&&(t=e,A=O(),h=null,w())}};return R}function ye(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&&w(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 we=F(null),be=F(!0);function ke({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return H(()=>{n&&e.resolveAll()},[e,n]),H(()=>{if(t&&"undefined"!=typeof document)return ye(document,e)},[e,t]),/* @__PURE__ */X(we.Provider,{value:e,children:/* @__PURE__ */X(be.Provider,{value:t,children:o})})}function Se(){const e=T(we);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function Ce(e){const t=Se(),n=W({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 Y(t.subscribe,o,o)}function Ie(){return function(e){return Ce(e)}}var De="data-easel-block",Ee="data-easel-dropzone",xe={},Oe="data-es-mirror",Ae="undefined"==typeof window?H:Q;function Me(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${Oe}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(Oe,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function ze({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=W(null),[p,f]=q(null);return Ae(()=>{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]),Ae(()=>{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){Me(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>Me(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}return()=>{n?.disconnect(),t.remove(),f(null),s?.(null)}},[]),/* @__PURE__ */X("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?ee(t,p):null})}var Re=F(null),Be=F(xe),Le=[];function Ve({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:i=120}){const l=Se(),s=Ce(n=>E(n.appState.data,l.config,{parentId:e,slot:t})??Le),a=Ce(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==D),c=Ce(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),d=T(Re),u=["es-zone"];return s.length&&u.push("has-children"),e===D&&u.push("is-root"),(a||c)&&u.push("is-area-selected"),null!==d&&d===e&&e!==D&&u.push("is-hovering-area"),n&&u.push(n),/* @__PURE__ */X("div",{className:u.join(" "),[Ee]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${i}px`},children:s.map(e=>/* @__PURE__ */X(He,{node:e},e.props.id))})}function $e(e,t,n,o){const r=U(()=>{const n={};for(const o of K(N(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
|
|
2
|
+
return X(Ve,{parentId:t,slot:o,...e})},{blockCount:0});return n},[e,t]);for(const e of Object.keys(r))r[e].blockCount=P(n[e],o);return r}function je(e){return U(()=>function({zone:t,...n}){/* @__PURE__ */
|
|
3
|
+
return X(Ve,{parentId:e,slot:t,...n})},[e])}var Ke=["top","bottom","zIndex"];function Ne(e,t,n){e.style[t]!==n&&(e.style[t]=n)}function Pe(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));Ne(e,"position",t?"sticky":"relative");for(const n of Ke)Ne(e,n,t?.[n]??"");return!!t}var Ze="data-es-canvas-relative";function Fe(e){e.hasAttribute(Ze)&&("relative"===e.style.position&&(e.style.position=""),e.removeAttribute(Ze));const t=e.ownerDocument.defaultView?.getComputedStyle(e).position;return t&&"static"!==t?"sticky"===t:(e.style.position||(e.style.position="relative",e.setAttribute(Ze,"")),!1)}function He({node:e}){const t=Se().config,n=t.components[e.type],o=e.props.id,r=W(null),i=function(e,t){return U(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(De),o.removeAttribute("data-easel-dnd")),t.current=n,n&&(n.setAttribute(De,e),n.setAttribute("data-easel-dnd",e),Fe(n))},[e,t])}(o,r),l=W(null),s=!!n?.inline;!function(e,t){const n=W(!1),o=W(()=>{});o.current=()=>{const o=e(),i=n.current;n.current=!!o&&t(o),i!==n.current&&r.current()};const r=W(()=>{});Ae(()=>o.current()),Ae(()=>{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?Fe(e):Pe(e));const a=T(Be),c=$e(n,o,e.props,t.components),d=je(o);if(!n?.render)return null;const u=n.render,p={...Z(n),...e.props,...c},f={renderDropZone:d,isEditing:!0,dragRef:n.inline?i:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */X(u,{...p,editor:f,editMode:!0}):
|
|
4
|
+
/* @__PURE__ */X("div",{ref:l,[De]:o,"data-easel-dnd":o,style:{position:"relative"},children:/* @__PURE__ */X(u,{...p,editor:f,editMode:!0})})}function Te({metadata:e}){const t=Ce(e=>e.config),n=Ce(e=>e.appState.data.root).props??{},o=t.root?.render,r=$e(t.root,D,n,t.components),i=je(D),l=/* @__PURE__ */X(Ve,{parentId:D,slot:j}),s=o?/* @__PURE__ */X(o,{id:"page-root",...n,...r,editor:{renderDropZone:i,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:l}):l;/* @__PURE__ */
|
|
5
|
+
return X(Be.Provider,{value:e??xe,children:s})}var We=F(void 0),Ye=F(void 0),qe=F(void 0);function Ue({element:e}){const t=W(null),n=Ge(t,e?()=>e:null,e);/* @__PURE__ */
|
|
6
|
+
return X("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"}})}function Ge(e,t,n){return Xe(e,t?e=>{const n=t(e);return n?[n]:[]}:null,n)[0]??null}var Qe=[];function Xe(e,t,n){const[o,r]=q(Qe),i=W(t);return i.current=t,Ae(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!i.current)return void r(Qe);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=S(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:Qe;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 Je({id:e,kind:t,overlay:n}){const o=W(null),r=T(Ye),i=null!==e&&!0===r?.(e),l=Xe(o,e?t=>C(t,`[${De}="${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__ */J(_,{children:[
|
|
7
|
+
/* @__PURE__ */X("div",{ref:o,"aria-hidden":"true",className:c,style:s?d(s):{display:"none"}}),a.map((e,t)=>/* @__PURE__ */X("div",{"aria-hidden":"true",className:c,style:d(e)},t))]});return n&&e?/* @__PURE__ */X(n,{componentId:e,kind:t,children:u}):u}function _e(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 et({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=W(null),[v,y]=q(!1),[w,k]=q(null),S=v||null!==w,C=()=>{e.hold(),y(!1),k({href:e.pressed().href})},I=()=>{y(!1),k(null),e.resume()};Q(()=>{r.current={escape:()=>!!S&&(I(),!0),link:()=>!!s.has("link")&&(C(),!0)}}),Q(()=>()=>{r.current=null},[r]);const D=W(I);D.current=I,H(()=>{if(v)return te(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]),H(()=>{const n=h.current;if(!S||!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),k(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)}},[S,e,t]),Q(()=>{const e=h.current,n=e?.querySelector(".rosh-tb-wrap > .es-copy-pop"),o=t();if(!(S&&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?b(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?b(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 k=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=`${k.top}px`,n.style.left=`${k.left}px`,n.style.setProperty("--es-pop-point",`${k.point}px`),n.dataset.side=k.above?"above":"below"});const E=f?{run:u(l.color,f),open:v,onToggle:()=>{k(null),v?I():(e.hold(),y(!0))}}:void 0;/* @__PURE__ */
|
|
8
|
+
return X(ne,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?b(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__ */X("div",{ref:h,children:/* @__PURE__ */X(oe,{layout:"row",offered:s,pressed:l.marks,onMark:t=>{"link"===t?C():e.press(t)},color:E,linkOpen:null!==w,list:{pressed:l.list,onList:t=>e.list(t)},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__ */J(_,{children:[v&&f?/* @__PURE__ */X(p,{colors:f,current:l.color,words:i.colors??m.colors,onPick:t=>e.color(t)}):null,w?
|
|
9
|
+
/* @__PURE__ */X(re,{className:"es-copy-link es-copy-pop",value:w.href??"",onApply:t=>{k(null),e.link(t)},onRemove:null!==w.href?()=>{k(null),e.link(null)}:void 0,onCancel:I}):null]})})})})}function tt({element:e}){const t=W(null),n=Ge(t,()=>e(),e);/* @__PURE__ */
|
|
10
|
+
return X("div",{ref:t,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:n?{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height}:{display:"none"}})}function nt({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:w,typing:b,passThrough:S}){const C=Se(),I=T(We),D=S??I,E=T(be),x=g("canvas",e),O=h??E,[A,M]=q(void 0),z=Ce(e=>"node"===e.selection?.kind?e.selection.id:null),[R,B]=q(null),[L,V]=q(null),$=T(qe),[j,K]=q(null),N=W(null),[,P]=q(0),Z=W(b);Z.current=b;const F=W(null),Y=W(null),U=Ce(e=>e.appState.data);H(()=>{const e=Y.current?.ownerDocument,t=e?.defaultView?.CustomEvent;if(!e||!t)return;const n=z&&!j&&Z.current?.atSelection?.()?z:null;e.dispatchEvent(new t(y,{detail:{id:n}}))},[z,j,U]);const G=e=>{const t=Y.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(k,{detail:{typing:e}}))},Q=(e,t)=>{N.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:_e(n,t,e.skip),write:e.write,remount:e.remount,onSelect:()=>P(e=>e+1),onEscape:()=>F.current?.escape()??!1,onLinkKey:()=>F.current?.link()??!1,end:e=>{o.close(),N.current?.element===r&&(N.current=null),K(null),G(!1),Z.current?.onChange?.({typing:!1,why:e})}});if(!i)return o.close(),!1;const l=n.closest?.(`[${De}]`)?.getAttribute(De);return l&&C.select(l),N.current={s:i,element:r,target:e},K(()=>r),B(null),G(!0),Z.current?.onChange?.({typing:!0,element:n}),!0};H(()=>()=>N.current?.s.stop("stop"),[]);const _=e=>{const t=N.current?.element();return Boolean(t&&t.contains(e))},ee=e=>{const t=e.closest?.(`[${De}]`)?.getAttribute(De);if(!t)return;const n=C.getState(),o="node"===n.selection?.kind?n.selection.id:null,r=$?.partAt(e,t)??null;if(r){const e=l(n.appState.data,C.config,t,r.id,o,$?.selected()??null,D);if(e)return{node:e.node,part:e.part?r:null}}return{node:s(n.appState.data,C.config,t,o,D)??t,part:null}},te=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(N.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=Z.current?.atSelection?.();n&&Q(n,null)&&e.preventDefault()},ne=/* @__PURE__ */J("div",{ref:Y,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),N.current){if(_(t))return;N.current.s.stop("outside")}const n=t.ownerDocument?.getSelection?.();n&&n.rangeCount>0&&n.isCollapsed&&n.removeAllRanges();const o=ee(t);if(void 0!==o)return C.select(o.node),void($&&(o.part?.id??null)!==$.selected()&&$.select(o.part?.id??null));t.hasAttribute?.(Ee)||(C.select(null),$?.selected()&&$.select(null))},onDoubleClick:e=>{const t=Z.current;if(!t||_(e.target))return;const n=t.at(e.target);n&&Q(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>te(e),onMouseOver:e=>{if(N.current)return;const t=ee(e.target),n=t?.part&&t.part.id!==$?.selected()?t.part.element:null,o=t&&!t.part?t.node:null;o!==R&&B(o),n!==L&&V(n)},onMouseLeave:()=>{B(null),V(null)},children:[
|
|
11
|
+
/* @__PURE__ */X(Re.Provider,{value:R,children:/* @__PURE__ */X(Te,{metadata:r})}),
|
|
12
|
+
/* @__PURE__ */J("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
|
|
13
|
+
/* @__PURE__ */X(Je,{id:!j&&R&&R!==z?R:null,kind:"hover",overlay:v}),$?/* @__PURE__ */X(Ue,{element:j?null:L}):null,
|
|
14
|
+
/* @__PURE__ */X(Je,{id:j?null:z,kind:"selected",overlay:v}),j?/* @__PURE__ */X(tt,{element:j}):null]}),w]}),oe=m?/* @__PURE__ */X(m,{document:A,children:ne}):ne;H(()=>{if(A&&O)return ye(A,C)},[A,O,C]),H(()=>{if(!A)return;const e=e=>{if("Enter"===e.key)return void te(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($?.selected())return void $.select(null);const o=i(n.appState.data,C.config,n.selection);"node"===o?.kind&&C.select(o.id)};return A.addEventListener("keydown",e),()=>A.removeEventListener("keydown",e)},[A,C,$]);/* @__PURE__ */
|
|
15
|
+
return J("div",{className:"es-canvas"+(n?` ${n}`:""),style:o,"data-easel-preview":"","data-es-typing":j?"":void 0,children:[j&&N.current?.target.toolbar?/* @__PURE__ */X(et,{s:N.current.s,element:N.current.element,toolbar:N.current.target.toolbar,label:x.textTools,keys:F}):null,t?/* @__PURE__ */X(ze,{mirrorStyles:a,onDocument:e=>{M(e??void 0),c?.(e)},height:d,title:u,nonce:p,children:oe}):/* @__PURE__ */X("div",{id:"preview-frame","data-easel-entry":"",children:oe})]})}function ot(e={}){const t=Se(),n=Ce(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function rt(){const e=Se(),n=Ce(e=>e.config),o=e.resolveCache,r=Ce(e=>e.selectedItem),i=Ce(e=>e.appState.data.root),l=r?r.props.id:"root",s=i.props??{},a=U(()=>r||{type:"root",props:s},[r,s]),c=r?n.components[r.type]:n.root,d=e.getState(),u=r?I(d.appState.data,n,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=Ce(e=>!1===e.getPermissions(r?{item:r}:{root:!0}).edit),g=G(t=>{(async()=>{const r=e.getState();if("root"!==l){const i=r.getItemById(l),s=r.getSelectorForId(l);if(!i||!s)return;const a={...i,props:{...i.props,...t}},{node:c}=await $(a,n,{cache:o,trigger:"replace"}),d=e.getState().getSelectorForId(l);if(!d)return;return void e.dispatch({type:"replace",destinationZone:d.zone??"root:default-zone",destinationIndex:d.index,data:c})}const i=r.appState.data.root.props??{},{node:s}=await $({type:"root",props:{...i,...t}},n,{cache:o,trigger:"replace"});e.dispatch({type:"replaceRoot",root:{props:s.props,readOnly:s.readOnly},recordHistory:!0})})()},[e,n,o,l]),v=G((e,t)=>g({[e]:t}),[g]);return{id:l,node:a,fields:h,values:a.props,readOnly:m,onChange:v,onChangeMany:g}}export{ze as CanvasFrame,qe as CanvasPartsContext,We as CanvasPassThroughContext,Ye as CanvasSharedContext,he as DEFAULT_UI,nt as EaselCanvas,ke as EaselProvider,Te as EditDocument,ye as bindUndoKeys,ve as createEasel,Ie as createUseEasel,ie as recordsByDefault,ue as reduce,ae as uiView,Ce as useEasel,Se as useEaselApi,ot as useEaselNodeOps,rt as useSelectedFields,ce as validSelection};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-
|
|
1
|
+
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-IYYE7VJN.js";import{ScreenStoreProvider as e}from"./chunk-RY5AWQ63.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-BTDI7JAA.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-EB6NI2VK.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var k=r(e),N=r(n);function C({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const k=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
|
|
2
2
|
return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
|
|
3
3
|
/* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
|
|
4
4
|
/* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
|
|
5
5
|
/* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},children:i.save})]}),children:i.body})}function j({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
|
|
6
|
-
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function
|
|
7
|
-
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:
|
|
6
|
+
return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function A({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),A=t(()=>s(!g),[g]),Y=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:Y.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
|
|
7
|
+
/* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:A,parts:n,children:/* @__PURE__ */u(N,{})}),f&&/* @__PURE__ */u(C,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:Y.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:Y.waitingForAuthorization})}export{A as DocumentScreen,j as ScreenMount};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e,offeredChoices as s}from"./chunk-
|
|
1
|
+
import{blockRuns as e,offeredChoices as s}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as t}from"./chunk-SJMS247S.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-EB6NI2VK.js";import{useWords as r}from"./chunk-MFIRYGHW.js";import{ItemCount as n,DropdownMenu as c}from"efficient-shell/ui";import{jsxs as a,jsx as o,Fragment as i}from"react/jsx-runtime";function m({choices:m,onPick:p}){const{Icon:u}=t(),f=r("screen",l),h=e(s(m)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */a("span",{className:"flex w-full items-center gap-2",children:[
|
|
2
2
|
/* @__PURE__ */o("span",{children:e.group}),
|
|
3
3
|
/* @__PURE__ */o(n,{count:e.items.length,label:f.blockCount({count:e.items.length}),className:"ml-auto"})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(u,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
|
|
4
4
|
return o(c,{align:"start",triggerClassName:"sf-add-card",items:h,trigger:/* @__PURE__ */a(i,{children:[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{activateEaselSession as r,deactivateEaselSession as n,currentEaselSession as e}from"./chunk-
|
|
1
|
+
import{activateEaselSession as r,deactivateEaselSession as n,currentEaselSession as e}from"./chunk-SNF5764Q.js";import{createContext as o,useEffect as t,useContext as i}from"react";import{jsx as u}from"react/jsx-runtime";var c=o(null);function m({session:e,children:o}){return r(e),t(()=>(r(e),()=>n(e)),[e]),/* @__PURE__ */u(c.Provider,{value:e,children:o})}function f(){return i(c)??e()}export{m as EaselSessionProvider,f as useEaselSession};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenDocument as n}from"./chunk-
|
|
1
|
+
import{useScreenDocument as n}from"./chunk-BTDI7JAA.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-EB6NI2VK.js";import{EditNotice as r}from"./chunk-ZG6PVMC3.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
|
package/dist/copy/index.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { c as CopyBoxProps, d as CopyCell, T as TextBoxHandle } from '../canvas-
|
|
|
3
3
|
export { e as COPY_CELLS, b as CanvasTypingEnd, f as CanvasTypingOptions, g as CanvasTypingSession, h as ColorWindow, i as CopyBoxAlign, j as CopyBoxFooter, C as CopyBoxLastTool, k as CopyCase, l as CopyCellPreset, m as CopyCells, a as CopyThemeColor, M as MarkWriter, S as SelectionSource, n as TextAreaHandle, o as TextMap, p as ToolbarMark, q as colorRunOf, r as insertSelection, s as markSelection, t as startCanvasTyping, u as textMap } from '../canvas-typing-Be4FO4q7.js';
|
|
4
4
|
import { TextAlign } from 'efficient-shell/ui';
|
|
5
5
|
export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
|
|
6
|
-
import { F as FieldOption } from '../types-
|
|
6
|
+
import { F as FieldOption } from '../types-BFd8FqQw.js';
|
|
7
7
|
import { TextStyleCase } from '../text-styles/model.js';
|
|
8
8
|
import { InlineRule, MarkStyle, MarkedLine, WrapResult } from 'efficient-shell/markup';
|
|
9
9
|
export { C as CopyWords } from '../words-BpTjCfqO.js';
|
|
10
|
-
import '../buckets-
|
|
10
|
+
import '../buckets-_MGDYJlb.js';
|
|
11
11
|
import '../words-gIDCeRv3.js';
|
|
12
12
|
|
|
13
13
|
declare function CopyBox({ value, onChange, onCommit, onCancel, multiline, placeholder, ariaLabel, className, readOnly, rules, tools, writeMark, align, actions, toolbar, barLabel, renderFooter, inputRef, barShows, richText, defaultShowMarks, colors, cells, letterCase, lastTool, }: CopyBoxProps): react.JSX.Element;
|