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/screen/screen.css
CHANGED
|
@@ -179,10 +179,10 @@
|
|
|
179
179
|
--sf-panel-shadow: none;
|
|
180
180
|
--sf-font: var(--es-font);
|
|
181
181
|
|
|
182
|
-
/* No
|
|
183
|
-
|
|
182
|
+
/* No old-editor variable names here. The old editor read its azure ramp and
|
|
183
|
+
font family from editor-shell's shell.css on this same root, and
|
|
184
184
|
they were deliberately never re-declared in this file — one blue is the
|
|
185
|
-
point.
|
|
185
|
+
point. The old editor and those names left with blueprint 6.1/6.3; the blue is the
|
|
186
186
|
`--es-*` set in efficient-easel/shell.css. */
|
|
187
187
|
|
|
188
188
|
/*
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
overflow: hidden;
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
-
/* ── Center: device-framed preview (wraps
|
|
492
|
+
/* ── Center: device-framed preview (wraps the old editor's preview) ──────────────── */
|
|
493
493
|
.sf-center {
|
|
494
494
|
flex: 1;
|
|
495
495
|
min-width: 0;
|
|
@@ -529,7 +529,7 @@
|
|
|
529
529
|
min-width: 0;
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
-
/* ── Center: device-framed preview (wraps
|
|
532
|
+
/* ── Center: device-framed preview (wraps the old editor's preview) ──────────────── */
|
|
533
533
|
.sf-frame {
|
|
534
534
|
width: 100%;
|
|
535
535
|
height: 100%;
|
|
@@ -553,7 +553,7 @@
|
|
|
553
553
|
min-height: 0;
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
/* ── Center: device-framed preview (wraps
|
|
556
|
+
/* ── Center: device-framed preview (wraps the old editor's preview) ──────────────── */
|
|
557
557
|
/* Sizer box for the device frame: its layout size is the frame's *painted*
|
|
558
558
|
(scaled) size, so the .sf-center well centres it when it fits and scrolls it
|
|
559
559
|
when a zoom makes it larger. The frame inside is scaled from its top-left. */
|
|
@@ -573,7 +573,7 @@
|
|
|
573
573
|
position: relative;
|
|
574
574
|
}
|
|
575
575
|
|
|
576
|
-
/*
|
|
576
|
+
/* The old editor's preview fills the frame */
|
|
577
577
|
.sf-preview-host > div,
|
|
578
578
|
.sf-preview-host iframe {
|
|
579
579
|
width: 100% !important;
|
|
@@ -626,7 +626,7 @@
|
|
|
626
626
|
insertion line + a dark "Add section" pill; clicking opens the picker targeted
|
|
627
627
|
at that seam. It sits inside the scaled device frame, so it tracks the zoom. */
|
|
628
628
|
/* The full-width band only POSITIONS the ➕ over a seam — it is itself
|
|
629
|
-
click-through (pointer-events:none) so it never steals canvas clicks /
|
|
629
|
+
click-through (pointer-events:none) so it never steals canvas clicks / the old editor
|
|
630
630
|
selection near a section boundary. Only the ➕ is interactive: the canvas
|
|
631
631
|
insert point (efficient-easel/drag `CanvasInsert`, drag.css), the shell's
|
|
632
632
|
24px IconButton (owner 2026-10-14). */
|
|
@@ -696,7 +696,7 @@
|
|
|
696
696
|
it: the rule below is drawn by a PACKAGE, it is the majority of what is
|
|
697
697
|
actually on screen, and it cannot be deleted from here.
|
|
698
698
|
|
|
699
|
-
|
|
699
|
+
The old editor rules the gap between every pair of top-level fields, so it draws once
|
|
700
700
|
per field for the whole panel — 28 lines in a single section panel, measured.
|
|
701
701
|
That is most of the panel's lines on its own, which is why removing the shop's
|
|
702
702
|
own two heading rules (card 66300) did not change what he saw.
|
|
@@ -706,21 +706,21 @@
|
|
|
706
706
|
text parts. It was held here under a written expiry, because a rule that lives
|
|
707
707
|
in another repo could not be reached from this one. editor-shell 0.29.0 (card
|
|
708
708
|
66350) deleted it AT SOURCE and card 66351 deleted this repo's copy with it —
|
|
709
|
-
the ending the
|
|
709
|
+
the ending the old editor rule below cannot have, since the old editor package is not ours
|
|
710
710
|
to change. That seam is now held from both ends by
|
|
711
711
|
`scripts/test-drill-rows-separated-by-air.ts`: it fails if the shell starts
|
|
712
712
|
drawing on it again, and it fails if a local override for it reappears here.
|
|
713
713
|
|
|
714
|
-
⚠️ SPECIFICITY, NOT `!important`.
|
|
714
|
+
⚠️ SPECIFICITY, NOT `!important`. The old editor's rule is (0,3,0) —
|
|
715
715
|
`wrapFields field + field` — so this restates all three parts to match it, and
|
|
716
|
-
wins on order: `storefront-editor.css` is imported after
|
|
716
|
+
wins on order: `storefront-editor.css` is imported after the old editor's stylesheet and after
|
|
717
717
|
`panel.css` at every call site. The `[class*=]` form is this file's existing
|
|
718
|
-
idiom for
|
|
719
|
-
would break on the next
|
|
718
|
+
idiom for the old editor's hashed module names (see the three rules above); a bare class
|
|
719
|
+
would break on the next the old editor bump, silently, by putting the lines back.
|
|
720
720
|
|
|
721
721
|
This is an override of a live upstream rule, not dead code:
|
|
722
722
|
`scripts/test-panel-no-divider-lines.tsx` §2 asserts the upstream rule still
|
|
723
|
-
exists before checking it, so if
|
|
723
|
+
exists before checking it, so if the old editor ever drops its own line, the guard says
|
|
724
724
|
to delete the override rather than leave it lying here — which is exactly what
|
|
725
725
|
happened to the drill one above. */
|
|
726
726
|
/* The one line that says WHICH device's settings are on screen. Quiet on
|
package/dist/strings/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { D as DragWords } from '../words-SD4neL0n.js';
|
|
|
5
5
|
import { LockWords } from '../edit-lock/index.js';
|
|
6
6
|
import { F as FieldsWords } from '../words-CFkb8XtN.js';
|
|
7
7
|
import { N as NodeMenuWords } from '../words-DMG4dYq2.js';
|
|
8
|
-
import { P as PanelWords } from '../words-
|
|
8
|
+
import { P as PanelWords } from '../words-fbR9IwxH.js';
|
|
9
9
|
import { P as PickWords } from '../words-DWvCJXwR.js';
|
|
10
10
|
import { ScreenWords } from '../screen/words.js';
|
|
11
11
|
export { ScreenAddWords, ScreenSharedWords } from '../screen/words.js';
|
|
@@ -20,7 +20,7 @@ import '../wordFit-7XpmhcaW.js';
|
|
|
20
20
|
import '../panelWidths-DgQXiPXU.js';
|
|
21
21
|
import '../engine-CvXpFE86.js';
|
|
22
22
|
import 'efficient-shell/markup';
|
|
23
|
-
import '../buckets-
|
|
23
|
+
import '../buckets-_MGDYJlb.js';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* The easel canvas's own words (`efficient-easel/strings`, 0.95.0): what the
|
package/dist/strings/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_SCREEN_WORDS as r}from"../chunk-EB6NI2VK.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as o}from"../chunk-6WY6ZXJG.js";import{DEFAULT_TEXT_STYLES_WORDS as n}from"../chunk-OGH6CC3E.js";import{DEFAULT_PICK_WORDS as t}from"../chunk-OFBZOI6W.js";import{DEFAULT_CANVAS_WORDS as c}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as e}from"../chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as m}from"../chunk-WK3AFPXY.js";import{DEFAULT_PANEL_WORDS as i}from"../chunk-KFV7N2DJ.js";import{DEFAULT_SAVE_WORDS as s}from"../chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as u,DEFAULT_NOTICE_WORDS as f}from"../chunk-AJSDWWJW.js";import{DEFAULT_RAIL_WORDS as p}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as l}from"../chunk-RE4LP46F.js";import{DEFAULT_COPY_WORDS as h}from"../chunk-KRL3IUV3.js";import{DEFAULT_FIELDS_WORDS as j}from"../chunk-JACEEVVF.js";import{stringsContext as k}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as a}from"../chunk-TQ5Y6S2X.js";import{useContext as W,useMemo as Y}from"react";import{jsx as y}from"react/jsx-runtime";var F={notice:f,lock:l,save:s,chrome:u,rail:p,tree:e,panel:i,fields:j,pick:t,drag:a,menu:m,styleClipboard:o,copy:h,canvas:c,textStyles:n,screen:r},d=r=>"object"==typeof r&&null!==r;function v(r,o){const n={};for(const t of Object.keys(r)){const c=r[t],e=o[t];null==e?n[t]=c:d(c)?n[t]=d(e)?v(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function D(r,o){return o?v(r,o):r}function J({value:r,locale:o,children:n}){const t=k(),c=W(t),e=c?.strings??F,m=o??c?.locale??"en",i=Y(()=>({strings:D(e,r),locale:m}),[e,r,m]);/* @__PURE__ */
|
|
2
2
|
return y(t.Provider,{value:i,children:n})}function K(){return W(k())?.strings??F}function E(){return W(k())?.locale??"en"}export{F as DEFAULT_EASEL_STRINGS,J as EaselStringsProvider,D as mergeEaselStrings,E as useEaselLocale,K as useEaselStrings};
|
|
@@ -44,7 +44,7 @@ interface StyleRow {
|
|
|
44
44
|
* WHAT KIND of setting this is — the second half of "the same setting".
|
|
45
45
|
* `null` means the host cannot say, and such a row only matches on a
|
|
46
46
|
* component of the SAME type (where the same key is certainly the same
|
|
47
|
-
* field). Use {@link fieldKind} for
|
|
47
|
+
* field). Use {@link fieldKind} for an old-editor field.
|
|
48
48
|
*/
|
|
49
49
|
kind: string | null;
|
|
50
50
|
/**
|
|
@@ -64,7 +64,7 @@ declare const STYLE_KIND: "__styleKind";
|
|
|
64
64
|
*/
|
|
65
65
|
declare function withStyleKind<F extends object>(field: F, kind: string): F;
|
|
66
66
|
/**
|
|
67
|
-
* The kind of
|
|
67
|
+
* The kind of an old-editor field.
|
|
68
68
|
*
|
|
69
69
|
* - a tagged field → its tag;
|
|
70
70
|
* - `text` / `textarea` / `number` → that word;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import{
|
|
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-ZEH6QLBH.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-KFWNGPW3.js";import"../chunk-JACEEVVF.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 E,useId as z,useEffect as O,Fragment as _}from"react";import{TrashIcon as L,ChevronIcon as A,BoldIcon as j,ItalicIcon as M,CaseLowerIcon as $,CaseCapitalizedIcon as W,CaseUpperIcon as Y,CaseNormalIcon as I}from"efficient-shell/icons/efficient";import{jsxs as D,jsx as X,Fragment as F}from"react/jsx-runtime";var H=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>N({h:e,s:1,v:1})).join(", ")})`;function P({value:t,hex:a,colours:n,label:l,followsWord:i,anyWord:r,onChange:o,readOnly:d=!1}){const[c,u]=w(!1),m=E(null),h=E(null),f=z(),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__ */D("div",{ref:m,className:"es-ts-set","data-ts-setting":"color",children:[
|
|
2
2
|
/* @__PURE__ */D("div",{className:"es-ts-top",children:[
|
|
3
3
|
/* @__PURE__ */X("span",{className:"es-ts-sub",children:l}),
|
|
4
|
-
/* @__PURE__ */X("span",{className:"es-ts-colour-read",children:
|
|
5
|
-
/* @__PURE__ */D("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[n.map(s=>/* @__PURE__ */X(C,{content:`${s.name} · ${
|
|
6
|
-
/* @__PURE__ */X(C,{content:r,children:/* @__PURE__ */X(x,{ref:h,color:H,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__ */X(
|
|
7
|
-
return X("div",{className:"es-ts",ref:I,children:l.map(
|
|
8
|
-
return D(G,{label:A.groups[
|
|
9
|
-
return X(R,{style:
|
|
10
|
-
/* @__PURE__ */X("span",{className:"es-ts-add-word",children:A.add[
|
|
11
|
-
/* @__PURE__ */X("span",{className:"es-ts-count",children:A.count({n:l.length,max:x})})]})),_||!r?null:/* @__PURE__ */X("span",{id:`${j}-full-${
|
|
4
|
+
/* @__PURE__ */X("span",{className:"es-ts-colour-read",children:a?e(a):i})]}),
|
|
5
|
+
/* @__PURE__ */D("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[n.map(s=>/* @__PURE__ */X(C,{content:`${s.name} · ${e(s.value)}`,children:/* @__PURE__ */X(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__ */X(C,{content:r,children:/* @__PURE__ */X(x,{ref:h,color:H,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__ */X(s,{id:f,value:a??"",onChange:e=>o(e),label:l,readOnly:d,onClose:()=>{u(!1),h.current?.focus()}}):null]})}function B({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=z(),[M,$]=w(p),W=void 0!==f?f:M,Y=e=>{void 0===f&&$(e),S?.(e)},I=E(null),[H,P]=w(null);O(()=>{if(!H||!I.current)return;const e=[...I.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===H.id),s=e?e.querySelector(".es-ts-row"):I.current.querySelector(`.es-ts-add[data-ts-kind="${H.kind}"]`);s?.focus(),P(null)},[H]);/* @__PURE__ */
|
|
7
|
+
return X("div",{className:"es-ts",ref:I,children:l.map(a=>{const l=e.filter(e=>e.kind===a),r=!i(e,a,x),d=!_&&!r;/* @__PURE__ */
|
|
8
|
+
return D(G,{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 X(R,{style:a,fonts:t,colours:n,settings:c,auto:u,fallback:m,sample:h,device:T,readOnly:_,open:W===a.id,onOpenChange:e=>Y(e?a.id:null),onChange:t=>s(e.map(e=>e.id===t.id?t:e)),actions:r||i?/* @__PURE__ */D(F,{children:[r?k(A.remove,/* @__PURE__ */X("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];W===t.id&&Y(null),s(a.styles),C(a.removed),P({id:l?.id??null,kind:t.kind})})(a),children:/* @__PURE__ */X(L,{size:14,"aria-hidden":"true"})})):null,i?l:null]}):null},a.id)}),k(!_&&r?A.full({kind:a,max:x}):void 0,/* @__PURE__ */D("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__ */X("span",{className:"es-ts-add-word",children:A.add[a]}),
|
|
11
|
+
/* @__PURE__ */X("span",{className:"es-ts-count",children:A.count({n:l.length,max:x})})]})),_||!r?null:/* @__PURE__ */X("span",{id:`${j}-full-${a}`,className:"es-vh",children:A.full({kind:a,max:x})})]},a)})})}function G({label:e,children:s}){const t=z();/* @__PURE__ */
|
|
12
12
|
return D("section",{className:"es-ts-section","aria-labelledby":t,children:[
|
|
13
|
-
/* @__PURE__ */X("div",{className:"es-ts-group",id:t,children:e}),s]})}function R({style:
|
|
13
|
+
/* @__PURE__ */X("div",{className:"es-ts-group",id:t,children:e}),s]})}function R({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=`${z()}-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,E=s.find(e=>e.value===x.font),O={fontFamily:E?.family,fontSize:`${u(w.size??16)}px`,fontWeight:x.weight,fontStyle:x.italic?"italic":void 0};/* @__PURE__ */
|
|
14
14
|
return D(_,{children:[
|
|
15
|
-
/* @__PURE__ */D("div",{className:"es-ts-item","data-ts-id":
|
|
15
|
+
/* @__PURE__ */D("div",{className:"es-ts-item","data-ts-id":e.id,children:[
|
|
16
16
|
/* @__PURE__ */D("button",{type:"button",className:"es-ts-row","aria-expanded":o,"aria-controls":o?k:void 0,onClick:()=>f(!o),children:[
|
|
17
17
|
/* @__PURE__ */X("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */X(A,{size:12})}),
|
|
18
|
-
/* @__PURE__ */X("span",{className:"es-ts-name",style:O,children:
|
|
19
|
-
/* @__PURE__ */X("span",{className:"es-ts-meta",children:m(w,
|
|
20
|
-
return X("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */X(
|
|
18
|
+
/* @__PURE__ */X("span",{className:"es-ts-name",style:O,children:e.name}),
|
|
19
|
+
/* @__PURE__ */X("span",{className:"es-ts-meta",children:m(w,s,g,{autoSize:N.has("size")&&w===x&&void 0===e.values.size})})]}),v?/* @__PURE__ */X("div",{className:"es-ts-actions",children:v}):null]}),o?/* @__PURE__ */X("div",{className:"es-ts-open",id:k,children:/* @__PURE__ */X(V,{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:I,upper:Y,capitalize:W,lower:$};function V({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,E={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)},z=e=>{const t=S[e],a=y(e);/* @__PURE__ */
|
|
20
|
+
return X("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */X(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 D(F,{children:[
|
|
22
|
-
/* @__PURE__ */X("div",{className:"es-ts-preview",style:E,"aria-label":d.preview,children:o}),i.map(
|
|
23
|
-
return X(Z,{value:h.font,fonts:a,words:d,readOnly:u,set:m},
|
|
24
|
-
return X(K,{value:h.color,hex:v,colours:l,words:d,readOnly:u,set:m},
|
|
25
|
-
return D("div",{className:"es-ts-set","data-ts-setting":
|
|
22
|
+
/* @__PURE__ */X("div",{className:"es-ts-preview",style:E,"aria-label":d.preview,children:o}),i.map(t=>{switch(t){case"font":/* @__PURE__ */
|
|
23
|
+
return X(Z,{value:h.font,fonts:a,words:d,readOnly:u,set:m},t);case"color":/* @__PURE__ */
|
|
24
|
+
return X(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 D("div",{className:"es-ts-set","data-ts-setting":t,children:[
|
|
26
26
|
/* @__PURE__ */X("span",{className:"es-ts-sub",children:d.settings.emphasis}),
|
|
27
|
-
/* @__PURE__ */D("div",{className:"es-ts-icons",children:[k(d.bold,/* @__PURE__ */X(T,{className:"es-ts-icon","aria-label":d.bold,"aria-pressed":e,disabled:u,onClick:()=>m({weight:e?400:700}),children:/* @__PURE__ */X(j,{size:16})})),u||
|
|
28
|
-
return X(q,{value:h.letterCase??
|
|
29
|
-
return X("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */X(
|
|
27
|
+
/* @__PURE__ */D("div",{className:"es-ts-icons",children:[k(d.bold,/* @__PURE__ */X(T,{className:"es-ts-icon","aria-label":d.bold,"aria-pressed":e,disabled:u,onClick:()=>m({weight:e?400:700}),children:/* @__PURE__ */X(j,{size:16})})),u||a?k(d.italic,/* @__PURE__ */X(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__ */X(M,{size:16})})):/* @__PURE__ */X(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(s.italic),"aria-disabled":!0,disabledReason:d.italicMissing,children:/* @__PURE__ */X(M,{size:16})})]})]},t)}case"letterCase":/* @__PURE__ */
|
|
28
|
+
return X(q,{value:h.letterCase??s.letterCase,auto:y("letterCase"),words:d,readOnly:u,set:m},t);case"largestSize":return"heading"===e.kind?z(t):null;case"size":return c?(()=>{const e=S.size;/* @__PURE__ */
|
|
29
|
+
return X("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */X(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")})():z(t);default:return z(t)}})]})}function Z({value:e,fonts:s,words:t,readOnly:a,set:n}){const l=z();/* @__PURE__ */
|
|
30
30
|
return D("div",{className:"es-ts-set","data-ts-setting":"font",children:[
|
|
31
31
|
/* @__PURE__ */X("span",{className:"es-ts-sub",id:l,children:t.settings.font}),
|
|
32
32
|
/* @__PURE__ */X(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__ */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ShowWhenRule } from 'efficient-shell/ui';
|
|
3
|
-
import { S as SettingsBucket } from './buckets-
|
|
3
|
+
import { S as SettingsBucket } from './buckets-_MGDYJlb.js';
|
|
4
4
|
|
|
5
5
|
/** What every control shares: an id for its label, a name for screen readers, and a read-only switch. */
|
|
6
6
|
interface ControlBase {
|
|
@@ -238,7 +238,7 @@ interface CustomFieldDef extends FieldMeta {
|
|
|
238
238
|
type InspectorFieldDef = TextFieldDef | TextareaFieldDef | NumberFieldDef | SelectFieldDef | RadioFieldDef | ObjectFieldDef | ArrayFieldDef | SlotFieldDef | CustomFieldDef;
|
|
239
239
|
type InspectorFields = Record<string, InspectorFieldDef>;
|
|
240
240
|
/**
|
|
241
|
-
* What a custom render is called with:
|
|
241
|
+
* What a custom render is called with: the old editor's own six props, so every custom
|
|
242
242
|
* field both apps wrote keeps working unchanged, plus what the host hands in as
|
|
243
243
|
* `context` (the node, the root, the device — blueprint §3.1).
|
|
244
244
|
*/
|
|
@@ -251,7 +251,7 @@ interface CustomFieldRenderProps<V = any> {
|
|
|
251
251
|
readOnly?: boolean;
|
|
252
252
|
[context: string]: unknown;
|
|
253
253
|
}
|
|
254
|
-
/** A field type's own drawing, swapped in by the host (e.g.
|
|
254
|
+
/** A field type's own drawing, swapped in by the host (e.g. The old editor's array until 4.5). */
|
|
255
255
|
type FieldRenderer = (props: {
|
|
256
256
|
field: InspectorFieldDef;
|
|
257
257
|
name: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DataInput } from './data/index.js';
|
|
2
|
-
import { I as ItemSelector, N as NodeSelection } from './plan-
|
|
3
|
-
import { D as Data, S as SlotAddress, a as DataConfig, N as Node } from './types-
|
|
2
|
+
import { I as ItemSelector, N as NodeSelection } from './plan-CRUh2kVK.js';
|
|
3
|
+
import { D as Data, S as SlotAddress, a as DataConfig, N as Node } from './types-DlQIM1YO.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* The easel's UI state, in
|
|
6
|
+
* The easel's UI state, in the old editor's shape so the apps' `appState.ui` reads move
|
|
7
7
|
* over unchanged. `itemSelector` and `selectedSlot` are DERIVED from the
|
|
8
8
|
* selection the store holds by id; every other key is the host's own and is
|
|
9
9
|
* kept as written.
|
|
@@ -12,14 +12,14 @@ type EaselUi = Record<string, unknown> & {
|
|
|
12
12
|
itemSelector: ItemSelector | null;
|
|
13
13
|
/** The selected slot (a column), when a slot rather than a node is selected. */
|
|
14
14
|
selectedSlot: SlotAddress | null;
|
|
15
|
-
/**
|
|
16
|
-
* They start at
|
|
15
|
+
/** The old editor's own UI keys, which a host's chrome reads and writes (`setUi`).
|
|
16
|
+
* They start at the old editor's defaults (`DEFAULT_UI`). */
|
|
17
17
|
leftSideBarVisible: boolean;
|
|
18
18
|
rightSideBarVisible: boolean;
|
|
19
19
|
previewMode: 'edit' | 'interactive';
|
|
20
20
|
isDragging: boolean;
|
|
21
21
|
};
|
|
22
|
-
/**
|
|
22
|
+
/** The old editor's public `appState`. */
|
|
23
23
|
interface AppState {
|
|
24
24
|
data: Data;
|
|
25
25
|
ui: EaselUi;
|
|
@@ -28,15 +28,15 @@ type Recordable = {
|
|
|
28
28
|
recordHistory?: boolean;
|
|
29
29
|
};
|
|
30
30
|
/** What `setData` merges in: part of the document — in this package's shape,
|
|
31
|
-
* or in
|
|
32
|
-
* are typed as and
|
|
31
|
+
* or in the old editor's looser one (`root.props` optional), which the apps' documents
|
|
32
|
+
* are typed as and `the old editor root` accepted. */
|
|
33
33
|
type SetDataPatch = Partial<Data> | DataInput;
|
|
34
34
|
/**
|
|
35
|
-
* The actions the apps dispatch today —
|
|
35
|
+
* The actions the apps dispatch today — the old editor's, with its meaning. Zone
|
|
36
36
|
* keys are `"<parentId>:<slot>"`; `root:default-zone` is the page's own list.
|
|
37
37
|
*
|
|
38
38
|
* `insert` puts the block in with its `defaultProps` and runs NO resolver, as
|
|
39
|
-
*
|
|
39
|
+
* The old editor's reducer did not. What ran a new block's `resolveData` in the old editor was its
|
|
40
40
|
* own drop from the component list; here that is `easel.resolveNode(id, {
|
|
41
41
|
* trigger: 'insert' })`, called by the host after the insert (pass the action
|
|
42
42
|
* an `id` so there is one to name).
|
|
@@ -87,7 +87,7 @@ type EaselAction = ({
|
|
|
87
87
|
index: number;
|
|
88
88
|
zone: string;
|
|
89
89
|
} & Recordable);
|
|
90
|
-
/** What a block, the root or the whole easel allows.
|
|
90
|
+
/** What a block, the root or the whole easel allows. The old editor's five. */
|
|
91
91
|
interface Permissions {
|
|
92
92
|
drag: boolean;
|
|
93
93
|
duplicate: boolean;
|
|
@@ -97,7 +97,7 @@ interface Permissions {
|
|
|
97
97
|
[key: string]: boolean;
|
|
98
98
|
}
|
|
99
99
|
/** The config the store needs: the data layer's shape, plus each block's own
|
|
100
|
-
* `permissions` (
|
|
100
|
+
* `permissions` (the old editor's per-component permissions). Rendering keys are the
|
|
101
101
|
* renderer's business and pass through untouched. */
|
|
102
102
|
interface EaselConfig extends DataConfig {
|
|
103
103
|
root?: DataConfig['root'] & {
|
|
@@ -114,12 +114,12 @@ interface EaselCore {
|
|
|
114
114
|
/** The host's own UI keys — everything but `itemSelector` / `selectedSlot`. */
|
|
115
115
|
ui: Record<string, unknown>;
|
|
116
116
|
}
|
|
117
|
-
/** One undo step: the whole state, as
|
|
117
|
+
/** One undo step: the whole state, as the old editor's history holds the whole app state. */
|
|
118
118
|
interface HistoryEntry {
|
|
119
119
|
id: string;
|
|
120
120
|
state: AppState;
|
|
121
121
|
}
|
|
122
|
-
/**
|
|
122
|
+
/** The old editor's PUBLIC `history` (what the old store hook hands out): `hasPast` and
|
|
123
123
|
* `hasFuture` are booleans there, read at the state they came with. */
|
|
124
124
|
interface EaselHistory {
|
|
125
125
|
back: () => void;
|
|
@@ -128,14 +128,14 @@ interface EaselHistory {
|
|
|
128
128
|
hasFuture: boolean;
|
|
129
129
|
histories: HistoryEntry[];
|
|
130
130
|
index: number;
|
|
131
|
-
/** Go straight to one step (
|
|
131
|
+
/** Go straight to one step (the old editor's `setHistoryIndex`). */
|
|
132
132
|
setHistoryIndex: (index: number) => void;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* What `useEasel` reads —
|
|
135
|
+
* What `useEasel` reads — the old store hook's state, so the apps' selectors move
|
|
136
136
|
* over by renaming the hook: `appState`, `selectedItem`, `dispatch`, `config`,
|
|
137
137
|
* `history`, `getPermissions`, `getItemById`, `getSelectorForId`. Plus the
|
|
138
|
-
* selection by id (`selection`), which
|
|
138
|
+
* selection by id (`selection`), which the old editor never had.
|
|
139
139
|
*/
|
|
140
140
|
interface EaselView<C extends EaselConfig = EaselConfig> {
|
|
141
141
|
appState: AppState;
|
|
@@ -151,7 +151,7 @@ interface EaselView<C extends EaselConfig = EaselConfig> {
|
|
|
151
151
|
}) => Permissions;
|
|
152
152
|
getItemById: (id: string) => Node | undefined;
|
|
153
153
|
getItemBySelector: (selector: ItemSelector) => Node | undefined;
|
|
154
|
-
/**
|
|
154
|
+
/** The old editor's: the node's place, its zone always named. Never throws — the old editor's
|
|
155
155
|
* did, across a data swap, which the website editor wrapped. */
|
|
156
156
|
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
157
157
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The document, and the smallest slice of a block config the data layer reads.
|
|
3
3
|
*
|
|
4
|
-
* THE DOCUMENT IS
|
|
4
|
+
* THE DOCUMENT IS THE OLD EDITOR'S, BYTE FOR BYTE. Every campaign and every page already
|
|
5
5
|
* saved is a Puck 0.20 `Data` object, and the backend reads it too (campaign
|
|
6
6
|
* copy, coupon deadlines, the assistant's knowledge tool, the media and
|
|
7
7
|
* neutralization manifests). So the engine keeps that exact shape — no version
|
|
8
|
-
* key, no wrapper, no rename — and nothing saved needs to migrate when
|
|
8
|
+
* key, no wrapper, no rename — and nothing saved needs to migrate when the old editor goes.
|
|
9
9
|
*
|
|
10
10
|
* { root: { props }, content: Node[], zones: {} }
|
|
11
11
|
*
|
|
12
12
|
* A node's children live INLINE in one of its props, under a field whose
|
|
13
|
-
* `type` is `"slot"`. `zones` is
|
|
13
|
+
* `type` is `"slot"`. `zones` is the old editor's older DropZone store: neither editor
|
|
14
14
|
* writes it, so it is `{}` on every document, and it is kept that way on save.
|
|
15
15
|
*/
|
|
16
16
|
/** One block in the document. `props.id` is `<Type>-<uuid>`. */
|
|
17
17
|
interface Node {
|
|
18
18
|
type: string;
|
|
19
19
|
props: NodeProps;
|
|
20
|
-
/**
|
|
20
|
+
/** The old editor's per-prop read-only map. Carried through untouched. */
|
|
21
21
|
readOnly?: Record<string, boolean>;
|
|
22
22
|
}
|
|
23
23
|
interface NodeProps {
|
|
@@ -40,7 +40,7 @@ interface Data {
|
|
|
40
40
|
*
|
|
41
41
|
* The top-level list is `{ parentId: 'root', slot: 'default-zone' }`, and a
|
|
42
42
|
* slot is named by its PROP PATH (`col1`, `items[0].content`) — the same two
|
|
43
|
-
* halves as
|
|
43
|
+
* halves as the old editor's zone key `"<parentId>:<slot>"`, so an app that still speaks
|
|
44
44
|
* zone keys converts with `zoneKey` / `parseZoneKey`.
|
|
45
45
|
*/
|
|
46
46
|
interface SlotAddress {
|
|
@@ -53,7 +53,7 @@ interface Place extends SlotAddress {
|
|
|
53
53
|
/**
|
|
54
54
|
* The part of a field definition the data layer needs: which props are slots,
|
|
55
55
|
* and (./translate) which hold words that are written again per language.
|
|
56
|
-
* A
|
|
56
|
+
* A the old editor `Field` satisfies it, so an app hands in the config it already has.
|
|
57
57
|
*/
|
|
58
58
|
interface FieldShape {
|
|
59
59
|
type: string;
|
|
@@ -68,7 +68,7 @@ interface FieldShape {
|
|
|
68
68
|
}
|
|
69
69
|
type FieldsShape = Record<string, FieldShape>;
|
|
70
70
|
/**
|
|
71
|
-
* `fields` and `defaultProps` are typed as ANY OBJECT on purpose. A
|
|
71
|
+
* `fields` and `defaultProps` are typed as ANY OBJECT on purpose. A the old editor config
|
|
72
72
|
* typed with its blocks' own props (`Config<{ Heading: HeadingProps }>`) carries
|
|
73
73
|
* `Fields<HeadingProps>` and `HeadingProps`, which no shared shape can name, and
|
|
74
74
|
* an app must be able to hand in the config it has. The data layer reads only
|
|
@@ -80,7 +80,7 @@ interface BlockShape {
|
|
|
80
80
|
defaultProps?: object;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
* The config as the data layer sees it. A
|
|
83
|
+
* The config as the data layer sees it. A the old editor `Config` satisfies it: only
|
|
84
84
|
* `components[type].fields` / `.defaultProps` and `root.fields` /
|
|
85
85
|
* `.defaultProps` are ever read. A type missing from `components` has no slots
|
|
86
86
|
* and is kept verbatim — never dropped — so content can land before its code.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Node, S as SlotAddress, D as Data, a as DataConfig, P as Place } from './types-
|
|
2
|
-
import { N as NodeSelection, A as AfterRemove, S as StepBounds } from './plan-
|
|
1
|
+
import { N as Node, S as SlotAddress, D as Data, a as DataConfig, P as Place } from './types-DlQIM1YO.js';
|
|
2
|
+
import { N as NodeSelection, A as AfterRemove, S as StepBounds } from './plan-CRUh2kVK.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The node clipboard — what Copy and Cut hold, and Paste reads.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Finding the canvas frame and its document — ONCE, with no polling.
|
|
3
3
|
*
|
|
4
|
-
* Both editors draw the canvas inside an iframe (today
|
|
4
|
+
* Both editors draw the canvas inside an iframe (today the old editor's
|
|
5
5
|
* `<iframe id="preview-frame">`; later the engine's own CanvasFrame). The frame
|
|
6
6
|
* gives no "ready" callback, its document arrives ASYNCHRONOUSLY (a srcdoc
|
|
7
7
|
* frame starts on an empty about:blank document and swaps to the real one on
|
|
@@ -24,11 +24,11 @@ interface CanvasTarget {
|
|
|
24
24
|
window: Window;
|
|
25
25
|
}
|
|
26
26
|
interface WatchOptions {
|
|
27
|
-
/** How the frame is found under `root`.
|
|
27
|
+
/** How the frame is found under `root`. The old editor's canvas is the default. */
|
|
28
28
|
selector?: string;
|
|
29
29
|
/**
|
|
30
30
|
* Publish the frame only once its document holds an element matching this.
|
|
31
|
-
* A loaded frame can still be EMPTY —
|
|
31
|
+
* A loaded frame can still be EMPTY — the old editor portals the blocks in after
|
|
32
32
|
* `load` — and a measurement taken then measures nothing. For the editor's
|
|
33
33
|
* canvas pass `BLOCK_SELECTOR`. Watched with a MutationObserver on the frame's
|
|
34
34
|
* document, never polled.
|