efficient-easel 16.1.0 → 17.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 (128) hide show
  1. package/README.md +23 -64
  2. package/dist/autosave/index.d.ts +4 -4
  3. package/dist/blocks/index.d.ts +2 -2
  4. package/dist/chrome/index.d.ts +3 -3
  5. package/dist/chrome/index.js +1 -1
  6. package/dist/{chunk-UVQR7W6I.js → chunk-3ERZNZ5S.js} +1 -1
  7. package/dist/{chunk-2H3W5OLQ.js → chunk-4UBYPRAS.js} +1 -1
  8. package/dist/{chunk-ATOXCKEE.js → chunk-7TOQCTHV.js} +3 -3
  9. package/dist/chunk-BU2YSTLJ.js +14 -0
  10. package/dist/{chunk-VVPZMWJE.js → chunk-EL4F3IN7.js} +1 -1
  11. package/dist/chunk-EXCIHRAE.js +4 -0
  12. package/dist/{chunk-HV56SLR2.js → chunk-FJL3MYPA.js} +1 -1
  13. package/dist/{chunk-IE55HNMA.js → chunk-GWIVPLOX.js} +11 -11
  14. package/dist/chunk-INIPQLPR.js +1 -0
  15. package/dist/{chunk-RFSLDGDA.js → chunk-JSH3XKEF.js} +1 -1
  16. package/dist/chunk-M2Z775ZC.js +1 -0
  17. package/dist/chunk-MI54XTWD.js +5 -0
  18. package/dist/chunk-MTNBJPXX.js +2 -0
  19. package/dist/{chunk-K6EM4F5N.js → chunk-N3LYD2LK.js} +11 -11
  20. package/dist/{chunk-V6VKM2QX.js → chunk-NFLO4I2N.js} +1 -1
  21. package/dist/chunk-OLRLHE5K.js +7 -0
  22. package/dist/chunk-SHS6WCLL.js +1 -0
  23. package/dist/chunk-SPQOPWCL.js +5 -0
  24. package/dist/{chunk-TZIIRGVY.js → chunk-U277UX5I.js} +1 -1
  25. package/dist/{chunk-GPLMNRHR.js → chunk-V63ERBLW.js} +1 -1
  26. package/dist/chunk-WR3EVON3.js +57 -0
  27. package/dist/{chunk-62VPYC7F.js → chunk-XDZHKYQX.js} +1 -1
  28. package/dist/chunk-XLUVTPKK.js +1 -0
  29. package/dist/{chunk-2L2L7G5L.js → chunk-Z72CYM3L.js} +1 -1
  30. package/dist/copy/index.js +23 -11
  31. package/dist/draw/client.js +1 -1
  32. package/dist/draw/index.js +1 -1
  33. package/dist/easel/index.d.ts +35 -6
  34. package/dist/easel/index.js +1 -1
  35. package/dist/fields/index.js +1 -1
  36. package/dist/gold/gold.css +1 -1
  37. package/dist/{host-DGmdCaNL.d.ts → host-Cxbhp0zg.d.ts} +0 -4
  38. package/dist/icons/index.d.ts +0 -2
  39. package/dist/node-ops/index.d.ts +2 -2
  40. package/dist/node-ops/index.js +1 -1
  41. package/dist/panel/index.js +1 -1
  42. package/dist/{plan-CGREINRO.d.ts → plan-2BLk7pWs.d.ts} +19 -1
  43. package/dist/rail/index.d.ts +2 -2
  44. package/dist/screen/components/AddBlockRow.js +1 -1
  45. package/dist/screen/components/AddSidePanel.js +1 -1
  46. package/dist/screen/components/MediaSidePanel.d.ts +3 -3
  47. package/dist/screen/components/MediaSidePanel.js +1 -1
  48. package/dist/screen/components/NodeContextMenu.d.ts +6 -6
  49. package/dist/screen/components/NodeContextMenu.js +1 -1
  50. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  51. package/dist/screen/components/SaveControls.d.ts +5 -5
  52. package/dist/screen/components/SaveControls.js +1 -1
  53. package/dist/screen/components/ScreenChrome.js +1 -1
  54. package/dist/screen/components/ScreenDocumentContext.d.ts +3 -3
  55. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  56. package/dist/screen/components/ScreenMount.d.ts +5 -5
  57. package/dist/screen/components/ScreenMount.js +1 -1
  58. package/dist/screen/components/ScreenStoreProvider.d.ts +5 -5
  59. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  60. package/dist/screen/components/SectionScreenShell.js +16 -16
  61. package/dist/screen/components/SidePanelHead.js +1 -1
  62. package/dist/screen/components/panel-widths.js +1 -1
  63. package/dist/screen/components/usePartBridge.d.ts +5 -5
  64. package/dist/screen/components/usePartBridge.js +1 -1
  65. package/dist/screen/index.d.ts +5 -5
  66. package/dist/screen/index.js +1 -1
  67. package/dist/screen/lib/admin-bridge.d.ts +2 -2
  68. package/dist/screen/lib/document-addressing.d.ts +3 -3
  69. package/dist/screen/lib/document-hooks.d.ts +2 -2
  70. package/dist/screen/lib/host-chrome.d.ts +0 -10
  71. package/dist/screen/lib/host.d.ts +3 -3
  72. package/dist/screen/lib/key-scope.js +1 -1
  73. package/dist/screen/lib/media-panel.d.ts +3 -3
  74. package/dist/screen/lib/media-picker.d.ts +3 -3
  75. package/dist/screen/lib/page-lock.d.ts +2 -2
  76. package/dist/screen/lib/puck/block-choice.d.ts +13 -1
  77. package/dist/screen/lib/puck/block-choice.js +1 -1
  78. package/dist/screen/lib/puck/device-fields.js +1 -1
  79. package/dist/screen/lib/puck/palette-sections.d.ts +2 -2
  80. package/dist/screen/lib/puck/section-doc.d.ts +2 -2
  81. package/dist/screen/lib/puck/style-clipboard.d.ts +5 -5
  82. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  83. package/dist/screen/lib/puck/use-section-ops.d.ts +2 -2
  84. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  85. package/dist/screen/lib/save-status.d.ts +2 -2
  86. package/dist/screen/lib/screen-parts.d.ts +5 -27
  87. package/dist/screen/lib/screen-parts.js +1 -1
  88. package/dist/screen/lib/section-templates.d.ts +2 -2
  89. package/dist/screen/lib/session-context.d.ts +2 -2
  90. package/dist/screen/lib/session.d.ts +2 -2
  91. package/dist/screen/words.d.ts +0 -2
  92. package/dist/screen/words.js +1 -1
  93. package/dist/shell/shell.css +6 -1
  94. package/dist/strings/index.d.ts +134 -20
  95. package/dist/strings/index.js +2 -2
  96. package/dist/text-styles/index.js +26 -26
  97. package/dist/{types-CsgMwHHa.d.ts → types-Cy7rdmXt.d.ts} +1 -1
  98. package/dist/{types-DGyDHiJV.d.ts → types-DT8ywrFQ.d.ts} +1 -1
  99. package/dist/{types-NQozKWEz.d.ts → types-kR_4wYBw.d.ts} +1 -1
  100. package/dist/{useNodeOps-BHRkUFfG.d.ts → useNodeOps-B0XZ8Bl8.d.ts} +1 -1
  101. package/dist/{words-pgIK0I6g.d.ts → words-DkWcK1rh.d.ts} +2 -2
  102. package/package.json +2 -41
  103. package/dist/chunk-44COUKXO.js +0 -5
  104. package/dist/chunk-4BGYVIDQ.js +0 -57
  105. package/dist/chunk-ECM5F6JJ.js +0 -1
  106. package/dist/chunk-H4UMY7QF.js +0 -13
  107. package/dist/chunk-HMXIAMCU.js +0 -1
  108. package/dist/chunk-HQ4VVRIC.js +0 -1
  109. package/dist/chunk-IN22IYOM.js +0 -1
  110. package/dist/chunk-JQOYUH4A.js +0 -7
  111. package/dist/chunk-L2VGRQ4R.js +0 -4
  112. package/dist/chunk-L3GSW4XI.js +0 -1
  113. package/dist/chunk-QX7GVECM.js +0 -13
  114. package/dist/chunk-U25CP5VX.js +0 -5
  115. package/dist/chunk-XQGV2XAK.js +0 -1
  116. package/dist/chunk-ZZ64CEC2.js +0 -2
  117. package/dist/gold/index.d.ts +0 -283
  118. package/dist/gold/index.js +0 -1
  119. package/dist/icons/meanings.d.ts +0 -1
  120. package/dist/icons/meanings.js +0 -1
  121. package/dist/index.d.ts +0 -6
  122. package/dist/index.js +0 -1
  123. package/dist/markup/index.d.ts +0 -1
  124. package/dist/markup/index.js +0 -1
  125. package/dist/shell/index.d.ts +0 -195
  126. package/dist/shell/index.js +0 -1
  127. package/dist/strings/catalogue.d.ts +0 -139
  128. package/dist/strings/catalogue.js +0 -1
@@ -5,11 +5,11 @@ import { WebsiteEditLock } from './document-contract.js';
5
5
  import { EaselDocumentHooks } from './document-hooks.js';
6
6
  import { SectionTemplateStore } from './section-template-types.js';
7
7
  import 'react';
8
- import '../../types-NQozKWEz.js';
8
+ import '../../types-kR_4wYBw.js';
9
9
  import '../../data/index.js';
10
10
  import '../../types-41704JE4.js';
11
11
  import '../../resolve-D68pb3Bx.js';
12
- import '../../plan-CGREINRO.js';
12
+ import '../../plan-2BLk7pWs.js';
13
13
  import '../../edit-lock/index.js';
14
14
  import './links/link-filters.js';
15
15
  import 'efficient-shell/ui';
@@ -274,8 +274,6 @@ type ScreenWords = {
274
274
  collapseAll: string;
275
275
  /** …its tooltip while the page has nothing to fold, and the button is off. */
276
276
  nothingToFold: string;
277
- /** The pinned Footer's row where the page has no footer of its own: its tooltip. */
278
- editFooter: string;
279
277
  /** The box a row's name is typed in: its accessible name. */
280
278
  rename: string;
281
279
  /** A row's trash and eye, naming the row. */
@@ -1 +1 @@
1
- export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-VVPZMWJE.js";
1
+ export{DEFAULT_SCREEN_ADD_WORDS,DEFAULT_SCREEN_SAVE_STATUS_WORDS,DEFAULT_SCREEN_WORDS}from"../chunk-EL4F3IN7.js";
@@ -60,7 +60,12 @@
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 the themed primary fill) —
64
+ SHELL GAP (#199): the shell has no token yet for an accent wash
65
+ (tint, tint-strong), an accent hairline (line), accent words (text), an
66
+ accent shadow, or ink on a solid fill (on-accent: its nearest is the status
67
+ tier's `--status-on-solid`). Each is MIXED from shell tokens until the
68
+ shell has one; none is a value of our own. */
64
69
  --es-accent: var(--accent-600, var(--submit-bg));
65
70
  --es-accent-tint: color-mix(in srgb, var(--es-accent) 10%, var(--surface));
66
71
  --es-accent-tint-strong: color-mix(in srgb, var(--es-accent) 18%, var(--surface));
@@ -1,27 +1,141 @@
1
- import { DeepPartial, EaselStrings } from './catalogue.js';
2
- export { CanvasWords, DEFAULT_EASEL_STRINGS, RailWords, mergeEaselStrings } from './catalogue.js';
1
+ import { a as SaveWords } from '../words-DkWcK1rh.js';
2
+ import { N as NoticeWords, C as ChromeWords } from '../words-BpiVrsW5.js';
3
+ import { C as CopyWords } from '../words-D-yhjdOg.js';
4
+ import { D as DragWords } from '../words-CvwYvkJm.js';
5
+ import { LockWords } from '../edit-lock/index.js';
6
+ import { F as FieldsWords } from '../words-vhnV8sM7.js';
7
+ import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
8
+ import { P as PanelWords } from '../words-zH1H0WFw.js';
9
+ import { P as PickWords } from '../words-DWvCJXwR.js';
10
+ import { ScreenWords } from '../screen/words.js';
11
+ export { ScreenAddWords } from '../screen/words.js';
12
+ import { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
13
+ import { T as TextStylesWords } from '../words-gIDCeRv3.js';
14
+ import { T as TreeWords } from '../words-Cl9xMUYY.js';
3
15
  import * as react from 'react';
4
16
  import { ReactNode } from 'react';
5
- export { C as ChromeWords, N as NoticeWords } from '../words-BpiVrsW5.js';
6
- export { C as CopyWords } from '../words-D-yhjdOg.js';
7
- export { D as DragWords } from '../words-CvwYvkJm.js';
8
- export { F as FieldsWords } from '../words-vhnV8sM7.js';
9
- export { LockWords } from '../edit-lock/index.js';
10
- export { N as NodeMenuWords } from '../words-DMG4dYq2.js';
11
- export { P as PanelWords } from '../words-zH1H0WFw.js';
12
- export { P as PickWords } from '../words-DWvCJXwR.js';
13
- export { S as SaveWords } from '../words-pgIK0I6g.js';
14
- export { ScreenAddWords, ScreenWords } from '../screen/words.js';
15
- export { S as StyleClipboardWords } from '../words-CnnHb9jo.js';
16
- export { T as TextStylesWords } from '../words-gIDCeRv3.js';
17
- export { T as TreeWords } from '../words-Cl9xMUYY.js';
18
- import 'efficient-shell/markup';
19
- import '../buckets-Tj-nkBpg.js';
20
- import '../types-DGyDHiJV.js';
21
- import '../types-CsgMwHHa.js';
17
+ import '../types-DT8ywrFQ.js';
18
+ import '../types-Cy7rdmXt.js';
22
19
  import '../wordFit-7XpmhcaW.js';
23
20
  import '../panelWidths-D9hTLR25.js';
24
21
  import '../engine-CvXpFE86.js';
22
+ import 'efficient-shell/markup';
23
+ import '../buckets-Tj-nkBpg.js';
24
+
25
+ /**
26
+ * The easel canvas's own words (`efficient-easel/strings`, 0.95.0): what the
27
+ * frame is called when the host does not name it (`title`), and the name of
28
+ * the bar of text tools that floats above words typed on the canvas.
29
+ *
30
+ * A plain module with no import.
31
+ */
32
+ type CanvasWords = {
33
+ /** The canvas frame's accessible name. */
34
+ frame: string;
35
+ /** The floating bar of text tools over the words being typed (its group's name). */
36
+ textTools: string;
37
+ };
38
+
39
+ /**
40
+ * The rail's own words. There is one: what the toolbar is called when the host
41
+ * does not name it (`ariaLabel`). Every other word on the rail is an item's
42
+ * `label`, and those are the host's.
43
+ *
44
+ * A plain module with no import, so the rail stays the leaf it is
45
+ * (`tests/rail-leaf-safety.test.tsx`). It is NOT exported from `./index`: the
46
+ * rail's runtime exports are pinned (`tests/rail-public-shape.test.tsx`), and a
47
+ * host reads these through `efficient-easel/strings`.
48
+ */
49
+ type RailWords = {
50
+ /** The toolbar's accessible name. */
51
+ label: string;
52
+ };
53
+
54
+ /**
55
+ * THE ENGINE'S OWN WORDS, as one catalogue a host can translate (0.95.0).
56
+ *
57
+ * Every word and sentence this package itself draws or returns — visible text,
58
+ * `aria-label`s, tooltips, placeholders — is an entry here, grouped by the
59
+ * module that says it. What a HOST supplies (a block's name, a field's label, a
60
+ * tile's caption, the document's noun) was never the engine's and is not here —
61
+ * with one exception: the assembled screen (`efficient-easel/screen`) draws the
62
+ * edit notice itself, so the noun it says it with is a word of its own group,
63
+ * the website's "page" until a host says another.
64
+ *
65
+ * - A plain word is a `string`.
66
+ * - Anything with a value in it, or a count that can be one or many, is a
67
+ * function: the host puts the value where its language wants it and does
68
+ * its own plural.
69
+ *
70
+ * ── Where the English lives ───────────────────────────────────────────────
71
+ * In each module's own `words.ts`, NOT here. A leaf may only import its own
72
+ * lane (`tests/*-leaf-safety`), and several are held to a bundle that never
73
+ * spells a browser global — while one sentence below does ("another tab or
74
+ * window"). So a module owns its group and its defaults, and this file only
75
+ * puts the groups side by side. `DEFAULT_EASEL_STRINGS.pick` IS the pickers'
76
+ * own default object, not a copy of it.
77
+ *
78
+ * ── Framework-free ────────────────────────────────────────────────────────
79
+ * No React, no browser global, nothing run at import but object literals
80
+ * (`tests/strings-leaf-safety.test.ts`), so `efficient-easel/strings`, which
81
+ * re-exports it beside the provider, creates nothing at import. A host's
82
+ * server-side test reads `DEFAULT_EASEL_STRINGS` from there. The provider and
83
+ * the hooks are in ./provider.
84
+ */
85
+
86
+ /** Every word the engine says, by the module that says it. */
87
+ interface EaselStrings {
88
+ /** `efficient-easel/chrome` — `EditNotice`: who holds the document, a refused save. */
89
+ notice: NoticeWords;
90
+ /** `efficient-easel/edit-lock` — "2 minutes ago", "Someone else". */
91
+ lock: LockWords;
92
+ /** `efficient-easel/autosave` — the save pill. */
93
+ save: SaveWords;
94
+ /** `efficient-easel/chrome` — the device switch, "up one level", the panel grip. */
95
+ chrome: ChromeWords;
96
+ /** `efficient-easel/rail` — the toolbar's name. */
97
+ rail: RailWords;
98
+ /** `efficient-easel/tree` — the drag hint and the caret. */
99
+ tree: TreeWords;
100
+ /** `efficient-easel/panel` — the tab strip's name and each tab's word. */
101
+ panel: PanelWords;
102
+ /** `efficient-easel/fields` — the number box, the dropdown, the list field. */
103
+ fields: FieldsWords;
104
+ /** `efficient-easel/pick` — the colour row and the image box. */
105
+ pick: PickWords;
106
+ /** `efficient-easel/drag` — the Add panel and the canvas layer. */
107
+ drag: DragWords;
108
+ /** `efficient-easel/node-ops` — the right-click rows. */
109
+ menu: NodeMenuWords;
110
+ /** `efficient-easel/style-clipboard` — Copy style, Paste style and what a paste says. */
111
+ styleClipboard: StyleClipboardWords;
112
+ /** `efficient-easel/copy` — the formatting bar, alignment, the link window, each mark. */
113
+ copy: CopyWords;
114
+ /** `efficient-easel/easel` — the canvas frame's name. */
115
+ canvas: CanvasWords;
116
+ /** `efficient-easel/text-styles` — the Email styles / Site styles list (E6). */
117
+ textStyles: TextStylesWords;
118
+ /** `efficient-easel/screen` — a document opening, one that will not, the
119
+ * notice's word for the document, the Layers tree's frame, the Add panel,
120
+ * the main button and the block keys. */
121
+ screen: ScreenWords;
122
+ }
123
+ /** Today's English, word for word. */
124
+ declare const DEFAULT_EASEL_STRINGS: EaselStrings;
125
+ /**
126
+ * A catalogue with any part left out. A function entry is taken whole or not
127
+ * at all: it has no "part" to leave out.
128
+ */
129
+ type DeepPartial<T> = T extends (...args: never[]) => unknown ? T : T extends object ? {
130
+ [K in keyof T]?: DeepPartial<T[K]>;
131
+ } : T;
132
+ /**
133
+ * `defaults` with every entry `partial` gives laid over it. Whatever `partial`
134
+ * leaves out (or gives as `undefined` / `null`) keeps the default, so a host
135
+ * that has translated half the catalogue shows the other half in English
136
+ * rather than as nothing. Neither argument is changed.
137
+ */
138
+ declare function mergeEaselStrings(defaults: EaselStrings, partial?: DeepPartial<EaselStrings> | null): EaselStrings;
25
139
 
26
140
  interface EaselStringsProviderProps {
27
141
  /**
@@ -58,4 +172,4 @@ declare function useEaselStrings(): EaselStrings;
58
172
  /** The nearest provider's locale, or `'en'`. */
59
173
  declare function useEaselLocale(): string;
60
174
 
61
- export { DeepPartial, EaselStrings, EaselStringsProvider, type EaselStringsProviderProps, useEaselLocale, useEaselStrings };
175
+ export { type CanvasWords, ChromeWords, CopyWords, DEFAULT_EASEL_STRINGS, type DeepPartial, DragWords, type EaselStrings, EaselStringsProvider, type EaselStringsProviderProps, FieldsWords, LockWords, NodeMenuWords, NoticeWords, PanelWords, PickWords, type RailWords, SaveWords, ScreenWords, StyleClipboardWords, TextStylesWords, TreeWords, mergeEaselStrings, useEaselLocale, useEaselStrings };
@@ -1,2 +1,2 @@
1
- import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-IN22IYOM.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-IN22IYOM.js";import"../chunk-OGH6CC3E.js";import"../chunk-OFBZOI6W.js";import"../chunk-VVPZMWJE.js";import"../chunk-6WY6ZXJG.js";import"../chunk-WK3AFPXY.js";import"../chunk-KAML3KQH.js";import"../chunk-TBY3DFKS.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Z6PVRXVY.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-B4JN227A.js";import"../chunk-WRFD4EXD.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
2
- return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
1
+ import{DEFAULT_SCREEN_WORDS as r}from"../chunk-EL4F3IN7.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as o}from"../chunk-6WY6ZXJG.js";import{DEFAULT_TEXT_STYLES_WORDS as n}from"../chunk-OGH6CC3E.js";import{DEFAULT_PICK_WORDS as t}from"../chunk-OFBZOI6W.js";import{DEFAULT_CANVAS_WORDS as c}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as e}from"../chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as m}from"../chunk-WK3AFPXY.js";import{DEFAULT_PANEL_WORDS as i}from"../chunk-KFV7N2DJ.js";import{DEFAULT_SAVE_WORDS as s}from"../chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as u,DEFAULT_NOTICE_WORDS as f}from"../chunk-Z6PVRXVY.js";import{DEFAULT_RAIL_WORDS as p}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as l}from"../chunk-RE4LP46F.js";import{DEFAULT_COPY_WORDS as h}from"../chunk-B4JN227A.js";import{DEFAULT_FIELDS_WORDS as j}from"../chunk-WRFD4EXD.js";import{stringsContext as k}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as a}from"../chunk-KAML3KQH.js";import{useContext as F,useMemo as Y}from"react";import{jsx as y}from"react/jsx-runtime";var D={notice:f,lock:l,save:s,chrome:u,rail:p,tree:e,panel:i,fields:j,pick:t,drag:a,menu:m,styleClipboard:o,copy:h,canvas:c,textStyles:n,screen:r},d=r=>"object"==typeof r&&null!==r;function v(r,o){const n={};for(const t of Object.keys(r)){const c=r[t],e=o[t];null==e?n[t]=c:d(c)?n[t]=d(e)?v(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function K(r,o){return o?v(r,o):r}function W({value:r,locale:o,children:n}){const t=k(),c=F(t),e=c?.strings??D,m=o??c?.locale??"en",i=Y(()=>({strings:K(e,r),locale:m}),[e,r,m]);/* @__PURE__ */
2
+ return y(t.Provider,{value:i,children:n})}function H(){return F(k())?.strings??D}function O(){return F(k())?.locale??"en"}export{D as DEFAULT_EASEL_STRINGS,W as EaselStringsProvider,K as mergeEaselStrings,O as useEaselLocale,H as useEaselStrings};
@@ -1,36 +1,36 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as e}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import{hexReadout as s,ColourWindow as t,typedHex as a}from"../chunk-U6LJ5UKD.js";import"../chunk-OFBZOI6W.js";import{FieldSlider as n}from"../chunk-XWFH2NHZ.js";import{withTip as l}from"../chunk-P2VEMZH5.js";import{TEXT_STYLE_KINDS as i,canAddTextStyle as r,TEXT_STYLE_MAX as o,isDefaultTextStyle as d,CAMPAIGN_TEXT_STYLE_SETTINGS as c,TEXT_STYLE_SETTINGS as u,textStyleRowSize as m,describeTextStyle as h,updateTextStyle as f,textStyleCaseCss as p,TEXT_STYLE_CASES as v,addTextStyle as y,removeTextStyle as S,TEXT_STYLE_RANGES as g}from"../chunk-YHZSBL2N.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,updateTextStyle,weightWord}from"../chunk-YHZSBL2N.js";import{FieldSelect as b}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{useWords as k}from"../chunk-MFIRYGHW.js";import{hsvToHex as N,Tooltip as C,ColorSwatch as x,IconButton as T}from"efficient-shell/ui";import{useState as w,useRef as z,useId as E,useEffect as O,Fragment as _}from"react";import{TrashIcon as L,ChevronIcon as A,BoldIcon as j,ItalicIcon as M,CaseLowerIcon as W,CaseCapitalizedIcon as $,CaseUpperIcon as D,CaseNormalIcon as X}from"efficient-shell/icons/efficient";import{jsxs as Y,jsx as I,Fragment as F}from"react/jsx-runtime";var G=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>N({h:e,s:1,v:1})).join(", ")})`;function H({value:e,hex:a,colours:n,label:l,followsWord:i,anyWord:r,onChange:o,readOnly:d=!1}){const[c,u]=w(!1),m=z(null),h=z(null),f=E(),p=void 0!==e&&n.some(s=>s.key===e),v=void 0!==e&&!p;return O(()=>{if(!c)return;const e=m.current?.ownerDocument;if(!e)return;const s=e=>{m.current&&!m.current.contains(e.target)&&u(!1)};return e.addEventListener("click",s,!0),()=>e.removeEventListener("click",s,!0)},[c]),/* @__PURE__ */Y("div",{ref:m,className:"es-ts-set","data-ts-setting":"color",children:[
1
+ import{hexReadout as e,ColourWindow as s,typedHex as t}from"../chunk-U6LJ5UKD.js";import{DEFAULT_TEXT_STYLES_WORDS as a}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import"../chunk-OFBZOI6W.js";import{FieldSlider as n}from"../chunk-XWFH2NHZ.js";import{TEXT_STYLE_KINDS as l,canAddTextStyle as i,TEXT_STYLE_MAX as r,isDefaultTextStyle as o,CAMPAIGN_TEXT_STYLE_SETTINGS as d,TEXT_STYLE_SETTINGS as c,textStyleRowSize as u,describeTextStyle as m,updateTextStyle as h,textStyleCaseCss as f,TEXT_STYLE_CASES as p,addTextStyle as v,removeTextStyle as y,TEXT_STYLE_RANGES as S}from"../chunk-YHZSBL2N.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,updateTextStyle,weightWord}from"../chunk-YHZSBL2N.js";import{FieldSelect as g}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{useWords as b}from"../chunk-MFIRYGHW.js";import{withTip as k}from"../chunk-P2VEMZH5.js";import{hsvToHex as N,Tooltip as C,ColorSwatch as x,IconButton as T}from"efficient-shell/ui";import{useState as w,useRef as z,useId as E,useEffect as O,Fragment as _}from"react";import{TrashIcon as L,ChevronIcon as A,BoldIcon as j,ItalicIcon as M,CaseLowerIcon as W,CaseCapitalizedIcon as $,CaseUpperIcon as D,CaseNormalIcon as X}from"efficient-shell/icons/efficient";import{jsxs as Y,jsx as I,Fragment as F}from"react/jsx-runtime";var G=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>N({h:e,s:1,v:1})).join(", ")})`;function H({value:t,hex:a,colours:n,label:l,followsWord:i,anyWord:r,onChange:o,readOnly:d=!1}){const[c,u]=w(!1),m=z(null),h=z(null),f=E(),p=void 0!==t&&n.some(e=>e.key===t),v=void 0!==t&&!p;return O(()=>{if(!c)return;const e=m.current?.ownerDocument;if(!e)return;const s=e=>{m.current&&!m.current.contains(e.target)&&u(!1)};return e.addEventListener("click",s,!0),()=>e.removeEventListener("click",s,!0)},[c]),/* @__PURE__ */Y("div",{ref:m,className:"es-ts-set","data-ts-setting":"color",children:[
2
2
  /* @__PURE__ */Y("div",{className:"es-ts-top",children:[
3
3
  /* @__PURE__ */I("span",{className:"es-ts-sub",children:l}),
4
- /* @__PURE__ */I("span",{className:"es-ts-colour-read",children:a?s(a):i})]}),
5
- /* @__PURE__ */Y("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[n.map(t=>/* @__PURE__ */I(C,{content:`${t.name} · ${s(t.value)}`,children:/* @__PURE__ */I(x,{color:t.value,size:"sm",className:"es-ts-swatch","aria-label":t.name,selected:e===t.key,disabled:d,onClick:()=>o(t.key)})},t.key)),
6
- /* @__PURE__ */I(C,{content:r,children:/* @__PURE__ */I(x,{ref:h,color:G,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:v,"aria-expanded":c,"aria-controls":c?f:void 0,disabled:d,onClick:()=>u(e=>!e)})})]}),c?/* @__PURE__ */I(t,{id:f,value:a??"",onChange:e=>o(e),label:l,readOnly:d,onClose:()=>{u(!1),h.current?.focus()}}):null]})}function P({styles:s,onChange:t,fonts:a,colours:n=[],settings:u=c,auto:m=[],fallback:h,sample:f,openId:p,defaultOpenId:v=null,onOpenChange:g,onAdd:b,rowActions:N,onRemove:C,max:x=o,device:T="desktop",readOnly:_=!1}){const A=k("textStyles",e),j=E(),[M,W]=w(v),$=void 0!==p?p:M,D=e=>{void 0===p&&W(e),g?.(e)},X=z(null),[G,H]=w(null);O(()=>{if(!G||!X.current)return;const e=[...X.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===G.id),s=e?e.querySelector(".es-ts-row"):X.current.querySelector(`.es-ts-add[data-ts-kind="${G.kind}"]`);s?.focus(),H(null)},[G]);/* @__PURE__ */
7
- return I("div",{className:"es-ts",ref:X,children:i.map(e=>{const i=s.filter(s=>s.kind===e),o=!r(s,e,x),c=!_&&!o;/* @__PURE__ */
8
- return Y(R,{label:A.groups[e],children:[i.map(e=>{const i=N?.(e),r=null!=i&&!1!==i,o=Boolean(C)&&!_&&!d(e);/* @__PURE__ */
9
- return I(B,{style:e,fonts:a,colours:n,settings:u,auto:m,fallback:h,sample:f,device:T,readOnly:_,open:$===e.id,onOpenChange:s=>D(s?e.id:null),onChange:e=>t(s.map(s=>s.id===e.id?e:s)),actions:o||r?/* @__PURE__ */Y(F,{children:[o?l(A.remove,/* @__PURE__ */I("button",{type:"button",className:"es-ts-del","aria-label":A.removeNamed({name:e.name}),onClick:()=>(e=>{if(_||!C)return;const a=S(s,e.id,{name:A.styleName});if(!a)return;const n=s.filter(s=>s.kind===e.kind),l=n[n.indexOf(e)+1];$===e.id&&D(null),t(a.styles),C(a.removed),H({id:l?.id??null,kind:e.kind})})(e),children:/* @__PURE__ */I(L,{size:14,"aria-hidden":"true"})})):null,r?i:null]}):null},e.id)}),l(!_&&o?A.full({kind:e,max:x}):void 0,/* @__PURE__ */Y("button",{type:"button",className:"es-ts-add","data-ts-kind":e,disabled:_,"aria-disabled":!(_||!o)||void 0,"aria-describedby":!_&&o?`${j}-full-${e}`:void 0,onClick:()=>{c&&(e=>{if(_)return;const a=y(s,e,{max:x,name:A.styleName,make:b});a&&t(a.styles)})(e)},children:[
10
- /* @__PURE__ */I("span",{className:"es-ts-add-word",children:A.add[e]}),
11
- /* @__PURE__ */I("span",{className:"es-ts-count",children:A.count({n:i.length,max:x})})]})),_||!o?null:/* @__PURE__ */I("span",{id:`${j}-full-${e}`,className:"es-vh",children:A.full({kind:e,max:x})})]},e)})})}function R({label:e,children:s}){const t=E();/* @__PURE__ */
4
+ /* @__PURE__ */I("span",{className:"es-ts-colour-read",children:a?e(a):i})]}),
5
+ /* @__PURE__ */Y("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[n.map(s=>/* @__PURE__ */I(C,{content:`${s.name} · ${e(s.value)}`,children:/* @__PURE__ */I(x,{color:s.value,size:"sm",className:"es-ts-swatch","aria-label":s.name,selected:t===s.key,disabled:d,onClick:()=>o(s.key)})},s.key)),
6
+ /* @__PURE__ */I(C,{content:r,children:/* @__PURE__ */I(x,{ref:h,color:G,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:v,"aria-expanded":c,"aria-controls":c?f:void 0,disabled:d,onClick:()=>u(e=>!e)})})]}),c?/* @__PURE__ */I(s,{id:f,value:a??"",onChange:e=>o(e),label:l,readOnly:d,onClose:()=>{u(!1),h.current?.focus()}}):null]})}function P({styles:e,onChange:s,fonts:t,colours:n=[],settings:c=d,auto:u=[],fallback:m,sample:h,openId:f,defaultOpenId:p=null,onOpenChange:S,onAdd:g,rowActions:N,onRemove:C,max:x=r,device:T="desktop",readOnly:_=!1}){const A=b("textStyles",a),j=E(),[M,W]=w(p),$=void 0!==f?f:M,D=e=>{void 0===f&&W(e),S?.(e)},X=z(null),[G,H]=w(null);O(()=>{if(!G||!X.current)return;const e=[...X.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===G.id),s=e?e.querySelector(".es-ts-row"):X.current.querySelector(`.es-ts-add[data-ts-kind="${G.kind}"]`);s?.focus(),H(null)},[G]);/* @__PURE__ */
7
+ return I("div",{className:"es-ts",ref:X,children:l.map(a=>{const l=e.filter(e=>e.kind===a),r=!i(e,a,x),d=!_&&!r;/* @__PURE__ */
8
+ return Y(R,{label:A.groups[a],children:[l.map(a=>{const l=N?.(a),i=null!=l&&!1!==l,r=Boolean(C)&&!_&&!o(a);/* @__PURE__ */
9
+ return I(B,{style:a,fonts:t,colours:n,settings:c,auto:u,fallback:m,sample:h,device:T,readOnly:_,open:$===a.id,onOpenChange:e=>D(e?a.id:null),onChange:t=>s(e.map(e=>e.id===t.id?t:e)),actions:r||i?/* @__PURE__ */Y(F,{children:[r?k(A.remove,/* @__PURE__ */I("button",{type:"button",className:"es-ts-del","aria-label":A.removeNamed({name:a.name}),onClick:()=>(t=>{if(_||!C)return;const a=y(e,t.id,{name:A.styleName});if(!a)return;const n=e.filter(e=>e.kind===t.kind),l=n[n.indexOf(t)+1];$===t.id&&D(null),s(a.styles),C(a.removed),H({id:l?.id??null,kind:t.kind})})(a),children:/* @__PURE__ */I(L,{size:14,"aria-hidden":"true"})})):null,i?l:null]}):null},a.id)}),k(!_&&r?A.full({kind:a,max:x}):void 0,/* @__PURE__ */Y("button",{type:"button",className:"es-ts-add","data-ts-kind":a,disabled:_,"aria-disabled":!(_||!r)||void 0,"aria-describedby":!_&&r?`${j}-full-${a}`:void 0,onClick:()=>{d&&(t=>{if(_)return;const a=v(e,t,{max:x,name:A.styleName,make:g});a&&s(a.styles)})(a)},children:[
10
+ /* @__PURE__ */I("span",{className:"es-ts-add-word",children:A.add[a]}),
11
+ /* @__PURE__ */I("span",{className:"es-ts-count",children:A.count({n:l.length,max:x})})]})),_||!r?null:/* @__PURE__ */I("span",{id:`${j}-full-${a}`,className:"es-vh",children:A.full({kind:a,max:x})})]},a)})})}function R({label:e,children:s}){const t=E();/* @__PURE__ */
12
12
  return Y("section",{className:"es-ts-section","aria-labelledby":t,children:[
13
- /* @__PURE__ */I("div",{className:"es-ts-group",id:t,children:e}),s]})}function B({style:s,fonts:t,colours:a=[],settings:n=c,auto:l=[],fallback:i,sample:r,open:o,onOpenChange:d,onChange:p,actions:v,device:y="desktop",readOnly:S=!1}){const g=k("textStyles",e),b=`${E()}-open-${s.id}`,N=new Set(l),C=u.filter(e=>n.includes(e)),x={...i?.(s)??{},...s.values},T="phone"===y,w=T&&void 0!==s.values.sizePhone?{...x,size:s.values.sizePhone}:x,z=t.find(e=>e.value===x.font),O={fontFamily:z?.family,fontSize:`${m(w.size??16)}px`,fontWeight:x.weight,fontStyle:x.italic?"italic":void 0};/* @__PURE__ */
13
+ /* @__PURE__ */I("div",{className:"es-ts-group",id:t,children:e}),s]})}function B({style:e,fonts:s,colours:t=[],settings:n=d,auto:l=[],fallback:i,sample:r,open:o,onOpenChange:f,onChange:p,actions:v,device:y="desktop",readOnly:S=!1}){const g=b("textStyles",a),k=`${E()}-open-${e.id}`,N=new Set(l),C=c.filter(e=>n.includes(e)),x={...i?.(e)??{},...e.values},T="phone"===y,w=T&&void 0!==e.values.sizePhone?{...x,size:e.values.sizePhone}:x,z=s.find(e=>e.value===x.font),O={fontFamily:z?.family,fontSize:`${u(w.size??16)}px`,fontWeight:x.weight,fontStyle:x.italic?"italic":void 0};/* @__PURE__ */
14
14
  return Y(_,{children:[
15
- /* @__PURE__ */Y("div",{className:"es-ts-item","data-ts-id":s.id,children:[
16
- /* @__PURE__ */Y("button",{type:"button",className:"es-ts-row","aria-expanded":o,"aria-controls":o?b:void 0,onClick:()=>d(!o),children:[
15
+ /* @__PURE__ */Y("div",{className:"es-ts-item","data-ts-id":e.id,children:[
16
+ /* @__PURE__ */Y("button",{type:"button",className:"es-ts-row","aria-expanded":o,"aria-controls":o?k:void 0,onClick:()=>f(!o),children:[
17
17
  /* @__PURE__ */I("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */I(A,{size:12})}),
18
- /* @__PURE__ */I("span",{className:"es-ts-name",style:O,children:s.name}),
19
- /* @__PURE__ */I("span",{className:"es-ts-meta",children:h(w,t,g,{autoSize:N.has("size")&&w===x&&void 0===s.values.size})})]}),v?/* @__PURE__ */I("div",{className:"es-ts-actions",children:v}):null]}),o?/* @__PURE__ */I("div",{className:"es-ts-open",id:b,children:/* @__PURE__ */I(Z,{style:s,values:x,fonts:t,colours:a,settings:C,autoSet:N,sample:r??g.sample,words:g,phone:T,readOnly:S,set:e=>p(f([s],s.id,e)[0])})}):null]})}var U={none:X,upper:D,capitalize:$,lower:W};function Z({style:e,values:s,fonts:t,colours:i,settings:r,autoSet:o,sample:d,words:c,phone:u,readOnly:m,set:h}){const f=e.values,v=t.find(e=>e.value===s.font),y=function(e,s){return e?s.find(s=>s.key===e)?.value??a(e)??void 0:void 0}(s.color,i),S=e=>"largestSize"===e||o.has(e),b=e=>S(e)?f[e]:s[e],k=b("size"),N=u&&void 0!==f.sizePhone?f.sizePhone:k,C=b("lineSpacing"),x=b("letterSpacing"),w=S("letterCase")?f.letterCase:s.letterCase,z={fontFamily:v?.family,fontSize:void 0===N?void 0:`${N}px`,fontWeight:s.weight,fontStyle:s.italic?"italic":void 0,lineHeight:void 0===C?void 0:String(C/100),letterSpacing:void 0===x?void 0:`${x}px`,color:y,textTransform:p(w)},E=e=>{const t=g[e],a=S(e);/* @__PURE__ */
20
- return I("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */I(n,{label:c.settings[e],value:f[e],onChange:s=>h({[e]:s}),min:t.min,max:t.max,step:t.step,shiftStep:t.shiftStep,sliderMin:t.sliderMin,sliderMax:t.sliderMax,unit:t.unit||void 0,styleValue:a?void 0:s[e],auto:a?c.auto:void 0,readOnly:m})},e)};/* @__PURE__ */
18
+ /* @__PURE__ */I("span",{className:"es-ts-name",style:O,children:e.name}),
19
+ /* @__PURE__ */I("span",{className:"es-ts-meta",children:m(w,s,g,{autoSize:N.has("size")&&w===x&&void 0===e.values.size})})]}),v?/* @__PURE__ */I("div",{className:"es-ts-actions",children:v}):null]}),o?/* @__PURE__ */I("div",{className:"es-ts-open",id:k,children:/* @__PURE__ */I(Z,{style:e,values:x,fonts:s,colours:t,settings:C,autoSet:N,sample:r??g.sample,words:g,phone:T,readOnly:S,set:s=>p(h([e],e.id,s)[0])})}):null]})}var U={none:X,upper:D,capitalize:$,lower:W};function Z({style:e,values:s,fonts:a,colours:l,settings:i,autoSet:r,sample:o,words:d,phone:c,readOnly:u,set:m}){const h=e.values,p=a.find(e=>e.value===s.font),v=function(e,s){return e?s.find(s=>s.key===e)?.value??t(e)??void 0:void 0}(s.color,l),y=e=>"largestSize"===e||r.has(e),g=e=>y(e)?h[e]:s[e],b=g("size"),N=c&&void 0!==h.sizePhone?h.sizePhone:b,C=g("lineSpacing"),x=g("letterSpacing"),w=y("letterCase")?h.letterCase:s.letterCase,z={fontFamily:p?.family,fontSize:void 0===N?void 0:`${N}px`,fontWeight:s.weight,fontStyle:s.italic?"italic":void 0,lineHeight:void 0===C?void 0:String(C/100),letterSpacing:void 0===x?void 0:`${x}px`,color:v,textTransform:f(w)},E=e=>{const t=S[e],a=y(e);/* @__PURE__ */
20
+ return I("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */I(n,{label:d.settings[e],value:h[e],onChange:s=>m({[e]:s}),min:t.min,max:t.max,step:t.step,shiftStep:t.shiftStep,sliderMin:t.sliderMin,sliderMax:t.sliderMax,unit:t.unit||void 0,styleValue:a?void 0:s[e],auto:a?d.auto:void 0,readOnly:u})},e)};/* @__PURE__ */
21
21
  return Y(F,{children:[
22
- /* @__PURE__ */I("div",{className:"es-ts-preview",style:z,"aria-label":c.preview,children:d}),r.map(a=>{switch(a){case"font":/* @__PURE__ */
23
- return I(q,{value:f.font,fonts:t,words:c,readOnly:m,set:h},a);case"color":/* @__PURE__ */
24
- return I(K,{value:f.color,hex:y,colours:i,words:c,readOnly:m,set:h},a);case"emphasis":{const e=(s.weight??400)>=600,t=!1!==v?.italic;/* @__PURE__ */
25
- return Y("div",{className:"es-ts-set","data-ts-setting":a,children:[
26
- /* @__PURE__ */I("span",{className:"es-ts-sub",children:c.settings.emphasis}),
27
- /* @__PURE__ */Y("div",{className:"es-ts-icons",children:[l(c.bold,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":c.bold,"aria-pressed":e,disabled:m,onClick:()=>h({weight:e?400:700}),children:/* @__PURE__ */I(j,{size:16})})),m||t?l(c.italic,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(s.italic),disabled:m,onClick:()=>h({italic:!s.italic||void 0}),children:/* @__PURE__ */I(M,{size:16})})):/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":c.italic,"aria-pressed":Boolean(s.italic),"aria-disabled":!0,disabledReason:c.italicMissing,children:/* @__PURE__ */I(M,{size:16})})]})]},a)}case"letterCase":/* @__PURE__ */
28
- return I(V,{value:f.letterCase??s.letterCase,auto:S("letterCase"),words:c,readOnly:m,set:h},a);case"largestSize":return"heading"===e.kind?E(a):null;case"size":return u?(()=>{const e=g.size;/* @__PURE__ */
29
- return I("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */I(n,{label:c.settings.size,value:f.sizePhone,onChange:e=>h({sizePhone:e}),min:e.min,max:e.max,step:e.step,shiftStep:e.shiftStep,sliderMin:e.sliderMin,sliderMax:e.sliderMax,unit:e.unit||void 0,styleValue:k,readOnly:m})},"size")})():E(a);default:return E(a)}})]})}function q({value:e,fonts:s,words:t,readOnly:a,set:n}){const l=E();/* @__PURE__ */
22
+ /* @__PURE__ */I("div",{className:"es-ts-preview",style:z,"aria-label":d.preview,children:o}),i.map(t=>{switch(t){case"font":/* @__PURE__ */
23
+ return I(q,{value:h.font,fonts:a,words:d,readOnly:u,set:m},t);case"color":/* @__PURE__ */
24
+ return I(K,{value:h.color,hex:v,colours:l,words:d,readOnly:u,set:m},t);case"emphasis":{const e=(s.weight??400)>=600,a=!1!==p?.italic;/* @__PURE__ */
25
+ return Y("div",{className:"es-ts-set","data-ts-setting":t,children:[
26
+ /* @__PURE__ */I("span",{className:"es-ts-sub",children:d.settings.emphasis}),
27
+ /* @__PURE__ */Y("div",{className:"es-ts-icons",children:[k(d.bold,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.bold,"aria-pressed":e,disabled:u,onClick:()=>m({weight:e?400:700}),children:/* @__PURE__ */I(j,{size:16})})),u||a?k(d.italic,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(s.italic),disabled:u,onClick:()=>m({italic:!s.italic||void 0}),children:/* @__PURE__ */I(M,{size:16})})):/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(s.italic),"aria-disabled":!0,disabledReason:d.italicMissing,children:/* @__PURE__ */I(M,{size:16})})]})]},t)}case"letterCase":/* @__PURE__ */
28
+ return I(V,{value:h.letterCase??s.letterCase,auto:y("letterCase"),words:d,readOnly:u,set:m},t);case"largestSize":return"heading"===e.kind?E(t):null;case"size":return c?(()=>{const e=S.size;/* @__PURE__ */
29
+ return I("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */I(n,{label:d.settings.size,value:h.sizePhone,onChange:e=>m({sizePhone:e}),min:e.min,max:e.max,step:e.step,shiftStep:e.shiftStep,sliderMin:e.sliderMin,sliderMax:e.sliderMax,unit:e.unit||void 0,styleValue:b,readOnly:u})},"size")})():E(t);default:return E(t)}})]})}function q({value:e,fonts:s,words:t,readOnly:a,set:n}){const l=E();/* @__PURE__ */
30
30
  return Y("div",{className:"es-ts-set","data-ts-setting":"font",children:[
31
31
  /* @__PURE__ */I("span",{className:"es-ts-sub",id:l,children:t.settings.font}),
32
- /* @__PURE__ */I(b,{value:e,options:s.map(e=>({label:e.label,value:e.value})),onChange:e=>n({font:e}),ariaLabelledBy:l,readOnly:a})]})}function K({value:e,hex:s,colours:t,words:a,readOnly:n,set:l}){/* @__PURE__ */
33
- return I(H,{value:e,hex:s,colours:t,label:a.settings.color,followsWord:a.colour.follows,anyWord:a.colour.any,readOnly:n,onChange:e=>l({color:e})})}function V({value:e,auto:s,words:t,readOnly:a,set:n}){const i=s?["auto",...v]:v,r=e??(s?"auto":"none"),o=z([]),d=e=>n({letterCase:"auto"===e?void 0:e});/* @__PURE__ */
32
+ /* @__PURE__ */I(g,{value:e,options:s.map(e=>({label:e.label,value:e.value})),onChange:e=>n({font:e}),ariaLabelledBy:l,readOnly:a})]})}function K({value:e,hex:s,colours:t,words:a,readOnly:n,set:l}){/* @__PURE__ */
33
+ return I(H,{value:e,hex:s,colours:t,label:a.settings.color,followsWord:a.colour.follows,anyWord:a.colour.any,readOnly:n,onChange:e=>l({color:e})})}function V({value:e,auto:s,words:t,readOnly:a,set:n}){const l=s?["auto",...p]:p,i=e??(s?"auto":"none"),r=z([]),o=e=>n({letterCase:"auto"===e?void 0:e});/* @__PURE__ */
34
34
  return Y("div",{className:"es-ts-set","data-ts-setting":"letterCase",children:[
35
35
  /* @__PURE__ */I("span",{className:"es-ts-sub",children:t.settings.letterCase}),
36
- /* @__PURE__ */I("div",{className:"es-ts-icons",role:"radiogroup","aria-label":t.settings.letterCase,onKeyDown:e=>{const s="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!s||a)return;e.preventDefault();const t=(i.indexOf(r)+s+i.length)%i.length;d(i[t]),o.current[t]?.focus()},children:i.map((e,s)=>{const n=e===r;if("auto"===e)return l(t.case.autoTitle,/* @__PURE__ */I(T,{ref:e=>{o.current[s]=e},role:"radio",pressed:n,className:"es-ts-icon es-ts-icon--word","aria-checked":n,"aria-label":t.case.auto,tabIndex:n?0:-1,disabled:a,onClick:()=>d(e),children:t.case.auto},e));const i=U[e];return l(t.case[e],/* @__PURE__ */I(T,{ref:e=>{o.current[s]=e},role:"radio",pressed:n,className:"es-ts-icon","aria-checked":n,"aria-label":t.case[e],tabIndex:n?0:-1,disabled:a,onClick:()=>d(e),children:/* @__PURE__ */I(i,{size:16})},e))})})]})}export{H as ColourSwatchRow,B as TextStyleItem,R as TextStylesGroup,P as TextStylesList};
36
+ /* @__PURE__ */I("div",{className:"es-ts-icons",role:"radiogroup","aria-label":t.settings.letterCase,onKeyDown:e=>{const s="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!s||a)return;e.preventDefault();const t=(l.indexOf(i)+s+l.length)%l.length;o(l[t]),r.current[t]?.focus()},children:l.map((e,s)=>{const n=e===i;if("auto"===e)return k(t.case.autoTitle,/* @__PURE__ */I(T,{ref:e=>{r.current[s]=e},role:"radio",pressed:n,className:"es-ts-icon es-ts-icon--word","aria-checked":n,"aria-label":t.case.auto,tabIndex:n?0:-1,disabled:a,onClick:()=>o(e),children:t.case.auto},e));const l=U[e];return k(t.case[e],/* @__PURE__ */I(T,{ref:e=>{r.current[s]=e},role:"radio",pressed:n,className:"es-ts-icon","aria-checked":n,"aria-label":t.case[e],tabIndex:n?0:-1,disabled:a,onClick:()=>o(e),children:/* @__PURE__ */I(l,{size:16})},e))})})]})}export{H as ColourSwatchRow,B as TextStyleItem,R as TextStylesGroup,P as TextStylesList};
@@ -88,4 +88,4 @@ interface EaselRailButtonProps {
88
88
  tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
89
89
  }
90
90
 
91
- export type { EaselRailButtonProps as E, EaselRailItem as a, EaselRailOrientation as b, EaselRailProps as c };
91
+ export type { EaselRailItem as E, EaselRailProps as a, EaselRailButtonProps as b, EaselRailOrientation as c };
@@ -1,4 +1,4 @@
1
- import { a as EaselRailItem } from './types-CsgMwHHa.js';
1
+ import { E as EaselRailItem } from './types-Cy7rdmXt.js';
2
2
  import { ReactNode, Ref, CSSProperties } from 'react';
3
3
  import { EditAccess, SaveConflict } from './edit-lock/index.js';
4
4
  import { P as PanelSide } from './panelWidths-D9hTLR25.js';
@@ -1,5 +1,5 @@
1
1
  import { DataInput } from './data/index.js';
2
- import { I as ItemSelector, N as NodeSelection } from './plan-CGREINRO.js';
2
+ import { I as ItemSelector, N as NodeSelection } from './plan-2BLk7pWs.js';
3
3
  import { D as Data, S as SlotAddress, a as DataConfig, N as Node } from './types-41704JE4.js';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { N as Node, S as SlotAddress, D as Data, a as DataConfig, P as Place } from './types-41704JE4.js';
2
- import { N as NodeSelection, A as AfterRemove, S as StepBounds } from './plan-CGREINRO.js';
2
+ import { N as NodeSelection, A as AfterRemove, S as StepBounds } from './plan-2BLk7pWs.js';
3
3
 
4
4
  /**
5
5
  * The node clipboard — what Copy and Cut hold, and Paste reads.
@@ -1,4 +1,4 @@
1
- import { S as SaveTone } from './types-DGyDHiJV.js';
1
+ import { S as SaveTone } from './types-DT8ywrFQ.js';
2
2
  import { A as AutosaveSnapshot } from './engine-CvXpFE86.js';
3
3
 
4
4
  /**
@@ -56,4 +56,4 @@ type SaveWords = {
56
56
  */
57
57
  declare function saveIndicator(state: AutosaveSnapshot, words?: SaveWords): SaveIndicator;
58
58
 
59
- export { type SaveWords as S, type SaveIndicator as a, saveIndicator as s };
59
+ export { type SaveIndicator as S, type SaveWords as a, saveIndicator as s };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "16.1.0",
3
+ "version": "17.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",
@@ -19,9 +19,6 @@
19
19
  "sideEffects": [
20
20
  "**/*.css"
21
21
  ],
22
- "main": "./dist/index.js",
23
- "module": "./dist/index.js",
24
- "types": "./dist/index.d.ts",
25
22
  "entryGroups": {
26
23
  "render": [
27
24
  "./render",
@@ -37,13 +34,10 @@
37
34
  "./screen/lib/puck/slot-child-name"
38
35
  ],
39
36
  "editor": [
40
- ".",
41
37
  "./rail",
42
38
  "./icons",
43
- "./icons/meanings",
44
39
  "./menu",
45
40
  "./panel",
46
- "./shell",
47
41
  "./chrome",
48
42
  "./tree",
49
43
  "./data",
@@ -58,11 +52,8 @@
58
52
  "./canvas",
59
53
  "./edit-lock",
60
54
  "./copy",
61
- "./gold",
62
- "./markup",
63
55
  "./style-clipboard",
64
56
  "./strings",
65
- "./strings/catalogue",
66
57
  "./screen/components/AddBlockRow",
67
58
  "./screen/components/AddChildRow",
68
59
  "./screen/components/AddSidePanel",
@@ -130,11 +121,6 @@
130
121
  ]
131
122
  },
132
123
  "exports": {
133
- ".": {
134
- "types": "./dist/index.d.ts",
135
- "import": "./dist/index.js",
136
- "default": "./dist/index.js"
137
- },
138
124
  "./rail": {
139
125
  "types": "./dist/rail/index.d.ts",
140
126
  "import": "./dist/rail/index.js",
@@ -145,11 +131,6 @@
145
131
  "import": "./dist/icons/index.js",
146
132
  "default": "./dist/icons/index.js"
147
133
  },
148
- "./icons/meanings": {
149
- "types": "./dist/icons/meanings.d.ts",
150
- "import": "./dist/icons/meanings.js",
151
- "default": "./dist/icons/meanings.js"
152
- },
153
134
  "./menu": {
154
135
  "types": "./dist/menu/index.d.ts",
155
136
  "import": "./dist/menu/index.js",
@@ -163,11 +144,6 @@
163
144
  },
164
145
  "./panel.css": "./dist/panel/panel.css",
165
146
  "./rail.css": "./dist/rail/rail.css",
166
- "./shell": {
167
- "types": "./dist/shell/index.d.ts",
168
- "import": "./dist/shell/index.js",
169
- "default": "./dist/shell/index.js"
170
- },
171
147
  "./shell.css": "./dist/shell/shell.css",
172
148
  "./chrome": {
173
149
  "types": "./dist/chrome/index.d.ts",
@@ -268,17 +244,7 @@
268
244
  "default": "./dist/copy/index.js"
269
245
  },
270
246
  "./copy.css": "./dist/copy/copy.css",
271
- "./gold": {
272
- "types": "./dist/gold/index.d.ts",
273
- "import": "./dist/gold/index.js",
274
- "default": "./dist/gold/index.js"
275
- },
276
247
  "./gold.css": "./dist/gold/gold.css",
277
- "./markup": {
278
- "types": "./dist/markup/index.d.ts",
279
- "import": "./dist/markup/index.js",
280
- "default": "./dist/markup/index.js"
281
- },
282
248
  "./style-clipboard": {
283
249
  "types": "./dist/style-clipboard/index.d.ts",
284
250
  "import": "./dist/style-clipboard/index.js",
@@ -289,11 +255,6 @@
289
255
  "import": "./dist/strings/index.js",
290
256
  "default": "./dist/strings/index.js"
291
257
  },
292
- "./strings/catalogue": {
293
- "types": "./dist/strings/catalogue.d.ts",
294
- "import": "./dist/strings/catalogue.js",
295
- "default": "./dist/strings/catalogue.js"
296
- },
297
258
  "./screen/components/AddBlockRow": {
298
259
  "types": "./dist/screen/components/AddBlockRow.d.ts",
299
260
  "import": "./dist/screen/components/AddBlockRow.js",
@@ -675,7 +636,7 @@
675
636
  "typescript": "^5.3.0"
676
637
  },
677
638
  "scripts": {
678
- "build": "NODE_OPTIONS=--max-old-space-size=6144 tsup && cp src/rail/rail.css dist/rail/rail.css && cp src/shell/shell.css dist/shell/shell.css && cp src/gold/gold.css dist/gold/gold.css && cp src/copy/copy.css dist/copy/copy.css && cp src/panel/panel.css dist/panel/panel.css && cp src/menu/menu.css dist/menu/menu.css && cp src/chrome/chrome.css dist/chrome/chrome.css && cp src/tree/tree.css dist/tree/tree.css && cp src/drag/drag.css dist/drag/drag.css && cp src/pick/pick.css dist/pick/pick.css && cp src/fields/fields.css dist/fields/fields.css && cp src/text-styles/text-styles.css dist/text-styles/text-styles.css && cp src/easel/easel.css dist/easel/easel.css && cp src/screen/screen.css dist/screen/screen.css",
639
+ "build": "NODE_OPTIONS=--max-old-space-size=6144 tsup && mkdir -p dist/shell dist/gold && cp src/rail/rail.css dist/rail/rail.css && cp src/shell/shell.css dist/shell/shell.css && cp src/gold/gold.css dist/gold/gold.css && cp src/copy/copy.css dist/copy/copy.css && cp src/panel/panel.css dist/panel/panel.css && cp src/menu/menu.css dist/menu/menu.css && cp src/chrome/chrome.css dist/chrome/chrome.css && cp src/tree/tree.css dist/tree/tree.css && cp src/drag/drag.css dist/drag/drag.css && cp src/pick/pick.css dist/pick/pick.css && cp src/fields/fields.css dist/fields/fields.css && cp src/text-styles/text-styles.css dist/text-styles/text-styles.css && cp src/easel/easel.css dist/easel/easel.css && cp src/screen/screen.css dist/screen/screen.css",
679
640
  "dev": "tsup --watch",
680
641
  "typecheck": "tsc --noEmit && tsc -p tsconfig.test.json",
681
642
  "test": "efficient-shell-ui-check && node scripts/test.mjs",
@@ -1,5 +0,0 @@
1
- import{buildPaletteSections as e,pinnedSection as t,categoryLabel as o}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as n}from"./chunk-BVN33R76.js";import{blockTypesIn as s}from"./chunk-5ZBY24K7.js";import{SidePanelHead as i,PanelModeExit as r}from"./chunk-62VPYC7F.js";import{blockRuns as l}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as c,useScreenBlockRules as a}from"./chunk-U25CP5VX.js";import{useEaselSession as p}from"./chunk-O7Q4DDJT.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-VVPZMWJE.js";import{AddPanel as d}from"./chunk-POSLNRTO.js";import{DEFAULT_DRAG_WORDS as f}from"./chunk-KAML3KQH.js";import{useEasel as y}from"./chunk-QX7GVECM.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{useState as u,useEffect as k,useMemo as b}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as j,jsxs as v,Fragment as V}from"react/jsx-runtime";var O=e=>`section:${e}`,E=e=>`block:${e}`,P=e=>`template:${e}`;function $({at:$,placeBlocks:w,canTake:C,onPick:L,itemFor:T,session:x,siteWide:A,onClose:B,onHide:H,readOnly:I}){const M=y(e=>e.config),N=c(),{labelAtLevel:R,categoryLabel:F,firstSection:Q,Icon:W,Thumbnail:D}=N,{blockIsOffered:K,canAddTo:S}=a(),Y=h("screen",m).add,z=h("drag",f).add,G=p(),[J,X]=u([]);k(()=>{let e=!1;const t=e=>K(e,G);return n(G).list().then(o=>{if(e)return;const n=M.components;X(o.filter(e=>e.node?.type&&n[e.node.type]&&s(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[M,G]);const Z=b(()=>e(M,N),[M]),U=e=>({type:O(e.type),label:e.name,cover:/* @__PURE__ */j(D,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:Y.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),q=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=J.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null},_=e=>/* @__PURE__ */j("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */j(W,{type:e,size:26})}),ee=b(()=>{const e=t(Z,Q),n=/* @__PURE__ */new Map,s=e=>{!n.has(e.type)&&K(e.type,G)&&n.set(e.type,e)};for(const t of e?[e]:Z){const e=S(t.type)?.choices??[];e.forEach(s),e.forEach(e=>S(e.type,1)?.choices?.forEach(s))}w?.forEach(s);const i=new Set(Z.map(e=>e.type)),r=[...n.values()].filter(e=>!i.has(e.type)),c=e=>({type:E(e.type),label:e.label,cover:_(e.type),title:Y.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>n.has(e.type)?{...U(e),cover:_(e.type)}:U(e),p=[];J.length>0&&p.push({key:"templates",title:Y.templates,tiles:J.map(e=>{return{type:P(e.id),label:e.name,cover:/* @__PURE__ */j(D,{type:e.node.type}),keywords:[(t=e.node.type,R(t,"section",M.components[t]?.label??t)),e.node.type]};var t})});const m=r.filter(e=>!e.group);let d=!1;for(const t of Object.keys(M.categories??{})){const n=Z.filter(e=>e.cat===t);if(0===n.length)continue;const s=e&&n.some(t=>t.type===e.type)?e:null,i=(s?[s,...n.filter(e=>e.type!==s.type)]:n).map(a);s&&!d&&(i.splice(1,0,...m.map(c)),d=!0),p.push({key:`category:${t}`,title:o(M,t,F),tiles:i})}const f=p.find(e=>e.key?.startsWith("category:"));if(!d&&f&&m.length>0&&(f.tiles=[...f.tiles,...m.map(c)],d=!0),l(r.filter(e=>e.group||!d)).forEach((e,t)=>{p.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(c)})}),!C)return p;const y=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=q(e.type),o=t?C(t):null;return o?{...e,disabled:!0,disabledReason:o}:e})})),h=e=>e.tiles.some(e=>!e.disabled);return[...y.filter(h),...y.filter(e=>!h(e))]},[J,Z,M,Y,C,w,G]);/* @__PURE__ */
2
- return v(V,{children:[
3
- /* @__PURE__ */j(i,{icon:/* @__PURE__ */j(g,{size:15}),title:Y.title,context:Y.contextAll,actions:/* @__PURE__ */j(r,{label:Y.done,description:Y.doneDescription,onClick:B}),onHide:H}),
4
- /* @__PURE__ */v("div",{className:"sf-addside sf-scroll",children:[
5
- /* @__PURE__ */j(d,{groups:ee,session:x,itemFor:e=>T(q(e)??{kind:"section",type:e}),onInsert:L?e=>{const t=q(e);t&&L(t)}:void 0,at:$,hint:Y.hint,searchLabel:Y.search,readOnly:I,words:z}),A??null]})]})}export{$ as AddSidePanel,E as blockKey,O as sectionKey,P as templateKey};