efficient-easel 11.3.0 → 12.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 (109) hide show
  1. package/README.md +20 -41
  2. package/dist/{canvas-typing-DvoqQINU.d.ts → canvas-typing-CZ11Y5tb.d.ts} +16 -105
  3. package/dist/chrome/chrome.css +5 -5
  4. package/dist/chunk-2SOOKBHH.js +21 -0
  5. package/dist/{chunk-66LWADFP.js → chunk-2XMHLXMA.js} +1 -1
  6. package/dist/chunk-33C6ALT5.js +1 -0
  7. package/dist/{chunk-XJCMEEBH.js → chunk-36LVP5WD.js} +7 -7
  8. package/dist/chunk-47JTYRQC.js +2 -0
  9. package/dist/{chunk-EXKKLTXH.js → chunk-5NM5TPAX.js} +1 -1
  10. package/dist/{chunk-ZXGQT75B.js → chunk-5QP7ZE35.js} +1 -1
  11. package/dist/chunk-5R7FE4VT.js +57 -0
  12. package/dist/{chunk-FPAVNX3Y.js → chunk-5XUMLKQF.js} +3 -3
  13. package/dist/{chunk-PPL7GB7D.js → chunk-62VPYC7F.js} +1 -1
  14. package/dist/chunk-643PVCEG.js +1 -0
  15. package/dist/chunk-AYWN5NRH.js +1 -0
  16. package/dist/{chunk-4ACVXF5V.js → chunk-CZYR5V77.js} +1 -1
  17. package/dist/{chunk-PPHUWGLZ.js → chunk-EC2I7SIY.js} +1 -1
  18. package/dist/{chunk-DGAXQTDW.js → chunk-FHLYUIJJ.js} +1 -1
  19. package/dist/{chunk-65Z5FSAW.js → chunk-G3GWAP5R.js} +5 -5
  20. package/dist/{chunk-2FZJWH24.js → chunk-H4UMY7QF.js} +1 -1
  21. package/dist/chunk-KE2CXEIK.js +13 -0
  22. package/dist/chunk-KR4OCYRP.js +1 -0
  23. package/dist/{chunk-IFS5P7CO.js → chunk-LZS7JZK5.js} +1 -1
  24. package/dist/chunk-O3RLI7XE.js +1 -0
  25. package/dist/{chunk-47RGVCPH.js → chunk-QFVRMARS.js} +12 -12
  26. package/dist/chunk-TBF5CVPA.js +1 -0
  27. package/dist/chunk-UMDQ6CLQ.js +2 -0
  28. package/dist/chunk-UX7UJPC5.js +5 -0
  29. package/dist/chunk-VVPZMWJE.js +1 -0
  30. package/dist/chunk-WDQY6JMM.js +7 -0
  31. package/dist/chunk-WP7AZDCV.js +5 -0
  32. package/dist/chunk-WRFD4EXD.js +1 -0
  33. package/dist/{chunk-AFSSKGTD.js → chunk-WUO2GBPO.js} +1 -1
  34. package/dist/{chunk-BPFPM3L4.js → chunk-WY5U4XFO.js} +3 -3
  35. package/dist/{chunk-XWK7WZQS.js → chunk-X4VIDPKV.js} +1 -1
  36. package/dist/{chunk-TWFM6GNK.js → chunk-XY5ZHRMR.js} +1 -1
  37. package/dist/chunk-YHZSBL2N.js +1 -0
  38. package/dist/copy/copy.css +8 -108
  39. package/dist/copy/index.d.ts +39 -9
  40. package/dist/copy/index.js +18 -19
  41. package/dist/drag/drag.css +8 -8
  42. package/dist/drag/index.js +1 -1
  43. package/dist/easel/index.d.ts +3 -3
  44. package/dist/easel/index.js +1 -1
  45. package/dist/fields/fields.css +8 -8
  46. package/dist/fields/index.js +1 -1
  47. package/dist/gold/index.d.ts +3 -3
  48. package/dist/gold/index.js +1 -1
  49. package/dist/icons/index.d.ts +1 -0
  50. package/dist/markup/index.d.ts +1 -629
  51. package/dist/markup/index.js +1 -1
  52. package/dist/menu/menu.css +1 -1
  53. package/dist/panel/index.js +1 -1
  54. package/dist/panel/panel.css +12 -12
  55. package/dist/pick/index.d.ts +30 -8
  56. package/dist/pick/index.js +3 -7
  57. package/dist/pick/pick.css +10 -84
  58. package/dist/screen/components/AddBlockRow.js +1 -1
  59. package/dist/screen/components/AddSidePanel.js +1 -1
  60. package/dist/screen/components/MediaSidePanel.js +1 -1
  61. package/dist/screen/components/NodeContextMenu.js +1 -1
  62. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  63. package/dist/screen/components/PanelToggleIcon.d.ts +6 -5
  64. package/dist/screen/components/PanelToggleIcon.js +1 -1
  65. package/dist/screen/components/ScreenChrome.js +1 -1
  66. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  67. package/dist/screen/components/ScreenMount.js +1 -1
  68. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  69. package/dist/screen/components/SectionScreenShell.js +15 -15
  70. package/dist/screen/components/SidePanelHead.js +1 -1
  71. package/dist/screen/components/usePartBridge.js +1 -1
  72. package/dist/screen/index.js +1 -1
  73. package/dist/screen/lib/key-scope.js +1 -1
  74. package/dist/screen/lib/puck/device-fields.js +1 -1
  75. package/dist/screen/lib/puck/slot-child-name.js +1 -1
  76. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  77. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  78. package/dist/screen/lib/screen-parts.js +1 -1
  79. package/dist/screen/screen.css +16 -16
  80. package/dist/screen/words.js +1 -1
  81. package/dist/shell/shell.css +10 -8
  82. package/dist/strings/catalogue.d.ts +2 -2
  83. package/dist/strings/catalogue.js +1 -1
  84. package/dist/strings/index.d.ts +2 -2
  85. package/dist/strings/index.js +1 -1
  86. package/dist/text-styles/index.d.ts +14 -233
  87. package/dist/text-styles/index.js +36 -35
  88. package/dist/text-styles/model.d.ts +267 -0
  89. package/dist/text-styles/model.js +1 -0
  90. package/dist/text-styles/text-styles.css +6 -6
  91. package/dist/{words-dsex49Jh.d.ts → words-notpwHR2.d.ts} +13 -7
  92. package/package.json +8 -3
  93. package/dist/chunk-26GHWMNN.js +0 -21
  94. package/dist/chunk-546BBOPE.js +0 -1
  95. package/dist/chunk-AZOCY74V.js +0 -57
  96. package/dist/chunk-BHRC3ASL.js +0 -1
  97. package/dist/chunk-DD7A6RRL.js +0 -5
  98. package/dist/chunk-EQFBUNEB.js +0 -1
  99. package/dist/chunk-FAAZZXIS.js +0 -1
  100. package/dist/chunk-FFYXVAAL.js +0 -1
  101. package/dist/chunk-FGJSCWUN.js +0 -7
  102. package/dist/chunk-GCCBEY2W.js +0 -2
  103. package/dist/chunk-GG4FGBFR.js +0 -1
  104. package/dist/chunk-KQMML6JM.js +0 -4
  105. package/dist/chunk-Q6AM43CA.js +0 -1
  106. package/dist/chunk-SJPKSE5G.js +0 -13
  107. package/dist/chunk-U7KFFC7N.js +0 -5
  108. package/dist/chunk-VWXUMVCD.js +0 -1
  109. package/dist/chunk-ZAOM6PFH.js +0 -1
package/README.md CHANGED
@@ -198,7 +198,7 @@ host owns the string and decides what a finished edit means.
198
198
  ```tsx
199
199
  'use client';
200
200
  import { GoldTextInput } from 'efficient-easel/gold';
201
- import { STOREFRONT_MARKUP } from 'efficient-easel/markup';
201
+ import { STOREFRONT_MARKUP } from 'efficient-shell/markup';
202
202
  import 'efficient-easel/gold.css'; // once, from a client/global entry
203
203
 
204
204
  <GoldTextInput
@@ -224,12 +224,11 @@ import 'efficient-easel/gold.css'; // once, from a client/global entry
224
224
  | `rules` | `readonly InlineRule[]` | `STANDARD_MARKUP` | pass your product's set — `STOREFRONT_MARKUP` / `CAMPAIGN_MARKUP` |
225
225
  | `ariaLabel` | `string` | — | in-place editing has no visible label |
226
226
 
227
- **The grammar is ours, and there is one.** Runs are parsed by
228
- `efficient-easel/markup`, which this package owns since 2026-09-28 (it started as
229
- `efficient-shell/markup`). The published page and the campaign email render from
230
- the same module, so a toolbar button, a page and this box can never disagree
231
- about what a delimiter means. It is framework-free and imports nothing. See
232
- [the text grammar](#the-text-grammar--efficient-easelmarkup) below.
227
+ **There is one grammar, and it is the shell's.** Runs are parsed by
228
+ `efficient-shell/markup` (decision D1, 2026-10-12). The published page and the
229
+ campaign email render from the same module, so a toolbar button, a page and
230
+ this box can never disagree about what a delimiter means. It is framework-free
231
+ and imports nothing. See [the text grammar](#the-text-grammar--efficient-easelmarkup-deprecated) below.
233
232
 
234
233
  **Two deliberate limits.** The asterisks are FADED, never removed. They go to
235
234
  nothing while the box is unfocused, so a merchant who is not typing does not read
@@ -242,43 +241,23 @@ earlier than the transparent box on top of it and every following line would be
242
241
  drawn over the wrong text. The real weight and slant appear on the page the
243
242
  moment the merchant clicks away.
244
243
 
245
- ## The text grammar — `efficient-easel/markup`
244
+ ## The text grammar — `efficient-easel/markup` (deprecated)
246
245
 
247
- The ONE rule for copy a merchant types, in both editors, on the page and in the
248
- email. Framework-free: no React, no DOM, no imports.
246
+ **Import `efficient-shell/markup`.** The one grammar for copy a merchant types,
247
+ in both editors, on the page and in the email, is efficient-shell's
248
+ (decision D1, Lewis 2026-10-12). Its marks, exports and rules are documented
249
+ in efficient-shell's README, "Editorial markup — `efficient-shell/markup`";
250
+ they are not repeated here.
249
251
 
250
- | Mark | Means | Written by a button |
251
- |---|---|---|
252
- | `**x**` | **Strong** (bold) | yes, ⌘B |
253
- | `==x==` | **Emphasis** (the brand accent) | yes |
254
- | `^^x^^` | **Quiet** | yes |
255
- | `_x_` | italic, only at a word edge | yes |
256
- | `~~x~~` | strikethrough | yes |
257
- | `[words](href)` | a link — `http`, `https`, `mailto`, `tel` or no scheme only | yes |
258
- | `- ` at the start of a line | a bullet line, one level | yes |
259
- | `1. ` at the start of a line | a numbered line, one level: 1-3 digits, `. `, words; the number is kept as typed | yes |
260
- | `[x]{underline}`, `[x]{sup}`, `[x]{sub}` | underline, superscript, subscript (tree only) | not yet — `applyMark` writes them; the buttons come with the final text box |
261
- | `[x]{color=name}` / `[x]{color=#rrggbb}` | a theme colour by name (`isColorName`), or any colour as exactly six hex digits (`isColorValue`; saved lowercase) (tree only) | not yet — `applyColor` writes it |
262
- | `@@x@@`, `++x++` | Emphasis, Strong (the storefront's old word styles) | no — read only |
263
- | `*x*`, `#x#`, `[x]` | legacy accent, bold, italic (per product set) | no — read only |
264
-
265
- The three names a merchant sees are in `MARK_NAMES`. A run never crosses a line
266
- break, and runs, spans and links nest up to four levels
267
- (`[**_[x]{sup}_**]{color=accent}`); a fifth stays as typed. Any block after `]`
268
- that is not exactly one of the four (`[x]{foo}`, `[x]{color=#f00}`,
269
- `[x]{{first_name}}`) is plain text. The spans and the numbered line are read by
270
- `parseMarkup` only: `tokenizeInline` keeps them as text, so a renderer that has
271
- not learned them prints the delimiters.
252
+ `efficient-easel/markup` still resolves, so a host that imports it keeps
253
+ working, but it is only `export * from 'efficient-shell/markup'`: it has no
254
+ code of its own, and it is `@deprecated`. Easel's own copy (1,498 lines, held
255
+ here from 2026-09-28) was deleted on 2026-10-17. Framework-free: no React, no
256
+ DOM, no other import.
272
257
 
273
- | Export | Notes |
274
- |---|---|
275
- | `parseMarkup(value, rules)` → `MarkupLine[]` | The whole grammar as a tree. Each run keeps the delimiters that were saved. |
276
- | `serializeMarkup(lines)` | The inverse: `serializeMarkup(parseMarkup(s, rules)) === s`, for every string. Pinned by `tests/markup-round-trip.test.ts` (made-up strings in the shape of saved copy). All 917 saved production strings were checked off-repo on 2026-09-29 (editor-shell #89), and again for the spans and numbered lines on 2026-10-06 (E1). |
277
- | `isSafeLinkHref(href)` | The link rule. Call it before writing any `href`. |
278
- | `tokenizeInline(value, rules)`, `stripInline` | The flat reading older renderers use: runs only, no links, no nesting. |
279
- | `applyMark(text, start, end, style)`, `MARKUP_TOOLS`, `markupTools`, `COPY_FIELD_TOOLS` | The writer behind a toolbar button, and the button descriptors. |
280
- | `applyColor(text, start, end, name)`, `isColorName`, `isColorValue`, `spanFor` | A colour carries a value, so it has its own writer: it writes, changes and (`null`) takes off `[x]{color=name}` — a theme name or a 6-digit hex, saved lowercase — and changes nothing for a value `isColorValue` refuses (`#f00`, `rgb()`, a typo). |
281
- | `STANDARD_MARKUP`, `STOREFRONT_MARKUP`, `CAMPAIGN_MARKUP` | The rule sets. The last two add each product's legacy runs. |
258
+ One behaviour came with the move: the read-only `++phrase++` Strong opens only
259
+ at a word start, so `A++ rated tyres, A++ service` is plain text, while
260
+ `Save ++20%++ today` is still Strong.
282
261
 
283
262
  ## The edit lock — two operators, one document
284
263
 
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { MarkStyle, MarkupTool, WrapResult, InlineRule } from './markup/index.js';
4
- import { C as CopyWords, a as CopyAlign } from './words-dsex49Jh.js';
3
+ import { MarkStyle, WrapResult, InlineRule, MarkupTool } from 'efficient-shell/markup';
4
+ import { C as CopyWords, a as CopyAlign } from './words-notpwHR2.js';
5
5
  import { TextToolbarCase, TextToolbarMark } from 'efficient-shell/ui';
6
6
 
7
7
  type CellWords = NonNullable<CopyWords['cells']>;
@@ -66,88 +66,6 @@ declare function ColorWindow({ colors, current, words, onPick, }: {
66
66
  onPick: (color: string | null) => void;
67
67
  }): react.JSX.Element;
68
68
 
69
- /** `'b'` → `Meta+B`, `'shift+x'` → `Meta+Shift+X` — the ARIA spelling of a
70
- * shortcut. Meta is what the tooltips promise (⌘); Ctrl works too. */
71
- declare function ariaShortcut(shortcut: string | undefined): string | undefined;
72
- interface MarkBarProps {
73
- /**
74
- * Which buttons to show.
75
- *
76
- * TWO FORMS, and the second is not a convenience — it is the only way a
77
- * product with marks of its OWN can use this bar at all.
78
- *
79
- * `MarkStyle[]` resolved against the shared grammar's `MARKUP_TOOLS`, in
80
- * that order. What the campaign designer passes.
81
- * `MarkupTool[]` used verbatim. What `efficient-storefront` passes.
82
- *
83
- * ⚠️ WHY VERBATIM DESCRIPTORS HAD TO EXIST. The storefront offered SEVEN
84
- * marks: the grammar's four, plus its three word styles (`@@`, `++`, `^^`),
85
- * which then lived only in the shop because the grammar was
86
- * `efficient-shell/markup`. Resolving through `markupTools` can only ever
87
- * return marks the grammar knows, so it silently DROPPED all three — the bar
88
- * rendered four buttons where the panel had seven, and nothing failed to
89
- * compile. Since 2026-09-28 the grammar is ours and holds Quiet (`^^`) and
90
- * reads `@@` / `++` as Emphasis and Strong, but a host may still hand in
91
- * marks of its own.
92
- *
93
- * So a host that has its own marks builds its own descriptors (the shop
94
- * already did: `shopMarkupTools()`) and hands them over whole. The bar's job
95
- * is the ROW — the buttons, the focus guard, the naming, the group — and that
96
- * job does not depend on who defined the mark.
97
- */
98
- tools: readonly MarkStyle[] | readonly MarkupTool[];
99
- onApply: (style: MarkStyle) => void;
100
- disabled?: boolean;
101
- /** Buttons that write no mark, after a divider — see `CopyBoxProps.actions`. */
102
- actions?: ReactNode;
103
- /** The alignment strip, already built by the control. */
104
- align?: ReactNode;
105
- /**
106
- * WHAT A BUTTON IS DRAWN AS, per style. Default: the grammar's own letter —
107
- * `B`, `I`, `S`, `◆` — which is what the campaign designer has always shown.
108
- *
109
- * ⚠️ THIS IS NOT A THEME KNOB, AND IT IS NOT OPTIONAL POLISH. This package
110
- * already says that WHICH buttons and WHAT they write are the grammar's, while
111
- * how they LOOK is the host's, "because this bar has to belong to the
112
- * storefront inspector's chrome and the campaign designer's bar has to belong
113
- * to the portal's". Colour was delegated by tokens on day one; the DRAWING was
114
- * not, and a letter is a drawing. `efficient-storefront` renders each mark as a 14px
115
- * stroked SVG at the weight of its other inspector glyphs, on the stated
116
- * ground that the row should read "as part of the field rather than as
117
- * pasted-in icons" — so without this it could not adopt the bar without losing
118
- * that, which is a regression dressed as a refactor.
119
- *
120
- * The set now HAS a glyph for every mark (0.94.0: bold, italic, strike,
121
- * emphasis, quiet, clear-marks — the owner's call, made 2026-10-02), and they
122
- * are the default. This map stays so a host can still draw its own.
123
- *
124
- * A style the map does not name falls back to the icon set's glyph for it
125
- * (`SET_GLYPH`, 0.94.0, when the owner added the mark glyphs to the set) and
126
- * then to the letter, so a host may override one button and leave the rest.
127
- */
128
- glyphs?: Partial<Record<MarkStyle, ReactNode>>;
129
- /**
130
- * What the group is CALLED. Defaults to "Formatting" (`EaselStrings.copy.formatting`).
131
- *
132
- * A bar bound to one box needs nothing more. A bar SHARED by several rows has
133
- * to say which row it is aimed at, because the visible cue — the marked row —
134
- * is not readable. `efficient-storefront` has that case today.
135
- */
136
- ariaLabel?: string;
137
- /**
138
- * The marks the selection already wears — a button drawn pressed is one
139
- * whose press takes the mark OFF (`markedAt`, the same test `applyMark`
140
- * unwraps by), so the two cannot disagree. A style not named is not pressed;
141
- * with no map at all no button says either way (`aria-pressed` is left off),
142
- * which is what every host that does not track the selection still gets.
143
- */
144
- pressed?: Partial<Record<MarkStyle, boolean>>;
145
- /** The style whose own window is open — the link button while its "Link
146
- * to" window is showing. Drawn pressed, and named as expanded. */
147
- open?: MarkStyle | null;
148
- }
149
- declare function MarkBar({ tools, onApply, disabled, actions, align, glyphs, ariaLabel, pressed, open, }: MarkBarProps): react.JSX.Element | null;
150
-
151
69
  /**
152
70
  * Just enough of a text control to read a selection off it. Narrowed to these
153
71
  * two fields so a caller may hand in a plain object in a test.
@@ -300,7 +218,7 @@ interface CopyBoxProps {
300
218
  readOnly?: boolean;
301
219
  /**
302
220
  * The grammar's rule set — `CAMPAIGN_MARKUP` in the designer,
303
- * `STOREFRONT_MARKUP` in the shop, both from `efficient-easel/markup`. It
221
+ * `STOREFRONT_MARKUP` in the shop, both from `efficient-shell/markup`. It
304
222
  * decides what the LAYER paints; {@link tools} decides what the BAR offers,
305
223
  * and a host that lets those two disagree gets a button whose mark draws as
306
224
  * plain text.
@@ -308,29 +226,27 @@ interface CopyBoxProps {
308
226
  rules?: readonly InlineRule[];
309
227
  /**
310
228
  * Which mark buttons to show — styles resolved against the shared grammar, or
311
- * the host's own descriptors used verbatim. See `MarkBarProps.tools`. Empty
312
- * draws no bar.
229
+ * the host's own descriptors (only their `style` is read). Empty draws no
230
+ * mark buttons.
313
231
  */
314
- tools?: MarkBarProps['tools'];
232
+ tools?: readonly MarkStyle[] | readonly MarkupTool[];
315
233
  /**
316
234
  * How a mark is written. Defaults to the shared grammar's `applyMark`; the
317
235
  * storefront passes its own so its three word styles reach the same bar.
318
236
  */
319
237
  writeMark?: MarkWriter;
320
238
  /**
321
- * Buttons that are NOT marks, drawn after a divider at the end of the bar.
322
- *
323
- * The storefront's "Clear formatting" is the one that exists: it writes no
324
- * mark at all, so it is not in the grammar's tool list and must not be added
325
- * to it. Drawing it here keeps `MARKUP_TOOLS` meaning "what a mark MEANS".
239
+ * @deprecated Only read with `toolbar: 'classic'`, where it is drawn in the
240
+ * toolbar's row 1 last cell (`lastTool` wins). Removed in 12.0.0.
326
241
  */
327
242
  actions?: ReactNode;
328
243
  /** The alignment strip. Omitted = no strip. */
329
244
  align?: CopyBoxAlign<CopyAlign>;
330
- /** What each mark button is DRAWN as — see `MarkBarProps.glyphs`. Default is
331
- * the grammar's own letter. */
332
- glyphs?: MarkBarProps['glyphs'];
333
- /** What the formatting group is CALLED — see `MarkBarProps.ariaLabel`. */
245
+ /** @deprecated Not drawn: the toolbar's drawings are the shell set's.
246
+ * Removed in 12.0.0. */
247
+ glyphs?: Partial<Record<MarkStyle, ReactNode>>;
248
+ /** What the toolbar is CALLED. Defaults to "Formatting"
249
+ * (`EaselStrings.copy.formatting`). */
334
250
  barLabel?: string;
335
251
  /** What goes under the box — see {@link CopyBoxFooter}. */
336
252
  renderFooter?: (ctx: CopyBoxFooter) => ReactNode;
@@ -354,13 +270,8 @@ interface CopyBoxProps {
354
270
  /** A many-line box opens with its marks shown. Default false. */
355
271
  defaultShowMarks?: boolean;
356
272
  /**
357
- * Which toolbar (E5b). `'final'` — the default — is the design made final
358
- * on 2026-10-06: two rows on one 9-column grid, B · I · U · S · Color ·
359
- * Link · Superscript · Subscript · the host's {@link lastTool} (Undo until
360
- * 2026-10-07) over Left · Center · Right · Justify
361
- * · Bulleted · Numbered · Aa · AA · aa, with the number {@link cells}
362
- * between it and the box. `'classic'` is the bar before it (`MarkBar` and
363
- * the alignment strip), for a host not moved over yet.
273
+ * @deprecated Every copy box draws the shell's `TextToolbar`; `'classic'`
274
+ * only draws {@link actions} in its last cell. Removed in 12.0.0.
364
275
  */
365
276
  toolbar?: 'final' | 'classic';
366
277
  /**
@@ -517,4 +428,4 @@ interface CanvasTypingSession {
517
428
  /** Start typing in the words `element()` drew, or `null` where they are not the string's. */
518
429
  declare function startCanvasTyping(o: CanvasTypingOptions): CanvasTypingSession | null;
519
430
 
520
- export { type CopyBoxLastTool as C, MarkBar as M, type SelectionSource as S, type TextBoxHandle as T, type CopyThemeColor as a, type CanvasTypingEnd as b, type CopyBoxProps as c, type CopyCell as d, COPY_CELLS as e, type CanvasTypingOptions as f, type CanvasTypingSession as g, ColorWindow as h, type CopyBoxAlign as i, type CopyBoxFooter as j, type CopyCase as k, type CopyCellPreset as l, CopyCells as m, type MarkBarProps as n, type MarkWriter as o, type TextAreaHandle as p, type TextMap as q, type ToolbarMark as r, ariaShortcut as s, colorRunOf as t, insertSelection as u, markSelection as v, startCanvasTyping as w, textMap as x };
431
+ export { type CopyBoxLastTool as C, type MarkWriter as M, type SelectionSource as S, type TextBoxHandle as T, type CopyThemeColor as a, type CanvasTypingEnd as b, type CopyBoxProps as c, type CopyCell as d, COPY_CELLS as e, type CanvasTypingOptions as f, type CanvasTypingSession as g, ColorWindow as h, type CopyBoxAlign as i, type CopyBoxFooter as j, type CopyCase as k, type CopyCellPreset as l, CopyCells as m, type TextAreaHandle as n, type TextMap as o, type ToolbarMark as p, colorRunOf as q, insertSelection as r, markSelection as s, startCanvasTyping as t, textMap as u };
@@ -154,7 +154,7 @@
154
154
  gap: 8px;
155
155
  padding: 4px 12px;
156
156
  border-radius: var(--radius-lg);
157
- font-size: 12px;
157
+ font-size: var(--text-xs, 12px);
158
158
  font-weight: 500;
159
159
  white-space: nowrap;
160
160
  user-select: none;
@@ -269,7 +269,7 @@
269
269
  }
270
270
  /* A panel's own name. States the margin an h2 would otherwise bring. */
271
271
  .es-panel-title {
272
- font-size: 14px;
272
+ font-size: var(--text-sm, 14px);
273
273
  font-weight: 600;
274
274
  color: var(--es-text);
275
275
  margin: 0;
@@ -412,7 +412,7 @@ span:has(> .es-insp-up-btn) {
412
412
  display: flex;
413
413
  align-items: center;
414
414
  justify-content: center;
415
- font-size: 14px;
415
+ font-size: var(--text-sm, 14px);
416
416
  flex: none;
417
417
  background: var(--es-chip-bg);
418
418
  color: var(--es-icon);
@@ -453,7 +453,7 @@ span:has(> .es-insp-up-btn) {
453
453
  }
454
454
  /* An h2 carries `0.83em 0` from the UA sheet; `margin: 0` keeps the head closed. */
455
455
  .es-insp-name {
456
- font-size: 14px;
456
+ font-size: var(--text-sm, 14px);
457
457
  font-weight: 600;
458
458
  color: var(--es-text);
459
459
  margin: 0;
@@ -462,7 +462,7 @@ span:has(> .es-insp-up-btn) {
462
462
  text-overflow: ellipsis;
463
463
  }
464
464
  .es-insp-kind {
465
- font-size: 11px;
465
+ font-size: var(--text-2xs, 11px);
466
466
  color: var(--es-muted);
467
467
  }
468
468
  .es-insp-actions {
@@ -0,0 +1,21 @@
1
+ import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{SETTINGS_BUCKETS as n,SettingsGroup as l}from"./chunk-RC25EGHD.js";import{DEFAULT_TREE_WORDS as t}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as a}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as r}from"./chunk-EA2HTX37.js";import{useTreeDrag as o,gapToMoveIndex as i}from"./chunk-67GNT6PF.js";import{withTip as s}from"./chunk-P2VEMZH5.js";import{FieldNumber as c}from"./chunk-2XMHLXMA.js";import{FieldSelect as d}from"./chunk-G3GWAP5R.js";import{SettingsField as u,SettingsSegmented as m}from"./chunk-36LVP5WD.js";import{DEFAULT_FIELDS_WORDS as p}from"./chunk-WRFD4EXD.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as D}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as I,MoveUpIcon as P,MoveDownIcon as L,DuplicateIcon as F,TrashIcon as M}from"efficient-shell/icons/efficient";function R({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function E(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function T(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function A(e,n){return e.filter((e,l)=>l!==n)}function H(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var z='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function G({label:n,icon:l,noun:a,items:c,onChange:d,newItem:u,summary:m,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:R,renderItem:G,renderRow:K,canRemove:W,lockedReason:X,fixed:J=!1,removeOnRow:V=!0,canDuplicate:Y,above:q,head:Z=!0}){const Q=h("fields",p).list,U=h("tree",t),_=a??Q.item,ee=!w&&!J&&("number"!=typeof x||c.length<x),ne=c.length<=k,le=e=>!!W&&!W(c[e],e),te=e=>!w&&!J&&V&&!ne&&!le(e),ae=e=>ee&&(!Y||Y(c[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(z)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=c.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(z)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}d(T(c,e,n));const a=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);a!==$&&R(a),he(Q.moved({n:n+1,total:c.length}))},be=e=>{ee&&(d(E(c,e,u())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&R($+1)):R(e))},ge=e=>{te(e)&&(d(A(c,e)),$===e?R(null):null!==$&&$>e&&R($-1))},ve=o({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=i({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<c.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<c.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(F,{size:14}),onClick:()=>(e=>{ae(e)&&(d(E(c,e+1,H(c[e]))),null!==$&&$>e&&R($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(M,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=c.slice();l[e]=n,d(l)};/* @__PURE__ */
2
+ return D("div",{className:"es-list",children:[Z?/* @__PURE__ */D("div",{className:"es-list-head",children:[
3
+ /* @__PURE__ */D("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,n]}),
4
+ /* @__PURE__ */j("span",{className:"es-list-count",children:c.length})]}):null,q?/* @__PURE__ */j("div",{className:"es-list-above",children:q}):null,c.length?/* @__PURE__ */D(g,{"aria-label":n,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[c.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!J&&V&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
5
+ /* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.current[l]=e},rowProps:{...t.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||J||!V?void 0:o?s(X?X(n,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":X?X(n,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):s(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:G(n,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(n,l,xe(l))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>R(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(n,l)}):null,
6
+ /* @__PURE__ */j("span",{className:"es-list-row-name",children:re(n,l)}),/* @__PURE__ */j("span",m?{className:"es-list-row-summary",children:m(n,l)}:{className:"es-list-row-summary"}),
7
+ /* @__PURE__ */j(S,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
8
+ /* @__PURE__ */j(e,{...ve.seam({place:{...B,index:c.length}})})]}):null,w||J?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(c.length),children:Q.add({noun:_})}),
9
+ /* @__PURE__ */j("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<c.length?
10
+ /* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(r,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,W=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function X({field:e,name:n,id:t,value:a,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=a&&"object"==typeof a?a:{};/* @__PURE__ */
11
+ return j(l,{id:`${t}-group`,title:W(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,l])=>/* @__PURE__ */j(V,{field:l,name:`${n}.${e}`,id:`${t}-${e}`,value:m[e],onChange:n=>r({...m,[e]:n}),readOnly:o,context:i,renderers:s,headingLevel:K(c)},e))})}function J({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:o,renderers:i,openItem:s,onOpenItem:c,headingLevel:d}){const[u,m]=C(null),p=c?s??null:u,h=c??m,f=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
+ return j(G,{label:W(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>H({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(V,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function V(e){const{field:n,name:l,id:t,value:a,onChange:r,readOnly:o,context:i,renderers:s}=e;if(!n||n.marker||!1===n.visible)return null;const p=s?.[n.type];if(p)return p({field:n,name:l,id:t,value:a,onChange:r,readOnly:o});switch(n.type){case"custom":{const e={...i,field:n,name:l,id:t,value:a,onChange:r,readOnly:o};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
13
+ return j(u,{label:W(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(R,{id:t,value:"string"==typeof a?a:null==a?"":String(a),onChange:r,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:o})});case"number":/* @__PURE__ */
14
+ return j(u,{label:W(n,l),htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(c,{id:t,value:"number"==typeof a?a:void 0,onChange:r,min:n.min,max:n.max,step:n.step,placeholder:n.placeholder,readOnly:o})});case"select":{const e=`${t}-label`;/* @__PURE__ */
15
+ return j(u,{label:W(n,l),labelId:e,htmlFor:t,icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(d,{id:t,value:a,options:n.options,onChange:r,readOnly:o,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
16
+ return j(u,{label:W(n,l),icon:n.icon,hint:n.hint,children:/* @__PURE__ */j(m,{ariaLabel:W(n,l),value:a,options:n.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||o})),onChange:e=>{o||r(e)}})});case"object":/* @__PURE__ */
17
+ return j(X,{...e,field:n});case"array":/* @__PURE__ */
18
+ return j(J,{...e,field:n});case"slot":return null}}var Y=e=>n.includes(e);function q(e){let l,t=n[0];const a=[],r=/* @__PURE__ */new Set;for(const[n,o]of Object.entries(e))o&&(Y(o.bucket)&&((o.marker||o.bucket!==t)&&(l=void 0),t=o.bucket),o.marker&&"string"==typeof o.fold?l={key:n,title:o.fold}:o.marker&&!1===o.fold&&(l=void 0),o.marker||!1===o.visible||(a.push(l?{name:n,field:o,bucket:t,fold:l}:{name:n,field:o,bucket:t}),"slot"!==o.type&&r.add(t)));return{rows:a,buckets:n.filter(e=>r.has(e))}}function Z(e){return new Map(q(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:t,readOnly:r=!1,context:o,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:u,idPrefix:m,ariaLabel:p,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=h("panel",a),S=$(),I=m??`es-insp${S.replace(/:/g,"")}`,P=q(e),[L,F]=C(void 0),M=i??L,R=M&&P.buckets.includes(M)?M:P.buckets[0],[E,T]=C(null),A=E&&E.panel===I&&P.rows.some(e=>e.name===E.name)?E:null,H=c&&P.buckets.length>1,z=H&&R?k(I,R):`${I}-rows`,[B,G]=C(()=>/* @__PURE__ */new Set),W=v??B,X=(e,n)=>{/* @__PURE__ */return j(l,{title:e.title,open:!W.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&G(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${t=e.key,[...t].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var t},J=e=>H&&e!==R,Y=({name:e,field:l,bucket:a,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":a,hidden:!!J(a)||void 0,children:/* @__PURE__ */j(V,{field:l,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>t(e,n),readOnly:r,context:o,renderers:u,openItem:A&&A.name===e?A.index:null,onOpenItem:n=>T(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
19
+ return D("div",{className:"es-insp",children:[H?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":p??O.settings,idPrefix:I,value:R,onChange:e=>{const n=e;void 0===i&&F(n),s?.(n)},items:P.buckets.map(e=>{const n=O.buckets[e],l=d?.[e];return l?{id:e,icon:l,label:/* @__PURE__ */j("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
20
+ /* @__PURE__ */D("div",{className:"es-insp-rows",id:z,role:H?"tabpanel":void 0,"aria-labelledby":H&&R?w(I,R):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:X(g,f)}):f:null,Q(P.rows).map((e,n)=>{if(!e.fold)return e.rows.map(Y);const l=e.rows[0].bucket,t=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
21
+ return j("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":l,hidden:!(!J(l)&&!t)||void 0,children:X(e.fold,e.rows.map(Y))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{R as FieldText,U as Inspector,V as InspectorField,G as ListField,Z as bucketsOf,H as copyItem,E as insertAt,W as labelOf,T as moveTo,q as planFields,A as removeAt};
@@ -1 +1 @@
1
- import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FFYXVAAL.js";import{useWords as i}from"./chunk-MFIRYGHW.js";import{ShellStringsProvider as n,InputNumber as s,Tooltip as a}from"efficient-shell/ui";import{jsx as l}from"react/jsx-runtime";function r({id:r,value:t,onChange:m,min:o,max:c,step:u=1,shiftStep:d,styleValue:p,icon:f,unit:h,steppers:b=!1,placeholder:v,readOnly:x=!1,ariaLabel:y,ariaLabelledBy:N,title:F}){const g=i("fields",e),j="number"==typeof t&&Number.isFinite(t)?t:null,L=/* @__PURE__ */l("div",{className:`es-fnum${f?" es-fnum--icon":""}${null===j&&void 0!==p?" is-style":""}`,children:/* @__PURE__ */l(n,{value:{number:{increase:g.more,decrease:g.less}},children:/* @__PURE__ */l(s,{id:r,size:"sm",className:"es-fnum-box",value:j,onChange:e=>m(e??void 0),min:o,max:c,step:u,shiftStep:d,readOnly:x,steppers:b,snap:!0,placeholder:void 0!==p?String(p):v,prefix:f?/* @__PURE__ */l("span",{className:"es-fnum-icon",children:f}):void 0,suffix:h?/* @__PURE__ */l("span",{className:"es-fnum-unit",children:h}):void 0,"aria-label":y,"aria-labelledby":N})})});return F?/* @__PURE__ */l(a,{content:F,children:L}):L}export{r as FieldNumber};
1
+ import{DEFAULT_FIELDS_WORDS as e}from"./chunk-WRFD4EXD.js";import{useWords as i}from"./chunk-MFIRYGHW.js";import{ShellStringsProvider as n,InputNumber as s,Tooltip as a}from"efficient-shell/ui";import{jsx as l}from"react/jsx-runtime";function r({id:r,value:t,onChange:m,min:o,max:c,step:u=1,shiftStep:d,styleValue:p,icon:f,unit:h,steppers:b=!1,placeholder:v,readOnly:x=!1,ariaLabel:y,ariaLabelledBy:N,title:g}){const j=i("fields",e),F="number"==typeof t&&Number.isFinite(t)?t:null,S=/* @__PURE__ */l("div",{className:`es-fnum${f?" es-fnum--icon":""}${null===F&&void 0!==p?" is-style":""}`,children:/* @__PURE__ */l(n,{value:{number:{increase:j.more,decrease:j.less}},children:/* @__PURE__ */l(s,{id:r,size:"sm",className:"es-fnum-box",value:F,onChange:e=>m(e??void 0),min:o,max:c,step:u,shiftStep:d,readOnly:x,steppers:b,snap:!0,placeholder:void 0!==p?String(p):v,prefix:f?/* @__PURE__ */l("span",{className:"es-fnum-icon",children:f}):void 0,suffix:h?/* @__PURE__ */l("span",{className:"es-fnum-unit",children:h}):void 0,"aria-label":y,"aria-labelledby":N})})});return g?/* @__PURE__ */l(a,{content:g,children:S}):S}export{r as FieldNumber};
@@ -0,0 +1 @@
1
+ import{MARKUP_TOOLS as e,MARK_PLACEHOLDERS as t}from"efficient-shell/markup";var i={formatting:"Formatting",alignment:"Alignment",align:{left:"Left",center:"Center",right:"Right",justify:"Justify"},marks:{...Object.fromEntries(e.map(e=>[e.style,{name:e.name??e.title,title:e.title}])),underline:{name:"Underline",title:"Underline · [words]{underline}"},sup:{name:"Superscript",title:"Superscript · [words]{sup}"},sub:{name:"Subscript",title:"Subscript · [words]{sub}"}},placeholders:t,showMarks:"Show marks",clearStyle:"Clear changes",clearStyleEmpty:"Select words first",colors:{title:"Color",theme:"Theme colors",remove:"Remove",any:"Any color",square:"Saturation and brightness",hue:"Hue",hex:"Hex color"},panel:{style:"Style",editStyles:"Edit styles",updateStyle:"Update style",font:"Font",italic:"Italic",list:"List",lists:{none:"No list",bullet:"Bulleted",number:"Numbered"},capitalization:"Capitalization",cases:{none:"As typed",upper:"Uppercase",capitalize:"Capitalized",lower:"Lowercase"}},cells:{fontSize:"Font size",lineHeight:"Line spacing",letterSpacing:"Letter spacing",paragraphSpacing:"Paragraph spacing",tip:({name:e,step:t,unit:i})=>`${e} · step ${t} ${i} · Shift ×10`}};export{i as DEFAULT_COPY_WORDS};
@@ -1,9 +1,9 @@
1
- import{Segmented as e,Switch as a,Tooltip as l}from"efficient-shell/ui";import{jsx as s,jsxs as i,Fragment as n}from"react/jsx-runtime";import{isValidElement as r,cloneElement as d}from"react";function c({options:a,value:n,onChange:r,ariaLabel:d,fit:c,disabled:t=!1,className:o}){const h=c&&function(e,a){return{"--es-fit-count":e,"--es-fit-labels":`${a.labelsPx}px`,"--es-fit-widest":`${a.widestLabelPx}px`}}(a.length,c),u=a.findIndex(e=>e.id===n);
2
- /* @__PURE__ */
3
- return s("div",{className:"es-segs-fit","data-disabled":t||void 0,style:h,children:/* @__PURE__ */s(e,{size:"sm",label:d,className:`es-segs${h?" is-measured":""}${o?` ${o}`:""}`,value:u<0?"":String(u),onChange:e=>r(a[Number(e)].id),options:a.map((e,a)=>{const n=e.title??("string"==typeof e.label?e.label:void 0),r="string"!=typeof e.label,d=a=>n&&(e.icon||r)?/* @__PURE__ */s(l,{content:n,children:a}):a;return{value:String(a),disabled:t||!0===e.disabled,icon:e.icon?d(
4
- /* @__PURE__ */s("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon})):void 0,label:r?/* @__PURE__ */i("span",{className:"es-seg-word",children:[d(/* @__PURE__ */s("span",{"aria-hidden":"true",children:e.label})),
5
- /* @__PURE__ */s("span",{className:"es-vh",children:n})]}):/* @__PURE__ */s("span",{className:"es-seg-word",children:e.label})}})})})}function t({checked:e,onChange:l,disabled:i,id:n,ariaLabel:r,ariaLabelledBy:d,className:c}){/* @__PURE__ */
6
- return s(a,{size:"sm",id:n,checked:e,"aria-label":r,"aria-labelledby":d,disabled:i,className:c?`es-switch ${c}`:"es-switch",onChange:l})}function o(e){return Array.isArray(e)?e.some(o):r(e)}function h(e,a,l){if(!r(e)||e.type!==t)return e;const s=e.props;return s.ariaLabel||s.ariaLabelledBy?e:d(e,l?{ariaLabelledBy:l}:{ariaLabel:a})}function u({label:e,labelId:a,icon:l,value:r,hint:d,changed:c,htmlFor:t,action:u,children:m,className:b}){const f=o(m),p=o(u);if(!f&&!p)return null;const N=["es-field"];f||N.push("is-inline"),c&&N.push("is-changed"),b&&N.push(b);const g=/* @__PURE__ */i(n,{children:[l?/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,
1
+ import{Switch as e,Segmented as a,Tooltip as l}from"efficient-shell/ui";import{jsx as s,jsxs as i,Fragment as n}from"react/jsx-runtime";import{isValidElement as r,cloneElement as d}from"react";function c({checked:a,onChange:l,disabled:i,id:n,ariaLabel:r,ariaLabelledBy:d,className:c}){/* @__PURE__ */
2
+ return s(e,{size:"sm",id:n,checked:a,"aria-label":r,"aria-labelledby":d,disabled:i,className:c?`es-switch ${c}`:"es-switch",onChange:l})}function t(e){return Array.isArray(e)?e.some(t):r(e)}function o(e,a,l){if(!r(e)||e.type!==c)return e;const s=e.props;return s.ariaLabel||s.ariaLabelledBy?e:d(e,l?{ariaLabelledBy:l}:{ariaLabel:a})}function h({label:e,labelId:a,icon:l,value:r,hint:d,changed:c,htmlFor:h,action:u,children:m,className:b}){const f=t(m),p=t(u);if(!f&&!p)return null;const N=["es-field"];f||N.push("is-inline"),c&&N.push("is-changed"),b&&N.push(b);const g=/* @__PURE__ */i(n,{children:[l?/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,
7
3
  /* @__PURE__ */s("span",{className:"es-field-label",id:a,children:e})]});/* @__PURE__ */
8
4
  return i("div",{className:N.join(" "),children:[
9
- /* @__PURE__ */i("div",{className:"es-field-head",children:[t?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:t,children:g}):/* @__PURE__ */s("span",{className:"es-field-name",children:g}),null!=r?/* @__PURE__ */s("span",{className:"es-field-value",children:r}):null,p?h(u,e,a):null]}),f?/* @__PURE__ */s("div",{className:"es-field-ctl",children:m}):null,d?/* @__PURE__ */s("p",{className:"es-field-hint",children:d}):null]})}export{u as SettingsField,c as SettingsSegmented,t as SettingsSwitch};
5
+ /* @__PURE__ */i("div",{className:"es-field-head",children:[h?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:h,children:g}):/* @__PURE__ */s("span",{className:"es-field-name",children:g}),null!=r?/* @__PURE__ */s("span",{className:"es-field-value",children:r}):null,p?o(u,e,a):null]}),f?/* @__PURE__ */s("div",{className:"es-field-ctl",children:m}):null,d?/* @__PURE__ */s("p",{className:"es-field-hint",children:d}):null]})}function u({options:e,value:n,onChange:r,ariaLabel:d,fit:c,disabled:t=!1,className:o}){const h=c&&function(e,a){return{"--es-fit-count":e,"--es-fit-labels":`${a.labelsPx}px`,"--es-fit-widest":`${a.widestLabelPx}px`}}(e.length,c),u=e.findIndex(e=>e.id===n);
6
+ /* @__PURE__ */
7
+ return s("div",{className:"es-segs-fit","data-disabled":t||void 0,style:h,children:/* @__PURE__ */s(a,{size:"sm",label:d,className:`es-segs${h?" is-measured":""}${o?` ${o}`:""}`,value:u<0?"":String(u),onChange:a=>r(e[Number(a)].id),options:e.map((e,a)=>{const n=e.title??("string"==typeof e.label?e.label:void 0),r="string"!=typeof e.label,d=a=>n&&(e.icon||r)?/* @__PURE__ */s(l,{content:n,children:a}):a;return{value:String(a),disabled:t||!0===e.disabled,icon:e.icon?d(
8
+ /* @__PURE__ */s("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon})):void 0,label:r?/* @__PURE__ */i("span",{className:"es-seg-word",children:[d(/* @__PURE__ */s("span",{"aria-hidden":"true",children:e.label})),
9
+ /* @__PURE__ */s("span",{className:"es-vh",children:n})]}):/* @__PURE__ */s("span",{className:"es-seg-word",children:e.label})}})})})}export{h as SettingsField,u as SettingsSegmented,c as SettingsSwitch};
@@ -0,0 +1,2 @@
1
+ import{editLockOf as e}from"./chunk-GMCZXMOV.js";import{saveStatusOf as r,resetForDocumentSwitch as n}from"./chunk-HNKB2ZYR.js";import{isExpiredSession as t,readEaselFailure as o}from"./chunk-CLOS6SSX.js";import{routeSharedHostMessage as u}from"./chunk-S4AWJX4Q.js";import{describeLoadFailure as a,hostLoadRefusal as s}from"./chunk-ERR437B5.js";import{useAdminBridge as i}from"./chunk-VPFNZ7TB.js";import{NO_DOCUMENT_ADDRESSING as l}from"./chunk-RLBXE4EU.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-O7Q4DDJT.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-RSCMJIWS.js";import{useEaselHost as k}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as g}from"./chunk-VVPZMWJE.js";import{canWriteDocument as v,newEaselClientId as p,reloadIfVersionMoved as h,openUnansweredClaim as y,FAIL_OPEN_RETRY_MS as w,CLAIM_FAIL_OPEN_MS as S,holderOf as b}from"./chunk-THWO5YVZ.js";import{useAutosave as P}from"./chunk-NDRZP6YR.js";import{useWords as I}from"./chunk-MFIRYGHW.js";import{createContext as j,useContext as R,useState as B,useMemo as O,useCallback as C,useEffect as E,useRef as H}from"react";import{jsx as T}from"react/jsx-runtime";var M={content:[],root:{},zones:{}};var V=j(null);function A(){const e=R(V);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function D({target:j,addressing:R=l,onHostMessage:A,children:D}){const N=R,{homeSlug:F,entryMayBounce:L,entryBounce:W,onSwitch:Z,tellsHost:J,adapterFor:Y,migrateRenamedProps:U,describeMissing:X,onLoadFailed:x}=N,[G,K]=B(j),Q=k(),z=d(),_=O(()=>f(z),[z]),q=O(()=>e(z),[z]),$="template"===G.kind,ee="template"===G.kind?G.id:null,re="template"===G.kind?G.pageSlug??F??"":"document"===G.kind?G.slug??"":G.slug,ne="page"===G.kind?G.siteId??null:null,te=z.blocks,oe=O(()=>Y(G,_,te),[Y,_,te,G.kind,"template"===G.kind?G.id:"document"===G.kind?G.record:G.siteId]),ue=oe.capabilities,ae=C(e=>z.documentHooks?.stored?.(e)??e,[z]),se="page"===G.kind?G.originSlug??null:null;E(()=>{m(z,ne)},[z,ne]);const ie=H(G);E(()=>{ie.current=G},[G]);const{token:le,tokenRef:ce,capabilities:de}=i({onMessage:e=>{if(A?.(e)||u(e))return;const r=e;if("storefront-editor:navigate"===r?.type){const r=e;r?.target&&Or(r.target)}}}),fe=!z.usesBridgedToken||null!==le,me=oe.lock,ke=Boolean(_.lock),[ge,ve]=B(null),[pe,he]=B(null),[ye,we]=B(null),[Se,be]=B(null),Pe=I("screen",g),Ie=Se?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(Se,Pe):null,[je,Re]=B(null),Be=H(null),Oe=H(null),[Ce,Ee]=B(!1),He=H(null),[Te,Me]=B(null),Ve=H(null),[Ae,De]=B(null),[Ne,Fe]=B(!1),Le=H(null);E(()=>{Le.current=Ae},[Ae]);const[We,Ze]=B(ue.hasEditLock?{kind:"checking"}:{kind:"editing"}),Je=H(We);E(()=>{Je.current=We},[We]);const Ye=H(()=>Promise.resolve(!1)),Ue=C(e=>{Oe.current=e,Ee(!0)},[]),Xe=P({save:async({id:e,data:r})=>{if(v(Je.current)){if(!await Ye.current(e,r)){if(!v(Je.current))return void Ue({id:e,data:r});throw new Error("page save did not land")}}else Ue({id:e,data:r})},onFailure:(e,r)=>{0===r&&Q.send("storefront-editor:save-failed")}}),{state:xe,push:Ge,flush:Ke,pause:Qe,resume:ze,stop:_e,reset:qe,retryNow:$e,hasPending:er}=Xe,rr=H(xe);E(()=>{rr.current=xe},[xe]);const nr=r(xe),tr=C(()=>{const e=Oe.current;e&&(Oe.current=null,Ee(!1),Ge(e))},[Ge]),or=H("");or.current||(or.current=p());const[ur,ar]=B(0),sr=H(!1),[ir,lr]=B(L(j)),cr=H(!1);E(()=>{if(cr.current)return;cr.current=!0;const e=Q.address.search(),r=W(j,e);r?Q.address.load(r):L(j)&&lr(!1)},[j,Q]);const dr=Q.send;E(()=>{if(!fe)return;let e=!1;const r=ie.current,n=oe.resolve(re),t=z.documentHooks?.opening?.({slug:re,isTemplate:$,capabilities:ue});return n.then(async n=>{if(e)return;if(!n)return"page"===r.kind&&null!==F&&re!==F?void Q.address.load({kind:"page",slug:F,siteId:ne??void 0}):(be({target:r,slug:re,missing:!0,sentence:X?.(r)??null}),void x?.(r,null));const o=n.readOnlyReason?n.readOnlyReason:null;Be.current=o,Re(o),ve(n.id),he(n.kind??null),Ve.current=n.version??null;const u=n.layout,a=u&&Object.keys(u).length?u:M,s=U(a),i=t?await t(s):s;e||we(i)}).catch(n=>{e||(console.error("[storefront-editor] document load failed",n),be({target:r,slug:re,missing:!1,sentence:s(n,{slug:re},z),cause:a(n,z)}),x?.(r,n))}),()=>{e=!0}},[fe,le,$,oe,re]);const fr=C(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=ce.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),mr=C(async e=>{const r=ce.current;if(!r&&z.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(t(n,z)){dr("storefront-editor:auth-expired");const n=r?await fr(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[dr,fr,z]),kr=C(async e=>{const r=ce.current?await mr(e):{ok:!1};return r.ok||dr("storefront-editor:save-failed"),r.ok},[dr,mr]),gr=C(async(e,r,n=!1)=>{if(null!==Be.current)return!1;if(!v(Je.current))return!1;if(Le.current)return!1;const t=await mr(()=>oe.saveLayout(e,r,Ve.current,or.current));if(t.ok)return Ve.current=t.value.version??Ve.current,Fe(!1),!0;const u=q.readLockTaken(t.error);if(u){const e={kind:"takenover",holder:u};return Je.current=e,Ze(e),!1}const a=q.readSaveConflict(t.error);if(a){if(a.savedByYou&&!n&&oe.rereadVersion){const n=await mr(()=>oe.rereadVersion(e));if(n.ok&&n.value)return Ve.current=n.value,Ye.current(e,r,!0)}_e(),Le.current=a,De(a)}return Fe(o(t.error,z)?.status===c),!1},[oe,mr,_e,z]);E(()=>{Ye.current=gr},[gr]);const vr=C(e=>{if(null!==Be.current)return;if(dr("storefront-editor:dirty"),!ge)return;const r=ae(e);He.current=r,v(Je.current)?Ge({id:ge,data:r}):Ue({id:ge,data:r})},[ge,dr,Ue,Ge,ae]),pr=C(async()=>{v(Je.current)&&tr();return await Ke()&&null==Oe.current},[tr,Ke]),hr=H(pr);E(()=>{hr.current=pr},[pr]);const yr=H(mr);E(()=>{yr.current=mr},[mr]);const wr=C(()=>{Q.address.reload()},[Q]),Sr=H(()=>Promise.resolve(!1));E(()=>{Sr.current=()=>{const e=oe.rereadVersion;return ge&&e?h({ours:Ve.current,stored:async()=>{const r=await yr.current(()=>e(ge));return r.ok?r.value:null},hasPending:()=>null!=Oe.current||er(),reload:wr}):Promise.resolve(!1)}},[oe,ge,er,wr]);const br=null!==je;E(()=>{if(!me||!ge||!fe||br)return;let e=!1,r=null,n=null;const t=or.current,o={claim:async e=>{const r=await yr.current(()=>me.claim(ge,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Je.current,heldWrite:()=>({pending:null!=Oe.current||er(),autoSaveEnabled:!rr.current.paused,saveConflict:null!=Le.current}),setAccess:e=>{Je.current=e,Ze(e)},releaseHeldWrite:()=>{hr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{Sr.current()}},u=q.makeClaimBeat(o),a=sr.current;return sr.current=!1,a||(Ze({kind:"checking"}),n=setTimeout(()=>{n=null,y(o)&&o.startHeartbeat(w)},S)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),me.release(ge,t).catch(()=>{})}},[ge,me,fe,le,ur,br]);const Pr=C(()=>{me&&ge&&(sr.current=!0,ar(e=>e+1))},[ge,me]),Ir=C(()=>{Ze(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),jr=C(()=>{rr.current.paused?(v(Je.current)&&tr(),ze()):Qe()},[tr,Qe,ze]),Rr=C(()=>{$e()},[$e]),Br=C(e=>{He.current=null,n("template"!==e.kind&&ke,{resetAutosave:()=>{qe(),Oe.current=null,Ee(!1)},setVersion:e=>{Ve.current=e},setSaveConflict:De,setAccess:Ze}),Z(e),K(e),Be.current=null,Re(null),ve(null),he(null),we(null),be(null),Q.address.show(e),"document"!==e.kind&&J(e)&&Q.send("storefront-editor:navigated",{target:e})},[qe,Q,ke,Z,J]),Or=C(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,ie.current,F))return;const r=null!=Oe.current;if(!r&&!er())return void Br(e);const n=rr.current;r||n.paused||n.failed||n.stopped?Me(e):Ke().then(r=>{r?Br(e):Me(e)})},[Br,er,Ke,F]),Cr=C(()=>Me(null),[]),Er=C(()=>{Me(e=>(e&&Br(e),null))},[Br]),Hr=C(async()=>{const e=Te;if(!e)return;await pr()&&(Me(null),Br(e))},[Te,pr,Br]),Tr=C(async e=>{if(null!==Be.current)return;if(!ge)return;if(!v(Je.current)||Le.current)return;const r=ae(e);if(!await gr(ge,r))return void(Le.current||dr("storefront-editor:save-failed"));const n=oe.publish;if(!ue.canPublish||!n)return void dr("storefront-editor:saved");const t=await mr(()=>n(ge,Ve.current??void 0));t.ok?(Ve.current=t.value.version??Ve.current,dr("storefront-editor:published")):dr("storefront-editor:save-failed")},[ge,oe,ue.canPublish,dr,gr,mr,ae]);/* @__PURE__ */
2
+ return T(V.Provider,{value:{target:G,adapter:oe,capabilities:ue,templateId:ee,currentSlug:re,currentKind:pe,siteId:ne,ready:fe,token:le,tokenRef:ce,notifyParent:dr,bridgeCapabilities:de,runAuthed:kr,docId:ge,data:ye,getLiveData:()=>He.current??ye,footerOriginSlug:se,error:Ie,redirecting:ir,saveStatus:nr,saveState:xe,autoSaveEnabled:!xe.paused,autoSaveStoppedByConflict:xe.stopped,hasUnsavedEdits:xe.pending||Ce,toggleAutoSave:jr,retrySave:Rr,onChange:vr,flushSave:pr,onPublish:Tr,access:We,readOnly:null!==b(We)||null!==je||null!==Ae,readOnlyReason:je,takeOverEditing:Pr,viewReadOnly:Ir,saveConflict:Ae,saveUnreachable:Ne,reloadFromServer:wr,navigate:Or,pendingNav:Te,cancelPendingNav:Cr,discardAndNavigate:Er,saveAndNavigate:Hr},children:D})}export{V as ScreenDocumentContext,D as ScreenDocumentProvider,A as useScreenDocument};
@@ -1 +1 @@
1
- import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-SJPKSE5G.js";import{useState as r,useEffect as o,useRef as u}from"react";function c(e){const t=n(),[u,c]=r(null);return o(()=>c(e.current),[e]),t.ownsDocument?"undefined"==typeof document?null:document:u}function i(r,u){const i=n(),s=e(),f=c(r);o(()=>{if(!i.ownsDocument&&f)return t(f,s,{leaveTyping:!0})},[i,s,f]);const m=u?.document??null;o(()=>{if(!i.ownsDocument&&m)return t(m,s,{leaveTyping:!0})},[i,s,m])}function s(n){return n.ownsDocument?{}:{tabIndex:-1}}function f(n){return!n.altKey&&!n.shiftKey&&(!(!n.metaKey&&!n.ctrlKey)&&("s"===n.key||"S"===n.key||"KeyS"===n.code))}function m(n,e,t){const r=c(n),i=u(t);o(()=>{i.current=t}),o(()=>{if(!r)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[r]);const s=e?.document??null;o(()=>{if(!s)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return s.addEventListener("keydown",n),()=>s.removeEventListener("keydown",n)},[s])}export{s as editorRootFocus,f as isSaveShortcut,c as useEaselKeyTarget,m as useEaselSaveKey,i as useEaselUndoKeys};
1
+ import{useEaselHost as n}from"./chunk-U3JP4VGF.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-KE2CXEIK.js";import{useState as r,useEffect as o,useRef as u}from"react";function c(e){const t=n(),[u,c]=r(null);return o(()=>c(e.current),[e]),t.ownsDocument?"undefined"==typeof document?null:document:u}function i(r,u){const i=n(),s=e(),f=c(r);o(()=>{if(!i.ownsDocument&&f)return t(f,s,{leaveTyping:!0})},[i,s,f]);const m=u?.document??null;o(()=>{if(!i.ownsDocument&&m)return t(m,s,{leaveTyping:!0})},[i,s,m])}function s(n){return n.ownsDocument?{}:{tabIndex:-1}}function f(n){return!n.altKey&&!n.shiftKey&&(!(!n.metaKey&&!n.ctrlKey)&&("s"===n.key||"S"===n.key||"KeyS"===n.code))}function m(n,e,t){const r=c(n),i=u(t);o(()=>{i.current=t}),o(()=>{if(!r)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[r]);const s=e?.document??null;o(()=>{if(!s)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return s.addEventListener("keydown",n),()=>s.removeEventListener("keydown",n)},[s])}export{s as editorRootFocus,f as isSaveShortcut,c as useEaselKeyTarget,m as useEaselSaveKey,i as useEaselUndoKeys};
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-U7KFFC7N.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-IE55HNMA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
1
+ import{useScreenOwnerName as e}from"./chunk-WP7AZDCV.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-IE55HNMA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
2
2
  return o(r,{children:[
3
3
  /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
4
4
  /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};