efficient-easel 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-KCE5RVVC.js → chunk-5LGAIELC.js} +3 -3
- package/dist/{chunk-7QWOAQQL.js → chunk-63GQKLJI.js} +5 -5
- package/dist/{chunk-BEEJ63CT.js → chunk-CG4OPQQX.js} +38 -38
- package/dist/{chunk-NGT4DAHF.js → chunk-DCPFE4IO.js} +1 -1
- package/dist/{chunk-4OL6MRYY.js → chunk-EOUMA3QT.js} +1 -1
- package/dist/{chunk-2F6RZTR7.js → chunk-FODNRCCO.js} +4 -4
- package/dist/chunk-K6ELD7N5.js +23 -0
- package/dist/{chunk-JMIZ3FOV.js → chunk-P3GORPR4.js} +1 -1
- package/dist/{chunk-TJIXDXTV.js → chunk-THQB37AA.js} +1 -1
- package/dist/chunk-U4MJQAVH.js +1 -0
- package/dist/fields/fields.css +23 -74
- package/dist/fields/index.d.ts +11 -3
- package/dist/fields/index.js +1 -1
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-Q6ETRSEA.js +0 -24
- package/dist/chunk-RINSVAKA.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as e}from"./chunk-
|
|
1
|
+
import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as e}from"./chunk-THQB37AA.js";import{ScreenChrome as r}from"./chunk-CG4OPQQX.js";import{ScreenDocumentProvider as a,useScreenDocument as i}from"./chunk-ONRYLR2D.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-E2O2MRZR.js";import{documentPermissions as o}from"./chunk-THWO5YVZ.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{useMemo as c}from"react";import{Dialog as d,Button as l}from"efficient-shell/ui";import{jsx as m,jsxs as g,Fragment as h}from"react/jsx-runtime";var v=n(e),f=n(r);function p({saving:n,onCancel:e,onDiscard:r,onSave:a}){/* @__PURE__ */
|
|
2
2
|
return m(d,{open:!0,role:"alertdialog",size:"sm",title:"Unsaved changes",onClose:e,footer:/* @__PURE__ */g(h,{children:[
|
|
3
3
|
/* @__PURE__ */m(l,{variant:"secondary",onClick:e,children:"Cancel"}),
|
|
4
4
|
/* @__PURE__ */m(l,{variant:"ghost-danger",onClick:r,children:"Discard & leave"}),
|
|
5
5
|
/* @__PURE__ */m(l,{variant:"primary",loading:n,onClick:a,children:n?"Saving…":"Save & leave"})]}),children:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them."})}function u({target:n,addressing:e,onHostMessage:r,children:i}){/* @__PURE__ */
|
|
6
|
-
return m(a,{target:n,addressing:e,onHostMessage:r,children:i})}var C=(n,e)=>/* @__PURE__ */g(h,{children:[n,e]});function k({config:n,parts:e,wrap:r=C}){const{data:a,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:k,pendingNav:N,cancelPendingNav:j,discardAndNavigate:
|
|
7
|
-
/* @__PURE__ */m(v,{config:n,data:a,onChange:k,permissions:
|
|
6
|
+
return m(a,{target:n,addressing:e,onHostMessage:r,children:i})}var C=(n,e)=>/* @__PURE__ */g(h,{children:[n,e]});function k({config:n,parts:e,wrap:r=C}){const{data:a,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:k,pendingNav:N,cancelPendingNav:j,discardAndNavigate:O,saveAndNavigate:S}=i(),y=c(()=>o(!u),[u]),A=t("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:A.loading}):d?/* @__PURE__ */m("div",{className:"sf-msg sf-msg--error",children:d}):g?a?r(
|
|
7
|
+
/* @__PURE__ */m(v,{config:n,data:a,onChange:k,permissions:y,parts:e,children:/* @__PURE__ */m(f,{})}),N&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:j,onDiscard:O,onSave:()=>{S()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:A.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:A.waitingForAuthorization})}export{k as DocumentScreen,u as ScreenMount};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as s}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as i}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-QR4DLZ3P.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */g(r,{icon:/* @__PURE__ */g(h,{size:15}),title:z.title,context:
|
|
4
|
-
/* @__PURE__
|
|
5
|
-
/* @__PURE__ */g(f,{groups:J,session:
|
|
1
|
+
import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as s}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as i}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-QR4DLZ3P.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-FODNRCCO.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-E2O2MRZR.js";import{useEasel as u}from"./chunk-PYCLHOSA.js";import{useWords as k}from"./chunk-MFIRYGHW.js";import{AddPanel as f}from"./chunk-W3XX2CNW.js";import{AddIcon as h}from"./chunk-L5KW4HG5.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{jsx as g,jsxs as O,Fragment as $}from"react/jsx-runtime";var v=e=>`section:${e}`,B=e=>`block:${e}`,C=e=>`template:${e}`;function L({blocks:L,blocksOnly:R,at:x,onAdd:H,itemFor:N,session:A,siteWide:D,onClose:I,onHide:V,readOnly:W}){const F=u(e=>e.config),P=p(),{labelAtLevel:Q,categoryLabel:S,firstSection:T,Icon:Y,Thumbnail:Z}=P,{blockIsOffered:w}=m(),z=k("screen",d).add,E=l(),[G,K]=y([]);b(()=>{let t=!1;const o=e=>w(e,E);return i(E).list().then(n=>{if(t)return;const s=F.components;K(n.filter(t=>t.node?.type&&s[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[F,E]);const M=j(()=>t(F,P),[F]),X=e=>({type:v(e.type),label:e.name,cover:/* @__PURE__ */g(Z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:z.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),J=j(()=>{const e=[];if(L&&L.choices.length>0&&a(L.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${z.inside({name:L.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:B(e.type),label:e.label,icon:/* @__PURE__ */g(Y,{type:e.type,size:18}),title:z.tile({name:e.label})}))})}),R)return e;const t=o(M,T);t&&e.push({key:"start",title:z.startBlank,tiles:[X(t)]}),G.length>0&&e.push({key:"templates",title:z.templates,tiles:G.map(e=>{return{type:C(e.id),label:e.name,cover:/* @__PURE__ */g(Z,{type:e.node.type}),keywords:[(t=e.node.type,Q(t,"section",F.components[t]?.label??t)),e.node.type]};var t})});const i=n(M,T);for(const t of Object.keys(F.categories??{})){const o=i.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:s(F,t,S),tiles:o.map(X)})}return e},[L,R,G,M,F,z]),q=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=G.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
|
|
2
|
+
return O($,{children:[
|
|
3
|
+
/* @__PURE__ */g(r,{icon:/* @__PURE__ */g(h,{size:15}),title:z.title,context:R?z.contextBlocks:z.contextAll,actions:/* @__PURE__ */g(c,{label:z.done,description:z.doneDescription,onClick:I}),onHide:V}),
|
|
4
|
+
/* @__PURE__ */O("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
+
/* @__PURE__ */g(f,{groups:J,session:A,itemFor:e=>N(q(e)??{kind:"section",type:e}),onInsert:e=>{const t=q(e);t&&H(t)},at:x,hint:R?z.hintBlocks:z.hint,searchLabel:R?z.searchBlocks:z.searchSections,readOnly:W}),D&&!R?D:null]})]})}export{L as AddSidePanel,B as blockKey,v as sectionKey,C as templateKey};
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-SQTY6CJD.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-PT6V53OO.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-ORR3Q4WV.js";import{usePartBridge as v}from"./chunk-
|
|
2
|
-
return bn(Fe,{tone:e.pending?"off-unsaved":"off",label:"Not saving — see the notice above",role:"status"});const{tone:l,label:s}=
|
|
1
|
+
import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-SQTY6CJD.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-PT6V53OO.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-ORR3Q4WV.js";import{usePartBridge as v}from"./chunk-U4MJQAVH.js";import{useSectionOps as x}from"./chunk-DCPFE4IO.js";import{useNodeClipboard as b,useNodeContextMenu as w}from"./chunk-JLTZQ4US.js";import{PageEditGuardNotices as z}from"./chunk-MAEXP3KE.js";import{useScreenDocument as C}from"./chunk-ONRYLR2D.js";import{requestMediaPick as O}from"./chunk-KG7RJWOK.js";import{heldStyle as B,styleShortcut as $}from"./chunk-57DJOKXT.js";import{AddChildRow as I}from"./chunk-5545A3PC.js";import{AddSidePanel as N}from"./chunk-63GQKLJI.js";import{SidePanelHead as P,PanelShowStrip as T}from"./chunk-QR4DLZ3P.js";import{MediaSidePanel as R}from"./chunk-EOUMA3QT.js";import{useScreenSaveSwitch as A,useScreenNodeKeys as M,useScreenPinned as j,useScreenDocumentLabel as E,useScreenCanvasFrame as L,useScreenInspectorPanel as D,useScreenDevices as V,useScreenPickFollowsSelection as H,useScreenLeftView as F,useScreenAdd as W,SELECTION_MODE as U,sameInspectorMode as G,useScreenBridges as J,useScreenBlockRules as Y,useScreenBlockLook as Q,useScreenStorageNamespace as K,useScreenNotify as X,useScreenCanvasHead as _,isSlotMode as q,useScreenStyleClipboard as Z,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-FODNRCCO.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as Se}from"./chunk-E2O2MRZR.js";import{useEasel as ve,useEaselApi as xe}from"./chunk-PYCLHOSA.js";import{TreeRow as be,Subtree as we,LayersTree as ze,TreeGroupLabel as Ce,TreeRowAction as Oe,TreeSeam as Be}from"./chunk-UFY6RNMT.js";import{toItemSelector as $e,useNodeOps as Ie}from"./chunk-D2BCHTQR.js";import{saveIndicator as Ne}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Pe,TopBarRail as Te,TopBarCluster as Re,EaselIconButton as Ae,TopBarDivider as Me,DeviceSwitch as je,InspectorIconButton as Ee,PanelResizeHandle as Le,MAX_PANEL_W as De,MIN_PANEL_W as Ve,panelWidthVars as He,SaveState as Fe,SaveStateToggle as We}from"./chunk-TJ7YIRWQ.js";import{useWords as Ue}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as Ge}from"./chunk-W3XX2CNW.js";import{createDragSession as Je,useTreeDrag as Ye,gapToMoveIndex as Qe}from"./chunk-67GNT6PF.js";import{useCanvasFrame as Ke,BLOCK_SELECTOR as Xe,useCanvasEvent as _e}from"./chunk-PAELDYYS.js";import{LayersIcon as qe,MediaIcon as Ze,UndoIcon as en,RedoIcon as nn,TrashIcon as tn,EyeOffIcon as on,EyeIcon as rn,DuplicateIcon as ln}from"./chunk-L5KW4HG5.js";import{zoneKey as sn,ROOT_ID as dn,ROOT_SLOT as cn,parseZoneKey as an,DataError as pn}from"./chunk-KRXQM65X.js";import{useRef as un,useMemo as fn,useState as hn,useEffect as mn,useCallback as gn,useLayoutEffect as yn,Fragment as kn}from"react";import{Tooltip as Sn,Button as vn,toast as xn}from"efficient-shell/ui";import{jsx as bn,jsxs as wn,Fragment as zn}from"react/jsx-runtime";function Cn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i}){if(null!==t)/* @__PURE__ */return bn(Fe,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
|
|
2
|
+
return bn(Fe,{tone:e.pending?"off-unsaved":"off",label:"Not saving — see the notice above",role:"status"});const{tone:l,label:s}=Ne(e),d=e.failed&&!e.paused&&/* @__PURE__ */bn(vn,{variant:"secondary",size:"sm",onClick:i,children:"Retry now"});/* @__PURE__ */
|
|
3
3
|
return wn(zn,o?{children:[
|
|
4
4
|
/* @__PURE__ */bn(We,{pressed:e.paused,onToggle:r,title:e.paused?"Auto-save is off — click to turn it back on (saves your held edits)":"Auto-save is on — click to pause it",children:/* @__PURE__ */bn(Fe,{tone:l,label:s})}),d]}:{children:[
|
|
5
|
-
/* @__PURE__ */bn(Fe,{tone:l,label:s,role:"status"}),d]})}function
|
|
5
|
+
/* @__PURE__ */bn(Fe,{tone:l,label:s,role:"status"}),d]})}function On({expand:e}){/* @__PURE__ */
|
|
6
6
|
return bn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */wn(zn,e?{children:[
|
|
7
7
|
/* @__PURE__ */bn("path",{d:"M8 9l4-4 4 4"}),
|
|
8
8
|
/* @__PURE__ */bn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
9
9
|
/* @__PURE__ */bn("path",{d:"M8 4l4 4 4-4"}),
|
|
10
10
|
/* @__PURE__ */bn("path",{d:"M8 20l4-4 4 4"}),
|
|
11
|
-
/* @__PURE__ */bn("path",{d:"M5 12h14"})]})})}function
|
|
12
|
-
return new Set}});mn(()=>{try{window.localStorage.setItem(Do,JSON.stringify([...Ho]))}catch{}},[Ho]);const[Wo,Uo]=hn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(Vo);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});mn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Vo,JSON.stringify(Wo))}catch{}},300);return()=>clearTimeout(e)},[Wo]);const Go=gn((e,n)=>Uo(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),
|
|
13
|
-
return bn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":"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)},
|
|
14
|
-
return bn(
|
|
11
|
+
/* @__PURE__ */bn("path",{d:"M5 12h14"})]})})}function Bn(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var $n="__rungs";var In="screen:band",Nn={duplicate:!0,delete:!0};function Pn(){const Ne=ye(),{target:Fe,docId:We,capabilities:Pn,currentSlug:Tn,siteId:Rn,onPublish:An,saveState:Mn,saveConflict:jn,retrySave:En,toggleAutoSave:Ln,readOnly:Dn,readOnlyReason:Vn=null}=C(),Hn=A(),Fn=M(),{mediaEditing:Wn,hasEditGuard:Un,hasPinnedChrome:Gn}=Pn,{appState:Jn,dispatch:Yn,history:Qn,selectedItem:Kn,getSelectorForId:Xn,config:_n}=ve(e=>e),qn=j(),{first:Zn,firstGroup:et,lastGroup:nt,isSectionGroup:tt,sectionGroupZone:ot,panelOf:rt}=qn,it=rt(Zn),lt=e=>oe(qn,e),st=e=>re(qn,e),dt="node"===qn.firstRow,ct=qn.band??null,at=Ue("screen",Se),pt=E()??`/${Tn}`,ut=L(),ft=D(),ht=x({readOnly:Dn}),mt=x({readOnly:Dn,foldIntoHistory:!0}),gt=un(null),yt=xe(),kt=fn(()=>({...ht,select:e=>{gt.current=e,ht.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=yt.config;gt.current=$e(e,t,n)}ht.commitDocument(e,n)}}),[ht,yt]),St=Jn.ui,vt=St.leftSideBarVisible,xt=St.rightSideBarVisible,{options:bt,widths:wt,initial:zt,fluid:Ct,fit:Ot}=V(),[Bt,$t]=hn(zt),It=he(),Nt=Wn&&null!==It,Pt=me(),Tt=ge();H(Kn?.props.id);const{read:Rt,write:At,forSelection:Mt}=F(),[jt,Et]=hn(Rt);mn(()=>{At(jt)},[jt]);const[Lt,Dt]=hn(0),Vt=un(null),Ht=un(null),Ft=Ke(Ht,{readySelector:Xe}),Wt=f(Ht);h(Ht,Ft);const[Ut,Gt]=hn(!1),Jt=un(!1),Yt=un(!1),[Qt,Kt]=hn(null),Xt=W(),_t=e=>Kt(null===e?null:{zone:le,index:e}),[qt,Zt]=hn([]),[eo,no]=hn(U),to="puck"===eo.kind,oo=Ut&&!Qt&&Xt.railTarget?Xt.railTarget(Jn.data,{node:Kn??null,mode:eo}):null,ro=oo?{zone:sn(oo),index:oo.index}:null,io=Qt??ro,lo=io&&io.zone===le?io.index:null,so=t(eo,Kn?.props.id),[co,ao]=hn(null);mn(()=>{co&&(o(),ao(null))},[co]);const po=un(Xn);po.current=Xn;const uo=gn((e,{scroll:n})=>{Et(n=>Mt(e,n)),n&&ao(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=po.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Fo(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),fo=un(null);mn(()=>{const e=fo.current;fo.current=null;const n=null==Kn?.props.id?null:String(Kn.props.id);no(e&&e.id===n?e.mode:rt(Kn?.type)??U);const t=Kn?.props.id,o=gt.current;if(gt.current=null,!t)return;const i=Xn(t);uo(String(t),{scroll:!r(o,i??null,le)})},[Kn?.props.id,uo]);const ho=gn(e=>{no(n=>G(n,e)?n:e),Yn({type:"setUi",ui:{rightSideBarVisible:!0}})},[Yn]),mo=un(()=>{});mo.current=(e,n)=>{const t=e?Rr(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Kn?.props.id?null:String(Kn.props.id);no(e=>G(e,n)?e:n),o!==r&&(fo.current={id:o,mode:n},kt.select(e))};const go=gn((e,n)=>mo.current(e,n),[]),yo={kind:eo.kind,mode:eo,open:ho,show:e=>no(e),reveal:()=>{xt||Yn({type:"setUi",ui:{rightSideBarVisible:!0}})},select:go},ko=J(yo,{data:Jn.data,selected:Kn??null,zoneOf:e=>Xn(e)?.zone,readOnly:Boolean(Dn),select:e=>{no(U),kt.select({index:e})},replace:(e,n)=>kt.replaceComponent(le,e,n),scrollTo:e=>ri(e)},{device:Bt,refreshes:Lt},{setView:Et,reveal:()=>{vt||Yn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),So=ko.pinnedSource??!1,vo=ko.resolveLeftView?ko.resolveLeftView(jt,Nt):"media"===jt&&Nt?jt:"sections",xo=Y(),{isLockedBlock:bo,duplicateBlocked:wo,nestDepth:zo,newSectionNode:Co,canAddTo:Oo,blockIsOffered:Bo}=xo,$o=Q(),{labelAtLevel:Io,Icon:No,useProducts:Po}=$o,To=$o.rowName?(e,n,t)=>$o.rowName(e,n,t):void 0,Ro=gn(e=>{Yn({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),uo(e,{scroll:!0})},[Yn,uo]),{selectNode:Ao,openPartId:Mo}=v({mode:eo,setMode:no,onOpenPart:Ro}),[jo,Eo]=hn(null);ke(null!==jo,()=>Eo(null));const Lo=y(K()),Do=Lo.collapsed,Vo=Lo.panelWidths,[Ho,Fo]=hn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Do);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
12
|
+
return new Set}});mn(()=>{try{window.localStorage.setItem(Do,JSON.stringify([...Ho]))}catch{}},[Ho]);const[Wo,Uo]=hn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(Vo);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});mn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Vo,JSON.stringify(Wo))}catch{}},300);return()=>clearTimeout(e)},[Wo]);const Go=gn((e,n)=>Uo(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Jo=gn(e=>Go("left",e),[Go]),Yo=gn(e=>Go("right",e),[Go]),Qo=e=>Ho.has(e),Ko=e=>Fo(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Xo=un(!1),_o=un(null);mn(()=>{if(Xo.current&&!Ut){const e=_o.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Ht.current?.querySelector(`button[aria-label="${CSS.escape(at.add.title)}"]`))?.focus(),_o.current=null}Xo.current=Ut},[Ut]),mn(()=>{if(!Ut||!Wt)return;const e=e=>{"Escape"===e.key&&fi()};return Wt.addEventListener("keydown",e),()=>Wt.removeEventListener("keydown",e)},[Ut,Wt]),ke(Ut,()=>fi()),mn(()=>{!vt&&Ut&&(Gt(!1),Kt(null),Jt.current=!1)},[vt]),mn(()=>{if(!Pt)return Yt.current&&Yn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Yt.current=!1);Ut&&(Gt(!1),Kt(null),Yt.current=Jt.current,Jt.current=!1),vt||(Yt.current=!0,Yn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Pt]),mn(()=>{!vt&&Pt&&(Yt.current=!1,Tt())},[vt]),mn(()=>{if(!Pt||!Wt)return;const e=e=>{"Escape"===e.key&&Tt()};return Wt.addEventListener("keydown",e),()=>Wt.removeEventListener("keydown",e)},[Pt,Wt]),ke(null!==Pt,()=>Tt());const qo=X(),Zo=(e,n="success")=>{qo?qo(e,"error"===n?"error":"info"):"error"===n?xn.error(e,{duration:3200,sound:!1}):xn.success(e,{duration:1900,sound:!1})},er=un(null),[nr,tr]=hn(0),[or,rr]=hn(0),ir=_(),lr=un(null),sr=e=>Math.max(0,e.clientHeight-(lr.current?.offsetHeight??0));mn(()=>{const e=er.current;if(!e)return;const n=()=>{tr(e.clientWidth),rr(sr(e))};n();const t=new ResizeObserver(n);return t.observe(e),lr.current&&t.observe(lr.current),()=>t.disconnect()},[]),yn(()=>{er.current&&(tr(er.current.clientWidth),rr(sr(er.current)))},[Wo,vt,xt]);const dr=Bt===Ct?nr>0?nr:wt[Ct]:wt[Bt],cr=nr>0?Math.min(nr/dr,"shrink"===Ot?1:2):1,ar=dr*cr,pr=nr>0&&ar>nr+1,ur={width:ar,height:or||"100%",flex:"none",position:"relative"},fr={width:dr,height:or?or/cr:"100%",maxHeight:"none",transform:1!==cr?`scale(${cr})`:void 0,transformOrigin:"top left"},hr=()=>Yn({type:"setUi",ui:{leftSideBarVisible:!vt}}),mr=()=>Yn({type:"setUi",ui:{rightSideBarVisible:!xt}}),gr=e=>{Ut&&(Gt(!1),Kt(null),Jt.current=!1,vt&&jt===e)||Pt&&(Yt.current=!1,Tt(),vt&&jt===e)||(vt&&jt===e?hr():(Et(e),vt||Yn({type:"setUi",ui:{leftSideBarVisible:!0}})))},yr=()=>{O(Ne,{accept:"image/*",title:"Media library"})},kr=()=>{no(U),kt.select(null),u()},Sr=()=>{no(it??U),xt||Yn({type:"setUi",ui:{rightSideBarVisible:!0}})},vr=Jn.data.content??[],xr=()=>{const e=vr.findIndex(lt),n=vr.findIndex(st);return{floor:e>=0?e+1:0,cap:n>=0?n:vr.length}},br=_n,wr=xo.stripCopy,zr=e=>i(e,wr),Cr=b(),Or=Ie({data:Jn.data,config:br,readOnly:Boolean(Dn),clipboard:Cr,strip:wr?e=>wr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==dn||e.slot!==cn)return{min:0,max:n-1};const{floor:t,cap:o}=xr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&no(U);const t=void 0===n||"node"===n?.kind?n:null;kt.commitDocument(e,t)}}),Br=e=>_n.components[e]?.label??e,$r=gn(e=>_n.components[e]?.defaultProps??{},[_n]),Ir=e=>Io(e,"section",Br(e)),Nr=e=>l({type:e.type,props:e.props??{}},Ir(e.type),To),{nodeAddresses:Pr,zoneItems:Tr}=fn(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=de)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ce(_n,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(vr,le,0),{nodeAddresses:e,zoneItems:n}},[vr,_n]),Rr=gn(e=>Tr.get(e)??[],[Tr]),Ar=e=>{const n=Pr.get(e);return n?Rr(n.zone)[n.index]:void 0},Mr=e=>ie(xo,_n,e),jr=e=>{if(!xo.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Ar(e.slice(0,n));if(!t)return null;const o=Mr(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}},Er=(()=>{if(!q(eo))return null;const e=`${eo.nodeId}:${eo.slot}`;return jr(e)?.slot.panel===eo.kind?e:null})(),Lr=un(null);mn(()=>{const e=Lr.current;if(Lr.current=null,!Er||!q(eo))return;const n=eo.nodeId;uo(n,{scroll:e!==Er}),Fo(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[eo]);const Dr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Pr.get(e);n&&(n.zone===le?ii(n.index):Mi(n.zone,n.index,e,Ar(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Er!==i&&(Lr.current=i),go(null,r),xt||Yn({type:"setUi",ui:{rightSideBarVisible:!0}}),ri(o)},Vr=(e,n,t)=>{const o=`${e}:${n}`;if(Fo(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;Er!==o&&(Lr.current=o);go(null,{kind:t,nodeId:e,slot:n})},Hr=(e,n,t)=>{if(Dn||!xo.moveSlot)return;const o=Ar(e),r=o?Mr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:$n,index:n},s=Qe(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=xo.moveSlot(e,n,s);"string"==typeof d&&Vr(e,d,i.panel)},Fr=Po(),Wr=fn(()=>{const e=/* @__PURE__ */new Map;for(const n of Fr??[])e.set(n.slug,n.name);return e},[Fr]),Ur=e=>s(e,Br,$o.plainText,e=>Wr.get(e),$o.rowName),Gr=(e,n)=>{const t=_n.components[e.type]?.fields,o=n===le||Zi(n)?"section":"block",r=n===le&&(lt(e)||st(e)||tt(e.type)),i="block"===o?d(t):r?null:c(t);return $o.renamePropOf?$o.renamePropOf(e,o,i):i},Jr=(e,n,t,o)=>{if(!(!Dn&&jo?.zone===e&&jo.index===n))return;const r=(t,o)=>{Eo(null),o&&((e,n,t)=>{const o=Rr(e)[n];if(!o)return;const r=Gr(o,e);r&&kt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
13
|
+
return bn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":"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)},Yr=n(Z()),Qr=Yr.scope({target:Fe,siteId:Rn,docId:We}),Kr=_n,Xr=(e,n)=>n===le?Ir(e):Br(e),_r=(e,n,t)=>{const o=Yr.plan(Qr,t,Xr(t.type,e),Kr);o&&(o.changed&&kt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Zo(o.message))},qr=w({nodesIn:Rr,nodeAt:(e,n)=>Rr(e)[n]??null,labelOf:(e,n)=>n===le?Ir(e):Br(e),renamePropOf:Gr,beginRename:(e,n)=>Eo({zone:e,index:n}),history:{hasPast:Qn.hasPast,hasFuture:Qn.hasFuture,back:()=>Qn.back(),forward:()=>Qn.forward()},openAddSection:()=>{kt.select(null),pi(null)},openPageSettings:()=>{kt.select(null),no(U)},pageSettingsLabel:at.pageSettings,readOnly:Boolean(Dn),collapseAll:()=>Fo(new Set(Rr(le).map(e=>String(e.props.id)))),onPasteRefused:e=>Zo(e?at.pasteRefused({name:e.label}):"Your browser won’t let us read the clipboard — press ⌘V","error"),canPasteAt:(e,n)=>nl(e,n),menuRows:ko.menuRows,isLocked:e=>bo(e.type),duplicateBlocked:e=>wo(Jn.data,e),permits:e=>se(_n,e.type),canAddTo:Oo,nodeOps:Or,isPinned:(e,n)=>n===le&&(lt(e)||st(e)),sectionBand:xr,openAddInside:(e,n)=>{e===le?ii(n):kt.select({zone:e,index:n}),pi(null)},locate:e=>Pr.get(e)??null,rowNameOf:(e,n)=>n===le?Nr(e):Ur(e),selectAt:(e,n,t,o)=>{e===le?ii(n):Mi(e,n,t,o??"")},slotRung:e=>{const n=jr(e);return n?.slot.panel?{label:n.slot.label,select:()=>Dr(n.node,n.slot,!1)}:null},style:{held:()=>B(Qr),canCopy:e=>Yr.rows(Kr,e).some(e=>!1!==e.counted),copy:(e,n)=>Yr.copy(Qr,e,Xr(e.type,n),Kr),paste:(e,n,t)=>_r(e,n,t)},keys:Fn?{target:Wt,selected:()=>{const e=Jn.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>Cr.get(),readOnly:Boolean(Dn),onDone:({done:e,name:n})=>{"copied"===e&&Zo(at.copied({name:n}))}}:void 0},Ft),Zr=un({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});mn(()=>{Zr.current={copy:(e,n)=>Yr.copy(Qr,e,Xr(e.type,n),Kr),paste:_r,at:()=>{const e=Jn.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Rr(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Dn)}});const ei=gn(e=>{const n=$(e);if(!n)return;const t=Zr.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))},[]);mn(()=>{if(!Wt)return;const e=e=>ei(e);return Wt.addEventListener("keydown",e),()=>Wt.removeEventListener("keydown",e)},[ei,Wt]),_e(Ft,"keydown",ei);const ni=vr.map(e=>e.props.id).join("|");mn(()=>{const e=Ft?.document??null,n=Ft?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Zt(e=>e.length?[]:e);const n=vr.findIndex(st),t=n>=0?n:vr.length,o=n=>{const t=vr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(Xe)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=Bn(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Zt(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()}},[Ft,ni,Bt,cr,vt,xt,Kn?.props.id]);const ti=Ft?.document??null,oi=Ft?.window??null;mn(()=>{const e=Vt.current;if(!e||!ti||!oi)return;const n=[],t=()=>{const n=ti.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&oi.scrollTo({left:oi.scrollX,top:oi.scrollY+t,behavior:"instant"}),!0};return Vt.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[ti,oi]);const ri=e=>{ko.holdCanvasOn?ko.holdCanvasOn(e):a(e)},ii=e=>{no(U),kt.select({index:e}),ko.sectionPressed?.(vr[e]);const n=vr[e]?.props?.id;n&&ri(n)},li=e=>{const{floor:n,cap:t}=xr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Kn&&eo.kind!==it?.kind?vr.findIndex(e=>e.props.id===Kn.props.id):-1;return o(r>=0?r+1:t)},si=(e,n)=>{const{floor:t,cap:o}=xr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(kt.reorderComponent(le,e,i),kt.select({index:i}),{moved:!0,dest:i})},di=(e,n,t,o)=>{no(U),kt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),Zo(`Added “${t}” section`)},ci=(e,n)=>{const t=li(n),o=Co(e,{nodeDefaults:$r,newNodeId:fe,sectionLabel:Ir,blockIsOffered:Bo}),r=o?kt.insertNode(le,t,o):kt.insertSection(e,t);return di(t,r,Ir(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:c}of ce(_n,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Oo(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:c,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},ai=(e,n,t)=>{const o=li(t),r=kt.insertNode(le,o,n);return di(o,r,e),o},pi=e=>ui(le,e),ui=(e,n)=>{_o.current=document.activeElement??null,Pt&&(Jt.current=Yt.current,Yt.current=!1,Tt()),Kt(null===n?null:{zone:e,index:n}),Gt(!0),vt||(Jt.current=!0,Yn({type:"setUi",ui:{leftSideBarVisible:!0}}))},fi=()=>{Gt(!1),Kt(null),Jt.current&&Yn({type:"setUi",ui:{leftSideBarVisible:!1}}),Jt.current=!1},hi=(e,n,t)=>{if("section"===e.kind)kt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;kt.insertNode(n,t,zr(e.template.node))}no(U),kt.select({index:t,zone:n})},mi=(e,n)=>$o.rowName?n?lt(e)?$o.rowName(e,"section",at.header):st(e)?$o.rowName(e,"section",at.footer):tt(e.type)?$o.rowName(e,"section",Br(e.type)):Nr(e):Ur(e):n?Ir(e.type):Br(e.type),gi=e=>n=>{e()},yi=()=>ko.editPinnedSource?.(),ki=(e,n,t)=>{if(Dn)return null;const o=Rr(e)[n];return o&&!se(_n,o.type).delete?null:/* @__PURE__ */bn(Oe,{kind:"delete",label:`Delete ${t}`,onClick:()=>((e,n)=>{const t=Rr(e)[n]?.props?.id;null!=t&&Or.remove(String(t))})(e,n),children:/* @__PURE__ */bn(tn,{size:15})})},Si=e=>$o.rowPreview?.(e)||void 0,vi=e=>$o.rowMarks?.(e)??void 0,xi=(e,n,t)=>$o.rowActions?.(e,n,t)??null,bi=(e,n,t,o)=>{if(Dn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
14
|
+
return bn(Oe,{kind:"eye",label:r?`Show ${o}`:`Hide ${o}`,onClick:()=>zi(e,n,t),children:/* @__PURE__ */bn(r?on:rn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},wi=e=>{const n=Ir(vr[e]?.type??""),t=n?at.addSectionBefore({name:n}):at.addSectionHere;return xl(le,e,()=>pi(e),t)},zi=(e,n,t)=>{kt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Ci=e=>ae(_n,e),Oi=e=>ce(_n,e),Bi=e=>xo.slotsOf?Mr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Oi(e)}],$i=e=>xo.slotsOf?Bi(e).flatMap(e=>e.kids):Oi(e),Ii=e=>Boolean(xo.slotsOf)&&Mr(e).some(e=>e.rung),Ni=(e,n,t)=>null===t?void 0===n?Oo(e):Oo(e,n):Oo(e,n,t),Pi=(e,n,t)=>{const o=ue(_n,e.type,n)&&(t||$i(e).length>0||Ii(e));return{collapsible:o,folded:o&&Qo(String(e.props.id))}},Ti=(e,n,t)=>Bi(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Pi(e,r,t(e.type)).collapsible?[String(e.props.id),...Ti(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ri=e=>$i(e).length>0||Ii(e)||Boolean(Oo(e.type)),Ai=e=>Boolean(Oo(e)),Mi=(e,n,t,o)=>{if(no(U),Oo(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),kt.select({index:n,zone:e}),a(t)}else kt.select({index:n,zone:e}),ri(t)},ji=(e,n,t,o,r)=>{const i=`${e}:${n}`;kt.insertComponent(i,t,o),Oo(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),kt.select({index:o,zone:i})}):kt.select({index:o,zone:i})},Ei=(e,n,t)=>{kt.insertComponent(e,n,t),no(U),kt.select({index:t,zone:e})},Li=un(/* @__PURE__ */new Set);mn(()=>{vr.forEach(e=>{const n=Oo(e.type)?.spec;if(!n)return;const t=e.props.id;if(Li.current.has(t))return;Li.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($r)).forEach((e,t)=>mt.seedChild(o,t,n.childType,e))})},[vr,mt,$r]);const Di=un(/* @__PURE__ */new Set);mn(()=>{vr.forEach((n,t)=>{const o=n.props.id;if(Di.current.has(o))return;const r=e(n,Ci(n.type));Di.current.add(o),r&&mt.replaceComponent(le,t,{...n,props:r})})},[vr,mt]),ee(mt,_n);const Vi=vr.findIndex(st),Hi=Vi>=0?vr[Vi]:null,Fi=dt?vr.findIndex(lt):-1,Wi=Fi>=0?vr[Fi]:null,Ui=vr.find(e=>e.type===et)??null,Gi=vr.find(e=>e.type===nt)??null,Ji=Vi>=0?Vi:vr.length,Yi=[];vr.forEach(e=>{st(e)||(Ri(e)&&Yi.push(String(e.props.id)),Yi.push(...Ti(e,1,Ai)))}),Hi&&(Yi.push(String(Hi.props.id)),Yi.push(...Ti(Hi,1,Ai)));const Qi=Yi.length>0&&Yi.every(e=>Ho.has(e)),Ki=e=>{const n=$o.blockRowName(e,Br);return $o.rowName?$o.rowName(e,"block",n):n},Xi=(e,n,t,o)=>{const r=Rr(e)[t];if(!r)return;const i={...an(e),index:t},l={...an(n),index:Math.min(Math.max(o,0),Rr(n).length)},s=Qe(i,l);if(e!==n||s!==t)try{Or.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof pn))throw e}},_i=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Oi(e))n.add(r),t(o)};for(const t of Ci(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},qi=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Pr.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Zi=e=>{const n=e.slice(0,e.indexOf(":")),t=vr.find(e=>tt(e.type)&&String(e.props.id)===n);return t&&ot(n)===e?t:null},el=(e,n,t)=>{if(e.rung){const t=Ar(e.rung.nodeId),o=t?Mr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===$n&&n.index>=0&&n.index<=o}if(n.slot===$n)return!1;if(e.add)return ol(e.add,n);const o=sn(n);if(tt(e.type))return!1;const r=Zi(o),i=Zi(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Rr(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=xr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Rr(o).length)return!1;if(e.zone===o)return!0;const l=Hi&&!qn.lastIsOpen?String(Hi.props.id):null;return(!l||qi(e.zone)!==l&&qi(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Rr(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Pr.get(i),s=l?Rr(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&_i(r).has(n))return!1;const d=Oo(s.type,zo(Jn?.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?.(Rr(n),r))})(e.zone,o,e.index,t)},nl=(e,n)=>{const t=sn(e.from);if(t===sn(n))return!0;const o=e.node;return el({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},tl=e=>{const n=e.slice(0,e.indexOf(":")),t=Pr.get(n),o=t?Rr(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Oo(o.type,zo(Jn?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:Br(r.spec.childType)}]:[]),l=jr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:mi(o,t.zone===le)}},ol=(e,n)=>{const t=sn(n);if("block"!==e.kind){if(Zi(t))return n.index>=0&&n.index<=Rr(t).length;if(t!==le)return!1;const{floor:e,cap:o}=xr();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=tl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Rr(t))},rl=(e,n)=>{e.rung?Hr(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&Zi(sn(n)))return void hi(e,sn(n),n.index);if("section"===e.kind)return void ci(e.type,n.index);if("template"===e.kind)return void ai(e.template.name,zr(e.template.node),n.index);const t=sn(n),o=tl(t);o&&(o.target.spec?ji(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ei(t,e.type,n.index))})(e.add,n):e.zone===le?si(e.index,n.index):Xi(e.zone,sn(n),e.index,n.index)},[il]=hn(()=>Je()),ll=Ye({keyOf:e=>e.id,readOnly:Boolean(Dn),session:il,canDrop:el,onDrop:rl,onStep:(e,n)=>{e.rung?Hr(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=Ir(vr[e]?.type??""),o=si(e,n<0?e-1:e+2);if(!o.moved)return void Zo(`“${t}” is already ${n<0?"first":"last"}`);const{floor:r,cap:i}=xr();Zo(`Moved “${t}” to position ${o.dest-r+1} of ${i-r}`)})(e.index,n):Xi(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),sl=gn(e=>{const{floor:n,cap:t}=xr(),o=[];for(const r of e.nodes){const e=sn(r.place),i=Rr(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(lt(i)||st(i)||bo(i.type))continue;if(tt(i.type))continue;const l=Boolean(Zi(e)),s=e===le||l;e===le&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?Ir(i.type):Ur(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(tl(sn(e.list))?.choices.length)||Boolean(Zi(sn(e.list))))}},[Jn.data]),dl=e=>{no(U),kt.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},cl=ne(),al=()=>({data:Jn.data,device:Bt,ops:kt,inspector:yo}),pl=cl?.model,ul=fn(()=>pl?e=>pl(e,sl(e),al()):sl,[pl,sl,Bt]),fl=cl?.measure,hl=fl?(e,n)=>fl(e,n,al()):void 0,ml=cl?.canDrop,gl=ml?(e,n)=>ml(e,n,el,al()):el,yl=cl?.drop,kl=yl?(e,n)=>yl(e,n,rl,al()):rl,Sl=cl?.pick,vl=Sl?e=>Sl(e,dl,al()):dl,xl=(e,n,t,o)=>/* @__PURE__ */bn(Be,{...Dn?{}:ll.seam({place:{...an(e),index:n}}),onAdd:Dn?void 0:t,label:o},`seam:${e}:${n}`),bl={rowClick:gi,isCollapsed:Qo,toggleCollapse:Ko},wl=e=>{const n=String(e.props.id),t=vr.findIndex(e=>String(e.props.id)===n),o=ot(n),r=Rr(o),i=Qo(n),l=Br(e.type),s=$o.rowName?$o.rowName(e,"section",l):l,d=e=>xl(o,e,()=>ui(o,e),at.addSectionHere);/* @__PURE__ */
|
|
15
15
|
return wn(zn,{children:[
|
|
16
|
-
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(
|
|
16
|
+
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:e.type,size:13}),name:s,preview:Si(e),marks:vi(e),onSelect:()=>ii(t),nameSlot:Jr(le,t,n,s),selected:so===n,actions:xi(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:gi(()=>ii(t))},fold:{open:!i,label:"section",onToggle:()=>Ko(n)}}),!i&&/* @__PURE__ */wn(we,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Nr(n),l=Ri(n),s=l&&Qo(r),c=()=>Mi(o,t,r,e.type),{rowProps:a,...p}=ll.row({item:{id:r,zone:o,index:t,type:n.type},place:{...an(o),index:t}},{"data-node-id":r,onClick:gi(c)});/* @__PURE__ */
|
|
17
17
|
return wn(kn,{children:[d(t),
|
|
18
|
-
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(
|
|
18
|
+
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:n.type,size:13}),name:i,preview:Si(n),marks:vi(n),onSelect:c,nameSlot:Jr(o,t,r,i),selected:so===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Ko(r)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[ki(o,t,i),xi(n,o,t),bi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */bn(we,{children:Ol(n,2)})]},r)}),d(r.length)]})]})},zl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ll.dragging,d=!Qo(l)&&s?.rung?.nodeId!==i,c={...an(l),index:0},a=s&&!s.rung&&el(s,c)?c:void 0,p=()=>Dr(e,n,!0),{rowProps:u,...f}=ll.row({item:{id:`rung:${l}`,zone:`${i}:${$n}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:$n,index:t},into:a,canDrag:Boolean(xo.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:gi(p)}),h=Dn?null:xo.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
19
19
|
return wn(kn,{children:[n.heading,
|
|
20
|
-
/* @__PURE__ */bn(be,{icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:
|
|
21
|
-
return bn(zn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=
|
|
20
|
+
/* @__PURE__ */bn(be,{icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Er===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Ko(l)},actions:h&&h.length>0?/* @__PURE__ */bn(zn,{children:h.map((t,o)=>/* @__PURE__ */bn(Oe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Dn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Vr(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__ */bn(tn,{size:15}):/* @__PURE__ */bn(ln,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */bn(we,{children:r})]},l)},Cl=(e,n)=>{const t=Bi(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
21
|
+
return bn(zn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Ni(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(tl(c)?.choices.length),p=(e,n)=>a?xl(e,n,()=>ui(e,n),"Add block here"):xl(e,n),u=/* @__PURE__ */wn(zn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=so===String(n.props.id),{collapsible:i,folded:s}=Pi(n,l,Ai(n.type)),d=String(n.props.id),c=Ki(n),a=()=>Mi(t,o,d,e.type),{rowProps:u,...f}=ll.row({item:{id:d,zone:t,index:o,type:n.type},place:{...an(t),index:o}},{"data-node-id":d,onClick:gi(a)});/* @__PURE__ */
|
|
22
22
|
return wn(kn,{children:[0===o&&p(t,0),
|
|
23
|
-
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(
|
|
24
|
-
return bn(zn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=
|
|
23
|
+
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:n.type,size:13}),name:c,preview:Si(n),marks:vi(n),onSelect:a,nameSlot:Jr(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Ko(d)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[ki(t,o,c),xi(n,t,o),bi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */bn(we,{children:Cl(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?zl(e,t.rung,r++,o,u):/* @__PURE__ */bn(kn,{children:u},t.slot??"")})})},Ol=(e,n)=>{const t=zo(Jn?.data,e.type,String(e.props.id)),o=Bi(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
24
|
+
return bn(zn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Ni(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>ji(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>ui(n,t):void 0;return xl(n,t,o,n===f&&c?c.addLabel:"Add block here")},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */wn(zn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=so===String(n.props.id),i=Ur(n),l=String(n.props.id),{collapsible:d,folded:c}=Pi(n,s,Ai(n.type)),a=Ci(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...an(p),index:Rr(p).length}:void 0,f=ll.dragging,h=u&&f&&el(f,u)?u:void 0,g=()=>Mi(t,o,l,e.type),{rowProps:y,...k}=ll.row({item:{id:l,zone:t,index:o,type:n.type},place:{...an(t),index:o},into:h,canDrag:!bo(n.type)},{"data-node-id":l,onClick:gi(g)});/* @__PURE__ */
|
|
25
25
|
return wn(kn,{children:[0===o&&m(t,0),
|
|
26
|
-
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(
|
|
27
|
-
/* @__PURE__ */bn(
|
|
26
|
+
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:n.type,size:13}),name:i,preview:Si(n),marks:vi(n),onSelect:g,nameSlot:Jr(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Ko(l)}:void 0,actions:bo(n.type)?xi(n,t,o)??void 0:/* @__PURE__ */wn(zn,{children:[ki(t,o,i),xi(n,t,o),bi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */bn(we,{children:Ol(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
|
|
27
|
+
/* @__PURE__ */bn(I,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>ji(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?zl(e,o.rung,i++,r,k):/* @__PURE__ */bn(kn,{children:k},o.slot??"")})})},Bl=(()=>{if(!Kn||!to)return null;const e=String(Kn.type),n=String(Kn.props.id),t=Oo(e,zo(Jn?.data,e,n));if(!t||"footer"===t.source)return null;const o=vr.some(e=>String(e.props?.id)===n),r=Array.isArray(Kn.props[t.slot])?Kn.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Br(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:mi(Kn,o),choices:i,onPick:o=>{t.spec?ji(n,t.slot,o,r.length,e):Ei(`${n}:${t.slot}`,o,r.length)}}})(),$l=io&&io.zone!==le&&!Zi(io.zone)?io.zone:null,Il=!0===Xt.blocksFirst,Nl=$l?tl($l):Il&&io?null:Bl,Pl=Boolean(Qt&&$l)||Il&&Boolean(Nl&&Nl.choices.length>0),Tl=Ut||null!==Pt,Rl=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:vt&&!Tl&&vo===e.id,onSelect:()=>gr(e.id)}:e,Al=[{id:"add",label:at.add.title,icon:/* @__PURE__ */bn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Ut,onSelect:()=>Ut?fi():pi(null)},...(ko.railLead??[]).map(Rl),{id:"sections",label:"Layers",icon:/* @__PURE__ */bn(qe,{}),active:vt&&!Tl&&"sections"===vo,onSelect:()=>gr("sections")},...(ko.railTrail??[]).map(Rl)];Nt?Al.push({id:"media",label:at.railMedia,icon:/* @__PURE__ */bn(Ze,{}),active:vt&&!Ut&&(null!==Pt||"media"===vo),onSelect:()=>gr("media")}):Wn&&Al.push({id:"media",label:at.railMedia,icon:/* @__PURE__ */bn(Ze,{}),onSelect:yr});const Ml=[...ko.railLead??[],...ko.railTrail??[]].find(e=>"panel"in e&&e.id===vo),jl=Boolean(ct?.foldable)&&!So,El=ct?.label??(Un?at.pageSections:at.templateSections),Ll=jl&&Qo(In),Dl=/* @__PURE__ */wn(zn,{children:[vr.map((e,n)=>{if(lt(e)||st(e)||tt(e.type))return null;const t=so===String(e.props.id),o=Boolean(e.props._hidden);Oi(e);const r=String(e.props.id),i=ko.hasOwnRows?.(e)??!1,l=Ri(e)||i,s=l&&Qo(r),{rowProps:d,...c}=ll.row({item:{id:r,zone:le,index:n,type:e.type},place:{...an(le),index:n}},{"data-node-id":r,onClick:gi(()=>ii(n))});/* @__PURE__ */
|
|
28
28
|
return wn(kn,{children:[n>0&&wi(n),
|
|
29
|
-
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(
|
|
29
|
+
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:e.type,size:13}),name:Nr(e),preview:Si(e),marks:vi(e),onSelect:()=>ii(n),nameSlot:Jr(le,n,r,Nr(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>Ko(r)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[ki(le,n,Nr(e)),xi(e,le,n),bi(le,n,e,Nr(e))]}),rowProps:d}),Ri(e)&&!s&&/* @__PURE__ */wn(we,{children:[Ol(e,1),ko.partRows?.(e,bl)]}),i&&!s&&/* @__PURE__ */bn(we,{children:ko.ownRows?.(e,n,bl)})]},String(e.props.id??n))}),!So&&Ji>0&&wi(Ji),ct?.addAtEnd&&!So&&!Dn&&/* @__PURE__ */bn(I,{small:!0,label:at.addSection,blocked:null,onAdd:()=>pi(Ji)})]}),Vl=(e,n,t)=>{const o=String(e.props.id),r=$i(e).length>0||Ii(e)||Boolean(Oo(e.type)),i=r&&Qo(o),l="header"===t?at.header:at.footer,s=$o.rowName?$o.rowName(e,"section",l):l;/* @__PURE__ */
|
|
30
30
|
return wn(zn,{children:[
|
|
31
|
-
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(
|
|
32
|
-
/* @__PURE__ */bn(te,{target:Ft,children:/* @__PURE__ */wn("div",{ref:Ht,className:"sf-editor es-editor",style:He(Wo),onContextMenu:qr.onEditorContextMenu,...m(
|
|
33
|
-
/* @__PURE__ */wn(Te,{children:[
|
|
34
|
-
/* @__PURE__ */bn(Re,{items:Al,ariaLabel:"Left panel views"}),
|
|
31
|
+
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:t,size:13}),name:s,preview:Si(e),marks:vi(e),onSelect:()=>ii(n),nameSlot:Jr(le,n,o,s),selected:so===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Ko(o)}:void 0,actions:xi(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:gi(()=>ii(n))}}),r&&!i&&/* @__PURE__ */bn(we,{children:Cl(e,1)})]})};return(ko.wrap??(e=>e))(
|
|
32
|
+
/* @__PURE__ */bn(te,{target:Ft,children:/* @__PURE__ */wn("div",{ref:Ht,className:"sf-editor es-editor",style:He(Wo),onContextMenu:qr.onEditorContextMenu,...m(Ne),children:[
|
|
35
33
|
/* @__PURE__ */wn(Pe,{children:[
|
|
34
|
+
/* @__PURE__ */bn(Te,{items:Al,ariaLabel:"Left panel views"}),
|
|
35
|
+
/* @__PURE__ */wn(Re,{children:[
|
|
36
36
|
/* @__PURE__ */bn(Ae,{label:"Undo",disabled:Boolean(Dn)||!Qn.hasPast,onClick:()=>Qn.back(),children:/* @__PURE__ */bn(en,{})}),
|
|
37
37
|
/* @__PURE__ */bn(Ae,{label:"Redo",disabled:Boolean(Dn)||!Qn.hasFuture,onClick:()=>Qn.forward(),children:/* @__PURE__ */bn(nn,{})}),
|
|
38
38
|
/* @__PURE__ */bn(Me,{}),
|
|
39
|
-
/* @__PURE__ */bn(je,{devices:bt,value:
|
|
40
|
-
/* @__PURE__ */wn(
|
|
41
|
-
/* @__PURE__ */bn(Cn,{saveState:Mn,notSaving:Boolean(Dn)||null!=jn,readOnlyReason:Vn,toggle:Hn,onToggle:
|
|
42
|
-
/* @__PURE__ */bn(Sn,{content:"Refresh the preview (reloads the canvas, keeps your place)",side:"bottom",children:/* @__PURE__ */bn(vn,{variant:"secondary",onClick:()=>{Vt.current=(()=>{const e=Ft?.document;if(!e)return null;const n=vr.findIndex(st),t=n>=0?n:vr.length;let o=null;for(let n=0;n<t;n++){const t=vr[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=Kn?.props?.id??vr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Dt(e=>e+1)},children:"Refresh"})}),ko.barTrail?.(),ko.barMain?ko.barMain():/* @__PURE__ */bn(vn,{variant:"primary",disabled:null!==Vn,onClick:()=>{An(
|
|
39
|
+
/* @__PURE__ */bn(je,{devices:bt,value:Bt,onChange:$t})]}),
|
|
40
|
+
/* @__PURE__ */wn(Re,{kind:"right",style:{minWidth:300},children:[
|
|
41
|
+
/* @__PURE__ */bn(Cn,{saveState:Mn,notSaving:Boolean(Dn)||null!=jn,readOnlyReason:Vn,toggle:Hn,onToggle:Ln,onRetry:En}),ko.barLead?.(),
|
|
42
|
+
/* @__PURE__ */bn(Sn,{content:"Refresh the preview (reloads the canvas, keeps your place)",side:"bottom",children:/* @__PURE__ */bn(vn,{variant:"secondary",onClick:()=>{Vt.current=(()=>{const e=Ft?.document;if(!e)return null;const n=vr.findIndex(st),t=n>=0?n:vr.length;let o=null;for(let n=0;n<t;n++){const t=vr[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=Kn?.props?.id??vr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Dt(e=>e+1)},children:"Refresh"})}),ko.barTrail?.(),ko.barMain?ko.barMain():/* @__PURE__ */bn(vn,{variant:"primary",disabled:null!==Vn,onClick:()=>{An(Jn.data)},children:at.done})]})]}),
|
|
43
43
|
/* @__PURE__ */bn(z,{}),
|
|
44
44
|
/* @__PURE__ */wn("div",{className:"sf-body",children:[vt?/* @__PURE__ */wn(zn,{children:[
|
|
45
|
-
/* @__PURE__ */bn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":at.leftPanel,children:Ut?/* @__PURE__ */bn(
|
|
46
|
-
/* @__PURE__ */bn(
|
|
47
|
-
/* @__PURE__ */bn(
|
|
45
|
+
/* @__PURE__ */bn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":at.leftPanel,children:Ut?/* @__PURE__ */bn(N,{blocks:Nl,blocksOnly:Pl,at:Qt?{label:(e=>{const n=Zi(e.zone);if(n)return at.add.addingTo({name:$o.rowName?mi(n,!0):Br(n.type)});if(e.zone===le){const n=vr[e.index];return n&&!st(n)?at.add.addingBefore({name:mi(n,!0)}):at.add.addingAtEnd}const t=tl(e.zone);return t?at.add.addingTo({name:t.parentName}):at.add.addingHere})(Qt),onClear:()=>Kt(null)}:void 0,onAdd:e=>{const n=io,t=(e,n)=>{Qt&&Kt({zone:e,index:n})};if(n&&"block"!==e.kind&&Zi(n.zone))return hi(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===lo)return void ci(e);const n=ci(e,lo);Qt&&_t(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===lo)return void ai(e,n);const t=ai(e,n,lo);Qt&&_t(t+1)})(e.template.name,zr(e.template.node));if(n&&n.zone!==le){const o=tl(n.zone);if(!o)return;return o.target.spec?ji(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ei(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Bl?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:il,siteWide:ko.addPanelRow?.(fi),onClose:fi,onHide:hr,readOnly:Boolean(Dn)}):Pt&&It?
|
|
46
|
+
/* @__PURE__ */bn(R,{panel:It,pick:Pt,onHide:hr}):Ml?Ml.panel({onHide:hr,notify:Zo}):"media"===vo&&It?/* @__PURE__ */bn(R,{panel:It,pick:null,onHide:hr}):/* @__PURE__ */wn(zn,{children:[
|
|
47
|
+
/* @__PURE__ */bn(P,{icon:/* @__PURE__ */bn(qe,{}),title:"Layers",context:pt,actions:Yi.length>0?/* @__PURE__ */bn(Ee,{label:Qi?"Expand all sections":"Collapse all sections",onClick:()=>Fo(e=>{const n=new Set(Yi);return Qi?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Yi])}),children:/* @__PURE__ */bn(On,{expand:Qi})}):void 0,onHide:hr}),
|
|
48
48
|
/* @__PURE__ */wn(ze,{className:"sf-tree sf-scroll",children:[
|
|
49
|
-
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(
|
|
49
|
+
/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:"page",size:13}),name:at.pageSettings,onSelect:kr,selected:!Kn&&to,rowProps:{onClick:gi(kr)}}),Ui&&/* @__PURE__ */wn(zn,{children:[
|
|
50
50
|
/* @__PURE__ */bn(Ce,{children:at.header}),wl(Ui)]}),!So&&Gn&&/* @__PURE__ */wn(zn,{children:[
|
|
51
|
-
/* @__PURE__ */bn(Ce,{children:at.header}),!dt&&/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(
|
|
52
|
-
/* @__PURE__ */bn(be,{icon:null,name:
|
|
53
|
-
/* @__PURE__ */bn(
|
|
54
|
-
/* @__PURE__ */wn("div",{ref:er,className:"sf-center sf-scroll","data-sf-canvas-head":ir?"":void 0,style:{overflowX:pr?"auto":"hidden",overflowY:"hidden"},children:[ir&&/* @__PURE__ */bn("div",{ref:lr,className:"sf-canvas-head",children:/* @__PURE__ */bn(ir,{device:
|
|
55
|
-
/* @__PURE__ */bn("div",{className:"sf-frame-scaler",style:ur,children:/* @__PURE__ */bn("div",{className:"sf-frame "+(
|
|
56
|
-
/* @__PURE__ */bn(ut,{},
|
|
57
|
-
/* @__PURE__ */bn(Ge,{canvas:Ft,session:il,model:ul,measure:hl,canDrop:gl,onDrop:kl,onPick:vl,onZoneAdd:e=>{const n=sn(e),t=jr(n);t&&Dr(t.node,t.slot,!1),ui(n,0)},zoneAddLabel:at.canvasAddBlock,readOnly:Boolean(Dn),revision:
|
|
51
|
+
/* @__PURE__ */bn(Ce,{children:at.header}),!dt&&/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:"header",size:13}),name:at.header,onSelect:Sr,selected:eo.kind===it?.kind,rowProps:{onClick:gi(Sr)}})]}),!So&&Wi&&Vl(Wi,Fi,"header"),!So&&!jl&&/* @__PURE__ */bn(Ce,{children:El}),jl?/* @__PURE__ */wn(zn,{children:[
|
|
52
|
+
/* @__PURE__ */bn(be,{icon:null,name:El,fold:{open:!Ll,label:El,onToggle:()=>Ko(In)}}),!Ll&&/* @__PURE__ */bn(we,{children:Dl})]}):Dl,Gn&&/* @__PURE__ */bn(Ce,{children:at.footer}),Hi&&Vl(Hi,Vi,"footer"),!So&&!Hi&&Gn&&/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(No,{type:"footer",size:13}),name:at.footer,onSelect:yi,rowProps:{onClick:gi(yi),title:"Edit the site footer"}}),Gi&&wl(Gi),ko.treeFoot?.()]})]})}),
|
|
53
|
+
/* @__PURE__ */bn(Le,{side:"left",width:Wo.left,min:Ve,max:De,defaultWidth:k.left,label:at.resizeLeftPanel,onResize:Jo})]}):/* @__PURE__ */bn(T,{side:"left",onShow:hr}),
|
|
54
|
+
/* @__PURE__ */wn("div",{ref:er,className:"sf-center sf-scroll","data-sf-canvas-head":ir?"":void 0,style:{overflowX:pr?"auto":"hidden",overflowY:"hidden"},children:[ir&&/* @__PURE__ */bn("div",{ref:lr,className:"sf-canvas-head",children:/* @__PURE__ */bn(ir,{device:Bt})}),
|
|
55
|
+
/* @__PURE__ */bn("div",{className:"sf-frame-scaler",style:ur,children:/* @__PURE__ */bn("div",{className:"sf-frame "+(Bt===Ct?"":`sf-frame--${Bt}`),style:fr,children:/* @__PURE__ */wn("div",{className:"sf-preview-host",children:[
|
|
56
|
+
/* @__PURE__ */bn(ut,{},Lt),
|
|
57
|
+
/* @__PURE__ */bn(Ge,{canvas:Ft,session:il,model:ul,measure:hl,canDrop:gl,onDrop:kl,onPick:vl,onZoneAdd:e=>{const n=sn(e),t=jr(n);t&&Dr(t.node,t.slot,!1),ui(n,0)},zoneAddLabel:at.canvasAddBlock,readOnly:Boolean(Dn),revision:Jn.data}),qt.length>0&&/* @__PURE__ */bn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:qt.map(e=>/* @__PURE__ */wn("button",{type:"button",tabIndex:-1,className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height},onClick:()=>pi(e.index),children:[
|
|
58
58
|
/* @__PURE__ */bn("span",{className:"sf-preview-gap-line"}),
|
|
59
59
|
/* @__PURE__ */wn("span",{className:"sf-preview-gap-pill",children:[
|
|
60
60
|
/* @__PURE__ */bn("span",{className:"sf-preview-gap-plus",children:"+"}),
|
|
61
61
|
/* @__PURE__ */bn("span",{className:"sf-preview-gap-label",children:"Add section"})]})]},e.index))})]})})})]}),xt?/* @__PURE__ */wn(zn,{children:[
|
|
62
|
-
/* @__PURE__ */bn(g,{value:{selectChild:Mi,addChild:ji,childRowName:Ur,blockRowName:Ki},children:/* @__PURE__ */bn(ft,{mode:eo,onOpenWebsiteSettings:ko.openSettings??(()=>{}),onOpenSiteStyles:ko.openStyles,onSelectNode:Ao,onNotify:Zo,onHidePanel:mr,nodeActions:Kn?se(_n,Kn.type):
|
|
63
|
-
/* @__PURE__ */bn(
|
|
64
|
-
/* @__PURE__ */bn(
|
|
62
|
+
/* @__PURE__ */bn(g,{value:{selectChild:Mi,addChild:ji,childRowName:Ur,blockRowName:Ki},children:/* @__PURE__ */bn(ft,{mode:eo,onOpenWebsiteSettings:ko.openSettings??(()=>{}),onOpenSiteStyles:ko.openStyles,onSelectNode:Ao,onNotify:Zo,onHidePanel:mr,nodeActions:Kn?se(_n,Kn.type):Nn})}),
|
|
63
|
+
/* @__PURE__ */bn(Le,{side:"right",width:Wo.right,min:Ve,max:De,defaultWidth:k.right,label:"Resize settings panel",onResize:Yo})]}):
|
|
64
|
+
/* @__PURE__ */bn(T,{side:"right",onShow:mr})]}),qr.menu]})}))}export{Pn as ScreenChrome};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-
|
|
1
|
+
import{useScreenBlockRules as e}from"./chunk-FODNRCCO.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-PYCLHOSA.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,4 +1,4 @@
|
|
|
1
|
-
import{useScreenOwnerName as e}from"./chunk-
|
|
1
|
+
import{useScreenOwnerName as e}from"./chunk-FODNRCCO.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-TJ7YIRWQ.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
|
|
2
2
|
return o(r,{children:[
|
|
3
3
|
/* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-PYCLHOSA.js";import{Inspector as o}from"./chunk-
|
|
1
|
+
import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-PYCLHOSA.js";import{Inspector as o}from"./chunk-K6ELD7N5.js";import{DesktopIcon as u}from"./chunk-L5KW4HG5.js";import{createContext as i,useContext as l}from"react";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function a(n,e){const t=n,r=e,o=Object.keys(t);return o.length===Object.keys(r).length&&o.every(n=>Object.is(t[n],r[n]))}function f(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const o=e.slotsOf?.(r);return o||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function k(n,e){return n.isLast?n.isLast(e):e.type===n.last}var m={},h={},v=()=>m,g=()=>"",y=()=>null,b=()=>{},L={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(u,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},w={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},S={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function C(){/* @__PURE__ */
|
|
2
2
|
return s(t,{height:"fill"})}function P(){const{id:n,fields:e,values:t,readOnly:u,onChange:i}=r();/* @__PURE__ */
|
|
3
|
-
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(o,{fields:e,values:t,onChange:i,readOnly:u,idPrefix:n})})}var
|
|
4
|
-
return s(
|
|
5
|
-
return s(X.Provider,{value:n,children:e})}function _(){return l(X)}function nn(){return
|
|
3
|
+
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(o,{fields:e,values:t,onChange:i,readOnly:u,idPrefix:n})})}var D=i({});function G({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
+
return s(D.Provider,{value:n,children:e})}function N(){return l(D)}function x(){return(N().useOwnerName??g)()}function A(){return(N().useDocumentLabel??y)()}function B(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function I(n){return(N().useStandaloneBridges??v)(n)}function K(n,e){(N().useDocumentPass??b)(n,e)}function T(){return N().blockRules??L}function F(){return N().blockLook??O}function H(){return N().devices??j}function R(){return N().leftView??w}function W(){return N().pinned??S}function E(){return N().saveSwitch??!0}function V(n){e(!0===N().pickFollowsSelection,n)}function Y(){return N().add??h}function Q(){return N().storageNamespace||void 0}function Z(){return N().styleClipboard??null}function q(){return N().nodeKeys??!0}function z(){return N().notify??null}function J(){return N().Canvas??C}function M(){return N().CanvasHead??null}function U(){return N().canvasDrag??null}var X=i(null);function $({target:n,children:e}){/* @__PURE__ */
|
|
5
|
+
return s(X.Provider,{value:n,children:e})}function _(){return l(X)}function nn(){return N().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,G as ScreenPartsProvider,p as isPinnedFirst,k as isPinnedLast,f as isSlotMode,a as sameInspectorMode,d as screenSlotsOf,Y as useScreenAdd,F as useScreenBlockLook,T as useScreenBlockRules,B as useScreenBridges,U as useScreenCanvasDrag,J as useScreenCanvasFrame,M as useScreenCanvasHead,_ as useScreenCanvasTarget,H as useScreenDevices,A as useScreenDocumentLabel,K as useScreenDocumentPass,nn as useScreenInspectorPanel,R as useScreenLeftView,q as useScreenNodeKeys,z as useScreenNotify,x as useScreenOwnerName,N as useScreenParts,V as useScreenPickFollowsSelection,W as useScreenPinned,E as useScreenSaveSwitch,Q as useScreenStorageNamespace,Z as useScreenStyleClipboard,I as useStandaloneScreenBridges};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{FieldSelect as e}from"./chunk-PJP46U5L.js";import{TreeSeam as n}from"./chunk-UFY6RNMT.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsTabs as a,SettingsGroup as r}from"./chunk-YNOZ5NXW.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-QTLAVDJE.js";import{EaselMenuItems as s}from"./chunk-EA2HTX37.js";import{FieldNumber as c}from"./chunk-7SQF6LZL.js";import{SettingsSegmented as u}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FPOKPNO4.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as h}from"./chunk-67GNT6PF.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{ChevronIcon as g,LockIcon as f,MoveUpIcon as v,MoveDownIcon as y,DuplicateIcon as x,TrashIcon as k}from"./chunk-L5KW4HG5.js";import{Textarea as w,Input as N,SortableList as O,ListRow as C,ContextMenu as j,tabPanelId as S,tabButtonId as D,SearchableSelect as I,Select as P}from"efficient-shell/ui";import{useRef as $,useState as F,useLayoutEffect as L,useId as M}from"react";import{jsx as T,jsxs as E}from"react/jsx-runtime";function z({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:i=!1,ariaLabel:o,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */T(w,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */T(N,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function R(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function H(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function A(e,n){return e.filter((e,l)=>l!==n)}function B(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var K='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',Y={parentId:"list",slot:"items"};function G({label:e,icon:l,noun:t,items:a,onChange:r,newItem:o,summary:c,itemName:u,thumb:w,min:N=0,max:S,readOnly:D=!1,open:I,onOpen:P,renderItem:M,renderRow:z,canRemove:G,lockedReason:J,fixed:Q=!1,removeOnRow:W=!0,canDuplicate:U,above:V,head:X=!0}){const Z=m("fields",d).list,q=m("tree",i),_=t??Z.item,ee=!D&&!Q&&("number"!=typeof S||a.length<S),ne=a.length<=N,le=e=>!!G&&!G(a[e],e),te=e=>!D&&!Q&&W&&!ne&&!le(e),ae=e=>ee&&(!U||U(a[e],e)),re=(e,n)=>u?u(e,n):Z.itemName({noun:_,n:n+1}),ie=$([]),oe=$(null),[se,ce]=F(null),ue=$(null),[de,me]=F(null),[pe,he]=F("");L(()=>{const e=oe.current;if(!e)return;oe.current=null;const n=ie.current[e.index]?.querySelectorAll(K)[e.nth]??ie.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const be=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=ie.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(K)].indexOf(t),a=t;oe.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}r(H(a,e,n));const i=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}(I,e,n);i!==I&&P(i),he(Z.moved({n:n+1,total:a.length}))},ge=e=>{ee&&(r(R(a,e,o())),z?(oe.current={index:e,nth:0,start:null,end:null},null!==I&&I>=e&&P(I+1)):P(e))},fe=e=>{te(e)&&(r(A(a,e)),I===e?P(null):null!==I&&I>e&&P(I-1))},ve=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===Y.parentId&&n.slot===Y.slot,onDrop:(e,n)=>{const l=h({...Y,index:e},n);l!==e&&be(e,l)},onStep:(e,n)=>be(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:D}),ye=e=>{const n=[];return e>0&&n.push({label:Z.moveUp,icon:/* @__PURE__ */T(v,{size:14}),shortcut:"⌥↑",onClick:()=>be(e,e-1)}),e<a.length-1&&n.push({label:Z.moveDown,icon:/* @__PURE__ */T(y,{size:14}),shortcut:"⌥↓",onClick:()=>be(e,e+1)}),ae(e)&&n.push({label:Z.duplicate,icon:/* @__PURE__ */T(x,{size:14}),onClick:()=>(e=>{ae(e)&&(r(R(a,e+1,B(a[e]))),null!==I&&I>e&&P(I+1))})(e)}),te(e)&&n.push({label:Z.delete,icon:/* @__PURE__ */T(k,{size:14}),danger:!0,onClick:()=>fe(e)}),n},xe=(e,n,l,t)=>{D||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},ke=e=>n=>{const l=a.slice();l[e]=n,r(l)};/* @__PURE__ */
|
|
2
|
+
return E("div",{className:"es-list",children:[X?/* @__PURE__ */E("div",{className:"es-list-head",children:[
|
|
3
|
+
/* @__PURE__ */E("span",{className:"es-list-label",children:[l?/* @__PURE__ */T("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,e]}),
|
|
4
|
+
/* @__PURE__ */T("span",{className:"es-list-count",children:a.length})]}):null,V?/* @__PURE__ */T("div",{className:"es-list-above",children:V}):null,a.length?/* @__PURE__ */E(O,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((e,l)=>{const t=ve.row({item:l,place:{...Y,index:l}}),a=t.draggable&&se!==l,r=!z&&I===l,i=!D&&!Q&&W&&le(l),o=["es-list-row",z?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */T(n,{...ve.seam({place:{...Y,index:l}}),onAdd:ee?()=>ge(l):void 0,label:Z.addHere({noun:_})},`seam-${l}`):null,
|
|
5
|
+
/* @__PURE__ */T(C,{className:o,flat:!!z,active:r,draggable:t.draggable,dragHint:q.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>be(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{ie.current[l]=e},rowProps:{...t.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,ue.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=ue.current;ue.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{D||(e.preventDefault(),e.stopPropagation(),xe(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void xe(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:D||Q||!W?void 0:i?b(J?J(e,l):Z.locked,/* @__PURE__ */T("span",{className:"es-list-lock",role:"img","aria-label":J?J(e,l):Z.locked,children:/* @__PURE__ */T(f,{size:13})})):b(Z.deleteItem({noun:_}),/* @__PURE__ */T("button",{type:"button",className:"es-list-x","aria-label":Z.deleteItem({noun:_}),disabled:!te(l),onClick:()=>fe(l),children:"×"})),below:r?/* @__PURE__ */T("div",{className:"es-list-item",children:M(e,l,ke(l))}):void 0,children:z?/* @__PURE__ */T("div",{className:"es-list-row-main",children:z(e,l,ke(l))}):/* @__PURE__ */E("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>P(r?null:l),children:[w?/* @__PURE__ */T("span",{className:"es-list-thumb","aria-hidden":"true",children:w(e,l)}):null,
|
|
6
|
+
/* @__PURE__ */T("span",{className:"es-list-row-name",children:re(e,l)}),/* @__PURE__ */T("span",c?{className:"es-list-row-summary",children:c(e,l)}:{className:"es-list-row-summary"}),
|
|
7
|
+
/* @__PURE__ */T(g,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
|
|
8
|
+
/* @__PURE__ */T(n,{...ve.seam({place:{...Y,index:a.length}})})]}):null,D||Q?null:/* @__PURE__ */T("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>ge(a.length),children:Z.add({noun:_})}),
|
|
9
|
+
/* @__PURE__ */T("span",{className:"es-list-said","aria-live":"polite",children:pe}),de&&de.index<a.length?
|
|
10
|
+
/* @__PURE__ */T(j,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>me(null),children:/* @__PURE__ */T(s,{items:ye(de.index),onClose:()=>me(null)})}):null]})}var J=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function Q({field:e,name:n,id:l,value:t,onChange:a,readOnly:i,context:o,renderers:s}){const[c,u]=F(!0),d=t&&"object"==typeof t?t:{};/* @__PURE__ */
|
|
11
|
+
return T(r,{id:`${l}-group`,title:J(e,n),open:c,onToggle:u,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */T(U,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:d[e],onChange:n=>a({...d,[e]:n}),readOnly:i,context:o,renderers:s},e))})}function W({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:i,renderers:o,openItem:s,onOpenItem:c}){const[u,d]=F(null),m=c?s??null:u,p=c??d,h=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
|
|
12
|
+
return T(G,{label:J(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>B({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:m,onOpen:p,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */T(U,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:i,renderers:o},e))})}function U(n){const{field:t,name:a,id:r,value:i,onChange:o,readOnly:s,context:d,renderers:m}=n;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:i,onChange:o,readOnly:s});switch(t.type){case"custom":{const e={...d,field:t,name:a,id:r,value:i,onChange:o,readOnly:s};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
13
|
+
return T(l,{label:J(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */T(z,{id:r,value:"string"==typeof i?i:null==i?"":String(i),onChange:o,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:s})});case"number":/* @__PURE__ */
|
|
14
|
+
return T(l,{label:J(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */T(c,{id:r,value:"number"==typeof i?i:void 0,onChange:o,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:s})});case"select":{const n=`${r}-label`;/* @__PURE__ */
|
|
15
|
+
return T(l,{label:J(t,a),labelId:n,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */T(e,{id:r,value:i,options:t.options,onChange:o,readOnly:s,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
|
|
16
|
+
return T(l,{label:J(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */T(u,{ariaLabel:J(t,a),value:i,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||s})),onChange:e=>{s||o(e)}})});case"object":/* @__PURE__ */
|
|
17
|
+
return T(Q,{...n,field:t});case"array":/* @__PURE__ */
|
|
18
|
+
return T(W,{...n,field:t});case"slot":return null}}var V=e=>t.includes(e);function X(e){let n=t[0];const l=[],a=/* @__PURE__ */new Set;for(const[t,r]of Object.entries(e))r&&(V(r.bucket)&&(n=r.bucket),r.marker||!1===r.visible||(l.push({name:t,field:r,bucket:n}),"slot"!==r.type&&a.add(n)));return{rows:l,buckets:t.filter(e=>a.has(e))}}function Z(e){return new Map(X(e).rows.map(e=>[e.name,e.bucket]))}function q({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:u,renderers:d,idPrefix:p,ariaLabel:h,children:b}){const g=m("panel",o),f=M(),v=p??`es-insp${f.replace(/:/g,"")}`,y=X(e),[x,k]=F(void 0),w=i??x,N=w&&y.buckets.includes(w)?w:y.buckets[0],[O,C]=F(null),j=O&&O.panel===v&&y.rows.some(e=>e.name===O.name)?O:null,I=c&&y.buckets.length>1,P=I&&N?S(v,N):`${v}-rows`;/* @__PURE__ */
|
|
19
|
+
return E("div",{className:"es-insp",children:[I?/* @__PURE__ */T("div",{className:"es-insp-tabs",children:/* @__PURE__ */T(a,{ariaLabel:h??g.settings,activeId:N,onSelect:e=>{const n=e;void 0===i&&k(n),s?.(n)},items:y.buckets.map(e=>({id:e,label:g.buckets[e],icon:u?.[e]})),idPrefix:v})}):null,
|
|
20
|
+
/* @__PURE__ */E("div",{className:"es-insp-rows",id:P,role:I?"tabpanel":void 0,"aria-labelledby":I&&N?D(v,N):void 0,children:[y.rows.map(({name:e,field:a,bucket:i})=>/* @__PURE__ */T("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!I||i===N)||void 0,children:/* @__PURE__ */T(U,{field:a,name:e,id:`${v}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:d,openItem:j&&j.name===e?j.index:null,onOpenItem:n=>C(null===n?null:{panel:v,name:e,index:n})})},e)),b]})]})}function _(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}function ee({value:e,onChange:n,kinds:l,rules:t,filtersFor:a,label:r,readOnly:i}){const o=m("fields",d).link??d.link,[s,c]=F(null),[u,p]=F(null),h=s&&s.against===e?s.kind:t.kindOf(e),b=l.filter(e=>!e.hideWhenEmpty||_(e.target).length>0||e.value===h),g=b.find(e=>"text"===e.target.type),f=b.find(e=>e.value===h)??g??b[0];if(!f)return null;const v="text"!==f.target.type,y=v?t.targetOf(e):e,x=_(f.target),k=x.find(e=>e.value===y),w=e=>({value:e,label:o.unavailable({value:e})}),O="select"===f.target.type&&y&&a?a(y):null,C=O?t.readFilter(e):null,j=C?O?.find(e=>e.param===C.param):void 0,S=u&&u.against===e?u.text:e,D=!v&&""!==S.trim()&&!t.isSafe(S),$=(e,l)=>{c(n=>n?{...n,against:e}:n),void 0===l?n(e):n(e,l)},L=e=>{if(!e)return $("");const n=x.find(n=>n.value===e);$(e,n?.label)},M=(e,n)=>n&&!e.some(e=>e.value===n)?[w(n),...e]:[...e],z=(e,n,l,t,a)=>{const r=[];for(const e of l){const n=r[r.length-1],l={value:e.value,label:e.label};e.group?n&&"options"in n&&n.label===e.group?n.options.push(l):r.push({label:e.group,options:[l]}):r.push(l)}if(a){const a=l.some(e=>""===e.value);/* @__PURE__ */
|
|
21
|
+
return T(I,{"aria-label":e,value:n,options:r,disabled:i,clearable:a,placeholder:l.find(e=>""===e.value)?.label,onChange:t})}/* @__PURE__ */
|
|
22
|
+
return T(P,{size:"sm","aria-label":e,value:n,options:r,readOnly:i,onChange:t})};let R;if("text"===f.target.type)R=/* @__PURE__ */T(N,{size:"sm",type:"text",className:"es-fin",invalid:D,"aria-label":o.address,placeholder:o.addressPlaceholder,value:S,readOnly:i,onChange:n=>(n=>{const l=n.trim();l?t.isSafe(n)?(p({text:n,against:l}),$(l)):p({text:n,against:e}):(p({text:n,against:""}),$(""))})(n.target.value)});else{const e="groups"===f.target.type?f.target.groups.flatMap(e=>e.options.map(n=>({value:n.value,label:n.label,group:e.label}))):f.target.options.map(e=>({value:e.value,label:e.label})),n=[{value:"",label:f.target.placeholder},...M(e,y)];R=z(f.label,y,n,L,e.length>10)}/* @__PURE__ */
|
|
23
|
+
return E("div",{className:"es-flink",role:r?"group":void 0,"aria-label":r,children:[z(o.linkType,f.value,b.map(e=>({value:e.value,label:e.label})),l=>{p(null);const t=b.find(e=>e.value===l);if(!t||"text"===t.target.type)return void c({kind:l,against:e});const a=_(t.target)[0];c({kind:l,against:a?a.value:""}),a?n(a.value,a.label):n("")},!1),R,O&&z(o.filter,C?.param??"",[{value:"",label:o.noFilter},...C&&!j?[w(C.param)]:[],...O.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return $(y,k?.label);const n=O?.find(n=>n.param===e),l=n?.values[0];l&&$(t.withFilter(y,{param:e,value:l.value}),l.label)},!1),O&&C&&z(o.value,C.value,M((j?.values??[]).map(e=>({value:e.value,label:e.label})),C.value),e=>{if(!C)return;const n=j?.values.find(n=>n.value===e);$(t.withFilter(y,{param:C.param,value:e}),n?.label)},(j?.values.length??0)>10),D&&/* @__PURE__ */T("p",{className:"es-flink-error",role:"alert",children:o.unsafe}),f.hint&&/* @__PURE__ */T("p",{className:"es-flink-hint",children:f.hint}),O&&/* @__PURE__ */T("p",{className:"es-flink-hint",children:o.filterHint})]})}export{z as FieldText,q as Inspector,U as InspectorField,ee as LinkPicker,G as ListField,Z as bucketsOf,B as copyItem,R as insertAt,J as labelOf,H as moveTo,X as planFields,A as removeAt};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as s}from"./chunk-
|
|
1
|
+
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as s}from"./chunk-FODNRCCO.js";import{DropdownMenu as r}from"efficient-shell/ui";import{jsxs as t,Fragment as l,jsx as i}from"react/jsx-runtime";function c({choices:c,onPick:n}){const{Icon:a}=s(),o=e(c).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */t(l,{children:[e.group," ",
|
|
2
2
|
/* @__PURE__ */i("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */i("span",{className:"sf-chip",children:/* @__PURE__ */i(a,{type:e.type,size:13})}),onSelect:()=>n(e.type)}))]);/* @__PURE__ */
|
|
3
3
|
return i(r,{align:"start",triggerClassName:"sf-add-card",items:o,trigger:/* @__PURE__ */t(l,{children:[
|
|
4
4
|
/* @__PURE__ */i("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add block"]})})}export{c as AddBlockRow};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScreenPartsProvider as t}from"./chunk-
|
|
1
|
+
import{ScreenPartsProvider as t}from"./chunk-FODNRCCO.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-PYCLHOSA.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
|
|
2
2
|
return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useSectionOps as o}from"./chunk-DCPFE4IO.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-FODNRCCO.js";import{useEasel as p}from"./chunk-PYCLHOSA.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=p(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);c(()=>{k(l)},[k,l]);const O=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(O)},[O,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:O}}export{m as usePartBridge};
|
package/dist/fields/fields.css
CHANGED
|
@@ -82,9 +82,18 @@ span:has(> .es-fnum) { display: flex; min-width: 0; }
|
|
|
82
82
|
|
|
83
83
|
/* ── a list (ListField): ONE look in both editors (owner, 2026-10-06) ────────
|
|
84
84
|
The website ticker's rows: one row per item, a × at its end, "+ Add <noun>"
|
|
85
|
-
under the last. The whole row drags
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
under the last. The whole row drags; a many-field item opens under its own
|
|
86
|
+
row. Sizes from the ticker (.sf-textlist): a 32px row, a 28 × 32 ×. Gaps are
|
|
87
|
+
the spacing scale: 8 between rows (the seam IS the gap), 4 inside.
|
|
88
|
+
|
|
89
|
+
The rows are efficient-shell's `SortableList` / `ListRow` (4.167.0, UI-24):
|
|
90
|
+
the frame, the 8px step (`spacing="comfortable"`, which a `TreeSeam` hands
|
|
91
|
+
back), the grip and its Tooltip, the drop line, the faded row being dragged,
|
|
92
|
+
the hover and open ground and the focus ring are the shell's. What is left
|
|
93
|
+
here is the list's own: its head, the row's content, the ×, the lock, the
|
|
94
|
+
open item, "+ Add". The `.es-list-row` classes stay on the shell's bar as
|
|
95
|
+
hooks (`is-inline`, `is-item`, `is-open`, `is-draggable`, `is-dragging`,
|
|
96
|
+
`is-drop-*`). */
|
|
88
97
|
|
|
89
98
|
.es-list { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-top: max(var(--es-row-gap), var(--es-rhythm-between)); }
|
|
90
99
|
.es-list-head {
|
|
@@ -99,54 +108,18 @@ span:has(> .es-fnum) { display: flex; min-width: 0; }
|
|
|
99
108
|
/* A host's bar for the row in use, between the name and the rows. */
|
|
100
109
|
.es-list-above { min-width: 0; }
|
|
101
110
|
|
|
102
|
-
/* The rows
|
|
103
|
-
`
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
/*
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
.es-list-
|
|
112
|
-
/* The
|
|
113
|
-
.es-list-rows > .es-list-gap:last-child { margin-top: -8px; }
|
|
114
|
-
.es-list-entry { display: flex; flex-direction: column; min-width: 0; }
|
|
115
|
-
|
|
116
|
-
.es-list-row {
|
|
117
|
-
position: relative;
|
|
118
|
-
display: flex;
|
|
119
|
-
align-items: center;
|
|
120
|
-
gap: 4px;
|
|
121
|
-
min-width: 0;
|
|
122
|
-
min-height: 32px;
|
|
123
|
-
border-radius: var(--es-row-radius);
|
|
124
|
-
--es-row-scrim: var(--es-panel);
|
|
125
|
-
}
|
|
126
|
-
.es-list-row.is-draggable { cursor: grab; }
|
|
127
|
-
.es-list-row.is-item { padding-left: 8px; }
|
|
128
|
-
/* A row whose own control is not a text box (a name, a picture) reads as a row. */
|
|
129
|
-
.es-list-row.is-inline:not(:has(input, textarea, [contenteditable])) { padding-left: 8px; }
|
|
130
|
-
.es-list-row.is-inline:not(:has(input, textarea, [contenteditable])):hover { --es-row-scrim: var(--es-hover); background: var(--es-row-scrim); }
|
|
131
|
-
.es-list-row.is-item:hover,
|
|
132
|
-
.es-list-row.is-open { --es-row-scrim: var(--es-hover); background: var(--es-row-scrim); }
|
|
133
|
-
.es-list-row.is-dragging { opacity: 0.4; }
|
|
111
|
+
/* The rows (the shell's `SortableList`). NOT a scroll box, and not Layers'
|
|
112
|
+
`.es-tree` (which is one): the panel around the list scrolls. Inside a
|
|
113
|
+
scroll box of its own the drag hint under the last row was clipped and the
|
|
114
|
+
list scrolled by itself under a wheel (second host, 2026-10-07). */
|
|
115
|
+
.es-list-rows { min-width: 0; }
|
|
116
|
+
|
|
117
|
+
/* A row whose own control is not a text box (a name, a picture) reads as a
|
|
118
|
+
row: the shell's bar is `flat` for every inline row, so the hover ground is
|
|
119
|
+
given back here, to the ones without a box. */
|
|
120
|
+
.es-list-row.is-inline:not(:has(input, textarea, [contenteditable])):hover { background: var(--es-hover); }
|
|
121
|
+
/* The picture that follows the pointer: the row, raised (`useTreeDrag`). */
|
|
134
122
|
.es-list-row.is-lifting { background: var(--es-raised); box-shadow: var(--rosh-glass-solid-shadow); }
|
|
135
|
-
.es-list-row:focus-visible { outline: 2px solid var(--es-accent); outline-offset: 1px; }
|
|
136
|
-
/* The one drop line, in the middle of the 8px gap — where a seam draws its own. */
|
|
137
|
-
.es-list-row.is-drop-before::before,
|
|
138
|
-
.es-list-row.is-drop-after::after {
|
|
139
|
-
content: "";
|
|
140
|
-
position: absolute;
|
|
141
|
-
left: 8px;
|
|
142
|
-
right: 8px;
|
|
143
|
-
height: 2px;
|
|
144
|
-
border-radius: var(--radius-sm);
|
|
145
|
-
background: var(--es-accent);
|
|
146
|
-
pointer-events: none;
|
|
147
|
-
}
|
|
148
|
-
.es-list-row.is-drop-before::before { top: -5px; }
|
|
149
|
-
.es-list-row.is-drop-after::after { bottom: -5px; }
|
|
150
123
|
|
|
151
124
|
/* The row's own control (renderRow): it fills the row up to the ×. */
|
|
152
125
|
.es-list-row-main { flex: 1 1 auto; min-width: 0; min-height: 32px; display: flex; align-items: center; font-size: 12px; color: var(--es-text); }
|
|
@@ -202,30 +175,6 @@ span:has(> .es-fnum) { display: flex; min-width: 0; }
|
|
|
202
175
|
color: var(--es-disabled);
|
|
203
176
|
}
|
|
204
177
|
|
|
205
|
-
/* What a draggable row says after 0.7 s on it — Layers' hint, never over a text box. */
|
|
206
|
-
.es-list-hint {
|
|
207
|
-
position: absolute;
|
|
208
|
-
left: 8px;
|
|
209
|
-
top: calc(100% + 4px);
|
|
210
|
-
z-index: 5;
|
|
211
|
-
padding: 4px 8px;
|
|
212
|
-
border-radius: var(--radius-md);
|
|
213
|
-
background: var(--es-toast-bg);
|
|
214
|
-
color: var(--es-on-accent);
|
|
215
|
-
font-size: 11px;
|
|
216
|
-
line-height: 1.3;
|
|
217
|
-
white-space: nowrap;
|
|
218
|
-
pointer-events: none;
|
|
219
|
-
opacity: 0;
|
|
220
|
-
transition: opacity 0.1s;
|
|
221
|
-
}
|
|
222
|
-
.es-list-row.is-draggable:hover:not(:has(input:hover, textarea:hover, [contenteditable]:hover)) .es-list-hint {
|
|
223
|
-
opacity: 1;
|
|
224
|
-
transition-delay: 0.7s;
|
|
225
|
-
}
|
|
226
|
-
.es-list-row.is-dragging .es-list-hint,
|
|
227
|
-
.es-list-row.is-lifting .es-list-hint { display: none; }
|
|
228
|
-
|
|
229
178
|
/* The open item, under its row: its own settings, indented on a hairline. */
|
|
230
179
|
.es-list-item {
|
|
231
180
|
display: flex;
|
package/dist/fields/index.d.ts
CHANGED
|
@@ -190,9 +190,17 @@ declare function useResolvedFields({ id, node, block, parent, appState }: Resolv
|
|
|
190
190
|
* item IN PLACE, under its row, one at a time (the owner's pick
|
|
191
191
|
* A of the 2026-10-06 mockup — the drill-in page is gone).
|
|
192
192
|
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
193
|
+
* THE ROWS ARE THE SHELL'S: `SortableList` / `ListRow` (efficient-shell
|
|
194
|
+
* 4.167.0, harness UI-24): the list and item roles, the grip on hover and
|
|
195
|
+
* focus with the drag hint in a Tooltip (Layers' grip — the toast-like hint
|
|
196
|
+
* that hung under the row is gone), the drop line, the faded row, the ×'s
|
|
197
|
+
* place at the end, the open item under its row, and the row taking the focus
|
|
198
|
+
* when nothing in it can. What stays here is the list's own behaviour.
|
|
199
|
+
*
|
|
200
|
+
* REORDER IS NEVER CUT TO FIT THE LOOK. The WHOLE ROW drags (owner,
|
|
201
|
+
* 2026-09-29; the grip marks it, it does not replace it) — a text box in it
|
|
202
|
+
* too, until the caret is in that box: from then on a press there selects
|
|
203
|
+
* text. Alt+↑ /
|
|
196
204
|
* Alt+↓ move it from the keyboard, the caret in the text box included, and the
|
|
197
205
|
* caret goes with the item. The right-click menu (or Shift+F10) offers Move up,
|
|
198
206
|
* Move down, Duplicate and Delete, and only what the row can do. The count, the
|
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-K6ELD7N5.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-PJP46U5L.js";import"../chunk-UFY6RNMT.js";import"../chunk-YNOZ5NXW.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-7SQF6LZL.js";import"../chunk-QLD57GBB.js";import"../chunk-FPOKPNO4.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-L5KW4HG5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-P3GORPR4.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FODNRCCO.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-K6ELD7N5.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-
|
|
1
|
+
export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-63GQKLJI.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-QR4DLZ3P.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FODNRCCO.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-K6ELD7N5.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-TJ7YIRWQ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-W3XX2CNW.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MediaSidePanel as default}from"../../chunk-
|
|
1
|
+
export{MediaSidePanel as default}from"../../chunk-EOUMA3QT.js";import"../../chunk-FODNRCCO.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-K6ELD7N5.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-TJ7YIRWQ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenChrome as default}from"../../chunk-
|
|
1
|
+
export{ScreenChrome as default}from"../../chunk-CG4OPQQX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-SQTY6CJD.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-PT6V53OO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-ORR3Q4WV.js";import"../../chunk-U4MJQAVH.js";import"../../chunk-DCPFE4IO.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-JLTZQ4US.js";import"../../chunk-MAEXP3KE.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-ONRYLR2D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-57DJOKXT.js";import"../../chunk-5545A3PC.js";import"../../chunk-63GQKLJI.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-QR4DLZ3P.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-EOUMA3QT.js";import"../../chunk-FODNRCCO.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-K6ELD7N5.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-2LK54I4E.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-X6DQWK2C.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-TJ7YIRWQ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-W3XX2CNW.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DocumentScreen,ScreenMount as default}from"../../chunk-
|
|
1
|
+
export{DocumentScreen,ScreenMount as default}from"../../chunk-5LGAIELC.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-THQB37AA.js";import"../../chunk-CG4OPQQX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-SQTY6CJD.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-PT6V53OO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-ORR3Q4WV.js";import"../../chunk-U4MJQAVH.js";import"../../chunk-DCPFE4IO.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-JLTZQ4US.js";import"../../chunk-MAEXP3KE.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-ONRYLR2D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-57DJOKXT.js";import"../../chunk-5545A3PC.js";import"../../chunk-63GQKLJI.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-QR4DLZ3P.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-EOUMA3QT.js";import"../../chunk-FODNRCCO.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-K6ELD7N5.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-2LK54I4E.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-X6DQWK2C.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-TJ7YIRWQ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-W3XX2CNW.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenStoreProvider as default}from"../../chunk-
|
|
1
|
+
export{ScreenStoreProvider as default}from"../../chunk-THQB37AA.js";import"../../chunk-FODNRCCO.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-K6ELD7N5.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{AddBlockRow as e}from"../../chunk-
|
|
2
|
-
return
|
|
3
|
-
return J
|
|
4
|
-
/* @__PURE__
|
|
5
|
-
return
|
|
6
|
-
/* @__PURE__
|
|
7
|
-
/* @__PURE__
|
|
8
|
-
/* @__PURE__
|
|
9
|
-
/* @__PURE__
|
|
10
|
-
/* @__PURE__
|
|
11
|
-
return J
|
|
12
|
-
/* @__PURE__
|
|
13
|
-
/* @__PURE__
|
|
14
|
-
/* @__PURE__
|
|
15
|
-
/* @__PURE__
|
|
16
|
-
/* @__PURE__
|
|
1
|
+
import{AddBlockRow as e}from"../../chunk-P3GORPR4.js";import{slotChildRowName as n}from"../../chunk-TBF5CVPA.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import{useEaselUndoKeys as t}from"../../chunk-PT6V53OO.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-ORR3Q4WV.js";import{usePartBridge as c}from"../../chunk-U4MJQAVH.js";import{useSectionOps as p}from"../../chunk-DCPFE4IO.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-ONRYLR2D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-EOUMA3QT.js";import{SELECTION_MODE as d,useScreenPinned as a,useScreenCanvasFrame as u,useScreenInspectorPanel as h,useScreenPickFollowsSelection as k,sameInspectorMode as j,useStandaloneScreenBridges as f,useScreenBlockLook as N,useScreenBlockRules as y}from"../../chunk-FODNRCCO.js";import{nestsInTree as O,slotFieldsOf as C}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as R,usePanelPick as S,useCancelPanelPick as P}from"../../chunk-R6WTQWAC.js";import{useHostEscape as x}from"../../chunk-U3JP4VGF.js";import"../../chunk-E2O2MRZR.js";import{useEasel as A}from"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-K6ELD7N5.js";import"../../chunk-PJP46U5L.js";import{LayersTree as E,Subtree as L,TreeRow as v,TreeRowAction as T,TreeSeam as D}from"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-BDTITTMW.js";import{saveIndicator as M}from"../../chunk-H6DDIBQ4.js";import{SaveState as g,panelWidthVars as z}from"../../chunk-TJ7YIRWQ.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-W3XX2CNW.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as B}from"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import{TrashIcon as W}from"../../chunk-L5KW4HG5.js";import{zoneKey as b,parseZoneKey as F}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as H,useRef as Y,useEffect as Q,useCallback as w,Fragment as J}from"react";import{Tooltip as V}from"efficient-shell/ui";import{jsxs as $,jsx as K,Fragment as X}from"react/jsx-runtime";var Z=e=>n=>{n.target.closest("button, input")||e()},G={rowClick:Z};function I(){const{saveState:I,readOnly:U,readOnlyReason:q=null}=l(),_=p(),{appState:ee,selectedItem:ne,config:oe}=A(e=>e),[re,te]=H(d),{first:se,last:ie,panelOf:ce}=a(),pe=ce(se),le=u(),me=h(),de=ee.data.content?.[0]??null,ae=de?.props.id??null,ue=de?.type===se,he=de?.type===ie,ke=Y(null),je=Y(null);t(je);const fe=R(),Ne=S(),ye=P();k(ne?.props.id),Q(()=>{const e=je.current;if(!Ne||!e)return;const n=e=>{"Escape"===e.key&&ye()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Ne]),x(null!==Ne,()=>ye()),Q(()=>{ae&&ke.current!==ae&&(ke.current=ae,ue?te(pe??d):ne||_.select({index:0}))},[ae,ne,_,ue]);const Oe=w(e=>te(n=>j(n,e)?n:e),[]),Ce=f({kind:re.kind,mode:re,open:Oe,show:e=>te(e),reveal:()=>{},select:(e,n)=>{te(e=>j(e,n)?e:n),_.select(e)}}),{selectNode:Re}=c({mode:re,setMode:te,onOpenPart:o}),Se=N(),{labelAtLevel:Pe,Icon:xe}=Se,{canAddTo:Ae}=y(),Ee=e=>oe.components[e]?.label??e,Le=e=>Pe(e,"section",Ee(e)),ve=!ue&&"puck"===re.kind&&ne?.props.id===ae,Te=de?Ae(de.type)?.spec??null:null,De=de&&Te?`${de.props.id}:${Te.slot}`:null,Me=de&&Te&&Array.isArray(de.props[Te.slot])?de.props[Te.slot]:[],ge=e=>n(e,Ee,Se.plainText),ze=(e,n)=>{de&&Te&&De&&(te(d),Te.slider?(r(String(de.props.id),e),_.select({index:e,zone:De}),o(String(de.props.id))):(_.select({index:e,zone:De}),o(n)))},Be=()=>{if(!de||!Te||!De)return;const e=Me.length;_.insertComponent(De,Te.childType,e),te(d),Te.slider?requestAnimationFrame(()=>{r(String(de.props.id),e),_.select({index:e,zone:De})}):_.select({index:e,zone:De})},We=e=>C(oe,e),be=e=>{const{parentId:n,slot:o}=F(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of We(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(de)?.props[o];return Array.isArray(t)?t.length:0},Fe=(e,n,o)=>{const r=Math.min(Math.max(o,0),be(e)),t=n<r?r-1:r;t!==n&&(_.reorderComponent(e,n,t),te(d),_.select({index:t,zone:e}))},He=B({keyOf:e=>e.id,readOnly:Boolean(U),canDrop:(e,n)=>b(n)===e.zone&&n.index>=0&&n.index<=be(e.zone),onDrop:(e,n)=>Fe(e.zone,e.index,n.index),onStep:(e,n)=>Fe(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ye=(e,n)=>/* @__PURE__ */K(D,{...U?{}:He.seam({place:{...F(e),index:n}})},`seam:${e}:${n}`),Qe=e=>Se.blockRowName(e,Ee),we=(e,n,r)=>{te(d),_.select({index:n,zone:e}),o(r)},Je=(e,n,o)=>{_.insertComponent(e,n,o),te(d),_.select({index:o,zone:e})},Ve=(n,o,r)=>/* @__PURE__ */K(e,{choices:r,onPick:e=>Je(n,e,o)}),$e=(e,n)=>{const o=We((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=Ae(e.type),s=t?.choices??null,i="footer"===t?.source?Qe:ge;/* @__PURE__ */
|
|
2
|
+
return $(X,{children:[o.map(({child:e,zone:o,index:r})=>{const t=ne?.props.id===e.props.id,s=O(oe,e.type,n),c=i(e),p=String(e.props.id),l=()=>we(o,r,p),{rowProps:m,...a}=He.row({item:{id:p,zone:o,index:r},place:{...F(o),index:r}},{onClick:Z(l)});/* @__PURE__ */
|
|
3
|
+
return $(J,{children:[0===r&&Ye(o,0),
|
|
4
|
+
/* @__PURE__ */K(v,{icon:/* @__PURE__ */K(xe,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */K(T,{kind:"delete",label:`Delete ${c}`,onClick:()=>{return e=o,n=r,_.removeComponent(e,n),te(d),void _.select(null);var e,n},children:/* @__PURE__ */K(W,{size:13})}),rowProps:m}),s&&/* @__PURE__ */K(L,{children:$e(e,n+1)}),Ye(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Ve(`${e.props.id}:${t.slot}`,o.length,s):null]})},Ke="HeroSingle"===de?.type,Xe=Boolean(de)&&(Boolean(Te)||he||ue||Ke);/* @__PURE__ */
|
|
5
|
+
return $("div",{ref:je,className:"sf-editor es-editor",style:z(i),children:[
|
|
6
|
+
/* @__PURE__ */K("div",{className:"sf-section-bar",children:/* @__PURE__ */K(g,null!==q?{tone:"off",label:q,role:"status"}:{...M(I),role:"status"})}),
|
|
7
|
+
/* @__PURE__ */$("div",{className:"sf-body",children:[Ne&&fe?/* @__PURE__ */K("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */K(m,{panel:fe,pick:Ne})}):Xe&&de&&/* @__PURE__ */$("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
|
|
8
|
+
/* @__PURE__ */K("div",{className:"sf-panel-head",children:/* @__PURE__ */K(V,{content:ue?"Header settings":`${Le(de.type)} settings`,side:"bottom",children:/* @__PURE__ */K("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(ve?"is-selected":""),"aria-pressed":ve,onClick:()=>{ue?te(pe??d):(te(d),_.select({index:0}))},children:Le(de.type)})})}),
|
|
9
|
+
/* @__PURE__ */K(E,{className:"sf-tree sf-scroll",rootProps:He.rootProps(),children:/* @__PURE__ */K(L,{children:ue?
|
|
10
|
+
/* @__PURE__ */K(v,{icon:/* @__PURE__ */K(xe,{type:"header",size:13}),name:"Header settings",selected:re.kind===pe?.kind,onSelect:()=>te(pe??d),rowProps:{onClick:Z(()=>te(pe??d))}}):Te?/* @__PURE__ */$(X,{children:[Me.map((e,n)=>{const o=ne?.props.id===e.props.id,r=ge(e),t=String(e.props.id),s=()=>ze(n,t),{rowProps:i,...c}=He.row({item:{id:t,zone:De,index:n},place:{...F(De),index:n}},{onClick:Z(s)});/* @__PURE__ */
|
|
11
|
+
return $(J,{children:[0===n&&Ye(De,0),
|
|
12
|
+
/* @__PURE__ */K(v,{icon:/* @__PURE__ */K(xe,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */K(T,{kind:"delete",label:`Delete ${r}`,onClick:()=>{return e=n,void(De&&(_.removeComponent(De,e),te(d),_.select(null)));var e},children:/* @__PURE__ */K(W,{size:13})}),rowProps:i}),Ye(De,n+1)]},String(e.props.id??n))}),
|
|
13
|
+
/* @__PURE__ */$("button",{type:"button",className:"sf-add-card",onClick:Be,children:[
|
|
14
|
+
/* @__PURE__ */K("span",{className:"sf-plus sf-plus--sm",children:"+"}),Te.addLabel]}),ae?Ce.partRows?.(de,G):null]}):$e(de,1)})})]}),
|
|
15
|
+
/* @__PURE__ */K("div",{className:"sf-center",children:/* @__PURE__ */K("div",{className:"sf-preview-host",children:/* @__PURE__ */K(le,{})})}),
|
|
16
|
+
/* @__PURE__ */K(s,{value:{selectChild:(e,n,o,r)=>"section"===Ae(r)?.source?ze(n,o):we(e,n,o),addChild:(e,n,o,r,t)=>"section"===Ae(t)?.source?Be():Je(`${e}:${n}`,o,r),childRowName:ge,blockRowName:Qe},children:/* @__PURE__ */K(me,{mode:re,onOpenWebsiteSettings:Ce.openSettings??(()=>{}),onSelectNode:Re,hideNodeActions:!0})})]})]})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{usePartBridge}from"../../chunk-
|
|
1
|
+
export{usePartBridge}from"../../chunk-U4MJQAVH.js";import"../../chunk-DCPFE4IO.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-FODNRCCO.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-K6ELD7N5.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
package/dist/screen/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-
|
|
1
|
+
import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-5LGAIELC.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-THQB37AA.js";import"../chunk-CG4OPQQX.js";import"../chunk-26OOWIJJ.js";import"../chunk-SQTY6CJD.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-2GVCAIPX.js";import"../chunk-PWZOS45R.js";import"../chunk-7F52SZOI.js";import"../chunk-R2HLPNQF.js";import"../chunk-TBF5CVPA.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-PT6V53OO.js";import"../chunk-KCBEE2MC.js";import"../chunk-ORR3Q4WV.js";import"../chunk-U4MJQAVH.js";import"../chunk-DCPFE4IO.js";import"../chunk-IYT6NN2J.js";import"../chunk-JLTZQ4US.js";import"../chunk-MAEXP3KE.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-ONRYLR2D.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";import"../chunk-57DJOKXT.js";import"../chunk-5545A3PC.js";import"../chunk-63GQKLJI.js";import"../chunk-5ZBY24K7.js";import"../chunk-PA3PNTVV.js";import"../chunk-BVN33R76.js";import"../chunk-QR4DLZ3P.js";import"../chunk-KQMML6JM.js";import"../chunk-KCOBHPN6.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";import"../chunk-HQ4VVRIC.js";import"../chunk-EOUMA3QT.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-FODNRCCO.js";import"../chunk-PLVEGYK6.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-6WY6ZXJG.js";import"../chunk-E2O2MRZR.js";import"../chunk-PYCLHOSA.js";import"../chunk-AELNNAFM.js";import"../chunk-K6ELD7N5.js";import"../chunk-PJP46U5L.js";import"../chunk-UFY6RNMT.js";import"../chunk-YNOZ5NXW.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-2LK54I4E.js";import"../chunk-WK3AFPXY.js";import"../chunk-D2BCHTQR.js";import"../chunk-X6DQWK2C.js";import"../chunk-BDTITTMW.js";import"../chunk-H6DDIBQ4.js";import"../chunk-TJ7YIRWQ.js";import"../chunk-ZJEBF4NB.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-7SQF6LZL.js";import"../chunk-QLD57GBB.js";import"../chunk-FPOKPNO4.js";import"../chunk-MFIRYGHW.js";import"../chunk-W3XX2CNW.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-PAELDYYS.js";import"../chunk-ZNCEOSXO.js";import"../chunk-P2VEMZH5.js";import"../chunk-L5KW4HG5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-DCPFE4IO.js";import"../../../chunk-FODNRCCO.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-PYCLHOSA.js";import"../../../chunk-AELNNAFM.js";import"../../../chunk-K6ELD7N5.js";import"../../../chunk-PJP46U5L.js";import"../../../chunk-UFY6RNMT.js";import"../../../chunk-YNOZ5NXW.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-QTLAVDJE.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-D2BCHTQR.js";import"../../../chunk-7SQF6LZL.js";import"../../../chunk-QLD57GBB.js";import"../../../chunk-FPOKPNO4.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-ZNCEOSXO.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-L5KW4HG5.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-
|
|
1
|
+
export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-FODNRCCO.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-K6ELD7N5.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-L5KW4HG5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-easel",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -517,7 +517,7 @@
|
|
|
517
517
|
"dist"
|
|
518
518
|
],
|
|
519
519
|
"peerDependencies": {
|
|
520
|
-
"efficient-shell": "^4.
|
|
520
|
+
"efficient-shell": "^4.167.0",
|
|
521
521
|
"react": ">=18",
|
|
522
522
|
"react-dom": ">=18"
|
|
523
523
|
},
|
|
@@ -527,7 +527,7 @@
|
|
|
527
527
|
"@types/node": "^22.0.0",
|
|
528
528
|
"@types/react": "^18.2.0",
|
|
529
529
|
"@types/react-dom": "^18.2.0",
|
|
530
|
-
"efficient-shell": "^4.
|
|
530
|
+
"efficient-shell": "^4.167.0",
|
|
531
531
|
"esbuild": "^0.27.0",
|
|
532
532
|
"jsdom": "^26.1.0",
|
|
533
533
|
"react": "^18.2.0",
|
package/dist/chunk-Q6ETRSEA.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{FieldSelect as e}from"./chunk-PJP46U5L.js";import{TreeSeam as n}from"./chunk-UFY6RNMT.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsTabs as a,SettingsGroup as r}from"./chunk-YNOZ5NXW.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as s}from"./chunk-QTLAVDJE.js";import{EaselMenuItems as o}from"./chunk-EA2HTX37.js";import{FieldNumber as c}from"./chunk-7SQF6LZL.js";import{SettingsSegmented as u}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FPOKPNO4.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as h}from"./chunk-67GNT6PF.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{ChevronIcon as f,LockIcon as g,MoveUpIcon as v,MoveDownIcon as y,DuplicateIcon as x,TrashIcon as k}from"./chunk-L5KW4HG5.js";import{Textarea as N,Input as w,ContextMenu as O,tabPanelId as C,tabButtonId as j,SearchableSelect as S,Select as D}from"efficient-shell/ui";import{useRef as I,useState as $,useLayoutEffect as F,useId as P}from"react";import{jsx as L,jsxs as T}from"react/jsx-runtime";function A({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:i=!1,ariaLabel:s,ariaLabelledBy:o}){const c=n??"";return a?/* @__PURE__ */L(N,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:i,"aria-label":s,"aria-labelledby":o,onChange:e=>l(e.target.value)}):/* @__PURE__ */L(w,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:i,"aria-label":s,"aria-labelledby":o,onChange:e=>l(e.target.value)})}function M(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function E(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function z(e,n){return e.filter((e,l)=>l!==n)}function R(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var H='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function K({label:e,icon:l,noun:t,items:a,onChange:r,newItem:s,summary:c,itemName:u,thumb:N,min:w=0,max:C,readOnly:j=!1,open:S,onOpen:D,renderItem:P,renderRow:A,canRemove:K,lockedReason:Y,fixed:G=!1,removeOnRow:J=!0,canDuplicate:Q,above:U,head:W=!0}){const q=m("fields",d).list,V=m("tree",i),X=t??q.item,Z=!j&&!G&&("number"!=typeof C||a.length<C),_=a.length<=w,ee=e=>!!K&&!K(a[e],e),ne=e=>!j&&!G&&J&&!_&&!ee(e),le=e=>Z&&(!Q||Q(a[e],e)),te=(e,n)=>u?u(e,n):q.itemName({noun:X,n:n+1}),ae=I([]),re=I(null),[ie,se]=$(null),oe=I(null),[ce,ue]=$(null),[de,me]=$("");F(()=>{for(const e of ae.current){if(!e)continue;null!==e.querySelector(H)||j?e.removeAttribute("tabindex"):e.tabIndex=0}}),F(()=>{const e=re.current;if(!e)return;re.current=null;const n=ae.current[e.index]?.querySelectorAll(H)[e.nth]??ae.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const pe=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=ae.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(H)].indexOf(t),a=t;re.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}r(E(a,e,n));const i=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}(S,e,n);i!==S&&D(i),me(q.moved({n:n+1,total:a.length}))},he=e=>{Z&&(r(M(a,e,s())),A?(re.current={index:e,nth:0,start:null,end:null},null!==S&&S>=e&&D(S+1)):D(e))},be=e=>{ne(e)&&(r(z(a,e)),S===e?D(null):null!==S&&S>e&&D(S-1))},fe=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=h({...B,index:e},n);l!==e&&pe(e,l)},onStep:(e,n)=>pe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:j}),ge=e=>{const n=[];return e>0&&n.push({label:q.moveUp,icon:/* @__PURE__ */L(v,{size:14}),shortcut:"⌥↑",onClick:()=>pe(e,e-1)}),e<a.length-1&&n.push({label:q.moveDown,icon:/* @__PURE__ */L(y,{size:14}),shortcut:"⌥↓",onClick:()=>pe(e,e+1)}),le(e)&&n.push({label:q.duplicate,icon:/* @__PURE__ */L(x,{size:14}),onClick:()=>(e=>{le(e)&&(r(M(a,e+1,R(a[e]))),null!==S&&S>e&&D(S+1))})(e)}),ne(e)&&n.push({label:q.delete,icon:/* @__PURE__ */L(k,{size:14}),danger:!0,onClick:()=>be(e)}),n},ve=(e,n,l,t)=>{j||0===ge(e).length||ue({index:e,x:n,y:l,owner:t})},ye=e=>n=>{const l=a.slice();l[e]=n,r(l)};/* @__PURE__ */
|
|
2
|
-
return T("div",{className:"es-list",children:[W?/* @__PURE__ */T("div",{className:"es-list-head",children:[
|
|
3
|
-
/* @__PURE__ */T("span",{className:"es-list-label",children:[l?/* @__PURE__ */L("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,e]}),
|
|
4
|
-
/* @__PURE__ */L("span",{className:"es-list-count",children:a.length})]}):null,U?/* @__PURE__ */L("div",{className:"es-list-above",children:U}):null,a.length?/* @__PURE__ */T("div",{className:"es-list-rows",...fe.rootProps(),children:[a.map((e,l)=>{const t=fe.row({item:l,place:{...B,index:l}}),a=t.draggable&&ie!==l,r=!A&&S===l,i=!j&&!G&&J&&ee(l),s=["es-list-row",A?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
5
|
-
return T("div",{className:"es-list-entry",children:[l>0?/* @__PURE__ */L("div",{className:"es-list-gap",children:/* @__PURE__ */L(n,{...fe.seam({place:{...B,index:l}}),onAdd:Z?()=>he(l):void 0,label:q.addHere({noun:X})})}):null,
|
|
6
|
-
/* @__PURE__ */T("div",{...t.rowProps,ref:e=>{ae.current[l]=e},className:s,draggable:a||void 0,"aria-keyshortcuts":t.draggable?"Alt+ArrowUp Alt+ArrowDown":void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,oe.current=n&&!a?n:null,se(a?l:null)},onDragStart:e=>{const n=oe.current;oe.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{j||(e.preventDefault(),e.stopPropagation(),ve(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ve(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)},children:[a?/* @__PURE__ */L("span",{className:"es-list-hint","aria-hidden":"true",children:V.dragHint}):null,A?/* @__PURE__ */L("div",{className:"es-list-row-main",children:A(e,l,ye(l))}):/* @__PURE__ */T("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>D(r?null:l),children:[N?/* @__PURE__ */L("span",{className:"es-list-thumb","aria-hidden":"true",children:N(e,l)}):null,
|
|
7
|
-
/* @__PURE__ */L("span",{className:"es-list-row-name",children:te(e,l)}),/* @__PURE__ */L("span",c?{className:"es-list-row-summary",children:c(e,l)}:{className:"es-list-row-summary"}),
|
|
8
|
-
/* @__PURE__ */L(f,{size:14,className:"es-list-chev","aria-hidden":"true"})]}),j||G||!J?null:i?b(Y?Y(e,l):q.locked,/* @__PURE__ */L("span",{className:"es-list-lock",role:"img","aria-label":Y?Y(e,l):q.locked,children:/* @__PURE__ */L(g,{size:13})})):b(q.deleteItem({noun:X}),/* @__PURE__ */L("button",{type:"button",className:"es-list-x","aria-label":q.deleteItem({noun:X}),disabled:!ne(l),onClick:()=>be(l),children:"×"}))]}),r?/* @__PURE__ */L("div",{className:"es-list-item",children:P(e,l,ye(l))}):null]},l)}),
|
|
9
|
-
/* @__PURE__ */L("div",{className:"es-list-gap",children:/* @__PURE__ */L(n,{...fe.seam({place:{...B,index:a.length}})})})]}):null,j||G?null:/* @__PURE__ */L("button",{type:"button",className:"es-list-add",disabled:!Z,onClick:()=>he(a.length),children:q.add({noun:X})}),
|
|
10
|
-
/* @__PURE__ */L("span",{className:"es-list-said","aria-live":"polite",children:de}),ce&&ce.index<a.length?
|
|
11
|
-
/* @__PURE__ */L(O,{at:{x:ce.x,y:ce.y},owner:ce.owner,onClose:()=>ue(null),children:/* @__PURE__ */L(o,{items:ge(ce.index),onClose:()=>ue(null)})}):null]})}var Y=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function G({field:e,name:n,id:l,value:t,onChange:a,readOnly:i,context:s,renderers:o}){const[c,u]=$(!0),d=t&&"object"==typeof t?t:{};/* @__PURE__ */
|
|
12
|
-
return L(r,{id:`${l}-group`,title:Y(e,n),open:c,onToggle:u,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */L(Q,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:d[e],onChange:n=>a({...d,[e]:n}),readOnly:i,context:s,renderers:o},e))})}function J({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:i,renderers:s,openItem:o,onOpenItem:c}){const[u,d]=$(null),m=c?o??null:u,p=c??d,h=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
|
|
13
|
-
return L(K,{label:Y(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>R({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:m,onOpen:p,renderItem:(t,a,o)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */L(Q,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>o({...t,[e]:n}),readOnly:r,context:i,renderers:s},e))})}function Q(n){const{field:t,name:a,id:r,value:i,onChange:s,readOnly:o,context:d,renderers:m}=n;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:i,onChange:s,readOnly:o});switch(t.type){case"custom":{const e={...d,field:t,name:a,id:r,value:i,onChange:s,readOnly:o};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
14
|
-
return L(l,{label:Y(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */L(A,{id:r,value:"string"==typeof i?i:null==i?"":String(i),onChange:s,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:o})});case"number":/* @__PURE__ */
|
|
15
|
-
return L(l,{label:Y(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */L(c,{id:r,value:"number"==typeof i?i:void 0,onChange:s,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:o})});case"select":{const n=`${r}-label`;/* @__PURE__ */
|
|
16
|
-
return L(l,{label:Y(t,a),labelId:n,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */L(e,{id:r,value:i,options:t.options,onChange:s,readOnly:o,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
|
|
17
|
-
return L(l,{label:Y(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */L(u,{ariaLabel:Y(t,a),value:i,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||o})),onChange:e=>{o||s(e)}})});case"object":/* @__PURE__ */
|
|
18
|
-
return L(G,{...n,field:t});case"array":/* @__PURE__ */
|
|
19
|
-
return L(J,{...n,field:t});case"slot":return null}}var U=e=>t.includes(e);function W(e){let n=t[0];const l=[],a=/* @__PURE__ */new Set;for(const[t,r]of Object.entries(e))r&&(U(r.bucket)&&(n=r.bucket),r.marker||!1===r.visible||(l.push({name:t,field:r,bucket:n}),"slot"!==r.type&&a.add(n)));return{rows:l,buckets:t.filter(e=>a.has(e))}}function q(e){return new Map(W(e).rows.map(e=>[e.name,e.bucket]))}function V({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:o,tabs:c=!0,tabIcons:u,renderers:d,idPrefix:p,ariaLabel:h,children:b}){const f=m("panel",s),g=P(),v=p??`es-insp${g.replace(/:/g,"")}`,y=W(e),[x,k]=$(void 0),N=i??x,w=N&&y.buckets.includes(N)?N:y.buckets[0],[O,S]=$(null),D=O&&O.panel===v&&y.rows.some(e=>e.name===O.name)?O:null,I=c&&y.buckets.length>1,F=I&&w?C(v,w):`${v}-rows`;/* @__PURE__ */
|
|
20
|
-
return T("div",{className:"es-insp",children:[I?/* @__PURE__ */L("div",{className:"es-insp-tabs",children:/* @__PURE__ */L(a,{ariaLabel:h??f.settings,activeId:w,onSelect:e=>{const n=e;void 0===i&&k(n),o?.(n)},items:y.buckets.map(e=>({id:e,label:f.buckets[e],icon:u?.[e]})),idPrefix:v})}):null,
|
|
21
|
-
/* @__PURE__ */T("div",{className:"es-insp-rows",id:F,role:I?"tabpanel":void 0,"aria-labelledby":I&&w?j(v,w):void 0,children:[y.rows.map(({name:e,field:a,bucket:i})=>/* @__PURE__ */L("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!I||i===w)||void 0,children:/* @__PURE__ */L(Q,{field:a,name:e,id:`${v}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:d,openItem:D&&D.name===e?D.index:null,onOpenItem:n=>S(null===n?null:{panel:v,name:e,index:n})})},e)),b]})]})}function X(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}function Z({value:e,onChange:n,kinds:l,rules:t,filtersFor:a,label:r,readOnly:i}){const s=m("fields",d).link??d.link,[o,c]=$(null),[u,p]=$(null),h=o&&o.against===e?o.kind:t.kindOf(e),b=l.filter(e=>!e.hideWhenEmpty||X(e.target).length>0||e.value===h),f=b.find(e=>"text"===e.target.type),g=b.find(e=>e.value===h)??f??b[0];if(!g)return null;const v="text"!==g.target.type,y=v?t.targetOf(e):e,x=X(g.target),k=x.find(e=>e.value===y),N=e=>({value:e,label:s.unavailable({value:e})}),O="select"===g.target.type&&y&&a?a(y):null,C=O?t.readFilter(e):null,j=C?O?.find(e=>e.param===C.param):void 0,I=u&&u.against===e?u.text:e,F=!v&&""!==I.trim()&&!t.isSafe(I),P=(e,l)=>{c(n=>n?{...n,against:e}:n),void 0===l?n(e):n(e,l)},A=e=>{if(!e)return P("");const n=x.find(n=>n.value===e);P(e,n?.label)},M=(e,n)=>n&&!e.some(e=>e.value===n)?[N(n),...e]:[...e],E=(e,n,l,t,a)=>{const r=[];for(const e of l){const n=r[r.length-1],l={value:e.value,label:e.label};e.group?n&&"options"in n&&n.label===e.group?n.options.push(l):r.push({label:e.group,options:[l]}):r.push(l)}if(a){const a=l.some(e=>""===e.value);/* @__PURE__ */
|
|
22
|
-
return L(S,{"aria-label":e,value:n,options:r,disabled:i,clearable:a,placeholder:l.find(e=>""===e.value)?.label,onChange:t})}/* @__PURE__ */
|
|
23
|
-
return L(D,{size:"sm","aria-label":e,value:n,options:r,readOnly:i,onChange:t})};let z;if("text"===g.target.type)z=/* @__PURE__ */L(w,{size:"sm",type:"text",className:"es-fin",invalid:F,"aria-label":s.address,placeholder:s.addressPlaceholder,value:I,readOnly:i,onChange:n=>(n=>{const l=n.trim();l?t.isSafe(n)?(p({text:n,against:l}),P(l)):p({text:n,against:e}):(p({text:n,against:""}),P(""))})(n.target.value)});else{const e="groups"===g.target.type?g.target.groups.flatMap(e=>e.options.map(n=>({value:n.value,label:n.label,group:e.label}))):g.target.options.map(e=>({value:e.value,label:e.label})),n=[{value:"",label:g.target.placeholder},...M(e,y)];z=E(g.label,y,n,A,e.length>10)}/* @__PURE__ */
|
|
24
|
-
return T("div",{className:"es-flink",role:r?"group":void 0,"aria-label":r,children:[E(s.linkType,g.value,b.map(e=>({value:e.value,label:e.label})),l=>{p(null);const t=b.find(e=>e.value===l);if(!t||"text"===t.target.type)return void c({kind:l,against:e});const a=X(t.target)[0];c({kind:l,against:a?a.value:""}),a?n(a.value,a.label):n("")},!1),z,O&&E(s.filter,C?.param??"",[{value:"",label:s.noFilter},...C&&!j?[N(C.param)]:[],...O.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return P(y,k?.label);const n=O?.find(n=>n.param===e),l=n?.values[0];l&&P(t.withFilter(y,{param:e,value:l.value}),l.label)},!1),O&&C&&E(s.value,C.value,M((j?.values??[]).map(e=>({value:e.value,label:e.label})),C.value),e=>{if(!C)return;const n=j?.values.find(n=>n.value===e);P(t.withFilter(y,{param:C.param,value:e}),n?.label)},(j?.values.length??0)>10),F&&/* @__PURE__ */L("p",{className:"es-flink-error",role:"alert",children:s.unsafe}),g.hint&&/* @__PURE__ */L("p",{className:"es-flink-hint",children:g.hint}),O&&/* @__PURE__ */L("p",{className:"es-flink-hint",children:s.filterHint})]})}export{A as FieldText,V as Inspector,Q as InspectorField,Z as LinkPicker,K as ListField,q as bucketsOf,R as copyItem,M as insertAt,Y as labelOf,E as moveTo,W as planFields,z as removeAt};
|
package/dist/chunk-RINSVAKA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-NGT4DAHF.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-2F6RZTR7.js";import{useEasel as p}from"./chunk-PYCLHOSA.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}=p(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),a?.(t)):i(o=>"part"===o.kind?n:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
|