efficient-easel 17.0.0 → 18.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/blocks/index.d.ts +2 -2
- package/dist/chunk-2ZWA6ARJ.js +8 -0
- package/dist/chunk-43AEUUNQ.js +1 -0
- package/dist/{chunk-OLRLHE5K.js → chunk-4QWTHRMD.js} +4 -4
- package/dist/{chunk-N3LYD2LK.js → chunk-5ZBV5RA6.js} +14 -14
- package/dist/chunk-A6Z4SD3I.js +10 -0
- package/dist/chunk-BHRC3ASL.js +1 -0
- package/dist/chunk-C2RHV42O.js +1 -0
- package/dist/{chunk-Z72CYM3L.js → chunk-DXROGLB5.js} +1 -1
- package/dist/{chunk-4UBYPRAS.js → chunk-HGV3FWOB.js} +1 -1
- package/dist/chunk-LLDHIBYG.js +18 -0
- package/dist/{chunk-EXCIHRAE.js → chunk-N5AN2RF2.js} +1 -1
- package/dist/{chunk-V63ERBLW.js → chunk-OBIL7BZO.js} +1 -1
- package/dist/{chunk-BU2YSTLJ.js → chunk-QEAUF632.js} +12 -12
- package/dist/chunk-QNAPTJRM.js +62 -0
- package/dist/{chunk-3ERZNZ5S.js → chunk-RFE7ZG3Y.js} +1 -1
- package/dist/{chunk-NFLO4I2N.js → chunk-SNB4LQMK.js} +1 -1
- package/dist/{chunk-MTNBJPXX.js → chunk-STWSCR25.js} +2 -2
- package/dist/{chunk-XLUVTPKK.js → chunk-VEZPDGDQ.js} +1 -1
- package/dist/chunk-W6SDWCOL.js +5 -0
- package/dist/chunk-X3TYRF5V.js +1 -0
- package/dist/chunk-X52NFKUS.js +1 -0
- package/dist/{chunk-FJL3MYPA.js → chunk-XHHVMAGM.js} +1 -1
- package/dist/{chunk-JSH3XKEF.js → chunk-YLQYEDUQ.js} +1 -1
- package/dist/drag/drag.css +8 -0
- package/dist/drag/index.d.ts +15 -1
- package/dist/drag/index.js +1 -1
- package/dist/draw/index.js +1 -1
- package/dist/easel/easel.css +8 -0
- package/dist/easel/index.d.ts +16 -6
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/{host-Cxbhp0zg.d.ts → host-epHo7r8P.d.ts} +12 -1
- package/dist/node-ops/index.d.ts +2 -2
- package/dist/node-ops/index.js +1 -1
- package/dist/{plan-2BLk7pWs.d.ts → plan-CZS902DV.d.ts} +9 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.d.ts +6 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.d.ts +4 -3
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +6 -5
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +5 -4
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +4 -3
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +5 -4
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +5 -4
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/usePartBridge.d.ts +5 -4
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +6 -5
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +3 -2
- package/dist/screen/lib/document-addressing.d.ts +4 -3
- package/dist/screen/lib/document-hooks.d.ts +2 -2
- package/dist/screen/lib/host.d.ts +4 -3
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +4 -3
- package/dist/screen/lib/media-picker.d.ts +7 -9
- package/dist/screen/lib/page-lock.d.ts +3 -2
- package/dist/screen/lib/puck/device-fields.js +1 -1
- package/dist/screen/lib/puck/palette-sections.d.ts +2 -2
- package/dist/screen/lib/puck/section-doc.d.ts +2 -2
- package/dist/screen/lib/puck/slot-child-name.js +1 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +5 -4
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.d.ts +2 -2
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +75 -7
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-templates.d.ts +3 -2
- package/dist/screen/lib/session-context.d.ts +3 -2
- package/dist/screen/lib/session.d.ts +6 -2
- package/dist/screen/lib/shared-section-types.d.ts +71 -0
- package/dist/screen/lib/shared-section-types.js +1 -0
- package/dist/screen/lib/shared-sections.d.ts +34 -0
- package/dist/screen/lib/shared-sections.js +1 -0
- package/dist/screen/screen.css +7 -0
- package/dist/screen/words.d.ts +49 -1
- package/dist/screen/words.js +1 -1
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +2 -2
- package/dist/tree/index.d.ts +3 -3
- package/dist/tree/index.js +1 -1
- package/dist/tree/tree.css +17 -0
- package/dist/{types-D8P9q-BG.d.ts → types-Bqq6ya0y.d.ts} +9 -0
- package/dist/{types-kR_4wYBw.d.ts → types-Cq53lL8d.d.ts} +1 -1
- package/dist/{useNodeOps-B0XZ8Bl8.d.ts → useNodeOps-fIDWzftn.d.ts} +3 -1
- package/package.json +15 -3
- package/dist/chunk-4JSBIW5H.js +0 -9
- package/dist/chunk-EL4F3IN7.js +0 -1
- package/dist/chunk-INIPQLPR.js +0 -1
- package/dist/chunk-MI54XTWD.js +0 -5
- package/dist/chunk-POSLNRTO.js +0 -18
- package/dist/chunk-SHS6WCLL.js +0 -1
- package/dist/chunk-SPQOPWCL.js +0 -5
- package/dist/chunk-TBF5CVPA.js +0 -1
- package/dist/chunk-WR3EVON3.js +0 -57
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-VEZPDGDQ.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s,scrollPreviewToTop as d}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as a,useEaselUndoKeys as c,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-YLQYEDUQ.js";import{SlotChildActionsProvider as h}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as m,clampPanelWidth as g}from"./chunk-U277UX5I.js";import{usePartBridge as y}from"./chunk-X52NFKUS.js";import{useSectionOps as k}from"./chunk-SNB4LQMK.js";import{ScreenSaveIcon as v,ScreenMainButton as S}from"./chunk-7TOQCTHV.js";import{useBrowserOffline as b}from"./chunk-RKTF5XLP.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-2ZWA6ARJ.js";import{keepsSharedSections as z,sharedSectionsOf as C}from"./chunk-43AEUUNQ.js";import{SidePanelHead as O,PanelShowStrip as B}from"./chunk-XDZHKYQX.js";import{offeredChoices as I}from"./chunk-M2Z775ZC.js";import{MediaSidePanel as N}from"./chunk-OBIL7BZO.js";import{useScreenSaveSwitch as P,useScreenNodeKeys as $,useScreenPinned as M,useScreenDocumentLabel as j,useScreenCanvasFrame as T,useScreenInspectorPanel as A,useScreenDevices as L,useScreenPickFollowsSelection as R,useScreenLeftView as E,SELECTION_MODE as V,sameInspectorMode as F,useScreenBridges as D,useScreenBlockRules as H,useScreenBlockLook as W,useScreenStorageNamespace as U,useScreenNotify as G,useScreenCanvasHead as X,isSlotMode as Y,useScreenStyleClipboard as J,useScreenDocumentPass as K,useScreenCanvasDrag as Q,ScreenCanvasTargetProvider as Z,isPinnedFirst as q,isPinnedLast as _,screenSlotsOf as ee}from"./chunk-W6SDWCOL.js";import{useNodeClipboard as ne,useNodeContextMenu as te}from"./chunk-RFE7ZG3Y.js";import{PageEditGuardNotices as oe}from"./chunk-HGV3FWOB.js";import{useScreenDocument as re}from"./chunk-STWSCR25.js";import{requestMediaPick as ie}from"./chunk-KG7RJWOK.js";import{useMediaPanel as le,usePanelPick as se,useCancelPanelPick as de}from"./chunk-R6WTQWAC.js";import{useEaselSession as ae}from"./chunk-O7Q4DDJT.js";import{useEaselHost as ce,useHostEscape as pe}from"./chunk-U3JP4VGF.js";import{LayersIcon as ue,MediaIcon as he}from"./chunk-4VJATVVR.js";import{DEFAULT_SCREEN_WORDS as fe}from"./chunk-C2RHV42O.js";import{heldStyle as me,styleShortcut as ge}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ye}from"./chunk-6WY6ZXJG.js";import{rootRowName as ke,slotChildRowName as ve,slotChildRenameProp as Se,sectionRenameProp as be}from"./chunk-BHRC3ASL.js";import{ROOT_ZONE as we,blockNodeActions as xe,TREE_MAX_DEPTH as ze,childSlotsOf as Ce,slotFieldsOf as Oe,slotChildrenIn as Be,nestsInTree as Ie,newNodeId as Ne}from"./chunk-PLVEGYK6.js";import{useEasel as Pe,useEaselApi as $e,CanvasPassThroughContext as Me,CanvasSharedContext as je}from"./chunk-QEAUF632.js";import{TreeRow as Te,Subtree as Ae,LayersTree as Le,TreeGroupLabel as Re,TreeRowAction as Ee,TreeSeam as Ve}from"./chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as Fe}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as De}from"./chunk-WK3AFPXY.js";import{toItemSelector as He,useNodeOps as We,clickPick as Ue}from"./chunk-X3TYRF5V.js";import{EaselTopBar as Ge,TopBarRail as Xe,TopBarCluster as Ye,EaselIconButton as Je,TopBarDivider as Ke,DeviceSwitch as Qe,InspectorIconButton as Ze,PanelResizeHandle as qe,MAX_PANEL_W as _e,MIN_PANEL_W as en,panelWidthVars as nn}from"./chunk-GWIVPLOX.js";import{DEFAULT_NOTICE_WORDS as tn,DEFAULT_CHROME_WORDS as on}from"./chunk-Z6PVRXVY.js";import{holderOf as rn,nameOrSomeone as ln}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as sn}from"./chunk-RE4LP46F.js";import{useWords as dn}from"./chunk-MFIRYGHW.js";import{insertSeams as an,CanvasDragLayer as cn,CanvasInsert as pn}from"./chunk-LLDHIBYG.js";import{DEFAULT_DRAG_WORDS as un}from"./chunk-KAML3KQH.js";import{createDragSession as hn,useTreeDrag as fn,gapToMoveIndex as mn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as gn,LIST_SELECTOR as yn,BLOCK_SELECTOR as kn,useCanvasTyping as vn,useCanvasEvent as Sn,nodeIdAt as bn,frameRectToHost as wn,BLOCK_ATTRIBUTE as xn,drawnBox as zn}from"./chunk-X4T6JT3M.js";import{ROOT_ID as Cn,ROOT_SLOT as On,zoneKey as Bn,parseZoneKey as In,find as Nn,DataError as Pn}from"./chunk-KRXQM65X.js";import{useRef as $n,useMemo as Mn,useState as jn,useEffect as Tn,useCallback as An,useLayoutEffect as Ln,Fragment as Rn,useId as En}from"react";import{ColoredBadge as Vn,toast as Fn,Tooltip as Dn,groupColors as Hn,Dialog as Wn,FormField as Un,Input as Gn,Button as Xn}from"efficient-shell/ui";import{UndoIcon as Yn,RedoIcon as Jn,RefreshIcon as Kn,AddIcon as Qn,TrashIcon as Zn,EyeOffIcon as qn,EyeIcon as _n,SharedIcon as et,DuplicateIcon as nt}from"efficient-shell/icons/efficient";import{jsx as tt,jsxs as ot,Fragment as rt}from"react/jsx-runtime";function it({name:e,onMake:n,onCancel:t}){const o=dn("screen",fe).shared,[r,i]=jn(e),[l,s]=jn(!1),d=En(),a=$n(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
|
|
2
|
+
return tt(Wn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */ot(rt,{children:[
|
|
3
|
+
/* @__PURE__ */tt(Xn,{variant:"secondary",onClick:t,children:o.cancel}),
|
|
4
|
+
/* @__PURE__ */tt(Xn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */tt("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */tt(Un,{label:o.name,htmlFor:d,children:/* @__PURE__ */tt(Gn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var lt=/* @__PURE__ */new WeakSet;function st(e,n,t){const o=Nn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function dt({canvas:e,tabs:n,onSelect:t}){const o=$n(null),[r,i]=jn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Ln(()=>{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=wn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=t.querySelector(`[${xn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?zn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=wn(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__ */tt("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */tt("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__ */tt(Dn,{content:e.reach,children:/* @__PURE__ */ot(Vn,{colorClass:Hn("success","solid"),size:"sm",children:[
|
|
6
|
+
/* @__PURE__ */tt("span",{className:"es-band-tab-mark",children:/* @__PURE__ */tt(et,{size:12})}),e.label]})}):/* @__PURE__ */tt(Vn,{colorClass:Hn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function at({expand:e}){/* @__PURE__ */
|
|
7
|
+
return tt("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */ot(rt,e?{children:[
|
|
8
|
+
/* @__PURE__ */tt("path",{d:"M8 9l4-4 4 4"}),
|
|
9
|
+
/* @__PURE__ */tt("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
10
|
+
/* @__PURE__ */tt("path",{d:"M8 4l4 4 4-4"}),
|
|
11
|
+
/* @__PURE__ */tt("path",{d:"M8 20l4-4 4 4"}),
|
|
12
|
+
/* @__PURE__ */tt("path",{d:"M5 12h14"})]})})}var ct=`${yn}, ${kn}`;function pt(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 ut="__rungs";var ht="screen:band",ft={duplicate:!0,delete:!0};function mt(){const yn=ce(),{target:wn,docId:xn,capabilities:zn,currentSlug:En,siteId:Dn,onPublish:Hn,saveState:Wn,saveConflict:Un,retrySave:Gn,toggleAutoSave:Xn,flushSave:et,access:mt,saveUnreachable:gt=!1,readOnly:yt,readOnlyReason:kt=null}=re(),vt=P(),St=$(),{mediaEditing:bt,hasEditGuard:wt,hasPinnedChrome:xt}=zn,{appState:zt,dispatch:Ct,history:Ot,selectedItem:Bt,getSelectorForId:It,config:Nt}=Pe(e=>e),Pt=M(),{first:$t,firstGroup:Mt,lastGroup:jt,isSectionGroup:Tt,sectionGroupZone:At,panelOf:Lt}=Pt,Rt=Lt($t),Et=e=>q(Pt,e),Vt=e=>_(Pt,e),Ft="node"===Pt.firstRow,Dt=Pt.band??null,Ht=dn("screen",fe),Wt=dn("tree",Fe),Ut=dn("drag",un),Gt=dn("notice",tn),Xt=dn("lock",sn),Yt=dn("menu",De),Jt=dn("styleClipboard",ye),Kt=dn("chrome",on),Qt=j()??`/${En}`,Zt=T(),qt=A(),_t=k({readOnly:yt}),eo=k({readOnly:yt,foldIntoHistory:!0}),no=$n(null),to=$e(),oo=Mn(()=>({..._t,select:e=>{no.current=e,_t.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=to.config;no.current=He(e,t,n)}_t.commitDocument(e,n)}}),[_t,to]),ro=zt.ui,io=ro.leftSideBarVisible,lo=ro.rightSideBarVisible,{options:so,widths:ao,initial:co,fluid:po,fit:uo}=L(),[ho,fo]=jn(co),mo=le(),go=bt&&null!==mo,yo=se(),ko=de();R(Bt?.props.id);const{read:vo,write:So,forSelection:bo}=E(),[wo,xo]=jn(vo);Tn(()=>{So(wo)},[wo]);const[zo,Co]=jn(0),Oo=$n(null),Bo=$n(null),Io=gn(Bo,{readySelector:ct}),No=vn(Io),Po=a(Bo);c(Bo,Io);const $o=b(),Mo=rn(mt),jo={state:Wn,offline:$o||Wn.failed&>,readOnlyReason:kt,editing:Mo?Gt.editing({name:ln(Mo.name,Xt),noun:Ht.noun}):null,conflict:null!=Un,notSaving:Ht.bar.notSaving},To=()=>{yt||(Wn.failed?Gn():et())};p(Bo,Io,To);const[Ao,Lo]=jn(!1),Ro=$n(!1),Eo=$n(!1),[Vo,Fo]=jn(null),[Do,Ho]=jn([]),[Wo,Uo]=jn(V),Go="puck"===Wo.kind,Xo=o(Wo,Bt?.props.id),[Yo,Jo]=jn(null);Tn(()=>{Yo&&(r(),Jo(null))},[Yo]);const Ko=$n(It);Ko.current=It;const Qo=An((e,{scroll:n})=>{xo(n=>bo(e,n)),n&&Jo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Ko.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Cr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Zo=$n(null);Tn(()=>{const e=Zo.current;Zo.current=null;const n=null==Bt?.props.id?null:String(Bt.props.id);Uo(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Lt(Bt?.type)??V);const t=Bt?.props.id,o=no.current;if(no.current=null,!t)return;const r=It(t);Qo(String(t),{scroll:!i(o,r??null,we)})},[Bt?.props.id,Qo]);const qo=An(e=>{Uo(n=>F(n,e)?n:e),Ct({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ct]),_o=$n(()=>{});_o.current=(e,n)=>{const t=e?wi(e.zone??we)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Bt?.props.id?null:String(Bt.props.id);Uo(e=>F(e,n)?e:n),o!==r&&(Zo.current={id:o,mode:n},oo.select(e))};const er=An((e,n)=>_o.current(e,n),[]),nr={kind:Wo.kind,mode:Wo,open:qo,show:e=>Uo(e),reveal:()=>{lo||Ct({type:"setUi",ui:{rightSideBarVisible:!0}})},select:er},tr=D(nr,{data:zt.data,selected:Bt??null,zoneOf:e=>It(e)?.zone,readOnly:Boolean(yt),select:e=>{Uo(V),oo.select({index:e})},replace:(e,n)=>oo.replaceComponent(we,e,n),scrollTo:e=>l(e)},{device:ho,refreshes:zo},{setView:xo,reveal:()=>{io||Ct({type:"setUi",ui:{leftSideBarVisible:!0}})}}),or=tr.resolveLeftView?tr.resolveLeftView(wo,go):"media"===wo&&go?wo:"sections",rr=H(),{isLockedBlock:ir,duplicateBlocked:lr,nestDepth:sr,newSectionNode:dr,canAddTo:ar,blockIsOffered:cr}=rr,pr=W(),{labelAtLevel:ur,Icon:hr,useProducts:fr}=pr,mr=pr.rowName?(e,n,t)=>pr.rowName(e,n,t):void 0,gr=An(e=>{Ct({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),Qo(e,{scroll:!0})},[Ct,Qo]),{selectNode:yr,openPartId:kr}=y({mode:Wo,setMode:Uo,onOpenPart:gr}),[vr,Sr]=jn(null);pe(null!==vr,()=>Sr(null));const br=f(U()),wr=br.collapsed,xr=br.panelWidths,[zr,Cr]=jn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(wr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
13
|
+
return new Set}});Tn(()=>{try{window.localStorage.setItem(wr,JSON.stringify([...zr]))}catch{}},[zr]);const[Or,Br]=jn(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem(xr);if(!e)return{...m};const n=JSON.parse(e);return{left:g(Number(n.left)||m.left),right:g(Number(n.right)||m.right)}}catch{return{...m}}});Tn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(xr,JSON.stringify(Or))}catch{}},300);return()=>clearTimeout(e)},[Or]);const Ir=An((e,n)=>Br(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Nr=An(e=>Ir("left",e),[Ir]),Pr=An(e=>Ir("right",e),[Ir]),$r=e=>zr.has(e),Mr=e=>Cr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),jr=$n(!1),Tr=$n(null);Tn(()=>{if(jr.current&&!Ao){const e=Tr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Bo.current?.querySelector(`button[aria-label="${CSS.escape(Ht.add.title)}"]`))?.focus(),Tr.current=null}jr.current=Ao},[Ao]),Tn(()=>{if(!Ao||!Po)return;const e=e=>{"Escape"===e.key&&el()};return Po.addEventListener("keydown",e),()=>Po.removeEventListener("keydown",e)},[Ao,Po]),pe(Ao,()=>el()),Tn(()=>{!io&&Ao&&(Lo(!1),Fo(null),Ro.current=!1)},[io]),Tn(()=>{if(!yo)return Eo.current&&Ct({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Eo.current=!1);Ao&&(Lo(!1),Fo(null),Eo.current=Ro.current,Ro.current=!1),io||(Eo.current=!0,Ct({type:"setUi",ui:{leftSideBarVisible:!0}}))},[yo]),Tn(()=>{!io&&yo&&(Eo.current=!1,ko())},[io]),Tn(()=>{if(!yo||!Po)return;const e=e=>{"Escape"===e.key&&ko()};return Po.addEventListener("keydown",e),()=>Po.removeEventListener("keydown",e)},[yo,Po]),pe(null!==yo,()=>ko());const Ar=G(),Lr=(e,n="success",t)=>{if(Ar)return void(t?Ar(e,"error"===n?"error":"info",t):Ar(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Fn.error(e,{...o,duration:t?.duration??3200}):Fn.success(e,{...o,duration:t?.duration??1900})},Rr=$n(null),[Er,Vr]=jn(0),[Fr,Dr]=jn(0),Hr=X(),Wr=$n(null),Ur=e=>Math.max(0,e.clientHeight-(Wr.current?.offsetHeight??0));Tn(()=>{const e=Rr.current;if(!e)return;const n=()=>{Vr(e.clientWidth),Dr(Ur(e))};n();const t=new ResizeObserver(n);return t.observe(e),Wr.current&&t.observe(Wr.current),()=>t.disconnect()},[]),Ln(()=>{Rr.current&&(Vr(Rr.current.clientWidth),Dr(Ur(Rr.current)))},[Or,io,lo]);const Gr=ho===po?Er>0?Er:ao[po]:ao[ho],Xr=Er>0?Math.min(Er/Gr,"shrink"===uo?1:2):1,Yr=Gr*Xr,Jr=Er>0&&Yr>Er+1,Kr={width:Yr,height:Fr||"100%",flex:"none",position:"relative"},Qr={width:Gr,height:Fr?Fr/Xr:"100%",maxHeight:"none",transform:1!==Xr?`scale(${Xr})`:void 0,transformOrigin:"top left"},Zr=()=>Ct({type:"setUi",ui:{leftSideBarVisible:!io}}),qr=()=>Ct({type:"setUi",ui:{rightSideBarVisible:!lo}}),_r=e=>{Ao&&(Lo(!1),Fo(null),Ro.current=!1,io&&wo===e)||yo&&(Eo.current=!1,ko(),io&&wo===e)||(io&&wo===e?Zr():(xo(e),io||Ct({type:"setUi",ui:{leftSideBarVisible:!0}})))},ei=()=>{ie(yn,{accept:"image/*",title:Kt.mediaLibrary})},ni=()=>{Uo(V),oo.select(null),d()},ti=()=>{Uo(Rt??V),lo||Ct({type:"setUi",ui:{rightSideBarVisible:!0}})},oi=zt.data.content??[],ri=()=>{const e=oi.findIndex(Et),n=oi.findIndex(Vt);return{floor:e>=0?e+1:0,cap:n>=0?n:oi.length}},ii=Nt,li=rr.stripCopy,si=n=>e(n,li),di=ne(),ai=We({data:zt.data,config:ii,readOnly:Boolean(yt),clipboard:di,strip:li?e=>li(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Cn||e.slot!==On)return{min:0,max:n-1};const{floor:t,cap:o}=ri();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Uo(V);const t=void 0===n||"node"===n?.kind?n:null;oo.commitDocument(e,t)}}),ci=ae(),[pi,ui]=jn(null),hi=e=>{const n=oi.find(n=>String(n.props.id)===e),t=Pt.shared;n&&t&&ai.swap(e,t.detach(n))},fi=e=>{const n=Nn(zt.data,Nt,e);if(!n)return!1;const t=Bn(n.place),o=n.node,r=t===we?vi(o):ji(o),i=t===we?Pt.shared?.usedOn(o):null;return!!ai.remove(e)&&(Lr(i?Ht.shared.removed({count:Math.max(0,i.length-1)}):Ht.deleted({name:r}),"success",{duration:8e3,action:{label:Ht.bar.undo,onClick:()=>{ai.restore(n.node,n.place)}}}),!0)},mi={...ai,remove:fi},gi=e=>ur(e,"block",Nt.components[e]?.label??e),yi=An(e=>Nt.components[e]?.defaultProps??{},[Nt]),ki=e=>ur(e,"section",gi(e)),vi=e=>ke({type:e.type,props:e.props??{}},ki(e.type),mr),{nodeAddresses:Si,zoneItems:bi}=Mn(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=ze)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Ce(Nt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(oi,we,0),{nodeAddresses:e,zoneItems:n}},[oi,Nt]),wi=An(e=>bi.get(e)??[],[bi]),xi=e=>{const n=Si.get(e);return n?wi(n.zone)[n.index]:void 0},zi=e=>ee(rr,Nt,e),Ci=e=>{if(!rr.slotsOf||e===we)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=xi(e.slice(0,n));if(!t)return null;const o=zi(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}},Oi=(()=>{if(!Y(Wo))return null;const e=`${Wo.nodeId}:${Wo.slot}`;return Ci(e)?.slot.panel===Wo.kind?e:null})(),Bi=$n(null);Tn(()=>{const e=Bi.current;if(Bi.current=null,!Oi||!Y(Wo))return;const n=Wo.nodeId;Qo(n,{scroll:e!==Oi}),Cr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Wo]);const Ii=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Si.get(e);n&&(n.zone===we?Yi(n.index):Sl(n.zone,n.index,e,xi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Oi!==i&&(Bi.current=i),er(null,r),lo||Ct({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ni=(e,n,t)=>{const o=`${e}:${n}`;if(Cr(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;Oi!==o&&(Bi.current=o);er(null,{kind:t,nodeId:e,slot:n})},Pi=(e,n,t)=>{if(yt||!rr.moveSlot)return;const o=xi(e),r=o?zi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:ut,index:n},s=mn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=rr.moveSlot(e,n,s);"string"==typeof d&&Ni(e,d,i.panel)},$i=fr(),Mi=Mn(()=>{const e=/* @__PURE__ */new Map;for(const n of $i??[])e.set(n.slug,n.name);return e},[$i]),ji=e=>ve(e,gi,pr.plainText,e=>Mi.get(e),pr.rowName),Ti=(e,n)=>{const t=Nt.components[e.type]?.fields,o=n===we||Xl(n)?"section":"block",r=n===we&&(Et(e)||Vt(e)||Tt(e.type)),i="block"===o?Se(t):r?null:be(t);return pr.renamePropOf?pr.renamePropOf(e,o,i):i},Ai=(e,n,t,o)=>{if(!(!yt&&vr?.zone===e&&vr.index===n))return;const r=(t,o)=>{Sr(null),o&&((e,n,t)=>{const o=wi(e)[n];if(!o)return;const r=Ti(o,e);r&&oo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
14
|
+
return tt("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Ht.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)},Li=t(J(),Jt),Ri=Li.scope({target:wn,siteId:Dn,docId:xn}),Ei=Nt,Vi=(e,n)=>n===we?ki(e):gi(e),Fi=(e,n,t)=>{const o=Li.plan(Ri,t,Vi(t.type,e),Ei);o&&(o.changed&&oo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Lr(o.message))},Di=te({nodesIn:wi,nodeAt:(e,n)=>wi(e)[n]??null,labelOf:(e,n)=>n===we?ki(e):gi(e),renamePropOf:Ti,beginRename:(e,n)=>Sr({zone:e,index:n}),history:{hasPast:Ot.hasPast,hasFuture:Ot.hasFuture,back:()=>Ot.back(),forward:()=>Ot.forward()},openPageSettings:()=>{oo.select(null),Uo(V)},pageSettingsLabel:Ht.pageSettings,words:{menu:Yt,styleClipboard:Jt,screen:Ht.menu},readOnly:Boolean(yt),collapseAll:()=>Cr(new Set(wi(we).map(e=>String(e.props.id)))),onPasteRefused:e=>Lr(e?Ht.pasteRefused({name:e.label}):Ht.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Kl(e,n),menuRows:(e,n,t)=>{const o=tr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Pt.shared;if(!t||n!==we)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:Ht.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return yt||ir(e.type,e)?n:{...n,change:[{label:Ht.shared.detach,onClick:()=>hi(e.props.id)}],remove:[{label:Ht.shared.removeFromPage,danger:!0,onClick:()=>{fi(e.props.id)}}]}}return yt||Et(e)||Vt(e)||Tt(e.type)?null:z(ci)?{change:[{label:Ht.shared.makeShared,onClick:()=>ui({id:e.props.id,name:vi(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=>ir(e.type,e),duplicateBlocked:e=>lr(zt.data,e),permits:e=>{const n=xe(Nt,e.type);return Pt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:mi,isPinned:(e,n)=>n===we&&(Et(e)||Vt(e)),sectionBand:ri,locate:e=>Si.get(e)??null,rowNameOf:(e,n)=>n===we?vi(e):ji(e),selectAt:(e,n,t,o)=>{e===we?Yi(n):Sl(e,n,t,o??"")},slotRung:e=>{const n=Ci(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ii(n.node,n.slot,!1)}:null},style:{held:()=>me(Ri),canCopy:e=>Li.rows(Ei,e).some(e=>!1!==e.counted),copy:(e,n)=>Li.copy(Ri,e,Vi(e.type,n),Ei),paste:(e,n,t)=>Fi(e,n,t)},keys:St?{target:Po,selected:()=>{const e=zt.ui.itemSelector;return e?{zone:e.zone??we,index:e.index}:null},held:()=>di.get(),readOnly:Boolean(yt),onDone:({done:e,name:n})=>{"copied"===e&&Lr(Ht.copied({name:n}))}}:void 0},Io),Hi=$n({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Tn(()=>{Hi.current={copy:(e,n)=>Li.copy(Ri,e,Vi(e.type,n),Ei),paste:Fi,at:()=>{const e=zt.ui.itemSelector;if(!e)return null;const n=e.zone??we,t=wi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(yt)}});const Wi=An(e=>{const n=ge(e);if(!n)return;const t=Hi.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);Tn(()=>{if(!Po)return;const e=e=>Wi(e);return Po.addEventListener("keydown",e),()=>Po.removeEventListener("keydown",e)},[Wi,Po]),Sn(Io,"keydown",Wi);const Ui=oi.map(e=>e.props.id).join("|");Tn(()=>{const e=Io?.document??null,n=Io?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Ho(e=>e.length?[]:e);const n=oi.findIndex(Vt),t=n>=0?n:oi.length,o=n=>{const t=oi[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(kn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=oi.length>0&&!Et(oi[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=pt(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})}Ho(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[Io,Ui,ho,Xr,io,lo,Bt?.props.id]);const Gi=Io?.document??null,Xi=Io?.window??null;Tn(()=>{const e=Oo.current;if(!e||!Gi||!Xi)return;const n=[],t=()=>{const n=Gi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Xi.scrollTo({left:Xi.scrollX,top:Xi.scrollY+t,behavior:"instant"}),!0};return Oo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Gi,Xi]);const Yi=e=>{Uo(V),oo.select({index:e}),tr.sectionPressed?.(oi[e]);const n=oi[e]?.props?.id;n&&l(n)},Ji=e=>{const{floor:n,cap:t}=ri(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Bt&&Wo.kind!==Rt?.kind?oi.findIndex(e=>e.props.id===Bt.props.id):-1;return o(r>=0?r+1:t)},Ki=(e,n)=>{const{floor:t,cap:o}=ri(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(oo.reorderComponent(we,e,i),oo.select({index:i}),{moved:!0,dest:i})},Qi=(e,n,t,o)=>{Uo(V),oo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Lr(Ht.sectionAdded({name:t}))},Zi=(e,n)=>{const t=Ji(n),o=dr(e,{nodeDefaults:yi,newNodeId:Ne,sectionLabel:ki,blockIsOffered:cr}),r=o?oo.insertNode(we,t,o):oo.insertSection(e,t);return Qi(t,r,ki(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 Ce(Nt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=ar(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},qi=e=>_i(we,e),_i=(e,n)=>{Tr.current=document.activeElement??null,yo&&(Ro.current=Eo.current,Eo.current=!1,ko()),Fo(null===n?null:{zone:e,index:n}),Lo(!0),io||(Ro.current=!0,Ct({type:"setUi",ui:{leftSideBarVisible:!0}}))},el=()=>{Lo(!1),Fo(null),Ro.current&&Ct({type:"setUi",ui:{leftSideBarVisible:!1}}),Ro.current=!1},nl=(e,n)=>pr.rowName?n?Et(e)?pr.rowName(e,"section",Ht.header):Vt(e)?pr.rowName(e,"section",Ht.footer):Tt(e.type)?pr.rowName(e,"section",gi(e.type)):vi(e):ji(e):n?ki(e.type):gi(e.type),tl=e=>n=>{e()},ol=(e,n,t)=>{if(yt)return null;const o=wi(e)[n];return o&&!xe(Nt,o.type).delete||o&&ir(o.type,o)?null:/* @__PURE__ */tt(Ee,{kind:"delete",label:e===we&&o&&Pt.shared?.usedOn(o)?Ht.shared.removeFromPage:Ht.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=wi(e)[n]?.props?.id;null!=t&&fi(String(t))})(e,n),children:/* @__PURE__ */tt(Zn,{size:15})})},rl=e=>pr.rowPreview?.(e)||void 0,il=e=>pr.rowMarks?.(e)??void 0,ll=(e,n,t)=>pr.rowActions?.(e,n,t)??null,sl=(e,n,t,o)=>{if(yt)return null;if(ir(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
15
|
+
return tt(Ee,{kind:"eye",label:r?Ht.showNamed({name:o}):Ht.hideNamed({name:o}),onClick:()=>al(e,n,t),children:/* @__PURE__ */tt(r?qn:_n,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},dl=e=>Is(we,e),al=(e,n,t)=>{oo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},cl=e=>Oe(Nt,e),pl=e=>Ce(Nt,e),ul=e=>rr.slotsOf?zi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Be(e,n.slot)})):[{slot:null,rung:null,kids:pl(e)}],hl=e=>rr.slotsOf?ul(e).flatMap(e=>e.kids):pl(e),fl=e=>Boolean(rr.slotsOf)&&zi(e).some(e=>e.rung),ml=(e,n,t)=>null===t?void 0===n?ar(e):ar(e,n):ar(e,n,t),gl=(e,n,t)=>{const o=Ie(Nt,e.type,n)&&(t||hl(e).length>0||fl(e));return{collapsible:o,folded:o&&$r(String(e.props.id))}},yl=(e,n,t)=>ul(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>gl(e,r,t(e.type)).collapsible?[String(e.props.id),...yl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),kl=e=>hl(e).length>0||fl(e)||Boolean(ar(e.type)),vl=e=>Boolean(ar(e)),Sl=(e,n,t,o)=>{if(Uo(V),ar(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),oo.select({index:n,zone:e}),l(t)}else oo.select({index:n,zone:e}),l(t)},bl=(e,n,t,o,r)=>{const i=`${e}:${n}`;oo.insertComponent(i,t,o),ar(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),oo.select({index:o,zone:i})}):oo.select({index:o,zone:i})},wl=$n(/* @__PURE__ */new Set);Tn(()=>{oi.forEach(e=>{const n=ar(e.type)?.spec;if(!n)return;const t=e.props.id;if(wl.current.has(t))return;wl.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(yi)).forEach((e,t)=>eo.seedChild(o,t,n.childType,e))})},[oi,eo,yi]);const xl=$n(/* @__PURE__ */new Set);Tn(()=>{oi.forEach((e,t)=>{const o=e.props.id;if(xl.current.has(o))return;const r=n(e,cl(e.type));xl.current.add(o),r&&eo.replaceComponent(we,t,{...e,props:r})})},[oi,eo]),K(eo,Nt);const zl=oi.findIndex(Vt),Cl=zl>=0?oi[zl]:null,Ol=Ft?oi.findIndex(Et):-1,Bl=Ol>=0?oi[Ol]:null,Il=Pt.groupTab,Nl=Mn(()=>Il?e=>Tt(e.type):void 0,[Il]),Pl=Boolean(Pt.groupBadge),$l=Pt.sharedReach,Ml=e=>$l?.(e)??void 0,jl=Mn(()=>$l?new Set(oi.filter(e=>Ml(e)).map(e=>String(e.props.id))):null,[oi,$l]),Tl=Mn(()=>jl?e=>jl.has(e):void 0,[jl]),Al=Pt.first?$l?.({type:Pt.first,props:{id:""}})??void 0:void 0,Ll=Pt.groupBadge?/* @__PURE__ */tt("span",{className:"es-tree-group-badge",children:/* @__PURE__ */tt(Vn,{tone:"info",size:"xs",children:Pt.groupBadge})}):void 0,Rl=oi.find(e=>e.type===Mt)??null,El=oi.find(e=>e.type===jt)??null,Vl=zl>=0?zl:oi.length,Fl=[];oi.forEach(e=>{Vt(e)||(kl(e)&&Fl.push(String(e.props.id)),Fl.push(...yl(e,1,vl)))}),Cl&&(Fl.push(String(Cl.props.id)),Fl.push(...yl(Cl,1,vl)));const Dl=Fl.length>0&&Fl.every(e=>zr.has(e)),Hl=e=>{const n=pr.blockRowName(e,gi);return pr.rowName?pr.rowName(e,"block",n):n},Wl=(e,n,t,o)=>{const r=wi(e)[t];if(!r)return;const i={...In(e),index:t},l={...In(n),index:Math.min(Math.max(o,0),wi(n).length)},s=mn(i,l);if(e!==n||s!==t)try{ai.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Pn))throw e}},Ul=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of pl(e))n.add(r),t(o)};for(const t of cl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Gl=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Si.get(n);if(!e)return null;if(e.zone===we)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Xl=e=>{const n=e.slice(0,e.indexOf(":")),t=oi.find(e=>Tt(e.type)&&String(e.props.id)===n);return t&&At(n)===e?t:null},Yl=(e,n)=>{const t=Xl(e);return!t||(!Pt.groupAccepts||Pt.groupAccepts(t.type,n,wi(e).length))},Jl=(e,n,t)=>{if(e.rung){const t=xi(e.rung.nodeId),o=t?zi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===ut&&n.index>=0&&n.index<=o}if(n.slot===ut)return!1;if(e.add)return ql(e.add,n);const o=Bn(n);if(Tt(e.type))return!1;const r=Xl(o),i=Xl(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!Yl(o,e.type))&&(n.index>=0&&n.index<=wi(o).length));if(e.zone===we||o===we){if(e.zone!==o)return!1;const{floor:t,cap:r}=ri();return n.index>=t&&n.index<=r}if(n.index<0||n.index>wi(o).length)return!1;if(e.zone===o)return!0;const l=Cl&&!Pt.lastIsOpen?String(Cl.props.id):null;return(!l||Gl(e.zone)!==l&&Gl(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??wi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Si.get(i),s=l?wi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Ul(r).has(n))return!1;const d=ar(s.type,sr(zt?.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?.(wi(n),r))})(e.zone,o,e.index,t)},Kl=(e,n)=>{const t=Bn(e.from),o=e.node;return t===Bn(n)?Yl(t,o.type):Jl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Ql=e=>{const n=e.slice(0,e.indexOf(":")),t=Si.get(n),o=t?wi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=ar(o.type,sr(zt?.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:gi(r.spec.childType)}]:[])),l=Ci(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:nl(o,t.zone===we)}},Zl=(e,n)=>{if("section"!==e.kind)return e;const t=Bn(n);return t===we||Xl(t)?e:Ql(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ql=(e,n)=>{const t=Zl(e,n),o=Bn(n);if("shared"===t.kind){if(o!==we||!Pt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=ri();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(Xl(o)){const e="section"===t.kind?t.type:t.template.node.type;return Yl(o,e)&&n.index>=0&&n.index<=wi(o).length}if(o!==we)return!1;const{floor:e,cap:r}=ri();return n.index>=e&&n.index<=r}if(o===we)return!1;const r=Ql(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(wi(o))},_l=(e,n)=>{const t=Zl(e,n);if("block"!==t.kind&&Xl(Bn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&Yl(n,o)){if("section"===e.kind)oo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;oo.insertNode(n,t,si(e.template.node))}Uo(V),oo.select({index:t,zone:n})}})(t,Bn(n),n.index);if("section"===t.kind)return void Zi(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=Ji(t),r=oo.insertNode(we,o,n);Qi(o,r,e)})(t.template.name,si(t.template.node),n.index);if("shared"===t.kind){const e=Pt.shared?.nodeOf(t.section);if(!e)return;const o=Ji(n.index);return void(ai.restore(e,{parentId:Cn,slot:On,index:o})&&Qi(o,e.props.id,t.section.title))}const o=Bn(n),r=Ql(o);r&&(r.target.spec?bl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{oo.insertComponent(e,n,t),Uo(V),oo.select({index:t,zone:e})})(o,t.type,n.index))},es=(e,n)=>{e.rung?Pi(e.rung.nodeId,e.index,n.index):e.add?_l(e.add,n):e.zone===we?Ki(e.index,n.index):Wl(e.zone,Bn(n),e.index,n.index)},[ns]=jn(()=>hn()),ts=fn({keyOf:e=>e.id,readOnly:Boolean(yt),session:ns,canDrop:Jl,onDrop:es,onStep:(e,n)=>{e.rung?Pi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===we?((e,n)=>{const t=ki(oi[e]?.type??""),o=Ki(e,n<0?e-1:e+2);if(!o.moved)return void Lr(n<0?Ht.sectionFirst({name:t}):Ht.sectionLast({name:t}));const{floor:r,cap:i}=ri();Lr(Ht.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Wl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),os=An(e=>{const{floor:n,cap:t}=ri(),o=[];for(const r of e.nodes){const e=Bn(r.place),i=wi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Et(i)||Vt(i)||ir(i.type,i))continue;if(Tt(i.type))continue;const l=Boolean(Xl(e)),s=e===we||l;e===we&&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?ki(i.type):ji(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Bn(e.list);if(n===we&&0===e.children.length)return[{...e,addLabel:Ht.addSection,addAlways:!0}];const t=Ql(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(Xl(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Bn(e.list),t=n===we||Xl(n)?null:Ql(n);return t?.choices.length?an(e,t.target.spec?.addLabel??Ht.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[zt.data]),rs=null==Bt?.props.id?null:String(Bt.props.id),is=An(e=>{const n=Nt,t=e=>!e.item.rung&&null!==Nn(zt.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(rs);return i||(r(Ue(zt.data,n,o.item.id,rs,Nl))??o)},[zt.data,Nt,rs,Nl]),[ls,ss]=jn(null),ds=Boolean(Il||$l);Sn(Io,"mouseover",e=>{if(!ds)return;const n=bn(e.target),t=n?st(zt.data,Nt,n):null;t!==ls&&ss(t)}),Sn(Io,"mouseout",e=>{ds&&!e.relatedTarget&&ss(null)});const as=e=>Et(e)||Vt(e)||Tt(e.type),cs=e=>{const n=Tt(e.type)?gi(e.type):Et(e)?Ht.header:Vt(e)?Ht.footer:null;return null===n?vi(e):pr.rowName?pr.rowName(e,"section",n):n},ps=[];if(ds){const e=rs?st(zt.data,Nt,rs):null;for(const n of/* @__PURE__ */new Set([e,ls])){const e=n?oi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Et(e)||e.type===Mt,o=Ml(e);if(o){ps.push({id:String(e.props.id),label:cs(e),below:t,reach:o});continue}if(!Il||!as(e))continue;const r=Il(e);r&&ps.push({id:String(e.props.id),label:r,below:t})}}const us=ae(),hs=$n(null);Tn(()=>{const e=Pt.changeNotice;if(!e)return;const n=JSON.stringify(oi.filter(as)),t=hs.current;if(hs.current={doc:xn,bands:n,index:Ot.index},!t||t.doc!==xn||t.bands===n)return;Ot.hasPast&&Ot.index>=t.index&&!lt.has(us)&&(lt.add(us),Lr(e,"success",{action:{label:Ht.bar.undo,onClick:()=>Ot.back()},duration:8e3}))},[oi]);const fs=e=>{Uo(V),oo.select(e.zone===we?{index:e.index}:{index:e.index,zone:e.zone})},ms=Q(),gs=()=>({data:zt.data,device:ho,ops:oo,inspector:nr}),ys=ms?.model,ks=Mn(()=>ys?e=>ys(e,os(e),gs()):os,[ys,os,ho]),vs=ms?.measure,Ss=vs?(e,n)=>vs(e,n,gs()):void 0,bs=ms?.canDrop,ws=bs?(e,n)=>bs(e,n,Jl,gs()):Jl,xs=ms?.drop,zs=xs?(e,n)=>xs(e,n,es,gs()):es,Cs=ms?.pick,Os=Cs?e=>Cs(e,fs,gs()):fs,Bs=e=>{const n=Bn(e),t=Ci(n);t&&Ii(t.node,t.slot,!1),_i(n,e.index)},Is=(e,n)=>/* @__PURE__ */tt(Ve,{...yt?{}:ts.seam({place:{...In(e),index:n}})},`seam:${e}:${n}`),Ns={rowClick:tl,isCollapsed:$r,toggleCollapse:Mr},Ps=e=>{const n=String(e.props.id),t=oi.findIndex(e=>String(e.props.id)===n),o=At(n),r=wi(o),i=$r(n),l=gi(e.type),s=pr.rowName?pr.rowName(e,"section",l):l,d=e=>Is(o,e);/* @__PURE__ */
|
|
16
|
+
return ot(rt,{children:[
|
|
17
|
+
/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:e.type,size:13}),name:s,preview:rl(e),marks:il(e),onSelect:()=>Yi(t),nameSlot:Ai(we,t,n,s),selected:Xo===n,badge:Ml(e)?void 0:Ll,shared:Ml(e),actions:ll(e,we,t)??void 0,rowProps:{"data-node-id":n,onClick:tl(()=>Yi(t))},fold:{open:!i,label:"section",onToggle:()=>Mr(n)}}),!i&&/* @__PURE__ */ot(Ae,{children:[r.map((n,t)=>{const r=String(n.props.id),i=vi(n),l=kl(n),s=l&&$r(r),a=()=>Sl(o,t,r,e.type),{rowProps:c,...p}=ts.row({item:{id:r,zone:o,index:t,type:n.type},place:{...In(o),index:t}},{"data-node-id":r,onClick:tl(a)});/* @__PURE__ */
|
|
18
|
+
return ot(Rn,{children:[d(t),
|
|
19
|
+
/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:a,nameSlot:Ai(o,t,r,i),selected:Xo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Mr(r)}:void 0,actions:/* @__PURE__ */ot(rt,{children:[ol(o,t,i),ll(n,o,t),sl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */tt(Ae,{children:js(n,2)})]},r)}),d(r.length)]})]})},$s=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ts.dragging,d=!$r(l)&&s?.rung?.nodeId!==i,a={...In(l),index:0},c=s&&!s.rung&&Jl(s,a)?a:void 0,p=()=>Ii(e,n,!0),{rowProps:u,...h}=ts.row({item:{id:`rung:${l}`,zone:`${i}:${ut}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:ut,index:t},into:c,canDrag:Boolean(rr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:tl(p)}),f=yt?null:rr.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
20
|
+
return ot(Rn,{children:[n.heading,
|
|
21
|
+
/* @__PURE__ */tt(Te,{words:Wt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Oi===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Mr(l)},actions:f&&f.length>0?/* @__PURE__ */tt(rt,{children:f.map((t,o)=>/* @__PURE__ */tt(Ee,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(yt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ni(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__ */tt(Zn,{size:15}):/* @__PURE__ */tt(nt,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */tt(Ae,{children:r})]},l)},Ms=(e,n)=>{const t=ul(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
22
|
+
return tt(rt,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=ml(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)=>Is(e,n),p=/* @__PURE__ */ot(rt,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Xo===String(n.props.id),{collapsible:i,folded:s}=gl(n,l,vl(n.type)),d=String(n.props.id),a=Hl(n),p=()=>Sl(t,o,d,e.type),{rowProps:u,...h}=ts.row({item:{id:d,zone:t,index:o,type:n.type},place:{...In(t),index:o}},{"data-node-id":d,onClick:tl(p)});/* @__PURE__ */
|
|
23
|
+
return ot(Rn,{children:[0===o&&c(t,0),
|
|
24
|
+
/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:n.type,size:13}),name:a,preview:rl(n),marks:il(n),onSelect:p,nameSlot:Ai(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Mr(d)}:void 0,actions:/* @__PURE__ */ot(rt,{children:[ol(t,o,a),ll(n,t,o),sl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */tt(Ae,{children:Ms(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?$s(e,t.rung,r++,o,p):/* @__PURE__ */tt(Rn,{children:p},t.slot??"")})})},js=(e,n)=>{const t=sr(zt?.data,e.type,String(e.props.id)),o=ul(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
25
|
+
return tt(rt,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=ml(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)=>Is(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),k=/* @__PURE__ */ot(rt,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Xo===String(n.props.id),i=ji(n),l=String(n.props.id),{collapsible:d,folded:a}=gl(n,s,vl(n.type)),c=cl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...In(p),index:wi(p).length}:void 0,h=ts.dragging,f=u&&h&&Jl(h,u)?u:void 0,g=()=>Sl(t,o,l,e.type),{rowProps:y,...k}=ts.row({item:{id:l,zone:t,index:o,type:n.type},place:{...In(t),index:o},into:f,canDrag:!ir(n.type,n)},{"data-node-id":l,onClick:tl(g)});/* @__PURE__ */
|
|
26
|
+
return ot(Rn,{children:[0===o&&m(t,0),
|
|
27
|
+
/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:g,nameSlot:Ai(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!a,label:"group",onToggle:()=>Mr(l)}:void 0,actions:ir(n.type,n)?ll(n,t,o)??void 0:/* @__PURE__ */ot(rt,{children:[ol(t,o,i),ll(n,t,o),sl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */tt(Ae,{children:js(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
|
|
28
|
+
/* @__PURE__ */tt(w,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>bl(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?$s(e,o.rung,i++,r,k):/* @__PURE__ */tt(Rn,{children:k},o.slot??"")})})},Ts=Ao||null!==yo,As=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:io&&!Ts&&or===e.id,onSelect:()=>_r(e.id)}:e,Ls=[...(tr.railLead??[]).map(As),{id:"sections",label:Ht.layers,icon:/* @__PURE__ */tt(ue,{}),active:io&&!Ts&&"sections"===or,onSelect:()=>_r("sections")},...(tr.railTrail??[]).map(As)];go?Ls.push({id:"media",label:Ht.railMedia,icon:/* @__PURE__ */tt(he,{}),active:io&&!Ao&&(null!==yo||"media"===or),onSelect:()=>_r("media")}):bt&&Ls.push({id:"media",label:Ht.railMedia,icon:/* @__PURE__ */tt(he,{}),onSelect:ei});const Rs=[...tr.railLead??[],...tr.railTrail??[]].find(e=>"panel"in e&&e.id===or),Es=Boolean(Dt?.foldable),Vs=Dt?.label??(wt?Ht.pageSections:Ht.templateSections),Fs=Es&&$r(ht),Ds=/* @__PURE__ */ot(rt,{children:[oi.map((e,n)=>{if(Et(e)||Vt(e)||Tt(e.type))return null;const t=Xo===String(e.props.id),o=Boolean(e.props._hidden);pl(e);const r=String(e.props.id),i=tr.hasOwnRows?.(e)??!1,l=kl(e)||i,s=l&&$r(r),d=cl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...In(a),index:wi(a).length}:void 0,p=ts.dragging,u=c&&p&&Jl(p,c)?c:void 0,{rowProps:h,...f}=ts.row({item:{id:r,zone:we,index:n,type:e.type},place:{...In(we),index:n},into:u,canDrag:!ir(e.type,e)},{"data-node-id":r,onClick:tl(()=>Yi(n))});/* @__PURE__ */
|
|
29
|
+
return ot(Rn,{children:[n>0&&dl(n),
|
|
30
|
+
/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:e.type,size:13}),name:vi(e),preview:rl(e),marks:il(e),shared:Ml(e),onSelect:()=>Yi(n),nameSlot:Ai(we,n,r,vi(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Mr(r)}:void 0,actions:/* @__PURE__ */ot(rt,{children:[ol(we,n,vi(e)),ll(e,we,n),sl(we,n,e,vi(e))]}),rowProps:h}),kl(e)&&!s&&/* @__PURE__ */ot(Ae,{children:[js(e,1),tr.partRows?.(e,Ns)]}),i&&!s&&/* @__PURE__ */tt(Ae,{children:tr.ownRows?.(e,n,Ns)})]},String(e.props.id??n))}),Vl>0&&dl(Vl)]}),Hs=(e,n,t)=>{const o=String(e.props.id),r=hl(e).length>0||fl(e)||Boolean(ar(e.type)),i=r&&$r(o),l="header"===t?Ht.header:Ht.footer,s=pr.rowName?pr.rowName(e,"section",l):l;/* @__PURE__ */
|
|
31
|
+
return ot(rt,{children:[
|
|
32
|
+
/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:t,size:13}),name:s,preview:rl(e),marks:il(e),badge:Ml(e)?void 0:Ll,shared:Ml(e),onSelect:()=>Yi(n),nameSlot:Ai(we,n,o,s),selected:Xo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Mr(o)}:void 0,actions:ll(e,we,n)??void 0,rowProps:{"data-node-id":o,onClick:tl(()=>Yi(n))}}),r&&!i&&/* @__PURE__ */tt(Ae,{children:Ms(e,1)})]})};return(tr.wrap??(e=>e))(
|
|
33
|
+
/* @__PURE__ */tt(Z,{target:Io,children:/* @__PURE__ */ot("div",{ref:Bo,className:"sf-editor es-editor",style:nn(Or),onContextMenu:Di.onEditorContextMenu,...u(yn),children:[
|
|
34
|
+
/* @__PURE__ */ot(Ge,{children:[
|
|
35
|
+
/* @__PURE__ */tt(Xe,{items:Ls,ariaLabel:Ht.bar.views}),
|
|
36
|
+
/* @__PURE__ */ot(Ye,{children:[
|
|
37
|
+
/* @__PURE__ */tt(Je,{label:Ht.bar.undo,disabled:Boolean(yt)||!Ot.hasPast,onClick:()=>Ot.back(),children:/* @__PURE__ */tt(Yn,{})}),
|
|
38
|
+
/* @__PURE__ */tt(Je,{label:Ht.bar.redo,disabled:Boolean(yt)||!Ot.hasFuture,onClick:()=>Ot.forward(),children:/* @__PURE__ */tt(Jn,{})}),
|
|
39
|
+
/* @__PURE__ */tt(Ke,{}),
|
|
40
|
+
/* @__PURE__ */tt(Qe,{devices:so,value:ho,onChange:fo}),
|
|
41
|
+
/* @__PURE__ */tt(Je,{label:Ht.bar.refresh,tip:Ht.bar.refreshTip,onClick:()=>{Oo.current=(()=>{const e=Io?.document;if(!e)return null;const n=oi.findIndex(Vt),t=n>=0?n:oi.length;let o=null;for(let n=0;n<t;n++){const t=oi[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Bt?.props?.id??oi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Co(e=>e+1)},children:/* @__PURE__ */tt(Kn,{})})]}),
|
|
42
|
+
/* @__PURE__ */ot(Ye,{kind:"right",style:{minWidth:300},children:[
|
|
43
|
+
/* @__PURE__ */tt(v,{input:jo,words:Ht.saveStatus}),tr.barLead?.(),tr.barTrail?.(),tr.mainAction||!tr.barMain?/* @__PURE__ */tt(S,{input:jo,action:tr.mainAction??{label:Ht.done,onPress:()=>{Hn(zt.data)}},readOnly:Boolean(yt),saveSwitch:vt,onToggleAutoSave:Xn,onSaveNow:To,bar:Ht.bar,words:Ht.saveStatus}):tr.barMain()]})]}),
|
|
44
|
+
/* @__PURE__ */tt(oe,{}),
|
|
45
|
+
/* @__PURE__ */ot("div",{className:"sf-body",children:[io?/* @__PURE__ */ot(rt,{children:[
|
|
46
|
+
/* @__PURE__ */tt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Ht.leftPanel,children:Ao?/* @__PURE__ */tt(x,{at:Vo?{label:(e=>{const n=Xl(e.zone);if(n)return Ht.add.addingTo({name:pr.rowName?nl(n,!0):gi(n.type)});if(e.zone===we){const n=oi[e.index];return n&&!Vt(n)?Ht.add.addingBefore({name:nl(n,!0)}):Ht.add.addingAtEnd}const t=Ql(e.zone);return t?Ht.add.addingTo({name:t.parentName}):Ht.add.addingHere})(Vo),onClear:()=>Fo(null)}:void 0,placeBlocks:Vo&&Vo.zone!==we?Ql(Vo.zone)?.choices:void 0,canTake:Vo?e=>{if(!Vo)return null;const n={...In(Vo.zone),index:Vo.index};if(ql(e,n))return null;if("shared"===e.kind&&Vo.zone===we&&!Pt.shared?.nodeOf(e.section))return Ht.shared.alreadyHere;const t=Xl(Vo.zone);if(t)return Ht.add.notInside({name:nl(t,!0)});if(Vo.zone===we)return Ht.add.onlySections;const o=Ql(Vo.zone);return o?Ht.add.notInside({name:o.parentName}):Ht.add.onlySections}:void 0,onPick:Vo?e=>{if(!Vo)return;const n={...In(Vo.zone),index:Vo.index};ql(e,n)&&(_l(e,n),el())}: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:ns,siteWide:tr.addPanelRow?.(el),onClose:el,onHide:Zr,readOnly:Boolean(yt)}):yo&&mo?
|
|
47
|
+
/* @__PURE__ */tt(N,{panel:mo,pick:yo,onHide:Zr}):Rs?Rs.panel({onHide:Zr,notify:Lr}):"media"===or&&mo?/* @__PURE__ */tt(N,{panel:mo,pick:null,onHide:Zr}):/* @__PURE__ */ot(rt,{children:[
|
|
48
|
+
/* @__PURE__ */tt(O,{icon:/* @__PURE__ */tt(ue,{}),title:Ht.layers,context:Qt,actions:/* @__PURE__ */ot(rt,{children:[!yt&&/* @__PURE__ */tt(Ze,{label:Ht.add.title,onClick:()=>qi(null),children:/* @__PURE__ */tt(Qn,{size:15})}),
|
|
49
|
+
/* @__PURE__ */tt(Ze,{label:Dl?Ht.expandAll:Ht.collapseAll,title:0===Fl.length?Ht.nothingToFold:void 0,disabled:0===Fl.length,onClick:()=>Cr(e=>{const n=new Set(Fl);return Dl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Fl])}),children:/* @__PURE__ */tt(at,{expand:Dl})})]}),onHide:Zr}),
|
|
50
|
+
/* @__PURE__ */ot(Le,{className:"sf-tree sf-scroll",words:Wt,children:[
|
|
51
|
+
/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:"page",size:13}),name:Ht.pageSettings,onSelect:ni,selected:!Bt&&Go,rowProps:{onClick:tl(ni)}}),Rl&&/* @__PURE__ */ot(rt,{children:[!Pl&&/* @__PURE__ */tt(Re,{children:Ht.header}),Ps(Rl)]}),xt&&!(Pl&&Rl)&&/* @__PURE__ */ot(rt,{children:[!Pl&&/* @__PURE__ */tt(Re,{children:Ht.header}),!Ft&&/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:"header",size:13}),name:Ht.header,badge:Al?void 0:Ll,shared:Al,onSelect:ti,selected:Wo.kind===Rt?.kind,rowProps:{onClick:tl(ti)}})]}),Bl&&!(Pl&&Rl)&&Hs(Bl,Ol,"header"),!Es&&/* @__PURE__ */tt(Re,{children:Vs}),Es?/* @__PURE__ */ot(rt,{children:[
|
|
52
|
+
/* @__PURE__ */tt(Te,{words:Wt,icon:null,name:Vs,fold:{open:!Fs,label:Vs,onToggle:()=>Mr(ht)}}),!Fs&&/* @__PURE__ */tt(Ae,{children:Ds})]}):Ds,xt&&!Pl&&/* @__PURE__ */tt(Re,{children:Ht.footer}),Cl&&!(Pl&&El)&&Hs(Cl,zl,"footer"),El&&Ps(El),tr.treeFoot?.()]})]})}),
|
|
53
|
+
/* @__PURE__ */tt(qe,{side:"left",width:Or.left,min:en,max:_e,defaultWidth:m.left,label:Ht.resizeLeftPanel,onResize:Nr})]}):/* @__PURE__ */tt(B,{side:"left",onShow:Zr}),
|
|
54
|
+
/* @__PURE__ */ot("div",{ref:Rr,className:"sf-center sf-scroll","data-sf-canvas-head":Hr?"":void 0,style:{overflowX:Jr?"auto":"hidden",overflowY:"hidden"},children:[Hr&&/* @__PURE__ */tt("div",{ref:Wr,className:"sf-canvas-head",children:/* @__PURE__ */tt(Hr,{device:ho})}),
|
|
55
|
+
/* @__PURE__ */ot("div",{className:"sf-frame-scaler",style:Kr,children:[
|
|
56
|
+
/* @__PURE__ */tt("div",{className:"sf-frame "+(ho===po?"":`sf-frame--${ho}`),style:Qr,children:/* @__PURE__ */ot("div",{className:"sf-preview-host",children:[
|
|
57
|
+
/* @__PURE__ */tt(Me.Provider,{value:Nl,children:/* @__PURE__ */tt(je.Provider,{value:Tl,children:/* @__PURE__ */tt(Zt,{},zo)})}),
|
|
58
|
+
/* @__PURE__ */tt(cn,{canvas:Io,session:ns,model:ks,measure:Ss,canDrop:ws,onDrop:zs,choose:is,onPick:Os,onZoneAdd:Bs,onSeamAdd:Bs,zoneAddLabel:Ht.canvasAddBlock,words:Ut.canvas,readOnly:Boolean(yt),revision:zt.data}),Do.length>0&&!No&&/* @__PURE__ */tt("div",{className:"sf-preview-gaps",children:Do.map(e=>
|
|
59
|
+
/* @__PURE__ */tt(pn,{index:e.index,label:Ht.addSectionHere,onInsert:()=>qi(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))})]})}),ds?/* @__PURE__ */tt(dt,{canvas:Io,tabs:ps,onSelect:e=>{const n=oi.findIndex(n=>String(n.props.id)===e);n>=0&&Yi(n)}}):null]})]}),lo?/* @__PURE__ */ot(rt,{children:[
|
|
60
|
+
/* @__PURE__ */tt(h,{value:{selectChild:Sl,addChild:bl,childRowName:ji,blockRowName:Hl},children:/* @__PURE__ */tt(qt,{mode:Wo,onOpenWebsiteSettings:tr.openSettings??(()=>{}),onOpenSiteStyles:tr.openStyles,onSelectNode:yr,onNotify:Lr,onHidePanel:qr,nodeActions:Bt?xe(Nt,Bt.type):ft})}),
|
|
61
|
+
/* @__PURE__ */tt(qe,{side:"right",width:Or.right,min:en,max:_e,defaultWidth:m.right,label:Ht.resizeSettingsPanel,onResize:Pr})]}):
|
|
62
|
+
/* @__PURE__ */tt(B,{side:"right",onShow:qr})]}),Di.menu,pi?/* @__PURE__ */tt(it,{name:pi.name,onMake:e=>(async(e,n)=>{const t=oi.find(n=>String(n.props.id)===e),o=Pt.shared;if(!t||!o)return;let r;try{r=await C(ci).create(n,t)}catch{return void Lr(Ht.shared.makeFailed,"error")}o.adopt(t,r),ui(null)})(pi.id,e),onCancel:()=>ui(null)}):null]})}))}export{mt as ScreenChrome};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEaselSession as e}from"./chunk-O7Q4DDJT.js";import{useHostEscape as n}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-
|
|
1
|
+
import{useEaselSession as e}from"./chunk-O7Q4DDJT.js";import{useHostEscape as n}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-C2RHV42O.js";import{styleMenuItems as o}from"./chunk-V7U33NF2.js";import{ROOT_ZONE as l}from"./chunk-PLVEGYK6.js";import{easelMenuEntries as r,menuLabel as i}from"./chunk-BALFHI3G.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{isTypingTarget as u,useCanvasEvent as d,framePointToHost as p}from"./chunk-X4T6JT3M.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as h}from"./chunk-KRXQM65X.js";import{useState as y,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,SettingsIcon as z,LayersIcon as O,CopyIcon as P}from"efficient-shell/icons/efficient";import{jsx as A}from"react/jsx-runtime";function D(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 K=c(),j=/* @__PURE__ */new WeakMap;function M(e){if(e.claimsPage)return K;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 S(){return M(e())}function T(e,n,t){if(n===l){const{floor:n,cap:o}=e.sectionBand();return{parentId:h,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 X(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 L(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?T(e,t.zone,t.index+1):null;for(const l of D(e,t)){const t=T(e,l.zone,l.index+1);if(o(n,t))return t}return null}function R(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 E(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=X(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:L(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function I(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),h=e.permits?.(i)??{duplicate:!0,delete:!0},y=X(e,i,t),k=D(e,n),b=d.held,v=b&&!p?L(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&&h.duplicate?()=>d.duplicate(c):void 0,moveUp:g&&d.canStep(c,-1)?()=>d.step(c,-1):void 0,moveDown:g&&d.canStep(c,1)?()=>d.step(c,1):void 0,copy:y.copy?()=>d.copy(c,a):void 0,cut:g&&y.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&&h.delete?()=>d.remove(c):void 0},style:w,extras:e.menuRows?.(i,t,r)??void 0,pinnedLine:p?V(e).pinned:void 0})}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=T(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,[{label:e.pageSettingsLabel??t.pageSettings,icon:/* @__PURE__ */A(z,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */A(O,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function U(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 Y(e){return e.shiftKey}function F(e,t){const[o,l]=y(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=R(e);if(!o)return;const l=t.selected();if(!l)return;const r=E(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(Y(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(Y(n)||!t)return;const o=n.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),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(N,{host:e,target:o,onClose:r}):null,closeMenu:r}}function N({host:e,target:n,onClose:t}){const o="node"===n.kind?I(e,n):"input"===n.kind?U(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{K as EASEL_NODE_CLIPBOARD,D as ancestorChain,M as nodeClipboardOf,X as nodeClipboardRules,I as nodeMenuItems,R as nodeShortcut,B as pageMenuItems,L as pastePlace,E as runNodeShortcut,U as textMenuItems,S as useNodeClipboard,F as useNodeContextMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-
|
|
1
|
+
import{useScreenBlockRules as e}from"./chunk-W6SDWCOL.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-QEAUF632.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{routeSharedHostMessage as e}from"./chunk-S4AWJX4Q.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-GMCZXMOV.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-HNKB2ZYR.js";import{isExpiredSession as s,readEaselFailure as i}from"./chunk-CLOS6SSX.js";import{useAdminBridge as l}from"./chunk-VPFNZ7TB.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-O7Q4DDJT.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-RSCMJIWS.js";import{useEaselHost as k}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as v}from"./chunk-
|
|
2
|
-
return T(
|
|
1
|
+
import{routeSharedHostMessage as e}from"./chunk-S4AWJX4Q.js";import{describeLoadFailure as r,hostLoadRefusal as n}from"./chunk-ERR437B5.js";import{editLockOf as t}from"./chunk-GMCZXMOV.js";import{NO_DOCUMENT_ADDRESSING as o}from"./chunk-RLBXE4EU.js";import{saveStatusOf as u,resetForDocumentSwitch as a}from"./chunk-HNKB2ZYR.js";import{isExpiredSession as s,readEaselFailure as i}from"./chunk-CLOS6SSX.js";import{useAdminBridge as l}from"./chunk-VPFNZ7TB.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-O7Q4DDJT.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-RSCMJIWS.js";import{useEaselHost as k}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as v}from"./chunk-C2RHV42O.js";import{useAutosave as g}from"./chunk-NDRZP6YR.js";import{canWriteDocument as p,newEaselClientId as h,reloadIfVersionMoved as y,openUnansweredClaim as w,FAIL_OPEN_RETRY_MS as S,CLAIM_FAIL_OPEN_MS as b,holderOf as P}from"./chunk-THWO5YVZ.js";import{useWords as I}from"./chunk-MFIRYGHW.js";import{createContext as j,useContext as R,useState as B,useMemo as C,useCallback as H,useEffect as O,useRef as E}from"react";import{jsx as T}from"react/jsx-runtime";var A={content:[],root:{},zones:{}};var D=j(null);function M(){const e=R(D);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function N({target:j,addressing:R=o,onHostMessage:M,children:N}){const V=R,{homeSlug:F,entryMayBounce:L,entryBounce:W,onSwitch:Y,tellsHost:Z,adapterFor:J,migrateRenamedProps:U,describeMissing:X,onLoadFailed:x}=V,[G,K]=B(j),Q=k(),z=d(),_=C(()=>f(z),[z]),q=C(()=>t(z),[z]),$="template"===G.kind,ee="template"===G.kind?G.id:null,re="template"===G.kind?G.pageSlug??F??"":"document"===G.kind?G.slug??"":G.slug,ne="page"===G.kind?G.siteId??null:null,te=z.blocks,oe=C(()=>J(G,_,te),[J,_,te,G.kind,"template"===G.kind?G.id:"document"===G.kind?G.record:G.siteId]),ue=oe.capabilities,ae=H(e=>z.documentHooks?.stored?.(e)??e,[z]);O(()=>{m(z,ne)},[z,ne]);const se=E(G);O(()=>{se.current=G},[G]);const{token:ie,tokenRef:le,capabilities:ce}=l({onMessage:r=>{if(M?.(r)||e(r))return;const n=r;if("storefront-editor:navigate"===n?.type){const e=r;e?.target&&Br(e.target)}}}),de=!z.usesBridgedToken||null!==ie,fe=oe.lock,me=Boolean(_.lock),[ke,ve]=B(null),[ge,pe]=B(null),[he,ye]=B(null),[we,Se]=B(null),be=I("screen",v),Pe=we?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(we,be):null,[Ie,je]=B(null),Re=E(null),Be=E(null),[Ce,He]=B(!1),Oe=E(null),[Ee,Te]=B(null),Ae=E(null),[De,Me]=B(null),[Ne,Ve]=B(!1),Fe=E(null);O(()=>{Fe.current=De},[De]);const[Le,We]=B(ue.hasEditLock?{kind:"checking"}:{kind:"editing"}),Ye=E(Le);O(()=>{Ye.current=Le},[Le]);const Ze=E(()=>Promise.resolve(!1)),Je=H(e=>{Be.current=e,He(!0)},[]),Ue=g({save:async({id:e,data:r})=>{if(p(Ye.current)){if(!await Ze.current(e,r)){if(!p(Ye.current))return void Je({id:e,data:r});throw new Error("page save did not land")}}else Je({id:e,data:r})},onFailure:(e,r)=>{0===r&&Q.send("storefront-editor:save-failed")}}),{state:Xe,push:xe,flush:Ge,pause:Ke,resume:Qe,stop:ze,reset:_e,retryNow:qe,hasPending:$e}=Ue,er=E(Xe);O(()=>{er.current=Xe},[Xe]);const rr=u(Xe),nr=H(()=>{const e=Be.current;e&&(Be.current=null,He(!1),xe(e))},[xe]),tr=E("");tr.current||(tr.current=h());const[or,ur]=B(0),ar=E(!1),[sr,ir]=B(L(j)),lr=E(!1);O(()=>{if(lr.current)return;lr.current=!0;const e=Q.address.search(),r=W(j,e);r?Q.address.load(r):L(j)&&ir(!1)},[j,Q]);const cr=Q.send;O(()=>{if(!de)return;let e=!1;const t=se.current,o=oe.resolve(re),u=z.documentHooks?.opening?.({slug:re,isTemplate:$,capabilities:ue});return o.then(async r=>{if(e)return;if(!r)return"page"===t.kind&&null!==F&&re!==F?void Q.address.load({kind:"page",slug:F,siteId:ne??void 0}):(Se({target:t,slug:re,missing:!0,sentence:X?.(t)??null}),void x?.(t,null));const n=r.readOnlyReason?r.readOnlyReason:null;Re.current=n,je(n),ve(r.id),pe(r.kind??null),Ae.current=r.version??null;const o=r.layout,a=o&&Object.keys(o).length?o:A,s=U(a),i=u?await u(s):s;e||ye(i)}).catch(o=>{e||(console.error("[storefront-editor] document load failed",o),Se({target:t,slug:re,missing:!1,sentence:n(o,{slug:re},z),cause:r(o,z)}),x?.(t,o))}),()=>{e=!0}},[de,ie,$,oe,re]);const dr=H(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=le.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),fr=H(async e=>{const r=le.current;if(!r&&z.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(s(n,z)){cr("storefront-editor:auth-expired");const n=r?await dr(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[cr,dr,z]),mr=H(async e=>{const r=le.current?await fr(e):{ok:!1};return r.ok||cr("storefront-editor:save-failed"),r.ok},[cr,fr]),kr=H(async(e,r,n=!1)=>{if(null!==Re.current)return!1;if(!p(Ye.current))return!1;if(Fe.current)return!1;const t=await fr(()=>oe.saveLayout(e,r,Ae.current,tr.current));if(t.ok)return Ae.current=t.value.version??Ae.current,Ve(!1),!0;const o=q.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Ye.current=e,We(e),!1}const u=q.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&oe.rereadVersion){const n=await fr(()=>oe.rereadVersion(e));if(n.ok&&n.value)return Ae.current=n.value,Ze.current(e,r,!0)}ze(),Fe.current=u,Me(u)}return Ve(i(t.error,z)?.status===c),!1},[oe,fr,ze,z]);O(()=>{Ze.current=kr},[kr]);const vr=H(e=>{if(null!==Re.current)return;if(cr("storefront-editor:dirty"),!ke)return;const r=ae(e);Oe.current=r,p(Ye.current)?xe({id:ke,data:r}):Je({id:ke,data:r})},[ke,cr,Je,xe,ae]),gr=H(async()=>{p(Ye.current)&&nr();return await Ge()&&null==Be.current},[nr,Ge]),pr=E(gr);O(()=>{pr.current=gr},[gr]);const hr=E(fr);O(()=>{hr.current=fr},[fr]);const yr=H(()=>{Q.address.reload()},[Q]),wr=E(()=>Promise.resolve(!1));O(()=>{wr.current=()=>{const e=oe.rereadVersion;return ke&&e?y({ours:Ae.current,stored:async()=>{const r=await hr.current(()=>e(ke));return r.ok?r.value:null},hasPending:()=>null!=Be.current||$e(),reload:yr}):Promise.resolve(!1)}},[oe,ke,$e,yr]);const Sr=null!==Ie;O(()=>{if(!fe||!ke||!de||Sr)return;let e=!1,r=null,n=null;const t=tr.current,o={claim:async e=>{const r=await hr.current(()=>fe.claim(ke,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Ye.current,heldWrite:()=>({pending:null!=Be.current||$e(),autoSaveEnabled:!er.current.paused,saveConflict:null!=Fe.current}),setAccess:e=>{Ye.current=e,We(e)},releaseHeldWrite:()=>{pr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{wr.current()}},u=q.makeClaimBeat(o),a=ar.current;return ar.current=!1,a||(We({kind:"checking"}),n=setTimeout(()=>{n=null,w(o)&&o.startHeartbeat(S)},b)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),fe.release(ke,t).catch(()=>{})}},[ke,fe,de,ie,or,Sr]);const br=H(()=>{fe&&ke&&(ar.current=!0,ur(e=>e+1))},[ke,fe]),Pr=H(()=>{We(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),Ir=H(()=>{er.current.paused?(p(Ye.current)&&nr(),Qe()):Ke()},[nr,Ke,Qe]),jr=H(()=>{qe()},[qe]),Rr=H(e=>{Oe.current=null,a("template"!==e.kind&&me,{resetAutosave:()=>{_e(),Be.current=null,He(!1)},setVersion:e=>{Ae.current=e},setSaveConflict:Me,setAccess:We}),Y(e),K(e),Re.current=null,je(null),ve(null),pe(null),ye(null),Se(null),Q.address.show(e),"document"!==e.kind&&Z(e)&&Q.send("storefront-editor:navigated",{target:e})},[_e,Q,me,Y,Z]),Br=H(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,se.current,F))return;const r=null!=Be.current;if(!r&&!$e())return void Rr(e);const n=er.current;r||n.paused||n.failed||n.stopped?Te(e):Ge().then(r=>{r?Rr(e):Te(e)})},[Rr,$e,Ge,F]),Cr=H(()=>Te(null),[]),Hr=H(()=>{Te(e=>(e&&Rr(e),null))},[Rr]),Or=H(async()=>{const e=Ee;if(!e)return;await gr()&&(Te(null),Rr(e))},[Ee,gr,Rr]),Er=H(async e=>{if(null!==Re.current)return;if(!ke)return;if(!p(Ye.current)||Fe.current)return;const r=ae(e);if(!await kr(ke,r))return void(Fe.current||cr("storefront-editor:save-failed"));const n=oe.publish;if(!ue.canPublish||!n)return void cr("storefront-editor:saved");const t=await fr(()=>n(ke,Ae.current??void 0));if(!t.ok){const{error:e}=t;return void cr("storefront-editor:publish-failed",{reason:e instanceof Error&&e.message?e.message:null})}Ae.current=t.value.version??Ae.current,cr("storefront-editor:published")},[ke,oe,ue.canPublish,cr,kr,fr,ae]);/* @__PURE__ */
|
|
2
|
+
return T(D.Provider,{value:{target:G,adapter:oe,capabilities:ue,templateId:ee,currentSlug:re,currentKind:ge,siteId:ne,ready:de,token:ie,tokenRef:le,notifyParent:cr,bridgeCapabilities:ce,runAuthed:mr,docId:ke,data:he,getLiveData:()=>Oe.current??he,error:Pe,redirecting:sr,saveStatus:rr,saveState:Xe,autoSaveEnabled:!Xe.paused,autoSaveStoppedByConflict:Xe.stopped,hasUnsavedEdits:Xe.pending||Ce,toggleAutoSave:Ir,retrySave:jr,onChange:vr,flushSave:gr,onPublish:Er,access:Le,readOnly:null!==P(Le)||null!==Ie||null!==De,readOnlyReason:Ie,takeOverEditing:br,viewReadOnly:Pr,saveConflict:De,saveUnreachable:Ne,reloadFromServer:yr,navigate:Br,pendingNav:Ee,cancelPendingNav:Cr,discardAndNavigate:Hr,saveAndNavigate:Or},children:N})}export{D as ScreenDocumentContext,N as ScreenDocumentProvider,M as useScreenDocument};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{panelFieldsOf as t}from"./chunk-LER7RKTO.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-
|
|
1
|
+
import{panelFieldsOf as t}from"./chunk-LER7RKTO.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-XHHVMAGM.js";import{DESIGN_GROUP_KEY as e,BUCKET_KEY as r}from"./chunk-MQNBD6AB.js";import{STYLE_KIND as s,fieldKind as c,copyStyle as i,heldStyle as p,planPaste as u,pasteMessage as a}from"./chunk-V7U33NF2.js";import{ANCHOR_FIELD_KEYS as f,foldMetaOf as l,MEDIA_FIELD_MARKER as m,TEXT_FIELD_MARKER as h,LINK_FIELD_MARKER as y}from"./chunk-DUVRZ456.js";var j=/* @__PURE__ */new Set([e.Size,e.Design,e.Layout,e.Position]),w=new Set(Object.values(e)),b=new Set(Object.values(r)),S=new Set(f),g=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[m,h,y];function v(t){return`site:${t??""}`}function A(t){if(!t||"object"!=typeof t)return null;const n=t,e=o(t)??t,r=n[s]??e[s];if("string"==typeof r)return r;const i=n.options??e.options;if(Array.isArray(i)){return`choice:${i.map(t=>String(t?.value)).sort().join("|")}`}return c(e)}function D(t){const n=t,e=o(t);return k.some(t=>t in n||e&&t in e)}function O(o,e){const s=t(o,e)??{},c=[];let i=!0,p=!1;for(const[t,o]of Object.entries(s))b.has(t)?(i=t===r.Design,p=!1):w.has(t)?i&&(p=j.has(t)):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(l(o)||S.has(t)||g.has(t)||D(o)||"slot"!==o.type&&c.push({path:[t],kind:A(o),counted:"mobile"!==n(o)?.tier}));return c}function d(t,o,n,e,r){i({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function L(t,o,n,e,r,s){const c=p(n);if(!c)return null;const i=u(c,{type:e.type,rows:t(o,e),props:e.props});return{...i,message:a(i,c.sourceLabel,r,s)}}function M(t,o,n,e){d(O,t,o,n,e)}function R(t,o,n,e,r){return L(O,t,o,n,e,r)}var V={scope:t=>v(t.siteId),rows:(t,o)=>O(t,o),copy:(t,o,n,e)=>M(e,t,o,n),plan:(t,o,n,e)=>R(e,t,o,n)};function B(t,o){if(!t&&!o)return V;const n=t?.rows,e=n?(t,o)=>n(t,o):O;return{scope:t?.scope??V.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>d(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>L(e,s,t,n,r,o))}}export{M as copyNodeStyle,O as nodeStyleRows,R as planNodePaste,A as shopFieldKind,v as siteStyleScope,B as styleClipboardOf};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{usePickFollowsSelection as n}from"./chunk-R6WTQWAC.js";import{slotFieldsOf as e}from"./chunk-PLVEGYK6.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-QEAUF632.js";import{Inspector as i}from"./chunk-5ZBV5RA6.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(n,t,r){const i=n.slotsOf?.(r);return i||e(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h=()=>k,v=()=>"",g=()=>null,y=()=>{},b={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},O={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},j={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},w={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},L={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
|
|
2
|
+
return s(t,{height:"fill"})}function C(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
|
|
3
|
+
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var P=o({});function A({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
+
return s(P.Provider,{value:n,children:e})}function B(){return u(P)}function D(){return(B().useOwnerName??v)()}function G(){return(B().useDocumentLabel??g)()}function N(n,e,t,r){return(B().useBridges??h)(n,e,t,r)}function x(n){return(B().useStandaloneBridges??h)(n)}function F(n,e){(B().useDocumentPass??y)(n,e)}function I(){return B().blockRules??b}function R(){return B().blockLook??O}function T(){return B().devices??j}function V(){return B().leftView??w}function E(){return B().pinned??L}function K(){return B().saveSwitch??!0}function Q(e){n(!0===B().pickFollowsSelection,e)}function W(){return B().storageNamespace||void 0}function Z(){return B().styleClipboard??null}function H(){return B().nodeKeys??!0}function U(){return B().notify??null}function Y(){return B().Canvas??S}function q(){return B().CanvasHead??null}function z(){return B().canvasDrag??null}var J=o(null);function M({target:n,children:e}){/* @__PURE__ */
|
|
5
|
+
return s(J.Provider,{value:n,children:e})}function X(){return u(J)}function $(){return B().Inspector??C}export{c as SELECTION_MODE,M as ScreenCanvasTargetProvider,A as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,R as useScreenBlockLook,I as useScreenBlockRules,N as useScreenBridges,z as useScreenCanvasDrag,Y as useScreenCanvasFrame,q as useScreenCanvasHead,X as useScreenCanvasTarget,T as useScreenDevices,G as useScreenDocumentLabel,F as useScreenDocumentPass,$ as useScreenInspectorPanel,V as useScreenLeftView,H as useScreenNodeKeys,U as useScreenNotify,D as useScreenOwnerName,B as useScreenParts,Q as useScreenPickFollowsSelection,E as useScreenPinned,K as useScreenSaveSwitch,W as useScreenStorageNamespace,Z as useScreenStyleClipboard,x as useStandaloneScreenBridges};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{find as n,remove as t,getList as e,newId as r,duplicate as o,move as l,copyNode as a,insert as c,setProps as i,slotsOf as d}from"./chunk-KRXQM65X.js";import{useRef as s,useSyncExternalStore as p,useCallback as u,useMemo as f}from"react";var m=n=>({kind:"node",id:n});function x(r,o,l,a="none"){const c=n(r,o,l),i=t(r,o,l);if("none"===a||!c)return{data:i,select:null};const d=e(r,o,c.place)??[],s=d[c.place.index+1]??d[c.place.index-1];return s?.props?.id?{data:i,select:m(s.props.id)}:"root"!==c.place.parentId?{data:i,select:m(c.place.parentId)}:{data:i,select:null}}function g(t,e,l,a={}){const c=n(t,e,l)?.node,i=a.id??r(c?.type??"Node");return{data:o(t,e,l,{strip:a.strip,id:i}),select:m(i)}}function I(n,t,e,r){return{data:l(n,t,e,r),select:m(e)}}var h=(n,t)=>({min:0,max:t-1});function v(t,r,o,l,a=h){const c=n(t,r,o);if(!c)return!1;const i=e(t,r,c.place)?.length??0,{min:d,max:s}=a(c.place,i),p=c.place.index+l;return c.place.index>=d&&c.place.index<=s&&p>=d&&p<=s}function b(t,e,r,o,l=h){if(!v(t,e,r,o,l))return null;const a=n(t,e,r);return I(t,e,r,{...a.place,index:a.place.index+o})}function k(n,t,e,r,o={}){const l=a(e,t,{strip:o.strip});return{data:c(n,t,r,l),select:m(l.props.id)}}function y(t,r,o,l){if(n(t,r,o.props.id))return null;const a=e(t,r,l)??[],i={...l,index:Math.max(0,Math.min(l.index,a.length))};return{data:c(t,r,i,o),select:m(o.props.id)}}function M(e,r,o,l){const a=n(e,r,o);return a?l.props.id!==o&&n(e,r,l.props.id)?null:{data:c(t(e,r,o),r,a.place,l),select:m(l.props.id)}:null}function O(n,t,e,r){return{data:i(n,t,e,r),select:void 0}}function z(t,e,r,o=()=>!1){if(!r)return null;if("slot"===r.kind)return n(t,e,r.parentId)?m(r.parentId):null;const l=n(t,e,r.id);if(!l||"root"===l.place.parentId)return null;const a=n(t,e,l.place.parentId);return a?o(a.node,l.place.slot)?{kind:"slot",parentId:a.node.props.id,slot:l.place.slot}:m(a.node.props.id):null}function R(t,e,r,o){const l=n(t,e,r);if(!l)return[];const a=l.path.filter(n=>"root"!==n.parentId).map(n=>n.parentId);return o?[...a.filter(r=>{const l=n(t,e,r);return!l||!o(l.node)}),r]:[...a,r]}function B(n,t){if(0===n.length)return null;const e=null===t?-1:n.indexOf(t);return-1===e?n[0]:n[Math.min(e+1,n.length-1)]}function X(t,e,r,o,l){const a=n(t,e,r);return a?0===d(a.node,e).length?r:B(R(t,e,r,l),o):null}function $(t,e,r,o,l,a,c){const i=n(t,e,r);if(!i)return null;if(0===d(i.node,e).length)return{node:r,part:o};const s="\0part:"+o,p=B([...R(t,e,r,c),s],l===r&&a===o?s:l);return p===s?{node:r,part:o}:{node:p??r,part:null}}function j(t,e,r){if(!r||"node"!==r.kind)return null;const o=n(t,e,r.id);return o?{zone:`${o.place.parentId}:${o.place.slot}`,index:o.place.index}:null}function w(n,t,r){if(!r)return null;const[o,l]=(r.zone??"root:default-zone").split(/:(.*)/s),a={parentId:o,slot:l},c=e(n,t,a)?.[r.index];return c?.props?.id?m(c.props.id):null}var K={get:()=>null,set:()=>{},subscribe:()=>()=>{}};function L(t){const e=s(t);e.current=t;const r=t.clipboard??K,o=p(r.subscribe,r.get,r.get),l=u(n=>{const t=e.current;if(t.readOnly)return!1;const r=n(t.data,t.config);return!!r&&((r.data!==t.data||void 0!==r.select)&&(t.commit(r.data,{select:r.select}),e.current={...t,data:r.data},!0))},[]);return f(()=>{const t=()=>e.current,r=(e,r)=>{const o=n(t().data,t().config,e);return o?{node:o.node,label:r,from:{parentId:o.place.parentId,slot:o.place.slot}}:null};return{held:o,remove:n=>l((e,r)=>x(e,r,n,t().afterRemove)),duplicate:n=>l((e,r)=>g(e,r,n,{strip:t().strip})),move:(n,t)=>l((e,r)=>I(e,r,n,t)),step:(n,e)=>l((r,o)=>b(r,o,n,e,t().stepBounds)),canStep:(n,e)=>v(t().data,t().config,n,e,t().stepBounds),setProps:(n,t)=>l((e,r)=>O(e,r,n,t)),copy:(n,e)=>{const o=r(n,e);return o&&(t().clipboard??K).set(o),!!o},cut:(n,e)=>{if(t().readOnly)return!1;const o=r(n,e);return!!o&&((t().clipboard??K).set(o),l((e,r)=>x(e,r,n,t().afterRemove)))},paste:n=>{const e=(t().clipboard??K).get();return!!e&&l((r,o)=>k(r,o,e.node,n,{strip:t().strip}))},restore:(n,t)=>l((e,r)=>y(e,r,n,t)),swap:(n,t)=>l((e,r)=>M(e,r,n,t)),parentOf:n=>z(t().data,t().config,n,t().slotIsLevel)}},[o,l])}export{v as canStep,X as clickPick,$ as clickPickPart,w as fromItemSelector,B as nextInChain,R as nodeChain,z as parentStep,g as planDuplicate,I as planMove,k as planPaste,x as planRemove,y as planRestore,O as planSetProps,b as planStep,M as planSwap,j as toItemSelector,L as useNodeOps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useSectionOps as o}from"./chunk-SNB4LQMK.js";import{SELECTION_MODE as e}from"./chunk-W6SDWCOL.js";import{decodePartId as r,encodePartId as t}from"./chunk-IYT6NN2J.js";import{useEasel as n}from"./chunk-QEAUF632.js";import{usePreviewParts as p}from"./chunk-I54UCYOU.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&I.select(r)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{noControlField as e}from"./chunk-7F52SZOI.js";import{DEFAULT_SCREEN_WORDS as n}from"./chunk-
|
|
1
|
+
import{noControlField as e}from"./chunk-7F52SZOI.js";import{DEFAULT_SCREEN_WORDS as n}from"./chunk-C2RHV42O.js";import{useWords as r}from"./chunk-MFIRYGHW.js";import{usePreviewDevice as t}from"./chunk-BSPCSC45.js";import{jsx as o}from"react/jsx-runtime";function i(e){return"mobile"===e?"mobile":"desktop"}var c={desktop:null,tablet:n.deviceNote.tablet,mobile:n.deviceNote.mobile},u="data-sf-device-hidden";function d(){/* @__PURE__ */
|
|
2
2
|
return o("span",{hidden:!0,[u]:""})}function s({tier:e,render:n,...r}){return i(t())===e?/* @__PURE__ */o(n,{...r}):/* @__PURE__ */o(d,{})}var m="__device";function f(e){const n=e?.[m];return n??null}function l(e){return f(e)?.inner??e}function a(e,n){const r=n.render;return{...n,[m]:{tier:e,inner:n},render:n=>/* @__PURE__ */o(s,{tier:e,render:r,...n})}}function p(){const e=r("screen",n).deviceNote,i=t(),c="desktop"===i?null:e[i];return c?/* @__PURE__ */o("div",{className:"sf-device-scope",children:c}):/* @__PURE__ */o(d,{})}function v(){return e({type:"custom",render:()=>/* @__PURE__ */o(p,{})},"always")}export{m as DEVICE_FIELD_MARKER,u as DEVICE_HIDDEN_ATTR,c as DEVICE_NOTE,a as deviceField,f as deviceMetaOf,v as deviceNote,i as shownTier,l as withoutDeviceGate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-
|
|
1
|
+
import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-QEAUF632.js";import{useState as r,useEffect as o,useRef as u}from"react";function c(e){const t=n(),[u,c]=r(null);return o(()=>c(e.current),[e]),t.ownsDocument?"undefined"==typeof document?null:document:u}function i(r,u){const i=n(),s=e(),f=c(r);o(()=>{if(!i.ownsDocument&&f)return t(f,s,{leaveTyping:!0})},[i,s,f]);const m=u?.document??null;o(()=>{if(!i.ownsDocument&&m)return t(m,s,{leaveTyping:!0})},[i,s,m])}function s(n){return n.ownsDocument?{}:{tabIndex:-1}}function f(n){return!n.altKey&&!n.shiftKey&&(!(!n.metaKey&&!n.ctrlKey)&&("s"===n.key||"S"===n.key||"KeyS"===n.code))}function m(n,e,t){const r=c(n),i=u(t);o(()=>{i.current=t}),o(()=>{if(!r)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[r]);const s=e?.document??null;o(()=>{if(!s)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return s.addEventListener("keydown",n),()=>s.removeEventListener("keydown",n)},[s])}export{s as editorRootFocus,f as isSaveShortcut,c as useEaselKeyTarget,m as useEaselSaveKey,i as useEaselUndoKeys};
|
package/dist/drag/drag.css
CHANGED
|
@@ -401,6 +401,14 @@
|
|
|
401
401
|
.es-add-tile.has-cover .es-add-tile-label {
|
|
402
402
|
padding: 0 2px;
|
|
403
403
|
}
|
|
404
|
+
/* A tile's mark after its name (`AddTile.mark`): a shared section's, in the
|
|
405
|
+
shell's success ink, as its Layers row is (Shared section design v4). */
|
|
406
|
+
.es-add-tile-mark {
|
|
407
|
+
display: inline-flex;
|
|
408
|
+
vertical-align: middle;
|
|
409
|
+
margin-left: 4px;
|
|
410
|
+
color: var(--status-success-soft-ink);
|
|
411
|
+
}
|
|
404
412
|
.es-add-empty {
|
|
405
413
|
display: flex;
|
|
406
414
|
flex-direction: column;
|
package/dist/drag/index.d.ts
CHANGED
|
@@ -200,6 +200,9 @@ type AddTile = {
|
|
|
200
200
|
/** Why, in the host's words ("A page has one header"): a disabled tile's
|
|
201
201
|
* tooltip, in place of "Add …". Left out, a disabled tile has none. */
|
|
202
202
|
disabledReason?: string;
|
|
203
|
+
/** A glyph after the caption — a shared section's mark. A picture of what
|
|
204
|
+
* the tile IS: its words are the tile's `title`. */
|
|
205
|
+
mark?: ReactNode;
|
|
203
206
|
};
|
|
204
207
|
/**
|
|
205
208
|
* One headed group of tiles.
|
|
@@ -234,6 +237,17 @@ type AddPanelProps<I> = {
|
|
|
234
237
|
label: string;
|
|
235
238
|
onClear: () => void;
|
|
236
239
|
};
|
|
240
|
+
/**
|
|
241
|
+
* A tile's own menu: a right-click on it (or the menu key while it has the
|
|
242
|
+
* focus) asks the host, with the tile's type and the point, and the host
|
|
243
|
+
* draws its menu there. A host answers only for the tiles it has rows for;
|
|
244
|
+
* the browser's own menu is held back only when it does. Left out: none.
|
|
245
|
+
*/
|
|
246
|
+
onTileMenu?: (type: string, at: {
|
|
247
|
+
x: number;
|
|
248
|
+
y: number;
|
|
249
|
+
owner: Element;
|
|
250
|
+
}) => boolean;
|
|
237
251
|
/** The line under the title. Default "Drag onto the page." */
|
|
238
252
|
hint?: string;
|
|
239
253
|
/** The search field's name. Default "Search blocks". */
|
|
@@ -247,7 +261,7 @@ type AddPanelProps<I> = {
|
|
|
247
261
|
*/
|
|
248
262
|
words?: DragWords['add'];
|
|
249
263
|
};
|
|
250
|
-
declare function AddPanel<I>({ groups, session, itemFor, onInsert, at, hint: ownHint, searchLabel: ownSearchLabel, readOnly, words, }: AddPanelProps<I>): react.JSX.Element;
|
|
264
|
+
declare function AddPanel<I>({ groups, session, itemFor, onInsert, onTileMenu, at, hint: ownHint, searchLabel: ownSearchLabel, readOnly, words, }: AddPanelProps<I>): react.JSX.Element;
|
|
251
265
|
|
|
252
266
|
/**
|
|
253
267
|
* The effect a drop target names (second host, 2026-10-06).
|
package/dist/drag/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-
|
|
1
|
+
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-LLDHIBYG.js";import"../chunk-KAML3KQH.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-X4T6JT3M.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/draw/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-PIND6KE7.js";export{VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,viewTierForWidth}from"../chunk-DWIOHQG7.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-
|
|
1
|
+
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../chunk-PIND6KE7.js";export{VIEW_DESKTOP_MIN,VIEW_TABLET_MIN,VIEW_TIERS,VIEW_TIER_LABEL,viewTierForWidth}from"../chunk-DWIOHQG7.js";export{rootRowName,sectionRenameProp,slotChildName,slotChildRenameProp,slotChildRowName}from"../chunk-BHRC3ASL.js";export{hidableText,readHidable}from"../chunk-6W7WLPZH.js";export{HERO_SLIDER_GOTO_EVENT}from"../chunk-IQ5TA7AM.js";export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../chunk-DUVRZ456.js";export{PART_SEP,decodePartId,encodePartId}from"../chunk-IYT6NN2J.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../chunk-PLVEGYK6.js";export{TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,isTextStyleCase,textStyleCaseCss,textStyleCaseOfCss}from"../chunk-YHZSBL2N.js";
|
package/dist/easel/easel.css
CHANGED
|
@@ -112,6 +112,14 @@
|
|
|
112
112
|
outline: 1px solid color-mix(in srgb, var(--es-canvas-outline-colour) 60%, transparent);
|
|
113
113
|
outline-offset: -1px;
|
|
114
114
|
}
|
|
115
|
+
/* A node many pages use live (`CanvasSharedContext`; Shared section design v4,
|
|
116
|
+
Lewis 2026-10-21): its selected and hover outlines in the shell's success
|
|
117
|
+
colour, as its Layers row and tab are. The frame holds the host's sheets,
|
|
118
|
+
and with them the shell's tokens; without them, the accent. No colour of
|
|
119
|
+
our own (harness UI-24). */
|
|
120
|
+
.es-canvas-outline.is-shared {
|
|
121
|
+
--es-canvas-outline-colour: var(--status-success-solid, var(--es-accent));
|
|
122
|
+
}
|
|
115
123
|
/* The words being typed (EaselCanvas `typing`, Lewis 2026-10-14): ONE plain
|
|
116
124
|
box round the whole words, like an input — a 2px line in the selection's
|
|
117
125
|
colour, 4px clear of them, with the selection outline's square corners. It
|
package/dist/easel/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DataInput } from '../data/index.js';
|
|
2
|
-
import { N as NodeSelection, P as PassThrough } from '../plan-
|
|
3
|
-
export { I as ItemSelector } from '../plan-
|
|
4
|
-
import { E as EaselConfig, a as EaselView, b as EaselAction, P as Permissions, c as EaselCore, d as EaselUi } from '../types-
|
|
5
|
-
export { A as AppState, e as EaselHistory, H as HistoryEntry, S as SetDataPatch } from '../types-
|
|
2
|
+
import { N as NodeSelection, P as PassThrough } from '../plan-CZS902DV.js';
|
|
3
|
+
export { I as ItemSelector } from '../plan-CZS902DV.js';
|
|
4
|
+
import { E as EaselConfig, a as EaselView, b as EaselAction, P as Permissions, c as EaselCore, d as EaselUi } from '../types-Cq53lL8d.js';
|
|
5
|
+
export { A as AppState, e as EaselHistory, H as HistoryEntry, S as SetDataPatch } from '../types-Cq53lL8d.js';
|
|
6
6
|
import { S as SlotAddress, D as Data, P as Place, N as Node } from '../types-41704JE4.js';
|
|
7
7
|
import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../resolve-D68pb3Bx.js';
|
|
8
8
|
import * as react from 'react';
|
|
@@ -10,7 +10,7 @@ import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
|
|
|
10
10
|
import { TextToolbarProps } from 'efficient-shell/ui';
|
|
11
11
|
import { C as CopyBoxLastTool, a as CopyThemeColor, b as CanvasTypingEnd } from '../canvas-typing-BsNigaCa.js';
|
|
12
12
|
import { InlineRule } from 'efficient-shell/markup';
|
|
13
|
-
import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-
|
|
13
|
+
import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-fIDWzftn.js';
|
|
14
14
|
import { I as InspectorFields } from '../types-CDX6vd6A.js';
|
|
15
15
|
import '../words-D-yhjdOg.js';
|
|
16
16
|
import '../buckets-Tj-nkBpg.js';
|
|
@@ -330,6 +330,15 @@ declare function EditDocument({ metadata }: {
|
|
|
330
330
|
* Absent: every container is a step, as before.
|
|
331
331
|
*/
|
|
332
332
|
declare const CanvasPassThroughContext: react.Context<PassThrough | undefined>;
|
|
333
|
+
/**
|
|
334
|
+
* THE NODES MANY PAGES USE LIVE (Shared section design v4, Lewis 2026-10-21):
|
|
335
|
+
* is the node with this id one of them? Its selected and its hover outline
|
|
336
|
+
* then carry `is-shared`, which easel.css draws in the success colour — green,
|
|
337
|
+
* as the shared node's Layers row and canvas tab are (Wix: "a global section
|
|
338
|
+
* has a green overlay when you hover over it"). The screen provides it round
|
|
339
|
+
* its canvas from the layer's `pinned.sharedReach`. Absent: no outline is.
|
|
340
|
+
*/
|
|
341
|
+
declare const CanvasSharedContext: react.Context<((id: string) => boolean) | undefined>;
|
|
333
342
|
/**
|
|
334
343
|
* A PART a host draws inside one of its blocks — a run of words, a picture —
|
|
335
344
|
* and where it is drawn.
|
|
@@ -521,6 +530,7 @@ declare function useEaselNodeOps(options?: Omit<NodeOpsHost, 'data' | 'config' |
|
|
|
521
530
|
cut: (id: string, label: string) => boolean;
|
|
522
531
|
paste: (at: Place) => boolean;
|
|
523
532
|
restore: (node: Node, at: Place) => boolean;
|
|
533
|
+
swap: (id: string, node: Node) => boolean;
|
|
524
534
|
parentOf: (selection: NodeSelection) => NodeSelection;
|
|
525
535
|
};
|
|
526
536
|
interface SelectedFields {
|
|
@@ -600,4 +610,4 @@ declare function bindUndoKeys(doc: Document, easel: Pick<Easel, 'undo' | 'redo'>
|
|
|
600
610
|
leaveTyping?: boolean;
|
|
601
611
|
}): () => void;
|
|
602
612
|
|
|
603
|
-
export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, type CanvasPart, type CanvasParts, CanvasPartsContext, CanvasPassThroughContext, type CanvasSlotProps, type CanvasTyping, type CanvasTypingState, type CanvasTypingTarget, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useSelectedFields, validSelection };
|
|
613
|
+
export { CanvasFrame, type CanvasFrameProps, type CanvasOverlay, type CanvasPart, type CanvasParts, CanvasPartsContext, CanvasPassThroughContext, CanvasSharedContext, type CanvasSlotProps, type CanvasTyping, type CanvasTypingState, type CanvasTypingTarget, DEFAULT_UI, type Easel, EaselAction, EaselCanvas, type EaselCanvasProps, EaselConfig, EaselCore, type EaselOptions, EaselProvider, type EaselProviderProps, EaselUi, EaselView, EditDocument, NodeSelection, Permissions, type SelectedFields, bindUndoKeys, createEasel, createUseEasel, recordsByDefault, reduce, uiView, useEasel, useEaselApi, useEaselNodeOps, useSelectedFields, validSelection };
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-
|
|
1
|
+
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-QEAUF632.js";import"../chunk-TBY3DFKS.js";import"../chunk-YRLPFZW3.js";import"../chunk-X3TYRF5V.js";import"../chunk-23VM4PMV.js";import"../chunk-B4JN227A.js";import"../chunk-MFIRYGHW.js";import"../chunk-X4T6JT3M.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/fields/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-
|
|
1
|
+
export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-5ZBV5RA6.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-A6Z4SD3I.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-BALFHI3G.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-2XMHLXMA.js";export{FieldSelect,optionFor}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
|
@@ -363,11 +363,22 @@ declare function ScreenDocumentProvider({ target, addressing: handed, onHostMess
|
|
|
363
363
|
* panel) gets {@link DETACHED_EASEL_HOST}: nobody listening, nothing sent — a
|
|
364
364
|
* request that needs an answer settles empty instead of waiting forever.
|
|
365
365
|
*/
|
|
366
|
+
/**
|
|
367
|
+
* What a picked file's `id` names:
|
|
368
|
+
* - `asset`: a file in the host's Media Library;
|
|
369
|
+
* - `design_image`: a product's picture (a render);
|
|
370
|
+
* - `url`: nothing that lasts; the picture is known by its address only, and
|
|
371
|
+
* `id` repeats it.
|
|
372
|
+
*/
|
|
373
|
+
type PickedMediaSource = "asset" | "design_image" | "url";
|
|
366
374
|
/** A picked media item, as the host's media picker returns it. */
|
|
367
375
|
interface HostPickedMedia {
|
|
368
376
|
id: string;
|
|
369
377
|
url: string;
|
|
370
378
|
kind: "image" | "video";
|
|
379
|
+
/** What `id` names. A host that sends none answers as before: a
|
|
380
|
+
* field that keeps ids treats the pick as `url`. */
|
|
381
|
+
source?: PickedMediaSource;
|
|
371
382
|
}
|
|
372
383
|
/** The SECTION editor's target (the standalone one-section surface). */
|
|
373
384
|
type SectionScreenTarget = {
|
|
@@ -604,4 +615,4 @@ declare function createEaselHost(options: {
|
|
|
604
615
|
deliver: (message: HostToEaselMessage) => void;
|
|
605
616
|
};
|
|
606
617
|
|
|
607
|
-
export { type AnyDocumentAddressing as A, DETACHED_EASEL_HOST as D, type EaselHost as E, type HostPickedMedia as H, type InboundHostMessage as I, NO_DOCUMENT_ADDRESSING as N, type SectionScreenTarget as S, type DocumentAddressing as a, type EaselHostAddress as b, EaselHostContext as c, EaselHostProvider as d, type EaselMessageType as e, type EaselToHostMessage as f, type HostToEaselMessage as g, type SendToHost as h, createEaselHost as i, useHostEscape as j, type AnyScreenTarget as k, type DocumentTarget as l, ScreenDocumentContext as m, ScreenDocumentProvider as n, type ScreenDocumentValue as o, type ScreenTarget as p, useScreenDocument as q, useEaselHost as u };
|
|
618
|
+
export { type AnyDocumentAddressing as A, DETACHED_EASEL_HOST as D, type EaselHost as E, type HostPickedMedia as H, type InboundHostMessage as I, NO_DOCUMENT_ADDRESSING as N, type PickedMediaSource as P, type SectionScreenTarget as S, type DocumentAddressing as a, type EaselHostAddress as b, EaselHostContext as c, EaselHostProvider as d, type EaselMessageType as e, type EaselToHostMessage as f, type HostToEaselMessage as g, type SendToHost as h, createEaselHost as i, useHostEscape as j, type AnyScreenTarget as k, type DocumentTarget as l, ScreenDocumentContext as m, ScreenDocumentProvider as n, type ScreenDocumentValue as o, type ScreenTarget as p, useScreenDocument as q, useEaselHost as u };
|
package/dist/node-ops/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AfterRemove, I as ItemSelector, N as NodeSelection, P as PassThrough, a as Planned, S as StepBounds, c as canStep, b as clickPick, d as clickPickPart, f as fromItemSelector, n as nextInChain, e as nodeChain, p as parentStep, g as planDuplicate, h as planMove, i as planPaste, j as planRemove, k as planRestore, l as planSetProps, m as planStep, t as toItemSelector } from '../plan-
|
|
2
|
-
export { C as ClipboardEntry, N as NodeClipboard, a as NodeOps, b as NodeOpsHost, c as createNodeClipboard, u as useNodeOps } from '../useNodeOps-
|
|
1
|
+
export { A as AfterRemove, I as ItemSelector, N as NodeSelection, P as PassThrough, a as Planned, S as StepBounds, c as canStep, b as clickPick, d as clickPickPart, f as fromItemSelector, n as nextInChain, e as nodeChain, p as parentStep, g as planDuplicate, h as planMove, i as planPaste, j as planRemove, k as planRestore, l as planSetProps, m as planStep, o as planSwap, t as toItemSelector } from '../plan-CZS902DV.js';
|
|
2
|
+
export { C as ClipboardEntry, N as NodeClipboard, a as NodeOps, b as NodeOpsHost, c as createNodeClipboard, u as useNodeOps } from '../useNodeOps-fIDWzftn.js';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { E as EaselContextMenuItem } from '../types-BsyPh6EW.js';
|
|
5
5
|
import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
package/dist/node-ops/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{createNodeClipboard,nodeMenuItems}from"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,clickPickPart,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,toItemSelector,useNodeOps}from"../chunk-
|
|
1
|
+
export{createNodeClipboard,nodeMenuItems}from"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";export{canStep,clickPick,clickPickPart,fromItemSelector,nextInChain,nodeChain,parentStep,planDuplicate,planMove,planPaste,planRemove,planRestore,planSetProps,planStep,planSwap,toItemSelector,useNodeOps}from"../chunk-X3TYRF5V.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|