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
|
@@ -1,128 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
export { DEVICE_FIELD_MARKER, DEVICE_HIDDEN_ATTR, DEVICE_NOTE, DeviceFieldMeta, DeviceTier, deviceField, deviceMetaOf, deviceNote, shownTier, withoutDeviceGate } from '../document/device-fields.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../../components/PreviewDeviceContext.js';
|
|
3
4
|
import '../content/view-tiers.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* lib/puck/device-fields.tsx — show the setting for the device the merchant is
|
|
7
|
-
* currently looking at, and only that one.
|
|
8
|
-
*
|
|
9
|
-
* THE PROBLEM. A section that can be sized differently on a phone stores TWO
|
|
10
|
-
* props and the panel drew BOTH, side by side, told apart only by a "(desktop)"
|
|
11
|
-
* / "(mobile)" suffix on the label. The canvas already knows which device is on
|
|
12
|
-
* screen; the panel ignored it, so the merchant read labels to find the control
|
|
13
|
-
* that matched what they were looking at.
|
|
14
|
-
*
|
|
15
|
-
* THE MECHANISM, and why this one. A Puck `resolveFields` cannot do it: in this
|
|
16
|
-
* Puck version the fields slice re-resolves only when the selected node's DATA
|
|
17
|
-
* changes (`useRegisterFieldsSlice` subscribes to `state.indexes.nodes[id]`), and
|
|
18
|
-
* switching device changes no data — the panel would keep whatever field set the
|
|
19
|
-
* last edit produced. So the decision is made where it can re-render freely: in
|
|
20
|
-
* the FIELD ITSELF, off the React context the editor chrome already publishes
|
|
21
|
-
* (`components/PreviewDeviceContext`, which the per-view Footer controls read
|
|
22
|
-
* for the same reason). One context, no prop threaded anywhere, and every house
|
|
23
|
-
* control is already a `type: "custom"` render, so wrapping one costs nothing.
|
|
24
|
-
*
|
|
25
|
-
* ⚠️ HIDDEN IS NOT DELETED. {@link deviceField} returns the SAME field object
|
|
26
|
-
* with the same markers (`__media`, `__text`, …) and the same key; only its
|
|
27
|
-
* paint is gated. Both props keep existing, keep their keys, keep their values
|
|
28
|
-
* and keep their `defaultProps`. Switch to Phone, type a size, switch back — the
|
|
29
|
-
* desktop size is exactly where it was, because nothing ever wrote to it.
|
|
30
|
-
* `scripts/test-device-fields.tsx` pins that round trip.
|
|
31
|
-
*
|
|
32
|
-
* TABLET (owner ruling, card 66066). There are no tablet-specific stored values
|
|
33
|
-
* today, and inventing them would mean a new stored prop on every section — a
|
|
34
|
-
* different card. So tablet shows the DESKTOP values and the panel SAYS SO
|
|
35
|
-
* ({@link DEVICE_NOTE}); it never presents desktop values as if they were
|
|
36
|
-
* tablet's. {@link shownTier} is the single place that ruling is written down.
|
|
37
|
-
*
|
|
38
|
-
* WHY THE HIDDEN FIELD LEAVES NO GAP. Puck wraps every top-level field in its
|
|
39
|
-
* own padded `_PuckFields-field_` box before it calls `render`, so a field that
|
|
40
|
-
* renders nothing would still cost ~37px of empty panel. The gate instead paints
|
|
41
|
-
* a zero-size marker and this package's `screen.css` collapses the
|
|
42
|
-
* wrapper that contains one — the same "reach the wrapper Puck owns" trick the
|
|
43
|
-
* fold reflow in `controls.tsx` already relies on, expressed as one CSS rule
|
|
44
|
-
* instead of a second DOM pass (so it cannot race the fold's).
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
/** The two tiers a stored value can belong to. Tablet is not one — see
|
|
48
|
-
* {@link shownTier}. */
|
|
49
|
-
type DeviceTier = "desktop" | "mobile";
|
|
50
|
-
/**
|
|
51
|
-
* Which tier's stored values the panel shows for a given preview device.
|
|
52
|
-
*
|
|
53
|
-
* The owner ruling in one expression: phone shows the phone values, everything
|
|
54
|
-
* else — desktop AND tablet — shows the desktop values.
|
|
55
|
-
*/
|
|
56
|
-
declare function shownTier(device: PreviewDevice): DeviceTier;
|
|
57
|
-
/**
|
|
58
|
-
* The quiet line the panel puts above a section's settings, so a merchant can
|
|
59
|
-
* always tell WHICH device's value they are editing without reading the canvas.
|
|
60
|
-
*
|
|
61
|
-
* Desktop says nothing: it is the resting state, and a banner that is always
|
|
62
|
-
* there is a banner nobody reads. Tablet says the ruling out loud rather than
|
|
63
|
-
* letting the desktop values pass for tablet's own.
|
|
64
|
-
*/
|
|
65
|
-
declare const DEVICE_NOTE: Readonly<Record<PreviewDevice, string | null>>;
|
|
66
|
-
/** The attribute the stylesheet looks for to collapse a gated-off field's Puck
|
|
67
|
-
* wrapper. Declared here, matched once in this package's `screen.css`, which
|
|
68
|
-
* every host that mounts the screen loads (it sat in the website's sheet until
|
|
69
|
-
* 0.103.0, so a second host's hidden rows kept their space). */
|
|
70
|
-
declare const DEVICE_HIDDEN_ATTR = "data-sf-device-hidden";
|
|
71
|
-
/** A house control's render, seen from outside: the builders in `controls.tsx`
|
|
72
|
-
* each type their own props, so the gate takes the widest shape that can be
|
|
73
|
-
* passed straight back through. */
|
|
74
|
-
type FieldRender = (props: Record<string, unknown>) => ReactElement;
|
|
75
|
-
/** Any house control — every one of them is a `type: "custom"` field whose
|
|
76
|
-
* `render` is a plain function of its props. */
|
|
77
|
-
type AnyCustomField = {
|
|
78
|
-
type: "custom";
|
|
79
|
-
render: FieldRender;
|
|
80
|
-
};
|
|
81
|
-
/** Marker carried by every gated field, in the same style as
|
|
82
|
-
* {@link import("./controls").FOLD_FIELD_MARKER}: the tier and the field it
|
|
83
|
-
* wraps live ON the field object, never only inside the render closure. Without
|
|
84
|
-
* it a gated control is opaque to every static walk — and the fold guard in
|
|
85
|
-
* `scripts/test-section-groups.ts` genuinely needs to see the header underneath
|
|
86
|
-
* to check its label against what it draws. Puck ignores extra keys. */
|
|
87
|
-
declare const DEVICE_FIELD_MARKER: "__device";
|
|
88
|
-
/** The payload on {@link DEVICE_FIELD_MARKER}. */
|
|
89
|
-
type DeviceFieldMeta = {
|
|
90
|
-
tier: DeviceTier;
|
|
91
|
-
inner: unknown;
|
|
92
|
-
};
|
|
93
|
-
/** Read a field's device payload, or null when it is not gated. The ONE place
|
|
94
|
-
* that knows the marker's shape. */
|
|
95
|
-
declare function deviceMetaOf(field: unknown): DeviceFieldMeta | null;
|
|
96
|
-
/** The field a gate wraps, or the field itself when it wraps nothing — what a
|
|
97
|
-
* static walk wants to look at. */
|
|
98
|
-
declare function withoutDeviceGate(field: unknown): unknown;
|
|
99
|
-
/**
|
|
100
|
-
* Paint `field` only while the canvas is showing `tier`.
|
|
101
|
-
*
|
|
102
|
-
* Everything else about the field is preserved by identity-spread — its `type`,
|
|
103
|
-
* its manifest markers, its data keys — so the media and neutralization walks,
|
|
104
|
-
* the field-key census and every stored prop see exactly what they saw before.
|
|
105
|
-
*/
|
|
106
|
-
declare function deviceField<F extends {
|
|
107
|
-
type: "custom";
|
|
108
|
-
render: (p: never) => ReactElement;
|
|
109
|
-
}>(tier: DeviceTier, field: F): F;
|
|
110
|
-
/**
|
|
111
|
-
* The panel's device indicator — one quiet line, and only when there is
|
|
112
|
-
* something to say (see {@link DEVICE_NOTE}).
|
|
113
|
-
*
|
|
114
|
-
* Declared as a FIELD rather than painted by the chrome so it sits inside the
|
|
115
|
-
* settings panel it describes, above the first group, and so a section that has
|
|
116
|
-
* no device-varying control never shows it. It edits nothing: like `group()` /
|
|
117
|
-
* `section()` it is a header, with no prop behind it.
|
|
118
|
-
*
|
|
119
|
-
* …WHICH IS WHY IT SAYS SO ON THE FIELD (card 66201). A note is not a control, so
|
|
120
|
-
* a heading with nothing but this under it is a heading over nothing — and it is
|
|
121
|
-
* the whole reason the Hero's Content tab was empty: `_dDevice` is the section's
|
|
122
|
-
* first field, so it opened the implicit leading Content run and gave the panel a
|
|
123
|
-
* Content tab with only a banner in it, while the hero's actual copy is edited in
|
|
124
|
-
* the Text sub-panel.
|
|
125
|
-
*/
|
|
126
|
-
declare function deviceNote(): AnyCustomField;
|
|
127
|
-
|
|
128
|
-
export { DEVICE_FIELD_MARKER, DEVICE_HIDDEN_ATTR, DEVICE_NOTE, type DeviceFieldMeta, type DeviceTier, deviceField, deviceMetaOf, deviceNote, shownTier, withoutDeviceGate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DEVICE_FIELD_MARKER,DEVICE_HIDDEN_ATTR,DEVICE_NOTE,deviceField,deviceMetaOf,deviceNote,shownTier,withoutDeviceGate}from"../../../chunk-
|
|
1
|
+
export{DEVICE_FIELD_MARKER,DEVICE_HIDDEN_ATTR,DEVICE_NOTE,deviceField,deviceMetaOf,deviceNote,shownTier,withoutDeviceGate}from"../../../chunk-KWLHKKZO.js";import"../../../chunk-INRERJU4.js";import"../../../chunk-EB6NI2VK.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-BSPCSC45.js";
|
|
@@ -1,36 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* lib/puck/field-buckets.ts — the two settings buckets a section's fields are
|
|
5
|
-
* sorted into (Design, Animation: owner 2026-10-08, final 2026-10-10), the
|
|
6
|
-
* field key each bucket's header is emitted under, and the field key of each
|
|
7
|
-
* Design group's heading.
|
|
8
|
-
*
|
|
9
|
-
* Moved out of lib/puck/field-groups (which re-exports both) so the editor's
|
|
10
|
-
* screen can read a header's key — the style clipboard copies a look by the
|
|
11
|
-
* groups it sits in — without importing the field builders that sort a
|
|
12
|
-
* section's fields (doc/adr/0004). The reasoning behind the buckets themselves
|
|
13
|
-
* stays in field-groups, beside the pass that applies them.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
type Bucket = SettingsBucket;
|
|
17
|
-
/**
|
|
18
|
-
* The field key each bucket's header is emitted under. `_s*` because these are
|
|
19
|
-
* level-1 headers (`section()`), matching the `_s*` convention the sections that
|
|
20
|
-
* already carry level-1 headers use (`_sText`, `_sImage`, `_sSetup`, …).
|
|
21
|
-
*/
|
|
22
|
-
declare const BUCKET_KEY: Record<Bucket, string>;
|
|
23
|
-
/**
|
|
24
|
-
* The field key of each Design group's heading, inside the Design bucket. The
|
|
25
|
-
* HOST emits them, in `DESIGN_GROUPS` order, one for each group it has; a row
|
|
26
|
-
* belongs to the heading above it. `_dContent` is a marker that draws no
|
|
27
|
-
* heading (the Content part has none), and the rows before the first group
|
|
28
|
-
* heading of Design are Content too. `_d*` for Design's own headings, apart
|
|
29
|
-
* from the `_s*` bucket headers and the `_g*` group headers a section draws.
|
|
30
|
-
* Only these six keys are group headings: `_dDevice` (the device note,
|
|
31
|
-
* ./device-fields) shares the prefix and is not one, so never read a group off
|
|
32
|
-
* the prefix.
|
|
33
|
-
*/
|
|
34
|
-
declare const DESIGN_GROUP_KEY: Record<DesignGroup, string>;
|
|
35
|
-
|
|
36
|
-
export { BUCKET_KEY, type Bucket, DESIGN_GROUP_KEY };
|
|
1
|
+
export { BUCKET_KEY, Bucket, DESIGN_GROUP_KEY } from '../document/field-buckets.js';
|
|
2
|
+
import '../../../buckets-Sw94ll9I.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BUCKET_KEY,DESIGN_GROUP_KEY}from"../../../chunk-
|
|
1
|
+
export{BUCKET_KEY,DESIGN_GROUP_KEY}from"../../../chunk-3QB2ZQXK.js";
|
|
@@ -1,205 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* field-markers — what a field DECLARES about itself, readable without the
|
|
5
|
-
* inspector.
|
|
6
|
-
*
|
|
7
|
-
* A control factory in `lib/puck/controls` stamps a marker on the field object
|
|
8
|
-
* it returns: this prop holds authored copy, this one a link, this row array
|
|
9
|
-
* draws these scaffold rows while it is empty. Two kinds of code read those
|
|
10
|
-
* stamps. The inspector does, and so does the RENDER side — the part walk that
|
|
11
|
-
* makes a headline clickable (`lib/puck/text-parts`), the typing bridge
|
|
12
|
-
* (`lib/puck/part-text`, `lib/puck/part-rows`) — and a section's own option
|
|
13
|
-
* module may be typed by a control's vocabulary (`lib/sections/ticker-scroll`
|
|
14
|
-
* names the pad cell each direction sits in).
|
|
15
|
-
*
|
|
16
|
-
* ⚠️ WHY THIS IS ITS OWN FILE. The markers were born in `controls.tsx` beside
|
|
17
|
-
* the factories that stamp them, and `controls.tsx` is the inspector: React, the
|
|
18
|
-
* editor shell, the link picker, the form picker, and through them the API
|
|
19
|
-
* client and the cart. A render-side module that only wanted the string
|
|
20
|
-
* `"__text"` imported all of it, which is what kept a general section from being
|
|
21
|
-
* drawn anywhere the inspector cannot go (doc/adr/0002). The same split, for the
|
|
22
|
-
* same reason, that `lib/puck/hidable` and `lib/puck/text-control-kinds` already
|
|
23
|
-
* made.
|
|
24
|
-
*
|
|
25
|
-
* This file imports nothing but that kinds leaf. `controls.tsx` re-exports
|
|
26
|
-
* every name, so an inspector-side import site is unchanged; a render-side
|
|
27
|
-
* module imports from HERE. `scripts/test-general-sections-import-boundary.ts`
|
|
28
|
-
* fails when one goes back to `controls`.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/** Marker carried by every AUTHORED-TEXT field object, mirroring
|
|
32
|
-
* {@link MEDIA_FIELD_MARKER} below. The neutralization manifest
|
|
33
|
-
* GENERATOR (`scripts/gen-neutralization-manifest.ts`) walks the built config
|
|
34
|
-
* looking for it, so the text factories are the single source of truth for
|
|
35
|
-
* "this prop holds customer-authored copy" — a new text field is covered the
|
|
36
|
-
* moment it is declared, with no list to maintain anywhere (Puck ignores extra
|
|
37
|
-
* keys).
|
|
38
|
-
*
|
|
39
|
-
* Unlike the media marker this carries a PAYLOAD, because the neutralizer needs
|
|
40
|
-
* more than a boolean: the declared `placeholder` IS the neutral replacement
|
|
41
|
-
* copy (the greyed hint the designer already wrote for an empty field), and
|
|
42
|
-
* `control` says which value shape the prop stores — `text`/`textarea` persist
|
|
43
|
-
* `{ text, hidden }` once edited, the `plain*` variants stay bare strings, and
|
|
44
|
-
* `textList` stores `{ text }[]`. A neutralizer that assumed "string" would
|
|
45
|
-
* silently skip most EDITED copy. */
|
|
46
|
-
declare const TEXT_FIELD_MARKER: "__text";
|
|
47
|
-
/** Marker carried by every LINK-DESTINATION field. A destination is not authored
|
|
48
|
-
* prose — it is a tenant-specific target (an internal path, an absolute URL, a
|
|
49
|
-
* `mailto:`/`tel:`, or an in-page `#anchor`) — so it neutralizes by its own rule
|
|
50
|
-
* rather than to placeholder copy. Kept separate from {@link TEXT_FIELD_MARKER}
|
|
51
|
-
* so the two can never be conflated. */
|
|
52
|
-
declare const LINK_FIELD_MARKER: "__link";
|
|
53
|
-
/**
|
|
54
|
-
* Marker carrying the rows a ROW-ARRAY field draws in the editor preview while
|
|
55
|
-
* its stored value is still empty — the `phRows` scaffold, declared on the field
|
|
56
|
-
* instead of only at the render call.
|
|
57
|
-
*
|
|
58
|
-
* WHY IT HAS TO BE ON THE FIELD. A scalar text control already declares its own
|
|
59
|
-
* greyed hint (`placeholder` above), and everything that asks "what does this
|
|
60
|
-
* prop put on screen?" — the neutralizer, the part walk — reads it there. A row
|
|
61
|
-
* array had no equivalent: `config.tsx` passes the scaffold constant straight
|
|
62
|
-
* into `phRows(value, SCAFFOLD, puck)` inside the render, where nothing outside
|
|
63
|
-
* the component can see it. So a freshly-dropped section drew three grey rows of
|
|
64
|
-
* scaffold copy that `lib/puck/text-parts` could not name, and clicking that copy
|
|
65
|
-
* opened the whole section instead of the one control behind it (card 66072).
|
|
66
|
-
*
|
|
67
|
-
* It is the SAME constant the render passes — `withScaffold` (in
|
|
68
|
-
* `lib/puck/controls`) takes it as an argument rather than copying it — so the
|
|
69
|
-
* preview and the walk cannot drift. Puck ignores extra keys on a field, exactly
|
|
70
|
-
* as it does for the two markers above.
|
|
71
|
-
*/
|
|
72
|
-
declare const SCAFFOLD_FIELD_MARKER: "__scaffold";
|
|
73
|
-
/**
|
|
74
|
-
* How the SECTION consuming a `textList` draws each row — and therefore whether
|
|
75
|
-
* the list may offer a formatting bar at all.
|
|
76
|
-
*
|
|
77
|
-
* This is the `COPY_FIELD_TOOLS` rule (`lib/markup.ts`) applied one level up. Upstream, the
|
|
78
|
-
* button set is derived from the grammar so a tool whose output the parser cannot
|
|
79
|
-
* read back can never appear. Here the same question is asked of the CONSUMER: a
|
|
80
|
-
* `"markup"` list is one whose rows go through `renderGold`, so every mark the
|
|
81
|
-
* grammar writes is drawn; a `"verbatim"` list is printed as-is (an Integrations
|
|
82
|
-
* chip, a ContactRouting meta line, a Mockup kanban card), where `**bold**` would
|
|
83
|
-
* reach the shopper as four literal asterisks. A mark stored where nothing renders
|
|
84
|
-
* it is a bug, not a feature — so a verbatim list gets no bar.
|
|
85
|
-
*
|
|
86
|
-
* DELIBERATELY REQUIRED, with no default. The two facts — what a field offers and
|
|
87
|
-
* what its section renders — sit in different files, and a default would let them
|
|
88
|
-
* agree by luck: whichever way it pointed, the next `textList` would inherit an
|
|
89
|
-
* answer nobody checked. Stating it at the call site puts the question in front of
|
|
90
|
-
* whoever adds the field, next to the render that answers it.
|
|
91
|
-
*/
|
|
92
|
-
type TextListRendering =
|
|
93
|
-
/** Rows render through `renderGold` — the shared grammar parses them back. */
|
|
94
|
-
"markup"
|
|
95
|
-
/** Rows are printed exactly as stored; a delimiter would reach the shopper. */
|
|
96
|
-
| "verbatim";
|
|
97
|
-
/** The payload on {@link TEXT_FIELD_MARKER}: what a text field says about the
|
|
98
|
-
* copy it holds. The `with…` wrappers that set its optional facts, and the
|
|
99
|
-
* readers that pair with them, are in `lib/puck/controls`. */
|
|
100
|
-
type TextFieldMeta = {
|
|
101
|
-
control: TextControlKind;
|
|
102
|
-
/** The control's inspector label — a classification signal when a field
|
|
103
|
-
* declares no placeholder (labels read "Heading …", "Body …", "Alt text"). */
|
|
104
|
-
label: string;
|
|
105
|
-
/** The declared greyed hint. PRIMARY source of the neutral replacement copy. */
|
|
106
|
-
placeholder?: string;
|
|
107
|
-
/** The one-line caption UNDER the box, where the field carries one. Recorded
|
|
108
|
-
* here for the same reason the two above are: it is merchant-facing copy, so
|
|
109
|
-
* the walks that ask "what words does this panel show?" — the neutralizer,
|
|
110
|
-
* `test-accent-syntax-taught`, `test-panel-plain-words` — must be able to see
|
|
111
|
-
* it without rendering. It is NOT a neutralization source: a hint explains
|
|
112
|
-
* the control and belongs to the product, not to the tenant's content. */
|
|
113
|
-
hint?: string;
|
|
114
|
-
/**
|
|
115
|
-
* DECLARED: these words never reach a shopper (card 66280). Set only by
|
|
116
|
-
* `withOffPage`, and only on a prop whose copy no render puts on the
|
|
117
|
-
* storefront — a join key, a tab reference, a tree label. The section screen's
|
|
118
|
-
* entry row then says so instead of previewing the value.
|
|
119
|
-
*
|
|
120
|
-
* ABSENT MEANS ON THE PAGE, and that default is the point. It cannot be
|
|
121
|
-
* derived: the walk that builds the entry rows reads fields, and only a
|
|
122
|
-
* component's RENDER knows whether a prop reaches a shopper. The costs of
|
|
123
|
-
* being wrong are not symmetric either — a field wrongly marked hides a
|
|
124
|
-
* merchant's own words behind a note, while a field wrongly left unmarked
|
|
125
|
-
* merely previews its stored value, which is true. So the default takes the
|
|
126
|
-
* harmless side and the exception is typed.
|
|
127
|
-
*/
|
|
128
|
-
offPage?: true;
|
|
129
|
-
/**
|
|
130
|
-
* DECLARED: this row NAMES the thing rather than saying anything to a shopper
|
|
131
|
-
* — a slide's own name, a box's name in the Layers tree, a card's display
|
|
132
|
-
* override. The Text entry list draws these in a folded group of their own, so
|
|
133
|
-
* a panel opens on the words a merchant is writing and not on the labels the
|
|
134
|
-
* editor needs (owner 2026-09-04, pointing at a Hero Slide's `Slide name` and
|
|
135
|
-
* `Category tag`: "every panel carries this, I think it is wrong").
|
|
136
|
-
*
|
|
137
|
-
* ⚠️ IT IS NOT {@link offPage}, AND THE TWO ARE INDEPENDENT. `offPage` answers
|
|
138
|
-
* "do the words reach a shopper"; this answers "is the row a name or is it
|
|
139
|
-
* copy". Three of the four fields that carry this ARE on the page — a slide
|
|
140
|
-
* name is printed in the reel rail — so deriving one from the other would have
|
|
141
|
-
* folded away a merchant's published copy. `Box name` is the only one that is
|
|
142
|
-
* both, and it is the coincidence that makes the pair look derivable.
|
|
143
|
-
*
|
|
144
|
-
* FOLDED, NOT DROPPED, and that is the whole design. The entry list is the
|
|
145
|
-
* ONLY way back into a part with no clickable words on the canvas
|
|
146
|
-
* (`components/SectionTextEntries.tsx`), and an EMPTY field never has any: an
|
|
147
|
-
* unset `Alt name` draws the category's name, not its own, so a row that
|
|
148
|
-
* vanished once hidden would stand the merchant up with no way to set one.
|
|
149
|
-
* A fold keeps every row reachable in one press and still answers the owner.
|
|
150
|
-
*/
|
|
151
|
-
identifier?: true;
|
|
152
|
-
/** For `textList`, the key each row stores its copy under. */
|
|
153
|
-
itemKey?: string;
|
|
154
|
-
/** For `textList`, whether its rows go through `renderGold` — the same answer
|
|
155
|
-
* {@link TextListRendering} makes the call site state, recorded here so a
|
|
156
|
-
* ROW opened on its own (card 66090) offers the formatting bar exactly when
|
|
157
|
-
* the whole list does. Without it the row control would have to guess, and a
|
|
158
|
-
* bar on a `verbatim` list writes markers the shopper reads as asterisks. */
|
|
159
|
-
rendering?: TextListRendering;
|
|
160
|
-
};
|
|
161
|
-
/** Which of an edge pad's four live squares an answer sits in — the cell a
|
|
162
|
-
* direction option names beside its value (`lib/sections/ticker-scroll`), and
|
|
163
|
-
* the one the pad in `lib/puck/controls` lights. */
|
|
164
|
-
type EdgeCell = "top" | "right" | "bottom" | "left";
|
|
165
|
-
/** Marker carried by every media field object. The manifest GENERATOR walks the
|
|
166
|
-
* built config looking for it, so the factory below is the single source of
|
|
167
|
-
* truth for "this prop holds media" — a new media field is covered the moment
|
|
168
|
-
* it is declared, with no list to maintain anywhere (Puck ignores extra keys). */
|
|
169
|
-
declare const MEDIA_FIELD_MARKER: "__media";
|
|
170
|
-
/** Marker carried by every heading {@link group} / {@link section} builds — and
|
|
171
|
-
* by every bucket header {@link bucketHeader} builds, whose "heading" a
|
|
172
|
-
* merchant reads as a TAB. Same style as {@link TEXT_FIELD_MARKER} / {@link LINK_FIELD_MARKER}:
|
|
173
|
-
* the label and the level ON the field object, not only inside the render
|
|
174
|
-
* closure. Without it a header's label is unreadable at runtime — the closure
|
|
175
|
-
* is all there is — and the four-bucket pass (`lib/puck/field-groups.ts`) would
|
|
176
|
-
* have to re-derive it by parsing `config.tsx`, i.e. a second source of truth
|
|
177
|
-
* for something the field already knows. Puck ignores extra keys, and the
|
|
178
|
-
* neutralization walk classifies by its own markers / `type` / prop name, so a
|
|
179
|
-
* header stays exactly as invisible to it as it was (see
|
|
180
|
-
* `scripts/gen-neutralization-manifest.ts`). */
|
|
181
|
-
declare const FOLD_FIELD_MARKER: "__fold";
|
|
182
|
-
type FoldFieldMeta = {
|
|
183
|
-
label: string;
|
|
184
|
-
level: 1 | 2;
|
|
185
|
-
};
|
|
186
|
-
/** Read a field's fold-header payload, or null when it is not a header. The ONE
|
|
187
|
-
* place that knows the marker's shape. */
|
|
188
|
-
declare function foldMetaOf(field: unknown): FoldFieldMeta | null;
|
|
189
|
-
/**
|
|
190
|
-
* Does this field DECLARE itself a name rather than copy? The read that pairs
|
|
191
|
-
* with {@link withIdentifier}'s write, so the one fact has one reader — the same
|
|
192
|
-
* shape as {@link textFieldOffPage}, and false for anything that is not a text
|
|
193
|
-
* field at all rather than throwing.
|
|
194
|
-
*/
|
|
195
|
-
declare function textFieldIdentifier(field: unknown): boolean;
|
|
196
|
-
/**
|
|
197
|
-
* The keys `anchorFields()` (lib/puck/controls) declares: the anchor's group
|
|
198
|
-
* header and its name row. The style clipboard leaves them out of a copied
|
|
199
|
-
* look — an anchor is the section's address, not its style — and reads them
|
|
200
|
-
* here rather than calling the builder, so it needs nothing of the inspector's
|
|
201
|
-
* field builders. scripts/test-anchor-field-keys.ts holds the two equal.
|
|
202
|
-
*/
|
|
203
|
-
declare const ANCHOR_FIELD_KEYS: readonly ["_gAnchor", "anchor"];
|
|
204
|
-
|
|
205
|
-
export { ANCHOR_FIELD_KEYS, type EdgeCell, FOLD_FIELD_MARKER, type FoldFieldMeta, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, type TextFieldMeta, type TextListRendering, foldMetaOf, textFieldIdentifier };
|
|
1
|
+
export { ANCHOR_FIELD_KEYS, EdgeCell, FOLD_FIELD_MARKER, FoldFieldMeta, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, TextFieldMeta, TextListRendering, foldMetaOf, textFieldIdentifier } from '../document/field-markers.js';
|
|
2
|
+
import '../document/text-control-kinds.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../../../chunk-
|
|
1
|
+
export{ANCHOR_FIELD_KEYS,FOLD_FIELD_MARKER,LINK_FIELD_MARKER,MEDIA_FIELD_MARKER,SCAFFOLD_FIELD_MARKER,TEXT_FIELD_MARKER,foldMetaOf,textFieldIdentifier}from"../../../chunk-ANPOR6EY.js";
|
|
@@ -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";
|