pagepilot-visual-editor 1.0.28 → 1.0.30

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 (180) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +42 -28
  3. package/dist/PagePilotEditor.d.ts +12 -9
  4. package/dist/api/ApiClientContext.d.ts +1 -0
  5. package/dist/api/PagepilotApiClient.d.ts +7 -0
  6. package/dist/assets/aiChatbotIcon.d.ts +1 -0
  7. package/dist/blocks-internal/block-container/src/index.d.ts +1 -1
  8. package/dist/blocks-internal/block-heading/src/index.d.ts +1 -1
  9. package/dist/blocks-internal/block-list/src/index.d.ts +11 -1
  10. package/dist/blocks-internal/block-mdx/src/index.d.ts +47 -0
  11. package/dist/blocks-internal/block-quill/src/index.d.ts +48 -0
  12. package/dist/editor/PagePreviewDialog.d.ts +14 -0
  13. package/dist/editor/Topbar.d.ts +3 -1
  14. package/dist/editor/pageUrls.d.ts +25 -0
  15. package/dist/editor/publish/PageLiveSuccessDialog.d.ts +9 -0
  16. package/dist/editor/publish/PagePublishDialog.d.ts +1 -0
  17. package/dist/editor/publish/PublishAccessibilityPanel.d.ts +8 -0
  18. package/dist/editor/publish/a11yLinter.d.ts +8 -0
  19. package/dist/editor/recordDirty.d.ts +16 -0
  20. package/dist/editor/renderSections.d.ts +2 -2
  21. package/dist/editor/savePipeline.d.ts +40 -0
  22. package/dist/editor/types.d.ts +35 -0
  23. package/dist/editor-sample/App/InspectorDrawer/BehaviourPanel.d.ts +22 -0
  24. package/dist/editor-sample/App/InspectorDrawer/BrandPanel/BrandColorPalette.d.ts +9 -0
  25. package/dist/editor-sample/App/InspectorDrawer/BrandPanel/BrandEmptyLink.d.ts +8 -0
  26. package/dist/editor-sample/App/InspectorDrawer/BrandPanel/BrandPanel.styled.d.ts +22 -0
  27. package/dist/editor-sample/App/InspectorDrawer/BrandPanel/BrandSection.d.ts +8 -0
  28. package/dist/editor-sample/App/InspectorDrawer/BrandPanel/EmptyText.d.ts +6 -0
  29. package/dist/editor-sample/App/InspectorDrawer/BrandPanel/FontDetailsList.d.ts +6 -0
  30. package/dist/editor-sample/App/InspectorDrawer/BrandPanel/index.d.ts +5 -0
  31. package/dist/editor-sample/App/InspectorDrawer/BrandPanel/useBrandApply.d.ts +9 -0
  32. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/ResponsiveDeviceTabs.d.ts +0 -2
  33. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/blockStyleClipboard.d.ts +2 -8
  34. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/index.d.ts +1 -4
  35. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/EmailLayoutSidebarPanel.d.ts +2 -1
  36. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/FlexColumns/ColumnSection.d.ts +2 -0
  37. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/FormsPickerSidebarPanel.d.ts +2 -1
  38. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/MdxSidebarPanel.d.ts +7 -0
  39. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/MenuPickerSidebarPanel.d.ts +22 -0
  40. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/QuillSidebarPanel.d.ts +8 -0
  41. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/TextSidebarPanel.d.ts +2 -2
  42. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/AnimationSection.d.ts +7 -5
  43. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/HoverEffectSection.d.ts +1 -1
  44. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/imageSizeUnit.d.ts +19 -0
  45. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/ColorInput/Picker.d.ts +0 -2
  46. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/VariableLinkHint.d.ts +8 -0
  47. package/dist/editor-sample/App/InspectorDrawer/EditorBehavior.d.ts +8 -2
  48. package/dist/editor-sample/App/InspectorDrawer/LayersPanelStyles.d.ts +1 -1
  49. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/AiSupportedBadge.d.ts +7 -0
  50. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/SectionsModal.d.ts +2 -10
  51. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/icons/index.d.ts +3 -5
  52. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateHelpers.d.ts +226 -0
  53. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/useDebouncedValue.d.ts +8 -0
  54. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/AiFillAllDialog.d.ts +21 -0
  55. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/AiGenerateButton.d.ts +14 -0
  56. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ScalarFieldRow.d.ts +4 -1
  57. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/VariableGroupDialog.d.ts +19 -0
  58. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/VariableGroupList.d.ts +5 -0
  59. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/aiFill.d.ts +36 -0
  60. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/styles.d.ts +14 -11
  61. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/upgradeDialog.d.ts +8 -8
  62. package/dist/editor-sample/App/InspectorDrawer/behaviourFields.d.ts +30 -0
  63. package/dist/editor-sample/App/InspectorDrawer/index.d.ts +8 -1
  64. package/dist/editor-sample/App/InspectorDrawer/publish/BackgroundPanel.d.ts +6 -0
  65. package/dist/editor-sample/App/InspectorDrawer/renderBehaviourField.d.ts +7 -0
  66. package/dist/editor-sample/App/TemplatePanel/hooks/useMainBoxStyles.d.ts +2 -1
  67. package/dist/editor-sample/App/TemplatePanel/index.d.ts +2 -1
  68. package/dist/editor-sample/App/TemplatePanel/minimap/useMiniMapSync.d.ts +2 -2
  69. package/dist/editor-sample/App/hooks/page/saveMenuHrefEdits.d.ts +1 -1
  70. package/dist/editor-sample/App/hooks/page/useSaveHandler.d.ts +1 -0
  71. package/dist/editor-sample/App/hooks/useAutosave.d.ts +8 -3
  72. package/dist/editor-sample/App/hooks/useIsTemplateEditorRoute.d.ts +1 -0
  73. package/dist/editor-sample/App/hooks/useStretch.d.ts +9 -0
  74. package/dist/editor-sample/App/shared/UploadImage.d.ts +4 -0
  75. package/dist/editor-sample/App/shared/editor.styles.d.ts +11 -1
  76. package/dist/editor-sample/documents/blocks/Container/ContainerPropsSchema.d.ts +6 -4
  77. package/dist/editor-sample/documents/blocks/FormsPicker/FormsPropsSchema.d.ts +33 -2
  78. package/dist/editor-sample/documents/blocks/List/ListEditor.d.ts +8 -0
  79. package/dist/editor-sample/documents/blocks/Marquee/MarqueePropsSchema.d.ts +4 -0
  80. package/dist/editor-sample/documents/blocks/MenuPicker/MenuPropsSchema.d.ts +6 -0
  81. package/dist/editor-sample/documents/blocks/Table/TableCellEditor.d.ts +2 -1
  82. package/dist/editor-sample/documents/blocks/Table/TableImportDialog.styles.d.ts +11 -1
  83. package/dist/editor-sample/documents/blocks/Table/parseClipboardTable.d.ts +7 -0
  84. package/dist/editor-sample/documents/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +6 -0
  85. package/dist/editor-sample/documents/blocks/Timer/TimerPropsSchema.d.ts +2 -0
  86. package/dist/editor-sample/documents/blocks/Timer/variants/CircularProgressView.d.ts +2 -1
  87. package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/blockMenuStyles.d.ts +1 -1
  88. package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/brandButtonDefaults.d.ts +1 -4
  89. package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/buttons.d.ts +0 -6
  90. package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/dialogs/LinkDialog.d.ts +4 -1
  91. package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/hooks/useToolbarCommands.d.ts +16 -4
  92. package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/styles.d.ts +2 -2
  93. package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/types.d.ts +2 -4
  94. package/dist/editor-sample/documents/blocks/helpers/block-wrappers/EditorBlockWrapper.d.ts +2 -3
  95. package/dist/editor-sample/documents/blocks/helpers/block-wrappers/TuneMenu.styles.d.ts +17 -0
  96. package/dist/editor-sample/documents/blocks/helpers/block-wrappers/saveAsTemplateUtils.d.ts +29 -1
  97. package/dist/editor-sample/documents/blocks/helpers/documentUtils.d.ts +33 -26
  98. package/dist/editor-sample/documents/blocks/helpers/variableBinding.d.ts +9 -0
  99. package/dist/editor-sample/documents/editor/EditorBlock.d.ts +2 -6
  100. package/dist/editor-sample/documents/editor/EditorContext.d.ts +77 -20
  101. package/dist/editor-sample/documents/editor/LazyEditorBlock.d.ts +1 -0
  102. package/dist/editor-sample/documents/editor/core.d.ts +492 -390
  103. package/dist/editor-sample/documents/editor/templateVariables.d.ts +151 -14
  104. package/dist/editor-sample/documents/editor/useRootFontFamily.d.ts +10 -0
  105. package/dist/editor-sample/utils/editorStorageKey.d.ts +2 -0
  106. package/dist/editor-sample/utils/localStoragePref.d.ts +2 -0
  107. package/dist/email-builder-core/blocks/Container/ContainerPropsSchema.d.ts +1 -1
  108. package/dist/email-builder-core/blocks/EmailLayout/EmailLayoutReader.d.ts +1 -1
  109. package/dist/email-builder-core/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +6 -0
  110. package/dist/email-builder-core/blocks/Timer/variants/CircularProgressView.d.ts +5 -1
  111. package/dist/email-builder-core/blocks/Timer/variants/DigitalFlipView.d.ts +4 -1
  112. package/dist/email-builder-core/blocks/Timer/variants/TextInlineView.d.ts +3 -1
  113. package/dist/email-builder-core/blocks/helpers/blockStyleHelpers.d.ts +22 -0
  114. package/dist/email-builder-core/renderers/pageScripts.d.ts +0 -1
  115. package/dist/email-builder-core/renderers/themeTokens.d.ts +5 -126
  116. package/dist/host-stubs/history.d.ts +5 -0
  117. package/dist/host-stubs/hooks/useTenantFeatureCutoff.d.ts +8 -0
  118. package/dist/host-stubs/hooks/useTenantPlan.d.ts +18 -0
  119. package/dist/host-stubs/i18nAhdDefaults.d.ts +1 -0
  120. package/dist/host-stubs/modules/auth/authCurrentTenant.d.ts +6 -0
  121. package/dist/host-stubs/modules/forms/formsService.d.ts +3 -1
  122. package/dist/host-stubs/modules/forms/useFormsList.d.ts +4 -1
  123. package/dist/host-stubs/modules/menu/menuService.d.ts +4 -0
  124. package/dist/host-stubs/modules/page/pageService.d.ts +11 -0
  125. package/dist/host-stubs/modules/settings/settingsActions.d.ts +2 -0
  126. package/dist/host-stubs/modules/settings/settingsSelectors.d.ts +4 -0
  127. package/dist/host-stubs/modules/shared/axios/authAxios.d.ts +16 -0
  128. package/dist/host-stubs/modules/shared/constants.d.ts +14 -0
  129. package/dist/host-stubs/modules/store.d.ts +4 -0
  130. package/dist/host-stubs/modules/template/templateEnumerators.d.ts +19 -0
  131. package/dist/host-stubs/modules/tour/injectTourIntoPage.d.ts +20 -0
  132. package/dist/host-stubs/style/icons.d.ts +57 -0
  133. package/dist/host-stubs/utils/dateFormats.d.ts +1 -0
  134. package/dist/host-stubs/view/branding/brandDefaultFont.d.ts +3 -1
  135. package/dist/host-stubs/view/branding/styles/BrandIcons.d.ts +9 -0
  136. package/dist/host-stubs/view/branding/styles/types.d.ts +76 -0
  137. package/dist/host-stubs/view/configurations/ConfigurationIcons.d.ts +9 -0
  138. package/dist/host-stubs/view/demo/DemoIcons.d.ts +9 -0
  139. package/dist/host-stubs/view/images/Icons.d.ts +6 -0
  140. package/dist/host-stubs/view/media/MediaGalleryDialog/types.d.ts +47 -0
  141. package/dist/host-stubs/view/media/MediaGalleryDialog/utils/fileUtils.d.ts +3 -0
  142. package/dist/host-stubs/view/media/MediaGalleryDialog/utils/mediaTypes.d.ts +9 -0
  143. package/dist/host-stubs/view/media/MediaGalleryDialog.d.ts +12 -2
  144. package/dist/host-stubs/view/media/styles/MediaIcons.d.ts +13 -0
  145. package/dist/host-stubs/view/shared/Confetti.d.ts +5 -0
  146. package/dist/host-stubs/view/shared/PagePilotLoader.d.ts +2 -0
  147. package/dist/host-stubs/view/shared/UpgradeDialog/UpgradeDialogContext.d.ts +1 -0
  148. package/dist/host-stubs/view/shared/common/CopyToClipboard.d.ts +7 -0
  149. package/dist/host-stubs/view/shared/editors/MdxEditor.d.ts +8 -0
  150. package/dist/host-stubs/view/shared/editors/QuillEditor.d.ts +3 -0
  151. package/dist/host-stubs/view/shared/editors/sanitize.d.ts +4 -0
  152. package/dist/host-stubs/view/shared/editors/types.d.ts +7 -0
  153. package/dist/host-stubs/view/shared/media/TemplatePreviewMedia.d.ts +29 -0
  154. package/dist/host-stubs/view/shared/modals/ConfigureDialog.d.ts +7 -0
  155. package/dist/host-stubs/view/shared/modals/ManageTemplateModal.d.ts +5 -0
  156. package/dist/host-stubs/view/shared/speech/index.d.ts +17 -0
  157. package/dist/host-stubs/view/shared/styles/Table.styles.d.ts +3 -0
  158. package/dist/host-stubs/view/template/form/TemplateFormModal.d.ts +10 -0
  159. package/dist/host-stubs/view/template/form/fields/types.d.ts +7 -0
  160. package/dist/{index-DcN8zC8_.js → index-B8pdGALF.js} +86258 -73803
  161. package/dist/{index-SYmY8c1I.cjs → index-C-KL2oQP.cjs} +1 -1
  162. package/dist/{index-Cp5AeqH5.js → index-CStZQ7E0.js} +1 -1
  163. package/dist/index-DVx38kGU.cjs +1553 -0
  164. package/dist/index.cjs +1 -1
  165. package/dist/index.js +1 -1
  166. package/dist/render-core/combineSections.d.ts +33 -3
  167. package/dist/render-core/dateFormats.d.ts +14 -3
  168. package/dist/render-core/stubs/pickerEmptyState.d.ts +2 -0
  169. package/dist/render-core/stubs/styleIcons.d.ts +1 -0
  170. package/dist/render.cjs +281 -219
  171. package/dist/render.js +9858 -8266
  172. package/dist/style.css +1 -1
  173. package/dist/{xlsx-vznvhtjT.cjs → xlsx-DUs4Mvqq.cjs} +1 -1
  174. package/dist/{xlsx-Bk2GErZO.js → xlsx-bYU68TCR.js} +1 -1
  175. package/package.json +1 -1
  176. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/ResponsiveEditingBanner.d.ts +0 -13
  177. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/BoxShadowControls.d.ts +0 -19
  178. package/dist/editor-sample/documents/blocks/AppBannerPicker/appBanner.styled.d.ts +0 -2
  179. package/dist/email-builder-core/blocks/boxShadowSchema.d.ts +0 -23
  180. package/dist/index-Br_dDd3Z.cjs +0 -1493
@@ -3,18 +3,15 @@ import { TEditorConfiguration } from './core';
3
3
  import { TemplateFormField, TemplateArrayRow } from './templateVariables';
4
4
  type TValue = {
5
5
  document: TEditorConfiguration;
6
+ record: any | null;
6
7
  selectedBlockId: string | null;
7
8
  selectedSidebarTab: 'block-configuration' | 'styles' | 'behaviour' | 'layout' | 'settings' | 'background' | 'page-pilot-ai' | 'layers' | 'brand' | 'seo' | 'variables' | 'research';
8
9
  selectedMainTab: 'editor' | 'preview' | 'json' | 'html';
9
10
  selectedScreenSize: 'desktop' | 'mobile' | 'tablet';
10
11
  zoomLevel: number;
11
12
  minimapVisible: boolean;
12
- /**
13
- * Which device the responsive sidebar tabs are currently authoring
14
- * for. Independent of `selectedScreenSize` (the top-toolbar preview
15
- * device) — flipping this must NOT resize the canvas.
16
- */
17
13
  sidebarEditingDevice: 'desktop' | 'mobile' | 'tablet';
14
+ hasManualScreenSizeOverride: boolean;
18
15
  inspectorDrawerOpen: boolean;
19
16
  samplesDrawerOpen: boolean;
20
17
  activeStepIndex: number;
@@ -41,6 +38,7 @@ type TValue = {
41
38
  };
42
39
  inlineEditingEnabled: boolean;
43
40
  hoveredBlockId: string | null;
41
+ highlightedVariableId: string | null;
44
42
  copiedBlock: {
45
43
  rootBlockId: string;
46
44
  blocks: Record<string, any>;
@@ -98,13 +96,26 @@ export declare function useDocumentPruned(): TEditorConfiguration;
98
96
  * whenever a component only needs one block's data.
99
97
  */
100
98
  export declare function useEditorBlock(id: string): any;
99
+ /**
100
+ * Subscribe to just the root block, for the id-not-found fallback path.
101
+ * Narrower than useDocument() — re-renders only when 'root' itself changes.
102
+ */
103
+ export declare function useRootBlock(): any;
101
104
  /**
102
105
  * Non-reactive read of the current document. Use inside event handlers / callbacks
103
106
  * when you need the latest document but do NOT want the component to re-render
104
107
  * every time any block in the document changes.
105
108
  */
106
109
  export declare function getDocument(): TValue['document'];
107
- export declare function useRootFontFamily(): string;
110
+ /**
111
+ * The page root's own font key, or null when the author never picked one.
112
+ *
113
+ * Deliberately does NOT resolve the workspace brand default here: this module
114
+ * is imported by nearly every editor component, and reaching into the redux
115
+ * store from it would create an import cycle. Callers pass the result through
116
+ * `resolveRootFontFamily` instead.
117
+ */
118
+ export declare function useRootFontFamilyKey(): string | null;
108
119
  export declare function useSelectedBlockId(): string;
109
120
  /**
110
121
  * Boolean selector — returns true only when THIS block is the selected one.
@@ -113,6 +124,8 @@ export declare function useSelectedBlockId(): string;
113
124
  */
114
125
  export declare function useIsBlockSelected(id: string): boolean;
115
126
  export declare function useSelectedScreenSize(): "desktop" | "tablet" | "mobile";
127
+ export declare const ZOOM_MIN = 25;
128
+ export declare const ZOOM_MAX = 100;
116
129
  export declare function useZoomLevel(): number;
117
130
  /**
118
131
  * View-only state — deliberately does NOT go through pushToUndoStack, so
@@ -126,7 +139,6 @@ export declare function useMinimapVisible(): boolean;
126
139
  export declare function toggleMinimapVisible(): void;
127
140
  /** Which device's properties the sidebar is currently editing (see ResponsiveDeviceTabs). */
128
141
  export declare function useSidebarEditingDevice(): "desktop" | "tablet" | "mobile";
129
- export declare function setSidebarEditingDevice(sidebarEditingDevice: TValue['sidebarEditingDevice']): void;
130
142
  export declare function useSelectedMainTab(): "html" | "editor" | "preview" | "json";
131
143
  export declare function useActiveStepIndex(): number;
132
144
  export declare function useSelectors(): string[];
@@ -141,6 +153,7 @@ export declare function usePanelMeasurements(): {
141
153
  offsetTop?: number;
142
154
  };
143
155
  export declare function useCurrentRecordType(): string;
156
+ export declare function setCurrentRecord(record: any | null): void;
144
157
  export declare function setCurrentRecordType(type: string | null): void;
145
158
  export declare function setPanelMeasurements(measurements: {
146
159
  panelWidth: number;
@@ -188,6 +201,8 @@ export declare function useHoveredBlockId(): string;
188
201
  */
189
202
  export declare function useIsBlockHovered(id: string): boolean;
190
203
  export declare function setHoveredBlockId(hoveredBlockId: string | null): void;
204
+ export declare function useHighlightedVariableId(): string;
205
+ export declare function setHighlightedVariableId(highlightedVariableId: string | null): void;
191
206
  export declare function getHoveredBlockId(): string | null;
192
207
  export declare function useCopiedBlock(): {
193
208
  rootBlockId: string;
@@ -231,23 +246,16 @@ export declare function resetDocument(document: TValue['document'], options?: {
231
246
  sideEffect?: UndoSideEffect;
232
247
  activeStepIndex?: number;
233
248
  /**
234
- * Skip the undo-stack push *and* wipe both stacks. Use when seeding the
235
- * editor from external state (host record on mount, hot reload, etc.) —
236
- * the swap isn't a user action and the previous empty doc shouldn't
237
- * become an Undo target. Without this, the Undo button is already
238
- * enabled the moment the editor mounts because pushToUndoStack records
239
- * the pre-seed empty state.
249
+ * pagepilot: skip the undo-stack push *and* wipe both stacks. Used by the
250
+ * Shell when seeding the editor from host props (not a user action), so
251
+ * the pre-seed empty doc never becomes an Undo target.
240
252
  */
241
253
  skipHistory?: boolean;
242
254
  }): void;
243
255
  /**
244
- * Wipe both history stacks without touching the document. Used by the Shell
245
- * after the initial seed has settled, to swallow any spurious pushes that
246
- * various block-level useEffects (ButtonGroup auto-seed, layout positioning
247
- * re-measure, sidebar panels echoing fetched data, etc.) emit between
248
- * "editor mounted" and "user has actually edited something". Without this
249
- * guard the Undo button is enabled on first paint and clicking it rolls
250
- * the canvas back to an empty document.
256
+ * pagepilot: wipe both history stacks without touching the document. Used by
257
+ * the Shell after the initial props-driven seed settles, to swallow spurious
258
+ * pushes from block-level effects before the user has edited anything.
251
259
  */
252
260
  export declare function clearEditorHistory(): void;
253
261
  export declare function resetDocumentKeepTab(document: TValue['document'], options?: {
@@ -263,6 +271,29 @@ export declare function resetDocumentKeepTab(document: TValue['document'], optio
263
271
  * the 200ms burst window with neighbouring words.
264
272
  */
265
273
  export declare function resetCoalesce(): void;
274
+ /**
275
+ * Run a batch of setDocument / setTemplateForms calls as a SINGLE undoable
276
+ * step. Any entries the batch pushes onto undoStack are collapsed to one
277
+ * entry whose snapshot is the pre-batch state — so a single Ctrl+Z rewinds
278
+ * the whole logical action.
279
+ *
280
+ * Motivation: the "insert a section-library template" flow calls
281
+ * 1. `setDocument(newBlocks)` — seed descendant blocks
282
+ * 2. `onInsert(rootBlock, id)` — parent's handleChildrenChange writes
283
+ * the root into its childrenIds AND calls `setSelectedBlockId` (which
284
+ * resetCoalesces)
285
+ * 3. `appendTemplateFormFields` — setDocument for root.data.formFields
286
+ *
287
+ * Step 2's `setSelectedBlockId` closes the coalesce window, so step 3 lands
288
+ * on its own undo entry. Users then need TWO Undos to remove the section,
289
+ * and after one Undo the section is still wired into the tree but its
290
+ * `{{tokens}}` render as "Add X" pills because formFields hasn't been
291
+ * restored yet.
292
+ *
293
+ * Any code path that combines several setDocument mutations into one
294
+ * user-visible action should wrap them here.
295
+ */
296
+ export declare function withSingleUndoStep(action: () => void): void;
266
297
  export declare function undo(): void;
267
298
  export declare function redo(): void;
268
299
  /**
@@ -328,6 +359,15 @@ export declare function setDocument(document: TValue['document'], options?: SetD
328
359
  export declare function toggleInspectorDrawerOpen(): void;
329
360
  export declare function toggleSamplesDrawerOpen(): void;
330
361
  export declare function setSelectedScreenSize(selectedScreenSize: TValue['selectedScreenSize']): void;
362
+ export declare function resetSelectedScreenSizeFromRecord(selectedScreenSize: TValue['selectedScreenSize']): void;
363
+ export declare function useHasManualScreenSizeOverride(): boolean;
364
+ export declare function resetManualScreenSizeOverride(): void;
365
+ /**
366
+ * Switch which device's properties the sidebar edits. Deliberately separate
367
+ * from `setSelectedScreenSize` — this must NEVER resize the canvas preview;
368
+ * only the top toolbar's device toggle does that.
369
+ */
370
+ export declare function setSidebarEditingDevice(sidebarEditingDevice: TValue['sidebarEditingDevice']): void;
331
371
  /** Reactive view of the template fields on root.data.formFields. */
332
372
  export declare function useTemplateForms(): TemplateFormField[];
333
373
  /** Non-reactive read for use inside event handlers / the save transform. */
@@ -337,8 +377,25 @@ export declare function getTemplateFormsState(): TemplateFormField[];
337
377
  * field (array field with a `sourceBlockId`). Recomputed when the document
338
378
  * changes. The canvas render path uses it to substitute a repeated container
339
379
  * copy's `{{this.subField}}` tokens with that copy's row values.
380
+ *
381
+ * Prefer `useRepeatRowForBlock(blockId)` in per-block components — this whole-
382
+ * map subscription re-renders on every document change and should only be used
383
+ * by callers that need the full map (ContainerRepeatSection, ItemsArrayRepeatSection,
384
+ * TabsBlockEditor's per-tab lookup).
340
385
  */
341
386
  export declare function useRepeatRowIndex(): Map<string, TemplateArrayRow>;
387
+ /**
388
+ * Reactive per-block row lookup — the row (if any) that `blockId` currently
389
+ * belongs to inside a container-repeat copy. Unlike `useRepeatRowIndex()`, this
390
+ * subscribes to a single Map entry: zustand's `Object.is` equality check means
391
+ * the component only re-renders when ITS OWN row reference changes (row values
392
+ * come from `formFields[i].value[j]` and keep referential identity across
393
+ * unrelated edits), not on every keystroke anywhere in the document.
394
+ *
395
+ * This is what per-block components (Text/Heading/Button/Image/Avatar/Logo/
396
+ * Rating/Progress/Breadcrumb) should call — never a whole-document selector.
397
+ */
398
+ export declare function useRepeatRowForBlock(blockId: string): TemplateArrayRow | null;
342
399
  /** Write the template-fields onto the document root (undoable, live). */
343
400
  export declare function setTemplateForms(fields: TemplateFormField[]): void;
344
401
  export declare function useElementIdError(): {
@@ -1,6 +1,7 @@
1
1
  type Props = {
2
2
  id: string;
3
3
  };
4
+ export declare const blockHeightCache: Map<string, number>;
4
5
  /**
5
6
  * Virtualized wrapper around <EditorBlock>. While the placeholder div is
6
7
  * outside the viewport (plus a 600px margin), the real EditorBlock is NOT