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
@@ -0,0 +1,26 @@
1
+ import { TemplateFieldDef } from './types';
2
+ /**
3
+ * Maps of old → new ids for template fields renamed in the dialog.
4
+ * `fields` are top-level variables (`{{id}}`, `{{id.date}}`), `items` are
5
+ * array row sub-fields (`{{this.id}}`).
6
+ */
7
+ export type FieldRenames = {
8
+ fields: Record<string, string>;
9
+ items: Record<string, string>;
10
+ };
11
+ export declare const EMPTY_RENAMES: FieldRenames;
12
+ export declare const hasRenames: (r: FieldRenames) => boolean;
13
+ /** `stableId → original id` snapshot taken when the dialog opens. */
14
+ export type OriginalIds = {
15
+ fields: Map<string, string>;
16
+ items: Map<string, string>;
17
+ };
18
+ export declare function snapshotOriginalIds(fields: TemplateFieldDef[]): OriginalIds;
19
+ /** Diffs the edited fields against the opening snapshot (matched by stableId). */
20
+ export declare function computeRenames(fields: TemplateFieldDef[], original: OriginalIds): FieldRenames;
21
+ /**
22
+ * Deep-rewrites `{{oldId}}` tokens inside every string of a JSON-like value.
23
+ * Returns the SAME reference when nothing changed so callers can cheaply
24
+ * detect which blocks were touched.
25
+ */
26
+ export declare function renameTokensDeep<T>(value: T, renames: FieldRenames): T;
@@ -1,3 +1,90 @@
1
+ /** Single-value field kinds (everything except the repeatable `array`). */
2
+ export type TemplateScalarType = 'text' | 'textarea' | 'number' | 'image' | 'video' | 'date' | 'time' | 'datetime';
3
+ export type TemplateFieldType = TemplateScalarType | 'array';
4
+ /** A row sub-field declared on an `array` template field. */
5
+ export type TemplateItemFieldDef = {
6
+ /**
7
+ * Authoring-only React list key, distinct from the user-editable `id`.
8
+ * Generated client-side (see `addItem` / load-time backfill) and stripped
9
+ * before save — never sent to the backend.
10
+ */
11
+ stableId?: string;
12
+ id: string;
13
+ name: string;
14
+ /** Sub-field input kind. Defaults to `text`. */
15
+ type?: TemplateScalarType;
16
+ /** Author-set default value used to prefill the row on apply. */
17
+ defaultValue?: string;
18
+ /** `date` / `datetime` sub-fields — date display format (+ absolute-only tz). */
19
+ dateFormat?: import('../../../../utils/dateFormats').DateFormatPreset;
20
+ /** `time` / `datetime` sub-fields — 24h / AM/PM display. Timezone reuses `dateTz`. */
21
+ timeFormat?: import('../../../../utils/dateFormats').TimeFormatPreset;
22
+ dateTz?: string;
23
+ };
24
+ export type TemplateFieldDef = {
25
+ /**
26
+ * Authoring-only React list key, distinct from the user-editable `id`.
27
+ * Generated client-side (see `addField` / load-time backfill) and stripped
28
+ * before save — never sent to the backend.
29
+ */
30
+ stableId?: string;
31
+ id: string;
32
+ name: string;
33
+ type: TemplateFieldType;
34
+ /**
35
+ * Author flag: whether this field's block/content is meant to be repeated
36
+ * (e.g. across grid cells / carousel slides) once the template is applied.
37
+ * Purely descriptive metadata on the saved field — doesn't change how this
38
+ * dialog behaves, just carries the author's intent through to `formFields`.
39
+ */
40
+ repeatable?: boolean;
41
+ /** Author-set default — prefills the Variables tab when the template is applied. */
42
+ defaultValue?: string;
43
+ /** Declared row sub-fields — only present for `array` fields. */
44
+ itemFields?: TemplateItemFieldDef[];
45
+ /**
46
+ * `array` only — when set, this field repeats the CONTAINER block with this id
47
+ * instead of looping text. Auto-linked to the container being saved.
48
+ */
49
+ sourceBlockId?: string;
50
+ /**
51
+ * `array` + `sourceBlockId` only — ids of OTHER existing container blocks on the
52
+ * canvas (e.g. Carousel slides 2 & 3) that should be treated as pre-existing rows
53
+ * when the template is applied. These become the initial `rowIds` so all existing
54
+ * copies are wired up from the start.
55
+ */
56
+ additionalSourceBlockIds?: string[];
57
+ /**
58
+ * `array` + `sourceBlockId` only — per-row default data, one entry per row
59
+ * (row 0 = sourceBlock, row 1+ = additionalSourceBlockIds). Each entry is a
60
+ * map of subFieldId → defaultValue. Prefilled into the Variables tab on apply.
61
+ */
62
+ defaultRows?: Record<string, string>[];
63
+ /**
64
+ * Authoring-only convenience: blockId → that block's default-row data, so
65
+ * re-ordering the block selection keeps each block's typed values intact.
66
+ * Not persisted to the runtime field — `defaultRows` (positional) is the
67
+ * source of truth that gets saved.
68
+ */
69
+ defaultRowsByBlock?: Record<string, Record<string, string>>;
70
+ /**
71
+ * Tour/Demo templates only — which step this field belongs to. Zero-based.
72
+ * `undefined` means the field applies to all steps (legacy / global). On
73
+ * save, fields are grouped by `stepIndex` and embedded in that step's
74
+ * `contentMetadata.document.root.data.formFields`, so tokens declared for a
75
+ * given step travel with its document.
76
+ */
77
+ stepIndex?: number;
78
+ };
79
+ export declare const FIELD_TYPE_OPTIONS: {
80
+ value: TemplateFieldType;
81
+ label: string;
82
+ }[];
83
+ export declare const SUBFIELD_TYPE_OPTIONS: {
84
+ value: TemplateScalarType;
85
+ label: string;
86
+ }[];
87
+ /** Inline `{{token}}` chip styling used in hint text across the fields editor. */
1
88
  export declare const codeSx: {
2
89
  readonly px: 0.5;
3
90
  readonly py: 0.1;
@@ -5,3 +92,17 @@ export declare const codeSx: {
5
92
  readonly bgcolor: "action.hover";
6
93
  readonly fontSize: "0.85em";
7
94
  };
95
+ /** Returns per-type TextField props (placeholder, multiline, input type). */
96
+ export declare function defaultValueInputProps(type: TemplateScalarType | undefined): {
97
+ placeholder: string;
98
+ multiline: boolean;
99
+ minRows: number;
100
+ maxRows: number;
101
+ type: string;
102
+ } | {
103
+ placeholder: string;
104
+ multiline: boolean;
105
+ type: string;
106
+ minRows?: undefined;
107
+ maxRows?: undefined;
108
+ };