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.
Files changed (233) hide show
  1. package/README.md +15 -3
  2. package/dist/{CanvasDragLayer-Cd1o0HQf.d.ts → CanvasDragLayer-CFUcBbgc.d.ts} +1 -1
  3. package/dist/{ScreenDocumentContext-CFJeqqKk.d.ts → ScreenDocumentContext-1RgtGKWR.d.ts} +4 -0
  4. package/dist/blocks/index.d.ts +5 -3
  5. package/dist/{buckets-Tj-nkBpg.d.ts → buckets-Sw94ll9I.d.ts} +1 -1
  6. package/dist/canvas/index.d.ts +8 -6
  7. package/dist/canvas/index.js +1 -1
  8. package/dist/chunk-2C7W64S5.js +8 -0
  9. package/dist/chunk-2L6KWUBC.js +1 -0
  10. package/dist/chunk-467WWV4I.js +1 -0
  11. package/dist/chunk-4FD7TAOE.js +1 -0
  12. package/dist/chunk-67HCYOW4.js +1 -0
  13. package/dist/chunk-A2VVB4RH.js +0 -0
  14. package/dist/{chunk-2GVCAIPX.js → chunk-BDSLF5BR.js} +1 -1
  15. package/dist/{chunk-U66YKDAR.js → chunk-BIK3AO2V.js} +1 -1
  16. package/dist/chunk-BTDI7JAA.js +2 -0
  17. package/dist/chunk-DDH2DYQP.js +1 -0
  18. package/dist/{chunk-HGCGIRVA.js → chunk-DNQ7AF6K.js} +1 -1
  19. package/dist/{chunk-66JNVRQM.js → chunk-GWYNMSIP.js} +1 -1
  20. package/dist/{chunk-V2ULLALL.js → chunk-I67UW5UG.js} +3 -3
  21. package/dist/{chunk-MSGZ56QL.js → chunk-KWLHKKZO.js} +1 -1
  22. package/dist/{chunk-FOHHXSOL.js → chunk-MLQKNED6.js} +1 -1
  23. package/dist/{chunk-43AEUUNQ.js → chunk-N3MJOHAG.js} +1 -1
  24. package/dist/{chunk-BVN33R76.js → chunk-N7E6264U.js} +1 -1
  25. package/dist/chunk-OHZHYROJ.js +5 -0
  26. package/dist/{chunk-YHFKWV7H.js → chunk-PFFH7ASD.js} +13 -13
  27. package/dist/chunk-PRHBWA5V.js +0 -0
  28. package/dist/chunk-SNF5764Q.js +1 -0
  29. package/dist/chunk-SSRYU3YG.js +1 -0
  30. package/dist/{chunk-R4QJ6DC5.js → chunk-SWBADIQT.js} +1 -1
  31. package/dist/{chunk-GOTN2KY4.js → chunk-TIAWIOGD.js} +1 -1
  32. package/dist/chunk-TUXLORVR.js +15 -0
  33. package/dist/{chunk-FGNR22NY.js → chunk-U5DNBT63.js} +1 -1
  34. package/dist/{chunk-EZTP6E2M.js → chunk-U7TFWHST.js} +1 -1
  35. package/dist/{chunk-2M4T27BI.js → chunk-WJJ7H42G.js} +7 -7
  36. package/dist/chunk-YIUE4US7.js +0 -0
  37. package/dist/{chunk-O7Q4DDJT.js → chunk-YM4UEGBV.js} +1 -1
  38. package/dist/chunk-YVFYWAYU.js +65 -0
  39. package/dist/{chunk-N2RISV46.js → chunk-ZOSEBPAI.js} +1 -1
  40. package/dist/copy/index.d.ts +2 -2
  41. package/dist/copy/index.js +11 -11
  42. package/dist/drag/index.d.ts +2 -2
  43. package/dist/drag/index.js +1 -1
  44. package/dist/draw/client.d.ts +1 -1
  45. package/dist/draw/client.js +1 -1
  46. package/dist/draw/index.d.ts +8 -8
  47. package/dist/draw/index.js +1 -1
  48. package/dist/easel/easel.css +3 -1
  49. package/dist/easel/index.d.ts +2 -2
  50. package/dist/easel/index.js +1 -1
  51. package/dist/fields/index.d.ts +4 -4
  52. package/dist/fields/index.js +1 -1
  53. package/dist/panel/index.d.ts +2 -2
  54. package/dist/render/index.d.ts +2 -2
  55. package/dist/render/index.js +5 -5
  56. package/dist/{repeat-Czi-6zPX.d.ts → repeat-BNgSq2Nw.d.ts} +1 -1
  57. package/dist/screen/components/AddBlockRow.d.ts +1 -1
  58. package/dist/screen/components/AddBlockRow.js +1 -1
  59. package/dist/screen/components/AddSidePanel.d.ts +2 -2
  60. package/dist/screen/components/AddSidePanel.js +1 -1
  61. package/dist/screen/components/NodeContextMenu.d.ts +13 -13
  62. package/dist/screen/components/NodeContextMenu.js +1 -1
  63. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  64. package/dist/screen/components/PreviewPartsContext.d.ts +2 -2
  65. package/dist/screen/components/PreviewPartsContext.js +1 -1
  66. package/dist/screen/components/SaveControls.d.ts +7 -7
  67. package/dist/screen/components/ScreenChrome.js +1 -1
  68. package/dist/screen/components/ScreenDocumentContext.d.ts +2 -2
  69. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  70. package/dist/screen/components/ScreenMount.d.ts +7 -7
  71. package/dist/screen/components/ScreenMount.js +1 -1
  72. package/dist/screen/components/ScreenStoreProvider.d.ts +7 -7
  73. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  74. package/dist/screen/components/SectionScreenShell.js +17 -17
  75. package/dist/screen/components/SlotChildActionsContext.d.ts +1 -1
  76. package/dist/screen/components/usePartBridge.d.ts +7 -7
  77. package/dist/screen/components/usePartBridge.js +1 -1
  78. package/dist/screen/index.d.ts +8 -8
  79. package/dist/screen/index.js +1 -1
  80. package/dist/screen/lib/admin-bridge.d.ts +1 -1
  81. package/dist/screen/lib/admin-bridge.js +1 -1
  82. package/dist/screen/lib/content/view-tiers.d.ts +1 -1
  83. package/dist/screen/lib/document/add-target-types.d.ts +55 -0
  84. package/dist/screen/lib/document/add-target-types.js +1 -0
  85. package/dist/screen/lib/document/block-choice.d.ts +64 -0
  86. package/dist/screen/lib/document/block-choice.js +1 -0
  87. package/dist/screen/lib/document/block-types-in.d.ts +39 -0
  88. package/dist/screen/lib/document/block-types-in.js +1 -0
  89. package/dist/screen/lib/document/content-tree.d.ts +222 -0
  90. package/dist/screen/lib/document/content-tree.js +1 -0
  91. package/dist/screen/lib/document/device-fields.d.ts +128 -0
  92. package/dist/screen/lib/document/device-fields.js +1 -0
  93. package/dist/screen/lib/document/field-buckets.d.ts +36 -0
  94. package/dist/screen/lib/document/field-buckets.js +1 -0
  95. package/dist/screen/lib/document/field-markers.d.ts +205 -0
  96. package/dist/screen/lib/document/field-markers.js +1 -0
  97. package/dist/screen/lib/document/hidable.d.ts +44 -0
  98. package/dist/screen/lib/document/hidable.js +1 -0
  99. package/dist/screen/lib/document/palette-sections.d.ts +103 -0
  100. package/dist/screen/lib/document/palette-sections.js +1 -0
  101. package/dist/screen/lib/document/panel-fields.d.ts +47 -0
  102. package/dist/screen/lib/document/panel-fields.js +1 -0
  103. package/dist/screen/lib/document/panel-no-control-mark.d.ts +74 -0
  104. package/dist/screen/lib/document/panel-no-control-mark.js +1 -0
  105. package/dist/screen/lib/document/part-id.d.ts +23 -0
  106. package/dist/screen/lib/document/part-id.js +1 -0
  107. package/dist/screen/lib/document/preview-click.d.ts +49 -0
  108. package/dist/screen/lib/document/preview-click.js +1 -0
  109. package/dist/screen/lib/document/preview-dom.d.ts +8 -0
  110. package/dist/screen/lib/document/preview-dom.js +1 -0
  111. package/dist/screen/lib/document/preview-events.d.ts +25 -0
  112. package/dist/screen/lib/document/preview-events.js +1 -0
  113. package/dist/screen/lib/document/preview-selection-context.d.ts +72 -0
  114. package/dist/screen/lib/document/preview-selection-context.js +1 -0
  115. package/dist/screen/lib/document/section-doc.d.ts +24 -0
  116. package/dist/screen/lib/document/section-doc.js +1 -0
  117. package/dist/screen/lib/document/slot-child-name.d.ts +225 -0
  118. package/dist/screen/lib/document/slot-child-name.js +1 -0
  119. package/dist/screen/lib/document/slot-heal.d.ts +5 -0
  120. package/dist/screen/lib/document/slot-heal.js +1 -0
  121. package/dist/screen/lib/document/slot-section-spec.d.ts +96 -0
  122. package/dist/screen/lib/document/slot-section-spec.js +1 -0
  123. package/dist/screen/lib/document/style-clipboard.d.ts +144 -0
  124. package/dist/screen/lib/document/style-clipboard.js +1 -0
  125. package/dist/screen/lib/document/text-control-kinds.d.ts +71 -0
  126. package/dist/screen/lib/document/text-control-kinds.js +1 -0
  127. package/dist/screen/lib/document/tree-reveal.d.ts +62 -0
  128. package/dist/screen/lib/document/tree-reveal.js +1 -0
  129. package/dist/screen/lib/document/use-section-ops.d.ts +110 -0
  130. package/dist/screen/lib/document/use-section-ops.js +1 -0
  131. package/dist/screen/lib/document-addressing.d.ts +2 -2
  132. package/dist/screen/lib/document-switch.d.ts +1 -1
  133. package/dist/screen/lib/host.d.ts +2 -2
  134. package/dist/screen/lib/key-scope.d.ts +1 -1
  135. package/dist/screen/lib/key-scope.js +1 -1
  136. package/dist/screen/lib/media-panel.d.ts +2 -2
  137. package/dist/screen/lib/media-picker.d.ts +2 -2
  138. package/dist/screen/lib/page-lock.d.ts +1 -1
  139. package/dist/screen/lib/puck/add-target-types.d.ts +3 -55
  140. package/dist/screen/lib/puck/add-target-types.js +1 -0
  141. package/dist/screen/lib/puck/block-choice.d.ts +1 -64
  142. package/dist/screen/lib/puck/block-choice.js +1 -1
  143. package/dist/screen/lib/puck/block-types-in.d.ts +1 -39
  144. package/dist/screen/lib/puck/block-types-in.js +1 -1
  145. package/dist/screen/lib/puck/content-tree.d.ts +1 -222
  146. package/dist/screen/lib/puck/content-tree.js +1 -1
  147. package/dist/screen/lib/puck/device-fields.d.ts +3 -127
  148. package/dist/screen/lib/puck/device-fields.js +1 -1
  149. package/dist/screen/lib/puck/field-buckets.d.ts +2 -36
  150. package/dist/screen/lib/puck/field-buckets.js +1 -1
  151. package/dist/screen/lib/puck/field-markers.d.ts +2 -205
  152. package/dist/screen/lib/puck/field-markers.js +1 -1
  153. package/dist/screen/lib/puck/hidable.d.ts +1 -44
  154. package/dist/screen/lib/puck/hidable.js +1 -1
  155. package/dist/screen/lib/puck/palette-sections.d.ts +2 -97
  156. package/dist/screen/lib/puck/palette-sections.js +1 -1
  157. package/dist/screen/lib/puck/panel-fields.d.ts +1 -47
  158. package/dist/screen/lib/puck/panel-fields.js +1 -1
  159. package/dist/screen/lib/puck/panel-no-control-mark.d.ts +2 -74
  160. package/dist/screen/lib/puck/panel-no-control-mark.js +1 -1
  161. package/dist/screen/lib/puck/part-id.d.ts +1 -23
  162. package/dist/screen/lib/puck/part-id.js +1 -1
  163. package/dist/screen/lib/puck/preview-click.d.ts +1 -49
  164. package/dist/screen/lib/puck/preview-click.js +1 -1
  165. package/dist/screen/lib/puck/preview-dom.d.ts +1 -8
  166. package/dist/screen/lib/puck/preview-dom.js +1 -1
  167. package/dist/screen/lib/puck/preview-events.d.ts +1 -25
  168. package/dist/screen/lib/puck/preview-events.js +1 -1
  169. package/dist/screen/lib/puck/preview-selection-context.d.ts +2 -72
  170. package/dist/screen/lib/puck/preview-selection-context.js +1 -1
  171. package/dist/screen/lib/puck/section-doc.d.ts +3 -18
  172. package/dist/screen/lib/puck/section-doc.js +1 -1
  173. package/dist/screen/lib/puck/slot-child-name.d.ts +1 -225
  174. package/dist/screen/lib/puck/slot-child-name.js +1 -1
  175. package/dist/screen/lib/puck/slot-heal.d.ts +2 -5
  176. package/dist/screen/lib/puck/slot-heal.js +1 -1
  177. package/dist/screen/lib/puck/slot-section-spec.d.ts +1 -96
  178. package/dist/screen/lib/puck/slot-section-spec.js +1 -0
  179. package/dist/screen/lib/puck/style-clipboard.d.ts +12 -114
  180. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  181. package/dist/screen/lib/puck/text-control-kinds.d.ts +1 -71
  182. package/dist/screen/lib/puck/text-control-kinds.js +1 -1
  183. package/dist/screen/lib/puck/tree-reveal.d.ts +1 -62
  184. package/dist/screen/lib/puck/tree-reveal.js +1 -1
  185. package/dist/screen/lib/puck/use-section-ops.d.ts +4 -105
  186. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  187. package/dist/screen/lib/screen-parts.d.ts +25 -18
  188. package/dist/screen/lib/screen-parts.js +1 -1
  189. package/dist/screen/lib/section-template-types.d.ts +1 -1
  190. package/dist/screen/lib/section-templates.d.ts +1 -1
  191. package/dist/screen/lib/section-templates.js +1 -1
  192. package/dist/screen/lib/session-context.d.ts +1 -1
  193. package/dist/screen/lib/session-context.js +1 -1
  194. package/dist/screen/lib/session.d.ts +3 -3
  195. package/dist/screen/lib/session.js +1 -1
  196. package/dist/screen/lib/shared-section-types.d.ts +1 -1
  197. package/dist/screen/lib/shared-sections.d.ts +1 -1
  198. package/dist/screen/lib/shared-sections.js +1 -1
  199. package/dist/screen/screen.css +2 -2
  200. package/dist/strings/index.d.ts +2 -2
  201. package/dist/strings/index.js +1 -1
  202. package/dist/text-styles/index.js +21 -21
  203. package/dist/tree/index.d.ts +1 -1
  204. package/dist/{types-CDX6vd6A.d.ts → types-B8NwXKlE.d.ts} +1 -1
  205. package/dist/{watch-BTYOJpQU.d.ts → watch-D8xZow3y.d.ts} +2 -2
  206. package/dist/{words-BeX5eGq7.d.ts → words-CmEnDoOe.d.ts} +1 -1
  207. package/package.json +154 -10
  208. package/dist/chunk-2E2SXDYQ.js +0 -1
  209. package/dist/chunk-4IJVV7DA.js +0 -1
  210. package/dist/chunk-7L3NKHEC.js +0 -15
  211. package/dist/chunk-APVUYICP.js +0 -65
  212. package/dist/chunk-BHRC3ASL.js +0 -1
  213. package/dist/chunk-I54UCYOU.js +0 -1
  214. package/dist/chunk-LXTM2OLQ.js +0 -2
  215. package/dist/chunk-NA3GMA43.js +0 -5
  216. package/dist/chunk-OBWDHKLI.js +0 -8
  217. package/dist/chunk-Q2A7RHG2.js +0 -1
  218. package/dist/chunk-QIDRJH3S.js +0 -1
  219. package/dist/chunk-RSCMJIWS.js +0 -1
  220. /package/dist/{chunk-MQNBD6AB.js → chunk-3QB2ZQXK.js} +0 -0
  221. /package/dist/{chunk-LER7RKTO.js → chunk-5XL2RXFU.js} +0 -0
  222. /package/dist/{chunk-6W7WLPZH.js → chunk-6UAEFOJ4.js} +0 -0
  223. /package/dist/{chunk-26OOWIJJ.js → chunk-7OCEPOEJ.js} +0 -0
  224. /package/dist/{chunk-IQ5TA7AM.js → chunk-AJ2SUSET.js} +0 -0
  225. /package/dist/{chunk-DUVRZ456.js → chunk-ANPOR6EY.js} +0 -0
  226. /package/dist/{chunk-5ZBY24K7.js → chunk-CPL43ZLJ.js} +0 -0
  227. /package/dist/{chunk-PIND6KE7.js → chunk-I6SK6ZDT.js} +0 -0
  228. /package/dist/{chunk-7F52SZOI.js → chunk-INRERJU4.js} +0 -0
  229. /package/dist/{chunk-R5L2E7JX.js → chunk-MGVI67QV.js} +0 -0
  230. /package/dist/{chunk-IYT6NN2J.js → chunk-R4AUZVA3.js} +0 -0
  231. /package/dist/{chunk-M2Z775ZC.js → chunk-RUQOIQWI.js} +0 -0
  232. /package/dist/{chunk-PLVEGYK6.js → chunk-TCAAOYQY.js} +0 -0
  233. /package/dist/{chunk-PA3PNTVV.js → chunk-VKPOH6MK.js} +0 -0
@@ -0,0 +1,103 @@
1
+ import { Config } from '../../../blocks/index.js';
2
+ import 'react';
3
+ import '../../../types-Cq53lL8d.js';
4
+ import '../../../data/index.js';
5
+ import '../../../types-41704JE4.js';
6
+ import '../../../resolve-D68pb3Bx.js';
7
+ 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/document/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/document/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 };
@@ -0,0 +1 @@
1
+ export{buildPaletteSections,categoryLabel,matchesQuery,paletteWithoutPinned,pinnedSection}from"../../../chunk-VKPOH6MK.js";
@@ -0,0 +1,47 @@
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 };
@@ -0,0 +1 @@
1
+ export{panelFieldsOf}from"../../../chunk-5XL2RXFU.js";import"../../../chunk-BPXEFVSQ.js";
@@ -0,0 +1,74 @@
1
+ import { ReactElement } from 'react';
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/document/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 };
@@ -0,0 +1 @@
1
+ export{NO_CONTROL_ATTR,NO_CONTROL_FIELD,NoControlMark,noControlField,noControlMetaOf}from"../../../chunk-INRERJU4.js";
@@ -0,0 +1,23 @@
1
+ /**
2
+ * lib/document/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/document/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 };
@@ -0,0 +1 @@
1
+ export{PART_SEP,decodePartId,encodePartId}from"../../../chunk-R4AUZVA3.js";
@@ -0,0 +1,49 @@
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/document/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 };
@@ -0,0 +1 @@
1
+ export{isPreviewClick,runAsPreviewClick}from"../../../chunk-MGVI67QV.js";
@@ -0,0 +1,8 @@
1
+ declare const previewFrame: () => HTMLIFrameElement | null;
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 };
@@ -0,0 +1 @@
1
+ export{gotoPreviewSlide,pinPreviewToBottom,pinPreviewToSection,previewFrame,scrollPreviewToSection,scrollPreviewToTop}from"../../../chunk-DDH2DYQP.js";import"../../../chunk-AJ2SUSET.js";import"../../../chunk-LF3FUSCQ.js";import"../../../chunk-MGVI67QV.js";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * lib/document/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/document/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-easel-block`); 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 };
@@ -0,0 +1 @@
1
+ export{HERO_SLIDER_GOTO_EVENT}from"../../../chunk-AJ2SUSET.js";
@@ -0,0 +1,72 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
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 };
@@ -0,0 +1 @@
1
+ export{createPreviewSelectionContext,useSelectHandler}from"../../../chunk-TIAWIOGD.js";import"../../../chunk-MGVI67QV.js";
@@ -0,0 +1,24 @@
1
+ import { Data } from '../../../blocks/index.js';
2
+ import { TreeItem } from './content-tree.js';
3
+ import 'react';
4
+ import '../../../types-Cq53lL8d.js';
5
+ import '../../../data/index.js';
6
+ import '../../../types-41704JE4.js';
7
+ import '../../../resolve-D68pb3Bx.js';
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 };
@@ -0,0 +1 @@
1
+ export{cloneNodeWithFreshIds,docToNode,nodeToDoc}from"../../../chunk-BDSLF5BR.js";import"../../../chunk-TCAAOYQY.js";