efficient-easel 22.0.0 → 23.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 (145) hide show
  1. package/README.md +38 -23
  2. package/dist/{CanvasDragLayer-B6Yn9S8T.d.ts → CanvasDragLayer-NZpaX6aq.d.ts} +15 -4
  3. package/dist/{ScreenDocumentContext-BIK3uWtF.d.ts → ScreenDocumentContext-BDLUYzlM.d.ts} +4 -4
  4. package/dist/blocks/index.d.ts +11 -11
  5. package/dist/canvas/index.d.ts +21 -9
  6. package/dist/canvas/index.js +1 -1
  7. package/dist/{canvas-typing-Be4FO4q7.d.ts → canvas-typing-DOBx8dD3.d.ts} +12 -2
  8. package/dist/{chunk-XWKQP6AE.js → chunk-3P735WOM.js} +4 -4
  9. package/dist/{chunk-KWLHKKZO.js → chunk-4YUC7B7E.js} +1 -1
  10. package/dist/chunk-6F5GO337.js +1 -0
  11. package/dist/{chunk-3S5N4HLJ.js → chunk-6NJHYXJM.js} +1 -1
  12. package/dist/{chunk-BTDI7JAA.js → chunk-A6ZP5II4.js} +2 -2
  13. package/dist/{chunk-IWCKVZHS.js → chunk-AGWKB77Q.js} +1 -1
  14. package/dist/chunk-AT4DDMJS.js +1 -0
  15. package/dist/chunk-FF54HWSE.js +8 -0
  16. package/dist/{chunk-IROEWITG.js → chunk-FOOK54T2.js} +1 -1
  17. package/dist/{chunk-SWBADIQT.js → chunk-G3HAKQUF.js} +1 -1
  18. package/dist/{chunk-ZOSEBPAI.js → chunk-GKG3M5QK.js} +1 -1
  19. package/dist/chunk-GXRS52JD.js +5 -0
  20. package/dist/{chunk-YC6KLSW3.js → chunk-HLMQ34GP.js} +1 -1
  21. package/dist/chunk-HZSZT3BE.js +7 -0
  22. package/dist/{chunk-EB6NI2VK.js → chunk-IYHO4XQX.js} +1 -1
  23. package/dist/chunk-IZGFJWH4.js +1 -0
  24. package/dist/chunk-KXM6YRG2.js +1 -0
  25. package/dist/chunk-KXTXYINN.js +16 -0
  26. package/dist/chunk-LN43DP2A.js +18 -0
  27. package/dist/{chunk-YHFKWV7H.js → chunk-MXECWHRJ.js} +10 -10
  28. package/dist/chunk-OXZDSOZV.js +1 -0
  29. package/dist/{chunk-BSHIQIZC.js → chunk-RPMSET77.js} +1 -1
  30. package/dist/{chunk-K7BTCBWD.js → chunk-TGZCD6IP.js} +1 -1
  31. package/dist/chunk-VZUXOZGP.js +64 -0
  32. package/dist/{chunk-RY5AWQ63.js → chunk-XJ23ULBP.js} +1 -1
  33. package/dist/{chunk-TLN5ZT76.js → chunk-YHEYJKQL.js} +1 -1
  34. package/dist/chunk-YU3WHLGI.js +1 -0
  35. package/dist/copy/index.d.ts +20 -6
  36. package/dist/copy/index.js +29 -29
  37. package/dist/data/index.d.ts +30 -22
  38. package/dist/data/index.js +1 -1
  39. package/dist/drag/drag.css +10 -1
  40. package/dist/drag/index.d.ts +5 -5
  41. package/dist/drag/index.js +1 -1
  42. package/dist/draw/index.d.ts +1 -1
  43. package/dist/easel/easel.css +12 -5
  44. package/dist/easel/index.d.ts +90 -53
  45. package/dist/easel/index.js +1 -1
  46. package/dist/edit-lock/index.d.ts +5 -5
  47. package/dist/fields/fields.css +1 -1
  48. package/dist/fields/index.d.ts +15 -15
  49. package/dist/fields/index.js +1 -1
  50. package/dist/node-ops/index.d.ts +3 -3
  51. package/dist/node-ops/index.js +1 -1
  52. package/dist/panel/index.d.ts +1 -1
  53. package/dist/panel/panel.css +6 -1
  54. package/dist/pick/index.d.ts +5 -5
  55. package/dist/{plan-CRUh2kVK.d.ts → plan-D0DgSLnY.d.ts} +5 -5
  56. package/dist/render/index.d.ts +13 -13
  57. package/dist/render/index.js +1 -1
  58. package/dist/{resolve-AJ6WF4EL.d.ts → resolve-Bz4mszpL.d.ts} +5 -5
  59. package/dist/screen/components/AddBlockRow.js +1 -1
  60. package/dist/screen/components/AddSidePanel.d.ts +2 -2
  61. package/dist/screen/components/AddSidePanel.js +1 -1
  62. package/dist/screen/components/NodeContextMenu.d.ts +17 -20
  63. package/dist/screen/components/NodeContextMenu.js +1 -1
  64. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  65. package/dist/screen/components/PreviewDeviceContext.d.ts +1 -1
  66. package/dist/screen/components/PreviewPartsContext.d.ts +2 -2
  67. package/dist/screen/components/SaveControls.d.ts +8 -8
  68. package/dist/screen/components/ScreenChrome.js +1 -1
  69. package/dist/screen/components/ScreenDocumentContext.d.ts +5 -5
  70. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  71. package/dist/screen/components/ScreenMount.d.ts +8 -8
  72. package/dist/screen/components/ScreenMount.js +1 -1
  73. package/dist/screen/components/ScreenStoreProvider.d.ts +12 -12
  74. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  75. package/dist/screen/components/SectionScreenShell.js +17 -17
  76. package/dist/screen/components/usePartBridge.d.ts +10 -10
  77. package/dist/screen/components/usePartBridge.js +1 -1
  78. package/dist/screen/index.d.ts +8 -8
  79. package/dist/screen/index.js +1 -1
  80. package/dist/screen/lib/admin-bridge.d.ts +4 -4
  81. package/dist/screen/lib/document/block-types-in.d.ts +2 -1
  82. package/dist/screen/lib/document/block-types-in.js +1 -1
  83. package/dist/screen/lib/document/content-tree.d.ts +8 -8
  84. package/dist/screen/lib/document/device-fields.d.ts +7 -7
  85. package/dist/screen/lib/document/device-fields.js +1 -1
  86. package/dist/screen/lib/document/field-markers.d.ts +4 -4
  87. package/dist/screen/lib/document/palette-sections.d.ts +5 -5
  88. package/dist/screen/lib/document/panel-fields.d.ts +5 -5
  89. package/dist/screen/lib/document/panel-no-control-mark.d.ts +3 -3
  90. package/dist/screen/lib/document/part-id.d.ts +1 -1
  91. package/dist/screen/lib/document/preview-events.d.ts +2 -2
  92. package/dist/screen/lib/document/preview-selection-context.d.ts +2 -2
  93. package/dist/screen/lib/document/section-doc.d.ts +5 -5
  94. package/dist/screen/lib/document/section-doc.js +1 -1
  95. package/dist/screen/lib/document/slot-child-name.d.ts +1 -1
  96. package/dist/screen/lib/document/slot-section-spec.d.ts +1 -1
  97. package/dist/screen/lib/document/style-clipboard.d.ts +8 -8
  98. package/dist/screen/lib/document/style-clipboard.js +1 -1
  99. package/dist/screen/lib/document/tree-reveal.d.ts +4 -4
  100. package/dist/screen/lib/document/use-section-ops.d.ts +6 -6
  101. package/dist/screen/lib/document/use-section-ops.js +1 -1
  102. package/dist/screen/lib/document-addressing.d.ts +5 -5
  103. package/dist/screen/lib/document-hooks.d.ts +4 -4
  104. package/dist/screen/lib/host.d.ts +5 -5
  105. package/dist/screen/lib/key-scope.d.ts +1 -1
  106. package/dist/screen/lib/key-scope.js +1 -1
  107. package/dist/screen/lib/media-panel.d.ts +5 -5
  108. package/dist/screen/lib/media-picker.d.ts +6 -6
  109. package/dist/screen/lib/page-lock.d.ts +4 -4
  110. package/dist/screen/lib/screen-parts.d.ts +22 -10
  111. package/dist/screen/lib/screen-parts.js +1 -1
  112. package/dist/screen/lib/section-templates.d.ts +4 -4
  113. package/dist/screen/lib/session-context.d.ts +4 -4
  114. package/dist/screen/lib/session.d.ts +5 -5
  115. package/dist/screen/lib/shared-sections.d.ts +4 -4
  116. package/dist/screen/screen.css +14 -14
  117. package/dist/screen/words.d.ts +4 -3
  118. package/dist/screen/words.js +1 -1
  119. package/dist/{session-CrWwDt7Z.d.ts → session-EsjORLQ0.d.ts} +1 -1
  120. package/dist/shell/shell.css +2 -2
  121. package/dist/strings/index.d.ts +2 -2
  122. package/dist/strings/index.js +2 -2
  123. package/dist/style-clipboard/index.d.ts +2 -2
  124. package/dist/text-styles/index.d.ts +3 -3
  125. package/dist/text-styles/model.d.ts +1 -1
  126. package/dist/{types-BFd8FqQw.d.ts → types-BIytwvvH.d.ts} +2 -2
  127. package/dist/{types-DFxBChE3.d.ts → types-BljCVdzR.d.ts} +17 -17
  128. package/dist/{types-DlQIM1YO.d.ts → types-Dq180WRV.d.ts} +8 -8
  129. package/dist/{useNodeOps-C_nisDHh.d.ts → useNodeOps-igxrnEhq.d.ts} +2 -2
  130. package/dist/{watch-D0bNZRtU.d.ts → watch-Unf6SfUf.d.ts} +3 -3
  131. package/dist/{words-gIDCeRv3.d.ts → words-B5Gb7KFq.d.ts} +1 -1
  132. package/dist/{words-BpTjCfqO.d.ts → words-Cf5VT2Ic.d.ts} +2 -2
  133. package/package.json +1 -1
  134. package/dist/chunk-4LGROS5L.js +0 -1
  135. package/dist/chunk-BDSLF5BR.js +0 -1
  136. package/dist/chunk-CPL43ZLJ.js +0 -1
  137. package/dist/chunk-CUZQ2HMA.js +0 -18
  138. package/dist/chunk-GHBK7BKL.js +0 -1
  139. package/dist/chunk-IYYE7VJN.js +0 -65
  140. package/dist/chunk-KN2TIXUT.js +0 -1
  141. package/dist/chunk-L55YIXDC.js +0 -1
  142. package/dist/chunk-MZ5GSSZ3.js +0 -7
  143. package/dist/chunk-SJMS247S.js +0 -5
  144. package/dist/chunk-TXR7GC5A.js +0 -8
  145. package/dist/chunk-WJSEWAWK.js +0 -15
@@ -179,10 +179,10 @@
179
179
  --sf-panel-shadow: none;
180
180
  --sf-font: var(--es-font);
181
181
 
182
- /* No old-editor variable names here. The old editor read its azure ramp and
182
+ /* No old-library variable names here. The old library read its azure ramp and
183
183
  font family from editor-shell's shell.css on this same root, and
184
184
  they were deliberately never re-declared in this file — one blue is the
185
- point. The old editor and those names left with blueprint 6.1/6.3; the blue is the
185
+ point. The old library and those names left with blueprint 6.1/6.3; the blue is the
186
186
  `--es-*` set in efficient-easel/shell.css. */
187
187
 
188
188
  /*
@@ -489,7 +489,7 @@
489
489
  overflow: hidden;
490
490
  }
491
491
 
492
- /* ── Center: device-framed preview (wraps the old editor's preview) ──────────────── */
492
+ /* ── Center: device-framed preview (wraps the old library's preview) ──────────────── */
493
493
  .sf-center {
494
494
  flex: 1;
495
495
  min-width: 0;
@@ -529,7 +529,7 @@
529
529
  min-width: 0;
530
530
  }
531
531
 
532
- /* ── Center: device-framed preview (wraps the old editor's preview) ──────────────── */
532
+ /* ── Center: device-framed preview (wraps the old library's preview) ──────────────── */
533
533
  .sf-frame {
534
534
  width: 100%;
535
535
  height: 100%;
@@ -553,7 +553,7 @@
553
553
  min-height: 0;
554
554
  }
555
555
 
556
- /* ── Center: device-framed preview (wraps the old editor's preview) ──────────────── */
556
+ /* ── Center: device-framed preview (wraps the old library's preview) ──────────────── */
557
557
  /* Sizer box for the device frame: its layout size is the frame's *painted*
558
558
  (scaled) size, so the .sf-center well centres it when it fits and scrolls it
559
559
  when a zoom makes it larger. The frame inside is scaled from its top-left. */
@@ -573,7 +573,7 @@
573
573
  position: relative;
574
574
  }
575
575
 
576
- /* The old editor's preview fills the frame */
576
+ /* The old library's preview fills the frame */
577
577
  .sf-preview-host > div,
578
578
  .sf-preview-host iframe {
579
579
  width: 100% !important;
@@ -626,7 +626,7 @@
626
626
  insertion line + a dark "Add section" pill; clicking opens the picker targeted
627
627
  at that seam. It sits inside the scaled device frame, so it tracks the zoom. */
628
628
  /* The full-width band only POSITIONS the ➕ over a seam — it is itself
629
- click-through (pointer-events:none) so it never steals canvas clicks / the old editor
629
+ click-through (pointer-events:none) so it never steals canvas clicks / the old library
630
630
  selection near a section boundary. Only the ➕ is interactive: the canvas
631
631
  insert point (efficient-easel/drag `CanvasInsert`, drag.css), the shell's
632
632
  24px IconButton (owner 2026-10-14). */
@@ -696,7 +696,7 @@
696
696
  it: the rule below is drawn by a PACKAGE, it is the majority of what is
697
697
  actually on screen, and it cannot be deleted from here.
698
698
 
699
- The old editor rules the gap between every pair of top-level fields, so it draws once
699
+ The old library rules the gap between every pair of top-level fields, so it draws once
700
700
  per field for the whole panel — 28 lines in a single section panel, measured.
701
701
  That is most of the panel's lines on its own, which is why removing the shop's
702
702
  own two heading rules (card 66300) did not change what he saw.
@@ -706,21 +706,21 @@
706
706
  text parts. It was held here under a written expiry, because a rule that lives
707
707
  in another repo could not be reached from this one. editor-shell 0.29.0 (card
708
708
  66350) deleted it AT SOURCE and card 66351 deleted this repo's copy with it —
709
- the ending the old editor rule below cannot have, since the old editor package is not ours
709
+ the ending the old library rule below cannot have, since the old library's package is not ours
710
710
  to change. That seam is now held from both ends by
711
711
  `scripts/test-drill-rows-separated-by-air.ts`: it fails if the shell starts
712
712
  drawing on it again, and it fails if a local override for it reappears here.
713
713
 
714
- ⚠️ SPECIFICITY, NOT `!important`. The old editor's rule is (0,3,0) —
714
+ ⚠️ SPECIFICITY, NOT `!important`. The old library's rule is (0,3,0) —
715
715
  `wrapFields field + field` — so this restates all three parts to match it, and
716
- wins on order: `storefront-editor.css` is imported after the old editor's stylesheet and after
716
+ wins on order: `storefront-editor.css` is imported after the old library's stylesheet and after
717
717
  `panel.css` at every call site. The `[class*=]` form is this file's existing
718
- idiom for the old editor's hashed module names (see the three rules above); a bare class
719
- would break on the next the old editor bump, silently, by putting the lines back.
718
+ idiom for the old library's hashed module names (see the three rules above); a bare class
719
+ would break on the next the old library bump, silently, by putting the lines back.
720
720
 
721
721
  This is an override of a live upstream rule, not dead code:
722
722
  `scripts/test-panel-no-divider-lines.tsx` §2 asserts the upstream rule still
723
- exists before checking it, so if the old editor ever drops its own line, the guard says
723
+ exists before checking it, so if the old library ever drops its own line, the guard says
724
724
  to delete the override rather than leave it lying here — which is exactly what
725
725
  happened to the drill one above. */
726
726
  /* The one line that says WHICH device's settings are on screen. Quiet on
@@ -260,9 +260,10 @@ type ScreenWords = {
260
260
  }) => string;
261
261
  /** What the document is called in the edit notice's sentences ("this page"). */
262
262
  noun: string;
263
- /** The Layers tree's first row: the document's own settings, with nothing
264
- * selected. */
265
- pageSettings: string;
263
+ /** The tree ground's menu row to THIS document's own styles, where the layer
264
+ * hands a way to them (`ScreenBridges.openPageStyles`). The tree has no row
265
+ * for the document's settings (Lewis, 2026-10-26). */
266
+ pageStyles: string;
266
267
  /** The group label over the node pinned first, and the name of its row
267
268
  * where the layer names it none. */
268
269
  header: string;
@@ -1 +1 @@
1
- export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_SHARED_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-EB6NI2VK.js";
1
+ export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_SHARED_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-IYHO4XQX.js";
@@ -1,4 +1,4 @@
1
- import { P as Place } from './types-DlQIM1YO.js';
1
+ import { P as Place } from './types-Dq180WRV.js';
2
2
 
3
3
  /**
4
4
  * The one drag in flight, shared by every surface of an editor — the Layers
@@ -60,7 +60,7 @@
60
60
  */
61
61
 
62
62
  .es-editor {
63
- /* — accent: the shell's (custom accent, else the themed primary fill) —
63
+ /* — accent: the shell's (custom accent, else themed primary fill) —
64
64
  SHELL GAP (#199): the shell has no token yet for an accent wash
65
65
  (tint, tint-strong), an accent hairline (line), accent words (text), an
66
66
  accent shadow, or ink on a solid fill (on-accent: its nearest is the status
@@ -131,7 +131,7 @@
131
131
  does. A field is a control and a row is a card, so each takes that role's
132
132
  radius and a host that restyles the role restyles the editor with it. A
133
133
  side panel is 12px, which no role draws (a card is 8, a menu and a window
134
- 16), so it stays on the scale's step. All three follow the theme's
134
+ 16), so it stays on the scale's step. All three follow theme's
135
135
  Corners setting either way: the setting rescales the scale itself. The
136
136
  second value is the step each role stands on, for a document that loads
137
137
  this sheet without the shell's `ui.css` (the role tokens are declared
@@ -1,6 +1,6 @@
1
1
  import { a as SaveWords } from '../words-Cm8PMYn0.js';
2
2
  import { N as NoticeWords, C as ChromeWords } from '../words-DYu4iBrR.js';
3
- import { C as CopyWords } from '../words-BpTjCfqO.js';
3
+ import { C as CopyWords } from '../words-Cf5VT2Ic.js';
4
4
  import { D as DragWords } from '../words-SD4neL0n.js';
5
5
  import { LockWords } from '../edit-lock/index.js';
6
6
  import { F as FieldsWords } from '../words-CFkb8XtN.js';
@@ -10,7 +10,7 @@ import { P as PickWords } from '../words-DWvCJXwR.js';
10
10
  import { ScreenWords } from '../screen/words.js';
11
11
  export { ScreenAddWords, ScreenSharedWords } from '../screen/words.js';
12
12
  import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
13
- import { T as TextStylesWords } from '../words-gIDCeRv3.js';
13
+ import { T as TextStylesWords } from '../words-B5Gb7KFq.js';
14
14
  import { T as TreeWords } from '../words-Cl9xMUYY.js';
15
15
  import * as react from 'react';
16
16
  import { ReactNode } from 'react';
@@ -1,2 +1,2 @@
1
- import{DEFAULT_SCREEN_WORDS as r}from"../chunk-EB6NI2VK.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-AJSDWWJW.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-KRL3IUV3.js";import{DEFAULT_FIELDS_WORDS as j}from"../chunk-JACEEVVF.js";import{stringsContext as k}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as a}from"../chunk-TQ5Y6S2X.js";import{useContext as W,useMemo as Y}from"react";import{jsx as y}from"react/jsx-runtime";var F={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 D(r,o){return o?v(r,o):r}function J({value:r,locale:o,children:n}){const t=k(),c=W(t),e=c?.strings??F,m=o??c?.locale??"en",i=Y(()=>({strings:D(e,r),locale:m}),[e,r,m]);/* @__PURE__ */
2
- return y(t.Provider,{value:i,children:n})}function K(){return W(k())?.strings??F}function E(){return W(k())?.locale??"en"}export{F as DEFAULT_EASEL_STRINGS,J as EaselStringsProvider,D as mergeEaselStrings,E as useEaselLocale,K as useEaselStrings};
1
+ import{DEFAULT_SCREEN_WORDS as r}from"../chunk-IYHO4XQX.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-AJSDWWJW.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-KRL3IUV3.js";import{DEFAULT_FIELDS_WORDS as j}from"../chunk-JACEEVVF.js";import{stringsContext as k}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as a}from"../chunk-TQ5Y6S2X.js";import{useContext as Y,useMemo as W}from"react";import{jsx as y}from"react/jsx-runtime";var F={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 D(r,o){return o?v(r,o):r}function J({value:r,locale:o,children:n}){const t=k(),c=Y(t),e=c?.strings??F,m=o??c?.locale??"en",i=W(()=>({strings:D(e,r),locale:m}),[e,r,m]);/* @__PURE__ */
2
+ return y(t.Provider,{value:i,children:n})}function O(){return Y(k())?.strings??F}function H(){return Y(k())?.locale??"en"}export{F as DEFAULT_EASEL_STRINGS,J as EaselStringsProvider,D as mergeEaselStrings,H as useEaselLocale,O as useEaselStrings};
@@ -44,7 +44,7 @@ interface StyleRow {
44
44
  * WHAT KIND of setting this is — the second half of "the same setting".
45
45
  * `null` means the host cannot say, and such a row only matches on a
46
46
  * component of the SAME type (where the same key is certainly the same
47
- * field). Use {@link fieldKind} for an old-editor field.
47
+ * field). Use {@link fieldKind} for an old-library field.
48
48
  */
49
49
  kind: string | null;
50
50
  /**
@@ -64,7 +64,7 @@ declare const STYLE_KIND: "__styleKind";
64
64
  */
65
65
  declare function withStyleKind<F extends object>(field: F, kind: string): F;
66
66
  /**
67
- * The kind of an old-editor field.
67
+ * The kind of an old-library field.
68
68
  *
69
69
  * - a tagged field → its tag;
70
70
  * - `text` / `textarea` / `number` → that word;
@@ -2,7 +2,7 @@ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { TextStyle, TextStyleFont, TextStyleColour, TextStyleSetting, TextStyleAuto, TextStyleValues, TextStyleDevice, TextStyleKind } from './model.js';
4
4
  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, TextStyleCase, TextStyleCaseCss, TextStyleNumber, TextStyleRange, addTextStyle, canAddTextStyle, defaultTextStyles, describeTextStyle, isDefaultTextStyle, isTextStyleCase, removeTextStyle, resolveTextStyle, textStyleCaseCss, textStyleCaseOfCss, textStyleRowSize, updateTextStyle, weightWord } from './model.js';
5
- export { D as DEFAULT_TEXT_STYLES_WORDS, T as TextStylesWords } from '../words-gIDCeRv3.js';
5
+ export { D as DEFAULT_TEXT_STYLES_WORDS, T as TextStylesWords } from '../words-B5Gb7KFq.js';
6
6
 
7
7
  interface TextStylesListProps {
8
8
  /** Headings and bodies, in the host's order; the list draws headings first. */
@@ -67,7 +67,7 @@ interface TextStylesListProps {
67
67
  * Playfair Display · 40 px · … the grey line under it
68
68
  * + Add heading 3 / 7 grey at 7
69
69
  *
70
- * A style opens to a one-line preview, Font, Color (the theme's colours and
70
+ * A style opens to a one-line preview, Font, Color (theme's colours and
71
71
  * Any color, which opens the pickers' window), sliders (E4's FieldSlider) and
72
72
  * Letter case. What is on offer is the host's: `settings`, `auto`.
73
73
  *
@@ -130,7 +130,7 @@ interface ColourSwatchRowProps {
130
130
  readOnly?: boolean;
131
131
  }
132
132
  /**
133
- * THE COLOR ROW — the theme's colours in a row, then Any color, which opens
133
+ * THE COLOR ROW — theme's colours in a row, then Any color, which opens
134
134
  * the one colour window (`ColourWindow`, the shell's `ColorPickerPanel`).
135
135
  * Exported so a second host draws the same row instead of a copy (plan S2:
136
136
  * the website's part panel; design final 2026-10-06). The text-styles list
@@ -1,4 +1,4 @@
1
- import { T as TextStylesWords } from '../words-gIDCeRv3.js';
1
+ import { T as TextStylesWords } from '../words-B5Gb7KFq.js';
2
2
 
3
3
  /**
4
4
  * The text styles as data (plan step E6): what a style is, the list both
@@ -238,7 +238,7 @@ interface CustomFieldDef extends FieldMeta {
238
238
  type InspectorFieldDef = TextFieldDef | TextareaFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | ObjectFieldDef | ArrayFieldDef | SlotFieldDef | CustomFieldDef;
239
239
  type InspectorFields = Record<string, InspectorFieldDef>;
240
240
  /**
241
- * What a custom render is called with: the old editor's own six props, so every custom
241
+ * What a custom render is called with: the old library's own six props, so every custom
242
242
  * field both apps wrote keeps working unchanged, plus what the host hands in as
243
243
  * `context` (the node, the root, the device — blueprint §3.1).
244
244
  */
@@ -251,7 +251,7 @@ interface CustomFieldRenderProps<V = any> {
251
251
  readOnly?: boolean;
252
252
  [context: string]: unknown;
253
253
  }
254
- /** A field type's own drawing, swapped in by the host (e.g. The old editor's array until 4.5). */
254
+ /** A field type's own drawing, swapped in by the host (e.g. The old library's array until 4.5). */
255
255
  type FieldRenderer = (props: {
256
256
  field: InspectorFieldDef;
257
257
  name: string;
@@ -1,9 +1,9 @@
1
1
  import { DataInput } from './data/index.js';
2
- import { I as ItemSelector, N as NodeSelection } from './plan-CRUh2kVK.js';
3
- import { D as Data, S as SlotAddress, a as DataConfig, N as Node } from './types-DlQIM1YO.js';
2
+ import { I as ItemSelector, N as NodeSelection } from './plan-D0DgSLnY.js';
3
+ import { D as Data, S as SlotAddress, a as DataConfig, N as Node } from './types-Dq180WRV.js';
4
4
 
5
5
  /**
6
- * The easel's UI state, in the old editor's shape so the apps' `appState.ui` reads move
6
+ * The easel's UI state, in the old library's shape so the apps' `appState.ui` reads move
7
7
  * over unchanged. `itemSelector` and `selectedSlot` are DERIVED from the
8
8
  * selection the store holds by id; every other key is the host's own and is
9
9
  * kept as written.
@@ -12,14 +12,14 @@ type EaselUi = Record<string, unknown> & {
12
12
  itemSelector: ItemSelector | null;
13
13
  /** The selected slot (a column), when a slot rather than a node is selected. */
14
14
  selectedSlot: SlotAddress | null;
15
- /** The old editor's own UI keys, which a host's chrome reads and writes (`setUi`).
16
- * They start at the old editor's defaults (`DEFAULT_UI`). */
15
+ /** The old library's own UI keys, which a host's chrome reads and writes (`setUi`).
16
+ * They start at the old library's defaults (`DEFAULT_UI`). */
17
17
  leftSideBarVisible: boolean;
18
18
  rightSideBarVisible: boolean;
19
19
  previewMode: 'edit' | 'interactive';
20
20
  isDragging: boolean;
21
21
  };
22
- /** The old editor's public `appState`. */
22
+ /** The old library's public `appState`. */
23
23
  interface AppState {
24
24
  data: Data;
25
25
  ui: EaselUi;
@@ -28,15 +28,15 @@ type Recordable = {
28
28
  recordHistory?: boolean;
29
29
  };
30
30
  /** What `setData` merges in: part of the document — in this package's shape,
31
- * or in the old editor's looser one (`root.props` optional), which the apps' documents
32
- * are typed as and `the old editor root` accepted. */
31
+ * or in the old library's looser one (`root.props` optional), which the apps' documents
32
+ * are typed as and the old library's root component accepted. */
33
33
  type SetDataPatch = Partial<Data> | DataInput;
34
34
  /**
35
- * The actions the apps dispatch today — the old editor's, with its meaning. Zone
35
+ * The actions the apps dispatch today — the old library's, with its meaning. Zone
36
36
  * keys are `"<parentId>:<slot>"`; `root:default-zone` is the page's own list.
37
37
  *
38
38
  * `insert` puts the block in with its `defaultProps` and runs NO resolver, as
39
- * The old editor's reducer did not. What ran a new block's `resolveData` in the old editor was its
39
+ * The old library's reducer did not. What ran a new block's `resolveData` in the old library was its
40
40
  * own drop from the component list; here that is `easel.resolveNode(id, {
41
41
  * trigger: 'insert' })`, called by the host after the insert (pass the action
42
42
  * an `id` so there is one to name).
@@ -87,7 +87,7 @@ type EaselAction = ({
87
87
  index: number;
88
88
  zone: string;
89
89
  } & Recordable);
90
- /** What a block, the root or the whole easel allows. The old editor's five. */
90
+ /** What a block, the root or the whole easel allows. The old library's five. */
91
91
  interface Permissions {
92
92
  drag: boolean;
93
93
  duplicate: boolean;
@@ -97,7 +97,7 @@ interface Permissions {
97
97
  [key: string]: boolean;
98
98
  }
99
99
  /** The config the store needs: the data layer's shape, plus each block's own
100
- * `permissions` (the old editor's per-component permissions). Rendering keys are the
100
+ * `permissions` (the old library's per-component permissions). Rendering keys are the
101
101
  * renderer's business and pass through untouched. */
102
102
  interface EaselConfig extends DataConfig {
103
103
  root?: DataConfig['root'] & {
@@ -114,12 +114,12 @@ interface EaselCore {
114
114
  /** The host's own UI keys — everything but `itemSelector` / `selectedSlot`. */
115
115
  ui: Record<string, unknown>;
116
116
  }
117
- /** One undo step: the whole state, as the old editor's history holds the whole app state. */
117
+ /** One undo step: the whole state, as the old library's history holds the whole app state. */
118
118
  interface HistoryEntry {
119
119
  id: string;
120
120
  state: AppState;
121
121
  }
122
- /** The old editor's PUBLIC `history` (what the old store hook hands out): `hasPast` and
122
+ /** The old library's PUBLIC `history` (what the old store hook hands out): `hasPast` and
123
123
  * `hasFuture` are booleans there, read at the state they came with. */
124
124
  interface EaselHistory {
125
125
  back: () => void;
@@ -128,14 +128,14 @@ interface EaselHistory {
128
128
  hasFuture: boolean;
129
129
  histories: HistoryEntry[];
130
130
  index: number;
131
- /** Go straight to one step (the old editor's `setHistoryIndex`). */
131
+ /** Go straight to one step (the old library's `setHistoryIndex`). */
132
132
  setHistoryIndex: (index: number) => void;
133
133
  }
134
134
  /**
135
135
  * What `useEasel` reads — the old store hook's state, so the apps' selectors move
136
136
  * over by renaming the hook: `appState`, `selectedItem`, `dispatch`, `config`,
137
137
  * `history`, `getPermissions`, `getItemById`, `getSelectorForId`. Plus the
138
- * selection by id (`selection`), which the old editor never had.
138
+ * selection by id (`selection`), which the old library never had.
139
139
  */
140
140
  interface EaselView<C extends EaselConfig = EaselConfig> {
141
141
  appState: AppState;
@@ -151,7 +151,7 @@ interface EaselView<C extends EaselConfig = EaselConfig> {
151
151
  }) => Permissions;
152
152
  getItemById: (id: string) => Node | undefined;
153
153
  getItemBySelector: (selector: ItemSelector) => Node | undefined;
154
- /** The old editor's: the node's place, its zone always named. Never throws — the old editor's
154
+ /** The old library's: the node's place, its zone always named. Never throws — the old library's
155
155
  * did, across a data swap, which the website editor wrapped. */
156
156
  getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
157
157
  }
@@ -1,23 +1,23 @@
1
1
  /**
2
2
  * The document, and the smallest slice of a block config the data layer reads.
3
3
  *
4
- * THE DOCUMENT IS THE OLD EDITOR'S, BYTE FOR BYTE. Every campaign and every page already
4
+ * THE DOCUMENT IS THE OLD LIBRARY'S, BYTE FOR BYTE. Every campaign and every page already
5
5
  * saved is a Puck 0.20 `Data` object, and the backend reads it too (campaign
6
6
  * copy, coupon deadlines, the assistant's knowledge tool, the media and
7
7
  * neutralization manifests). So the engine keeps that exact shape — no version
8
- * key, no wrapper, no rename — and nothing saved needs to migrate when the old editor goes.
8
+ * key, no wrapper, no rename — and nothing saved needs to migrate when the old library goes.
9
9
  *
10
10
  * { root: { props }, content: Node[], zones: {} }
11
11
  *
12
12
  * A node's children live INLINE in one of its props, under a field whose
13
- * `type` is `"slot"`. `zones` is the old editor's older DropZone store: neither editor
13
+ * `type` is `"slot"`. `zones` is the old library's older DropZone store: neither editor
14
14
  * writes it, so it is `{}` on every document, and it is kept that way on save.
15
15
  */
16
16
  /** One block in the document. `props.id` is `<Type>-<uuid>`. */
17
17
  interface Node {
18
18
  type: string;
19
19
  props: NodeProps;
20
- /** The old editor's per-prop read-only map. Carried through untouched. */
20
+ /** The old library's per-prop read-only map. Carried through untouched. */
21
21
  readOnly?: Record<string, boolean>;
22
22
  }
23
23
  interface NodeProps {
@@ -40,7 +40,7 @@ interface Data {
40
40
  *
41
41
  * The top-level list is `{ parentId: 'root', slot: 'default-zone' }`, and a
42
42
  * slot is named by its PROP PATH (`col1`, `items[0].content`) — the same two
43
- * halves as the old editor's zone key `"<parentId>:<slot>"`, so an app that still speaks
43
+ * halves as the old library's zone key `"<parentId>:<slot>"`, so an app that still speaks
44
44
  * zone keys converts with `zoneKey` / `parseZoneKey`.
45
45
  */
46
46
  interface SlotAddress {
@@ -53,7 +53,7 @@ interface Place extends SlotAddress {
53
53
  /**
54
54
  * The part of a field definition the data layer needs: which props are slots,
55
55
  * and (./translate) which hold words that are written again per language.
56
- * A the old editor `Field` satisfies it, so an app hands in the config it already has.
56
+ * An old-library `Field` satisfies it, so an app hands in the config it already has.
57
57
  */
58
58
  interface FieldShape {
59
59
  type: string;
@@ -68,7 +68,7 @@ interface FieldShape {
68
68
  }
69
69
  type FieldsShape = Record<string, FieldShape>;
70
70
  /**
71
- * `fields` and `defaultProps` are typed as ANY OBJECT on purpose. A the old editor config
71
+ * `fields` and `defaultProps` are typed as ANY OBJECT on purpose. An old-library config
72
72
  * typed with its blocks' own props (`Config<{ Heading: HeadingProps }>`) carries
73
73
  * `Fields<HeadingProps>` and `HeadingProps`, which no shared shape can name, and
74
74
  * an app must be able to hand in the config it has. The data layer reads only
@@ -80,7 +80,7 @@ interface BlockShape {
80
80
  defaultProps?: object;
81
81
  }
82
82
  /**
83
- * The config as the data layer sees it. A the old editor `Config` satisfies it: only
83
+ * The config as the data layer sees it. An old-library `Config` satisfies it: only
84
84
  * `components[type].fields` / `.defaultProps` and `root.fields` /
85
85
  * `.defaultProps` are ever read. A type missing from `components` has no slots
86
86
  * and is kept verbatim — never dropped — so content can land before its code.
@@ -1,5 +1,5 @@
1
- import { N as Node, S as SlotAddress, D as Data, a as DataConfig, P as Place } from './types-DlQIM1YO.js';
2
- import { N as NodeSelection, A as AfterRemove, S as StepBounds } from './plan-CRUh2kVK.js';
1
+ import { N as Node, S as SlotAddress, D as Data, a as DataConfig, P as Place } from './types-Dq180WRV.js';
2
+ import { N as NodeSelection, A as AfterRemove, S as StepBounds } from './plan-D0DgSLnY.js';
3
3
 
4
4
  /**
5
5
  * The node clipboard — what Copy and Cut hold, and Paste reads.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Finding the canvas frame and its document — ONCE, with no polling.
3
3
  *
4
- * Both editors draw the canvas inside an iframe (today the old editor's
4
+ * Both editors draw the canvas inside an iframe (today the old library's
5
5
  * `<iframe id="preview-frame">`; later the engine's own CanvasFrame). The frame
6
6
  * gives no "ready" callback, its document arrives ASYNCHRONOUSLY (a srcdoc
7
7
  * frame starts on an empty about:blank document and swaps to the real one on
@@ -24,11 +24,11 @@ interface CanvasTarget {
24
24
  window: Window;
25
25
  }
26
26
  interface WatchOptions {
27
- /** How the frame is found under `root`. The old editor's canvas is the default. */
27
+ /** How the frame is found under `root`. The old library's canvas is the default. */
28
28
  selector?: string;
29
29
  /**
30
30
  * Publish the frame only once its document holds an element matching this.
31
- * A loaded frame can still be EMPTY — the old editor portals the blocks in after
31
+ * A loaded frame can still be EMPTY — the old library portals the blocks in after
32
32
  * `load` — and a measurement taken then measures nothing. For the editor's
33
33
  * canvas pass `BLOCK_SELECTOR`. Watched with a MutationObserver on the frame's
34
34
  * document, never polled.
@@ -95,7 +95,7 @@ type TextStylesWords = {
95
95
  lower: string;
96
96
  };
97
97
  colour: {
98
- /** The rainbow swatch at the end of the theme's colours. */
98
+ /** The rainbow swatch at the end of theme's colours. */
99
99
  any: string;
100
100
  /** What the Color row reads while the style has no colour of its own. */
101
101
  follows: string;
@@ -38,12 +38,12 @@ type CopyWords = {
38
38
  * (E5a). Optional, so a host's words from before still type; English when
39
39
  * left out. */
40
40
  showMarks?: string;
41
- /** The colour window: its name, the theme row's label, and Remove. */
41
+ /** The colour window: its name, theme row's label, and Remove. */
42
42
  colors?: {
43
43
  title: string;
44
44
  theme: string;
45
45
  remove: string;
46
- /** "Any color": the square, the hue bar and the hex box under the theme. */
46
+ /** "Any color": the square, the hue bar and the hex box under theme. */
47
47
  any: string;
48
48
  square: string;
49
49
  hue: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "22.0.0",
3
+ "version": "23.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",
@@ -1 +0,0 @@
1
- import{useEaselSession as e}from"./chunk-YM4UEGBV.js";import{useHostEscape as n}from"./chunk-MQA7OFRA.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-EB6NI2VK.js";import{styleMenuItems as o}from"./chunk-V7U33NF2.js";import{ROOT_ZONE as l}from"./chunk-TCAAOYQY.js";import{easelMenuEntries as r,menuLabel as i}from"./chunk-FIVU2COQ.js";import{createNodeClipboard as c,nodeMenuItems as s}from"./chunk-P5VYGWYO.js";import{DEFAULT_NODE_MENU_WORDS as a}from"./chunk-WK3AFPXY.js";import{isTypingTarget as u,useCanvasEvent as d,framePointToHost as p}from"./chunk-GHBK7BKL.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as h}from"./chunk-K7BTCBWD.js";import{useState as y,useCallback as k,useRef as b,useEffect as g}from"react";import{ContextMenu as v}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,PasteIcon as C,SettingsIcon as O,LayersIcon as z,CopyIcon as A}from"efficient-shell/icons/efficient";import{jsx as P}from"react/jsx-runtime";function K(e,n){const t=[],o=/* @__PURE__ */new Set;let r={zone:n.zone,index:n.index};for(;r;){const n=e.nodeAt(r.zone,r.index);if(!n||o.has(n.props.id))break;if(o.add(n.props.id),t.push({zone:r.zone,index:r.index,node:n,parentType:null}),r.zone===l)break;const i=r.zone.lastIndexOf(":");if(i<=0)break;r=e.locate(r.zone.slice(0,i))}for(let e=0;e<t.length-1;e+=1)t[e].parentType=t[e+1].node.type;return t}var j=c(),B=/* @__PURE__ */new WeakMap;function D(e){if(e.claimsPage)return j;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",c);let t=B.get(n);return t||(t=c(),B.set(n,t)),t}function M(){return D(e())}function T(e,n,t){if(n===l){const{floor:n,cap:o}=e.sectionBand();return{parentId:h,slot:m,index:Math.min(Math.max(t,n),o)}}const o=n.lastIndexOf(":");return{parentId:n.slice(0,o),slot:n.slice(o+1),index:t}}function Y(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function E(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?T(e,t.zone,t.index+1):null;for(const l of K(e,t)){const t=T(e,l.zone,l.index+1);if(o(n,t))return t}return null}function I(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(u(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function S(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=Y(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:E(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function V(e,n){const{zone:t,index:r}=n,i=e.nodeAt(t,r);if(!i)return[];const c=i.props.id,a=e.labelOf(i.type,t),u=Boolean(i.props._hidden),d=e.nodeOps,p=e.isPinned(i,t),f=e.isLocked(i),m=!p&&!f&&!e.duplicateBlocked(i),h=e.permits?.(i)??{duplicate:!0,delete:!0},y=Y(e,i,t),k=K(e,n),b=d.held,g=b&&!p?E(e,b,n):null,v=!e.readOnly,w=e.style?o({held:v?e.style.held():null,canCopy:e.style.canCopy(i,t),onCopy:()=>e.style?.copy(i,t),onPaste:()=>e.style?.paste(t,r,i),words:e.words?.styleClipboard}):[];return s({title:a,words:e.words?.menu,layer:{group:"pick",items:k.flatMap((n,t)=>{const o={label:e.rowNameOf(n.node,n.zone),checked:0===t,onClick:()=>e.selectAt(n.zone,n.index,n.node.props.id,n.parentType)},r=n.zone===l?null:e.slotRung?.(n.zone)??null;return r?[o,{label:r.label,checked:!1,onClick:r.select}]:[o]})},actions:{duplicate:v&&m&&h.duplicate?()=>d.duplicate(c):void 0,...L(v&&!p,e=>d.canStep(c,e),e=>d.step(c,e)),copy:y.copy?()=>d.copy(c,a):void 0,cut:v&&y.cut?()=>d.cut(c,a):void 0,paste:v&&b&&g?{label:b.label,run:()=>d.paste(g)}:void 0,rename:v&&e.renamePropOf(i,t)?()=>e.beginRename(t,r):void 0,hide:!v||f||p?void 0:{hidden:u,run:()=>d.setProps(c,{_hidden:!u})},delete:v&&m&&h.delete?()=>d.remove(c):void 0},style:w,extras:e.menuRows?.(i,t,r)??void 0,pinnedLine:p?R(e).pinned:void 0})}function L(e,n,t){return e?{moveUp:n(-1)?()=>t(-1):null,moveDown:n(1)?()=>t(1):null}:{}}var R=e=>e.words?.screen??t.menu;function X(e){const n=R(e),o=!e.readOnly,r=[];o&&e.history.hasPast&&r.push({label:n.undo,icon:/* @__PURE__ */P(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&r.push({label:n.redo,icon:/* @__PURE__ */P(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const i=[],c=e.nodeOps.held,s=T(e,l,e.sectionBand().cap);if(o&&c&&(e.canPasteAt?e.canPasteAt(c,s):f(c.from)===l)){const n=s,t=e.words?.menu??a;i.push({label:t.pasteNamed({paste:t.paste,label:c.label}),icon:/* @__PURE__ */P(C,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[r,i,[{label:e.pageSettingsLabel??t.pageSettings,icon:/* @__PURE__ */P(O,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */P(z,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function N(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},i=e.words?.menu??a,c=R(e),s=[];l&&(s.push({label:i.copy,icon:/* @__PURE__ */P(A,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),s.push({label:i.cut,icon:/* @__PURE__ */P(A,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),s.push({label:i.paste,icon:/* @__PURE__ */P(C,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const u=[s,n.value?[{label:c.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function U(e){return e.shiftKey}function F(e,t){const[o,l]=y(null),r=k(()=>l(null),[]);n(null!==o,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=I(e);if(!o)return;const l=t.selected();if(!l)return;const r=S(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;g(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),d(t,"keydown",c);const a=k(n=>{if(U(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);d(t,"contextmenu",n=>{if(U(n)||!t)return;const o=n.target?.closest?.("[data-easel-block]")??null,r=o?.getAttribute("data-easel-block"),i=r?e.locate(r):null;n.preventDefault();const c=p(t.frame,n.clientX,n.clientY),s=t.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),d(t,"mousedown",r),d(t,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:o?/* @__PURE__ */P(W,{host:e,target:o,onClose:r}):null,closeMenu:r}}function W({host:e,target:n,onClose:t}){const o="node"===n.kind?V(e,n):"input"===n.kind?N(e,n.el):X(e);return 0===o.length?null:/* @__PURE__ */P(v,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":i(o),items:r(o)})}export{j as EASEL_NODE_CLIPBOARD,K as ancestorChain,D as nodeClipboardOf,Y as nodeClipboardRules,V as nodeMenuItems,I as nodeShortcut,X as pageMenuItems,E as pastePlace,S as runNodeShortcut,N as textMenuItems,M as useNodeClipboard,F as useNodeContextMenu};
@@ -1 +0,0 @@
1
- import{newNodeId as t}from"./chunk-TCAAOYQY.js";function o(t){return{root:{props:{}},content:[t],zones:{}}}function r(t){return(t.content??[])[0]??null}function n(t){return Array.isArray(t)&&t.length>0&&t.every(t=>!!t&&"object"==typeof t&&"string"==typeof t.type&&"object"==typeof t.props)}function e(o,r){const p={...o.props,id:t(o.type)};for(const[t,o]of Object.entries(p))n(o)&&(p[t]=o.map(t=>e(t,r)));const s={type:o.type,props:p};if(!r)return s;const c=r(s);return{...c,props:{...c.props,id:p.id}}}export{e as cloneNodeWithFreshIds,r as docToNode,o as nodeToDoc};
@@ -1 +0,0 @@
1
- var t=t=>"object"==typeof t&&null!==t&&!Array.isArray(t);function o(o){return t(o)&&"string"==typeof o.type&&""!==o.type&&t(o.props)}function r(r,e,f){if(Array.isArray(r))for(const s of r)o(s)?n(s,e,f):t(s)&&"string"==typeof s.type&&""!==s.type&&e.add(s.type)}function e(r,f,s){if(Array.isArray(r)){if(s.has(r))return;s.add(r);for(const t of r)o(t)?n(t,f,s):e(t,f,s)}else if(t(r)&&!s.has(r)){s.add(r);for(const t of Object.values(r))e(t,f,s)}}function n(t,o,r){if(!r.has(t)){r.add(t),o.add(t.type);for(const n of Object.values(t.props))e(n,o,r)}}function f(f){const s=/* @__PURE__ */new Set,a=/* @__PURE__ */new Set;if(o(f))n(f,s,a);else if(t(f)){if(r(f.content,s,a),t(f.zones))for(const t of Object.values(f.zones))r(t,s,a);t(f.root)&&e(f.root,s,a)}return[...s].sort()}export{f as blockTypesIn};
@@ -1,18 +0,0 @@
1
- import{DEFAULT_DRAG_WORDS as e}from"./chunk-TQ5Y6S2X.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as a,isNoOpDrop as r}from"./chunk-3S5N4HLJ.js";import{withTip as o}from"./chunk-P2VEMZH5.js";import{useCanvasLayout as s,useCanvasTyping as i,useCanvasEvent as c,CANVAS_TYPABLE_EVENT as d,framePointToHost as u,elementScale as h,frameRectToLayer as f,clientPointToLayer as p}from"./chunk-GHBK7BKL.js";import{isRepeatCopy as m}from"./chunk-LF3FUSCQ.js";import{parseZoneKey as g,ROOT_ID as b}from"./chunk-K7BTCBWD.js";import{useRef as x,useEffect as y,useState as v,useCallback as w,useMemo as k,useSyncExternalStore as N,useId as D,useLayoutEffect as A}from"react";import{Tooltip as z,IconButton as T,solidSurfaceStyle as M,Input as C,ItemCount as S}from"efficient-shell/ui";import{AddIcon as $,CloseIcon as B,SearchIcon as E}from"efficient-shell/icons/efficient";import{jsxs as L,jsx as j}from"react/jsx-runtime";function K({label:e,onInsert:t,style:n,axis:l="y",className:a,index:r}){const o=["es-canvas-insert","x"===l?"is-x":"",a??""].filter(Boolean).join(" ");/* @__PURE__ */
2
- return L("div",{className:o,style:n,"data-index":r,children:[
3
- /* @__PURE__ */j("span",{className:"es-canvas-insert-line","aria-hidden":"true"}),
4
- /* @__PURE__ */j("span",{className:"es-canvas-insert-chip",children:/* @__PURE__ */j(z,{content:e,children:/* @__PURE__ */j(T,{variant:"ghost",size:"sm","aria-label":e,onClick:t,children:/* @__PURE__ */j($,{})})})})]})}var O=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,I=e=>e.width*e.height;function q(e,t,n){return e.map((e,t)=>({s:e,at:t})).filter(({s:e})=>O(e.box,t,n)).sort((e,t)=>I(t.s.box)-I(e.s.box)||e.at-t.at).map(({s:e})=>e)}function X(e,t,n){return q(e,t,n).at(-1)??null}function Y(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 H(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,o=a??l??e.box;return{left:r-1,top:o.top,width:2,height:o.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 F(e,t,n,l,a=()=>!1,r=()=>!0){const o=e.filter(e=>O(e.box,t,n)).sort((e,t)=>I(e.box)-I(t.box));for(const e of o){const o=Y(e,t,n),s={...e.list,index:o};if(a(s))return null;if(l(s))return{zone:e,to:s,line:H(e,o)};if(!r(s))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,o=r?a.left:a.top,s=o+(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 a=0;a<=l.length;a++){const u=l[a-1],h=l[a];let f,p;if(u&&h)f=c(u),p=Math.max(i(h)-f,0);else{const e=u?(c(u)+s)/2:(o+i(h))/2,t=Math.min(Math.max(e,o+n),s-n);f=u?Math.max(t,c(u)):Math.min(t,i(h)),p=0}const m=[u,h].filter(e=>Boolean(e)),g=Math.min(...m.map(e=>r?e.top:e.left)),b=Math.max(...m.map(e=>r?e.top+e.height:e.left+e.width)),x=r?{left:f,top:g,width:p,height:b-g}:{left:g,top:f,width:b-g,height:p};d.push({key:`${e.key}:+${a}`,place:{...e.list,index:a},box:x,axis:e.axis,label:t})}return d}function Z(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],o=a.top+a.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:o,width:e.box.width,height:Math.max(r.top-o,0)}})}return n}var Q={nodes:[],zones:[]},R="data-easel-dropzone",V="data-easel-block";function W(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 G(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=[],o=[];for(const e of l.querySelectorAll(`[${R}]`)){if(m(e))continue;const t=e.getAttribute(R)??"";let n;try{n=g(t)}catch{continue}const l=[...e.querySelectorAll(`[${V}]`)].filter(t=>t.parentElement?.closest(`[${R}]`)===e&&!m(t)),s=l.map(a);o.push({key:t,list:n,box:a(e),axis:W(s,e),children:s}),l.forEach((e,t)=>{const l=e.getAttribute(V);l&&r.push({id:l,place:{...n,index:t},box:s[t]})})}return{nodes:r,zones:o}}var J="data-es-empty-cell",U="data-easel-dropzone",_=140;var ee=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function te(o){const{canvas:f,session:m,readOnly:g,words:D=e.canvas}=o,T=x(o);y(()=>{T.current=o});const C=x(null),S=s(f),[$,B]=v(0),E=w(()=>B(e=>e+1),[]),[O,I]=v(Q);y(()=>{const e=C.current;f&&e&&I((T.current.measure??G)(f,e))},[f,S,o.revision,$]);const X=o.model,Y=k(()=>X(O),[X,O]),H=N(m.subscribe,m.shown,m.shown),P=o.choose,Z=(e,t)=>{const n=q(Y.sources,e,t);return 0===n.length?null:P?P(n):n[n.length-1]},[R,V]=v(null),[W,_]=v(null),[te,ne]=v(null),le=x(null),ae=()=>{le.current&&clearTimeout(le.current),le.current=null},re=()=>{ae(),le.current=setTimeout(()=>{m.get()||V(null)},140)};y(()=>ae,[]);const oe=x(null),se=i(f),ie=x(!1);ie.current=se,y(()=>{se&&(ae(),V(null))},[se]);const[ce,de]=v(null);c(f,d,e=>de(e.detail?.id??null));const ue=!ce||se||g||H?null:O.nodes.find(e=>e.id===ce)?.box??null;c(f,"mousemove",e=>{const t=C.current;if(!f||!t)return;const n=u(f.frame,e.clientX,e.clientY,t),l=h(t),a={x:n.x/l,y:n.y/l};if(oe.current=a,T.current.readOnly||m.get()||ie.current)return;ae();const r=Z(a.x,a.y);V(e=>e?.key===r?.key&&e?.box===r?.box?e:r)}),c(f,"mouseout",e=>{e.relatedTarget||(oe.current=null,re())}),c(f,"mouseover",e=>{e.relatedTarget||E()});const he=x(null),fe=w(()=>{he.current?.(),he.current=null,_(null),ne(null)},[]);y(()=>m.subscribe(()=>{m.get()?E():fe()}),[m,fe,E]),y(()=>fe,[fe]),("undefined"==typeof document?y:A)(()=>{if(m.get())return;const e=oe.current;V(t=>g||ie.current?null:e?Z(e.x,e.y):t?Y.sources.find(e=>e.key===t.key)??null:null)},[Y,H,m,g,P]);const pe=e=>{const t=m.get(),n=C.current,l=T.current.dropOn;if(!t||!n||!l)return null;const a=p(n,e.clientX,e.clientY);oe.current=a;const r=q(Y.sources,a.x,a.y);for(let e=r.length-1;e>=0;e-=1)if(l.accepts(t.item,r[e]))return{h:t,source:r[e]};return null},me=e=>{const t=m.get(),n=C.current;if(!t||!n)return null;const l=p(n,e.clientX,e.clientY);oe.current=l;const a=F(Y.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},ge={onDragEnter:e=>{if(he.current)return;const t=n(e.currentTarget.parentElement?.parentElement??null),r=f?l(f.document):null,o=[];t&&o.push(a(t)),r&&f&&o.push(a(r,f.frame)),he.current=o.length?()=>o.forEach(e=>e()):null},onDragOver:e=>{const n=pe(e);if(n)return e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed),_(null),void ne(e=>e&&e.key===n.source.key&&e.box===n.source.box?e:n.source);ne(null);const l=me(e);if(!l)return void _(null);e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed);const a={zoneKey:l.t.zone.key,line:l.t.line,axis:l.t.zone.axis};_(e=>e&&e.zoneKey===a.zoneKey&&e.line.left===a.line.left&&e.line.top===a.line.top?e:a)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||(oe.current=null,_(null),ne(null))},onDrop:e=>{const t=pe(e);if(t)return e.preventDefault(),m.end(),fe(),void T.current.dropOn.onDrop(t.h.item,t.source);const n=me(e);n&&(e.preventDefault(),m.end(),fe(),T.current.onDrop(n.h.item,n.t.to))}},be={draggable:!g&&!!R,onMouseEnter:ae,onMouseLeave:()=>!m.get()&&re(),onDragStart:e=>{if(R&&!g){m.start({key:R.key,item:R.item,from:R.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",R.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{m.end(),fe()},onClick:()=>{R&&!g&&T.current.onPick?.(R.item)}},{seams:xe=[]}=Y,ye=Y.zones.filter(e=>0===e.children.length),ve=!o.onZoneAdd||g||se?[]:ye,we=ve.map(e=>e.key).join("\n");return y(()=>{const e=f?.document;if(!e)return;const t=new Set(we?we.split("\n"):[]);for(const n of e.querySelectorAll(`[${U}]`))n.toggleAttribute(J,t.has(n.getAttribute(U)??""));return()=>{for(const t of e.querySelectorAll(`[${J}]`))t.removeAttribute(J)}},[f,we,O,S,$]),/* @__PURE__ */L("div",{ref:C,className:"es-canvas-layer",children:[H||!o.onSeamAdd||g||se?null:xe.map(e=>
5
- /* @__PURE__ */j(K,{className:"es-canvas-seam",axis:e.axis,index:e.place.index,label:e.label??o.seamLabel??D.addSection,onInsert:()=>o.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)),ve.length?ve.map(e=>/* @__PURE__ */j("button",{type:"button",className:["es-canvas-empty",e.addAlways?"is-always":"",W?.zoneKey===e.key?"is-over":""].filter(Boolean).join(" "),style:ee(e.box),"data-node-id":e.list.parentId===b?void 0:e.list.parentId,onClick:()=>o.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */j("span",{className:"es-canvas-empty-add",children:D.addButton({label:e.addLabel??o.zoneAddLabel??D.addBlock})})},e.key)):null,H?/* @__PURE__ */j("div",{className:"es-canvas-catch",...ge}):null,te&&H?/* @__PURE__ */j("div",{className:"es-canvas-target",style:ee(te.box),children:o.dropOn?.label?/* @__PURE__ */j("span",{className:"es-canvas-target-label",style:M(),children:o.dropOn.label(H.item,te)}):null}):null,W&&!ye.some(e=>e.key===W.zoneKey)?/* @__PURE__ */j("div",{className:`es-canvas-line is-${W.axis}`,style:ee(W.line)}):null,ue?/* @__PURE__ */j("span",{className:"es-canvas-hint"+(ue.width<200?" is-below":""),style:{...M(),left:ue.left+ue.width,top:ue.width<200?ue.top+ue.height:ue.top},children:D.typeHint}):null,
6
- /* @__PURE__ */j("div",{className:"es-canvas-handle-spot",style:R?{"--es-handle-x":`${R.box.left+2}px`,"--es-handle-y":`${Math.max(R.box.top-11,0)}px`}:void 0,children:/* @__PURE__ */j(z,{className:"es-canvas-handle-tip",side:"top",content:!R||g||H?null:R.title??D.handle({label:R.label}),children:/* @__PURE__ */L("div",{className:["es-canvas-handle",R&&!g?"is-shown":"",H?"is-dragging":""].filter(Boolean).join(" "),...be,children:[
7
- /* @__PURE__ */j("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),R?.label]})})})]})}var ne=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function le({groups:t,session:n,itemFor:l,onInsert:a,onTileMenu:r,at:s,hint:i,searchLabel:c,readOnly:d,words:u=e.add}){const h=i??u.hint,f=c??u.search,[p,m]=v(""),g=D(),b=p.trim().toLowerCase(),x=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:x[t],tiles:b?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,b)):e.tiles})).filter(e=>e.tiles.length>0),w=(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 L("div",{className:"es-add",children:[s?/* @__PURE__ */L("div",{className:"es-add-at",role:"status",children:[
9
- /* @__PURE__ */j("span",{children:s.label}),o(u.stop,/* @__PURE__ */j("button",{type:"button",className:"es-add-at-clear","aria-label":u.stop,onClick:s.onClear,children:/* @__PURE__ */j(B,{size:12,"aria-hidden":"true"})}))]}):null,
10
- /* @__PURE__ */j("p",{className:"es-add-hint",children:h}),
11
- /* @__PURE__ */j("div",{className:"es-add-find",children:/* @__PURE__ */j(C,{id:g,type:"search","aria-label":f,placeholder:u.searchPlaceholder({label:f}),value:p,onChange:e=>m(e.target.value),leftIcon:/* @__PURE__ */j(E,{size:16,"aria-hidden":"true"}),rightAdornment:p?/* @__PURE__ */j(T,{size:"sm","aria-label":u.clearSearch,onClick:()=>m(""),children:/* @__PURE__ */j(B,{size:12,"aria-hidden":"true"})}):void 0})}),0===y.length?/* @__PURE__ */L("div",{className:"es-add-empty",role:"status",children:[
12
- /* @__PURE__ */j("div",{className:"es-add-empty-title",children:u.nothing({query:p.trim()})}),
13
- /* @__PURE__ */j("div",{className:"es-add-empty-sub",children:u.tryAnother})]}):y.map(e=>/* @__PURE__ */L("section",{className:"es-add-group","aria-label":e.title,children:[
14
- /* @__PURE__ */L("div",{className:"es-add-group-head",children:[
15
- /* @__PURE__ */j("span",{className:"es-add-group-title",children:e.title}),
16
- /* @__PURE__ */j(S,{count:e.tiles.length,label:u.count({count:e.tiles.length,sections:ne(e)}),className:"ml-auto"})]}),
17
- /* @__PURE__ */j("div",{className:ne(e)?"es-add-grid is-cards":"es-add-grid",children:e.tiles.map(e=>{const t=Boolean(d||e.disabled),l=d?void 0:e.disabled?e.disabledReason:e.title??u.tile({label:e.label});return o(l,/* @__PURE__ */L("button",{type:"button",className:null!=e.cover?"es-add-tile has-cover":"es-add-tile",draggable:!t,"aria-disabled":t||void 0,"aria-label":u.tile({label:e.label}),onDragStart:w(e.type,t),onDragEnd:()=>n.end(),onClick:()=>!t&&a?.(e.type),onContextMenu:r?t=>{r(e.type,{x:t.clientX,y:t.clientY,owner:t.currentTarget})&&t.preventDefault()}:void 0,children:[null!=e.cover?/* @__PURE__ */j("span",{className:"es-add-tile-cover","aria-hidden":"true",children:e.cover}):e.icon?/* @__PURE__ */j("span",{className:"es-add-tile-glyph","aria-hidden":"true",children:e.icon}):null,
18
- /* @__PURE__ */L("span",{className:"es-add-tile-label",children:[e.label,null!=e.mark?/* @__PURE__ */j("span",{className:"es-add-tile-mark","aria-hidden":"true",children:e.mark}):null]})]},e.type))})})]},e.key))]})}export{le as AddPanel,te as CanvasDragLayer,K as CanvasInsert,Q as EMPTY_MEASURE,_ as HANDLE_GRACE_MS,F as canvasTarget,O as contains,Y as gapInZone,H as gapLine,P as insertSeams,G as measureCanvas,X as pickSource,Z as seamsBetween,q as sourcesAt};
@@ -1 +0,0 @@
1
- import{useState as t,useEffect as e,useRef as n}from"react";var o=/* @__PURE__ */new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);function r(t){const e=t;if(!e||"string"!=typeof e.tagName)return!1;const n=e.tagName.toUpperCase();if("TEXTAREA"===n||"SELECT"===n)return!0;if("INPUT"===n)return!o.has(String(e.type??"text").toLowerCase());if(e.isContentEditable)return!0;const r=e.closest?.("[contenteditable]");return!(!r||"false"===r.getAttribute("contenteditable"))||null!=e.closest?.('[role="textbox"]')}var i="data-easel-block";function c(t,e=i){const n=t;return n&&"function"==typeof n.closest?n.closest(`[${e}]`)?.getAttribute(e)??null:null}function u(t){const e=t.getBoundingClientRect();if(e.width>0&&e.height>0)return{left:e.left,top:e.top,width:e.width,height:e.height};let n=1/0,o=1/0,r=-1/0,i=-1/0;for(const e of Array.from(t.children)){const t=e.getBoundingClientRect();t.width<=0||t.height<=0||(n=Math.min(n,t.left),o=Math.min(o,t.top),r=Math.max(r,t.right??t.left+t.width),i=Math.max(i,t.bottom??t.top+t.height))}return n===1/0?{left:e.left,top:e.top,width:e.width,height:e.height}:{left:n,top:o,width:r-n,height:i-o}}function l(t){const e=t.offsetWidth;if(!e)return 1;const n=t.getBoundingClientRect().width;return n>0?n/e:1}function s(t,e,n){const o=t.getBoundingClientRect(),r=n?.getBoundingClientRect()??{left:0,top:0},i=l(t);return{left:o.left-r.left+e.left*i,top:o.top-r.top+e.top*i,width:e.width*i,height:e.height*i}}function a(t){const e=t.offsetWidth;if(!e)return 1;const n=t.getBoundingClientRect().width;return n>0?n/e:1}function d(t,e,n){const o=s(t,e,n),r=a(n);return{left:o.left/r,top:o.top/r,width:o.width/r,height:o.height/r}}function f(t,e,n){const o=t.getBoundingClientRect(),r=a(t);return{x:(e-o.left)/r,y:(n-o.top)/r}}function h(t,e,n,o){const{left:r,top:i}=s(t,{left:e,top:n,width:0,height:0},o);return{x:r,y:i}}function m({available:t,width:e,maxScale:n=1}){const o=Math.max(0,t);if(!e||e<=0)return{width:o,scale:1,shownWidth:o};const r=o>0?Math.min(o/e,n):1;return{width:e,scale:r,shownWidth:e*r}}var w="data-es-canvas-style",g=/* @__PURE__ */new WeakMap;function b(t,e){e?g.set(t,e):g.delete(t)}function p(t,e,n){const o=t.head??t.documentElement;let r=y(t,e);if(!r){r=t.createElement("style"),r.setAttribute(w,e);const n=g.get(t);n&&r.setAttribute("nonce",n),o.appendChild(r)}return r.textContent!==n&&(r.textContent=n),r}function v(t,e){y(t,e)?.remove()}function y(t,e){for(const n of Array.from(t.querySelectorAll(`style[${w}]`)))if(n.getAttribute(w)===e)return n;return null}var E="[data-easel-block]",A="[data-easel-dropzone]",C="iframe#preview-frame";function L(t){const e=t.contentDocument;if(!e||!t.contentWindow||"loading"===e.readyState||!e.body)return!1;if(t.hasAttribute("srcdoc"))return"about:srcdoc"===e.URL;const n=t.getAttribute("src");return!n||"about:blank"===n||"about:blank"!==e.URL}function x(t,e,{selector:n=C,readySelector:o}={}){let r=null,i=null,c=!1,u=!1,l=null;const s=()=>{l?.observer.disconnect(),l=null},a=()=>{if(u)return;let t=null;if(r&&L(r)){const e=r.contentDocument;(t=>{if(!o||t.querySelector(o))return s(),!0;if(l?.doc!==t){s();const e=t.defaultView?.MutationObserver;if(e){const n=new e(()=>a());n.observe(t,{childList:!0,subtree:!0}),l={doc:t,observer:n}}}return!1})(e)&&(t={frame:r,document:e,window:r.contentWindow})}else s();(t===i||!!t&&!!i&&t.frame===i.frame&&t.document===i.document)&&c||(c=!0,i=t,e(i))},d=()=>a(),f=()=>{const e=t.querySelector?.(n);e!==r?(r?.removeEventListener("load",d),r=e,r?.addEventListener("load",d),a()):a()},h=t.ownerDocument?.defaultView??t.defaultView,m=h?.MutationObserver,w=m?new m(t=>(t=>null!==r&&!r.isConnected||t.some(t=>[...t.addedNodes,...t.removedNodes].some(t=>"IFRAME"===t.nodeName||!!t.querySelector?.("iframe"))))(t)&&f()):null;return w?.observe(t,{childList:!0,subtree:!0}),f(),()=>{u=!0,w?.disconnect(),s(),r?.removeEventListener("load",d),r=null}}function M(n,{selector:o,readySelector:r}={}){const[i,c]=t(null);return e(()=>{const t=n.current;if(!t)return;const e=x(t,c,{selector:o,readySelector:r});return()=>{e(),c(null)}},[n,o,r]),i}var R="easel:canvas-typing",S="easel:canvas-typable";function B(t,o,r,{on:i="document",capture:c=!1}={}){const u=n(r);u.current=r;const l=t?.document??null,s=t?.window??null;e(()=>{const t="window"===i?s:l;if(!t)return;const e=t=>u.current(t);return t.addEventListener(o,e,c),()=>t.removeEventListener(o,e,c)},[l,s,o,i,c])}function W(e){const[n,o]=t(!1);return B(e,R,t=>o(Boolean(t.detail?.typing))),n}function k(t,n,o){const r=t?.document??null;e(()=>{if(!r)return;if(!o)return void v(r,n);const t=p(r,n,o),e=r.defaultView?.MutationObserver,i=e?new e(()=>{t.isConnected||p(r,n,o)}):null;return i?.observe(r.head??r.documentElement,{childList:!0}),()=>{i?.disconnect(),v(r,n)}},[r,n,o])}function q(n,{settle:o=[150,450]}={}){const[r,i]=t(0),c=n?.frame??null,u=n?.document??null,l=n?.window??null,s=o.join(",");return e(()=>{if(!c||!u||!l)return;const t=c.ownerDocument.defaultView;let e=!1,n=0;const r=()=>{if(e)return;e=!0;const o=()=>{e=!1,i(t=>t+1)};t?.requestAnimationFrame?n=t.requestAnimationFrame(o):o()},s=[],a=(t,e)=>{t.addEventListener(e,r,!0),s.push(()=>t.removeEventListener(e,r,!0))};a(u,"scroll"),a(l,"resize"),t&&(a(t,"scroll"),a(t,"resize"));const d=t?.ResizeObserver;if(d){const t=new d(r);t.observe(c),u.documentElement&&t.observe(u.documentElement),s.push(()=>t.disconnect())}const f=u.defaultView?.MutationObserver,h=u.body??u.documentElement;if(f&&h){const t=new f(r);t.observe(u===c.ownerDocument?c:h,{childList:!0,subtree:!0}),s.push(()=>t.disconnect())}const m=u.fonts;m&&a(m,"loadingdone");const w=o.map(t=>setTimeout(r,t));return r(),()=>{for(const t of s)t();for(const t of w)clearTimeout(t);n&&t?.cancelAnimationFrame&&t.cancelAnimationFrame(n)}},[c,u,l,s]),r}export{i as BLOCK_ATTRIBUTE,E as BLOCK_SELECTOR,C as CANVAS_SELECTOR,S as CANVAS_TYPABLE_EVENT,R as CANVAS_TYPING_EVENT,A as LIST_SELECTOR,f as clientPointToLayer,u as drawnBox,a as elementScale,m as fitCanvas,h as framePointToHost,s as frameRectToHost,d as frameRectToLayer,l as frameScale,L as isFrameReady,r as isTypingTarget,c as nodeIdAt,v as removeCanvasStyle,b as setCanvasNonce,p as upsertCanvasStyle,B as useCanvasEvent,M as useCanvasFrame,q as useCanvasLayout,k as useCanvasStyle,W as useCanvasTyping,x as watchCanvasFrame};