pagepilot-visual-editor 1.0.29 → 1.0.33
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/CHANGELOG.md +116 -0
- package/README.md +42 -28
- package/dist/PagePilotEditor.d.ts +12 -9
- package/dist/api/ApiClientContext.d.ts +1 -0
- package/dist/api/PagepilotApiClient.d.ts +7 -0
- package/dist/assets/aiChatbotIcon.d.ts +1 -0
- package/dist/blocks-internal/block-button/src/index.d.ts +6 -0
- package/dist/blocks-internal/block-container/src/index.d.ts +1 -1
- package/dist/blocks-internal/block-heading/src/index.d.ts +2 -2
- package/dist/blocks-internal/block-list/src/index.d.ts +12 -2
- package/dist/blocks-internal/block-mdx/src/index.d.ts +47 -0
- package/dist/blocks-internal/block-quill/src/index.d.ts +48 -0
- package/dist/editor/PagePreviewDialog.d.ts +14 -0
- package/dist/editor/Topbar.d.ts +3 -1
- package/dist/editor/pageUrls.d.ts +25 -0
- package/dist/editor/publish/PageLiveSuccessDialog.d.ts +9 -0
- package/dist/editor/publish/PagePublishDialog.d.ts +1 -0
- package/dist/editor/publish/PublishAccessibilityPanel.d.ts +8 -0
- package/dist/editor/publish/a11yLinter.d.ts +8 -0
- package/dist/editor/recordDirty.d.ts +16 -0
- package/dist/editor/renderSections.d.ts +2 -2
- package/dist/editor/savePipeline.d.ts +40 -0
- package/dist/editor/types.d.ts +35 -0
- package/dist/editor-sample/App/InspectorDrawer/BehaviourPanel.d.ts +22 -0
- package/dist/editor-sample/App/InspectorDrawer/BrandPanel/BrandColorPalette.d.ts +9 -0
- package/dist/editor-sample/App/InspectorDrawer/BrandPanel/BrandEmptyLink.d.ts +8 -0
- package/dist/editor-sample/App/InspectorDrawer/BrandPanel/BrandPanel.styled.d.ts +22 -0
- package/dist/editor-sample/App/InspectorDrawer/BrandPanel/BrandSection.d.ts +8 -0
- package/dist/editor-sample/App/InspectorDrawer/BrandPanel/EmptyText.d.ts +6 -0
- package/dist/editor-sample/App/InspectorDrawer/BrandPanel/FontDetailsList.d.ts +6 -0
- package/dist/editor-sample/App/InspectorDrawer/BrandPanel/index.d.ts +5 -0
- package/dist/editor-sample/App/InspectorDrawer/BrandPanel/useBrandApply.d.ts +9 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/ResponsiveDeviceTabs.d.ts +0 -2
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/blockStyleClipboard.d.ts +2 -8
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/index.d.ts +1 -4
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/EmailLayoutSidebarPanel.d.ts +2 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/FlexColumns/ColumnSection.d.ts +2 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/FormsPickerSidebarPanel.d.ts +2 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/MdxSidebarPanel.d.ts +7 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/MenuPickerSidebarPanel.d.ts +23 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/QuillSidebarPanel.d.ts +8 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/TextSidebarPanel.d.ts +2 -2
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/AnimationSection.d.ts +7 -5
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/HoverEffectSection.d.ts +1 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/imageSizeUnit.d.ts +19 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/ColorInput/Picker.d.ts +0 -2
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/VariableLinkHint.d.ts +27 -0
- package/dist/editor-sample/App/InspectorDrawer/EditorBehavior.d.ts +8 -2
- package/dist/editor-sample/App/InspectorDrawer/LayersPanelStyles.d.ts +2 -2
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/AiSupportedBadge.d.ts +7 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/SectionsModal.d.ts +2 -10
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/icons/index.d.ts +3 -5
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateHelpers.d.ts +198 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/useDebouncedValue.d.ts +8 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/AiGenerateButton.d.ts +18 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ItemsArrayRepeatSection.d.ts +2 -3
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ScalarFieldRow.d.ts +4 -1
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/VariableGroupDialog.d.ts +19 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/VariableGroupList.d.ts +5 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/aiFill.d.ts +75 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/styles.d.ts +14 -11
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/upgradeDialog.d.ts +8 -8
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/useAutoRegisterTokenFields.d.ts +8 -0
- package/dist/editor-sample/App/InspectorDrawer/behaviourFields.d.ts +30 -0
- package/dist/editor-sample/App/InspectorDrawer/components/RichTextAiButton.d.ts +7 -0
- package/dist/editor-sample/App/InspectorDrawer/index.d.ts +8 -1
- package/dist/editor-sample/App/InspectorDrawer/publish/BackgroundPanel.d.ts +6 -0
- package/dist/editor-sample/App/InspectorDrawer/renderBehaviourField.d.ts +7 -0
- package/dist/editor-sample/App/TemplatePanel/hooks/useMainBoxStyles.d.ts +2 -1
- package/dist/editor-sample/App/TemplatePanel/index.d.ts +2 -1
- package/dist/editor-sample/App/TemplatePanel/minimap/useMiniMapSync.d.ts +2 -2
- package/dist/editor-sample/App/TemplatePanel/pageGuide/iframeSrcDoc.d.ts +3 -6
- package/dist/editor-sample/App/hooks/page/saveMenuHrefEdits.d.ts +1 -1
- package/dist/editor-sample/App/hooks/page/useSaveHandler.d.ts +1 -0
- package/dist/editor-sample/App/hooks/useAutosave.d.ts +8 -3
- package/dist/editor-sample/App/hooks/useIsTemplateEditorRoute.d.ts +1 -0
- package/dist/editor-sample/App/hooks/useStretch.d.ts +9 -0
- package/dist/editor-sample/App/shared/PagePreviewFrame.d.ts +17 -2
- package/dist/editor-sample/App/shared/UploadImage.d.ts +4 -0
- package/dist/editor-sample/App/shared/editor.styles.d.ts +13 -3
- package/dist/editor-sample/documents/blocks/Container/ContainerPropsSchema.d.ts +6 -4
- package/dist/editor-sample/documents/blocks/EmailLayout/EmailLayoutPropsSchema.d.ts +4 -0
- package/dist/editor-sample/documents/blocks/FormsPicker/FormsPropsSchema.d.ts +33 -2
- package/dist/editor-sample/documents/blocks/List/ListEditor.d.ts +8 -0
- package/dist/editor-sample/documents/blocks/Marquee/MarqueePropsSchema.d.ts +4 -0
- package/dist/editor-sample/documents/blocks/MenuPicker/MenuPropsSchema.d.ts +11 -0
- package/dist/editor-sample/documents/blocks/Table/TableCellEditor.d.ts +2 -1
- package/dist/editor-sample/documents/blocks/Table/TableImportDialog.styles.d.ts +15 -5
- package/dist/editor-sample/documents/blocks/Table/parseClipboardTable.d.ts +7 -0
- package/dist/editor-sample/documents/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +6 -0
- package/dist/editor-sample/documents/blocks/Timer/TimerPropsSchema.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/Timer/variants/CircularProgressView.d.ts +2 -1
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/blockMenuStyles.d.ts +1 -1
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/brandButtonDefaults.d.ts +1 -4
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/buttons.d.ts +0 -6
- package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/dialogs/LinkDialog.d.ts +4 -1
- package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/hooks/useToolbarCommands.d.ts +16 -4
- package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/popovers/TableResizeOverlay.d.ts +17 -0
- package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/styles.d.ts +2 -2
- package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/types.d.ts +2 -4
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/EditorBlockWrapper.d.ts +2 -3
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/TuneMenu.styles.d.ts +17 -0
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/saveAsTemplateUtils.d.ts +37 -7
- package/dist/editor-sample/documents/blocks/helpers/documentUtils.d.ts +55 -28
- package/dist/editor-sample/documents/blocks/helpers/responsiveStyle.d.ts +1 -1
- package/dist/editor-sample/documents/blocks/helpers/variableBinding.d.ts +9 -2
- package/dist/editor-sample/documents/editor/EditorBlock.d.ts +2 -6
- package/dist/editor-sample/documents/editor/EditorContext.d.ts +87 -20
- package/dist/editor-sample/documents/editor/LazyEditorBlock.d.ts +1 -0
- package/dist/editor-sample/documents/editor/core.d.ts +510 -390
- package/dist/editor-sample/documents/editor/templateVariables.d.ts +178 -25
- package/dist/editor-sample/documents/editor/useRootFontFamily.d.ts +10 -0
- package/dist/editor-sample/utils/editorStorageKey.d.ts +2 -0
- package/dist/editor-sample/utils/localStoragePref.d.ts +2 -0
- package/dist/email-builder-core/blocks/Container/ContainerPropsSchema.d.ts +1 -1
- package/dist/email-builder-core/blocks/Container/ContainerReader.d.ts +1 -1
- package/dist/email-builder-core/blocks/EmailLayout/EmailLayoutPropsSchema.d.ts +4 -0
- package/dist/email-builder-core/blocks/EmailLayout/EmailLayoutReader.d.ts +1 -1
- package/dist/email-builder-core/blocks/FlexColumns/FlexColumnsPropsSchema.d.ts +3 -0
- package/dist/email-builder-core/blocks/FlexColumns/flexColumnsHelpers.d.ts +4 -2
- package/dist/email-builder-core/blocks/MenuPicker/MenuColumns.d.ts +13 -0
- package/dist/email-builder-core/blocks/MenuPicker/MenuPropsSchema.d.ts +10 -0
- package/dist/email-builder-core/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +6 -0
- package/dist/email-builder-core/index.d.ts +0 -2
- package/dist/email-builder-core/renderers/pageScripts.d.ts +0 -1
- package/dist/email-builder-core/renderers/themeTokens.d.ts +94 -132
- package/dist/host-stubs/history.d.ts +5 -0
- package/dist/host-stubs/hooks/useTenantFeatureCutoff.d.ts +8 -0
- package/dist/host-stubs/hooks/useTenantPlan.d.ts +18 -0
- package/dist/host-stubs/i18nAhdDefaults.d.ts +1 -0
- package/dist/host-stubs/modules/allSlugs/allSlugsActions.d.ts +1 -0
- package/dist/host-stubs/modules/allSlugs/allSlugsSelectors.d.ts +1 -0
- package/dist/host-stubs/modules/auth/authCurrentTenant.d.ts +6 -0
- package/dist/host-stubs/modules/forms/formsService.d.ts +3 -1
- package/dist/host-stubs/modules/forms/useFormsList.d.ts +4 -1
- package/dist/host-stubs/modules/menu/menuService.d.ts +4 -0
- package/dist/host-stubs/modules/page/pageService.d.ts +11 -0
- package/dist/host-stubs/modules/settings/settingsActions.d.ts +2 -0
- package/dist/host-stubs/modules/settings/settingsSelectors.d.ts +4 -0
- package/dist/host-stubs/modules/shared/axios/authAxios.d.ts +17 -0
- package/dist/host-stubs/modules/shared/constants.d.ts +14 -0
- package/dist/host-stubs/modules/store.d.ts +4 -0
- package/dist/host-stubs/modules/template/templateEnumerators.d.ts +19 -0
- package/dist/host-stubs/modules/tour/injectTourIntoPage.d.ts +20 -0
- package/dist/host-stubs/modules/websiteV2/propagateFromPage.d.ts +4 -0
- package/dist/host-stubs/style/icons.d.ts +57 -0
- package/dist/host-stubs/utils/dateFormats.d.ts +1 -0
- package/dist/host-stubs/view/branding/brandDefaultFont.d.ts +3 -1
- package/dist/host-stubs/view/branding/styles/BrandIcons.d.ts +9 -0
- package/dist/host-stubs/view/branding/styles/types.d.ts +76 -0
- package/dist/host-stubs/view/configurations/ConfigurationIcons.d.ts +9 -0
- package/dist/host-stubs/view/demo/DemoIcons.d.ts +9 -0
- package/dist/host-stubs/view/images/Icons.d.ts +6 -0
- package/dist/host-stubs/view/media/MediaGalleryDialog/types.d.ts +47 -0
- package/dist/host-stubs/view/media/MediaGalleryDialog/utils/fileUtils.d.ts +3 -0
- package/dist/host-stubs/view/media/MediaGalleryDialog/utils/mediaTypes.d.ts +9 -0
- package/dist/host-stubs/view/media/MediaGalleryDialog.d.ts +12 -2
- package/dist/host-stubs/view/media/styles/MediaIcons.d.ts +13 -0
- package/dist/host-stubs/view/shared/Confetti.d.ts +5 -0
- package/dist/host-stubs/view/shared/PagePilotLoader.d.ts +2 -0
- package/dist/host-stubs/view/shared/UpgradeDialog/UpgradeDialogContext.d.ts +1 -0
- package/dist/host-stubs/view/shared/common/CopyToClipboard.d.ts +7 -0
- package/dist/host-stubs/view/shared/editors/MdxEditor.d.ts +8 -0
- package/dist/host-stubs/view/shared/editors/QuillEditor.d.ts +3 -0
- package/dist/host-stubs/view/shared/editors/sanitize.d.ts +4 -0
- package/dist/host-stubs/view/shared/editors/types.d.ts +7 -0
- package/dist/host-stubs/view/shared/media/TemplatePreviewMedia.d.ts +29 -0
- package/dist/host-stubs/view/shared/modals/ConfigureDialog.d.ts +7 -0
- package/dist/host-stubs/view/shared/modals/ManageTemplateModal.d.ts +5 -0
- package/dist/host-stubs/view/shared/speech/index.d.ts +17 -0
- package/dist/host-stubs/view/shared/styles/Table.styles.d.ts +3 -0
- package/dist/host-stubs/view/template/form/TemplateFormModal.d.ts +10 -0
- package/dist/host-stubs/view/template/form/fields/types.d.ts +7 -0
- package/dist/{index-BN1BduFG.js → index-BONR8bWR.js} +1 -1
- package/dist/{index-DojXOBrb.js → index-B_cb-ZLC.js} +88415 -74153
- package/dist/index-BfIWhBCR.cjs +1561 -0
- package/dist/{index-BRq3RgdO.cjs → index-CFA3aG_U.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/render-core/combineSections.d.ts +33 -3
- package/dist/render-core/dateFormats.d.ts +14 -3
- package/dist/render-core/stubs/pickerEmptyState.d.ts +2 -0
- package/dist/render-core/stubs/styleIcons.d.ts +1 -0
- package/dist/render.cjs +272 -219
- package/dist/render.js +9856 -7949
- package/dist/style.css +1 -1
- package/dist/{xlsx-D2quXLTv.cjs → xlsx-CBpoXUEM.cjs} +1 -1
- package/dist/{xlsx-0y4dyiCO.js → xlsx-DSqBw3Em.js} +1 -1
- package/package.json +1 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/ResponsiveEditingBanner.d.ts +0 -13
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/BoxShadowControls.d.ts +0 -19
- package/dist/editor-sample/documents/blocks/AppBannerPicker/appBanner.styled.d.ts +0 -2
- package/dist/email-builder-core/blocks/boxShadowSchema.d.ts +0 -23
- package/dist/index-DEBoxZlq.cjs +0 -1510
|
@@ -33,14 +33,16 @@ export type BlockTemplateConfiguration = {
|
|
|
33
33
|
* type's own child-id layout) into a flat `{ id: block }` map.
|
|
34
34
|
*/
|
|
35
35
|
export declare function collectBlockSubtree(document: BlockMap, rootBlockId: string): BlockMap;
|
|
36
|
+
export declare function extractFormFieldsFromBlocks(blocks: BlockMap, rootBlockId: string): FormField[];
|
|
36
37
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
38
|
+
* Scalar `{{id}}` tokens present in the live document that have no matching
|
|
39
|
+
* root form field yet — returned as ready-to-append field objects. Lets the
|
|
40
|
+
* Variables panel surface a freshly-typed token immediately instead of only
|
|
41
|
+
* after "Save as template" runs `extractFormFieldsFromBlocks`.
|
|
42
|
+
* Repeat (array) fields are never auto-created here; they come from the
|
|
43
|
+
* explicit repeatable-container flow.
|
|
42
44
|
*/
|
|
43
|
-
export declare function
|
|
45
|
+
export declare function detectMissingScalarFields(document: BlockMap, forms: FormField[]): FormField[];
|
|
44
46
|
/**
|
|
45
47
|
* Convert one live root field into an authoring field for the template dialog.
|
|
46
48
|
* Only the DEFINITION is kept (id, name, type, itemFields, target blocks);
|
|
@@ -75,8 +77,15 @@ export declare function toAuthoringField(field: FormField, blockIds: Set<string>
|
|
|
75
77
|
* templates, where any authored scalar is fair game) and for
|
|
76
78
|
* `derivePageInitialFormFields` (which has no document to scan and passes
|
|
77
79
|
* `detectedFields=[]`).
|
|
80
|
+
*
|
|
81
|
+
* `canvasDocument`/`canvasRootId` (opt-in) — when both are supplied, the
|
|
82
|
+
* merged result is sorted to match canvas top-to-bottom order (the same
|
|
83
|
+
* order the Variables panel displays), so a newly-detected field lands
|
|
84
|
+
* between the fields around it instead of always at the end. Omitted by the
|
|
85
|
+
* one caller with no live document to rank against, in which case the
|
|
86
|
+
* merged order is returned unchanged (today's behavior).
|
|
78
87
|
*/
|
|
79
|
-
export declare function buildTemplateFormFields(rootFormFields: FormField[], detectedFields: FormField[], blockIds: Set<string>, prefillDefaults?: boolean, scopeScalarsToDetected?: boolean): FormField[];
|
|
88
|
+
export declare function buildTemplateFormFields(rootFormFields: FormField[], detectedFields: FormField[], blockIds: Set<string>, prefillDefaults?: boolean, scopeScalarsToDetected?: boolean, canvasDocument?: BlockMap, canvasRootId?: string): FormField[];
|
|
80
89
|
/** Pull color / font-size out of value HTML (`<font color>` or `style="font-size"`). */
|
|
81
90
|
export declare function extractInlineStyle(html: string): {
|
|
82
91
|
color?: string;
|
|
@@ -105,6 +114,27 @@ export declare function enrichTokenBlockStyleFromValue(block: AnyBlock, fields:
|
|
|
105
114
|
* this false so authored templates stay default-empty.
|
|
106
115
|
*/
|
|
107
116
|
export declare function buildBlockTemplateConfiguration(document: BlockMap, rootBlockId: string, liveFormFields: FormField[], prefillDefaults?: boolean): BlockTemplateConfiguration;
|
|
117
|
+
/**
|
|
118
|
+
* Inverse of `buildBlockTemplateConfiguration`: wraps a saved block template's
|
|
119
|
+
* `{ isIndividualBlock, rootBlockId, blocks }` into a normal editable document
|
|
120
|
+
* (`{ root: EmailLayout, ...blocks }`) so the block can be opened on the
|
|
121
|
+
* regular canvas for editing, the same way a page document is.
|
|
122
|
+
*
|
|
123
|
+
* Used when editing an existing "block" type template — without this, the
|
|
124
|
+
* editor's document-loading effect (which requires `doc.root` to exist) has
|
|
125
|
+
* nothing to load and falls back to a blank canvas.
|
|
126
|
+
*/
|
|
127
|
+
export declare function wrapBlockConfigurationAsDocument(configuration: BlockTemplateConfiguration): BlockMap;
|
|
128
|
+
/**
|
|
129
|
+
* Inverse of `wrapBlockConfigurationAsDocument`: given a document that was
|
|
130
|
+
* loaded via that wrapper and then edited on the canvas, collect the (single)
|
|
131
|
+
* root child's subtree back into the `isIndividualBlock` save shape.
|
|
132
|
+
*
|
|
133
|
+
* `formFields` are carried over as-is (not re-derived) so authored field
|
|
134
|
+
* definitions (custom names/types/defaults) aren't clobbered by a blind
|
|
135
|
+
* token re-detection on every save.
|
|
136
|
+
*/
|
|
137
|
+
export declare function unwrapDocumentToBlockConfiguration(document: BlockMap, formFields: FormField[]): BlockTemplateConfiguration | null;
|
|
108
138
|
/**
|
|
109
139
|
* True when the configuration has authored `formFields` embedded on one of its
|
|
110
140
|
* document roots — meaning the record was already saved with the new
|
|
@@ -36,6 +36,13 @@ export declare const addRepeatRow: (documentTree: Record<string, any>, sourceBlo
|
|
|
36
36
|
* arrays. Used to delete a repeat row's cloned container subtree.
|
|
37
37
|
*/
|
|
38
38
|
export declare function removeSubtree(documentTree: Record<string, any>, idsToRemove: Set<string>): Record<string, any>;
|
|
39
|
+
/**
|
|
40
|
+
* removeSubtree for deleted repeat rows. Tabs are the exception to the
|
|
41
|
+
* "slot stays" rule: each repeat row owns a whole tab (label + panel), so
|
|
42
|
+
* deleting the row must drop the tab item itself — otherwise a blank-panel tab
|
|
43
|
+
* with a stale label is left behind. At least one tab is always kept.
|
|
44
|
+
*/
|
|
45
|
+
export declare function removeRepeatRowSubtrees(documentTree: Record<string, any>, cloneRootIds: string[], idsToRemove: Set<string>): Record<string, any>;
|
|
39
46
|
export type RepeatableSlot = {
|
|
40
47
|
childrenIds: string[];
|
|
41
48
|
};
|
|
@@ -69,14 +76,24 @@ export type ItemsArrayInfo = {
|
|
|
69
76
|
};
|
|
70
77
|
/** True if the block's repeatable content is a flat `props.items` array (no child blocks). */
|
|
71
78
|
export declare function isItemsArrayBlockType(type: string | undefined): boolean;
|
|
79
|
+
/** The `data.props` key an items-array block keeps its items under. */
|
|
80
|
+
export declare function getItemsArrayPropKey(type: string | undefined): string;
|
|
81
|
+
/** A block's current items array (empty when missing). */
|
|
82
|
+
export declare function readItemsArray(block: any): Record<string, any>[];
|
|
83
|
+
type ItemSubField = {
|
|
84
|
+
id: string;
|
|
85
|
+
mapsTo?: string;
|
|
86
|
+
};
|
|
87
|
+
/** Items → field rows: row keys are sub-field ids, read from each sub's `mapsTo` item key. */
|
|
88
|
+
export declare function itemsToRows(items: Record<string, any>[], itemFields: ItemSubField[] | null | undefined): Record<string, string>[];
|
|
89
|
+
/** Field rows → items: writes each row value onto its sub's `mapsTo` key, keeping other item keys. */
|
|
90
|
+
export declare function rowsToItems(rows: Record<string, any>[], existingItems: Record<string, any>[], itemFields: ItemSubField[] | null | undefined): Record<string, any>[];
|
|
72
91
|
/**
|
|
73
92
|
* Describe an items-array block's current items. Returns null when the block
|
|
74
93
|
* isn't a supported items-array type. Used by the Variables tab to decide
|
|
75
94
|
* whether to show the items data-source controls for the selected block.
|
|
76
95
|
*/
|
|
77
96
|
export declare function getItemsArrayInfo(documentTree: Record<string, any>, blockId: string): ItemsArrayInfo | null;
|
|
78
|
-
/** Write an items-array block's `items` back onto the block. */
|
|
79
|
-
export declare function writeItemsArray(block: any, items: Record<string, any>[]): any;
|
|
80
97
|
export type VariableGroupKind = 'container' | 'itemsArray' | 'block' | 'page';
|
|
81
98
|
export type VariableGroup = {
|
|
82
99
|
/** Stable identity for selection — the owning block id, or `page` for page-level. */
|
|
@@ -97,45 +114,52 @@ export type VariableGroup = {
|
|
|
97
114
|
*/
|
|
98
115
|
fieldNames: string[];
|
|
99
116
|
/**
|
|
100
|
-
* True when the block is a repeatable container
|
|
101
|
-
*
|
|
117
|
+
* True when the block is a repeatable container that owns no variables —
|
|
118
|
+
* no field and no row tokens (the Repeat toggle alone doesn't count). It owns nothing to edit,
|
|
102
119
|
* but its Repeat toggle is only reachable from its own screen, so it is
|
|
103
120
|
* listed separately rather than dropped. See `isVariableBoundBlock`.
|
|
104
121
|
*/
|
|
105
122
|
isCandidate?: boolean;
|
|
106
123
|
};
|
|
124
|
+
export declare function getFieldOwnerBlockId(documentTree: Record<string, any>, field: {
|
|
125
|
+
id?: string;
|
|
126
|
+
containerId?: string;
|
|
127
|
+
sourceBlockId?: string;
|
|
128
|
+
itemsBlockId?: string;
|
|
129
|
+
}): string | null;
|
|
107
130
|
/**
|
|
108
|
-
* The block a field
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* thinks of as "the group", and grouping by the raw `sourceBlockId` would both
|
|
115
|
-
* split one grid into a row per slot and fail every `getRepeatableContainerInfo`
|
|
116
|
-
* lookup downstream.
|
|
117
|
-
*
|
|
118
|
-
* A source block with no repeatable ancestor is a plain (non-repeatable) block
|
|
119
|
-
* with variables — it stays its own group, keyed on itself.
|
|
131
|
+
* The block a field's `{{token}}` actually renders on — unlike
|
|
132
|
+
* `getFieldOwnerBlockId`, this resolves a plain scalar field (no explicit
|
|
133
|
+
* containerId/sourceBlockId/itemsBlockId) to the real block referencing its
|
|
134
|
+
* token instead of `null`. Used for canvas locate/highlight and row
|
|
135
|
+
* ordering, where the panel needs the field's true position even though it
|
|
136
|
+
* groups under the shared "General variables" bucket.
|
|
120
137
|
*/
|
|
121
|
-
export declare function
|
|
138
|
+
export declare function getFieldCanvasBlockId(documentTree: Record<string, any>, field: {
|
|
139
|
+
id?: string;
|
|
122
140
|
containerId?: string;
|
|
123
141
|
sourceBlockId?: string;
|
|
124
142
|
itemsBlockId?: string;
|
|
125
143
|
}): string | null;
|
|
126
144
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* Must list the SAME shapes `collectSubtreeIds` + `readContainerSlots` walk —
|
|
136
|
-
* if a new container child-array is added there, mirror it here or the list can
|
|
137
|
-
* go stale until an unrelated structural edit flushes it.
|
|
145
|
+
* Where a field's row should sort within an opened Variables-panel group, so
|
|
146
|
+
* rows read in the same top-to-bottom order as their tokens appear on the
|
|
147
|
+
* canvas instead of whatever order `formFields` happens to be authored in.
|
|
148
|
+
* `blockIndex` is the owner block's position in `collectSubtreeIds` (canvas
|
|
149
|
+
* order); `tokenIndex` breaks ties between multiple tokens on the same block
|
|
150
|
+
* (e.g. a Button's `text` vs `url`) using their first-appearance order from
|
|
151
|
+
* `getBlockScalarTokenIds`. Unresolvable fields rank last via `Infinity`
|
|
152
|
+
* rather than throwing off the whole group's order.
|
|
138
153
|
*/
|
|
154
|
+
export declare function getFieldCanvasRank(documentTree: Record<string, any>, field: {
|
|
155
|
+
id?: string;
|
|
156
|
+
containerId?: string;
|
|
157
|
+
sourceBlockId?: string;
|
|
158
|
+
itemsBlockId?: string;
|
|
159
|
+
}): {
|
|
160
|
+
blockIndex: number;
|
|
161
|
+
tokenIndex: number;
|
|
162
|
+
};
|
|
139
163
|
export declare function variableGroupsStructuralKey(documentTree: Record<string, any>, fields: Array<{
|
|
140
164
|
id?: string;
|
|
141
165
|
name?: string;
|
|
@@ -153,6 +177,8 @@ export declare function collectVariableGroups(documentTree: Record<string, any>,
|
|
|
153
177
|
sourceBlockId?: string;
|
|
154
178
|
itemsBlockId?: string;
|
|
155
179
|
}>): VariableGroup[];
|
|
180
|
+
/** Write an items-array block's `items` back onto the block. */
|
|
181
|
+
export declare function writeItemsArray(block: any, items: Record<string, any>[]): any;
|
|
156
182
|
/**
|
|
157
183
|
* Grow a repeatable container so it has at least `neededSlots` cells/columns/slides.
|
|
158
184
|
*
|
|
@@ -307,3 +333,4 @@ export declare function sanitizeAgainstKnownTypes(doc: Record<string, any>, know
|
|
|
307
333
|
removedTypes: string[];
|
|
308
334
|
changed: boolean;
|
|
309
335
|
};
|
|
336
|
+
export {};
|
|
@@ -31,7 +31,7 @@ export declare const RESPONSIVE_PROP_KEYS: readonly ["contentAlignment", "horizo
|
|
|
31
31
|
* {@link nativeKeysForBlock} to get the right set for a block type — never test
|
|
32
32
|
* against this flat list directly.
|
|
33
33
|
*/
|
|
34
|
-
export declare const NATIVE_DEVICE_PROP_KEYS: readonly ["columnsCount", "columnsCountTablet", "columnsCountMobile", "rowsCount", "rowsCountTablet", "rowsCountMobile", "columnsGap", "columnsGapTablet", "columnsGapMobile", "rowsGap", "desktopLayout", "tabletLayout", "mobileLayout", "columnShrink", "columnShrinkTablet", "columnShrinkMobile", "columnsDirection", "columnsDirectionTablet", "columnsDirectionMobile", "widthType", "widthTypeTablet", "widthTypeMobile", "size", "sizeTablet", "sizeMobile", "fixedWidths", "fixedWidthsTablet", "fixedWidthsMobile", "contentAlignmentTablet", "contentAlignmentMobile", "slidesPerView", "slidesPerViewTablet", "slidesPerViewMobile", "width", "widthTablet", "widthMobile", "widthUnit", "widthUnitTablet", "widthUnitMobile", "height", "heightTablet", "heightMobile", "url", "urlTablet", "urlMobile", "iconName", "iconNameTablet", "iconNameMobile", "iconFillColor", "iconFillColorTablet", "iconFillColorMobile", "enableScroll", "enableScrollTablet", "enableScrollMobile", "orientation", "orientationTablet", "orientationMobile", "dropdown", "dropdownTablet", "dropdownMobile", "direction", "directionTablet", "directionMobile", "gapTablet", "gapMobile", "alignmentTablet", "alignmentMobile", "rotation", "rotationTablet", "rotationMobile", "burgerDropdownBackgroundColor", "stickyNavTablet", "stickyNavMobile"];
|
|
34
|
+
export declare const NATIVE_DEVICE_PROP_KEYS: readonly ["columnsCount", "columnsCountTablet", "columnsCountMobile", "rowsCount", "rowsCountTablet", "rowsCountMobile", "columnsGap", "columnsGapTablet", "columnsGapMobile", "rowsGap", "desktopLayout", "tabletLayout", "mobileLayout", "columnShrink", "columnShrinkTablet", "columnShrinkMobile", "columnSpan", "columnSpanTablet", "columnSpanMobile", "columnsDirection", "columnsDirectionTablet", "columnsDirectionMobile", "widthType", "widthTypeTablet", "widthTypeMobile", "size", "sizeTablet", "sizeMobile", "fixedWidths", "fixedWidthsTablet", "fixedWidthsMobile", "contentAlignmentTablet", "contentAlignmentMobile", "slidesPerView", "slidesPerViewTablet", "slidesPerViewMobile", "width", "widthTablet", "widthMobile", "widthUnit", "widthUnitTablet", "widthUnitMobile", "height", "heightTablet", "heightMobile", "url", "urlTablet", "urlMobile", "iconName", "iconNameTablet", "iconNameMobile", "iconFillColor", "iconFillColorTablet", "iconFillColorMobile", "enableScroll", "enableScrollTablet", "enableScrollMobile", "orientation", "orientationTablet", "orientationMobile", "dropdown", "dropdownTablet", "dropdownMobile", "direction", "directionTablet", "directionMobile", "gapTablet", "gapMobile", "alignmentTablet", "alignmentMobile", "rotation", "rotationTablet", "rotationMobile", "burgerDropdownBackgroundColor", "stickyNavTablet", "stickyNavMobile"];
|
|
35
35
|
/**
|
|
36
36
|
* The native per-device prop keys that apply to `blockType`. Unambiguous keys
|
|
37
37
|
* are always native; ambiguous ones only for the block types that actually
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scalar variable ids (`TemplateFormField.id`) referenced directly on this
|
|
3
|
+
* block's own props — the token shown by the tune menu's "highlight
|
|
4
|
+
* variable" icon. Distinct from `subtreeHasRowTokens`, which looks for
|
|
5
|
+
* `{{this.field}}` row tokens inside a repeatable container's subtree.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getBlockScalarTokenIds(block: any): string[];
|
|
8
|
+
/** Every token-bearing string on a single block. */
|
|
9
|
+
export declare function blockTokenStrings(block: any): string[];
|
|
1
10
|
export declare function subtreeHasRowTokens(documentTree: Record<string, any>, rootId: string): boolean;
|
|
2
|
-
/** True if the author has switched the block's Repeat toggle on. */
|
|
3
|
-
export declare function hasRepeatEnabled(block: any): boolean;
|
|
4
11
|
export declare function isVariableBoundBlock(documentTree: Record<string, any>, blockId: string, fieldOwnerIds: Set<string>): boolean;
|
|
5
12
|
export declare function classifyVariableBlock(documentTree: Record<string, any>, blockId: string, fieldOwnerIds: Set<string>): 'bound' | 'candidate' | 'none';
|
|
@@ -4,13 +4,9 @@ type EditorBlockProps = {
|
|
|
4
4
|
id: string;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
* Loads a single block by id from the editor store and renders it. Subscribes
|
|
8
|
-
* only to that block, so sibling edits don't re-render this subtree — the
|
|
9
|
-
* per-block reference stays stable across setDocument calls that didn't
|
|
10
|
-
* change this block (see _shallowBlockEqual in EditorContext).
|
|
11
7
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
8
|
+
* @param id - Block id
|
|
9
|
+
* @returns EditorBlock component that loads data from the EditorDocumentContext
|
|
14
10
|
*/
|
|
15
11
|
declare function EditorBlock({ id }: EditorBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
16
12
|
declare const _default: React.MemoExoticComponent<typeof EditorBlock>;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { PageTypes } from '../../App/hooks/constants';
|
|
2
2
|
import { TEditorConfiguration } from './core';
|
|
3
3
|
import { TemplateFormField, TemplateArrayRow } from './templateVariables';
|
|
4
|
+
export type PreviewHostTheme = 'light' | 'dark' | 'follow';
|
|
4
5
|
type TValue = {
|
|
5
6
|
document: TEditorConfiguration;
|
|
7
|
+
record: any | null;
|
|
6
8
|
selectedBlockId: string | null;
|
|
7
9
|
selectedSidebarTab: 'block-configuration' | 'styles' | 'behaviour' | 'layout' | 'settings' | 'background' | 'page-pilot-ai' | 'layers' | 'brand' | 'seo' | 'variables' | 'research';
|
|
8
10
|
selectedMainTab: 'editor' | 'preview' | 'json' | 'html';
|
|
9
11
|
selectedScreenSize: 'desktop' | 'mobile' | 'tablet';
|
|
12
|
+
previewHostTheme: PreviewHostTheme;
|
|
10
13
|
zoomLevel: number;
|
|
11
14
|
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
15
|
sidebarEditingDevice: 'desktop' | 'mobile' | 'tablet';
|
|
16
|
+
hasManualScreenSizeOverride: boolean;
|
|
18
17
|
inspectorDrawerOpen: boolean;
|
|
19
18
|
samplesDrawerOpen: boolean;
|
|
20
19
|
activeStepIndex: number;
|
|
@@ -41,6 +40,7 @@ type TValue = {
|
|
|
41
40
|
};
|
|
42
41
|
inlineEditingEnabled: boolean;
|
|
43
42
|
hoveredBlockId: string | null;
|
|
43
|
+
highlightedVariableId: string | null;
|
|
44
44
|
copiedBlock: {
|
|
45
45
|
rootBlockId: string;
|
|
46
46
|
blocks: Record<string, any>;
|
|
@@ -98,13 +98,26 @@ export declare function useDocumentPruned(): TEditorConfiguration;
|
|
|
98
98
|
* whenever a component only needs one block's data.
|
|
99
99
|
*/
|
|
100
100
|
export declare function useEditorBlock(id: string): any;
|
|
101
|
+
/**
|
|
102
|
+
* Subscribe to just the root block, for the id-not-found fallback path.
|
|
103
|
+
* Narrower than useDocument() — re-renders only when 'root' itself changes.
|
|
104
|
+
*/
|
|
105
|
+
export declare function useRootBlock(): any;
|
|
101
106
|
/**
|
|
102
107
|
* Non-reactive read of the current document. Use inside event handlers / callbacks
|
|
103
108
|
* when you need the latest document but do NOT want the component to re-render
|
|
104
109
|
* every time any block in the document changes.
|
|
105
110
|
*/
|
|
106
111
|
export declare function getDocument(): TValue['document'];
|
|
107
|
-
|
|
112
|
+
/**
|
|
113
|
+
* The page root's own font key, or null when the author never picked one.
|
|
114
|
+
*
|
|
115
|
+
* Deliberately does NOT resolve the workspace brand default here: this module
|
|
116
|
+
* is imported by nearly every editor component, and reaching into the redux
|
|
117
|
+
* store from it would create an import cycle. Callers pass the result through
|
|
118
|
+
* `resolveRootFontFamily` instead.
|
|
119
|
+
*/
|
|
120
|
+
export declare function useRootFontFamilyKey(): string | null;
|
|
108
121
|
export declare function useSelectedBlockId(): string;
|
|
109
122
|
/**
|
|
110
123
|
* Boolean selector — returns true only when THIS block is the selected one.
|
|
@@ -112,7 +125,11 @@ export declare function useSelectedBlockId(): string;
|
|
|
112
125
|
* re-renders A and B, not every other block on the canvas.
|
|
113
126
|
*/
|
|
114
127
|
export declare function useIsBlockSelected(id: string): boolean;
|
|
128
|
+
export declare function usePreviewHostTheme(): PreviewHostTheme;
|
|
129
|
+
export declare function setPreviewHostTheme(previewHostTheme: PreviewHostTheme): void;
|
|
115
130
|
export declare function useSelectedScreenSize(): "desktop" | "tablet" | "mobile";
|
|
131
|
+
export declare const ZOOM_MIN = 25;
|
|
132
|
+
export declare const ZOOM_MAX = 100;
|
|
116
133
|
export declare function useZoomLevel(): number;
|
|
117
134
|
/**
|
|
118
135
|
* View-only state — deliberately does NOT go through pushToUndoStack, so
|
|
@@ -126,7 +143,6 @@ export declare function useMinimapVisible(): boolean;
|
|
|
126
143
|
export declare function toggleMinimapVisible(): void;
|
|
127
144
|
/** Which device's properties the sidebar is currently editing (see ResponsiveDeviceTabs). */
|
|
128
145
|
export declare function useSidebarEditingDevice(): "desktop" | "tablet" | "mobile";
|
|
129
|
-
export declare function setSidebarEditingDevice(sidebarEditingDevice: TValue['sidebarEditingDevice']): void;
|
|
130
146
|
export declare function useSelectedMainTab(): "html" | "editor" | "preview" | "json";
|
|
131
147
|
export declare function useActiveStepIndex(): number;
|
|
132
148
|
export declare function useSelectors(): string[];
|
|
@@ -141,6 +157,7 @@ export declare function usePanelMeasurements(): {
|
|
|
141
157
|
offsetTop?: number;
|
|
142
158
|
};
|
|
143
159
|
export declare function useCurrentRecordType(): string;
|
|
160
|
+
export declare function setCurrentRecord(record: any | null): void;
|
|
144
161
|
export declare function setCurrentRecordType(type: string | null): void;
|
|
145
162
|
export declare function setPanelMeasurements(measurements: {
|
|
146
163
|
panelWidth: number;
|
|
@@ -181,6 +198,12 @@ export declare function useInlineEditing(): {
|
|
|
181
198
|
blockId: string | null;
|
|
182
199
|
draft: string;
|
|
183
200
|
};
|
|
201
|
+
/**
|
|
202
|
+
* Boolean selector — true only while THIS block is the one being inline-edited.
|
|
203
|
+
* Prefer over useInlineEditing() in per-block components so starting/stopping
|
|
204
|
+
* an edit doesn't re-render every Text/Heading/Button on the canvas.
|
|
205
|
+
*/
|
|
206
|
+
export declare function useIsBlockInlineEditing(id: string): boolean;
|
|
184
207
|
export declare function useHoveredBlockId(): string;
|
|
185
208
|
/**
|
|
186
209
|
* Boolean selector — returns true only when THIS block is the hovered one.
|
|
@@ -188,6 +211,8 @@ export declare function useHoveredBlockId(): string;
|
|
|
188
211
|
*/
|
|
189
212
|
export declare function useIsBlockHovered(id: string): boolean;
|
|
190
213
|
export declare function setHoveredBlockId(hoveredBlockId: string | null): void;
|
|
214
|
+
export declare function useHighlightedVariableId(): string;
|
|
215
|
+
export declare function setHighlightedVariableId(highlightedVariableId: string | null): void;
|
|
191
216
|
export declare function getHoveredBlockId(): string | null;
|
|
192
217
|
export declare function useCopiedBlock(): {
|
|
193
218
|
rootBlockId: string;
|
|
@@ -231,23 +256,16 @@ export declare function resetDocument(document: TValue['document'], options?: {
|
|
|
231
256
|
sideEffect?: UndoSideEffect;
|
|
232
257
|
activeStepIndex?: number;
|
|
233
258
|
/**
|
|
234
|
-
*
|
|
235
|
-
* editor from
|
|
236
|
-
* the
|
|
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.
|
|
259
|
+
* pagepilot: skip the undo-stack push *and* wipe both stacks. Used by the
|
|
260
|
+
* Shell when seeding the editor from host props (not a user action), so
|
|
261
|
+
* the pre-seed empty doc never becomes an Undo target.
|
|
240
262
|
*/
|
|
241
263
|
skipHistory?: boolean;
|
|
242
264
|
}): void;
|
|
243
265
|
/**
|
|
244
|
-
*
|
|
245
|
-
* after the initial seed
|
|
246
|
-
*
|
|
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.
|
|
266
|
+
* pagepilot: wipe both history stacks without touching the document. Used by
|
|
267
|
+
* the Shell after the initial props-driven seed settles, to swallow spurious
|
|
268
|
+
* pushes from block-level effects before the user has edited anything.
|
|
251
269
|
*/
|
|
252
270
|
export declare function clearEditorHistory(): void;
|
|
253
271
|
export declare function resetDocumentKeepTab(document: TValue['document'], options?: {
|
|
@@ -263,6 +281,29 @@ export declare function resetDocumentKeepTab(document: TValue['document'], optio
|
|
|
263
281
|
* the 200ms burst window with neighbouring words.
|
|
264
282
|
*/
|
|
265
283
|
export declare function resetCoalesce(): void;
|
|
284
|
+
/**
|
|
285
|
+
* Run a batch of setDocument / setTemplateForms calls as a SINGLE undoable
|
|
286
|
+
* step. Any entries the batch pushes onto undoStack are collapsed to one
|
|
287
|
+
* entry whose snapshot is the pre-batch state — so a single Ctrl+Z rewinds
|
|
288
|
+
* the whole logical action.
|
|
289
|
+
*
|
|
290
|
+
* Motivation: the "insert a section-library template" flow calls
|
|
291
|
+
* 1. `setDocument(newBlocks)` — seed descendant blocks
|
|
292
|
+
* 2. `onInsert(rootBlock, id)` — parent's handleChildrenChange writes
|
|
293
|
+
* the root into its childrenIds AND calls `setSelectedBlockId` (which
|
|
294
|
+
* resetCoalesces)
|
|
295
|
+
* 3. `appendTemplateFormFields` — setDocument for root.data.formFields
|
|
296
|
+
*
|
|
297
|
+
* Step 2's `setSelectedBlockId` closes the coalesce window, so step 3 lands
|
|
298
|
+
* on its own undo entry. Users then need TWO Undos to remove the section,
|
|
299
|
+
* and after one Undo the section is still wired into the tree but its
|
|
300
|
+
* `{{tokens}}` render as "Add X" pills because formFields hasn't been
|
|
301
|
+
* restored yet.
|
|
302
|
+
*
|
|
303
|
+
* Any code path that combines several setDocument mutations into one
|
|
304
|
+
* user-visible action should wrap them here.
|
|
305
|
+
*/
|
|
306
|
+
export declare function withSingleUndoStep(action: () => void): void;
|
|
266
307
|
export declare function undo(): void;
|
|
267
308
|
export declare function redo(): void;
|
|
268
309
|
/**
|
|
@@ -328,6 +369,15 @@ export declare function setDocument(document: TValue['document'], options?: SetD
|
|
|
328
369
|
export declare function toggleInspectorDrawerOpen(): void;
|
|
329
370
|
export declare function toggleSamplesDrawerOpen(): void;
|
|
330
371
|
export declare function setSelectedScreenSize(selectedScreenSize: TValue['selectedScreenSize']): void;
|
|
372
|
+
export declare function resetSelectedScreenSizeFromRecord(selectedScreenSize: TValue['selectedScreenSize']): void;
|
|
373
|
+
export declare function useHasManualScreenSizeOverride(): boolean;
|
|
374
|
+
export declare function resetManualScreenSizeOverride(): void;
|
|
375
|
+
/**
|
|
376
|
+
* Switch which device's properties the sidebar edits. Deliberately separate
|
|
377
|
+
* from `setSelectedScreenSize` — this must NEVER resize the canvas preview;
|
|
378
|
+
* only the top toolbar's device toggle does that.
|
|
379
|
+
*/
|
|
380
|
+
export declare function setSidebarEditingDevice(sidebarEditingDevice: TValue['sidebarEditingDevice']): void;
|
|
331
381
|
/** Reactive view of the template fields on root.data.formFields. */
|
|
332
382
|
export declare function useTemplateForms(): TemplateFormField[];
|
|
333
383
|
/** Non-reactive read for use inside event handlers / the save transform. */
|
|
@@ -337,8 +387,25 @@ export declare function getTemplateFormsState(): TemplateFormField[];
|
|
|
337
387
|
* field (array field with a `sourceBlockId`). Recomputed when the document
|
|
338
388
|
* changes. The canvas render path uses it to substitute a repeated container
|
|
339
389
|
* copy's `{{this.subField}}` tokens with that copy's row values.
|
|
390
|
+
*
|
|
391
|
+
* Prefer `useRepeatRowForBlock(blockId)` in per-block components — this whole-
|
|
392
|
+
* map subscription re-renders on every document change and should only be used
|
|
393
|
+
* by callers that need the full map (ContainerRepeatSection, ItemsArrayRepeatSection,
|
|
394
|
+
* TabsBlockEditor's per-tab lookup).
|
|
340
395
|
*/
|
|
341
396
|
export declare function useRepeatRowIndex(): Map<string, TemplateArrayRow>;
|
|
397
|
+
/**
|
|
398
|
+
* Reactive per-block row lookup — the row (if any) that `blockId` currently
|
|
399
|
+
* belongs to inside a container-repeat copy. Unlike `useRepeatRowIndex()`, this
|
|
400
|
+
* subscribes to a single Map entry: zustand's `Object.is` equality check means
|
|
401
|
+
* the component only re-renders when ITS OWN row reference changes (row values
|
|
402
|
+
* come from `formFields[i].value[j]` and keep referential identity across
|
|
403
|
+
* unrelated edits), not on every keystroke anywhere in the document.
|
|
404
|
+
*
|
|
405
|
+
* This is what per-block components (Text/Heading/Button/Image/Avatar/Logo/
|
|
406
|
+
* Rating/Progress/Breadcrumb) should call — never a whole-document selector.
|
|
407
|
+
*/
|
|
408
|
+
export declare function useRepeatRowForBlock(blockId: string): TemplateArrayRow | null;
|
|
342
409
|
/** Write the template-fields onto the document root (undoable, live). */
|
|
343
410
|
export declare function setTemplateForms(fields: TemplateFormField[]): void;
|
|
344
411
|
export declare function useElementIdError(): {
|