efficient-easel 3.1.0 → 3.6.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.
Files changed (78) hide show
  1. package/README.md +3 -1
  2. package/dist/blocks/index.d.ts +2 -2
  3. package/dist/{chunk-EF3YSWT5.js → chunk-2I7MAA2U.js} +1 -1
  4. package/dist/chunk-55IKQFBW.js +5 -0
  5. package/dist/{chunk-JVUGLF5I.js → chunk-6B4276GZ.js} +3 -3
  6. package/dist/{chunk-TGF7KEO7.js → chunk-6QSPOILR.js} +1 -1
  7. package/dist/chunk-7P6IFCR4.js +1 -0
  8. package/dist/{chunk-LHZIMK3M.js → chunk-FRGCTHDB.js} +1 -1
  9. package/dist/{chunk-PT6V53OO.js → chunk-J2JBETVO.js} +1 -1
  10. package/dist/chunk-MCHMF32I.js +1 -0
  11. package/dist/{chunk-53NZMIRT.js → chunk-MTRFMGBO.js} +1 -1
  12. package/dist/{chunk-BVUPKIM3.js → chunk-OFNXIZEP.js} +1 -1
  13. package/dist/{chunk-VX5GDBRI.js → chunk-PAM3NLFL.js} +1 -1
  14. package/dist/chunk-PDZXAFNX.js +9 -0
  15. package/dist/chunk-QASZFO4S.js +1 -0
  16. package/dist/chunk-QVWPI2FL.js +5 -0
  17. package/dist/{chunk-7HGVGKWU.js → chunk-TNTV7UZ6.js} +65 -64
  18. package/dist/{chunk-TCNPQKY6.js → chunk-UVAIY7VO.js} +1 -1
  19. package/dist/{chunk-QMBB7SU5.js → chunk-WSNVBUPL.js} +1 -1
  20. package/dist/{chunk-VGV5D667.js → chunk-WZMU646D.js} +2 -2
  21. package/dist/{chunk-4LD4KA27.js → chunk-ZN752E2O.js} +1 -1
  22. package/dist/easel/index.d.ts +5 -5
  23. package/dist/easel/index.js +1 -1
  24. package/dist/node-ops/index.d.ts +2 -2
  25. package/dist/node-ops/index.js +1 -1
  26. package/dist/{plan-DChbUXdS.d.ts → plan-BdQ9mLIf.d.ts} +20 -1
  27. package/dist/screen/components/AddBlockRow.js +1 -1
  28. package/dist/screen/components/AddSidePanel.js +1 -1
  29. package/dist/screen/components/MediaSidePanel.d.ts +2 -2
  30. package/dist/screen/components/MediaSidePanel.js +1 -1
  31. package/dist/screen/components/NodeContextMenu.d.ts +3 -3
  32. package/dist/screen/components/NodeContextMenu.js +1 -1
  33. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  34. package/dist/screen/components/ScreenChrome.js +1 -1
  35. package/dist/screen/components/ScreenDocumentContext.d.ts +2 -2
  36. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  37. package/dist/screen/components/ScreenMount.d.ts +2 -2
  38. package/dist/screen/components/ScreenMount.js +1 -1
  39. package/dist/screen/components/ScreenStoreProvider.d.ts +2 -2
  40. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  41. package/dist/screen/components/SectionScreenShell.js +15 -15
  42. package/dist/screen/components/usePartBridge.d.ts +2 -2
  43. package/dist/screen/components/usePartBridge.js +1 -1
  44. package/dist/screen/index.d.ts +2 -2
  45. package/dist/screen/index.js +1 -1
  46. package/dist/screen/lib/admin-bridge.d.ts +2 -2
  47. package/dist/screen/lib/document-addressing.d.ts +2 -2
  48. package/dist/screen/lib/document-hooks.d.ts +2 -2
  49. package/dist/screen/lib/host.d.ts +2 -2
  50. package/dist/screen/lib/key-scope.js +1 -1
  51. package/dist/screen/lib/media-panel.d.ts +2 -2
  52. package/dist/screen/lib/media-picker.d.ts +2 -2
  53. package/dist/screen/lib/page-lock.d.ts +2 -2
  54. package/dist/screen/lib/puck/device-fields.js +1 -1
  55. package/dist/screen/lib/puck/palette-sections.d.ts +2 -2
  56. package/dist/screen/lib/puck/section-doc.d.ts +2 -2
  57. package/dist/screen/lib/puck/style-clipboard.d.ts +2 -2
  58. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  59. package/dist/screen/lib/puck/use-section-ops.d.ts +2 -2
  60. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  61. package/dist/screen/lib/screen-parts.d.ts +4 -4
  62. package/dist/screen/lib/screen-parts.js +1 -1
  63. package/dist/screen/lib/section-templates.d.ts +2 -2
  64. package/dist/screen/lib/session-context.d.ts +2 -2
  65. package/dist/screen/lib/session.d.ts +2 -2
  66. package/dist/screen/words.d.ts +2 -0
  67. package/dist/screen/words.js +1 -1
  68. package/dist/strings/catalogue.js +1 -1
  69. package/dist/strings/index.js +1 -1
  70. package/dist/{types-E3HrTPg2.d.ts → types-CGFykP7c.d.ts} +1 -1
  71. package/dist/{useNodeOps-BF0fQsif.d.ts → useNodeOps-B3e4b8a2.d.ts} +1 -1
  72. package/package.json +1 -1
  73. package/dist/chunk-D2BCHTQR.js +0 -1
  74. package/dist/chunk-EJ6QAWRH.js +0 -5
  75. package/dist/chunk-LYALMY55.js +0 -1
  76. package/dist/chunk-MYC3AVG2.js +0 -1
  77. package/dist/chunk-PYCLHOSA.js +0 -9
  78. package/dist/chunk-UV4D7CDX.js +0 -5
@@ -5,11 +5,11 @@ import { WebsiteEditLock } from './document-contract.js';
5
5
  import { EaselDocumentHooks } from './document-hooks.js';
6
6
  import { SectionTemplateStore } from './section-template-types.js';
7
7
  import 'react';
8
- import '../../types-E3HrTPg2.js';
8
+ import '../../types-CGFykP7c.js';
9
9
  import '../../data/index.js';
10
10
  import '../../types-41704JE4.js';
11
11
  import '../../resolve-D68pb3Bx.js';
12
- import '../../plan-DChbUXdS.js';
12
+ import '../../plan-BdQ9mLIf.js';
13
13
  import '../../edit-lock/index.js';
14
14
  import './links/link-filters.js';
15
15
  import 'efficient-shell/ui';
@@ -217,6 +217,8 @@ type ScreenWords = {
217
217
  /** The Layers head's button, while every section is folded, and while not. */
218
218
  expandAll: string;
219
219
  collapseAll: string;
220
+ /** …its tooltip while the page has nothing to fold, and the button is off. */
221
+ nothingToFold: string;
220
222
  /** The pinned Footer's row where the page has no footer of its own: its tooltip. */
221
223
  editFooter: string;
222
224
  /** The box a row's name is typed in: its accessible name. */
@@ -1 +1 @@
1
- export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-LYALMY55.js";
1
+ export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-MCHMF32I.js";
@@ -1 +1 @@
1
- export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-QMBB7SU5.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-LYALMY55.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";
1
+ export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-WSNVBUPL.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-MCHMF32I.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-O2NLQBFX.js";
@@ -1,2 +1,2 @@
1
- import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-QMBB7SU5.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-QMBB7SU5.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-LYALMY55.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
1
+ import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-WSNVBUPL.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-WSNVBUPL.js";import"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import"../chunk-6WY6ZXJG.js";import"../chunk-MCHMF32I.js";import"../chunk-AELNNAFM.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-WK3AFPXY.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Y2G7CU6A.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-JZDEIRH4.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-O2NLQBFX.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
2
2
  return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
@@ -1,5 +1,5 @@
1
1
  import { DataInput } from './data/index.js';
2
- import { I as ItemSelector, N as NodeSelection } from './plan-DChbUXdS.js';
2
+ import { I as ItemSelector, N as NodeSelection } from './plan-BdQ9mLIf.js';
3
3
  import { D as Data, S as SlotAddress, a as DataConfig, N as Node } from './types-41704JE4.js';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { N as Node, S as SlotAddress, D as Data, a as DataConfig, P as Place } from './types-41704JE4.js';
2
- import { N as NodeSelection, A as AfterRemove, S as StepBounds } from './plan-DChbUXdS.js';
2
+ import { N as NodeSelection, A as AfterRemove, S as StepBounds } from './plan-BdQ9mLIf.js';
3
3
 
4
4
  /**
5
5
  * The node clipboard — what Copy and Cut hold, and Paste reads.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "3.1.0",
3
+ "version": "3.6.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",
@@ -1 +0,0 @@
1
- import{find as t,remove as e,getList as n,newId as r,duplicate as o,move as a,copyNode as c,insert as l,setProps as d}from"./chunk-KRXQM65X.js";import{useRef as s,useSyncExternalStore as i,useCallback as p,useMemo as u}from"react";var f=t=>({kind:"node",id:t});function m(r,o,a,c="none"){const l=t(r,o,a),d=e(r,o,a);if("none"===c||!l)return{data:d,select:null};const s=n(r,o,l.place)??[],i=s[l.place.index+1]??s[l.place.index-1];return i?.props?.id?{data:d,select:f(i.props.id)}:"root"!==l.place.parentId?{data:d,select:f(l.place.parentId)}:{data:d,select:null}}function x(e,n,a,c={}){const l=t(e,n,a)?.node,d=c.id??r(l?.type??"Node");return{data:o(e,n,a,{strip:c.strip,id:d}),select:f(d)}}function I(t,e,n,r){return{data:a(t,e,n,r),select:f(n)}}var v=(t,e)=>({min:0,max:e-1});function b(e,r,o,a,c=v){const l=t(e,r,o);if(!l)return!1;const d=n(e,r,l.place)?.length??0,{min:s,max:i}=c(l.place,d),p=l.place.index+a;return l.place.index>=s&&l.place.index<=i&&p>=s&&p<=i}function g(e,n,r,o,a=v){if(!b(e,n,r,o,a))return null;const c=t(e,n,r);return I(e,n,r,{...c.place,index:c.place.index+o})}function k(t,e,n,r,o={}){const a=c(n,e,{strip:o.strip});return{data:l(t,e,r,a),select:f(a.props.id)}}function y(t,e,n,r){return{data:d(t,e,n,r),select:void 0}}function h(e,n,r,o=()=>!1){if(!r)return null;if("slot"===r.kind)return t(e,n,r.parentId)?f(r.parentId):null;const a=t(e,n,r.id);if(!a||"root"===a.place.parentId)return null;const c=t(e,n,a.place.parentId);return c?o(c.node,a.place.slot)?{kind:"slot",parentId:c.node.props.id,slot:a.place.slot}:f(c.node.props.id):null}function z(e,n,r){if(!r||"node"!==r.kind)return null;const o=t(e,n,r.id);return o?{zone:`${o.place.parentId}:${o.place.slot}`,index:o.place.index}:null}function O(t,e,r){if(!r)return null;const[o,a]=(r.zone??"root:default-zone").split(/:(.*)/s),c={parentId:o,slot:a},l=n(t,e,c)?.[r.index];return l?.props?.id?f(l.props.id):null}var R={get:()=>null,set:()=>{},subscribe:()=>()=>{}};function B(e){const n=s(e);n.current=e;const r=e.clipboard??R,o=i(r.subscribe,r.get,r.get),a=p(t=>{const e=n.current;if(e.readOnly)return!1;const r=t(e.data,e.config);return!!r&&((r.data!==e.data||void 0!==r.select)&&(e.commit(r.data,{select:r.select}),n.current={...e,data:r.data},!0))},[]);return u(()=>{const e=()=>n.current,r=(n,r)=>{const o=t(e().data,e().config,n);return o?{node:o.node,label:r,from:{parentId:o.place.parentId,slot:o.place.slot}}:null};return{held:o,remove:t=>a((n,r)=>m(n,r,t,e().afterRemove)),duplicate:t=>a((n,r)=>x(n,r,t,{strip:e().strip})),move:(t,e)=>a((n,r)=>I(n,r,t,e)),step:(t,n)=>a((r,o)=>g(r,o,t,n,e().stepBounds)),canStep:(t,n)=>b(e().data,e().config,t,n,e().stepBounds),setProps:(t,e)=>a((n,r)=>y(n,r,t,e)),copy:(t,n)=>{const o=r(t,n);return o&&(e().clipboard??R).set(o),!!o},cut:(t,n)=>{if(e().readOnly)return!1;const o=r(t,n);return!!o&&((e().clipboard??R).set(o),a((n,r)=>m(n,r,t,e().afterRemove)))},paste:t=>{const n=(e().clipboard??R).get();return!!n&&a((r,o)=>k(r,o,n.node,t,{strip:e().strip}))},parentOf:t=>h(e().data,e().config,t,e().slotIsLevel)}},[o,a])}export{b as canStep,O as fromItemSelector,h as parentStep,x as planDuplicate,I as planMove,k as planPaste,m as planRemove,y as planSetProps,g as planStep,z as toItemSelector,B as useNodeOps};
@@ -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-PYCLHOSA.js";import{Inspector as i}from"./chunk-CRPJGCSO.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},C={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},L={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},S={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},j={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function w(){/* @__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 G=o({});function D({parts:n,children:e}){/* @__PURE__ */
4
- return s(G.Provider,{value:n,children:e})}function N(){return u(G)}function x(){return(N().useOwnerName??g)()}function A(){return(N().useDocumentLabel??y)()}function B(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function I(n){return(N().useStandaloneBridges??v)(n)}function R(n,e){(N().useDocumentPass??b)(n,e)}function T(){return N().blockRules??O}function F(){return N().blockLook??C}function H(){return N().devices??L}function K(){return N().leftView??S}function V(){return N().pinned??j}function W(){return N().saveSwitch??!0}function Y(n){e(!0===N().pickFollowsSelection,n)}function E(){return N().add??h}function J(){return N().storageNamespace||void 0}function Q(){return N().styleClipboard??null}function Z(){return N().nodeKeys??!0}function q(){return N().notify??null}function z(){return N().Canvas??w}function M(){return N().CanvasHead??null}function U(){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,D as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,E as useScreenAdd,F as useScreenBlockLook,T as useScreenBlockRules,B as useScreenBridges,U as useScreenCanvasDrag,z as useScreenCanvasFrame,M as useScreenCanvasHead,_ as useScreenCanvasTarget,H as useScreenDevices,A as useScreenDocumentLabel,R as useScreenDocumentPass,nn as useScreenInspectorPanel,K as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,x as useScreenOwnerName,N as useScreenParts,Y as useScreenPickFollowsSelection,V as useScreenPinned,W as useScreenSaveSwitch,J as useScreenStorageNamespace,Q as useScreenStyleClipboard,I as useStandaloneScreenBridges};
@@ -1 +0,0 @@
1
- var e={title:"Add",contextBlocks:"Blocks for this place",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",startBlank:"Start blank",templates:"Your templates",inside:({name:e})=>`Inside ${e}`,tile:({name:e})=>`Add ${e}`,hintBlocks:"Drag into the page, or click to add.",hint:"Drag onto the page, or click to add.",searchBlocks:"Search blocks",searchSections:"Search sections",addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"},t={loading:"Loading…",waitingForAuthorization:"Waiting for editor authorization…",missingTemplatePage:"Couldn’t open a page in this template.",missingPage:({slug:e})=>`No page with slug "${e}".`,missingDocument:"Couldn’t open this document.",loadFailed:({cause:e})=>`Could not load the document — ${e}`,noun:"page",pageSettings:"Page settings",header:"Header",footer:"Footer",pageSections:"Template · Home page",templateSections:"Template · Template",addSection:"Add section",addSectionBefore:({name:e})=>`Add section before ${e}`,addSectionHere:"Add section here",done:"Done",copied:({name:e})=>`Copied ${e}`,pasteRefused:({name:e})=>`${e} can’t be pasted here.`,add:e,canvasAddBlock:"Add block",railMedia:"Media library",leftPanel:"Left panel",resizeLeftPanel:"Resize left panel",leave:{title:"Unsaved changes",body:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them.",cancel:"Cancel",discard:"Discard & leave",save:"Save & leave",saving:"Saving…"},bar:{undo:"Undo",redo:"Redo",refresh:"Refresh",refreshTip:"Refresh the preview (reloads the canvas, keeps your place)",notSaving:"Not saving — see the notice above",retry:"Retry now",autoSaveOff:"Auto-save is off — click to turn it back on (saves your held edits)",autoSaveOn:"Auto-save is on — click to pause it",views:"Left panel views"},menu:{undo:"Undo",redo:"Redo",addSection:"Add section",collapseAll:"Collapse all layers",selectAll:"Select all",pinned:"Pinned — can’t be moved or deleted",clipboardRefused:"Your browser won’t let us read the clipboard — press ⌘V"},layers:"Layers",expandAll:"Expand all sections",collapseAll:"Collapse all sections",editFooter:"Edit the site footer",rename:"Rename",deleteNamed:({name:e})=>`Delete ${e}`,hideNamed:({name:e})=>`Hide ${e}`,showNamed:({name:e})=>`Show ${e}`,addBlockHere:"Add block here",sectionFirst:({name:e})=>`“${e}” is already first`,sectionLast:({name:e})=>`“${e}” is already last`,sectionMoved:({name:e,n:t,total:a})=>`Moved “${e}” to position ${t} of ${a}`,sectionAdded:({name:e})=>`Added “${e}” section`,resizeSettingsPanel:"Resize settings panel",sectionSettings:({name:e})=>`${e} settings`,headerSettings:"Header settings",addBlockMenu:"Add block",deviceNote:{tablet:"Tablet uses the desktop settings.",mobile:"Showing the phone settings for this section."}};export{e as DEFAULT_SCREEN_ADD_WORDS,t as DEFAULT_SCREEN_WORDS};
@@ -1 +0,0 @@
1
- import{panelFieldsOf as t}from"./chunk-ZE7I3PLX.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-VX5GDBRI.js";import{BUCKET_KEY as r}from"./chunk-R2HLPNQF.js";import{ANCHOR_FIELD_KEYS as e,foldMetaOf as s,MEDIA_FIELD_MARKER as c,TEXT_FIELD_MARKER as p,LINK_FIELD_MARKER as i}from"./chunk-DUVRZ456.js";import{STYLE_KIND as u,fieldKind as f,copyStyle as a,heldStyle as l,planPaste as m,pasteMessage as y}from"./chunk-V7U33NF2.js";var h=/* @__PURE__ */new Set([r.Style,r.Layout]),j=new Set(Object.values(r)),w=new Set(e),b=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[c,p,i];function S(t){return`site:${t??""}`}function g(t){if(!t||"object"!=typeof t)return null;const n=t,r=o(t)??t,e=n[u]??r[u];if("string"==typeof e)return e;const s=n.options??r.options;if(Array.isArray(s)){return`choice:${s.map(t=>String(t?.value)).sort().join("|")}`}return f(r)}function v(t){const n=t,r=o(t);return k.some(t=>t in n||r&&t in r)}function L(o,r){const e=t(o,r)??{},c=[];let p=!1;for(const[t,o]of Object.entries(e))j.has(t)?p=h.has(t):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(s(o)||w.has(t)||b.has(t)||v(o)||"slot"!==o.type&&c.push({path:[t],kind:g(o),counted:"mobile"!==n(o)?.tier}));return c}function d(t,o,n,r,e){a({scope:n,type:r.type,label:e,rows:t(o,r),props:r.props})}function F(t,o,n,r,e,s){const c=l(n);if(!c)return null;const p=m(c,{type:r.type,rows:t(o,r),props:r.props});return{...p,message:y(p,c.sourceLabel,e,s)}}function I(t,o,n,r){d(L,t,o,n,r)}function R(t,o,n,r,e){return F(L,t,o,n,r,e)}var V={scope:t=>S(t.siteId),rows:(t,o)=>L(t,o),copy:(t,o,n,r)=>I(r,t,o,n),plan:(t,o,n,r)=>R(r,t,o,n)};function A(t,o){if(!t&&!o)return V;const n=t?.rows,r=n?(t,o)=>n(t,o):L;return{scope:t?.scope??V.scope,rows:(t,o)=>r(t,o),copy:t?.copy??((t,o,n,e)=>d(r,e,t,o,n)),plan:t?.plan??((t,n,e,s)=>F(r,s,t,n,e,o))}}export{I as copyNodeStyle,L as nodeStyleRows,R as planNodePaste,g as shopFieldKind,S as siteStyleScope,A as styleClipboardOf};
@@ -1,9 +0,0 @@
1
- import{DEFAULT_CANVAS_WORDS as e}from"./chunk-AELNNAFM.js";import{useResolvedFields as t}from"./chunk-YRLPFZW3.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r}from"./chunk-D2BCHTQR.js";import{useWords as a}from"./chunk-MFIRYGHW.js";import{setCanvasNonce as i,isTypingTarget as s}from"./chunk-ZNCEOSXO.js";import{find as d,ROOT_ID as l,getList as c,remove as u,parseZoneKey as p,move as f,duplicate as h,replaceNode as m,createNode as v,insert as y,normalizeData as g,createResolveCache as k,resolveNodeData as b,ROOT_SLOT as w}from"./chunk-KRXQM65X.js";import{topLevelSlotKeys as S,fieldsFrom as I,defaultsFrom as C}from"./chunk-NKB3KVAB.js";import{createContext as O,useEffect as x,useContext as E,useRef as A,useSyncExternalStore as D,useState as z,useMemo as M,useCallback as Z,useLayoutEffect as N}from"react";import{jsx as $,jsxs as j}from"react/jsx-runtime";import{createPortal as R}from"react-dom";function B(e){return!["setData","setUi","set"].includes(e.type)}var P=(e,t,n,o)=>{const r=c(e,t,p(n));return r?.[o]??null},L=(e,t,n,o,r)=>{const a=P(e,t,n,o);if(!a)throw new Error(`${r}: nothing at ${n}[${o}]`);return a};function K(e,t){const{selection:o}=e;return{...e.ui,itemSelector:n(e.data,t,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function F(e,t,n){return n?"node"===n.kind?d(e,t,n.id)?n:null:n.parentId===l?c(e,t,n)?n:null:d(e,t,n.parentId)&&c(e,t,n)?n:null:null}function H(e,t,n,r=!1){const{itemSelector:a,selectedSlot:i,...s}=n;let d=e.selection;var l;return"itemSelector"in n&&(d=o(e.data,t,a??null)),"selectedSlot"in n&&(i?d=(l=i)?{kind:"slot",parentId:l.parentId,slot:l.slot}:null:"slot"===d?.kind&&(d=null)),{...e,selection:d,ui:r?s:{...e.ui,...s}}}function V(e,t,n){const o=T(e,t,n);if(o===e)return e;const r=F(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function T(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return H(e,n,"function"==typeof t.ui?t.ui(K(e,n)):t.ui);case"set":{const r={data:o,ui:K(e,n)},a="function"==typeof t.state?t.state(r):t.state;let i=a.data?{...e,data:a.data}:e;return a.ui&&(i=H(i,n,a.ui,!0)),i}case"insert":{const r={...p(t.destinationZone),index:t.destinationIndex},a=v(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:y(o,n,r,a)}}case"replace":{const r=L(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:m(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=L(o,n,t.sourceZone,t.sourceIndex,"duplicate"),a=h(o,n,r.props.id),i=P(a,n,t.sourceZone,t.sourceIndex+1);return{...e,data:a,selection:i?{kind:"node",id:i.props.id}:e.selection}}case"reorder":return T(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=P(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const a={...p(t.destinationZone),index:t.destinationIndex};return{...e,data:f(o,n,r.props.id,a)}}case"remove":{const r=L(o,n,t.zone,t.index,"remove");return{...e,data:u(o,n,r.props.id)}}default:return e}}var q={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},Y={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},U=0,W=()=>`history-${U+=1}`;function X(e){let t=e.config;const r=e.now??(()=>Date.now()),a=e.historyCoalesceMs??250;let i=e.permissions??{};const s=g(e.data,t);let l={data:s,selection:null,ui:{...Y}};if(e.ui){const{itemSelector:n,selectedSlot:r,...a}=e.ui;l={data:s,selection:r?{kind:"slot",...r}:o(s,t,n??null),ui:{...Y,...a}}}let u=[{core:l,at:-1/0,sealed:!0,id:W()}],p=0;const f=e=>{const t=u[p],n=r();!e&&p===u.length-1&&p>0&&!t.sealed&&n-t.at<a?u=[...u.slice(0,p),{...t,core:l,at:n}]:(u=[...u.slice(0,p+1),{core:l,at:n,sealed:e,id:W()}],p=u.length-1)},h=/* @__PURE__ */new Set;let v=null,y=null,w=0,S=null,I=!1;const C=()=>{for(const e of[...h])e()},O=()=>{u=[...u.slice(0,p),{...u[p],core:l},...u.slice(p+1)]},x=(t,n)=>{w>0?I=I||n:(n?f(!1):l!==t&&O(),l.data!==t.data&&e.onChange?.(l.data),l!==t&&C())},E=e=>{const n=l;if(l=V(l,e,t),l===n)return;const o=e.recordHistory??B(e);x(n,o&&l.data!==n.data)},A=t=>{0===w&&(S=l,I=!1),w+=1;try{t()}catch(e){throw w-=1,0===w&&S&&(l=S,S=null),e}if(w-=1,w>0||!S)return;const n=S;S=null,I&&l.data!==n.data?f(!0):l!==n&&O(),l.data!==n.data&&e.onChange?.(l.data),l!==n&&C()},D=e=>{const n=l,o=F(l.data,t,e);var r,a;(r=o,a=l.selection,r===a||r&&a&&r.kind===a.kind&&("node"===r.kind&&"node"===a.kind?r.id===a.id:"slot"===r.kind&&"slot"===a.kind&&r.parentId===a.parentId&&r.slot===a.slot))||(l={...l,selection:o},x(n,!1))},z=t=>{const n=l;p=t,l=u[p].core,l.data!==n.data&&e.onChange?.(l.data),l!==n&&C()},M=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...q,...i,...n}};let Z=M();const N=k(),$={resolveCache:N,async resolveAll({trigger:e="load",metadata:n}={}){const o=l.data,r={type:"root",props:{...o.root.props??{}}},a=[...o.content,...Object.values(o.zones??{}).flat()],[i,...s]=await Promise.all([b(r,t,{cache:N,trigger:e,metadata:n}),...a.map(o=>b(o,t,{cache:N,trigger:e,metadata:n}))]);A(()=>{const e=l;let n=l.data;s.forEach((e,r)=>{if(!e.didChange)return;const i=a[r].props.id,s=d(n,t,i)?.node;s&&s===d(o,t,i)?.node&&(n=m(n,t,i,e.node))}),i.didChange&&n.root===o.root&&(n={...n,root:{...n.root,props:i.node.props,readOnly:i.node.readOnly??n.root.readOnly}}),n!==l.data&&(l={...l,data:n,selection:F(n,t,l.selection)},x(e,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=d(l.data,t,e)?.node;if(!r)return!1;const a=await b(r,t,{cache:N,trigger:n,metadata:o});if(!a.didChange)return!1;let i=!1;return A(()=>{const n=l;if(d(l.data,t,e)?.node!==r)return;const o=m(l.data,t,e,a.node);o!==l.data&&(l={...l,data:o,selection:F(o,t,l.selection)},x(n,!1),i=!0)}),i},get config(){return t},getState(){if(v&&y===l)return v;const e=l,o={data:e.data,ui:K(e,t)},r="node"===e.selection?.kind?d(e.data,t,e.selection.id)?.node??null:null;return v={appState:o,selection:e.selection,selectedItem:r,config:t,dispatch:E,history:{back:()=>$.undo(),forward:()=>$.redo(),hasPast:p>0,hasFuture:p<u.length-1,histories:u.map(e=>({id:e.id,state:{data:e.core.data,ui:K(e.core,t)}})),index:p,setHistoryIndex:e=>{e>=0&&e<u.length&&e!==p&&z(e)}},getPermissions:Z,getItemById:n=>d(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return c(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,t,n),getSelectorForId:o=>{const r=n(e.data,t,{kind:"node",id:o});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},y=e,v},subscribe:e=>(h.add(e),()=>{h.delete(e)}),dispatch:E,batch:A,select:e=>D(e?{kind:"node",id:e}:null),selectSlot:e=>D(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){A(()=>{const n=l,o=void 0===e.select?l.selection:e.select;l={...l,data:e.data,selection:F(e.data,t,o)},x(n,e.data!==n.data)})},load(e,n={}){const o=l,r=g(e,t);l={...l,data:r,selection:F(r,t,n.selection??l.selection)},n.keepHistory||(u=[{core:l,at:-1/0,sealed:!0,id:W()}],p=0),l!==o&&C()},undo(){p>0&&z(p-1)},redo(){p<u.length-1&&z(p+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,i)||(i=e,Z=M(),v=null,C())},setConfig(e){e!==t&&(t=e,Z=M(),v=null,C())}};return $}function Q(e,t,n={}){const o=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const o="KeyZ"===e.code,r="KeyY"===e.code&&!e.shiftKey;(o||r)&&(n.leaveTyping&&s(e.target)||!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),r||e.shiftKey?t.redo():t.undo()))};return e.addEventListener("keydown",o),()=>e.removeEventListener("keydown",o)}var G=O(null),J=O(!0);function _({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return x(()=>{n&&e.resolveAll()},[e,n]),x(()=>{if(t&&"undefined"!=typeof document)return Q(document,e)},[e,t]),/* @__PURE__ */$(G.Provider,{value:e,children:/* @__PURE__ */$(J.Provider,{value:t,children:o})})}function ee(){const e=E(G);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function te(e){const t=ee(),n=A({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const a=e(o);return r.has&&Object.is(r.value,a)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:a,has:!0},a)};return D(t.subscribe,o,o)}function ne(){return function(e){return te(e)}}var oe="data-puck-component",re="data-puck-dropzone",ae={},ie="data-es-mirror",se="undefined"==typeof window?x:N;function de(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${ie}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(ie,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function le({children:t,id:n="preview-frame",title:o,className:r,style:s,mirrorStyles:d=!0,onDocument:l,height:c="auto",nonce:u}){const p=a("canvas",e),f=A(null),[h,m]=z(null);return se(()=>{const e=f.current,t=h?.ownerDocument.defaultView;if("auto"!==c||!e||!h||!t)return;const n=()=>{e.style.height=`${Math.ceil(h.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(h),()=>r?.disconnect()},[h,c]),se(()=>{let e=f.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=f.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-puck-entry",""),t.id="frame-root","fill"===c&&t.classList.add("es-frame-fill"),e.body.appendChild(t),i(e,u),m(t),l?.(e);let n=null;const o=f.current?.ownerDocument;if(d&&o){de(o,e,u);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>de(o,e,u)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}return()=>{n?.disconnect(),t.remove(),m(null),l?.(null)}},[]),/* @__PURE__ */$("iframe",{ref:f,id:n,title:o??p.frame,className:["es-canvas-frame","fill"===c?"is-fill":"",r??""].filter(Boolean).join(" "),style:s,children:h?R(t,h):null})}var ce=O(null),ue=O(ae),pe=[];function fe({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128}){const a=ee(),i=te(n=>c(n.appState.data,a.config,{parentId:e,slot:t})??pe),s=te(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==l),d=te(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),u=E(ce),p=["es-zone"];return i.length&&p.push("has-children"),e===l&&p.push("is-root"),(s||d)&&p.push("is-area-selected"),null!==u&&u===e&&e!==l&&p.push("is-hovering-area"),n&&p.push(n),/* @__PURE__ */$("div",{className:p.join(" "),[re]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`},children:i.map(e=>/* @__PURE__ */$(ve,{node:e},e.props.id))})}function he(e,t,n,o){const r="root"===t?e.root:e.components[t],a={...o};for(const e of S(I(r)))a[e]=function(t={}){/* @__PURE__ */
2
- return $(fe,{parentId:n,slot:e,...t})};return a}function me(e){return function({zone:t,...n}){/* @__PURE__ */
3
- return $(fe,{parentId:e,slot:t,...n})}}function ve({node:e}){const t=ee().config,n=t.components[e.type],o=e.props.id,r=function(e){const t=A(null);return M(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(oe),o.removeAttribute("data-puck-dnd")),t.current=n,n&&(n.setAttribute(oe,e),n.setAttribute("data-puck-dnd",e),n.style.position="relative")},[e])}(o),a=E(ue);if(!n?.render)return null;const i=n.render,s=he(t,e.type,o,{...C(n),...e.props}),d={renderDropZone:me(o),isEditing:!0,dragRef:n.inline?r:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */$(i,{...s,puck:d,editMode:!0}):/* @__PURE__ */$("div",{[oe]:o,"data-puck-dnd":o,style:{position:"relative"},children:/* @__PURE__ */$(i,{...s,puck:d,editMode:!0})})}function ye({metadata:e}){const t=te(e=>e.config),n=te(e=>e.appState.data.root).props??{},o=t.root?.render,r=/* @__PURE__ */$(fe,{parentId:l,slot:w}),a=o?/* @__PURE__ */$(o,{id:"puck-root",...he(t,"root",l,n),puck:{renderDropZone:me(l),isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:r}):r;/* @__PURE__ */
4
- return $(ue.Provider,{value:e??ae,children:a})}function ge({id:e,kind:t,overlay:n}){const o=A(null),[r,a]=z(null);se(()=>{const t=o.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!e)return void a(null);let r=0;const i=()=>{r=0;const i=function(e,t){if(!e||!t)return null;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(t.querySelector(`[${oe}="${n.CSS?.escape?n.CSS.escape(e):e}"]`),o.current?.parentElement??null);a(e=>{return(t=e)===(n=i)||t&&n&&t.top===n.top&&t.left===n.left&&t.width===n.width&&t.height===n.height?e:i;var t,n})},s=()=>{r||(r=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(i))};i();const d="MutationObserver"in n?new n.MutationObserver(s):null;d?.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0});const l="ResizeObserver"in n?new n.ResizeObserver(s):null;return l?.observe(t.documentElement),n.addEventListener("resize",s),()=>{d?.disconnect(),l?.disconnect(),n.removeEventListener("resize",s),r&&(n.cancelAnimationFrame??n.clearTimeout)(r)}},[e]);const i=/* @__PURE__ */$("div",{ref:o,"aria-hidden":"true",className:`es-canvas-outline is-${t}`,style:r?{position:"absolute",top:r.top,left:r.left,width:r.width,height:r.height}:{display:"none"}});return n&&e?/* @__PURE__ */$(n,{componentId:e,kind:t,children:i}):i}function ke({frame:e=!0,className:t,style:n,metadata:o,mirrorStyles:r,onDocument:a,height:i,title:s,nonce:d,hotkeys:l,frameWrapper:c,overlay:u,children:p}){const f=ee(),h=E(J),m=l??h,[v,y]=z(void 0),g=te(e=>"node"===e.selection?.kind?e.selection.id:null),[k,b]=z(null),w=/* @__PURE__ */j("div",{className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;t.closest?.("a[href]")&&e.preventDefault();const n=t.closest?.(`[${oe}]`);n?f.select(n.getAttribute(oe)):t.hasAttribute?.(re)||f.select(null)},onMouseOver:e=>{const t=e.target.closest?.(`[${oe}]`),n=t?.getAttribute(oe)??null;n!==k&&b(n)},onMouseLeave:()=>b(null),children:[
5
- /* @__PURE__ */$(ce.Provider,{value:k,children:/* @__PURE__ */$(ye,{metadata:o})}),
6
- /* @__PURE__ */j("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
7
- /* @__PURE__ */$(ge,{id:k&&k!==g?k:null,kind:"hover",overlay:u}),
8
- /* @__PURE__ */$(ge,{id:g,kind:"selected",overlay:u})]}),p]}),S=c?/* @__PURE__ */$(c,{document:v,children:w}):w;x(()=>{if(v&&m)return Q(v,f)},[v,m,f]);/* @__PURE__ */
9
- return $("div",{className:"es-canvas"+(t?` ${t}`:""),style:n,"data-puck-preview":"",children:e?/* @__PURE__ */$(le,{mirrorStyles:r,onDocument:e=>{y(e??void 0),a?.(e)},height:i,title:s,nonce:d,children:S}):/* @__PURE__ */$("div",{id:"preview-frame","data-puck-entry":"",children:S})})}function be(e={}){const t=ee(),n=te(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function we(){const e=ee(),n=te(e=>e.config),o=e.resolveCache,r=te(e=>e.selectedItem),a=te(e=>e.appState.data.root),i=r?r.props.id:"root",s=a.props??{},l=M(()=>r||{type:"root",props:s},[r,s]),c=r?n.components[r.type]:n.root,u=e.getState(),p=r?d(u.appState.data,n,i):null,f=p&&"root"!==p.place.parentId?p.place.parentId:null,h=f?u.getItemById(f)??null:null,{fields:m}=t({id:i,node:l,block:c,parent:h,appState:u.appState}),v=te(e=>!1===e.getPermissions(r?{item:r}:{root:!0}).edit),y=Z((t,r)=>{(async()=>{const a=e.getState();if("root"!==i){const s=a.getItemById(i),d=a.getSelectorForId(i);if(!s||!d)return;const l={...s,props:{...s.props,[t]:r}},{node:c}=await b(l,n,{cache:o,trigger:"replace"}),u=e.getState().getSelectorForId(i);if(!u)return;return void e.dispatch({type:"replace",destinationZone:u.zone??"root:default-zone",destinationIndex:u.index,data:c})}const s=a.appState.data.root.props??{},{node:d}=await b({type:"root",props:{...s,[t]:r}},n,{cache:o,trigger:"replace"});e.dispatch({type:"replaceRoot",root:{props:d.props,readOnly:d.readOnly},recordHistory:!0})})()},[e,n,o,i]);return{id:i,node:l,fields:m,values:l.props,readOnly:v,onChange:y}}export{le as CanvasFrame,Y as DEFAULT_UI,ke as EaselCanvas,_ as EaselProvider,ye as EditDocument,Q as bindUndoKeys,X as createEasel,ne as createUseEasel,B as recordsByDefault,V as reduce,K as uiView,te as useEasel,ee as useEaselApi,be as useEaselNodeOps,we as useSelectedFields,F as validSelection};
@@ -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-5SOSVTVI.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-EJ6QAWRH.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-LYALMY55.js";import{useEasel as f}from"./chunk-PYCLHOSA.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-6HHHBBSY.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 B,jsxs as O,Fragment as $}from"react/jsx-runtime";var H=e=>`section:${e}`,L=e=>`block:${e}`,v=e=>`template:${e}`;function A({blocks:A,blocksOnly:V,at:x,onAdd:I,itemFor:S,session:Y,siteWide:N,onClose:C,onHide:F,readOnly:Q}){const R=f(e=>e.config),T=p(),{labelAtLevel:w,categoryLabel:D,firstSection:P,Icon:W,Thumbnail:z}=T,{blockIsOffered:E}=m(),J=u("screen",d).add,M=u("drag",h).add,G=l(),[K,X]=y([]);b(()=>{let t=!1;const o=e=>E(e,G);return s(G).list().then(n=>{if(t)return;const i=R.components;X(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[R,G]);const Z=j(()=>t(R,T),[R]),q=e=>({type:H(e.type),label:e.name,cover:/* @__PURE__ */B(z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:J.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),U=j(()=>{const e=[];if(A&&A.choices.length>0&&a(A.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${J.inside({name:A.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:L(e.type),label:e.label,icon:/* @__PURE__ */B(W,{type:e.type,size:18}),title:J.tile({name:e.label})}))})}),V)return e;const t=o(Z,P);t&&e.push({key:"start",title:J.startBlank,tiles:[q(t)]}),K.length>0&&e.push({key:"templates",title:J.templates,tiles:K.map(e=>{return{type:v(e.id),label:e.name,cover:/* @__PURE__ */B(z,{type:e.node.type}),keywords:[(t=e.node.type,w(t,"section",R.components[t]?.label??t)),e.node.type]};var t})});const s=n(Z,P);for(const t of Object.keys(R.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(R,t,D),tiles:o.map(q)})}return e},[A,V,K,Z,R,J]),_=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=K.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
- return O($,{children:[
3
- /* @__PURE__ */B(r,{icon:/* @__PURE__ */B(g,{size:15}),title:J.title,context:V?J.contextBlocks:J.contextAll,actions:/* @__PURE__ */B(c,{label:J.done,description:J.doneDescription,onClick:C}),onHide:F}),
4
- /* @__PURE__ */O("div",{className:"sf-addside sf-scroll",children:[
5
- /* @__PURE__ */B(k,{groups:U,session:Y,itemFor:e=>S(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&I(t)},at:x,hint:V?J.hintBlocks:J.hint,searchLabel:V?J.searchBlocks:J.searchSections,readOnly:Q,words:M}),N&&!V?N:null]})]})}export{A as AddSidePanel,L as blockKey,H as sectionKey,v as templateKey};