efficient-easel 10.1.0 → 10.3.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.
- package/README.md +6 -0
- package/dist/canvas-typing-CJodefPO.d.ts +478 -0
- package/dist/{chunk-CQGCGRDI.js → chunk-74ZFATLG.js} +1 -1
- package/dist/{chunk-76YU5ZS7.js → chunk-7O6MDCDU.js} +5 -5
- package/dist/{chunk-YHJDAJAD.js → chunk-A5OEGP7B.js} +4 -4
- package/dist/{chunk-76DVL36A.js → chunk-ERA3XM2U.js} +1 -1
- package/dist/chunk-FJ3ZJJ5Z.js +57 -0
- package/dist/chunk-ICN6COBK.js +5 -0
- package/dist/{chunk-WQASXLXS.js → chunk-IL6QCPO6.js} +1 -1
- package/dist/{chunk-M3MCCGPN.js → chunk-IZ2QRXSE.js} +1 -1
- package/dist/{chunk-XF2AIO46.js → chunk-JSPZU7X2.js} +1 -1
- package/dist/{chunk-ACUQNEHP.js → chunk-M32O2WRM.js} +10 -10
- package/dist/{chunk-M6F6LS3H.js → chunk-OGH6CC3E.js} +1 -1
- package/dist/{chunk-SL7JKLTD.js → chunk-OWK7DGWG.js} +1 -1
- package/dist/{chunk-KKUZLRP4.js → chunk-TROOTMAD.js} +1 -1
- package/dist/{chunk-4GMKP2AZ.js → chunk-YMEN4KVE.js} +1 -1
- package/dist/copy/index.d.ts +20 -399
- package/dist/copy/index.js +17 -15
- package/dist/easel/index.d.ts +11 -2
- package/dist/easel/index.js +1 -1
- package/dist/fields/index.d.ts +2 -2
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/MediaSidePanel.js +1 -1
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +16 -16
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/strings/catalogue.d.ts +1 -1
- package/dist/strings/catalogue.js +1 -1
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +1 -1
- package/dist/text-styles/index.d.ts +38 -4
- package/dist/text-styles/index.js +35 -33
- package/dist/{types-C97TAUKi.d.ts → types-Dkx1VAIQ.d.ts} +1 -1
- package/dist/{words-CRYvAiHX.d.ts → words-gIDCeRv3.d.ts} +1 -0
- package/package.json +1 -1
- package/dist/canvas-typing-Cnvlsh_V.d.ts +0 -69
- package/dist/chunk-YCBD64P4.js +0 -5
- package/dist/chunk-ZRNSJGUW.js +0 -57
package/dist/copy/index.d.ts
CHANGED
|
@@ -1,403 +1,13 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { C as CopyWords, a as CopyAlign } from '../words-dsex49Jh.js';
|
|
5
|
-
export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, f as copyAlignOptions } from '../words-dsex49Jh.js';
|
|
6
|
-
import { TextToolbarCase, TextToolbarMark } from 'efficient-shell/ui';
|
|
2
|
+
import { b as CopyBoxProps, c as CopyCell, T as TextBoxHandle } from '../canvas-typing-CJodefPO.js';
|
|
3
|
+
export { d as COPY_CELLS, a as CanvasTypingEnd, e as CanvasTypingOptions, f as CanvasTypingSession, g as ColorWindow, h as CopyBoxAlign, i as CopyBoxFooter, C as CopyBoxLastTool, j as CopyCase, k as CopyCellPreset, l as CopyCells, m as CopyThemeColor, M as MarkBar, n as MarkBarProps, o as MarkWriter, S as SelectionSource, p as TextAreaHandle, q as TextMap, r as ToolbarMark, s as ariaShortcut, t as insertSelection, u as markSelection, v as startCanvasTyping, w as textMap } from '../canvas-typing-CJodefPO.js';
|
|
7
4
|
export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
|
|
8
|
-
import {
|
|
9
|
-
|
|
5
|
+
import { F as FieldOption } from '../types-Dkx1VAIQ.js';
|
|
6
|
+
import { a as CopyAlign } from '../words-dsex49Jh.js';
|
|
7
|
+
export { b as COPY_ALIGNS, c as COPY_ALIGN_FIT, d as COPY_ALIGN_GLYPHS, e as COPY_ALIGN_LABELS, C as CopyWords, f as copyAlignOptions } from '../words-dsex49Jh.js';
|
|
8
|
+
import { InlineRule, MarkStyle, MarkedLine, WrapResult } from '../markup/index.js';
|
|
10
9
|
import '../buckets-Tj-nkBpg.js';
|
|
11
10
|
|
|
12
|
-
type CellWords = NonNullable<CopyWords['cells']>;
|
|
13
|
-
interface CopyCell {
|
|
14
|
-
/** Which cell this is — a stable key for the grid. */
|
|
15
|
-
key: string;
|
|
16
|
-
/** The cell's name, from the copy words (the four the design draws)… */
|
|
17
|
-
nameKey?: Exclude<keyof CellWords, 'tip'>;
|
|
18
|
-
/** …or the host's own (a cell the package does not know). */
|
|
19
|
-
name?: string;
|
|
20
|
-
icon?: ReactNode;
|
|
21
|
-
unit?: string;
|
|
22
|
-
/** What an arrow or ↑↓ moves by, in SHOWN units. */
|
|
23
|
-
step?: number;
|
|
24
|
-
/** What Shift moves by. Default ten steps. */
|
|
25
|
-
shiftStep?: number;
|
|
26
|
-
/** Bounds, in SHOWN units. */
|
|
27
|
-
min?: number;
|
|
28
|
-
max?: number;
|
|
29
|
-
/** Shown = stored × scale (100 for a multiple shown in %). Default 1. */
|
|
30
|
-
scale?: number;
|
|
31
|
-
/** The STORED value, or `undefined` while the cell follows the style. */
|
|
32
|
-
value: number | undefined;
|
|
33
|
-
/** The style's STORED value, shown grey while the cell is empty. */
|
|
34
|
-
styleValue?: number;
|
|
35
|
-
/** A STORED value, or `undefined` when the cell is emptied. */
|
|
36
|
-
onChange: (value: number | undefined) => void;
|
|
37
|
-
}
|
|
38
|
-
/** A cell's preset: everything but its value and its write. */
|
|
39
|
-
type CopyCellPreset = Omit<CopyCell, 'value' | 'styleValue' | 'onChange'>;
|
|
40
|
-
/** The four cells the final design draws, with its steps and ranges
|
|
41
|
-
* (the campaign page's "三个框的规则" table, read 2026-10-06). */
|
|
42
|
-
declare const COPY_CELLS: {
|
|
43
|
-
fontSize: CopyCellPreset;
|
|
44
|
-
lineHeight: CopyCellPreset;
|
|
45
|
-
letterSpacing: CopyCellPreset;
|
|
46
|
-
paragraphSpacing: CopyCellPreset;
|
|
47
|
-
};
|
|
48
|
-
declare function CopyCells({ cells, words, readOnly }: {
|
|
49
|
-
cells: readonly CopyCell[];
|
|
50
|
-
words?: CellWords;
|
|
51
|
-
readOnly?: boolean;
|
|
52
|
-
}): react.JSX.Element;
|
|
53
|
-
|
|
54
|
-
interface CopyThemeColor {
|
|
55
|
-
name: string;
|
|
56
|
-
label: string;
|
|
57
|
-
value: string;
|
|
58
|
-
}
|
|
59
|
-
declare function ColorWindow({ colors, current, words, onPick, }: {
|
|
60
|
-
colors: readonly CopyThemeColor[];
|
|
61
|
-
/** The colour the selection wears — a theme name or a hex — or null. */
|
|
62
|
-
current: string | null;
|
|
63
|
-
words: NonNullable<CopyWords['colors']>;
|
|
64
|
-
/** A theme name, a lowercase `#rrggbb`, or null to take the colour off. */
|
|
65
|
-
onPick: (color: string | null) => void;
|
|
66
|
-
}): react.JSX.Element;
|
|
67
|
-
|
|
68
|
-
/** `'b'` → `Meta+B`, `'shift+x'` → `Meta+Shift+X` — the ARIA spelling of a
|
|
69
|
-
* shortcut. Meta is what the tooltips promise (⌘); Ctrl works too. */
|
|
70
|
-
declare function ariaShortcut(shortcut: string | undefined): string | undefined;
|
|
71
|
-
interface MarkBarProps {
|
|
72
|
-
/**
|
|
73
|
-
* Which buttons to show.
|
|
74
|
-
*
|
|
75
|
-
* TWO FORMS, and the second is not a convenience — it is the only way a
|
|
76
|
-
* product with marks of its OWN can use this bar at all.
|
|
77
|
-
*
|
|
78
|
-
* `MarkStyle[]` resolved against the shared grammar's `MARKUP_TOOLS`, in
|
|
79
|
-
* that order. What the campaign designer passes.
|
|
80
|
-
* `MarkupTool[]` used verbatim. What `efficient-storefront` passes.
|
|
81
|
-
*
|
|
82
|
-
* ⚠️ WHY VERBATIM DESCRIPTORS HAD TO EXIST. The storefront offered SEVEN
|
|
83
|
-
* marks: the grammar's four, plus its three word styles (`@@`, `++`, `^^`),
|
|
84
|
-
* which then lived only in the shop because the grammar was
|
|
85
|
-
* `efficient-shell/markup`. Resolving through `markupTools` can only ever
|
|
86
|
-
* return marks the grammar knows, so it silently DROPPED all three — the bar
|
|
87
|
-
* rendered four buttons where the panel had seven, and nothing failed to
|
|
88
|
-
* compile. Since 2026-09-28 the grammar is ours and holds Quiet (`^^`) and
|
|
89
|
-
* reads `@@` / `++` as Emphasis and Strong, but a host may still hand in
|
|
90
|
-
* marks of its own.
|
|
91
|
-
*
|
|
92
|
-
* So a host that has its own marks builds its own descriptors (the shop
|
|
93
|
-
* already did: `shopMarkupTools()`) and hands them over whole. The bar's job
|
|
94
|
-
* is the ROW — the buttons, the focus guard, the naming, the group — and that
|
|
95
|
-
* job does not depend on who defined the mark.
|
|
96
|
-
*/
|
|
97
|
-
tools: readonly MarkStyle[] | readonly MarkupTool[];
|
|
98
|
-
onApply: (style: MarkStyle) => void;
|
|
99
|
-
disabled?: boolean;
|
|
100
|
-
/** Buttons that write no mark, after a divider — see `CopyBoxProps.actions`. */
|
|
101
|
-
actions?: ReactNode;
|
|
102
|
-
/** The alignment strip, already built by the control. */
|
|
103
|
-
align?: ReactNode;
|
|
104
|
-
/**
|
|
105
|
-
* WHAT A BUTTON IS DRAWN AS, per style. Default: the grammar's own letter —
|
|
106
|
-
* `B`, `I`, `S`, `◆` — which is what the campaign designer has always shown.
|
|
107
|
-
*
|
|
108
|
-
* ⚠️ THIS IS NOT A THEME KNOB, AND IT IS NOT OPTIONAL POLISH. This package
|
|
109
|
-
* already says that WHICH buttons and WHAT they write are the grammar's, while
|
|
110
|
-
* how they LOOK is the host's, "because this bar has to belong to the
|
|
111
|
-
* storefront inspector's chrome and the campaign designer's bar has to belong
|
|
112
|
-
* to the portal's". Colour was delegated by tokens on day one; the DRAWING was
|
|
113
|
-
* not, and a letter is a drawing. `efficient-storefront` renders each mark as a 14px
|
|
114
|
-
* stroked SVG at the weight of its other inspector glyphs, on the stated
|
|
115
|
-
* ground that the row should read "as part of the field rather than as
|
|
116
|
-
* pasted-in icons" — so without this it could not adopt the bar without losing
|
|
117
|
-
* that, which is a regression dressed as a refactor.
|
|
118
|
-
*
|
|
119
|
-
* The set now HAS a glyph for every mark (0.94.0: bold, italic, strike,
|
|
120
|
-
* emphasis, quiet, clear-marks — the owner's call, made 2026-10-02), and they
|
|
121
|
-
* are the default. This map stays so a host can still draw its own.
|
|
122
|
-
*
|
|
123
|
-
* A style the map does not name falls back to the icon set's glyph for it
|
|
124
|
-
* (`SET_GLYPH`, 0.94.0, when the owner added the mark glyphs to the set) and
|
|
125
|
-
* then to the letter, so a host may override one button and leave the rest.
|
|
126
|
-
*/
|
|
127
|
-
glyphs?: Partial<Record<MarkStyle, ReactNode>>;
|
|
128
|
-
/**
|
|
129
|
-
* What the group is CALLED. Defaults to "Formatting" (`EaselStrings.copy.formatting`).
|
|
130
|
-
*
|
|
131
|
-
* A bar bound to one box needs nothing more. A bar SHARED by several rows has
|
|
132
|
-
* to say which row it is aimed at, because the visible cue — the marked row —
|
|
133
|
-
* is not readable. `efficient-storefront` has that case today.
|
|
134
|
-
*/
|
|
135
|
-
ariaLabel?: string;
|
|
136
|
-
/**
|
|
137
|
-
* The marks the selection already wears — a button drawn pressed is one
|
|
138
|
-
* whose press takes the mark OFF (`markedAt`, the same test `applyMark`
|
|
139
|
-
* unwraps by), so the two cannot disagree. A style not named is not pressed;
|
|
140
|
-
* with no map at all no button says either way (`aria-pressed` is left off),
|
|
141
|
-
* which is what every host that does not track the selection still gets.
|
|
142
|
-
*/
|
|
143
|
-
pressed?: Partial<Record<MarkStyle, boolean>>;
|
|
144
|
-
/** The style whose own window is open — the link button while its "Link
|
|
145
|
-
* to" window is showing. Drawn pressed, and named as expanded. */
|
|
146
|
-
open?: MarkStyle | null;
|
|
147
|
-
}
|
|
148
|
-
declare function MarkBar({ tools, onApply, disabled, actions, align, glyphs, ariaLabel, pressed, open, }: MarkBarProps): react.JSX.Element | null;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Just enough of a text control to read a selection off it. Narrowed to these
|
|
152
|
-
* two fields so a caller may hand in a plain object in a test.
|
|
153
|
-
*
|
|
154
|
-
* A `<textarea>` OR an `<input>` (blueprint 4.9). An input's selection is
|
|
155
|
-
* `number | null` where a textarea's is `number`, so the type had to be the
|
|
156
|
-
* wider of the two: typed to the textarea, every one-line row in the website
|
|
157
|
-
* editor needed a cast or a copy of this file, and the shop kept a copy.
|
|
158
|
-
*/
|
|
159
|
-
type SelectionSource = {
|
|
160
|
-
readonly selectionStart: number | null;
|
|
161
|
-
readonly selectionEnd: number | null;
|
|
162
|
-
} | null;
|
|
163
|
-
/**
|
|
164
|
-
* How a mark is written. Defaults to the shared grammar's own `applyMark`.
|
|
165
|
-
*
|
|
166
|
-
* INJECTED RATHER THAN ASSUMED, because the storefront legitimately writes marks
|
|
167
|
-
* the shell's grammar does not know: its three word styles (`@@`, `++`, `^^`)
|
|
168
|
-
* go through `applyShopMark`, which delegates here for everything else. Making
|
|
169
|
-
* the writer a parameter is what lets one control serve both products without
|
|
170
|
-
* this package learning a vocabulary that belongs to one of them.
|
|
171
|
-
*/
|
|
172
|
-
type MarkWriter = (text: string, start: number, end: number, style: MarkStyle) => WrapResult;
|
|
173
|
-
/** Apply a style to whatever the field has selected. */
|
|
174
|
-
declare function markSelection(value: string, style: MarkStyle, el: SelectionSource, write?: MarkWriter): WrapResult;
|
|
175
|
-
/**
|
|
176
|
-
* Put a literal string where the caret is.
|
|
177
|
-
*
|
|
178
|
-
* The caret lands AFTER the inserted text and selects nothing, because the thing
|
|
179
|
-
* inserted is finished — a merge tag is not a placeholder to type over, and
|
|
180
|
-
* leaving it selected invites the next keystroke to delete it.
|
|
181
|
-
*/
|
|
182
|
-
declare function insertSelection(value: string, text: string, el: SelectionSource): WrapResult;
|
|
183
|
-
|
|
184
|
-
/** A letter case the toolbar sets on the host's field: the shell toolbar's. */
|
|
185
|
-
type CopyCase = TextToolbarCase;
|
|
186
|
-
/** The marks row 1 of the toolbar carries: the shell toolbar's. */
|
|
187
|
-
type ToolbarMark = TextToolbarMark;
|
|
188
|
-
/**
|
|
189
|
-
* A handle on the box's textarea.
|
|
190
|
-
*
|
|
191
|
-
* DECLARED STRUCTURALLY rather than as React's `RefObject`, and the reason is
|
|
192
|
-
* the package's `react >=18` peer range. React 18 types read `RefObject<T>` as
|
|
193
|
-
* `{ readonly current: T | null }`, React 19's `useRef<T>(null)` produces
|
|
194
|
-
* `RefObject<T | null>`, and the interface is covariant in `T` — so the two
|
|
195
|
-
* spellings of the same object do not assign to each other, and a package that
|
|
196
|
-
* has to compile against both cannot name either one. The shape is the whole
|
|
197
|
-
* contract; naming it here costs one line and no version branch.
|
|
198
|
-
*/
|
|
199
|
-
type TextAreaHandle = {
|
|
200
|
-
current: HTMLTextAreaElement | null;
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* A handle on ANY text control the caret machinery can drive — a `<textarea>`
|
|
204
|
-
* or a one-line `<input>` (blueprint 4.9). `useCaretEdit` takes this, so a host
|
|
205
|
-
* with its own input rows (the website editor's list lines) uses the same
|
|
206
|
-
* twelve lines instead of a copy of them. A {@link TextAreaHandle} is one.
|
|
207
|
-
*/
|
|
208
|
-
type TextBoxHandle = {
|
|
209
|
-
current: HTMLInputElement | HTMLTextAreaElement | null;
|
|
210
|
-
};
|
|
211
|
-
/**
|
|
212
|
-
* What a host may put UNDER the box, and what it needs to draw it.
|
|
213
|
-
*
|
|
214
|
-
* A render prop rather than a plain node, for one reason that is not style: the
|
|
215
|
-
* campaign's merge-tag chips have to insert at the caret, and only this control
|
|
216
|
-
* knows where the caret is. Handing the host `insert` is what lets the chips
|
|
217
|
-
* live in the app — where the tag list, the audience call and the product's
|
|
218
|
-
* vocabulary belong — while the caret machinery stays here, written once.
|
|
219
|
-
*
|
|
220
|
-
* `focused` is passed for the same reason the portal tracked it locally: the row
|
|
221
|
-
* appears while the merchant is typing in THIS box and not in its neighbour.
|
|
222
|
-
*/
|
|
223
|
-
interface CopyBoxFooter {
|
|
224
|
-
focused: boolean;
|
|
225
|
-
/** Put a literal string where the caret is, replacing any selection. */
|
|
226
|
-
insert: (text: string) => void;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* What a host needs to draw its OWN control in row 1's 9th cell of the final
|
|
230
|
-
* toolbar ({@link CopyBoxProps.lastTool}) — the campaign designer's Insert
|
|
231
|
-
* (merge tags), owner ruling 2026-10-07. The website editor passes nothing.
|
|
232
|
-
*
|
|
233
|
-
* `className` makes it a cell that looks like its neighbours; `keepCaret` on
|
|
234
|
-
* its mousedown keeps the caret and the selection in the box; `insert` writes
|
|
235
|
-
* at the caret, as {@link CopyBoxFooter.insert} does.
|
|
236
|
-
*/
|
|
237
|
-
interface CopyBoxLastTool {
|
|
238
|
-
className: string;
|
|
239
|
-
/** The box is read-only. */
|
|
240
|
-
disabled: boolean;
|
|
241
|
-
/** Words are selected (not just a caret). */
|
|
242
|
-
selected: boolean;
|
|
243
|
-
keepCaret: (e: {
|
|
244
|
-
preventDefault(): void;
|
|
245
|
-
}) => void;
|
|
246
|
-
/** Put a literal string where the caret is, replacing any selection. */
|
|
247
|
-
insert: (text: string) => void;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* The alignment strip, when the host has an alignment to offer.
|
|
251
|
-
*
|
|
252
|
-
* GENERIC IN THE DIRECTIONS IT ALLOWS, so `onChange` RECEIVES only what the
|
|
253
|
-
* host said it could honour. Before this it received the whole union, and a
|
|
254
|
-
* host allowing three directions had to narrow a `justify` it had just
|
|
255
|
-
* declared impossible before storing. Raised by the strip's first consumer,
|
|
256
|
-
* which did write that narrowing; the next one might not.
|
|
257
|
-
*
|
|
258
|
-
* `A` is inferred from `allow`, so nothing has to be spelled at the call site.
|
|
259
|
-
*
|
|
260
|
-
* ⚠️ IT DOES NOT FORBID A WIDER HANDLER, and cannot: a function taking the
|
|
261
|
-
* whole `CopyAlign` is assignable where one taking three is wanted, because
|
|
262
|
-
* parameters are contravariant — and that direction is SAFE, since only the
|
|
263
|
-
* three can ever arrive. What this buys is that the narrow handler now
|
|
264
|
-
* type-checks without a cast, which is what makes writing the safe one the
|
|
265
|
-
* path of least resistance.
|
|
266
|
-
*/
|
|
267
|
-
interface CopyBoxAlign<A extends CopyAlign = CopyAlign> {
|
|
268
|
-
value: A | '';
|
|
269
|
-
onChange: (next: A) => void;
|
|
270
|
-
/**
|
|
271
|
-
* Which directions this host can honour. Required and with no default: a
|
|
272
|
-
* renderer that cannot justify must not be given a Justify button because a
|
|
273
|
-
* default handed it one, which is the shape of mistake this whole card exists
|
|
274
|
-
* to stop. It is also what `A` above is inferred from.
|
|
275
|
-
*/
|
|
276
|
-
allow: readonly A[];
|
|
277
|
-
/** The strip exists but cannot apply right now. Distinct from the whole
|
|
278
|
-
* control being read-only. */
|
|
279
|
-
disabled?: boolean;
|
|
280
|
-
}
|
|
281
|
-
interface CopyBoxProps {
|
|
282
|
-
/** The authored string, delimiters and all. The single source of truth. */
|
|
283
|
-
value: string;
|
|
284
|
-
/** Every keystroke, and every button press. */
|
|
285
|
-
onChange: (value: string) => void;
|
|
286
|
-
/** The edit is finished and may be written: on blur, and on Enter when
|
|
287
|
-
* {@link multiline} is false. */
|
|
288
|
-
onCommit?: (value: string) => void;
|
|
289
|
-
/** Escape. The argument is the value the box was given when it gained focus;
|
|
290
|
-
* the HOST puts it back, because the host owns the string. */
|
|
291
|
-
onCancel?: (restored: string) => void;
|
|
292
|
-
/** What Enter means — NOT how the text wraps. Both modes soft-wrap. */
|
|
293
|
-
multiline?: boolean;
|
|
294
|
-
placeholder?: string;
|
|
295
|
-
/** Accessible name for the box. */
|
|
296
|
-
ariaLabel?: string;
|
|
297
|
-
className?: string;
|
|
298
|
-
/** Nothing may be typed or pressed. */
|
|
299
|
-
readOnly?: boolean;
|
|
300
|
-
/**
|
|
301
|
-
* The grammar's rule set — `CAMPAIGN_MARKUP` in the designer,
|
|
302
|
-
* `STOREFRONT_MARKUP` in the shop, both from `efficient-easel/markup`. It
|
|
303
|
-
* decides what the LAYER paints; {@link tools} decides what the BAR offers,
|
|
304
|
-
* and a host that lets those two disagree gets a button whose mark draws as
|
|
305
|
-
* plain text.
|
|
306
|
-
*/
|
|
307
|
-
rules?: readonly InlineRule[];
|
|
308
|
-
/**
|
|
309
|
-
* Which mark buttons to show — styles resolved against the shared grammar, or
|
|
310
|
-
* the host's own descriptors used verbatim. See `MarkBarProps.tools`. Empty
|
|
311
|
-
* draws no bar.
|
|
312
|
-
*/
|
|
313
|
-
tools?: MarkBarProps['tools'];
|
|
314
|
-
/**
|
|
315
|
-
* How a mark is written. Defaults to the shared grammar's `applyMark`; the
|
|
316
|
-
* storefront passes its own so its three word styles reach the same bar.
|
|
317
|
-
*/
|
|
318
|
-
writeMark?: MarkWriter;
|
|
319
|
-
/**
|
|
320
|
-
* Buttons that are NOT marks, drawn after a divider at the end of the bar.
|
|
321
|
-
*
|
|
322
|
-
* The storefront's "Clear formatting" is the one that exists: it writes no
|
|
323
|
-
* mark at all, so it is not in the grammar's tool list and must not be added
|
|
324
|
-
* to it. Drawing it here keeps `MARKUP_TOOLS` meaning "what a mark MEANS".
|
|
325
|
-
*/
|
|
326
|
-
actions?: ReactNode;
|
|
327
|
-
/** The alignment strip. Omitted = no strip. */
|
|
328
|
-
align?: CopyBoxAlign<CopyAlign>;
|
|
329
|
-
/** What each mark button is DRAWN as — see `MarkBarProps.glyphs`. Default is
|
|
330
|
-
* the grammar's own letter. */
|
|
331
|
-
glyphs?: MarkBarProps['glyphs'];
|
|
332
|
-
/** What the formatting group is CALLED — see `MarkBarProps.ariaLabel`. */
|
|
333
|
-
barLabel?: string;
|
|
334
|
-
/** What goes under the box — see {@link CopyBoxFooter}. */
|
|
335
|
-
renderFooter?: (ctx: CopyBoxFooter) => ReactNode;
|
|
336
|
-
/**
|
|
337
|
-
* When the bar is drawn. `'always'` (the default) keeps it over the box at
|
|
338
|
-
* rest. `'focus'` draws it only while this box is being typed in — the text
|
|
339
|
-
* box design for 4.9: a column of text settings at rest is a column of
|
|
340
|
-
* words, not a column of toolbars.
|
|
341
|
-
*/
|
|
342
|
-
barShows?: 'always' | 'focus';
|
|
343
|
-
/**
|
|
344
|
-
* Show the EFFECT, not the marks (0.95.0, rulings B + C — the default). A
|
|
345
|
-
* many-line box gets a "Show marks" switch under it that flips to the raw
|
|
346
|
-
* text with its marks and back; a one-line box is always the effect.
|
|
347
|
-
* `false` keeps the 0.94 box (the raw text, painted) with no switch.
|
|
348
|
-
*
|
|
349
|
-
* ⚠️ In the rich view there is no textarea, so {@link inputRef} holds null.
|
|
350
|
-
* Insert at the caret through `renderFooter`'s `insert`, which works in both.
|
|
351
|
-
*/
|
|
352
|
-
richText?: boolean;
|
|
353
|
-
/** A many-line box opens with its marks shown. Default false. */
|
|
354
|
-
defaultShowMarks?: boolean;
|
|
355
|
-
/**
|
|
356
|
-
* Which toolbar (E5b). `'final'` — the default — is the design made final
|
|
357
|
-
* on 2026-10-06: two rows on one 9-column grid, B · I · U · S · Color ·
|
|
358
|
-
* Link · Superscript · Subscript · the host's {@link lastTool} (Undo until
|
|
359
|
-
* 2026-10-07) over Left · Center · Right · Justify
|
|
360
|
-
* · Bulleted · Numbered · Aa · AA · aa, with the number {@link cells}
|
|
361
|
-
* between it and the box. `'classic'` is the bar before it (`MarkBar` and
|
|
362
|
-
* the alignment strip), for a host not moved over yet.
|
|
363
|
-
*/
|
|
364
|
-
toolbar?: 'final' | 'classic';
|
|
365
|
-
/**
|
|
366
|
-
* The theme colours the colour window offers (final toolbar): the NAME
|
|
367
|
-
* saved in `[words]{color=name}`, what it is called, and its value. The box
|
|
368
|
-
* paints a coloured word with the value (`--es-color-<name>`). The window
|
|
369
|
-
* also offers Any color, saved as a hex (`[words]{color=#rrggbb}`). No colours:
|
|
370
|
-
* no colour button, and no blank where it was (Lewis 2026-10-13).
|
|
371
|
-
*/
|
|
372
|
-
colors?: readonly CopyThemeColor[];
|
|
373
|
-
/** The number cells between the toolbar and the box (final toolbar), each
|
|
374
|
-
* the host's value — see `COPY_CELLS`. None: no cells. */
|
|
375
|
-
cells?: readonly CopyCell[];
|
|
376
|
-
/**
|
|
377
|
-
* The host's letter-case field, set by Aa · AA · aa (final toolbar). The
|
|
378
|
-
* lit one pressed again writes `''`: no case of its own, the style decides.
|
|
379
|
-
* Left out: no case buttons, and no blanks where they were (Lewis
|
|
380
|
-
* 2026-10-13). A row with no tool at all is not drawn.
|
|
381
|
-
*/
|
|
382
|
-
letterCase?: {
|
|
383
|
-
value: CopyCase | '';
|
|
384
|
-
onChange: (next: CopyCase | '') => void;
|
|
385
|
-
disabled?: boolean;
|
|
386
|
-
};
|
|
387
|
-
/**
|
|
388
|
-
* Row 1's 9th cell of the final toolbar, drawn by the host (owner ruling
|
|
389
|
-
* 2026-10-07: Undo left that cell). Return one control; it is placed in the
|
|
390
|
-
* cell as given; one that draws nothing (`null`) leaves no blank. Left
|
|
391
|
-
* out, row 1 is eight buttons spread over the row. See
|
|
392
|
-
* {@link CopyBoxLastTool}.
|
|
393
|
-
*/
|
|
394
|
-
lastTool?: (slot: CopyBoxLastTool) => ReactNode;
|
|
395
|
-
/** A handle on the textarea, for a host that needs one — and the SAME object
|
|
396
|
-
* the control uses, so there is never a second ref to reconcile. A plain prop
|
|
397
|
-
* rather than `ref`, for the reason `GoldLayer.layerRef` gives. */
|
|
398
|
-
inputRef?: TextAreaHandle;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
11
|
declare function CopyBox({ value, onChange, onCommit, onCancel, multiline, placeholder, ariaLabel, className, readOnly, rules, tools, writeMark, actions, align, glyphs, barLabel, renderFooter, inputRef, barShows, richText, defaultShowMarks, toolbar, colors, cells, letterCase, lastTool, }: CopyBoxProps): react.JSX.Element;
|
|
402
12
|
|
|
403
13
|
/** Whether the lines are a list, and which kind. */
|
|
@@ -413,6 +23,15 @@ interface TextPartStrip<V extends string> {
|
|
|
413
23
|
interface TextPartPanelProps {
|
|
414
24
|
/** The kept box, on top: a `CopyBox` for words the canvas cannot take. */
|
|
415
25
|
kept?: CopyBoxProps;
|
|
26
|
+
/** One line under the kept box (what its host tool does, say). A name is
|
|
27
|
+
* never a manual: the hint is where a clause goes (`SettingsField`'s). */
|
|
28
|
+
keptHint?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Nothing can be changed (a sent campaign, a page held by somebody else):
|
|
31
|
+
* every control is shown and disabled, and nothing writes. The kept box is
|
|
32
|
+
* read-only too.
|
|
33
|
+
*/
|
|
34
|
+
readOnly?: boolean;
|
|
416
35
|
style?: {
|
|
417
36
|
value: string;
|
|
418
37
|
/** The site's (or the email's) text styles. `description` is the second
|
|
@@ -435,7 +54,9 @@ interface TextPartPanelProps {
|
|
|
435
54
|
/** A long list (the website's fonts): the field is a search. */
|
|
436
55
|
searchable?: boolean;
|
|
437
56
|
};
|
|
438
|
-
/** The Italic button at the end of the Font row
|
|
57
|
+
/** The Italic button at the end of the Font row — or, where the host hands
|
|
58
|
+
* no `font` (a phone has no font of its own), on a row of its own named
|
|
59
|
+
* Italic, where the Font row stands. `undefined` follows the style. */
|
|
439
60
|
italic?: {
|
|
440
61
|
value: boolean | undefined;
|
|
441
62
|
styleValue?: boolean;
|
|
@@ -448,7 +69,7 @@ interface TextPartPanelProps {
|
|
|
448
69
|
list?: TextPartStrip<TextList>;
|
|
449
70
|
letterCase?: TextPartStrip<TextCase>;
|
|
450
71
|
}
|
|
451
|
-
declare function TextPartPanel({ kept, style, font, italic, cells, align, list, letterCase }: TextPartPanelProps): react.JSX.Element;
|
|
72
|
+
declare function TextPartPanel({ kept, keptHint, readOnly, style, font, italic, cells, align, list, letterCase, }: TextPartPanelProps): react.JSX.Element;
|
|
452
73
|
|
|
453
74
|
interface PasteData {
|
|
454
75
|
/** The clipboard's `text/html`, when there is one. */
|
|
@@ -700,4 +321,4 @@ interface CaretEdit {
|
|
|
700
321
|
*/
|
|
701
322
|
declare function useCaretEdit({ target, onChange }: CaretEdit): (edit: (el: HTMLInputElement | HTMLTextAreaElement | null) => WrapResult) => void;
|
|
702
323
|
|
|
703
|
-
export {
|
|
324
|
+
export { type CaretEdit, CopyAlign, CopyBox, CopyBoxProps, CopyCell, type History, MARKUP_CLIPBOARD_TYPE, type PasteData, type PasteOptions, RichBox, type RichBoxProps, type RichEdit, type RichHandle, type RichInputEvent, type RichInputResult, type RichInsert, type RichLayout, type RichLine, type RichPending, type Snapshot, TYPING_BURST_MS, TextBoxHandle, type TextCase, type TextList, TextPartPanel, type TextPartPanelProps, type TextPartStrip, createHistory, editVisible, markupOfRange, newLine, pasteToMarkup, richInput, richLayout, selectionToSource, selectionToVisible, setBullet, toSource, toSourceStart, toVisible, useCaretEdit };
|