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
package/dist/chunk-APVUYICP.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-R4QJ6DC5.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s,scrollPreviewToTop as d}from"./chunk-2E2SXDYQ.js";import{useEaselKeyTarget as a,useEaselUndoKeys as c,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-HGCGIRVA.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-Q2A7RHG2.js";import{useSectionOps as v}from"./chunk-FOHHXSOL.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-OBWDHKLI.js";import{keepsSharedSections as z,sharedSectionsOf as C}from"./chunk-43AEUUNQ.js";import{PanelHideButton as N,SidePanelHead as I,PanelShowStrip as O}from"./chunk-SINAM2IT.js";import{offeredChoices as B}from"./chunk-M2Z775ZC.js";import{useScreenSaveSwitch as P,useScreenNodeKeys as $,useScreenPinned as M,useScreenDocumentLabel as j,useScreenCanvasFrame as A,useScreenInspectorPanel as L,useScreenDevices as T,useScreenPickFollowsSelection as E,useScreenLeftView as R,SELECTION_MODE as F,sameInspectorMode as D,useScreenBridges as H,useScreenBlockRules as V,useScreenBlockLook as W,useScreenStorageNamespace as U,useScreenNotify as G,useScreenCanvasHead as J,isSlotMode as Y,useScreenStyleClipboard as K,useScreenDocumentPass as Q,useScreenCanvasDrag as X,ScreenCanvasTargetProvider as Z,isPinnedFirst as _,isPinnedLast as q,screenSlotsOf as ee}from"./chunk-NA3GMA43.js";import{MediaPopup as ne}from"./chunk-2G6MAXPY.js";import{useNodeClipboard as te,useNodeContextMenu as oe}from"./chunk-4IJVV7DA.js";import{PageEditGuardNotices as re}from"./chunk-N2RISV46.js";import{useScreenDocument as ie}from"./chunk-LXTM2OLQ.js";import{requestMediaPick as le}from"./chunk-UNVKPVZW.js";import{useMediaPanel as se,usePanelPick as de,useMediaBrowsing as ae,useOpenMediaBrowse as ce,useMediaPlace as pe}from"./chunk-FHCKFOCD.js";import{useEaselSession as ue}from"./chunk-O7Q4DDJT.js";import{useEaselHost as he,useHostEscape as fe}from"./chunk-MQA7OFRA.js";import{LayersIcon as me,MediaIcon as ge}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ye}from"./chunk-EB6NI2VK.js";import{heldStyle as ve,styleShortcut as ke}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as be}from"./chunk-6WY6ZXJG.js";import{rootRowName as Se,slotChildRowName as we,slotChildRenameProp as xe,sectionRenameProp as ze}from"./chunk-BHRC3ASL.js";import{ROOT_ZONE as Ce,blockNodeActions as Ne,TREE_MAX_DEPTH as Ie,childSlotsOf as Oe,slotFieldsOf as Be,newNodeId as Pe,slotChildrenIn as $e,nestsInTree as Me}from"./chunk-PLVEGYK6.js";import{useEasel as je,useEaselApi as Ae,CanvasPassThroughContext as Le,CanvasSharedContext as Te}from"./chunk-7L3NKHEC.js";import{TreeRow as Ee,Subtree as Re,LayersTree as Fe,TreeGroupLabel as De,TreeRowAction as He,TreeSeam as Ve}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as We}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Ue}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ge,useNodeOps as Je,clickPick as Ye}from"./chunk-BSHIQIZC.js";import{EaselTopBar as Ke,EaselIconButton as Qe,TopBarCluster as Xe,DeviceSwitch as Ze,InspectorIconButton as _e,PanelResizeHandle as qe,MAX_PANEL_W as en,MIN_PANEL_W_BY_SIDE as nn,panelWidthVars as tn}from"./chunk-ZG6PVMC3.js";import{DEFAULT_NOTICE_WORDS as on,DEFAULT_CHROME_WORDS as rn}from"./chunk-AJSDWWJW.js";import{holderOf as ln,nameOrSomeone as sn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as dn}from"./chunk-RE4LP46F.js";import{useWords as an}from"./chunk-MFIRYGHW.js";import{insertSeams as cn,CanvasDragLayer as pn,CanvasInsert as un}from"./chunk-2M4T27BI.js";import{DEFAULT_DRAG_WORDS as hn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as fn,useTreeDrag as mn,gapToMoveIndex as gn}from"./chunk-3S5N4HLJ.js";import{ROOT_ID as yn,ROOT_SLOT as vn,zoneKey as kn,parseZoneKey as bn,find as Sn,DataError as wn}from"./chunk-K7BTCBWD.js";import{useCanvasFrame as xn,LIST_SELECTOR as zn,BLOCK_SELECTOR as Cn,useCanvasTyping as Nn,useCanvasEvent as In,nodeIdAt as On,frameRectToHost as Bn,BLOCK_ATTRIBUTE as Pn,drawnBox as $n}from"./chunk-QIDRJH3S.js";import{queryMainCopy as Mn}from"./chunk-LF3FUSCQ.js";import{useRef as jn,useMemo as An,useState as Ln,useEffect as Tn,useCallback as En,useLayoutEffect as Rn,Fragment as Fn,useId as Dn}from"react";import{ColoredBadge as Hn,Button as Vn,Tabs as Wn,toast as Un,readMediaFileDrag as Gn,Tooltip as Jn,groupColors as Yn,Dialog as Kn,FormField as Qn,Input as Xn,MEDIA_FILE_DRAG_TYPE as Zn}from"efficient-shell/ui";import{UndoIcon as _n,RedoIcon as qn,RefreshIcon as et,AddIcon as nt,TrashIcon as tt,EyeOffIcon as ot,EyeIcon as rt,SharedIcon as it,DuplicateIcon as lt}from"efficient-shell/icons/efficient";import{jsx as st,jsxs as dt,Fragment as at}from"react/jsx-runtime";var ct="media-file";function pt({name:e,onMake:n,onCancel:t}){const o=an("screen",ye).shared,[r,i]=Ln(e),[l,s]=Ln(!1),d=Dn(),a=jn(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
-
return st(Kn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */dt(at,{children:[
|
|
3
|
-
/* @__PURE__ */st(Vn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
-
/* @__PURE__ */st(Vn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */st("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */st(Qn,{label:o.name,htmlFor:d,children:/* @__PURE__ */st(Xn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var ut=/* @__PURE__ */new WeakSet;function ht(e,n,t){const o=Sn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function ft({canvas:e,tabs:n,onSelect:t}){const o=jn(null),[r,i]=Ln({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Rn(()=>{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=Bn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=Mn(t,`[${Pn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?$n(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=Bn(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__ */st("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */st("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__ */st(Jn,{content:e.reach,children:/* @__PURE__ */dt(Hn,{colorClass:Yn("success","solid"),size:"sm",children:[
|
|
6
|
-
/* @__PURE__ */st("span",{className:"es-band-tab-mark",children:/* @__PURE__ */st(it,{size:12})}),e.label]})}):/* @__PURE__ */st(Hn,{colorClass:Yn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function mt({expand:e}){/* @__PURE__ */
|
|
7
|
-
return st("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */dt(at,e?{children:[
|
|
8
|
-
/* @__PURE__ */st("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
-
/* @__PURE__ */st("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
-
/* @__PURE__ */st("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
-
/* @__PURE__ */st("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
-
/* @__PURE__ */st("path",{d:"M5 12h14"})]})})}var gt=`${zn}, ${Cn}`;function yt(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 vt="__rungs";var kt="screen:band",bt={duplicate:!0,delete:!0},St=()=>null;function wt(){const zn=he(),Bn=zn.panels?.Toolbar,Pn=(zn.panels?.useRight??St)(),{target:$n,docId:Dn,capabilities:Jn,currentSlug:Yn,siteId:Kn,onPublish:Qn,saveState:Xn,saveConflict:it,retrySave:wt,toggleAutoSave:xt,flushSave:zt,access:Ct,saveUnreachable:Nt=!1,readOnly:It,readOnlyReason:Ot=null}=ie(),Bt=P(),Pt=$(),{mediaEditing:$t,hasEditGuard:Mt,hasPinnedChrome:jt}=Jn,{appState:At,dispatch:Lt,history:Tt,selectedItem:Et,getSelectorForId:Rt,config:Ft}=je(e=>e),Dt=M(),{first:Ht,firstGroup:Vt,lastGroup:Wt,isSectionGroup:Ut,sectionGroupZone:Gt,panelOf:Jt}=Dt,Yt=Jt(Ht),Kt=e=>_(Dt,e),Qt=e=>q(Dt,e),Xt="node"===Dt.firstRow,Zt=Dt.band??null,_t=an("screen",ye),qt=an("tree",We),eo=an("drag",hn),no=an("notice",on),to=an("lock",dn),oo=an("menu",Ue),ro=an("styleClipboard",be),io=an("chrome",rn),lo=j()??`/${Yn}`,so=A(),ao=L(),co=v({readOnly:It}),po=v({readOnly:It,foldIntoHistory:!0}),uo=jn(null),ho=Ae(),fo=An(()=>({...co,select:e=>{uo.current=e,co.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=ho.config;uo.current=Ge(e,t,n)}co.commitDocument(e,n)}}),[co,ho]),mo=At.ui,go=mo.leftSideBarVisible,yo=mo.rightSideBarVisible,{options:vo,widths:ko,initial:bo,fluid:So,fit:wo}=T(),[xo,zo]=Ln(bo),Co=se(),No=$t&&null!==Co;de(),ae();const Io=ce();E(Et?.props.id);const{read:Oo,write:Bo,forSelection:Po}=R(),[$o,Mo]=Ln(Oo);Tn(()=>{Bo($o)},[$o]);const[jo,Ao]=Ln(0),Lo=jn(null),To=jn(null),Eo=xn(To,{readySelector:gt}),Ro=Nn(Eo),Fo=a(To);c(To,Eo);const Do=S(),Ho=ln(Ct),Vo={state:Xn,offline:Do||Xn.failed&&Nt,readOnlyReason:Ot,editing:Ho?no.editing({name:sn(Ho.name,to),noun:_t.noun}):null,conflict:null!=it,notSaving:_t.bar.notSaving},Wo=()=>{It||(Xn.failed?wt():zt())};p(To,Eo,Wo);const[Uo,Go]=Ln(!1),Jo=jn(!1),[Yo,Ko]=Ln(null),[Qo,Xo]=Ln([]),[Zo,_o]=Ln(F),qo="puck"===Zo.kind,er=o(Zo,Et?.props.id),[nr,tr]=Ln(null);Tn(()=>{nr&&(r(),tr(null))},[nr]);const or=jn(Rt);or.current=Rt;const rr=En((e,{scroll:n})=>{Mo(n=>Po(e,n)),n&&tr(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=or.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&jr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),ir=jn(null);Tn(()=>{const e=ir.current;ir.current=null;const n=null==Et?.props.id?null:String(Et.props.id);_o(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Jt(Et?.type)??F);const t=Et?.props.id,o=uo.current;if(uo.current=null,!t)return;const r=Rt(t);rr(String(t),{scroll:!i(o,r??null,Ce)})},[Et?.props.id,rr]);const lr=En(e=>{_o(n=>D(n,e)?n:e),Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},[Lt]),sr=jn(()=>{});sr.current=(e,n)=>{const t=e?Bi(e.zone??Ce)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Et?.props.id?null:String(Et.props.id);_o(e=>D(e,n)?e:n),o!==r&&(ir.current={id:o,mode:n},fo.select(e))};const dr=En((e,n)=>sr.current(e,n),[]),ar={kind:Zo.kind,mode:Zo,open:lr,show:e=>_o(e),reveal:()=>{yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:dr},cr=H(ar,{data:At.data,selected:Et??null,zoneOf:e=>Rt(e)?.zone,readOnly:Boolean(It),select:e=>{_o(F),fo.select({index:e})},replace:(e,n)=>fo.replaceComponent(Ce,e,n),scrollTo:e=>l(e)},{device:xo,refreshes:jo},{setView:Mo,reveal:()=>{go||Lt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),pr=cr.resolveLeftView?cr.resolveLeftView($o):"sections",ur=V(),{isLockedBlock:hr,duplicateBlocked:fr,nestDepth:mr,newSectionNode:gr,canAddTo:yr,blockIsOffered:vr}=ur,kr=W(),{labelAtLevel:br,Icon:Sr,useProducts:wr}=kr,xr=kr.rowName?(e,n,t)=>kr.rowName(e,n,t):void 0,zr=En(e=>{Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),rr(e,{scroll:!0})},[Lt,rr]),{selectNode:Cr,openPartId:Nr}=y({mode:Zo,setMode:_o,onOpenPart:zr}),[Ir,Or]=Ln(null);fe(null!==Ir,()=>Or(null));const Br=f(U()),Pr=Br.collapsed,$r=Br.panelWidths,[Mr,jr]=Ln(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Pr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
-
return new Set}});Tn(()=>{try{window.localStorage.setItem(Pr,JSON.stringify([...Mr]))}catch{}},[Mr]);const[Ar,Lr]=Ln(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem($r);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}}});Tn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem($r,JSON.stringify(Ar))}catch{}},300);return()=>clearTimeout(e)},[Ar]);const Tr=En((e,n)=>Lr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Er=En(e=>Tr("left",e),[Tr]),Rr=En(e=>Tr("right",e),[Tr]),Fr=e=>Mr.has(e),Dr=e=>jr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Hr=jn(!1),Vr=jn(null);Tn(()=>{if(Hr.current&&!Uo){const e=Vr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??To.current?.querySelector(`button[aria-label="${CSS.escape(_t.add.title)}"]`))?.focus(),Vr.current=null}Hr.current=Uo},[Uo]),Tn(()=>{if(!Uo||!Fo)return;const e=e=>{"Escape"===e.key&&sl()};return Fo.addEventListener("keydown",e),()=>Fo.removeEventListener("keydown",e)},[Uo,Fo]),fe(Uo,()=>sl()),Tn(()=>{!go&&Uo&&(Go(!1),Ko(null),Jo.current=!1)},[go]);const Wr=G(),Ur=(e,n="success",t)=>{if(Wr)return void(t?Wr(e,"error"===n?"error":"info",t):Wr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Un.error(e,{...o,duration:t?.duration??3200}):Un.success(e,{...o,duration:t?.duration??1900})},Gr=jn(null),[Jr,Yr]=Ln(0),[Kr,Qr]=Ln(0),Xr=J(),Zr=jn(null),_r=e=>Math.max(0,e.clientHeight-(Zr.current?.offsetHeight??0));Tn(()=>{const e=Gr.current;if(!e)return;const n=()=>{Yr(e.clientWidth),Qr(_r(e))};n();const t=new ResizeObserver(n);return t.observe(e),Zr.current&&t.observe(Zr.current),()=>t.disconnect()},[]),Rn(()=>{Gr.current&&(Yr(Gr.current.clientWidth),Qr(_r(Gr.current)))},[Ar,go,yo]);const qr=xo===So?Jr>0?Jr:ko[So]:ko[xo],ei=Jr>0?Math.min(Jr/qr,"shrink"===wo?1:2):1,ni=qr*ei,ti=Jr>0&&ni>Jr+1,oi={width:ni,height:Kr||"100%",flex:"none",position:"relative"},ri={width:qr,height:Kr?Kr/ei:"100%",maxHeight:"none",transform:1!==ei?`scale(${ei})`:void 0,transformOrigin:"top left"},ii=()=>Lt({type:"setUi",ui:{leftSideBarVisible:!go}}),li=()=>Lt({type:"setUi",ui:{rightSideBarVisible:!yo}}),si=e=>{Uo&&(Go(!1),Ko(null),Jo.current=!1,go&&$o===e)||(Mo(e),go||Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},di=()=>{_o(F),fo.select(null),d()},ai=()=>{_o(Yt??F),yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},ci=At.data.content??[],pi=()=>{const e=ci.findIndex(Kt),n=ci.findIndex(Qt);return{floor:e>=0?e+1:0,cap:n>=0?n:ci.length}},ui=Ft,hi=ur.stripCopy,fi=n=>e(n,hi),mi=te(),gi=Je({data:At.data,config:ui,readOnly:Boolean(It),clipboard:mi,strip:hi?e=>hi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==yn||e.slot!==vn)return{min:0,max:n-1};const{floor:t,cap:o}=pi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&_o(F);const t=void 0===n||"node"===n?.kind?n:null;fo.commitDocument(e,t)}}),yi=ue(),[vi,ki]=Ln(null),bi=e=>{const n=ci.find(n=>String(n.props.id)===e),t=Dt.shared;n&&t&&gi.swap(e,t.detach(n))},Si=e=>{const n=Sn(At.data,Ft,e);if(!n)return!1;const t=kn(n.place),o=n.node,r=t===Ce?Ni(o):Di(o),i=t===Ce?Dt.shared?.usedOn(o):null;return!!gi.remove(e)&&(Ur(i?_t.shared.removed({count:Math.max(0,i.length-1)}):_t.deleted({name:r}),"success",{duration:8e3,action:{label:_t.bar.undo,onClick:()=>{gi.restore(n.node,n.place)}}}),!0)},wi={...gi,remove:Si},xi=e=>br(e,"block",Ft.components[e]?.label??e),zi=En(e=>Ft.components[e]?.defaultProps??{},[Ft]),Ci=e=>br(e,"section",xi(e)),Ni=e=>Se({type:e.type,props:e.props??{}},Ci(e.type),xr),{nodeAddresses:Ii,zoneItems:Oi}=An(()=>{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>=Ie)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Oe(Ft,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(ci,Ce,0),{nodeAddresses:e,zoneItems:n}},[ci,Ft]),Bi=En(e=>Oi.get(e)??[],[Oi]),Pi=e=>{const n=Ii.get(e);return n?Bi(n.zone)[n.index]:void 0},$i=e=>ee(ur,Ft,e),Mi=e=>{if(!ur.slotsOf||e===Ce)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Pi(e.slice(0,n));if(!t)return null;const o=$i(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}},ji=(()=>{if(!Y(Zo))return null;const e=`${Zo.nodeId}:${Zo.slot}`;return Mi(e)?.slot.panel===Zo.kind?e:null})(),Ai=jn(null);Tn(()=>{const e=Ai.current;if(Ai.current=null,!ji||!Y(Zo))return;const n=Zo.nodeId;rr(n,{scroll:e!==ji}),jr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Zo]);const Li=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Ii.get(e);n&&(n.zone===Ce?el(n.index):Il(n.zone,n.index,e,Pi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&ji!==i&&(Ai.current=i),dr(null,r),yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ti=(e,n,t)=>{const o=`${e}:${n}`;if(jr(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;ji!==o&&(Ai.current=o);dr(null,{kind:t,nodeId:e,slot:n})},Ei=(e,n,t)=>{if(It||!ur.moveSlot)return;const o=Pi(e),r=o?$i(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:vt,index:n},s=gn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=ur.moveSlot(e,n,s);"string"==typeof d&&Ti(e,d,i.panel)},Ri=wr(),Fi=An(()=>{const e=/* @__PURE__ */new Map;for(const n of Ri??[])e.set(n.slug,n.name);return e},[Ri]),Di=e=>we(e,xi,kr.plainText,e=>Fi.get(e),kr.rowName),Hi=(e,n)=>{const t=Ft.components[e.type]?.fields,o=n===Ce||ql(n)?"section":"block",r=n===Ce&&(Kt(e)||Qt(e)||Ut(e.type)),i="block"===o?xe(t):r?null:ze(t);return kr.renamePropOf?kr.renamePropOf(e,o,i):i},Vi=(e,n,t,o)=>{if(!(!It&&Ir?.zone===e&&Ir.index===n))return;const r=(t,o)=>{Or(null),o&&((e,n,t)=>{const o=Bi(e)[n];if(!o)return;const r=Hi(o,e);r&&fo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
-
return st("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":_t.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)},Wi=t(K(),ro),Ui=Wi.scope({target:$n,siteId:Kn,docId:Dn}),Gi=Ft,Ji=(e,n)=>n===Ce?Ci(e):xi(e),Yi=(e,n,t)=>{const o=Wi.plan(Ui,t,Ji(t.type,e),Gi);o&&(o.changed&&fo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Ur(o.message))},Ki=oe({nodesIn:Bi,nodeAt:(e,n)=>Bi(e)[n]??null,labelOf:(e,n)=>n===Ce?Ci(e):xi(e),renamePropOf:Hi,beginRename:(e,n)=>Or({zone:e,index:n}),history:{hasPast:Tt.hasPast,hasFuture:Tt.hasFuture,back:()=>Tt.back(),forward:()=>Tt.forward()},openPageSettings:()=>{fo.select(null),_o(F)},pageSettingsLabel:_t.pageSettings,words:{menu:oo,styleClipboard:ro,screen:_t.menu},readOnly:Boolean(It),collapseAll:()=>jr(new Set(Bi(Ce).map(e=>String(e.props.id)))),onPasteRefused:e=>Ur(e?_t.pasteRefused({name:e.label}):_t.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>ts(e,n),menuRows:(e,n,t)=>{const o=cr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Dt.shared;if(!t||n!==Ce)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:_t.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return It||hr(e.type,e)?n:{...n,change:[{label:_t.shared.detach,onClick:()=>bi(e.props.id)}],remove:[{label:_t.shared.removeFromPage,danger:!0,onClick:()=>{Si(e.props.id)}}]}}return It||Kt(e)||Qt(e)||Ut(e.type)?null:z(yi)?{change:[{label:_t.shared.makeShared,onClick:()=>ki({id:e.props.id,name:Ni(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=>hr(e.type,e),duplicateBlocked:e=>fr(At.data,e),permits:e=>{const n=Ne(Ft,e.type);return Dt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:wi,isPinned:(e,n)=>n===Ce&&(Kt(e)||Qt(e)),sectionBand:pi,locate:e=>Ii.get(e)??null,rowNameOf:(e,n)=>n===Ce?Ni(e):Di(e),selectAt:(e,n,t,o)=>{e===Ce?el(n):Il(e,n,t,o??"")},slotRung:e=>{const n=Mi(e);return n?.slot.panel?{label:n.slot.label,select:()=>Li(n.node,n.slot,!1)}:null},style:{held:()=>ve(Ui),canCopy:e=>Wi.rows(Gi,e).some(e=>!1!==e.counted),copy:(e,n)=>Wi.copy(Ui,e,Ji(e.type,n),Gi),paste:(e,n,t)=>Yi(e,n,t)},keys:Pt?{target:Fo,selected:()=>{const e=At.ui.itemSelector;return e?{zone:e.zone??Ce,index:e.index}:null},held:()=>mi.get(),readOnly:Boolean(It),onDone:({done:e,name:n})=>{"copied"===e&&Ur(_t.copied({name:n}))}}:void 0},Eo),Qi=jn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Tn(()=>{Qi.current={copy:(e,n)=>Wi.copy(Ui,e,Ji(e.type,n),Gi),paste:Yi,at:()=>{const e=At.ui.itemSelector;if(!e)return null;const n=e.zone??Ce,t=Bi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(It)}});const Xi=En(e=>{const n=ke(e);if(!n)return;const t=Qi.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))},[]);Tn(()=>{if(!Fo)return;const e=e=>Xi(e);return Fo.addEventListener("keydown",e),()=>Fo.removeEventListener("keydown",e)},[Xi,Fo]),In(Eo,"keydown",Xi);const Zi=ci.map(e=>e.props.id).join("|");Tn(()=>{const e=Eo?.document??null,n=Eo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Xo(e=>e.length?[]:e);const n=ci.findIndex(Qt),t=n>=0?n:ci.length,o=n=>{const t=ci[n]?.props?.id;return null==t?null:Mn(e,`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(Cn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=ci.length>0&&!Kt(ci[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=yt(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})}Xo(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()}},[Eo,Zi,xo,ei,go,yo,Et?.props.id]);const _i=Eo?.document??null,qi=Eo?.window??null;Tn(()=>{const e=Lo.current;if(!e||!_i||!qi)return;const n=[],t=()=>{const n=Mn(_i,`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&qi.scrollTo({left:qi.scrollX,top:qi.scrollY+t,behavior:"instant"}),!0};return Lo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[_i,qi]);const el=e=>{_o(F),fo.select({index:e}),cr.sectionPressed?.(ci[e]);const n=ci[e]?.props?.id;n&&l(n)},nl=e=>{const{floor:n,cap:t}=pi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Et&&Zo.kind!==Yt?.kind?ci.findIndex(e=>e.props.id===Et.props.id):-1;return o(r>=0?r+1:t)},tl=(e,n)=>{const{floor:t,cap:o}=pi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(fo.reorderComponent(Ce,e,i),fo.select({index:i}),{moved:!0,dest:i})},ol=(e,n,t,o)=>{_o(F),fo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Ur(_t.sectionAdded({name:t}))},rl=(e,n)=>{const t=nl(n),o=gr(e,{nodeDefaults:zi,newNodeId:Pe,sectionLabel:Ci,blockIsOffered:vr}),r=o?fo.insertNode(Ce,t,o):fo.insertSection(e,t);return ol(t,r,Ci(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(Ft,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=yr(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},il=e=>ll(Ce,e),ll=(e,n)=>{Vr.current=document.activeElement??null,Ko(null===n?null:{zone:e,index:n}),Go(!0),go||(Jo.current=!0,Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},sl=()=>{Go(!1),Ko(null),Jo.current&&Lt({type:"setUi",ui:{leftSideBarVisible:!1}}),Jo.current=!1},dl=(e,n)=>kr.rowName?n?Kt(e)?kr.rowName(e,"section",_t.header):Qt(e)?kr.rowName(e,"section",_t.footer):Ut(e.type)?kr.rowName(e,"section",xi(e.type)):Ni(e):Di(e):n?Ci(e.type):xi(e.type),al=e=>n=>{e()},cl=(e,n,t)=>{if(It)return null;const o=Bi(e)[n];return o&&!Ne(Ft,o.type).delete||o&&hr(o.type,o)?null:/* @__PURE__ */st(He,{kind:"delete",label:e===Ce&&o&&Dt.shared?.usedOn(o)?_t.shared.removeFromPage:_t.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Bi(e)[n]?.props?.id;null!=t&&Si(String(t))})(e,n),children:/* @__PURE__ */st(tt,{size:15})})},pl=e=>kr.rowPreview?.(e)||void 0,ul=e=>kr.rowMarks?.(e)??void 0,hl=(e,n,t)=>kr.rowActions?.(e,n,t)??null,fl=(e,n,t,o)=>{if(It)return null;if(hr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
-
return st(He,{kind:"eye",label:r?_t.showNamed({name:o}):_t.hideNamed({name:o}),onClick:()=>gl(e,n,t),children:/* @__PURE__ */st(r?ot:rt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},ml=e=>Vs(Ce,e),gl=(e,n,t)=>{fo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},yl=e=>Be(Ft,e),vl=e=>Oe(Ft,e),kl=e=>ur.slotsOf?$i(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:$e(e,n.slot)})):[{slot:null,rung:null,kids:vl(e)}],bl=e=>ur.slotsOf?kl(e).flatMap(e=>e.kids):vl(e),Sl=e=>Boolean(ur.slotsOf)&&$i(e).some(e=>e.rung),wl=(e,n,t)=>null===t?void 0===n?yr(e):yr(e,n):yr(e,n,t),xl=(e,n,t)=>{const o=Me(Ft,e.type,n)&&(t||bl(e).length>0||Sl(e));return{collapsible:o,folded:o&&Fr(String(e.props.id))}},zl=(e,n,t)=>kl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>xl(e,r,t(e.type)).collapsible?[String(e.props.id),...zl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Cl=e=>bl(e).length>0||Sl(e)||Boolean(yr(e.type)),Nl=e=>Boolean(yr(e)),Il=(e,n,t,o)=>{if(_o(F),yr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),fo.select({index:n,zone:e}),l(t)}else fo.select({index:n,zone:e}),l(t)},Ol=(e,n,t,o,r)=>{const i=`${e}:${n}`;fo.insertComponent(i,t,o),yr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),fo.select({index:o,zone:i})}):fo.select({index:o,zone:i})},Bl=jn(/* @__PURE__ */new Set);Tn(()=>{ci.forEach(e=>{const n=yr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Bl.current.has(t))return;Bl.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(zi)).forEach((e,t)=>po.seedChild(o,t,n.childType,e))})},[ci,po,zi]);const Pl=jn(/* @__PURE__ */new Set);Tn(()=>{ci.forEach((e,t)=>{const o=e.props.id;if(Pl.current.has(o))return;const r=n(e,yl(e.type));Pl.current.add(o),r&&po.replaceComponent(Ce,t,{...e,props:r})})},[ci,po]),Q(po,Ft);const $l=ci.findIndex(Qt),Ml=$l>=0?ci[$l]:null,jl=Xt?ci.findIndex(Kt):-1,Al=jl>=0?ci[jl]:null,Ll=Dt.groupTab,Tl=An(()=>Ll?e=>Ut(e.type):void 0,[Ll]),El=Boolean(Dt.groupBadge),Rl=Dt.sharedReach,Fl=e=>Rl?.(e)??void 0,Dl=An(()=>Rl?new Set(ci.filter(e=>Fl(e)).map(e=>String(e.props.id))):null,[ci,Rl]),Hl=An(()=>Dl?e=>Dl.has(e):void 0,[Dl]),Vl=Dt.first?Rl?.({type:Dt.first,props:{id:""}})??void 0:void 0,Wl=Dt.groupBadge?/* @__PURE__ */st("span",{className:"es-tree-group-badge",children:/* @__PURE__ */st(Hn,{tone:"info",size:"xs",children:Dt.groupBadge})}):void 0,Ul=ci.find(e=>e.type===Vt)??null,Gl=ci.find(e=>e.type===Wt)??null,Jl=$l>=0?$l:ci.length,Yl=[];ci.forEach(e=>{Qt(e)||(Cl(e)&&Yl.push(String(e.props.id)),Yl.push(...zl(e,1,Nl)))}),Ml&&(Yl.push(String(Ml.props.id)),Yl.push(...zl(Ml,1,Nl)));const Kl=Yl.length>0&&Yl.every(e=>Mr.has(e)),Ql=e=>{const n=kr.blockRowName(e,xi);return kr.rowName?kr.rowName(e,"block",n):n},Xl=(e,n,t,o)=>{const r=Bi(e)[t];if(!r)return;const i={...bn(e),index:t},l={...bn(n),index:Math.min(Math.max(o,0),Bi(n).length)},s=gn(i,l);if(e!==n||s!==t)try{gi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof wn))throw e}},Zl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of vl(e))n.add(r),t(o)};for(const t of yl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},_l=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ii.get(n);if(!e)return null;if(e.zone===Ce)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ql=e=>{const n=e.slice(0,e.indexOf(":")),t=ci.find(e=>Ut(e.type)&&String(e.props.id)===n);return t&&Gt(n)===e?t:null},es=(e,n)=>{const t=ql(e);return!t||(!Dt.groupAccepts||Dt.groupAccepts(t.type,n,Bi(e).length))},ns=(e,n,t)=>{if(e.rung){const t=Pi(e.rung.nodeId),o=t?$i(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===vt&&n.index>=0&&n.index<=o}if(n.slot===vt)return!1;if(e.add)return is(e.add,n);const o=kn(n);if(Ut(e.type))return!1;const r=ql(o),i=ql(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!es(o,e.type))&&(n.index>=0&&n.index<=Bi(o).length));if(e.zone===Ce||o===Ce){if(e.zone!==o)return!1;const{floor:t,cap:r}=pi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Bi(o).length)return!1;if(e.zone===o)return!0;const l=Ml&&!Dt.lastIsOpen?String(Ml.props.id):null;return(!l||_l(e.zone)!==l&&_l(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Bi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ii.get(i),s=l?Bi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Zl(r).has(n))return!1;const d=yr(s.type,mr(At?.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?.(Bi(n),r))})(e.zone,o,e.index,t)},ts=(e,n)=>{const t=kn(e.from),o=e.node;return t===kn(n)?es(t,o.type):ns({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},os=e=>{const n=e.slice(0,e.indexOf(":")),t=Ii.get(n),o=t?Bi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=yr(o.type,mr(At?.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=B(r.choices??(r.spec?[{type:r.spec.childType,label:xi(r.spec.childType)}]:[])),l=Mi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:dl(o,t.zone===Ce)}},rs=(e,n)=>{if("section"!==e.kind)return e;const t=kn(n);return t===Ce||ql(t)?e:os(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},is=(e,n)=>{const t=rs(e,n),o=kn(n);if("shared"===t.kind){if(o!==Ce||!Dt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=pi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ql(o)){const e="section"===t.kind?t.type:t.template.node.type;return es(o,e)&&n.index>=0&&n.index<=Bi(o).length}if(o!==Ce)return!1;const{floor:e,cap:r}=pi();return n.index>=e&&n.index<=r}if(o===Ce)return!1;const r=os(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Bi(o))},ls=(e,n)=>{const t=rs(e,n);if("block"!==t.kind&&ql(kn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&es(n,o)){if("section"===e.kind)fo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;fo.insertNode(n,t,fi(e.template.node))}_o(F),fo.select({index:t,zone:n})}})(t,kn(n),n.index);if("section"===t.kind)return void rl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=nl(t),r=fo.insertNode(Ce,o,n);ol(o,r,e)})(t.template.name,fi(t.template.node),n.index);if("shared"===t.kind){const e=Dt.shared?.nodeOf(t.section);if(!e)return;const o=nl(n.index);return void(gi.restore(e,{parentId:yn,slot:vn,index:o})&&ol(o,e.props.id,t.section.title))}const o=kn(n),r=os(o);r&&(r.target.spec?Ol(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{fo.insertComponent(e,n,t),_o(F),fo.select({index:t,zone:e})})(o,t.type,n.index))},ss=(e,n)=>{e.media?function(e){const n=Es();if(!n||!As)return;Fs(n).then(n=>{n&&function(e,n){if(!As)return;const t=As.create(e,{nodeDefaults:zi,newNodeId:Pe,sectionLabel:Ci,blockIsOffered:vr}),o=kn(n);if(o===Ce){const e=nl(n.index),o=fo.insertNode(Ce,e,t);return void ol(e,o,Ci(t.type))}fo.insertNode(o,n.index,t),_o(F),fo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Ei(e.rung.nodeId,e.index,n.index):e.add?ls(e.add,n):e.zone===Ce?tl(e.index,n.index):Xl(e.zone,kn(n),e.index,n.index)},[ds]=Ln(()=>fn()),as=mn({keyOf:e=>e.id,readOnly:Boolean(It),session:ds,canDrop:ns,onDrop:ss,onStep:(e,n)=>{e.rung?Ei(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Ce?((e,n)=>{const t=Ci(ci[e]?.type??""),o=tl(e,n<0?e-1:e+2);if(!o.moved)return void Ur(n<0?_t.sectionFirst({name:t}):_t.sectionLast({name:t}));const{floor:r,cap:i}=pi();Ur(_t.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Xl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),cs=En(e=>{const{floor:n,cap:t}=pi(),o=[];for(const r of e.nodes){const e=kn(r.place),i=Bi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Kt(i)||Qt(i)||hr(i.type,i))continue;if(Ut(i.type))continue;const l=Boolean(ql(e)),s=e===Ce||l;e===Ce&&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?Ci(i.type):Di(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=kn(e.list);if(n===Ce&&0===e.children.length)return[{...e,addLabel:_t.addSection,addAlways:!0}];const t=os(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ql(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=kn(e.list),t=n===Ce||ql(n)?null:os(n);return t?.choices.length?cn(e,t.target.spec?.addLabel??_t.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[At.data]),ps=null==Et?.props.id?null:String(Et.props.id),us=En(e=>{const n=Ft,t=e=>!e.item.rung&&null!==Sn(At.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(ps);return i||(r(Ye(At.data,n,o.item.id,ps,Tl))??o)},[At.data,Ft,ps,Tl]),[hs,fs]=Ln(null),ms=Boolean(Ll||Rl);In(Eo,"mouseover",e=>{if(!ms)return;const n=On(e.target),t=n?ht(At.data,Ft,n):null;t!==hs&&fs(t)}),In(Eo,"mouseout",e=>{ms&&!e.relatedTarget&&fs(null)});const gs=e=>Kt(e)||Qt(e)||Ut(e.type),ys=e=>{const n=Ut(e.type)?xi(e.type):Kt(e)?_t.header:Qt(e)?_t.footer:null;return null===n?Ni(e):kr.rowName?kr.rowName(e,"section",n):n},vs=[];if(ms){const e=ps?ht(At.data,Ft,ps):null;for(const n of/* @__PURE__ */new Set([e,hs])){const e=n?ci.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Kt(e)||e.type===Vt,o=Fl(e);if(o){vs.push({id:String(e.props.id),label:ys(e),below:t,reach:o});continue}if(!Ll||!gs(e))continue;const r=Ll(e);r&&vs.push({id:String(e.props.id),label:r,below:t})}}const ks=ue(),bs=jn(null);Tn(()=>{const e=Dt.changeNotice;if(!e)return;const n=JSON.stringify(ci.filter(gs)),t=bs.current;if(bs.current={doc:Dn,bands:n,index:Tt.index},!t||t.doc!==Dn||t.bands===n)return;Tt.hasPast&&Tt.index>=t.index&&!ut.has(ks)&&(ut.add(ks),Ur(e,"success",{action:{label:_t.bar.undo,onClick:()=>Tt.back()},duration:8e3}))},[ci]);const Ss=e=>{_o(F),fo.select(e.zone===Ce?{index:e.index}:{index:e.index,zone:e.zone})},ws=X(),xs=()=>({data:At.data,device:xo,ops:fo,inspector:ar}),zs=ws?.model,Cs=An(()=>zs?e=>zs(e,cs(e),xs()):cs,[zs,cs,xo]),Ns=ws?.measure,Is=Ns?(e,n)=>Ns(e,n,xs()):void 0,Os=ws?.canDrop,Bs=Os?(e,n)=>Os(e,n,ns,xs()):ns,Ps=ws?.drop,$s=Ps?(e,n)=>Ps(e,n,ss,xs()):ss,Ms=ws?.pick,js=Ms?e=>Ms(e,Ss,xs()):Ss,As=ws?.media??null,Ls=jn(null),Ts=An(()=>As?{id:ct,zone:"",index:-1,type:As.adds.type,add:{kind:As.adds.kind,type:As.adds.type},media:!0}:null,[As]);Tn(()=>{if(!Ts||It||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(Zn))(e)&&(Ls.current=null,ds.start({key:ct,item:Ts}))},n=e=>{ds.get()?.item.media&&(Ls.current=Gn(e.dataTransfer))},t=()=>{ds.get()?.item.media&&ds.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)}},[Ts,It,ds]);const Es=()=>{const e=Ls.current;return Ls.current=null,e},Rs=pe(),Fs=async e=>{if(!Rs)return e;const n=await Rs(e);return n?{...e,id:n.id,url:n.url}:null};const Ds=(e,n)=>{if(!As)return;const t=Sn(ho.getState().appState.data,ui,n);if(!t)return;const o=t.node;fo.replaceComponent(kn(t.place),t.place.index,{...o,props:{...As.replace(o,e),id:o.props.id}})},Hs=e=>{const n=kn(e),t=Mi(n);t&&Li(t.node,t.slot,!1),ll(n,e.index)},Vs=(e,n)=>/* @__PURE__ */st(Ve,{...It?{}:as.seam({place:{...bn(e),index:n}})},`seam:${e}:${n}`),Ws={rowClick:al,isCollapsed:Fr,toggleCollapse:Dr},Us=e=>{const n=String(e.props.id),t=ci.findIndex(e=>String(e.props.id)===n),o=Gt(n),r=Bi(o),i=Fr(n),l=xi(e.type),s=kr.rowName?kr.rowName(e,"section",l):l,d=e=>Vs(o,e);/* @__PURE__ */
|
|
16
|
-
return dt(at,{children:[
|
|
17
|
-
/* @__PURE__ */st(Ee,{words:qt,icon:/* @__PURE__ */st(Sr,{type:e.type,size:13}),name:s,preview:pl(e),marks:ul(e),onSelect:()=>el(t),nameSlot:Vi(Ce,t,n,s),selected:er===n,badge:Fl(e)?void 0:Wl,shared:Fl(e),actions:hl(e,Ce,t)??void 0,rowProps:{"data-node-id":n,onClick:al(()=>el(t))},fold:{open:!i,label:"section",onToggle:()=>Dr(n)}}),!i&&/* @__PURE__ */dt(Re,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ni(n),l=Cl(n),s=l&&Fr(r),a=()=>Il(o,t,r,e.type),{rowProps:c,...p}=as.row({item:{id:r,zone:o,index:t,type:n.type},place:{...bn(o),index:t}},{"data-node-id":r,onClick:al(a)});/* @__PURE__ */
|
|
18
|
-
return dt(Fn,{children:[d(t),
|
|
19
|
-
/* @__PURE__ */st(Ee,{words:qt,icon:/* @__PURE__ */st(Sr,{type:n.type,size:13}),name:i,preview:pl(n),marks:ul(n),onSelect:a,nameSlot:Vi(o,t,r,i),selected:er===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Dr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[cl(o,t,i),hl(n,o,t),fl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */st(Re,{children:Ys(n,2)})]},r)}),d(r.length)]})]})},Gs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=as.dragging,d=!Fr(l)&&s?.rung?.nodeId!==i,a={...bn(l),index:0},c=s&&!s.rung&&ns(s,a)?a:void 0,p=()=>Li(e,n,!0),{rowProps:u,...h}=as.row({item:{id:`rung:${l}`,zone:`${i}:${vt}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:vt,index:t},into:c,canDrag:Boolean(ur.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:al(p)}),f=It?null:ur.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
-
return dt(Fn,{children:[n.heading,
|
|
21
|
-
/* @__PURE__ */st(Ee,{words:qt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:ji===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Dr(l)},actions:f&&f.length>0?/* @__PURE__ */st(at,{children:f.map((t,o)=>/* @__PURE__ */st(He,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(It||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ti(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__ */st(tt,{size:15}):/* @__PURE__ */st(lt,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */st(Re,{children:r})]},l)},Js=(e,n)=>{const t=kl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
-
return st(at,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=wl(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__ */dt(at,{children:[i.map(({child:n,zone:t,index:o})=>{const r=er===String(n.props.id),{collapsible:i,folded:s}=xl(n,l,Nl(n.type)),d=String(n.props.id),a=Ql(n),p=()=>Il(t,o,d,e.type),{rowProps:u,...h}=as.row({item:{id:d,zone:t,index:o,type:n.type},place:{...bn(t),index:o}},{"data-node-id":d,onClick:al(p)});/* @__PURE__ */
|
|
23
|
-
return dt(Fn,{children:[0===o&&c(t,0),
|
|
24
|
-
/* @__PURE__ */st(Ee,{words:qt,icon:/* @__PURE__ */st(Sr,{type:n.type,size:13}),name:a,preview:pl(n),marks:ul(n),onSelect:p,nameSlot:Vi(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Dr(d)}:void 0,actions:/* @__PURE__ */dt(at,{children:[cl(t,o,a),hl(n,t,o),fl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */st(Re,{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__ */st(Fn,{children:p},t.slot??"")})})},Ys=(e,n)=>{const t=mr(At?.data,e.type,String(e.props.id)),o=kl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
-
return st(at,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=wl(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__ */dt(at,{children:[l.map(({child:n,zone:t,index:o})=>{const r=er===String(n.props.id),i=Di(n),l=String(n.props.id),{collapsible:d,folded:a}=xl(n,s,Nl(n.type)),c=yl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...bn(p),index:Bi(p).length}:void 0,h=as.dragging,f=u&&h&&ns(h,u)?u:void 0,g=()=>Il(t,o,l,e.type),{rowProps:y,...v}=as.row({item:{id:l,zone:t,index:o,type:n.type},place:{...bn(t),index:o},into:f,canDrag:!hr(n.type,n)},{"data-node-id":l,onClick:al(g)});/* @__PURE__ */
|
|
26
|
-
return dt(Fn,{children:[0===o&&m(t,0),
|
|
27
|
-
/* @__PURE__ */st(Ee,{words:qt,icon:/* @__PURE__ */st(Sr,{type:n.type,size:13}),name:i,preview:pl(n),marks:ul(n),onSelect:g,nameSlot:Vi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Dr(l)}:void 0,actions:hr(n.type,n)?hl(n,t,o)??void 0:/* @__PURE__ */dt(at,{children:[cl(t,o,i),hl(n,t,o),fl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */st(Re,{children:Ys(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
-
/* @__PURE__ */st(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__ */st(Fn,{children:v},o.slot??"")})})},Ks=Uo,Qs=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:go&&!Ks&&pr===e.id,onSelect:()=>si(e.id)}:e,Xs=[...(cr.railLead??[]).map(Qs),{id:"sections",label:_t.layers,icon:/* @__PURE__ */st(me,{}),active:go&&!Ks&&"sections"===pr,onSelect:()=>si("sections")},...(cr.railTrail??[]).map(Qs)],Zs=No?{onPress:Io}:$t?{onPress:()=>{le(zn,{accept:"image/*",title:io.mediaLibrary})}}:null,_s={value:Xs.find(e=>!0===e.active)?.id??"",press:e=>{const n=Xs.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:Xs.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */st("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},qs=[...cr.railLead??[],...cr.railTrail??[]].find(e=>"panel"in e&&e.id===pr),ed=Boolean(Zt?.foldable),nd=Zt?.label??(Mt?_t.pageSections:_t.templateSections),td=ed&&Fr(kt),od=/* @__PURE__ */dt(at,{children:[ci.map((e,n)=>{if(Kt(e)||Qt(e)||Ut(e.type))return null;const t=er===String(e.props.id),o=Boolean(e.props._hidden);vl(e);const r=String(e.props.id),i=cr.hasOwnRows?.(e)??!1,l=Cl(e)||i,s=l&&Fr(r),d=yl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...bn(a),index:Bi(a).length}:void 0,p=as.dragging,u=c&&p&&ns(p,c)?c:void 0,{rowProps:h,...f}=as.row({item:{id:r,zone:Ce,index:n,type:e.type},place:{...bn(Ce),index:n},into:u,canDrag:!hr(e.type,e)},{"data-node-id":r,onClick:al(()=>el(n))});/* @__PURE__ */
|
|
29
|
-
return dt(Fn,{children:[n>0&&ml(n),
|
|
30
|
-
/* @__PURE__ */st(Ee,{words:qt,icon:/* @__PURE__ */st(Sr,{type:e.type,size:13}),name:Ni(e),preview:pl(e),marks:ul(e),shared:Fl(e),onSelect:()=>el(n),nameSlot:Vi(Ce,n,r,Ni(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Dr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[cl(Ce,n,Ni(e)),hl(e,Ce,n),fl(Ce,n,e,Ni(e))]}),rowProps:h}),Cl(e)&&!s&&/* @__PURE__ */dt(Re,{children:[Ys(e,1),cr.partRows?.(e,Ws)]}),i&&!s&&/* @__PURE__ */st(Re,{children:cr.ownRows?.(e,n,Ws)})]},String(e.props.id??n))}),Jl>0&&ml(Jl)]}),rd=(e,n,t)=>{const o=String(e.props.id),r=bl(e).length>0||Sl(e)||Boolean(yr(e.type)),i=r&&Fr(o),l="header"===t?_t.header:_t.footer,s=kr.rowName?kr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
-
return dt(at,{children:[
|
|
32
|
-
/* @__PURE__ */st(Ee,{words:qt,icon:/* @__PURE__ */st(Sr,{type:t,size:13}),name:s,preview:pl(e),marks:ul(e),badge:Fl(e)?void 0:Wl,shared:Fl(e),onSelect:()=>el(n),nameSlot:Vi(Ce,n,o,s),selected:er===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Dr(o)}:void 0,actions:hl(e,Ce,n)??void 0,rowProps:{"data-node-id":o,onClick:al(()=>el(n))}}),r&&!i&&/* @__PURE__ */st(Re,{children:Js(e,1)})]})};return(cr.wrap??(e=>e))(
|
|
33
|
-
/* @__PURE__ */st(Z,{target:Eo,children:/* @__PURE__ */dt("div",{ref:To,className:"sf-editor es-editor",style:tn(Ar),onContextMenu:Ki.onEditorContextMenu,...u(zn),children:[
|
|
34
|
-
/* @__PURE__ */dt(Ke,{children:[
|
|
35
|
-
/* @__PURE__ */dt("div",{className:"es-cluster es-cluster--left",children:[Zs?/* @__PURE__ */st(Vn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */st(ge,{}),onClick:Zs.onPress,children:_t.railMedia}):null,
|
|
36
|
-
/* @__PURE__ */st(Qe,{label:_t.bar.undo,disabled:Boolean(It)||!Tt.hasPast,onClick:()=>Tt.back(),children:/* @__PURE__ */st(_n,{})}),
|
|
37
|
-
/* @__PURE__ */st(Qe,{label:_t.bar.redo,disabled:Boolean(It)||!Tt.hasFuture,onClick:()=>Tt.forward(),children:/* @__PURE__ */st(qn,{})})]}),
|
|
38
|
-
/* @__PURE__ */dt(Xe,{children:[
|
|
39
|
-
/* @__PURE__ */st(Ze,{devices:vo,value:xo,onChange:zo}),
|
|
40
|
-
/* @__PURE__ */st(Qe,{label:_t.bar.refresh,tip:_t.bar.refreshTip,onClick:()=>{Lo.current=(()=>{const e=Eo?.document;if(!e)return null;const n=ci.findIndex(Qt),t=n>=0?n:ci.length;let o=null;for(let n=0;n<t;n++){const t=ci[n]?.props?.id;if(null==t)continue;const r=Mn(e,`[data-puck-component="${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=Et?.props?.id??ci[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Ao(e=>e+1)},children:/* @__PURE__ */st(et,{})}),cr.barView?.()]}),
|
|
41
|
-
/* @__PURE__ */dt(Xe,{kind:"right",style:{minWidth:300},children:[
|
|
42
|
-
/* @__PURE__ */st(k,{input:Vo,words:_t.saveStatus}),Bn?/* @__PURE__ */st(Bn,{}):null,cr.barLead?.(),cr.barTrail?.(),cr.mainAction||!cr.barMain?/* @__PURE__ */st(b,{input:Vo,action:cr.mainAction??{label:_t.done,onPress:()=>{Qn(At.data)}},readOnly:Boolean(It),saveSwitch:Bt,onToggleAutoSave:xt,onSaveNow:Wo,bar:_t.bar,words:_t.saveStatus}):cr.barMain()]})]}),
|
|
43
|
-
/* @__PURE__ */st(re,{}),
|
|
44
|
-
/* @__PURE__ */dt("div",{className:"sf-body",children:[go?/* @__PURE__ */dt(at,{children:[
|
|
45
|
-
/* @__PURE__ */dt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":_t.leftPanel,children:[
|
|
46
|
-
/* @__PURE__ */dt("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
|
-
/* @__PURE__ */st(N,{side:"left",onHide:ii}),
|
|
48
|
-
/* @__PURE__ */st("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
|
|
49
|
-
/* @__PURE__ */st(Wn,{variant:"underline",block:!0,"aria-label":_t.bar.views,value:_s.value,onChange:_s.press,items:_s.items})]}),Uo?/* @__PURE__ */st(x,{at:Yo?{label:(e=>{const n=ql(e.zone);if(n)return _t.add.addingTo({name:kr.rowName?dl(n,!0):xi(n.type)});if(e.zone===Ce){const n=ci[e.index];return n&&!Qt(n)?_t.add.addingBefore({name:dl(n,!0)}):_t.add.addingAtEnd}const t=os(e.zone);return t?_t.add.addingTo({name:t.parentName}):_t.add.addingHere})(Yo),onClear:()=>Ko(null)}:void 0,placeBlocks:Yo&&Yo.zone!==Ce?os(Yo.zone)?.choices:void 0,canTake:Yo?e=>{if(!Yo)return null;const n={...bn(Yo.zone),index:Yo.index};if(is(e,n))return null;if("shared"===e.kind&&Yo.zone===Ce&&!Dt.shared?.nodeOf(e.section))return _t.shared.alreadyHere;const t=ql(Yo.zone);if(t)return _t.add.notInside({name:dl(t,!0)});if(Yo.zone===Ce)return _t.add.onlySections;const o=os(Yo.zone);return o?_t.add.notInside({name:o.parentName}):_t.add.onlySections}:void 0,onPick:Yo?e=>{if(!Yo)return;const n={...bn(Yo.zone),index:Yo.index};is(e,n)&&(ls(e,n),sl())}: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:ds,siteWide:cr.addPanelRow?.(sl),onClose:sl,readOnly:Boolean(It)}):qs?qs.panel({onHide:ii,notify:Ur}):/* @__PURE__ */dt(at,{children:[
|
|
50
|
-
/* @__PURE__ */st(I,{icon:/* @__PURE__ */st(me,{}),title:_t.layers,context:lo,actions:/* @__PURE__ */dt(at,{children:[!It&&/* @__PURE__ */st(_e,{label:_t.add.title,onClick:()=>il(null),children:/* @__PURE__ */st(nt,{size:15})}),
|
|
51
|
-
/* @__PURE__ */st(_e,{label:Kl?_t.expandAll:_t.collapseAll,title:0===Yl.length?_t.nothingToFold:void 0,disabled:0===Yl.length,onClick:()=>jr(e=>{const n=new Set(Yl);return Kl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Yl])}),children:/* @__PURE__ */st(mt,{expand:Kl})})]})}),
|
|
52
|
-
/* @__PURE__ */dt(Fe,{className:"sf-tree sf-scroll",words:qt,children:[
|
|
53
|
-
/* @__PURE__ */st(Ee,{words:qt,icon:/* @__PURE__ */st(Sr,{type:"page",size:13}),name:_t.pageSettings,onSelect:di,selected:!Et&&qo,rowProps:{onClick:al(di)}}),Ul&&/* @__PURE__ */dt(at,{children:[!El&&/* @__PURE__ */st(De,{children:_t.header}),Us(Ul)]}),jt&&!(El&&Ul)&&/* @__PURE__ */dt(at,{children:[!El&&/* @__PURE__ */st(De,{children:_t.header}),!Xt&&/* @__PURE__ */st(Ee,{words:qt,icon:/* @__PURE__ */st(Sr,{type:"header",size:13}),name:_t.header,badge:Vl?void 0:Wl,shared:Vl,onSelect:ai,selected:Zo.kind===Yt?.kind,rowProps:{onClick:al(ai)}})]}),Al&&!(El&&Ul)&&rd(Al,jl,"header"),!ed&&/* @__PURE__ */st(De,{children:nd}),ed?/* @__PURE__ */dt(at,{children:[
|
|
54
|
-
/* @__PURE__ */st(Ee,{words:qt,icon:null,name:nd,fold:{open:!td,label:nd,onToggle:()=>Dr(kt)}}),!td&&/* @__PURE__ */st(Re,{children:od})]}):od,jt&&!El&&/* @__PURE__ */st(De,{children:_t.footer}),Ml&&!(El&&Gl)&&rd(Ml,$l,"footer"),Gl&&Us(Gl),cr.treeFoot?.()]})]})]}),
|
|
55
|
-
/* @__PURE__ */st(qe,{side:"left",width:Ar.left,min:nn.left,max:en,defaultWidth:m.left,label:_t.resizeLeftPanel,onResize:Er})]}):/* @__PURE__ */st(O,{side:"left",onShow:ii}),
|
|
56
|
-
/* @__PURE__ */dt("div",{ref:Gr,className:"sf-center sf-scroll","data-sf-canvas-head":Xr?"":void 0,style:{overflowX:ti?"auto":"hidden",overflowY:"hidden"},children:[Xr&&/* @__PURE__ */st("div",{ref:Zr,className:"sf-canvas-head",children:/* @__PURE__ */st(Xr,{device:xo})}),
|
|
57
|
-
/* @__PURE__ */dt("div",{className:"sf-frame-scaler",style:oi,children:[
|
|
58
|
-
/* @__PURE__ */st("div",{className:"sf-frame "+(xo===So?"":`sf-frame--${xo}`),style:ri,children:/* @__PURE__ */dt("div",{className:"sf-preview-host",children:[
|
|
59
|
-
/* @__PURE__ */st(Le.Provider,{value:Tl,children:/* @__PURE__ */st(Te.Provider,{value:Hl,children:/* @__PURE__ */st(so,{},jo)})}),
|
|
60
|
-
/* @__PURE__ */st(pn,{canvas:Eo,session:ds,model:Cs,measure:Is,canDrop:Bs,onDrop:$s,choose:us,onPick:js,dropOn:As?{accepts:(e,n)=>{if(!e.media||!As||n.item.rung)return!1;const t=Sn(At.data,ui,n.item.id);return null!==t&&As.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Es();n&&As&&Fs(n).then(n=>{n&&Ds(n,e.item.id)})})(n),label:()=>_t.canvasReplaceImage}:void 0,onZoneAdd:Hs,onSeamAdd:Hs,zoneAddLabel:_t.canvasAddBlock,words:eo.canvas,readOnly:Boolean(It),revision:At.data}),Qo.length>0&&!Ro&&/* @__PURE__ */st("div",{className:"sf-preview-gaps",children:Qo.map(e=>
|
|
61
|
-
/* @__PURE__ */st(un,{index:e.index,label:_t.addSectionHere,onInsert:()=>il(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))})]})}),ms?/* @__PURE__ */st(ft,{canvas:Eo,tabs:vs,onSelect:e=>{const n=ci.findIndex(n=>String(n.props.id)===e);n>=0&&el(n)}}):null]})]}),yo?/* @__PURE__ */dt(at,{children:[Pn?
|
|
62
|
-
/* @__PURE__ */st("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:Pn}):/* @__PURE__ */st(at,{children:/* @__PURE__ */st(h,{value:{selectChild:Il,addChild:Ol,childRowName:Di,blockRowName:Ql},children:/* @__PURE__ */st(ao,{mode:Zo,onOpenWebsiteSettings:cr.openSettings??(()=>{}),onOpenSiteStyles:cr.openStyles,onSelectNode:Cr,onNotify:Ur,onHidePanel:li,nodeActions:Et?Ne(Ft,Et.type):bt})})}),
|
|
63
|
-
/* @__PURE__ */st(qe,{side:"right",width:Ar.right,min:nn.right,max:en,defaultWidth:m.right,label:_t.resizeSettingsPanel,onResize:Rr})]}):
|
|
64
|
-
/* @__PURE__ */st(O,{side:"right",onShow:li})]}),Ki.menu,
|
|
65
|
-
/* @__PURE__ */st(ne,{}),vi?/* @__PURE__ */st(pt,{name:vi.name,onMake:e=>(async(e,n)=>{const t=ci.find(n=>String(n.props.id)===e),o=Dt.shared;if(!t||!o)return;let r;try{r=await C(yi).create(n,t)}catch{return void Ur(_t.shared.makeFailed,"error")}o.adopt(t,r),ki(null)})(vi.id,e),onCancel:()=>ki(null)}):null]})}))}export{wt as ScreenChrome};
|
package/dist/chunk-BHRC3ASL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hidableText as n}from"./chunk-6W7WLPZH.js";import{textFieldIdentifier as r}from"./chunk-DUVRZ456.js";function t(r,t){const o=n(r.props.name);if(o)return o;const e=n(r.props.altName);if(e)return e;const c=r.props.collection?.name;if(c)return c;const u=r.props.source?.title;if(u)return u;const s=r.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(n){if(!n)return null;for(const t of["name","altName"])if(r(n[t]))return t;return null}function c(n){const t=n?.name;return void 0===t||r(t)?"name":null}function u(r,t,o){const e=n(r.props?.name).trim()||t;return o?o(r,"section",e):e}export{u as rootRowName,c as sectionRenameProp,t as slotChildName,e as slotChildRenameProp,o as slotChildRowName};
|
package/dist/chunk-I54UCYOU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createPreviewSelectionContext as e}from"./chunk-GOTN2KY4.js";var{Provider:r,useSelection:o}=e("selectedPartId");export{r as PreviewPartsProvider,o as usePreviewParts};
|
package/dist/chunk-LXTM2OLQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{routeSharedHostMessage as e}from"./chunk-77IWWW6X.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-GMCZXMOV.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-HNKB2ZYR.js";import{isExpiredSession as s,readEaselFailure as i}from"./chunk-CLOS6SSX.js";import{useAdminBridge as l}from"./chunk-U66YKDAR.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-O7Q4DDJT.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-RSCMJIWS.js";import{useEaselHost as k}from"./chunk-MQA7OFRA.js";import{DEFAULT_SCREEN_WORDS as v}from"./chunk-EB6NI2VK.js";import{useAutosave as g}from"./chunk-NDRZP6YR.js";import{canWriteDocument as p,newEaselClientId as h,reloadIfVersionMoved as y,openUnansweredClaim as w,FAIL_OPEN_RETRY_MS as S,CLAIM_FAIL_OPEN_MS as b,holderOf as I}from"./chunk-THWO5YVZ.js";import{useWords as P}from"./chunk-MFIRYGHW.js";import{createContext as j,useContext as R,useState as B,useMemo as E,useCallback as O,useEffect as C,useRef as H}from"react";import{jsx as A}from"react/jsx-runtime";var D={content:[],root:{},zones:{}};var M=j(null);function T(){const e=R(M);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function N({target:j,addressing:R=o,onHostMessage:T,children:N}){const W=R,{homeSlug:F,entryMayBounce:L,entryBounce:V,onSwitch:Y,tellsHost:K,adapterFor:U,migrateRenamedProps:X,describeMissing:Z,onLoadFailed:x}=W,[G,J]=B(j),Q=k(),z=d(),_=E(()=>f(z),[z]),q=E(()=>t(z),[z]),$="template"===G.kind,ee="template"===G.kind?G.id:null,re="template"===G.kind?G.pageSlug??F??"":"document"===G.kind?G.slug??"":G.slug,ne="page"===G.kind?G.siteId??null:null,te=z.blocks,oe=E(()=>U(G,_,te),[U,_,te,G.kind,"template"===G.kind?G.id:"document"===G.kind?G.record:G.siteId]),ue=oe.capabilities,ae=O(e=>z.documentHooks?.stored?.(e)??e,[z]);C(()=>{m(z,ne)},[z,ne]);const se=H(G);C(()=>{se.current=G},[G]);const{token:ie,tokenRef:le,capabilities:ce}=l({onMessage:r=>{if(T?.(r)||e(r))return;const n=r;if("storefront-editor:navigate"===n?.type){const e=r;e?.target&&Br(e.target)}}}),de=!z.usesBridgedToken||null!==ie,fe=oe.lock,me=Boolean(_.lock),[ke,ve]=B(null),[ge,pe]=B(null),[he,ye]=B(null),[we,Se]=B(null),be=P("screen",v),Ie=we?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(we,be):null,[Pe,je]=B(null),Re=H(null),Be=H(null),[Ee,Oe]=B(!1),Ce=H(null),[He,Ae]=B(null),De=H(null),[Me,Te]=B(null),[Ne,We]=B(!1),Fe=H(null);C(()=>{Fe.current=Me},[Me]);const[Le,Ve]=B(ue.hasEditLock?{kind:"checking"}:{kind:"editing"}),Ye=H(Le);C(()=>{Ye.current=Le},[Le]);const Ke=H(()=>Promise.resolve(!1)),Ue=O(e=>{Be.current=e,Oe(!0)},[]),Xe=g({save:async({id:e,data:r})=>{if(p(Ye.current)){if(!await Ke.current(e,r)){if(!p(Ye.current))return void Ue({id:e,data:r});throw new Error("page save did not land")}}else Ue({id:e,data:r})},onFailure:(e,r)=>{0===r&&Q.send("storefront-editor:save-failed")}}),{state:Ze,push:xe,flush:Ge,pause:Je,resume:Qe,stop:ze,reset:_e,retryNow:qe,hasPending:$e}=Xe,er=H(Ze);C(()=>{er.current=Ze},[Ze]);const rr=u(Ze),nr=O(()=>{const e=Be.current;e&&(Be.current=null,Oe(!1),xe(e))},[xe]),tr=H("");tr.current||(tr.current=h());const[or,ur]=B(0),ar=H(!1),[sr,ir]=B(L(j)),lr=H(!1);C(()=>{if(lr.current)return;lr.current=!0;const e=Q.address.search(),r=V(j,e);r?Q.address.load(r):L(j)&&ir(!1)},[j,Q]);const cr=Q.send;C(()=>{if(!de)return;let e=!1;const t=se.current,o=oe.resolve(re),u=z.documentHooks?.opening?.({slug:re,isTemplate:$,capabilities:ue});return o.then(async r=>{if(e)return;if(!r)return"page"===t.kind&&null!==F&&re!==F?void Q.address.load({kind:"page",slug:F,siteId:ne??void 0}):(Se({target:t,slug:re,missing:!0,sentence:Z?.(t)??null}),void x?.(t,null));const n=r.readOnlyReason?r.readOnlyReason:null;Re.current=n,je(n),ve(r.id),pe(r.kind??null),De.current=r.version??null;const o=r.layout,a=o&&Object.keys(o).length?o:D,s=X(a),i=u?await u(s):s;e||ye(i)}).catch(o=>{e||(console.error("[storefront-editor] document load failed",o),Se({target:t,slug:re,missing:!1,sentence:n(o,{slug:re},z),cause:r(o,z)}),x?.(t,o))}),()=>{e=!0}},[de,ie,$,oe,re]);const dr=O(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=le.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),fr=O(async e=>{const r=le.current;if(!r&&z.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(s(n,z)){cr("storefront-editor:auth-expired");const n=r?await dr(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[cr,dr,z]),mr=O(async e=>{const r=le.current?await fr(e):{ok:!1};return r.ok||cr("storefront-editor:save-failed"),r.ok},[cr,fr]),kr=O(async(e,r,n=!1)=>{if(null!==Re.current)return!1;if(!p(Ye.current))return!1;if(Fe.current)return!1;const t=await fr(()=>oe.saveLayout(e,r,De.current,tr.current));if(t.ok)return De.current=t.value.version??De.current,We(!1),!0;const o=q.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Ye.current=e,Ve(e),!1}const u=q.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&oe.rereadVersion){const n=await fr(()=>oe.rereadVersion(e));if(n.ok&&n.value)return De.current=n.value,Ke.current(e,r,!0)}ze(),Fe.current=u,Te(u)}return We(i(t.error,z)?.status===c),!1},[oe,fr,ze,z]);C(()=>{Ke.current=kr},[kr]);const vr=O(e=>{if(null!==Re.current)return;if(cr("storefront-editor:dirty"),!ke)return;const r=ae(e);Ce.current=r,p(Ye.current)?xe({id:ke,data:r}):Ue({id:ke,data:r})},[ke,cr,Ue,xe,ae]),gr=O(async()=>{p(Ye.current)&&nr();return await Ge()&&null==Be.current},[nr,Ge]),pr=H(gr);C(()=>{pr.current=gr},[gr]);const hr=H(fr);C(()=>{hr.current=fr},[fr]);const yr=O(()=>{Q.address.reload()},[Q]),wr=H(()=>Promise.resolve(!1));C(()=>{wr.current=()=>{const e=oe.rereadVersion;return ke&&e?y({ours:De.current,stored:async()=>{const r=await hr.current(()=>e(ke));return r.ok?r.value:null},hasPending:()=>null!=Be.current||$e(),reload:yr}):Promise.resolve(!1)}},[oe,ke,$e,yr]);const Sr=null!==Pe;C(()=>{if(!fe||!ke||!de||Sr)return;let e=!1,r=null,n=null;const t=tr.current,o={claim:async e=>{const r=await hr.current(()=>fe.claim(ke,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Ye.current,heldWrite:()=>({pending:null!=Be.current||$e(),autoSaveEnabled:!er.current.paused,saveConflict:null!=Fe.current}),setAccess:e=>{Ye.current=e,Ve(e)},releaseHeldWrite:()=>{pr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{wr.current()}},u=q.makeClaimBeat(o),a=ar.current;return ar.current=!1,a||(Ve({kind:"checking"}),n=setTimeout(()=>{n=null,w(o)&&o.startHeartbeat(S)},b)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),fe.release(ke,t).catch(()=>{})}},[ke,fe,de,ie,or,Sr]);const br=O(()=>{fe&&ke&&(ar.current=!0,ur(e=>e+1))},[ke,fe]),Ir=O(()=>{Ve(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),Pr=O(()=>{er.current.paused?(p(Ye.current)&&nr(),Qe()):Je()},[nr,Je,Qe]),jr=O(()=>{qe()},[qe]),Rr=O(e=>{Ce.current=null,a("template"!==e.kind&&me,{resetAutosave:()=>{_e(),Be.current=null,Oe(!1)},setVersion:e=>{De.current=e},setSaveConflict:Te,setAccess:Ve}),Y(e),J(e),Re.current=null,je(null),ve(null),pe(null),ye(null),Se(null),Q.address.show(e),"document"!==e.kind&&K(e)&&Q.send("storefront-editor:navigated",{target:e})},[_e,Q,me,Y,K]),Br=O(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,se.current,F))return;const r=null!=Be.current;if(!r&&!$e())return void Rr(e);const n=er.current;r||n.paused||n.failed||n.stopped?Ae(e):Ge().then(r=>{r?Rr(e):Ae(e)})},[Rr,$e,Ge,F]),Er=O(()=>Ae(null),[]),Or=O(()=>{Ae(e=>(e&&Rr(e),null))},[Rr]),Cr=O(async()=>{const e=He;if(!e)return;await gr()&&(Ae(null),Rr(e))},[He,gr,Rr]),Hr=O(async e=>{if(null!==Re.current)return;if(!ke)return;if(!p(Ye.current)||Fe.current)return;const r=ae(e);if(!await kr(ke,r))return void(Fe.current||cr("storefront-editor:save-failed"));const n=oe.publish;if(!ue.canPublish||!n)return void cr("storefront-editor:saved");const t=await fr(()=>n(ke,De.current??void 0));if(!t.ok){const{error:e}=t;return void cr("storefront-editor:publish-failed",{reason:e instanceof Error&&e.message?e.message:null})}De.current=t.value.version??De.current,cr("storefront-editor:published")},[ke,oe,ue.canPublish,cr,kr,fr,ae]);/* @__PURE__ */
|
|
2
|
-
return A(M.Provider,{value:{target:G,adapter:oe,capabilities:ue,templateId:ee,currentSlug:re,currentKind:ge,siteId:ne,ready:de,token:ie,tokenRef:le,notifyParent:cr,bridgeCapabilities:ce,runAuthed:mr,docId:ke,data:he,getLiveData:()=>Ce.current??he,error:Ie,redirecting:sr,saveStatus:rr,saveState:Ze,autoSaveEnabled:!Ze.paused,autoSaveStoppedByConflict:Ze.stopped,hasUnsavedEdits:Ze.pending||Ee,toggleAutoSave:Pr,retrySave:jr,onChange:vr,flushSave:gr,onPublish:Hr,access:Le,readOnly:null!==I(Le)||null!==Pe||null!==Me,readOnlyReason:Pe,takeOverEditing:br,viewReadOnly:Ir,saveConflict:Me,saveUnreachable:Ne,reloadFromServer:yr,navigate:Br,pendingNav:He,cancelPendingNav:Er,discardAndNavigate:Or,saveAndNavigate:Cr},children:N})}export{M as ScreenDocumentContext,N as ScreenDocumentProvider,T as useScreenDocument};
|
package/dist/chunk-NA3GMA43.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{usePickFollowsSelection as n}from"./chunk-FHCKFOCD.js";import{slotFieldsOf as e}from"./chunk-PLVEGYK6.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-7L3NKHEC.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:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(n,t,r){const i=n.slotsOf?.(r);return i||e(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h=()=>k,v=()=>"",g=()=>null,y=()=>{},b={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},O={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},L={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},j={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},w={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function C(){/* @__PURE__ */
|
|
2
|
-
return s(t,{height:"fill"})}function S(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
|
|
3
|
-
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var D=o({});function F({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return s(D.Provider,{value:n,children:e})}function N(){return u(D)}function P(){return(N().useOwnerName??v)()}function G(){return(N().useDocumentLabel??g)()}function H(n,e,t,r){return(N().useBridges??h)(n,e,t,r)}function K(n){return(N().useStandaloneBridges??h)(n)}function x(n,e){(N().useDocumentPass??y)(n,e)}function B(){return N().blockRules??b}function I(){return N().blockLook??O}function T(){return N().devices??L}function V(){return N().leftView??j}function A(){return N().pinned??w}function E(){return N().saveSwitch??!0}function R(e){n(!0===N().pickFollowsSelection,e)}function Y(){return N().storageNamespace||void 0}function W(){return N().styleClipboard??null}function Z(){return N().nodeKeys??!0}function q(){return N().notify??null}function z(){return N().Canvas??C}function J(){return N().CanvasHead??null}function M(){return N().canvasDrag??null}var Q=o(null);function U({target:n,children:e}){/* @__PURE__ */
|
|
5
|
-
return s(Q.Provider,{value:n,children:e})}function X(){return u(Q)}function $(){return N().Inspector??S}export{c as SELECTION_MODE,U as ScreenCanvasTargetProvider,F as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,I as useScreenBlockLook,B as useScreenBlockRules,H as useScreenBridges,M as useScreenCanvasDrag,z as useScreenCanvasFrame,J as useScreenCanvasHead,X as useScreenCanvasTarget,T as useScreenDevices,G as useScreenDocumentLabel,x as useScreenDocumentPass,$ as useScreenInspectorPanel,V as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,P as useScreenOwnerName,N as useScreenParts,R as useScreenPickFollowsSelection,A as useScreenPinned,E as useScreenSaveSwitch,Y as useScreenStorageNamespace,W as useScreenStyleClipboard,K as useStandaloneScreenBridges};
|
package/dist/chunk-OBWDHKLI.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as o}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as l}from"./chunk-BVN33R76.js";import{sharedSectionsOf as r}from"./chunk-43AEUUNQ.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-SINAM2IT.js";import{blockRuns as c}from"./chunk-M2Z775ZC.js";import{useScreenBlockLook as a,useScreenBlockRules as d,useScreenPinned as p}from"./chunk-NA3GMA43.js";import{useEaselSession as m}from"./chunk-O7Q4DDJT.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-EB6NI2VK.js";import{useEasel as u}from"./chunk-7L3NKHEC.js";import{easelMenuEntries as y}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-2M4T27BI.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 T}from"efficient-shell/icons/efficient";import{ContextMenu as I,toast as N,Dialog as A,Button as E}from"efficient-shell/ui";import{jsx as M,jsxs as $,Fragment as x}from"react/jsx-runtime";function B({name:e,pages:t,onDelete:n,onCancel:o}){const l=h("screen",f).shared,[r,i]=b(!1),s=C(null);/* @__PURE__ */
|
|
2
|
-
return M(A,{open:!0,role:"alertdialog",size:"sm",title:l.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */$(x,{children:[
|
|
3
|
-
/* @__PURE__ */M(E,{ref:s,variant:"secondary",onClick:o,children:l.cancel}),
|
|
4
|
-
/* @__PURE__ */M(E,{variant:"danger",loading:r,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:l.deleteShared})]}),children:l.deleteMessage({count:t})})}var O=e=>`section:${e}`,F=e=>`block:${e}`,S=e=>`template:${e}`,D=e=>`shared:${e}`;function L({at:C,placeBlocks:A,canTake:E,onPick:L,itemFor:V,session:z,siteWide:H,onClose:P,onHide:Q,readOnly:K}){const R=u(e=>e.config),U=a(),{labelAtLevel:W,categoryLabel:Y,firstSection:Z,Icon:G,Thumbnail:_}=U,{blockIsOffered:J,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=>J(e,te);return l(te).list().then(n=>{if(e)return;const l=R.components;oe(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[R,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=>J(e,te);return r(te).list().then(n=>{if(e)return;const l=R.components;se(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[R,te,ce]);const[de,pe]=b(null),[me,fe]=b(null),ue=j(()=>e(R,U),[R]),ye=e=>W(e,"section",R.components[e]?.label??e),he=e=>({type:O(e.type),label:e.name,cover:/* @__PURE__ */M(_,{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__ */M("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */M(G,{type:e,size:26})}),be=j(()=>{const e=t(ue,Z),o=/* @__PURE__ */new Map,l=e=>{e.retired||o.has(e.type)||!J(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))}A?.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:D(e.id),label:e.title,cover:/* @__PURE__ */M(_,{type:e.node.type}),mark:/* @__PURE__ */M(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:S(e.id),label:e.name,cover:/* @__PURE__ */M(_,{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(R.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(R,t,Y),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)})}),!E)return d;const u=d.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ke(e.type),n=t?E(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,R,q,E,A,te]);/* @__PURE__ */
|
|
5
|
-
return $(x,{children:[
|
|
6
|
-
/* @__PURE__ */M(i,{icon:/* @__PURE__ */M(T,{size:15}),title:q.title,context:q.contextAll,actions:/* @__PURE__ */M(s,{label:q.done,description:q.doneDescription,onClick:P}),onHide:Q}),
|
|
7
|
-
/* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
|
|
8
|
-
/* @__PURE__ */M(k,{groups:be,session:z,itemFor:e=>V(ke(e)??{kind:"section",type:e}),onInsert:L?e=>{const t=ke(e);t&&L(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}),H??null]}),de?/* @__PURE__ */M(I,{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__ */M(B,{name:me.title,pages:me.used_on.length,onDelete:()=>(async e=>{try{await r(te).remove(e.id)}catch{return void N.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{L as AddSidePanel,F as blockKey,O as sectionKey,D as sharedKey,S as templateKey};
|
package/dist/chunk-Q2A7RHG2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-FOHHXSOL.js";import{SELECTION_MODE as e}from"./chunk-NA3GMA43.js";import{decodePartId as r,encodePartId as t}from"./chunk-IYT6NN2J.js";import{useEasel as n}from"./chunk-7L3NKHEC.js";import{usePreviewParts as p}from"./chunk-I54UCYOU.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&I.select(r)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
|
package/dist/chunk-QIDRJH3S.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as t,useEffect as e,useRef as n}from"react";var o=/* @__PURE__ */new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);function r(t){const e=t;if(!e||"string"!=typeof e.tagName)return!1;const n=e.tagName.toUpperCase();if("TEXTAREA"===n||"SELECT"===n)return!0;if("INPUT"===n)return!o.has(String(e.type??"text").toLowerCase());if(e.isContentEditable)return!0;const r=e.closest?.("[contenteditable]");return!(!r||"false"===r.getAttribute("contenteditable"))||null!=e.closest?.('[role="textbox"]')}var i="data-puck-component";function c(t,e=i){const n=t;return n&&"function"==typeof n.closest?n.closest(`[${e}]`)?.getAttribute(e)??null:null}function u(t){const e=t.getBoundingClientRect();if(e.width>0&&e.height>0)return{left:e.left,top:e.top,width:e.width,height:e.height};let n=1/0,o=1/0,r=-1/0,i=-1/0;for(const e of Array.from(t.children)){const t=e.getBoundingClientRect();t.width<=0||t.height<=0||(n=Math.min(n,t.left),o=Math.min(o,t.top),r=Math.max(r,t.right??t.left+t.width),i=Math.max(i,t.bottom??t.top+t.height))}return n===1/0?{left:e.left,top:e.top,width:e.width,height:e.height}:{left:n,top:o,width:r-n,height:i-o}}function l(t){const e=t.offsetWidth;if(!e)return 1;const n=t.getBoundingClientRect().width;return n>0?n/e:1}function s(t,e,n){const o=t.getBoundingClientRect(),r=n?.getBoundingClientRect()??{left:0,top:0},i=l(t);return{left:o.left-r.left+e.left*i,top:o.top-r.top+e.top*i,width:e.width*i,height:e.height*i}}function a(t){const e=t.offsetWidth;if(!e)return 1;const n=t.getBoundingClientRect().width;return n>0?n/e:1}function d(t,e,n){const o=s(t,e,n),r=a(n);return{left:o.left/r,top:o.top/r,width:o.width/r,height:o.height/r}}function f(t,e,n){const o=t.getBoundingClientRect(),r=a(t);return{x:(e-o.left)/r,y:(n-o.top)/r}}function h(t,e,n,o){const{left:r,top:i}=s(t,{left:e,top:n,width:0,height:0},o);return{x:r,y:i}}function m({available:t,width:e,maxScale:n=1}){const o=Math.max(0,t);if(!e||e<=0)return{width:o,scale:1,shownWidth:o};const r=o>0?Math.min(o/e,n):1;return{width:e,scale:r,shownWidth:e*r}}var w="data-es-canvas-style",g=/* @__PURE__ */new WeakMap;function p(t,e){e?g.set(t,e):g.delete(t)}function b(t,e,n){const o=t.head??t.documentElement;let r=y(t,e);if(!r){r=t.createElement("style"),r.setAttribute(w,e);const n=g.get(t);n&&r.setAttribute("nonce",n),o.appendChild(r)}return r.textContent!==n&&(r.textContent=n),r}function v(t,e){y(t,e)?.remove()}function y(t,e){for(const n of Array.from(t.querySelectorAll(`style[${w}]`)))if(n.getAttribute(w)===e)return n;return null}var E="[data-puck-component]",A="[data-puck-dropzone]",C="iframe#preview-frame";function L(t){const e=t.contentDocument;if(!e||!t.contentWindow||"loading"===e.readyState||!e.body)return!1;if(t.hasAttribute("srcdoc"))return"about:srcdoc"===e.URL;const n=t.getAttribute("src");return!n||"about:blank"===n||"about:blank"!==e.URL}function x(t,e,{selector:n=C,readySelector:o}={}){let r=null,i=null,c=!1,u=!1,l=null;const s=()=>{l?.observer.disconnect(),l=null},a=()=>{if(u)return;let t=null;if(r&&L(r)){const e=r.contentDocument;(t=>{if(!o||t.querySelector(o))return s(),!0;if(l?.doc!==t){s();const e=t.defaultView?.MutationObserver;if(e){const n=new e(()=>a());n.observe(t,{childList:!0,subtree:!0}),l={doc:t,observer:n}}}return!1})(e)&&(t={frame:r,document:e,window:r.contentWindow})}else s();(t===i||!!t&&!!i&&t.frame===i.frame&&t.document===i.document)&&c||(c=!0,i=t,e(i))},d=()=>a(),f=()=>{const e=t.querySelector?.(n);e!==r?(r?.removeEventListener("load",d),r=e,r?.addEventListener("load",d),a()):a()},h=t.ownerDocument?.defaultView??t.defaultView,m=h?.MutationObserver,w=m?new m(t=>(t=>null!==r&&!r.isConnected||t.some(t=>[...t.addedNodes,...t.removedNodes].some(t=>"IFRAME"===t.nodeName||!!t.querySelector?.("iframe"))))(t)&&f()):null;return w?.observe(t,{childList:!0,subtree:!0}),f(),()=>{u=!0,w?.disconnect(),s(),r?.removeEventListener("load",d),r=null}}function M(n,{selector:o,readySelector:r}={}){const[i,c]=t(null);return e(()=>{const t=n.current;if(!t)return;const e=x(t,c,{selector:o,readySelector:r});return()=>{e(),c(null)}},[n,o,r]),i}var R="easel:canvas-typing",S="easel:canvas-typable";function B(t,o,r,{on:i="document",capture:c=!1}={}){const u=n(r);u.current=r;const l=t?.document??null,s=t?.window??null;e(()=>{const t="window"===i?s:l;if(!t)return;const e=t=>u.current(t);return t.addEventListener(o,e,c),()=>t.removeEventListener(o,e,c)},[l,s,o,i,c])}function k(e){const[n,o]=t(!1);return B(e,R,t=>o(Boolean(t.detail?.typing))),n}function W(t,n,o){const r=t?.document??null;e(()=>{if(!r)return;if(!o)return void v(r,n);const t=b(r,n,o),e=r.defaultView?.MutationObserver,i=e?new e(()=>{t.isConnected||b(r,n,o)}):null;return i?.observe(r.head??r.documentElement,{childList:!0}),()=>{i?.disconnect(),v(r,n)}},[r,n,o])}function q(n,{settle:o=[150,450]}={}){const[r,i]=t(0),c=n?.frame??null,u=n?.document??null,l=n?.window??null,s=o.join(",");return e(()=>{if(!c||!u||!l)return;const t=c.ownerDocument.defaultView;let e=!1,n=0;const r=()=>{if(e)return;e=!0;const o=()=>{e=!1,i(t=>t+1)};t?.requestAnimationFrame?n=t.requestAnimationFrame(o):o()},s=[],a=(t,e)=>{t.addEventListener(e,r,!0),s.push(()=>t.removeEventListener(e,r,!0))};a(u,"scroll"),a(l,"resize"),t&&(a(t,"scroll"),a(t,"resize"));const d=t?.ResizeObserver;if(d){const t=new d(r);t.observe(c),u.documentElement&&t.observe(u.documentElement),s.push(()=>t.disconnect())}const f=u.defaultView?.MutationObserver,h=u.body??u.documentElement;if(f&&h){const t=new f(r);t.observe(u===c.ownerDocument?c:h,{childList:!0,subtree:!0}),s.push(()=>t.disconnect())}const m=u.fonts;m&&a(m,"loadingdone");const w=o.map(t=>setTimeout(r,t));return r(),()=>{for(const t of s)t();for(const t of w)clearTimeout(t);n&&t?.cancelAnimationFrame&&t.cancelAnimationFrame(n)}},[c,u,l,s]),r}export{i as BLOCK_ATTRIBUTE,E as BLOCK_SELECTOR,C as CANVAS_SELECTOR,S as CANVAS_TYPABLE_EVENT,R as CANVAS_TYPING_EVENT,A as LIST_SELECTOR,f as clientPointToLayer,u as drawnBox,a as elementScale,m as fitCanvas,h as framePointToHost,s as frameRectToHost,d as frameRectToLayer,l as frameScale,L as isFrameReady,r as isTypingTarget,c as nodeIdAt,v as removeCanvasStyle,p as setCanvasNonce,b as upsertCanvasStyle,B as useCanvasEvent,M as useCanvasFrame,q as useCanvasLayout,W as useCanvasStyle,k as useCanvasTyping,x as watchCanvasFrame};
|
package/dist/chunk-RSCMJIWS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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/puck/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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{blockRuns,offeredChoices}from"../../../chunk-M2Z775ZC.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{blockTypesIn}from"../../../chunk-5ZBY24K7.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{BUCKET_KEY,DESIGN_GROUP_KEY}from"../../../chunk-MQNBD6AB.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{hidableText,readHidable}from"../../../chunk-6W7WLPZH.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{panelFieldsOf}from"../../../chunk-LER7RKTO.js";import"../../../chunk-BPXEFVSQ.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{PART_SEP,decodePartId,encodePartId}from"../../../chunk-IYT6NN2J.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{isPreviewClick,runAsPreviewClick}from"../../../chunk-R5L2E7JX.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{HERO_SLIDER_GOTO_EVENT}from"../../../chunk-IQ5TA7AM.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../../../chunk-BHRC3ASL.js";import"../../../chunk-6W7WLPZH.js";import"../../../chunk-DUVRZ456.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{dedupeSlotChildren}from"../../../chunk-26OOWIJJ.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-R4QJ6DC5.js";import"../../../chunk-LER7RKTO.js";import"../../../chunk-MSGZ56QL.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-MQNBD6AB.js";import"../../../chunk-EB6NI2VK.js";import"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-DUVRZ456.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-BSPCSC45.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-FOHHXSOL.js";import"../../../chunk-NA3GMA43.js";import"../../../chunk-FHCKFOCD.js";import"../../../chunk-MQA7OFRA.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-7L3NKHEC.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YHFKWV7H.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-WHS6Y55E.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-ZEH6QLBH.js";import"../../../chunk-IWCKVZHS.js";import"../../../chunk-FIVU2COQ.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-BSHIQIZC.js";import"../../../chunk-MZ5GSSZ3.js";import"../../../chunk-KRL3IUV3.js";import"../../../chunk-Y2T3JX7K.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-S3DUFDQ6.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-3S5N4HLJ.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-K7BTCBWD.js";import"../../../chunk-L55YIXDC.js";import"../../../chunk-QIDRJH3S.js";import"../../../chunk-LF3FUSCQ.js";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|