efficient-easel 7.1.1 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/chunk-3PASGRBK.js +1 -0
- package/dist/{chunk-NZGRBCBZ.js → chunk-CLWYUKUO.js} +3 -3
- package/dist/chunk-GZH4UVDH.js +8 -0
- package/dist/chunk-HUTO5ZIL.js +5 -0
- package/dist/{chunk-SWDPE63D.js → chunk-MUUPE34I.js} +1 -1
- package/dist/chunk-NCMQD4P6.js +5 -0
- package/dist/{chunk-H4OMQ3QW.js → chunk-PH3GWKS2.js} +1 -1
- package/dist/{chunk-JWJ6B67U.js → chunk-U2SECYQB.js} +1 -1
- package/dist/chunk-UCLVWF5E.js +21 -0
- package/dist/{chunk-GLWQPLIA.js → chunk-UJZGOO3D.js} +42 -42
- package/dist/{chunk-Q7KMV5XI.js → chunk-XC36V42X.js} +1 -1
- package/dist/fields/index.d.ts +52 -40
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +16 -2
- package/dist/panel/index.js +1 -1
- package/dist/panel/panel.css +16 -0
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/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 +1 -1
- package/dist/chunk-2SXSWNKG.js +0 -5
- package/dist/chunk-3ZJSLHHI.js +0 -8
- package/dist/chunk-5ZIVEJAM.js +0 -1
- package/dist/chunk-CRWFB7MU.js +0 -21
- package/dist/chunk-FCEBEN5T.js +0 -5
package/README.md
CHANGED
|
@@ -941,6 +941,14 @@ const easel = createEasel<EaselConfig>({ config, data, onChange: (doc) => autosa
|
|
|
941
941
|
are drawn inside one `SettingsGroup` (− / +, open by default). `leadFold`
|
|
942
942
|
puts `lead` in a band of its own; `closedFolds` + `onFold` let the host hold
|
|
943
943
|
which bands are closed. A folded band's rows stay mounted.
|
|
944
|
+
- **A band's title is a heading since 7.2.0** (WAI-ARIA accordion pattern):
|
|
945
|
+
`SettingsGroup` draws `<h3 class="es-group-title"><button aria-expanded
|
|
946
|
+
aria-controls>…</button></h3>`. `headingLevel` (default 3) sets the bands'
|
|
947
|
+
level; a group inside a band draws one under it. `SettingsGroup` takes
|
|
948
|
+
`level` too. A band's DOM id is built from a safe form of its key (any
|
|
949
|
+
character but letters, digits, `-` and `_` becomes `-u<hex>-`, so `" text"`
|
|
950
|
+
is `<prefix>-fold--u20-text`); the key itself is unchanged for
|
|
951
|
+
`closedFolds`, `onFold` and `data-fold`.
|
|
944
952
|
- **`planFields().rows` holds `slot` rows.** They draw nothing and are there so
|
|
945
953
|
the slot's name has a bucket. Filter `row.field.type !== 'slot'` before
|
|
946
954
|
drawing or counting rows of your own.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useSectionOps as o}from"./chunk-MUUPE34I.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-HUTO5ZIL.js";import{useEasel as p}from"./chunk-AWKOTOE6.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=p(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as r}from"./chunk-
|
|
1
|
+
import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as r}from"./chunk-PH3GWKS2.js";import{ScreenChrome as e}from"./chunk-UJZGOO3D.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-64ZRPAWS.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-5F3PKNT7.js";import{documentPermissions as o}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t}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 f=n(r),v=n(e);function p({saving:n,onCancel:r,onDiscard:e,onSave:i}){const a=c("screen",s).leave;/* @__PURE__ */
|
|
2
2
|
return m(d,{open:!0,role:"alertdialog",size:"sm",title:a.title,onClose:r,footer:/* @__PURE__ */g(h,{children:[
|
|
3
3
|
/* @__PURE__ */m(l,{variant:"secondary",onClick:r,children:a.cancel}),
|
|
4
4
|
/* @__PURE__ */m(l,{variant:"ghost-danger",onClick:e,children:a.discard}),
|
|
5
5
|
/* @__PURE__ */m(l,{variant:"primary",loading:n,onClick:i,children:n?a.saving:a.save})]}),children:a.body})}function u({target:n,addressing:r,onHostMessage:e,children:a}){/* @__PURE__ */
|
|
6
|
-
return m(i,{target:n,addressing:r,onHostMessage:e,children:a})}var k=(n,r)=>/* @__PURE__ */g(h,{children:[n,r]});function C({config:n,parts:r,wrap:e=k}){const{data:i,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:C,pendingNav:N,cancelPendingNav:j,discardAndNavigate:y,saveAndNavigate:
|
|
7
|
-
/* @__PURE__ */m(f,{config:n,data:i,onChange:C,permissions:
|
|
6
|
+
return m(i,{target:n,addressing:r,onHostMessage:e,children:a})}var k=(n,r)=>/* @__PURE__ */g(h,{children:[n,r]});function C({config:n,parts:r,wrap:e=k}){const{data:i,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:C,pendingNav:N,cancelPendingNav:j,discardAndNavigate:y,saveAndNavigate:H}=a(),O=t(()=>o(!u),[u]),P=c("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:P.loading}):d?/* @__PURE__ */m("div",{className:"sf-msg sf-msg--error",children:d}):g?i?e(
|
|
7
|
+
/* @__PURE__ */m(f,{config:n,data:i,onChange:C,permissions:O,parts:r,children:/* @__PURE__ */m(v,{})}),N&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:j,onDiscard:y,onSave:()=>{H()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:P.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:P.waitingForAuthorization})}export{C as DocumentScreen,u as ScreenMount};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{SettingsSwitch as e}from"./chunk-QLD57GBB.js";import{jsxs as l,jsx as n,Fragment as a}from"react/jsx-runtime";import{isValidElement as i,cloneElement as s}from"react";function r({title:e,open:a,onToggle:i,count:s,level:r=3,id:c,children:d,className:o}){const t=c?`${c}-body`:void 0;/* @__PURE__ */
|
|
2
|
+
return l("div",{className:o?`es-group ${o}`:"es-group",children:[
|
|
3
|
+
/* @__PURE__ */n(`h${r}`,{className:"es-group-title",children:/* @__PURE__ */l("button",{type:"button",id:c,"aria-expanded":a,"aria-controls":t,className:"es-group-head",onClick:()=>i(!a),children:[e,"number"==typeof s&&s>0?/* @__PURE__ */n("span",{className:"es-group-count",children:s}):null,
|
|
4
|
+
/* @__PURE__ */n("span",{className:"es-group-sign","aria-hidden":"true"})]})}),
|
|
5
|
+
/* @__PURE__ */n("div",{id:t,className:"es-group-body",hidden:!a,children:d})]})}function c(e){return Array.isArray(e)?e.some(c):i(e)}function d(l,n,a){if(!i(l)||l.type!==e)return l;const r=l.props;return r.ariaLabel||r.ariaLabelledBy?l:s(l,a?{ariaLabelledBy:a}:{ariaLabel:n})}function o({label:e,labelId:i,icon:s,value:r,hint:o,changed:t,htmlFor:u,action:h,children:m,className:p}){const f=c(m),N=c(h);if(!f&&!N)return null;const b=["es-field"];f||b.push("is-inline"),t&&b.push("is-changed"),p&&b.push(p);const g=/* @__PURE__ */l(a,{children:[s?/* @__PURE__ */n("span",{className:"es-field-icon","aria-hidden":"true",children:s}):null,
|
|
6
|
+
/* @__PURE__ */n("span",{className:"es-field-label",id:i,children:e})]});/* @__PURE__ */
|
|
7
|
+
return l("div",{className:b.join(" "),children:[
|
|
8
|
+
/* @__PURE__ */l("div",{className:"es-field-head",children:[u?/* @__PURE__ */n("label",{className:"es-field-name",htmlFor:u,children:g}):/* @__PURE__ */n("span",{className:"es-field-name",children:g}),null!=r?/* @__PURE__ */n("span",{className:"es-field-value",children:r}):null,N?d(h,e,i):null]}),f?/* @__PURE__ */n("div",{className:"es-field-ctl",children:m}):null,o?/* @__PURE__ */n("p",{className:"es-field-hint",children:o}):null]})}var t=Object.freeze(["Design","Animation"]),u=Object.freeze(["Content","Size","Design","Layout","Position","Anchor"]);export{u as DESIGN_GROUPS,t as SETTINGS_BUCKETS,o as SettingsField,r as SettingsGroup};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-AWKOTOE6.js";import{Inspector as i}from"./chunk-UCLVWF5E.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},L={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},j={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},w={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},C={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
|
|
2
|
+
return s(t,{height:"fill"})}function P(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
|
|
3
|
+
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var D=o({});function G({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
+
return s(D.Provider,{value:n,children:e})}function N(){return u(D)}function T(){return(N().useOwnerName??g)()}function x(){return(N().useDocumentLabel??y)()}function A(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function B(n){return(N().useStandaloneBridges??v)(n)}function F(n,e){(N().useDocumentPass??b)(n,e)}function I(){return N().blockRules??O}function W(){return N().blockLook??L}function E(){return N().devices??j}function K(){return N().leftView??w}function R(){return N().pinned??C}function V(){return N().saveSwitch??!0}function H(n){e(!0===N().pickFollowsSelection,n)}function Q(){return N().add??h}function U(){return N().storageNamespace||void 0}function Y(){return N().styleClipboard??null}function Z(){return N().nodeKeys??!0}function q(){return N().notify??null}function z(){return N().Canvas??S}function J(){return N().CanvasHead??null}function M(){return N().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
|
|
5
|
+
return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return N().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,G as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,Q as useScreenAdd,W as useScreenBlockLook,I as useScreenBlockRules,A as useScreenBridges,M as useScreenCanvasDrag,z as useScreenCanvasFrame,J as useScreenCanvasHead,_ as useScreenCanvasTarget,E as useScreenDevices,x as useScreenDocumentLabel,F as useScreenDocumentPass,nn as useScreenInspectorPanel,K as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,T as useScreenOwnerName,N as useScreenParts,H as useScreenPickFollowsSelection,R as useScreenPinned,V as useScreenSaveSwitch,U as useScreenStorageNamespace,Y as useScreenStyleClipboard,B as useStandaloneScreenBridges};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useScreenBlockRules as e}from"./chunk-
|
|
1
|
+
import{useScreenBlockRules as e}from"./chunk-HUTO5ZIL.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-AWKOTOE6.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-PFNIVZPN.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-HUTO5ZIL.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-5F3PKNT7.js";import{useEasel as f}from"./chunk-AWKOTOE6.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-SSORUDHE.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-O2NLQBFX.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as O,jsxs as $,Fragment as B}from"react/jsx-runtime";var N=e=>`section:${e}`,v=e=>`block:${e}`,I=e=>`template:${e}`;function x({blocks:x,blocksOnly:F,at:H,onAdd:L,itemFor:T,session:V,siteWide:A,onClose:P,onHide:D,readOnly:R}){const S=f(e=>e.config),w=p(),{labelAtLevel:C,categoryLabel:E,firstSection:K,Icon:Q,Thumbnail:W}=w,{blockIsOffered:Z}=m(),z=u("screen",d).add,U=u("drag",h).add,Y=l(),[G,J]=y([]);b(()=>{let t=!1;const o=e=>Z(e,Y);return s(Y).list().then(n=>{if(t)return;const i=S.components;J(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[S,Y]);const M=j(()=>t(S,w),[S]),X=e=>({type:N(e.type),label:e.name,cover:/* @__PURE__ */O(W,{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)}),q=j(()=>{const e=[];if(x&&x.choices.length>0&&a(x.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${z.inside({name:x.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:v(e.type),label:e.label,icon:/* @__PURE__ */O(Q,{type:e.type,size:18}),title:z.tile({name:e.label})}))})}),F)return e;const t=o(M,K);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:I(e.id),label:e.name,cover:/* @__PURE__ */O(W,{type:e.node.type}),keywords:[(t=e.node.type,C(t,"section",S.components[t]?.label??t)),e.node.type]};var t})});const s=n(M,K);for(const t of Object.keys(S.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(S,t,E),tiles:o.map(X)})}return e},[x,F,G,M,S,z]),_=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 $(B,{children:[
|
|
3
|
+
/* @__PURE__ */O(r,{icon:/* @__PURE__ */O(g,{size:15}),title:z.title,context:F?z.contextBlocks:z.contextAll,actions:/* @__PURE__ */O(c,{label:z.done,description:z.doneDescription,onClick:P}),onHide:D}),
|
|
4
|
+
/* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
+
/* @__PURE__ */O(k,{groups:q,session:V,itemFor:e=>T(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&L(t)},at:H,hint:F?z.hintBlocks:z.hint,searchLabel:F?z.searchBlocks:z.searchSections,readOnly:R,words:U}),A&&!F?A:null]})]})}export{x as AddSidePanel,v as blockKey,N as sectionKey,I as templateKey};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ScreenPartsProvider as t}from"./chunk-
|
|
1
|
+
import{ScreenPartsProvider as t}from"./chunk-HUTO5ZIL.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-AWKOTOE6.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
|
|
2
2
|
return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useScreenOwnerName as e}from"./chunk-
|
|
1
|
+
import{useScreenOwnerName as e}from"./chunk-HUTO5ZIL.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-UB4TLWVJ.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
|
|
2
2
|
return o(r,{children:[
|
|
3
3
|
/* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{FieldSelect as n}from"./chunk-OZ72A6MY.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsGroup as a}from"./chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as r}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as i}from"./chunk-EA2HTX37.js";import{FieldNumber as s}from"./chunk-66LWADFP.js";import{SettingsSegmented as c}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FFYXVAAL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as D}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as I,MoveUpIcon as L,MoveDownIcon as P,DuplicateIcon as F,TrashIcon as A}from"efficient-shell/icons/efficient";function M({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function T(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 z(e,n){return e.filter((e,l)=>l!==n)}function E(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var R='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function Y({label:n,icon:l,noun:t,items:a,onChange:o,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:M,renderItem:Y,renderRow:K,canRemove:V,lockedReason:G,fixed:J=!1,removeOnRow:Z=!0,canDuplicate:W,above:X,head:q=!0}){const Q=u("fields",d).list,U=u("tree",r),_=t??Q.item,ee=!w&&!J&&("number"!=typeof x||a.length<x),ne=a.length<=k,le=e=>!!V&&!V(a[e],e),te=e=>!w&&!J&&Z&&!ne&&!le(e),ae=e=>ee&&(!W||W(a[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(R)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(R)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}o(H(a,e,n));const r=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);r!==$&&M(r),he(Q.moved({n:n+1,total:a.length}))},be=e=>{ee&&(o(T(a,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&M($+1)):M(e))},ge=e=>{te(e)&&(o(z(a,e)),$===e?M(null):null!==$&&$>e&&M($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<a.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(F,{size:14}),onClick:()=>(e=>{ae(e)&&(o(T(a,e+1,E(a[e]))),null!==$&&$>e&&M($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=a.slice();l[e]=n,o(l)};/* @__PURE__ */
|
|
2
|
+
return D("div",{className:"es-list",children:[q?/* @__PURE__ */D("div",{className:"es-list-head",children:[
|
|
3
|
+
/* @__PURE__ */D("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,n]}),
|
|
4
|
+
/* @__PURE__ */j("span",{className:"es-list-count",children:a.length})]}):null,X?/* @__PURE__ */j("div",{className:"es-list-above",children:X}):null,a.length?/* @__PURE__ */D(g,{"aria-label":n,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!J&&Z&&le(l),i=["es-list-row",K?"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__ */j(e,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
|
|
5
|
+
/* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.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,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(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 ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||J||!Z?void 0:o?h(G?G(n,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":G?G(n,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:Y(n,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(n,l,xe(l))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>M(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(n,l)}):null,
|
|
6
|
+
/* @__PURE__ */j("span",{className:"es-list-row-name",children:re(n,l)}),/* @__PURE__ */j("span",c?{className:"es-list-row-summary",children:c(n,l)}:{className:"es-list-row-summary"}),
|
|
7
|
+
/* @__PURE__ */j(S,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
|
|
8
|
+
/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:a.length}})})]}):null,w||J?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(a.length),children:Q.add({noun:_})}),
|
|
9
|
+
/* @__PURE__ */j("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<a.length?
|
|
10
|
+
/* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(i,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,V=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function G({field:e,name:n,id:l,value:t,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=t&&"object"==typeof t?t:{};/* @__PURE__ */
|
|
11
|
+
return j(a,{id:`${l}-group`,title:V(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */j(Z,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:m[e],onChange:n=>r({...m,[e]:n}),readOnly:o,context:i,renderers:s,headingLevel:K(c)},e))})}function J({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:o,renderers:i,openItem:s,onOpenItem:c,headingLevel:d}){const[u,m]=C(null),p=c?s??null:u,h=c??m,f=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
|
|
12
|
+
return j(Y,{label:V(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>E({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(Z,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function Z(e){const{field:t,name:a,id:r,value:o,onChange:i,readOnly:d,context:u,renderers:m}=e;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:o,onChange:i,readOnly:d});switch(t.type){case"custom":{const e={...u,field:t,name:a,id:r,value:o,onChange:i,readOnly:d};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
13
|
+
return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(M,{id:r,value:"string"==typeof o?o:null==o?"":String(o),onChange:i,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:d})});case"number":/* @__PURE__ */
|
|
14
|
+
return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(s,{id:r,value:"number"==typeof o?o:void 0,onChange:i,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:d})});case"select":{const e=`${r}-label`;/* @__PURE__ */
|
|
15
|
+
return j(l,{label:V(t,a),labelId:e,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(n,{id:r,value:o,options:t.options,onChange:i,readOnly:d,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
|
|
16
|
+
return j(l,{label:V(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(c,{ariaLabel:V(t,a),value:o,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||d})),onChange:e=>{d||i(e)}})});case"object":/* @__PURE__ */
|
|
17
|
+
return j(G,{...e,field:t});case"array":/* @__PURE__ */
|
|
18
|
+
return j(J,{...e,field:t});case"slot":return null}}var W=e=>t.includes(e);function X(e){let n,l=t[0];const a=[],r=/* @__PURE__ */new Set;for(const[t,o]of Object.entries(e))o&&(W(o.bucket)&&((o.marker||o.bucket!==l)&&(n=void 0),l=o.bucket),o.marker&&"string"==typeof o.fold?n={key:t,title:o.fold}:o.marker&&!1===o.fold&&(n=void 0),o.marker||!1===o.visible||(a.push(n?{name:t,field:o,bucket:l,fold:n}:{name:t,field:o,bucket:l}),"slot"!==o.type&&r.add(l)));return{rows:a,buckets:t.filter(e=>r.has(e))}}function q(e){return new Map(X(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",o),S=$(),I=p??`es-insp${S.replace(/:/g,"")}`,L=X(e),[P,F]=C(void 0),A=i??P,M=A&&L.buckets.includes(A)?A:L.buckets[0],[T,H]=C(null),z=T&&T.panel===I&&L.rows.some(e=>e.name===T.name)?T:null,E=c&&L.buckets.length>1,R=E&&M?k(I,M):`${I}-rows`,[B,Y]=C(()=>/* @__PURE__ */new Set),V=v??B,G=(e,n)=>{/* @__PURE__ */return j(a,{title:e.title,open:!V.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&Y(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${l=e.key,[...l].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var l},J=e=>E&&e!==M,W=({name:e,field:a,bucket:o,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":o,hidden:!!J(o)||void 0,children:/* @__PURE__ */j(Z,{field:a,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:m,openItem:z&&z.name===e?z.index:null,onOpenItem:n=>H(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
|
|
19
|
+
return D("div",{className:"es-insp",children:[E?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":h??O.settings,idPrefix:I,value:M,onChange:e=>{const n=e;void 0===i&&F(n),s?.(n)},items:L.buckets.map(e=>{const n=O.buckets[e],l=d?.[e];return l?{id:e,icon:l,label:/* @__PURE__ */j("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
|
|
20
|
+
/* @__PURE__ */D("div",{className:"es-insp-rows",id:R,role:E?"tabpanel":void 0,"aria-labelledby":E&&M?w(I,M):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:G(g,f)}):f:null,Q(L.rows).map((e,n)=>{if(!e.fold)return e.rows.map(W);const l=e.rows[0].bucket,t=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
|
|
21
|
+
return j("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":l,hidden:!(!J(l)&&!t)||void 0,children:G(e.fold,e.rows.map(W))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{M as FieldText,U as Inspector,Z as InspectorField,Y as ListField,q as bucketsOf,E as copyItem,T as insertAt,V as labelOf,H as moveTo,X as planFields,z as removeAt};
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-MVQEEWTE.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-2AAJCKCB.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-6TOYXESC.js";import{usePartBridge as v}from"./chunk-
|
|
2
|
-
return An(
|
|
1
|
+
import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-MVQEEWTE.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-2AAJCKCB.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-6TOYXESC.js";import{usePartBridge as v}from"./chunk-3PASGRBK.js";import{useSectionOps as x}from"./chunk-MUUPE34I.js";import{useNodeClipboard as w,useNodeContextMenu as b}from"./chunk-LC62L4P2.js";import{PageEditGuardNotices as z}from"./chunk-E4MAYJX5.js";import{useScreenDocument as B}from"./chunk-64ZRPAWS.js";import{requestMediaPick as C}from"./chunk-KG7RJWOK.js";import{heldStyle as O,styleShortcut as I}from"./chunk-V7U33NF2.js";import{AddChildRow as N}from"./chunk-5545A3PC.js";import{AddSidePanel as P}from"./chunk-NCMQD4P6.js";import{SidePanelHead as $,PanelShowStrip as T}from"./chunk-PFNIVZPN.js";import{MediaSidePanel as A}from"./chunk-U2SECYQB.js";import{useScreenSaveSwitch as M,useScreenNodeKeys as j,useScreenPinned as E,useScreenDocumentLabel as R,useScreenCanvasFrame as L,useScreenInspectorPanel as V,useScreenDevices as F,useScreenPickFollowsSelection as H,useScreenLeftView as W,useScreenAdd as U,SELECTION_MODE as D,sameInspectorMode as G,useScreenBridges as J,useScreenBlockRules as Y,useScreenBlockLook as K,useScreenStorageNamespace as X,useScreenNotify as Q,useScreenCanvasHead as _,isSlotMode as Z,useScreenStyleClipboard as q,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-HUTO5ZIL.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as ve}from"./chunk-5F3PKNT7.js";import{useEasel as xe,useEaselApi as we}from"./chunk-AWKOTOE6.js";import{TreeRow as be,Subtree as ze,LayersTree as Be,TreeGroupLabel as Ce,TreeRowAction as Oe,TreeSeam as Ie}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as Ne}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Pe}from"./chunk-WK3AFPXY.js";import{toItemSelector as $e,useNodeOps as Te,clickPick as Ae}from"./chunk-SOZUYCQZ.js";import{LayersIcon as Me,MediaIcon as je}from"./chunk-4VJATVVR.js";import{DEFAULT_SAVE_WORDS as Ee,saveIndicator as Re}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Le,TopBarRail as Ve,TopBarCluster as Fe,EaselIconButton as He,TopBarDivider as We,DeviceSwitch as Ue,InspectorIconButton as De,PanelResizeHandle as Ge,MAX_PANEL_W as Je,MIN_PANEL_W as Ye,panelWidthVars as Ke,SaveState as Xe,SaveStateToggle as Qe}from"./chunk-UB4TLWVJ.js";import{DEFAULT_CHROME_WORDS as _e}from"./chunk-Y2G7CU6A.js";import{useWords as Ze}from"./chunk-MFIRYGHW.js";import{insertSeams as qe,CanvasDragLayer as en,CanvasInsert as nn}from"./chunk-SSORUDHE.js";import{DEFAULT_DRAG_WORDS as tn}from"./chunk-O2NLQBFX.js";import{createDragSession as on,useTreeDrag as rn,gapToMoveIndex as ln}from"./chunk-67GNT6PF.js";import{useCanvasFrame as sn,LIST_SELECTOR as dn,BLOCK_SELECTOR as cn,useCanvasEvent as an}from"./chunk-AWJUYMX7.js";import{zoneKey as pn,ROOT_ID as un,ROOT_SLOT as fn,parseZoneKey as hn,find as mn,DataError as gn}from"./chunk-KRXQM65X.js";import{useRef as yn,useMemo as kn,useState as Sn,useEffect as vn,useCallback as xn,useLayoutEffect as wn,Fragment as bn}from"react";import{Tooltip as zn,Button as Bn,toast as Cn}from"efficient-shell/ui";import{UndoIcon as On,RedoIcon as In,TrashIcon as Nn,EyeOffIcon as Pn,EyeIcon as $n,DuplicateIcon as Tn}from"efficient-shell/icons/efficient";import{jsx as An,jsxs as Mn,Fragment as jn}from"react/jsx-runtime";function En({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i,words:l,saveWords:s}){if(null!==t)/* @__PURE__ */return An(Xe,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
|
|
2
|
+
return An(Xe,{tone:e.pending?"off-unsaved":"off",label:l.notSaving,role:"status"});const{tone:d,label:c}=Re(e,s),a=e.failed&&!e.paused&&/* @__PURE__ */An(Bn,{variant:"secondary",size:"sm",onClick:i,children:l.retry});/* @__PURE__ */
|
|
3
3
|
return Mn(jn,o?{children:[
|
|
4
|
-
/* @__PURE__ */An(
|
|
5
|
-
/* @__PURE__ */An(
|
|
4
|
+
/* @__PURE__ */An(Qe,{pressed:e.paused,onToggle:r,title:e.paused?l.autoSaveOff:l.autoSaveOn,children:/* @__PURE__ */An(Xe,{tone:d,label:c})}),a]}:{children:[
|
|
5
|
+
/* @__PURE__ */An(Xe,{tone:d,label:c,role:"status"}),a]})}function Rn({expand:e}){/* @__PURE__ */
|
|
6
6
|
return An("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Mn(jn,e?{children:[
|
|
7
7
|
/* @__PURE__ */An("path",{d:"M8 9l4-4 4 4"}),
|
|
8
8
|
/* @__PURE__ */An("path",{d:"M8 15l4 4 4-4"})]}:{children:[
|
|
9
9
|
/* @__PURE__ */An("path",{d:"M8 4l4 4 4-4"}),
|
|
10
10
|
/* @__PURE__ */An("path",{d:"M8 20l4-4 4 4"}),
|
|
11
|
-
/* @__PURE__ */An("path",{d:"M5 12h14"})]})})}var Ln=`${dn}, ${cn}`;function Vn(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var
|
|
12
|
-
return new Set}});vn(()=>{try{window.localStorage.setItem(tr,JSON.stringify([...rr]))}catch{}},[rr]);const[lr,sr]=Sn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(or);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}}});vn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(or,JSON.stringify(lr))}catch{}},300);return()=>clearTimeout(e)},[lr]);const dr=xn((e,n)=>sr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),cr=xn(e=>dr("left",e),[dr]),ar=xn(e=>dr("right",e),[dr]),pr=e=>rr.has(e),ur=e=>ir(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),fr=yn(!1),hr=yn(null);vn(()=>{if(fr.current&&!so){const e=hr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??ro.current?.querySelector(`button[aria-label="${CSS.escape(xt.add.title)}"]`))?.focus(),hr.current=null}fr.current=so},[so]),vn(()=>{if(!so||!lo)return;const e=e=>{"Escape"===e.key&&Ti()};return lo.addEventListener("keydown",e),()=>lo.removeEventListener("keydown",e)},[so,lo]),ke(so,()=>Ti()),vn(()=>{!Rt&&so&&(co(!1),fo(null),ao.current=!1)},[Rt]),vn(()=>{if(!
|
|
13
|
-
return An("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":xt.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},ui=n(
|
|
14
|
-
return An(Oe,{kind:"eye",label:r?xt.showNamed({name:o}):xt.hideNamed({name:o}),onClick:()=>
|
|
11
|
+
/* @__PURE__ */An("path",{d:"M5 12h14"})]})})}var Ln=`${dn}, ${cn}`;function Vn(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var Fn="__rungs";var Hn="screen:band",Wn={duplicate:!0,delete:!0};function Un(){const Re=ye(),{target:Xe,docId:Qe,capabilities:dn,currentSlug:Un,siteId:Dn,onPublish:Gn,saveState:Jn,saveConflict:Yn,retrySave:Kn,toggleAutoSave:Xn,readOnly:Qn,readOnlyReason:_n=null}=B(),Zn=M(),qn=j(),{mediaEditing:et,hasEditGuard:nt,hasPinnedChrome:tt}=dn,{appState:ot,dispatch:rt,history:it,selectedItem:lt,getSelectorForId:st,config:dt}=xe(e=>e),ct=E(),{first:at,firstGroup:pt,lastGroup:ut,isSectionGroup:ft,sectionGroupZone:ht,panelOf:mt}=ct,gt=mt(at),yt=e=>oe(ct,e),kt=e=>re(ct,e),St="node"===ct.firstRow,vt=ct.band??null,xt=Ze("screen",ve),wt=Ze("tree",Ne),bt=Ze("drag",tn),zt=Ze("save",Ee),Bt=Ze("menu",Pe),Ct=Ze("styleClipboard",Se),Ot=Ze("chrome",_e),It=R()??`/${Un}`,Nt=L(),Pt=V(),$t=x({readOnly:Qn}),Tt=x({readOnly:Qn,foldIntoHistory:!0}),At=yn(null),Mt=we(),jt=kn(()=>({...$t,select:e=>{At.current=e,$t.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Mt.config;At.current=$e(e,t,n)}$t.commitDocument(e,n)}}),[$t,Mt]),Et=ot.ui,Rt=Et.leftSideBarVisible,Lt=Et.rightSideBarVisible,{options:Vt,widths:Ft,initial:Ht,fluid:Wt,fit:Ut}=F(),[Dt,Gt]=Sn(Ht),Jt=he(),Yt=et&&null!==Jt,Kt=me(),Xt=ge();H(lt?.props.id);const{read:Qt,write:_t,forSelection:Zt}=W(),[qt,eo]=Sn(Qt);vn(()=>{_t(qt)},[qt]);const[no,to]=Sn(0),oo=yn(null),ro=yn(null),io=sn(ro,{readySelector:Ln}),lo=f(ro);h(ro,io);const[so,co]=Sn(!1),ao=yn(!1),po=yn(!1),[uo,fo]=Sn(null),ho=U(),mo=e=>fo(null===e?null:{zone:le,index:e}),[go,yo]=Sn([]),[ko,So]=Sn(D),vo="puck"===ko.kind,xo=so&&!uo&&ho.railTarget?ho.railTarget(ot.data,{node:lt??null,mode:ko}):null,wo=xo?{zone:pn(xo),index:xo.index}:null,bo=uo??wo,zo=bo&&bo.zone===le?bo.index:null,Bo=t(ko,lt?.props.id),[Co,Oo]=Sn(null);vn(()=>{Co&&(o(),Oo(null))},[Co]);const Io=yn(st);Io.current=st;const No=xn((e,{scroll:n})=>{eo(n=>Zt(e,n)),n&&Oo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Io.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&ir(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Po=yn(null);vn(()=>{const e=Po.current;Po.current=null;const n=null==lt?.props.id?null:String(lt.props.id);So(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:mt(lt?.type)??D);const t=lt?.props.id,o=At.current;if(At.current=null,!t)return;const i=st(t);No(String(t),{scroll:!r(o,i??null,le)})},[lt?.props.id,No]);const $o=xn(e=>{So(n=>G(n,e)?n:e),rt({type:"setUi",ui:{rightSideBarVisible:!0}})},[rt]),To=yn(()=>{});To.current=(e,n)=>{const t=e?Zr(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==lt?.props.id?null:String(lt.props.id);So(e=>G(e,n)?e:n),o!==r&&(Po.current={id:o,mode:n},jt.select(e))};const Ao=xn((e,n)=>To.current(e,n),[]),Mo={kind:ko.kind,mode:ko,open:$o,show:e=>So(e),reveal:()=>{Lt||rt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Ao},jo=J(Mo,{data:ot.data,selected:lt??null,zoneOf:e=>st(e)?.zone,readOnly:Boolean(Qn),select:e=>{So(D),jt.select({index:e})},replace:(e,n)=>jt.replaceComponent(le,e,n),scrollTo:e=>bi(e)},{device:Dt,refreshes:no},{setView:eo,reveal:()=>{Rt||rt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Eo=jo.pinnedSource??!1,Ro=jo.resolveLeftView?jo.resolveLeftView(qt,Yt):"media"===qt&&Yt?qt:"sections",Lo=Y(),{isLockedBlock:Vo,duplicateBlocked:Fo,nestDepth:Ho,newSectionNode:Wo,canAddTo:Uo,blockIsOffered:Do}=Lo,Go=K(),{labelAtLevel:Jo,Icon:Yo,useProducts:Ko}=Go,Xo=Go.rowName?(e,n,t)=>Go.rowName(e,n,t):void 0,Qo=xn(e=>{rt({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),No(e,{scroll:!0})},[rt,No]),{selectNode:_o,openPartId:Zo}=v({mode:ko,setMode:So,onOpenPart:Qo}),[qo,er]=Sn(null);ke(null!==qo,()=>er(null));const nr=y(X()),tr=nr.collapsed,or=nr.panelWidths,[rr,ir]=Sn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(tr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
|
|
12
|
+
return new Set}});vn(()=>{try{window.localStorage.setItem(tr,JSON.stringify([...rr]))}catch{}},[rr]);const[lr,sr]=Sn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(or);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}}});vn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(or,JSON.stringify(lr))}catch{}},300);return()=>clearTimeout(e)},[lr]);const dr=xn((e,n)=>sr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),cr=xn(e=>dr("left",e),[dr]),ar=xn(e=>dr("right",e),[dr]),pr=e=>rr.has(e),ur=e=>ir(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),fr=yn(!1),hr=yn(null);vn(()=>{if(fr.current&&!so){const e=hr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??ro.current?.querySelector(`button[aria-label="${CSS.escape(xt.add.title)}"]`))?.focus(),hr.current=null}fr.current=so},[so]),vn(()=>{if(!so||!lo)return;const e=e=>{"Escape"===e.key&&Ti()};return lo.addEventListener("keydown",e),()=>lo.removeEventListener("keydown",e)},[so,lo]),ke(so,()=>Ti()),vn(()=>{!Rt&&so&&(co(!1),fo(null),ao.current=!1)},[Rt]),vn(()=>{if(!Kt)return po.current&&rt({type:"setUi",ui:{leftSideBarVisible:!1}}),void(po.current=!1);so&&(co(!1),fo(null),po.current=ao.current,ao.current=!1),Rt||(po.current=!0,rt({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Kt]),vn(()=>{!Rt&&Kt&&(po.current=!1,Xt())},[Rt]),vn(()=>{if(!Kt||!lo)return;const e=e=>{"Escape"===e.key&&Xt()};return lo.addEventListener("keydown",e),()=>lo.removeEventListener("keydown",e)},[Kt,lo]),ke(null!==Kt,()=>Xt());const mr=Q(),gr=(e,n="success",t)=>{if(mr)return void(t?mr(e,"error"===n?"error":"info",t):mr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Cn.error(e,{...o,duration:t?.duration??3200}):Cn.success(e,{...o,duration:t?.duration??1900})},yr=yn(null),[kr,Sr]=Sn(0),[vr,xr]=Sn(0),wr=_(),br=yn(null),zr=e=>Math.max(0,e.clientHeight-(br.current?.offsetHeight??0));vn(()=>{const e=yr.current;if(!e)return;const n=()=>{Sr(e.clientWidth),xr(zr(e))};n();const t=new ResizeObserver(n);return t.observe(e),br.current&&t.observe(br.current),()=>t.disconnect()},[]),wn(()=>{yr.current&&(Sr(yr.current.clientWidth),xr(zr(yr.current)))},[lr,Rt,Lt]);const Br=Dt===Wt?kr>0?kr:Ft[Wt]:Ft[Dt],Cr=kr>0?Math.min(kr/Br,"shrink"===Ut?1:2):1,Or=Br*Cr,Ir=kr>0&&Or>kr+1,Nr={width:Or,height:vr||"100%",flex:"none",position:"relative"},Pr={width:Br,height:vr?vr/Cr:"100%",maxHeight:"none",transform:1!==Cr?`scale(${Cr})`:void 0,transformOrigin:"top left"},$r=()=>rt({type:"setUi",ui:{leftSideBarVisible:!Rt}}),Tr=()=>rt({type:"setUi",ui:{rightSideBarVisible:!Lt}}),Ar=e=>{so&&(co(!1),fo(null),ao.current=!1,Rt&&qt===e)||Kt&&(po.current=!1,Xt(),Rt&&qt===e)||(Rt&&qt===e?$r():(eo(e),Rt||rt({type:"setUi",ui:{leftSideBarVisible:!0}})))},Mr=()=>{C(Re,{accept:"image/*",title:Ot.mediaLibrary})},jr=()=>{So(D),jt.select(null),u()},Er=()=>{So(gt??D),Lt||rt({type:"setUi",ui:{rightSideBarVisible:!0}})},Rr=ot.data.content??[],Lr=()=>{const e=Rr.findIndex(yt),n=Rr.findIndex(kt);return{floor:e>=0?e+1:0,cap:n>=0?n:Rr.length}},Vr=dt,Fr=Lo.stripCopy,Hr=e=>i(e,Fr),Wr=w(),Ur=Te({data:ot.data,config:Vr,readOnly:Boolean(Qn),clipboard:Wr,strip:Fr?e=>Fr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==un||e.slot!==fn)return{min:0,max:n-1};const{floor:t,cap:o}=Lr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&So(D);const t=void 0===n||"node"===n?.kind?n:null;jt.commitDocument(e,t)}}),Dr=e=>{const n=mn(ot.data,dt,e);if(!n)return!1;const t=pn(n.place),o=n.node,r=t===le?Xr(o):ci(o);return!!Ur.remove(e)&&(gr(xt.deleted({name:r}),"success",{duration:8e3,action:{label:xt.bar.undo,onClick:()=>{Ur.restore(n.node,n.place)}}}),!0)},Gr={...Ur,remove:Dr},Jr=e=>Jo(e,"block",dt.components[e]?.label??e),Yr=xn(e=>dt.components[e]?.defaultProps??{},[dt]),Kr=e=>Jo(e,"section",Jr(e)),Xr=e=>l({type:e.type,props:e.props??{}},Kr(e.type),Xo),{nodeAddresses:Qr,zoneItems:_r}=kn(()=>{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(dt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(Rr,le,0),{nodeAddresses:e,zoneItems:n}},[Rr,dt]),Zr=xn(e=>_r.get(e)??[],[_r]),qr=e=>{const n=Qr.get(e);return n?Zr(n.zone)[n.index]:void 0},ei=e=>ie(Lo,dt,e),ni=e=>{if(!Lo.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=qr(e.slice(0,n));if(!t)return null;const o=ei(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}},ti=(()=>{if(!Z(ko))return null;const e=`${ko.nodeId}:${ko.slot}`;return ni(e)?.slot.panel===ko.kind?e:null})(),oi=yn(null);vn(()=>{const e=oi.current;if(oi.current=null,!ti||!Z(ko))return;const n=ko.nodeId;No(n,{scroll:e!==ti}),ir(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[ko]);const ri=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Qr.get(e);n&&(n.zone===le?zi(n.index):el(n.zone,n.index,e,qr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&ti!==i&&(oi.current=i),Ao(null,r),Lt||rt({type:"setUi",ui:{rightSideBarVisible:!0}}),bi(o)},ii=(e,n,t)=>{const o=`${e}:${n}`;if(ir(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;ti!==o&&(oi.current=o);Ao(null,{kind:t,nodeId:e,slot:n})},li=(e,n,t)=>{if(Qn||!Lo.moveSlot)return;const o=qr(e),r=o?ei(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Fn,index:n},s=ln(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=Lo.moveSlot(e,n,s);"string"==typeof d&&ii(e,d,i.panel)},si=Ko(),di=kn(()=>{const e=/* @__PURE__ */new Map;for(const n of si??[])e.set(n.slug,n.name);return e},[si]),ci=e=>s(e,Jr,Go.plainText,e=>di.get(e),Go.rowName),ai=(e,n)=>{const t=dt.components[e.type]?.fields,o=n===le||kl(n)?"section":"block",r=n===le&&(yt(e)||kt(e)||ft(e.type)),i="block"===o?d(t):r?null:c(t);return Go.renamePropOf?Go.renamePropOf(e,o,i):i},pi=(e,n,t,o)=>{if(!(!Qn&&qo?.zone===e&&qo.index===n))return;const r=(t,o)=>{er(null),o&&((e,n,t)=>{const o=Zr(e)[n];if(!o)return;const r=ai(o,e);r&&jt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
|
|
13
|
+
return An("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":xt.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},ui=n(q(),Ct),fi=ui.scope({target:Xe,siteId:Dn,docId:Qe}),hi=dt,mi=(e,n)=>n===le?Kr(e):Jr(e),gi=(e,n,t)=>{const o=ui.plan(fi,t,mi(t.type,e),hi);o&&(o.changed&&jt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),gr(o.message))},yi=b({nodesIn:Zr,nodeAt:(e,n)=>Zr(e)[n]??null,labelOf:(e,n)=>n===le?Kr(e):Jr(e),renamePropOf:ai,beginRename:(e,n)=>er({zone:e,index:n}),history:{hasPast:it.hasPast,hasFuture:it.hasFuture,back:()=>it.back(),forward:()=>it.forward()},openAddSection:()=>{jt.select(null),Pi(null)},openPageSettings:()=>{jt.select(null),So(D)},pageSettingsLabel:xt.pageSettings,words:{menu:Bt,styleClipboard:Ct,screen:xt.menu},readOnly:Boolean(Qn),collapseAll:()=>ir(new Set(Zr(le).map(e=>String(e.props.id)))),onPasteRefused:e=>gr(e?xt.pasteRefused({name:e.label}):xt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>vl(e,n),menuRows:jo.menuRows,isLocked:e=>Vo(e.type),duplicateBlocked:e=>Fo(ot.data,e),permits:e=>se(dt,e.type),canAddTo:Uo,nodeOps:Gr,isPinned:(e,n)=>n===le&&(yt(e)||kt(e)),sectionBand:Lr,openAddInside:(e,n)=>{e===le?zi(n):jt.select({zone:e,index:n}),Pi(null)},locate:e=>Qr.get(e)??null,rowNameOf:(e,n)=>n===le?Xr(e):ci(e),selectAt:(e,n,t,o)=>{e===le?zi(n):el(e,n,t,o??"")},slotRung:e=>{const n=ni(e);return n?.slot.panel?{label:n.slot.label,select:()=>ri(n.node,n.slot,!1)}:null},style:{held:()=>O(fi),canCopy:e=>ui.rows(hi,e).some(e=>!1!==e.counted),copy:(e,n)=>ui.copy(fi,e,mi(e.type,n),hi),paste:(e,n,t)=>gi(e,n,t)},keys:qn?{target:lo,selected:()=>{const e=ot.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>Wr.get(),readOnly:Boolean(Qn),onDone:({done:e,name:n})=>{"copied"===e&&gr(xt.copied({name:n}))}}:void 0},io),ki=yn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});vn(()=>{ki.current={copy:(e,n)=>ui.copy(fi,e,mi(e.type,n),hi),paste:gi,at:()=>{const e=ot.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Zr(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Qn)}});const Si=xn(e=>{const n=I(e);if(!n)return;const t=ki.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))},[]);vn(()=>{if(!lo)return;const e=e=>Si(e);return lo.addEventListener("keydown",e),()=>lo.removeEventListener("keydown",e)},[Si,lo]),an(io,"keydown",Si);const vi=Rr.map(e=>e.props.id).join("|");vn(()=>{const e=io?.document??null,n=io?.window??null;let t=0;const o=[],r=()=>{if(!e)return void yo(e=>e.length?[]:e);const n=Rr.findIndex(kt),t=n>=0?n:Rr.length,o=n=>{const t=Rr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(cn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=Rr.length>0&&!yt(Rr[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=Vn(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}yo(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[io,vi,Dt,Cr,Rt,Lt,lt?.props.id]);const xi=io?.document??null,wi=io?.window??null;vn(()=>{const e=oo.current;if(!e||!xi||!wi)return;const n=[],t=()=>{const n=xi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&wi.scrollTo({left:wi.scrollX,top:wi.scrollY+t,behavior:"instant"}),!0};return oo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[xi,wi]);const bi=e=>{jo.holdCanvasOn?jo.holdCanvasOn(e):a(e)},zi=e=>{So(D),jt.select({index:e}),jo.sectionPressed?.(Rr[e]);const n=Rr[e]?.props?.id;n&&bi(n)},Bi=e=>{const{floor:n,cap:t}=Lr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=lt&&ko.kind!==gt?.kind?Rr.findIndex(e=>e.props.id===lt.props.id):-1;return o(r>=0?r+1:t)},Ci=(e,n)=>{const{floor:t,cap:o}=Lr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(jt.reorderComponent(le,e,i),jt.select({index:i}),{moved:!0,dest:i})},Oi=(e,n,t,o)=>{So(D),jt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),gr(xt.sectionAdded({name:t}))},Ii=(e,n)=>{const t=Bi(n),o=Wo(e,{nodeDefaults:Yr,newNodeId:fe,sectionLabel:Kr,blockIsOffered:Do}),r=o?jt.insertNode(le,t,o):jt.insertSection(e,t);return Oi(t,r,Kr(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(dt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Uo(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},Ni=(e,n,t)=>{const o=Bi(t),r=jt.insertNode(le,o,n);return Oi(o,r,e),o},Pi=e=>$i(le,e),$i=(e,n)=>{hr.current=document.activeElement??null,Kt&&(ao.current=po.current,po.current=!1,Xt()),fo(null===n?null:{zone:e,index:n}),co(!0),Rt||(ao.current=!0,rt({type:"setUi",ui:{leftSideBarVisible:!0}}))},Ti=()=>{co(!1),fo(null),ao.current&&rt({type:"setUi",ui:{leftSideBarVisible:!1}}),ao.current=!1},Ai=(e,n,t)=>{if("section"===e.kind)jt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;jt.insertNode(n,t,Hr(e.template.node))}So(D),jt.select({index:t,zone:n})},Mi=(e,n)=>Go.rowName?n?yt(e)?Go.rowName(e,"section",xt.header):kt(e)?Go.rowName(e,"section",xt.footer):ft(e.type)?Go.rowName(e,"section",Jr(e.type)):Xr(e):ci(e):n?Kr(e.type):Jr(e.type),ji=e=>n=>{e()},Ei=()=>jo.editPinnedSource?.(),Ri=(e,n,t)=>{if(Qn)return null;const o=Zr(e)[n];return o&&!se(dt,o.type).delete?null:/* @__PURE__ */An(Oe,{kind:"delete",label:xt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Zr(e)[n]?.props?.id;null!=t&&Dr(String(t))})(e,n),children:/* @__PURE__ */An(Nn,{size:15})})},Li=e=>Go.rowPreview?.(e)||void 0,Vi=e=>Go.rowMarks?.(e)??void 0,Fi=(e,n,t)=>Go.rowActions?.(e,n,t)??null,Hi=(e,n,t,o)=>{if(Qn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
|
|
14
|
+
return An(Oe,{kind:"eye",label:r?xt.showNamed({name:o}):xt.hideNamed({name:o}),onClick:()=>Ui(e,n,t),children:/* @__PURE__ */An(r?Pn:$n,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},Wi=e=>{const n=Kr(Rr[e]?.type??""),t=n?xt.addSectionBefore({name:n}):xt.addSectionHere;return Ul(le,e,()=>Pi(e),t)},Ui=(e,n,t)=>{jt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Di=e=>ae(dt,e),Gi=e=>ce(dt,e),Ji=e=>Lo.slotsOf?ei(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Gi(e)}],Yi=e=>Lo.slotsOf?Ji(e).flatMap(e=>e.kids):Gi(e),Ki=e=>Boolean(Lo.slotsOf)&&ei(e).some(e=>e.rung),Xi=(e,n,t)=>null===t?void 0===n?Uo(e):Uo(e,n):Uo(e,n,t),Qi=(e,n,t)=>{const o=ue(dt,e.type,n)&&(t||Yi(e).length>0||Ki(e));return{collapsible:o,folded:o&&pr(String(e.props.id))}},_i=(e,n,t)=>Ji(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Qi(e,r,t(e.type)).collapsible?[String(e.props.id),..._i(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Zi=e=>Yi(e).length>0||Ki(e)||Boolean(Uo(e.type)),qi=e=>Boolean(Uo(e)),el=(e,n,t,o)=>{if(So(D),Uo(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),jt.select({index:n,zone:e}),a(t)}else jt.select({index:n,zone:e}),bi(t)},nl=(e,n,t,o,r)=>{const i=`${e}:${n}`;jt.insertComponent(i,t,o),Uo(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),jt.select({index:o,zone:i})}):jt.select({index:o,zone:i})},tl=(e,n,t)=>{jt.insertComponent(e,n,t),So(D),jt.select({index:t,zone:e})},ol=yn(/* @__PURE__ */new Set);vn(()=>{Rr.forEach(e=>{const n=Uo(e.type)?.spec;if(!n)return;const t=e.props.id;if(ol.current.has(t))return;ol.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(Yr)).forEach((e,t)=>Tt.seedChild(o,t,n.childType,e))})},[Rr,Tt,Yr]);const rl=yn(/* @__PURE__ */new Set);vn(()=>{Rr.forEach((n,t)=>{const o=n.props.id;if(rl.current.has(o))return;const r=e(n,Di(n.type));rl.current.add(o),r&&Tt.replaceComponent(le,t,{...n,props:r})})},[Rr,Tt]),ee(Tt,dt);const il=Rr.findIndex(kt),ll=il>=0?Rr[il]:null,sl=St?Rr.findIndex(yt):-1,dl=sl>=0?Rr[sl]:null,cl=Rr.find(e=>e.type===pt)??null,al=Rr.find(e=>e.type===ut)??null,pl=il>=0?il:Rr.length,ul=[];Rr.forEach(e=>{kt(e)||(Zi(e)&&ul.push(String(e.props.id)),ul.push(..._i(e,1,qi)))}),ll&&(ul.push(String(ll.props.id)),ul.push(..._i(ll,1,qi)));const fl=ul.length>0&&ul.every(e=>rr.has(e)),hl=e=>{const n=Go.blockRowName(e,Jr);return Go.rowName?Go.rowName(e,"block",n):n},ml=(e,n,t,o)=>{const r=Zr(e)[t];if(!r)return;const i={...hn(e),index:t},l={...hn(n),index:Math.min(Math.max(o,0),Zr(n).length)},s=ln(i,l);if(e!==n||s!==t)try{Ur.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof gn))throw e}},gl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Gi(e))n.add(r),t(o)};for(const t of Di(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},yl=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Qr.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},kl=e=>{const n=e.slice(0,e.indexOf(":")),t=Rr.find(e=>ft(e.type)&&String(e.props.id)===n);return t&&ht(n)===e?t:null},Sl=(e,n,t)=>{if(e.rung){const t=qr(e.rung.nodeId),o=t?ei(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Fn&&n.index>=0&&n.index<=o}if(n.slot===Fn)return!1;if(e.add)return wl(e.add,n);const o=pn(n);if(ft(e.type))return!1;const r=kl(o),i=kl(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Zr(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=Lr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Zr(o).length)return!1;if(e.zone===o)return!0;const l=ll&&!ct.lastIsOpen?String(ll.props.id):null;return(!l||yl(e.zone)!==l&&yl(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Zr(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Qr.get(i),s=l?Zr(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&gl(r).has(n))return!1;const d=Uo(s.type,Ho(ot?.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?.(Zr(n),r))})(e.zone,o,e.index,t)},vl=(e,n)=>{const t=pn(e.from);if(t===pn(n))return!0;const o=e.node;return Sl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},xl=e=>{const n=e.slice(0,e.indexOf(":")),t=Qr.get(n),o=t?Zr(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Uo(o.type,Ho(ot?.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:Jr(r.spec.childType)}]:[]),l=ni(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Mi(o,t.zone===le)}},wl=(e,n)=>{const t=pn(n);if("block"!==e.kind){if(kl(t))return n.index>=0&&n.index<=Zr(t).length;if(t!==le)return!1;const{floor:e,cap:o}=Lr();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=xl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Zr(t))},bl=(e,n)=>{e.rung?li(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&kl(pn(n)))return void Ai(e,pn(n),n.index);if("section"===e.kind)return void Ii(e.type,n.index);if("template"===e.kind)return void Ni(e.template.name,Hr(e.template.node),n.index);const t=pn(n),o=xl(t);o&&(o.target.spec?nl(o.parentId,o.target.slot,e.type,n.index,o.parent.type):tl(t,e.type,n.index))})(e.add,n):e.zone===le?Ci(e.index,n.index):ml(e.zone,pn(n),e.index,n.index)},[zl]=Sn(()=>on()),Bl=rn({keyOf:e=>e.id,readOnly:Boolean(Qn),session:zl,canDrop:Sl,onDrop:bl,onStep:(e,n)=>{e.rung?li(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=Kr(Rr[e]?.type??""),o=Ci(e,n<0?e-1:e+2);if(!o.moved)return void gr(n<0?xt.sectionFirst({name:t}):xt.sectionLast({name:t}));const{floor:r,cap:i}=Lr();gr(xt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):ml(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Cl=xn(e=>{const{floor:n,cap:t}=Lr(),o=[];for(const r of e.nodes){const e=pn(r.place),i=Zr(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(yt(i)||kt(i)||Vo(i.type))continue;if(ft(i.type))continue;const l=Boolean(kl(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?Kr(i.type):ci(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=pn(e.list);return n===le&&0===e.children.length?[{...e,addLabel:xt.addSection,addAlways:!0}]:e.children.length>0||Boolean(xl(n)?.choices.length)||Boolean(kl(n))?[e]:[]}),i=r.flatMap(e=>{const n=pn(e.list);return n===le||kl(n)||!xl(n)?.choices.length?[]:qe(e,xt.addBlockHere)});return{sources:o,zones:r,seams:i}},[ot.data]),Ol=null==lt?.props.id?null:String(lt.props.id),Il=xn(e=>{const n=dt,t=e=>!e.item.rung&&null!==mn(ot.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(Ol);return i||(r(Ae(ot.data,n,o.item.id,Ol))??o)},[ot.data,dt,Ol]),Nl=e=>{So(D),jt.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},Pl=ne(),$l=()=>({data:ot.data,device:Dt,ops:jt,inspector:Mo}),Tl=Pl?.model,Al=kn(()=>Tl?e=>Tl(e,Cl(e),$l()):Cl,[Tl,Cl,Dt]),Ml=Pl?.measure,jl=Ml?(e,n)=>Ml(e,n,$l()):void 0,El=Pl?.canDrop,Rl=El?(e,n)=>El(e,n,Sl,$l()):Sl,Ll=Pl?.drop,Vl=Ll?(e,n)=>Ll(e,n,bl,$l()):bl,Fl=Pl?.pick,Hl=Fl?e=>Fl(e,Nl,$l()):Nl,Wl=e=>{const n=pn(e),t=ni(n);t&&ri(t.node,t.slot,!1),$i(n,e.index)},Ul=(e,n,t,o)=>/* @__PURE__ */An(Ie,{...Qn?{}:Bl.seam({place:{...hn(e),index:n}}),onAdd:Qn?void 0:t,label:o},`seam:${e}:${n}`),Dl={rowClick:ji,isCollapsed:pr,toggleCollapse:ur},Gl=e=>{const n=String(e.props.id),t=Rr.findIndex(e=>String(e.props.id)===n),o=ht(n),r=Zr(o),i=pr(n),l=Jr(e.type),s=Go.rowName?Go.rowName(e,"section",l):l,d=e=>Ul(o,e,()=>$i(o,e),xt.addSectionHere);/* @__PURE__ */
|
|
15
15
|
return Mn(jn,{children:[
|
|
16
|
-
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:e.type,size:13}),name:s,preview:Li(e),marks:Vi(e),onSelect:()=>zi(t),nameSlot:pi(le,t,n,s),selected:Bo===n,actions:
|
|
16
|
+
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:e.type,size:13}),name:s,preview:Li(e),marks:Vi(e),onSelect:()=>zi(t),nameSlot:pi(le,t,n,s),selected:Bo===n,actions:Fi(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:ji(()=>zi(t))},fold:{open:!i,label:"section",onToggle:()=>ur(n)}}),!i&&/* @__PURE__ */Mn(ze,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Xr(n),l=Zi(n),s=l&&pr(r),c=()=>el(o,t,r,e.type),{rowProps:a,...p}=Bl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...hn(o),index:t}},{"data-node-id":r,onClick:ji(c)});/* @__PURE__ */
|
|
17
17
|
return Mn(bn,{children:[d(t),
|
|
18
|
-
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:n.type,size:13}),name:i,preview:Li(n),marks:Vi(n),onSelect:c,nameSlot:pi(o,t,r,i),selected:Bo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>ur(r)}:void 0,actions:/* @__PURE__ */Mn(jn,{children:[Ri(o,t,i),
|
|
18
|
+
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:n.type,size:13}),name:i,preview:Li(n),marks:Vi(n),onSelect:c,nameSlot:pi(o,t,r,i),selected:Bo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>ur(r)}:void 0,actions:/* @__PURE__ */Mn(jn,{children:[Ri(o,t,i),Fi(n,o,t),Hi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */An(ze,{children:Kl(n,2)})]},r)}),d(r.length)]})]})},Jl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=Bl.dragging,d=!pr(l)&&s?.rung?.nodeId!==i,c={...hn(l),index:0},a=s&&!s.rung&&Sl(s,c)?c:void 0,p=()=>ri(e,n,!0),{rowProps:u,...f}=Bl.row({item:{id:`rung:${l}`,zone:`${i}:${Fn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Fn,index:t},into:a,canDrag:Boolean(Lo.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:ji(p)}),h=Qn?null:Lo.slotActions?.(e,n.slot);/* @__PURE__ */
|
|
19
19
|
return Mn(bn,{children:[n.heading,
|
|
20
|
-
/* @__PURE__ */An(be,{words:wt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:ti===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>ur(l)},actions:h&&h.length>0?/* @__PURE__ */An(jn,{children:h.map((t,o)=>/* @__PURE__ */An(Oe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(
|
|
21
|
-
return An(jn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=
|
|
20
|
+
/* @__PURE__ */An(be,{words:wt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:ti===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>ur(l)},actions:h&&h.length>0?/* @__PURE__ */An(jn,{children:h.map((t,o)=>/* @__PURE__ */An(Oe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Qn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&ii(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__ */An(Nn,{size:15}):/* @__PURE__ */An(Tn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */An(ze,{children:r})]},l)},Yl=(e,n)=>{const t=Ji(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
|
|
21
|
+
return An(jn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Xi(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(xl(c)?.choices.length),p=(e,n)=>a?Ul(e,n,()=>$i(e,n),xt.addBlockHere):Ul(e,n),u=/* @__PURE__ */Mn(jn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Bo===String(n.props.id),{collapsible:i,folded:s}=Qi(n,l,qi(n.type)),d=String(n.props.id),c=hl(n),a=()=>el(t,o,d,e.type),{rowProps:u,...f}=Bl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...hn(t),index:o}},{"data-node-id":d,onClick:ji(a)});/* @__PURE__ */
|
|
22
22
|
return Mn(bn,{children:[0===o&&p(t,0),
|
|
23
|
-
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:n.type,size:13}),name:c,preview:Li(n),marks:Vi(n),onSelect:a,nameSlot:pi(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>ur(d)}:void 0,actions:/* @__PURE__ */Mn(jn,{children:[Ri(t,o,c),
|
|
24
|
-
return An(jn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=
|
|
23
|
+
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:n.type,size:13}),name:c,preview:Li(n),marks:Vi(n),onSelect:a,nameSlot:pi(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>ur(d)}:void 0,actions:/* @__PURE__ */Mn(jn,{children:[Ri(t,o,c),Fi(n,t,o),Hi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */An(ze,{children:Yl(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?Jl(e,t.rung,r++,o,u):/* @__PURE__ */An(bn,{children:u},t.slot??"")})})},Kl=(e,n)=>{const t=Ho(ot?.data,e.type,String(e.props.id)),o=Ji(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
|
|
24
|
+
return An(jn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Xi(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)?()=>nl(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>$i(n,t):void 0;return Ul(n,t,o,n===f&&c?c.addLabel:xt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Mn(jn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Bo===String(n.props.id),i=ci(n),l=String(n.props.id),{collapsible:d,folded:c}=Qi(n,s,qi(n.type)),a=Di(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...hn(p),index:Zr(p).length}:void 0,f=Bl.dragging,h=u&&f&&Sl(f,u)?u:void 0,g=()=>el(t,o,l,e.type),{rowProps:y,...k}=Bl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...hn(t),index:o},into:h,canDrag:!Vo(n.type)},{"data-node-id":l,onClick:ji(g)});/* @__PURE__ */
|
|
25
25
|
return Mn(bn,{children:[0===o&&m(t,0),
|
|
26
|
-
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:n.type,size:13}),name:i,preview:Li(n),marks:Vi(n),onSelect:g,nameSlot:pi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>ur(l)}:void 0,actions:Vo(n.type)?
|
|
27
|
-
/* @__PURE__ */An(N,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>nl(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?
|
|
28
|
-
return Mn(bn,{children:[n>0&&
|
|
29
|
-
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:e.type,size:13}),name:
|
|
26
|
+
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:n.type,size:13}),name:i,preview:Li(n),marks:Vi(n),onSelect:g,nameSlot:pi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>ur(l)}:void 0,actions:Vo(n.type)?Fi(n,t,o)??void 0:/* @__PURE__ */Mn(jn,{children:[Ri(t,o,i),Fi(n,t,o),Hi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */An(ze,{children:Kl(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
|
|
27
|
+
/* @__PURE__ */An(N,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>nl(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?Jl(e,o.rung,i++,r,k):/* @__PURE__ */An(bn,{children:k},o.slot??"")})})},Xl=(()=>{if(!lt||!vo)return null;const e=String(lt.type),n=String(lt.props.id),t=Uo(e,Ho(ot?.data,e,n));if(!t||"footer"===t.source)return null;const o=Rr.some(e=>String(e.props?.id)===n),r=Array.isArray(lt.props[t.slot])?lt.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Jr(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:Mi(lt,o),choices:i,onPick:o=>{t.spec?nl(n,t.slot,o,r.length,e):tl(`${n}:${t.slot}`,o,r.length)}}})(),Ql=bo&&bo.zone!==le&&!kl(bo.zone)?bo.zone:null,_l=!0===ho.blocksFirst,Zl=Ql?xl(Ql):_l&&bo?null:Xl,ql=Boolean(uo&&Ql)||_l&&Boolean(Zl&&Zl.choices.length>0),es=so||null!==Kt,ns=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Rt&&!es&&Ro===e.id,onSelect:()=>Ar(e.id)}:e,ts=[{id:"add",label:xt.add.title,icon:/* @__PURE__ */An("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:so,onSelect:()=>so?Ti():Pi(null)},...(jo.railLead??[]).map(ns),{id:"sections",label:xt.layers,icon:/* @__PURE__ */An(Me,{}),active:Rt&&!es&&"sections"===Ro,onSelect:()=>Ar("sections")},...(jo.railTrail??[]).map(ns)];Yt?ts.push({id:"media",label:xt.railMedia,icon:/* @__PURE__ */An(je,{}),active:Rt&&!so&&(null!==Kt||"media"===Ro),onSelect:()=>Ar("media")}):et&&ts.push({id:"media",label:xt.railMedia,icon:/* @__PURE__ */An(je,{}),onSelect:Mr});const os=[...jo.railLead??[],...jo.railTrail??[]].find(e=>"panel"in e&&e.id===Ro),rs=Boolean(vt?.foldable)&&!Eo,is=vt?.label??(nt?xt.pageSections:xt.templateSections),ls=rs&&pr(Hn),ss=/* @__PURE__ */Mn(jn,{children:[Rr.map((e,n)=>{if(yt(e)||kt(e)||ft(e.type))return null;const t=Bo===String(e.props.id),o=Boolean(e.props._hidden);Gi(e);const r=String(e.props.id),i=jo.hasOwnRows?.(e)??!1,l=Zi(e)||i,s=l&&pr(r),d=Di(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...hn(c),index:Zr(c).length}:void 0,p=Bl.dragging,u=a&&p&&Sl(p,a)?a:void 0,{rowProps:f,...h}=Bl.row({item:{id:r,zone:le,index:n,type:e.type},place:{...hn(le),index:n},into:u},{"data-node-id":r,onClick:ji(()=>zi(n))});/* @__PURE__ */
|
|
28
|
+
return Mn(bn,{children:[n>0&&Wi(n),
|
|
29
|
+
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:e.type,size:13}),name:Xr(e),preview:Li(e),marks:Vi(e),onSelect:()=>zi(n),nameSlot:pi(le,n,r,Xr(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>ur(r)}:void 0,actions:/* @__PURE__ */Mn(jn,{children:[Ri(le,n,Xr(e)),Fi(e,le,n),Hi(le,n,e,Xr(e))]}),rowProps:f}),Zi(e)&&!s&&/* @__PURE__ */Mn(ze,{children:[Kl(e,1),jo.partRows?.(e,Dl)]}),i&&!s&&/* @__PURE__ */An(ze,{children:jo.ownRows?.(e,n,Dl)})]},String(e.props.id??n))}),!Eo&&pl>0&&Wi(pl),vt?.addAtEnd&&!Eo&&!Qn&&/* @__PURE__ */An(N,{small:!0,label:xt.addSection,blocked:null,onAdd:()=>Pi(pl)})]}),ds=(e,n,t)=>{const o=String(e.props.id),r=Yi(e).length>0||Ki(e)||Boolean(Uo(e.type)),i=r&&pr(o),l="header"===t?xt.header:xt.footer,s=Go.rowName?Go.rowName(e,"section",l):l;/* @__PURE__ */
|
|
30
30
|
return Mn(jn,{children:[
|
|
31
|
-
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:t,size:13}),name:s,preview:Li(e),marks:Vi(e),onSelect:()=>zi(n),nameSlot:pi(le,n,o,s),selected:Bo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>ur(o)}:void 0,actions:
|
|
32
|
-
/* @__PURE__ */An(te,{target:io,children:/* @__PURE__ */Mn("div",{ref:ro,className:"sf-editor es-editor",style:
|
|
31
|
+
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:t,size:13}),name:s,preview:Li(e),marks:Vi(e),onSelect:()=>zi(n),nameSlot:pi(le,n,o,s),selected:Bo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>ur(o)}:void 0,actions:Fi(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:ji(()=>zi(n))}}),r&&!i&&/* @__PURE__ */An(ze,{children:Yl(e,1)})]})};return(jo.wrap??(e=>e))(
|
|
32
|
+
/* @__PURE__ */An(te,{target:io,children:/* @__PURE__ */Mn("div",{ref:ro,className:"sf-editor es-editor",style:Ke(lr),onContextMenu:yi.onEditorContextMenu,...m(Re),children:[
|
|
33
33
|
/* @__PURE__ */Mn(Le,{children:[
|
|
34
34
|
/* @__PURE__ */An(Ve,{items:ts,ariaLabel:xt.bar.views}),
|
|
35
|
-
/* @__PURE__ */Mn(
|
|
36
|
-
/* @__PURE__ */An(
|
|
37
|
-
/* @__PURE__ */An(
|
|
38
|
-
/* @__PURE__ */An(
|
|
39
|
-
/* @__PURE__ */An(
|
|
40
|
-
/* @__PURE__ */Mn(
|
|
41
|
-
/* @__PURE__ */An(En,{saveState:
|
|
42
|
-
/* @__PURE__ */An(zn,{content:xt.bar.refreshTip,side:"bottom",children:/* @__PURE__ */An(Bn,{variant:"secondary",onClick:()=>{oo.current=(()=>{const e=io?.document;if(!e)return null;const n=Rr.findIndex(kt),t=n>=0?n:Rr.length;let o=null;for(let n=0;n<t;n++){const t=Rr[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=lt?.props?.id??Rr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),to(e=>e+1)},children:xt.bar.refresh})}),jo.barTrail?.(),jo.barMain?jo.barMain():/* @__PURE__ */An(Bn,{variant:"primary",disabled:null!==
|
|
35
|
+
/* @__PURE__ */Mn(Fe,{children:[
|
|
36
|
+
/* @__PURE__ */An(He,{label:xt.bar.undo,disabled:Boolean(Qn)||!it.hasPast,onClick:()=>it.back(),children:/* @__PURE__ */An(On,{})}),
|
|
37
|
+
/* @__PURE__ */An(He,{label:xt.bar.redo,disabled:Boolean(Qn)||!it.hasFuture,onClick:()=>it.forward(),children:/* @__PURE__ */An(In,{})}),
|
|
38
|
+
/* @__PURE__ */An(We,{}),
|
|
39
|
+
/* @__PURE__ */An(Ue,{devices:Vt,value:Dt,onChange:Gt})]}),
|
|
40
|
+
/* @__PURE__ */Mn(Fe,{kind:"right",style:{minWidth:300},children:[
|
|
41
|
+
/* @__PURE__ */An(En,{saveState:Jn,notSaving:Boolean(Qn)||null!=Yn,readOnlyReason:_n,toggle:Zn,onToggle:Xn,onRetry:Kn,words:xt.bar,saveWords:zt}),jo.barLead?.(),
|
|
42
|
+
/* @__PURE__ */An(zn,{content:xt.bar.refreshTip,side:"bottom",children:/* @__PURE__ */An(Bn,{variant:"secondary",onClick:()=>{oo.current=(()=>{const e=io?.document;if(!e)return null;const n=Rr.findIndex(kt),t=n>=0?n:Rr.length;let o=null;for(let n=0;n<t;n++){const t=Rr[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=lt?.props?.id??Rr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),to(e=>e+1)},children:xt.bar.refresh})}),jo.barTrail?.(),jo.barMain?jo.barMain():/* @__PURE__ */An(Bn,{variant:"primary",disabled:null!==_n,onClick:()=>{Gn(ot.data)},children:xt.done})]})]}),
|
|
43
43
|
/* @__PURE__ */An(z,{}),
|
|
44
44
|
/* @__PURE__ */Mn("div",{className:"sf-body",children:[Rt?/* @__PURE__ */Mn(jn,{children:[
|
|
45
|
-
/* @__PURE__ */An("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":xt.leftPanel,children:so?/* @__PURE__ */An(
|
|
46
|
-
/* @__PURE__ */An(A,{panel:
|
|
47
|
-
/* @__PURE__ */An(
|
|
48
|
-
/* @__PURE__ */An(
|
|
45
|
+
/* @__PURE__ */An("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":xt.leftPanel,children:so?/* @__PURE__ */An(P,{blocks:Zl,blocksOnly:ql,at:uo?{label:(e=>{const n=kl(e.zone);if(n)return xt.add.addingTo({name:Go.rowName?Mi(n,!0):Jr(n.type)});if(e.zone===le){const n=Rr[e.index];return n&&!kt(n)?xt.add.addingBefore({name:Mi(n,!0)}):xt.add.addingAtEnd}const t=xl(e.zone);return t?xt.add.addingTo({name:t.parentName}):xt.add.addingHere})(uo),onClear:()=>fo(null)}:void 0,onAdd:e=>{const n=bo,t=(e,n)=>{uo&&fo({zone:e,index:n})};if(n&&"block"!==e.kind&&kl(n.zone))return Ai(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===zo)return void Ii(e);const n=Ii(e,zo);uo&&mo(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===zo)return void Ni(e,n);const t=Ni(e,n,zo);uo&&mo(t+1)})(e.template.name,Hr(e.template.node));if(n&&n.zone!==le){const o=xl(n.zone);if(!o)return;return o.target.spec?nl(o.parentId,o.target.slot,e.type,n.index,o.parent.type):tl(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Xl?.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:zl,siteWide:jo.addPanelRow?.(Ti),onClose:Ti,onHide:$r,readOnly:Boolean(Qn)}):Kt&&Jt?
|
|
46
|
+
/* @__PURE__ */An(A,{panel:Jt,pick:Kt,onHide:$r}):os?os.panel({onHide:$r,notify:gr}):"media"===Ro&&Jt?/* @__PURE__ */An(A,{panel:Jt,pick:null,onHide:$r}):/* @__PURE__ */Mn(jn,{children:[
|
|
47
|
+
/* @__PURE__ */An($,{icon:/* @__PURE__ */An(Me,{}),title:xt.layers,context:It,actions:
|
|
48
|
+
/* @__PURE__ */An(De,{label:fl?xt.expandAll:xt.collapseAll,title:0===ul.length?xt.nothingToFold:void 0,disabled:0===ul.length,onClick:()=>ir(e=>{const n=new Set(ul);return fl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...ul])}),children:/* @__PURE__ */An(Rn,{expand:fl})}),onHide:$r}),
|
|
49
49
|
/* @__PURE__ */Mn(Be,{className:"sf-tree sf-scroll",words:wt,children:[
|
|
50
50
|
/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:"page",size:13}),name:xt.pageSettings,onSelect:jr,selected:!lt&&vo,rowProps:{onClick:ji(jr)}}),cl&&/* @__PURE__ */Mn(jn,{children:[
|
|
51
|
-
/* @__PURE__ */An(Ce,{children:xt.header}),
|
|
51
|
+
/* @__PURE__ */An(Ce,{children:xt.header}),Gl(cl)]}),!Eo&&tt&&/* @__PURE__ */Mn(jn,{children:[
|
|
52
52
|
/* @__PURE__ */An(Ce,{children:xt.header}),!St&&/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:"header",size:13}),name:xt.header,onSelect:Er,selected:ko.kind===gt?.kind,rowProps:{onClick:ji(Er)}})]}),!Eo&&dl&&ds(dl,sl,"header"),!Eo&&!rs&&/* @__PURE__ */An(Ce,{children:is}),rs?/* @__PURE__ */Mn(jn,{children:[
|
|
53
|
-
/* @__PURE__ */An(be,{words:wt,icon:null,name:is,fold:{open:!ls,label:is,onToggle:()=>ur(
|
|
54
|
-
/* @__PURE__ */An(
|
|
55
|
-
/* @__PURE__ */Mn("div",{ref:yr,className:"sf-center sf-scroll","data-sf-canvas-head":wr?"":void 0,style:{overflowX:Ir?"auto":"hidden",overflowY:"hidden"},children:[wr&&/* @__PURE__ */An("div",{ref:br,className:"sf-canvas-head",children:/* @__PURE__ */An(wr,{device:
|
|
56
|
-
/* @__PURE__ */An("div",{className:"sf-frame-scaler",style:Nr,children:/* @__PURE__ */An("div",{className:"sf-frame "+(
|
|
53
|
+
/* @__PURE__ */An(be,{words:wt,icon:null,name:is,fold:{open:!ls,label:is,onToggle:()=>ur(Hn)}}),!ls&&/* @__PURE__ */An(ze,{children:ss})]}):ss,tt&&/* @__PURE__ */An(Ce,{children:xt.footer}),ll&&ds(ll,il,"footer"),!Eo&&!ll&&tt&&/* @__PURE__ */An(be,{words:wt,icon:/* @__PURE__ */An(Yo,{type:"footer",size:13}),name:xt.footer,onSelect:Ei,rowProps:{onClick:ji(Ei),title:xt.editFooter}}),al&&Gl(al),jo.treeFoot?.()]})]})}),
|
|
54
|
+
/* @__PURE__ */An(Ge,{side:"left",width:lr.left,min:Ye,max:Je,defaultWidth:k.left,label:xt.resizeLeftPanel,onResize:cr})]}):/* @__PURE__ */An(T,{side:"left",onShow:$r}),
|
|
55
|
+
/* @__PURE__ */Mn("div",{ref:yr,className:"sf-center sf-scroll","data-sf-canvas-head":wr?"":void 0,style:{overflowX:Ir?"auto":"hidden",overflowY:"hidden"},children:[wr&&/* @__PURE__ */An("div",{ref:br,className:"sf-canvas-head",children:/* @__PURE__ */An(wr,{device:Dt})}),
|
|
56
|
+
/* @__PURE__ */An("div",{className:"sf-frame-scaler",style:Nr,children:/* @__PURE__ */An("div",{className:"sf-frame "+(Dt===Wt?"":`sf-frame--${Dt}`),style:Pr,children:/* @__PURE__ */Mn("div",{className:"sf-preview-host",children:[
|
|
57
57
|
/* @__PURE__ */An(Nt,{},no),
|
|
58
|
-
/* @__PURE__ */An(en,{canvas:io,session:zl,model:Al,measure:jl,canDrop:Rl,onDrop:Vl,choose:Il,onPick:
|
|
59
|
-
/* @__PURE__ */An(nn,{index:e.index,label:xt.addSectionHere,onInsert:()
|
|
60
|
-
/* @__PURE__ */An(g,{value:{selectChild:el,addChild:nl,childRowName:ci,blockRowName:hl},children:/* @__PURE__ */An(
|
|
61
|
-
/* @__PURE__ */An(
|
|
62
|
-
/* @__PURE__ */An(T,{side:"right",onShow:Tr})]}),yi.menu]})}))}export{
|
|
58
|
+
/* @__PURE__ */An(en,{canvas:io,session:zl,model:Al,measure:jl,canDrop:Rl,onDrop:Vl,choose:Il,onPick:Hl,onZoneAdd:Wl,onSeamAdd:Wl,zoneAddLabel:xt.canvasAddBlock,words:bt.canvas,readOnly:Boolean(Qn),revision:ot.data}),go.length>0&&/* @__PURE__ */An("div",{className:"sf-preview-gaps",children:go.map(e=>
|
|
59
|
+
/* @__PURE__ */An(nn,{index:e.index,label:xt.addSectionHere,onInsert:()=>Pi(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})})})]}),Lt?/* @__PURE__ */Mn(jn,{children:[
|
|
60
|
+
/* @__PURE__ */An(g,{value:{selectChild:el,addChild:nl,childRowName:ci,blockRowName:hl},children:/* @__PURE__ */An(Pt,{mode:ko,onOpenWebsiteSettings:jo.openSettings??(()=>{}),onOpenSiteStyles:jo.openStyles,onSelectNode:_o,onNotify:gr,onHidePanel:Tr,nodeActions:lt?se(dt,lt.type):Wn})}),
|
|
61
|
+
/* @__PURE__ */An(Ge,{side:"right",width:lr.right,min:Ye,max:Je,defaultWidth:k.right,label:xt.resizeSettingsPanel,onResize:ar})]}):
|
|
62
|
+
/* @__PURE__ */An(T,{side:"right",onShow:Tr})]}),yi.menu]})}))}export{Un as ScreenChrome};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-
|
|
1
|
+
import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-HUTO5ZIL.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-5F3PKNT7.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
|
|
2
2
|
/* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(a,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
|
|
3
3
|
return o(n,{align:"start",triggerClassName:"sf-add-card",items:u,trigger:/* @__PURE__ */c(i,{children:[
|
|
4
4
|
/* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),m.addBlockMenu]})})}export{l as AddBlockRow};
|
package/dist/fields/index.d.ts
CHANGED
|
@@ -2,13 +2,59 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { S as SettingsBucket } from '../buckets-Tj-nkBpg.js';
|
|
4
4
|
export { D as DesignGroup } from '../buckets-Tj-nkBpg.js';
|
|
5
|
-
import { a as InspectorFieldDef,
|
|
5
|
+
import { a as InspectorFieldDef, F as FieldRenderer, I as InspectorFields, b as FieldTextProps, c as FieldNumberProps, d as FieldSliderProps, e as FieldSelectManyProps, f as FieldSelectOneProps, g as FieldOption } from '../types-OUl0mK1k.js';
|
|
6
6
|
export { A as ArrayFieldDef, C as CustomFieldDef, h as CustomFieldRenderProps, i as FieldSelectProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, j as SlotFieldDef, T as TextFieldDef, k as TextareaFieldDef } from '../types-OUl0mK1k.js';
|
|
7
7
|
import { R as ResolvableItem } from '../resolve-D68pb3Bx.js';
|
|
8
8
|
export { F as FieldsWords } from '../words-vhnV8sM7.js';
|
|
9
9
|
export { LinkFilter, LinkFilterField, LinkKindChoice, LinkOption, LinkOptionGroup, LinkPicker, LinkPickerProps, LinkRules, LinkTarget } from 'efficient-shell/ui';
|
|
10
10
|
import '../types-41704JE4.js';
|
|
11
11
|
|
|
12
|
+
interface InspectorFieldProps {
|
|
13
|
+
field: InspectorFieldDef;
|
|
14
|
+
name: string;
|
|
15
|
+
/** Unique on the page: the label's `for`, and what a custom render gets as `id`. */
|
|
16
|
+
id: string;
|
|
17
|
+
value: unknown;
|
|
18
|
+
onChange: (value: unknown) => void;
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
/** Extra props for a custom render (the node, the root, the device…). */
|
|
21
|
+
context?: Record<string, unknown>;
|
|
22
|
+
/** A field type's drawing, swapped in by the host. */
|
|
23
|
+
renderers?: Partial<Record<InspectorFieldDef['type'], FieldRenderer>>;
|
|
24
|
+
/**
|
|
25
|
+
* An array's open item, when the Inspector holds it (the item takes the panel
|
|
26
|
+
* over). Absent: the list keeps its own.
|
|
27
|
+
*/
|
|
28
|
+
openItem?: number | null;
|
|
29
|
+
onOpenItem?: (index: number | null) => void;
|
|
30
|
+
/**
|
|
31
|
+
* The heading level a group this field draws (an object's members) takes in
|
|
32
|
+
* the panel's outline (7.2.0). The Inspector passes one under its band's for a
|
|
33
|
+
* row inside a band. Default 3; never past 6.
|
|
34
|
+
*/
|
|
35
|
+
headingLevel?: HeadingLevel;
|
|
36
|
+
}
|
|
37
|
+
/** A heading level a settings group may draw at. */
|
|
38
|
+
type HeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
39
|
+
/** The label a row shows: the field's own, else its key, as Puck did. */
|
|
40
|
+
declare const labelOf: (field: InspectorFieldDef, name: string) => string;
|
|
41
|
+
/**
|
|
42
|
+
* ONE FIELD, drawn by its type — what Puck's `AutoField` was (blueprint 4.1).
|
|
43
|
+
*
|
|
44
|
+
* custom the field's own render, called with Puck's props plus `context`;
|
|
45
|
+
* text, textarea, number, select
|
|
46
|
+
* a SettingsField row (quiet label, control under it) holding the
|
|
47
|
+
* shell's own control, never the browser's;
|
|
48
|
+
* radio the panel's segmented strip;
|
|
49
|
+
* object a group of its members, each written back into the object;
|
|
50
|
+
* slot nothing: a slot's children are on the canvas and in Layers;
|
|
51
|
+
* array the list field (4.2): a row per item, open one to edit its own
|
|
52
|
+
* fields, each written back into the array.
|
|
53
|
+
*
|
|
54
|
+
* A marker, or a field with `visible: false`, draws nothing.
|
|
55
|
+
*/
|
|
56
|
+
declare function InspectorField(props: InspectorFieldProps): ReactNode;
|
|
57
|
+
|
|
12
58
|
/** The folding band a row sits in: the fold marker's name and its title. */
|
|
13
59
|
interface PlannedFold {
|
|
14
60
|
key: string;
|
|
@@ -112,6 +158,10 @@ interface InspectorProps {
|
|
|
112
158
|
closedFolds?: ReadonlySet<string>;
|
|
113
159
|
/** A band opened (`true`) or closed (`false`). */
|
|
114
160
|
onFold?: (key: string, open: boolean) => void;
|
|
161
|
+
/** The heading level each band's title draws at (7.2.0): the fold button
|
|
162
|
+
* sits inside an `h{level}`. Default 3, under the panel's `h2` name; a group
|
|
163
|
+
* inside a band draws one level under it. */
|
|
164
|
+
headingLevel?: HeadingLevel;
|
|
115
165
|
}
|
|
116
166
|
/**
|
|
117
167
|
* THE SETTINGS PANEL'S BODY (blueprint step 4.1) — what `<Puck.Fields>` was in
|
|
@@ -146,45 +196,7 @@ interface InspectorProps {
|
|
|
146
196
|
* is `hidden`), as a row on another tab does. Which bands are closed is the
|
|
147
197
|
* host's when it passes `closedFolds` + `onFold`, else the Inspector's own.
|
|
148
198
|
*/
|
|
149
|
-
declare function Inspector({ fields, values, onChange, readOnly, context, tab, onTab, tabs, tabIcons, renderers, idPrefix, ariaLabel, lead, children, leadFold, closedFolds, onFold, }: InspectorProps): react.JSX.Element;
|
|
150
|
-
|
|
151
|
-
interface InspectorFieldProps {
|
|
152
|
-
field: InspectorFieldDef;
|
|
153
|
-
name: string;
|
|
154
|
-
/** Unique on the page: the label's `for`, and what a custom render gets as `id`. */
|
|
155
|
-
id: string;
|
|
156
|
-
value: unknown;
|
|
157
|
-
onChange: (value: unknown) => void;
|
|
158
|
-
readOnly?: boolean;
|
|
159
|
-
/** Extra props for a custom render (the node, the root, the device…). */
|
|
160
|
-
context?: Record<string, unknown>;
|
|
161
|
-
/** A field type's drawing, swapped in by the host. */
|
|
162
|
-
renderers?: Partial<Record<InspectorFieldDef['type'], FieldRenderer>>;
|
|
163
|
-
/**
|
|
164
|
-
* An array's open item, when the Inspector holds it (the item takes the panel
|
|
165
|
-
* over). Absent: the list keeps its own.
|
|
166
|
-
*/
|
|
167
|
-
openItem?: number | null;
|
|
168
|
-
onOpenItem?: (index: number | null) => void;
|
|
169
|
-
}
|
|
170
|
-
/** The label a row shows: the field's own, else its key, as Puck did. */
|
|
171
|
-
declare const labelOf: (field: InspectorFieldDef, name: string) => string;
|
|
172
|
-
/**
|
|
173
|
-
* ONE FIELD, drawn by its type — what Puck's `AutoField` was (blueprint 4.1).
|
|
174
|
-
*
|
|
175
|
-
* custom the field's own render, called with Puck's props plus `context`;
|
|
176
|
-
* text, textarea, number, select
|
|
177
|
-
* a SettingsField row (quiet label, control under it) holding the
|
|
178
|
-
* shell's own control, never the browser's;
|
|
179
|
-
* radio the panel's segmented strip;
|
|
180
|
-
* object a group of its members, each written back into the object;
|
|
181
|
-
* slot nothing: a slot's children are on the canvas and in Layers;
|
|
182
|
-
* array the list field (4.2): a row per item, open one to edit its own
|
|
183
|
-
* fields, each written back into the array.
|
|
184
|
-
*
|
|
185
|
-
* A marker, or a field with `visible: false`, draws nothing.
|
|
186
|
-
*/
|
|
187
|
-
declare function InspectorField(props: InspectorFieldProps): ReactNode;
|
|
199
|
+
declare function Inspector({ fields, values, onChange, readOnly, context, tab, onTab, tabs, tabIcons, renderers, idPrefix, ariaLabel, lead, children, leadFold, closedFolds, onFold, headingLevel, }: InspectorProps): react.JSX.Element;
|
|
188
200
|
|
|
189
201
|
/** What a block may declare about its fields. */
|
|
190
202
|
interface FieldsBlock {
|
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-UCLVWF5E.js";import"../chunk-4JSBIW5H.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-GZH4UVDH.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
package/dist/panel/index.d.ts
CHANGED
|
@@ -315,7 +315,14 @@ interface SettingsGroupProps {
|
|
|
315
315
|
* on the pill so a FOLDED group still admits it holds changes.
|
|
316
316
|
*/
|
|
317
317
|
count?: number;
|
|
318
|
-
/**
|
|
318
|
+
/**
|
|
319
|
+
* The heading level the title draws at, in the HOST's outline (7.2.0). The
|
|
320
|
+
* fold button sits inside an `h{level}`, the WAI-ARIA accordion pattern.
|
|
321
|
+
* Defaults to 3, a group under a panel's `h2` name.
|
|
322
|
+
*/
|
|
323
|
+
level?: 2 | 3 | 4 | 5 | 6;
|
|
324
|
+
/** Ties the pill to its body for assistive tech (`aria-controls`). One DOM
|
|
325
|
+
* id: no whitespace (the body's id is this plus `-body`). */
|
|
319
326
|
id?: string;
|
|
320
327
|
children: ReactNode;
|
|
321
328
|
className?: string;
|
|
@@ -676,8 +683,15 @@ declare function SettingsSegmented<V = string>({ options, value, onChange, ariaL
|
|
|
676
683
|
*
|
|
677
684
|
* `count` is the reason a fold here is safe: a folded group that holds changes
|
|
678
685
|
* still says so on its pill, so nothing a merchant changed can hide.
|
|
686
|
+
*
|
|
687
|
+
* THE TITLE IS A HEADING THAT HOLDS THE BUTTON (WAI-ARIA APG accordion pattern,
|
|
688
|
+
* 7.2.0). A button alone gives a screen reader nothing to jump between; the
|
|
689
|
+
* `h{level}` round it puts each group in the panel's outline, under the panel's
|
|
690
|
+
* `h2` name. The level is the host's (default 3, as `SettingsGroupHead`), since
|
|
691
|
+
* only the host knows the outline around it. `panel.css` takes every margin and
|
|
692
|
+
* font off `.es-group-title`, so the pill looks as it did.
|
|
679
693
|
*/
|
|
680
|
-
declare function SettingsGroup({ title, open, onToggle, count, id, children, className, }: SettingsGroupProps): react.JSX.Element;
|
|
694
|
+
declare function SettingsGroup({ title, open, onToggle, count, level, id, children, className, }: SettingsGroupProps): react.JSX.Element;
|
|
681
695
|
|
|
682
696
|
/**
|
|
683
697
|
* A group heading with NO group under it — the pill on its own.
|
package/dist/panel/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsField,SettingsGroup}from"../chunk-
|
|
1
|
+
export{DESIGN_GROUPS,SETTINGS_BUCKETS,SettingsField,SettingsGroup}from"../chunk-GZH4UVDH.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";export{SettingsSegmented,SettingsSwitch}from"../chunk-QLD57GBB.js";import{withTip as n}from"../chunk-P2VEMZH5.js";import{Tabs as t,CountBadge as i,Tooltip as l}from"efficient-shell/ui";export{CornersInput as SettingsCorners,AlignmentGrid as SettingsPlacement}from"efficient-shell/ui";import{jsx as s,jsxs as a,Fragment as r}from"react/jsx-runtime";import{RevertIcon as c}from"efficient-shell/icons/efficient";function d(e){const n=e[0];if(!n?.htmlId||!n.htmlId.endsWith(`-tab-${n.id}`))return;const t=n.htmlId.slice(0,-`-tab-${n.id}`.length);return e.every(e=>e.htmlId===`${t}-tab-${e.id}`)?t:void 0}function o({items:n,activeId:l,onSelect:c,ariaLabel:o=e.settings,idPrefix:u,className:m}){
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return s("div",{className:"es-tabs-fit",children:/* @__PURE__ */s(t,{variant:"pill","aria-label":o,idPrefix:u??d(n),className:m?`es-tabs ${m}`:"es-tabs",value:l,onChange:c,items:n.map(e=>{const n="number"==typeof e.badge&&e.badge>0?/* @__PURE__ */s(i,{count:e.badge,tone:"accent"}):null;return e.icon?{id:e.id,tooltip:e.label,label:/* @__PURE__ */a(r,{children:[
|
|
4
4
|
/* @__PURE__ */a("span",{className:"es-tab-tip",children:[
|
package/dist/panel/panel.css
CHANGED
|
@@ -581,6 +581,22 @@
|
|
|
581
581
|
`var(--es-row-gap)` the worst case is the floor instead. */
|
|
582
582
|
.es-group + .es-group { margin-top: var(--es-row-gap); }
|
|
583
583
|
|
|
584
|
+
/* THE HEADING ROUND A GROUP'S BUTTON (7.2.0, WAI-ARIA APG accordion pattern).
|
|
585
|
+
It is there for the outline a screen reader walks, not for the eye, so it
|
|
586
|
+
draws nothing: no margin, no padding, the font of the group around it (a
|
|
587
|
+
host's `h3 { … }` or a browser's bold 1.17em never reaches the pill). The
|
|
588
|
+
pill's own margin collapses through it, as it did through nothing before. */
|
|
589
|
+
.es-group-title {
|
|
590
|
+
display: block;
|
|
591
|
+
margin: 0;
|
|
592
|
+
padding: 0;
|
|
593
|
+
border: 0;
|
|
594
|
+
font: inherit;
|
|
595
|
+
letter-spacing: inherit;
|
|
596
|
+
text-transform: inherit;
|
|
597
|
+
color: inherit;
|
|
598
|
+
}
|
|
599
|
+
|
|
584
600
|
/* ONE pill, two elements. `SettingsGroup` renders a <button> that folds;
|
|
585
601
|
`SettingsGroupHead` renders a heading that folds nothing, because Puck's
|
|
586
602
|
inspector is a flat sibling list and a heading there cannot wrap the rows it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddBlockRow as default}from"../../chunk-
|
|
1
|
+
export{AddBlockRow as default}from"../../chunk-XC36V42X.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-HUTO5ZIL.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-5F3PKNT7.js";import"../../chunk-AWKOTOE6.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-SOZUYCQZ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.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-NCMQD4P6.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-HUTO5ZIL.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-5F3PKNT7.js";import"../../chunk-AWKOTOE6.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-SOZUYCQZ.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-SSORUDHE.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.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-U2SECYQB.js";import"../../chunk-HUTO5ZIL.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-AWKOTOE6.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-SOZUYCQZ.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.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-UJZGOO3D.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-MVQEEWTE.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-6Z5VENIE.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-2AAJCKCB.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-3PASGRBK.js";import"../../chunk-MUUPE34I.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-LC62L4P2.js";import"../../chunk-E4MAYJX5.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-64ZRPAWS.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-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-NCMQD4P6.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-U2SECYQB.js";import"../../chunk-HUTO5ZIL.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5F3PKNT7.js";import"../../chunk-AWKOTOE6.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-SOZUYCQZ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-SSORUDHE.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.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-CLWYUKUO.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-PH3GWKS2.js";import"../../chunk-UJZGOO3D.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-MVQEEWTE.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-6Z5VENIE.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-2AAJCKCB.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-6TOYXESC.js";import"../../chunk-3PASGRBK.js";import"../../chunk-MUUPE34I.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-LC62L4P2.js";import"../../chunk-E4MAYJX5.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-64ZRPAWS.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-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-NCMQD4P6.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-PFNIVZPN.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-U2SECYQB.js";import"../../chunk-HUTO5ZIL.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-5F3PKNT7.js";import"../../chunk-AWKOTOE6.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-SOZUYCQZ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-SSORUDHE.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.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-PH3GWKS2.js";import"../../chunk-HUTO5ZIL.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-AWKOTOE6.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-SOZUYCQZ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{AddBlockRow as e}from"../../chunk-
|
|
2
|
-
return
|
|
3
|
-
return
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
return
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
return
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
1
|
+
import{AddBlockRow as e}from"../../chunk-XC36V42X.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-2AAJCKCB.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-6TOYXESC.js";import{usePartBridge as c}from"../../chunk-3PASGRBK.js";import{useSectionOps as p}from"../../chunk-MUUPE34I.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-64ZRPAWS.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-U2SECYQB.js";import{SELECTION_MODE as d,useScreenPinned as a,useScreenCanvasFrame as u,useScreenInspectorPanel as h,useScreenPickFollowsSelection as k,sameInspectorMode as f,useStandaloneScreenBridges as j,useScreenBlockLook as S,useScreenBlockRules as y}from"../../chunk-HUTO5ZIL.js";import{slotFieldsOf as C,nestsInTree as A}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as N,usePanelPick as x,useCancelPanelPick as B}from"../../chunk-R6WTQWAC.js";import{useHostEscape as O}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as P}from"../../chunk-5F3PKNT7.js";import{useEasel as v}from"../../chunk-AWKOTOE6.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import{LayersTree as E,Subtree as R,TreeRow as T,TreeRowAction as g,TreeSeam as W}from"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as w}from"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-SOZUYCQZ.js";import"../../chunk-BDTITTMW.js";import{DEFAULT_SAVE_WORDS as z,saveIndicator as L}from"../../chunk-H6DDIBQ4.js";import{SaveState as b,panelWidthVars as M}from"../../chunk-UB4TLWVJ.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import{useWords as Y}from"../../chunk-MFIRYGHW.js";import"../../chunk-SSORUDHE.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as F}from"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as D,parseZoneKey as H}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as K,useRef as V,useEffect as X,useCallback as U,Fragment as J}from"react";import{Tooltip as Z}from"efficient-shell/ui";import{TrashIcon as G}from"efficient-shell/icons/efficient";import{jsxs as I,jsx as Q,Fragment as $}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=l(),re=p(),{appState:te,selectedItem:se,config:ie}=v(e=>e),[ce,pe]=K(d),le=Y("screen",P),me=Y("tree",w),de=Y("save",z),{first:ae,last:ue,panelOf:he}=a(),ke=he(ae),fe=u(),je=h(),Se=te.data.content?.[0]??null,ye=Se?.props.id??null,Ce=Se?.type===ae,Ae=Se?.type===ue,Ne=V(null),xe=V(null);t(xe);const Be=N(),Oe=x(),Pe=B();k(se?.props.id),X(()=>{const e=xe.current;if(!Oe||!e)return;const n=e=>{"Escape"===e.key&&Pe()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Oe]),O(null!==Oe,()=>Pe()),X(()=>{ye&&Ne.current!==ye&&(Ne.current=ye,Ce?pe(ke??d):se||re.select({index:0}))},[ye,se,re,Ce]);const ve=U(e=>pe(n=>f(n,e)?n:e),[]),Ee=j({kind:ce.kind,mode:ce,open:ve,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>f(e,n)?e:n),re.select(e)}}),{selectNode:Re}=c({mode:ce,setMode:pe,onOpenPart:o}),Te=S(),{labelAtLevel:ge,Icon:We}=Te,{canAddTo:we}=y(),ze=e=>ge(e,"block",ie.components[e]?.label??e),Le=e=>ge(e,"section",ze(e)),be=!Ce&&"puck"===ce.kind&&se?.props.id===ye,Me=Se?we(Se.type)?.spec??null:null,Ye=Se&&Me?`${Se.props.id}:${Me.slot}`:null,Fe=Se&&Me&&Array.isArray(Se.props[Me.slot])?Se.props[Me.slot]:[],De=e=>n(e,ze,Te.plainText),He=(e,n)=>{Se&&Me&&Ye&&(pe(d),Me.slider?(r(String(Se.props.id),e),re.select({index:e,zone:Ye}),o(String(Se.props.id))):(re.select({index:e,zone:Ye}),o(n)))},Ke=()=>{if(!Se||!Me||!Ye)return;const e=Fe.length;re.insertComponent(Ye,Me.childType,e),pe(d),Me.slider?requestAnimationFrame(()=>{r(String(Se.props.id),e),re.select({index:e,zone:Ye})}):re.select({index:e,zone:Ye})},Ve=e=>C(ie,e),Xe=e=>{const{parentId:n,slot:o}=H(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Ve(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(Se)?.props[o];return Array.isArray(t)?t.length:0},Ue=(e,n,o)=>{const r=Math.min(Math.max(o,0),Xe(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(d),re.select({index:t,zone:e}))},Je=F({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>D(n)===e.zone&&n.index>=0&&n.index<=Xe(e.zone),onDrop:(e,n)=>Ue(e.zone,e.index,n.index),onStep:(e,n)=>Ue(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ze=(e,n)=>/* @__PURE__ */Q(W,{...ne?{}:Je.seam({place:{...H(e),index:n}})},`seam:${e}:${n}`),Ge=e=>Te.blockRowName(e,ze),Ie=(e,n,r)=>{pe(d),re.select({index:n,zone:e}),o(r)},Qe=(e,n,o)=>{re.insertComponent(e,n,o),pe(d),re.select({index:o,zone:e})},$e=(n,o,r)=>/* @__PURE__ */Q(e,{choices:r,onPick:e=>Qe(n,e,o)}),qe=(e,n)=>{const o=Ve((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=we(e.type),s=t?.choices??null,i="footer"===t?.source?Ge:De;/* @__PURE__ */
|
|
2
|
+
return I($,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=A(ie,e.type,n),c=i(e),p=String(e.props.id),l=()=>Ie(o,r,p),{rowProps:m,...a}=Je.row({item:{id:p,zone:o,index:r},place:{...H(o),index:r}},{onClick:q(l)});/* @__PURE__ */
|
|
3
|
+
return I(J,{children:[0===r&&Ze(o,0),
|
|
4
|
+
/* @__PURE__ */Q(T,{words:me,icon:/* @__PURE__ */Q(We,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */Q(g,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(d),void re.select(null);var e,n},children:/* @__PURE__ */Q(G,{size:13})}),rowProps:m}),s&&/* @__PURE__ */Q(R,{children:qe(e,n+1)}),Ze(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?$e(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===Se?.type,en=Boolean(Se)&&(Boolean(we(Se.type))||Ve(Se.type).length>0),nn=Boolean(Se)&&(Boolean(Me)||Ae||Ce||_e||en);/* @__PURE__ */
|
|
5
|
+
return I("div",{ref:xe,className:"sf-editor es-editor",style:M(i),children:[
|
|
6
|
+
/* @__PURE__ */Q("div",{className:"sf-section-bar",children:/* @__PURE__ */Q(b,null!==oe?{tone:"off",label:oe,role:"status"}:{...L(ee,de),role:"status"})}),
|
|
7
|
+
/* @__PURE__ */I("div",{className:"sf-body",children:[Oe&&Be?/* @__PURE__ */Q("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */Q(m,{panel:Be,pick:Oe})}):nn&&Se&&/* @__PURE__ */I("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
|
|
8
|
+
/* @__PURE__ */Q("div",{className:"sf-panel-head",children:/* @__PURE__ */Q(Z,{content:Ce?le.headerSettings:le.sectionSettings({name:Le(Se.type)}),side:"bottom",children:/* @__PURE__ */Q("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(be?"is-selected":""),"aria-pressed":be,onClick:()=>{Ce?pe(ke??d):(pe(d),re.select({index:0}))},children:Le(Se.type)})})}),
|
|
9
|
+
/* @__PURE__ */Q(E,{className:"sf-tree sf-scroll",rootProps:Je.rootProps(),words:me,children:/* @__PURE__ */Q(R,{children:Ce?
|
|
10
|
+
/* @__PURE__ */Q(T,{words:me,icon:/* @__PURE__ */Q(We,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??d),rowProps:{onClick:q(()=>pe(ke??d))}}):Me?/* @__PURE__ */I($,{children:[Fe.map((e,n)=>{const o=se?.props.id===e.props.id,r=De(e),t=String(e.props.id),s=()=>He(n,t),{rowProps:i,...c}=Je.row({item:{id:t,zone:Ye,index:n},place:{...H(Ye),index:n}},{onClick:q(s)});/* @__PURE__ */
|
|
11
|
+
return I(J,{children:[0===n&&Ze(Ye,0),
|
|
12
|
+
/* @__PURE__ */Q(T,{words:me,icon:/* @__PURE__ */Q(We,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */Q(g,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Ye&&(re.removeComponent(Ye,e),pe(d),re.select(null)));var e},children:/* @__PURE__ */Q(G,{size:13})}),rowProps:i}),Ze(Ye,n+1)]},String(e.props.id??n))}),
|
|
13
|
+
/* @__PURE__ */I("button",{type:"button",className:"sf-add-card",onClick:Ke,children:[
|
|
14
|
+
/* @__PURE__ */Q("span",{className:"sf-plus sf-plus--sm",children:"+"}),Me.addLabel]}),ye?Ee.partRows?.(Se,_):null]}):qe(Se,1)})})]}),
|
|
15
|
+
/* @__PURE__ */Q("div",{className:"sf-center",children:/* @__PURE__ */Q("div",{className:"sf-preview-host",children:/* @__PURE__ */Q(fe,{})})}),
|
|
16
|
+
/* @__PURE__ */Q(s,{value:{selectChild:(e,n,o,r)=>"section"===we(r)?.source?He(n,o):Ie(e,n,o),addChild:(e,n,o,r,t)=>"section"===we(t)?.source?Ke():Qe(`${e}:${n}`,o,r),childRowName:De,blockRowName:Ge},children:/* @__PURE__ */Q(je,{mode:ce,onOpenWebsiteSettings:Ee.openSettings??(()=>{}),onSelectNode:Re,hideNodeActions:!0})})]})]})}export{ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{usePartBridge}from"../../chunk-
|
|
1
|
+
export{usePartBridge}from"../../chunk-3PASGRBK.js";import"../../chunk-MUUPE34I.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-HUTO5ZIL.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-AWKOTOE6.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-SOZUYCQZ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.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-CLWYUKUO.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-PH3GWKS2.js";import"../chunk-UJZGOO3D.js";import"../chunk-26OOWIJJ.js";import"../chunk-MVQEEWTE.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-2GVCAIPX.js";import"../chunk-6Z5VENIE.js";import"../chunk-7F52SZOI.js";import"../chunk-MQNBD6AB.js";import"../chunk-TBF5CVPA.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-2AAJCKCB.js";import"../chunk-KCBEE2MC.js";import"../chunk-6TOYXESC.js";import"../chunk-3PASGRBK.js";import"../chunk-MUUPE34I.js";import"../chunk-IYT6NN2J.js";import"../chunk-LC62L4P2.js";import"../chunk-E4MAYJX5.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-64ZRPAWS.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-V7U33NF2.js";import"../chunk-5545A3PC.js";import"../chunk-NCMQD4P6.js";import"../chunk-5ZBY24K7.js";import"../chunk-PA3PNTVV.js";import"../chunk-BVN33R76.js";import"../chunk-PFNIVZPN.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-U2SECYQB.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-HUTO5ZIL.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-5F3PKNT7.js";import"../chunk-AWKOTOE6.js";import"../chunk-TBY3DFKS.js";import"../chunk-UCLVWF5E.js";import"../chunk-4JSBIW5H.js";import"../chunk-OZ72A6MY.js";import"../chunk-GZH4UVDH.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-SOZUYCQZ.js";import"../chunk-4VJATVVR.js";import"../chunk-BDTITTMW.js";import"../chunk-H6DDIBQ4.js";import"../chunk-UB4TLWVJ.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-WQASXLXS.js";import"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-SSORUDHE.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-AWJUYMX7.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useSectionOps}from"../../../chunk-
|
|
1
|
+
export{useSectionOps}from"../../../chunk-MUUPE34I.js";import"../../../chunk-HUTO5ZIL.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-AWKOTOE6.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-UCLVWF5E.js";import"../../../chunk-4JSBIW5H.js";import"../../../chunk-OZ72A6MY.js";import"../../../chunk-GZH4UVDH.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-SOZUYCQZ.js";import"../../../chunk-WQASXLXS.js";import"../../../chunk-66LWADFP.js";import"../../../chunk-QLD57GBB.js";import"../../../chunk-FFYXVAAL.js";import"../../../chunk-546BBOPE.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-AWJUYMX7.js";import"../../../chunk-P2VEMZH5.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-HUTO5ZIL.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-AWKOTOE6.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-SOZUYCQZ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-AWJUYMX7.js";import"../../chunk-P2VEMZH5.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": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
package/dist/chunk-2SXSWNKG.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
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-AWKOTOE6.js";import{Inspector as i}from"./chunk-CRWFB7MU.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},j={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},w={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},L={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},C={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
|
|
2
|
-
return s(t,{height:"fill"})}function P(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
|
|
3
|
-
return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var B=o({});function D({parts:n,children:e}){/* @__PURE__ */
|
|
4
|
-
return s(B.Provider,{value:n,children:e})}function G(){return u(B)}function N(){return(G().useOwnerName??g)()}function T(){return(G().useDocumentLabel??y)()}function x(n,e,t,r){return(G().useBridges??v)(n,e,t,r)}function A(n){return(G().useStandaloneBridges??v)(n)}function F(n,e){(G().useDocumentPass??b)(n,e)}function I(){return G().blockRules??O}function R(){return G().blockLook??j}function W(){return G().devices??w}function K(){return G().leftView??L}function E(){return G().pinned??C}function V(){return G().saveSwitch??!0}function H(n){e(!0===G().pickFollowsSelection,n)}function M(){return G().add??h}function Q(){return G().storageNamespace||void 0}function U(){return G().styleClipboard??null}function Y(){return G().nodeKeys??!0}function Z(){return G().notify??null}function q(){return G().Canvas??S}function z(){return G().CanvasHead??null}function J(){return G().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
|
|
5
|
-
return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return G().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,D as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,M as useScreenAdd,R as useScreenBlockLook,I as useScreenBlockRules,x as useScreenBridges,J as useScreenCanvasDrag,q as useScreenCanvasFrame,z as useScreenCanvasHead,_ as useScreenCanvasTarget,W as useScreenDevices,T as useScreenDocumentLabel,F as useScreenDocumentPass,nn as useScreenInspectorPanel,K as useScreenLeftView,Y as useScreenNodeKeys,Z as useScreenNotify,N as useScreenOwnerName,G as useScreenParts,H as useScreenPickFollowsSelection,E as useScreenPinned,V as useScreenSaveSwitch,Q as useScreenStorageNamespace,U as useScreenStyleClipboard,A as useStandaloneScreenBridges};
|
package/dist/chunk-3ZJSLHHI.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{SettingsSwitch as e}from"./chunk-QLD57GBB.js";import{jsxs as n,jsx as l,Fragment as a}from"react/jsx-runtime";import{isValidElement as i,cloneElement as s}from"react";function r({title:e,open:a,onToggle:i,count:s,id:r,children:c,className:d}){const o=r?`${r}-body`:void 0;/* @__PURE__ */
|
|
2
|
-
return n("div",{className:d?`es-group ${d}`:"es-group",children:[
|
|
3
|
-
/* @__PURE__ */n("button",{type:"button",id:r,"aria-expanded":a,"aria-controls":o,className:"es-group-head",onClick:()=>i(!a),children:[e,"number"==typeof s&&s>0?/* @__PURE__ */l("span",{className:"es-group-count",children:s}):null,
|
|
4
|
-
/* @__PURE__ */l("span",{className:"es-group-sign","aria-hidden":"true"})]}),
|
|
5
|
-
/* @__PURE__ */l("div",{id:o,className:"es-group-body",hidden:!a,children:c})]})}function c(e){return Array.isArray(e)?e.some(c):i(e)}function d(n,l,a){if(!i(n)||n.type!==e)return n;const r=n.props;return r.ariaLabel||r.ariaLabelledBy?n:s(n,a?{ariaLabelledBy:a}:{ariaLabel:l})}function o({label:e,labelId:i,icon:s,value:r,hint:o,changed:t,htmlFor:u,action:h,children:m,className:p}){const f=c(m),N=c(h);if(!f&&!N)return null;const b=["es-field"];f||b.push("is-inline"),t&&b.push("is-changed"),p&&b.push(p);const g=/* @__PURE__ */n(a,{children:[s?/* @__PURE__ */l("span",{className:"es-field-icon","aria-hidden":"true",children:s}):null,
|
|
6
|
-
/* @__PURE__ */l("span",{className:"es-field-label",id:i,children:e})]});/* @__PURE__ */
|
|
7
|
-
return n("div",{className:b.join(" "),children:[
|
|
8
|
-
/* @__PURE__ */n("div",{className:"es-field-head",children:[u?/* @__PURE__ */l("label",{className:"es-field-name",htmlFor:u,children:g}):/* @__PURE__ */l("span",{className:"es-field-name",children:g}),null!=r?/* @__PURE__ */l("span",{className:"es-field-value",children:r}):null,N?d(h,e,i):null]}),f?/* @__PURE__ */l("div",{className:"es-field-ctl",children:m}):null,o?/* @__PURE__ */l("p",{className:"es-field-hint",children:o}):null]})}var t=Object.freeze(["Design","Animation"]),u=Object.freeze(["Content","Size","Design","Layout","Position","Anchor"]);export{u as DESIGN_GROUPS,t as SETTINGS_BUCKETS,o as SettingsField,r as SettingsGroup};
|
package/dist/chunk-5ZIVEJAM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useSectionOps as o}from"./chunk-SWDPE63D.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-2SXSWNKG.js";import{useEasel as p}from"./chunk-AWKOTOE6.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 K=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(K)},[K,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:K}}export{m as usePartBridge};
|
package/dist/chunk-CRWFB7MU.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{FieldSelect as e}from"./chunk-OZ72A6MY.js";import{TreeSeam as n}from"./chunk-4JSBIW5H.js";import{SettingsField as t,SETTINGS_BUCKETS as l,SettingsGroup as r}from"./chunk-3ZJSLHHI.js";import{DEFAULT_TREE_WORDS as a}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as i}from"./chunk-EA2HTX37.js";import{FieldNumber as s}from"./chunk-66LWADFP.js";import{SettingsSegmented as c}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FFYXVAAL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as D}from"react/jsx-runtime";import{ChevronIcon as I,LockIcon as S,MoveUpIcon as F,MoveDownIcon as P,DuplicateIcon as L,TrashIcon as M}from"efficient-shell/icons/efficient";function T({id:e,value:n,onChange:t,placeholder:l,multiline:r=!1,rows:a=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return r?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:a,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)})}function A(e,n,t){const l=e.slice();return l.splice(Math.max(0,Math.min(n,l.length)),0,t),l}function H(e,n,t){const l=e.slice(),[r]=l.splice(n,1);return l.splice(Math.max(0,Math.min(t,l.length)),0,r),l}function E(e,n){return e.filter((e,t)=>t!==n)}function R(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var z='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function Y({label:e,icon:t,noun:l,items:r,onChange:o,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:T,renderItem:Y,renderRow:J,canRemove:K,lockedReason:V,fixed:G=!1,removeOnRow:W=!0,canDuplicate:X,above:Z,head:q=!0}){const Q=u("fields",d).list,U=u("tree",a),_=l??Q.item,ee=!w&&!G&&("number"!=typeof x||r.length<x),ne=r.length<=k,te=e=>!!K&&!K(r[e],e),le=e=>!w&&!G&&W&&!ne&&!te(e),re=e=>ee&&(!X||X(r[e],e)),ae=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(z)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=r.length||n===e)return;const t=oe.current[e],l=t?.ownerDocument.activeElement;if(t&&l&&t.contains(l)){const e=[...t.querySelectorAll(z)].indexOf(l),r=l;ie.current={index:n,nth:e,start:"number"==typeof r.selectionStart?r.selectionStart:null,end:"number"==typeof r.selectionEnd?r.selectionEnd:null}}o(H(r,e,n));const a=function(e,n,t){return null===e?null:e===n?t:n<e&&t>=e?e-1:n>e&&t<=e?e+1:e}($,e,n);a!==$&&T(a),he(Q.moved({n:n+1,total:r.length}))},be=e=>{ee&&(o(A(r,e,s())),J?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&T($+1)):T(e))},ge=e=>{le(e)&&(o(E(r,e)),$===e?T(null):null!==$&&$>e&&T($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const t=p({...B,index:e},n);t!==e&&fe(e,t)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<r.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(F,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<r.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),re(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(L,{size:14}),onClick:()=>(e=>{re(e)&&(o(A(r,e+1,R(r[e]))),null!==$&&$>e&&T($+1))})(e)}),le(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(M,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,t,l)=>{w||0===ye(e).length||me({index:e,x:n,y:t,owner:l})},xe=e=>n=>{const t=r.slice();t[e]=n,o(t)};/* @__PURE__ */
|
|
2
|
-
return D("div",{className:"es-list",children:[q?/* @__PURE__ */D("div",{className:"es-list-head",children:[
|
|
3
|
-
/* @__PURE__ */D("span",{className:"es-list-label",children:[t?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:t}):null,e]}),
|
|
4
|
-
/* @__PURE__ */j("span",{className:"es-list-count",children:r.length})]}):null,Z?/* @__PURE__ */j("div",{className:"es-list-above",children:Z}):null,r.length?/* @__PURE__ */D(g,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[r.map((e,t)=>{const l=ve.row({item:t,place:{...B,index:t}}),r=l.draggable&&se!==t,a=!J&&$===t,o=!w&&!G&&W&&te(t),i=["es-list-row",J?"is-inline":"is-item",a?"is-open":"",r?"is-draggable":"",l.dragging?"is-dragging":"",l.drop?`is-drop-${l.drop}`:""].filter(Boolean).join(" ");return[t>0?/* @__PURE__ */j(n,{...ve.seam({place:{...B,index:t}}),onAdd:ee?()=>be(t):void 0,label:Q.addHere({noun:_})},`seam-${t}`):null,
|
|
5
|
-
/* @__PURE__ */j(v,{className:i,flat:!!J,active:a,draggable:l.draggable,dragHint:U.dragHint,dragging:l.dragging,drop:"before"===l.drop||"after"===l.drop?l.drop:void 0,onMove:l.draggable?e=>fe(t,"up"===e?t-1:t+1):void 0,rowRef:e=>{oe.current[t]=e},rowProps:{...l.rowProps,draggable:r||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),r=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=l.draggable&&!r,de.current=n&&!r?n:null,ce(r?t:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),l.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(t,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,l=e=>e.preventDefault();n.addEventListener("contextmenu",l,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",l,{capture:!0}),500);const r=e.currentTarget.getBoundingClientRect();return void ke(t,r.left+24,r.bottom,e.currentTarget)}l.rowProps.onKeyDown?.(e)}},actions:w||G||!W?void 0:o?h(V?V(e,t):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":V?V(e,t):Q.locked,children:/* @__PURE__ */j(S,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!le(t),onClick:()=>ge(t),children:"×"})),below:a?/* @__PURE__ */j("div",{className:"es-list-item",children:Y(e,t,xe(t))}):void 0,children:J?/* @__PURE__ */j("div",{className:"es-list-row-main",children:J(e,t,xe(t))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":a,onClick:()=>T(a?null:t),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(e,t)}):null,
|
|
6
|
-
/* @__PURE__ */j("span",{className:"es-list-row-name",children:ae(e,t)}),/* @__PURE__ */j("span",c?{className:"es-list-row-summary",children:c(e,t)}:{className:"es-list-row-summary"}),
|
|
7
|
-
/* @__PURE__ */j(I,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},t)]}),
|
|
8
|
-
/* @__PURE__ */j(n,{...ve.seam({place:{...B,index:r.length}})})]}):null,w||G?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(r.length),children:Q.add({noun:_})}),
|
|
9
|
-
/* @__PURE__ */j("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<r.length?
|
|
10
|
-
/* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(i,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var J=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function K({field:e,name:n,id:t,value:l,onChange:a,readOnly:o,context:i,renderers:s}){const[c,d]=C(!0),u=l&&"object"==typeof l?l:{};/* @__PURE__ */
|
|
11
|
-
return j(r,{id:`${t}-group`,title:J(e,n),open:c,onToggle:d,children:Object.entries(e.objectFields).map(([e,l])=>/* @__PURE__ */j(G,{field:l,name:`${n}.${e}`,id:`${t}-${e}`,value:u[e],onChange:n=>a({...u,[e]:n}),readOnly:o,context:i,renderers:s},e))})}function V({field:e,name:n,id:t,value:l,onChange:r,readOnly:a,context:o,renderers:i,openItem:s,onOpenItem:c}){const[d,u]=C(null),m=c?s??null:d,p=c??u,h=Array.isArray(l)?l:[],f=e.getItemSummary;/* @__PURE__ */
|
|
12
|
-
return j(Y,{label:J(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:r,newItem:()=>R({...e.defaultItemProps??{}}),summary:f?(e,n)=>f(e,n):void 0,min:e.min,max:e.max,readOnly:a,open:m,onOpen:p,renderItem:(l,r,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(G,{field:c,name:`${n}[${r}].${e}`,id:`${t}-${r}-${e}`,value:l?.[e],onChange:n=>s({...l,[e]:n}),readOnly:a,context:o,renderers:i},e))})}function G(n){const{field:l,name:r,id:a,value:o,onChange:i,readOnly:d,context:u,renderers:m}=n;if(!l||l.marker||!1===l.visible)return null;const p=m?.[l.type];if(p)return p({field:l,name:r,id:a,value:o,onChange:i,readOnly:d});switch(l.type){case"custom":{const e={...u,field:l,name:r,id:a,value:o,onChange:i,readOnly:d};return l.render(e)}case"text":case"textarea":/* @__PURE__ */
|
|
13
|
-
return j(t,{label:J(l,r),htmlFor:a,icon:l.icon,hint:l.hint,children:/* @__PURE__ */j(T,{id:a,value:"string"==typeof o?o:null==o?"":String(o),onChange:i,placeholder:l.placeholder,multiline:"textarea"===l.type,readOnly:d})});case"number":/* @__PURE__ */
|
|
14
|
-
return j(t,{label:J(l,r),htmlFor:a,icon:l.icon,hint:l.hint,children:/* @__PURE__ */j(s,{id:a,value:"number"==typeof o?o:void 0,onChange:i,min:l.min,max:l.max,step:l.step,placeholder:l.placeholder,readOnly:d})});case"select":{const n=`${a}-label`;/* @__PURE__ */
|
|
15
|
-
return j(t,{label:J(l,r),labelId:n,htmlFor:a,icon:l.icon,hint:l.hint,children:/* @__PURE__ */j(e,{id:a,value:o,options:l.options,onChange:i,readOnly:d,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
|
|
16
|
-
return j(t,{label:J(l,r),icon:l.icon,hint:l.hint,children:/* @__PURE__ */j(c,{ariaLabel:J(l,r),value:o,options:l.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||d})),onChange:e=>{d||i(e)}})});case"object":/* @__PURE__ */
|
|
17
|
-
return j(K,{...n,field:l});case"array":/* @__PURE__ */
|
|
18
|
-
return j(V,{...n,field:l});case"slot":return null}}var W=e=>l.includes(e);function X(e){let n,t=l[0];const r=[],a=/* @__PURE__ */new Set;for(const[l,o]of Object.entries(e))o&&(W(o.bucket)&&((o.marker||o.bucket!==t)&&(n=void 0),t=o.bucket),o.marker&&"string"==typeof o.fold?n={key:l,title:o.fold}:o.marker&&!1===o.fold&&(n=void 0),o.marker||!1===o.visible||(r.push(n?{name:l,field:o,bucket:t,fold:n}:{name:l,field:o,bucket:t}),"slot"!==o.type&&a.add(t)));return{rows:r,buckets:l.filter(e=>a.has(e))}}function Z(e){return new Map(X(e).rows.map(e=>[e.name,e.bucket]))}function q(e){const n=[];for(const t of e){const e=n[n.length-1];e&&e.fold?.key===t.fold?.key?e.rows.push(t):n.push({fold:t.fold,rows:[t]})}return n}function Q({fields:e,values:n,onChange:t,readOnly:l=!1,context:a,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y}){const N=u("panel",o),O=$(),I=p??`es-insp${O.replace(/:/g,"")}`,S=X(e),[F,P]=C(void 0),L=i??F,M=L&&S.buckets.includes(L)?L:S.buckets[0],[T,A]=C(null),H=T&&T.panel===I&&S.rows.some(e=>e.name===T.name)?T:null,E=c&&S.buckets.length>1,R=E&&M?k(I,M):`${I}-rows`,[z,B]=C(()=>/* @__PURE__ */new Set),Y=v??z,J=(e,n)=>/* @__PURE__ */j(r,{title:e.title,open:!Y.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&B(t=>{const l=new Set(t);return n?l.delete(e):l.add(e),l}),y?.(e,n)})(e.key,n),id:`${I}-fold-${e.key}`,children:n}),K=e=>E&&e!==M,V=({name:e,field:r,bucket:o})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":o,hidden:!!K(o)||void 0,children:/* @__PURE__ */j(G,{field:r,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:l,context:a,renderers:m,openItem:H&&H.name===e?H.index:null,onOpenItem:n=>A(null===n?null:{panel:I,name:e,index:n})})},e);/* @__PURE__ */
|
|
19
|
-
return D("div",{className:"es-insp",children:[E?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":h??N.settings,idPrefix:I,value:M,onChange:e=>{const n=e;void 0===i&&P(n),s?.(n)},items:S.buckets.map(e=>{const n=N.buckets[e],t=d?.[e];return t?{id:e,icon:t,label:/* @__PURE__ */j("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
|
|
20
|
-
/* @__PURE__ */D("div",{className:"es-insp-rows",id:R,role:E?"tabpanel":void 0,"aria-labelledby":E&&M?w(I,M):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:J(g,f)}):f:null,q(S.rows).map((e,n)=>{if(!e.fold)return e.rows.map(V);const t=e.rows[0].bucket,l=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
|
|
21
|
-
return j("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":t,hidden:!(!K(t)&&!l)||void 0,children:J(e.fold,e.rows.map(V))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{T as FieldText,Q as Inspector,G as InspectorField,Y as ListField,Z as bucketsOf,R as copyItem,A as insertAt,J as labelOf,H as moveTo,X as planFields,E as removeAt};
|
package/dist/chunk-FCEBEN5T.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-PFNIVZPN.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-2SXSWNKG.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-5F3PKNT7.js";import{useEasel as f}from"./chunk-AWKOTOE6.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-SSORUDHE.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-O2NLQBFX.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as O,jsxs as $,Fragment as N}from"react/jsx-runtime";var B=e=>`section:${e}`,v=e=>`block:${e}`,x=e=>`template:${e}`;function F({blocks:F,blocksOnly:I,at:S,onAdd:V,itemFor:A,session:H,siteWide:L,onClose:P,onHide:T,readOnly:D}){const K=f(e=>e.config),R=p(),{labelAtLevel:W,categoryLabel:w,firstSection:C,Icon:E,Thumbnail:Q}=R,{blockIsOffered:z}=m(),G=u("screen",d).add,X=u("drag",h).add,Y=l(),[Z,J]=y([]);b(()=>{let t=!1;const o=e=>z(e,Y);return s(Y).list().then(n=>{if(t)return;const i=K.components;J(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[K,Y]);const M=j(()=>t(K,R),[K]),U=e=>({type:B(e.type),label:e.name,cover:/* @__PURE__ */O(Q,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:G.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),q=j(()=>{const e=[];if(F&&F.choices.length>0&&a(F.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${G.inside({name:F.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:v(e.type),label:e.label,icon:/* @__PURE__ */O(E,{type:e.type,size:18}),title:G.tile({name:e.label})}))})}),I)return e;const t=o(M,C);t&&e.push({key:"start",title:G.startBlank,tiles:[U(t)]}),Z.length>0&&e.push({key:"templates",title:G.templates,tiles:Z.map(e=>{return{type:x(e.id),label:e.name,cover:/* @__PURE__ */O(Q,{type:e.node.type}),keywords:[(t=e.node.type,W(t,"section",K.components[t]?.label??t)),e.node.type]};var t})});const s=n(M,C);for(const t of Object.keys(K.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(K,t,w),tiles:o.map(U)})}return e},[F,I,Z,M,K,G]),_=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=Z.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
|
|
2
|
-
return $(N,{children:[
|
|
3
|
-
/* @__PURE__ */O(r,{icon:/* @__PURE__ */O(g,{size:15}),title:G.title,context:I?G.contextBlocks:G.contextAll,actions:/* @__PURE__ */O(c,{label:G.done,description:G.doneDescription,onClick:P}),onHide:T}),
|
|
4
|
-
/* @__PURE__ */$("div",{className:"sf-addside sf-scroll",children:[
|
|
5
|
-
/* @__PURE__ */O(k,{groups:q,session:H,itemFor:e=>A(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&V(t)},at:S,hint:I?G.hintBlocks:G.hint,searchLabel:I?G.searchBlocks:G.searchSections,readOnly:D,words:X}),L&&!I?L:null]})]})}export{F as AddSidePanel,v as blockKey,B as sectionKey,x as templateKey};
|