efficient-easel 3.7.0 → 5.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 +13 -0
- package/dist/buckets-Tj-nkBpg.d.ts +28 -0
- package/dist/chrome/chrome.css +30 -2
- package/dist/chrome/index.js +1 -1
- package/dist/chunk-37DMJPHL.js +14 -0
- package/dist/chunk-3GX7XBAF.js +5 -0
- package/dist/chunk-3ZJSLHHI.js +8 -0
- package/dist/chunk-4JSBIW5H.js +9 -0
- package/dist/{chunk-42TMLDSQ.js → chunk-6TOYXESC.js} +1 -1
- package/dist/chunk-BXQBCW3P.js +1 -0
- package/dist/{chunk-CRG625FM.js → chunk-C7ERK4DF.js} +3 -3
- package/dist/chunk-CRWFB7MU.js +21 -0
- package/dist/{chunk-RKSKUGWC.js → chunk-ETDRAF3O.js} +65 -65
- package/dist/{chunk-LZ6EGT4Y.js → chunk-G5JILVHG.js} +1 -1
- package/dist/{chunk-2I7MAA2U.js → chunk-HQWQLDCB.js} +1 -1
- package/dist/{chunk-XBNOEQMR.js → chunk-I7ER3P4U.js} +1 -1
- package/dist/chunk-KFV7N2DJ.js +1 -0
- package/dist/{chunk-SCPCXNTB.js → chunk-KJ2RODGT.js} +1 -1
- package/dist/chunk-KSTX646X.js +5 -0
- package/dist/chunk-MQNBD6AB.js +1 -0
- package/dist/{chunk-5SOSVTVI.js → chunk-PFNIVZPN.js} +1 -1
- package/dist/{chunk-6N64PNWF.js → chunk-RQWJOPRB.js} +1 -1
- package/dist/{chunk-GTDLBUOC.js → chunk-UB4TLWVJ.js} +6 -6
- package/dist/{chunk-MUZNA23W.js → chunk-UQ6CD3K2.js} +1 -1
- package/dist/{chunk-WSNVBUPL.js → chunk-Y324X4U4.js} +1 -1
- package/dist/drag/drag.css +5 -56
- package/dist/drag/index.js +1 -1
- package/dist/easel/index.d.ts +2 -2
- package/dist/fields/fields.css +4 -0
- package/dist/fields/index.d.ts +103 -51
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +8 -2
- package/dist/panel/index.js +19 -12
- package/dist/panel/panel.css +19 -0
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +15 -15
- package/dist/screen/components/SidePanelHead.js +1 -1
- package/dist/screen/components/panel-widths.js +1 -1
- package/dist/screen/components/usePartBridge.d.ts +1 -1
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/puck/field-buckets.d.ts +20 -6
- package/dist/screen/lib/puck/field-buckets.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +15 -6
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/screen.css +9 -42
- package/dist/strings/catalogue.d.ts +2 -2
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +2 -2
- package/dist/strings/index.js +1 -1
- package/dist/tree/index.d.ts +8 -4
- package/dist/tree/index.js +1 -1
- package/dist/tree/tree.css +6 -3
- package/dist/{types-BqGnUVX5.d.ts → types-BLRK6_JO.d.ts} +7 -0
- package/dist/{types-CWxUxPGO.d.ts → types-OUl0mK1k.d.ts} +5 -2
- package/dist/{words-BGrHZAJJ.d.ts → words-zH1H0WFw.d.ts} +8 -3
- package/package.json +3 -3
- package/dist/buckets-CuLM47h9.d.ts +0 -13
- package/dist/chunk-2GLQRNYT.js +0 -16
- package/dist/chunk-7P6IFCR4.js +0 -1
- package/dist/chunk-CRPJGCSO.js +0 -20
- package/dist/chunk-LUSM3QTY.js +0 -5
- package/dist/chunk-QTLAVDJE.js +0 -1
- package/dist/chunk-R2HLPNQF.js +0 -1
- package/dist/chunk-UFY6RNMT.js +0 -9
- package/dist/chunk-YIKMVF24.js +0 -5
- package/dist/chunk-YNOZ5NXW.js +0 -14
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-
|
|
2
|
-
return
|
|
3
|
-
return
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
return
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
return new Set}});yn(()=>{try{window.localStorage.setItem(Zo,JSON.stringify([...nr]))}catch{}},[nr]);const[or,rr]=gn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(er);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});yn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(er,JSON.stringify(or))}catch{}},300);return()=>clearTimeout(e)},[or]);const ir=kn((e,n)=>rr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),lr=kn(e=>ir("left",e),[ir]),sr=kn(e=>ir("right",e),[ir]),dr=e=>nr.has(e),cr=e=>tr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),ar=hn(!1),pr=hn(null);yn(()=>{if(ar.current&&!ro){const e=pr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??no.current?.querySelector(`button[aria-label="${CSS.escape(kt.add.title)}"]`))?.focus(),pr.current=null}ar.current=ro},[ro]),yn(()=>{if(!ro||!oo)return;const e=e=>{"Escape"===e.key&&
|
|
13
|
-
return
|
|
14
|
-
return
|
|
15
|
-
return
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
return
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
return
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
return
|
|
22
|
-
return
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
return
|
|
25
|
-
return
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
return
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
return
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
1
|
+
import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-BXQBCW3P.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-VZGLBEAE.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-6TOYXESC.js";import{usePartBridge as v}from"./chunk-RQWJOPRB.js";import{useSectionOps as w}from"./chunk-I7ER3P4U.js";import{useNodeClipboard as x,useNodeContextMenu as b}from"./chunk-MTRFMGBO.js";import{PageEditGuardNotices as z}from"./chunk-HQWQLDCB.js";import{useScreenDocument as B}from"./chunk-WZMU646D.js";import{requestMediaPick as C}from"./chunk-KG7RJWOK.js";import{heldStyle as O,styleShortcut as N}from"./chunk-V7U33NF2.js";import{AddChildRow as I}from"./chunk-5545A3PC.js";import{AddSidePanel as P}from"./chunk-3GX7XBAF.js";import{SidePanelHead as T,PanelShowStrip as $}from"./chunk-PFNIVZPN.js";import{MediaSidePanel as A}from"./chunk-KJ2RODGT.js";import{useScreenSaveSwitch as M,useScreenNodeKeys as j,useScreenPinned as R,useScreenDocumentLabel as E,useScreenCanvasFrame as L,useScreenInspectorPanel as V,useScreenDevices as F,useScreenPickFollowsSelection as W,useScreenLeftView as D,useScreenAdd as H,SELECTION_MODE as U,sameInspectorMode as G,useScreenBridges as J,useScreenBlockRules as X,useScreenBlockLook as Y,useScreenStorageNamespace as K,useScreenNotify as Q,useScreenCanvasHead as _,isSlotMode as q,useScreenStyleClipboard as Z,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-KSTX646X.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-MCHMF32I.js";import{useEasel as we,useEaselApi as xe}from"./chunk-XW4AV5N4.js";import{TreeRow as be,Subtree as ze,LayersTree as Be,TreeGroupLabel as Ce,TreeRowAction as Oe,TreeSeam as Ne}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as Ie}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Pe}from"./chunk-WK3AFPXY.js";import{toItemSelector as Te,useNodeOps as $e,clickPick as Ae}from"./chunk-UK2FQOUT.js";import{LayersIcon as Me,MediaIcon as je}from"./chunk-4VJATVVR.js";import{DEFAULT_SAVE_WORDS as Re,saveIndicator as Ee}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Le,TopBarRail as Ve,TopBarCluster as Fe,EaselIconButton as We,TopBarDivider as De,DeviceSwitch as He,InspectorIconButton as Ue,PanelResizeHandle as Ge,MAX_PANEL_W as Je,MIN_PANEL_W as Xe,panelWidthVars as Ye,SaveState as Ke,SaveStateToggle as Qe}from"./chunk-UB4TLWVJ.js";import{DEFAULT_CHROME_WORDS as _e}from"./chunk-Y2G7CU6A.js";import{useWords as qe}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as Ze}from"./chunk-37DMJPHL.js";import{DEFAULT_DRAG_WORDS as en}from"./chunk-O2NLQBFX.js";import{createDragSession as nn,useTreeDrag as tn,gapToMoveIndex as on}from"./chunk-67GNT6PF.js";import{useCanvasFrame as rn,BLOCK_SELECTOR as ln,useCanvasEvent as sn}from"./chunk-PAELDYYS.js";import{zoneKey as dn,ROOT_ID as cn,ROOT_SLOT as an,parseZoneKey as pn,DataError as un,find as fn}from"./chunk-KRXQM65X.js";import{useRef as hn,useMemo as mn,useState as gn,useEffect as yn,useCallback as kn,useLayoutEffect as Sn,Fragment as vn}from"react";import{Tooltip as wn,Button as xn,toast as bn}from"efficient-shell/ui";import{UndoIcon as zn,RedoIcon as Bn,TrashIcon as Cn,EyeOffIcon as On,EyeIcon as Nn,DuplicateIcon as In}from"efficient-shell/icons/efficient";import{jsx as Pn,jsxs as Tn,Fragment as $n}from"react/jsx-runtime";function An({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i,words:l,saveWords:s}){if(null!==t)/* @__PURE__ */return Pn(Ke,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
|
|
2
|
+
return Pn(Ke,{tone:e.pending?"off-unsaved":"off",label:l.notSaving,role:"status"});const{tone:d,label:c}=Ee(e,s),a=e.failed&&!e.paused&&/* @__PURE__ */Pn(xn,{variant:"secondary",size:"sm",onClick:i,children:l.retry});/* @__PURE__ */
|
|
3
|
+
return Tn($n,o?{children:[
|
|
4
|
+
/* @__PURE__ */Pn(Qe,{pressed:e.paused,onToggle:r,title:e.paused?l.autoSaveOff:l.autoSaveOn,children:/* @__PURE__ */Pn(Ke,{tone:d,label:c})}),a]}:{children:[
|
|
5
|
+
/* @__PURE__ */Pn(Ke,{tone:d,label:c,role:"status"}),a]})}function Mn({expand:e}){/* @__PURE__ */
|
|
6
|
+
return Pn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Tn($n,e?{children:[
|
|
7
|
+
/* @__PURE__ */Pn("path",{d:"M8 9l4-4 4 4"}),
|
|
8
|
+
/* @__PURE__ */Pn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
9
|
+
/* @__PURE__ */Pn("path",{d:"M8 4l4 4 4-4"}),
|
|
10
|
+
/* @__PURE__ */Pn("path",{d:"M8 20l4-4 4 4"}),
|
|
11
|
+
/* @__PURE__ */Pn("path",{d:"M5 12h14"})]})})}function jn(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var Rn="__rungs";var En="screen:band",Ln={duplicate:!0,delete:!0};function Vn(){const Ee=ye(),{target:Ke,docId:Qe,capabilities:Vn,currentSlug:Fn,siteId:Wn,onPublish:Dn,saveState:Hn,saveConflict:Un,retrySave:Gn,toggleAutoSave:Jn,readOnly:Xn,readOnlyReason:Yn=null}=B(),Kn=M(),Qn=j(),{mediaEditing:_n,hasEditGuard:qn,hasPinnedChrome:Zn}=Vn,{appState:et,dispatch:nt,history:tt,selectedItem:ot,getSelectorForId:rt,config:it}=we(e=>e),lt=R(),{first:st,firstGroup:dt,lastGroup:ct,isSectionGroup:at,sectionGroupZone:pt,panelOf:ut}=lt,ft=ut(st),ht=e=>oe(lt,e),mt=e=>re(lt,e),gt="node"===lt.firstRow,yt=lt.band??null,kt=qe("screen",ve),St=qe("tree",Ie),vt=qe("drag",en),wt=qe("save",Re),xt=qe("menu",Pe),bt=qe("styleClipboard",Se),zt=qe("chrome",_e),Bt=E()??`/${Fn}`,Ct=L(),Ot=V(),Nt=w({readOnly:Xn}),It=w({readOnly:Xn,foldIntoHistory:!0}),Pt=hn(null),Tt=xe(),$t=mn(()=>({...Nt,select:e=>{Pt.current=e,Nt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Tt.config;Pt.current=Te(e,t,n)}Nt.commitDocument(e,n)}}),[Nt,Tt]),At=et.ui,Mt=At.leftSideBarVisible,jt=At.rightSideBarVisible,{options:Rt,widths:Et,initial:Lt,fluid:Vt,fit:Ft}=F(),[Wt,Dt]=gn(Lt),Ht=he(),Ut=_n&&null!==Ht,Gt=me(),Jt=ge();W(ot?.props.id);const{read:Xt,write:Yt,forSelection:Kt}=D(),[Qt,_t]=gn(Xt);yn(()=>{Yt(Qt)},[Qt]);const[qt,Zt]=gn(0),eo=hn(null),no=hn(null),to=rn(no,{readySelector:ln}),oo=f(no);h(no,to);const[ro,io]=gn(!1),lo=hn(!1),so=hn(!1),[co,ao]=gn(null),po=H(),uo=e=>ao(null===e?null:{zone:le,index:e}),[fo,ho]=gn([]),[mo,go]=gn(U),yo="puck"===mo.kind,ko=ro&&!co&&po.railTarget?po.railTarget(et.data,{node:ot??null,mode:mo}):null,So=ko?{zone:dn(ko),index:ko.index}:null,vo=co??So,wo=vo&&vo.zone===le?vo.index:null,xo=t(mo,ot?.props.id),[bo,zo]=gn(null);yn(()=>{bo&&(o(),zo(null))},[bo]);const Bo=hn(rt);Bo.current=rt;const Co=kn((e,{scroll:n})=>{_t(n=>Kt(e,n)),n&&zo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Bo.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&tr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Oo=hn(null);yn(()=>{const e=Oo.current;Oo.current=null;const n=null==ot?.props.id?null:String(ot.props.id);go(e&&e.id===n?e.mode:ut(ot?.type)??U);const t=ot?.props.id,o=Pt.current;if(Pt.current=null,!t)return;const i=rt(t);Co(String(t),{scroll:!r(o,i??null,le)})},[ot?.props.id,Co]);const No=kn(e=>{go(n=>G(n,e)?n:e),nt({type:"setUi",ui:{rightSideBarVisible:!0}})},[nt]),Io=hn(()=>{});Io.current=(e,n)=>{const t=e?Xr(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==ot?.props.id?null:String(ot.props.id);go(e=>G(e,n)?e:n),o!==r&&(Oo.current={id:o,mode:n},$t.select(e))};const Po=kn((e,n)=>Io.current(e,n),[]),To={kind:mo.kind,mode:mo,open:No,show:e=>go(e),reveal:()=>{jt||nt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Po},$o=J(To,{data:et.data,selected:ot??null,zoneOf:e=>rt(e)?.zone,readOnly:Boolean(Xn),select:e=>{go(U),$t.select({index:e})},replace:(e,n)=>$t.replaceComponent(le,e,n),scrollTo:e=>ki(e)},{device:Wt,refreshes:qt},{setView:_t,reveal:()=>{Mt||nt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Ao=$o.pinnedSource??!1,Mo=$o.resolveLeftView?$o.resolveLeftView(Qt,Ut):"media"===Qt&&Ut?Qt:"sections",jo=X(),{isLockedBlock:Ro,duplicateBlocked:Eo,nestDepth:Lo,newSectionNode:Vo,canAddTo:Fo,blockIsOffered:Wo}=jo,Do=Y(),{labelAtLevel:Ho,Icon:Uo,useProducts:Go}=Do,Jo=Do.rowName?(e,n,t)=>Do.rowName(e,n,t):void 0,Xo=kn(e=>{nt({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),Co(e,{scroll:!0})},[nt,Co]),{selectNode:Yo,openPartId:Ko}=v({mode:mo,setMode:go,onOpenPart:Xo}),[Qo,_o]=gn(null);ke(null!==Qo,()=>_o(null));const qo=y(K()),Zo=qo.collapsed,er=qo.panelWidths,[nr,tr]=gn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Zo);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
12
|
+
return new Set}});yn(()=>{try{window.localStorage.setItem(Zo,JSON.stringify([...nr]))}catch{}},[nr]);const[or,rr]=gn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(er);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});yn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(er,JSON.stringify(or))}catch{}},300);return()=>clearTimeout(e)},[or]);const ir=kn((e,n)=>rr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),lr=kn(e=>ir("left",e),[ir]),sr=kn(e=>ir("right",e),[ir]),dr=e=>nr.has(e),cr=e=>tr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),ar=hn(!1),pr=hn(null);yn(()=>{if(ar.current&&!ro){const e=pr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??no.current?.querySelector(`button[aria-label="${CSS.escape(kt.add.title)}"]`))?.focus(),pr.current=null}ar.current=ro},[ro]),yn(()=>{if(!ro||!oo)return;const e=e=>{"Escape"===e.key&&Oi()};return oo.addEventListener("keydown",e),()=>oo.removeEventListener("keydown",e)},[ro,oo]),ke(ro,()=>Oi()),yn(()=>{!Mt&&ro&&(io(!1),ao(null),lo.current=!1)},[Mt]),yn(()=>{if(!Gt)return so.current&&nt({type:"setUi",ui:{leftSideBarVisible:!1}}),void(so.current=!1);ro&&(io(!1),ao(null),so.current=lo.current,lo.current=!1),Mt||(so.current=!0,nt({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Gt]),yn(()=>{!Mt&&Gt&&(so.current=!1,Jt())},[Mt]),yn(()=>{if(!Gt||!oo)return;const e=e=>{"Escape"===e.key&&Jt()};return oo.addEventListener("keydown",e),()=>oo.removeEventListener("keydown",e)},[Gt,oo]),ke(null!==Gt,()=>Jt());const ur=Q(),fr=(e,n="success")=>{ur?ur(e,"error"===n?"error":"info"):"error"===n?bn.error(e,{duration:3200,sound:!1}):bn.success(e,{duration:1900,sound:!1})},hr=hn(null),[mr,gr]=gn(0),[yr,kr]=gn(0),Sr=_(),vr=hn(null),wr=e=>Math.max(0,e.clientHeight-(vr.current?.offsetHeight??0));yn(()=>{const e=hr.current;if(!e)return;const n=()=>{gr(e.clientWidth),kr(wr(e))};n();const t=new ResizeObserver(n);return t.observe(e),vr.current&&t.observe(vr.current),()=>t.disconnect()},[]),Sn(()=>{hr.current&&(gr(hr.current.clientWidth),kr(wr(hr.current)))},[or,Mt,jt]);const xr=Wt===Vt?mr>0?mr:Et[Vt]:Et[Wt],br=mr>0?Math.min(mr/xr,"shrink"===Ft?1:2):1,zr=xr*br,Br=mr>0&&zr>mr+1,Cr={width:zr,height:yr||"100%",flex:"none",position:"relative"},Or={width:xr,height:yr?yr/br:"100%",maxHeight:"none",transform:1!==br?`scale(${br})`:void 0,transformOrigin:"top left"},Nr=()=>nt({type:"setUi",ui:{leftSideBarVisible:!Mt}}),Ir=()=>nt({type:"setUi",ui:{rightSideBarVisible:!jt}}),Pr=e=>{ro&&(io(!1),ao(null),lo.current=!1,Mt&&Qt===e)||Gt&&(so.current=!1,Jt(),Mt&&Qt===e)||(Mt&&Qt===e?Nr():(_t(e),Mt||nt({type:"setUi",ui:{leftSideBarVisible:!0}})))},Tr=()=>{C(Ee,{accept:"image/*",title:zt.mediaLibrary})},$r=()=>{go(U),$t.select(null),u()},Ar=()=>{go(ft??U),jt||nt({type:"setUi",ui:{rightSideBarVisible:!0}})},Mr=et.data.content??[],jr=()=>{const e=Mr.findIndex(ht),n=Mr.findIndex(mt);return{floor:e>=0?e+1:0,cap:n>=0?n:Mr.length}},Rr=it,Er=jo.stripCopy,Lr=e=>i(e,Er),Vr=x(),Fr=$e({data:et.data,config:Rr,readOnly:Boolean(Xn),clipboard:Vr,strip:Er?e=>Er(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==cn||e.slot!==an)return{min:0,max:n-1};const{floor:t,cap:o}=jr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&go(U);const t=void 0===n||"node"===n?.kind?n:null;$t.commitDocument(e,t)}}),Wr=e=>Ho(e,"block",it.components[e]?.label??e),Dr=kn(e=>it.components[e]?.defaultProps??{},[it]),Hr=e=>Ho(e,"section",Wr(e)),Ur=e=>l({type:e.type,props:e.props??{}},Hr(e.type),Jo),{nodeAddresses:Gr,zoneItems:Jr}=mn(()=>{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>=de)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ce(it,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(Mr,le,0),{nodeAddresses:e,zoneItems:n}},[Mr,it]),Xr=kn(e=>Jr.get(e)??[],[Jr]),Yr=e=>{const n=Gr.get(e);return n?Xr(n.zone)[n.index]:void 0},Kr=e=>ie(jo,it,e),Qr=e=>{if(!jo.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Yr(e.slice(0,n));if(!t)return null;const o=Kr(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}},_r=(()=>{if(!q(mo))return null;const e=`${mo.nodeId}:${mo.slot}`;return Qr(e)?.slot.panel===mo.kind?e:null})(),qr=hn(null);yn(()=>{const e=qr.current;if(qr.current=null,!_r||!q(mo))return;const n=mo.nodeId;Co(n,{scroll:e!==_r}),tr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[mo]);const Zr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Gr.get(e);n&&(n.zone===le?Si(n.index):Ki(n.zone,n.index,e,Yr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&_r!==i&&(qr.current=i),Po(null,r),jt||nt({type:"setUi",ui:{rightSideBarVisible:!0}}),ki(o)},ei=(e,n,t)=>{const o=`${e}:${n}`;if(tr(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;_r!==o&&(qr.current=o);Po(null,{kind:t,nodeId:e,slot:n})},ni=(e,n,t)=>{if(Xn||!jo.moveSlot)return;const o=Yr(e),r=o?Kr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Rn,index:n},s=on(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=jo.moveSlot(e,n,s);"string"==typeof d&&ei(e,d,i.panel)},ti=Go(),oi=mn(()=>{const e=/* @__PURE__ */new Map;for(const n of ti??[])e.set(n.slug,n.name);return e},[ti]),ri=e=>s(e,Wr,Do.plainText,e=>oi.get(e),Do.rowName),ii=(e,n)=>{const t=it.components[e.type]?.fields,o=n===le||fl(n)?"section":"block",r=n===le&&(ht(e)||mt(e)||at(e.type)),i="block"===o?d(t):r?null:c(t);return Do.renamePropOf?Do.renamePropOf(e,o,i):i},li=(e,n,t,o)=>{if(!(!Xn&&Qo?.zone===e&&Qo.index===n))return;const r=(t,o)=>{_o(null),o&&((e,n,t)=>{const o=Xr(e)[n];if(!o)return;const r=ii(o,e);r&&$t.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
13
|
+
return Pn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":kt.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)},si=n(Z(),bt),di=si.scope({target:Ke,siteId:Wn,docId:Qe}),ci=it,ai=(e,n)=>n===le?Hr(e):Wr(e),pi=(e,n,t)=>{const o=si.plan(di,t,ai(t.type,e),ci);o&&(o.changed&&$t.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),fr(o.message))},ui=b({nodesIn:Xr,nodeAt:(e,n)=>Xr(e)[n]??null,labelOf:(e,n)=>n===le?Hr(e):Wr(e),renamePropOf:ii,beginRename:(e,n)=>_o({zone:e,index:n}),history:{hasPast:tt.hasPast,hasFuture:tt.hasFuture,back:()=>tt.back(),forward:()=>tt.forward()},openAddSection:()=>{$t.select(null),Bi(null)},openPageSettings:()=>{$t.select(null),go(U)},pageSettingsLabel:kt.pageSettings,words:{menu:xt,styleClipboard:bt,screen:kt.menu},readOnly:Boolean(Xn),collapseAll:()=>tr(new Set(Xr(le).map(e=>String(e.props.id)))),onPasteRefused:e=>fr(e?kt.pasteRefused({name:e.label}):kt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>ml(e,n),menuRows:$o.menuRows,isLocked:e=>Ro(e.type),duplicateBlocked:e=>Eo(et.data,e),permits:e=>se(it,e.type),canAddTo:Fo,nodeOps:Fr,isPinned:(e,n)=>n===le&&(ht(e)||mt(e)),sectionBand:jr,openAddInside:(e,n)=>{e===le?Si(n):$t.select({zone:e,index:n}),Bi(null)},locate:e=>Gr.get(e)??null,rowNameOf:(e,n)=>n===le?Ur(e):ri(e),selectAt:(e,n,t,o)=>{e===le?Si(n):Ki(e,n,t,o??"")},slotRung:e=>{const n=Qr(e);return n?.slot.panel?{label:n.slot.label,select:()=>Zr(n.node,n.slot,!1)}:null},style:{held:()=>O(di),canCopy:e=>si.rows(ci,e).some(e=>!1!==e.counted),copy:(e,n)=>si.copy(di,e,ai(e.type,n),ci),paste:(e,n,t)=>pi(e,n,t)},keys:Qn?{target:oo,selected:()=>{const e=et.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>Vr.get(),readOnly:Boolean(Xn),onDone:({done:e,name:n})=>{"copied"===e&&fr(kt.copied({name:n}))}}:void 0},to),fi=hn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});yn(()=>{fi.current={copy:(e,n)=>si.copy(di,e,ai(e.type,n),ci),paste:pi,at:()=>{const e=et.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Xr(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Xn)}});const hi=kn(e=>{const n=N(e);if(!n)return;const t=fi.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))},[]);yn(()=>{if(!oo)return;const e=e=>hi(e);return oo.addEventListener("keydown",e),()=>oo.removeEventListener("keydown",e)},[hi,oo]),sn(to,"keydown",hi);const mi=Mr.map(e=>e.props.id).join("|");yn(()=>{const e=to?.document??null,n=to?.window??null;let t=0;const o=[],r=()=>{if(!e)return void ho(e=>e.length?[]:e);const n=Mr.findIndex(mt),t=n>=0?n:Mr.length,o=n=>{const t=Mr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(ln)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=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=jn(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}ho(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()}},[to,mi,Wt,br,Mt,jt,ot?.props.id]);const gi=to?.document??null,yi=to?.window??null;yn(()=>{const e=eo.current;if(!e||!gi||!yi)return;const n=[],t=()=>{const n=gi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&yi.scrollTo({left:yi.scrollX,top:yi.scrollY+t,behavior:"instant"}),!0};return eo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[gi,yi]);const ki=e=>{$o.holdCanvasOn?$o.holdCanvasOn(e):a(e)},Si=e=>{go(U),$t.select({index:e}),$o.sectionPressed?.(Mr[e]);const n=Mr[e]?.props?.id;n&&ki(n)},vi=e=>{const{floor:n,cap:t}=jr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=ot&&mo.kind!==ft?.kind?Mr.findIndex(e=>e.props.id===ot.props.id):-1;return o(r>=0?r+1:t)},wi=(e,n)=>{const{floor:t,cap:o}=jr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:($t.reorderComponent(le,e,i),$t.select({index:i}),{moved:!0,dest:i})},xi=(e,n,t,o)=>{go(U),$t.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),fr(kt.sectionAdded({name:t}))},bi=(e,n)=>{const t=vi(n),o=Vo(e,{nodeDefaults:Dr,newNodeId:fe,sectionLabel:Hr,blockIsOffered:Wo}),r=o?$t.insertNode(le,t,o):$t.insertSection(e,t);return xi(t,r,Hr(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:c}of ce(it,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Fo(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:c,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},zi=(e,n,t)=>{const o=vi(t),r=$t.insertNode(le,o,n);return xi(o,r,e),o},Bi=e=>Ci(le,e),Ci=(e,n)=>{pr.current=document.activeElement??null,Gt&&(lo.current=so.current,so.current=!1,Jt()),ao(null===n?null:{zone:e,index:n}),io(!0),Mt||(lo.current=!0,nt({type:"setUi",ui:{leftSideBarVisible:!0}}))},Oi=()=>{io(!1),ao(null),lo.current&&nt({type:"setUi",ui:{leftSideBarVisible:!1}}),lo.current=!1},Ni=(e,n,t)=>{if("section"===e.kind)$t.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;$t.insertNode(n,t,Lr(e.template.node))}go(U),$t.select({index:t,zone:n})},Ii=(e,n)=>Do.rowName?n?ht(e)?Do.rowName(e,"section",kt.header):mt(e)?Do.rowName(e,"section",kt.footer):at(e.type)?Do.rowName(e,"section",Wr(e.type)):Ur(e):ri(e):n?Hr(e.type):Wr(e.type),Pi=e=>n=>{e()},Ti=()=>$o.editPinnedSource?.(),$i=(e,n,t)=>{if(Xn)return null;const o=Xr(e)[n];return o&&!se(it,o.type).delete?null:/* @__PURE__ */Pn(Oe,{kind:"delete",label:kt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Xr(e)[n]?.props?.id;null!=t&&Fr.remove(String(t))})(e,n),children:/* @__PURE__ */Pn(Cn,{size:15})})},Ai=e=>Do.rowPreview?.(e)||void 0,Mi=e=>Do.rowMarks?.(e)??void 0,ji=(e,n,t)=>Do.rowActions?.(e,n,t)??null,Ri=(e,n,t,o)=>{if(Xn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
14
|
+
return Pn(Oe,{kind:"eye",label:r?kt.showNamed({name:o}):kt.hideNamed({name:o}),onClick:()=>Li(e,n,t),children:/* @__PURE__ */Pn(r?On:Nn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},Ei=e=>{const n=Hr(Mr[e]?.type??""),t=n?kt.addSectionBefore({name:n}):kt.addSectionHere;return El(le,e,()=>Bi(e),t)},Li=(e,n,t)=>{$t.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Vi=e=>ae(it,e),Fi=e=>ce(it,e),Wi=e=>jo.slotsOf?Kr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Fi(e)}],Di=e=>jo.slotsOf?Wi(e).flatMap(e=>e.kids):Fi(e),Hi=e=>Boolean(jo.slotsOf)&&Kr(e).some(e=>e.rung),Ui=(e,n,t)=>null===t?void 0===n?Fo(e):Fo(e,n):Fo(e,n,t),Gi=(e,n,t)=>{const o=ue(it,e.type,n)&&(t||Di(e).length>0||Hi(e));return{collapsible:o,folded:o&&dr(String(e.props.id))}},Ji=(e,n,t)=>Wi(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Gi(e,r,t(e.type)).collapsible?[String(e.props.id),...Ji(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Xi=e=>Di(e).length>0||Hi(e)||Boolean(Fo(e.type)),Yi=e=>Boolean(Fo(e)),Ki=(e,n,t,o)=>{if(go(U),Fo(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),$t.select({index:n,zone:e}),a(t)}else $t.select({index:n,zone:e}),ki(t)},Qi=(e,n,t,o,r)=>{const i=`${e}:${n}`;$t.insertComponent(i,t,o),Fo(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),$t.select({index:o,zone:i})}):$t.select({index:o,zone:i})},_i=(e,n,t)=>{$t.insertComponent(e,n,t),go(U),$t.select({index:t,zone:e})},qi=hn(/* @__PURE__ */new Set);yn(()=>{Mr.forEach(e=>{const n=Fo(e.type)?.spec;if(!n)return;const t=e.props.id;if(qi.current.has(t))return;qi.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(Dr)).forEach((e,t)=>It.seedChild(o,t,n.childType,e))})},[Mr,It,Dr]);const Zi=hn(/* @__PURE__ */new Set);yn(()=>{Mr.forEach((n,t)=>{const o=n.props.id;if(Zi.current.has(o))return;const r=e(n,Vi(n.type));Zi.current.add(o),r&&It.replaceComponent(le,t,{...n,props:r})})},[Mr,It]),ee(It,it);const el=Mr.findIndex(mt),nl=el>=0?Mr[el]:null,tl=gt?Mr.findIndex(ht):-1,ol=tl>=0?Mr[tl]:null,rl=Mr.find(e=>e.type===dt)??null,il=Mr.find(e=>e.type===ct)??null,ll=el>=0?el:Mr.length,sl=[];Mr.forEach(e=>{mt(e)||(Xi(e)&&sl.push(String(e.props.id)),sl.push(...Ji(e,1,Yi)))}),nl&&(sl.push(String(nl.props.id)),sl.push(...Ji(nl,1,Yi)));const dl=sl.length>0&&sl.every(e=>nr.has(e)),cl=e=>{const n=Do.blockRowName(e,Wr);return Do.rowName?Do.rowName(e,"block",n):n},al=(e,n,t,o)=>{const r=Xr(e)[t];if(!r)return;const i={...pn(e),index:t},l={...pn(n),index:Math.min(Math.max(o,0),Xr(n).length)},s=on(i,l);if(e!==n||s!==t)try{Fr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof un))throw e}},pl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Fi(e))n.add(r),t(o)};for(const t of Vi(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ul=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Gr.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},fl=e=>{const n=e.slice(0,e.indexOf(":")),t=Mr.find(e=>at(e.type)&&String(e.props.id)===n);return t&&pt(n)===e?t:null},hl=(e,n,t)=>{if(e.rung){const t=Yr(e.rung.nodeId),o=t?Kr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Rn&&n.index>=0&&n.index<=o}if(n.slot===Rn)return!1;if(e.add)return yl(e.add,n);const o=dn(n);if(at(e.type))return!1;const r=fl(o),i=fl(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Xr(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=jr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Xr(o).length)return!1;if(e.zone===o)return!0;const l=nl&&!lt.lastIsOpen?String(nl.props.id):null;return(!l||ul(e.zone)!==l&&ul(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Xr(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Gr.get(i),s=l?Xr(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&pl(r).has(n))return!1;const d=Fo(s.type,Lo(et?.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?.(Xr(n),r))})(e.zone,o,e.index,t)},ml=(e,n)=>{const t=dn(e.from);if(t===dn(n))return!0;const o=e.node;return hl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},gl=e=>{const n=e.slice(0,e.indexOf(":")),t=Gr.get(n),o=t?Xr(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Fo(o.type,Lo(et?.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=r.choices??(r.spec?[{type:r.spec.childType,label:Wr(r.spec.childType)}]:[]),l=Qr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Ii(o,t.zone===le)}},yl=(e,n)=>{const t=dn(n);if("block"!==e.kind){if(fl(t))return n.index>=0&&n.index<=Xr(t).length;if(t!==le)return!1;const{floor:e,cap:o}=jr();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=gl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Xr(t))},kl=(e,n)=>{e.rung?ni(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&fl(dn(n)))return void Ni(e,dn(n),n.index);if("section"===e.kind)return void bi(e.type,n.index);if("template"===e.kind)return void zi(e.template.name,Lr(e.template.node),n.index);const t=dn(n),o=gl(t);o&&(o.target.spec?Qi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):_i(t,e.type,n.index))})(e.add,n):e.zone===le?wi(e.index,n.index):al(e.zone,dn(n),e.index,n.index)},[Sl]=gn(()=>nn()),vl=tn({keyOf:e=>e.id,readOnly:Boolean(Xn),session:Sl,canDrop:hl,onDrop:kl,onStep:(e,n)=>{e.rung?ni(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=Hr(Mr[e]?.type??""),o=wi(e,n<0?e-1:e+2);if(!o.moved)return void fr(n<0?kt.sectionFirst({name:t}):kt.sectionLast({name:t}));const{floor:r,cap:i}=jr();fr(kt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):al(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),wl=kn(e=>{const{floor:n,cap:t}=jr(),o=[];for(const r of e.nodes){const e=dn(r.place),i=Xr(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(ht(i)||mt(i)||Ro(i.type))continue;if(at(i.type))continue;const l=Boolean(fl(e)),s=e===le||l;e===le&&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?Hr(i.type):ri(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(gl(dn(e.list))?.choices.length)||Boolean(fl(dn(e.list))))}},[et.data]),xl=null==ot?.props.id?null:String(ot.props.id),bl=kn(e=>{const n=it,t=e=>!e.item.rung&&null!==fn(et.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(xl);return i||(r(Ae(et.data,n,o.item.id,xl))??o)},[et.data,it,xl]),zl=e=>{go(U),$t.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},Bl=ne(),Cl=()=>({data:et.data,device:Wt,ops:$t,inspector:To}),Ol=Bl?.model,Nl=mn(()=>Ol?e=>Ol(e,wl(e),Cl()):wl,[Ol,wl,Wt]),Il=Bl?.measure,Pl=Il?(e,n)=>Il(e,n,Cl()):void 0,Tl=Bl?.canDrop,$l=Tl?(e,n)=>Tl(e,n,hl,Cl()):hl,Al=Bl?.drop,Ml=Al?(e,n)=>Al(e,n,kl,Cl()):kl,jl=Bl?.pick,Rl=jl?e=>jl(e,zl,Cl()):zl,El=(e,n,t,o)=>/* @__PURE__ */Pn(Ne,{...Xn?{}:vl.seam({place:{...pn(e),index:n}}),onAdd:Xn?void 0:t,label:o},`seam:${e}:${n}`),Ll={rowClick:Pi,isCollapsed:dr,toggleCollapse:cr},Vl=e=>{const n=String(e.props.id),t=Mr.findIndex(e=>String(e.props.id)===n),o=pt(n),r=Xr(o),i=dr(n),l=Wr(e.type),s=Do.rowName?Do.rowName(e,"section",l):l,d=e=>El(o,e,()=>Ci(o,e),kt.addSectionHere);/* @__PURE__ */
|
|
15
|
+
return Tn($n,{children:[
|
|
16
|
+
/* @__PURE__ */Pn(be,{words:St,icon:/* @__PURE__ */Pn(Uo,{type:e.type,size:13}),name:s,preview:Ai(e),marks:Mi(e),onSelect:()=>Si(t),nameSlot:li(le,t,n,s),selected:xo===n,actions:ji(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:Pi(()=>Si(t))},fold:{open:!i,label:"section",onToggle:()=>cr(n)}}),!i&&/* @__PURE__ */Tn(ze,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ur(n),l=Xi(n),s=l&&dr(r),c=()=>Ki(o,t,r,e.type),{rowProps:a,...p}=vl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...pn(o),index:t}},{"data-node-id":r,onClick:Pi(c)});/* @__PURE__ */
|
|
17
|
+
return Tn(vn,{children:[d(t),
|
|
18
|
+
/* @__PURE__ */Pn(be,{words:St,icon:/* @__PURE__ */Pn(Uo,{type:n.type,size:13}),name:i,preview:Ai(n),marks:Mi(n),onSelect:c,nameSlot:li(o,t,r,i),selected:xo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>cr(r)}:void 0,actions:/* @__PURE__ */Tn($n,{children:[$i(o,t,i),ji(n,o,t),Ri(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Pn(ze,{children:Dl(n,2)})]},r)}),d(r.length)]})]})},Fl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=vl.dragging,d=!dr(l)&&s?.rung?.nodeId!==i,c={...pn(l),index:0},a=s&&!s.rung&&hl(s,c)?c:void 0,p=()=>Zr(e,n,!0),{rowProps:u,...f}=vl.row({item:{id:`rung:${l}`,zone:`${i}:${Rn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Rn,index:t},into:a,canDrag:Boolean(jo.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Pi(p)}),h=Xn?null:jo.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
19
|
+
return Tn(vn,{children:[n.heading,
|
|
20
|
+
/* @__PURE__ */Pn(be,{words:St,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:_r===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>cr(l)},actions:h&&h.length>0?/* @__PURE__ */Pn($n,{children:h.map((t,o)=>/* @__PURE__ */Pn(Oe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Xn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&ei(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */Pn(Cn,{size:15}):/* @__PURE__ */Pn(In,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Pn(ze,{children:r})]},l)},Wl=(e,n)=>{const t=Wi(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
21
|
+
return Pn($n,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Ui(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(gl(c)?.choices.length),p=(e,n)=>a?El(e,n,()=>Ci(e,n),kt.addBlockHere):El(e,n),u=/* @__PURE__ */Tn($n,{children:[i.map(({child:n,zone:t,index:o})=>{const r=xo===String(n.props.id),{collapsible:i,folded:s}=Gi(n,l,Yi(n.type)),d=String(n.props.id),c=cl(n),a=()=>Ki(t,o,d,e.type),{rowProps:u,...f}=vl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...pn(t),index:o}},{"data-node-id":d,onClick:Pi(a)});/* @__PURE__ */
|
|
22
|
+
return Tn(vn,{children:[0===o&&p(t,0),
|
|
23
|
+
/* @__PURE__ */Pn(be,{words:St,icon:/* @__PURE__ */Pn(Uo,{type:n.type,size:13}),name:c,preview:Ai(n),marks:Mi(n),onSelect:a,nameSlot:li(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>cr(d)}:void 0,actions:/* @__PURE__ */Tn($n,{children:[$i(t,o,c),ji(n,t,o),Ri(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Pn(ze,{children:Wl(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?Fl(e,t.rung,r++,o,u):/* @__PURE__ */Pn(vn,{children:u},t.slot??"")})})},Dl=(e,n)=>{const t=Lo(et?.data,e.type,String(e.props.id)),o=Wi(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
24
|
+
return Pn($n,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Ui(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>Qi(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>Ci(n,t):void 0;return El(n,t,o,n===f&&c?c.addLabel:kt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Tn($n,{children:[l.map(({child:n,zone:t,index:o})=>{const r=xo===String(n.props.id),i=ri(n),l=String(n.props.id),{collapsible:d,folded:c}=Gi(n,s,Yi(n.type)),a=Vi(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...pn(p),index:Xr(p).length}:void 0,f=vl.dragging,h=u&&f&&hl(f,u)?u:void 0,g=()=>Ki(t,o,l,e.type),{rowProps:y,...k}=vl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...pn(t),index:o},into:h,canDrag:!Ro(n.type)},{"data-node-id":l,onClick:Pi(g)});/* @__PURE__ */
|
|
25
|
+
return Tn(vn,{children:[0===o&&m(t,0),
|
|
26
|
+
/* @__PURE__ */Pn(be,{words:St,icon:/* @__PURE__ */Pn(Uo,{type:n.type,size:13}),name:i,preview:Ai(n),marks:Mi(n),onSelect:g,nameSlot:li(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>cr(l)}:void 0,actions:Ro(n.type)?ji(n,t,o)??void 0:/* @__PURE__ */Tn($n,{children:[$i(t,o,i),ji(n,t,o),Ri(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Pn(ze,{children:Dl(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
|
|
27
|
+
/* @__PURE__ */Pn(I,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>Qi(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?Fl(e,o.rung,i++,r,k):/* @__PURE__ */Pn(vn,{children:k},o.slot??"")})})},Hl=(()=>{if(!ot||!yo)return null;const e=String(ot.type),n=String(ot.props.id),t=Fo(e,Lo(et?.data,e,n));if(!t||"footer"===t.source)return null;const o=Mr.some(e=>String(e.props?.id)===n),r=Array.isArray(ot.props[t.slot])?ot.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Wr(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:Ii(ot,o),choices:i,onPick:o=>{t.spec?Qi(n,t.slot,o,r.length,e):_i(`${n}:${t.slot}`,o,r.length)}}})(),Ul=vo&&vo.zone!==le&&!fl(vo.zone)?vo.zone:null,Gl=!0===po.blocksFirst,Jl=Ul?gl(Ul):Gl&&vo?null:Hl,Xl=Boolean(co&&Ul)||Gl&&Boolean(Jl&&Jl.choices.length>0),Yl=ro||null!==Gt,Kl=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Mt&&!Yl&&Mo===e.id,onSelect:()=>Pr(e.id)}:e,Ql=[{id:"add",label:kt.add.title,icon:/* @__PURE__ */Pn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:ro,onSelect:()=>ro?Oi():Bi(null)},...($o.railLead??[]).map(Kl),{id:"sections",label:kt.layers,icon:/* @__PURE__ */Pn(Me,{}),active:Mt&&!Yl&&"sections"===Mo,onSelect:()=>Pr("sections")},...($o.railTrail??[]).map(Kl)];Ut?Ql.push({id:"media",label:kt.railMedia,icon:/* @__PURE__ */Pn(je,{}),active:Mt&&!ro&&(null!==Gt||"media"===Mo),onSelect:()=>Pr("media")}):_n&&Ql.push({id:"media",label:kt.railMedia,icon:/* @__PURE__ */Pn(je,{}),onSelect:Tr});const _l=[...$o.railLead??[],...$o.railTrail??[]].find(e=>"panel"in e&&e.id===Mo),ql=Boolean(yt?.foldable)&&!Ao,Zl=yt?.label??(qn?kt.pageSections:kt.templateSections),es=ql&&dr(En),ns=/* @__PURE__ */Tn($n,{children:[Mr.map((e,n)=>{if(ht(e)||mt(e)||at(e.type))return null;const t=xo===String(e.props.id),o=Boolean(e.props._hidden);Fi(e);const r=String(e.props.id),i=$o.hasOwnRows?.(e)??!1,l=Xi(e)||i,s=l&&dr(r),{rowProps:d,...c}=vl.row({item:{id:r,zone:le,index:n,type:e.type},place:{...pn(le),index:n}},{"data-node-id":r,onClick:Pi(()=>Si(n))});/* @__PURE__ */
|
|
28
|
+
return Tn(vn,{children:[n>0&&Ei(n),
|
|
29
|
+
/* @__PURE__ */Pn(be,{words:St,icon:/* @__PURE__ */Pn(Uo,{type:e.type,size:13}),name:Ur(e),preview:Ai(e),marks:Mi(e),onSelect:()=>Si(n),nameSlot:li(le,n,r,Ur(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>cr(r)}:void 0,actions:/* @__PURE__ */Tn($n,{children:[$i(le,n,Ur(e)),ji(e,le,n),Ri(le,n,e,Ur(e))]}),rowProps:d}),Xi(e)&&!s&&/* @__PURE__ */Tn(ze,{children:[Dl(e,1),$o.partRows?.(e,Ll)]}),i&&!s&&/* @__PURE__ */Pn(ze,{children:$o.ownRows?.(e,n,Ll)})]},String(e.props.id??n))}),!Ao&&ll>0&&Ei(ll),yt?.addAtEnd&&!Ao&&!Xn&&/* @__PURE__ */Pn(I,{small:!0,label:kt.addSection,blocked:null,onAdd:()=>Bi(ll)})]}),ts=(e,n,t)=>{const o=String(e.props.id),r=Di(e).length>0||Hi(e)||Boolean(Fo(e.type)),i=r&&dr(o),l="header"===t?kt.header:kt.footer,s=Do.rowName?Do.rowName(e,"section",l):l;/* @__PURE__ */
|
|
30
|
+
return Tn($n,{children:[
|
|
31
|
+
/* @__PURE__ */Pn(be,{words:St,icon:/* @__PURE__ */Pn(Uo,{type:t,size:13}),name:s,preview:Ai(e),marks:Mi(e),onSelect:()=>Si(n),nameSlot:li(le,n,o,s),selected:xo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>cr(o)}:void 0,actions:ji(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:Pi(()=>Si(n))}}),r&&!i&&/* @__PURE__ */Pn(ze,{children:Wl(e,1)})]})};return($o.wrap??(e=>e))(
|
|
32
|
+
/* @__PURE__ */Pn(te,{target:to,children:/* @__PURE__ */Tn("div",{ref:no,className:"sf-editor es-editor",style:Ye(or),onContextMenu:ui.onEditorContextMenu,...m(Ee),children:[
|
|
33
|
+
/* @__PURE__ */Tn(Le,{children:[
|
|
34
|
+
/* @__PURE__ */Pn(Ve,{items:Ql,ariaLabel:kt.bar.views}),
|
|
35
|
+
/* @__PURE__ */Tn(Fe,{children:[
|
|
36
|
+
/* @__PURE__ */Pn(We,{label:kt.bar.undo,disabled:Boolean(Xn)||!tt.hasPast,onClick:()=>tt.back(),children:/* @__PURE__ */Pn(zn,{})}),
|
|
37
|
+
/* @__PURE__ */Pn(We,{label:kt.bar.redo,disabled:Boolean(Xn)||!tt.hasFuture,onClick:()=>tt.forward(),children:/* @__PURE__ */Pn(Bn,{})}),
|
|
38
|
+
/* @__PURE__ */Pn(De,{}),
|
|
39
|
+
/* @__PURE__ */Pn(He,{devices:Rt,value:Wt,onChange:Dt})]}),
|
|
40
|
+
/* @__PURE__ */Tn(Fe,{kind:"right",style:{minWidth:300},children:[
|
|
41
|
+
/* @__PURE__ */Pn(An,{saveState:Hn,notSaving:Boolean(Xn)||null!=Un,readOnlyReason:Yn,toggle:Kn,onToggle:Jn,onRetry:Gn,words:kt.bar,saveWords:wt}),$o.barLead?.(),
|
|
42
|
+
/* @__PURE__ */Pn(wn,{content:kt.bar.refreshTip,side:"bottom",children:/* @__PURE__ */Pn(xn,{variant:"secondary",onClick:()=>{eo.current=(()=>{const e=to?.document;if(!e)return null;const n=Mr.findIndex(mt),t=n>=0?n:Mr.length;let o=null;for(let n=0;n<t;n++){const t=Mr[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[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=ot?.props?.id??Mr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Zt(e=>e+1)},children:kt.bar.refresh})}),$o.barTrail?.(),$o.barMain?$o.barMain():/* @__PURE__ */Pn(xn,{variant:"primary",disabled:null!==Yn,onClick:()=>{Dn(et.data)},children:kt.done})]})]}),
|
|
43
|
+
/* @__PURE__ */Pn(z,{}),
|
|
44
|
+
/* @__PURE__ */Tn("div",{className:"sf-body",children:[Mt?/* @__PURE__ */Tn($n,{children:[
|
|
45
|
+
/* @__PURE__ */Pn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":kt.leftPanel,children:ro?/* @__PURE__ */Pn(P,{blocks:Jl,blocksOnly:Xl,at:co?{label:(e=>{const n=fl(e.zone);if(n)return kt.add.addingTo({name:Do.rowName?Ii(n,!0):Wr(n.type)});if(e.zone===le){const n=Mr[e.index];return n&&!mt(n)?kt.add.addingBefore({name:Ii(n,!0)}):kt.add.addingAtEnd}const t=gl(e.zone);return t?kt.add.addingTo({name:t.parentName}):kt.add.addingHere})(co),onClear:()=>ao(null)}:void 0,onAdd:e=>{const n=vo,t=(e,n)=>{co&&ao({zone:e,index:n})};if(n&&"block"!==e.kind&&fl(n.zone))return Ni(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===wo)return void bi(e);const n=bi(e,wo);co&&uo(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===wo)return void zi(e,n);const t=zi(e,n,wo);co&&uo(t+1)})(e.template.name,Lr(e.template.node));if(n&&n.zone!==le){const o=gl(n.zone);if(!o)return;return o.target.spec?Qi(o.parentId,o.target.slot,e.type,n.index,o.parent.type):_i(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Hl?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:Sl,siteWide:$o.addPanelRow?.(Oi),onClose:Oi,onHide:Nr,readOnly:Boolean(Xn)}):Gt&&Ht?
|
|
46
|
+
/* @__PURE__ */Pn(A,{panel:Ht,pick:Gt,onHide:Nr}):_l?_l.panel({onHide:Nr,notify:fr}):"media"===Mo&&Ht?/* @__PURE__ */Pn(A,{panel:Ht,pick:null,onHide:Nr}):/* @__PURE__ */Tn($n,{children:[
|
|
47
|
+
/* @__PURE__ */Pn(T,{icon:/* @__PURE__ */Pn(Me,{}),title:kt.layers,context:Bt,actions:
|
|
48
|
+
/* @__PURE__ */Pn(Ue,{label:dl?kt.expandAll:kt.collapseAll,title:0===sl.length?kt.nothingToFold:void 0,disabled:0===sl.length,onClick:()=>tr(e=>{const n=new Set(sl);return dl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...sl])}),children:/* @__PURE__ */Pn(Mn,{expand:dl})}),onHide:Nr}),
|
|
49
|
+
/* @__PURE__ */Tn(Be,{className:"sf-tree sf-scroll",words:St,children:[
|
|
50
|
+
/* @__PURE__ */Pn(be,{words:St,icon:/* @__PURE__ */Pn(Uo,{type:"page",size:13}),name:kt.pageSettings,onSelect:$r,selected:!ot&&yo,rowProps:{onClick:Pi($r)}}),rl&&/* @__PURE__ */Tn($n,{children:[
|
|
51
|
+
/* @__PURE__ */Pn(Ce,{children:kt.header}),Vl(rl)]}),!Ao&&Zn&&/* @__PURE__ */Tn($n,{children:[
|
|
52
|
+
/* @__PURE__ */Pn(Ce,{children:kt.header}),!gt&&/* @__PURE__ */Pn(be,{words:St,icon:/* @__PURE__ */Pn(Uo,{type:"header",size:13}),name:kt.header,onSelect:Ar,selected:mo.kind===ft?.kind,rowProps:{onClick:Pi(Ar)}})]}),!Ao&&ol&&ts(ol,tl,"header"),!Ao&&!ql&&/* @__PURE__ */Pn(Ce,{children:Zl}),ql?/* @__PURE__ */Tn($n,{children:[
|
|
53
|
+
/* @__PURE__ */Pn(be,{words:St,icon:null,name:Zl,fold:{open:!es,label:Zl,onToggle:()=>cr(En)}}),!es&&/* @__PURE__ */Pn(ze,{children:ns})]}):ns,Zn&&/* @__PURE__ */Pn(Ce,{children:kt.footer}),nl&&ts(nl,el,"footer"),!Ao&&!nl&&Zn&&/* @__PURE__ */Pn(be,{words:St,icon:/* @__PURE__ */Pn(Uo,{type:"footer",size:13}),name:kt.footer,onSelect:Ti,rowProps:{onClick:Pi(Ti),title:kt.editFooter}}),il&&Vl(il),$o.treeFoot?.()]})]})}),
|
|
54
|
+
/* @__PURE__ */Pn(Ge,{side:"left",width:or.left,min:Xe,max:Je,defaultWidth:k.left,label:kt.resizeLeftPanel,onResize:lr})]}):/* @__PURE__ */Pn($,{side:"left",onShow:Nr}),
|
|
55
|
+
/* @__PURE__ */Tn("div",{ref:hr,className:"sf-center sf-scroll","data-sf-canvas-head":Sr?"":void 0,style:{overflowX:Br?"auto":"hidden",overflowY:"hidden"},children:[Sr&&/* @__PURE__ */Pn("div",{ref:vr,className:"sf-canvas-head",children:/* @__PURE__ */Pn(Sr,{device:Wt})}),
|
|
56
|
+
/* @__PURE__ */Pn("div",{className:"sf-frame-scaler",style:Cr,children:/* @__PURE__ */Pn("div",{className:"sf-frame "+(Wt===Vt?"":`sf-frame--${Wt}`),style:Or,children:/* @__PURE__ */Tn("div",{className:"sf-preview-host",children:[
|
|
57
|
+
/* @__PURE__ */Pn(Ct,{},qt),
|
|
58
|
+
/* @__PURE__ */Pn(Ze,{canvas:to,session:Sl,model:Nl,measure:Pl,canDrop:$l,onDrop:Ml,choose:bl,onPick:Rl,onZoneAdd:e=>{const n=dn(e),t=Qr(n);t&&Zr(t.node,t.slot,!1),Ci(n,0)},zoneAddLabel:kt.canvasAddBlock,words:vt.canvas,readOnly:Boolean(Xn),revision:et.data}),fo.length>0&&/* @__PURE__ */Pn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:fo.map(e=>/* @__PURE__ */Tn("button",{type:"button",tabIndex:-1,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},onClick:()=>Bi(e.index),children:[
|
|
59
|
+
/* @__PURE__ */Pn("span",{className:"sf-preview-gap-line"}),
|
|
60
|
+
/* @__PURE__ */Tn("span",{className:"sf-preview-gap-pill",children:[
|
|
61
|
+
/* @__PURE__ */Pn("span",{className:"sf-preview-gap-plus",children:"+"}),
|
|
62
|
+
/* @__PURE__ */Pn("span",{className:"sf-preview-gap-label",children:kt.addSection})]})]},e.index))})]})})})]}),jt?/* @__PURE__ */Tn($n,{children:[
|
|
63
|
+
/* @__PURE__ */Pn(g,{value:{selectChild:Ki,addChild:Qi,childRowName:ri,blockRowName:cl},children:/* @__PURE__ */Pn(Ot,{mode:mo,onOpenWebsiteSettings:$o.openSettings??(()=>{}),onOpenSiteStyles:$o.openStyles,onSelectNode:Yo,onNotify:fr,onHidePanel:Ir,nodeActions:ot?se(it,ot.type):Ln})}),
|
|
64
|
+
/* @__PURE__ */Pn(Ge,{side:"right",width:or.right,min:Xe,max:Je,defaultWidth:k.right,label:kt.resizeSettingsPanel,onResize:sr})]}):
|
|
65
|
+
/* @__PURE__ */Pn($,{side:"right",onShow:Ir})]}),ui.menu]})}))}export{Vn as ScreenChrome};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScreenPartsProvider as t}from"./chunk-
|
|
1
|
+
import{ScreenPartsProvider as t}from"./chunk-KSTX646X.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-XW4AV5N4.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
|
|
2
2
|
return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenDocument as n}from"./chunk-WZMU646D.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-MCHMF32I.js";import{EditNotice as r}from"./chunk-
|
|
1
|
+
import{useScreenDocument as n}from"./chunk-WZMU646D.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-MCHMF32I.js";import{EditNotice as r}from"./chunk-UB4TLWVJ.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-
|
|
1
|
+
import{useScreenBlockRules as e}from"./chunk-KSTX646X.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-XW4AV5N4.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={settings:"Settings",buckets:{Design:"Design",Animation:"Animation"},designGroups:{Content:"Content",Size:"Size",Design:"Design",Layout:"Layout",Position:"Position",Anchor:"Anchor"},followsDefault:"Default",reset:"Reset",resetName:({label:e})=>`Reset ${e}`,backToDefault:({detail:e})=>`Back to default: ${e}`,resetTitle:({label:e,detail:t})=>`Reset ${e} (back to ${t})`};export{e as DEFAULT_PANEL_WORDS};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useScreenOwnerName as e}from"./chunk-
|
|
1
|
+
import{useScreenOwnerName as e}from"./chunk-KSTX646X.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-UB4TLWVJ.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
|
|
2
2
|
return o(r,{children:[
|
|
3
3
|
/* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-XW4AV5N4.js";import{Inspector as i}from"./chunk-CRWFB7MU.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},j={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},w={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},L={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},C={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
|
|
2
|
+
return s(t,{height:"fill"})}function N(){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 P=o({});function B({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
+
return s(P.Provider,{value:n,children:e})}function D(){return u(P)}function G(){return(D().useOwnerName??g)()}function x(){return(D().useDocumentLabel??y)()}function A(n,e,t,r){return(D().useBridges??v)(n,e,t,r)}function F(n){return(D().useStandaloneBridges??v)(n)}function I(n,e){(D().useDocumentPass??b)(n,e)}function R(){return D().blockRules??O}function T(){return D().blockLook??j}function W(){return D().devices??w}function V(){return D().leftView??L}function K(){return D().pinned??C}function E(){return D().saveSwitch??!0}function H(n){e(!0===D().pickFollowsSelection,n)}function M(){return D().add??h}function Q(){return D().storageNamespace||void 0}function U(){return D().styleClipboard??null}function X(){return D().nodeKeys??!0}function Y(){return D().notify??null}function Z(){return D().Canvas??S}function q(){return D().CanvasHead??null}function z(){return D().canvasDrag??null}var J=o(null);function $({target:n,children:e}){/* @__PURE__ */
|
|
5
|
+
return s(J.Provider,{value:n,children:e})}function _(){return u(J)}function nn(){return D().Inspector??N}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,B as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,M as useScreenAdd,T as useScreenBlockLook,R as useScreenBlockRules,A as useScreenBridges,z as useScreenCanvasDrag,Z as useScreenCanvasFrame,q as useScreenCanvasHead,_ as useScreenCanvasTarget,W as useScreenDevices,x as useScreenDocumentLabel,I as useScreenDocumentPass,nn as useScreenInspectorPanel,V as useScreenLeftView,X as useScreenNodeKeys,Y as useScreenNotify,G as useScreenOwnerName,D as useScreenParts,H as useScreenPickFollowsSelection,K as useScreenPinned,E as useScreenSaveSwitch,Q as useScreenStorageNamespace,U as useScreenStyleClipboard,F as useStandaloneScreenBridges};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n={Design:"_sDesign",Animation:"_sAnimation"},i={Content:"_dContent",Size:"_dSize",Design:"_dDesign",Layout:"_dLayout",Position:"_dPosition",Anchor:"_dAnchor"};export{n as BUCKET_KEY,i as DESIGN_GROUP_KEY};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PanelToggleIcon as e}from"./chunk-KQMML6JM.js";import{InspectorHead as n}from"./chunk-
|
|
1
|
+
import{PanelToggleIcon as e}from"./chunk-KQMML6JM.js";import{InspectorHead as n}from"./chunk-UB4TLWVJ.js";import{DEFAULT_CHROME_WORDS as i}from"./chunk-Y2G7CU6A.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{Tooltip as s,IconButton as t,Button as c}from"efficient-shell/ui";import{jsx as r,jsxs as l,Fragment as d}from"react/jsx-runtime";function a({icon:e,title:i,context:o,actions:s,side:t="left",onHide:c}){/* @__PURE__ */
|
|
2
2
|
return r(n,{icon:e,name:i,kind:o,actions:s||c?/* @__PURE__ */l(d,{children:[s,c?/* @__PURE__ */r(m,{side:t,onHide:c,divider:Boolean(s)}):null]}):void 0})}function m({side:n,onHide:c,divider:a=!1}){const m=o("chrome",i);/* @__PURE__ */
|
|
3
3
|
return l(d,{children:[a?/* @__PURE__ */r("span",{className:"sf-head-divider","aria-hidden":"true"}):null,
|
|
4
4
|
/* @__PURE__ */r(s,{content:m.hidePanel,side:"bottom",children:/* @__PURE__ */r(t,{className:"es-insp-iconbtn","aria-label":m.hidePanelLabel({side:n}),onClick:c,children:/* @__PURE__ */r(e,{side:n})})})]})}function h({side:n,onShow:c}){const l=o("chrome",i);/* @__PURE__ */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-
|
|
1
|
+
import{useSectionOps as o}from"./chunk-I7ER3P4U.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-KSTX646X.js";import{useEasel as p}from"./chunk-XW4AV5N4.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=p(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-Y2G7CU6A.js";import{holderOf as i,describeAge as a,nameOrSomeone as s}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as t}from"./chunk-RE4LP46F.js";import{EaselRail as l}from"./chunk-MJM6SFD3.js";import{DEFAULT_RAIL_WORDS as r}from"./chunk-2OAZYSWJ.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";import{Tooltip as h,IconButton as m,Segmented as v,Switch as f,ResizeHandle as
|
|
1
|
+
import{DEFAULT_NOTICE_WORDS as e,DEFAULT_CHROME_WORDS as n}from"./chunk-Y2G7CU6A.js";import{holderOf as i,describeAge as a,nameOrSomeone as s}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as t}from"./chunk-RE4LP46F.js";import{EaselRail as l}from"./chunk-MJM6SFD3.js";import{DEFAULT_RAIL_WORDS as r}from"./chunk-2OAZYSWJ.js";import{useWords as o}from"./chunk-MFIRYGHW.js";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";import{Tooltip as h,IconButton as m,Segmented as v,Switch as f,ResizeHandle as p,Button as k,Banner as b}from"efficient-shell/ui";import{PanelLeftIcon as g,PanelRightIcon as y,MediaIcon as N,ImageIcon as w}from"efficient-shell/icons/efficient";function C({children:e}){/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"es-topbar",children:e})}function O({kind:e,style:n,children:i}){/* @__PURE__ */
|
|
3
3
|
return c("div",{className:e?`es-cluster es-cluster--${e}`:"es-cluster",style:n,children:i})}function x(){/* @__PURE__ */
|
|
4
4
|
return c("div",{className:"es-divider-v","aria-hidden":"true"})}function z({items:e,ariaLabel:n,onWords:i}){const a=o("rail",r);/* @__PURE__ */
|
|
@@ -7,15 +7,15 @@ return c(h,{content:e,side:"bottom",children:/* @__PURE__ */c(m,{ref:s,"aria-lab
|
|
|
7
7
|
return c(v,{className:"es-devseg",size:"sm",label:s??t.device,value:i,onChange:e=>{e!==i&&a(e)},options:e.map(e=>({value:e.id,icon:/* @__PURE__ */c(h,{content:e.label,side:"bottom",children:/* @__PURE__ */c("span",{className:"es-devseg-glyph","aria-hidden":"true",children:e.icon})}),label:/* @__PURE__ */c("span",{className:"es-vh",children:e.label})}))})}var L={idle:"is-quiet",saved:"is-quiet is-saved",saving:"is-saving",error:"is-error",off:"is-off","off-unsaved":"is-off is-unsaved"};function $({tone:e,label:n,counting:i,waitMs:a,ringRef:s,role:t}){/* @__PURE__ */
|
|
8
8
|
return d("span",{className:`es-savestate ${L[e]}`,role:t,"aria-live":"polite",children:[/* @__PURE__ */c("span",i?{ref:s,className:"es-savestate-ring is-counting",style:void 0!==a?{"--es-savewait":`${a}ms`}:void 0,"aria-hidden":"true"}:{className:"es-savestate-dot","aria-hidden":"true"}),n]})}function W({pressed:e,title:n,onToggle:i,children:a}){/* @__PURE__ */
|
|
9
9
|
return c("span",{className:"es-savestate-toggle",children:/* @__PURE__ */c(h,{content:n,side:"bottom",children:/* @__PURE__ */c(f,{size:"sm",checked:!e,"aria-label":n,label:a,onChange:()=>i()})})})}function j({side:e,width:i,min:a,max:s,defaultWidth:t,label:l,onResize:r}){const d=o("chrome",n);/* @__PURE__ */
|
|
10
|
-
return c(
|
|
10
|
+
return c(p,{side:e,width:i,min:a,max:s,defaultWidth:t,label:l,hint:d.resize,onResize:e=>r(e),className:`es-resizer es-resizer--${e}`})}function M({icon:e,name:n,kind:i,actions:a}){/* @__PURE__ */
|
|
11
11
|
return d("div",{className:"es-insp-head",children:[
|
|
12
12
|
/* @__PURE__ */c("span",{className:"es-insp-chip","aria-hidden":"true",children:e}),
|
|
13
13
|
/* @__PURE__ */d("div",{className:"es-insp-titles",children:[
|
|
14
|
-
/* @__PURE__ */c("h2",{className:"es-insp-name",children:n}),
|
|
14
|
+
/* @__PURE__ */c(h,{content:n,describe:!1,side:"bottom",className:"es-insp-name-tip",children:/* @__PURE__ */c("h2",{className:"es-insp-name",children:n})}),
|
|
15
15
|
/* @__PURE__ */c("div",{className:"es-insp-kind",children:i})]}),a?/* @__PURE__ */c("div",{className:"es-insp-actions",children:a}):null]})}function S({label:e,title:n,hasPopup:i,onClick:a,disabled:s,danger:t,expanded:l,buttonRef:r,children:o}){/* @__PURE__ */
|
|
16
|
-
return c(h,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:r,variant:t?"ghost-danger":"ghost",className:"es-insp-iconbtn","aria-label":e,"aria-haspopup":i,"aria-expanded":l,disabled:s,onClick:a,children:o})})}function P({name:e,onSelect:i,label:a,inline:s}){const t=o("chrome",n),l=a??t.upLevel,r=/* @__PURE__ */c(h,{content:l,side:"bottom",children:/* @__PURE__ */c(
|
|
16
|
+
return c(h,{content:n??e,side:"bottom",children:/* @__PURE__ */c(m,{ref:r,variant:t?"ghost-danger":"ghost",className:"es-insp-iconbtn","aria-label":e,"aria-haspopup":i,"aria-expanded":l,disabled:s,onClick:a,children:o})})}function P({name:e,onSelect:i,label:a,inline:s}){const t=o("chrome",n),l=a??t.upLevel,r=/* @__PURE__ */c(h,{content:l,side:"bottom",children:/* @__PURE__ */c(k,{variant:"link",size:"sm",className:"es-insp-up-btn","aria-label":t.upLevelTo({label:l,name:e}),leftIcon:/* @__PURE__ */c("span",{className:"es-insp-up-arrow","aria-hidden":"true",children:"←"}),onClick:i,children:/* @__PURE__ */c("span",{className:"es-insp-up-name",children:e})})});return s?r:/* @__PURE__ */c("div",{className:"es-insp-up",children:r})}function Y({context:e,pick:i,onCancel:a,onHide:s,side:t="left"}){const l=o("chrome",n),r=s?/* @__PURE__ */c(S,{label:l.hidePanelLabel({side:t}),title:l.hidePanel,onClick:s,children:/* @__PURE__ */c("left"===t?g:y,{size:16})}):null;if(!i)/* @__PURE__ */
|
|
17
17
|
return c(M,{icon:/* @__PURE__ */c(N,{}),name:l.mediaLibrary,kind:e,actions:r??void 0});const m=l.mediaKinds[i.kind];/* @__PURE__ */
|
|
18
18
|
return c(M,{icon:/* @__PURE__ */c(w,{size:15}),name:l.mediaChoose({kind:m}),kind:i.field?l.mediaFor({field:i.field}):e,actions:/* @__PURE__ */d(u,{children:[
|
|
19
|
-
/* @__PURE__ */c(h,{content:l.mediaKeep({kind:m}),side:"bottom",children:/* @__PURE__ */c(
|
|
20
|
-
/* @__PURE__ */c("span",{className:"es-insp-divider","aria-hidden":"true"}),r]}):null]})})}function T(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var F={notice:e,lock:t};function H(e,n,t,l=F){const r=l.notice,o=i(e),c={kind:"reload",label:r.reload};if(n){const e=a(n.secondsAgo,l.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?r.savedByYou({noun:t,when:e}):r.savedByOther({name:s(n.savedBy,l.lock),noun:t,when:e}),body:r.conflictBody,actions:o?[c,{kind:"take-over",label:r.takeOver,title:r.takeOverWhileDeciding}]:[c]}}if(!o)return null;const d=s(o.name,l.lock),u=a(o.secondsSinceSeen,l.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:r.tookOver({name:d,noun:t,when:a(o.secondsSinceHeld,l.lock)}),body:r.tookOverBody,actions:[{kind:"take-back",label:r.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:r.viewingOnly,body:r.viewingOnlyBody({name:d,noun:t,seen:u}),actions:[{kind:"take-over",label:r.takeOver}]};default:return{tone:"warning",urgent:!1,lead:r.editing({name:d,noun:t}),body:r.editingBody({seen:u}),actions:[{kind:"view-read-only",label:r.viewReadOnly},{kind:"take-over",label:r.takeOver,title:r.takeOverTold}]}}}function A({access:n,conflict:i,noun:a,onTakeOver:s,onViewReadOnly:l,onReload:r}){const d=H(n,i,a,{notice:o("notice",e),lock:o("lock",t)});if(!d)return null;const u={reload:r,"take-over":s,"take-back":s,"view-read-only":l},m=d.actions.map(e=>e.title?/* @__PURE__ */c(h,{content:e.title,side:"bottom",children:/* @__PURE__ */c(
|
|
19
|
+
/* @__PURE__ */c(h,{content:l.mediaKeep({kind:m}),side:"bottom",children:/* @__PURE__ */c(k,{variant:"secondary",size:"sm",className:"es-insp-textbtn",onClick:a,children:l.mediaCancel})}),r?/* @__PURE__ */d(u,{children:[
|
|
20
|
+
/* @__PURE__ */c("span",{className:"es-insp-divider","aria-hidden":"true"}),r]}):null]})})}function T(e){return/svg/i.test(e)?"svg":e.startsWith("video")?"video":"image"}var F={notice:e,lock:t};function H(e,n,t,l=F){const r=l.notice,o=i(e),c={kind:"reload",label:r.reload};if(n){const e=a(n.secondsAgo,l.lock);return{tone:"warning",urgent:!0,lead:n.savedByYou?r.savedByYou({noun:t,when:e}):r.savedByOther({name:s(n.savedBy,l.lock),noun:t,when:e}),body:r.conflictBody,actions:o?[c,{kind:"take-over",label:r.takeOver,title:r.takeOverWhileDeciding}]:[c]}}if(!o)return null;const d=s(o.name,l.lock),u=a(o.secondsSinceSeen,l.lock);switch(e.kind){case"takenover":return{tone:"warning",urgent:!0,lead:r.tookOver({name:d,noun:t,when:a(o.secondsSinceHeld,l.lock)}),body:r.tookOverBody,actions:[{kind:"take-back",label:r.takeBack},c]};case"readonly":return{tone:"neutral",urgent:!1,lead:r.viewingOnly,body:r.viewingOnlyBody({name:d,noun:t,seen:u}),actions:[{kind:"take-over",label:r.takeOver}]};default:return{tone:"warning",urgent:!1,lead:r.editing({name:d,noun:t}),body:r.editingBody({seen:u}),actions:[{kind:"view-read-only",label:r.viewReadOnly},{kind:"take-over",label:r.takeOver,title:r.takeOverTold}]}}}function A({access:n,conflict:i,noun:a,onTakeOver:s,onViewReadOnly:l,onReload:r}){const d=H(n,i,a,{notice:o("notice",e),lock:o("lock",t)});if(!d)return null;const u={reload:r,"take-over":s,"take-back":s,"view-read-only":l},m=d.actions.map(e=>e.title?/* @__PURE__ */c(h,{content:e.title,side:"bottom",children:/* @__PURE__ */c(k,{variant:"secondary",size:"sm",onClick:u[e.kind],children:e.label})},e.kind):/* @__PURE__ */c(k,{variant:"secondary",size:"sm",onClick:u[e.kind],children:e.label},e.kind));/* @__PURE__ */
|
|
21
21
|
return c("div",{className:`es-notice is-${d.tone}`,role:d.urgent?"alert":"status",children:/* @__PURE__ */c(b,{tone:"warning"===d.tone?"warning":"info",title:d.lead,action:/* @__PURE__ */c("span",{className:"es-notice-actions",children:m}),children:d.body})})}var q={left:288,right:320},D=220,G=560;function I(e){return Math.min(560,Math.max(220,Math.round(e)))}function J(e){return{"--es-left-w":`${e.left}px`,"--es-right-w":`${e.right}px`}}function K(e,n){e.style.setProperty("--es-left-w",`${n.left}px`),e.style.setProperty("--es-right-w",`${n.right}px`)}export{q as DEFAULT_PANEL_W,B as DeviceSwitch,R as EaselIconButton,C as EaselTopBar,A as EditNotice,M as InspectorHead,S as InspectorIconButton,P as InspectorUpLevel,G as MAX_PANEL_W,D as MIN_PANEL_W,Y as MediaPanelHead,j as PanelResizeHandle,$ as SaveState,W as SaveStateToggle,O as TopBarCluster,x as TopBarDivider,z as TopBarRail,I as clampPanelWidth,H as editNotice,T as mediaPickKind,J as panelWidthVars,K as setPanelWidthVars};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-
|
|
1
|
+
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-KSTX646X.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-MCHMF32I.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
|
|
2
2
|
/* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(a,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
|
|
3
3
|
return o(n,{align:"start",triggerClassName:"sf-add-card",items:u,trigger:/* @__PURE__ */c(i,{children:[
|
|
4
4
|
/* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),m.addBlockMenu]})})}export{l as AddBlockRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-MCHMF32I.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-AELNNAFM.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-
|
|
1
|
+
import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-M6F6LS3H.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-ZAOM6PFH.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-MCHMF32I.js";import{DEFAULT_CANVAS_WORDS as n}from"./chunk-AELNNAFM.js";import{DEFAULT_TREE_WORDS as c}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-KFV7N2DJ.js";import{DEFAULT_NODE_MENU_WORDS as f}from"./chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Y2G7CU6A.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-JZDEIRH4.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-FFYXVAAL.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-O2NLQBFX.js";var F={notice:i,lock:u,save:p,chrome:e,rail:k,tree:c,panel:s,fields:h,pick:r,drag:l,menu:f,styleClipboard:t,copy:j,canvas:n,textStyles:o,screen:m},a=o=>"object"==typeof o&&null!==o;function A(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:a(n)?t[m]=a(c)?A(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function y(o,r){return r?A(o,r):o}export{F as DEFAULT_EASEL_STRINGS,y as mergeEaselStrings};
|
package/dist/drag/drag.css
CHANGED
|
@@ -215,62 +215,11 @@
|
|
|
215
215
|
font-size: 12.5px;
|
|
216
216
|
color: var(--es-muted);
|
|
217
217
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
margin-bottom:
|
|
223
|
-
padding: 0 12px;
|
|
224
|
-
height: 38px;
|
|
225
|
-
background: var(--es-track-bg);
|
|
226
|
-
border: 1px solid var(--es-input-border);
|
|
227
|
-
border-radius: var(--radius-lg);
|
|
228
|
-
color: var(--es-muted);
|
|
229
|
-
transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
|
|
230
|
-
}
|
|
231
|
-
.es-add-search:focus-within {
|
|
232
|
-
border-color: var(--es-accent);
|
|
233
|
-
background: var(--es-panel);
|
|
234
|
-
box-shadow: 0 0 0 3px var(--es-accent-ring);
|
|
235
|
-
}
|
|
236
|
-
.es-add-search > svg {
|
|
237
|
-
flex: none;
|
|
238
|
-
}
|
|
239
|
-
.es-add-search input {
|
|
240
|
-
flex: 1;
|
|
241
|
-
min-width: 0;
|
|
242
|
-
border: none;
|
|
243
|
-
background: transparent;
|
|
244
|
-
outline: none;
|
|
245
|
-
box-shadow: none;
|
|
246
|
-
padding: 0;
|
|
247
|
-
font: inherit;
|
|
248
|
-
font-size: 13.5px;
|
|
249
|
-
color: var(--es-text);
|
|
250
|
-
}
|
|
251
|
-
.es-add-search input::placeholder {
|
|
252
|
-
color: var(--es-field-placeholder);
|
|
253
|
-
opacity: 1;
|
|
254
|
-
}
|
|
255
|
-
.es-add-search input::-webkit-search-cancel-button {
|
|
256
|
-
display: none;
|
|
257
|
-
}
|
|
258
|
-
.es-add-search-clear {
|
|
259
|
-
flex: none;
|
|
260
|
-
display: flex;
|
|
261
|
-
align-items: center;
|
|
262
|
-
justify-content: center;
|
|
263
|
-
width: 20px;
|
|
264
|
-
height: 20px;
|
|
265
|
-
border: none;
|
|
266
|
-
border-radius: var(--radius-md);
|
|
267
|
-
background: transparent;
|
|
268
|
-
color: var(--es-muted);
|
|
269
|
-
cursor: pointer;
|
|
270
|
-
}
|
|
271
|
-
.es-add-search-clear:hover {
|
|
272
|
-
background: var(--es-divider);
|
|
273
|
-
color: var(--es-text);
|
|
218
|
+
/* The search is the shell's `Input` (leftIcon, rightAdornment): one field.
|
|
219
|
+
`.es-add-search*` WAS HERE — a frame round a bare input, which the dark
|
|
220
|
+
theme painted a darker strip inside. Only the room under it is the panel's. */
|
|
221
|
+
.es-add-find {
|
|
222
|
+
margin-bottom: var(--es-space-16);
|
|
274
223
|
}
|
|
275
224
|
.es-add-group + .es-add-group {
|
|
276
225
|
margin-top: 16px;
|