efficient-easel 21.1.0 → 22.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.
- package/README.md +27 -34
- package/dist/{CanvasDragLayer-CFUcBbgc.d.ts → CanvasDragLayer-B6Yn9S8T.d.ts} +4 -4
- package/dist/{ScreenDocumentContext-1RgtGKWR.d.ts → ScreenDocumentContext-BIK3uWtF.d.ts} +4 -4
- package/dist/blocks/index.d.ts +16 -18
- package/dist/{buckets-Sw94ll9I.d.ts → buckets-_MGDYJlb.d.ts} +1 -1
- package/dist/canvas/index.d.ts +8 -10
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-2L6KWUBC.js → chunk-4LGROS5L.js} +1 -1
- package/dist/{chunk-WJJ7H42G.js → chunk-CUZQ2HMA.js} +15 -15
- package/dist/chunk-GHBK7BKL.js +1 -0
- package/dist/{chunk-MLQKNED6.js → chunk-IROEWITG.js} +1 -1
- package/dist/{chunk-YVFYWAYU.js → chunk-IYYE7VJN.js} +30 -30
- package/dist/chunk-KN2TIXUT.js +1 -0
- package/dist/{chunk-GWYNMSIP.js → chunk-RY5AWQ63.js} +1 -1
- package/dist/chunk-SJMS247S.js +5 -0
- package/dist/{chunk-DNQ7AF6K.js → chunk-TLN5ZT76.js} +1 -1
- package/dist/chunk-TXR7GC5A.js +8 -0
- package/dist/{chunk-U5DNBT63.js → chunk-UMBNBCL4.js} +1 -1
- package/dist/{chunk-TUXLORVR.js → chunk-WJSEWAWK.js} +13 -13
- package/dist/{chunk-I67UW5UG.js → chunk-XWKQP6AE.js} +1 -1
- package/dist/{chunk-U7TFWHST.js → chunk-YC6KLSW3.js} +1 -1
- package/dist/{chunk-PFFH7ASD.js → chunk-YHFKWV7H.js} +13 -13
- package/dist/copy/index.d.ts +2 -2
- package/dist/copy/index.js +11 -11
- package/dist/data/index.d.ts +21 -21
- package/dist/drag/index.d.ts +5 -5
- package/dist/drag/index.js +1 -1
- package/dist/draw/index.d.ts +1 -1
- package/dist/easel/easel.css +5 -7
- package/dist/easel/index.d.ts +57 -57
- package/dist/easel/index.js +1 -1
- package/dist/edit-lock/index.d.ts +5 -5
- package/dist/fields/fields.css +1 -1
- package/dist/fields/index.d.ts +17 -17
- package/dist/fields/index.js +1 -1
- package/dist/node-ops/index.d.ts +3 -3
- package/dist/panel/index.d.ts +4 -4
- package/dist/panel/panel.css +1 -1
- package/dist/{plan-CZS902DV.d.ts → plan-CRUh2kVK.d.ts} +5 -5
- package/dist/render/index.d.ts +19 -19
- package/dist/render/index.js +5 -5
- package/dist/{repeat-BNgSq2Nw.d.ts → repeat-D65bJS8d.d.ts} +1 -1
- package/dist/{resolve-D68pb3Bx.d.ts → resolve-AJ6WF4EL.d.ts} +5 -5
- package/dist/screen/components/AddBlockRow.js +1 -1
- package/dist/screen/components/AddSidePanel.d.ts +2 -2
- package/dist/screen/components/AddSidePanel.js +1 -1
- package/dist/screen/components/NodeContextMenu.d.ts +11 -11
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PreviewDeviceContext.d.ts +1 -1
- package/dist/screen/components/PreviewPartsContext.d.ts +2 -2
- package/dist/screen/components/SaveControls.d.ts +8 -8
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +5 -5
- package/dist/screen/components/ScreenMount.d.ts +8 -8
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +12 -12
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +17 -17
- package/dist/screen/components/usePartBridge.d.ts +10 -10
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +8 -8
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +4 -4
- package/dist/screen/lib/document/add-target-types.js +0 -1
- package/dist/screen/lib/document/content-tree.d.ts +7 -7
- package/dist/screen/lib/document/device-fields.d.ts +7 -7
- package/dist/screen/lib/document/field-buckets.d.ts +1 -1
- package/dist/screen/lib/document/field-markers.d.ts +5 -5
- package/dist/screen/lib/document/palette-sections.d.ts +5 -5
- package/dist/screen/lib/document/panel-fields.d.ts +6 -6
- package/dist/screen/lib/document/panel-no-control-mark.d.ts +4 -5
- package/dist/screen/lib/document/part-id.d.ts +1 -1
- package/dist/screen/lib/document/preview-events.d.ts +2 -2
- package/dist/screen/lib/document/preview-selection-context.d.ts +2 -2
- package/dist/screen/lib/document/section-doc.d.ts +5 -5
- package/dist/screen/lib/document/slot-child-name.d.ts +1 -1
- package/dist/screen/lib/document/slot-section-spec.d.ts +1 -1
- package/dist/screen/lib/document/slot-section-spec.js +0 -1
- package/dist/screen/lib/document/style-clipboard.d.ts +8 -8
- package/dist/screen/lib/document/tree-reveal.d.ts +6 -6
- package/dist/screen/lib/document/tree-reveal.js +1 -1
- package/dist/screen/lib/document/use-section-ops.d.ts +6 -6
- package/dist/screen/lib/document/use-section-ops.js +1 -1
- package/dist/screen/lib/document-addressing.d.ts +5 -5
- package/dist/screen/lib/document-hooks.d.ts +4 -4
- package/dist/screen/lib/host.d.ts +5 -5
- package/dist/screen/lib/key-scope.d.ts +1 -1
- package/dist/screen/lib/key-scope.js +1 -1
- package/dist/screen/lib/media-panel.d.ts +5 -5
- package/dist/screen/lib/media-picker.d.ts +6 -6
- package/dist/screen/lib/page-lock.d.ts +4 -4
- package/dist/screen/lib/screen-parts.d.ts +13 -16
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-templates.d.ts +4 -4
- package/dist/screen/lib/session-context.d.ts +4 -4
- package/dist/screen/lib/session.d.ts +5 -5
- package/dist/screen/lib/shared-sections.d.ts +4 -4
- package/dist/screen/screen.css +15 -15
- package/dist/{session-DSQFmIvx.d.ts → session-CrWwDt7Z.d.ts} +1 -1
- package/dist/strings/index.d.ts +2 -2
- package/dist/strings/index.js +1 -1
- package/dist/style-clipboard/index.d.ts +2 -2
- package/dist/text-styles/index.js +21 -21
- package/dist/{types-B8NwXKlE.d.ts → types-BFd8FqQw.d.ts} +3 -3
- package/dist/{types-Cq53lL8d.d.ts → types-DFxBChE3.d.ts} +18 -18
- package/dist/{types-41704JE4.d.ts → types-DlQIM1YO.d.ts} +8 -8
- package/dist/{useNodeOps-fIDWzftn.d.ts → useNodeOps-C_nisDHh.d.ts} +2 -2
- package/dist/{watch-D8xZow3y.d.ts → watch-D0bNZRtU.d.ts} +3 -3
- package/dist/{words-CmEnDoOe.d.ts → words-fbR9IwxH.d.ts} +1 -1
- package/package.json +3 -147
- package/dist/chunk-2C7W64S5.js +0 -8
- package/dist/chunk-4FD7TAOE.js +0 -1
- package/dist/chunk-67HCYOW4.js +0 -1
- package/dist/chunk-A2VVB4RH.js +0 -0
- package/dist/chunk-OHZHYROJ.js +0 -5
- package/dist/chunk-PRHBWA5V.js +0 -0
- package/dist/chunk-YIUE4US7.js +0 -0
- package/dist/screen/lib/puck/add-target-types.d.ts +0 -3
- package/dist/screen/lib/puck/add-target-types.js +0 -1
- package/dist/screen/lib/puck/block-choice.d.ts +0 -1
- package/dist/screen/lib/puck/block-choice.js +0 -1
- package/dist/screen/lib/puck/block-types-in.d.ts +0 -1
- package/dist/screen/lib/puck/block-types-in.js +0 -1
- package/dist/screen/lib/puck/content-tree.d.ts +0 -1
- package/dist/screen/lib/puck/content-tree.js +0 -1
- package/dist/screen/lib/puck/device-fields.d.ts +0 -4
- package/dist/screen/lib/puck/device-fields.js +0 -1
- package/dist/screen/lib/puck/field-buckets.d.ts +0 -2
- package/dist/screen/lib/puck/field-buckets.js +0 -1
- package/dist/screen/lib/puck/field-markers.d.ts +0 -2
- package/dist/screen/lib/puck/field-markers.js +0 -1
- package/dist/screen/lib/puck/hidable.d.ts +0 -1
- package/dist/screen/lib/puck/hidable.js +0 -1
- package/dist/screen/lib/puck/palette-sections.d.ts +0 -8
- package/dist/screen/lib/puck/palette-sections.js +0 -1
- package/dist/screen/lib/puck/panel-fields.d.ts +0 -1
- package/dist/screen/lib/puck/panel-fields.js +0 -1
- package/dist/screen/lib/puck/panel-no-control-mark.d.ts +0 -2
- package/dist/screen/lib/puck/panel-no-control-mark.js +0 -1
- package/dist/screen/lib/puck/part-id.d.ts +0 -1
- package/dist/screen/lib/puck/part-id.js +0 -1
- package/dist/screen/lib/puck/preview-click.d.ts +0 -1
- package/dist/screen/lib/puck/preview-click.js +0 -1
- package/dist/screen/lib/puck/preview-dom.d.ts +0 -1
- package/dist/screen/lib/puck/preview-dom.js +0 -1
- package/dist/screen/lib/puck/preview-events.d.ts +0 -1
- package/dist/screen/lib/puck/preview-events.js +0 -1
- package/dist/screen/lib/puck/preview-selection-context.d.ts +0 -2
- package/dist/screen/lib/puck/preview-selection-context.js +0 -1
- package/dist/screen/lib/puck/section-doc.d.ts +0 -9
- package/dist/screen/lib/puck/section-doc.js +0 -1
- package/dist/screen/lib/puck/slot-child-name.d.ts +0 -1
- package/dist/screen/lib/puck/slot-child-name.js +0 -1
- package/dist/screen/lib/puck/slot-heal.d.ts +0 -2
- package/dist/screen/lib/puck/slot-heal.js +0 -1
- package/dist/screen/lib/puck/slot-section-spec.d.ts +0 -1
- package/dist/screen/lib/puck/slot-section-spec.js +0 -1
- package/dist/screen/lib/puck/style-clipboard.d.ts +0 -42
- package/dist/screen/lib/puck/style-clipboard.js +0 -1
- package/dist/screen/lib/puck/text-control-kinds.d.ts +0 -1
- package/dist/screen/lib/puck/text-control-kinds.js +0 -1
- package/dist/screen/lib/puck/tree-reveal.d.ts +0 -1
- package/dist/screen/lib/puck/tree-reveal.js +0 -1
- package/dist/screen/lib/puck/use-section-ops.d.ts +0 -9
- package/dist/screen/lib/puck/use-section-ops.js +0 -1
package/dist/data/index.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { D as Data, a as DataConfig, N as Node, S as SlotAddress, F as Found, P as Place, b as SlotEntry, W as WalkInfo } from '../types-
|
|
2
|
-
export { B as BlockShape, c as FieldShape, d as FieldsShape, e as NodeProps, R as RootData } from '../types-
|
|
3
|
-
export { R as ResolvableItem, a as ResolveCache, b as ResolveOptions, c as ResolveTrigger, d as changedProps, e as createResolveCache, f as deepEqual, r as resolveNodeData } from '../resolve-
|
|
1
|
+
import { D as Data, a as DataConfig, N as Node, S as SlotAddress, F as Found, P as Place, b as SlotEntry, W as WalkInfo } from '../types-DlQIM1YO.js';
|
|
2
|
+
export { B as BlockShape, c as FieldShape, d as FieldsShape, e as NodeProps, R as RootData } from '../types-DlQIM1YO.js';
|
|
3
|
+
export { R as ResolvableItem, a as ResolveCache, b as ResolveOptions, c as ResolveTrigger, d as changedProps, e as createResolveCache, f as deepEqual, r as resolveNodeData } from '../resolve-AJ6WF4EL.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Finding a node's slots, and reading or writing a value at a prop path.
|
|
7
7
|
*
|
|
8
|
-
* A slot is found the way
|
|
8
|
+
* A slot is found the way the old editor finds one: by the FIELDS, not by the value. A
|
|
9
9
|
* prop is a slot when its field says `type: 'slot'`; a slot can also sit inside
|
|
10
10
|
* an `object` field or inside each item of an `array` field, and its name is
|
|
11
|
-
* then the prop path
|
|
11
|
+
* then the prop path the old editor gives it — `items[0].content`, `box.content`.
|
|
12
12
|
*
|
|
13
|
-
* One deliberate difference from
|
|
13
|
+
* One deliberate difference from the old editor: the old editor also walks an object whose field is
|
|
14
14
|
* NOT an `object` field using the PARENT's field map, so a key there that
|
|
15
15
|
* happens to share a slot's name is treated as a slot. No document relies on
|
|
16
|
-
* that (a non-array value there crashes
|
|
16
|
+
* that (a non-array value there crashes the old editor's own walk), and a rule that
|
|
17
17
|
* depends on a coincidence of names is not one to copy.
|
|
18
18
|
*
|
|
19
19
|
* Order is DECLARATION order — the order the fields are written in the config,
|
|
20
|
-
* which is the order a person reads the block in (`col1` before `col2`).
|
|
20
|
+
* which is the order a person reads the block in (`col1` before `col2`). The old editor
|
|
21
21
|
* visits slots in reverse, as a side effect of how it fills empty ones; nothing
|
|
22
22
|
* in either app depends on that.
|
|
23
23
|
*/
|
|
@@ -195,7 +195,7 @@ declare function copyTranslation(overlay: TranslationOverlay | null | undefined,
|
|
|
195
195
|
/**
|
|
196
196
|
* efficient-easel/data — the document, as pure functions.
|
|
197
197
|
*
|
|
198
|
-
* The bottom layer of the engine that replaces
|
|
198
|
+
* The bottom layer of the engine that replaces the old editor (the blueprint "From
|
|
199
199
|
* The Ground Up For Efficient Editor", 2026-09-29, step 1.1). Every function
|
|
200
200
|
* takes a document and returns a new one; nothing here holds state, knows
|
|
201
201
|
* about React, or touches a browser global, so a server component, a Node
|
|
@@ -213,17 +213,17 @@ declare function copyTranslation(overlay: TranslationOverlay | null | undefined,
|
|
|
213
213
|
* round-trip spec pins each one:
|
|
214
214
|
*
|
|
215
215
|
* 1. An empty slot is written as `[]`, and `zones` is written as `{}`.
|
|
216
|
-
* 2. Default props follow
|
|
216
|
+
* 2. Default props follow the old editor: a new block is created WITH its
|
|
217
217
|
* `defaultProps`; the root's `defaultProps` are filled in on open; an
|
|
218
218
|
* existing block is never back-filled.
|
|
219
219
|
* 3. A root prop that no field declares (a site's `theme`, `fonts`, `scales`)
|
|
220
220
|
* is kept exactly as it is. Nothing here drops a key it doesn't know.
|
|
221
221
|
* 4. The two older formats are READ — root props written directly on `root`,
|
|
222
|
-
* and children parked in `zones` — and converted on open, the way
|
|
222
|
+
* and children parked in `zones` — and converted on open, the way the old editor's
|
|
223
223
|
* `migrate()` converts them. They are never written back.
|
|
224
224
|
*
|
|
225
225
|
* KEY ORDER. The backend stores these documents in Postgres `jsonb`, which does
|
|
226
|
-
* not keep key order, so "the same document as
|
|
226
|
+
* not keep key order, so "the same document as the old editor" means the same keys and
|
|
227
227
|
* values. What this layer does promise is stronger for its own round trip: a
|
|
228
228
|
* document that is already in shape comes back as THE SAME OBJECT (so
|
|
229
229
|
* `normalizeData(doc) === doc`), and every edit copies only the nodes on the
|
|
@@ -239,7 +239,7 @@ declare function copyTranslation(overlay: TranslationOverlay | null | undefined,
|
|
|
239
239
|
*/
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
|
-
* What `normalizeData` accepts: any saved document, as loosely as
|
|
242
|
+
* What `normalizeData` accepts: any saved document, as loosely as the old editor's own
|
|
243
243
|
* `Data` type describes one (`root.props` optional). Converting the older
|
|
244
244
|
* shapes is its job, so it must take them without a cast. Every OTHER function
|
|
245
245
|
* here takes the normalised `Data` it returns.
|
|
@@ -259,9 +259,9 @@ declare const ROOT_ID = "root";
|
|
|
259
259
|
declare const ROOT_SLOT = "default-zone";
|
|
260
260
|
/** The top-level list, as an address. */
|
|
261
261
|
declare const ROOT_LIST: SlotAddress;
|
|
262
|
-
/** `{ parentId, slot }` →
|
|
262
|
+
/** `{ parentId, slot }` → the old editor's zone key `"<parentId>:<slot>"`. */
|
|
263
263
|
declare const zoneKey: ({ parentId, slot }: SlotAddress) => string;
|
|
264
|
-
/**
|
|
264
|
+
/** The old editor's zone key → `{ parentId, slot }`. Ids and prop paths hold no colon. */
|
|
265
265
|
declare function parseZoneKey(key: string): SlotAddress;
|
|
266
266
|
type DataErrorCode = 'not-found' | 'no-slot' | 'bad-index' | 'duplicate-id' | 'cycle' | 'id-change' | 'unknown-type';
|
|
267
267
|
declare class DataError extends Error {
|
|
@@ -294,7 +294,7 @@ declare function find(data: Data, config: DataConfig, id: string): Found | null;
|
|
|
294
294
|
/** The list at an address, or `null` when no such slot exists. */
|
|
295
295
|
declare function getList(data: Data, config: DataConfig, address: SlotAddress): Node[] | null;
|
|
296
296
|
/**
|
|
297
|
-
* What the easel does to a document when it opens it — the same result
|
|
297
|
+
* What the easel does to a document when it opens it — the same result the old editor
|
|
298
298
|
* reaches on load, with the older formats converted (rule 4):
|
|
299
299
|
*
|
|
300
300
|
* - `root` holding its props directly becomes `{ props: { …those keys } }`;
|
|
@@ -309,7 +309,7 @@ declare function getList(data: Data, config: DataConfig, address: SlotAddress):
|
|
|
309
309
|
*/
|
|
310
310
|
declare function normalizeData(data: DataInput | Data, config: DataConfig): Data;
|
|
311
311
|
/**
|
|
312
|
-
* A new block, the way the Add panel makes one —
|
|
312
|
+
* A new block, the way the Add panel makes one — the old editor's `insert` recipe:
|
|
313
313
|
* `{ ...defaultProps, id }`, plus any `props` the caller starts it with. The
|
|
314
314
|
* defaults are copied, so two blocks never share an array or object, and every
|
|
315
315
|
* child a default slot seeds gets its own id.
|
|
@@ -328,7 +328,7 @@ declare function insert(data: Data, config: DataConfig, place: Place, node: Node
|
|
|
328
328
|
declare function remove(data: Data, config: DataConfig, id: string): Data;
|
|
329
329
|
/**
|
|
330
330
|
* Move a node to `to`. Within one list, `to.index` is the node's index AFTER
|
|
331
|
-
* the move (
|
|
331
|
+
* the move (the old editor's rule), so `0 … length-1`; into another list it is the index
|
|
332
332
|
* to insert at, `0 … length`. A move into the node's own subtree is refused.
|
|
333
333
|
*/
|
|
334
334
|
declare function move(data: Data, config: DataConfig, id: string, to: Place): Data;
|
|
@@ -336,7 +336,7 @@ declare function move(data: Data, config: DataConfig, id: string, to: Place): Da
|
|
|
336
336
|
* Copy a node, and everything under it, to the place just after it. Every
|
|
337
337
|
* copied node gets a fresh id. `strip` sees each copied node (with its new id)
|
|
338
338
|
* and returns what to keep — the hook for "a copy must not claim the
|
|
339
|
-
* original's baked image" (`bakedId`), which
|
|
339
|
+
* original's baked image" (`bakedId`), which the old editor's own duplicate copied
|
|
340
340
|
* verbatim.
|
|
341
341
|
*/
|
|
342
342
|
declare function duplicate(data: Data, config: DataConfig, id: string, options?: {
|
|
@@ -354,7 +354,7 @@ declare function copyNode(node: Node, config: DataConfig, options?: {
|
|
|
354
354
|
strip?: (node: Node) => Node;
|
|
355
355
|
}): Node;
|
|
356
356
|
/**
|
|
357
|
-
* Merge `patch` into a node's props —
|
|
357
|
+
* Merge `patch` into a node's props — the old editor's `replace`, for the common case of
|
|
358
358
|
* changing some props. A key keeps its place; a new key goes on the end;
|
|
359
359
|
* `undefined` clears a key (JSON drops it on save). New children in a patched
|
|
360
360
|
* slot are brought into shape. Changing `id` is refused. A patch that changes
|
|
@@ -362,7 +362,7 @@ declare function copyNode(node: Node, config: DataConfig, options?: {
|
|
|
362
362
|
*/
|
|
363
363
|
declare function setProps(data: Data, config: DataConfig, id: string, patch: Record<string, unknown>): Data;
|
|
364
364
|
/**
|
|
365
|
-
* Replace a node wholesale —
|
|
365
|
+
* Replace a node wholesale — the old editor's `replace` action: the node keeps its place
|
|
366
366
|
* and its id, and every prop is the new node's (a key it does not carry is
|
|
367
367
|
* gone, which `setProps` cannot do). Children in its slots that arrive without
|
|
368
368
|
* an id get one, and an id another node already holds is refused, as `insert`
|
package/dist/drag/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import { P as Place } from '../types-
|
|
4
|
-
import { D as DragSession } from '../session-
|
|
5
|
-
export { a as DragHeld, c as createDragSession } from '../session-
|
|
6
|
-
export { B as Box, a as CanvasDragLayer, b as CanvasDragLayerProps, C as CanvasDragModel, c as CanvasDropTarget, d as CanvasSeam, e as CanvasSource, f as CanvasZone, E as EMPTY_MEASURE, H as HANDLE_GRACE_MS, M as MeasuredCanvas, g as MeasuredNode, h as canvasTarget, i as contains, j as gapInZone, k as gapLine, l as insertSeams, m as measureCanvas, p as pickSource, s as seamsBetween, n as sourcesAt } from '../CanvasDragLayer-
|
|
3
|
+
import { P as Place } from '../types-DlQIM1YO.js';
|
|
4
|
+
import { D as DragSession } from '../session-CrWwDt7Z.js';
|
|
5
|
+
export { a as DragHeld, c as createDragSession } from '../session-CrWwDt7Z.js';
|
|
6
|
+
export { B as Box, a as CanvasDragLayer, b as CanvasDragLayerProps, C as CanvasDragModel, c as CanvasDropTarget, d as CanvasSeam, e as CanvasSource, f as CanvasZone, E as EMPTY_MEASURE, H as HANDLE_GRACE_MS, M as MeasuredCanvas, g as MeasuredNode, h as canvasTarget, i as contains, j as gapInZone, k as gapLine, l as insertSeams, m as measureCanvas, p as pickSource, s as seamsBetween, n as sourcesAt } from '../CanvasDragLayer-B6Yn9S8T.js';
|
|
7
7
|
import { D as DragWords } from '../words-SD4neL0n.js';
|
|
8
|
-
import '../watch-
|
|
8
|
+
import '../watch-D0bNZRtU.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Where a drop lands — the engine's one hit rule, as pure functions (blueprint
|
package/dist/drag/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-
|
|
1
|
+
export{AddPanel,CanvasDragLayer,CanvasInsert,EMPTY_MEASURE,HANDLE_GRACE_MS,canvasTarget,contains,gapInZone,gapLine,insertSeams,measureCanvas,pickSource,seamsBetween,sourcesAt}from"../chunk-CUZQ2HMA.js";import"../chunk-TQ5Y6S2X.js";export{AUTO_SCROLL_EDGE,AUTO_SCROLL_MAX_SPEED,autoScrollDelta,autoScrollSpeed,createDragSession,dropEffectFor,dropOnRow,frameScrollBox,gapToMoveIndex,isNoOpDrop,scrollBoxOf,scrollParent,startAutoScroll,stepGap,useTreeDrag}from"../chunk-3S5N4HLJ.js";import"../chunk-P2VEMZH5.js";import"../chunk-GHBK7BKL.js";import"../chunk-LF3FUSCQ.js";import"../chunk-K7BTCBWD.js";import"../chunk-L55YIXDC.js";
|
package/dist/draw/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ export { RowNameRule, rootRowName, sectionRenameProp, slotChildName, slotChildRe
|
|
|
6
6
|
export { FOOTER_TYPE, HEADER_TYPE, NodeLocation, ROOT_ZONE, SlotConfigView, TREE_MAX_DEPTH, TreeItem, blockNodeActions, childSlotsOf, locateNode, missingPinnedTypes, nestsInTree, newNodeId, pinnedDuplicateIds, pinnedDuplicateIndices, slotChildrenIn, slotFieldsOf } from '../screen/lib/document/content-tree.js';
|
|
7
7
|
export { AUTO_RULES, AutoRule, FOLLOW_RULES, VIEW_DESKTOP_MIN, VIEW_TABLET_MIN, VIEW_TIERS, VIEW_TIER_LABEL, ViewTier, ViewValueKind, ViewValues, isAuto, phoneKey, resolveViewValue, tabletKey, viewTierForWidth } from '../screen/lib/content/view-tiers.js';
|
|
8
8
|
export { HERO_SLIDER_GOTO_EVENT, HeroSliderGotoDetail } from '../screen/lib/document/preview-events.js';
|
|
9
|
-
export { R as REPEAT_ATTRIBUTE, a as REPEAT_INDEX_ATTRIBUTE } from '../repeat-
|
|
9
|
+
export { R as REPEAT_ATTRIBUTE, a as REPEAT_INDEX_ATTRIBUTE } from '../repeat-D65bJS8d.js';
|
|
10
10
|
export { TEXT_STYLE_CASES, TEXT_STYLE_CASE_CSS, TextStyleCase, TextStyleCaseCss, isTextStyleCase, textStyleCaseCss, textStyleCaseOfCss } from '../text-styles/model.js';
|
|
11
11
|
import '../words-gIDCeRv3.js';
|
package/dist/easel/easel.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* efficient-easel/easel — the canvas's own marks (blueprint 5.1): the
|
|
3
3
|
* lists' empty and selected states, and the outlines over the selected and
|
|
4
|
-
* hovered block.
|
|
4
|
+
* hovered block. The old editor's stylesheet drew these until now; the rules follow it.
|
|
5
5
|
*
|
|
6
6
|
* The canvas is an iframe of its own, so this sheet must reach it: import it
|
|
7
7
|
* once in the host, and `CanvasFrame` copies the host's stylesheets into the
|
|
@@ -44,16 +44,14 @@
|
|
|
44
44
|
box-shadow: var(--elevation-panel);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
/* The frame's root (CanvasFrame)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
[data-easel-entry],
|
|
51
|
-
[data-puck-entry] {
|
|
47
|
+
/* The frame's root (CanvasFrame): a stacking context of its own, so a block's
|
|
48
|
+
z-index stays inside the page. */
|
|
49
|
+
[data-easel-entry] {
|
|
52
50
|
position: relative;
|
|
53
51
|
z-index: 0;
|
|
54
52
|
}
|
|
55
53
|
/* A frame that FILLS its parent (`height="fill"`): the page is at least as tall
|
|
56
|
-
as the frame, as
|
|
54
|
+
as the frame, as the old editor's `#frame-root` was, so a short page's background and
|
|
57
55
|
its top list reach the bottom of the canvas. `height: 1px` gives the root a
|
|
58
56
|
height of its own for a list's `height: 100%` to resolve against. Not on an
|
|
59
57
|
`auto` frame, whose height comes FROM the page: there `100vh` is the frame
|
package/dist/easel/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { DataInput } from '../data/index.js';
|
|
2
|
-
import { N as NodeSelection, P as PassThrough } from '../plan-
|
|
3
|
-
export { I as ItemSelector } from '../plan-
|
|
4
|
-
import { E as EaselConfig, a as EaselView, b as EaselAction, P as Permissions, c as EaselCore, d as EaselUi } from '../types-
|
|
5
|
-
export { A as AppState, e as EaselHistory, H as HistoryEntry, S as SetDataPatch } from '../types-
|
|
6
|
-
import { S as SlotAddress, D as Data, P as Place, N as Node } from '../types-
|
|
7
|
-
import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../resolve-
|
|
2
|
+
import { N as NodeSelection, P as PassThrough } from '../plan-CRUh2kVK.js';
|
|
3
|
+
export { I as ItemSelector } from '../plan-CRUh2kVK.js';
|
|
4
|
+
import { E as EaselConfig, a as EaselView, b as EaselAction, P as Permissions, c as EaselCore, d as EaselUi } from '../types-DFxBChE3.js';
|
|
5
|
+
export { A as AppState, e as EaselHistory, H as HistoryEntry, S as SetDataPatch } from '../types-DFxBChE3.js';
|
|
6
|
+
import { S as SlotAddress, D as Data, P as Place, N as Node } from '../types-DlQIM1YO.js';
|
|
7
|
+
import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../resolve-AJ6WF4EL.js';
|
|
8
8
|
import * as react from 'react';
|
|
9
9
|
import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
|
|
10
10
|
import { TextToolbarProps } from 'efficient-shell/ui';
|
|
11
11
|
import { C as CopyBoxLastTool, a as CopyThemeColor, b as CanvasTypingEnd } from '../canvas-typing-Be4FO4q7.js';
|
|
12
12
|
import { InlineRule } from 'efficient-shell/markup';
|
|
13
|
-
import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-
|
|
14
|
-
import { I as InspectorFields } from '../types-
|
|
13
|
+
import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-C_nisDHh.js';
|
|
14
|
+
import { I as InspectorFields } from '../types-BFd8FqQw.js';
|
|
15
15
|
import '../words-BpTjCfqO.js';
|
|
16
|
-
import '../buckets-
|
|
16
|
+
import '../buckets-_MGDYJlb.js';
|
|
17
17
|
|
|
18
18
|
interface EaselOptions<C extends EaselConfig = EaselConfig> {
|
|
19
19
|
config: C;
|
|
@@ -31,11 +31,11 @@ interface EaselOptions<C extends EaselConfig = EaselConfig> {
|
|
|
31
31
|
* loaded as if it were an edit.
|
|
32
32
|
*/
|
|
33
33
|
onChange?: (data: Data) => void;
|
|
34
|
-
/** Easel-wide permissions, under each block's own (
|
|
34
|
+
/** Easel-wide permissions, under each block's own (the old editor's `permissions`). */
|
|
35
35
|
permissions?: Partial<Permissions>;
|
|
36
36
|
/**
|
|
37
37
|
* Changes recorded closer together than this collapse into ONE undo step —
|
|
38
|
-
*
|
|
38
|
+
* The old editor's 250 ms history debounce, so a word typed into a field is undone as
|
|
39
39
|
* a word and not as letters. A `batch` is never collapsed into its
|
|
40
40
|
* neighbours. 0 records every change on its own.
|
|
41
41
|
*/
|
|
@@ -55,7 +55,7 @@ interface Easel<C extends EaselConfig = EaselConfig> {
|
|
|
55
55
|
getState: () => EaselView<C>;
|
|
56
56
|
subscribe: (listener: () => void) => () => void;
|
|
57
57
|
/**
|
|
58
|
-
* One
|
|
58
|
+
* One the old editor action. Outside a `batch`, one undo step when it records.
|
|
59
59
|
* Permissions are not checked here (see `setPermissions`).
|
|
60
60
|
*/
|
|
61
61
|
dispatch: (action: EaselAction) => void;
|
|
@@ -87,8 +87,8 @@ interface Easel<C extends EaselConfig = EaselConfig> {
|
|
|
87
87
|
select?: NodeSelection | undefined;
|
|
88
88
|
}) => void;
|
|
89
89
|
/**
|
|
90
|
-
* Put a different document in WITHOUT remounting anything —
|
|
91
|
-
* new `key` on
|
|
90
|
+
* Put a different document in WITHOUT remounting anything — the old editor needed a
|
|
91
|
+
* new `key` on `the old editor root` for that, which threw away every subscriber's state.
|
|
92
92
|
* The history starts again at this document unless `keepHistory`.
|
|
93
93
|
*/
|
|
94
94
|
load: (data: DataInput | Data, options?: {
|
|
@@ -111,11 +111,11 @@ interface Easel<C extends EaselConfig = EaselConfig> {
|
|
|
111
111
|
*/
|
|
112
112
|
setPermissions: (permissions: Partial<Permissions>) => void;
|
|
113
113
|
/**
|
|
114
|
-
* Run every block's `resolveData` over the document, as
|
|
114
|
+
* Run every block's `resolveData` over the document, as `the old editor root` did when it
|
|
115
115
|
* mounted (trigger `'load'`), and write what changed as ONE change folded
|
|
116
116
|
* into the step it happens in — a resolver bringing a stale document up to
|
|
117
|
-
* date is not an undo step (
|
|
118
|
-
* document). `onChange` hears it, as
|
|
117
|
+
* date is not an undo step (the old editor made it one, which undid back to the stale
|
|
118
|
+
* document). `onChange` hears it, as the old editor's did. `EaselProvider` runs this
|
|
119
119
|
* on mount; a node changed by hand while it ran is left as the hand left it.
|
|
120
120
|
*/
|
|
121
121
|
resolveAll: (options?: {
|
|
@@ -127,10 +127,10 @@ interface Easel<C extends EaselConfig = EaselConfig> {
|
|
|
127
127
|
* write what changed folded into the step it happens in — `resolveAll`, for
|
|
128
128
|
* one node. Resolves to whether anything was written.
|
|
129
129
|
*
|
|
130
|
-
* It is what
|
|
130
|
+
* It is what the old editor's own insert ran: a block dropped from its component list
|
|
131
131
|
* was resolved with trigger `'insert'` (`insertComponent`), which is how a
|
|
132
132
|
* block seeds its children or stamps a default the moment it arrives. The
|
|
133
|
-
* `insert` ACTION never did —
|
|
133
|
+
* `insert` ACTION never did — the old editor's reducer was pure, and so is this one —
|
|
134
134
|
* and the engine has no drop of its own: the Add list's click and the drag's
|
|
135
135
|
* drop are the host's. So a host that puts a new block in, by `dispatch` or
|
|
136
136
|
* by `run`, follows it with this (second host, 2026-10-07):
|
|
@@ -138,7 +138,7 @@ interface Easel<C extends EaselConfig = EaselConfig> {
|
|
|
138
138
|
* easel.dispatch({ type: 'insert', componentType, destinationZone, destinationIndex, id });
|
|
139
139
|
* void easel.resolveNode(id, { trigger: 'insert' });
|
|
140
140
|
*
|
|
141
|
-
* ONE undo step with the insert (
|
|
141
|
+
* ONE undo step with the insert (the old editor made the resolver's write a second
|
|
142
142
|
* one, and a single undo left a block that had never been resolved). A node
|
|
143
143
|
* changed by hand, or taken out, while its resolver ran is left as it is.
|
|
144
144
|
* `trigger` is `'replace'` when not given, as `resolveNodeData`'s is.
|
|
@@ -148,10 +148,10 @@ interface Easel<C extends EaselConfig = EaselConfig> {
|
|
|
148
148
|
metadata?: Record<string, unknown>;
|
|
149
149
|
}) => Promise<boolean>;
|
|
150
150
|
/** This easel's memory of the last change each node was resolved for —
|
|
151
|
-
*
|
|
151
|
+
* The old editor kept one per editor, shared by every write that resolves. */
|
|
152
152
|
readonly resolveCache: ResolveCache;
|
|
153
153
|
/**
|
|
154
|
-
* Swap the config in place —
|
|
154
|
+
* Swap the config in place — `the old editor root` took a new `config` prop live. The
|
|
155
155
|
* website editor rebuilds a few blocks' fields when the site's gap moves; the
|
|
156
156
|
* document, the selection and the history are untouched.
|
|
157
157
|
*/
|
|
@@ -176,12 +176,12 @@ interface Easel<C extends EaselConfig = EaselConfig> {
|
|
|
176
176
|
* Puck 0.20's UI at mount (`defaultAppState.ui`), less the selection, which
|
|
177
177
|
* the store holds by id. A host's chrome reads these — the website editor
|
|
178
178
|
* opens its side panels from `leftSideBarVisible` / `rightSideBarVisible` — so
|
|
179
|
-
* a host moving off
|
|
179
|
+
* a host moving off `the old editor root` finds them where they were.
|
|
180
180
|
*/
|
|
181
181
|
declare const DEFAULT_UI: Record<string, unknown>;
|
|
182
182
|
/**
|
|
183
183
|
* THE EASEL STORE (blueprint step 5.1): the document, the selection by id and
|
|
184
|
-
* the host's UI keys, with
|
|
184
|
+
* the host's UI keys, with the old editor's actions, the old editor's history and a `batch` the old editor
|
|
185
185
|
* never had. Framework-free — `useEasel` (./react) is the React binding.
|
|
186
186
|
*/
|
|
187
187
|
declare function createEasel<C extends EaselConfig>(options: EaselOptions<C>): Easel<C>;
|
|
@@ -189,24 +189,24 @@ declare function createEasel<C extends EaselConfig>(options: EaselOptions<C>): E
|
|
|
189
189
|
/**
|
|
190
190
|
* Puck 0.20's reducer, on `efficient-easel/data` — blueprint step 5.1.
|
|
191
191
|
*
|
|
192
|
-
* Each action means what it meant to
|
|
192
|
+
* Each action means what it meant to the old editor, so the apps' `dispatch` calls move
|
|
193
193
|
* over unchanged (`reorder`'s and `move`'s indexes, `replaceRoot` MERGING
|
|
194
194
|
* props, `duplicate` selecting the copy, `insert` leaving the selection where
|
|
195
195
|
* it was). Two things differ, on purpose:
|
|
196
196
|
*
|
|
197
|
-
* - THE SELECTION IS BY ID.
|
|
197
|
+
* - THE SELECTION IS BY ID. The old editor held `itemSelector` — a place — so a node
|
|
198
198
|
* inserted or removed above the selected one silently moved the selection
|
|
199
199
|
* onto its neighbour, and both editors carried patches for exactly that.
|
|
200
200
|
* Here `itemSelector` is derived from the id on every read, and a
|
|
201
201
|
* selection whose node is gone becomes nothing rather than whatever now
|
|
202
202
|
* sits in its place.
|
|
203
|
-
* - A SLOT CAN BE SELECTED (a column): `ui.selectedSlot`, which
|
|
203
|
+
* - A SLOT CAN BE SELECTED (a column): `ui.selectedSlot`, which the old editor had no
|
|
204
204
|
* way to say.
|
|
205
205
|
*/
|
|
206
|
-
/** Whether
|
|
206
|
+
/** Whether the old editor records an action in history when the action does not say:
|
|
207
207
|
* everything but the state-setters. */
|
|
208
208
|
declare function recordsByDefault(action: EaselAction): boolean;
|
|
209
|
-
/** The UI as
|
|
209
|
+
/** The UI as the old editor shows it: the host's keys, with the selection translated. */
|
|
210
210
|
declare function uiView(core: EaselCore, config: EaselConfig): EaselUi;
|
|
211
211
|
/** A selection that still points at something; otherwise nothing. */
|
|
212
212
|
declare function validSelection(data: Data, config: EaselConfig, selection: NodeSelection): NodeSelection;
|
|
@@ -223,22 +223,22 @@ interface EaselProviderProps {
|
|
|
223
223
|
* `edit` permission is off (`bindUndoKeys`).
|
|
224
224
|
*/
|
|
225
225
|
hotkeys?: boolean;
|
|
226
|
-
/** Run every block's `resolveData` once the easel mounts, as
|
|
226
|
+
/** Run every block's `resolveData` once the easel mounts, as `the old editor root` did
|
|
227
227
|
* (`easel.resolveAll`). On by default. */
|
|
228
228
|
resolveOnMount?: boolean;
|
|
229
229
|
children?: ReactNode;
|
|
230
230
|
}
|
|
231
|
-
/** Puts one easel in reach of everything under it —
|
|
232
|
-
* half — and, as
|
|
231
|
+
/** Puts one easel in reach of everything under it — `the old editor root`'s provider
|
|
232
|
+
* half — and, as `the old editor root` did, binds undo / redo to the page's keyboard
|
|
233
233
|
* (`hotkeys={false}` for a host that binds its own) and runs every block's
|
|
234
234
|
* `resolveData` once on mount (`resolveOnMount={false}` to skip). */
|
|
235
235
|
declare function EaselProvider({ easel, hotkeys, resolveOnMount, children }: EaselProviderProps): react.JSX.Element;
|
|
236
236
|
/** The easel itself, for handlers that read the state at the moment they run
|
|
237
|
-
* (`
|
|
237
|
+
* (`the old store getter`'s job) and for `dispatch` / `batch` / `select`. */
|
|
238
238
|
declare function useEaselApi<C extends EaselConfig = EaselConfig>(): Easel<C>;
|
|
239
239
|
/**
|
|
240
|
-
* Read a slice of the easel and re-render when it changes —
|
|
241
|
-
* `
|
|
240
|
+
* Read a slice of the easel and re-render when it changes — the old store hook /
|
|
241
|
+
* `the old selector hook`'s selector form, over the same state shape, so the apps'
|
|
242
242
|
* selectors move over by renaming the hook.
|
|
243
243
|
*
|
|
244
244
|
* A selector may return a fresh object; the snapshot is cached per state and
|
|
@@ -247,12 +247,12 @@ declare function useEaselApi<C extends EaselConfig = EaselConfig>(): Easel<C>;
|
|
|
247
247
|
*/
|
|
248
248
|
declare function useEasel<T, C extends EaselConfig = EaselConfig>(selector: (view: EaselView<C>) => T): T;
|
|
249
249
|
/**
|
|
250
|
-
* A typed `useEasel` for one config — `
|
|
250
|
+
* A typed `useEasel` for one config — `the old selector hook`'s shape, so
|
|
251
251
|
* a file that made its own typed hook keeps the one line that made it.
|
|
252
252
|
*/
|
|
253
253
|
declare function createUseEasel<C extends EaselConfig = EaselConfig>(): <T>(selector: (view: EaselView<C>) => T) => T;
|
|
254
254
|
|
|
255
|
-
/** What a slot component accepts —
|
|
255
|
+
/** What a slot component accepts — the old editor's. */
|
|
256
256
|
interface CanvasSlotProps {
|
|
257
257
|
className?: string;
|
|
258
258
|
style?: CSSProperties;
|
|
@@ -282,7 +282,7 @@ interface CanvasFrameProps {
|
|
|
282
282
|
/** Called with the frame's document once it is ready, and null when it goes. */
|
|
283
283
|
onDocument?: (doc: Document | null) => void;
|
|
284
284
|
/**
|
|
285
|
-
* `'auto'` (the default,
|
|
285
|
+
* `'auto'` (the default, the old editor's): the frame is as tall as its content, and
|
|
286
286
|
* the host's pane scrolls it — so the canvas reads like the page it is.
|
|
287
287
|
* `'fill'`: the frame fills its parent and scrolls itself.
|
|
288
288
|
*/
|
|
@@ -309,7 +309,7 @@ interface CanvasFrameProps {
|
|
|
309
309
|
* arriving late, a dev reload).
|
|
310
310
|
*
|
|
311
311
|
* ⚠️ THAT FIRST DOCUMENT HAS NO DOCTYPE, SO IT RENDERS IN QUIRKS MODE, and it
|
|
312
|
-
* is rewritten with one before anything is drawn.
|
|
312
|
+
* is rewritten with one before anything is drawn. The old editor's frame was a
|
|
313
313
|
* `<!DOCTYPE html>` srcdoc, so every block was written against standards mode;
|
|
314
314
|
* in quirks mode a `height: 100%` resolves through auto-height ancestors (an
|
|
315
315
|
* empty slot grew to the frame's full height), tables stop inheriting the
|
|
@@ -329,7 +329,7 @@ declare function CanvasFrame({ children, id, title, className, style, mirrorStyl
|
|
|
329
329
|
/**
|
|
330
330
|
* The whole document, for editing. Works in a `CanvasFrame` or on its own.
|
|
331
331
|
*
|
|
332
|
-
* `metadata` is the easel-wide metadata: the root's `
|
|
332
|
+
* `metadata` is the easel-wide metadata: the root's `editor.metadata`, and —
|
|
333
333
|
* under each block's own — every block's (see the header).
|
|
334
334
|
*/
|
|
335
335
|
declare function EditDocument({ metadata }: {
|
|
@@ -381,7 +381,7 @@ interface CanvasParts {
|
|
|
381
381
|
select(partId: string | null): void;
|
|
382
382
|
}
|
|
383
383
|
declare const CanvasPartsContext: react.Context<CanvasParts | undefined>;
|
|
384
|
-
/** What a host may wrap an outline in —
|
|
384
|
+
/** What a host may wrap an outline in — the old editor's `componentOverlay`: render
|
|
385
385
|
* `children` to draw it, or nothing to hide it (a text part open on the
|
|
386
386
|
* block, say). */
|
|
387
387
|
type CanvasOverlay = ComponentType<{
|
|
@@ -459,7 +459,7 @@ interface EaselCanvasProps {
|
|
|
459
459
|
style?: CSSProperties;
|
|
460
460
|
/**
|
|
461
461
|
* The easel-wide metadata — what the published page passes `Render` as
|
|
462
|
-
* `metadata`. Every block reads it as `
|
|
462
|
+
* `metadata`. Every block reads it as `editor.metadata` (its own `metadata`
|
|
463
463
|
* laid over it) and the root as it is. Change it whenever the host's data
|
|
464
464
|
* changes: the blocks redraw in place, nothing remounts, and it never enters
|
|
465
465
|
* the document or the undo history.
|
|
@@ -467,7 +467,7 @@ interface EaselCanvasProps {
|
|
|
467
467
|
metadata?: Record<string, unknown>;
|
|
468
468
|
/** Copy the host's stylesheets into the frame (default true). */
|
|
469
469
|
mirrorStyles?: boolean;
|
|
470
|
-
/** The frame's height: as tall as its content (default,
|
|
470
|
+
/** The frame's height: as tall as its content (default, the old editor's), or filling its parent. */
|
|
471
471
|
height?: 'auto' | 'fill';
|
|
472
472
|
/**
|
|
473
473
|
* The frame's accessible name — an iframe with none is announced as "frame".
|
|
@@ -490,14 +490,14 @@ interface EaselCanvasProps {
|
|
|
490
490
|
onDocument?: (doc: Document | null) => void;
|
|
491
491
|
/**
|
|
492
492
|
* Wraps everything drawn in the frame, and is handed the frame's document —
|
|
493
|
-
*
|
|
493
|
+
* The old editor's `overrides.iframe`: where a host syncs its theme onto the frame's
|
|
494
494
|
* `<html>` or adds frame-only CSS.
|
|
495
495
|
*/
|
|
496
496
|
frameWrapper?: ComponentType<{
|
|
497
497
|
document?: Document;
|
|
498
498
|
children: ReactNode;
|
|
499
499
|
}>;
|
|
500
|
-
/** Wraps each outline —
|
|
500
|
+
/** Wraps each outline — the old editor's `componentOverlay`; see `CanvasOverlay`. */
|
|
501
501
|
overlay?: CanvasOverlay;
|
|
502
502
|
/** Drawn inside the frame, after the document — a host's canvas-only layer. */
|
|
503
503
|
children?: ReactNode;
|
|
@@ -515,7 +515,7 @@ interface EaselCanvasProps {
|
|
|
515
515
|
passThrough?: PassThrough;
|
|
516
516
|
}
|
|
517
517
|
/**
|
|
518
|
-
*
|
|
518
|
+
* `the old editor's preview`, ours: the document for editing, its outlines, and the
|
|
519
519
|
* clicks that select. Must sit under an `EaselProvider`.
|
|
520
520
|
*/
|
|
521
521
|
declare function EaselCanvas({ frame, className, style, metadata, mirrorStyles, onDocument, height, title, nonce, hotkeys, frameWrapper: FrameWrapper, overlay, children, typing, passThrough: passThroughProp, }: EaselCanvasProps): ReactElement;
|
|
@@ -524,8 +524,8 @@ declare function EaselCanvas({ frame, className, style, metadata, mirrorStyles,
|
|
|
524
524
|
* THE PARTS, ON THE STORE (blueprint step 5.2).
|
|
525
525
|
*
|
|
526
526
|
* Every part built in steps 2.1–4.9 takes a HOST — what to read, how to write
|
|
527
|
-
* — so it never knew
|
|
528
|
-
* editor, against
|
|
527
|
+
* — so it never knew the old editor. Until now each app wrote that host twice, once per
|
|
528
|
+
* editor, against the old editor's store: `EmailFields` and `SiteFields` for the settings
|
|
529
529
|
* panel, the node-ops host for the menus. These are the hosts, written ONCE,
|
|
530
530
|
* against the engine's store; the parts' own APIs do not change.
|
|
531
531
|
*/
|
|
@@ -551,13 +551,13 @@ interface SelectedFields {
|
|
|
551
551
|
id: string;
|
|
552
552
|
/** The node the fields are for — the selected one, or the root as `{ type: 'root', props }`. */
|
|
553
553
|
node: ResolvableItem;
|
|
554
|
-
/** Its fields, resolved as
|
|
554
|
+
/** Its fields, resolved as the old editor resolved them (`resolveFields` with the old editor's params, parent included). */
|
|
555
555
|
fields: InspectorFields;
|
|
556
556
|
/** What the fields show. */
|
|
557
557
|
values: Record<string, unknown>;
|
|
558
558
|
/** The block's (or the root's) `edit` permission is off. */
|
|
559
559
|
readOnly: boolean;
|
|
560
|
-
/** Write one field: `resolveData` as
|
|
560
|
+
/** Write one field: `resolveData` as the old editor ran it, then ONE replace — one undo step. */
|
|
561
561
|
onChange: (name: string, value: unknown) => void;
|
|
562
562
|
/**
|
|
563
563
|
* Write SEVERAL fields at once: one merged props object, `resolveData` once,
|
|
@@ -570,11 +570,11 @@ interface SelectedFields {
|
|
|
570
570
|
}
|
|
571
571
|
/**
|
|
572
572
|
* The settings panel's host: the selected node's fields and the write that
|
|
573
|
-
* changes one — what `EmailFields` and `SiteFields` each did against
|
|
573
|
+
* changes one — what `EmailFields` and `SiteFields` each did against the old editor,
|
|
574
574
|
* here once:
|
|
575
|
-
* - fields resolve through `useResolvedFields` (
|
|
575
|
+
* - fields resolve through `useResolvedFields` (the old editor's
|
|
576
576
|
* `useRegisterFieldsSlice`: `changed`, `lastFields`, `appState`, `parent`);
|
|
577
|
-
* - a change runs the block's `resolveData` (`resolveNodeData`,
|
|
577
|
+
* - a change runs the block's `resolveData` (`resolveNodeData`, the old editor's
|
|
578
578
|
* `resolveComponentData`, with this easel's own memory of the last
|
|
579
579
|
* change) and then writes ONE `replace` of the node, or ONE `replaceRoot`.
|
|
580
580
|
*
|
|
@@ -585,14 +585,14 @@ interface SelectedFields {
|
|
|
585
585
|
declare function useSelectedFields(): SelectedFields;
|
|
586
586
|
|
|
587
587
|
/**
|
|
588
|
-
* UNDO AND REDO ON THE KEYBOARD —
|
|
588
|
+
* UNDO AND REDO ON THE KEYBOARD — the old editor's own six bindings, which both editors
|
|
589
589
|
* relied on without writing any: ⌘Z / Ctrl+Z undo; ⇧⌘Z, ⌘Y, Ctrl+Shift+Z and
|
|
590
590
|
* Ctrl+Y redo.
|
|
591
591
|
*
|
|
592
|
-
* Exact combinations, read off the physical key (`code`, as
|
|
592
|
+
* Exact combinations, read off the physical key (`code`, as the old editor read it), so
|
|
593
593
|
* a layout that moves Z still undoes and ⌥⌘Z does nothing.
|
|
594
594
|
*
|
|
595
|
-
* ⚠️
|
|
595
|
+
* ⚠️ THE OLD EDITOR FIRED THESE IN A TEXT FIELD TOO, and so does this: ⌘Z while typing
|
|
596
596
|
* in a setting undoes the easel's last step — which, since a field writes as
|
|
597
597
|
* it is typed, is the typing — and the browser's own text undo is prevented,
|
|
598
598
|
* so there are never two undo histories answering one key.
|
|
@@ -617,7 +617,7 @@ declare function useSelectedFields(): SelectedFields;
|
|
|
617
617
|
* editable region (efficient-easel/canvas `isTypingTarget`) — is not taken:
|
|
618
618
|
* it is that field's own undo. The assembled screen binds its keys so, to its
|
|
619
619
|
* own root and to the canvas frame, inside another app's page (lib/key-scope);
|
|
620
|
-
* left out, a press in a field undoes the easel's step, as
|
|
620
|
+
* left out, a press in a field undoes the easel's step, as the old editor's did.
|
|
621
621
|
*/
|
|
622
622
|
declare function bindUndoKeys(doc: Document, easel: Pick<Easel, 'undo' | 'redo'> & Partial<Pick<Easel, 'getState'>>, options?: {
|
|
623
623
|
leaveTyping?: boolean;
|
package/dist/easel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-
|
|
1
|
+
export{CanvasFrame,CanvasPartsContext,CanvasPassThroughContext,CanvasSharedContext,DEFAULT_UI,EaselCanvas,EaselProvider,EditDocument,bindUndoKeys,createEasel,createUseEasel,recordsByDefault,reduce,uiView,useEasel,useEaselApi,useEaselNodeOps,useSelectedFields,validSelection}from"../chunk-WJSEWAWK.js";import"../chunk-TBY3DFKS.js";import"../chunk-IWCKVZHS.js";import"../chunk-BSHIQIZC.js";import"../chunk-MZ5GSSZ3.js";import"../chunk-KRL3IUV3.js";import"../chunk-MFIRYGHW.js";import"../chunk-GHBK7BKL.js";import"../chunk-LF3FUSCQ.js";import"../chunk-K7BTCBWD.js";import"../chunk-L55YIXDC.js";
|
|
@@ -142,7 +142,7 @@ declare function accessForNewDocument(hasEditLock: boolean): EditAccess;
|
|
|
142
142
|
declare const holderOf: (access: EditAccess) => LockHolder | null;
|
|
143
143
|
/** Read the `edit-lock` body — from a 200 or from a 409's error payload. */
|
|
144
144
|
declare function readLockHolder(data: unknown): LockHolder | null;
|
|
145
|
-
/** The five capabilities
|
|
145
|
+
/** The five capabilities the old editor's `permissions` prop carries for the canvas. */
|
|
146
146
|
type DocumentPermissions = {
|
|
147
147
|
edit: boolean;
|
|
148
148
|
insert: boolean;
|
|
@@ -151,13 +151,13 @@ type DocumentPermissions = {
|
|
|
151
151
|
drag: boolean;
|
|
152
152
|
};
|
|
153
153
|
/**
|
|
154
|
-
* The canvas's
|
|
154
|
+
* The canvas's the old editor `permissions`, derived from the write gate.
|
|
155
155
|
*
|
|
156
156
|
* BOTH branches name ALL FIVE keys — and that completeness is the whole point,
|
|
157
|
-
* not tidiness.
|
|
157
|
+
* not tidiness. The old editor does not replace this prop when it changes; it MERGES it
|
|
158
158
|
* over the permissions it already holds (store/slices/permissions.ts,
|
|
159
159
|
* `useRegisterPermissionsSlice`: `{ ...existingGlobalPermissions, ...prop }`),
|
|
160
|
-
* and a field's editability is the live `getPermissions().edit`.
|
|
160
|
+
* and a field's editability is the live `getPermissions().edit`. The old editor mounts
|
|
161
161
|
* while the lock claim is still `checking`, so `canEdit` is false and the store
|
|
162
162
|
* latches every key false. A PARTIAL writable value (say `{ drag: false }`)
|
|
163
163
|
* would then merge WITHOUT an `edit` key and leave `edit:false` stuck — every
|
|
@@ -166,7 +166,7 @@ type DocumentPermissions = {
|
|
|
166
166
|
* resets them, so the panel comes back the instant `canEdit` flips true.
|
|
167
167
|
*
|
|
168
168
|
* `drag` stays false in EITHER state: both editors move blocks with native DnD
|
|
169
|
-
* rails of their own, so
|
|
169
|
+
* rails of their own, so the old editor's flaky cross-iframe canvas drag is always off.
|
|
170
170
|
*
|
|
171
171
|
* Write safety is unchanged: the `checking` window is still non-editable here,
|
|
172
172
|
* and the host's own write gate still drops any edit attempted before the claim
|
package/dist/fields/fields.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* The rows and the groups are `panel.css`'s (SettingsField, SettingsGroup),
|
|
5
5
|
* and the tabs are the shell's `Tabs`. The panel's rhythm is defined in
|
|
6
6
|
* `panel.css` ONCE (`--es-row-gap`, `--es-rhythm-*`), so this file adds no spacing between rows
|
|
7
|
-
* and no spacing between groups. What it adds is what a row HOLDS where
|
|
7
|
+
* and no spacing between groups. What it adds is what a row HOLDS where the old editor
|
|
8
8
|
* used to put the browser's own: a text box, a number box, a dropdown.
|
|
9
9
|
*
|
|
10
10
|
* Every colour is a shell token (`shell.css`), so the dark editor is the same
|