pagepilot-visual-editor 1.0.30 → 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.
- package/CHANGELOG.md +39 -0
- package/dist/blocks-internal/block-button/src/index.d.ts +6 -0
- package/dist/blocks-internal/block-heading/src/index.d.ts +2 -2
- package/dist/blocks-internal/block-list/src/index.d.ts +1 -1
- package/dist/editor-sample/App/InspectorDrawer/BehaviourPanel.d.ts +1 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/MenuPickerSidebarPanel.d.ts +1 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/VariableLinkHint.d.ts +34 -3
- package/dist/editor-sample/App/InspectorDrawer/LayersPanelStyles.d.ts +1 -1
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/ChangeDesignFlow.d.ts +12 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/ChangeTemplateCompareDialog.d.ts +23 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/ChangeTemplateVariablesPane.d.ts +14 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/SectionsModal.d.ts +5 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateCategory.d.ts +1 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateHelpers.d.ts +22 -62
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/AiGenerateButton.d.ts +5 -1
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/EditVariableDialog.d.ts +9 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ItemsArrayRepeatSection.d.ts +2 -3
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/RowCard.d.ts +6 -2
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ScalarFieldRow.d.ts +3 -1
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/aiFill.d.ts +42 -3
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/useAutoRegisterTokenFields.d.ts +13 -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/RichTextAiButton.d.ts +7 -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/TemplatePanel/pageGuide/iframeSrcDoc.d.ts +3 -6
- package/dist/editor-sample/App/shared/PagePreviewFrame.d.ts +17 -2
- package/dist/editor-sample/App/shared/SectionsDropdown.d.ts +2 -2
- package/dist/editor-sample/App/shared/editor.styles.d.ts +2 -2
- package/dist/editor-sample/App/shared/pageSections.d.ts +7 -0
- package/dist/editor-sample/documents/blocks/EmailLayout/EmailLayoutPropsSchema.d.ts +4 -0
- package/dist/editor-sample/documents/blocks/MenuPicker/MenuPropsSchema.d.ts +8 -0
- package/dist/editor-sample/documents/blocks/MenuPicker/menuBlockLabel.d.ts +4 -0
- package/dist/editor-sample/documents/blocks/Table/TableImportDialog.styles.d.ts +6 -6
- 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/InlineTextToolbar/popovers/TableResizeOverlay.d.ts +17 -0
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/saveAsTemplateUtils.d.ts +18 -6
- package/dist/editor-sample/documents/blocks/helpers/documentUtils.d.ts +28 -2
- package/dist/editor-sample/documents/blocks/helpers/responsiveStyle.d.ts +1 -1
- package/dist/editor-sample/documents/blocks/helpers/variableBinding.d.ts +0 -2
- package/dist/editor-sample/documents/editor/EditorContext.d.ts +10 -0
- package/dist/editor-sample/documents/editor/changeSectionDesign.d.ts +36 -0
- package/dist/editor-sample/documents/editor/core.d.ts +23 -2
- package/dist/editor-sample/documents/editor/sectionScope.d.ts +73 -0
- package/dist/editor-sample/documents/editor/templateVariables.d.ts +31 -14
- 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/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 +15 -0
- package/dist/email-builder-core/blocks/MenuPicker/MenuPropsSchema.d.ts +16 -0
- package/dist/email-builder-core/renderers/themeTokens.d.ts +100 -4
- 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/content/view/contentViewSelectors.d.ts +4 -0
- package/dist/host-stubs/modules/shared/axios/authAxios.d.ts +1 -0
- package/dist/host-stubs/modules/websiteV2/propagateFromPage.d.ts +4 -0
- package/dist/host-stubs/view/page/form/dialog/PageVariablesPreview.d.ts +5 -0
- package/dist/host-stubs/view/shared/styles/Table.styles.d.ts +1 -1
- 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-DVx38kGU.cjs → index-BksEeUhc.cjs} +340 -332
- package/dist/{index-B8pdGALF.js → index-Bqru3CFh.js} +59714 -56281
- package/dist/{index-C-KL2oQP.cjs → index-BszXspnA.cjs} +1 -1
- package/dist/{index-CStZQ7E0.js → index-CI-ydHOL.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/render.cjs +176 -168
- package/dist/render.js +4542 -4134
- package/dist/{xlsx-bYU68TCR.js → xlsx-BJAjl_m-.js} +1 -1
- package/dist/{xlsx-DUs4Mvqq.cjs → xlsx-D2eLxkb-.cjs} +1 -1
- package/package.json +1 -1
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/AiFillAllDialog.d.ts +0 -21
|
@@ -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[];
|
|
@@ -26,6 +27,12 @@ export type TemplateItemFieldDef = {
|
|
|
26
27
|
/** `time` sub-fields only — 24h / AM/PM. Timezone reuses `dateTz`. */
|
|
27
28
|
timeFormat?: TimeFormatPreset;
|
|
28
29
|
dateTz?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Items-array fields only: the block item key this sub-field writes to
|
|
32
|
+
* (e.g. MenuPicker `name` / `href`), so the variable id can be anything the
|
|
33
|
+
* author likes (`navLabel`). Falls back to `id` when absent.
|
|
34
|
+
*/
|
|
35
|
+
mapsTo?: string;
|
|
29
36
|
};
|
|
30
37
|
export type TemplateArrayRow = Record<string, string>;
|
|
31
38
|
export type TemplateFormField = {
|
|
@@ -159,6 +166,21 @@ export declare function stripTokenWrapper(html: string, { prefix, suffix }: {
|
|
|
159
166
|
prefix: string;
|
|
160
167
|
suffix: string;
|
|
161
168
|
}): string;
|
|
169
|
+
/**
|
|
170
|
+
* Like stripTokenWrapper, but also returns the EDITED wrapper (outermost
|
|
171
|
+
* layer) so toolbar changes made on it — e.g. clearing tablet/mobile
|
|
172
|
+
* `data-fs-*` on the wrapper span — can be written back to the block instead
|
|
173
|
+
* of being discarded with the strip. `prefix`/`suffix` are null when the
|
|
174
|
+
* wrapper couldn't be matched structurally.
|
|
175
|
+
*/
|
|
176
|
+
export declare function splitEditedTokenHtml(html: string, wrapper: {
|
|
177
|
+
prefix: string;
|
|
178
|
+
suffix: string;
|
|
179
|
+
}): {
|
|
180
|
+
value: string;
|
|
181
|
+
prefix: string | null;
|
|
182
|
+
suffix: string | null;
|
|
183
|
+
};
|
|
162
184
|
/**
|
|
163
185
|
* When a Text/Heading/Button block's text is a SINGLE template token
|
|
164
186
|
* (`{{description}}` for a scalar field, or `{{this.sub}}` for a row sub-field
|
|
@@ -179,23 +201,18 @@ export declare function resolveEditableTokenField(rawText: string, blockId: stri
|
|
|
179
201
|
value: string;
|
|
180
202
|
apply: (next: string, forms: TemplateFormField[]) => TemplateFormField[];
|
|
181
203
|
} | null;
|
|
182
|
-
/**
|
|
183
|
-
|
|
184
|
-
* so the Variables tab stays in sync in real time.
|
|
185
|
-
*
|
|
186
|
-
* - Scalar fields (text / textarea / number / image) and plain array fields
|
|
187
|
-
* (no sourceBlockId): removed when their {{id}} token no longer appears in
|
|
188
|
-
* any remaining block's text props.
|
|
189
|
-
* - Container-repeat array fields (sourceBlockId set):
|
|
190
|
-
* • sourceBlockId gone → whole field removed.
|
|
191
|
-
* • individual rowIds gone → those rows pruned.
|
|
192
|
-
*
|
|
193
|
-
* Returns the SAME reference when nothing changed so callers can skip a write.
|
|
194
|
-
*/
|
|
204
|
+
/** Drop stale MenuPicker container-repeat fields. Same reference when none. */
|
|
205
|
+
export declare function dropStaleMenuRepeatFields(document: TEditorConfiguration | null | undefined, fields: TemplateFormField[]): TemplateFormField[];
|
|
195
206
|
export declare function pruneOrphanFormFields(document: TEditorConfiguration | null | undefined, fields: TemplateFormField[] | null | undefined): TemplateFormField[];
|
|
196
207
|
export declare function getTextFieldsForType(type: string | undefined): string[] | undefined;
|
|
197
208
|
export declare function getTemplateForms(document: TEditorConfiguration | null | undefined): TemplateFormField[];
|
|
198
209
|
export declare function applyVariables(input: string | null | undefined, fields: TemplateFormField[] | null | undefined, rowContext?: TemplateArrayRow | null): string;
|
|
210
|
+
/**
|
|
211
|
+
* Resolve {{tokens}} in MenuPicker `menuItems[]` (name/label/href, recursing
|
|
212
|
+
* into `children[]`). Returns the SAME array reference when nothing changed.
|
|
213
|
+
*/
|
|
214
|
+
export declare function substituteMenuItems(items: any[] | null | undefined, fields: TemplateFormField[] | null | undefined, rowContext?: TemplateArrayRow | null): any[] | null | undefined;
|
|
215
|
+
export declare function htmlToPlainText(html: string): string;
|
|
199
216
|
export declare function substituteBlockText(block: any, fields: TemplateFormField[] | null | undefined, rowContext?: TemplateArrayRow | null, rowIndex?: Map<string, TemplateArrayRow> | null): any;
|
|
200
217
|
/**
|
|
201
218
|
* Permanently substitute every token into the document and drop `formFields`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ContainerProps } from './ContainerPropsSchema';
|
|
2
|
-
export default function ContainerReader({ style, props, blockId }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function ContainerReader({ style, props, responsive, blockId }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,6 +11,10 @@ export declare const EmailLayoutPropsSchema: z.ZodObject<{
|
|
|
11
11
|
borderRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
12
12
|
canvasColor: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString, z.ZodLiteral<"transparent">]>>>>;
|
|
13
13
|
textColor: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString, z.ZodLiteral<"transparent">]>>>;
|
|
14
|
+
hostTheme: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
light: "light";
|
|
16
|
+
follow: "follow";
|
|
17
|
+
}>>>;
|
|
14
18
|
fontFamily: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
15
19
|
MODERN_SANS: "MODERN_SANS";
|
|
16
20
|
BOOK_SANS: "BOOK_SANS";
|
|
@@ -49,6 +49,9 @@ declare const FlexColumnsPropsSchema: z.ZodObject<{
|
|
|
49
49
|
columnShrink: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodBoolean>>>;
|
|
50
50
|
columnShrinkTablet: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodBoolean>>>;
|
|
51
51
|
columnShrinkMobile: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodBoolean>>>;
|
|
52
|
+
columnSpan: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodNumber>>>>;
|
|
53
|
+
columnSpanTablet: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodNumber>>>>;
|
|
54
|
+
columnSpanMobile: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodNumber>>>>;
|
|
52
55
|
equalColumns: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
53
56
|
columns: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
54
57
|
childrenIds: z.ZodArray<z.ZodString>;
|
|
@@ -40,6 +40,8 @@ export type DeviceLayout = {
|
|
|
40
40
|
layout: FlexRowLayout;
|
|
41
41
|
/** Per-column shrink-to-content flags, one entry per column. */
|
|
42
42
|
shrink: boolean[];
|
|
43
|
+
/** Per-column 12-grid span, one entry per column; null = no span. */
|
|
44
|
+
span: (number | null)[];
|
|
43
45
|
/** All non-shrink columns share the row width equally. */
|
|
44
46
|
equalColumns: boolean;
|
|
45
47
|
reverseColumns: boolean;
|
|
@@ -58,7 +60,7 @@ export declare function resolveDeviceLayout(props: FlexProps, device: FlexDevice
|
|
|
58
60
|
* equal — take an identical share of the row, whatever the content
|
|
59
61
|
* plain — grow from natural width
|
|
60
62
|
*/
|
|
61
|
-
export type ColumnKind = 'plain' | 'equal' | 'shrink';
|
|
63
|
+
export type ColumnKind = 'plain' | 'equal' | 'shrink' | 'span';
|
|
62
64
|
/**
|
|
63
65
|
* The block's complete stylesheet: structure, then one fully-restated sizing block
|
|
64
66
|
* per device in ascending-specificity-free source order (desktop → tablet → mobile).
|
|
@@ -75,7 +77,7 @@ export declare function buildResponsiveRowCss(instanceClass: string, opts: {
|
|
|
75
77
|
* owns that at every breakpoint. Kept for the editor canvas, which renders without
|
|
76
78
|
* the stylesheet and needs the active device's sizing directly.
|
|
77
79
|
*/
|
|
78
|
-
export declare function buildColumnStyle(kind: ColumnKind, stacked: boolean): CSSProperties;
|
|
80
|
+
export declare function buildColumnStyle(kind: ColumnKind, stacked: boolean, span?: number | null, gap?: number): CSSProperties;
|
|
79
81
|
/** The kind of a column on a given device — shared by the editor and the reader. */
|
|
80
82
|
export declare function columnKindFor(index: number, device: DeviceLayout): ColumnKind;
|
|
81
83
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
p: any;
|
|
4
|
+
menuItems: any[];
|
|
5
|
+
menuKey: string;
|
|
6
|
+
textColor: string;
|
|
7
|
+
submenuTextColor?: string | null;
|
|
8
|
+
submenuFontSize?: string | null;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
fontFamily?: string;
|
|
11
|
+
start?: React.ReactNode;
|
|
12
|
+
end?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
declare const MenuColumns: ({ p, menuItems, menuKey, textColor, submenuTextColor, submenuFontSize, backgroundColor, fontFamily, start, end }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default MenuColumns;
|
|
@@ -2,6 +2,10 @@ import { z } from 'zod';
|
|
|
2
2
|
declare const MenuPropsInnerSchema: z.ZodObject<{
|
|
3
3
|
menuId: z.ZodDefault<z.ZodString>;
|
|
4
4
|
useCustomMenu: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
+
navRole: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
footer: "footer";
|
|
7
|
+
header: "header";
|
|
8
|
+
}>>>;
|
|
5
9
|
stickyNav: z.ZodDefault<z.ZodBoolean>;
|
|
6
10
|
stickyNavTablet: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
7
11
|
stickyNavMobile: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -13,6 +17,7 @@ declare const MenuPropsInnerSchema: z.ZodObject<{
|
|
|
13
17
|
orientation: z.ZodDefault<z.ZodEnum<{
|
|
14
18
|
vertical: "vertical";
|
|
15
19
|
horizontal: "horizontal";
|
|
20
|
+
columns: "columns";
|
|
16
21
|
}>>;
|
|
17
22
|
menuItems: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>>;
|
|
18
23
|
startChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
@@ -29,6 +34,9 @@ declare const MenuPropsInnerSchema: z.ZodObject<{
|
|
|
29
34
|
submenuBackgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
30
35
|
submenuRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
31
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>>;
|
|
32
40
|
submenuPadding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
33
41
|
top: z.ZodNumber;
|
|
34
42
|
right: z.ZodNumber;
|
|
@@ -71,6 +79,10 @@ export declare const MenuPropsSchema: z.ZodObject<{
|
|
|
71
79
|
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
72
80
|
menuId: z.ZodDefault<z.ZodString>;
|
|
73
81
|
useCustomMenu: z.ZodDefault<z.ZodBoolean>;
|
|
82
|
+
navRole: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
footer: "footer";
|
|
84
|
+
header: "header";
|
|
85
|
+
}>>>;
|
|
74
86
|
stickyNav: z.ZodDefault<z.ZodBoolean>;
|
|
75
87
|
stickyNavTablet: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
76
88
|
stickyNavMobile: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -82,6 +94,7 @@ export declare const MenuPropsSchema: z.ZodObject<{
|
|
|
82
94
|
orientation: z.ZodDefault<z.ZodEnum<{
|
|
83
95
|
vertical: "vertical";
|
|
84
96
|
horizontal: "horizontal";
|
|
97
|
+
columns: "columns";
|
|
85
98
|
}>>;
|
|
86
99
|
menuItems: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>>;
|
|
87
100
|
startChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
@@ -98,6 +111,9 @@ export declare const MenuPropsSchema: z.ZodObject<{
|
|
|
98
111
|
submenuBackgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
99
112
|
submenuRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
100
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>>;
|
|
101
117
|
submenuPadding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
102
118
|
top: z.ZodNumber;
|
|
103
119
|
right: z.ZodNumber;
|
|
@@ -1,9 +1,105 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Host-application theme support.
|
|
3
|
+
*
|
|
4
|
+
* Published output follows the host's light/dark theme through CSS custom
|
|
5
|
+
* properties (`--pp-*`) defined by `HOST_THEME_CSS`. A color adapts only when it
|
|
6
|
+
* is rendered in a theme-role slot AND its value is null or that slot's own
|
|
7
|
+
* seed default; every other value stays literal. Light = variables undefined,
|
|
8
|
+
* so each `var(--pp-x, <literal>)` resolves to the original literal.
|
|
5
9
|
*/
|
|
10
|
+
export type ThemeRole = 'text' | 'text-strong' | 'text-muted' | 'link' | 'surface' | 'surface-alt' | 'track' | 'border' | 'border-subtle';
|
|
11
|
+
export type ThemeSlotDef = {
|
|
12
|
+
role: ThemeRole;
|
|
13
|
+
/** Values (normalized) that count as the editor-seeded default for this slot. */
|
|
14
|
+
seeds: string[];
|
|
15
|
+
/** Applied when raw is null. Without it a null raw stays undefined (inherits). */
|
|
16
|
+
nullFallback?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function normalizeColor(raw: string | null | undefined): string;
|
|
19
|
+
/** Central registry of theme-aware slots (see host-theme-plan.md, matrix C). */
|
|
20
|
+
export declare const THEME_SLOTS: {
|
|
21
|
+
readonly pageText: ThemeSlotDef;
|
|
22
|
+
readonly containerFill: ThemeSlotDef;
|
|
23
|
+
readonly layoutText: ThemeSlotDef;
|
|
24
|
+
readonly canvas: ThemeSlotDef;
|
|
25
|
+
readonly closeIcon: ThemeSlotDef;
|
|
26
|
+
readonly brandingText: ThemeSlotDef;
|
|
27
|
+
readonly blockText: ThemeSlotDef;
|
|
28
|
+
readonly listText: ThemeSlotDef;
|
|
29
|
+
readonly link: ThemeSlotDef;
|
|
30
|
+
readonly codeBg: ThemeSlotDef;
|
|
31
|
+
readonly quoteBorder: ThemeSlotDef;
|
|
32
|
+
readonly divider: ThemeSlotDef;
|
|
33
|
+
readonly tableText: ThemeSlotDef;
|
|
34
|
+
readonly tableBorder: ThemeSlotDef;
|
|
35
|
+
readonly tableHeaderBg: ThemeSlotDef;
|
|
36
|
+
readonly tableHeaderText: ThemeSlotDef;
|
|
37
|
+
readonly tableStripe: ThemeSlotDef;
|
|
38
|
+
readonly track: ThemeSlotDef;
|
|
39
|
+
readonly trackText: ThemeSlotDef;
|
|
40
|
+
readonly timerText: ThemeSlotDef;
|
|
41
|
+
readonly timerLabel: ThemeSlotDef;
|
|
42
|
+
readonly timerTrack: ThemeSlotDef;
|
|
43
|
+
readonly breadcrumbText: ThemeSlotDef;
|
|
44
|
+
readonly menuText: ThemeSlotDef;
|
|
45
|
+
readonly menuSurface: ThemeSlotDef;
|
|
46
|
+
readonly carouselArrow: ThemeSlotDef;
|
|
47
|
+
readonly carouselArrowBg: ThemeSlotDef;
|
|
48
|
+
readonly carouselArrowBorder: ThemeSlotDef;
|
|
49
|
+
readonly carouselDot: ThemeSlotDef;
|
|
50
|
+
readonly carouselDotActive: ThemeSlotDef;
|
|
51
|
+
readonly paginationBg: ThemeSlotDef;
|
|
52
|
+
readonly paginationText: ThemeSlotDef;
|
|
53
|
+
readonly paginationBorder: ThemeSlotDef;
|
|
54
|
+
readonly surface: ThemeSlotDef;
|
|
55
|
+
readonly surfaceLiteral: ThemeSlotDef;
|
|
56
|
+
readonly bgAdaptive: ThemeSlotDef;
|
|
57
|
+
readonly buttonText: ThemeSlotDef;
|
|
58
|
+
readonly borderAdaptive: ThemeSlotDef;
|
|
59
|
+
readonly borderSubtle: ThemeSlotDef;
|
|
60
|
+
readonly surfaceAlt: ThemeSlotDef;
|
|
61
|
+
readonly tabsRing: ThemeSlotDef;
|
|
62
|
+
};
|
|
63
|
+
export type ThemeSlotName = keyof typeof THEME_SLOTS;
|
|
64
|
+
/** Dark-mode counterpart of an authored color, or null when it should stay as authored. */
|
|
65
|
+
export declare function darkCounterpart(raw: string, kind: 'text' | 'bg'): string | null;
|
|
66
|
+
/** True when this light solid background gets a dark counterpart (so no light lock is needed). */
|
|
67
|
+
/** True when a background is effectively see-through (empty, transparent or alpha 0). */
|
|
68
|
+
export declare function isClearBg(raw: string | null | undefined): boolean;
|
|
69
|
+
export declare function isAdaptableBg(raw: string | null | undefined): boolean;
|
|
70
|
+
type GradientKind = 'text' | 'bg' | 'border';
|
|
71
|
+
export declare const gradientKindForRole: (role: ThemeRole) => GradientKind;
|
|
72
|
+
/** Theme the seed colors of every gradient in `raw`; everything else is preserved verbatim. */
|
|
73
|
+
export declare function themeGradient(raw: string, kind?: GradientKind): string;
|
|
74
|
+
/** True when every opaque stop of the gradient adapts (so no light surface lock is needed). */
|
|
75
|
+
export declare function isFullyAdaptiveGradient(raw: string, kind?: GradientKind): boolean;
|
|
76
|
+
/** Resolve a raw color for a slot: var(--pp-role, literal) when adaptable, else literal. */
|
|
77
|
+
export declare function themeSlot(raw: string | null | undefined, name: ThemeSlotName | ThemeSlotDef): string | undefined;
|
|
78
|
+
export declare function useThemeSlot(raw: string | null | undefined, name: ThemeSlotName | ThemeSlotDef): string | undefined;
|
|
79
|
+
/** Plain-function form for colors in lists/maps (no hook rules). */
|
|
80
|
+
export declare function useThemeSlotter(): typeof themeSlot;
|
|
81
|
+
/**
|
|
82
|
+
* Spread on the element that paints an author background. Locks the subtree to
|
|
83
|
+
* light so default text stays readable on author-painted surfaces.
|
|
84
|
+
*/
|
|
85
|
+
export declare function surfaceAttrs(bgRaw?: string | null, bgImage?: string | null, adaptiveSlot?: ThemeSlotName): {
|
|
86
|
+
'data-pp-surface'?: 'fixed';
|
|
87
|
+
};
|
|
6
88
|
export declare function useColorToken(raw: string | null | undefined): string | undefined;
|
|
7
|
-
/** Plain-function form for colors that live in a list (no hook rules). */
|
|
8
89
|
export declare function useColorTokenizer(): (raw: string | null | undefined) => string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Theme colors the rich-text toolbar baked into the markup (`<font color>` and
|
|
92
|
+
* inline `color:` declarations). Neutral dark text gets a light-dark() pair so it
|
|
93
|
+
* stays readable on a dark host; tinted/light colors stay as authored.
|
|
94
|
+
*/
|
|
95
|
+
export declare function themeHtmlColors(html: string): string;
|
|
96
|
+
/** Inverse of themeHtmlColors: restores the authored color so edited HTML is saved untouched. */
|
|
97
|
+
export declare function unthemeHtmlColors(html: string): string;
|
|
9
98
|
export declare function useThemedHtml(html: string): string;
|
|
99
|
+
/**
|
|
100
|
+
* Nearest marked element wins: marker rules DEFINE the variables on the element
|
|
101
|
+
* carrying the marker, descendants inherit. :where() keeps specificity at 0, so
|
|
102
|
+
* same-element conflicts are decided by source order (weakest first).
|
|
103
|
+
*/
|
|
104
|
+
export declare const HOST_THEME_CSS: string;
|
|
105
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { noopListActions as default } from '../_hostListShim';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { noopListSelectors as default } from '../_hostListShim';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const StyledCellContainer: import('@emotion/styled').StyledComponent<import('@mui/system').BoxOwnProps<import('@mui/material').Theme> & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
2
|
-
export declare const StyledCellValue: import('@emotion/styled').StyledComponent<import('@mui/material').TypographyOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "top" | "bottom" | "right" | "left" | "padding" | "margin" | "style" | "lineHeight" | "children" | "className" | "fontSize" | "fontFamily" | "fontWeight" | "fontStyle" | "textAlign" | "marginBottom" | "width" | "height" | "borderRadius" | "borderColor" | "gap" | "p" | "color" | "flex" | "display" | "position" | "
|
|
2
|
+
export declare const StyledCellValue: import('@emotion/styled').StyledComponent<import('@mui/material').TypographyOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "border" | "top" | "bottom" | "right" | "left" | "padding" | "margin" | "style" | "lineHeight" | "children" | "className" | "fontSize" | "fontFamily" | "fontWeight" | "fontStyle" | "textAlign" | "marginBottom" | "width" | "height" | "borderRadius" | "borderColor" | "gap" | "p" | "color" | "flex" | "display" | "position" | "paddingBottom" | "align" | "bgcolor" | "borderTop" | "px" | "boxShadow" | "overflow" | "variant" | "paddingX" | "paddingY" | "marginX" | "marginY" | "maxWidth" | "maxHeight" | "classes" | "sx" | "letterSpacing" | "order" | "visibility" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "marginBlockEnd" | "marginBlockStart" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "minHeight" | "minWidth" | "paddingBlockEnd" | "paddingBlockStart" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "rowGap" | "textOverflow" | "textTransform" | "whiteSpace" | "borderBottom" | "borderLeft" | "borderRight" | "gridArea" | "gridColumn" | "gridRow" | "marginBlock" | "marginInline" | "paddingBlock" | "paddingInline" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "py" | "typography" | "displayPrint" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
3
3
|
export declare const StyledCopyIconContainer: import('@emotion/styled').StyledComponent<import('@mui/system').BoxOwnProps<import('@mui/material').Theme> & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
@@ -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
|
+
};
|