efficient-easel 20.2.1 → 21.1.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 +30 -9
- package/dist/{CanvasDragLayer-ARfaivCu.d.ts → CanvasDragLayer-CFUcBbgc.d.ts} +2 -2
- package/dist/{ScreenDocumentContext-CFJeqqKk.d.ts → ScreenDocumentContext-1RgtGKWR.d.ts} +4 -0
- package/dist/blocks/index.d.ts +5 -3
- package/dist/{buckets-Tj-nkBpg.d.ts → buckets-Sw94ll9I.d.ts} +1 -1
- package/dist/canvas/index.d.ts +8 -6
- package/dist/canvas/index.js +1 -1
- package/dist/chunk-2C7W64S5.js +8 -0
- package/dist/chunk-2L6KWUBC.js +1 -0
- package/dist/chunk-467WWV4I.js +1 -0
- package/dist/chunk-4FD7TAOE.js +1 -0
- package/dist/chunk-67HCYOW4.js +1 -0
- package/dist/chunk-A2VVB4RH.js +0 -0
- package/dist/{chunk-2GVCAIPX.js → chunk-BDSLF5BR.js} +1 -1
- package/dist/{chunk-U66YKDAR.js → chunk-BIK3AO2V.js} +1 -1
- package/dist/chunk-BTDI7JAA.js +2 -0
- package/dist/chunk-DDH2DYQP.js +1 -0
- package/dist/{chunk-I7BROL77.js → chunk-DNQ7AF6K.js} +1 -1
- package/dist/{chunk-HK6I3NVO.js → chunk-E52W3M5I.js} +1 -1
- package/dist/chunk-EB6NI2VK.js +1 -0
- package/dist/chunk-FM6JO4WF.js +2 -0
- package/dist/{chunk-JQXD3TDE.js → chunk-GWYNMSIP.js} +1 -1
- package/dist/{chunk-7YVEYQDE.js → chunk-I67UW5UG.js} +3 -3
- package/dist/chunk-JACEEVVF.js +1 -0
- package/dist/{chunk-QAJAEWCZ.js → chunk-KFWNGPW3.js} +5 -5
- package/dist/{chunk-FGYJ5DJY.js → chunk-KWLHKKZO.js} +1 -1
- package/dist/chunk-MLQKNED6.js +1 -0
- package/dist/chunk-MZ5GSSZ3.js +7 -0
- package/dist/{chunk-43AEUUNQ.js → chunk-N3MJOHAG.js} +1 -1
- package/dist/{chunk-BVN33R76.js → chunk-N7E6264U.js} +1 -1
- package/dist/chunk-OHZHYROJ.js +5 -0
- package/dist/chunk-PFFH7ASD.js +21 -0
- package/dist/chunk-PRHBWA5V.js +0 -0
- package/dist/chunk-S3DUFDQ6.js +6 -0
- package/dist/chunk-SNF5764Q.js +1 -0
- package/dist/chunk-SSRYU3YG.js +1 -0
- package/dist/chunk-SWBADIQT.js +1 -0
- package/dist/{chunk-GOTN2KY4.js → chunk-TIAWIOGD.js} +1 -1
- package/dist/chunk-TQ5Y6S2X.js +1 -0
- package/dist/chunk-TUXLORVR.js +15 -0
- package/dist/{chunk-FGNR22NY.js → chunk-U5DNBT63.js} +1 -1
- package/dist/chunk-U7TFWHST.js +5 -0
- package/dist/chunk-WHS6Y55E.js +10 -0
- package/dist/chunk-WJJ7H42G.js +18 -0
- package/dist/{chunk-ZOBSIXRD.js → chunk-Y2T3JX7K.js} +1 -1
- package/dist/chunk-YIUE4US7.js +0 -0
- package/dist/{chunk-O7Q4DDJT.js → chunk-YM4UEGBV.js} +1 -1
- package/dist/chunk-YVFYWAYU.js +65 -0
- package/dist/{chunk-UJ46J7QW.js → chunk-ZOSEBPAI.js} +1 -1
- package/dist/copy/index.d.ts +2 -2
- package/dist/copy/index.js +13 -13
- package/dist/drag/drag.css +3 -9
- package/dist/drag/index.d.ts +3 -3
- package/dist/drag/index.js +1 -1
- package/dist/draw/client.d.ts +1 -1
- package/dist/draw/client.js +1 -1
- package/dist/draw/index.d.ts +9 -9
- package/dist/draw/index.js +1 -1
- package/dist/easel/easel.css +3 -1
- package/dist/easel/index.d.ts +2 -2
- package/dist/easel/index.js +1 -1
- package/dist/fields/fields.css +2 -2
- package/dist/fields/index.d.ts +5 -5
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +39 -140
- package/dist/panel/index.js +15 -15
- package/dist/panel/panel.css +53 -347
- package/dist/render/index.d.ts +2 -2
- package/dist/render/index.js +5 -5
- package/dist/{repeat-Czi-6zPX.d.ts → repeat-BNgSq2Nw.d.ts} +1 -1
- package/dist/screen/components/AddBlockRow.d.ts +1 -1
- 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 +15 -15
- package/dist/screen/components/NodeContextMenu.js +1 -1
- package/dist/screen/components/PageEditGuardNotices.js +1 -1
- package/dist/screen/components/PreviewPartsContext.d.ts +2 -2
- package/dist/screen/components/PreviewPartsContext.js +1 -1
- package/dist/screen/components/SaveControls.d.ts +9 -9
- package/dist/screen/components/ScreenChrome.js +1 -1
- package/dist/screen/components/ScreenDocumentContext.d.ts +2 -2
- package/dist/screen/components/ScreenDocumentContext.js +1 -1
- package/dist/screen/components/ScreenMount.d.ts +9 -9
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +9 -9
- package/dist/screen/components/ScreenStoreProvider.js +1 -1
- package/dist/screen/components/SectionScreenShell.js +17 -17
- package/dist/screen/components/SlotChildActionsContext.d.ts +1 -1
- package/dist/screen/components/usePartBridge.d.ts +9 -9
- package/dist/screen/components/usePartBridge.js +1 -1
- package/dist/screen/index.d.ts +10 -10
- package/dist/screen/index.js +1 -1
- package/dist/screen/lib/admin-bridge.d.ts +1 -1
- package/dist/screen/lib/admin-bridge.js +1 -1
- package/dist/screen/lib/content/view-tiers.d.ts +15 -3
- package/dist/screen/lib/content/view-tiers.js +1 -1
- package/dist/screen/lib/document/add-target-types.d.ts +55 -0
- package/dist/screen/lib/document/add-target-types.js +1 -0
- package/dist/screen/lib/document/block-choice.d.ts +64 -0
- package/dist/screen/lib/document/block-choice.js +1 -0
- package/dist/screen/lib/document/block-types-in.d.ts +39 -0
- package/dist/screen/lib/document/block-types-in.js +1 -0
- package/dist/screen/lib/document/content-tree.d.ts +222 -0
- package/dist/screen/lib/document/content-tree.js +1 -0
- package/dist/screen/lib/document/device-fields.d.ts +128 -0
- package/dist/screen/lib/document/device-fields.js +1 -0
- package/dist/screen/lib/document/field-buckets.d.ts +36 -0
- package/dist/screen/lib/document/field-buckets.js +1 -0
- package/dist/screen/lib/document/field-markers.d.ts +205 -0
- package/dist/screen/lib/document/field-markers.js +1 -0
- package/dist/screen/lib/document/hidable.d.ts +44 -0
- package/dist/screen/lib/document/hidable.js +1 -0
- package/dist/screen/lib/document/palette-sections.d.ts +103 -0
- package/dist/screen/lib/document/palette-sections.js +1 -0
- package/dist/screen/lib/document/panel-fields.d.ts +47 -0
- package/dist/screen/lib/document/panel-fields.js +1 -0
- package/dist/screen/lib/document/panel-no-control-mark.d.ts +74 -0
- package/dist/screen/lib/document/panel-no-control-mark.js +1 -0
- package/dist/screen/lib/document/part-id.d.ts +23 -0
- package/dist/screen/lib/document/part-id.js +1 -0
- package/dist/screen/lib/document/preview-click.d.ts +49 -0
- package/dist/screen/lib/document/preview-click.js +1 -0
- package/dist/screen/lib/document/preview-dom.d.ts +8 -0
- package/dist/screen/lib/document/preview-dom.js +1 -0
- package/dist/screen/lib/document/preview-events.d.ts +25 -0
- package/dist/screen/lib/document/preview-events.js +1 -0
- package/dist/screen/lib/document/preview-selection-context.d.ts +72 -0
- package/dist/screen/lib/document/preview-selection-context.js +1 -0
- package/dist/screen/lib/document/section-doc.d.ts +24 -0
- package/dist/screen/lib/document/section-doc.js +1 -0
- package/dist/screen/lib/document/slot-child-name.d.ts +225 -0
- package/dist/screen/lib/document/slot-child-name.js +1 -0
- package/dist/screen/lib/document/slot-heal.d.ts +5 -0
- package/dist/screen/lib/document/slot-heal.js +1 -0
- package/dist/screen/lib/document/slot-section-spec.d.ts +96 -0
- package/dist/screen/lib/document/slot-section-spec.js +1 -0
- package/dist/screen/lib/document/style-clipboard.d.ts +144 -0
- package/dist/screen/lib/document/style-clipboard.js +1 -0
- package/dist/screen/lib/document/text-control-kinds.d.ts +71 -0
- package/dist/screen/lib/document/text-control-kinds.js +1 -0
- package/dist/screen/lib/document/tree-reveal.d.ts +62 -0
- package/dist/screen/lib/document/tree-reveal.js +1 -0
- package/dist/screen/lib/document/use-section-ops.d.ts +110 -0
- package/dist/screen/lib/document/use-section-ops.js +1 -0
- package/dist/screen/lib/document-addressing.d.ts +2 -2
- package/dist/screen/lib/document-switch.d.ts +1 -1
- package/dist/screen/lib/host.d.ts +2 -2
- 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 +2 -2
- package/dist/screen/lib/media-picker.d.ts +2 -2
- package/dist/screen/lib/page-lock.d.ts +1 -1
- package/dist/screen/lib/puck/add-target-types.d.ts +3 -55
- package/dist/screen/lib/puck/add-target-types.js +1 -0
- package/dist/screen/lib/puck/block-choice.d.ts +1 -64
- package/dist/screen/lib/puck/block-choice.js +1 -1
- package/dist/screen/lib/puck/block-types-in.d.ts +1 -39
- package/dist/screen/lib/puck/block-types-in.js +1 -1
- package/dist/screen/lib/puck/content-tree.d.ts +1 -222
- package/dist/screen/lib/puck/content-tree.js +1 -1
- package/dist/screen/lib/puck/device-fields.d.ts +3 -127
- package/dist/screen/lib/puck/device-fields.js +1 -1
- package/dist/screen/lib/puck/field-buckets.d.ts +2 -36
- package/dist/screen/lib/puck/field-buckets.js +1 -1
- package/dist/screen/lib/puck/field-markers.d.ts +2 -205
- package/dist/screen/lib/puck/field-markers.js +1 -1
- package/dist/screen/lib/puck/hidable.d.ts +1 -44
- package/dist/screen/lib/puck/hidable.js +1 -1
- package/dist/screen/lib/puck/palette-sections.d.ts +2 -97
- package/dist/screen/lib/puck/palette-sections.js +1 -1
- package/dist/screen/lib/puck/panel-fields.d.ts +1 -47
- package/dist/screen/lib/puck/panel-fields.js +1 -1
- package/dist/screen/lib/puck/panel-no-control-mark.d.ts +2 -74
- package/dist/screen/lib/puck/panel-no-control-mark.js +1 -1
- package/dist/screen/lib/puck/part-id.d.ts +1 -23
- package/dist/screen/lib/puck/part-id.js +1 -1
- package/dist/screen/lib/puck/preview-click.d.ts +1 -49
- package/dist/screen/lib/puck/preview-click.js +1 -1
- package/dist/screen/lib/puck/preview-dom.d.ts +1 -8
- package/dist/screen/lib/puck/preview-dom.js +1 -1
- package/dist/screen/lib/puck/preview-events.d.ts +1 -25
- package/dist/screen/lib/puck/preview-events.js +1 -1
- package/dist/screen/lib/puck/preview-selection-context.d.ts +2 -72
- package/dist/screen/lib/puck/preview-selection-context.js +1 -1
- package/dist/screen/lib/puck/section-doc.d.ts +3 -18
- package/dist/screen/lib/puck/section-doc.js +1 -1
- package/dist/screen/lib/puck/slot-child-name.d.ts +1 -225
- package/dist/screen/lib/puck/slot-child-name.js +1 -1
- package/dist/screen/lib/puck/slot-heal.d.ts +2 -5
- package/dist/screen/lib/puck/slot-heal.js +1 -1
- package/dist/screen/lib/puck/slot-section-spec.d.ts +1 -96
- package/dist/screen/lib/puck/slot-section-spec.js +1 -0
- package/dist/screen/lib/puck/style-clipboard.d.ts +14 -116
- package/dist/screen/lib/puck/style-clipboard.js +1 -1
- package/dist/screen/lib/puck/text-control-kinds.d.ts +1 -71
- package/dist/screen/lib/puck/text-control-kinds.js +1 -1
- package/dist/screen/lib/puck/tree-reveal.d.ts +1 -62
- package/dist/screen/lib/puck/tree-reveal.js +1 -1
- package/dist/screen/lib/puck/use-section-ops.d.ts +4 -105
- package/dist/screen/lib/puck/use-section-ops.js +1 -1
- package/dist/screen/lib/screen-parts.d.ts +27 -20
- package/dist/screen/lib/screen-parts.js +1 -1
- package/dist/screen/lib/section-template-types.d.ts +1 -1
- package/dist/screen/lib/section-templates.d.ts +1 -1
- package/dist/screen/lib/section-templates.js +1 -1
- package/dist/screen/lib/session-context.d.ts +1 -1
- package/dist/screen/lib/session-context.js +1 -1
- package/dist/screen/lib/session.d.ts +3 -3
- package/dist/screen/lib/session.js +1 -1
- package/dist/screen/lib/shared-section-types.d.ts +1 -1
- package/dist/screen/lib/shared-sections.d.ts +1 -1
- package/dist/screen/lib/shared-sections.js +1 -1
- package/dist/screen/screen.css +5 -9
- package/dist/screen/words.d.ts +4 -0
- package/dist/screen/words.js +1 -1
- package/dist/strings/index.d.ts +4 -4
- package/dist/strings/index.js +2 -2
- package/dist/text-styles/index.js +33 -33
- package/dist/tree/index.d.ts +5 -5
- package/dist/tree/index.js +1 -1
- package/dist/{types-CDX6vd6A.d.ts → types-B8NwXKlE.d.ts} +1 -1
- package/dist/{types-Bqq6ya0y.d.ts → types-DBy3L69b.d.ts} +11 -4
- package/dist/{watch-BTYOJpQU.d.ts → watch-D8xZow3y.d.ts} +2 -2
- package/dist/{words-vhnV8sM7.d.ts → words-CFkb8XtN.d.ts} +5 -0
- package/dist/{words-BeX5eGq7.d.ts → words-CmEnDoOe.d.ts} +1 -1
- package/dist/{words-CvwYvkJm.d.ts → words-SD4neL0n.d.ts} +6 -0
- package/package.json +156 -12
- package/dist/chunk-23DYNW6S.js +0 -1
- package/dist/chunk-23VM4PMV.js +0 -7
- package/dist/chunk-276MBG5P.js +0 -2
- package/dist/chunk-6FWAE2RN.js +0 -1
- package/dist/chunk-7LYKFL3Q.js +0 -21
- package/dist/chunk-A6Z4SD3I.js +0 -10
- package/dist/chunk-BHRC3ASL.js +0 -1
- package/dist/chunk-EFHV56BO.js +0 -15
- package/dist/chunk-I54UCYOU.js +0 -1
- package/dist/chunk-JBOSEHIX.js +0 -1
- package/dist/chunk-KAML3KQH.js +0 -1
- package/dist/chunk-L2Y3PF2R.js +0 -4
- package/dist/chunk-LQV5FZTQ.js +0 -18
- package/dist/chunk-MEHLY5Q4.js +0 -1
- package/dist/chunk-PAOZMXEI.js +0 -5
- package/dist/chunk-QIDRJH3S.js +0 -1
- package/dist/chunk-R5KEFI55.js +0 -8
- package/dist/chunk-RC25EGHD.js +0 -5
- package/dist/chunk-RSCMJIWS.js +0 -1
- package/dist/chunk-TNGOL65V.js +0 -1
- package/dist/chunk-VANKQVOW.js +0 -8
- package/dist/chunk-WEIE2FBC.js +0 -1
- package/dist/chunk-WRFD4EXD.js +0 -1
- package/dist/chunk-XJ2WXGFJ.js +0 -65
- /package/dist/{chunk-MQNBD6AB.js → chunk-3QB2ZQXK.js} +0 -0
- /package/dist/{chunk-LER7RKTO.js → chunk-5XL2RXFU.js} +0 -0
- /package/dist/{chunk-6W7WLPZH.js → chunk-6UAEFOJ4.js} +0 -0
- /package/dist/{chunk-26OOWIJJ.js → chunk-7OCEPOEJ.js} +0 -0
- /package/dist/{chunk-IQ5TA7AM.js → chunk-AJ2SUSET.js} +0 -0
- /package/dist/{chunk-DUVRZ456.js → chunk-ANPOR6EY.js} +0 -0
- /package/dist/{chunk-5ZBY24K7.js → chunk-CPL43ZLJ.js} +0 -0
- /package/dist/{chunk-PIND6KE7.js → chunk-I6SK6ZDT.js} +0 -0
- /package/dist/{chunk-7F52SZOI.js → chunk-INRERJU4.js} +0 -0
- /package/dist/{chunk-R5L2E7JX.js → chunk-MGVI67QV.js} +0 -0
- /package/dist/{chunk-IYT6NN2J.js → chunk-R4AUZVA3.js} +0 -0
- /package/dist/{chunk-M2Z775ZC.js → chunk-RUQOIQWI.js} +0 -0
- /package/dist/{chunk-PLVEGYK6.js → chunk-TCAAOYQY.js} +0 -0
- /package/dist/{chunk-PA3PNTVV.js → chunk-VKPOH6MK.js} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* text-control-kinds — the authored-text control kinds, and the ONE fact about
|
|
3
|
+
* each that three separate lists used to hold by hand (card 66286).
|
|
4
|
+
*
|
|
5
|
+
* A LEAF ON PURPOSE: it imports nothing. `lib/document/controls` is nine hops deep in
|
|
6
|
+
* a require cycle back to `lib/document/part-text`
|
|
7
|
+
* (controls → MediaUploadField → ScreenDocumentContext →
|
|
8
|
+
* catalog-default-layout → ProductGridSection → goldPhrases → PartStyledText →
|
|
9
|
+
* part-styles → part-rows → part-text), so a list defined in `controls` and read
|
|
10
|
+
* at another module's INIT time throws "Cannot access before initialization".
|
|
11
|
+
* The cycle never bit before because the values `part-text` takes from `controls`
|
|
12
|
+
* — `TEXT_FIELD_MARKER`, `readHidable` — are only read inside functions. A
|
|
13
|
+
* single source has to be readable at init, so it lives here, on its own, where
|
|
14
|
+
* nothing can be in flight ahead of it.
|
|
15
|
+
*
|
|
16
|
+
* `lib/document/controls` re-exports every name below, because that is where the rest
|
|
17
|
+
* of the text-field vocabulary lives (`TEXT_FIELD_MARKER`, `TextFieldMeta`, the
|
|
18
|
+
* builders) and every existing caller already reads it from there. The
|
|
19
|
+
* definitions are here and only here.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Every authored-text control kind, as recorded on `TEXT_FIELD_MARKER`
|
|
23
|
+
* (`lib/document/controls`),
|
|
24
|
+
* and the one fact three separate lists used to hold by hand (card 66286):
|
|
25
|
+
* whether the kind's value is ONE string a merchant edits as a single box
|
|
26
|
+
* (`"scalar"`), or N of them a control adds, removes and reorders (`"list"`).
|
|
27
|
+
*
|
|
28
|
+
* ⚠️ THIS IS THE SOURCE. {@link TextControlKind} and {@link SCALAR_TEXT_CONTROLS}
|
|
29
|
+
* are both read off it, so a sixth kind cannot be added without answering the
|
|
30
|
+
* scalar/list question once, here, where the answer is. Until this card it was
|
|
31
|
+
* answered THREE times in three files, kept in step by a comment asking the next
|
|
32
|
+
* reader to remember: which parts get an entry row on the section screen
|
|
33
|
+
* (`ENTRY_CONTROLS`), which copy boxes move to the drill (`DRILL_TEXT_CONTROLS`),
|
|
34
|
+
* and which parts a caret may be opened in (`TYPE_IN_PLACE_KINDS`). All three
|
|
35
|
+
* were the same question and nothing went red when they disagreed — card 66282
|
|
36
|
+
* added `copyText` to one of them first and the drift surfaced afterwards as
|
|
37
|
+
* `1 unreachable: altName`.
|
|
38
|
+
*
|
|
39
|
+
* `control` also fixes the STORED VALUE SHAPE the neutralizer must preserve, so
|
|
40
|
+
* each kind names its own shape beside it.
|
|
41
|
+
*/
|
|
42
|
+
declare const TEXT_CONTROL_KINDS: {
|
|
43
|
+
readonly text: "scalar";
|
|
44
|
+
readonly textarea: "scalar";
|
|
45
|
+
readonly plainText: "scalar";
|
|
46
|
+
readonly copyText: "scalar";
|
|
47
|
+
readonly plainTextarea: "scalar";
|
|
48
|
+
readonly textList: "list";
|
|
49
|
+
};
|
|
50
|
+
/** The authored-text control kinds — the keys of {@link TEXT_CONTROL_KINDS}. */
|
|
51
|
+
type TextControlKind = keyof typeof TEXT_CONTROL_KINDS;
|
|
52
|
+
/** The kinds whose value is ONE string, as a type — so a caller may hold one of
|
|
53
|
+
* those and not the list kind, which the compiler then keeps it to. */
|
|
54
|
+
type ScalarTextControlKind = {
|
|
55
|
+
[K in TextControlKind]: (typeof TEXT_CONTROL_KINDS)[K] extends "scalar" ? K : never;
|
|
56
|
+
}[TextControlKind];
|
|
57
|
+
/**
|
|
58
|
+
* THE SCALAR CONTROLS, derived — one string each, so one box, so one row.
|
|
59
|
+
*
|
|
60
|
+
* The three lists this replaces all named exactly these and each stated the same
|
|
61
|
+
* reason for leaving `textList` out: its control manages ROW STRUCTURE (add,
|
|
62
|
+
* remove, reorder), which a per-row box cannot, so it keeps its place on the
|
|
63
|
+
* section screen. That reason is now the `"list"` beside it above, stated once.
|
|
64
|
+
*
|
|
65
|
+
* Order is declaration order, and the section screen's rows are built by walking
|
|
66
|
+
* a section's FIELDS rather than this list, so nothing merchant-facing reads it
|
|
67
|
+
* as an ordering.
|
|
68
|
+
*/
|
|
69
|
+
declare const SCALAR_TEXT_CONTROLS: readonly ScalarTextControlKind[];
|
|
70
|
+
|
|
71
|
+
export { SCALAR_TEXT_CONTROLS, type ScalarTextControlKind, TEXT_CONTROL_KINDS, type TextControlKind };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{SCALAR_TEXT_CONTROLS,TEXT_CONTROL_KINDS}from"../../../chunk-I6SK6ZDT.js";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Puck's index-based address, as `use-section-ops` spells it (zone omitted at root). */
|
|
2
|
+
type Selector = {
|
|
3
|
+
index: number;
|
|
4
|
+
zone?: string;
|
|
5
|
+
} | null;
|
|
6
|
+
/**
|
|
7
|
+
* Do these two addresses name the same node?
|
|
8
|
+
*
|
|
9
|
+
* `ops.select` omits the zone for a top-level node (Puck's reducer falls back to
|
|
10
|
+
* the root zone), while `getSelectorForId` always fills it in — so the two
|
|
11
|
+
* spellings of one top-level node differ, and the comparison has to normalise
|
|
12
|
+
* before it can answer. Exported for `scripts/test-tree-reveal.ts`.
|
|
13
|
+
*/
|
|
14
|
+
declare function sameSelector(a: Selector, b: Selector, rootZone: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Bring the selected Layers row into view. Returns whether a row was found —
|
|
17
|
+
* false whenever the panel is collapsed or on another view, which is a no-op and
|
|
18
|
+
* not a failure. A row that is already fully visible is found and left alone:
|
|
19
|
+
* the return says "there is a row", not "the panel moved".
|
|
20
|
+
*/
|
|
21
|
+
declare function revealSelectedTreeRow(doc?: Document | undefined): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Which node's Layers row is the MARKED one — the row that draws `is-selected`,
|
|
24
|
+
* and so the row {@link revealSelectedTreeRow} scrolls to.
|
|
25
|
+
*
|
|
26
|
+
* TWO SOURCES, ONE ANSWER. Normally it is the Puck selection. While a PART
|
|
27
|
+
* panel is open it is that part's OWNER, because `usePartBridge` deliberately
|
|
28
|
+
* leaves the Puck selection where it was — "the Layers tree, undo, redo and
|
|
29
|
+
* autosave therefore see nothing at all", which is that bridge's own cheapest
|
|
30
|
+
* proof that they still behave. The chrome asked `isPuckMode && selectedItem`
|
|
31
|
+
* instead, and `isPuckMode` is false in part mode, so opening a part put the
|
|
32
|
+
* mark out on EVERY row at once: a merchant who clicked a run of text in the
|
|
33
|
+
* canvas was left looking at a Layers list with nothing lit, which had also not
|
|
34
|
+
* moved (owner, 2026-09-09 — the "SHOP" tag on a Collections card). The bridge
|
|
35
|
+
* has returned `openPartId` for exactly this since card 66268 and no shell ever
|
|
36
|
+
* read it.
|
|
37
|
+
*
|
|
38
|
+
* EVERY OTHER OVERRIDE STILL ANSWERS `null` — Header, Website, Live chat and the
|
|
39
|
+
* ticker. Those panels are not about a node in this tree at all, and the rows
|
|
40
|
+
* that DO mark them (`inspectorMode.kind === "header"`, `tickerHeroId === secId`,
|
|
41
|
+
* …) read their own state, which is why widening this to them would light two
|
|
42
|
+
* rows for one panel.
|
|
43
|
+
*
|
|
44
|
+
* ⚠️ THE HERO'S `Text` / `Background` WERE ON THIS LIST AND ARE GONE
|
|
45
|
+
* ([ADD] The Hero Takes Boxes). They were two SYNTHETIC rows standing for the
|
|
46
|
+
* section's own copy and media; the owner put the background back in the hero's
|
|
47
|
+
* settings on 2026-09-09 and deleted the built-in copy, so both panels and both
|
|
48
|
+
* `…SectionId` derivations went with them. The example above named
|
|
49
|
+
* `heroTextSectionId`, a variable that no longer exists — corrected to the ticker
|
|
50
|
+
* rather than dropped, because the RULE it illustrates is unchanged and this is
|
|
51
|
+
* the only place that states it.
|
|
52
|
+
*
|
|
53
|
+
* The mode is taken structurally rather than as `InspectorMode`: that union
|
|
54
|
+
* lives in a component (SectionEditor) and this is `lib`, so a named import
|
|
55
|
+
* here would point the dependency the wrong way for one field.
|
|
56
|
+
*/
|
|
57
|
+
declare function markedTreeNodeId(mode: {
|
|
58
|
+
kind: string;
|
|
59
|
+
nodeId?: string;
|
|
60
|
+
}, selectedId: string | null | undefined): string | null;
|
|
61
|
+
|
|
62
|
+
export { markedTreeNodeId, revealSelectedTreeRow, sameSelector };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{markedTreeNodeId,revealSelectedTreeRow,sameSelector}from"../../../chunk-U5DNBT63.js";
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { N as NodeSelection } from '../../../plan-CZS902DV.js';
|
|
2
|
+
import { Data } from '../../../blocks/index.js';
|
|
3
|
+
import { TreeItem } from './content-tree.js';
|
|
4
|
+
import '../../../types-41704JE4.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import '../../../types-Cq53lL8d.js';
|
|
7
|
+
import '../../../data/index.js';
|
|
8
|
+
import '../../../resolve-D68pb3Bx.js';
|
|
9
|
+
|
|
10
|
+
type NodeSelector = {
|
|
11
|
+
index: number;
|
|
12
|
+
zone?: string;
|
|
13
|
+
} | null;
|
|
14
|
+
type ComponentData = TreeItem;
|
|
15
|
+
type SectionOps = {
|
|
16
|
+
/** Insert a component into a zone at an index; returns the generated id. */
|
|
17
|
+
insertComponent: (zone: string, type: string, index: number) => string;
|
|
18
|
+
/** Insert into ROOT_ZONE (top-level section); returns the generated id. */
|
|
19
|
+
insertSection: (type: string, index: number) => string;
|
|
20
|
+
/** Atomically replace the node at (zone, index) — heal, reseed, hide toggle. */
|
|
21
|
+
replaceComponent: (zone: string, index: number, data: ComponentData) => void;
|
|
22
|
+
/** Seed a freshly-inserted slot child's props (insert THEN replace at a stable id). */
|
|
23
|
+
seedChild: (zone: string, index: number, childType: string, props: Record<string, unknown>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Insert a FULL node — type + props, including inline slot children — at
|
|
26
|
+
* (zone, index); returns its id. The same insert-then-replace pattern as
|
|
27
|
+
* seedChild, one level up: how a saved section template lands in a page.
|
|
28
|
+
* Callers pass a node whose ids are already fresh (cloneNodeWithFreshIds).
|
|
29
|
+
*/
|
|
30
|
+
insertNode: (zone: string, index: number, node: TreeItem) => string;
|
|
31
|
+
/** Remove the node at (zone, index). A normal dispatch, so Undo restores it. */
|
|
32
|
+
removeComponent: (zone: string, index: number) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Move the node at (zone, sourceIndex) to destinationIndex WITHIN THE SAME
|
|
35
|
+
* zone. `destinationIndex` is the node's final resting index in the array
|
|
36
|
+
* (Puck's `reorder` reducer splices it out then back in), so a caller moving a
|
|
37
|
+
* node DOWN must account for the one-slot shift itself.
|
|
38
|
+
*/
|
|
39
|
+
reorderComponent: (zone: string, sourceIndex: number, destinationIndex: number) => void;
|
|
40
|
+
/** Duplicate the node at (zone, index). */
|
|
41
|
+
duplicateComponent: (zone: string, index: number) => void;
|
|
42
|
+
/** Set (or clear) the Puck selection by index-based address. */
|
|
43
|
+
select: (selector: NodeSelector) => void;
|
|
44
|
+
/** Replace the whole working document (used by Reset). */
|
|
45
|
+
setDocument: (data: Data) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Write the next document, and what to select in it, as ONE undo step — the
|
|
48
|
+
* commit behind the block operations (`efficient-easel/node-ops`, blueprint
|
|
49
|
+
* step 2.4b: the menu's Delete, Duplicate, Move, Copy / Cut / Paste and Hide,
|
|
50
|
+
* and the rows' hover-delete). Each of those is planned whole and lands here
|
|
51
|
+
* once, instead of the two or three dispatches it used to be.
|
|
52
|
+
*
|
|
53
|
+
* `select` is BY ID, in `data` (`undefined` leaves the selection as it is),
|
|
54
|
+
* and goes in with the document through the store's `run` (0.105.1). Until
|
|
55
|
+
* then the chrome selected first, by position (`setUi { itemSelector }`),
|
|
56
|
+
* which the store reads in the document it still holds: a paste or a
|
|
57
|
+
* Duplicate selected the node after its copy, and a Move the node it passed.
|
|
58
|
+
* Behind the read-only gate like every other mutation here.
|
|
59
|
+
*/
|
|
60
|
+
commitDocument: (data: Data, select?: NodeSelection) => void;
|
|
61
|
+
};
|
|
62
|
+
type SectionOpsOptions = {
|
|
63
|
+
/**
|
|
64
|
+
* SOMEBODY ELSE holds the open document: every MUTATION below becomes a no-op.
|
|
65
|
+
*
|
|
66
|
+
* This is the one place the editor's read-only state is enforced on the
|
|
67
|
+
* document, and it is here rather than on each button because this hook is
|
|
68
|
+
* already the single source of truth for every mutation — the tree rows, the
|
|
69
|
+
* canvas "+" seams, the inspector head buttons and the lifecycle effects all
|
|
70
|
+
* come through it. A gate on the buttons would be a gate on the ones somebody
|
|
71
|
+
* remembered.
|
|
72
|
+
*
|
|
73
|
+
* `select` and `setUi` are NOT mutations and stay live: a read-only viewer must
|
|
74
|
+
* still be able to click a section and read its settings.
|
|
75
|
+
*
|
|
76
|
+
* Deliberately keyed on "somebody else has it" and NOT on the wider save gate.
|
|
77
|
+
* The save gate is also false while the lock claim is still `checking`, and the
|
|
78
|
+
* pinned Header/Footer seed runs in the chrome's mount commit, inside that
|
|
79
|
+
* window, through these very ops. Its WRITE is what is held there — by
|
|
80
|
+
* `onChange`, released by the claim if it is granted — so the seed must be
|
|
81
|
+
* allowed to lay the node down (card 1096). Blocking it here would silently
|
|
82
|
+
* un-fix that card.
|
|
83
|
+
*/
|
|
84
|
+
readOnly?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Resolve each node an op puts in (`easel.resolveNode`, trigger `"insert"`).
|
|
87
|
+
* Default: the layer's rule (`ScreenBlockRules.resolveOnInsert`), else
|
|
88
|
+
* false — no op resolves anything, as before 0.103.0.
|
|
89
|
+
*/
|
|
90
|
+
resolveOnInsert?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* NOT AN UNDO STEP: every write is folded into the history entry it happens
|
|
93
|
+
* in (the store's `recordHistory: false`), as the store folds a resolver's
|
|
94
|
+
* write (`resolveAll`), instead of being recorded as a step of its own.
|
|
95
|
+
*
|
|
96
|
+
* For the passes the screen runs over a document AS IT OPENS — the slot
|
|
97
|
+
* seeding, the duplicate-id heal, and the layer's own pass (the website's
|
|
98
|
+
* pinned Header and Footer). Recorded, each was the first entry of the
|
|
99
|
+
* history: Undo was offered the moment the page opened, and ONE press took
|
|
100
|
+
* the seeded slides and cards (or the Header) back out of the page, which
|
|
101
|
+
* autosave then wrote (1.0.1). Folded, the document opens as the history's
|
|
102
|
+
* first entry; a pass that runs after an edit (a section just inserted,
|
|
103
|
+
* seeded) lands in that edit's step, so one Undo takes both out together.
|
|
104
|
+
* Autosave still hears every write (the store's `onChange` fires on a fold).
|
|
105
|
+
*/
|
|
106
|
+
foldIntoHistory?: boolean;
|
|
107
|
+
};
|
|
108
|
+
declare function useSectionOps(options?: SectionOpsOptions): SectionOps;
|
|
109
|
+
|
|
110
|
+
export { type NodeSelector, type SectionOps, type SectionOpsOptions, useSectionOps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{useSectionOps}from"../../../chunk-MLQKNED6.js";import"../../../chunk-OHZHYROJ.js";import"../../../chunk-PRHBWA5V.js";import"../../../chunk-FHCKFOCD.js";import"../../../chunk-MQA7OFRA.js";import"../../../chunk-TCAAOYQY.js";import"../../../chunk-TUXLORVR.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-PFFH7ASD.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-ZEH6QLBH.js";import"../../../chunk-FM6JO4WF.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-WHS6Y55E.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-IWCKVZHS.js";import"../../../chunk-FIVU2COQ.js";import"../../../chunk-BSHIQIZC.js";import"../../../chunk-MZ5GSSZ3.js";import"../../../chunk-KRL3IUV3.js";import"../../../chunk-Y2T3JX7K.js";import"../../../chunk-KFWNGPW3.js";import"../../../chunk-S3DUFDQ6.js";import"../../../chunk-JACEEVVF.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-3S5N4HLJ.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-4FD7TAOE.js";import"../../../chunk-LF3FUSCQ.js";import"../../../chunk-K7BTCBWD.js";import"../../../chunk-L55YIXDC.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AnyDocumentAddressing, a as DocumentAddressing, N as NO_DOCUMENT_ADDRESSING } from '../../ScreenDocumentContext-
|
|
1
|
+
export { A as AnyDocumentAddressing, a as DocumentAddressing, N as NO_DOCUMENT_ADDRESSING } from '../../ScreenDocumentContext-1RgtGKWR.js';
|
|
2
2
|
import './document-contract.js';
|
|
3
3
|
import './session.js';
|
|
4
4
|
import 'react';
|
|
@@ -18,5 +18,5 @@ import './links/link-filters.js';
|
|
|
18
18
|
import 'efficient-shell/ui';
|
|
19
19
|
import './document-hooks.js';
|
|
20
20
|
import './section-template-types.js';
|
|
21
|
-
import './
|
|
21
|
+
import './document/content-tree.js';
|
|
22
22
|
import './shared-section-types.js';
|
|
@@ -9,7 +9,7 @@ import { EditAccess } from '../../edit-lock/index.js';
|
|
|
9
9
|
* read off the autosave's state, and a set of per-document facts (the pending
|
|
10
10
|
* edit, the version token, a refused save, the lock) that are true of the
|
|
11
11
|
* document being left and of no other. They were written beside the website's
|
|
12
|
-
* pinned-chrome seed, which defers on that status (lib/
|
|
12
|
+
* pinned-chrome seed, which defers on that status (lib/document/pinned-seed-gate —
|
|
13
13
|
* the account of why the two must not drift is there, and that module still
|
|
14
14
|
* hands these on), and are here because the document provider reads them and
|
|
15
15
|
* holds no website.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { D as DETACHED_EASEL_HOST, E as EaselBlockType, b as EaselFieldDescription, c as EaselHost, d as EaselHostAddress, e as EaselHostContext, f as EaselHostPanels, g as EaselHostProvider, h as EaselMessageType, i as EaselSelection, j as EaselToHostMessage, H as HostPickedMedia, k as HostToEaselMessage, I as InboundHostMessage, P as PageEditOp, l as PickedMediaSource, S as SectionScreenTarget, m as SendToHost, n as createEaselHost, u as useEaselHost, o as useHostEscape } from '../../ScreenDocumentContext-
|
|
2
|
+
export { D as DETACHED_EASEL_HOST, E as EaselBlockType, b as EaselFieldDescription, c as EaselHost, d as EaselHostAddress, e as EaselHostContext, f as EaselHostPanels, g as EaselHostProvider, h as EaselMessageType, i as EaselSelection, j as EaselToHostMessage, H as HostPickedMedia, k as HostToEaselMessage, I as InboundHostMessage, P as PageEditOp, l as PickedMediaSource, S as SectionScreenTarget, m as SendToHost, n as createEaselHost, u as useEaselHost, o as useHostEscape } from '../../ScreenDocumentContext-1RgtGKWR.js';
|
|
3
3
|
import '../../blocks/index.js';
|
|
4
4
|
import '../../types-Cq53lL8d.js';
|
|
5
5
|
import '../../data/index.js';
|
|
@@ -18,5 +18,5 @@ import './links/link-filters.js';
|
|
|
18
18
|
import 'efficient-shell/ui';
|
|
19
19
|
import './document-hooks.js';
|
|
20
20
|
import './section-template-types.js';
|
|
21
|
-
import './
|
|
21
|
+
import './document/content-tree.js';
|
|
22
22
|
import './shared-section-types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-
|
|
1
|
+
export{editorRootFocus,isSaveShortcut,useEaselKeyTarget,useEaselSaveKey,useEaselUndoKeys}from"../../chunk-DNQ7AF6K.js";import"../../chunk-MQA7OFRA.js";import"../../chunk-TUXLORVR.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-4FD7TAOE.js";import"../../chunk-LF3FUSCQ.js";import"../../chunk-K7BTCBWD.js";import"../../chunk-L55YIXDC.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentType, ReactNode } from 'react';
|
|
3
|
-
import { H as HostPickedMedia, c as EaselHost } from '../../ScreenDocumentContext-
|
|
3
|
+
import { H as HostPickedMedia, c as EaselHost } from '../../ScreenDocumentContext-1RgtGKWR.js';
|
|
4
4
|
import '../../blocks/index.js';
|
|
5
5
|
import '../../types-Cq53lL8d.js';
|
|
6
6
|
import '../../data/index.js';
|
|
@@ -19,7 +19,7 @@ import './links/link-filters.js';
|
|
|
19
19
|
import 'efficient-shell/ui';
|
|
20
20
|
import './document-hooks.js';
|
|
21
21
|
import './section-template-types.js';
|
|
22
|
-
import './
|
|
22
|
+
import './document/content-tree.js';
|
|
23
23
|
import './shared-section-types.js';
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HostPickedMedia, c as EaselHost } from '../../ScreenDocumentContext-
|
|
1
|
+
import { H as HostPickedMedia, c as EaselHost } from '../../ScreenDocumentContext-1RgtGKWR.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../blocks/index.js';
|
|
4
4
|
import '../../types-Cq53lL8d.js';
|
|
@@ -18,7 +18,7 @@ import './links/link-filters.js';
|
|
|
18
18
|
import 'efficient-shell/ui';
|
|
19
19
|
import './document-hooks.js';
|
|
20
20
|
import './section-template-types.js';
|
|
21
|
-
import './
|
|
21
|
+
import './document/content-tree.js';
|
|
22
22
|
import './shared-section-types.js';
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -14,7 +14,7 @@ import 'efficient-shell/ui';
|
|
|
14
14
|
import './document-contract.js';
|
|
15
15
|
import './document-hooks.js';
|
|
16
16
|
import './section-template-types.js';
|
|
17
|
-
import './
|
|
17
|
+
import './document/content-tree.js';
|
|
18
18
|
import './shared-section-types.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -1,55 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
/** Which registry answered — the discriminator three of the four decisions read. */
|
|
5
|
-
type AddTargetSource = "section" | "footer" | "container";
|
|
6
|
-
/**
|
|
7
|
-
* What a parent can take, and everything the four decisions below need to act on
|
|
8
|
-
* it.
|
|
9
|
-
*
|
|
10
|
-
* ⚠️ THE LOOKUP DECIDES FOUR THINGS, NOT ONE. Wiring only the choice list ships
|
|
11
|
-
* a menu with wrong row names, wrong handlers, and unreachable on an empty
|
|
12
|
-
* container — which is why this returns a record rather than a list:
|
|
13
|
-
*
|
|
14
|
-
* 1 the CHOICE LIST — {@link AddTarget.choices}, what the Add menu offers, or
|
|
15
|
-
* `null` where the parent adds ONE child type from a button instead.
|
|
16
|
-
* 2 the ROW NAME — `rowNamerFor` (components/SlotChildRows) reads
|
|
17
|
-
* {@link AddTarget.source} to pick the FOOTER's block-label rule over
|
|
18
|
-
* lib/puck/slot-child-name.ts. It must ask "is this a FOOTER block", NOT
|
|
19
|
-
* "does this parent use a menu": a Box adds from a menu too and
|
|
20
|
-
* keeps the slot-child rule, or its Headings, Texts and Buttons all fall
|
|
21
|
-
* through to a rule that reads a heading, a bound menu and first-words.
|
|
22
|
-
* 3 WHICH HANDLERS — SectionScreenShell's adapter reads `source` to choose
|
|
23
|
-
* which pair of host handlers a row presses. Keyed the other way round it
|
|
24
|
-
* answered null for a Box, whose rows then pressed and did nothing.
|
|
25
|
-
* 4 REACHABILITY — `Boolean(canAddTo(type))` feeds `nestState`, and a row
|
|
26
|
-
* folds open only if it has children OR an add affordance. An EMPTY
|
|
27
|
-
* container with no caret cannot be opened to reach its own menu — and
|
|
28
|
-
* empty is exactly the state a merchant is in when adding the first block.
|
|
29
|
-
*/
|
|
30
|
-
interface AddTarget {
|
|
31
|
-
/** Which of the three registries answered. */
|
|
32
|
-
source: AddTargetSource;
|
|
33
|
-
/**
|
|
34
|
-
* The slot this parent keeps its children on.
|
|
35
|
-
*
|
|
36
|
-
* RETURNED rather than defaulted, so a caller can never reach it by falling
|
|
37
|
-
* through another mechanism's constant — the rule container-blocks states for
|
|
38
|
-
* its own lookup, kept here because this is now the one that is asked. A Flex
|
|
39
|
-
* listed on the Footer's `blocks` would draw its rows off `undefined`.
|
|
40
|
-
*/
|
|
41
|
-
slot: string;
|
|
42
|
-
/** The registry's own choice list, or `null` for a single-type "Add …" button. */
|
|
43
|
-
choices: BlockChoice[] | null;
|
|
44
|
-
/**
|
|
45
|
-
* The section's own spec — its `addLabel`, `childType`, `seeds`, `addBlocked`,
|
|
46
|
-
* `notice` and `slider`. Non-null exactly when `source === "section"`.
|
|
47
|
-
*
|
|
48
|
-
* Carried so a caller that needs a section's own arithmetic (the Hero slide's
|
|
49
|
-
* anchor cap, the seed-on-load effect) reaches it through this one seam rather
|
|
50
|
-
* than importing the registry beside it and gaining a second opinion.
|
|
51
|
-
*/
|
|
52
|
-
spec: SlotSectionSpec | null;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export type { AddTarget, AddTargetSource };
|
|
1
|
+
export { AddTarget, AddTargetSource } from '../document/add-target-types.js';
|
|
2
|
+
import '../document/block-choice.js';
|
|
3
|
+
import '../document/slot-section-spec.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../chunk-YIUE4US7.js";
|
|
@@ -1,64 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* One row of an "Add block" menu.
|
|
3
|
-
*
|
|
4
|
-
* `group` is OPTIONAL and is the menu's own heading, not a property of the
|
|
5
|
-
* block: the same `ImageBlock` is grouped in a Box's menu and ungrouped in a
|
|
6
|
-
* Slide box's, because grouping is a fact about the LIST a merchant is reading,
|
|
7
|
-
* not about the component. A list whose choices carry no group renders flat, so
|
|
8
|
-
* every menu that shipped before this stays exactly as it was.
|
|
9
|
-
*
|
|
10
|
-
* It is set at BUILD time by whichever module assembles the list, from the
|
|
11
|
-
* source each choice came from — never hand-written per row. See
|
|
12
|
-
* `lib/puck/container-blocks.ts`, which is the only assembler that sets one.
|
|
13
|
-
*/
|
|
14
|
-
type BlockChoice = {
|
|
15
|
-
type: string;
|
|
16
|
-
label: string;
|
|
17
|
-
group?: string;
|
|
18
|
-
/**
|
|
19
|
-
* RETIRED: Add does not offer it, and a node of it already in a slot still
|
|
20
|
-
* belongs there (card [MERGE] One Text Block And Click Through Parts). The
|
|
21
|
-
* website's Heading and Eyebrow blocks: the Text block took their job, so
|
|
22
|
-
* nobody starts a new one, and every stored one still draws, edits, moves
|
|
23
|
-
* and pastes. Read through {@link offeredChoices} wherever a list is shown
|
|
24
|
-
* to ADD from; the whole list is still the slot's answer to "does this slot
|
|
25
|
-
* take it?", so a move or a paste reads it unfiltered.
|
|
26
|
-
*/
|
|
27
|
-
retired?: boolean;
|
|
28
|
-
};
|
|
29
|
-
/** The choices Add offers: every one that is not {@link BlockChoice.retired}, in order. */
|
|
30
|
-
declare function offeredChoices<C extends BlockChoice>(choices: readonly C[]): C[];
|
|
31
|
-
/**
|
|
32
|
-
* One run of consecutive choices sharing a `group` — what a menu draws under one
|
|
33
|
-
* heading.
|
|
34
|
-
*
|
|
35
|
-
* ⚠️ ONE FUNCTION, BOTH SURFACES, and that is the whole reason it is a function.
|
|
36
|
-
* A Box's menu is drawn twice — the dropdown in `components/AddBlockRow`
|
|
37
|
-
* (reached from the Layers tree and from the box's own settings panel) and the
|
|
38
|
-
* chip row at the top of the Add panel (`components/AddSectionPanel`). They draw
|
|
39
|
-
* ONE list, so "where does a heading start" must be ONE answer; two `map`s each
|
|
40
|
-
* comparing with the previous item is how the two surfaces begin dividing the
|
|
41
|
-
* same list differently. That is the exact defect `lib/puck/add-target.ts`'s
|
|
42
|
-
* docblock is an essay about, one tier down.
|
|
43
|
-
*
|
|
44
|
-
* ⚠️ AND THE MENU'S CLASS NAME IS DELIBERATELY NOT WRITTEN IN THIS FILE.
|
|
45
|
-
* `test-footer-block-lists` §8 counts the files mentioning it to prove the menu
|
|
46
|
-
* has exactly ONE home, and it reads prose the same way it reads code — naming
|
|
47
|
-
* the class in a comment here makes this module look like a second menu. The
|
|
48
|
-
* markup lives in `components/AddBlockRow`; this is only the arithmetic.
|
|
49
|
-
*
|
|
50
|
-
* It preserves ORDER and never sorts: the list arrives in the order its assembler
|
|
51
|
-
* chose (`lib/puck/container-blocks.ts` says why that order is what it is), and a
|
|
52
|
-
* renderer is not the place to have a second opinion about it.
|
|
53
|
-
*
|
|
54
|
-
* A list whose choices carry NO group comes back as a single run with
|
|
55
|
-
* `group: undefined` — so a caller written for runs draws an ungrouped list
|
|
56
|
-
* exactly the way it drew it before groups existed, with no branch of its own.
|
|
57
|
-
*/
|
|
58
|
-
type BlockChoiceRun = {
|
|
59
|
-
group?: string;
|
|
60
|
-
items: BlockChoice[];
|
|
61
|
-
};
|
|
62
|
-
declare function blockRuns(choices: BlockChoice[]): BlockChoiceRun[];
|
|
63
|
-
|
|
64
|
-
export { type BlockChoice, type BlockChoiceRun, blockRuns, offeredChoices };
|
|
1
|
+
export { BlockChoice, BlockChoiceRun, blockRuns, offeredChoices } from '../document/block-choice.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockRuns,offeredChoices}from"../../../chunk-
|
|
1
|
+
export{blockRuns,offeredChoices}from"../../../chunk-RUQOIQWI.js";
|
|
@@ -1,39 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Every block type a saved layout uses — the top-level sections and whatever
|
|
3
|
-
* sits in their slots, to any depth.
|
|
4
|
-
*
|
|
5
|
-
* WHAT IT IS FOR. A host chooses which blocks its editor offers
|
|
6
|
-
* (`WebsiteEditor`'s `blocks`), and that choice hides them in the palette, the
|
|
7
|
-
* slot menus and the drop targets. It is not a boundary: a saved page is a JSON
|
|
8
|
-
* document, and whoever can call the host's save endpoint can send one holding
|
|
9
|
-
* any type. So the host's SERVER reads the layout it was handed with this, and
|
|
10
|
-
* refuses a type it does not allow.
|
|
11
|
-
*
|
|
12
|
-
* READ BY SHAPE, WITH NO REGISTRY. A node is `{ type: string, props: {…} }`,
|
|
13
|
-
* and a slot is an array of nodes kept on a prop of its parent — directly, or
|
|
14
|
-
* inside an object or a list item. This walks every value under `props` and
|
|
15
|
-
* takes each array item of that shape as a node. It asks no block registry which
|
|
16
|
-
* props are slots, because the caller is a server that must not have to load
|
|
17
|
-
* one: this module imports nothing.
|
|
18
|
-
*
|
|
19
|
-
* That makes it wider than the editor's own walk in one direction only: a prop
|
|
20
|
-
* that merely LOOKS like a node (an object with a string `type` and an object
|
|
21
|
-
* `props`, inside an array) is counted. It does not ask for the `id` the engine
|
|
22
|
-
* gives every node, because the renderer draws a node without one and a request
|
|
23
|
-
* written by hand can leave it out. Wider is the safe side for an allow-list —
|
|
24
|
-
* it can refuse a page it might have accepted, never accept one it should have
|
|
25
|
-
* refused.
|
|
26
|
-
*
|
|
27
|
-
* `zones` — the engine's older place for slot children, which this editor has
|
|
28
|
-
* never written — is walked too, so a document from elsewhere hides nothing
|
|
29
|
-
* there.
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* The block types in `layout`, each once, sorted. `layout` is the page document
|
|
33
|
-
* a `WebsiteBackend` stores (`PageLayout`: `content`, `root`, `zones`); a single
|
|
34
|
-
* node — a section template's — is read the same way. Anything else answers
|
|
35
|
-
* an empty list: it holds no block.
|
|
36
|
-
*/
|
|
37
|
-
declare function blockTypesIn(layout: unknown): string[];
|
|
38
|
-
|
|
39
|
-
export { blockTypesIn };
|
|
1
|
+
export { blockTypesIn } from '../document/block-types-in.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{blockTypesIn}from"../../../chunk-
|
|
1
|
+
export{blockTypesIn}from"../../../chunk-CPL43ZLJ.js";
|