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
|
@@ -1,44 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* hidable — the ONE reader for the shape a hideable copy row stores.
|
|
3
|
-
*
|
|
4
|
-
* Every authored-text row in the editor is one of five controls
|
|
5
|
-
* (`lib/puck/text-control-kinds`), and two of them — `text()` and `textarea()` —
|
|
6
|
-
* carry the eye that takes an element off the page while keeping the words. Those
|
|
7
|
-
* two persist `{ text, hidden }`; the other three persist a bare string, and so
|
|
8
|
-
* does every page published before the eye existed. A prop's stored value is
|
|
9
|
-
* therefore an OBJECT OR A STRING, and which one it is depends on whether a
|
|
10
|
-
* merchant has touched that row — not on anything a reader can see in the code.
|
|
11
|
-
*
|
|
12
|
-
* ⚠️ WHY THIS IS ITS OWN FILE. `readHidable` was born in `lib/puck/controls.tsx`
|
|
13
|
-
* beside the field that writes the shape, and `controls.tsx` is React: it imports
|
|
14
|
-
* the editor shell, the markup toolbar and 30 components. So a PURE module that
|
|
15
|
-
* needs to read a stored heading could not use the one reader without dragging
|
|
16
|
-
* the whole editor in — and `lib/puck/heading-outline.ts` is exactly that module
|
|
17
|
-
* (its own header promises no React and no config import, so the audit can be
|
|
18
|
-
* walked in a test without mounting the editor). It called `String(...)` on the
|
|
19
|
-
* prop instead, and printed the literal words `[object Object]` into the outline
|
|
20
|
-
* a merchant reads. Splitting the ~6 lines out costs nothing and removes the
|
|
21
|
-
* reason anyone would ever write a second unwrapper. `controls.tsx` re-exports
|
|
22
|
-
* both names, so every existing import site is unchanged.
|
|
23
|
-
*
|
|
24
|
-
* There is exactly one definition. Do not add a second way to unwrap this value.
|
|
25
|
-
*/
|
|
26
|
-
/** A hideable row's stored value: the object, a bare string (a `plainText()` row
|
|
27
|
-
* or legacy data), or nothing at all. */
|
|
28
|
-
type HidableValue = {
|
|
29
|
-
text?: string;
|
|
30
|
-
hidden?: boolean;
|
|
31
|
-
} | string | undefined;
|
|
32
|
-
declare function readHidable(v: HidableValue): {
|
|
33
|
-
text: string;
|
|
34
|
-
hidden: boolean;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Plain-text view of a hidable field value — a `{ text, hidden }` object (a
|
|
38
|
-
* `text()`/`textarea()` row) OR a bare string (a `plainText()` row / legacy data).
|
|
39
|
-
* Funnels through here at read sites that need a string (e.g. a section's
|
|
40
|
-
* `imageLabel`, a link `href`) so a stored object can never reach a React child.
|
|
41
|
-
*/
|
|
42
|
-
declare function hidableText(v: HidableValue): string;
|
|
43
|
-
|
|
44
|
-
export { type HidableValue, hidableText, readHidable };
|
|
1
|
+
export { HidableValue, hidableText, readHidable } from '../document/hidable.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{hidableText,readHidable}from"../../../chunk-
|
|
1
|
+
export{hidableText,readHidable}from"../../../chunk-6UAEFOJ4.js";
|
|
@@ -1,103 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
export { PaletteLook, PaletteSection, buildPaletteSections, categoryLabel, matchesQuery, paletteWithoutPinned, pinnedSection } from '../document/palette-sections.js';
|
|
2
|
+
import '../../../blocks/index.js';
|
|
2
3
|
import 'react';
|
|
3
4
|
import '../../../types-Cq53lL8d.js';
|
|
4
5
|
import '../../../data/index.js';
|
|
5
6
|
import '../../../types-41704JE4.js';
|
|
6
7
|
import '../../../resolve-D68pb3Bx.js';
|
|
7
8
|
import '../../../plan-CZS902DV.js';
|
|
8
|
-
|
|
9
|
-
/** One offerable section, with the category it is grouped under. */
|
|
10
|
-
type PaletteSection = {
|
|
11
|
-
type: string;
|
|
12
|
-
cat: string;
|
|
13
|
-
name: string;
|
|
14
|
-
desc: string;
|
|
15
|
-
/**
|
|
16
|
-
* The heading of the category this section sits under, resolved once at build
|
|
17
|
-
* time — SEARCHED, and already SHOWN as the nav row this card sits beneath.
|
|
18
|
-
*
|
|
19
|
-
* ⚠️ IT IS HERE BECAUSE THE NAV AND THE SEARCH DISAGREED. Seven of the
|
|
20
|
-
* thirteen category names returned NOTHING when typed: "Blog & journal" reads
|
|
21
|
-
* 5 in the nav, and "blog" found 0, because not one of Issue Header, Featured
|
|
22
|
-
* Cover, Article Text, Recurring Columns or Latest Posts carries the word. Same
|
|
23
|
-
* for shop, about, promotions, navigation, legal and layout. A merchant reads
|
|
24
|
-
* the word off the screen, types it, and is told no section matches.
|
|
25
|
-
*
|
|
26
|
-
* Resolved HERE, not in `matchesQuery`, because the label needs the `config`
|
|
27
|
-
* (`categoryLabel`) and the matcher is given only a section — passing config
|
|
28
|
-
* into the matcher would make every caller carry it.
|
|
29
|
-
*/
|
|
30
|
-
catLabel: string;
|
|
31
|
-
/**
|
|
32
|
-
* Another word this section is known by, searched but never shown.
|
|
33
|
-
*
|
|
34
|
-
* ⚠️ THIS EXISTS FOR ONE NODE AND ONE REASON. `Flex` is offered here as
|
|
35
|
-
* "Blank section" and is called "Box" everywhere it is nested — so a merchant
|
|
36
|
-
* who met it in a Layers row, or in last week's handoff, types "box" and must
|
|
37
|
-
* still find it. Without this they would find NOTHING: the card is pinned out
|
|
38
|
-
* of its group, so a search that misses it misses it completely.
|
|
39
|
-
*/
|
|
40
|
-
alias?: string;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* What the layer says of its sections for the palette: the word for a type at
|
|
44
|
-
* a level, a group's short heading where it has one, and the blurbs. The
|
|
45
|
-
* screen's `blockLook` is one (lib/screen-parts); so is the website's own
|
|
46
|
-
* (lib/puck/add-palette).
|
|
47
|
-
*/
|
|
48
|
-
interface PaletteLook {
|
|
49
|
-
/** What a node of `type` is called at a level, given the label the config
|
|
50
|
-
* holds for it. */
|
|
51
|
-
labelAtLevel: (type: string, level: "section" | "block", base: string) => string;
|
|
52
|
-
/** A group's short heading, by its key, where the layer has one; undefined,
|
|
53
|
-
* and the config's own title is the heading. */
|
|
54
|
-
categoryLabel: (id: string) => string | undefined;
|
|
55
|
-
/** The one-line blurb for a section, by type. */
|
|
56
|
-
descriptions: Record<string, string>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Flatten `config.categories` into an ordered section list.
|
|
60
|
-
*
|
|
61
|
-
* Grouping and order ARE the category order in the config — which is the
|
|
62
|
-
* catalog's order — so this adds no opinion of its own. A component listed in a
|
|
63
|
-
* category but absent from `components` is skipped: a stale catalog row cannot
|
|
64
|
-
* render and certainly cannot insert, so offering it would be a card that fails
|
|
65
|
-
* on click.
|
|
66
|
-
*
|
|
67
|
-
* Child-only blocks (HeroSlide / CollectionCard / ProductRef) and the four
|
|
68
|
-
* generic primitives (Heading / Text / ImageBlock / ButtonBlock) sit in NO
|
|
69
|
-
* category on purpose, so they never appear here — they are added from their
|
|
70
|
-
* parent's slot instead. See the note above `categories:` in lib/puck/config.tsx.
|
|
71
|
-
*
|
|
72
|
-
* A category the config marks `visible: false` is NOT offered (0.105.0, seam
|
|
73
|
-
* E9): it is a registry's way of keeping blocks it has out of the picker — the
|
|
74
|
-
* campaign designer's Product parts, its retired blocks, its Sections — and a
|
|
75
|
-
* palette that listed them would offer things that may not be put on a page.
|
|
76
|
-
* Puck's own palette read the flag the same way. No website category carries
|
|
77
|
-
* it, so the website's palette is the list it was.
|
|
78
|
-
*/
|
|
79
|
-
declare function buildPaletteSections(config: Config, look: PaletteLook): PaletteSection[];
|
|
80
|
-
/** A category's display label — the layer's short one where there is one, else the config's title. */
|
|
81
|
-
declare function categoryLabel(config: Config, id: string, shortLabel: (id: string) => string | undefined): string;
|
|
82
|
-
/**
|
|
83
|
-
* Does a section match a search query?
|
|
84
|
-
*
|
|
85
|
-
* The query is matched against the NAME, any ALIAS, the blurb, the component
|
|
86
|
-
* TYPE and the CATEGORY HEADING — the type because a merchant who knows the
|
|
87
|
-
* section by the word they saw in a handoff should still find it, the alias
|
|
88
|
-
* because one node is called something else everywhere it is nested (see
|
|
89
|
-
* `PaletteSection.alias`), and the category because it is PRINTED IN THE NAV
|
|
90
|
-
* BESIDE THE RESULTS: seven of thirteen headings used to match nothing at all
|
|
91
|
-
* (see `PaletteSection.catLabel`). A word a merchant can read off this screen
|
|
92
|
-
* must find what it is labelling.
|
|
93
|
-
*
|
|
94
|
-
* `q` is expected already lower-cased and trimmed; an empty query matches
|
|
95
|
-
* everything.
|
|
96
|
-
*/
|
|
97
|
-
declare function matchesQuery(s: PaletteSection, q: string): boolean;
|
|
98
|
-
/** The pinned section, or `null` if the layer pins none or the config does not offer it. */
|
|
99
|
-
declare function pinnedSection(sections: PaletteSection[], pinned: string | null): PaletteSection | null;
|
|
100
|
-
/** Every OTHER section — what the grouped grid below the pinned card draws. */
|
|
101
|
-
declare function paletteWithoutPinned(sections: PaletteSection[], pinned: string | null): PaletteSection[];
|
|
102
|
-
|
|
103
|
-
export { type PaletteLook, type PaletteSection, buildPaletteSections, categoryLabel, matchesQuery, paletteWithoutPinned, pinnedSection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{buildPaletteSections,categoryLabel,matchesQuery,paletteWithoutPinned,pinnedSection}from"../../../chunk-
|
|
1
|
+
export{buildPaletteSections,categoryLabel,matchesQuery,paletteWithoutPinned,pinnedSection}from"../../../chunk-VKPOH6MK.js";
|
|
@@ -1,47 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* THE ROWS A PANEL IS REALLY DRAWING — not the ones its component declares.
|
|
3
|
-
*
|
|
4
|
-
* `config.components[type].fields` is a DECLARATION. A component's
|
|
5
|
-
* `resolveFields` then culls it for the state that node is in: the Booking Form
|
|
6
|
-
* gives its head rows away to the boxes that own them, Spec Table drops its Rows
|
|
7
|
-
* array on a linked product, Image & Text Columns takes its text-position row
|
|
8
|
-
* away once it has Boxes.
|
|
9
|
-
*
|
|
10
|
-
* `Puck.Fields` honours all of that. Every list built beside it from the raw
|
|
11
|
-
* declaration does not — and one of them is the copy list in
|
|
12
|
-
* `components/SectionEditor`. So a merchant met the SAME heading twice: once in
|
|
13
|
-
* the panel Puck drew, and once in a list drawn from rows the resolver had
|
|
14
|
-
* already dropped (owner, 2026-09-10, on a Booking Form's Head box).
|
|
15
|
-
*
|
|
16
|
-
* ⚠️ PUCK DOES NOT EXPOSE ITS RESOLVED SET. The store slice that holds it is
|
|
17
|
-
* internal — `useEasel((s) => s)` and `createUsePuck()` both hand back `PuckApi`, which
|
|
18
|
-
* has no `fields` on it (checked against 0.20.2's own types, not remembered). So
|
|
19
|
-
* the resolver is asked here, the same way Puck asks it.
|
|
20
|
-
*
|
|
21
|
-
* ⚠️ AND AN ASYNC RESOLVER IS ANSWERED WITH THE DECLARATION. A promise cannot be
|
|
22
|
-
* read during a render, and a list that waited would flicker rows in and out.
|
|
23
|
-
* Falling back is the same answer this code gave before, so an async resolver is
|
|
24
|
-
* no worse off than it was — it simply is not helped either. Stated because a
|
|
25
|
-
* silent half-fix is the thing worth naming.
|
|
26
|
-
*/
|
|
27
|
-
type PanelFieldMap = Record<string, unknown>;
|
|
28
|
-
interface PanelComponent {
|
|
29
|
-
fields?: PanelFieldMap;
|
|
30
|
-
resolveFields?: (data: unknown, params: Record<string, unknown>) => unknown;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The field map to build a panel-side list from, for one node.
|
|
34
|
-
*
|
|
35
|
-
* `parent` is passed as null and `appState` as an empty object because the ONE
|
|
36
|
-
* caller uses the result for authored-copy rows, which no resolver decides from
|
|
37
|
-
* either. A caller that needs the width rows — which DO read `parent` — must ask
|
|
38
|
-
* Puck rather than this.
|
|
39
|
-
*/
|
|
40
|
-
declare function panelFieldsOf(config: {
|
|
41
|
-
components?: Record<string, PanelComponent>;
|
|
42
|
-
}, node: {
|
|
43
|
-
type: string;
|
|
44
|
-
props: Record<string, unknown>;
|
|
45
|
-
} | null | undefined): PanelFieldMap | null;
|
|
46
|
-
|
|
47
|
-
export { type PanelFieldMap, panelFieldsOf };
|
|
1
|
+
export { PanelFieldMap, panelFieldsOf } from '../document/panel-fields.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{panelFieldsOf}from"../../../chunk-
|
|
1
|
+
export{panelFieldsOf}from"../../../chunk-5XL2RXFU.js";import"../../../chunk-BPXEFVSQ.js";
|
|
@@ -1,74 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* panel-no-control-mark — what a settings field draws when it draws NO CONTROL
|
|
5
|
-
* on the screen it is on (card 66178).
|
|
6
|
-
*
|
|
7
|
-
* WHY A FIELD HAS TO SAY THIS OUT LOUD. Puck lays the inspector out as a FLAT
|
|
8
|
-
* list and owns the wrapper around every top-level field, and its own stylesheet
|
|
9
|
-
* rules the gap between two of them:
|
|
10
|
-
*
|
|
11
|
-
* ._PuckFields--wrapFields_ ._PuckFields-field_ + ._PuckFields-field_ {
|
|
12
|
-
* border-top: 1px solid var(--puck-color-grey-09); margin-top: 8px; }
|
|
13
|
-
*
|
|
14
|
-
* That rule is right — a line between two adjacent rows. But a field whose
|
|
15
|
-
* `render` returns `null` still gets the wrapper, still takes its `16px 16px
|
|
16
|
-
* 12px` of padding and still draws the line, so the panel shows a hairline with
|
|
17
|
-
* nothing on one side of it. Measured on the Collections Content tab before this
|
|
18
|
-
* card: two 29px-tall wrappers whose whole content was
|
|
19
|
-
* `<div class="_InputWrapper_"></div>`, and three rules stacked with only blank
|
|
20
|
-
* space between them. Across the catalogue it was 338 such rows in 74 panels.
|
|
21
|
-
*
|
|
22
|
-
* We cannot stop Puck emitting the wrapper, so the wrapper is collapsed from the
|
|
23
|
-
* outside: the field renders this zero-size marker and ONE declarative rule in
|
|
24
|
-
* `components/storefront-editor.css` takes the wrapper out of the layout
|
|
25
|
-
* entirely — `display: none`, so the row leaves the accessibility tree with it
|
|
26
|
-
* rather than lingering as an unlabelled blank. That is exactly the shape the
|
|
27
|
-
* bucket boundary markers (`data-sf-bucket`) and the device-gated fields
|
|
28
|
-
* (`data-sf-device-hidden`) already use, and it is declarative for the same
|
|
29
|
-
* reason: it cannot race the tab pass.
|
|
30
|
-
*
|
|
31
|
-
* IT IS NOT A WAY TO HIDE A SETTING. A field that draws nothing here must still
|
|
32
|
-
* be reachable somewhere — as an entry row in the section screen's TEXT group,
|
|
33
|
-
* or through another control on the same panel. `scripts/test-panel-no-empty-rows.tsx`
|
|
34
|
-
* §2 fails a field that draws no control and has no way back to it, which is how
|
|
35
|
-
* the lost "Anchor name" box was found.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/** The attribute the marker carries — the single source, read by the stylesheet
|
|
39
|
-
* rule and by the guard that proves the rule is there. */
|
|
40
|
-
declare const NO_CONTROL_ATTR = "data-sf-no-control";
|
|
41
|
-
/** The marker itself. `hidden` as well as the CSS rule, so a field that renders
|
|
42
|
-
* it in a context the editor stylesheet has not reached (a test harness, a
|
|
43
|
-
* bundled preview) still draws nothing rather than an empty inline box. */
|
|
44
|
-
declare function NoControlMark(): ReactElement;
|
|
45
|
-
/**
|
|
46
|
-
* …AND THE SAME FACT SAID ON THE FIELD OBJECT (card 66201).
|
|
47
|
-
*
|
|
48
|
-
* The attribute above is drawn, so only a render can see it. The pass that drops
|
|
49
|
-
* a heading standing over nothing runs in `resolveFields`, where there is no DOM
|
|
50
|
-
* and no React — it has a field list and nothing else. So a field that draws no
|
|
51
|
-
* control has to say so twice, in the two places the answer is asked, and both
|
|
52
|
-
* are stamped by the ONE `if` that decides it: see `textField` in
|
|
53
|
-
* `lib/puck/controls`, which wraps the render and stamps the marker together.
|
|
54
|
-
*
|
|
55
|
-
* The two reasons are not the same shape, hence a word rather than a boolean:
|
|
56
|
-
* • `"always"` — it draws nothing wherever it appears. A device scope note, a
|
|
57
|
-
* key whose one control is a row elsewhere on the same panel.
|
|
58
|
-
* • `"authored-copy"` — a scalar copy box card 8819 moved to the DRILL screen.
|
|
59
|
-
* It draws nothing on the section screen unless its prop is STRUCTURAL, which
|
|
60
|
-
* is the one question `SuppressibleText` also asks at render time.
|
|
61
|
-
*/
|
|
62
|
-
declare const NO_CONTROL_FIELD: "__noControl";
|
|
63
|
-
/** The payload on {@link NO_CONTROL_FIELD}. */
|
|
64
|
-
type NoControlFieldMeta = "always" | "authored-copy";
|
|
65
|
-
/** Read a field's no-control payload, or `null` when it draws a control of its
|
|
66
|
-
* own. The ONE place that knows the marker's shape. */
|
|
67
|
-
declare function noControlMetaOf(field: unknown): NoControlFieldMeta | null;
|
|
68
|
-
/** Stamp {@link NO_CONTROL_FIELD} on a field. The cast is here and nowhere else:
|
|
69
|
-
* Puck's field types have no slot for a marker, so an object literal carrying
|
|
70
|
-
* one trips the excess-property check at every call site otherwise — the same
|
|
71
|
-
* reason `group()` and the text/link markers have their own builders. */
|
|
72
|
-
declare function noControlField<F>(field: F, reason: NoControlFieldMeta): F;
|
|
73
|
-
|
|
74
|
-
export { NO_CONTROL_ATTR, NO_CONTROL_FIELD, type NoControlFieldMeta, NoControlMark, noControlField, noControlMetaOf };
|
|
1
|
+
export { NO_CONTROL_ATTR, NO_CONTROL_FIELD, NoControlFieldMeta, NoControlMark, noControlField, noControlMetaOf } from '../document/panel-no-control-mark.js';
|
|
2
|
+
import 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{NO_CONTROL_ATTR,NO_CONTROL_FIELD,NoControlMark,noControlField,noControlMetaOf}from"../../../chunk-
|
|
1
|
+
export{NO_CONTROL_ATTR,NO_CONTROL_FIELD,NoControlMark,noControlField,noControlMetaOf}from"../../../chunk-INRERJU4.js";
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* lib/puck/part-id.ts — how one PART of a section is named: `"<nodeId>::<propKey>"`.
|
|
3
|
-
*
|
|
4
|
-
* A part is one authored text of a node (a heading, a button label) that the
|
|
5
|
-
* editor's inspector can drill into. Its id is read on both sides of the
|
|
6
|
-
* preview: the section's render marks each part with it, and the screen's part
|
|
7
|
-
* bridge (components/usePartBridge) opens the part it names. The codec moved
|
|
8
|
-
* here from lib/puck/text-parts (which re-exports it) so the screen reads it
|
|
9
|
-
* without the text walk, and moves into efficient-easel with it (doc/adr/0004).
|
|
10
|
-
*/
|
|
11
|
-
/** Separates the node id from the prop key inside a part id. A doubled colon:
|
|
12
|
-
* a Puck node id is `<Type>-<uuid>` and a compound zone is `<parentId>:<slot>`,
|
|
13
|
-
* so a single colon is already taken. */
|
|
14
|
-
declare const PART_SEP = "::";
|
|
15
|
-
/** `"<nodeId>::<propKey>"`, or `"<nodeId>::"` for "the whole section". */
|
|
16
|
-
declare function encodePartId(nodeId: string, propKey: string | null): string;
|
|
17
|
-
/** Inverse of {@link encodePartId}. `propKey: null` means the whole section. */
|
|
18
|
-
declare function decodePartId(partId: string): {
|
|
19
|
-
nodeId: string;
|
|
20
|
-
propKey: string | null;
|
|
21
|
-
} | null;
|
|
22
|
-
|
|
23
|
-
export { PART_SEP, decodePartId, encodePartId };
|
|
1
|
+
export { PART_SEP, decodePartId, encodePartId } from '../document/part-id.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{PART_SEP,decodePartId,encodePartId}from"../../../chunk-
|
|
1
|
+
export{PART_SEP,decodePartId,encodePartId}from"../../../chunk-R4AUZVA3.js";
|
|
@@ -1,49 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* "Did this come from a click INSIDE the preview?" — the one fact that decides
|
|
3
|
-
* whether the editor is allowed to scroll its canvas.
|
|
4
|
-
*
|
|
5
|
-
* Every in-preview selection bridge (a section's text PARTS, and a Hero's
|
|
6
|
-
* ticker / Background / Text) shares ONE handler with the matching row in the
|
|
7
|
-
* Layers tree. The handler ends in `scrollPreviewToSection`, and only one of its
|
|
8
|
-
* two callers should travel:
|
|
9
|
-
*
|
|
10
|
-
* · from the LAYERS TREE — scroll. A row in a list can name a section that is
|
|
11
|
-
* off-screen, and taking the merchant there is the whole point of clicking it.
|
|
12
|
-
* · from a CLICK IN THE PREVIEW — do not. The merchant is already looking at
|
|
13
|
-
* the thing they clicked, so moving the canvas under them is motion they did
|
|
14
|
-
* not ask for (card 66392: "after clicking, the screen moves; cancel this
|
|
15
|
-
* sliding motion" — measured at 409px of travel in the phone preview).
|
|
16
|
-
*
|
|
17
|
-
* The two callers are told apart HERE rather than at each of the eight call
|
|
18
|
-
* sites, because the difference is one rule and a rule spelled eight times is a
|
|
19
|
-
* rule that drifts. `useSelectHandler` (lib/puck/preview-selection-context) is
|
|
20
|
-
* the single entry point every in-preview click already goes through — it is
|
|
21
|
-
* invoked from inside the portaled preview iframe — so wrapping it once covers
|
|
22
|
-
* both editor shells and all four bridges, and the tree keeps calling the same
|
|
23
|
-
* handlers directly and unchanged.
|
|
24
|
-
*
|
|
25
|
-
* ⚠️ AMBIENT, AND DELIBERATELY SO. Threading a "did this come from the preview"
|
|
26
|
-
* argument through the bridges would mean editing every handler and every one of
|
|
27
|
-
* its callers — exactly the call-site patching that left the last fix half-done.
|
|
28
|
-
* The cost is that the fact lives in a module variable, so two things are load-
|
|
29
|
-
* bearing: the flag is only ever read SYNCHRONOUSLY (see `scrollPreviewToSection`,
|
|
30
|
-
* which must not defer the check into its `requestAnimationFrame`), and it is
|
|
31
|
-
* restored in a `finally` so a throwing handler cannot leave the canvas
|
|
32
|
-
* permanently unable to scroll. Both are pinned by
|
|
33
|
-
* `scripts/test-preview-click-does-not-scroll.tsx`.
|
|
34
|
-
*
|
|
35
|
-
* No imports on purpose: `preview-dom` reads this and `preview-selection-context`
|
|
36
|
-
* writes it, and the latter is reached from inside the preview iframe — putting
|
|
37
|
-
* the flag in `preview-dom` would close a cycle back through HeroSection.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* Run `handler` as work caused by a click INSIDE the preview, so anything it
|
|
41
|
-
* reaches knows not to move the canvas. Returns whatever `handler` returns; the
|
|
42
|
-
* fact is restored even if it throws.
|
|
43
|
-
*/
|
|
44
|
-
declare function runAsPreviewClick<T>(handler: () => T): T;
|
|
45
|
-
/** True while a `runAsPreviewClick` handler is on the stack. Read it
|
|
46
|
-
* SYNCHRONOUSLY — deferred work runs after the click has already returned. */
|
|
47
|
-
declare function isPreviewClick(): boolean;
|
|
48
|
-
|
|
49
|
-
export { isPreviewClick, runAsPreviewClick };
|
|
1
|
+
export { isPreviewClick, runAsPreviewClick } from '../document/preview-click.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{isPreviewClick,runAsPreviewClick}from"../../../chunk-
|
|
1
|
+
export{isPreviewClick,runAsPreviewClick}from"../../../chunk-MGVI67QV.js";
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
declare function scrollPreviewToSection(id: string): void;
|
|
3
|
-
declare function gotoPreviewSlide(heroId: string, index: number): void;
|
|
4
|
-
declare function scrollPreviewToTop(): void;
|
|
5
|
-
declare function pinPreviewToSection(id: string): () => void;
|
|
6
|
-
declare function pinPreviewToBottom(onPinned?: () => void): () => void;
|
|
7
|
-
|
|
8
|
-
export { gotoPreviewSlide, pinPreviewToBottom, pinPreviewToSection, previewFrame, scrollPreviewToSection, scrollPreviewToTop };
|
|
1
|
+
export { gotoPreviewSlide, pinPreviewToBottom, pinPreviewToSection, previewFrame, scrollPreviewToSection, scrollPreviewToTop } from '../document/preview-dom.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{gotoPreviewSlide,pinPreviewToBottom,pinPreviewToSection,previewFrame,scrollPreviewToSection,scrollPreviewToTop}from"../../../chunk-
|
|
1
|
+
export{gotoPreviewSlide,pinPreviewToBottom,pinPreviewToSection,previewFrame,scrollPreviewToSection,scrollPreviewToTop}from"../../../chunk-DDH2DYQP.js";import"../../../chunk-AJ2SUSET.js";import"../../../chunk-LF3FUSCQ.js";import"../../../chunk-MGVI67QV.js";
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* lib/puck/preview-events.ts — events the editor's screen sends INTO the preview.
|
|
3
|
-
*
|
|
4
|
-
* Moved from components/HeroSection (which re-exports them) so the screen's
|
|
5
|
-
* preview bridge (lib/puck/preview-dom) can send them without importing a
|
|
6
|
-
* section, and moves into efficient-easel with the screen (doc/adr/0004). A
|
|
7
|
-
* section listens for its own; the name is the contract between the two.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Event the editor chrome dispatches INTO the preview iframe to jump a Hero's
|
|
11
|
-
* slider to a slide by index. The chrome (section tree + "Add slide") lives
|
|
12
|
-
* outside this iframe and can't reach the slider's React state, and Puck's
|
|
13
|
-
* selection overlay is portaled to the iframe `<body>` (not inside `.hero-track`),
|
|
14
|
-
* so selection alone can't be observed from here — this is the explicit bridge.
|
|
15
|
-
* See {@link ScreenChrome} `selectChild` / `addChild`.
|
|
16
|
-
*/
|
|
17
|
-
declare const HERO_SLIDER_GOTO_EVENT = "hero-slider:goto";
|
|
18
|
-
interface HeroSliderGotoDetail {
|
|
19
|
-
/** Target Hero's stable Puck id (`data-puck-component`); omit to hit all Heroes. */
|
|
20
|
-
id?: string;
|
|
21
|
-
/** Zero-based slide index to show. */
|
|
22
|
-
index: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { HERO_SLIDER_GOTO_EVENT, type HeroSliderGotoDetail };
|
|
1
|
+
export { HERO_SLIDER_GOTO_EVENT, HeroSliderGotoDetail } from '../document/preview-events.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{HERO_SLIDER_GOTO_EVENT}from"../../../chunk-
|
|
1
|
+
export{HERO_SLIDER_GOTO_EVENT}from"../../../chunk-AJ2SUSET.js";
|
|
@@ -1,72 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Shared machinery for the editor preview's "selection bridges" — the click-to-
|
|
6
|
-
* select plumbing every piece of site CHROME needs because it is NOT a Puck node
|
|
7
|
-
* and so can't route through Puck's own selection. The header, the chat bubble,
|
|
8
|
-
* and a Hero's ticker / background / text overlay each expose the SAME two-way
|
|
9
|
-
* bridge, and all built it by hand until this file:
|
|
10
|
-
*
|
|
11
|
-
* - `select(…)` / `setSelectHandler(fn)` — a ref-backed handler the chrome
|
|
12
|
-
* registers (it opens the matching inspector panel), invoked from inside the
|
|
13
|
-
* portaled preview iframe when the element is clicked. It lives behind a ref so
|
|
14
|
-
* the chrome can re-register without re-rendering the preview; `select` itself
|
|
15
|
-
* stays stable. See {@link useSelectHandler}.
|
|
16
|
-
* - a mirrored SELECTION the preview reads to draw its own "selected" outline.
|
|
17
|
-
*
|
|
18
|
-
* Two entry points reuse the bridge:
|
|
19
|
-
* - {@link useSelectHandler} — just the ref-backed `select` / `setSelectHandler`
|
|
20
|
-
* pair, for the header + chat bridges. They keep a plain boolean `selected` and
|
|
21
|
-
* layer their own live-config state around it, so they compose this hook rather
|
|
22
|
-
* than the whole context factory.
|
|
23
|
-
* - {@link createPreviewSelectionContext} — a whole context + provider + hook for
|
|
24
|
-
* an ID-SCOPED bridge (a Hero's ticker / background / text), where the mirrored
|
|
25
|
-
* selection is "which sibling id is selected" (`selected<Thing>Id`), scoped by
|
|
26
|
-
* id so sibling heroes never cross-select. The three such contexts differ ONLY
|
|
27
|
-
* in that field's name, so they are each one call to this factory.
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* The ref-backed `select` / `setSelectHandler` pair shared by every selection
|
|
31
|
-
* bridge. `Args` is the click payload the chrome's handler receives — `[]` for a
|
|
32
|
-
* lone toggle (header / chat) or `[id: string]` for an id-scoped bridge (ticker /
|
|
33
|
-
* hero media / hero text). `select` is stable across renders; registering a new
|
|
34
|
-
* handler never re-renders the portaled preview.
|
|
35
|
-
*/
|
|
36
|
-
declare function useSelectHandler<Args extends unknown[]>(): {
|
|
37
|
-
select: (...args: Args) => void;
|
|
38
|
-
setSelectHandler: (fn: (...args: Args) => void) => void;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* The context value of an id-scoped selection bridge, keyed by the id field's
|
|
42
|
-
* name `Key` (e.g. `"selectedHeroId"`): the mirrored id + its `set…` setter, plus
|
|
43
|
-
* the shared `select(id)` / `setSelectHandler` pair. Keeping the field name in the
|
|
44
|
-
* type is what lets one factory reproduce each context's exact public API.
|
|
45
|
-
*/
|
|
46
|
-
type PreviewIdSelection<Key extends string> = {
|
|
47
|
-
[P in Key]: string | null;
|
|
48
|
-
} & {
|
|
49
|
-
[P in Key as `set${Capitalize<P>}`]: (id: string | null) => void;
|
|
50
|
-
} & {
|
|
51
|
-
select: (id: string) => void;
|
|
52
|
-
setSelectHandler: (fn: (id: string) => void) => void;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Build a complete id-scoped selection-bridge context — the shared body of
|
|
56
|
-
* PreviewTickerContext / PreviewHeroMediaContext / PreviewHeroTextContext, which
|
|
57
|
-
* differ only in the id field's NAME. Pass that field name and the returned
|
|
58
|
-
* `Provider` + `useSelection` expose exactly `{ [idKey], set<IdKey>, select,
|
|
59
|
-
* setSelectHandler }`, so each context's existing consumers read unchanged.
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* export const { Provider: PreviewTickerProvider, useSelection: usePreviewTicker } =
|
|
63
|
-
* createPreviewSelectionContext("selectedHeroId");
|
|
64
|
-
*/
|
|
65
|
-
declare function createPreviewSelectionContext<Key extends string>(idKey: Key): {
|
|
66
|
-
Provider: ({ children }: {
|
|
67
|
-
children: ReactNode;
|
|
68
|
-
}) => react.JSX.Element;
|
|
69
|
-
useSelection: () => PreviewIdSelection<Key>;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export { type PreviewIdSelection, createPreviewSelectionContext, useSelectHandler };
|
|
1
|
+
export { PreviewIdSelection, createPreviewSelectionContext, useSelectHandler } from '../document/preview-selection-context.js';
|
|
2
|
+
import 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{createPreviewSelectionContext,useSelectHandler}from"../../../chunk-
|
|
1
|
+
export{createPreviewSelectionContext,useSelectHandler}from"../../../chunk-TIAWIOGD.js";import"../../../chunk-MGVI67QV.js";
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
export { cloneNodeWithFreshIds, docToNode, nodeToDoc } from '../document/section-doc.js';
|
|
2
|
+
import '../../../blocks/index.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '../../../types-Cq53lL8d.js';
|
|
5
5
|
import '../../../data/index.js';
|
|
6
6
|
import '../../../types-41704JE4.js';
|
|
7
7
|
import '../../../resolve-D68pb3Bx.js';
|
|
8
8
|
import '../../../plan-CZS902DV.js';
|
|
9
|
-
|
|
10
|
-
declare function nodeToDoc(node: TreeItem): Data;
|
|
11
|
-
declare function docToNode(data: Data): TreeItem | null;
|
|
12
|
-
/**
|
|
13
|
-
* Deep-copy a stored section node with FRESH ids — the node's own and every
|
|
14
|
-
* inline slot child's, recursively — so inserting the same template twice never
|
|
15
|
-
* lands two nodes with colliding ids (Puck keys selection/replace on id, and
|
|
16
|
-
* React keys render on it).
|
|
17
|
-
*
|
|
18
|
-
* `strip` (0.106.0) sees each copied node once its children are copied, and
|
|
19
|
-
* answers it as the copy should hold it — the layer's `blockRules.stripCopy`,
|
|
20
|
-
* which takes out what only an original may hold. It keeps the fresh id.
|
|
21
|
-
*/
|
|
22
|
-
declare function cloneNodeWithFreshIds(node: TreeItem, strip?: (node: TreeItem) => TreeItem): TreeItem;
|
|
23
|
-
|
|
24
|
-
export { cloneNodeWithFreshIds, docToNode, nodeToDoc };
|
|
9
|
+
import '../document/content-tree.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{cloneNodeWithFreshIds,docToNode,nodeToDoc}from"../../../chunk-
|
|
1
|
+
export{cloneNodeWithFreshIds,docToNode,nodeToDoc}from"../../../chunk-BDSLF5BR.js";import"../../../chunk-TCAAOYQY.js";
|