pagepilot-visual-editor 1.0.33 → 1.0.34

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 (47) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/VariableLinkHint.d.ts +12 -0
  3. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/ChangeDesignFlow.d.ts +12 -0
  4. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/ChangeTemplateCompareDialog.d.ts +23 -0
  5. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/ChangeTemplateVariablesPane.d.ts +14 -0
  6. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/SectionsModal.d.ts +5 -0
  7. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateCategory.d.ts +1 -0
  8. package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateHelpers.d.ts +14 -26
  9. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/EditVariableDialog.d.ts +9 -0
  10. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/RowCard.d.ts +6 -2
  11. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ScalarFieldRow.d.ts +3 -1
  12. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/useAutoRegisterTokenFields.d.ts +5 -0
  13. package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/variableEditActions.d.ts +32 -0
  14. package/dist/editor-sample/App/InspectorDrawer/components/DateFieldControls.d.ts +2 -1
  15. package/dist/editor-sample/App/InspectorDrawer/components/DateTimeFieldControls.d.ts +2 -1
  16. package/dist/editor-sample/App/InspectorDrawer/components/MiniRichTextInput.d.ts +1 -0
  17. package/dist/editor-sample/App/InspectorDrawer/components/ScalarFieldInput.d.ts +2 -1
  18. package/dist/editor-sample/App/InspectorDrawer/components/TimeFieldControls.d.ts +2 -1
  19. package/dist/editor-sample/App/shared/SectionsDropdown.d.ts +2 -2
  20. package/dist/editor-sample/App/shared/pageSections.d.ts +7 -0
  21. package/dist/editor-sample/documents/blocks/MenuPicker/MenuPropsSchema.d.ts +3 -0
  22. package/dist/editor-sample/documents/blocks/MenuPicker/menuBlockLabel.d.ts +4 -0
  23. package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/ScopePickerMenu.d.ts +3 -2
  24. package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/index.d.ts +2 -1
  25. package/dist/editor-sample/documents/blocks/helpers/block-wrappers/saveAsTemplateUtils.d.ts +10 -0
  26. package/dist/editor-sample/documents/blocks/helpers/documentUtils.d.ts +6 -0
  27. package/dist/editor-sample/documents/editor/changeSectionDesign.d.ts +36 -0
  28. package/dist/editor-sample/documents/editor/core.d.ts +3 -0
  29. package/dist/editor-sample/documents/editor/sectionScope.d.ts +73 -0
  30. package/dist/editor-sample/documents/editor/templateVariables.d.ts +2 -1
  31. package/dist/email-builder-core/blocks/MenuPicker/MenuColumns.d.ts +3 -1
  32. package/dist/email-builder-core/blocks/MenuPicker/MenuPropsSchema.d.ts +6 -0
  33. package/dist/host-stubs/modules/content/view/contentViewSelectors.d.ts +4 -0
  34. package/dist/host-stubs/view/page/form/dialog/PageVariablesPreview.d.ts +5 -0
  35. package/dist/host-stubs/view/template/form/fields/renameFieldTokens.d.ts +26 -0
  36. package/dist/host-stubs/view/template/form/fields/types.d.ts +101 -0
  37. package/dist/{index-BfIWhBCR.cjs → index-BksEeUhc.cjs} +329 -329
  38. package/dist/{index-B_cb-ZLC.js → index-Bqru3CFh.js} +34766 -33209
  39. package/dist/{index-CFA3aG_U.cjs → index-BszXspnA.cjs} +1 -1
  40. package/dist/{index-BONR8bWR.js → index-CI-ydHOL.js} +1 -1
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.js +1 -1
  43. package/dist/render.cjs +115 -115
  44. package/dist/render.js +1616 -1592
  45. package/dist/{xlsx-DSqBw3Em.js → xlsx-BJAjl_m-.js} +1 -1
  46. package/dist/{xlsx-CBpoXUEM.cjs → xlsx-D2eLxkb-.cjs} +1 -1
  47. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
  ## [Unreleased]
8
8
 
9
9
  ### Changed
10
+ - Re-synced the vendored editor with ahd-fe `plugin-integration` (2aa96315d),
11
+ covering everything since the 67f2b933 sync. Upstream behaviour pulled in
12
+ includes:
13
+ - "Change design" in the block tune menu: swap a template section for
14
+ another design, carrying content over (`sectionScope`,
15
+ `changeSectionDesign`, `ChangeDesignFlow`, compare dialog + variables pane).
16
+ - "Edit variable" dialog: rename a `{{token}}` across the page or convert it
17
+ back to plain text, from the Variables tab, bound inputs or the canvas.
18
+ - MenuPicker: sub-menu text color / font size / font weight, header /
19
+ footer / navigation labels, page-link picker for site pages.
20
+ - Layers panel: section category in labels, copy/paste whole page buttons
21
+ disabled when there's nothing to copy/paste.
22
+ - Add-block keeps preassigned IDs, "Edit Content" in the add menu, Section
23
+ Library "View all" / "All sections", Video / Rating / Progress token fields.
24
+ - Inline text caret is restored correctly on undo/redo.
25
+ - Host stubs: `modules/content/view/contentViewSelectors` (no record),
26
+ trimmed `view/page/form/dialog/PageVariablesPreview`, full
27
+ `view/template/form/fields/types` + `renameFieldTokens`; i18n defaults
28
+ regenerated with the new keys.
10
29
  - Re-synced the vendored editor with ahd-fe `master` (9661ba36b), on top of
11
30
  the 82ec6ec4b sync below. Upstream behaviour pulled in includes:
12
31
  - Host-application theme support (theme slots, surface lock, dark-host
@@ -1,4 +1,16 @@
1
1
  import { default as React } from 'react';
2
+ /** Inline "Edit variable" link — rename the token(s) behind `value` or convert them to text. */
3
+ export declare function EditVariableLink({ value }: {
4
+ value: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ /**
7
+ * Compact pencil (fits inside a locked input's end adornment) opening "Edit
8
+ * variable". Opts back into pointer events — VariableBoundClickArea switches
9
+ * them off on the input — and stops the click reaching that wrapper.
10
+ */
11
+ export declare function EditVariableIcon({ value }: {
12
+ value: string;
13
+ }): import("react/jsx-runtime").JSX.Element;
2
14
  /**
3
15
  * Wraps a locked, variable-bound input so clicking anywhere on it jumps to the
4
16
  * Variables tab (a disabled input swallows clicks itself, so its own pointer
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * "Change design" for one section: pick a block template (the library opens
4
+ * on the section's category), review the section before/after, then swap it
5
+ * in place keeping the section's content. See changeSectionDesign.
6
+ */
7
+ declare const ChangeDesignFlow: React.FC<{
8
+ blockId: string;
9
+ open: boolean;
10
+ onClose: () => void;
11
+ }>;
12
+ export default ChangeDesignFlow;
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ import { FieldPatches } from './templateHelpers';
3
+ interface ChangeTemplateCompareDialogProps {
4
+ open: boolean;
5
+ templateId?: string;
6
+ before: any;
7
+ after: any;
8
+ loading?: boolean;
9
+ onConfirm: (fieldPatches?: FieldPatches) => void;
10
+ onClose: () => void;
11
+ title?: string;
12
+ description?: string;
13
+ confirmLabel?: string;
14
+ notes?: string[];
15
+ }
16
+ /**
17
+ * "Change template" confirm: the current page on the left, the page as it
18
+ * will look after the change on the right — either rendered, or as each
19
+ * side's variables. The right side's variable values can be edited; the
20
+ * edits ride along with the confirm.
21
+ */
22
+ declare const ChangeTemplateCompareDialog: React.FC<ChangeTemplateCompareDialogProps>;
23
+ export default ChangeTemplateCompareDialog;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { TemplateFormField } from '../../../documents/editor/templateVariables';
3
+ /**
4
+ * A page's variables (`root.data.formFields`), grouped the way the editor's
5
+ * Variables tab groups them. The "Change template" compare shows one per
6
+ * side, so the user sees which values the new template keeps; with
7
+ * `onPatch` the values can be edited before the change is applied, without
8
+ * it the same fields render disabled.
9
+ */
10
+ declare const ChangeTemplateVariablesPane: React.FC<{
11
+ document: any;
12
+ onPatch?: (fieldId: string, patch: Partial<TemplateFormField>) => void;
13
+ }>;
14
+ export default ChangeTemplateVariablesPane;
@@ -2,6 +2,11 @@ interface SectionsModalProps {
2
2
  open: boolean;
3
3
  onClose: () => void;
4
4
  onInsert?: (block: any, preassignedId?: string) => void;
5
+ /** Category tab to open on (falls back to "Overall" when it has no templates). */
6
+ initialCategory?: string;
7
+ /** Pick mode ("Change design"): hand the fetched template back instead of inserting it. */
8
+ onPick?: (record: any) => void;
9
+ title?: string;
5
10
  }
6
11
  declare const SectionsModal: React.FC<SectionsModalProps>;
7
12
  export default SectionsModal;
@@ -0,0 +1 @@
1
+ export declare function humanizeCategory(category: string): string;
@@ -79,32 +79,12 @@ export declare function mergeTemplateFormFields(templateRecord: any, idMapping?:
79
79
  [oldId: string]: string;
80
80
  }): void;
81
81
  /**
82
- * Merge incoming formFields into the existing ones. Used by "Add this section"
83
- * so adding Template B that shares {{name}} with Template A keeps the typed
84
- * value and only appends B's new fields. Then jumps to Variables.
85
- *
86
- * Two dedupe rules — different because these fields mean different things:
87
- *
88
- * - Scalar / plain-array fields are dedupe'd by `id`. A page-level `{{name}}`
89
- * is a single slot; inserting Template B that also references `{{name}}`
90
- * should reuse Template A's (possibly user-filled) value, not stomp it.
91
- *
92
- * - Container-repeat fields (`type === 'array' && sourceBlockId`) are dedupe'd
93
- * by `sourceBlockId`. Each such field is scoped to ONE container instance
94
- * (a specific Grid / FlexColumns / Carousel), and its `sourceBlockId` gets
95
- * remapped per insertion. Inserting a testimonial section twice produces
96
- * two independent grid instances; BOTH need their own field or the second
97
- * grid's `{{this.subField}}` tokens can't find their row in
98
- * `buildRepeatRowIndex` (which keys off sourceBlockId/rowIds) and render as
99
- * bare pills. Same-token-id but different sourceBlockId → different field.
100
- *
101
- * When a new container-repeat field's id collides with an already-registered
102
- * field (either a scalar sharing that name, or the same section inserted
103
- * before), we suffix the id with its sourceBlockId so `buildContext` doesn't
104
- * silently overwrite the earlier field. Sub-field tokens (`{{this.X}}`) are
105
- * resolved via the row index by block id, so they don't care about the outer
106
- * field's id.
82
+ * "Choose design" with a multi-section page template: replaces the page's
83
+ * sections with the template's (each carrying its own prefilled variables),
84
+ * loads the first internal section onto the canvas and returns its index so
85
+ * the caller can make it active.
107
86
  */
87
+ export declare function applyPageSectionsTemplate(configuration: any, templateRecord: any, record: any, onUpdateRecord: (record: any) => void, resetDocument: (doc: any) => void): number;
108
88
  export declare function appendTemplateFormFields(templateRecord: any, idMapping?: {
109
89
  [oldId: string]: string;
110
90
  }): void;
@@ -119,7 +99,15 @@ export declare const buildChangeTemplateDocument: (configuration: any, document:
119
99
  fields: any[];
120
100
  current: any;
121
101
  } | null;
122
- export declare const applyChangeTemplate: (configuration: any, document: any, resetDocument: (doc: any) => void, templateRecord?: any) => void;
102
+ export type FieldPatches = Record<string, Record<string, any>>;
103
+ /**
104
+ * Apply field edits (field id → patch) made in the "Change template" compare
105
+ * to a document's `root.data.formFields`. An items-array field's rows are
106
+ * mirrored onto its block's items too — those blocks render from their own
107
+ * props, not from the field.
108
+ */
109
+ export declare const applyFieldPatches: (doc: any, patches: FieldPatches) => any;
110
+ export declare const applyChangeTemplate: (configuration: any, document: any, resetDocument: (doc: any) => void, templateRecord?: any, fieldPatches?: FieldPatches) => void;
123
111
  /**
124
112
  * "Use this Styles" for non-tour modules (pages, FAQ, app-banner, tooltip,
125
113
  * template). Applies the template's styling — the root canvas AND every
@@ -0,0 +1,9 @@
1
+ /**
2
+ * "Edit variable" — rename a declared `{{token}}` / `{{this.token}}` (every
3
+ * use on the page is rewritten, the value is kept) or turn it back into plain
4
+ * text. Opened via `openEditVariable` from the Variables tab, a bound input in
5
+ * the block sidebar, or the canvas tune menu — the last two pass EVERY
6
+ * variable they use (a Button's label + link), so one "Convert to text" frees
7
+ * the whole block.
8
+ */
9
+ export default function EditVariableDialog(): import("react/jsx-runtime").JSX.Element;
@@ -9,15 +9,19 @@ type RowCardProps = {
9
9
  onRemove: null | (() => void);
10
10
  updateCell: (rowIndex: number, key: string, value: string) => void;
11
11
  headerLabel: string;
12
+ /** Read-only: the row still expands, its inputs are disabled. */
13
+ disabled?: boolean;
14
+ /** Shows an "Edit variable" icon per sub-field (`{{this.subId}}` rename/unlink/delete). */
15
+ onEditSub?: (subId: string) => void;
12
16
  };
13
17
  /**
14
18
  * The bare list of sub-field inputs for one row — no card chrome. Used inside
15
19
  * RowCard (behind its collapse) and directly by the Template Modifier, which
16
20
  * doesn't need a second collapsible layer around its single template row.
17
21
  */
18
- export declare function RowFields({ rowIndex, row, itemFields, updateCell, sx, }: Pick<RowCardProps, 'rowIndex' | 'row' | 'itemFields' | 'updateCell'> & {
22
+ export declare function RowFields({ rowIndex, row, itemFields, updateCell, sx, disabled, onEditSub, }: Pick<RowCardProps, 'rowIndex' | 'row' | 'itemFields' | 'updateCell' | 'disabled' | 'onEditSub'> & {
19
23
  sx?: object;
20
24
  }): import("react/jsx-runtime").JSX.Element;
21
25
  /** One collapsible copy/template card in the Variables array editor. */
22
- export default function RowCard({ rowIndex, row, itemFields, isExpanded, onToggle, onRemove, updateCell, headerLabel, }: RowCardProps): import("react/jsx-runtime").JSX.Element;
26
+ export default function RowCard({ rowIndex, row, itemFields, isExpanded, onToggle, onRemove, updateCell, headerLabel, disabled, onEditSub, }: RowCardProps): import("react/jsx-runtime").JSX.Element;
23
27
  export {};
@@ -5,11 +5,13 @@ type Props = {
5
5
  onPatch: (patch: Partial<TemplateFormField>) => void;
6
6
  /** Optional control rendered at the right of the label row (e.g. "locate in canvas"). */
7
7
  headerAction?: ReactNode;
8
+ /** Read-only: shows the value and its controls, all disabled. */
9
+ disabled?: boolean;
8
10
  };
9
11
  /**
10
12
  * One scalar variable row: name, a type selector (Text / Number / Date / Time /
11
13
  * Image), the value input, and — for `date` / `time` — the format + timezone
12
14
  * controls.
13
15
  */
14
- export default function ScalarFieldRow({ field, onPatch, headerAction }: Props): import("react/jsx-runtime").JSX.Element;
16
+ export default function ScalarFieldRow({ field, onPatch, headerAction, disabled }: Props): import("react/jsx-runtime").JSX.Element;
15
17
  export {};
@@ -4,5 +4,10 @@
4
4
  * token with no matching form field. Once added it's no longer "missing", so
5
5
  * this can't loop. Mounted from the always-present inspector drawer so the
6
6
  * variable already exists when the Variables tab is opened.
7
+ *
8
+ * A token edited away (present on the previous scan, gone now) drops its
9
+ * field. When exactly one token vanished and one new token appeared it's a
10
+ * rename (`{{old}}` → `{{new}}`): the field is re-keyed in place so its value
11
+ * and settings carry over instead of leaving both variables behind.
7
12
  */
8
13
  export default function useAutoRegisterTokenFields(): void;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * A variable the "Edit variable" dialog acts on: a top-level `{{id}}` field,
3
+ * or a `{{this.subId}}` sub-field of a container-repeat field.
4
+ */
5
+ export type VariableEditTarget = {
6
+ fieldId: string;
7
+ subId?: string;
8
+ };
9
+ export type VariableIdError = 'invalid' | 'duplicate';
10
+ /** Opens the dialog for one variable, or every variable a block / input uses. */
11
+ export declare const openEditVariable: (targets: VariableEditTarget | VariableEditTarget[]) => void;
12
+ export declare const closeEditVariable: () => void;
13
+ export declare const useEditVariableState: () => {
14
+ open: boolean;
15
+ targets: VariableEditTarget[];
16
+ openId: number;
17
+ };
18
+ export declare const VARIABLE_ID_RE: RegExp;
19
+ /** All variables a block's own token-bearing props use (a Button: label + link). */
20
+ export declare const getBlockVariableTargets: (blockId: string) => VariableEditTarget[];
21
+ /** All variables behind one bound input value. */
22
+ export declare const getValueVariableTargets: (value: string, blockId: string | null) => VariableEditTarget[];
23
+ /**
24
+ * Per-target reason `nextIds[i]` can't be used, or null when it's fine (or
25
+ * unchanged). Keys must be unique against the page's other variables and
26
+ * against each other within the dialog.
27
+ */
28
+ export declare function validateVariableIds(targets: VariableEditTarget[], nextIds: string[]): (VariableIdError | null)[];
29
+ /** Renames every changed key, as ONE undo step. */
30
+ export declare function renameVariables(targets: VariableEditTarget[], nextIds: string[]): void;
31
+ /** Turns every target back into plain text, as ONE undo step. */
32
+ export declare function unlinkVariables(targets: VariableEditTarget[]): void;
@@ -2,11 +2,12 @@ import { TemplateFormField } from '../../../documents/editor/templateVariables';
2
2
  type Props = {
3
3
  field: TemplateFormField;
4
4
  onPatch: (patch: Partial<TemplateFormField>) => void;
5
+ disabled?: boolean;
5
6
  };
6
7
  /**
7
8
  * Format + timezone controls for a `date` scalar variable, shown under the
8
9
  * datetime input. `relative` recomputes in the reader's browser at view time;
9
10
  * every other preset is a fixed string baked in `dateTz` on publish.
10
11
  */
11
- export default function DateFieldControls({ field, onPatch }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export default function DateFieldControls({ field, onPatch, disabled }: Props): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -2,6 +2,7 @@ import { TemplateFormField } from '../../../documents/editor/templateVariables';
2
2
  type Props = {
3
3
  field: TemplateFormField;
4
4
  onPatch: (patch: Partial<TemplateFormField>) => void;
5
+ disabled?: boolean;
5
6
  };
6
7
  /**
7
8
  * Controls for a `datetime` scalar variable: one ISO value, exposed as two
@@ -10,5 +11,5 @@ type Props = {
10
11
  * may be `relative` (recomputed in the reader's browser); the time part is
11
12
  * always a fixed string.
12
13
  */
13
- export default function DateTimeFieldControls({ field, onPatch }: Props): import("react/jsx-runtime").JSX.Element;
14
+ export default function DateTimeFieldControls({ field, onPatch, disabled }: Props): import("react/jsx-runtime").JSX.Element;
14
15
  export {};
@@ -3,6 +3,7 @@ type Props = {
3
3
  value: string;
4
4
  onChange: (value: string) => void;
5
5
  fieldId?: string;
6
+ disabled?: boolean;
6
7
  };
7
8
  declare const MiniRichTextInput: React.FC<Props>;
8
9
  export default MiniRichTextInput;
@@ -6,6 +6,7 @@ type Props = {
6
6
  onChange: (value: string) => void;
7
7
  onPaperBackground?: boolean;
8
8
  fieldId?: string;
9
+ disabled?: boolean;
9
10
  };
10
- declare const ScalarFieldInput: ({ type, label, value, onChange, onPaperBackground, fieldId }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ declare const ScalarFieldInput: ({ type, label, value, onChange, onPaperBackground, fieldId, disabled, }: Props) => import("react/jsx-runtime").JSX.Element;
11
12
  export default ScalarFieldInput;
@@ -2,11 +2,12 @@ import { TemplateFormField } from '../../../documents/editor/templateVariables';
2
2
  type Props = {
3
3
  field: TemplateFormField;
4
4
  onPatch: (patch: Partial<TemplateFormField>) => void;
5
+ disabled?: boolean;
5
6
  };
6
7
  /**
7
8
  * Format + timezone controls for a `time` scalar variable, shown under the
8
9
  * datetime input. `time` always bakes to a fixed string (24h or AM/PM) rendered
9
10
  * in the chosen timezone — there's no view-time / relative mode.
10
11
  */
11
- export default function TimeFieldControls({ field, onPatch }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export default function TimeFieldControls({ field, onPatch, disabled }: Props): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -3,8 +3,8 @@ type Props = {
3
3
  sections: PageSection[];
4
4
  activeSectionIndex: number;
5
5
  onSelectSection: (index: number) => void;
6
- onDeleteSection: (index: number) => void;
7
- onEditSection: (index: number) => void;
6
+ onDeleteSection?: (index: number) => void;
7
+ onEditSection?: (index: number) => void;
8
8
  onReorderSections?: (fromIndex: number, toIndex: number) => void;
9
9
  };
10
10
  declare const SectionsDropdown: ({ sections, activeSectionIndex, onSelectSection, onDeleteSection, onEditSection, onReorderSections, }: Props) => import("react/jsx-runtime").JSX.Element;
@@ -24,5 +24,12 @@ export declare const isExternalSection: (section: Partial<PageSection> | undefin
24
24
  * Identifier is auto-generated as `${sectionType}-${Date.now()}`.
25
25
  */
26
26
  export declare const createPageSectionFromDraft: (draft: SectionDraft, defaultDocument: TEditorConfiguration) => PageSection;
27
+ /**
28
+ * Turns a multi-section page template's `sections` into page sections, giving
29
+ * each internal section's root the `formFields` tagged for it (`stepIndex` =
30
+ * section index, tag stripped). `existing` sections at the same index keep
31
+ * their `_id` / `identifier` so applying onto a saved page updates in place.
32
+ */
33
+ export declare const buildSectionsFromTemplate: (templateSections: PageSection[], formFields?: any[], existing?: PageSection[]) => PageSection[];
27
34
  /** Writes the live editor document back into the active section before switching or saving. */
28
35
  export declare const mergeCurrentDocumentIntoSections: (sections: PageSection[], activeSectionIndex: number, document: TEditorConfiguration) => PageSection[];
@@ -34,6 +34,9 @@ declare const MenuPropsSchema: z.ZodObject<{
34
34
  submenuBackgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
35
35
  submenuRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
36
36
  submenuIconSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
37
+ submenuTextColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
38
+ submenuFontSize: z.ZodNullable<z.ZodOptional<z.ZodString>>;
39
+ submenuFontWeight: z.ZodNullable<z.ZodOptional<z.ZodString>>;
37
40
  submenuPadding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
38
41
  top: z.ZodNumber;
39
42
  right: z.ZodNumber;
@@ -0,0 +1,4 @@
1
+ export declare const menuBlockLabel: (props?: {
2
+ navRole?: string | null;
3
+ orientation?: string;
4
+ } | null) => string;
@@ -7,8 +7,9 @@ export type ScopeOption = {
7
7
  };
8
8
  type Props = {
9
9
  anchorEl: HTMLElement | null;
10
- options: [ScopeOption, ScopeOption];
10
+ options: ScopeOption[];
11
11
  onClose: () => void;
12
+ title?: string;
12
13
  };
13
- export default function ScopePickerMenu({ anchorEl, options, onClose }: Props): import("react/jsx-runtime").JSX.Element;
14
+ export default function ScopePickerMenu({ anchorEl, options, onClose, title }: Props): import("react/jsx-runtime").JSX.Element;
14
15
  export {};
@@ -11,6 +11,7 @@ type Props = {
11
11
  containerNeighbors?: ContainerNeighbor[];
12
12
  onInsertIntoContainer?: (block: TEditorBlock, containerId: string, insertAt: 'start' | 'end') => void;
13
13
  insertAboveCallback?: (block: TEditorBlock) => void;
14
+ onEditContent?: () => void;
14
15
  };
15
- export default function AddBlockButton({ onSelect, onPaste, placeholder, suppressAdd, containerNeighbors, onInsertIntoContainer, insertAboveCallback, }: Props): import("react/jsx-runtime").JSX.Element;
16
+ export default function AddBlockButton({ onSelect, onPaste, placeholder, suppressAdd, containerNeighbors, onInsertIntoContainer, insertAboveCallback, onEditContent, }: Props): import("react/jsx-runtime").JSX.Element;
16
17
  export {};
@@ -33,6 +33,8 @@ 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
+ /** `firstName` → "First Name" for a human-readable field label. */
37
+ export declare const humanize: (id: string) => string;
36
38
  export declare function extractFormFieldsFromBlocks(blocks: BlockMap, rootBlockId: string): FormField[];
37
39
  /**
38
40
  * Scalar `{{id}}` tokens present in the live document that have no matching
@@ -43,6 +45,14 @@ export declare function extractFormFieldsFromBlocks(blocks: BlockMap, rootBlockI
43
45
  * explicit repeatable-container flow.
44
46
  */
45
47
  export declare function detectMissingScalarFields(document: BlockMap, forms: FormField[]): FormField[];
48
+ /**
49
+ * Add every `{{this.sub}}` token found inside a container-repeat field's own
50
+ * blocks (source + row subtrees) to that field's `itemFields`, so a row token
51
+ * typed after the repeat was set up shows in the Variables panel and survives
52
+ * save. Blocks belonging to a nested repeat are skipped — their tokens are
53
+ * that inner field's. Returns `forms` itself when nothing was added.
54
+ */
55
+ export declare function mergeDetectedRowSubFields(document: BlockMap, forms: FormField[]): FormField[];
46
56
  /**
47
57
  * Convert one live root field into an authoring field for the template dialog.
48
58
  * Only the DEFINITION is kept (id, name, type, itemFields, target blocks);
@@ -299,6 +299,12 @@ export declare const duplicateBlock: (documentTree: Record<string, any>, rootId:
299
299
  updatedDocument: Record<string, any>;
300
300
  newRootId: string;
301
301
  };
302
+ /**
303
+ * Re-point a repeat field at its copied blocks. Items-array fields (MenuPicker
304
+ * custom menu) follow their block; container-repeat fields keep a row per
305
+ * copied row block. Null when the field's blocks weren't copied.
306
+ */
307
+ export declare function cloneRepeatField(f: any, idMap: Record<string, string>): any | null;
302
308
  export declare const cloneCopiedBlocks: (copiedConfig: {
303
309
  rootBlockId: string;
304
310
  blocks: Record<string, any>;
@@ -0,0 +1,36 @@
1
+ import { TemplateSource } from './sectionScope';
2
+ /**
3
+ * "Change design": swap one section on the page for another block template
4
+ * while keeping the section's content.
5
+ *
6
+ * The new design takes the old section's place and its field scope (`__<n>`),
7
+ * and each of its fields takes the old value with the same plain id. A repeat
8
+ * list keeps all of its rows — the new design's row blocks are added/removed
9
+ * (growing its grid if needed) to match. Values the new design has no field
10
+ * for are dropped, so a section only ever carries its current design's data.
11
+ *
12
+ * Pure: returns the next document; the caller commits it.
13
+ */
14
+ type Doc = Record<string, any>;
15
+ type Field = Record<string, any>;
16
+ export type ChangeSectionDesignResult = {
17
+ doc: Doc;
18
+ newRootIds: string[];
19
+ /** Plain ids of fields whose value came from the old design. */
20
+ carried: string[];
21
+ /** Plain ids of old values the new design has no field for (removed). */
22
+ dropped: string[];
23
+ /** Repeat fields that couldn't get a row block for every row. */
24
+ capacityLimited: string[];
25
+ };
26
+ export declare function changeSectionDesign({ doc, sectionRootId, configuration, templateFields, source, }: {
27
+ doc: Doc;
28
+ /** Top-level block of the section being replaced. */
29
+ sectionRootId: string;
30
+ /** The new block template's configuration ({ rootBlockId, blocks, childrenIds? }). */
31
+ configuration: any;
32
+ /** The new template's authored formFields. */
33
+ templateFields: Field[];
34
+ source: TemplateSource;
35
+ }): ChangeSectionDesignResult | null;
36
+ export {};
@@ -2284,6 +2284,9 @@ export declare const EditorBlock: ({ type, data }: import('@usewaypoint/document
2284
2284
  submenuBackgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2285
2285
  submenuRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
2286
2286
  submenuIconSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
2287
+ submenuTextColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2288
+ submenuFontSize: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2289
+ submenuFontWeight: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2287
2290
  submenuPadding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
2288
2291
  top: z.ZodNumber;
2289
2292
  right: z.ZodNumber;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Section-scoped template fields.
3
+ *
4
+ * A block template placed on a page is a "section". Its top-level block(s) are
5
+ * stamped with `data.templateSource` so the editor knows which template and
6
+ * category the section came from (used by "Change design" to preselect the
7
+ * category, and below to tell sections of the same kind apart).
8
+ *
9
+ * Fields are page-wide by id: a header and a footer that both use
10
+ * `{{phoneNumber}}` show one value. A second section of the SAME kind must not
11
+ * share, though — two FAQ sections need their own title and Q&A list. So when
12
+ * a section's fields collide with another section of its kind, EVERY field of
13
+ * the new section gets the same `__<n>` suffix (n ≥ 2) and its `{{tokens}}` are
14
+ * rewritten to match. The suffix is digits only because bare `{{tokens}}` only
15
+ * allow `[a-zA-Z0-9_]`.
16
+ *
17
+ * Pure functions over the document tree; callers write the results.
18
+ */
19
+ export type TemplateSource = {
20
+ templateId?: string;
21
+ name?: string;
22
+ category?: string;
23
+ /** The `__<n>` suffix this section's fields carry; absent for plain ids. */
24
+ scope?: number;
25
+ };
26
+ type Doc = Record<string, any>;
27
+ type Field = Record<string, any>;
28
+ export declare const baseFieldId: (id: string) => string;
29
+ export declare const getTemplateSource: (block: any) => TemplateSource | undefined;
30
+ export declare const withTemplateSource: (block: any, source: TemplateSource) => any;
31
+ export declare function subtreeIdsOf(doc: Doc, rootId: string): string[];
32
+ /** Top-level `{{token}}` ids used by the given blocks (`{{this.x}}` excluded). */
33
+ export declare function tokenIdsIn(doc: Doc, ids: Iterable<string>): Set<string>;
34
+ /** Repeat fields bound to one block instance (container-repeat or items-array). */
35
+ export declare const isBlockScoped: (f: Field) => boolean;
36
+ export declare const scopedFieldName: (name: string, scope?: number) => string;
37
+ export declare const blockIdsOutside: (doc: Doc, exclude: Set<string>) => string[];
38
+ /** The fields a section uses: tokens inside it plus repeat fields anchored inside it. */
39
+ export declare function sectionFieldsOf(doc: Doc, rootId: string, fields: Field[]): Field[];
40
+ /**
41
+ * Decide the field ids for a section that was just added to `doc` (its blocks,
42
+ * `sectionIds`, are already in `doc`).
43
+ *
44
+ * - Existing fields with an incoming id that nothing outside the section uses
45
+ * any more are dropped, so a swapped-in design takes the plain ids back.
46
+ * - When an incoming id collides with a field owned by a section of the same
47
+ * kind, every incoming field is suffixed `__<n>` and the section's tokens
48
+ * are rewritten; `blocks` holds the rewritten blocks and `scope` is `n`.
49
+ * - Otherwise nothing is renamed: the caller keeps its normal dedupe (scalars
50
+ * shared by id, colliding repeat fields suffixed).
51
+ */
52
+ export declare function scopeSectionFields({ doc, existing, incoming, sectionIds, source, }: {
53
+ doc: Doc;
54
+ existing: Field[];
55
+ incoming: Field[];
56
+ sectionIds: Set<string>;
57
+ source?: TemplateSource;
58
+ }): {
59
+ existing: Field[];
60
+ incoming: Field[];
61
+ blocks: Doc;
62
+ scope?: number;
63
+ };
64
+ /**
65
+ * After sections are removed: a scoped section whose plain ids are all free
66
+ * again (no field uses them) takes them back, lowest scope first. Returns null
67
+ * when nothing changes.
68
+ */
69
+ export declare function unscopeSections(doc: Doc, fields: Field[]): {
70
+ blocks: Doc;
71
+ fields: Field[];
72
+ } | null;
73
+ export {};
@@ -4,13 +4,14 @@ import { DateFormatPreset, TimeFormatPreset } from '../../../host-stubs/utils/da
4
4
  * The kinds of single-value template field. `array` is repeatable and handled
5
5
  * separately. `text` / `textarea` substitute as plain strings, `number` as a
6
6
  * numeric string, `image` as an image URL (used in Image/Avatar/Logo blocks),
7
+ * `video` a video URL — media-library file or YouTube link (used in Video blocks),
7
8
  * `date` an ISO date string rendered through a display format (see `dateFormat`).
8
9
  * `time` an ISO date string rendered as just its time portion (see `timeFormat`).
9
10
  * `datetime` one ISO string exposing TWO sub-tokens — `{{id.date}}` (formatted
10
11
  * via `dateFormat`) and `{{id.time}}` (via `timeFormat`) — so a single value /
11
12
  * API mapping can print its date and time in separate blocks.
12
13
  */
13
- export type TemplateScalarType = 'text' | 'textarea' | 'number' | 'image' | 'date' | 'time' | 'datetime';
14
+ export type TemplateScalarType = 'text' | 'textarea' | 'number' | 'image' | 'video' | 'date' | 'time' | 'datetime';
14
15
  export type TemplateFormType = TemplateScalarType | 'array';
15
16
  /** All scalar types — used by both top-level fields and array sub-fields. */
16
17
  export declare const TEMPLATE_SCALAR_TYPES: TemplateScalarType[];
@@ -4,10 +4,12 @@ type Props = {
4
4
  menuItems: any[];
5
5
  menuKey: string;
6
6
  textColor: string;
7
+ submenuTextColor?: string | null;
8
+ submenuFontSize?: string | null;
7
9
  backgroundColor: string;
8
10
  fontFamily?: string;
9
11
  start?: React.ReactNode;
10
12
  end?: React.ReactNode;
11
13
  };
12
- declare const MenuColumns: ({ p, menuItems, menuKey, textColor, backgroundColor, fontFamily, start, end }: Props) => import("react/jsx-runtime").JSX.Element;
14
+ declare const MenuColumns: ({ p, menuItems, menuKey, textColor, submenuTextColor, submenuFontSize, backgroundColor, fontFamily, start, end }: Props) => import("react/jsx-runtime").JSX.Element;
13
15
  export default MenuColumns;
@@ -34,6 +34,9 @@ declare const MenuPropsInnerSchema: z.ZodObject<{
34
34
  submenuBackgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
35
35
  submenuRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
36
36
  submenuIconSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
37
+ submenuTextColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
38
+ submenuFontSize: z.ZodNullable<z.ZodOptional<z.ZodString>>;
39
+ submenuFontWeight: z.ZodNullable<z.ZodOptional<z.ZodString>>;
37
40
  submenuPadding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
38
41
  top: z.ZodNumber;
39
42
  right: z.ZodNumber;
@@ -108,6 +111,9 @@ export declare const MenuPropsSchema: z.ZodObject<{
108
111
  submenuBackgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
109
112
  submenuRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
110
113
  submenuIconSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
114
+ submenuTextColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
115
+ submenuFontSize: z.ZodNullable<z.ZodOptional<z.ZodString>>;
116
+ submenuFontWeight: z.ZodNullable<z.ZodOptional<z.ZodString>>;
111
117
  submenuPadding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
112
118
  top: z.ZodNumber;
113
119
  right: z.ZodNumber;
@@ -0,0 +1,4 @@
1
+ declare const contentViewSelectors: {
2
+ selectRecord: any;
3
+ };
4
+ export default contentViewSelectors;
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ document: any;
3
+ };
4
+ declare const PageVariablesPreview: ({ document }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export default PageVariablesPreview;