efficient-easel 21.0.0 → 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 +15 -3
- package/dist/{CanvasDragLayer-Cd1o0HQf.d.ts → CanvasDragLayer-CFUcBbgc.d.ts} +1 -1
- 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-HGCGIRVA.js → chunk-DNQ7AF6K.js} +1 -1
- package/dist/{chunk-66JNVRQM.js → chunk-GWYNMSIP.js} +1 -1
- package/dist/{chunk-V2ULLALL.js → chunk-I67UW5UG.js} +3 -3
- package/dist/{chunk-MSGZ56QL.js → chunk-KWLHKKZO.js} +1 -1
- package/dist/{chunk-FOHHXSOL.js → chunk-MLQKNED6.js} +1 -1
- 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-YHFKWV7H.js → chunk-PFFH7ASD.js} +13 -13
- package/dist/chunk-PRHBWA5V.js +0 -0
- package/dist/chunk-SNF5764Q.js +1 -0
- package/dist/chunk-SSRYU3YG.js +1 -0
- package/dist/{chunk-R4QJ6DC5.js → chunk-SWBADIQT.js} +1 -1
- package/dist/{chunk-GOTN2KY4.js → chunk-TIAWIOGD.js} +1 -1
- package/dist/chunk-TUXLORVR.js +15 -0
- package/dist/{chunk-FGNR22NY.js → chunk-U5DNBT63.js} +1 -1
- package/dist/{chunk-EZTP6E2M.js → chunk-U7TFWHST.js} +1 -1
- package/dist/{chunk-2M4T27BI.js → chunk-WJJ7H42G.js} +7 -7
- 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-N2RISV46.js → chunk-ZOSEBPAI.js} +1 -1
- package/dist/copy/index.d.ts +2 -2
- package/dist/copy/index.js +11 -11
- package/dist/drag/index.d.ts +2 -2
- 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 +8 -8
- 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/index.d.ts +4 -4
- package/dist/fields/index.js +1 -1
- package/dist/panel/index.d.ts +2 -2
- 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 +13 -13
- 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 +7 -7
- 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 +7 -7
- package/dist/screen/components/ScreenMount.js +1 -1
- package/dist/screen/components/ScreenStoreProvider.d.ts +7 -7
- 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 +7 -7
- 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 +1 -1
- package/dist/screen/lib/admin-bridge.js +1 -1
- package/dist/screen/lib/content/view-tiers.d.ts +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 +12 -114
- 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 +25 -18
- 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 +2 -2
- package/dist/strings/index.d.ts +2 -2
- package/dist/strings/index.js +1 -1
- package/dist/text-styles/index.js +21 -21
- package/dist/tree/index.d.ts +1 -1
- package/dist/{types-CDX6vd6A.d.ts → types-B8NwXKlE.d.ts} +1 -1
- package/dist/{watch-BTYOJpQU.d.ts → watch-D8xZow3y.d.ts} +2 -2
- package/dist/{words-BeX5eGq7.d.ts → words-CmEnDoOe.d.ts} +1 -1
- package/package.json +154 -10
- package/dist/chunk-2E2SXDYQ.js +0 -1
- package/dist/chunk-4IJVV7DA.js +0 -1
- package/dist/chunk-7L3NKHEC.js +0 -15
- package/dist/chunk-APVUYICP.js +0 -65
- package/dist/chunk-BHRC3ASL.js +0 -1
- package/dist/chunk-I54UCYOU.js +0 -1
- package/dist/chunk-LXTM2OLQ.js +0 -2
- package/dist/chunk-NA3GMA43.js +0 -5
- package/dist/chunk-OBWDHKLI.js +0 -8
- package/dist/chunk-Q2A7RHG2.js +0 -1
- package/dist/chunk-QIDRJH3S.js +0 -1
- package/dist/chunk-RSCMJIWS.js +0 -1
- /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,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";
|
|
@@ -1,222 +1 @@
|
|
|
1
|
-
|
|
2
|
-
type: string;
|
|
3
|
-
props: {
|
|
4
|
-
id: string;
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
type SlotConfigView = {
|
|
9
|
-
components?: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Which of a component type's props are SLOTS — the prop names that hold child
|
|
13
|
-
* Blocks, read off the config's field map.
|
|
14
|
-
*
|
|
15
|
-
* Puck 0.20 stores slot children INLINE on the parent's props
|
|
16
|
-
* (`props.<slotName> = [{type,props}, …]`), NOT in `data.zones` — so a walker
|
|
17
|
-
* that wants a section's children has to know which prop names to look under.
|
|
18
|
-
* That set is per-component and lives in exactly one place, `config.components`:
|
|
19
|
-
* `Grid`/`Flex` call theirs `content`, but `Hero` calls it `slides`,
|
|
20
|
-
* `Collections` `cards`, `GalleryB` `items`, `ProductGrid` `products` and
|
|
21
|
-
* `Footer`/`FooterGroup` `blocks`.
|
|
22
|
-
*
|
|
23
|
-
* This is the ONE reader of that set. Hard-coding `"content"` instead is how the
|
|
24
|
-
* heading/SEO audit came to be blind to every heading nested in a Hero slide
|
|
25
|
-
* (card 66067): the walker recursed on a prop name only two of the eight slots
|
|
26
|
-
* happen to use, so a page with two H1s reported as fine. A type the config does
|
|
27
|
-
* not know has no slots — and cannot render either, so there is nothing to walk.
|
|
28
|
-
*/
|
|
29
|
-
declare function slotFieldsOf(config: SlotConfigView, type: string): string[];
|
|
30
|
-
/**
|
|
31
|
-
* What a component type's config ALLOWS of the two actions that make another
|
|
32
|
-
* node or take one away (0.103.0): its `permissions.duplicate` and
|
|
33
|
-
* `permissions.delete`, each true unless the config says false — the reading
|
|
34
|
-
* Puck gave a config that carried none. The campaign designer's Product keeps
|
|
35
|
-
* its Price line this way (`{ delete: false, duplicate: false }`).
|
|
36
|
-
*
|
|
37
|
-
* The screen's tree rows, its menu and the inspector head it hands this to
|
|
38
|
-
* (`ScreenInspectorPanelProps.nodeActions`) all ask HERE, so the three cannot
|
|
39
|
-
* come to disagree about one block. Only the config's own, never the
|
|
40
|
-
* easel-wide permissions the edit lock sets: a document somebody else holds is
|
|
41
|
-
* refused at the writes, as it always was, and draws the rows it drew.
|
|
42
|
-
*
|
|
43
|
-
* A type the config does not know allows both, as one with no `permissions`.
|
|
44
|
-
*/
|
|
45
|
-
declare function blockNodeActions(config: SlotConfigView, type: string): {
|
|
46
|
-
duplicate: boolean;
|
|
47
|
-
delete: boolean;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* A slot child, addressed the way the Layers tree selects it: the node, the
|
|
51
|
-
* compound zone key "<parentId>:<slotName>" Puck's ops take, and its index in
|
|
52
|
-
* that slot.
|
|
53
|
-
*/
|
|
54
|
-
type SlotChild = {
|
|
55
|
-
child: TreeItem;
|
|
56
|
-
zone: string;
|
|
57
|
-
index: number;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Every slot child of `item`, across EVERY slot field its type declares — so a
|
|
61
|
-
* type with two slots reports both, and nesting is general: the result's `child`
|
|
62
|
-
* is itself an item this function accepts.
|
|
63
|
-
*
|
|
64
|
-
* Puck 0.20 stores slot children INLINE on the parent's props, so this reads the
|
|
65
|
-
* arrays rather than `data.zones` (which stays empty for slots).
|
|
66
|
-
*/
|
|
67
|
-
declare function childSlotsOf(config: SlotConfigView, item: TreeItem): SlotChild[];
|
|
68
|
-
/**
|
|
69
|
-
* The children of ONE slot of `item`, addressed as {@link childSlotsOf}
|
|
70
|
-
* addresses them (0.105.0): what the Layers tree draws under a slot it draws
|
|
71
|
-
* as a row of its own (`ScreenBlockRules.slotsOf`). A slot the node holds
|
|
72
|
-
* nothing in, or no array in, has none.
|
|
73
|
-
*/
|
|
74
|
-
declare function slotChildrenIn(item: TreeItem, slot: string): SlotChild[];
|
|
75
|
-
/**
|
|
76
|
-
* WHERE a node sits in the document — the node itself, the zone key its own
|
|
77
|
-
* array is addressed by, and its index in that array. Exactly the three
|
|
78
|
-
* arguments a Puck `replace` / `remove` / `reorder` op takes.
|
|
79
|
-
*/
|
|
80
|
-
type NodeLocation = {
|
|
81
|
-
item: TreeItem;
|
|
82
|
-
zone: string;
|
|
83
|
-
index: number;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Find a node by id and say WHERE IT IS, anywhere in the document — the root
|
|
87
|
-
* list or any slot at any depth.
|
|
88
|
-
*
|
|
89
|
-
* ── WHY A PANEL NEEDS THIS ──────────────────────────────────────────────────
|
|
90
|
-
* `useEasel((s) => s)` hands a field the SELECTED node and, in `ui.itemSelector`, the
|
|
91
|
-
* zone and index of that node. A control that has to rewrite the node's PARENT
|
|
92
|
-
* — "Apply to all cards" writes the whole Collections node once, so one press is
|
|
93
|
-
* one undo step — gets only half of what it needs: the selector's zone is the
|
|
94
|
-
* compound `"<parentId>:cards"`, which names the parent but says nothing about
|
|
95
|
-
* where the PARENT itself lives. Without that, the write has nowhere to go.
|
|
96
|
-
*
|
|
97
|
-
* ⚠️ IT IS NOT `enclosingSectionProps`, AND THE DIFFERENCE IS NOT COSMETIC.
|
|
98
|
-
* That one answers "which TOP-LEVEL section is this inside", returns props, and
|
|
99
|
-
* deliberately returns `null` for the immediate parent when the parent is not a
|
|
100
|
-
* root section. This one answers "where is THIS node", returns an address, and
|
|
101
|
-
* is happy to name a node nested inside a Box inside a Box. Its own docblock
|
|
102
|
-
* asks for a third question to be a third function rather than a third shape
|
|
103
|
-
* returned by the same walker; this is that function.
|
|
104
|
-
*
|
|
105
|
-
* ⚠️ AND IT IS NOT `childSlotsOf` WITH A FILTER. That lists one node's children;
|
|
106
|
-
* this searches a whole document. It is BUILT on `childSlotsOf` so the set of
|
|
107
|
-
* slot prop names stays read in exactly one place — hard-coding `"content"`
|
|
108
|
-
* instead is how the heading audit went blind to every heading nested in a Hero
|
|
109
|
-
* slide (card 66067), and the reason is written out on `slotFieldsOf`.
|
|
110
|
-
*
|
|
111
|
-
* ⚠️ THE CHROME ALREADY ANSWERS THIS, AND THAT IS NOT A DUPLICATE OF THIS.
|
|
112
|
-
* `ScreenChrome` memoises a Map of EVERY node's address (plus each
|
|
113
|
-
* zone's whole sibling list) and hands the lookup to the context menu as
|
|
114
|
-
* `locate`. That map is built once per document for a surface that needs all of
|
|
115
|
-
* it; this finds ONE node and is reachable from a Puck field, which the map is
|
|
116
|
-
* not — it lives in a component's closure and rides no context. What must not
|
|
117
|
-
* be two things is the set of SLOT PROP NAMES, and it is not: both walk through
|
|
118
|
-
* `childSlotsOf`, so an address here and an address there cannot disagree.
|
|
119
|
-
* Puck's own `getSelectorForId` is a third reader of the same fact, and the one
|
|
120
|
-
* a live store already offers — it is a hook-bound function, so a guard cannot
|
|
121
|
-
* call it, which is the whole reason this one is written pure.
|
|
122
|
-
*
|
|
123
|
-
* PURE, and takes the config as an argument, so a guard can assert against it
|
|
124
|
-
* without a Puck store, a React tree or a hook.
|
|
125
|
-
*
|
|
126
|
-
* `null` when no node carries the id — the honest answer for a stale selection,
|
|
127
|
-
* and every caller treats it as "there is nothing to write".
|
|
128
|
-
*/
|
|
129
|
-
declare function locateNode(config: SlotConfigView, content: ReadonlyArray<TreeItem>, id: string): NodeLocation | null;
|
|
130
|
-
/**
|
|
131
|
-
* How many levels of slot children the Layers tree draws below a top-level row.
|
|
132
|
-
*
|
|
133
|
-
* The tree is a ~288px panel that already scrolls and each level costs 10px of
|
|
134
|
-
* indent (`.sf-subtree`'s `padding-left`, storefront-editor.css — it was 25px
|
|
135
|
-
* until card 66199 took the drag grip out of the flow and moved the caret to the
|
|
136
|
-
* row's right end), so the depth is capped rather than unbounded: `Grid.content`
|
|
137
|
-
* is an open slot that accepts a Grid, so a document CAN nest without limit and a
|
|
138
|
-
* tree that followed it would run out of width.
|
|
139
|
-
*
|
|
140
|
-
* ⚠️ 3 SINCE CARD 66273, and the level it buys is the one a merchant was stuck
|
|
141
|
-
* on. A hero group's blocks are the THIRD level — Hero → slide → group → blocks
|
|
142
|
-
* — and at 2 a group row was a LEAF: no `.sf-subtree` was rendered under it, so
|
|
143
|
-
* the "Add block" row that lives inside that subtree had nowhere to go, and a
|
|
144
|
-
* merchant who made a group in the tree could not put anything into it. The
|
|
145
|
-
* number was 2 because the Footer's chain (Footer → blocks → Group → blocks) was
|
|
146
|
-
* the only one that existed when the cap was named; the hero's is one level
|
|
147
|
-
* deeper.
|
|
148
|
-
*
|
|
149
|
-
* The Footer is unaffected, measured rather than hoped: `FooterGroup.blocks`
|
|
150
|
-
* allows FooterText / FooterEmailSignup / FooterMenu / FooterDivider and none of
|
|
151
|
-
* those owns a slot, so no footer row grows a third level. What DOES gain one is
|
|
152
|
-
* a container nested inside a container (a Box in a Box) —
|
|
153
|
-
* blocks a merchant can already build and could not see.
|
|
154
|
-
*/
|
|
155
|
-
declare const TREE_MAX_DEPTH = 6;
|
|
156
|
-
/**
|
|
157
|
-
* Does the Layers tree draw a subtree under a node of `type` sitting at `depth`?
|
|
158
|
-
* True only when the type owns at least one slot AND the level is inside the cap.
|
|
159
|
-
* `depth` is 1 for a section's own children (the first `.sf-subtree`).
|
|
160
|
-
*
|
|
161
|
-
* The ONE place the cap is decided — both tree renderers and the "collapse all"
|
|
162
|
-
* gather read it here, so a row that folds and a row that draws children can
|
|
163
|
-
* never disagree about which rows those are.
|
|
164
|
-
*/
|
|
165
|
-
declare function nestsInTree(config: SlotConfigView, type: string, depth: number): boolean;
|
|
166
|
-
declare const newNodeId: (type: string) => string;
|
|
167
|
-
declare const HEADER_TYPE = "Header";
|
|
168
|
-
declare const FOOTER_TYPE = "Footer";
|
|
169
|
-
declare const ROOT_ZONE = "root:default-zone";
|
|
170
|
-
/**
|
|
171
|
-
* Indices of the DUPLICATE pinned chrome sections in a top-level content array —
|
|
172
|
-
* every Header/Footer node PAST the first of its type, in ascending order. Empty
|
|
173
|
-
* when the array already holds at most one of each (the healthy case), so a caller
|
|
174
|
-
* can skip the rewrite. Keeping the FIRST of each type matches exactly what the
|
|
175
|
-
* Sections tree shows (footerIndex/findIndex), so healing never surprises the
|
|
176
|
-
* author by dropping the copy they were looking at. Accepts a loose node shape so
|
|
177
|
-
* both the editor's `TreeItem[]` and the published render's untyped content pass.
|
|
178
|
-
*/
|
|
179
|
-
declare function pinnedDuplicateIndices(content: ReadonlyArray<{
|
|
180
|
-
type?: string;
|
|
181
|
-
}>): number[];
|
|
182
|
-
/**
|
|
183
|
-
* Ids of the DUPLICATE pinned chrome sections — the id-anchored counterpart of
|
|
184
|
-
* pinnedDuplicateIndices, derived FROM it so the two can never disagree about
|
|
185
|
-
* which copy is the keeper (the first of each type).
|
|
186
|
-
*
|
|
187
|
-
* A LIVE store must be edited by identity, never by position: an index computed
|
|
188
|
-
* from a render snapshot addresses whatever has since shifted into that slot,
|
|
189
|
-
* which is how the old editor heal deleted real sections. Ids survive that skew
|
|
190
|
-
* — the worst a stale read can do is name a node that is no longer there. A
|
|
191
|
-
* duplicate carrying no id is skipped (it cannot be named in a remove); the
|
|
192
|
-
* published render's index-based dedupe still drops it.
|
|
193
|
-
*/
|
|
194
|
-
declare function pinnedDuplicateIds(content: ReadonlyArray<{
|
|
195
|
-
type?: string;
|
|
196
|
-
props?: {
|
|
197
|
-
id?: unknown;
|
|
198
|
-
};
|
|
199
|
-
}>): string[];
|
|
200
|
-
/**
|
|
201
|
-
* Which pinned chrome types a document is MISSING, and a load-time seed must
|
|
202
|
-
* therefore create. A type counts as missing only when it is absent from BOTH:
|
|
203
|
-
*
|
|
204
|
-
* - `live` — the editor's Puck store, read at the moment of the write; and
|
|
205
|
-
* - `persisted` — the document exactly as it was LOADED from the backend.
|
|
206
|
-
*
|
|
207
|
-
* Requiring both is what makes seeding idempotent, and neither check can be
|
|
208
|
-
* dropped. Trusting `live` alone was the duplicate-Header bug: a remount re-armed
|
|
209
|
-
* the seed's per-mount guard while a snapshot that lagged the store reported "no
|
|
210
|
-
* Header", so a second one was appended next to the first. Trusting `persisted`
|
|
211
|
-
* alone would re-seed a node this session has already inserted but not yet saved.
|
|
212
|
-
*
|
|
213
|
-
* Returned in no particular order — the CALLER owns the insert order, because
|
|
214
|
-
* only it knows that the Footer is pinned last and the Header first.
|
|
215
|
-
*/
|
|
216
|
-
declare function missingPinnedTypes(live: ReadonlyArray<{
|
|
217
|
-
type?: string;
|
|
218
|
-
}>, persisted: ReadonlyArray<{
|
|
219
|
-
type?: string;
|
|
220
|
-
}>): string[];
|
|
221
|
-
|
|
222
|
-
export { FOOTER_TYPE, HEADER_TYPE, type NodeLocation, ROOT_ZONE, type SlotChild, type SlotConfigView, TREE_MAX_DEPTH, type TreeItem, blockNodeActions, childSlotsOf, locateNode, missingPinnedTypes, nestsInTree, newNodeId, pinnedDuplicateIds, pinnedDuplicateIndices, slotChildrenIn, slotFieldsOf };
|
|
1
|
+
export { FOOTER_TYPE, HEADER_TYPE, NodeLocation, ROOT_ZONE, SlotChild, SlotConfigView, TREE_MAX_DEPTH, TreeItem, blockNodeActions, childSlotsOf, locateNode, missingPinnedTypes, nestsInTree, newNodeId, pinnedDuplicateIds, pinnedDuplicateIndices, slotChildrenIn, slotFieldsOf } from '../document/content-tree.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../../../chunk-
|
|
1
|
+
import"../../../chunk-PRHBWA5V.js";export{FOOTER_TYPE,HEADER_TYPE,ROOT_ZONE,TREE_MAX_DEPTH,blockNodeActions,childSlotsOf,locateNode,missingPinnedTypes,nestsInTree,newNodeId,pinnedDuplicateIds,pinnedDuplicateIndices,slotChildrenIn,slotFieldsOf}from"../../../chunk-TCAAOYQY.js";
|