efficient-easel 14.2.0 → 15.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 +0 -1
- package/dist/{CanvasDragLayer-CLb7j-CZ.d.ts → CanvasDragLayer-dZCPbQCP.d.ts} +1 -1
- package/dist/canvas/index.d.ts +21 -1
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-NY7HHUGB.js → chunk-23VM4PMV.js} +2 -2
- package/dist/chunk-5EPK5WB3.js +1 -0
- package/dist/{chunk-CSGTPJTY.js → chunk-EHBWUEEE.js} +4 -4
- package/dist/chunk-FRXE6EQN.js +5 -0
- package/dist/{chunk-F3A7SXSV.js → chunk-GOABCALQ.js} +1 -1
- package/dist/{chunk-44QA42OJ.js → chunk-GS44HQ45.js} +1 -1
- package/dist/{chunk-CY52PUMZ.js → chunk-HM7S7H5H.js} +1 -1
- package/dist/{chunk-35VMTYPH.js → chunk-JASNL4KG.js} +3 -3
- package/dist/{chunk-AYWN5NRH.js → chunk-KAML3KQH.js} +1 -1
- package/dist/chunk-OFBZOI6W.js +1 -0
- package/dist/{chunk-TR4APEJZ.js → chunk-OJ6QWOLG.js} +1 -1
- package/dist/chunk-POSLNRTO.js +18 -0
- package/dist/chunk-QKZPPI5O.js +57 -0
- package/dist/chunk-SMM3ST7A.js +13 -0
- package/dist/chunk-U6LJ5UKD.js +6 -0
- package/dist/chunk-VJZDNOQ7.js +1 -0
- package/dist/chunk-X4T6JT3M.js +1 -0
- package/dist/{chunk-YKJ3RIMT.js → chunk-YQVR54RE.js} +1 -1
- package/dist/{chunk-CMXK3JT3.js → chunk-Z62Z75UI.js} +1 -1
- package/dist/copy/copy.css +9 -9
- package/dist/copy/index.d.ts +2 -29
- package/dist/copy/index.js +12 -13
- package/dist/drag/drag.css +22 -0
- package/dist/drag/index.d.ts +2 -2
- package/dist/drag/index.js +1 -1
- package/dist/easel/easel.css +26 -0
- package/dist/easel/index.js +1 -1
- package/dist/pick/index.d.ts +5 -70
- package/dist/pick/index.js +1 -3
- package/dist/pick/pick.css +1 -21
- 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 +3 -3
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +2 -2
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +2 -2
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +2 -2
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/usePartBridge.d.ts +2 -2
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +2 -2
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +2 -2
- 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 +2 -2
- package/dist/screen/lib/screen-parts.js +1 -1
- 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/text-styles/index.js +36 -36
- package/dist/{words-BDignMl_.d.ts → words-CvwYvkJm.d.ts} +2 -0
- package/dist/{words-is_Vy6hn.d.ts → words-DWvCJXwR.d.ts} +2 -37
- package/package.json +3 -3
- package/dist/chunk-5XUMLKQF.js +0 -6
- package/dist/chunk-643PVCEG.js +0 -1
- package/dist/chunk-D46OYLJR.js +0 -5
- package/dist/chunk-ILXP5VX5.js +0 -1
- package/dist/chunk-LPM2SCM4.js +0 -13
- package/dist/chunk-NW4LJ4G4.js +0 -1
- package/dist/chunk-QFVRMARS.js +0 -18
- package/dist/chunk-XGW6NWLC.js +0 -1
- package/dist/chunk-XUAKHY4T.js +0 -57
package/dist/chunk-XUAKHY4T.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import{styleClipboardOf as e}from"./chunk-XT6DOSHO.js";import{markedTreeNodeId as n,revealSelectedTreeRow as t,sameSelector as o}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as r}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as i}from"./chunk-26OOWIJJ.js";import{ScreenSaveIcon as l,ScreenMainButton as s}from"./chunk-RSKHAHPJ.js";import{useBrowserOffline as d}from"./chunk-RKTF5XLP.js";import{scrollPreviewToSection as c,gotoPreviewSlide as a,scrollPreviewToTop as p}from"./chunk-3Z2MVLCD.js";import{useEaselKeyTarget as u,useEaselUndoKeys as f,useEaselSaveKey as h,editorRootFocus as m}from"./chunk-CY52PUMZ.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-TZIIRGVY.js";import{usePartBridge as v}from"./chunk-CMXK3JT3.js";import{useSectionOps as b}from"./chunk-TR4APEJZ.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-D46OYLJR.js";import{SidePanelHead as z,PanelShowStrip as C}from"./chunk-62VPYC7F.js";import{MediaSidePanel as B}from"./chunk-44QA42OJ.js";import{useScreenSaveSwitch as I,useScreenNodeKeys as O,useScreenPinned as N,useScreenDocumentLabel as P,useScreenCanvasFrame as $,useScreenInspectorPanel as M,useScreenDevices as T,useScreenPickFollowsSelection as j,useScreenLeftView as A,SELECTION_MODE as L,sameInspectorMode as R,useScreenBridges as E,useScreenBlockRules as V,useScreenBlockLook as F,useScreenStorageNamespace as H,useScreenNotify as W,useScreenCanvasHead as D,isSlotMode as J,useScreenStyleClipboard as U,useScreenDocumentPass as Y,useScreenCanvasDrag as G,ScreenCanvasTargetProvider as X,isPinnedFirst as Z,isPinnedLast as K,screenSlotsOf as q}from"./chunk-CSGTPJTY.js";import{useNodeClipboard as _,useNodeContextMenu as Q}from"./chunk-NW4LJ4G4.js";import{PageEditGuardNotices as ee}from"./chunk-2H3W5OLQ.js";import{useScreenDocument as ne}from"./chunk-ZZ64CEC2.js";import{requestMediaPick as te}from"./chunk-KG7RJWOK.js";import{useMediaPanel as oe,usePanelPick as re,useCancelPanelPick as ie}from"./chunk-R6WTQWAC.js";import{useEaselSession as le}from"./chunk-O7Q4DDJT.js";import{useEaselHost as se,useHostEscape as de}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as ce}from"./chunk-VVPZMWJE.js";import{heldStyle as ae,styleShortcut as pe}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ue}from"./chunk-6WY6ZXJG.js";import{DEFAULT_NODE_MENU_WORDS as fe}from"./chunk-WK3AFPXY.js";import{rootRowName as he,slotChildRowName as me,slotChildRenameProp as ge,sectionRenameProp as ye}from"./chunk-TBF5CVPA.js";import{ROOT_ZONE as ke,blockNodeActions as Se,TREE_MAX_DEPTH as ve,childSlotsOf as be,slotFieldsOf as we,slotChildrenIn as xe,nestsInTree as ze,newNodeId as Ce}from"./chunk-PLVEGYK6.js";import{useEasel as Be,useEaselApi as Ie,CanvasPassThroughContext as Oe}from"./chunk-LPM2SCM4.js";import{toItemSelector as Ne,useNodeOps as Pe,clickPick as $e}from"./chunk-ECM5F6JJ.js";import{TreeRow as Me,Subtree as Te,LayersTree as je,TreeGroupLabel as Ae,TreeRowAction as Le,TreeSeam as Re}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as Ee}from"./chunk-K56YDHYQ.js";import{LayersIcon as Ve,MediaIcon as Fe}from"./chunk-4VJATVVR.js";import{EaselTopBar as He,TopBarRail as We,TopBarCluster as De,EaselIconButton as Je,TopBarDivider as Ue,DeviceSwitch as Ye,InspectorIconButton as Ge,PanelResizeHandle as Xe,MAX_PANEL_W as Ze,MIN_PANEL_W as Ke,panelWidthVars as qe}from"./chunk-IE55HNMA.js";import{DEFAULT_NOTICE_WORDS as _e,DEFAULT_CHROME_WORDS as Qe}from"./chunk-Z6PVRXVY.js";import{holderOf as en,nameOrSomeone as nn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as tn}from"./chunk-RE4LP46F.js";import{useWords as on}from"./chunk-MFIRYGHW.js";import{insertSeams as rn,CanvasDragLayer as ln,CanvasInsert as sn}from"./chunk-QFVRMARS.js";import{DEFAULT_DRAG_WORDS as dn}from"./chunk-AYWN5NRH.js";import{createDragSession as cn,useTreeDrag as an,gapToMoveIndex as pn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as un,LIST_SELECTOR as fn,BLOCK_SELECTOR as hn,useCanvasEvent as mn,nodeIdAt as gn,frameRectToHost as yn,BLOCK_ATTRIBUTE as kn,drawnBox as Sn}from"./chunk-ILXP5VX5.js";import{ROOT_ID as vn,ROOT_SLOT as bn,zoneKey as wn,parseZoneKey as xn,find as zn,DataError as Cn}from"./chunk-KRXQM65X.js";import{useRef as Bn,useMemo as In,useState as On,useEffect as Nn,useCallback as Pn,useLayoutEffect as $n,Fragment as Mn}from"react";import{ColoredBadge as Tn,toast as jn,groupColors as An}from"efficient-shell/ui";import{UndoIcon as Ln,RedoIcon as Rn,RefreshIcon as En,AddIcon as Vn,TrashIcon as Fn,EyeOffIcon as Hn,EyeIcon as Wn,DuplicateIcon as Dn}from"efficient-shell/icons/efficient";import{jsx as Jn,jsxs as Un,Fragment as Yn}from"react/jsx-runtime";var Gn=/* @__PURE__ */new WeakSet;function Xn(e,n,t){const o=zn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function Zn({canvas:e,tabs:n,onSelect:t}){const o=Bn(null),[r,i]=On({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return $n(()=>{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=yn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),c={};for(const o of n){const n=t.querySelector(`[${kn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?Sn(n):null;if(!i||0===i.height){c[o.id]=null;continue}const s=yn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),a=s.top+s.height;if(a<d.top||s.top>d.top+d.height){c[o.id]=null;continue}const p=o.below?a+4:Math.max(s.top,d.top)+6;c[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(c)},c=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",c,!0),r.addEventListener("resize",c);const a=new r.MutationObserver(c);return a.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",c,!0),r.removeEventListener("resize",c),a.disconnect()}},[e,l]),/* @__PURE__ */Jn("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */Jn("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:/* @__PURE__ */Jn(Tn,{colorClass:An("info","solid"),size:"sm",children:e.label})},e.id):null})})}function Kn({expand:e}){/* @__PURE__ */
|
|
2
|
-
return Jn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Un(Yn,e?{children:[
|
|
3
|
-
/* @__PURE__ */Jn("path",{d:"M8 9l4-4 4 4"}),
|
|
4
|
-
/* @__PURE__ */Jn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
5
|
-
/* @__PURE__ */Jn("path",{d:"M8 4l4 4 4-4"}),
|
|
6
|
-
/* @__PURE__ */Jn("path",{d:"M8 20l4-4 4 4"}),
|
|
7
|
-
/* @__PURE__ */Jn("path",{d:"M5 12h14"})]})})}var qn=`${fn}, ${hn}`;function _n(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 Qn="__rungs";var et="screen:band",nt={duplicate:!0,delete:!0};function tt(){const fn=se(),{target:yn,docId:kn,capabilities:Sn,currentSlug:An,siteId:tt,onPublish:ot,saveState:rt,saveConflict:it,retrySave:lt,toggleAutoSave:st,flushSave:dt,access:ct,saveUnreachable:at=!1,readOnly:pt,readOnlyReason:ut=null}=ne(),ft=I(),ht=O(),{mediaEditing:mt,hasEditGuard:gt,hasPinnedChrome:yt}=Sn,{appState:kt,dispatch:St,history:vt,selectedItem:bt,getSelectorForId:wt,config:xt}=Be(e=>e),zt=N(),{first:Ct,firstGroup:Bt,lastGroup:It,isSectionGroup:Ot,sectionGroupZone:Nt,panelOf:Pt}=zt,$t=Pt(Ct),Mt=e=>Z(zt,e),Tt=e=>K(zt,e),jt="node"===zt.firstRow,At=zt.band??null,Lt=on("screen",ce),Rt=on("tree",Ee),Et=on("drag",dn),Vt=on("notice",_e),Ft=on("lock",tn),Ht=on("menu",fe),Wt=on("styleClipboard",ue),Dt=on("chrome",Qe),Jt=P()??`/${An}`,Ut=$(),Yt=M(),Gt=b({readOnly:pt}),Xt=b({readOnly:pt,foldIntoHistory:!0}),Zt=Bn(null),Kt=Ie(),qt=In(()=>({...Gt,select:e=>{Zt.current=e,Gt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Kt.config;Zt.current=Ne(e,t,n)}Gt.commitDocument(e,n)}}),[Gt,Kt]),_t=kt.ui,Qt=_t.leftSideBarVisible,eo=_t.rightSideBarVisible,{options:no,widths:to,initial:oo,fluid:ro,fit:io}=T(),[lo,so]=On(oo),co=oe(),ao=mt&&null!==co,po=re(),uo=ie();j(bt?.props.id);const{read:fo,write:ho,forSelection:mo}=A(),[go,yo]=On(fo);Nn(()=>{ho(go)},[go]);const[ko,So]=On(0),vo=Bn(null),bo=Bn(null),wo=un(bo,{readySelector:qn}),xo=u(bo);f(bo,wo);const zo=d(),Co=en(ct),Bo={state:rt,offline:zo||rt.failed&&at,readOnlyReason:ut,editing:Co?Vt.editing({name:nn(Co.name,Ft),noun:Lt.noun}):null,conflict:null!=it,notSaving:Lt.bar.notSaving},Io=()=>{pt||(rt.failed?lt():dt())};h(bo,wo,Io);const[Oo,No]=On(!1),Po=Bn(!1),$o=Bn(!1),[Mo,To]=On(null),[jo,Ao]=On([]),[Lo,Ro]=On(L),Eo="puck"===Lo.kind,Vo=n(Lo,bt?.props.id),[Fo,Ho]=On(null);Nn(()=>{Fo&&(t(),Ho(null))},[Fo]);const Wo=Bn(wt);Wo.current=wt;const Do=Pn((e,{scroll:n})=>{yo(n=>mo(e,n)),n&&Ho(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Wo.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Sr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Jo=Bn(null);Nn(()=>{const e=Jo.current;Jo.current=null;const n=null==bt?.props.id?null:String(bt.props.id);Ro(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Pt(bt?.type)??L);const t=bt?.props.id,r=Zt.current;if(Zt.current=null,!t)return;const i=wt(t);Do(String(t),{scroll:!o(r,i??null,ke)})},[bt?.props.id,Do]);const Uo=Pn(e=>{Ro(n=>R(n,e)?n:e),St({type:"setUi",ui:{rightSideBarVisible:!0}})},[St]),Yo=Bn(()=>{});Yo.current=(e,n)=>{const t=e?ui(e.zone??ke)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==bt?.props.id?null:String(bt.props.id);Ro(e=>R(e,n)?e:n),o!==r&&(Jo.current={id:o,mode:n},qt.select(e))};const Go=Pn((e,n)=>Yo.current(e,n),[]),Xo={kind:Lo.kind,mode:Lo,open:Uo,show:e=>Ro(e),reveal:()=>{eo||St({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Go},Zo=E(Xo,{data:kt.data,selected:bt??null,zoneOf:e=>wt(e)?.zone,readOnly:Boolean(pt),select:e=>{Ro(L),qt.select({index:e})},replace:(e,n)=>qt.replaceComponent(ke,e,n),scrollTo:e=>Ri(e)},{device:lo,refreshes:ko},{setView:yo,reveal:()=>{Qt||St({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Ko=Zo.pinnedSource??!1,qo=Zo.resolveLeftView?Zo.resolveLeftView(go,ao):"media"===go&&ao?go:"sections",_o=V(),{isLockedBlock:Qo,duplicateBlocked:er,nestDepth:nr,newSectionNode:tr,canAddTo:or,blockIsOffered:rr}=_o,ir=F(),{labelAtLevel:lr,Icon:sr,useProducts:dr}=ir,cr=ir.rowName?(e,n,t)=>ir.rowName(e,n,t):void 0,ar=Pn(e=>{St({type:"setUi",ui:{rightSideBarVisible:!0}}),c(e),Do(e,{scroll:!0})},[St,Do]),{selectNode:pr,openPartId:ur}=v({mode:Lo,setMode:Ro,onOpenPart:ar}),[fr,hr]=On(null);de(null!==fr,()=>hr(null));const mr=y(H()),gr=mr.collapsed,yr=mr.panelWidths,[kr,Sr]=On(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(gr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
8
|
-
return new Set}});Nn(()=>{try{window.localStorage.setItem(gr,JSON.stringify([...kr]))}catch{}},[kr]);const[vr,br]=On(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(yr);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}}});Nn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(yr,JSON.stringify(vr))}catch{}},300);return()=>clearTimeout(e)},[vr]);const wr=Pn((e,n)=>br(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),xr=Pn(e=>wr("left",e),[wr]),zr=Pn(e=>wr("right",e),[wr]),Cr=e=>kr.has(e),Br=e=>Sr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Ir=Bn(!1),Or=Bn(null);Nn(()=>{if(Ir.current&&!Oo){const e=Or.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??bo.current?.querySelector(`button[aria-label="${CSS.escape(Lt.add.title)}"]`))?.focus(),Or.current=null}Ir.current=Oo},[Oo]),Nn(()=>{if(!Oo||!xo)return;const e=e=>{"Escape"===e.key&&Ui()};return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[Oo,xo]),de(Oo,()=>Ui()),Nn(()=>{!Qt&&Oo&&(No(!1),To(null),Po.current=!1)},[Qt]),Nn(()=>{if(!po)return $o.current&&St({type:"setUi",ui:{leftSideBarVisible:!1}}),void($o.current=!1);Oo&&(No(!1),To(null),$o.current=Po.current,Po.current=!1),Qt||($o.current=!0,St({type:"setUi",ui:{leftSideBarVisible:!0}}))},[po]),Nn(()=>{!Qt&&po&&($o.current=!1,uo())},[Qt]),Nn(()=>{if(!po||!xo)return;const e=e=>{"Escape"===e.key&&uo()};return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[po,xo]),de(null!==po,()=>uo());const Nr=W(),Pr=(e,n="success",t)=>{if(Nr)return void(t?Nr(e,"error"===n?"error":"info",t):Nr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?jn.error(e,{...o,duration:t?.duration??3200}):jn.success(e,{...o,duration:t?.duration??1900})},$r=Bn(null),[Mr,Tr]=On(0),[jr,Ar]=On(0),Lr=D(),Rr=Bn(null),Er=e=>Math.max(0,e.clientHeight-(Rr.current?.offsetHeight??0));Nn(()=>{const e=$r.current;if(!e)return;const n=()=>{Tr(e.clientWidth),Ar(Er(e))};n();const t=new ResizeObserver(n);return t.observe(e),Rr.current&&t.observe(Rr.current),()=>t.disconnect()},[]),$n(()=>{$r.current&&(Tr($r.current.clientWidth),Ar(Er($r.current)))},[vr,Qt,eo]);const Vr=lo===ro?Mr>0?Mr:to[ro]:to[lo],Fr=Mr>0?Math.min(Mr/Vr,"shrink"===io?1:2):1,Hr=Vr*Fr,Wr=Mr>0&&Hr>Mr+1,Dr={width:Hr,height:jr||"100%",flex:"none",position:"relative"},Jr={width:Vr,height:jr?jr/Fr:"100%",maxHeight:"none",transform:1!==Fr?`scale(${Fr})`:void 0,transformOrigin:"top left"},Ur=()=>St({type:"setUi",ui:{leftSideBarVisible:!Qt}}),Yr=()=>St({type:"setUi",ui:{rightSideBarVisible:!eo}}),Gr=e=>{Oo&&(No(!1),To(null),Po.current=!1,Qt&&go===e)||po&&($o.current=!1,uo(),Qt&&go===e)||(Qt&&go===e?Ur():(yo(e),Qt||St({type:"setUi",ui:{leftSideBarVisible:!0}})))},Xr=()=>{te(fn,{accept:"image/*",title:Dt.mediaLibrary})},Zr=()=>{Ro(L),qt.select(null),p()},Kr=()=>{Ro($t??L),eo||St({type:"setUi",ui:{rightSideBarVisible:!0}})},qr=kt.data.content??[],_r=()=>{const e=qr.findIndex(Mt),n=qr.findIndex(Tt);return{floor:e>=0?e+1:0,cap:n>=0?n:qr.length}},Qr=xt,ei=_o.stripCopy,ni=e=>r(e,ei),ti=_(),oi=Pe({data:kt.data,config:Qr,readOnly:Boolean(pt),clipboard:ti,strip:ei?e=>ei(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==vn||e.slot!==bn)return{min:0,max:n-1};const{floor:t,cap:o}=_r();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Ro(L);const t=void 0===n||"node"===n?.kind?n:null;qt.commitDocument(e,t)}}),ri=e=>{const n=zn(kt.data,xt,e);if(!n)return!1;const t=wn(n.place),o=n.node,r=t===ke?ci(o):xi(o);return!!oi.remove(e)&&(Pr(Lt.deleted({name:r}),"success",{duration:8e3,action:{label:Lt.bar.undo,onClick:()=>{oi.restore(n.node,n.place)}}}),!0)},ii={...oi,remove:ri},li=e=>lr(e,"block",xt.components[e]?.label??e),si=Pn(e=>xt.components[e]?.defaultProps??{},[xt]),di=e=>lr(e,"section",li(e)),ci=e=>he({type:e.type,props:e.props??{}},di(e.type),cr),{nodeAddresses:ai,zoneItems:pi}=In(()=>{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>=ve)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of be(xt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(qr,ke,0),{nodeAddresses:e,zoneItems:n}},[qr,xt]),ui=Pn(e=>pi.get(e)??[],[pi]),fi=e=>{const n=ai.get(e);return n?ui(n.zone)[n.index]:void 0},hi=e=>q(_o,xt,e),mi=e=>{if(!_o.slotsOf||e===ke)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=fi(e.slice(0,n));if(!t)return null;const o=hi(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}},gi=(()=>{if(!J(Lo))return null;const e=`${Lo.nodeId}:${Lo.slot}`;return mi(e)?.slot.panel===Lo.kind?e:null})(),yi=Bn(null);Nn(()=>{const e=yi.current;if(yi.current=null,!gi||!J(Lo))return;const n=Lo.nodeId;Do(n,{scroll:e!==gi}),Sr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Lo]);const ki=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=ai.get(e);n&&(n.zone===ke?Ei(n.index):ul(n.zone,n.index,e,fi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&gi!==i&&(yi.current=i),Go(null,r),eo||St({type:"setUi",ui:{rightSideBarVisible:!0}}),Ri(o)},Si=(e,n,t)=>{const o=`${e}:${n}`;if(Sr(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;gi!==o&&(yi.current=o);Go(null,{kind:t,nodeId:e,slot:n})},vi=(e,n,t)=>{if(pt||!_o.moveSlot)return;const o=fi(e),r=o?hi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Qn,index:n},s=pn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=_o.moveSlot(e,n,s);"string"==typeof d&&Si(e,d,i.panel)},bi=dr(),wi=In(()=>{const e=/* @__PURE__ */new Map;for(const n of bi??[])e.set(n.slug,n.name);return e},[bi]),xi=e=>me(e,li,ir.plainText,e=>wi.get(e),ir.rowName),zi=(e,n)=>{const t=xt.components[e.type]?.fields,o=n===ke||Tl(n)?"section":"block",r=n===ke&&(Mt(e)||Tt(e)||Ot(e.type)),i="block"===o?ge(t):r?null:ye(t);return ir.renamePropOf?ir.renamePropOf(e,o,i):i},Ci=(e,n,t,o)=>{if(!(!pt&&fr?.zone===e&&fr.index===n))return;const r=(t,o)=>{hr(null),o&&((e,n,t)=>{const o=ui(e)[n];if(!o)return;const r=zi(o,e);r&&qt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
9
|
-
return Jn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Lt.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)},Bi=e(U(),Wt),Ii=Bi.scope({target:yn,siteId:tt,docId:kn}),Oi=xt,Ni=(e,n)=>n===ke?di(e):li(e),Pi=(e,n,t)=>{const o=Bi.plan(Ii,t,Ni(t.type,e),Oi);o&&(o.changed&&qt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Pr(o.message))},$i=Q({nodesIn:ui,nodeAt:(e,n)=>ui(e)[n]??null,labelOf:(e,n)=>n===ke?di(e):li(e),renamePropOf:zi,beginRename:(e,n)=>hr({zone:e,index:n}),history:{hasPast:vt.hasPast,hasFuture:vt.hasFuture,back:()=>vt.back(),forward:()=>vt.forward()},openPageSettings:()=>{qt.select(null),Ro(L)},pageSettingsLabel:Lt.pageSettings,words:{menu:Ht,styleClipboard:Wt,screen:Lt.menu},readOnly:Boolean(pt),collapseAll:()=>Sr(new Set(ui(ke).map(e=>String(e.props.id)))),onPasteRefused:e=>Pr(e?Lt.pasteRefused({name:e.label}):Lt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Ll(e,n),menuRows:Zo.menuRows,isLocked:e=>Qo(e.type),duplicateBlocked:e=>er(kt.data,e),permits:e=>Se(xt,e.type),nodeOps:ii,isPinned:(e,n)=>n===ke&&(Mt(e)||Tt(e)),sectionBand:_r,locate:e=>ai.get(e)??null,rowNameOf:(e,n)=>n===ke?ci(e):xi(e),selectAt:(e,n,t,o)=>{e===ke?Ei(n):ul(e,n,t,o??"")},slotRung:e=>{const n=mi(e);return n?.slot.panel?{label:n.slot.label,select:()=>ki(n.node,n.slot,!1)}:null},style:{held:()=>ae(Ii),canCopy:e=>Bi.rows(Oi,e).some(e=>!1!==e.counted),copy:(e,n)=>Bi.copy(Ii,e,Ni(e.type,n),Oi),paste:(e,n,t)=>Pi(e,n,t)},keys:ht?{target:xo,selected:()=>{const e=kt.ui.itemSelector;return e?{zone:e.zone??ke,index:e.index}:null},held:()=>ti.get(),readOnly:Boolean(pt),onDone:({done:e,name:n})=>{"copied"===e&&Pr(Lt.copied({name:n}))}}:void 0},wo),Mi=Bn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Nn(()=>{Mi.current={copy:(e,n)=>Bi.copy(Ii,e,Ni(e.type,n),Oi),paste:Pi,at:()=>{const e=kt.ui.itemSelector;if(!e)return null;const n=e.zone??ke,t=ui(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(pt)}});const Ti=Pn(e=>{const n=pe(e);if(!n)return;const t=Mi.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))},[]);Nn(()=>{if(!xo)return;const e=e=>Ti(e);return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[Ti,xo]),mn(wo,"keydown",Ti);const ji=qr.map(e=>e.props.id).join("|");Nn(()=>{const e=wo?.document??null,n=wo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Ao(e=>e.length?[]:e);const n=qr.findIndex(Tt),t=n>=0?n:qr.length,o=n=>{const t=qr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(hn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=qr.length>0&&!Mt(qr[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=_n(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})}Ao(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()}},[wo,ji,lo,Fr,Qt,eo,bt?.props.id]);const Ai=wo?.document??null,Li=wo?.window??null;Nn(()=>{const e=vo.current;if(!e||!Ai||!Li)return;const n=[],t=()=>{const n=Ai.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Li.scrollTo({left:Li.scrollX,top:Li.scrollY+t,behavior:"instant"}),!0};return vo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Ai,Li]);const Ri=e=>{Zo.holdCanvasOn?Zo.holdCanvasOn(e):c(e)},Ei=e=>{Ro(L),qt.select({index:e}),Zo.sectionPressed?.(qr[e]);const n=qr[e]?.props?.id;n&&Ri(n)},Vi=e=>{const{floor:n,cap:t}=_r(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=bt&&Lo.kind!==$t?.kind?qr.findIndex(e=>e.props.id===bt.props.id):-1;return o(r>=0?r+1:t)},Fi=(e,n)=>{const{floor:t,cap:o}=_r(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(qt.reorderComponent(ke,e,i),qt.select({index:i}),{moved:!0,dest:i})},Hi=(e,n,t,o)=>{Ro(L),qt.select(o?{index:o.index,zone:o.zone}:{index:e}),c(n),Pr(Lt.sectionAdded({name:t}))},Wi=(e,n)=>{const t=Vi(n),o=tr(e,{nodeDefaults:si,newNodeId:Ce,sectionLabel:di,blockIsOffered:rr}),r=o?qt.insertNode(ke,t,o):qt.insertSection(e,t);return Hi(t,r,di(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 be(xt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=or(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},Di=e=>Ji(ke,e),Ji=(e,n)=>{Or.current=document.activeElement??null,po&&(Po.current=$o.current,$o.current=!1,uo()),To(null===n?null:{zone:e,index:n}),No(!0),Qt||(Po.current=!0,St({type:"setUi",ui:{leftSideBarVisible:!0}}))},Ui=()=>{No(!1),To(null),Po.current&&St({type:"setUi",ui:{leftSideBarVisible:!1}}),Po.current=!1},Yi=(e,n)=>ir.rowName?n?Mt(e)?ir.rowName(e,"section",Lt.header):Tt(e)?ir.rowName(e,"section",Lt.footer):Ot(e.type)?ir.rowName(e,"section",li(e.type)):ci(e):xi(e):n?di(e.type):li(e.type),Gi=e=>n=>{e()},Xi=()=>Zo.editPinnedSource?.(),Zi=(e,n,t)=>{if(pt)return null;const o=ui(e)[n];return o&&!Se(xt,o.type).delete?null:/* @__PURE__ */Jn(Le,{kind:"delete",label:Lt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=ui(e)[n]?.props?.id;null!=t&&ri(String(t))})(e,n),children:/* @__PURE__ */Jn(Fn,{size:15})})},Ki=e=>ir.rowPreview?.(e)||void 0,qi=e=>ir.rowMarks?.(e)??void 0,_i=(e,n,t)=>ir.rowActions?.(e,n,t)??null,Qi=(e,n,t,o)=>{if(pt)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
10
|
-
return Jn(Le,{kind:"eye",label:r?Lt.showNamed({name:o}):Lt.hideNamed({name:o}),onClick:()=>nl(e,n,t),children:/* @__PURE__ */Jn(r?Hn:Wn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},el=e=>fs(ke,e),nl=(e,n,t)=>{qt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},tl=e=>we(xt,e),ol=e=>be(xt,e),rl=e=>_o.slotsOf?hi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:xe(e,n.slot)})):[{slot:null,rung:null,kids:ol(e)}],il=e=>_o.slotsOf?rl(e).flatMap(e=>e.kids):ol(e),ll=e=>Boolean(_o.slotsOf)&&hi(e).some(e=>e.rung),sl=(e,n,t)=>null===t?void 0===n?or(e):or(e,n):or(e,n,t),dl=(e,n,t)=>{const o=ze(xt,e.type,n)&&(t||il(e).length>0||ll(e));return{collapsible:o,folded:o&&Cr(String(e.props.id))}},cl=(e,n,t)=>rl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>dl(e,r,t(e.type)).collapsible?[String(e.props.id),...cl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),al=e=>il(e).length>0||ll(e)||Boolean(or(e.type)),pl=e=>Boolean(or(e)),ul=(e,n,t,o)=>{if(Ro(L),or(o)?.spec?.slider){const t=e.split(":")[0];a(t,n),qt.select({index:n,zone:e}),c(t)}else qt.select({index:n,zone:e}),Ri(t)},fl=(e,n,t,o,r)=>{const i=`${e}:${n}`;qt.insertComponent(i,t,o),or(r)?.spec?.slider?requestAnimationFrame(()=>{a(e,o),qt.select({index:o,zone:i})}):qt.select({index:o,zone:i})},hl=Bn(/* @__PURE__ */new Set);Nn(()=>{qr.forEach(e=>{const n=or(e.type)?.spec;if(!n)return;const t=e.props.id;if(hl.current.has(t))return;hl.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(si)).forEach((e,t)=>Xt.seedChild(o,t,n.childType,e))})},[qr,Xt,si]);const ml=Bn(/* @__PURE__ */new Set);Nn(()=>{qr.forEach((e,n)=>{const t=e.props.id;if(ml.current.has(t))return;const o=i(e,tl(e.type));ml.current.add(t),o&&Xt.replaceComponent(ke,n,{...e,props:o})})},[qr,Xt]),Y(Xt,xt);const gl=qr.findIndex(Tt),yl=gl>=0?qr[gl]:null,kl=jt?qr.findIndex(Mt):-1,Sl=kl>=0?qr[kl]:null,vl=zt.groupTab,bl=In(()=>vl?e=>Ot(e.type):void 0,[vl]),wl=Boolean(zt.groupBadge),xl=zt.groupBadge?/* @__PURE__ */Jn("span",{className:"es-tree-group-badge",children:/* @__PURE__ */Jn(Tn,{tone:"info",size:"xs",children:zt.groupBadge})}):void 0,zl=qr.find(e=>e.type===Bt)??null,Cl=qr.find(e=>e.type===It)??null,Bl=gl>=0?gl:qr.length,Il=[];qr.forEach(e=>{Tt(e)||(al(e)&&Il.push(String(e.props.id)),Il.push(...cl(e,1,pl)))}),yl&&(Il.push(String(yl.props.id)),Il.push(...cl(yl,1,pl)));const Ol=Il.length>0&&Il.every(e=>kr.has(e)),Nl=e=>{const n=ir.blockRowName(e,li);return ir.rowName?ir.rowName(e,"block",n):n},Pl=(e,n,t,o)=>{const r=ui(e)[t];if(!r)return;const i={...xn(e),index:t},l={...xn(n),index:Math.min(Math.max(o,0),ui(n).length)},s=pn(i,l);if(e!==n||s!==t)try{oi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Cn))throw e}},$l=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of ol(e))n.add(r),t(o)};for(const t of tl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Ml=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=ai.get(n);if(!e)return null;if(e.zone===ke)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Tl=e=>{const n=e.slice(0,e.indexOf(":")),t=qr.find(e=>Ot(e.type)&&String(e.props.id)===n);return t&&Nt(n)===e?t:null},jl=(e,n)=>{const t=Tl(e);return!t||(!zt.groupAccepts||zt.groupAccepts(t.type,n,ui(e).length))},Al=(e,n,t)=>{if(e.rung){const t=fi(e.rung.nodeId),o=t?hi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Qn&&n.index>=0&&n.index<=o}if(n.slot===Qn)return!1;if(e.add)return Vl(e.add,n);const o=wn(n);if(Ot(e.type))return!1;const r=Tl(o),i=Tl(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!jl(o,e.type))&&(n.index>=0&&n.index<=ui(o).length));if(e.zone===ke||o===ke){if(e.zone!==o)return!1;const{floor:t,cap:r}=_r();return n.index>=t&&n.index<=r}if(n.index<0||n.index>ui(o).length)return!1;if(e.zone===o)return!0;const l=yl&&!zt.lastIsOpen?String(yl.props.id):null;return(!l||Ml(e.zone)!==l&&Ml(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??ui(e)[t];if(!r)return!1;const i=n.split(":")[0],l=ai.get(i),s=l?ui(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&$l(r).has(n))return!1;const d=or(s.type,nr(kt?.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?.(ui(n),r))})(e.zone,o,e.index,t)},Ll=(e,n)=>{const t=wn(e.from),o=e.node;return t===wn(n)?jl(t,o.type):Al({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Rl=e=>{const n=e.slice(0,e.indexOf(":")),t=ai.get(n),o=t?ui(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=or(o.type,nr(kt?.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:li(r.spec.childType)}]:[]),l=mi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Yi(o,t.zone===ke)}},El=(e,n)=>{if("section"!==e.kind)return e;const t=wn(n);return t===ke||Tl(t)?e:Rl(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},Vl=(e,n)=>{const t=El(e,n),o=wn(n);if("block"!==t.kind){if(Tl(o)){const e="section"===t.kind?t.type:t.template.node.type;return jl(o,e)&&n.index>=0&&n.index<=ui(o).length}if(o!==ke)return!1;const{floor:e,cap:r}=_r();return n.index>=e&&n.index<=r}if(o===ke)return!1;const r=Rl(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(ui(o))},Fl=(e,n)=>{const t=El(e,n);if("block"!==t.kind&&Tl(wn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&jl(n,o)){if("section"===e.kind)qt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;qt.insertNode(n,t,ni(e.template.node))}Ro(L),qt.select({index:t,zone:n})}})(t,wn(n),n.index);if("section"===t.kind)return void Wi(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=Vi(t),r=qt.insertNode(ke,o,n);Hi(o,r,e)})(t.template.name,ni(t.template.node),n.index);const o=wn(n),r=Rl(o);r&&(r.target.spec?fl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{qt.insertComponent(e,n,t),Ro(L),qt.select({index:t,zone:e})})(o,t.type,n.index))},Hl=(e,n)=>{e.rung?vi(e.rung.nodeId,e.index,n.index):e.add?Fl(e.add,n):e.zone===ke?Fi(e.index,n.index):Pl(e.zone,wn(n),e.index,n.index)},[Wl]=On(()=>cn()),Dl=an({keyOf:e=>e.id,readOnly:Boolean(pt),session:Wl,canDrop:Al,onDrop:Hl,onStep:(e,n)=>{e.rung?vi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===ke?((e,n)=>{const t=di(qr[e]?.type??""),o=Fi(e,n<0?e-1:e+2);if(!o.moved)return void Pr(n<0?Lt.sectionFirst({name:t}):Lt.sectionLast({name:t}));const{floor:r,cap:i}=_r();Pr(Lt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Pl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Jl=Pn(e=>{const{floor:n,cap:t}=_r(),o=[];for(const r of e.nodes){const e=wn(r.place),i=ui(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Mt(i)||Tt(i)||Qo(i.type))continue;if(Ot(i.type))continue;const l=Boolean(Tl(e)),s=e===ke||l;e===ke&&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?di(i.type):xi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=wn(e.list);if(n===ke&&0===e.children.length)return[{...e,addLabel:Lt.addSection,addAlways:!0}];const t=Rl(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(Tl(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=wn(e.list),t=n===ke||Tl(n)?null:Rl(n);return t?.choices.length?rn(e,t.target.spec?.addLabel??Lt.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[kt.data]),Ul=null==bt?.props.id?null:String(bt.props.id),Yl=Pn(e=>{const n=xt,t=e=>!e.item.rung&&null!==zn(kt.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(Ul);return i||(r($e(kt.data,n,o.item.id,Ul,bl))??o)},[kt.data,xt,Ul,bl]),[Gl,Xl]=On(null);mn(wo,"mouseover",e=>{if(!vl)return;const n=gn(e.target),t=n?Xn(kt.data,xt,n):null;t!==Gl&&Xl(t)}),mn(wo,"mouseout",e=>{vl&&!e.relatedTarget&&Xl(null)});const Zl=e=>Mt(e)||Tt(e)||Ot(e.type),Kl=[];if(vl){const e=Ul?Xn(kt.data,xt,Ul):null;for(const n of/* @__PURE__ */new Set([e,Gl])){const e=n?qr.find(e=>String(e.props.id)===n):void 0;if(!e||!Zl(e))continue;const t=vl(e);t&&Kl.push({id:String(e.props.id),label:t,below:Mt(e)||e.type===Bt})}}const ql=le(),_l=Bn(null);Nn(()=>{const e=zt.changeNotice;if(!e)return;const n=JSON.stringify(qr.filter(Zl)),t=_l.current;if(_l.current={doc:kn,bands:n,index:vt.index},!t||t.doc!==kn||t.bands===n)return;vt.hasPast&&vt.index>=t.index&&!Gn.has(ql)&&(Gn.add(ql),Pr(e,"success",{action:{label:Lt.bar.undo,onClick:()=>vt.back()},duration:8e3}))},[qr]);const Ql=e=>{Ro(L),qt.select(e.zone===ke?{index:e.index}:{index:e.index,zone:e.zone})},es=G(),ns=()=>({data:kt.data,device:lo,ops:qt,inspector:Xo}),ts=es?.model,os=In(()=>ts?e=>ts(e,Jl(e),ns()):Jl,[ts,Jl,lo]),rs=es?.measure,is=rs?(e,n)=>rs(e,n,ns()):void 0,ls=es?.canDrop,ss=ls?(e,n)=>ls(e,n,Al,ns()):Al,ds=es?.drop,cs=ds?(e,n)=>ds(e,n,Hl,ns()):Hl,as=es?.pick,ps=as?e=>as(e,Ql,ns()):Ql,us=e=>{const n=wn(e),t=mi(n);t&&ki(t.node,t.slot,!1),Ji(n,e.index)},fs=(e,n)=>/* @__PURE__ */Jn(Re,{...pt?{}:Dl.seam({place:{...xn(e),index:n}})},`seam:${e}:${n}`),hs={rowClick:Gi,isCollapsed:Cr,toggleCollapse:Br},ms=e=>{const n=String(e.props.id),t=qr.findIndex(e=>String(e.props.id)===n),o=Nt(n),r=ui(o),i=Cr(n),l=li(e.type),s=ir.rowName?ir.rowName(e,"section",l):l,d=e=>fs(o,e);/* @__PURE__ */
|
|
11
|
-
return Un(Yn,{children:[
|
|
12
|
-
/* @__PURE__ */Jn(Me,{words:Rt,icon:/* @__PURE__ */Jn(sr,{type:e.type,size:13}),name:s,preview:Ki(e),marks:qi(e),onSelect:()=>Ei(t),nameSlot:Ci(ke,t,n,s),selected:Vo===n,badge:xl,actions:_i(e,ke,t)??void 0,rowProps:{"data-node-id":n,onClick:Gi(()=>Ei(t))},fold:{open:!i,label:"section",onToggle:()=>Br(n)}}),!i&&/* @__PURE__ */Un(Te,{children:[r.map((n,t)=>{const r=String(n.props.id),i=ci(n),l=al(n),s=l&&Cr(r),c=()=>ul(o,t,r,e.type),{rowProps:a,...p}=Dl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...xn(o),index:t}},{"data-node-id":r,onClick:Gi(c)});/* @__PURE__ */
|
|
13
|
-
return Un(Mn,{children:[d(t),
|
|
14
|
-
/* @__PURE__ */Jn(Me,{words:Rt,icon:/* @__PURE__ */Jn(sr,{type:n.type,size:13}),name:i,preview:Ki(n),marks:qi(n),onSelect:c,nameSlot:Ci(o,t,r,i),selected:Vo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Br(r)}:void 0,actions:/* @__PURE__ */Un(Yn,{children:[Zi(o,t,i),_i(n,o,t),Qi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Jn(Te,{children:ks(n,2)})]},r)}),d(r.length)]})]})},gs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=Dl.dragging,d=!Cr(l)&&s?.rung?.nodeId!==i,c={...xn(l),index:0},a=s&&!s.rung&&Al(s,c)?c:void 0,p=()=>ki(e,n,!0),{rowProps:u,...f}=Dl.row({item:{id:`rung:${l}`,zone:`${i}:${Qn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Qn,index:t},into:a,canDrag:Boolean(_o.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Gi(p)}),h=pt?null:_o.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
15
|
-
return Un(Mn,{children:[n.heading,
|
|
16
|
-
/* @__PURE__ */Jn(Me,{words:Rt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:gi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Br(l)},actions:h&&h.length>0?/* @__PURE__ */Jn(Yn,{children:h.map((t,o)=>/* @__PURE__ */Jn(Le,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(pt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Si(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__ */Jn(Fn,{size:15}):/* @__PURE__ */Jn(Dn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Jn(Te,{children:r})]},l)},ys=(e,n)=>{const t=rl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
17
|
-
return Jn(Yn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=sl(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=(e,n)=>fs(e,n),p=/* @__PURE__ */Un(Yn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Vo===String(n.props.id),{collapsible:i,folded:s}=dl(n,l,pl(n.type)),d=String(n.props.id),c=Nl(n),p=()=>ul(t,o,d,e.type),{rowProps:u,...f}=Dl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...xn(t),index:o}},{"data-node-id":d,onClick:Gi(p)});/* @__PURE__ */
|
|
18
|
-
return Un(Mn,{children:[0===o&&a(t,0),
|
|
19
|
-
/* @__PURE__ */Jn(Me,{words:Rt,icon:/* @__PURE__ */Jn(sr,{type:n.type,size:13}),name:c,preview:Ki(n),marks:qi(n),onSelect:p,nameSlot:Ci(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Br(d)}:void 0,actions:/* @__PURE__ */Un(Yn,{children:[Zi(t,o,c),_i(n,t,o),Qi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Jn(Te,{children:ys(n,l+1)}),a(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?a(d,0):null:0!==i.length||!t.rung&&d!==c?null:a(c,0)]});return t.rung?gs(e,t.rung,r++,o,p):/* @__PURE__ */Jn(Mn,{children:p},t.slot??"")})})},ks=(e,n)=>{const t=nr(kt?.data,e.type,String(e.props.id)),o=rl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
20
|
-
return Jn(Yn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=sl(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=(e,n)=>fs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Un(Yn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Vo===String(n.props.id),i=xi(n),l=String(n.props.id),{collapsible:d,folded:c}=dl(n,s,pl(n.type)),a=tl(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...xn(p),index:ui(p).length}:void 0,f=Dl.dragging,h=u&&f&&Al(f,u)?u:void 0,g=()=>ul(t,o,l,e.type),{rowProps:y,...k}=Dl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...xn(t),index:o},into:h,canDrag:!Qo(n.type)},{"data-node-id":l,onClick:Gi(g)});/* @__PURE__ */
|
|
21
|
-
return Un(Mn,{children:[0===o&&m(t,0),
|
|
22
|
-
/* @__PURE__ */Jn(Me,{words:Rt,icon:/* @__PURE__ */Jn(sr,{type:n.type,size:13}),name:i,preview:Ki(n),marks:qi(n),onSelect:g,nameSlot:Ci(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Br(l)}:void 0,actions:Qo(n.type)?_i(n,t,o)??void 0:/* @__PURE__ */Un(Yn,{children:[Zi(t,o,i),_i(n,t,o),Qi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Jn(Te,{children:ks(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
|
|
23
|
-
/* @__PURE__ */Jn(w,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>fl(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?gs(e,o.rung,i++,r,k):/* @__PURE__ */Jn(Mn,{children:k},o.slot??"")})})},Ss=Oo||null!==po,vs=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Qt&&!Ss&&qo===e.id,onSelect:()=>Gr(e.id)}:e,bs=[...(Zo.railLead??[]).map(vs),{id:"sections",label:Lt.layers,icon:/* @__PURE__ */Jn(Ve,{}),active:Qt&&!Ss&&"sections"===qo,onSelect:()=>Gr("sections")},...(Zo.railTrail??[]).map(vs)];ao?bs.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Jn(Fe,{}),active:Qt&&!Oo&&(null!==po||"media"===qo),onSelect:()=>Gr("media")}):mt&&bs.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Jn(Fe,{}),onSelect:Xr});const ws=[...Zo.railLead??[],...Zo.railTrail??[]].find(e=>"panel"in e&&e.id===qo),xs=Boolean(At?.foldable)&&!Ko,zs=At?.label??(gt?Lt.pageSections:Lt.templateSections),Cs=xs&&Cr(et),Bs=/* @__PURE__ */Un(Yn,{children:[qr.map((e,n)=>{if(Mt(e)||Tt(e)||Ot(e.type))return null;const t=Vo===String(e.props.id),o=Boolean(e.props._hidden);ol(e);const r=String(e.props.id),i=Zo.hasOwnRows?.(e)??!1,l=al(e)||i,s=l&&Cr(r),d=tl(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...xn(c),index:ui(c).length}:void 0,p=Dl.dragging,u=a&&p&&Al(p,a)?a:void 0,{rowProps:f,...h}=Dl.row({item:{id:r,zone:ke,index:n,type:e.type},place:{...xn(ke),index:n},into:u},{"data-node-id":r,onClick:Gi(()=>Ei(n))});/* @__PURE__ */
|
|
24
|
-
return Un(Mn,{children:[n>0&&el(n),
|
|
25
|
-
/* @__PURE__ */Jn(Me,{words:Rt,icon:/* @__PURE__ */Jn(sr,{type:e.type,size:13}),name:ci(e),preview:Ki(e),marks:qi(e),onSelect:()=>Ei(n),nameSlot:Ci(ke,n,r,ci(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Br(r)}:void 0,actions:/* @__PURE__ */Un(Yn,{children:[Zi(ke,n,ci(e)),_i(e,ke,n),Qi(ke,n,e,ci(e))]}),rowProps:f}),al(e)&&!s&&/* @__PURE__ */Un(Te,{children:[ks(e,1),Zo.partRows?.(e,hs)]}),i&&!s&&/* @__PURE__ */Jn(Te,{children:Zo.ownRows?.(e,n,hs)})]},String(e.props.id??n))}),!Ko&&Bl>0&&el(Bl)]}),Is=(e,n,t)=>{const o=String(e.props.id),r=il(e).length>0||ll(e)||Boolean(or(e.type)),i=r&&Cr(o),l="header"===t?Lt.header:Lt.footer,s=ir.rowName?ir.rowName(e,"section",l):l;/* @__PURE__ */
|
|
26
|
-
return Un(Yn,{children:[
|
|
27
|
-
/* @__PURE__ */Jn(Me,{words:Rt,icon:/* @__PURE__ */Jn(sr,{type:t,size:13}),name:s,preview:Ki(e),marks:qi(e),badge:xl,onSelect:()=>Ei(n),nameSlot:Ci(ke,n,o,s),selected:Vo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Br(o)}:void 0,actions:_i(e,ke,n)??void 0,rowProps:{"data-node-id":o,onClick:Gi(()=>Ei(n))}}),r&&!i&&/* @__PURE__ */Jn(Te,{children:ys(e,1)})]})};return(Zo.wrap??(e=>e))(
|
|
28
|
-
/* @__PURE__ */Jn(X,{target:wo,children:/* @__PURE__ */Un("div",{ref:bo,className:"sf-editor es-editor",style:qe(vr),onContextMenu:$i.onEditorContextMenu,...m(fn),children:[
|
|
29
|
-
/* @__PURE__ */Un(He,{children:[
|
|
30
|
-
/* @__PURE__ */Jn(We,{items:bs,ariaLabel:Lt.bar.views}),
|
|
31
|
-
/* @__PURE__ */Un(De,{children:[
|
|
32
|
-
/* @__PURE__ */Jn(Je,{label:Lt.bar.undo,disabled:Boolean(pt)||!vt.hasPast,onClick:()=>vt.back(),children:/* @__PURE__ */Jn(Ln,{})}),
|
|
33
|
-
/* @__PURE__ */Jn(Je,{label:Lt.bar.redo,disabled:Boolean(pt)||!vt.hasFuture,onClick:()=>vt.forward(),children:/* @__PURE__ */Jn(Rn,{})}),
|
|
34
|
-
/* @__PURE__ */Jn(Ue,{}),
|
|
35
|
-
/* @__PURE__ */Jn(Ye,{devices:no,value:lo,onChange:so}),
|
|
36
|
-
/* @__PURE__ */Jn(Je,{label:Lt.bar.refresh,tip:Lt.bar.refreshTip,onClick:()=>{vo.current=(()=>{const e=wo?.document;if(!e)return null;const n=qr.findIndex(Tt),t=n>=0?n:qr.length;let o=null;for(let n=0;n<t;n++){const t=qr[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=bt?.props?.id??qr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),So(e=>e+1)},children:/* @__PURE__ */Jn(En,{})})]}),
|
|
37
|
-
/* @__PURE__ */Un(De,{kind:"right",style:{minWidth:300},children:[
|
|
38
|
-
/* @__PURE__ */Jn(l,{input:Bo,words:Lt.saveStatus}),Zo.barLead?.(),Zo.barTrail?.(),Zo.mainAction||!Zo.barMain?/* @__PURE__ */Jn(s,{input:Bo,action:Zo.mainAction??{label:Lt.done,onPress:()=>{ot(kt.data)}},readOnly:Boolean(pt),saveSwitch:ft,onToggleAutoSave:st,onSaveNow:Io,bar:Lt.bar,words:Lt.saveStatus}):Zo.barMain()]})]}),
|
|
39
|
-
/* @__PURE__ */Jn(ee,{}),
|
|
40
|
-
/* @__PURE__ */Un("div",{className:"sf-body",children:[Qt?/* @__PURE__ */Un(Yn,{children:[
|
|
41
|
-
/* @__PURE__ */Jn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Lt.leftPanel,children:Oo?/* @__PURE__ */Jn(x,{at:Mo?{label:(e=>{const n=Tl(e.zone);if(n)return Lt.add.addingTo({name:ir.rowName?Yi(n,!0):li(n.type)});if(e.zone===ke){const n=qr[e.index];return n&&!Tt(n)?Lt.add.addingBefore({name:Yi(n,!0)}):Lt.add.addingAtEnd}const t=Rl(e.zone);return t?Lt.add.addingTo({name:t.parentName}):Lt.add.addingHere})(Mo),onClear:()=>To(null)}:void 0,placeBlocks:Mo&&Mo.zone!==ke?Rl(Mo.zone)?.choices:void 0,canTake:Mo?e=>{if(!Mo)return null;const n={...xn(Mo.zone),index:Mo.index};if(Vl(e,n))return null;const t=Tl(Mo.zone);if(t)return Lt.add.notInside({name:Yi(t,!0)});if(Mo.zone===ke)return Lt.add.onlySections;const o=Rl(Mo.zone);return o?Lt.add.notInside({name:o.parentName}):Lt.add.onlySections}:void 0,onPick:Mo?e=>{if(!Mo)return;const n={...xn(Mo.zone),index:Mo.index};Vl(e,n)&&(Fl(e,n),Ui())}:void 0,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:Wl,siteWide:Zo.addPanelRow?.(Ui),onClose:Ui,onHide:Ur,readOnly:Boolean(pt)}):po&&co?
|
|
42
|
-
/* @__PURE__ */Jn(B,{panel:co,pick:po,onHide:Ur}):ws?ws.panel({onHide:Ur,notify:Pr}):"media"===qo&&co?/* @__PURE__ */Jn(B,{panel:co,pick:null,onHide:Ur}):/* @__PURE__ */Un(Yn,{children:[
|
|
43
|
-
/* @__PURE__ */Jn(z,{icon:/* @__PURE__ */Jn(Ve,{}),title:Lt.layers,context:Jt,actions:/* @__PURE__ */Un(Yn,{children:[!pt&&/* @__PURE__ */Jn(Ge,{label:Lt.add.title,onClick:()=>Di(null),children:/* @__PURE__ */Jn(Vn,{size:15})}),
|
|
44
|
-
/* @__PURE__ */Jn(Ge,{label:Ol?Lt.expandAll:Lt.collapseAll,title:0===Il.length?Lt.nothingToFold:void 0,disabled:0===Il.length,onClick:()=>Sr(e=>{const n=new Set(Il);return Ol?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Il])}),children:/* @__PURE__ */Jn(Kn,{expand:Ol})})]}),onHide:Ur}),
|
|
45
|
-
/* @__PURE__ */Un(je,{className:"sf-tree sf-scroll",words:Rt,children:[
|
|
46
|
-
/* @__PURE__ */Jn(Me,{words:Rt,icon:/* @__PURE__ */Jn(sr,{type:"page",size:13}),name:Lt.pageSettings,onSelect:Zr,selected:!bt&&Eo,rowProps:{onClick:Gi(Zr)}}),zl&&/* @__PURE__ */Un(Yn,{children:[!wl&&/* @__PURE__ */Jn(Ae,{children:Lt.header}),ms(zl)]}),!Ko&&yt&&!(wl&&zl)&&/* @__PURE__ */Un(Yn,{children:[!wl&&/* @__PURE__ */Jn(Ae,{children:Lt.header}),!jt&&/* @__PURE__ */Jn(Me,{words:Rt,icon:/* @__PURE__ */Jn(sr,{type:"header",size:13}),name:Lt.header,badge:xl,onSelect:Kr,selected:Lo.kind===$t?.kind,rowProps:{onClick:Gi(Kr)}})]}),!Ko&&Sl&&!(wl&&zl)&&Is(Sl,kl,"header"),!Ko&&!xs&&/* @__PURE__ */Jn(Ae,{children:zs}),xs?/* @__PURE__ */Un(Yn,{children:[
|
|
47
|
-
/* @__PURE__ */Jn(Me,{words:Rt,icon:null,name:zs,fold:{open:!Cs,label:zs,onToggle:()=>Br(et)}}),!Cs&&/* @__PURE__ */Jn(Te,{children:Bs})]}):Bs,yt&&!wl&&/* @__PURE__ */Jn(Ae,{children:Lt.footer}),yl&&!(wl&&Cl)&&Is(yl,gl,"footer"),!Ko&&!yl&&yt&&!wl&&/* @__PURE__ */Jn(Me,{words:Rt,icon:/* @__PURE__ */Jn(sr,{type:"footer",size:13}),name:Lt.footer,onSelect:Xi,rowProps:{onClick:Gi(Xi),title:Lt.editFooter}}),Cl&&ms(Cl),Zo.treeFoot?.()]})]})}),
|
|
48
|
-
/* @__PURE__ */Jn(Xe,{side:"left",width:vr.left,min:Ke,max:Ze,defaultWidth:k.left,label:Lt.resizeLeftPanel,onResize:xr})]}):/* @__PURE__ */Jn(C,{side:"left",onShow:Ur}),
|
|
49
|
-
/* @__PURE__ */Un("div",{ref:$r,className:"sf-center sf-scroll","data-sf-canvas-head":Lr?"":void 0,style:{overflowX:Wr?"auto":"hidden",overflowY:"hidden"},children:[Lr&&/* @__PURE__ */Jn("div",{ref:Rr,className:"sf-canvas-head",children:/* @__PURE__ */Jn(Lr,{device:lo})}),
|
|
50
|
-
/* @__PURE__ */Un("div",{className:"sf-frame-scaler",style:Dr,children:[
|
|
51
|
-
/* @__PURE__ */Jn("div",{className:"sf-frame "+(lo===ro?"":`sf-frame--${lo}`),style:Jr,children:/* @__PURE__ */Un("div",{className:"sf-preview-host",children:[
|
|
52
|
-
/* @__PURE__ */Jn(Oe.Provider,{value:bl,children:/* @__PURE__ */Jn(Ut,{},ko)}),
|
|
53
|
-
/* @__PURE__ */Jn(ln,{canvas:wo,session:Wl,model:os,measure:is,canDrop:ss,onDrop:cs,choose:Yl,onPick:ps,onZoneAdd:us,onSeamAdd:us,zoneAddLabel:Lt.canvasAddBlock,words:Et.canvas,readOnly:Boolean(pt),revision:kt.data}),jo.length>0&&/* @__PURE__ */Jn("div",{className:"sf-preview-gaps",children:jo.map(e=>
|
|
54
|
-
/* @__PURE__ */Jn(sn,{index:e.index,label:Lt.addSectionHere,onInsert:()=>Di(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))})]})}),vl?/* @__PURE__ */Jn(Zn,{canvas:wo,tabs:Kl,onSelect:e=>{const n=qr.findIndex(n=>String(n.props.id)===e);n>=0&&Ei(n)}}):null]})]}),eo?/* @__PURE__ */Un(Yn,{children:[
|
|
55
|
-
/* @__PURE__ */Jn(g,{value:{selectChild:ul,addChild:fl,childRowName:xi,blockRowName:Nl},children:/* @__PURE__ */Jn(Yt,{mode:Lo,onOpenWebsiteSettings:Zo.openSettings??(()=>{}),onOpenSiteStyles:Zo.openStyles,onSelectNode:pr,onNotify:Pr,onHidePanel:Yr,nodeActions:bt?Se(xt,bt.type):nt})}),
|
|
56
|
-
/* @__PURE__ */Jn(Xe,{side:"right",width:vr.right,min:Ke,max:Ze,defaultWidth:k.right,label:Lt.resizeSettingsPanel,onResize:zr})]}):
|
|
57
|
-
/* @__PURE__ */Jn(C,{side:"right",onShow:Yr})]}),$i.menu]})}))}export{tt as ScreenChrome};
|