efficient-easel 17.0.0 → 18.0.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 (104) hide show
  1. package/README.md +5 -1
  2. package/dist/blocks/index.d.ts +2 -2
  3. package/dist/chunk-43AEUUNQ.js +1 -0
  4. package/dist/{chunk-N3LYD2LK.js → chunk-5VD2LGIZ.js} +14 -14
  5. package/dist/chunk-A6Z4SD3I.js +10 -0
  6. package/dist/{chunk-NFLO4I2N.js → chunk-A7FF65FL.js} +1 -1
  7. package/dist/chunk-BHRC3ASL.js +1 -0
  8. package/dist/chunk-BRMYJBMB.js +8 -0
  9. package/dist/chunk-C2RHV42O.js +1 -0
  10. package/dist/{chunk-EXCIHRAE.js → chunk-F7FDF6NS.js} +1 -1
  11. package/dist/{chunk-4UBYPRAS.js → chunk-HGV3FWOB.js} +1 -1
  12. package/dist/chunk-LLDHIBYG.js +18 -0
  13. package/dist/{chunk-Z72CYM3L.js → chunk-MPF5QZJ7.js} +1 -1
  14. package/dist/chunk-N3VPBHR6.js +62 -0
  15. package/dist/{chunk-BU2YSTLJ.js → chunk-QEAUF632.js} +12 -12
  16. package/dist/{chunk-3ERZNZ5S.js → chunk-RFE7ZG3Y.js} +1 -1
  17. package/dist/{chunk-MTNBJPXX.js → chunk-STWSCR25.js} +2 -2
  18. package/dist/{chunk-XLUVTPKK.js → chunk-VEZPDGDQ.js} +1 -1
  19. package/dist/{chunk-OLRLHE5K.js → chunk-W2GEGVUY.js} +4 -4
  20. package/dist/{chunk-V63ERBLW.js → chunk-WOETW3H6.js} +1 -1
  21. package/dist/chunk-X3TYRF5V.js +1 -0
  22. package/dist/{chunk-FJL3MYPA.js → chunk-XHHVMAGM.js} +1 -1
  23. package/dist/{chunk-SPQOPWCL.js → chunk-XHSGRH42.js} +4 -4
  24. package/dist/chunk-YI4QXOVJ.js +1 -0
  25. package/dist/{chunk-JSH3XKEF.js → chunk-YLQYEDUQ.js} +1 -1
  26. package/dist/drag/drag.css +8 -0
  27. package/dist/drag/index.d.ts +15 -1
  28. package/dist/drag/index.js +1 -1
  29. package/dist/draw/index.js +1 -1
  30. package/dist/easel/easel.css +8 -0
  31. package/dist/easel/index.d.ts +16 -6
  32. package/dist/easel/index.js +1 -1
  33. package/dist/fields/index.js +1 -1
  34. package/dist/{host-Cxbhp0zg.d.ts → host-epHo7r8P.d.ts} +12 -1
  35. package/dist/node-ops/index.d.ts +2 -2
  36. package/dist/node-ops/index.js +1 -1
  37. package/dist/{plan-2BLk7pWs.d.ts → plan-CZS902DV.d.ts} +9 -1
  38. package/dist/screen/components/AddBlockRow.js +1 -1
  39. package/dist/screen/components/AddSidePanel.d.ts +6 -1
  40. package/dist/screen/components/AddSidePanel.js +1 -1
  41. package/dist/screen/components/MediaSidePanel.d.ts +4 -3
  42. package/dist/screen/components/MediaSidePanel.js +1 -1
  43. package/dist/screen/components/NodeContextMenu.d.ts +6 -5
  44. package/dist/screen/components/NodeContextMenu.js +1 -1
  45. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  46. package/dist/screen/components/SaveControls.d.ts +5 -4
  47. package/dist/screen/components/ScreenChrome.js +1 -1
  48. package/dist/screen/components/ScreenDocumentContext.d.ts +4 -3
  49. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  50. package/dist/screen/components/ScreenMount.d.ts +5 -4
  51. package/dist/screen/components/ScreenMount.js +1 -1
  52. package/dist/screen/components/ScreenStoreProvider.d.ts +5 -4
  53. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  54. package/dist/screen/components/SectionScreenShell.js +16 -16
  55. package/dist/screen/components/usePartBridge.d.ts +5 -4
  56. package/dist/screen/components/usePartBridge.js +1 -1
  57. package/dist/screen/index.d.ts +6 -5
  58. package/dist/screen/index.js +1 -1
  59. package/dist/screen/lib/admin-bridge.d.ts +3 -2
  60. package/dist/screen/lib/document-addressing.d.ts +4 -3
  61. package/dist/screen/lib/document-hooks.d.ts +2 -2
  62. package/dist/screen/lib/host.d.ts +4 -3
  63. package/dist/screen/lib/key-scope.js +1 -1
  64. package/dist/screen/lib/media-panel.d.ts +4 -3
  65. package/dist/screen/lib/media-picker.d.ts +7 -9
  66. package/dist/screen/lib/page-lock.d.ts +3 -2
  67. package/dist/screen/lib/puck/device-fields.js +1 -1
  68. package/dist/screen/lib/puck/palette-sections.d.ts +2 -2
  69. package/dist/screen/lib/puck/section-doc.d.ts +2 -2
  70. package/dist/screen/lib/puck/slot-child-name.js +1 -1
  71. package/dist/screen/lib/puck/style-clipboard.d.ts +5 -4
  72. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  73. package/dist/screen/lib/puck/use-section-ops.d.ts +2 -2
  74. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  75. package/dist/screen/lib/screen-parts.d.ts +69 -5
  76. package/dist/screen/lib/screen-parts.js +1 -1
  77. package/dist/screen/lib/section-templates.d.ts +3 -2
  78. package/dist/screen/lib/session-context.d.ts +3 -2
  79. package/dist/screen/lib/session.d.ts +6 -2
  80. package/dist/screen/lib/shared-section-types.d.ts +71 -0
  81. package/dist/screen/lib/shared-section-types.js +1 -0
  82. package/dist/screen/lib/shared-sections.d.ts +34 -0
  83. package/dist/screen/lib/shared-sections.js +1 -0
  84. package/dist/screen/screen.css +7 -0
  85. package/dist/screen/words.d.ts +49 -1
  86. package/dist/screen/words.js +1 -1
  87. package/dist/strings/index.d.ts +1 -1
  88. package/dist/strings/index.js +2 -2
  89. package/dist/text-styles/index.js +21 -21
  90. package/dist/tree/index.d.ts +3 -3
  91. package/dist/tree/index.js +1 -1
  92. package/dist/tree/tree.css +17 -0
  93. package/dist/{types-D8P9q-BG.d.ts → types-Bqq6ya0y.d.ts} +9 -0
  94. package/dist/{types-kR_4wYBw.d.ts → types-Cq53lL8d.d.ts} +1 -1
  95. package/dist/{useNodeOps-B0XZ8Bl8.d.ts → useNodeOps-fIDWzftn.d.ts} +3 -1
  96. package/package.json +15 -3
  97. package/dist/chunk-4JSBIW5H.js +0 -9
  98. package/dist/chunk-EL4F3IN7.js +0 -1
  99. package/dist/chunk-INIPQLPR.js +0 -1
  100. package/dist/chunk-MI54XTWD.js +0 -5
  101. package/dist/chunk-POSLNRTO.js +0 -18
  102. package/dist/chunk-SHS6WCLL.js +0 -1
  103. package/dist/chunk-TBF5CVPA.js +0 -1
  104. package/dist/chunk-WR3EVON3.js +0 -57
@@ -72,6 +72,52 @@ type ScreenAddWords = {
72
72
  addingHere: string;
73
73
  };
74
74
  declare const DEFAULT_SCREEN_ADD_WORDS: ScreenAddWords;
75
+ /**
76
+ * A SHARED SECTION'S WORDS (Shared section design v4, Lewis 2026-10-21): one
77
+ * section that many pages use live. Lewis's words for the menu are "Make
78
+ * shared", "On 3 pages", "Detach from shared" and "Remove from this page" — not
79
+ * "Delete" on a page, so nobody thinks it went from every page.
80
+ */
81
+ type ScreenSharedWords = {
82
+ /** Add's group of them, above the saved sections. */
83
+ group: string;
84
+ /** How far one reaches: a card's Tooltip, and the menu's row that lists
85
+ * the pages. */
86
+ onPages: (v: {
87
+ count: number;
88
+ }) => string;
89
+ /** The menu row on a page's own section, and the dialog's title and button. */
90
+ makeShared: string;
91
+ /** The dialog's line under its title. */
92
+ makeSharedHint: string;
93
+ /** The name box's label. */
94
+ name: string;
95
+ /** The dialog's way out. */
96
+ cancel: string;
97
+ /** The store refused to make it. */
98
+ makeFailed: string;
99
+ /** The menu row that gives this page its own copy. */
100
+ detach: string;
101
+ /** The menu row, and the Layers trash, that take it off this page only. */
102
+ removeFromPage: string;
103
+ /** …and what is said then, with how many pages still use it. */
104
+ removed: (v: {
105
+ count: number;
106
+ }) => string;
107
+ /** A card's menu row, and the dialog's title and button. */
108
+ deleteShared: string;
109
+ deleteTitle: (v: {
110
+ name: string;
111
+ }) => string;
112
+ deleteMessage: (v: {
113
+ count: number;
114
+ }) => string;
115
+ /** The store refused to delete it. */
116
+ deleteFailed: string;
117
+ /** Why a card is dimmed: it is on this page already (once per page). */
118
+ alreadyHere: string;
119
+ };
120
+ declare const DEFAULT_SCREEN_SHARED_WORDS: ScreenSharedWords;
75
121
  /**
76
122
  * THE PROMPT BEFORE A SWITCH OF DOCUMENT WOULD LOSE AN EDIT (3.1.0). It was
77
123
  * written into components/ScreenMount; the words are its English, word for
@@ -245,6 +291,8 @@ type ScreenWords = {
245
291
  }) => string;
246
292
  /** The Add panel's words (0.105.0). */
247
293
  add: ScreenAddWords;
294
+ /** A shared section's words: Add's group, the menu rows and the dialogs. */
295
+ shared: ScreenSharedWords;
248
296
  /** The cell over an EMPTY slot on the canvas, after its "+" (0.106.0): the
249
297
  * campaign designer's "Add a block". */
250
298
  canvasAddBlock: string;
@@ -331,4 +379,4 @@ type ScreenWords = {
331
379
  };
332
380
  declare const DEFAULT_SCREEN_WORDS: ScreenWords;
333
381
 
334
- export { DEFAULT_SCREEN_ADD_WORDS, DEFAULT_SCREEN_SAVE_STATUS_WORDS, DEFAULT_SCREEN_WORDS, type ScreenAddWords, type ScreenBarWords, type ScreenLeaveWords, type ScreenMenuWords, type ScreenSaveStatusWords, type ScreenWords };
382
+ export { DEFAULT_SCREEN_ADD_WORDS, DEFAULT_SCREEN_SAVE_STATUS_WORDS, DEFAULT_SCREEN_SHARED_WORDS, DEFAULT_SCREEN_WORDS, type ScreenAddWords, type ScreenBarWords, type ScreenLeaveWords, type ScreenMenuWords, type ScreenSaveStatusWords, type ScreenSharedWords, type ScreenWords };
@@ -1 +1 @@
1
- export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-EL4F3IN7.js";
1
+ export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_SHARED_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-C2RHV42O.js";
@@ -8,7 +8,7 @@ import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
8
8
  import { P as PanelWords } from '../words-zH1H0WFw.js';
9
9
  import { P as PickWords } from '../words-DWvCJXwR.js';
10
10
  import { ScreenWords } from '../screen/words.js';
11
- export { ScreenAddWords } from '../screen/words.js';
11
+ export { ScreenAddWords, ScreenSharedWords } from '../screen/words.js';
12
12
  import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
13
13
  import { T as TextStylesWords } from '../words-gIDCeRv3.js';
14
14
  import { T as TreeWords } from '../words-Cl9xMUYY.js';
@@ -1,2 +1,2 @@
1
- import{DEFAULT_SCREEN_WORDS as r}from"../chunk-EL4F3IN7.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as o}from"../chunk-6WY6ZXJG.js";import{DEFAULT_TEXT_STYLES_WORDS as n}from"../chunk-OGH6CC3E.js";import{DEFAULT_PICK_WORDS as t}from"../chunk-OFBZOI6W.js";import{DEFAULT_CANVAS_WORDS as c}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as e}from"../chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as m}from"../chunk-WK3AFPXY.js";import{DEFAULT_PANEL_WORDS as i}from"../chunk-KFV7N2DJ.js";import{DEFAULT_SAVE_WORDS as s}from"../chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as u,DEFAULT_NOTICE_WORDS as f}from"../chunk-Z6PVRXVY.js";import{DEFAULT_RAIL_WORDS as p}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as l}from"../chunk-RE4LP46F.js";import{DEFAULT_COPY_WORDS as h}from"../chunk-B4JN227A.js";import{DEFAULT_FIELDS_WORDS as j}from"../chunk-WRFD4EXD.js";import{stringsContext as k}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as a}from"../chunk-KAML3KQH.js";import{useContext as F,useMemo as Y}from"react";import{jsx as y}from"react/jsx-runtime";var D={notice:f,lock:l,save:s,chrome:u,rail:p,tree:e,panel:i,fields:j,pick:t,drag:a,menu:m,styleClipboard:o,copy:h,canvas:c,textStyles:n,screen:r},d=r=>"object"==typeof r&&null!==r;function v(r,o){const n={};for(const t of Object.keys(r)){const c=r[t],e=o[t];null==e?n[t]=c:d(c)?n[t]=d(e)?v(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function K(r,o){return o?v(r,o):r}function W({value:r,locale:o,children:n}){const t=k(),c=F(t),e=c?.strings??D,m=o??c?.locale??"en",i=Y(()=>({strings:K(e,r),locale:m}),[e,r,m]);/* @__PURE__ */
2
- return y(t.Provider,{value:i,children:n})}function H(){return F(k())?.strings??D}function O(){return F(k())?.locale??"en"}export{D as DEFAULT_EASEL_STRINGS,W as EaselStringsProvider,K as mergeEaselStrings,O as useEaselLocale,H as useEaselStrings};
1
+ import{DEFAULT_SCREEN_WORDS as r}from"../chunk-C2RHV42O.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as o}from"../chunk-6WY6ZXJG.js";import{DEFAULT_TEXT_STYLES_WORDS as n}from"../chunk-OGH6CC3E.js";import{DEFAULT_CANVAS_WORDS as t}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"../chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";import{DEFAULT_PICK_WORDS as m}from"../chunk-OFBZOI6W.js";import{DEFAULT_NODE_MENU_WORDS as i}from"../chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as s}from"../chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as u,DEFAULT_NOTICE_WORDS as f}from"../chunk-Z6PVRXVY.js";import{DEFAULT_RAIL_WORDS as p}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as l}from"../chunk-RE4LP46F.js";import{DEFAULT_COPY_WORDS as h}from"../chunk-B4JN227A.js";import{DEFAULT_FIELDS_WORDS as j}from"../chunk-WRFD4EXD.js";import{stringsContext as k}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as a}from"../chunk-KAML3KQH.js";import{useContext as Y,useMemo as y}from"react";import{jsx as D}from"react/jsx-runtime";var F={notice:f,lock:l,save:s,chrome:u,rail:p,tree:c,panel:e,fields:j,pick:m,drag:a,menu:i,styleClipboard:o,copy:h,canvas:t,textStyles:n,screen:r},d=r=>"object"==typeof r&&null!==r;function v(r,o){const n={};for(const t of Object.keys(r)){const c=r[t],e=o[t];null==e?n[t]=c:d(c)?n[t]=d(e)?v(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function H(r,o){return o?v(r,o):r}function K({value:r,locale:o,children:n}){const t=k(),c=Y(t),e=c?.strings??F,m=o??c?.locale??"en",i=y(()=>({strings:H(e,r),locale:m}),[e,r,m]);/* @__PURE__ */
2
+ return D(t.Provider,{value:i,children:n})}function O(){return Y(k())?.strings??F}function W(){return Y(k())?.locale??"en"}export{F as DEFAULT_EASEL_STRINGS,K as EaselStringsProvider,H as mergeEaselStrings,W as useEaselLocale,O as useEaselStrings};
@@ -1,32 +1,32 @@
1
- import{hexReadout as e,ColourWindow as s,typedHex as t}from"../chunk-U6LJ5UKD.js";import{DEFAULT_TEXT_STYLES_WORDS as a}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import"../chunk-OFBZOI6W.js";import{FieldSlider as n}from"../chunk-XWFH2NHZ.js";import{TEXT_STYLE_KINDS as l,canAddTextStyle as i,TEXT_STYLE_MAX as r,isDefaultTextStyle as o,CAMPAIGN_TEXT_STYLE_SETTINGS as d,TEXT_STYLE_SETTINGS as c,textStyleRowSize as u,describeTextStyle as m,updateTextStyle as h,textStyleCaseCss as f,TEXT_STYLE_CASES as p,addTextStyle as v,removeTextStyle as y,TEXT_STYLE_RANGES as S}from"../chunk-YHZSBL2N.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,updateTextStyle,weightWord}from"../chunk-YHZSBL2N.js";import{FieldSelect as g}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{useWords as b}from"../chunk-MFIRYGHW.js";import{withTip as k}from"../chunk-P2VEMZH5.js";import{hsvToHex as N,Tooltip as C,ColorSwatch as x,IconButton as T}from"efficient-shell/ui";import{useState as w,useRef as z,useId as E,useEffect as O,Fragment as _}from"react";import{TrashIcon as L,ChevronIcon as A,BoldIcon as j,ItalicIcon as M,CaseLowerIcon as W,CaseCapitalizedIcon as $,CaseUpperIcon as D,CaseNormalIcon as X}from"efficient-shell/icons/efficient";import{jsxs as Y,jsx as I,Fragment as F}from"react/jsx-runtime";var G=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>N({h:e,s:1,v:1})).join(", ")})`;function H({value:t,hex:a,colours:n,label:l,followsWord:i,anyWord:r,onChange:o,readOnly:d=!1}){const[c,u]=w(!1),m=z(null),h=z(null),f=E(),p=void 0!==t&&n.some(e=>e.key===t),v=void 0!==t&&!p;return O(()=>{if(!c)return;const e=m.current?.ownerDocument;if(!e)return;const s=e=>{m.current&&!m.current.contains(e.target)&&u(!1)};return e.addEventListener("click",s,!0),()=>e.removeEventListener("click",s,!0)},[c]),/* @__PURE__ */Y("div",{ref:m,className:"es-ts-set","data-ts-setting":"color",children:[
1
+ import{DEFAULT_TEXT_STYLES_WORDS as e}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import{FieldSlider as s}from"../chunk-XWFH2NHZ.js";import{hexReadout as t,ColourWindow as a,typedHex as n}from"../chunk-U6LJ5UKD.js";import"../chunk-OFBZOI6W.js";import{TEXT_STYLE_KINDS as l,canAddTextStyle as i,TEXT_STYLE_MAX as r,isDefaultTextStyle as o,CAMPAIGN_TEXT_STYLE_SETTINGS as d,TEXT_STYLE_SETTINGS as c,textStyleRowSize as u,describeTextStyle as m,updateTextStyle as h,textStyleCaseCss as f,TEXT_STYLE_CASES as p,addTextStyle as v,removeTextStyle as y,TEXT_STYLE_RANGES as S}from"../chunk-YHZSBL2N.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,updateTextStyle,weightWord}from"../chunk-YHZSBL2N.js";import{FieldSelect as g}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{useWords as b}from"../chunk-MFIRYGHW.js";import{withTip as k}from"../chunk-P2VEMZH5.js";import{hsvToHex as N,Tooltip as C,ColorSwatch as x,IconButton as T}from"efficient-shell/ui";import{useState as w,useRef as z,useId as E,useEffect as O,Fragment as _}from"react";import{TrashIcon as L,ChevronIcon as A,BoldIcon as j,ItalicIcon as M,CaseLowerIcon as W,CaseCapitalizedIcon as $,CaseUpperIcon as D,CaseNormalIcon as X}from"efficient-shell/icons/efficient";import{jsxs as Y,jsx as I,Fragment as F}from"react/jsx-runtime";var G=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>N({h:e,s:1,v:1})).join(", ")})`;function H({value:e,hex:s,colours:n,label:l,followsWord:i,anyWord:r,onChange:o,readOnly:d=!1}){const[c,u]=w(!1),m=z(null),h=z(null),f=E(),p=void 0!==e&&n.some(s=>s.key===e),v=void 0!==e&&!p;return O(()=>{if(!c)return;const e=m.current?.ownerDocument;if(!e)return;const s=e=>{m.current&&!m.current.contains(e.target)&&u(!1)};return e.addEventListener("click",s,!0),()=>e.removeEventListener("click",s,!0)},[c]),/* @__PURE__ */Y("div",{ref:m,className:"es-ts-set","data-ts-setting":"color",children:[
2
2
  /* @__PURE__ */Y("div",{className:"es-ts-top",children:[
3
3
  /* @__PURE__ */I("span",{className:"es-ts-sub",children:l}),
4
- /* @__PURE__ */I("span",{className:"es-ts-colour-read",children:a?e(a):i})]}),
5
- /* @__PURE__ */Y("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[n.map(s=>/* @__PURE__ */I(C,{content:`${s.name} · ${e(s.value)}`,children:/* @__PURE__ */I(x,{color:s.value,size:"sm",className:"es-ts-swatch","aria-label":s.name,selected:t===s.key,disabled:d,onClick:()=>o(s.key)})},s.key)),
6
- /* @__PURE__ */I(C,{content:r,children:/* @__PURE__ */I(x,{ref:h,color:G,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:v,"aria-expanded":c,"aria-controls":c?f:void 0,disabled:d,onClick:()=>u(e=>!e)})})]}),c?/* @__PURE__ */I(s,{id:f,value:a??"",onChange:e=>o(e),label:l,readOnly:d,onClose:()=>{u(!1),h.current?.focus()}}):null]})}function P({styles:e,onChange:s,fonts:t,colours:n=[],settings:c=d,auto:u=[],fallback:m,sample:h,openId:f,defaultOpenId:p=null,onOpenChange:S,onAdd:g,rowActions:N,onRemove:C,max:x=r,device:T="desktop",readOnly:_=!1}){const A=b("textStyles",a),j=E(),[M,W]=w(p),$=void 0!==f?f:M,D=e=>{void 0===f&&W(e),S?.(e)},X=z(null),[G,H]=w(null);O(()=>{if(!G||!X.current)return;const e=[...X.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===G.id),s=e?e.querySelector(".es-ts-row"):X.current.querySelector(`.es-ts-add[data-ts-kind="${G.kind}"]`);s?.focus(),H(null)},[G]);/* @__PURE__ */
7
- return I("div",{className:"es-ts",ref:X,children:l.map(a=>{const l=e.filter(e=>e.kind===a),r=!i(e,a,x),d=!_&&!r;/* @__PURE__ */
8
- return Y(R,{label:A.groups[a],children:[l.map(a=>{const l=N?.(a),i=null!=l&&!1!==l,r=Boolean(C)&&!_&&!o(a);/* @__PURE__ */
9
- return I(B,{style:a,fonts:t,colours:n,settings:c,auto:u,fallback:m,sample:h,device:T,readOnly:_,open:$===a.id,onOpenChange:e=>D(e?a.id:null),onChange:t=>s(e.map(e=>e.id===t.id?t:e)),actions:r||i?/* @__PURE__ */Y(F,{children:[r?k(A.remove,/* @__PURE__ */I("button",{type:"button",className:"es-ts-del","aria-label":A.removeNamed({name:a.name}),onClick:()=>(t=>{if(_||!C)return;const a=y(e,t.id,{name:A.styleName});if(!a)return;const n=e.filter(e=>e.kind===t.kind),l=n[n.indexOf(t)+1];$===t.id&&D(null),s(a.styles),C(a.removed),H({id:l?.id??null,kind:t.kind})})(a),children:/* @__PURE__ */I(L,{size:14,"aria-hidden":"true"})})):null,i?l:null]}):null},a.id)}),k(!_&&r?A.full({kind:a,max:x}):void 0,/* @__PURE__ */Y("button",{type:"button",className:"es-ts-add","data-ts-kind":a,disabled:_,"aria-disabled":!(_||!r)||void 0,"aria-describedby":!_&&r?`${j}-full-${a}`:void 0,onClick:()=>{d&&(t=>{if(_)return;const a=v(e,t,{max:x,name:A.styleName,make:g});a&&s(a.styles)})(a)},children:[
10
- /* @__PURE__ */I("span",{className:"es-ts-add-word",children:A.add[a]}),
11
- /* @__PURE__ */I("span",{className:"es-ts-count",children:A.count({n:l.length,max:x})})]})),_||!r?null:/* @__PURE__ */I("span",{id:`${j}-full-${a}`,className:"es-vh",children:A.full({kind:a,max:x})})]},a)})})}function R({label:e,children:s}){const t=E();/* @__PURE__ */
4
+ /* @__PURE__ */I("span",{className:"es-ts-colour-read",children:s?t(s):i})]}),
5
+ /* @__PURE__ */Y("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[n.map(s=>/* @__PURE__ */I(C,{content:`${s.name} · ${t(s.value)}`,children:/* @__PURE__ */I(x,{color:s.value,size:"sm",className:"es-ts-swatch","aria-label":s.name,selected:e===s.key,disabled:d,onClick:()=>o(s.key)})},s.key)),
6
+ /* @__PURE__ */I(C,{content:r,children:/* @__PURE__ */I(x,{ref:h,color:G,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:v,"aria-expanded":c,"aria-controls":c?f:void 0,disabled:d,onClick:()=>u(e=>!e)})})]}),c?/* @__PURE__ */I(a,{id:f,value:s??"",onChange:e=>o(e),label:l,readOnly:d,onClose:()=>{u(!1),h.current?.focus()}}):null]})}function P({styles:s,onChange:t,fonts:a,colours:n=[],settings:c=d,auto:u=[],fallback:m,sample:h,openId:f,defaultOpenId:p=null,onOpenChange:S,onAdd:g,rowActions:N,onRemove:C,max:x=r,device:T="desktop",readOnly:_=!1}){const A=b("textStyles",e),j=E(),[M,W]=w(p),$=void 0!==f?f:M,D=e=>{void 0===f&&W(e),S?.(e)},X=z(null),[G,H]=w(null);O(()=>{if(!G||!X.current)return;const e=[...X.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===G.id),s=e?e.querySelector(".es-ts-row"):X.current.querySelector(`.es-ts-add[data-ts-kind="${G.kind}"]`);s?.focus(),H(null)},[G]);/* @__PURE__ */
7
+ return I("div",{className:"es-ts",ref:X,children:l.map(e=>{const l=s.filter(s=>s.kind===e),r=!i(s,e,x),d=!_&&!r;/* @__PURE__ */
8
+ return Y(R,{label:A.groups[e],children:[l.map(e=>{const l=N?.(e),i=null!=l&&!1!==l,r=Boolean(C)&&!_&&!o(e);/* @__PURE__ */
9
+ return I(B,{style:e,fonts:a,colours:n,settings:c,auto:u,fallback:m,sample:h,device:T,readOnly:_,open:$===e.id,onOpenChange:s=>D(s?e.id:null),onChange:e=>t(s.map(s=>s.id===e.id?e:s)),actions:r||i?/* @__PURE__ */Y(F,{children:[r?k(A.remove,/* @__PURE__ */I("button",{type:"button",className:"es-ts-del","aria-label":A.removeNamed({name:e.name}),onClick:()=>(e=>{if(_||!C)return;const a=y(s,e.id,{name:A.styleName});if(!a)return;const n=s.filter(s=>s.kind===e.kind),l=n[n.indexOf(e)+1];$===e.id&&D(null),t(a.styles),C(a.removed),H({id:l?.id??null,kind:e.kind})})(e),children:/* @__PURE__ */I(L,{size:14,"aria-hidden":"true"})})):null,i?l:null]}):null},e.id)}),k(!_&&r?A.full({kind:e,max:x}):void 0,/* @__PURE__ */Y("button",{type:"button",className:"es-ts-add","data-ts-kind":e,disabled:_,"aria-disabled":!(_||!r)||void 0,"aria-describedby":!_&&r?`${j}-full-${e}`:void 0,onClick:()=>{d&&(e=>{if(_)return;const a=v(s,e,{max:x,name:A.styleName,make:g});a&&t(a.styles)})(e)},children:[
10
+ /* @__PURE__ */I("span",{className:"es-ts-add-word",children:A.add[e]}),
11
+ /* @__PURE__ */I("span",{className:"es-ts-count",children:A.count({n:l.length,max:x})})]})),_||!r?null:/* @__PURE__ */I("span",{id:`${j}-full-${e}`,className:"es-vh",children:A.full({kind:e,max:x})})]},e)})})}function R({label:e,children:s}){const t=E();/* @__PURE__ */
12
12
  return Y("section",{className:"es-ts-section","aria-labelledby":t,children:[
13
- /* @__PURE__ */I("div",{className:"es-ts-group",id:t,children:e}),s]})}function B({style:e,fonts:s,colours:t=[],settings:n=d,auto:l=[],fallback:i,sample:r,open:o,onOpenChange:f,onChange:p,actions:v,device:y="desktop",readOnly:S=!1}){const g=b("textStyles",a),k=`${E()}-open-${e.id}`,N=new Set(l),C=c.filter(e=>n.includes(e)),x={...i?.(e)??{},...e.values},T="phone"===y,w=T&&void 0!==e.values.sizePhone?{...x,size:e.values.sizePhone}:x,z=s.find(e=>e.value===x.font),O={fontFamily:z?.family,fontSize:`${u(w.size??16)}px`,fontWeight:x.weight,fontStyle:x.italic?"italic":void 0};/* @__PURE__ */
13
+ /* @__PURE__ */I("div",{className:"es-ts-group",id:t,children:e}),s]})}function B({style:s,fonts:t,colours:a=[],settings:n=d,auto:l=[],fallback:i,sample:r,open:o,onOpenChange:f,onChange:p,actions:v,device:y="desktop",readOnly:S=!1}){const g=b("textStyles",e),k=`${E()}-open-${s.id}`,N=new Set(l),C=c.filter(e=>n.includes(e)),x={...i?.(s)??{},...s.values},T="phone"===y,w=T&&void 0!==s.values.sizePhone?{...x,size:s.values.sizePhone}:x,z=t.find(e=>e.value===x.font),O={fontFamily:z?.family,fontSize:`${u(w.size??16)}px`,fontWeight:x.weight,fontStyle:x.italic?"italic":void 0};/* @__PURE__ */
14
14
  return Y(_,{children:[
15
- /* @__PURE__ */Y("div",{className:"es-ts-item","data-ts-id":e.id,children:[
15
+ /* @__PURE__ */Y("div",{className:"es-ts-item","data-ts-id":s.id,children:[
16
16
  /* @__PURE__ */Y("button",{type:"button",className:"es-ts-row","aria-expanded":o,"aria-controls":o?k:void 0,onClick:()=>f(!o),children:[
17
17
  /* @__PURE__ */I("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */I(A,{size:12})}),
18
- /* @__PURE__ */I("span",{className:"es-ts-name",style:O,children:e.name}),
19
- /* @__PURE__ */I("span",{className:"es-ts-meta",children:m(w,s,g,{autoSize:N.has("size")&&w===x&&void 0===e.values.size})})]}),v?/* @__PURE__ */I("div",{className:"es-ts-actions",children:v}):null]}),o?/* @__PURE__ */I("div",{className:"es-ts-open",id:k,children:/* @__PURE__ */I(Z,{style:e,values:x,fonts:s,colours:t,settings:C,autoSet:N,sample:r??g.sample,words:g,phone:T,readOnly:S,set:s=>p(h([e],e.id,s)[0])})}):null]})}var U={none:X,upper:D,capitalize:$,lower:W};function Z({style:e,values:s,fonts:a,colours:l,settings:i,autoSet:r,sample:o,words:d,phone:c,readOnly:u,set:m}){const h=e.values,p=a.find(e=>e.value===s.font),v=function(e,s){return e?s.find(s=>s.key===e)?.value??t(e)??void 0:void 0}(s.color,l),y=e=>"largestSize"===e||r.has(e),g=e=>y(e)?h[e]:s[e],b=g("size"),N=c&&void 0!==h.sizePhone?h.sizePhone:b,C=g("lineSpacing"),x=g("letterSpacing"),w=y("letterCase")?h.letterCase:s.letterCase,z={fontFamily:p?.family,fontSize:void 0===N?void 0:`${N}px`,fontWeight:s.weight,fontStyle:s.italic?"italic":void 0,lineHeight:void 0===C?void 0:String(C/100),letterSpacing:void 0===x?void 0:`${x}px`,color:v,textTransform:f(w)},E=e=>{const t=S[e],a=y(e);/* @__PURE__ */
20
- return I("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */I(n,{label:d.settings[e],value:h[e],onChange:s=>m({[e]:s}),min:t.min,max:t.max,step:t.step,shiftStep:t.shiftStep,sliderMin:t.sliderMin,sliderMax:t.sliderMax,unit:t.unit||void 0,styleValue:a?void 0:s[e],auto:a?d.auto:void 0,readOnly:u})},e)};/* @__PURE__ */
18
+ /* @__PURE__ */I("span",{className:"es-ts-name",style:O,children:s.name}),
19
+ /* @__PURE__ */I("span",{className:"es-ts-meta",children:m(w,t,g,{autoSize:N.has("size")&&w===x&&void 0===s.values.size})})]}),v?/* @__PURE__ */I("div",{className:"es-ts-actions",children:v}):null]}),o?/* @__PURE__ */I("div",{className:"es-ts-open",id:k,children:/* @__PURE__ */I(Z,{style:s,values:x,fonts:t,colours:a,settings:C,autoSet:N,sample:r??g.sample,words:g,phone:T,readOnly:S,set:e=>p(h([s],s.id,e)[0])})}):null]})}var U={none:X,upper:D,capitalize:$,lower:W};function Z({style:e,values:t,fonts:a,colours:l,settings:i,autoSet:r,sample:o,words:d,phone:c,readOnly:u,set:m}){const h=e.values,p=a.find(e=>e.value===t.font),v=function(e,s){return e?s.find(s=>s.key===e)?.value??n(e)??void 0:void 0}(t.color,l),y=e=>"largestSize"===e||r.has(e),g=e=>y(e)?h[e]:t[e],b=g("size"),N=c&&void 0!==h.sizePhone?h.sizePhone:b,C=g("lineSpacing"),x=g("letterSpacing"),w=y("letterCase")?h.letterCase:t.letterCase,z={fontFamily:p?.family,fontSize:void 0===N?void 0:`${N}px`,fontWeight:t.weight,fontStyle:t.italic?"italic":void 0,lineHeight:void 0===C?void 0:String(C/100),letterSpacing:void 0===x?void 0:`${x}px`,color:v,textTransform:f(w)},E=e=>{const a=S[e],n=y(e);/* @__PURE__ */
20
+ return I("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */I(s,{label:d.settings[e],value:h[e],onChange:s=>m({[e]:s}),min:a.min,max:a.max,step:a.step,shiftStep:a.shiftStep,sliderMin:a.sliderMin,sliderMax:a.sliderMax,unit:a.unit||void 0,styleValue:n?void 0:t[e],auto:n?d.auto:void 0,readOnly:u})},e)};/* @__PURE__ */
21
21
  return Y(F,{children:[
22
- /* @__PURE__ */I("div",{className:"es-ts-preview",style:z,"aria-label":d.preview,children:o}),i.map(t=>{switch(t){case"font":/* @__PURE__ */
23
- return I(q,{value:h.font,fonts:a,words:d,readOnly:u,set:m},t);case"color":/* @__PURE__ */
24
- return I(K,{value:h.color,hex:v,colours:l,words:d,readOnly:u,set:m},t);case"emphasis":{const e=(s.weight??400)>=600,a=!1!==p?.italic;/* @__PURE__ */
25
- return Y("div",{className:"es-ts-set","data-ts-setting":t,children:[
22
+ /* @__PURE__ */I("div",{className:"es-ts-preview",style:z,"aria-label":d.preview,children:o}),i.map(n=>{switch(n){case"font":/* @__PURE__ */
23
+ return I(q,{value:h.font,fonts:a,words:d,readOnly:u,set:m},n);case"color":/* @__PURE__ */
24
+ return I(K,{value:h.color,hex:v,colours:l,words:d,readOnly:u,set:m},n);case"emphasis":{const e=(t.weight??400)>=600,s=!1!==p?.italic;/* @__PURE__ */
25
+ return Y("div",{className:"es-ts-set","data-ts-setting":n,children:[
26
26
  /* @__PURE__ */I("span",{className:"es-ts-sub",children:d.settings.emphasis}),
27
- /* @__PURE__ */Y("div",{className:"es-ts-icons",children:[k(d.bold,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.bold,"aria-pressed":e,disabled:u,onClick:()=>m({weight:e?400:700}),children:/* @__PURE__ */I(j,{size:16})})),u||a?k(d.italic,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(s.italic),disabled:u,onClick:()=>m({italic:!s.italic||void 0}),children:/* @__PURE__ */I(M,{size:16})})):/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(s.italic),"aria-disabled":!0,disabledReason:d.italicMissing,children:/* @__PURE__ */I(M,{size:16})})]})]},t)}case"letterCase":/* @__PURE__ */
28
- return I(V,{value:h.letterCase??s.letterCase,auto:y("letterCase"),words:d,readOnly:u,set:m},t);case"largestSize":return"heading"===e.kind?E(t):null;case"size":return c?(()=>{const e=S.size;/* @__PURE__ */
29
- return I("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */I(n,{label:d.settings.size,value:h.sizePhone,onChange:e=>m({sizePhone:e}),min:e.min,max:e.max,step:e.step,shiftStep:e.shiftStep,sliderMin:e.sliderMin,sliderMax:e.sliderMax,unit:e.unit||void 0,styleValue:b,readOnly:u})},"size")})():E(t);default:return E(t)}})]})}function q({value:e,fonts:s,words:t,readOnly:a,set:n}){const l=E();/* @__PURE__ */
27
+ /* @__PURE__ */Y("div",{className:"es-ts-icons",children:[k(d.bold,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.bold,"aria-pressed":e,disabled:u,onClick:()=>m({weight:e?400:700}),children:/* @__PURE__ */I(j,{size:16})})),u||s?k(d.italic,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(t.italic),disabled:u,onClick:()=>m({italic:!t.italic||void 0}),children:/* @__PURE__ */I(M,{size:16})})):/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(t.italic),"aria-disabled":!0,disabledReason:d.italicMissing,children:/* @__PURE__ */I(M,{size:16})})]})]},n)}case"letterCase":/* @__PURE__ */
28
+ return I(V,{value:h.letterCase??t.letterCase,auto:y("letterCase"),words:d,readOnly:u,set:m},n);case"largestSize":return"heading"===e.kind?E(n):null;case"size":return c?(()=>{const e=S.size;/* @__PURE__ */
29
+ return I("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */I(s,{label:d.settings.size,value:h.sizePhone,onChange:e=>m({sizePhone:e}),min:e.min,max:e.max,step:e.step,shiftStep:e.shiftStep,sliderMin:e.sliderMin,sliderMax:e.sliderMax,unit:e.unit||void 0,styleValue:b,readOnly:u})},"size")})():E(n);default:return E(n)}})]})}function q({value:e,fonts:s,words:t,readOnly:a,set:n}){const l=E();/* @__PURE__ */
30
30
  return Y("div",{className:"es-ts-set","data-ts-setting":"font",children:[
31
31
  /* @__PURE__ */I("span",{className:"es-ts-sub",id:l,children:t.settings.font}),
32
32
  /* @__PURE__ */I(g,{value:e,options:s.map(e=>({label:e.label,value:e.value})),onChange:e=>n({font:e}),ariaLabelledBy:l,readOnly:a})]})}function K({value:e,hex:s,colours:t,words:a,readOnly:n,set:l}){/* @__PURE__ */
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { L as LayersTreeProps, S as SubtreeProps, a as TreeGroupLabelProps, b as TreeEmptySlotProps, c as TreeRowProps, d as TreeRowActionProps, e as TreeSeamProps } from '../types-D8P9q-BG.js';
3
- export { f as TreeRowFold, T as TreeRowMark } from '../types-D8P9q-BG.js';
2
+ import { L as LayersTreeProps, S as SubtreeProps, a as TreeGroupLabelProps, b as TreeEmptySlotProps, c as TreeRowProps, d as TreeRowActionProps, e as TreeSeamProps } from '../types-Bqq6ya0y.js';
3
+ export { f as TreeRowFold, T as TreeRowMark } from '../types-Bqq6ya0y.js';
4
4
  export { T as TreeWords } from '../words-Cl9xMUYY.js';
5
5
  import 'efficient-shell/ui';
6
6
 
@@ -53,7 +53,7 @@ declare const TREE_DRAG_HINT: string;
53
53
  * selected wherever the old name button did not) is selected by that onClick
54
54
  * alone on a click, and by `onSelect` from the keyboard (Enter, Space).
55
55
  */
56
- declare function TreeRow({ icon, name, preview, selected, hidden, draggable, dragHint, dragging, drop, fold, actions, nameSlot, onSelect, marks, badge, trailing, children, rowProps, level, words, }: TreeRowProps): react.JSX.Element;
56
+ declare function TreeRow({ icon, name, preview, selected, hidden, draggable, dragHint, dragging, drop, fold, actions, nameSlot, onSelect, marks, badge, trailing, shared, children, rowProps, level, words, }: TreeRowProps): react.JSX.Element;
57
57
  /**
58
58
  * An action over the end of a row's name — delete (the danger tone) or show /
59
59
  * hide, or any other: the shell's `IconButton` with its `Tooltip`. Pressing it
@@ -1 +1 @@
1
- export{LayersTree,Subtree,TREE_DRAG_HINT,TreeEmptySlot,TreeGroupLabel,TreeRow,TreeRowAction,TreeSeam}from"../chunk-4JSBIW5H.js";import"../chunk-K56YDHYQ.js";
1
+ export{LayersTree,Subtree,TREE_DRAG_HINT,TreeEmptySlot,TreeGroupLabel,TreeRow,TreeRowAction,TreeSeam}from"../chunk-A6Z4SD3I.js";import"../chunk-K56YDHYQ.js";
@@ -55,6 +55,23 @@
55
55
  height: 13px;
56
56
  }
57
57
 
58
+ /* ── A shared row (Shared section design v4, Lewis 2026-10-21) ──────────────
59
+ Its mark holds the row's end; the row's own actions show before it only on
60
+ hover, focus or a hidden row — at rest, selected or not, the mark alone (the
61
+ design's selected row; at 220px they would cut the name to a letter). The
62
+ tone and the mark are the shell's (TreeRow `tone`, `SharedIcon`). */
63
+ .es-tree-row:not(:hover):not(:focus-within):not(.is-hidden) .es-tree-shared-acts {
64
+ display: none;
65
+ }
66
+ .es-tree-shared-acts,
67
+ .es-tree-shared-mark {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ }
71
+ .es-tree-shared-mark {
72
+ padding: 0 4px;
73
+ }
74
+
58
75
  /* A rename box stands in for the name. It must not move the row by a pixel:
59
76
  the name's own font, no border, no padding of its own. */
60
77
  .es-tree-rename {
@@ -88,6 +88,15 @@ type TreeRowProps = {
88
88
  label: string;
89
89
  icon: ReactNode;
90
90
  };
91
+ /**
92
+ * SHARED (Shared section design v4, Lewis 2026-10-21): the row's thing is
93
+ * used live on many pages, and these are the words for how far — "On every
94
+ * page", "On 3 pages". The row is drawn in the shell's shared tone (green),
95
+ * with the shell's `shared` mark held at its end, these words its Tooltip and
96
+ * accessible name. The row's `actions` stay, shown before the mark on hover
97
+ * or focus. Absent: the row is drawn as before.
98
+ */
99
+ shared?: string;
91
100
  /** Drawn after the name, the marks and `trailing` — a count, say. The drop line is the row's own (`drop`). */
92
101
  children?: ReactNode;
93
102
  /** The depth, from 1 (`aria-level`). Left out: the nearest `Subtree`'s, counted. */
@@ -1,5 +1,5 @@
1
1
  import { DataInput } from './data/index.js';
2
- import { I as ItemSelector, N as NodeSelection } from './plan-2BLk7pWs.js';
2
+ import { I as ItemSelector, N as NodeSelection } from './plan-CZS902DV.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-2BLk7pWs.js';
2
+ import { N as NodeSelection, A as AfterRemove, S as StepBounds } from './plan-CZS902DV.js';
3
3
 
4
4
  /**
5
5
  * The node clipboard — what Copy and Cut hold, and Paste reads.
@@ -62,6 +62,8 @@ declare function useNodeOps(host: NodeOpsHost): {
62
62
  paste: (at: Place) => boolean;
63
63
  /** Put back exactly what a delete took, at its place, selected (`planRestore`). */
64
64
  restore: (node: Node, at: Place) => boolean;
65
+ /** Put `node` where `id` stands, selected, in one step (`planSwap`). */
66
+ swap: (id: string, node: Node) => boolean;
65
67
  /** Where "up one level" goes from `selection`, or null when there is nothing above. */
66
68
  parentOf: (selection: NodeSelection) => NodeSelection;
67
69
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "17.0.0",
3
+ "version": "18.0.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",
@@ -117,6 +117,8 @@
117
117
  "./screen/lib/section-template-types",
118
118
  "./screen/lib/section-templates",
119
119
  "./screen/lib/session-context",
120
+ "./screen/lib/shared-section-types",
121
+ "./screen/lib/shared-sections",
120
122
  "./screen/words"
121
123
  ]
122
124
  },
@@ -605,6 +607,16 @@
605
607
  "import": "./dist/screen/lib/session-context.js",
606
608
  "default": "./dist/screen/lib/session-context.js"
607
609
  },
610
+ "./screen/lib/shared-section-types": {
611
+ "types": "./dist/screen/lib/shared-section-types.d.ts",
612
+ "import": "./dist/screen/lib/shared-section-types.js",
613
+ "default": "./dist/screen/lib/shared-section-types.js"
614
+ },
615
+ "./screen/lib/shared-sections": {
616
+ "types": "./dist/screen/lib/shared-sections.d.ts",
617
+ "import": "./dist/screen/lib/shared-sections.js",
618
+ "default": "./dist/screen/lib/shared-sections.js"
619
+ },
608
620
  "./screen/words": {
609
621
  "types": "./dist/screen/words.d.ts",
610
622
  "import": "./dist/screen/words.js",
@@ -615,7 +627,7 @@
615
627
  "dist"
616
628
  ],
617
629
  "peerDependencies": {
618
- "efficient-shell": "^8.18.0",
630
+ "efficient-shell": "^8.20.0",
619
631
  "react": ">=18",
620
632
  "react-dom": ">=18"
621
633
  },
@@ -625,7 +637,7 @@
625
637
  "@types/node": "^22.0.0",
626
638
  "@types/react": "^18.2.0",
627
639
  "@types/react-dom": "^18.2.0",
628
- "efficient-shell": "^8.18.0",
640
+ "efficient-shell": "^8.20.0",
629
641
  "esbuild": "^0.27.0",
630
642
  "jsdom": "^26.1.0",
631
643
  "react": "^18.2.0",
@@ -1,9 +0,0 @@
1
- import{DEFAULT_TREE_WORDS as e}from"./chunk-K56YDHYQ.js";import{useContext as r,createContext as a,isValidElement as o}from"react";import{Tree as n,TreeGroupLabel as l,TreeGroup as i,Tooltip as s,TreeRow as t,IconButton as d,TreeSeam as c,TreeEmptySlot as m}from"efficient-shell/ui";import{jsx as p,jsxs as g,Fragment as u}from"react/jsx-runtime";var h,b=()=>h??=a(1),f=()=>r(b());function k({className:r,children:a,rootProps:o,ariaLabel:l,words:i=e}){/* @__PURE__ */
2
- return p(n,{"aria-label":l??i.name??e.name,className:r?`es-tree ${r}`:"es-tree",rootProps:o,children:a})}function v({children:e,count:r,expanded:a,onToggle:o}){/* @__PURE__ */
3
- return p(l,{count:r,expanded:a,onToggle:o,children:e})}function w({children:e}){const r=f(),a=b();/* @__PURE__ */
4
- return p(a.Provider,{value:r+1,children:/* @__PURE__ */p(i,{children:e})})}var N=e.dragHint,P=e=>[e].flat(1/0).some(e=>o(e)&&!0===e.props.pressed);function T({icon:r,name:a,preview:o,selected:n,hidden:l,draggable:i,dragHint:d,dragging:c,drop:m,fold:h,actions:b,nameSlot:k,onSelect:v,marks:w,badge:N,trailing:T,children:y,rowProps:A,level:S,words:x=e}){const H=f(),j=["es-tree-row",n?"is-selected":"",l?"is-hidden":"",i?"is-draggable":"",c?"is-dragging":"",m?`is-drop-${m}`:""].filter(Boolean).join(" "),B=/* @__PURE__ */g(u,{children:[
5
- /* @__PURE__ */p("span",{className:"es-tree-name",children:a}),w?.map(e=>/* @__PURE__ */p(s,{content:e.label,children:/* @__PURE__ */p("span",{className:"es-tree-mark","aria-label":e.label,role:"img",children:e.icon})},e.key)),T?/* @__PURE__ */p(s,{content:T.label,children:/* @__PURE__ */p("span",{className:"es-tree-trailing","aria-label":T.label,role:"img",children:T.icon})}):null,y]}),C=A?.onClick,$={click:!1},D=C?e=>{C(e),$.click=!0,queueMicrotask(()=>{$.click=!1})}:void 0,L=v?()=>{$.click||v()}:void 0;/* @__PURE__ */
6
- return p(t,{label:B,level:S??H,icon:r,preview:o,selected:!!n,expanded:h?h.open:void 0,onToggle:h?.onToggle,onSelect:L,muted:!!l,badge:N,actions:b,actionsPinned:P(b),rename:k,drop:m,dragging:!!c,draggable:!!i,dragHint:d??x.dragHint,className:j,rowProps:{...A,onClick:D,...i?{"aria-keyshortcuts":"Alt+ArrowUp Alt+ArrowDown"}:{}}})}function y({kind:e,label:r,onClick:a,pressed:o,disabled:n,children:l}){/* @__PURE__ */
7
- return p(s,{content:r,children:/* @__PURE__ */p(d,{"aria-label":r,"aria-pressed":o,"aria-disabled":n||void 0,variant:"delete"===e?"ghost-danger":"ghost",size:"sm","data-kind":e,className:n?"es-tree-act-off":void 0,onClick:e=>{e.stopPropagation(),a()},children:l})})}function A({drop:e,onAdd:r,label:a,seamProps:o}){const n=["es-tree-seam",e?"is-drop":"",r?"has-add":"",o?.className??""].filter(Boolean).join(" "),l={...o,className:n};/* @__PURE__ */
8
- return p(c,{drop:!!e,onInsert:r,label:a,seamProps:l})}function S({drop:r,onAdd:a,label:o,seamProps:n,words:l=e}){const i=o??(a?l.addBlock??e.addBlock:l.emptySlot??e.emptySlot),s={...n,className:n?.className?`es-tree-empty ${n.className}`:"es-tree-empty"};/* @__PURE__ */
9
- return p(m,{drop:!!r,onAdd:a,label:i,slotProps:s})}export{k as LayersTree,w as Subtree,N as TREE_DRAG_HINT,S as TreeEmptySlot,v as TreeGroupLabel,T as TreeRow,y as TreeRowAction,A as TreeSeam};
@@ -1 +0,0 @@
1
- var e={title:"Add",contextAll:"Sections and blocks",done:"Done",doneDescription:"Close Add and go back",templates:"Your templates",tile:({name:e})=>`Add ${e}`,hint:"Drag onto the page.",search:"Search",onlySections:"Only sections go here",notInside:({name:e})=>`Cannot go inside ${e}`,addingTo:({name:e})=>`Adding to ${e}`,addingBefore:({name:e})=>`Adding before ${e}`,addingAtEnd:"Adding at the end of the page",addingHere:"Adding here"};var a={savedAgo:function({seconds:e}){const a=Math.max(0,Math.floor(e));if(a<1)return"Saved just now";if(a<60)return`Saved ${a} second${1===a?"":"s"} ago`;const n=Math.floor(a/60);if(n<60)return`Saved ${n} minute${1===n?"":"s"} ago`;const o=Math.floor(n/60);return`Saved ${o} hour${1===o?"":"s"} ago`},saved:"All changes saved",saving:"Saving",pending:"Changes not saved yet — saving in a moment",failedIn:({seconds:e})=>`Not saved — trying again in ${e} s`,failedSoon:"Not saved — trying again soon",offline:"You’re offline — we’ll save when you’re back",pausedHeld:"Auto-save is off — changes not saved",paused:"Auto-save is off",locked:({editing:e})=>`Not saving — ${e}`,blockedOffline:"You’re offline. Try again when you’re back online.",blockedFailed:"Your last changes are not saved yet. Try again when they are.",blockedConflict:"Your last save was refused. See the notice below."},n={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:"Page",templateSections:"Template",addSection:"Add section",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:"Reload the preview",refreshTip:"Reload the preview (keeps your place)",notSaving:"Not saving — see the notice below",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",saveOptions:"Save options",autoSave:"Auto-save",saveNow:"Save now"},saveStatus:a,menu:{undo:"Undo",redo:"Redo",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",nothingToFold:"Nothing to fold on this page",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:a,total:n})=>`Moved “${e}” to position ${a} of ${n}`,sectionAdded:({name:e})=>`Added “${e}” section`,deleted:({name:e})=>`Deleted “${e}”`,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,a as DEFAULT_SCREEN_SAVE_STATUS_WORDS,n as DEFAULT_SCREEN_WORDS};
@@ -1 +0,0 @@
1
- import{useSectionOps as o}from"./chunk-NFLO4I2N.js";import{SELECTION_MODE as e}from"./chunk-SPQOPWCL.js";import{decodePartId as r,encodePartId as t}from"./chunk-IYT6NN2J.js";import{useEasel as n}from"./chunk-BU2YSTLJ.js";import{usePreviewParts as p}from"./chunk-I54UCYOU.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=n(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),I?.(n)):i(o=>"part"===o.kind?e:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=a(o);r&&u.select(r)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
@@ -1,5 +0,0 @@
1
- import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as i,PanelModeExit as r}from"./chunk-XDZHKYQX.js";import{blockRuns as l}from"./chunk-M2Z775ZC.js";import{useScreenBlockLook as c,useScreenBlockRules as a}from"./chunk-SPQOPWCL.js";import{useEaselSession as p}from"./chunk-O7Q4DDJT.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-EL4F3IN7.js";import{useEasel as d}from"./chunk-BU2YSTLJ.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{AddPanel as y}from"./chunk-POSLNRTO.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-KAML3KQH.js";import{useState as u,useEffect as k,useMemo as b}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as j,jsxs as v,Fragment as L}from"react/jsx-runtime";var O=e=>`section:${e}`,T=e=>`block:${e}`,$=e=>`template:${e}`;function w({at:w,placeBlocks:B,canTake:E,onPick:N,itemFor:P,session:x,siteWide:A,onClose:H,onHide:I,readOnly:S}){const C=d(e=>e.config),D=c(),{labelAtLevel:F,categoryLabel:K,firstSection:M,Icon:Q,Thumbnail:R}=D,{blockIsOffered:W,canAddTo:Y}=a(),Z=f("screen",m).add,V=f("drag",h).add,z=p(),[J,X]=u([]);k(()=>{let t=!1;const o=e=>W(e,z);return s(z).list().then(n=>{if(t)return;const s=C.components;X(n.filter(t=>t.node?.type&&s[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[C,z]);const G=b(()=>t(C,D),[C]),U=e=>({type:O(e.type),label:e.name,cover:/* @__PURE__ */j(R,{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=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=J.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null},_=e=>/* @__PURE__ */j("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */j(Q,{type:e,size:26})}),ee=b(()=>{const e=o(G,M),t=/* @__PURE__ */new Map,s=e=>{e.retired||t.has(e.type)||!W(e.type,z)||t.set(e.type,e)};for(const t of e?[e]:G){const e=Y(t.type)?.choices??[];e.forEach(s),e.forEach(e=>Y(e.type,1)?.choices?.forEach(s))}B?.forEach(s);const i=new Set(G.map(e=>e.type)),r=[...t.values()].filter(e=>!i.has(e.type)),c=e=>({type:T(e.type),label:e.label,cover:_(e.type),title:Z.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>t.has(e.type)?{...U(e),cover:_(e.type)}:U(e),p=[];J.length>0&&p.push({key:"templates",title:Z.templates,tiles:J.map(e=>{return{type:$(e.id),label:e.name,cover:/* @__PURE__ */j(R,{type:e.node.type}),keywords:[(t=e.node.type,F(t,"section",C.components[t]?.label??t)),e.node.type]};var t})});const m=r.filter(e=>!e.group);let d=!1;for(const t of Object.keys(C.categories??{})){const o=G.filter(e=>e.cat===t);if(0===o.length)continue;const s=e&&o.some(t=>t.type===e.type)?e:null,i=(s?[s,...o.filter(e=>e.type!==s.type)]:o).map(a);s&&!d&&(i.splice(1,0,...m.map(c)),d=!0),p.push({key:`category:${t}`,title:n(C,t,K),tiles:i})}const f=p.find(e=>e.key?.startsWith("category:"));if(!d&&f&&m.length>0&&(f.tiles=[...f.tiles,...m.map(c)],d=!0),l(r.filter(e=>e.group||!d)).forEach((e,t)=>{p.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(c)})}),!E)return p;const y=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=q(e.type),o=t?E(t):null;return o?{...e,disabled:!0,disabledReason:o}:e})})),h=e=>e.tiles.some(e=>!e.disabled);return[...y.filter(h),...y.filter(e=>!h(e))]},[J,G,C,Z,E,B,z]);/* @__PURE__ */
2
- return v(L,{children:[
3
- /* @__PURE__ */j(i,{icon:/* @__PURE__ */j(g,{size:15}),title:Z.title,context:Z.contextAll,actions:/* @__PURE__ */j(r,{label:Z.done,description:Z.doneDescription,onClick:H}),onHide:I}),
4
- /* @__PURE__ */v("div",{className:"sf-addside sf-scroll",children:[
5
- /* @__PURE__ */j(y,{groups:ee,session:x,itemFor:e=>P(q(e)??{kind:"section",type:e}),onInsert:N?e=>{const t=q(e);t&&N(t)}:void 0,at:w,hint:Z.hint,searchLabel:Z.search,readOnly:S,words:V}),A??null]})]})}export{w as AddSidePanel,T as blockKey,O as sectionKey,$ as templateKey};
@@ -1,18 +0,0 @@
1
- import{DEFAULT_DRAG_WORDS as e}from"./chunk-KAML3KQH.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as a,isNoOpDrop as r}from"./chunk-67GNT6PF.js";import{withTip as s}from"./chunk-P2VEMZH5.js";import{useCanvasLayout as o,useCanvasTyping as i,useCanvasEvent as c,CANVAS_TYPABLE_EVENT as d,framePointToHost as h,elementScale as u,frameRectToLayer as f,clientPointToLayer as p}from"./chunk-X4T6JT3M.js";import{parseZoneKey as m}from"./chunk-KRXQM65X.js";import{useRef as g,useEffect as b,useState as x,useCallback as y,useMemo as v,useSyncExternalStore as w,useId as k,useLayoutEffect as N}from"react";import{Tooltip as A,IconButton as z,solidSurfaceStyle as D,Input as T}from"efficient-shell/ui";import{AddIcon as $,CloseIcon as M,SearchIcon as C}from"efficient-shell/icons/efficient";import{jsxs as S,jsx as E}from"react/jsx-runtime";function j({label:e,onInsert:t,style:n,axis:l="y",className:a,index:r}){const s=["es-canvas-insert","x"===l?"is-x":"",a??""].filter(Boolean).join(" ");/* @__PURE__ */
2
- return S("div",{className:s,style:n,"data-index":r,children:[
3
- /* @__PURE__ */E("span",{className:"es-canvas-insert-line","aria-hidden":"true"}),
4
- /* @__PURE__ */E("span",{className:"es-canvas-insert-chip",children:/* @__PURE__ */E(A,{content:e,children:/* @__PURE__ */E(z,{variant:"ghost",size:"sm","aria-label":e,onClick:t,children:/* @__PURE__ */E($,{})})})})]})}var L=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,K=e=>e.width*e.height;function B(e,t,n){return e.map((e,t)=>({s:e,at:t})).filter(({s:e})=>L(e.box,t,n)).sort((e,t)=>K(t.s.box)-K(e.s.box)||e.at-t.at).map(({s:e})=>e)}function q(e,t,n){return B(e,t,n).at(-1)??null}function X(e,t,n){const l="x"===e.axis?t:n;let a=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(a+=1)}return a}function I(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],a=n[t],r=l&&a?(l.left+l.width+a.left)/2:l?l.left+l.width:a?a.left:e.box.left,s=a??l??e.box;return{left:r-1,top:s.top,width:2,height:s.height}}const l=n[t-1],a=n[t],r=l&&a?(l.top+l.height+a.top)/2:l?l.top+l.height:a?a.top:e.box.top;return{left:e.box.left,top:r-1,width:e.box.width,height:2}}function O(e,t,n,l,a=()=>!1,r=()=>!0){const s=e.filter(e=>L(e.box,t,n)).sort((e,t)=>K(e.box)-K(t.box));for(const e of s){const s=X(e,t,n),o={...e.list,index:s};if(a(o))return null;if(l(o))return{zone:e,to:o,line:I(e,s)};if(!r(o))return null}return null}function P(e,t,n=12){const l=e.children;if(0===l.length)return[];const a=e.box,r="x"===e.axis,s=r?a.left:a.top,o=s+(r?a.width:a.height),i=e=>r?e.left:e.top,c=e=>r?e.left+e.width:e.top+e.height,d=[];for(let h=0;h<=l.length;h++){const u=l[h-1],f=l[h];let p,m;if(u&&f)p=c(u),m=Math.max(i(f)-p,0);else{const e=u?(c(u)+o)/2:(s+i(f))/2;p=Math.min(Math.max(e,s+n),o-n),m=0}const g=r?{left:p,top:a.top,width:m,height:a.height}:{left:a.left,top:p,width:a.width,height:m};d.push({key:`${e.key}:+${h}`,place:{...e.list,index:h},box:g,axis:e.axis,label:t})}return d}function H(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const a=e.children[l-1],r=e.children[l],s=a.top+a.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:s,width:e.box.width,height:Math.max(r.top-s,0)}})}return n}var R={nodes:[],zones:[]},Z="data-puck-dropzone",F="data-puck-component";function Q(e,t){if(e.length>=2){const[t,n]=e;return Math.abs(n.top-t.top)<Math.min(t.height,n.height)/2&&n.left>t.left?"x":"y"}const n=t.ownerDocument.defaultView?.getComputedStyle(t);return n&&n.display.includes("flex")&&n.flexDirection.startsWith("row")?"x":"y"}function V(e,t){const{frame:n,document:l}=e,a=e=>f(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),r=[],s=[];for(const e of l.querySelectorAll(`[${Z}]`)){const t=e.getAttribute(Z)??"";let n;try{n=m(t)}catch{continue}const l=[...e.querySelectorAll(`[${F}]`)].filter(t=>t.parentElement?.closest(`[${Z}]`)===e),o=l.map(a);s.push({key:t,list:n,box:a(e),axis:Q(o,e),children:o}),l.forEach((e,t)=>{const l=e.getAttribute(F);l&&r.push({id:l,place:{...n,index:t},box:o[t]})})}return{nodes:r,zones:s}}var Y="data-es-empty-cell",G="data-puck-dropzone",J=140;var W=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function U(s){const{canvas:f,session:m,readOnly:k,words:z=e.canvas}=s,T=g(s);b(()=>{T.current=s});const $=g(null),M=o(f),[C,L]=x(0),K=y(()=>L(e=>e+1),[]),[q,X]=x(R);b(()=>{const e=$.current;f&&e&&X((T.current.measure??V)(f,e))},[f,M,s.revision,C]);const I=s.model,P=v(()=>I(q),[I,q]),H=w(m.subscribe,m.shown,m.shown),Z=s.choose,F=(e,t)=>{const n=B(P.sources,e,t);return 0===n.length?null:Z?Z(n):n[n.length-1]},[Q,J]=x(null),[U,_]=x(null),ee=g(null),te=()=>{ee.current&&clearTimeout(ee.current),ee.current=null},ne=()=>{te(),ee.current=setTimeout(()=>{m.get()||J(null)},140)};b(()=>te,[]);const le=g(null),ae=i(f),re=g(!1);re.current=ae,b(()=>{ae&&(te(),J(null))},[ae]);const[se,oe]=x(null);c(f,d,e=>oe(e.detail?.id??null));const ie=!se||ae||k||H?null:q.nodes.find(e=>e.id===se)?.box??null;c(f,"mousemove",e=>{const t=$.current;if(!f||!t)return;const n=h(f.frame,e.clientX,e.clientY,t),l=u(t),a={x:n.x/l,y:n.y/l};if(le.current=a,T.current.readOnly||m.get()||re.current)return;te();const r=F(a.x,a.y);J(e=>e?.key===r?.key&&e?.box===r?.box?e:r)}),c(f,"mouseout",e=>{e.relatedTarget||(le.current=null,ne())}),c(f,"mouseover",e=>{e.relatedTarget||K()});const ce=g(null),de=y(()=>{ce.current?.(),ce.current=null,_(null)},[]);b(()=>m.subscribe(()=>{m.get()?K():de()}),[m,de,K]),b(()=>de,[de]),("undefined"==typeof document?b:N)(()=>{if(m.get())return;const e=le.current;J(t=>k||re.current?null:e?F(e.x,e.y):t?P.sources.find(e=>e.key===t.key)??null:null)},[P,H,m,k,Z]);const he=e=>{const t=m.get(),n=$.current;if(!t||!n)return null;const l=p(n,e.clientX,e.clientY);le.current=l;const a=O(P.zones,l.x,l.y,e=>T.current.canDrop(t.item,e),e=>!!t.from&&r(t.from,e),e=>T.current.fallThrough?.(t.item,e,t.from)??!0);return a?{h:t,t:a}:null},ue={onDragEnter:e=>{if(ce.current)return;const t=n(e.currentTarget.parentElement?.parentElement??null),r=f?l(f.document):null,s=[];t&&s.push(a(t)),r&&f&&s.push(a(r,f.frame)),ce.current=s.length?()=>s.forEach(e=>e()):null},onDragOver:e=>{const n=he(e);if(!n)return void _(null);e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed);const l={zoneKey:n.t.zone.key,line:n.t.line,axis:n.t.zone.axis};_(e=>e&&e.zoneKey===l.zoneKey&&e.line.left===l.line.left&&e.line.top===l.line.top?e:l)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||(le.current=null,_(null))},onDrop:e=>{const t=he(e);t&&(e.preventDefault(),m.end(),de(),T.current.onDrop(t.h.item,t.t.to))}},fe={draggable:!k&&!!Q,onMouseEnter:te,onMouseLeave:()=>!m.get()&&ne(),onDragStart:e=>{if(Q&&!k){m.start({key:Q.key,item:Q.item,from:Q.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",Q.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{m.end(),de()},onClick:()=>{Q&&!k&&T.current.onPick?.(Q.item)}},{seams:pe=[]}=P,me=P.zones.filter(e=>0===e.children.length),ge=!s.onZoneAdd||k||ae?[]:me,be=ge.map(e=>e.key).join("\n");return b(()=>{const e=f?.document;if(!e)return;const t=new Set(be?be.split("\n"):[]);for(const n of e.querySelectorAll(`[${G}]`))n.toggleAttribute(Y,t.has(n.getAttribute(G)??""));return()=>{for(const t of e.querySelectorAll(`[${Y}]`))t.removeAttribute(Y)}},[f,be,q,M,C]),/* @__PURE__ */S("div",{ref:$,className:"es-canvas-layer",children:[H||!s.onSeamAdd||k||ae?null:pe.map(e=>
5
- /* @__PURE__ */E(j,{className:"es-canvas-seam",axis:e.axis,index:e.place.index,label:e.label??s.seamLabel??z.addSection,onInsert:()=>s.onSeamAdd?.(e.place),style:"x"===e.axis?{left:e.box.left+e.box.width/2-12,top:e.box.top,width:24,height:e.box.height}:{left:e.box.left,top:e.box.top+e.box.height/2-12,width:e.box.width,height:24}},e.key)),ge.length?ge.map(e=>/* @__PURE__ */E("button",{type:"button",className:["es-canvas-empty",e.addAlways?"is-always":"",U?.zoneKey===e.key?"is-over":""].filter(Boolean).join(" "),style:W(e.box),onClick:()=>s.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */E("span",{className:"es-canvas-empty-add",children:z.addButton({label:e.addLabel??s.zoneAddLabel??z.addBlock})})},e.key)):null,H?/* @__PURE__ */E("div",{className:"es-canvas-catch",...ue}):null,U&&!me.some(e=>e.key===U.zoneKey)?/* @__PURE__ */E("div",{className:`es-canvas-line is-${U.axis}`,style:W(U.line)}):null,ie?/* @__PURE__ */E("span",{className:"es-canvas-hint"+(ie.width<200?" is-below":""),style:{...D(),left:ie.left+ie.width,top:ie.width<200?ie.top+ie.height:ie.top},children:z.typeHint}):null,
6
- /* @__PURE__ */E("div",{className:"es-canvas-handle-spot",style:Q?{"--es-handle-x":`${Q.box.left+2}px`,"--es-handle-y":`${Math.max(Q.box.top-11,0)}px`}:void 0,children:/* @__PURE__ */E(A,{className:"es-canvas-handle-tip",side:"top",content:!Q||k||H?null:Q.title??z.handle({label:Q.label}),children:/* @__PURE__ */S("div",{className:["es-canvas-handle",Q&&!k?"is-shown":"",H?"is-dragging":""].filter(Boolean).join(" "),...fe,children:[
7
- /* @__PURE__ */E("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),Q?.label]})})})]})}var _=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function ee({groups:t,session:n,itemFor:l,onInsert:a,at:r,hint:o,searchLabel:i,readOnly:c,words:d=e.add}){const h=o??d.hint,u=i??d.search,[f,p]=x(""),m=k(),g=f.trim().toLowerCase(),b=function(e){const t=/* @__PURE__ */new Map;return e.map(e=>{const n=e.key??e.title,l=t.get(n)??0;return t.set(n,l+1),0===l?n:`${n}\0${l}`})}(t),y=t.map((e,t)=>({...e,key:b[t],tiles:g?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,g)):e.tiles})).filter(e=>e.tiles.length>0),v=(e,t)=>a=>{if(t)a.preventDefault();else{n.start({key:`new:${e}`,item:l(e)}),a.dataTransfer.effectAllowed="copy";try{a.dataTransfer.setData("text/plain",e)}catch{}}};/* @__PURE__ */
8
- return S("div",{className:"es-add",children:[r?/* @__PURE__ */S("div",{className:"es-add-at",role:"status",children:[
9
- /* @__PURE__ */E("span",{children:r.label}),s(d.stop,/* @__PURE__ */E("button",{type:"button",className:"es-add-at-clear","aria-label":d.stop,onClick:r.onClear,children:/* @__PURE__ */E(M,{size:12,"aria-hidden":"true"})}))]}):null,
10
- /* @__PURE__ */E("p",{className:"es-add-hint",children:h}),
11
- /* @__PURE__ */E("div",{className:"es-add-find",children:/* @__PURE__ */E(T,{id:m,type:"search","aria-label":u,placeholder:d.searchPlaceholder({label:u}),value:f,onChange:e=>p(e.target.value),leftIcon:/* @__PURE__ */E(C,{size:16,"aria-hidden":"true"}),rightAdornment:f?/* @__PURE__ */E(z,{size:"sm","aria-label":d.clearSearch,onClick:()=>p(""),children:/* @__PURE__ */E(M,{size:12,"aria-hidden":"true"})}):void 0})}),0===y.length?/* @__PURE__ */S("div",{className:"es-add-empty",role:"status",children:[
12
- /* @__PURE__ */E("div",{className:"es-add-empty-title",children:d.nothing({query:f.trim()})}),
13
- /* @__PURE__ */E("div",{className:"es-add-empty-sub",children:d.tryAnother})]}):y.map(e=>/* @__PURE__ */S("section",{className:"es-add-group","aria-label":e.title,children:[
14
- /* @__PURE__ */S("div",{className:"es-add-group-head",children:[
15
- /* @__PURE__ */E("span",{className:"es-add-group-title",children:e.title}),
16
- /* @__PURE__ */E("span",{className:"es-add-group-count",children:e.tiles.length})]}),
17
- /* @__PURE__ */E("div",{className:_(e)?"es-add-grid is-cards":"es-add-grid",children:e.tiles.map(e=>{const t=Boolean(c||e.disabled),l=c?void 0:e.disabled?e.disabledReason:e.title??d.tile({label:e.label});return s(l,/* @__PURE__ */S("button",{type:"button",className:null!=e.cover?"es-add-tile has-cover":"es-add-tile",draggable:!t,"aria-disabled":t||void 0,"aria-label":d.tile({label:e.label}),onDragStart:v(e.type,t),onDragEnd:()=>n.end(),onClick:()=>!t&&a?.(e.type),children:[null!=e.cover?/* @__PURE__ */E("span",{className:"es-add-tile-cover","aria-hidden":"true",children:e.cover}):e.icon?/* @__PURE__ */E("span",{className:"es-add-tile-glyph","aria-hidden":"true",children:e.icon}):null,
18
- /* @__PURE__ */E("span",{className:"es-add-tile-label",children:e.label})]},e.type))})})]},e.key))]})}export{ee as AddPanel,U as CanvasDragLayer,j as CanvasInsert,R as EMPTY_MEASURE,J as HANDLE_GRACE_MS,O as canvasTarget,L as contains,X as gapInZone,I as gapLine,P as insertSeams,V as measureCanvas,q as pickSource,H as seamsBetween,B as sourcesAt};
@@ -1 +0,0 @@
1
- import{find as n,remove as t,getList as e,newId as r,duplicate as o,move as l,copyNode as a,insert as c,setProps as i,slotsOf as d}from"./chunk-KRXQM65X.js";import{useRef as s,useSyncExternalStore as u,useCallback as p,useMemo as f}from"react";var m=n=>({kind:"node",id:n});function x(r,o,l,a="none"){const c=n(r,o,l),i=t(r,o,l);if("none"===a||!c)return{data:i,select:null};const d=e(r,o,c.place)??[],s=d[c.place.index+1]??d[c.place.index-1];return s?.props?.id?{data:i,select:m(s.props.id)}:"root"!==c.place.parentId?{data:i,select:m(c.place.parentId)}:{data:i,select:null}}function g(t,e,l,a={}){const c=n(t,e,l)?.node,i=a.id??r(c?.type??"Node");return{data:o(t,e,l,{strip:a.strip,id:i}),select:m(i)}}function I(n,t,e,r){return{data:l(n,t,e,r),select:m(e)}}var h=(n,t)=>({min:0,max:t-1});function v(t,r,o,l,a=h){const c=n(t,r,o);if(!c)return!1;const i=e(t,r,c.place)?.length??0,{min:d,max:s}=a(c.place,i),u=c.place.index+l;return c.place.index>=d&&c.place.index<=s&&u>=d&&u<=s}function b(t,e,r,o,l=h){if(!v(t,e,r,o,l))return null;const a=n(t,e,r);return I(t,e,r,{...a.place,index:a.place.index+o})}function k(n,t,e,r,o={}){const l=a(e,t,{strip:o.strip});return{data:c(n,t,r,l),select:m(l.props.id)}}function y(t,r,o,l){if(n(t,r,o.props.id))return null;const a=e(t,r,l)??[],i={...l,index:Math.max(0,Math.min(l.index,a.length))};return{data:c(t,r,i,o),select:m(o.props.id)}}function M(n,t,e,r){return{data:i(n,t,e,r),select:void 0}}function O(t,e,r,o=()=>!1){if(!r)return null;if("slot"===r.kind)return n(t,e,r.parentId)?m(r.parentId):null;const l=n(t,e,r.id);if(!l||"root"===l.place.parentId)return null;const a=n(t,e,l.place.parentId);return a?o(a.node,l.place.slot)?{kind:"slot",parentId:a.node.props.id,slot:l.place.slot}:m(a.node.props.id):null}function z(t,e,r,o){const l=n(t,e,r);if(!l)return[];const a=l.path.filter(n=>"root"!==n.parentId).map(n=>n.parentId);return o?[...a.filter(r=>{const l=n(t,e,r);return!l||!o(l.node)}),r]:[...a,r]}function R(n,t){if(0===n.length)return null;const e=null===t?-1:n.indexOf(t);return-1===e?n[0]:n[Math.min(e+1,n.length-1)]}function B(t,e,r,o,l){const a=n(t,e,r);return a?0===d(a.node,e).length?r:R(z(t,e,r,l),o):null}function X(t,e,r,o,l,a,c){const i=n(t,e,r);if(!i)return null;if(0===d(i.node,e).length)return{node:r,part:o};const s="\0part:"+o,u=R([...z(t,e,r,c),s],l===r&&a===o?s:l);return u===s?{node:r,part:o}:{node:u??r,part:null}}function $(t,e,r){if(!r||"node"!==r.kind)return null;const o=n(t,e,r.id);return o?{zone:`${o.place.parentId}:${o.place.slot}`,index:o.place.index}:null}function j(n,t,r){if(!r)return null;const[o,l]=(r.zone??"root:default-zone").split(/:(.*)/s),a={parentId:o,slot:l},c=e(n,t,a)?.[r.index];return c?.props?.id?m(c.props.id):null}var K={get:()=>null,set:()=>{},subscribe:()=>()=>{}};function L(t){const e=s(t);e.current=t;const r=t.clipboard??K,o=u(r.subscribe,r.get,r.get),l=p(n=>{const t=e.current;if(t.readOnly)return!1;const r=n(t.data,t.config);return!!r&&((r.data!==t.data||void 0!==r.select)&&(t.commit(r.data,{select:r.select}),e.current={...t,data:r.data},!0))},[]);return f(()=>{const t=()=>e.current,r=(e,r)=>{const o=n(t().data,t().config,e);return o?{node:o.node,label:r,from:{parentId:o.place.parentId,slot:o.place.slot}}:null};return{held:o,remove:n=>l((e,r)=>x(e,r,n,t().afterRemove)),duplicate:n=>l((e,r)=>g(e,r,n,{strip:t().strip})),move:(n,t)=>l((e,r)=>I(e,r,n,t)),step:(n,e)=>l((r,o)=>b(r,o,n,e,t().stepBounds)),canStep:(n,e)=>v(t().data,t().config,n,e,t().stepBounds),setProps:(n,t)=>l((e,r)=>M(e,r,n,t)),copy:(n,e)=>{const o=r(n,e);return o&&(t().clipboard??K).set(o),!!o},cut:(n,e)=>{if(t().readOnly)return!1;const o=r(n,e);return!!o&&((t().clipboard??K).set(o),l((e,r)=>x(e,r,n,t().afterRemove)))},paste:n=>{const e=(t().clipboard??K).get();return!!e&&l((r,o)=>k(r,o,e.node,n,{strip:t().strip}))},restore:(n,t)=>l((e,r)=>y(e,r,n,t)),parentOf:n=>O(t().data,t().config,n,t().slotIsLevel)}},[o,l])}export{v as canStep,B as clickPick,X as clickPickPart,j as fromItemSelector,R as nextInChain,z as nodeChain,O as parentStep,g as planDuplicate,I as planMove,k as planPaste,x as planRemove,y as planRestore,M as planSetProps,b as planStep,$ as toItemSelector,L as useNodeOps};
@@ -1 +0,0 @@
1
- import{textFieldIdentifier as n}from"./chunk-DUVRZ456.js";import{hidableText as r}from"./chunk-6W7WLPZH.js";function t(n,t){const o=r(n.props.name);if(o)return o;const e=r(n.props.altName);if(e)return e;const c=n.props.collection?.name;if(c)return c;const u=n.props.source?.title;if(u)return u;const s=n.props.code;return s?t?.(s)??s:""}function o(n,r,o,e,c){const u=o(t(n,e))||r(n.type);return c?c(n,"block",u):u}function e(r){if(!r)return null;for(const t of["name","altName"])if(n(r[t]))return t;return null}function c(r){const t=r?.name;return void 0===t||n(t)?"name":null}function u(n,t,o){const e=r(n.props?.name).trim()||t;return o?o(n,"section",e):e}export{u as rootRowName,c as sectionRenameProp,t as slotChildName,e as slotChildRenameProp,o as slotChildRowName};