efficient-easel 24.1.0 → 24.2.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/dist/{chunk-AAAZ2CQR.js → chunk-G7ISR6DI.js} +1 -1
- package/dist/{chunk-CE5SGCN2.js → chunk-JMAOCKB2.js} +1 -1
- package/dist/chunk-UKPZ2YWE.js +64 -0
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +12 -12
- package/dist/screen/index.d.ts +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/document/box-fields.js +1 -1
- package/dist/screen/lib/document/style-clipboard.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +15 -2
- package/package.json +1 -1
- package/dist/chunk-MRWVYSU5.js +0 -64
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEaselSession as e}from"./chunk-YM4UEGBV.js";import{useHostEscape as n}from"./chunk-LX23TCTP.js";import{
|
|
1
|
+
import{useEaselSession as e}from"./chunk-YM4UEGBV.js";import{useHostEscape as n}from"./chunk-LX23TCTP.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-IYHO4XQX.js";import{styleMenuItems as o}from"./chunk-V7U33NF2.js";import{ROOT_ZONE as l}from"./chunk-TCAAOYQY.js";import{easelMenuEntries as r,menuLabel as i}from"./chunk-FIVU2COQ.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-P5VYGWYO.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{isTypingTarget as u,useCanvasEvent as d,framePointToHost as p}from"./chunk-YU3WHLGI.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as y}from"./chunk-TGZCD6IP.js";import{useState as h,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,PasteIcon as C,StylesIcon as O,LayersIcon as z,CopyIcon as P}from"efficient-shell/icons/efficient";import{jsx as A}from"react/jsx-runtime";function T(e,n){const t=[],o=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||o.has(n.props.id))break;if(o.add(n.props.id),t.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===l)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<t.length-1;e+=1)t[e].parentType=t[e+1].node.type;return t}var Y=c(),j=/* @__PURE__ */new WeakMap;function D(e){if(e.claimsPage)return Y;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",c);let t=j.get(n);return t||(t=c(),j.set(n,t)),t}function I(){return D(e())}function K(e,n,t){if(n===l){const{floor:n,cap:o}=e.sectionBand();return{parentId:y,slot:m,index:Math.min(Math.max(t,n),o)}}const o=n.lastIndexOf(":");return{parentId:n.slice(0,o),slot:n.slice(o+1),index:t}}function M(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function X(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?K(e,t.zone,t.index+1):null;for(const l of T(e,t)){const t=K(e,l.zone,l.index+1);if(o(n,t))return t}return null}function S(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(u(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function L(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=M(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:X(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function E(e,n){const{zone:t,index:r}=n,i=e.nodeAt(t,r);if(!i)return[];const c=i.props.id,a=e.labelOf(i.type,t),u=Boolean(i.props._hidden),d=e.nodeOps,p=e.isPinned(i,t),f=e.isLocked(i),m=!p&&!f&&!e.duplicateBlocked(i),y=e.permits?.(i)??{duplicate:!0,delete:!0},h=M(e,i,t),k=T(e,n),b=d.held,v=b&&!p?X(e,b,n):null,g=!e.readOnly,w=e.style?o({held:g?e.style.held():null,canCopy:e.style.canCopy(i,t),onCopy:()=>e.style?.copy(i,t),onPaste:()=>e.style?.paste(t,r,i),words:e.words?.styleClipboard}):[];return s({title:a,words:e.words?.menu,layer:{group:"pick",items:k.flatMap((n,t)=>{const o={label:e.rowNameOf(n.node,n.zone),checked:0===t,onClick:()=>e.selectAt(n.zone,n.index,n.node.props.id,n.parentType)},r=n.zone===l?null:e.slotRung?.(n.zone)??null;return r?[o,{label:r.label,checked:!1,onClick:r.select}]:[o]})},actions:{duplicate:g&&m&&y.duplicate?()=>d.duplicate(c):void 0,...U(g&&!p,e=>d.canStep(c,e),e=>d.step(c,e)),copy:h.copy?()=>d.copy(c,a):void 0,cut:g&&h.cut?()=>d.cut(c,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:g&&e.renamePropOf(i,t)?()=>e.beginRename(t,r):void 0,hide:!g||f||p?void 0:{hidden:u,run:()=>d.setProps(c,{_hidden:!u})},delete:g&&m&&y.delete?()=>d.remove(c):void 0},style:w,extras:e.menuRows?.(i,t,r)??void 0,pinnedLine:p?V(e).pinned:void 0})}function U(e,n,t){return e?{moveUp:n(-1)?()=>t(-1):null,moveDown:n(1)?()=>t(1):null}:{}}var V=e=>e.words?.screen??t.menu;function B(e){const n=V(e),o=!e.readOnly,r=[];o&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */A(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */A(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=[],c=e.nodeOps.held,s=K(e,l,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):f(c.from)===l)){const n=s,t=e.words?.menu??a;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[r,i,[...e.openPageStyles?[{label:e.pageStylesLabel??t.pageStyles,icon:/* @__PURE__ */A(O,{}),onClick:e.openPageStyles}]:[],{label:n.collapseAll,icon:/* @__PURE__ */A(z,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function R(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??a,c=V(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */A(P,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */A(P,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const u=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function N(e){return e.shiftKey}function F(e,t){const[o,l]=h(null),r=k(()=>l(null),[]);n(null!==o,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=S(e);if(!o)return;const l=t.selected();if(!l)return;const r=L(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),d(t,"keydown",c);const a=k(n=>{if(N(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);d(t,"contextmenu",n=>{if(N(n)||!t)return;const o=n.target?.closest?.("[data-easel-block]")??null,r=o?.getAttribute("data-easel-block"),i=r?e.locate(r):null;n.preventDefault();const c=p(t.frame,n.clientX,n.clientY),s=t.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),d(t,"mousedown",r),d(t,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:o?/* @__PURE__ */A(G,{host:e,target:o,onClose:r}):null,closeMenu:r}}function G({host:e,target:n,onClose:t}){const o="node"===n.kind?E(e,n):"input"===n.kind?R(e,n.el):B(e);return 0===o.length?null:/* @__PURE__ */A(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":i(o),items:r(o)})}export{Y as EASEL_NODE_CLIPBOARD,T as ancestorChain,D as nodeClipboardOf,M as nodeClipboardRules,E as nodeMenuItems,S as nodeShortcut,B as pageMenuItems,X as pastePlace,L as runNodeShortcut,R as textMenuItems,I as useNodeClipboard,F as useNodeContextMenu};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-
|
|
1
|
+
import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-UKPZ2YWE.js";import{ScreenStoreProvider as e}from"./chunk-4ESG53BH.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-K7MMLCTT.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-IYHO4XQX.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var k=r(e),C=r(n);function j({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const k=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
|
|
2
2
|
return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
|
|
3
3
|
/* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
|
|
4
4
|
/* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import{cloneNodeWithFreshIds as e}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as n}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as t}from"./chunk-DSKNJXB4.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-UMBNBCL4.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s}from"./chunk-DDH2DYQP.js";import{useEaselKeyTarget as d,useEaselUndoKeys as a,useEaselSaveKey as c,editorRootFocus as p}from"./chunk-75C6WFNF.js";import{SlotChildActionsProvider as u}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as h,DEFAULT_PANEL_W as f,clampPanelWidth as m}from"./chunk-Y53EKN35.js";import{usePartBridge as g}from"./chunk-7RSE6KKY.js";import{useSectionOps as y}from"./chunk-OITNWE52.js";import{ScreenSaveIcon as v,ScreenMainButton as b}from"./chunk-55KKGABA.js";import{useBrowserOffline as k}from"./chunk-RKTF5XLP.js";import{AddChildRow as S}from"./chunk-5545A3PC.js";import{AddSidePanel as w}from"./chunk-CMPFUJ26.js";import{keepsSharedSections as x,sharedSectionsOf as z}from"./chunk-N3MJOHAG.js";import{PanelHideButton as C,SidePanelHead as N,PanelShowStrip as I}from"./chunk-5PXVT7JY.js";import{offeredChoices as O}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as B,useScreenNodeKeys as P,useScreenPinned as $,useScreenDocumentLabel as T,useScreenCanvasFrame as M,useScreenInspectorPanel as j,useScreenDevices as A,useScreenPickFollowsSelection as L,useScreenLeftView as E,SELECTION_MODE as R,isSelectionMode as F,sameInspectorMode as D,useScreenBridges as W,useScreenBlockRules as H,useScreenBlockLook as V,useScreenStorageNamespace as Y,useScreenNotify as U,useScreenCanvasHead as J,isSlotMode as X,useScreenStyleClipboard as K,useScreenDocumentPass as G,useScreenCanvasDrag as Q,ScreenCanvasTargetProvider as _,isPinnedFirst as Z,isPinnedLast as q,screenSlotsOf as ee,shownChildSlotsOf as ne}from"./chunk-QORC32JO.js";import{MediaPopup as te}from"./chunk-T2RINM7R.js";import{useNodeClipboard as oe,useNodeContextMenu as re}from"./chunk-G7ISR6DI.js";import{PageEditGuardNotices as ie}from"./chunk-FRAIEWRC.js";import{useScreenDocument as le}from"./chunk-K7MMLCTT.js";import{requestMediaPick as se}from"./chunk-3FIS2FRS.js";import{useMediaPanel as de,usePanelPick as ae,useMediaBrowsing as ce,useOpenMediaBrowse as pe,useMediaPlace as ue}from"./chunk-NCXYC7WI.js";import{useEaselSession as he}from"./chunk-YM4UEGBV.js";import{useEaselHost as fe,useHostEscape as me}from"./chunk-LX23TCTP.js";import{LayersIcon as ge,MediaIcon as ye}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-IYHO4XQX.js";import{heldStyle as be,styleShortcut as ke}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{rootRowName as we,slotChildRowName as xe,slotChildRenameProp as ze,sectionRenameProp as Ce}from"./chunk-5NHQ452C.js";import{ROOT_ZONE as Ne,blockNodeActions as Ie,TREE_MAX_DEPTH as Oe,childSlotsOf as Be,slotFieldsOf as Pe,newNodeId as $e,slotChildrenIn as Te,nestsInTree as Me}from"./chunk-TCAAOYQY.js";import{useEasel as je,useEaselApi as Ae,CanvasPartsContext as Le,partHasOwnBox as Ee,CanvasPassThroughContext as Re,CanvasSharedContext as Fe}from"./chunk-FJTCSQWK.js";import{TreeRow as De,Subtree as We,LayersTree as He,TreeGroupLabel as Ve,TreeRowAction as Ye,TreeSeam as Ue}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Je}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Xe}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ke,useNodeOps as Ge,clickPick as Qe}from"./chunk-RPMSET77.js";import{EaselTopBar as _e,EaselIconButton as Ze,TopBarCluster as qe,DeviceSwitch as en,InspectorIconButton as nn,PanelResizeHandle as tn,MAX_PANEL_W as on,MIN_PANEL_W_BY_SIDE as rn,panelWidthVars as ln}from"./chunk-WYTPBF3Q.js";import{DEFAULT_NOTICE_WORDS as sn,DEFAULT_CHROME_WORDS as dn}from"./chunk-AJSDWWJW.js";import{holderOf as an,nameOrSomeone as cn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as pn}from"./chunk-RE4LP46F.js";import{useWords as un}from"./chunk-MFIRYGHW.js";import{insertSeams as hn,CanvasDragLayer as fn,CanvasInsert as mn}from"./chunk-LN43DP2A.js";import{DEFAULT_DRAG_WORDS as gn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as yn,useTreeDrag as vn,gapToMoveIndex as bn}from"./chunk-6NJHYXJM.js";import{useCanvasFrame as kn,LIST_SELECTOR as Sn,BLOCK_SELECTOR as wn,useCanvasTyping as xn,useCanvasEvent as zn,nodeIdAt as Cn,frameRectToHost as Nn,BLOCK_ATTRIBUTE as In,drawnBox as On}from"./chunk-YU3WHLGI.js";import{queryMainCopy as Bn}from"./chunk-LF3FUSCQ.js";import{ROOT_ID as Pn,ROOT_SLOT as $n,zoneKey as Tn,parseZoneKey as Mn,find as jn,DataError as An}from"./chunk-TGZCD6IP.js";import{useRef as Ln,useMemo as En,useState as Rn,useEffect as Fn,useCallback as Dn,useLayoutEffect as Wn,useContext as Hn,Fragment as Vn,useId as Yn}from"react";import{ColoredBadge as Un,Button as Jn,Tabs as Xn,toast as Kn,readMediaFileDrag as Gn,Tooltip as Qn,groupColors as _n,Dialog as Zn,FormField as qn,Input as et,MEDIA_FILE_DRAG_TYPE as nt}from"efficient-shell/ui";import{UndoIcon as tt,RedoIcon as ot,RefreshIcon as rt,AddIcon as it,TrashIcon as lt,EyeOffIcon as st,EyeIcon as dt,SharedIcon as at,DuplicateIcon as ct}from"efficient-shell/icons/efficient";import{jsx as pt,jsxs as ut,Fragment as ht}from"react/jsx-runtime";var ft="media-file";function mt({name:e,onMake:n,onCancel:t}){const o=un("screen",ve).shared,[r,i]=Rn(e),[l,s]=Rn(!1),d=Yn(),a=Ln(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
+
return pt(Zn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */ut(ht,{children:[
|
|
3
|
+
/* @__PURE__ */pt(Jn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
+
/* @__PURE__ */pt(Jn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */pt("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */pt(qn,{label:o.name,htmlFor:d,children:/* @__PURE__ */pt(et,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var gt=/* @__PURE__ */new WeakSet;function yt(e,n,t){const o=jn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function vt({canvas:e,tabs:n,onSelect:t}){const o=Ln(null),[r,i]=Rn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Wn(()=>{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=Nn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=Bn(t,`[${In}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?On(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=Nn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),c=s.top+s.height;if(c<d.top||s.top>d.top+d.height){a[o.id]=null;continue}const p=o.below?c+4:Math.max(s.top,d.top)+6;a[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(a)},a=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",a,!0),r.addEventListener("resize",a);const c=new r.MutationObserver(a);return c.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a),c.disconnect()}},[e,l]),/* @__PURE__ */pt("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */pt("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
|
|
5
|
+
/* @__PURE__ */pt(Qn,{content:e.reach,children:/* @__PURE__ */ut(Un,{colorClass:_n("success","solid"),size:"sm",children:[
|
|
6
|
+
/* @__PURE__ */pt("span",{className:"es-band-tab-mark",children:/* @__PURE__ */pt(at,{size:12})}),e.label]})}):/* @__PURE__ */pt(Un,{colorClass:_n("info","solid"),size:"sm",children:e.label})},e.id):null})})}function bt({expand:e}){/* @__PURE__ */
|
|
7
|
+
return pt("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */ut(ht,e?{children:[
|
|
8
|
+
/* @__PURE__ */pt("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
+
/* @__PURE__ */pt("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
+
/* @__PURE__ */pt("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
+
/* @__PURE__ */pt("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
+
/* @__PURE__ */pt("path",{d:"M5 12h14"})]})})}var kt=`${Sn}, ${wn}`;function St(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 wt="__rungs";var xt="screen:band",zt={duplicate:!0,delete:!0},Ct=()=>null;function Nt(){const Sn=fe(),Nn=Sn.panels?.Toolbar,In=(Sn.panels?.useRight??Ct)(),{target:On,docId:Yn,capabilities:Qn,currentSlug:_n,siteId:Zn,onPublish:qn,saveState:et,saveConflict:at,retrySave:Nt,toggleAutoSave:It,flushSave:Ot,access:Bt,saveUnreachable:Pt=!1,readOnly:$t,readOnlyReason:Tt=null}=le(),Mt=B(),jt=P(),{mediaEditing:At,hasEditGuard:Lt,hasPinnedChrome:Et}=Qn,{appState:Rt,dispatch:Ft,history:Dt,selectedItem:Wt,getSelectorForId:Ht,config:Vt}=je(e=>e),Yt=$(),{first:Ut,firstGroup:Jt,lastGroup:Xt,isSectionGroup:Kt,sectionGroupZone:Gt,panelOf:Qt}=Yt,_t=Qt(Ut),Zt=e=>Z(Yt,e),qt=e=>q(Yt,e),eo="node"===Yt.firstRow,no=Yt.band??null,to=un("screen",ve),oo=un("tree",Je),ro=un("drag",gn),io=un("notice",sn),lo=un("lock",pn),so=un("menu",Xe),ao=un("styleClipboard",Se),co=un("chrome",dn),po=T()??`/${_n}`,uo=M(),ho=j(),fo=y({readOnly:$t}),mo=y({readOnly:$t,foldIntoHistory:!0}),go=Ln(null),yo=Ae(),vo=En(()=>({...fo,select:e=>{go.current=e,fo.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=yo.config;go.current=Ke(e,t,n)}fo.commitDocument(e,n)}}),[fo,yo]),bo=Rt.ui,ko=bo.leftSideBarVisible,So=bo.rightSideBarVisible,{options:wo,widths:xo,initial:zo,fluid:Co,fit:No}=A(),[Io,Oo]=Rn(zo),Bo=de(),Po=At&&null!==Bo;ae(),ce();const $o=pe();L(Wt?.props.id);const{read:To,write:Mo,forSelection:jo}=E(),[Ao,Lo]=Rn(To);Fn(()=>{Mo(Ao)},[Ao]);const[Eo,Ro]=Rn(0),Fo=Ln(null),Do=Ln(null),Wo=kn(Do,{readySelector:kt}),Ho=xn(Wo),Vo=d(Do);a(Do,Wo);const Yo=k(),Uo=an(Bt),Jo={state:et,offline:Yo||et.failed&&Pt,readOnlyReason:Tt,editing:Uo?io.editing({name:cn(Uo.name,lo),noun:to.noun}):null,conflict:null!=at,notSaving:to.bar.notSaving},Xo=()=>{$t||(et.failed?Nt():Ot())};c(Do,Wo,Xo);const[Ko,Go]=Rn(!1),Qo=Ln(!1),[_o,Zo]=Rn(null),[qo,er]=Rn([]),[nr,tr]=Rn(R);F(nr);const or=o(nr,Wt?.props.id),[rr,ir]=Rn(null);Fn(()=>{rr&&(r(),ir(null))},[rr]);const lr=Ln(Ht);lr.current=Ht;const sr=Dn((e,{scroll:n})=>{Lo(n=>jo(e,n)),n&&ir(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=lr.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Er(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),dr=Ln(null);Fn(()=>{const e=dr.current;dr.current=null;const n=null==Wt?.props.id?null:String(Wt.props.id);tr(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Qt(Wt?.type)??R);const t=Wt?.props.id,o=go.current;if(go.current=null,!t)return;const r=Ht(t);sr(String(t),{scroll:!i(o,r??null,Ne)})},[Wt?.props.id,sr]);const ar=Dn(e=>{tr(n=>D(n,e)?n:e),Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ft]),cr=Ln(()=>{});cr.current=(e,n)=>{const t=e?Ti(e.zone??Ne)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Wt?.props.id?null:String(Wt.props.id);tr(e=>D(e,n)?e:n),o!==r&&(dr.current={id:o,mode:n},vo.select(e))};const pr=Dn((e,n)=>cr.current(e,n),[]),ur={kind:nr.kind,mode:nr,open:ar,show:e=>tr(e),reveal:()=>{So||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},select:pr},hr=W(ur,{data:Rt.data,selected:Wt??null,zoneOf:e=>Ht(e)?.zone,readOnly:Boolean($t),select:e=>{tr(R),vo.select({index:e})},replace:(e,n)=>vo.replaceComponent(Ne,e,n),scrollTo:e=>l(e)},{device:Io,refreshes:Eo},{setView:Lo,reveal:()=>{ko||Ft({type:"setUi",ui:{leftSideBarVisible:!0}})}}),fr=hr.resolveLeftView?hr.resolveLeftView(Ao):"sections",mr=H(),{isLockedBlock:gr,duplicateBlocked:yr,nestDepth:vr,newSectionNode:br,canAddTo:kr,blockIsOffered:Sr}=mr,wr=e=>({id:String(e.props.id??""),data:Rt?.data}),xr=V(),{labelAtLevel:zr,Icon:Cr,useProducts:Nr}=xr,Ir=xr.rowName?(e,n,t)=>xr.rowName(e,n,t):void 0,Or=Dn(e=>{Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),sr(e,{scroll:!0})},[Ft,sr]),{selectNode:Br,openPartId:Pr}=g({mode:nr,setMode:tr,onOpenPart:Or}),[$r,Tr]=Rn(null);me(null!==$r,()=>Tr(null));const Mr=h(Y()),jr=Mr.collapsed,Ar=Mr.panelWidths,[Lr,Er]=Rn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(jr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
+
return new Set}});Fn(()=>{try{window.localStorage.setItem(jr,JSON.stringify([...Lr]))}catch{}},[Lr]);const[Rr,Fr]=Rn(()=>{if("undefined"==typeof window)return{...f};try{const e=window.localStorage.getItem(Ar);if(!e)return{...f};const n=JSON.parse(e);return{left:m(Number(n.left)||f.left,"left"),right:m(Number(n.right)||f.right,"right")}}catch{return{...f}}});Fn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Ar,JSON.stringify(Rr))}catch{}},300);return()=>clearTimeout(e)},[Rr]);const Dr=Dn((e,n)=>Fr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Wr=Dn(e=>Dr("left",e),[Dr]),Hr=Dn(e=>Dr("right",e),[Dr]),Vr=e=>Lr.has(e),Yr=e=>Er(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Ur=Ln(!1),Jr=Ln(null);Fn(()=>{if(Ur.current&&!Ko){const e=Jr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Do.current?.querySelector(`button[aria-label="${CSS.escape(to.add.title)}"]`))?.focus(),Jr.current=null}Ur.current=Ko},[Ko]),Fn(()=>{if(!Ko||!Vo)return;const e=e=>{"Escape"===e.key&&cl()};return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[Ko,Vo]),me(Ko,()=>cl()),Fn(()=>{!ko&&Ko&&(Go(!1),Zo(null),Qo.current=!1)},[ko]);const Xr=U(),Kr=(e,n="success",t)=>{if(Xr)return void(t?Xr(e,"error"===n?"error":"info",t):Xr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Kn.error(e,{...o,duration:t?.duration??3200}):Kn.success(e,{...o,duration:t?.duration??1900})},Gr=Ln(null),[Qr,_r]=Rn(0),[Zr,qr]=Rn(0),ei=J(),ni=Ln(null),ti=e=>Math.max(0,e.clientHeight-(ni.current?.offsetHeight??0));Fn(()=>{const e=Gr.current;if(!e)return;const n=()=>{_r(e.clientWidth),qr(ti(e))};n();const t=new ResizeObserver(n);return t.observe(e),ni.current&&t.observe(ni.current),()=>t.disconnect()},[]),Wn(()=>{Gr.current&&(_r(Gr.current.clientWidth),qr(ti(Gr.current)))},[Rr,ko,So]);const oi=Io===Co?Qr>0?Qr:xo[Co]:xo[Io],ri=Qr>0?Math.min(Qr/oi,"shrink"===No?1:2):1,ii=oi*ri,li=Qr>0&&ii>Qr+1,si={width:ii,height:Zr||"100%",flex:"none",position:"relative"},di={width:oi,height:Zr?Zr/ri:"100%",maxHeight:"none",transform:1!==ri?`scale(${ri})`:void 0,transformOrigin:"top left"},ai=()=>Ft({type:"setUi",ui:{leftSideBarVisible:!ko}}),ci=()=>Ft({type:"setUi",ui:{rightSideBarVisible:!So}}),pi=e=>{Ko&&(Go(!1),Zo(null),Qo.current=!1,ko&&Ao===e)||(Lo(e),ko||Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},ui=()=>{tr(_t??R),So||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},hi=Rt.data.content??[],fi=()=>{const e=hi.findIndex(Zt),n=hi.findIndex(qt);return{floor:e>=0?e+1:0,cap:n>=0?n:hi.length}},mi=Vt,gi=mr.stripCopy,yi=n=>e(n,gi),vi=oe(),bi=Ge({data:Rt.data,config:mi,readOnly:Boolean($t),clipboard:vi,strip:gi?e=>gi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Pn||e.slot!==$n)return{min:0,max:n-1};const{floor:t,cap:o}=fi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&tr(R);const t=void 0===n||"node"===n?.kind?n:null;vo.commitDocument(e,t)}}),ki=he(),[Si,wi]=Rn(null),xi=e=>{const n=hi.find(n=>String(n.props.id)===e),t=Yt.shared;n&&t&&bi.swap(e,t.detach(n))},zi=e=>{const n=jn(Rt.data,Vt,e);if(!n)return!1;const t=Tn(n.place),o=n.node,r=t===Ne?Bi(o):Vi(o),i=t===Ne?Yt.shared?.usedOn(o):null;return!!bi.remove(e)&&(Kr(i?to.shared.removed({count:Math.max(0,i.length-1)}):to.deleted({name:r}),"success",{duration:8e3,action:{label:to.bar.undo,onClick:()=>{bi.restore(n.node,n.place)}}}),!0)},Ci={...bi,remove:zi},Ni=e=>zr(e,"block",Vt.components[e]?.label??e),Ii=Dn(e=>Vt.components[e]?.defaultProps??{},[Vt]),Oi=e=>zr(e,"section",Ni(e)),Bi=e=>we({type:e.type,props:e.props??{}},Oi(e.type),Ir),{nodeAddresses:Pi,zoneItems:$i}=En(()=>{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>=Oe)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Be(Vt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(hi,Ne,0),{nodeAddresses:e,zoneItems:n}},[hi,Vt]),Ti=Dn(e=>$i.get(e)??[],[$i]),Mi=e=>{const n=Pi.get(e);return n?Ti(n.zone)[n.index]:void 0},ji=e=>ee(mr,Vt,e),Ai=e=>{if(!mr.slotsOf||e===Ne)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Mi(e.slice(0,n));if(!t)return null;const o=ji(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}},Li=(()=>{if(!X(nr))return null;const e=`${nr.nodeId}:${nr.slot}`;return Ai(e)?.slot.panel===nr.kind?e:null})(),Ei=Ln(null);Fn(()=>{const e=Ei.current;if(Ei.current=null,!Li||!X(nr))return;const n=nr.nodeId;sr(n,{scroll:e!==Li}),Er(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[nr]);const Ri=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Pi.get(e);n&&(n.zone===Ne?ol(n.index):Pl(n.zone,n.index,e,Mi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Li!==i&&(Ei.current=i),pr(null,r),So||Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Fi=(e,n,t)=>{const o=`${e}:${n}`;if(Er(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;Li!==o&&(Ei.current=o);pr(null,{kind:t,nodeId:e,slot:n})},Di=(e,n,t)=>{if($t||!mr.moveSlot)return;const o=Mi(e),r=o?ji(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:wt,index:n},s=bn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=mr.moveSlot(e,n,s);"string"==typeof d&&Fi(e,d,i.panel)},Wi=Nr(),Hi=En(()=>{const e=/* @__PURE__ */new Map;for(const n of Wi??[])e.set(n.slug,n.name);return e},[Wi]),Vi=e=>xe(e,Ni,xr.plainText,e=>Hi.get(e),xr.rowName),Yi=(e,n)=>{const t=Vt.components[e.type]?.fields,o=n===Ne||ts(n)?"section":"block",r=n===Ne&&(Zt(e)||qt(e)||Kt(e.type)),i="block"===o?ze(t):r?null:Ce(t);return xr.renamePropOf?xr.renamePropOf(e,o,i):i},Ui=(e,n,t,o)=>{if(!(!$t&&$r?.zone===e&&$r.index===n))return;const r=(t,o)=>{Tr(null),o&&((e,n,t)=>{const o=Ti(e)[n];if(!o)return;const r=Yi(o,e);r&&vo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
+
return pt("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":to.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)},Ji=t(K(),ao),Xi=Ji.scope({target:On,siteId:Zn,docId:Yn}),Ki=Vt,Gi=(e,n)=>n===Ne?Oi(e):Ni(e),Qi=(e,n,t)=>{const o=Ji.plan(Xi,t,Gi(t.type,e),Ki);o&&(o.changed&&vo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Kr(o.message))},_i=re({nodesIn:Ti,nodeAt:(e,n)=>Ti(e)[n]??null,labelOf:(e,n)=>n===Ne?Oi(e):Ni(e),renamePropOf:Yi,beginRename:(e,n)=>Tr({zone:e,index:n}),history:{hasPast:Dt.hasPast,hasFuture:Dt.hasFuture,back:()=>Dt.back(),forward:()=>Dt.forward()},openPageStyles:hr.openPageStyles,pageStylesLabel:to.pageStyles,words:{menu:so,styleClipboard:ao,screen:to.menu},readOnly:Boolean($t),collapseAll:()=>Er(new Set(Ti(Ne).map(e=>String(e.props.id)))),onPasteRefused:e=>Kr(e?to.pasteRefused({name:e.label}):to.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>is(e,n),menuRows:(e,n,t)=>{const o=hr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Yt.shared;if(!t||n!==Ne)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:to.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return $t||gr(e.type,e)?n:{...n,change:[{label:to.shared.detach,onClick:()=>xi(e.props.id)}],remove:[{label:to.shared.removeFromPage,danger:!0,onClick:()=>{zi(e.props.id)}}]}}return $t||Zt(e)||qt(e)||Kt(e.type)?null:x(ki)?{change:[{label:to.shared.makeShared,onClick:()=>wi({id:e.props.id,name:Bi(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>gr(e.type,e),duplicateBlocked:e=>yr(Rt.data,e),permits:e=>{const n=Ie(Vt,e.type);return Yt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:Ci,isPinned:(e,n)=>n===Ne&&(Zt(e)||qt(e)),sectionBand:fi,locate:e=>Pi.get(e)??null,rowNameOf:(e,n)=>n===Ne?Bi(e):Vi(e),selectAt:(e,n,t,o)=>{e===Ne?ol(n):Pl(e,n,t,o??"")},slotRung:e=>{const n=Ai(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ri(n.node,n.slot,!1)}:null},style:{held:()=>be(Xi),canCopy:e=>Ji.rows(Ki,e).some(e=>!1!==e.counted),copy:(e,n)=>Ji.copy(Xi,e,Gi(e.type,n),Ki),paste:(e,n,t)=>Qi(e,n,t)},keys:jt?{target:Vo,selected:()=>{const e=Rt.ui.itemSelector;return e?{zone:e.zone??Ne,index:e.index}:null},held:()=>vi.get(),readOnly:Boolean($t),onDone:({done:e,name:n})=>{"copied"===e&&Kr(to.copied({name:n}))}}:void 0},Wo),Zi=Ln({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Fn(()=>{Zi.current={copy:(e,n)=>Ji.copy(Xi,e,Gi(e.type,n),Ki),paste:Qi,at:()=>{const e=Rt.ui.itemSelector;if(!e)return null;const n=e.zone??Ne,t=Ti(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean($t)}});const qi=Dn(e=>{const n=ke(e);if(!n)return;const t=Zi.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))},[]);Fn(()=>{if(!Vo)return;const e=e=>qi(e);return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[qi,Vo]),zn(Wo,"keydown",qi);const el=hi.map(e=>e.props.id).join("|");Fn(()=>{const e=Wo?.document??null,n=Wo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void er(e=>e.length?[]:e);const n=hi.findIndex(qt),t=n>=0?n:hi.length,o=n=>{const t=hi[n]?.props?.id;return null==t?null:Bn(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(wn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=hi.length>0&&!Zt(hi[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=St(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})}er(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,el,Io,ri,ko,So,Wt?.props.id]);const nl=Wo?.document??null,tl=Wo?.window??null;Fn(()=>{const e=Fo.current;if(!e||!nl||!tl)return;const n=[],t=()=>{const n=Bn(nl,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&tl.scrollTo({left:tl.scrollX,top:tl.scrollY+t,behavior:"instant"}),!0};return Fo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[nl,tl]);const ol=e=>{tr(R),vo.select({index:e}),hr.sectionPressed?.(hi[e]);const n=hi[e]?.props?.id;n&&l(n)},rl=e=>{const{floor:n,cap:t}=fi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Wt&&nr.kind!==_t?.kind?hi.findIndex(e=>e.props.id===Wt.props.id):-1;return o(r>=0?r+1:t)},il=(e,n)=>{const{floor:t,cap:o}=fi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(vo.reorderComponent(Ne,e,i),vo.select({index:i}),{moved:!0,dest:i})},ll=(e,n,t,o)=>{tr(R),vo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Kr(to.sectionAdded({name:t}))},sl=(e,n)=>{const t=rl(n),o=br(e,{nodeDefaults:Ii,newNodeId:$e,sectionLabel:Oi,blockIsOffered:Sr}),r=o?vo.insertNode(Ne,t,o):vo.insertSection(e,t);return ll(t,r,Oi(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:a}of Be(Vt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=kr(e.type,l,d.slice(d.lastIndexOf(":")+1),wr(e)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:a,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},dl=e=>al(Ne,e),al=(e,n)=>{Jr.current=document.activeElement??null,Zo(null===n?null:{zone:e,index:n}),Go(!0),ko||(Qo.current=!0,Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},cl=()=>{Go(!1),Zo(null),Qo.current&&Ft({type:"setUi",ui:{leftSideBarVisible:!1}}),Qo.current=!1},pl=(e,n)=>xr.rowName?n?Zt(e)?xr.rowName(e,"section",to.header):qt(e)?xr.rowName(e,"section",to.footer):Kt(e.type)?xr.rowName(e,"section",Ni(e.type)):Bi(e):Vi(e):n?Oi(e.type):Ni(e.type),ul=e=>n=>{e()},hl=(e,n,t)=>{if($t)return null;const o=Ti(e)[n];return o&&!Ie(Vt,o.type).delete||o&&gr(o.type,o)?null:/* @__PURE__ */pt(Ye,{kind:"delete",label:e===Ne&&o&&Yt.shared?.usedOn(o)?to.shared.removeFromPage:to.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Ti(e)[n]?.props?.id;null!=t&&zi(String(t))})(e,n),children:/* @__PURE__ */pt(lt,{size:15})})},fl=e=>xr.rowPreview?.(e)||void 0,ml=e=>xr.rowMarks?.(e)??void 0,gl=(e,n,t)=>xr.rowActions?.(e,n,t)??null,yl=(e,n,t,o)=>{if($t)return null;if(gr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
+
return pt(Ye,{kind:"eye",label:r?to.showNamed({name:o}):to.hideNamed({name:o}),onClick:()=>bl(e,n,t),children:/* @__PURE__ */pt(r?st:dt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},vl=e=>Qs(Ne,e),bl=(e,n,t)=>{vo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},kl=e=>Pe(Vt,e),Sl=e=>Be(Vt,e),wl=e=>mr.slotsOf?ji(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Te(e,n.slot)})):[{slot:null,rung:null,kids:ne(Vt,e)}],xl=e=>mr.slotsOf?wl(e).flatMap(e=>e.kids):ne(Vt,e),zl=e=>Boolean(mr.slotsOf)&&ji(e).some(e=>e.rung),Cl=(e,n,t)=>kr(e.type,n,t??void 0,wr(e)),Nl=(e,n,t)=>{const o=Me(Vt,e.type,n)&&(t||xl(e).length>0||zl(e));return{collapsible:o,folded:o&&Vr(String(e.props.id))}},Il=(e,n,t)=>wl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Nl(e,r,t(e.type)).collapsible?[String(e.props.id),...Il(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ol=e=>xl(e).length>0||zl(e)||Boolean(kr(e.type)),Bl=e=>Boolean(kr(e)),Pl=(e,n,t,o)=>{if(tr(R),kr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),vo.select({index:n,zone:e}),l(t)}else vo.select({index:n,zone:e}),l(t)},$l=(e,n,t,o,r)=>{const i=`${e}:${n}`;vo.insertComponent(i,t,o),kr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),vo.select({index:o,zone:i})}):vo.select({index:o,zone:i})},Tl=Ln(/* @__PURE__ */new Set);Fn(()=>{hi.forEach(e=>{const n=kr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Tl.current.has(t))return;Tl.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(Ii)).forEach((e,t)=>mo.seedChild(o,t,n.childType,e))})},[hi,mo,Ii]);const Ml=Ln(/* @__PURE__ */new Set);Fn(()=>{hi.forEach((e,t)=>{const o=e.props.id;if(Ml.current.has(o))return;const r=n(e,kl(e.type));Ml.current.add(o),r&&mo.replaceComponent(Ne,t,{...e,props:r})})},[hi,mo]),G(mo,Vt);const jl=hi.findIndex(qt),Al=jl>=0?hi[jl]:null,Ll=eo?hi.findIndex(Zt):-1,El=Ll>=0?hi[Ll]:null,Rl=Yt.groupTab,Fl=En(()=>Rl?e=>Kt(e.type):void 0,[Rl]),Dl=Boolean(Yt.groupBadge),Wl=Yt.sharedReach,Hl=e=>Wl?.(e)??void 0,Vl=En(()=>Wl?new Set(hi.filter(e=>Hl(e)).map(e=>String(e.props.id))):null,[hi,Wl]),Yl=En(()=>Vl?e=>Vl.has(e):void 0,[Vl]),Ul=Yt.first?Wl?.({type:Yt.first,props:{id:""}})??void 0:void 0,Jl=Yt.groupBadge?/* @__PURE__ */pt("span",{className:"es-tree-group-badge",children:/* @__PURE__ */pt(Un,{tone:"info",size:"xs",children:Yt.groupBadge})}):void 0,Xl=hi.find(e=>e.type===Jt)??null,Kl=hi.find(e=>e.type===Xt)??null,Gl=jl>=0?jl:hi.length,Ql=[];hi.forEach(e=>{qt(e)||(Ol(e)&&Ql.push(String(e.props.id)),Ql.push(...Il(e,1,Bl)))}),Al&&(Ql.push(String(Al.props.id)),Ql.push(...Il(Al,1,Bl)));const _l=Ql.length>0&&Ql.every(e=>Lr.has(e)),Zl=e=>{const n=xr.blockRowName(e,Ni);return xr.rowName?xr.rowName(e,"block",n):n},ql=(e,n,t,o)=>{const r=Ti(e)[t];if(!r)return;const i={...Mn(e),index:t},l={...Mn(n),index:Math.min(Math.max(o,0),Ti(n).length)},s=bn(i,l);if(e!==n||s!==t)try{bi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof An))throw e}},es=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Sl(e))n.add(r),t(o)};for(const t of kl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ns=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Pi.get(n);if(!e)return null;if(e.zone===Ne)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ts=e=>{const n=e.slice(0,e.indexOf(":")),t=hi.find(e=>Kt(e.type)&&String(e.props.id)===n);return t&&Gt(n)===e?t:null},os=(e,n)=>{const t=ts(e);return!t||(!Yt.groupAccepts||Yt.groupAccepts(t.type,n,Ti(e).length))},rs=(e,n,t)=>{if(e.rung){const t=Mi(e.rung.nodeId),o=t?ji(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===wt&&n.index>=0&&n.index<=o}if(n.slot===wt)return!1;if(e.add)return ds(e.add,n);const o=Tn(n);if(Kt(e.type))return!1;const r=ts(o),i=ts(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!os(o,e.type))&&(n.index>=0&&n.index<=Ti(o).length));if(e.zone===Ne||o===Ne){if(e.zone!==o)return!1;const{floor:t,cap:r}=fi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Ti(o).length)return!1;if(e.zone===o)return!0;const l=Al&&!Yt.lastIsOpen?String(Al.props.id):null;return(!l||ns(e.zone)!==l&&ns(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Ti(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Pi.get(i),s=l?Ti(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&es(r).has(n))return!1;const d=kr(s.type,vr(Rt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1),wr(s));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Ti(n),r))})(e.zone,o,e.index,t)},is=(e,n)=>{const t=Tn(e.from),o=e.node;return t===Tn(n)?os(t,o.type):rs({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},ls=e=>{const n=e.slice(0,e.indexOf(":")),t=Pi.get(n),o=t?Ti(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=kr(o.type,vr(Rt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1),wr(o));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=O(r.choices??(r.spec?[{type:r.spec.childType,label:Ni(r.spec.childType)}]:[])),l=Ai(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:pl(o,t.zone===Ne)}},ss=(e,n)=>{if("section"!==e.kind)return e;const t=Tn(n);return t===Ne||ts(t)?e:ls(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ds=(e,n)=>{const t=ss(e,n),o=Tn(n);if("shared"===t.kind){if(o!==Ne||!Yt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=fi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ts(o)){const e="section"===t.kind?t.type:t.template.node.type;return os(o,e)&&n.index>=0&&n.index<=Ti(o).length}if(o!==Ne)return!1;const{floor:e,cap:r}=fi();return n.index>=e&&n.index<=r}if(o===Ne)return!1;const r=ls(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Ti(o))},as=(e,n)=>{const t=ss(e,n);if("block"!==t.kind&&ts(Tn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&os(n,o)){if("section"===e.kind)vo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;vo.insertNode(n,t,yi(e.template.node))}tr(R),vo.select({index:t,zone:n})}})(t,Tn(n),n.index);if("section"===t.kind)return void sl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=rl(t),r=vo.insertNode(Ne,o,n);ll(o,r,e)})(t.template.name,yi(t.template.node),n.index);if("shared"===t.kind){const e=Yt.shared?.nodeOf(t.section);if(!e)return;const o=rl(n.index);return void(bi.restore(e,{parentId:Pn,slot:$n,index:o})&&ll(o,e.props.id,t.section.title))}const o=Tn(n),r=ls(o);r&&(r.target.spec?$l(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{vo.insertComponent(e,n,t),tr(R),vo.select({index:t,zone:e})})(o,t.type,n.index))},cs=(e,n)=>{e.media?function(e){const n=Us();if(!n||!Hs)return;Xs(n).then(n=>{n&&function(e,n){if(!Hs)return;const t=Hs.create(e,{nodeDefaults:Ii,newNodeId:$e,sectionLabel:Oi,blockIsOffered:Sr}),o=Tn(n);if(o===Ne){const e=rl(n.index),o=vo.insertNode(Ne,e,t);return void ll(e,o,Oi(t.type))}vo.insertNode(o,n.index,t),tr(R),vo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Di(e.rung.nodeId,e.index,n.index):e.add?as(e.add,n):e.zone===Ne?il(e.index,n.index):ql(e.zone,Tn(n),e.index,n.index)},[ps]=Rn(()=>yn()),us=vn({keyOf:e=>e.id,readOnly:Boolean($t),session:ps,canDrop:rs,onDrop:cs,onStep:(e,n)=>{e.rung?Di(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Ne?((e,n)=>{const t=Oi(hi[e]?.type??""),o=il(e,n<0?e-1:e+2);if(!o.moved)return void Kr(n<0?to.sectionFirst({name:t}):to.sectionLast({name:t}));const{floor:r,cap:i}=fi();Kr(to.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):ql(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),hs=Dn(e=>{const{floor:n,cap:t}=fi(),o=[];for(const r of e.nodes){const e=Tn(r.place),i=Ti(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Zt(i)||qt(i)||gr(i.type,i))continue;if(Kt(i.type))continue;const l=Boolean(ts(e)),s=e===Ne||l;e===Ne&&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?Oi(i.type):Vi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Tn(e.list);if(n===Ne&&0===e.children.length)return[{...e,addLabel:to.addSection,addAlways:!0}];const t=ls(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ts(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Tn(e.list),t=n===Ne||ts(n)?null:ls(n);return t?.choices.length?hn(e,t.target.spec?.addLabel??to.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Rt.data]),fs=null==Wt?.props.id?null:String(Wt.props.id),ms=Hn(Le),gs=ms?.selected()&&Wo?.document&&fs?ms.selectedPart?.(Wo.document)??null:null,ys=gs&&fs&&Ee(Rt.data,Vt,fs,gs)?gs:null,vs=ys?.label?{element:ys.element,label:ys.label}:null,bs=null!==ys,ks=Dn(e=>{const n=Vt,t=e=>!e.item.rung&&null!==jn(Rt.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(fs);return i?bs?null:i:r(Qe(Rt.data,n,o.item.id,fs,Fl))??o},[Rt.data,Vt,fs,Fl,bs]),[Ss,ws]=Rn(null),xs=Boolean(Rl||Wl);zn(Wo,"mouseover",e=>{if(!xs)return;const n=Cn(e.target),t=n?yt(Rt.data,Vt,n):null;t!==Ss&&ws(t)}),zn(Wo,"mouseout",e=>{xs&&!e.relatedTarget&&ws(null)});const zs=e=>Zt(e)||qt(e)||Kt(e.type),Cs=e=>{const n=Kt(e.type)?Ni(e.type):Zt(e)?to.header:qt(e)?to.footer:null;return null===n?Bi(e):xr.rowName?xr.rowName(e,"section",n):n},Ns=[];if(xs){const e=fs?yt(Rt.data,Vt,fs):null;for(const n of/* @__PURE__ */new Set([e,Ss])){const e=n?hi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Zt(e)||e.type===Jt,o=Hl(e);if(o){Ns.push({id:String(e.props.id),label:Cs(e),below:t,reach:o});continue}if(!Rl||!zs(e))continue;const r=Rl(e);r&&Ns.push({id:String(e.props.id),label:r,below:t})}}const Is=he(),Os=Ln(null);Fn(()=>{const e=Yt.changeNotice;if(!e)return;const n=JSON.stringify(hi.filter(zs)),t=Os.current;if(Os.current={doc:Yn,bands:n,index:Dt.index},!t||t.doc!==Yn||t.bands===n)return;Dt.hasPast&&Dt.index>=t.index&&!gt.has(Is)&&(gt.add(Is),Kr(e,"success",{action:{label:to.bar.undo,onClick:()=>Dt.back()},duration:8e3}))},[hi]);const Bs=e=>{tr(R),vo.select(e.zone===Ne?{index:e.index}:{index:e.index,zone:e.zone})},Ps=Q(),$s=()=>({data:Rt.data,device:Io,ops:vo,inspector:ur}),Ts=Ps?.model,Ms=En(()=>Ts?e=>Ts(e,hs(e),$s()):hs,[Ts,hs,Io]),js=Ps?.measure,As=js?(e,n)=>js(e,n,$s()):void 0,Ls=Ps?.canDrop,Es=Ls?(e,n)=>Ls(e,n,rs,$s()):rs,Rs=Ps?.drop,Fs=Rs?(e,n)=>Rs(e,n,cs,$s()):cs,Ds=Ps?.pick,Ws=Ds?e=>Ds(e,Bs,$s()):Bs,Hs=Ps?.media??null,Vs=Ln(null),Ys=En(()=>Hs?{id:ft,zone:"",index:-1,type:Hs.adds.type,add:{kind:Hs.adds.kind,type:Hs.adds.type},media:!0}:null,[Hs]);Fn(()=>{if(!Ys||$t||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(nt))(e)&&(Vs.current=null,ps.start({key:ft,item:Ys}))},n=e=>{ps.get()?.item.media&&(Vs.current=Gn(e.dataTransfer))},t=()=>{ps.get()?.item.media&&ps.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[Ys,$t,ps]);const Us=()=>{const e=Vs.current;return Vs.current=null,e},Js=ue(),Xs=async e=>{if(!Js)return e;const n=await Js(e);return n?{...e,id:n.id,url:n.url}:null};const Ks=(e,n)=>{if(!Hs)return;const t=jn(yo.getState().appState.data,mi,n);if(!t)return;const o=t.node;vo.replaceComponent(Tn(t.place),t.place.index,{...o,props:{...Hs.replace(o,e),id:o.props.id}})},Gs=e=>{const n=Tn(e),t=Ai(n);t&&Ri(t.node,t.slot,!1),al(n,e.index)},Qs=(e,n)=>/* @__PURE__ */pt(Ue,{...$t?{}:us.seam({place:{...Mn(e),index:n}})},`seam:${e}:${n}`),_s={rowClick:ul,isCollapsed:Vr,toggleCollapse:Yr},Zs=e=>{const n=String(e.props.id),t=hi.findIndex(e=>String(e.props.id)===n),o=Gt(n),r=Ti(o),i=Vr(n),l=Ni(e.type),s=xr.rowName?xr.rowName(e,"section",l):l,d=e=>Qs(o,e);/* @__PURE__ */
|
|
16
|
+
return ut(ht,{children:[
|
|
17
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:e.type,size:13}),name:s,preview:fl(e),marks:ml(e),onSelect:()=>ol(t),nameSlot:Ui(Ne,t,n,s),selected:or===n,badge:Hl(e)?void 0:Jl,shared:Hl(e),actions:gl(e,Ne,t)??void 0,rowProps:{"data-node-id":n,onClick:ul(()=>ol(t))},fold:{open:!i,label:"section",onToggle:()=>Yr(n)}}),!i&&/* @__PURE__ */ut(We,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Bi(n),l=Ol(n),s=l&&Vr(r),a=()=>Pl(o,t,r,e.type),{rowProps:c,...p}=us.row({item:{id:r,zone:o,index:t,type:n.type},place:{...Mn(o),index:t}},{"data-node-id":r,onClick:ul(a)});/* @__PURE__ */
|
|
18
|
+
return ut(Vn,{children:[d(t),
|
|
19
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:n.type,size:13}),name:i,preview:fl(n),marks:ml(n),onSelect:a,nameSlot:Ui(o,t,r,i),selected:or===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Yr(r)}:void 0,actions:/* @__PURE__ */ut(ht,{children:[hl(o,t,i),gl(n,o,t),yl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */pt(We,{children:nd(n,2)})]},r)}),d(r.length)]})]})},qs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=us.dragging,d=!Vr(l)&&s?.rung?.nodeId!==i,a={...Mn(l),index:0},c=s&&!s.rung&&rs(s,a)?a:void 0,p=()=>Ri(e,n,!0),{rowProps:u,...h}=us.row({item:{id:`rung:${l}`,zone:`${i}:${wt}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:wt,index:t},into:c,canDrag:Boolean(mr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:ul(p)}),f=$t?null:mr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
+
return ut(Vn,{children:[n.heading,
|
|
21
|
+
/* @__PURE__ */pt(De,{words:oo,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Li===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Yr(l)},actions:f&&f.length>0?/* @__PURE__ */pt(ht,{children:f.map((t,o)=>/* @__PURE__ */pt(Ye,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if($t||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Fi(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__ */pt(lt,{size:15}):/* @__PURE__ */pt(ct,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */pt(We,{children:r})]},l)},ed=(e,n)=>{const t=wl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
+
return pt(ht,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Cl(e,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>Qs(e,n),p=/* @__PURE__ */ut(ht,{children:[i.map(({child:n,zone:t,index:o})=>{const r=or===String(n.props.id),{collapsible:i,folded:s}=Nl(n,l,Bl(n.type)),d=String(n.props.id),a=Zl(n),p=()=>Pl(t,o,d,e.type),{rowProps:u,...h}=us.row({item:{id:d,zone:t,index:o,type:n.type},place:{...Mn(t),index:o}},{"data-node-id":d,onClick:ul(p)});/* @__PURE__ */
|
|
23
|
+
return ut(Vn,{children:[0===o&&c(t,0),
|
|
24
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:n.type,size:13}),name:a,preview:fl(n),marks:ml(n),onSelect:p,nameSlot:Ui(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Yr(d)}:void 0,actions:/* @__PURE__ */ut(ht,{children:[hl(t,o,a),gl(n,t,o),yl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */pt(We,{children:ed(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?qs(e,t.rung,r++,o,p):/* @__PURE__ */pt(Vn,{children:p},t.slot??"")})})},nd=(e,n)=>{const t=vr(Rt?.data,e.type,String(e.props.id)),o=wl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
+
return pt(ht,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Cl(e,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),h=a&&!a.fixed?`${u}:${a.slot}`:null,f=p?`${u}:${p.slot}`:null,m=(e,n)=>Qs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),v=/* @__PURE__ */ut(ht,{children:[l.map(({child:n,zone:t,index:o})=>{const r=or===String(n.props.id),i=Vi(n),l=String(n.props.id),{collapsible:d,folded:a}=Nl(n,s,Bl(n.type)),c=kl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...Mn(p),index:Ti(p).length}:void 0,h=us.dragging,f=u&&h&&rs(h,u)?u:void 0,g=()=>Pl(t,o,l,e.type),{rowProps:y,...v}=us.row({item:{id:l,zone:t,index:o,type:n.type},place:{...Mn(t),index:o},into:f,canDrag:!gr(n.type,n)},{"data-node-id":l,onClick:ul(g)});/* @__PURE__ */
|
|
26
|
+
return ut(Vn,{children:[0===o&&m(t,0),
|
|
27
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:n.type,size:13}),name:i,preview:fl(n),marks:ml(n),onSelect:g,nameSlot:Ui(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Yr(l)}:void 0,actions:gr(n.type,n)?gl(n,t,o)??void 0:/* @__PURE__ */ut(ht,{children:[hl(t,o,i),gl(n,t,o),yl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */pt(We,{children:nd(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
+
/* @__PURE__ */pt(S,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>$l(e.props.id,a.slot,a.childType,c.length,e.type)}),null===g?f&&!l.some(e=>e.zone===f)?m(f,0):null:0!==l.length||(o.rung?y:g!==f)?null:m(g,0)]});return o.rung?qs(e,o.rung,i++,r,v):/* @__PURE__ */pt(Vn,{children:v},o.slot??"")})})},td=Ko,od=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:ko&&!td&&fr===e.id,onSelect:()=>pi(e.id)}:e,rd=[...(hr.railLead??[]).map(od),{id:"sections",label:to.layers,icon:/* @__PURE__ */pt(ge,{}),active:ko&&!td&&"sections"===fr,onSelect:()=>pi("sections")},...(hr.railTrail??[]).map(od)],id=Po?{onPress:$o}:At?{onPress:()=>{se(Sn,{accept:"image/*",title:co.mediaLibrary})}}:null,ld={value:rd.find(e=>!0===e.active)?.id??"",press:e=>{const n=rd.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:rd.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */pt("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},sd=[...hr.railLead??[],...hr.railTrail??[]].find(e=>"panel"in e&&e.id===fr),dd=Boolean(no?.foldable),ad=no?.label??(Lt?to.pageSections:to.templateSections),cd=dd&&Vr(xt),pd=/* @__PURE__ */ut(ht,{children:[hi.map((e,n)=>{if(Zt(e)||qt(e)||Kt(e.type))return null;const t=or===String(e.props.id),o=Boolean(e.props._hidden);Sl(e);const r=String(e.props.id),i=hr.hasOwnRows?.(e)??!1,l=Ol(e)||i,s=l&&Vr(r),d=kl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...Mn(a),index:Ti(a).length}:void 0,p=us.dragging,u=c&&p&&rs(p,c)?c:void 0,{rowProps:h,...f}=us.row({item:{id:r,zone:Ne,index:n,type:e.type},place:{...Mn(Ne),index:n},into:u,canDrag:!gr(e.type,e)},{"data-node-id":r,onClick:ul(()=>ol(n))});/* @__PURE__ */
|
|
29
|
+
return ut(Vn,{children:[n>0&&vl(n),
|
|
30
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:e.type,size:13}),name:Bi(e),preview:fl(e),marks:ml(e),shared:Hl(e),onSelect:()=>ol(n),nameSlot:Ui(Ne,n,r,Bi(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Yr(r)}:void 0,actions:/* @__PURE__ */ut(ht,{children:[hl(Ne,n,Bi(e)),gl(e,Ne,n),yl(Ne,n,e,Bi(e))]}),rowProps:h}),Ol(e)&&!s&&/* @__PURE__ */ut(We,{children:[nd(e,1),hr.partRows?.(e,_s)]}),i&&!s&&/* @__PURE__ */pt(We,{children:hr.ownRows?.(e,n,_s)})]},String(e.props.id??n))}),Gl>0&&vl(Gl)]}),ud=(e,n,t)=>{const o=String(e.props.id),r=xl(e).length>0||zl(e)||Boolean(kr(e.type)),i=r&&Vr(o),l="header"===t?to.header:to.footer,s=xr.rowName?xr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
+
return ut(ht,{children:[
|
|
32
|
+
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:t,size:13}),name:s,preview:fl(e),marks:ml(e),badge:Hl(e)?void 0:Jl,shared:Hl(e),onSelect:()=>ol(n),nameSlot:Ui(Ne,n,o,s),selected:or===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Yr(o)}:void 0,actions:gl(e,Ne,n)??void 0,rowProps:{"data-node-id":o,onClick:ul(()=>ol(n))}}),r&&!i&&/* @__PURE__ */pt(We,{children:ed(e,1)})]})};return(hr.wrap??(e=>e))(
|
|
33
|
+
/* @__PURE__ */pt(_,{target:Wo,children:/* @__PURE__ */ut("div",{ref:Do,className:"sf-editor es-editor",style:ln(Rr),onContextMenu:_i.onEditorContextMenu,...p(Sn),children:[
|
|
34
|
+
/* @__PURE__ */ut(_e,{children:[
|
|
35
|
+
/* @__PURE__ */ut("div",{className:"es-cluster es-cluster--left",children:[id?/* @__PURE__ */pt(Jn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */pt(ye,{}),onClick:id.onPress,children:to.railMedia}):null,
|
|
36
|
+
/* @__PURE__ */pt(Ze,{label:to.bar.undo,disabled:Boolean($t)||!Dt.hasPast,onClick:()=>Dt.back(),children:/* @__PURE__ */pt(tt,{})}),
|
|
37
|
+
/* @__PURE__ */pt(Ze,{label:to.bar.redo,disabled:Boolean($t)||!Dt.hasFuture,onClick:()=>Dt.forward(),children:/* @__PURE__ */pt(ot,{})})]}),
|
|
38
|
+
/* @__PURE__ */ut(qe,{children:[
|
|
39
|
+
/* @__PURE__ */pt(en,{devices:wo,value:Io,onChange:Oo}),
|
|
40
|
+
/* @__PURE__ */pt(Ze,{label:to.bar.refresh,tip:to.bar.refreshTip,onClick:()=>{Fo.current=(()=>{const e=Wo?.document;if(!e)return null;const n=hi.findIndex(qt),t=n>=0?n:hi.length;let o=null;for(let n=0;n<t;n++){const t=hi[n]?.props?.id;if(null==t)continue;const r=Bn(e,`[data-easel-block="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Wt?.props?.id??hi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Ro(e=>e+1)},children:/* @__PURE__ */pt(rt,{})}),hr.barView?.()]}),
|
|
41
|
+
/* @__PURE__ */ut(qe,{kind:"right",style:{minWidth:300},children:[
|
|
42
|
+
/* @__PURE__ */pt(v,{input:Jo,words:to.saveStatus}),Nn?/* @__PURE__ */pt(Nn,{}):null,hr.barLead?.(),hr.barTrail?.(),hr.mainAction||!hr.barMain?/* @__PURE__ */pt(b,{input:Jo,action:hr.mainAction??{label:to.done,onPress:()=>{qn(Rt.data)}},readOnly:Boolean($t),saveSwitch:Mt,onToggleAutoSave:It,onSaveNow:Xo,bar:to.bar,words:to.saveStatus}):hr.barMain()]})]}),
|
|
43
|
+
/* @__PURE__ */pt(ie,{}),
|
|
44
|
+
/* @__PURE__ */ut("div",{className:"sf-body",children:[ko?/* @__PURE__ */ut(ht,{children:[
|
|
45
|
+
/* @__PURE__ */ut("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":to.leftPanel,children:[
|
|
46
|
+
/* @__PURE__ */ut("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
|
+
/* @__PURE__ */pt(C,{side:"left",onHide:ai}),
|
|
48
|
+
/* @__PURE__ */pt("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
|
|
49
|
+
/* @__PURE__ */pt(Xn,{variant:"underline",block:!0,"aria-label":to.bar.views,value:ld.value,onChange:ld.press,items:ld.items})]}),Ko?/* @__PURE__ */pt(w,{at:_o?{label:(e=>{const n=ts(e.zone);if(n)return to.add.addingTo({name:xr.rowName?pl(n,!0):Ni(n.type)});if(e.zone===Ne){const n=hi[e.index];return n&&!qt(n)?to.add.addingBefore({name:pl(n,!0)}):to.add.addingAtEnd}const t=ls(e.zone);return t?to.add.addingTo({name:t.parentName}):to.add.addingHere})(_o),onClear:()=>Zo(null)}:void 0,placeBlocks:_o&&_o.zone!==Ne?ls(_o.zone)?.choices:void 0,canTake:_o?e=>{if(!_o)return null;const n={...Mn(_o.zone),index:_o.index};if(ds(e,n))return null;if("shared"===e.kind&&_o.zone===Ne&&!Yt.shared?.nodeOf(e.section))return to.shared.alreadyHere;const t=ts(_o.zone);if(t)return to.add.notInside({name:pl(t,!0)});if(_o.zone===Ne)return to.add.onlySections;const o=ls(_o.zone);return o?to.add.notInside({name:o.parentName}):to.add.onlySections}:void 0,onPick:_o?e=>{if(!_o)return;const n={...Mn(_o.zone),index:_o.index};ds(e,n)&&(as(e,n),cl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:e.type,add:e}),session:ps,siteWide:hr.addPanelRow?.(cl),onClose:cl,readOnly:Boolean($t)}):sd?sd.panel({onHide:ai,notify:Kr}):/* @__PURE__ */ut(ht,{children:[
|
|
50
|
+
/* @__PURE__ */pt(N,{icon:/* @__PURE__ */pt(ge,{}),title:to.layers,context:po,actions:/* @__PURE__ */ut(ht,{children:[!$t&&/* @__PURE__ */pt(nn,{label:to.add.title,onClick:()=>dl(null),children:/* @__PURE__ */pt(it,{size:15})}),
|
|
51
|
+
/* @__PURE__ */pt(nn,{label:_l?to.expandAll:to.collapseAll,title:0===Ql.length?to.nothingToFold:void 0,disabled:0===Ql.length,onClick:()=>Er(e=>{const n=new Set(Ql);return _l?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Ql])}),children:/* @__PURE__ */pt(bt,{expand:_l})})]})}),
|
|
52
|
+
/* @__PURE__ */ut(He,{className:"sf-tree sf-scroll",words:oo,children:[Xl&&/* @__PURE__ */ut(ht,{children:[!Dl&&/* @__PURE__ */pt(Ve,{children:to.header}),Zs(Xl)]}),Et&&!(Dl&&Xl)&&/* @__PURE__ */ut(ht,{children:[!Dl&&/* @__PURE__ */pt(Ve,{children:to.header}),!eo&&/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(Cr,{type:"header",size:13}),name:to.header,badge:Ul?void 0:Jl,shared:Ul,onSelect:ui,selected:nr.kind===_t?.kind,rowProps:{onClick:ul(ui)}})]}),El&&!(Dl&&Xl)&&ud(El,Ll,"header"),!dd&&/* @__PURE__ */pt(Ve,{children:ad}),dd?/* @__PURE__ */ut(ht,{children:[
|
|
53
|
+
/* @__PURE__ */pt(De,{words:oo,icon:null,name:ad,fold:{open:!cd,label:ad,onToggle:()=>Yr(xt)}}),!cd&&/* @__PURE__ */pt(We,{children:pd})]}):pd,Et&&!Dl&&/* @__PURE__ */pt(Ve,{children:to.footer}),Al&&!(Dl&&Kl)&&ud(Al,jl,"footer"),Kl&&Zs(Kl),hr.treeFoot?.()]})]})]}),
|
|
54
|
+
/* @__PURE__ */pt(tn,{side:"left",width:Rr.left,min:rn.left,max:on,defaultWidth:f.left,label:to.resizeLeftPanel,onResize:Wr})]}):/* @__PURE__ */pt(I,{side:"left",onShow:ai}),
|
|
55
|
+
/* @__PURE__ */ut("div",{ref:Gr,className:"sf-center sf-scroll","data-sf-canvas-head":ei?"":void 0,style:{overflowX:li?"auto":"hidden",overflowY:"hidden"},children:[ei&&/* @__PURE__ */pt("div",{ref:ni,className:"sf-canvas-head",children:/* @__PURE__ */pt(ei,{device:Io})}),
|
|
56
|
+
/* @__PURE__ */ut("div",{className:"sf-frame-scaler",style:si,children:[
|
|
57
|
+
/* @__PURE__ */pt("div",{className:"sf-frame "+(Io===Co?"":`sf-frame--${Io}`),style:di,children:/* @__PURE__ */ut("div",{className:"sf-preview-host",children:[
|
|
58
|
+
/* @__PURE__ */pt(Re.Provider,{value:Fl,children:/* @__PURE__ */pt(Fe.Provider,{value:Yl,children:/* @__PURE__ */pt(uo,{},Eo)})}),
|
|
59
|
+
/* @__PURE__ */pt(fn,{canvas:Wo,session:ps,model:Ms,measure:As,canDrop:Es,onDrop:Fs,choose:ks,tag:vs,onPick:Ws,dropOn:Hs?{accepts:(e,n)=>{if(!e.media||!Hs||n.item.rung)return!1;const t=jn(Rt.data,mi,n.item.id);return null!==t&&Hs.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Us();n&&Hs&&Xs(n).then(n=>{n&&Ks(n,e.item.id)})})(n),label:()=>to.canvasReplaceImage}:void 0,onZoneAdd:Gs,onSeamAdd:Gs,zoneAddLabel:to.canvasAddBlock,words:ro.canvas,readOnly:Boolean($t),revision:Rt.data}),qo.length>0&&!Ho&&/* @__PURE__ */pt("div",{className:"sf-preview-gaps",children:qo.map(e=>
|
|
60
|
+
/* @__PURE__ */pt(mn,{index:e.index,label:to.addSectionHere,onInsert:()=>dl(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))})]})}),xs?/* @__PURE__ */pt(vt,{canvas:Wo,tabs:Ns,onSelect:e=>{const n=hi.findIndex(n=>String(n.props.id)===e);n>=0&&ol(n)}}):null]})]}),So?/* @__PURE__ */ut(ht,{children:[In?
|
|
61
|
+
/* @__PURE__ */pt("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:In}):/* @__PURE__ */pt(ht,{children:/* @__PURE__ */pt(u,{value:{selectChild:Pl,addChild:$l,childRowName:Vi,blockRowName:Zl},children:/* @__PURE__ */pt(ho,{mode:nr,onOpenWebsiteSettings:hr.openSettings??(()=>{}),onOpenSiteStyles:hr.openStyles,onOpenPageStyles:hr.openPageStyles,onSelectNode:Br,onNotify:Kr,onHidePanel:ci,nodeActions:Wt?Ie(Vt,Wt.type):zt})})}),
|
|
62
|
+
/* @__PURE__ */pt(tn,{side:"right",width:Rr.right,min:rn.right,max:on,defaultWidth:f.right,label:to.resizeSettingsPanel,onResize:Hr})]}):
|
|
63
|
+
/* @__PURE__ */pt(I,{side:"right",onShow:ci})]}),_i.menu,
|
|
64
|
+
/* @__PURE__ */pt(te,{}),Si?/* @__PURE__ */pt(mt,{name:Si.name,onMake:e=>(async(e,n)=>{const t=hi.find(n=>String(n.props.id)===e),o=Yt.shared;if(!t||!o)return;let r;try{r=await z(ki).create(n,t)}catch{return void Kr(to.shared.makeFailed,"error")}o.adopt(t,r),wi(null)})(Si.id,e),onCancel:()=>wi(null)}):null]})}))}export{Nt as ScreenChrome};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-
|
|
1
|
+
export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-G7ISR6DI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-UKPZ2YWE.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-75C6WFNF.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-Y53EKN35.js";import"../../chunk-7RSE6KKY.js";import"../../chunk-OITNWE52.js";import"../../chunk-55KKGABA.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-5545A3PC.js";import"../../chunk-CMPFUJ26.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-QORC32JO.js";import"../../chunk-T2RINM7R.js";import"../../chunk-G7ISR6DI.js";import"../../chunk-FRAIEWRC.js";import"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-XFYFKITX.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5NHQ452C.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-JMAOCKB2.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-UKPZ2YWE.js";import"../../chunk-OXZDSOZV.js";import"../../chunk-7OCEPOEJ.js";import"../../chunk-DSKNJXB4.js";import"../../chunk-UMBNBCL4.js";import"../../chunk-5XL2RXFU.js";import"../../chunk-2FYFAAAK.js";import"../../chunk-22I55W37.js";import"../../chunk-3QB2ZQXK.js";import"../../chunk-DDH2DYQP.js";import"../../chunk-75C6WFNF.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-Y53EKN35.js";import"../../chunk-7RSE6KKY.js";import"../../chunk-OITNWE52.js";import"../../chunk-55KKGABA.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-4ESG53BH.js";import"../../chunk-5545A3PC.js";import"../../chunk-CMPFUJ26.js";import"../../chunk-VKPOH6MK.js";import"../../chunk-IZGFJWH4.js";import"../../chunk-N7E6264U.js";import"../../chunk-N3MJOHAG.js";import"../../chunk-5PXVT7JY.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-RUQOIQWI.js";import"../../chunk-QORC32JO.js";import"../../chunk-T2RINM7R.js";import"../../chunk-G7ISR6DI.js";import"../../chunk-FRAIEWRC.js";import"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import"../../chunk-XFYFKITX.js";import"../../chunk-IYHO4XQX.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5NHQ452C.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import"../../chunk-TCAAOYQY.js";import"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import"../../chunk-WHS6Y55E.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-ZKY45F5G.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-P5VYGWYO.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-BSPCSC45.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{AddBlockRow as e}from"../../chunk-G67G63O5.js";import{scrollPreviewToSection as n,gotoPreviewSlide as o}from"../../chunk-DDH2DYQP.js";import{useEaselUndoKeys as r}from"../../chunk-75C6WFNF.js";import{SlotChildActionsProvider as t}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as s}from"../../chunk-Y53EKN35.js";import{usePartBridge as i}from"../../chunk-7RSE6KKY.js";import{useSectionOps as c}from"../../chunk-OITNWE52.js";import"../../chunk-RUQOIQWI.js";import{SELECTION_MODE as p,useScreenPinned as l,useScreenCanvasFrame as m,useScreenInspectorPanel as d,useScreenPickFollowsSelection as
|
|
2
|
-
return L(X,{children:[o.map(({child:e,zone:o,index:r})=>{const t=re?.props.id===e.props.id,i=O(te,e.type,n),c=s(e),l=String(e.props.id),m=()=>Ve(o,r,l),{rowProps:d,...
|
|
1
|
+
import{AddBlockRow as e}from"../../chunk-G67G63O5.js";import{scrollPreviewToSection as n,gotoPreviewSlide as o}from"../../chunk-DDH2DYQP.js";import{useEaselUndoKeys as r}from"../../chunk-75C6WFNF.js";import{SlotChildActionsProvider as t}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as s}from"../../chunk-Y53EKN35.js";import{usePartBridge as i}from"../../chunk-7RSE6KKY.js";import{useSectionOps as c}from"../../chunk-OITNWE52.js";import"../../chunk-RUQOIQWI.js";import{SELECTION_MODE as p,useScreenPinned as l,useScreenCanvasFrame as m,useScreenInspectorPanel as d,useScreenPickFollowsSelection as a,sameInspectorMode as u,useStandaloneScreenBridges as h,useScreenBlockLook as k,useScreenBlockRules as j,isSelectionMode as f,shownChildSlotsOf as S}from"../../chunk-QORC32JO.js";import{MediaPopup as C}from"../../chunk-T2RINM7R.js";import{useScreenDocument as N}from"../../chunk-K7MMLCTT.js";import"../../chunk-ISS72IKO.js";import"../../chunk-ERR437B5.js";import"../../chunk-3FIS2FRS.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-NQW6XCAY.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-NCXYC7WI.js";import"../../chunk-YM4UEGBV.js";import"../../chunk-SNF5764Q.js";import"../../chunk-LX23TCTP.js";import{DEFAULT_SCREEN_WORDS as y}from"../../chunk-IYHO4XQX.js";import{slotChildRowName as A}from"../../chunk-5NHQ452C.js";import"../../chunk-6UAEFOJ4.js";import"../../chunk-AJ2SUSET.js";import"../../chunk-ANPOR6EY.js";import"../../chunk-R4AUZVA3.js";import{slotFieldsOf as x,nestsInTree as O}from"../../chunk-TCAAOYQY.js";import{useEasel as Y}from"../../chunk-FJTCSQWK.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-H4Z2V56N.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-YCSZAP7T.js";import{LayersTree as R,Subtree as F,TreeRow as P,TreeRowAction as W,TreeSeam as g}from"../../chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as E}from"../../chunk-K56YDHYQ.js";import"../../chunk-ZEH6QLBH.js";import"../../chunk-AGWKB77Q.js";import"../../chunk-FIVU2COQ.js";import"../../chunk-RPMSET77.js";import"../../chunk-FM6JO4WF.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as I,saveIndicator as T}from"../../chunk-H6DDIBQ4.js";import"../../chunk-HZSZT3BE.js";import"../../chunk-KRL3IUV3.js";import"../../chunk-Y2T3JX7K.js";import"../../chunk-KFWNGPW3.js";import"../../chunk-JACEEVVF.js";import"../../chunk-CZAAGBVL.js";import{SaveState as v,panelWidthVars as M}from"../../chunk-WYTPBF3Q.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-AJSDWWJW.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import{useWords as Q}from"../../chunk-MFIRYGHW.js";import"../../chunk-LN43DP2A.js";import"../../chunk-TQ5Y6S2X.js";import{useTreeDrag as b}from"../../chunk-6NJHYXJM.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-YU3WHLGI.js";import"../../chunk-LF3FUSCQ.js";import{zoneKey as z,parseZoneKey as B}from"../../chunk-TGZCD6IP.js";import"../../chunk-KXM6YRG2.js";import"../../chunk-467WWV4I.js";import"../../chunk-TIAWIOGD.js";import"../../chunk-MGVI67QV.js";import{useState as H,useRef as w,useEffect as D,useCallback as K,Fragment as V}from"react";import{Tooltip as G}from"efficient-shell/ui";import{TrashIcon as J}from"efficient-shell/icons/efficient";import{jsxs as L,jsx as Z,Fragment as X}from"react/jsx-runtime";var U=e=>n=>{n.target.closest("button, input")||e()},$={rowClick:U};function q(){const{saveState:q,readOnly:_,readOnlyReason:ee=null}=N(),ne=c(),{appState:oe,selectedItem:re,config:te}=Y(e=>e),[se,ie]=H(p),ce=Q("screen",y),pe=Q("tree",E),le=Q("save",I),{first:me,last:de,panelOf:ae}=l(),ue=ae(me),he=m(),ke=d(),je=oe.data.content?.[0]??null,fe=je?.props.id??null,Se=je?.type===me,Ce=je?.type===de,Ne=w(null),ye=w(null);r(ye),a(re?.props.id),D(()=>{fe&&Ne.current!==fe&&(Ne.current=fe,Se?ie(ue??p):re||ne.select({index:0}))},[fe,re,ne,Se]);const Ae=K(e=>ie(n=>u(n,e)?n:e),[]),xe=h({kind:se.kind,mode:se,open:Ae,show:e=>ie(e),reveal:()=>{},select:(e,n)=>{ie(e=>u(e,n)?e:n),ne.select(e)}}),{selectNode:Oe}=i({mode:se,setMode:ie,onOpenPart:n}),Ye=k(),{labelAtLevel:Re,Icon:Fe}=Ye,{canAddTo:Pe}=j(),We=e=>Re(e,"block",te.components[e]?.label??e),ge=e=>Re(e,"section",We(e)),Ee=!Se&&f(se)&&re?.props.id===fe,Ie=je?Pe(je.type)?.spec??null:null,Te=je&&Ie?`${je.props.id}:${Ie.slot}`:null,ve=je&&Ie&&Array.isArray(je.props[Ie.slot])?je.props[Ie.slot]:[],Me=e=>A(e,We,Ye.plainText),Qe=(e,r)=>{je&&Ie&&Te&&(ie(p),Ie.slider?(o(String(je.props.id),e),ne.select({index:e,zone:Te}),n(String(je.props.id))):(ne.select({index:e,zone:Te}),n(r)))},be=()=>{if(!je||!Ie||!Te)return;const e=ve.length;ne.insertComponent(Te,Ie.childType,e),ie(p),Ie.slider?requestAnimationFrame(()=>{o(String(je.props.id),e),ne.select({index:e,zone:Te})}):ne.select({index:e,zone:Te})},ze=e=>x(te,e),Be=e=>{const{parentId:n,slot:o}=B(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of ze(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(je)?.props[o];return Array.isArray(t)?t.length:0},He=(e,n,o)=>{const r=Math.min(Math.max(o,0),Be(e)),t=n<r?r-1:r;t!==n&&(ne.reorderComponent(e,n,t),ie(p),ne.select({index:t,zone:e}))},we=b({keyOf:e=>e.id,readOnly:Boolean(_),canDrop:(e,n)=>z(n)===e.zone&&n.index>=0&&n.index<=Be(e.zone),onDrop:(e,n)=>He(e.zone,e.index,n.index),onStep:(e,n)=>He(e.zone,e.index,n<0?e.index-1:e.index+2)}),De=(e,n)=>/* @__PURE__ */Z(g,{..._?{}:we.seam({place:{...B(e),index:n}})},`seam:${e}:${n}`),Ke=e=>Ye.blockRowName(e,We),Ve=(e,o,r)=>{ie(p),ne.select({index:o,zone:e}),n(r)},Ge=(e,n,o)=>{ne.insertComponent(e,n,o),ie(p),ne.select({index:o,zone:e})},Je=(n,o,r)=>/* @__PURE__ */Z(e,{choices:r,onPick:e=>Ge(n,e,o)}),Le=(e,n)=>{const o=S(te,e);const r=Pe(e.type,void 0,void 0,{id:String(e.props.id??""),data:oe.data}),t=r?.choices??null,s="footer"===r?.source?Ke:Me;/* @__PURE__ */
|
|
2
|
+
return L(X,{children:[o.map(({child:e,zone:o,index:r})=>{const t=re?.props.id===e.props.id,i=O(te,e.type,n),c=s(e),l=String(e.props.id),m=()=>Ve(o,r,l),{rowProps:d,...a}=we.row({item:{id:l,zone:o,index:r},place:{...B(o),index:r}},{onClick:U(m)});/* @__PURE__ */
|
|
3
3
|
return L(V,{children:[0===r&&De(o,0),
|
|
4
|
-
/* @__PURE__ */Z(P,{words:pe,icon:/* @__PURE__ */Z(Fe,{type:e.type,size:13}),name:c,selected:t,onSelect:m,...
|
|
5
|
-
return L("div",{ref:ye,className:"sf-editor es-editor",style:
|
|
6
|
-
/* @__PURE__ */Z("div",{className:"sf-section-bar",children:/* @__PURE__ */Z(
|
|
4
|
+
/* @__PURE__ */Z(P,{words:pe,icon:/* @__PURE__ */Z(Fe,{type:e.type,size:13}),name:c,selected:t,onSelect:m,...a,actions:/* @__PURE__ */Z(W,{kind:"delete",label:ce.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,ne.removeComponent(e,n),ie(p),void ne.select(null);var e,n},children:/* @__PURE__ */Z(J,{size:13})}),rowProps:d}),i&&/* @__PURE__ */Z(F,{children:Le(e,n+1)}),De(o,r+1)]},String(e.props.id??`${o}-${r}`))}),r&&t?Je(`${e.props.id}:${r.slot}`,o.length,t):null]})},Ze="HeroSingle"===je?.type,Xe=Boolean(je)&&(Boolean(Pe(je.type))||ze(je.type).length>0),Ue=Boolean(je)&&(Boolean(Ie)||Ce||Se||Ze||Xe);/* @__PURE__ */
|
|
5
|
+
return L("div",{ref:ye,className:"sf-editor es-editor",style:M(s),children:[
|
|
6
|
+
/* @__PURE__ */Z("div",{className:"sf-section-bar",children:/* @__PURE__ */Z(v,null!==ee?{tone:"off",label:ee,role:"status"}:{...T(q,le),role:"status"})}),
|
|
7
7
|
/* @__PURE__ */L("div",{className:"sf-body",children:[Ue&&je&&/* @__PURE__ */L("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
|
|
8
|
-
/* @__PURE__ */Z("div",{className:"sf-panel-head",children:/* @__PURE__ */Z(G,{content:Se?ce.headerSettings:ce.sectionSettings({name:
|
|
8
|
+
/* @__PURE__ */Z("div",{className:"sf-panel-head",children:/* @__PURE__ */Z(G,{content:Se?ce.headerSettings:ce.sectionSettings({name:ge(je.type)}),side:"bottom",children:/* @__PURE__ */Z("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(Ee?"is-selected":""),"aria-pressed":Ee,onClick:()=>{Se?ie(ue??p):(ie(p),ne.select({index:0}))},children:ge(je.type)})})}),
|
|
9
9
|
/* @__PURE__ */Z(R,{className:"sf-tree sf-scroll",rootProps:we.rootProps(),words:pe,children:/* @__PURE__ */Z(F,{children:Se?
|
|
10
|
-
/* @__PURE__ */Z(P,{words:pe,icon:/* @__PURE__ */Z(Fe,{type:"header",size:13}),name:ce.headerSettings,selected:se.kind===
|
|
11
|
-
return L(V,{children:[0===n&&De(
|
|
12
|
-
/* @__PURE__ */Z(P,{words:pe,icon:/* @__PURE__ */Z(Fe,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */Z(W,{kind:"delete",label:ce.deleteNamed({name:r}),onClick:()=>{return e=n,void(
|
|
13
|
-
/* @__PURE__ */L("button",{type:"button",className:"sf-add-card",onClick:
|
|
14
|
-
/* @__PURE__ */Z("span",{className:"sf-plus sf-plus--sm",children:"+"}),
|
|
10
|
+
/* @__PURE__ */Z(P,{words:pe,icon:/* @__PURE__ */Z(Fe,{type:"header",size:13}),name:ce.headerSettings,selected:se.kind===ue?.kind,onSelect:()=>ie(ue??p),rowProps:{onClick:U(()=>ie(ue??p))}}):Ie?/* @__PURE__ */L(X,{children:[ve.map((e,n)=>{const o=re?.props.id===e.props.id,r=Me(e),t=String(e.props.id),s=()=>Qe(n,t),{rowProps:i,...c}=we.row({item:{id:t,zone:Te,index:n},place:{...B(Te),index:n}},{onClick:U(s)});/* @__PURE__ */
|
|
11
|
+
return L(V,{children:[0===n&&De(Te,0),
|
|
12
|
+
/* @__PURE__ */Z(P,{words:pe,icon:/* @__PURE__ */Z(Fe,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */Z(W,{kind:"delete",label:ce.deleteNamed({name:r}),onClick:()=>{return e=n,void(Te&&(ne.removeComponent(Te,e),ie(p),ne.select(null)));var e},children:/* @__PURE__ */Z(J,{size:13})}),rowProps:i}),De(Te,n+1)]},String(e.props.id??n))}),
|
|
13
|
+
/* @__PURE__ */L("button",{type:"button",className:"sf-add-card",onClick:be,children:[
|
|
14
|
+
/* @__PURE__ */Z("span",{className:"sf-plus sf-plus--sm",children:"+"}),Ie.addLabel]}),fe?xe.partRows?.(je,$):null]}):Le(je,1)})})]}),
|
|
15
15
|
/* @__PURE__ */Z("div",{className:"sf-center",children:/* @__PURE__ */Z("div",{className:"sf-preview-host",children:/* @__PURE__ */Z(he,{})})}),
|
|
16
|
-
/* @__PURE__ */Z(t,{value:{selectChild:(e,n,o,r)=>"section"===Pe(r)?.source?
|
|
16
|
+
/* @__PURE__ */Z(t,{value:{selectChild:(e,n,o,r)=>"section"===Pe(r)?.source?Qe(n,o):Ve(e,n,o),addChild:(e,n,o,r,t)=>"section"===Pe(t)?.source?be():Ge(`${e}:${n}`,o,r),childRowName:Me,blockRowName:Ke},children:/* @__PURE__ */Z(ke,{mode:se,onOpenWebsiteSettings:xe.openSettings??(()=>{}),onSelectNode:Oe,hideNodeActions:!0})})]}),
|
|
17
17
|
/* @__PURE__ */Z(C,{})]})}export{q as default};
|
package/dist/screen/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DocumentScreen, default as ScreenMount } from './components/ScreenMount.js';
|
|
2
2
|
export { default as ScreenStoreProvider } from './components/ScreenStoreProvider.js';
|
|
3
|
-
export { NodeDefaults, SELECTION_MODE, ScreenBlockLook, ScreenBlockRules, ScreenBridges, ScreenCanvas, ScreenCanvasDrag, ScreenCanvasDragContext, ScreenCanvasHeadProps, ScreenCanvasTargetProvider, ScreenDevices, ScreenDocumentOps, ScreenDragItem, ScreenInspector, ScreenInspectorMode, ScreenInspectorPanelProps, ScreenLeftPanel, ScreenLeftView, ScreenLeftViewFrame, ScreenLeftViewRules, ScreenMainAction, ScreenMediaDrop, ScreenMediaFile, ScreenMenuItem, ScreenMenuRows, ScreenNewNode, ScreenNode, ScreenNodeActions, ScreenNodeLevel, ScreenNodeMaker, ScreenPartMode, ScreenParts, ScreenPartsProvider, ScreenPinnedBand, ScreenPinnedNodes, ScreenRailItem, ScreenSelector, ScreenSharedSections, ScreenSlot, ScreenSlotAction, ScreenSlotMode, ScreenStyleClipboard, ScreenStyleDocument, ScreenStylePastePlan, ScreenToastExtra, ScreenTree, ScreenTreeFolds, ScreenTreeRows, isPinnedFirst, isPinnedLast, isSelectionMode, isSlotMode, sameInspectorMode, screenSlotsOf, shownChildSlotsOf, shownSlotFieldsOf, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasDrag, useScreenCanvasFrame, useScreenCanvasHead, useScreenCanvasTarget, useScreenDevices, useScreenDocumentLabel, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenNodeKeys, useScreenNotify, useScreenOwnerName, useScreenParts, useScreenPickFollowsSelection, useScreenPinned, useScreenSaveSwitch, useScreenStorageNamespace, useScreenStyleClipboard, useStandaloneScreenBridges } from './lib/screen-parts.js';
|
|
3
|
+
export { NodeDefaults, SELECTION_MODE, ScreenBlockLook, ScreenBlockRules, ScreenBridges, ScreenCanvas, ScreenCanvasDrag, ScreenCanvasDragContext, ScreenCanvasHeadProps, ScreenCanvasTargetProvider, ScreenDevices, ScreenDocumentOps, ScreenDragItem, ScreenInspector, ScreenInspectorMode, ScreenInspectorPanelProps, ScreenLeftPanel, ScreenLeftView, ScreenLeftViewFrame, ScreenLeftViewRules, ScreenMainAction, ScreenMediaDrop, ScreenMediaFile, ScreenMenuItem, ScreenMenuRows, ScreenNewNode, ScreenNode, ScreenNodeActions, ScreenNodeAt, ScreenNodeLevel, ScreenNodeMaker, ScreenPartMode, ScreenParts, ScreenPartsProvider, ScreenPinnedBand, ScreenPinnedNodes, ScreenRailItem, ScreenSelector, ScreenSharedSections, ScreenSlot, ScreenSlotAction, ScreenSlotMode, ScreenStyleClipboard, ScreenStyleDocument, ScreenStylePastePlan, ScreenToastExtra, ScreenTree, ScreenTreeFolds, ScreenTreeRows, isPinnedFirst, isPinnedLast, isSelectionMode, isSlotMode, sameInspectorMode, screenSlotsOf, shownChildSlotsOf, shownSlotFieldsOf, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasDrag, useScreenCanvasFrame, useScreenCanvasHead, useScreenCanvasTarget, useScreenDevices, useScreenDocumentLabel, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenNodeKeys, useScreenNotify, useScreenOwnerName, useScreenParts, useScreenPickFollowsSelection, useScreenPinned, useScreenSaveSwitch, useScreenStorageNamespace, useScreenStyleClipboard, useStandaloneScreenBridges } from './lib/screen-parts.js';
|
|
4
4
|
export { DefaultBackend, EFFICIENT_BACKEND, EaselSession, SessionBackend, SessionBlocks, activateEaselSession, backendOf, createEaselSession, currentEaselSession, deactivateEaselSession, efficientClientOpen, isEfficientBackend, provideDefaultBackend, resetAmbientEaselSession, sessionRegistry, setSessionBridgedSite, setSessionDocumentSite } from './lib/session.js';
|
|
5
5
|
export { EaselSessionProvider, useEaselSession } from './lib/session-context.js';
|
|
6
6
|
export { A as AnyDocumentAddressing, D as DETACHED_EASEL_HOST, a as DocumentAddressing, E as EaselBlockType, b as EaselFieldDescription, c as EaselHost, d as EaselHostAddress, e as EaselHostContext, f as EaselHostPanels, g as EaselHostProvider, h as EaselMessageType, i as EaselSelection, j as EaselToHostMessage, F as FIELD_DESCRIPTION_MARKER, H as HostPickedMedia, k as HostToEaselMessage, I as InboundHostMessage, N as NO_DOCUMENT_ADDRESSING, P as PageEditOp, l as PickedMediaSource, S as SectionScreenTarget, m as SendToHost, n as createEaselHost, o as describedAs, u as useEaselHost, p as useHostEscape } from '../ScreenDocumentContext-DPW_6gOC.js';
|
package/dist/screen/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-
|
|
1
|
+
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-JMAOCKB2.js";import"../chunk-GXQCZJOP.js";import"../chunk-UKPZ2YWE.js";import"../chunk-OXZDSOZV.js";import"../chunk-7OCEPOEJ.js";import"../chunk-DSKNJXB4.js";import"../chunk-UMBNBCL4.js";import"../chunk-5XL2RXFU.js";import"../chunk-2FYFAAAK.js";import"../chunk-22I55W37.js";import"../chunk-3QB2ZQXK.js";import"../chunk-DDH2DYQP.js";import"../chunk-75C6WFNF.js";import"../chunk-KCBEE2MC.js";import"../chunk-Y53EKN35.js";import"../chunk-7RSE6KKY.js";import"../chunk-OITNWE52.js";import"../chunk-55KKGABA.js";import"../chunk-RKTF5XLP.js";export{ScreenStoreProvider}from"../chunk-4ESG53BH.js";import"../chunk-5545A3PC.js";import"../chunk-CMPFUJ26.js";import"../chunk-VKPOH6MK.js";import"../chunk-IZGFJWH4.js";import"../chunk-N7E6264U.js";import"../chunk-N3MJOHAG.js";import"../chunk-5PXVT7JY.js";import"../chunk-UMDQ6CLQ.js";import"../chunk-RUQOIQWI.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSelectionMode,isSlotMode,sameInspectorMode,screenSlotsOf,shownChildSlotsOf,shownSlotFieldsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-QORC32JO.js";import"../chunk-T2RINM7R.js";import"../chunk-G7ISR6DI.js";import"../chunk-FRAIEWRC.js";import"../chunk-K7MMLCTT.js";import"../chunk-ISS72IKO.js";import"../chunk-ERR437B5.js";import"../chunk-3FIS2FRS.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-NQW6XCAY.js";import"../chunk-LOMEH6DG.js";import"../chunk-KCOBHPN6.js";import"../chunk-NCXYC7WI.js";export{EaselSessionProvider,useEaselSession}from"../chunk-YM4UEGBV.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-SNF5764Q.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,FIELD_DESCRIPTION_MARKER,createEaselHost,describedAs,useEaselHost,useHostEscape}from"../chunk-LX23TCTP.js";import"../chunk-XFYFKITX.js";import"../chunk-IYHO4XQX.js";import"../chunk-V7U33NF2.js";import"../chunk-6WY6ZXJG.js";import"../chunk-5NHQ452C.js";import"../chunk-6UAEFOJ4.js";import"../chunk-AJ2SUSET.js";import"../chunk-ANPOR6EY.js";import"../chunk-R4AUZVA3.js";import"../chunk-TCAAOYQY.js";import"../chunk-FJTCSQWK.js";import"../chunk-TBY3DFKS.js";import"../chunk-H4Z2V56N.js";import"../chunk-BPXEFVSQ.js";import"../chunk-YCSZAP7T.js";import"../chunk-WHS6Y55E.js";import"../chunk-K56YDHYQ.js";import"../chunk-ZEH6QLBH.js";import"../chunk-AGWKB77Q.js";import"../chunk-ZKY45F5G.js";import"../chunk-FIVU2COQ.js";import"../chunk-P5VYGWYO.js";import"../chunk-WK3AFPXY.js";import"../chunk-RPMSET77.js";import"../chunk-FM6JO4WF.js";import"../chunk-KFV7N2DJ.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-HZSZT3BE.js";import"../chunk-KRL3IUV3.js";import"../chunk-Y2T3JX7K.js";import"../chunk-KFWNGPW3.js";import"../chunk-JACEEVVF.js";import"../chunk-CZAAGBVL.js";import"../chunk-WYTPBF3Q.js";import"../chunk-MJM6SFD3.js";import"../chunk-AJSDWWJW.js";import"../chunk-2OAZYSWJ.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MFIRYGHW.js";import"../chunk-LN43DP2A.js";import"../chunk-TQ5Y6S2X.js";import"../chunk-6NJHYXJM.js";import"../chunk-P2VEMZH5.js";import"../chunk-YU3WHLGI.js";import"../chunk-LF3FUSCQ.js";import"../chunk-TGZCD6IP.js";import"../chunk-KXM6YRG2.js";import"../chunk-BSPCSC45.js";import"../chunk-467WWV4I.js";import"../chunk-TIAWIOGD.js";import"../chunk-MGVI67QV.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{deviceField as e}from"../../../chunk-2FYFAAAK.js";import{noControlField as t,NoControlMark as n}from"../../../chunk-22I55W37.js";import{describedAs as o}from"../../../chunk-LX23TCTP.js";export{FIELD_DESCRIPTION_MARKER,describedAs}from"../../../chunk-LX23TCTP.js";import{withStyleKind as l}from"../../../chunk-V7U33NF2.js";import"../../../chunk-
|
|
1
|
+
import{deviceField as e}from"../../../chunk-2FYFAAAK.js";import{noControlField as t,NoControlMark as n}from"../../../chunk-22I55W37.js";import{describedAs as o}from"../../../chunk-LX23TCTP.js";export{FIELD_DESCRIPTION_MARKER,describedAs}from"../../../chunk-LX23TCTP.js";import"../../../chunk-IYHO4XQX.js";import{withStyleKind as l}from"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import{phoneKey as a}from"../../../chunk-E52W3M5I.js";import{foldMetaOf as i,FOLD_FIELD_MARKER as r}from"../../../chunk-ANPOR6EY.js";import{useEasel as s,useSelectedFields as u}from"../../../chunk-FJTCSQWK.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-AGWKB77Q.js";import"../../../chunk-RPMSET77.js";import{SettingsDefaultReset as c,sidesStartEach as d,SidesInput as p,SidesEachToggle as m}from"../../../chunk-TOHOGVAE.js";import"../../../chunk-FM6JO4WF.js";import{DEFAULT_PANEL_WORDS as b}from"../../../chunk-KFV7N2DJ.js";import"../../../chunk-HZSZT3BE.js";import"../../../chunk-KRL3IUV3.js";import{FieldSelect as f}from"../../../chunk-KFWNGPW3.js";import"../../../chunk-JACEEVVF.js";import{SettingsSwitch as h}from"../../../chunk-OECWLNKJ.js";import{SettingsField as g,SettingsSegmented as v}from"../../../chunk-CZAAGBVL.js";import{useWords as y}from"../../../chunk-MFIRYGHW.js";import"../../../chunk-YU3WHLGI.js";import"../../../chunk-LF3FUSCQ.js";import"../../../chunk-TGZCD6IP.js";import"../../../chunk-KXM6YRG2.js";import"../../../chunk-BSPCSC45.js";import{useState as k}from"react";import{BoxJustifyIcon as C,WrapIcon as j,GapIcon as x,WidthIcon as F,PlacementIcon as w,NudgeIcon as P,PaddingAllIcon as S,BoxYBetweenIcon as E,BoxYStretchIcon as L,BoxYEndIcon as I,BoxYCenterIcon as O,BoxYStartIcon as T,BoxXBetweenIcon as W,BoxXStretchIcon as K,BoxXEndIcon as A,BoxXCenterIcon as G,BoxXStartIcon as R,BoxItemAlignmentIcon as B}from"efficient-shell/icons/efficient";import{Slider as N,AlignmentGrid as V,PositionInput as Y}from"efficient-shell/ui";import{jsx as J,Fragment as M,jsxs as D}from"react/jsx-runtime";var X=e=>e;function Z(){return null}function H(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
|
|
2
2
|
return J(Z,{},e)}function U(e){return e.type===Z}function _(e){return U(e)?void 0:e}function Q(e){for(const[t,n]of Object.entries(e))n&&"object"==typeof n&&!i(n)&&l(n,`section:${t}`);return e}function z(e,t){return{type:"custom",[r]:{label:e,level:t},marker:!0,fold:e,render:()=>/* @__PURE__ */J(M,{})}}function $(e){return z(e,2)}function q(e){return z(e,1)}var ee=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],te=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],ne="Wrap",oe=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],le="Direction",ae=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],ie={min:-32,max:64,step:2,builtIn:0},re={min:30,max:100,step:5,fallback:60},se=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],ue="bottom-left",ce={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},de=se.map(e=>({value:e,label:ce[e]}));function pe(e,t=ue){return se.includes(e)?e:t}var me=40,be=e=>"number"==typeof e?e:null;function fe(e,t,n){const o={};for(const l of["x","y"])n[l]!==t[l]&&(o[e[l]]=n[l]??void 0);return o}var he=["top","right","bottom","left"],ge={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ve=e=>"number"==typeof e?e:null;function ye(e,t,n){const o={};for(const l of he)n[l]!==t[l]&&(o[e[l]]=n[l]??void 0);return o}function ke(e,{options:t,value:n,onChange:o,ariaLabel:l,disabled:a=!1}){/* @__PURE__ */
|
|
3
3
|
return J(v,{options:t.map(t=>t.picture?{id:t.value,label:t.picture,title:e(t.title??t.label)}:{id:t.value,label:e(t.label),title:void 0===t.title?void 0:e(t.title)}),value:n,onChange:o,ariaLabel:e(l),disabled:a})}function Ce(e,{label:t,value:n,onChange:o,points:l}){const a=l.find(e=>e.disabled),i=l.map(t=>({...t,label:e(t.label),...t.title?{title:e(t.title)}:null}));/* @__PURE__ */
|
|
4
4
|
return J(g,{label:e(t),icon:/* @__PURE__ */J(w,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */J(V,{label:e(t),value:n,points:i,onChange:o})})}function je({say:e,label:t,value:n,onChange:o,pointsFor:l}){const{appState:a,selectedItem:i}=s(e=>e),r=i?.props?.id?String(i.props.id):void 0;return Ce(e,{label:t,value:n,onChange:o,points:l(a?.data,r)})}function xe(){try{return u()}catch{return null}}function Fe({say:e,o:t}){const n=xe(),o=y("panel",b),l=n?.values??{},a={x:be(l[t.keys.x]),y:be(l[t.keys.y])},i=e(t.label??"Position"),r=Boolean(a.x||a.y),s=e=>{const o=fe(t.keys,a,e);Object.keys(o).length&&n?.onChangeMany(o)},u=/* @__PURE__ */J(Y,{label:i,value:a,onChange:s,words:{x:e("Left and right"),y:e("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:t.min,max:t.max,step:t.step??1}),d=/* @__PURE__ */J(c,{words:o,label:i,changed:r,detail:"0 px, 0 px",onReset:()=>s({x:null,y:null})});return null===t.label?/* @__PURE__ */D("div",{className:"sf-position-line",children:[u,d]}):/* @__PURE__ */J(g,{label:i,icon:/* @__PURE__ */J(P,{}),changed:r,action:d,children:u})}var we={x:{start:/* @__PURE__ */J(R,{}),center:/* @__PURE__ */J(G,{}),end:/* @__PURE__ */J(A,{}),stretch:/* @__PURE__ */J(K,{}),between:/* @__PURE__ */J(W,{})},y:{start:/* @__PURE__ */J(T,{}),center:/* @__PURE__ */J(O,{}),end:/* @__PURE__ */J(I,{}),stretch:/* @__PURE__ */J(L,{}),between:/* @__PURE__ */J(E,{})}},Pe=e=>"row"===e?"row":"column";function Se({say:e,kind:t,label:n,options:o,value:l,onChange:a,o:i}){const r=xe(),s="justify"===t==("row"===(i.runs??Pe)(r?.values?.[i.directionKey??"direction"]))?"x":"y";return ke(e,{options:o.map(e=>({label:e.label,value:e.value,picture:we[s][e.value]})),value:l,onChange:a,ariaLabel:n})}function Ee({say:e,tier:t,o:n}){const o=xe(),l=o?.values??{},a="mobile"===t?n.phoneKeys:n.keys,i=Object.fromEntries(he.map(e=>[e,ve(l[a[e]])])),r=Object.fromEntries(he.map(e=>[e,String("mobile"===t?ve(l[n.keys[e]])??n.fallback[e]:n.fallback[e])])),[s,u]=k(()=>d(i,r));/* @__PURE__ */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-DSKNJXB4.js";import"../../../chunk-5XL2RXFU.js";import"../../../chunk-2FYFAAAK.js";import"../../../chunk-22I55W37.js";import"../../../chunk-3QB2ZQXK.js";import"../../../chunk-
|
|
1
|
+
export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-DSKNJXB4.js";import"../../../chunk-5XL2RXFU.js";import"../../../chunk-2FYFAAAK.js";import"../../../chunk-22I55W37.js";import"../../../chunk-3QB2ZQXK.js";import"../../../chunk-IYHO4XQX.js";import"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-ANPOR6EY.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-YCSZAP7T.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-BSPCSC45.js";
|
|
@@ -613,6 +613,11 @@ interface ScreenNewNode {
|
|
|
613
613
|
type: string;
|
|
614
614
|
props: Record<string, unknown>;
|
|
615
615
|
}
|
|
616
|
+
/** The node a `canAddTo` question is asked of: its id, and the document it is in. */
|
|
617
|
+
interface ScreenNodeAt {
|
|
618
|
+
id: string;
|
|
619
|
+
data: unknown;
|
|
620
|
+
}
|
|
616
621
|
/**
|
|
617
622
|
* The rules of particular blocks, asked by the screen and never stated in it:
|
|
618
623
|
* the screen is handed nodes and is not told which blocks exist. Plain
|
|
@@ -660,8 +665,16 @@ interface ScreenBlockRules {
|
|
|
660
665
|
* opened at, a drop into a slot. The answer is that slot's (the campaign
|
|
661
666
|
* designer's Column 2 answers `col2`); a layer that keeps one slot per node
|
|
662
667
|
* may ignore it, and the screen then offers that slot alone, as before.
|
|
668
|
+
*
|
|
669
|
+
* `at` (24.2.0) is the ONE node asked of, where the screen means one: its
|
|
670
|
+
* id and the document it is in (Add opened in it, its rows in the tree, a
|
|
671
|
+
* drop or an insert into it). Two nodes of one type may take different
|
|
672
|
+
* children — the campaign designer's Box takes any email block, a Box in a
|
|
673
|
+
* Banner only what the Banner's bake can draw. A layer whose nodes of one
|
|
674
|
+
* type all take the same may ignore it. Absent where the question is about
|
|
675
|
+
* a type, not a node (the Add panel's catalogue).
|
|
663
676
|
*/
|
|
664
|
-
canAddTo: (nodeType: string, nestDepth?: number, slot?: string) => AddTarget | null;
|
|
677
|
+
canAddTo: (nodeType: string, nestDepth?: number, slot?: string, at?: ScreenNodeAt) => AddTarget | null;
|
|
665
678
|
/**
|
|
666
679
|
* THE SLOTS OF A NODE, IN ORDER, AS THE SCREEN DRAWS THEM (0.105.0). A slot
|
|
667
680
|
* that is a `rung` is a row of its own in the Layers tree, with its children
|
|
@@ -1599,4 +1612,4 @@ declare function useScreenCanvasTarget(): CanvasTarget | null;
|
|
|
1599
1612
|
* engine's plain rows for the selection. */
|
|
1600
1613
|
declare function useScreenInspectorPanel(): ComponentType<ScreenInspectorPanelProps>;
|
|
1601
1614
|
|
|
1602
|
-
export { type NodeDefaults, SELECTION_MODE, type ScreenBlockLook, type ScreenBlockRules, type ScreenBridges, type ScreenCanvas, type ScreenCanvasDrag, type ScreenCanvasDragContext, type ScreenCanvasHeadProps, ScreenCanvasTargetProvider, type ScreenDevices, type ScreenDocumentOps, type ScreenDragItem, type ScreenInspector, type ScreenInspectorMode, type ScreenInspectorPanelProps, type ScreenLeftPanel, type ScreenLeftView, type ScreenLeftViewFrame, type ScreenLeftViewRules, type ScreenMainAction, type ScreenMediaDrop, type ScreenMediaFile, type ScreenMenuItem, type ScreenMenuRows, type ScreenNewNode, type ScreenNode, type ScreenNodeActions, type ScreenNodeLevel, type ScreenNodeMaker, type ScreenPartMode, type ScreenParts, ScreenPartsProvider, type ScreenPinnedBand, type ScreenPinnedNodes, type ScreenRailItem, type ScreenSelector, type ScreenSharedSections, type ScreenSlot, type ScreenSlotAction, type ScreenSlotMode, type ScreenStyleClipboard, type ScreenStyleDocument, type ScreenStylePastePlan, type ScreenToastExtra, type ScreenTree, type ScreenTreeFolds, type ScreenTreeRows, isPinnedFirst, isPinnedLast, isSelectionMode, isSlotMode, sameInspectorMode, screenSlotsOf, shownChildSlotsOf, shownSlotFieldsOf, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasDrag, useScreenCanvasFrame, useScreenCanvasHead, useScreenCanvasTarget, useScreenDevices, useScreenDocumentLabel, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenNodeKeys, useScreenNotify, useScreenOwnerName, useScreenParts, useScreenPickFollowsSelection, useScreenPinned, useScreenSaveSwitch, useScreenStorageNamespace, useScreenStyleClipboard, useStandaloneScreenBridges };
|
|
1615
|
+
export { type NodeDefaults, SELECTION_MODE, type ScreenBlockLook, type ScreenBlockRules, type ScreenBridges, type ScreenCanvas, type ScreenCanvasDrag, type ScreenCanvasDragContext, type ScreenCanvasHeadProps, ScreenCanvasTargetProvider, type ScreenDevices, type ScreenDocumentOps, type ScreenDragItem, type ScreenInspector, type ScreenInspectorMode, type ScreenInspectorPanelProps, type ScreenLeftPanel, type ScreenLeftView, type ScreenLeftViewFrame, type ScreenLeftViewRules, type ScreenMainAction, type ScreenMediaDrop, type ScreenMediaFile, type ScreenMenuItem, type ScreenMenuRows, type ScreenNewNode, type ScreenNode, type ScreenNodeActions, type ScreenNodeAt, type ScreenNodeLevel, type ScreenNodeMaker, type ScreenPartMode, type ScreenParts, ScreenPartsProvider, type ScreenPinnedBand, type ScreenPinnedNodes, type ScreenRailItem, type ScreenSelector, type ScreenSharedSections, type ScreenSlot, type ScreenSlotAction, type ScreenSlotMode, type ScreenStyleClipboard, type ScreenStyleDocument, type ScreenStylePastePlan, type ScreenToastExtra, type ScreenTree, type ScreenTreeFolds, type ScreenTreeRows, isPinnedFirst, isPinnedLast, isSelectionMode, isSlotMode, sameInspectorMode, screenSlotsOf, shownChildSlotsOf, shownSlotFieldsOf, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasDrag, useScreenCanvasFrame, useScreenCanvasHead, useScreenCanvasTarget, useScreenDevices, useScreenDocumentLabel, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenNodeKeys, useScreenNotify, useScreenOwnerName, useScreenParts, useScreenPickFollowsSelection, useScreenPinned, useScreenSaveSwitch, useScreenStorageNamespace, useScreenStyleClipboard, useStandaloneScreenBridges };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.2.0",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
package/dist/chunk-MRWVYSU5.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import{cloneNodeWithFreshIds as e}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as n}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as t}from"./chunk-DSKNJXB4.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-UMBNBCL4.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s}from"./chunk-DDH2DYQP.js";import{useEaselKeyTarget as d,useEaselUndoKeys as a,useEaselSaveKey as c,editorRootFocus as p}from"./chunk-75C6WFNF.js";import{SlotChildActionsProvider as u}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as h,DEFAULT_PANEL_W as f,clampPanelWidth as m}from"./chunk-Y53EKN35.js";import{usePartBridge as g}from"./chunk-7RSE6KKY.js";import{useSectionOps as y}from"./chunk-OITNWE52.js";import{ScreenSaveIcon as v,ScreenMainButton as b}from"./chunk-55KKGABA.js";import{useBrowserOffline as k}from"./chunk-RKTF5XLP.js";import{AddChildRow as S}from"./chunk-5545A3PC.js";import{AddSidePanel as w}from"./chunk-CMPFUJ26.js";import{keepsSharedSections as x,sharedSectionsOf as z}from"./chunk-N3MJOHAG.js";import{PanelHideButton as C,SidePanelHead as N,PanelShowStrip as O}from"./chunk-5PXVT7JY.js";import{offeredChoices as I}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as B,useScreenNodeKeys as P,useScreenPinned as $,useScreenDocumentLabel as T,useScreenCanvasFrame as M,useScreenInspectorPanel as j,useScreenDevices as A,useScreenPickFollowsSelection as L,useScreenLeftView as E,SELECTION_MODE as R,isSelectionMode as F,sameInspectorMode as D,useScreenBridges as W,useScreenBlockRules as H,useScreenBlockLook as V,useScreenStorageNamespace as Y,useScreenNotify as U,useScreenCanvasHead as J,isSlotMode as X,useScreenStyleClipboard as K,useScreenDocumentPass as Q,useScreenCanvasDrag as G,ScreenCanvasTargetProvider as _,isPinnedFirst as Z,isPinnedLast as q,screenSlotsOf as ee,shownChildSlotsOf as ne}from"./chunk-QORC32JO.js";import{MediaPopup as te}from"./chunk-T2RINM7R.js";import{useNodeClipboard as oe,useNodeContextMenu as re}from"./chunk-AAAZ2CQR.js";import{PageEditGuardNotices as ie}from"./chunk-FRAIEWRC.js";import{useScreenDocument as le}from"./chunk-K7MMLCTT.js";import{requestMediaPick as se}from"./chunk-3FIS2FRS.js";import{useMediaPanel as de,usePanelPick as ae,useMediaBrowsing as ce,useOpenMediaBrowse as pe,useMediaPlace as ue}from"./chunk-NCXYC7WI.js";import{useEaselSession as he}from"./chunk-YM4UEGBV.js";import{useEaselHost as fe,useHostEscape as me}from"./chunk-LX23TCTP.js";import{LayersIcon as ge,MediaIcon as ye}from"./chunk-XFYFKITX.js";import{heldStyle as ve,styleShortcut as be}from"./chunk-V7U33NF2.js";import{DEFAULT_SCREEN_WORDS as ke}from"./chunk-IYHO4XQX.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{rootRowName as we,slotChildRowName as xe,slotChildRenameProp as ze,sectionRenameProp as Ce}from"./chunk-5NHQ452C.js";import{ROOT_ZONE as Ne,blockNodeActions as Oe,TREE_MAX_DEPTH as Ie,childSlotsOf as Be,slotFieldsOf as Pe,newNodeId as $e,slotChildrenIn as Te,nestsInTree as Me}from"./chunk-TCAAOYQY.js";import{useEasel as je,useEaselApi as Ae,CanvasPartsContext as Le,partHasOwnBox as Ee,CanvasPassThroughContext as Re,CanvasSharedContext as Fe}from"./chunk-FJTCSQWK.js";import{TreeRow as De,Subtree as We,LayersTree as He,TreeGroupLabel as Ve,TreeRowAction as Ye,TreeSeam as Ue}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Je}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Xe}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ke,useNodeOps as Qe,clickPick as Ge}from"./chunk-RPMSET77.js";import{EaselTopBar as _e,EaselIconButton as Ze,TopBarCluster as qe,DeviceSwitch as en,InspectorIconButton as nn,PanelResizeHandle as tn,MAX_PANEL_W as on,MIN_PANEL_W_BY_SIDE as rn,panelWidthVars as ln}from"./chunk-WYTPBF3Q.js";import{DEFAULT_NOTICE_WORDS as sn,DEFAULT_CHROME_WORDS as dn}from"./chunk-AJSDWWJW.js";import{holderOf as an,nameOrSomeone as cn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as pn}from"./chunk-RE4LP46F.js";import{useWords as un}from"./chunk-MFIRYGHW.js";import{insertSeams as hn,CanvasDragLayer as fn,CanvasInsert as mn}from"./chunk-LN43DP2A.js";import{DEFAULT_DRAG_WORDS as gn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as yn,useTreeDrag as vn,gapToMoveIndex as bn}from"./chunk-6NJHYXJM.js";import{useCanvasFrame as kn,LIST_SELECTOR as Sn,BLOCK_SELECTOR as wn,useCanvasTyping as xn,useCanvasEvent as zn,nodeIdAt as Cn,frameRectToHost as Nn,BLOCK_ATTRIBUTE as On,drawnBox as In}from"./chunk-YU3WHLGI.js";import{queryMainCopy as Bn}from"./chunk-LF3FUSCQ.js";import{ROOT_ID as Pn,ROOT_SLOT as $n,zoneKey as Tn,parseZoneKey as Mn,find as jn,DataError as An}from"./chunk-TGZCD6IP.js";import{useRef as Ln,useMemo as En,useState as Rn,useEffect as Fn,useCallback as Dn,useLayoutEffect as Wn,useContext as Hn,Fragment as Vn,useId as Yn}from"react";import{ColoredBadge as Un,Button as Jn,Tabs as Xn,toast as Kn,readMediaFileDrag as Qn,Tooltip as Gn,groupColors as _n,Dialog as Zn,FormField as qn,Input as et,MEDIA_FILE_DRAG_TYPE as nt}from"efficient-shell/ui";import{UndoIcon as tt,RedoIcon as ot,RefreshIcon as rt,AddIcon as it,TrashIcon as lt,EyeOffIcon as st,EyeIcon as dt,SharedIcon as at,DuplicateIcon as ct}from"efficient-shell/icons/efficient";import{jsx as pt,jsxs as ut,Fragment as ht}from"react/jsx-runtime";var ft="media-file";function mt({name:e,onMake:n,onCancel:t}){const o=un("screen",ke).shared,[r,i]=Rn(e),[l,s]=Rn(!1),d=Yn(),a=Ln(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
-
return pt(Zn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */ut(ht,{children:[
|
|
3
|
-
/* @__PURE__ */pt(Jn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
-
/* @__PURE__ */pt(Jn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */pt("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */pt(qn,{label:o.name,htmlFor:d,children:/* @__PURE__ */pt(et,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var gt=/* @__PURE__ */new WeakSet;function yt(e,n,t){const o=jn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function vt({canvas:e,tabs:n,onSelect:t}){const o=Ln(null),[r,i]=Rn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Wn(()=>{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=Nn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=Bn(t,`[${On}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?In(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=Nn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),c=s.top+s.height;if(c<d.top||s.top>d.top+d.height){a[o.id]=null;continue}const p=o.below?c+4:Math.max(s.top,d.top)+6;a[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(a)},a=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",a,!0),r.addEventListener("resize",a);const c=new r.MutationObserver(a);return c.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a),c.disconnect()}},[e,l]),/* @__PURE__ */pt("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */pt("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
|
|
5
|
-
/* @__PURE__ */pt(Gn,{content:e.reach,children:/* @__PURE__ */ut(Un,{colorClass:_n("success","solid"),size:"sm",children:[
|
|
6
|
-
/* @__PURE__ */pt("span",{className:"es-band-tab-mark",children:/* @__PURE__ */pt(at,{size:12})}),e.label]})}):/* @__PURE__ */pt(Un,{colorClass:_n("info","solid"),size:"sm",children:e.label})},e.id):null})})}function bt({expand:e}){/* @__PURE__ */
|
|
7
|
-
return pt("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */ut(ht,e?{children:[
|
|
8
|
-
/* @__PURE__ */pt("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
-
/* @__PURE__ */pt("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
-
/* @__PURE__ */pt("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
-
/* @__PURE__ */pt("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
-
/* @__PURE__ */pt("path",{d:"M5 12h14"})]})})}var kt=`${Sn}, ${wn}`;function St(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 wt="__rungs";var xt="screen:band",zt={duplicate:!0,delete:!0},Ct=()=>null;function Nt(){const Sn=fe(),Nn=Sn.panels?.Toolbar,On=(Sn.panels?.useRight??Ct)(),{target:In,docId:Yn,capabilities:Gn,currentSlug:_n,siteId:Zn,onPublish:qn,saveState:et,saveConflict:at,retrySave:Nt,toggleAutoSave:Ot,flushSave:It,access:Bt,saveUnreachable:Pt=!1,readOnly:$t,readOnlyReason:Tt=null}=le(),Mt=B(),jt=P(),{mediaEditing:At,hasEditGuard:Lt,hasPinnedChrome:Et}=Gn,{appState:Rt,dispatch:Ft,history:Dt,selectedItem:Wt,getSelectorForId:Ht,config:Vt}=je(e=>e),Yt=$(),{first:Ut,firstGroup:Jt,lastGroup:Xt,isSectionGroup:Kt,sectionGroupZone:Qt,panelOf:Gt}=Yt,_t=Gt(Ut),Zt=e=>Z(Yt,e),qt=e=>q(Yt,e),eo="node"===Yt.firstRow,no=Yt.band??null,to=un("screen",ke),oo=un("tree",Je),ro=un("drag",gn),io=un("notice",sn),lo=un("lock",pn),so=un("menu",Xe),ao=un("styleClipboard",Se),co=un("chrome",dn),po=T()??`/${_n}`,uo=M(),ho=j(),fo=y({readOnly:$t}),mo=y({readOnly:$t,foldIntoHistory:!0}),go=Ln(null),yo=Ae(),vo=En(()=>({...fo,select:e=>{go.current=e,fo.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=yo.config;go.current=Ke(e,t,n)}fo.commitDocument(e,n)}}),[fo,yo]),bo=Rt.ui,ko=bo.leftSideBarVisible,So=bo.rightSideBarVisible,{options:wo,widths:xo,initial:zo,fluid:Co,fit:No}=A(),[Oo,Io]=Rn(zo),Bo=de(),Po=At&&null!==Bo;ae(),ce();const $o=pe();L(Wt?.props.id);const{read:To,write:Mo,forSelection:jo}=E(),[Ao,Lo]=Rn(To);Fn(()=>{Mo(Ao)},[Ao]);const[Eo,Ro]=Rn(0),Fo=Ln(null),Do=Ln(null),Wo=kn(Do,{readySelector:kt}),Ho=xn(Wo),Vo=d(Do);a(Do,Wo);const Yo=k(),Uo=an(Bt),Jo={state:et,offline:Yo||et.failed&&Pt,readOnlyReason:Tt,editing:Uo?io.editing({name:cn(Uo.name,lo),noun:to.noun}):null,conflict:null!=at,notSaving:to.bar.notSaving},Xo=()=>{$t||(et.failed?Nt():It())};c(Do,Wo,Xo);const[Ko,Qo]=Rn(!1),Go=Ln(!1),[_o,Zo]=Rn(null),[qo,er]=Rn([]),[nr,tr]=Rn(R);F(nr);const or=o(nr,Wt?.props.id),[rr,ir]=Rn(null);Fn(()=>{rr&&(r(),ir(null))},[rr]);const lr=Ln(Ht);lr.current=Ht;const sr=Dn((e,{scroll:n})=>{Lo(n=>jo(e,n)),n&&ir(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=lr.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Lr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),dr=Ln(null);Fn(()=>{const e=dr.current;dr.current=null;const n=null==Wt?.props.id?null:String(Wt.props.id);tr(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Gt(Wt?.type)??R);const t=Wt?.props.id,o=go.current;if(go.current=null,!t)return;const r=Ht(t);sr(String(t),{scroll:!i(o,r??null,Ne)})},[Wt?.props.id,sr]);const ar=Dn(e=>{tr(n=>D(n,e)?n:e),Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ft]),cr=Ln(()=>{});cr.current=(e,n)=>{const t=e?$i(e.zone??Ne)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Wt?.props.id?null:String(Wt.props.id);tr(e=>D(e,n)?e:n),o!==r&&(dr.current={id:o,mode:n},vo.select(e))};const pr=Dn((e,n)=>cr.current(e,n),[]),ur={kind:nr.kind,mode:nr,open:ar,show:e=>tr(e),reveal:()=>{So||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},select:pr},hr=W(ur,{data:Rt.data,selected:Wt??null,zoneOf:e=>Ht(e)?.zone,readOnly:Boolean($t),select:e=>{tr(R),vo.select({index:e})},replace:(e,n)=>vo.replaceComponent(Ne,e,n),scrollTo:e=>l(e)},{device:Oo,refreshes:Eo},{setView:Lo,reveal:()=>{ko||Ft({type:"setUi",ui:{leftSideBarVisible:!0}})}}),fr=hr.resolveLeftView?hr.resolveLeftView(Ao):"sections",mr=H(),{isLockedBlock:gr,duplicateBlocked:yr,nestDepth:vr,newSectionNode:br,canAddTo:kr,blockIsOffered:Sr}=mr,wr=V(),{labelAtLevel:xr,Icon:zr,useProducts:Cr}=wr,Nr=wr.rowName?(e,n,t)=>wr.rowName(e,n,t):void 0,Or=Dn(e=>{Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),sr(e,{scroll:!0})},[Ft,sr]),{selectNode:Ir,openPartId:Br}=g({mode:nr,setMode:tr,onOpenPart:Or}),[Pr,$r]=Rn(null);me(null!==Pr,()=>$r(null));const Tr=h(Y()),Mr=Tr.collapsed,jr=Tr.panelWidths,[Ar,Lr]=Rn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Mr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
-
return new Set}});Fn(()=>{try{window.localStorage.setItem(Mr,JSON.stringify([...Ar]))}catch{}},[Ar]);const[Er,Rr]=Rn(()=>{if("undefined"==typeof window)return{...f};try{const e=window.localStorage.getItem(jr);if(!e)return{...f};const n=JSON.parse(e);return{left:m(Number(n.left)||f.left,"left"),right:m(Number(n.right)||f.right,"right")}}catch{return{...f}}});Fn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(jr,JSON.stringify(Er))}catch{}},300);return()=>clearTimeout(e)},[Er]);const Fr=Dn((e,n)=>Rr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Dr=Dn(e=>Fr("left",e),[Fr]),Wr=Dn(e=>Fr("right",e),[Fr]),Hr=e=>Ar.has(e),Vr=e=>Lr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Yr=Ln(!1),Ur=Ln(null);Fn(()=>{if(Yr.current&&!Ko){const e=Ur.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Do.current?.querySelector(`button[aria-label="${CSS.escape(to.add.title)}"]`))?.focus(),Ur.current=null}Yr.current=Ko},[Ko]),Fn(()=>{if(!Ko||!Vo)return;const e=e=>{"Escape"===e.key&&al()};return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[Ko,Vo]),me(Ko,()=>al()),Fn(()=>{!ko&&Ko&&(Qo(!1),Zo(null),Go.current=!1)},[ko]);const Jr=U(),Xr=(e,n="success",t)=>{if(Jr)return void(t?Jr(e,"error"===n?"error":"info",t):Jr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Kn.error(e,{...o,duration:t?.duration??3200}):Kn.success(e,{...o,duration:t?.duration??1900})},Kr=Ln(null),[Qr,Gr]=Rn(0),[_r,Zr]=Rn(0),qr=J(),ei=Ln(null),ni=e=>Math.max(0,e.clientHeight-(ei.current?.offsetHeight??0));Fn(()=>{const e=Kr.current;if(!e)return;const n=()=>{Gr(e.clientWidth),Zr(ni(e))};n();const t=new ResizeObserver(n);return t.observe(e),ei.current&&t.observe(ei.current),()=>t.disconnect()},[]),Wn(()=>{Kr.current&&(Gr(Kr.current.clientWidth),Zr(ni(Kr.current)))},[Er,ko,So]);const ti=Oo===Co?Qr>0?Qr:xo[Co]:xo[Oo],oi=Qr>0?Math.min(Qr/ti,"shrink"===No?1:2):1,ri=ti*oi,ii=Qr>0&&ri>Qr+1,li={width:ri,height:_r||"100%",flex:"none",position:"relative"},si={width:ti,height:_r?_r/oi:"100%",maxHeight:"none",transform:1!==oi?`scale(${oi})`:void 0,transformOrigin:"top left"},di=()=>Ft({type:"setUi",ui:{leftSideBarVisible:!ko}}),ai=()=>Ft({type:"setUi",ui:{rightSideBarVisible:!So}}),ci=e=>{Ko&&(Qo(!1),Zo(null),Go.current=!1,ko&&Ao===e)||(Lo(e),ko||Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},pi=()=>{tr(_t??R),So||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},ui=Rt.data.content??[],hi=()=>{const e=ui.findIndex(Zt),n=ui.findIndex(qt);return{floor:e>=0?e+1:0,cap:n>=0?n:ui.length}},fi=Vt,mi=mr.stripCopy,gi=n=>e(n,mi),yi=oe(),vi=Qe({data:Rt.data,config:fi,readOnly:Boolean($t),clipboard:yi,strip:mi?e=>mi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Pn||e.slot!==$n)return{min:0,max:n-1};const{floor:t,cap:o}=hi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&tr(R);const t=void 0===n||"node"===n?.kind?n:null;vo.commitDocument(e,t)}}),bi=he(),[ki,Si]=Rn(null),wi=e=>{const n=ui.find(n=>String(n.props.id)===e),t=Yt.shared;n&&t&&vi.swap(e,t.detach(n))},xi=e=>{const n=jn(Rt.data,Vt,e);if(!n)return!1;const t=Tn(n.place),o=n.node,r=t===Ne?Ii(o):Hi(o),i=t===Ne?Yt.shared?.usedOn(o):null;return!!vi.remove(e)&&(Xr(i?to.shared.removed({count:Math.max(0,i.length-1)}):to.deleted({name:r}),"success",{duration:8e3,action:{label:to.bar.undo,onClick:()=>{vi.restore(n.node,n.place)}}}),!0)},zi={...vi,remove:xi},Ci=e=>xr(e,"block",Vt.components[e]?.label??e),Ni=Dn(e=>Vt.components[e]?.defaultProps??{},[Vt]),Oi=e=>xr(e,"section",Ci(e)),Ii=e=>we({type:e.type,props:e.props??{}},Oi(e.type),Nr),{nodeAddresses:Bi,zoneItems:Pi}=En(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=Ie)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Be(Vt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(ui,Ne,0),{nodeAddresses:e,zoneItems:n}},[ui,Vt]),$i=Dn(e=>Pi.get(e)??[],[Pi]),Ti=e=>{const n=Bi.get(e);return n?$i(n.zone)[n.index]:void 0},Mi=e=>ee(mr,Vt,e),ji=e=>{if(!mr.slotsOf||e===Ne)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Ti(e.slice(0,n));if(!t)return null;const o=Mi(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},Ai=(()=>{if(!X(nr))return null;const e=`${nr.nodeId}:${nr.slot}`;return ji(e)?.slot.panel===nr.kind?e:null})(),Li=Ln(null);Fn(()=>{const e=Li.current;if(Li.current=null,!Ai||!X(nr))return;const n=nr.nodeId;sr(n,{scroll:e!==Ai}),Lr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[nr]);const Ei=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Bi.get(e);n&&(n.zone===Ne?tl(n.index):Bl(n.zone,n.index,e,Ti(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Ai!==i&&(Li.current=i),pr(null,r),So||Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ri=(e,n,t)=>{const o=`${e}:${n}`;if(Lr(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;Ai!==o&&(Li.current=o);pr(null,{kind:t,nodeId:e,slot:n})},Fi=(e,n,t)=>{if($t||!mr.moveSlot)return;const o=Ti(e),r=o?Mi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:wt,index:n},s=bn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=mr.moveSlot(e,n,s);"string"==typeof d&&Ri(e,d,i.panel)},Di=Cr(),Wi=En(()=>{const e=/* @__PURE__ */new Map;for(const n of Di??[])e.set(n.slug,n.name);return e},[Di]),Hi=e=>xe(e,Ci,wr.plainText,e=>Wi.get(e),wr.rowName),Vi=(e,n)=>{const t=Vt.components[e.type]?.fields,o=n===Ne||ns(n)?"section":"block",r=n===Ne&&(Zt(e)||qt(e)||Kt(e.type)),i="block"===o?ze(t):r?null:Ce(t);return wr.renamePropOf?wr.renamePropOf(e,o,i):i},Yi=(e,n,t,o)=>{if(!(!$t&&Pr?.zone===e&&Pr.index===n))return;const r=(t,o)=>{$r(null),o&&((e,n,t)=>{const o=$i(e)[n];if(!o)return;const r=Vi(o,e);r&&vo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
-
return pt("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":to.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Ui=t(K(),ao),Ji=Ui.scope({target:In,siteId:Zn,docId:Yn}),Xi=Vt,Ki=(e,n)=>n===Ne?Oi(e):Ci(e),Qi=(e,n,t)=>{const o=Ui.plan(Ji,t,Ki(t.type,e),Xi);o&&(o.changed&&vo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Xr(o.message))},Gi=re({nodesIn:$i,nodeAt:(e,n)=>$i(e)[n]??null,labelOf:(e,n)=>n===Ne?Oi(e):Ci(e),renamePropOf:Vi,beginRename:(e,n)=>$r({zone:e,index:n}),history:{hasPast:Dt.hasPast,hasFuture:Dt.hasFuture,back:()=>Dt.back(),forward:()=>Dt.forward()},openPageStyles:hr.openPageStyles,pageStylesLabel:to.pageStyles,words:{menu:so,styleClipboard:ao,screen:to.menu},readOnly:Boolean($t),collapseAll:()=>Lr(new Set($i(Ne).map(e=>String(e.props.id)))),onPasteRefused:e=>Xr(e?to.pasteRefused({name:e.label}):to.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>rs(e,n),menuRows:(e,n,t)=>{const o=hr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Yt.shared;if(!t||n!==Ne)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:to.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return $t||gr(e.type,e)?n:{...n,change:[{label:to.shared.detach,onClick:()=>wi(e.props.id)}],remove:[{label:to.shared.removeFromPage,danger:!0,onClick:()=>{xi(e.props.id)}}]}}return $t||Zt(e)||qt(e)||Kt(e.type)?null:x(bi)?{change:[{label:to.shared.makeShared,onClick:()=>Si({id:e.props.id,name:Ii(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>gr(e.type,e),duplicateBlocked:e=>yr(Rt.data,e),permits:e=>{const n=Oe(Vt,e.type);return Yt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:zi,isPinned:(e,n)=>n===Ne&&(Zt(e)||qt(e)),sectionBand:hi,locate:e=>Bi.get(e)??null,rowNameOf:(e,n)=>n===Ne?Ii(e):Hi(e),selectAt:(e,n,t,o)=>{e===Ne?tl(n):Bl(e,n,t,o??"")},slotRung:e=>{const n=ji(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ei(n.node,n.slot,!1)}:null},style:{held:()=>ve(Ji),canCopy:e=>Ui.rows(Xi,e).some(e=>!1!==e.counted),copy:(e,n)=>Ui.copy(Ji,e,Ki(e.type,n),Xi),paste:(e,n,t)=>Qi(e,n,t)},keys:jt?{target:Vo,selected:()=>{const e=Rt.ui.itemSelector;return e?{zone:e.zone??Ne,index:e.index}:null},held:()=>yi.get(),readOnly:Boolean($t),onDone:({done:e,name:n})=>{"copied"===e&&Xr(to.copied({name:n}))}}:void 0},Wo),_i=Ln({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Fn(()=>{_i.current={copy:(e,n)=>Ui.copy(Ji,e,Ki(e.type,n),Xi),paste:Qi,at:()=>{const e=Rt.ui.itemSelector;if(!e)return null;const n=e.zone??Ne,t=$i(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean($t)}});const Zi=Dn(e=>{const n=be(e);if(!n)return;const t=_i.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))},[]);Fn(()=>{if(!Vo)return;const e=e=>Zi(e);return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[Zi,Vo]),zn(Wo,"keydown",Zi);const qi=ui.map(e=>e.props.id).join("|");Fn(()=>{const e=Wo?.document??null,n=Wo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void er(e=>e.length?[]:e);const n=ui.findIndex(qt),t=n>=0?n:ui.length,o=n=>{const t=ui[n]?.props?.id;return null==t?null:Bn(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(wn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=ui.length>0&&!Zt(ui[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=St(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})}er(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,qi,Oo,oi,ko,So,Wt?.props.id]);const el=Wo?.document??null,nl=Wo?.window??null;Fn(()=>{const e=Fo.current;if(!e||!el||!nl)return;const n=[],t=()=>{const n=Bn(el,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&nl.scrollTo({left:nl.scrollX,top:nl.scrollY+t,behavior:"instant"}),!0};return Fo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[el,nl]);const tl=e=>{tr(R),vo.select({index:e}),hr.sectionPressed?.(ui[e]);const n=ui[e]?.props?.id;n&&l(n)},ol=e=>{const{floor:n,cap:t}=hi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Wt&&nr.kind!==_t?.kind?ui.findIndex(e=>e.props.id===Wt.props.id):-1;return o(r>=0?r+1:t)},rl=(e,n)=>{const{floor:t,cap:o}=hi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(vo.reorderComponent(Ne,e,i),vo.select({index:i}),{moved:!0,dest:i})},il=(e,n,t,o)=>{tr(R),vo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Xr(to.sectionAdded({name:t}))},ll=(e,n)=>{const t=ol(n),o=br(e,{nodeDefaults:Ni,newNodeId:$e,sectionLabel:Oi,blockIsOffered:Sr}),r=o?vo.insertNode(Ne,t,o):vo.insertSection(e,t);return il(t,r,Oi(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:a}of Be(Vt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=kr(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:a,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},sl=e=>dl(Ne,e),dl=(e,n)=>{Ur.current=document.activeElement??null,Zo(null===n?null:{zone:e,index:n}),Qo(!0),ko||(Go.current=!0,Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},al=()=>{Qo(!1),Zo(null),Go.current&&Ft({type:"setUi",ui:{leftSideBarVisible:!1}}),Go.current=!1},cl=(e,n)=>wr.rowName?n?Zt(e)?wr.rowName(e,"section",to.header):qt(e)?wr.rowName(e,"section",to.footer):Kt(e.type)?wr.rowName(e,"section",Ci(e.type)):Ii(e):Hi(e):n?Oi(e.type):Ci(e.type),pl=e=>n=>{e()},ul=(e,n,t)=>{if($t)return null;const o=$i(e)[n];return o&&!Oe(Vt,o.type).delete||o&&gr(o.type,o)?null:/* @__PURE__ */pt(Ye,{kind:"delete",label:e===Ne&&o&&Yt.shared?.usedOn(o)?to.shared.removeFromPage:to.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=$i(e)[n]?.props?.id;null!=t&&xi(String(t))})(e,n),children:/* @__PURE__ */pt(lt,{size:15})})},hl=e=>wr.rowPreview?.(e)||void 0,fl=e=>wr.rowMarks?.(e)??void 0,ml=(e,n,t)=>wr.rowActions?.(e,n,t)??null,gl=(e,n,t,o)=>{if($t)return null;if(gr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
-
return pt(Ye,{kind:"eye",label:r?to.showNamed({name:o}):to.hideNamed({name:o}),onClick:()=>vl(e,n,t),children:/* @__PURE__ */pt(r?st:dt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},yl=e=>Qs(Ne,e),vl=(e,n,t)=>{vo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},bl=e=>Pe(Vt,e),kl=e=>Be(Vt,e),Sl=e=>mr.slotsOf?Mi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Te(e,n.slot)})):[{slot:null,rung:null,kids:ne(Vt,e)}],wl=e=>mr.slotsOf?Sl(e).flatMap(e=>e.kids):ne(Vt,e),xl=e=>Boolean(mr.slotsOf)&&Mi(e).some(e=>e.rung),zl=(e,n,t)=>null===t?void 0===n?kr(e):kr(e,n):kr(e,n,t),Cl=(e,n,t)=>{const o=Me(Vt,e.type,n)&&(t||wl(e).length>0||xl(e));return{collapsible:o,folded:o&&Hr(String(e.props.id))}},Nl=(e,n,t)=>Sl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Cl(e,r,t(e.type)).collapsible?[String(e.props.id),...Nl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ol=e=>wl(e).length>0||xl(e)||Boolean(kr(e.type)),Il=e=>Boolean(kr(e)),Bl=(e,n,t,o)=>{if(tr(R),kr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),vo.select({index:n,zone:e}),l(t)}else vo.select({index:n,zone:e}),l(t)},Pl=(e,n,t,o,r)=>{const i=`${e}:${n}`;vo.insertComponent(i,t,o),kr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),vo.select({index:o,zone:i})}):vo.select({index:o,zone:i})},$l=Ln(/* @__PURE__ */new Set);Fn(()=>{ui.forEach(e=>{const n=kr(e.type)?.spec;if(!n)return;const t=e.props.id;if($l.current.has(t))return;$l.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(Ni)).forEach((e,t)=>mo.seedChild(o,t,n.childType,e))})},[ui,mo,Ni]);const Tl=Ln(/* @__PURE__ */new Set);Fn(()=>{ui.forEach((e,t)=>{const o=e.props.id;if(Tl.current.has(o))return;const r=n(e,bl(e.type));Tl.current.add(o),r&&mo.replaceComponent(Ne,t,{...e,props:r})})},[ui,mo]),Q(mo,Vt);const Ml=ui.findIndex(qt),jl=Ml>=0?ui[Ml]:null,Al=eo?ui.findIndex(Zt):-1,Ll=Al>=0?ui[Al]:null,El=Yt.groupTab,Rl=En(()=>El?e=>Kt(e.type):void 0,[El]),Fl=Boolean(Yt.groupBadge),Dl=Yt.sharedReach,Wl=e=>Dl?.(e)??void 0,Hl=En(()=>Dl?new Set(ui.filter(e=>Wl(e)).map(e=>String(e.props.id))):null,[ui,Dl]),Vl=En(()=>Hl?e=>Hl.has(e):void 0,[Hl]),Yl=Yt.first?Dl?.({type:Yt.first,props:{id:""}})??void 0:void 0,Ul=Yt.groupBadge?/* @__PURE__ */pt("span",{className:"es-tree-group-badge",children:/* @__PURE__ */pt(Un,{tone:"info",size:"xs",children:Yt.groupBadge})}):void 0,Jl=ui.find(e=>e.type===Jt)??null,Xl=ui.find(e=>e.type===Xt)??null,Kl=Ml>=0?Ml:ui.length,Ql=[];ui.forEach(e=>{qt(e)||(Ol(e)&&Ql.push(String(e.props.id)),Ql.push(...Nl(e,1,Il)))}),jl&&(Ql.push(String(jl.props.id)),Ql.push(...Nl(jl,1,Il)));const Gl=Ql.length>0&&Ql.every(e=>Ar.has(e)),_l=e=>{const n=wr.blockRowName(e,Ci);return wr.rowName?wr.rowName(e,"block",n):n},Zl=(e,n,t,o)=>{const r=$i(e)[t];if(!r)return;const i={...Mn(e),index:t},l={...Mn(n),index:Math.min(Math.max(o,0),$i(n).length)},s=bn(i,l);if(e!==n||s!==t)try{vi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof An))throw e}},ql=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of kl(e))n.add(r),t(o)};for(const t of bl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},es=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Bi.get(n);if(!e)return null;if(e.zone===Ne)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ns=e=>{const n=e.slice(0,e.indexOf(":")),t=ui.find(e=>Kt(e.type)&&String(e.props.id)===n);return t&&Qt(n)===e?t:null},ts=(e,n)=>{const t=ns(e);return!t||(!Yt.groupAccepts||Yt.groupAccepts(t.type,n,$i(e).length))},os=(e,n,t)=>{if(e.rung){const t=Ti(e.rung.nodeId),o=t?Mi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===wt&&n.index>=0&&n.index<=o}if(n.slot===wt)return!1;if(e.add)return ss(e.add,n);const o=Tn(n);if(Kt(e.type))return!1;const r=ns(o),i=ns(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!ts(o,e.type))&&(n.index>=0&&n.index<=$i(o).length));if(e.zone===Ne||o===Ne){if(e.zone!==o)return!1;const{floor:t,cap:r}=hi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>$i(o).length)return!1;if(e.zone===o)return!0;const l=jl&&!Yt.lastIsOpen?String(jl.props.id):null;return(!l||es(e.zone)!==l&&es(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??$i(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Bi.get(i),s=l?$i(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&ql(r).has(n))return!1;const d=kr(s.type,vr(Rt?.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?.($i(n),r))})(e.zone,o,e.index,t)},rs=(e,n)=>{const t=Tn(e.from),o=e.node;return t===Tn(n)?ts(t,o.type):os({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},is=e=>{const n=e.slice(0,e.indexOf(":")),t=Bi.get(n),o=t?$i(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=kr(o.type,vr(Rt?.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=I(r.choices??(r.spec?[{type:r.spec.childType,label:Ci(r.spec.childType)}]:[])),l=ji(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:cl(o,t.zone===Ne)}},ls=(e,n)=>{if("section"!==e.kind)return e;const t=Tn(n);return t===Ne||ns(t)?e:is(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ss=(e,n)=>{const t=ls(e,n),o=Tn(n);if("shared"===t.kind){if(o!==Ne||!Yt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=hi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ns(o)){const e="section"===t.kind?t.type:t.template.node.type;return ts(o,e)&&n.index>=0&&n.index<=$i(o).length}if(o!==Ne)return!1;const{floor:e,cap:r}=hi();return n.index>=e&&n.index<=r}if(o===Ne)return!1;const r=is(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.($i(o))},ds=(e,n)=>{const t=ls(e,n);if("block"!==t.kind&&ns(Tn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&ts(n,o)){if("section"===e.kind)vo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;vo.insertNode(n,t,gi(e.template.node))}tr(R),vo.select({index:t,zone:n})}})(t,Tn(n),n.index);if("section"===t.kind)return void ll(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=ol(t),r=vo.insertNode(Ne,o,n);il(o,r,e)})(t.template.name,gi(t.template.node),n.index);if("shared"===t.kind){const e=Yt.shared?.nodeOf(t.section);if(!e)return;const o=ol(n.index);return void(vi.restore(e,{parentId:Pn,slot:$n,index:o})&&il(o,e.props.id,t.section.title))}const o=Tn(n),r=is(o);r&&(r.target.spec?Pl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{vo.insertComponent(e,n,t),tr(R),vo.select({index:t,zone:e})})(o,t.type,n.index))},as=(e,n)=>{e.media?function(e){const n=Ys();if(!n||!Ws)return;Js(n).then(n=>{n&&function(e,n){if(!Ws)return;const t=Ws.create(e,{nodeDefaults:Ni,newNodeId:$e,sectionLabel:Oi,blockIsOffered:Sr}),o=Tn(n);if(o===Ne){const e=ol(n.index),o=vo.insertNode(Ne,e,t);return void il(e,o,Oi(t.type))}vo.insertNode(o,n.index,t),tr(R),vo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Fi(e.rung.nodeId,e.index,n.index):e.add?ds(e.add,n):e.zone===Ne?rl(e.index,n.index):Zl(e.zone,Tn(n),e.index,n.index)},[cs]=Rn(()=>yn()),ps=vn({keyOf:e=>e.id,readOnly:Boolean($t),session:cs,canDrop:os,onDrop:as,onStep:(e,n)=>{e.rung?Fi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Ne?((e,n)=>{const t=Oi(ui[e]?.type??""),o=rl(e,n<0?e-1:e+2);if(!o.moved)return void Xr(n<0?to.sectionFirst({name:t}):to.sectionLast({name:t}));const{floor:r,cap:i}=hi();Xr(to.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Zl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),us=Dn(e=>{const{floor:n,cap:t}=hi(),o=[];for(const r of e.nodes){const e=Tn(r.place),i=$i(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Zt(i)||qt(i)||gr(i.type,i))continue;if(Kt(i.type))continue;const l=Boolean(ns(e)),s=e===Ne||l;e===Ne&&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?Oi(i.type):Hi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Tn(e.list);if(n===Ne&&0===e.children.length)return[{...e,addLabel:to.addSection,addAlways:!0}];const t=is(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ns(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Tn(e.list),t=n===Ne||ns(n)?null:is(n);return t?.choices.length?hn(e,t.target.spec?.addLabel??to.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Rt.data]),hs=null==Wt?.props.id?null:String(Wt.props.id),fs=Hn(Le),ms=fs?.selected()&&Wo?.document&&hs?fs.selectedPart?.(Wo.document)??null:null,gs=ms&&hs&&Ee(Rt.data,Vt,hs,ms)?ms:null,ys=gs?.label?{element:gs.element,label:gs.label}:null,vs=null!==gs,bs=Dn(e=>{const n=Vt,t=e=>!e.item.rung&&null!==jn(Rt.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(hs);return i?vs?null:i:r(Ge(Rt.data,n,o.item.id,hs,Rl))??o},[Rt.data,Vt,hs,Rl,vs]),[ks,Ss]=Rn(null),ws=Boolean(El||Dl);zn(Wo,"mouseover",e=>{if(!ws)return;const n=Cn(e.target),t=n?yt(Rt.data,Vt,n):null;t!==ks&&Ss(t)}),zn(Wo,"mouseout",e=>{ws&&!e.relatedTarget&&Ss(null)});const xs=e=>Zt(e)||qt(e)||Kt(e.type),zs=e=>{const n=Kt(e.type)?Ci(e.type):Zt(e)?to.header:qt(e)?to.footer:null;return null===n?Ii(e):wr.rowName?wr.rowName(e,"section",n):n},Cs=[];if(ws){const e=hs?yt(Rt.data,Vt,hs):null;for(const n of/* @__PURE__ */new Set([e,ks])){const e=n?ui.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Zt(e)||e.type===Jt,o=Wl(e);if(o){Cs.push({id:String(e.props.id),label:zs(e),below:t,reach:o});continue}if(!El||!xs(e))continue;const r=El(e);r&&Cs.push({id:String(e.props.id),label:r,below:t})}}const Ns=he(),Os=Ln(null);Fn(()=>{const e=Yt.changeNotice;if(!e)return;const n=JSON.stringify(ui.filter(xs)),t=Os.current;if(Os.current={doc:Yn,bands:n,index:Dt.index},!t||t.doc!==Yn||t.bands===n)return;Dt.hasPast&&Dt.index>=t.index&&!gt.has(Ns)&&(gt.add(Ns),Xr(e,"success",{action:{label:to.bar.undo,onClick:()=>Dt.back()},duration:8e3}))},[ui]);const Is=e=>{tr(R),vo.select(e.zone===Ne?{index:e.index}:{index:e.index,zone:e.zone})},Bs=G(),Ps=()=>({data:Rt.data,device:Oo,ops:vo,inspector:ur}),$s=Bs?.model,Ts=En(()=>$s?e=>$s(e,us(e),Ps()):us,[$s,us,Oo]),Ms=Bs?.measure,js=Ms?(e,n)=>Ms(e,n,Ps()):void 0,As=Bs?.canDrop,Ls=As?(e,n)=>As(e,n,os,Ps()):os,Es=Bs?.drop,Rs=Es?(e,n)=>Es(e,n,as,Ps()):as,Fs=Bs?.pick,Ds=Fs?e=>Fs(e,Is,Ps()):Is,Ws=Bs?.media??null,Hs=Ln(null),Vs=En(()=>Ws?{id:ft,zone:"",index:-1,type:Ws.adds.type,add:{kind:Ws.adds.kind,type:Ws.adds.type},media:!0}:null,[Ws]);Fn(()=>{if(!Vs||$t||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(nt))(e)&&(Hs.current=null,cs.start({key:ft,item:Vs}))},n=e=>{cs.get()?.item.media&&(Hs.current=Qn(e.dataTransfer))},t=()=>{cs.get()?.item.media&&cs.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[Vs,$t,cs]);const Ys=()=>{const e=Hs.current;return Hs.current=null,e},Us=ue(),Js=async e=>{if(!Us)return e;const n=await Us(e);return n?{...e,id:n.id,url:n.url}:null};const Xs=(e,n)=>{if(!Ws)return;const t=jn(yo.getState().appState.data,fi,n);if(!t)return;const o=t.node;vo.replaceComponent(Tn(t.place),t.place.index,{...o,props:{...Ws.replace(o,e),id:o.props.id}})},Ks=e=>{const n=Tn(e),t=ji(n);t&&Ei(t.node,t.slot,!1),dl(n,e.index)},Qs=(e,n)=>/* @__PURE__ */pt(Ue,{...$t?{}:ps.seam({place:{...Mn(e),index:n}})},`seam:${e}:${n}`),Gs={rowClick:pl,isCollapsed:Hr,toggleCollapse:Vr},_s=e=>{const n=String(e.props.id),t=ui.findIndex(e=>String(e.props.id)===n),o=Qt(n),r=$i(o),i=Hr(n),l=Ci(e.type),s=wr.rowName?wr.rowName(e,"section",l):l,d=e=>Qs(o,e);/* @__PURE__ */
|
|
16
|
-
return ut(ht,{children:[
|
|
17
|
-
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(zr,{type:e.type,size:13}),name:s,preview:hl(e),marks:fl(e),onSelect:()=>tl(t),nameSlot:Yi(Ne,t,n,s),selected:or===n,badge:Wl(e)?void 0:Ul,shared:Wl(e),actions:ml(e,Ne,t)??void 0,rowProps:{"data-node-id":n,onClick:pl(()=>tl(t))},fold:{open:!i,label:"section",onToggle:()=>Vr(n)}}),!i&&/* @__PURE__ */ut(We,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ii(n),l=Ol(n),s=l&&Hr(r),a=()=>Bl(o,t,r,e.type),{rowProps:c,...p}=ps.row({item:{id:r,zone:o,index:t,type:n.type},place:{...Mn(o),index:t}},{"data-node-id":r,onClick:pl(a)});/* @__PURE__ */
|
|
18
|
-
return ut(Vn,{children:[d(t),
|
|
19
|
-
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(zr,{type:n.type,size:13}),name:i,preview:hl(n),marks:fl(n),onSelect:a,nameSlot:Yi(o,t,r,i),selected:or===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Vr(r)}:void 0,actions:/* @__PURE__ */ut(ht,{children:[ul(o,t,i),ml(n,o,t),gl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */pt(We,{children:ed(n,2)})]},r)}),d(r.length)]})]})},Zs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ps.dragging,d=!Hr(l)&&s?.rung?.nodeId!==i,a={...Mn(l),index:0},c=s&&!s.rung&&os(s,a)?a:void 0,p=()=>Ei(e,n,!0),{rowProps:u,...h}=ps.row({item:{id:`rung:${l}`,zone:`${i}:${wt}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:wt,index:t},into:c,canDrag:Boolean(mr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:pl(p)}),f=$t?null:mr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
-
return ut(Vn,{children:[n.heading,
|
|
21
|
-
/* @__PURE__ */pt(De,{words:oo,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Ai===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Vr(l)},actions:f&&f.length>0?/* @__PURE__ */pt(ht,{children:f.map((t,o)=>/* @__PURE__ */pt(Ye,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if($t||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ri(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__ */pt(lt,{size:15}):/* @__PURE__ */pt(ct,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */pt(We,{children:r})]},l)},qs=(e,n)=>{const t=Sl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
-
return pt(ht,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=zl(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>Qs(e,n),p=/* @__PURE__ */ut(ht,{children:[i.map(({child:n,zone:t,index:o})=>{const r=or===String(n.props.id),{collapsible:i,folded:s}=Cl(n,l,Il(n.type)),d=String(n.props.id),a=_l(n),p=()=>Bl(t,o,d,e.type),{rowProps:u,...h}=ps.row({item:{id:d,zone:t,index:o,type:n.type},place:{...Mn(t),index:o}},{"data-node-id":d,onClick:pl(p)});/* @__PURE__ */
|
|
23
|
-
return ut(Vn,{children:[0===o&&c(t,0),
|
|
24
|
-
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(zr,{type:n.type,size:13}),name:a,preview:hl(n),marks:fl(n),onSelect:p,nameSlot:Yi(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Vr(d)}:void 0,actions:/* @__PURE__ */ut(ht,{children:[ul(t,o,a),ml(n,t,o),gl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */pt(We,{children:qs(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?Zs(e,t.rung,r++,o,p):/* @__PURE__ */pt(Vn,{children:p},t.slot??"")})})},ed=(e,n)=>{const t=vr(Rt?.data,e.type,String(e.props.id)),o=Sl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
-
return pt(ht,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=zl(e.type,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),h=a&&!a.fixed?`${u}:${a.slot}`:null,f=p?`${u}:${p.slot}`:null,m=(e,n)=>Qs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),v=/* @__PURE__ */ut(ht,{children:[l.map(({child:n,zone:t,index:o})=>{const r=or===String(n.props.id),i=Hi(n),l=String(n.props.id),{collapsible:d,folded:a}=Cl(n,s,Il(n.type)),c=bl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...Mn(p),index:$i(p).length}:void 0,h=ps.dragging,f=u&&h&&os(h,u)?u:void 0,g=()=>Bl(t,o,l,e.type),{rowProps:y,...v}=ps.row({item:{id:l,zone:t,index:o,type:n.type},place:{...Mn(t),index:o},into:f,canDrag:!gr(n.type,n)},{"data-node-id":l,onClick:pl(g)});/* @__PURE__ */
|
|
26
|
-
return ut(Vn,{children:[0===o&&m(t,0),
|
|
27
|
-
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(zr,{type:n.type,size:13}),name:i,preview:hl(n),marks:fl(n),onSelect:g,nameSlot:Yi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Vr(l)}:void 0,actions:gr(n.type,n)?ml(n,t,o)??void 0:/* @__PURE__ */ut(ht,{children:[ul(t,o,i),ml(n,t,o),gl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */pt(We,{children:ed(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
-
/* @__PURE__ */pt(S,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>Pl(e.props.id,a.slot,a.childType,c.length,e.type)}),null===g?f&&!l.some(e=>e.zone===f)?m(f,0):null:0!==l.length||(o.rung?y:g!==f)?null:m(g,0)]});return o.rung?Zs(e,o.rung,i++,r,v):/* @__PURE__ */pt(Vn,{children:v},o.slot??"")})})},nd=Ko,td=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:ko&&!nd&&fr===e.id,onSelect:()=>ci(e.id)}:e,od=[...(hr.railLead??[]).map(td),{id:"sections",label:to.layers,icon:/* @__PURE__ */pt(ge,{}),active:ko&&!nd&&"sections"===fr,onSelect:()=>ci("sections")},...(hr.railTrail??[]).map(td)],rd=Po?{onPress:$o}:At?{onPress:()=>{se(Sn,{accept:"image/*",title:co.mediaLibrary})}}:null,id={value:od.find(e=>!0===e.active)?.id??"",press:e=>{const n=od.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:od.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */pt("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},ld=[...hr.railLead??[],...hr.railTrail??[]].find(e=>"panel"in e&&e.id===fr),sd=Boolean(no?.foldable),dd=no?.label??(Lt?to.pageSections:to.templateSections),ad=sd&&Hr(xt),cd=/* @__PURE__ */ut(ht,{children:[ui.map((e,n)=>{if(Zt(e)||qt(e)||Kt(e.type))return null;const t=or===String(e.props.id),o=Boolean(e.props._hidden);kl(e);const r=String(e.props.id),i=hr.hasOwnRows?.(e)??!1,l=Ol(e)||i,s=l&&Hr(r),d=bl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...Mn(a),index:$i(a).length}:void 0,p=ps.dragging,u=c&&p&&os(p,c)?c:void 0,{rowProps:h,...f}=ps.row({item:{id:r,zone:Ne,index:n,type:e.type},place:{...Mn(Ne),index:n},into:u,canDrag:!gr(e.type,e)},{"data-node-id":r,onClick:pl(()=>tl(n))});/* @__PURE__ */
|
|
29
|
-
return ut(Vn,{children:[n>0&&yl(n),
|
|
30
|
-
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(zr,{type:e.type,size:13}),name:Ii(e),preview:hl(e),marks:fl(e),shared:Wl(e),onSelect:()=>tl(n),nameSlot:Yi(Ne,n,r,Ii(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Vr(r)}:void 0,actions:/* @__PURE__ */ut(ht,{children:[ul(Ne,n,Ii(e)),ml(e,Ne,n),gl(Ne,n,e,Ii(e))]}),rowProps:h}),Ol(e)&&!s&&/* @__PURE__ */ut(We,{children:[ed(e,1),hr.partRows?.(e,Gs)]}),i&&!s&&/* @__PURE__ */pt(We,{children:hr.ownRows?.(e,n,Gs)})]},String(e.props.id??n))}),Kl>0&&yl(Kl)]}),pd=(e,n,t)=>{const o=String(e.props.id),r=wl(e).length>0||xl(e)||Boolean(kr(e.type)),i=r&&Hr(o),l="header"===t?to.header:to.footer,s=wr.rowName?wr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
-
return ut(ht,{children:[
|
|
32
|
-
/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(zr,{type:t,size:13}),name:s,preview:hl(e),marks:fl(e),badge:Wl(e)?void 0:Ul,shared:Wl(e),onSelect:()=>tl(n),nameSlot:Yi(Ne,n,o,s),selected:or===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Vr(o)}:void 0,actions:ml(e,Ne,n)??void 0,rowProps:{"data-node-id":o,onClick:pl(()=>tl(n))}}),r&&!i&&/* @__PURE__ */pt(We,{children:qs(e,1)})]})};return(hr.wrap??(e=>e))(
|
|
33
|
-
/* @__PURE__ */pt(_,{target:Wo,children:/* @__PURE__ */ut("div",{ref:Do,className:"sf-editor es-editor",style:ln(Er),onContextMenu:Gi.onEditorContextMenu,...p(Sn),children:[
|
|
34
|
-
/* @__PURE__ */ut(_e,{children:[
|
|
35
|
-
/* @__PURE__ */ut("div",{className:"es-cluster es-cluster--left",children:[rd?/* @__PURE__ */pt(Jn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */pt(ye,{}),onClick:rd.onPress,children:to.railMedia}):null,
|
|
36
|
-
/* @__PURE__ */pt(Ze,{label:to.bar.undo,disabled:Boolean($t)||!Dt.hasPast,onClick:()=>Dt.back(),children:/* @__PURE__ */pt(tt,{})}),
|
|
37
|
-
/* @__PURE__ */pt(Ze,{label:to.bar.redo,disabled:Boolean($t)||!Dt.hasFuture,onClick:()=>Dt.forward(),children:/* @__PURE__ */pt(ot,{})})]}),
|
|
38
|
-
/* @__PURE__ */ut(qe,{children:[
|
|
39
|
-
/* @__PURE__ */pt(en,{devices:wo,value:Oo,onChange:Io}),
|
|
40
|
-
/* @__PURE__ */pt(Ze,{label:to.bar.refresh,tip:to.bar.refreshTip,onClick:()=>{Fo.current=(()=>{const e=Wo?.document;if(!e)return null;const n=ui.findIndex(qt),t=n>=0?n:ui.length;let o=null;for(let n=0;n<t;n++){const t=ui[n]?.props?.id;if(null==t)continue;const r=Bn(e,`[data-easel-block="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Wt?.props?.id??ui[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Ro(e=>e+1)},children:/* @__PURE__ */pt(rt,{})}),hr.barView?.()]}),
|
|
41
|
-
/* @__PURE__ */ut(qe,{kind:"right",style:{minWidth:300},children:[
|
|
42
|
-
/* @__PURE__ */pt(v,{input:Jo,words:to.saveStatus}),Nn?/* @__PURE__ */pt(Nn,{}):null,hr.barLead?.(),hr.barTrail?.(),hr.mainAction||!hr.barMain?/* @__PURE__ */pt(b,{input:Jo,action:hr.mainAction??{label:to.done,onPress:()=>{qn(Rt.data)}},readOnly:Boolean($t),saveSwitch:Mt,onToggleAutoSave:Ot,onSaveNow:Xo,bar:to.bar,words:to.saveStatus}):hr.barMain()]})]}),
|
|
43
|
-
/* @__PURE__ */pt(ie,{}),
|
|
44
|
-
/* @__PURE__ */ut("div",{className:"sf-body",children:[ko?/* @__PURE__ */ut(ht,{children:[
|
|
45
|
-
/* @__PURE__ */ut("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":to.leftPanel,children:[
|
|
46
|
-
/* @__PURE__ */ut("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
|
|
47
|
-
/* @__PURE__ */pt(C,{side:"left",onHide:di}),
|
|
48
|
-
/* @__PURE__ */pt("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
|
|
49
|
-
/* @__PURE__ */pt(Xn,{variant:"underline",block:!0,"aria-label":to.bar.views,value:id.value,onChange:id.press,items:id.items})]}),Ko?/* @__PURE__ */pt(w,{at:_o?{label:(e=>{const n=ns(e.zone);if(n)return to.add.addingTo({name:wr.rowName?cl(n,!0):Ci(n.type)});if(e.zone===Ne){const n=ui[e.index];return n&&!qt(n)?to.add.addingBefore({name:cl(n,!0)}):to.add.addingAtEnd}const t=is(e.zone);return t?to.add.addingTo({name:t.parentName}):to.add.addingHere})(_o),onClear:()=>Zo(null)}:void 0,placeBlocks:_o&&_o.zone!==Ne?is(_o.zone)?.choices:void 0,canTake:_o?e=>{if(!_o)return null;const n={...Mn(_o.zone),index:_o.index};if(ss(e,n))return null;if("shared"===e.kind&&_o.zone===Ne&&!Yt.shared?.nodeOf(e.section))return to.shared.alreadyHere;const t=ns(_o.zone);if(t)return to.add.notInside({name:cl(t,!0)});if(_o.zone===Ne)return to.add.onlySections;const o=is(_o.zone);return o?to.add.notInside({name:o.parentName}):to.add.onlySections}:void 0,onPick:_o?e=>{if(!_o)return;const n={...Mn(_o.zone),index:_o.index};ss(e,n)&&(ds(e,n),al())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:e.type,add:e}),session:cs,siteWide:hr.addPanelRow?.(al),onClose:al,readOnly:Boolean($t)}):ld?ld.panel({onHide:di,notify:Xr}):/* @__PURE__ */ut(ht,{children:[
|
|
50
|
-
/* @__PURE__ */pt(N,{icon:/* @__PURE__ */pt(ge,{}),title:to.layers,context:po,actions:/* @__PURE__ */ut(ht,{children:[!$t&&/* @__PURE__ */pt(nn,{label:to.add.title,onClick:()=>sl(null),children:/* @__PURE__ */pt(it,{size:15})}),
|
|
51
|
-
/* @__PURE__ */pt(nn,{label:Gl?to.expandAll:to.collapseAll,title:0===Ql.length?to.nothingToFold:void 0,disabled:0===Ql.length,onClick:()=>Lr(e=>{const n=new Set(Ql);return Gl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Ql])}),children:/* @__PURE__ */pt(bt,{expand:Gl})})]})}),
|
|
52
|
-
/* @__PURE__ */ut(He,{className:"sf-tree sf-scroll",words:oo,children:[Jl&&/* @__PURE__ */ut(ht,{children:[!Fl&&/* @__PURE__ */pt(Ve,{children:to.header}),_s(Jl)]}),Et&&!(Fl&&Jl)&&/* @__PURE__ */ut(ht,{children:[!Fl&&/* @__PURE__ */pt(Ve,{children:to.header}),!eo&&/* @__PURE__ */pt(De,{words:oo,icon:/* @__PURE__ */pt(zr,{type:"header",size:13}),name:to.header,badge:Yl?void 0:Ul,shared:Yl,onSelect:pi,selected:nr.kind===_t?.kind,rowProps:{onClick:pl(pi)}})]}),Ll&&!(Fl&&Jl)&&pd(Ll,Al,"header"),!sd&&/* @__PURE__ */pt(Ve,{children:dd}),sd?/* @__PURE__ */ut(ht,{children:[
|
|
53
|
-
/* @__PURE__ */pt(De,{words:oo,icon:null,name:dd,fold:{open:!ad,label:dd,onToggle:()=>Vr(xt)}}),!ad&&/* @__PURE__ */pt(We,{children:cd})]}):cd,Et&&!Fl&&/* @__PURE__ */pt(Ve,{children:to.footer}),jl&&!(Fl&&Xl)&&pd(jl,Ml,"footer"),Xl&&_s(Xl),hr.treeFoot?.()]})]})]}),
|
|
54
|
-
/* @__PURE__ */pt(tn,{side:"left",width:Er.left,min:rn.left,max:on,defaultWidth:f.left,label:to.resizeLeftPanel,onResize:Dr})]}):/* @__PURE__ */pt(O,{side:"left",onShow:di}),
|
|
55
|
-
/* @__PURE__ */ut("div",{ref:Kr,className:"sf-center sf-scroll","data-sf-canvas-head":qr?"":void 0,style:{overflowX:ii?"auto":"hidden",overflowY:"hidden"},children:[qr&&/* @__PURE__ */pt("div",{ref:ei,className:"sf-canvas-head",children:/* @__PURE__ */pt(qr,{device:Oo})}),
|
|
56
|
-
/* @__PURE__ */ut("div",{className:"sf-frame-scaler",style:li,children:[
|
|
57
|
-
/* @__PURE__ */pt("div",{className:"sf-frame "+(Oo===Co?"":`sf-frame--${Oo}`),style:si,children:/* @__PURE__ */ut("div",{className:"sf-preview-host",children:[
|
|
58
|
-
/* @__PURE__ */pt(Re.Provider,{value:Rl,children:/* @__PURE__ */pt(Fe.Provider,{value:Vl,children:/* @__PURE__ */pt(uo,{},Eo)})}),
|
|
59
|
-
/* @__PURE__ */pt(fn,{canvas:Wo,session:cs,model:Ts,measure:js,canDrop:Ls,onDrop:Rs,choose:bs,tag:ys,onPick:Ds,dropOn:Ws?{accepts:(e,n)=>{if(!e.media||!Ws||n.item.rung)return!1;const t=jn(Rt.data,fi,n.item.id);return null!==t&&Ws.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Ys();n&&Ws&&Js(n).then(n=>{n&&Xs(n,e.item.id)})})(n),label:()=>to.canvasReplaceImage}:void 0,onZoneAdd:Ks,onSeamAdd:Ks,zoneAddLabel:to.canvasAddBlock,words:ro.canvas,readOnly:Boolean($t),revision:Rt.data}),qo.length>0&&!Ho&&/* @__PURE__ */pt("div",{className:"sf-preview-gaps",children:qo.map(e=>
|
|
60
|
-
/* @__PURE__ */pt(mn,{index:e.index,label:to.addSectionHere,onInsert:()=>sl(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))})]})}),ws?/* @__PURE__ */pt(vt,{canvas:Wo,tabs:Cs,onSelect:e=>{const n=ui.findIndex(n=>String(n.props.id)===e);n>=0&&tl(n)}}):null]})]}),So?/* @__PURE__ */ut(ht,{children:[On?
|
|
61
|
-
/* @__PURE__ */pt("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:On}):/* @__PURE__ */pt(ht,{children:/* @__PURE__ */pt(u,{value:{selectChild:Bl,addChild:Pl,childRowName:Hi,blockRowName:_l},children:/* @__PURE__ */pt(ho,{mode:nr,onOpenWebsiteSettings:hr.openSettings??(()=>{}),onOpenSiteStyles:hr.openStyles,onOpenPageStyles:hr.openPageStyles,onSelectNode:Ir,onNotify:Xr,onHidePanel:ai,nodeActions:Wt?Oe(Vt,Wt.type):zt})})}),
|
|
62
|
-
/* @__PURE__ */pt(tn,{side:"right",width:Er.right,min:rn.right,max:on,defaultWidth:f.right,label:to.resizeSettingsPanel,onResize:Wr})]}):
|
|
63
|
-
/* @__PURE__ */pt(O,{side:"right",onShow:ai})]}),Gi.menu,
|
|
64
|
-
/* @__PURE__ */pt(te,{}),ki?/* @__PURE__ */pt(mt,{name:ki.name,onMake:e=>(async(e,n)=>{const t=ui.find(n=>String(n.props.id)===e),o=Yt.shared;if(!t||!o)return;let r;try{r=await z(bi).create(n,t)}catch{return void Xr(to.shared.makeFailed,"error")}o.adopt(t,r),Si(null)})(ki.id,e),onCancel:()=>Si(null)}):null]})}))}export{Nt as ScreenChrome};
|