pagepilot-visual-editor 1.0.33 → 1.0.35
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 +28 -0
- package/dist/editor/publish/PagePublishDialog.d.ts +2 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/VariableLinkHint.d.ts +12 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/ChangeDesignFlow.d.ts +16 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/ChangeTemplateCompareDialog.d.ts +25 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/ChangeTemplateVariablesPane.d.ts +14 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/SectionLibraryTab.d.ts +9 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/SectionsModal.d.ts +9 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/TemplatePreviewDialog.d.ts +5 -1
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/index.d.ts +1 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateCategory.d.ts +1 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateHelpers.d.ts +14 -26
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ArrayFieldEditor.d.ts +3 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/DataReferencePanel.d.ts +3 -1
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/EditVariableDialog.d.ts +9 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/RowCard.d.ts +10 -2
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ScalarFieldRow.d.ts +3 -1
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/dataReferenceUtils.d.ts +20 -5
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/useAutoRefreshDataSources.d.ts +8 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/useAutoRegisterTokenFields.d.ts +5 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/variableEditActions.d.ts +32 -0
- package/dist/editor-sample/App/InspectorDrawer/components/DateFieldControls.d.ts +2 -1
- package/dist/editor-sample/App/InspectorDrawer/components/DateTimeFieldControls.d.ts +2 -1
- package/dist/editor-sample/App/InspectorDrawer/components/MiniRichTextInput.d.ts +1 -0
- package/dist/editor-sample/App/InspectorDrawer/components/ScalarFieldInput.d.ts +2 -1
- package/dist/editor-sample/App/InspectorDrawer/components/TimeFieldControls.d.ts +2 -1
- package/dist/editor-sample/App/hooks/page/useSaveHandler.d.ts +1 -0
- package/dist/editor-sample/App/shared/SectionsDropdown.d.ts +2 -2
- package/dist/editor-sample/App/shared/pageSections.d.ts +7 -0
- package/dist/editor-sample/documents/blocks/MenuPicker/MenuPropsSchema.d.ts +3 -0
- package/dist/editor-sample/documents/blocks/MenuPicker/menuBlockLabel.d.ts +4 -0
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/ScopePickerMenu.d.ts +3 -2
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/index.d.ts +2 -1
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/saveAsTemplateUtils.d.ts +10 -0
- package/dist/editor-sample/documents/blocks/helpers/documentUtils.d.ts +6 -0
- package/dist/editor-sample/documents/editor/EditorContext.d.ts +2 -2
- package/dist/editor-sample/documents/editor/changeSectionDesign.d.ts +36 -0
- package/dist/editor-sample/documents/editor/core.d.ts +3 -0
- package/dist/editor-sample/documents/editor/sectionScope.d.ts +73 -0
- package/dist/editor-sample/documents/editor/templateVariables.d.ts +11 -2
- package/dist/email-builder-core/blocks/MenuPicker/MenuColumns.d.ts +3 -1
- package/dist/email-builder-core/blocks/MenuPicker/MenuPropsSchema.d.ts +6 -0
- package/dist/host-stubs/config.d.ts +4 -0
- package/dist/host-stubs/modules/content/view/contentViewSelectors.d.ts +4 -0
- package/dist/host-stubs/view/page/form/dialog/PageVariablesPreview.d.ts +5 -0
- package/dist/host-stubs/view/template/form/fields/renameFieldTokens.d.ts +26 -0
- package/dist/host-stubs/view/template/form/fields/types.d.ts +101 -0
- package/dist/{index-BfIWhBCR.cjs → index-BoRfsMEk.cjs} +327 -327
- package/dist/{index-BONR8bWR.js → index-BzP_d1Tz.js} +1 -1
- package/dist/{index-CFA3aG_U.cjs → index-CQKG85qV.cjs} +1 -1
- package/dist/{index-B_cb-ZLC.js → index-CZDJUpCA.js} +37245 -35216
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/render.cjs +115 -115
- package/dist/render.js +1616 -1592
- package/dist/{xlsx-CBpoXUEM.cjs → xlsx-Bc8RxjL3.cjs} +1 -1
- package/dist/{xlsx-DSqBw3Em.js → xlsx-ChzvWWQV.js} +1 -1
- package/package.json +1 -1
|
@@ -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[];
|
|
@@ -108,7 +109,15 @@ export type TemplateFormField = {
|
|
|
108
109
|
*/
|
|
109
110
|
dataSource?: {
|
|
110
111
|
/** `api` = fetch an array of objects from a REST endpoint. */
|
|
111
|
-
type: 'custom' | 'custom-json' | 'api' | 'menu';
|
|
112
|
+
type: 'custom' | 'custom-json' | 'api' | 'menu' | 'pages';
|
|
113
|
+
/** `pages`: page group to list (tenant settings → groups). */
|
|
114
|
+
pageGroup?: string;
|
|
115
|
+
/** `pages`: sub-field id → page field (name, slug, thumbnailImage, …). */
|
|
116
|
+
pageFieldMap?: Record<string, string>;
|
|
117
|
+
/** POST body sent with `apiUrl` (the `pages` source builds it). */
|
|
118
|
+
apiBody?: Record<string, any>;
|
|
119
|
+
/** Minutes between automatic refreshes of the published page. 0/empty = off. */
|
|
120
|
+
ttlMinutes?: number;
|
|
112
121
|
/** Raw JSON text for `custom-json`. */
|
|
113
122
|
customJson?: string;
|
|
114
123
|
/** Endpoint URL for the `api` source. Persisted in config. */
|
|
@@ -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,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
|
+
};
|