pagepilot-visual-editor 1.0.12 → 1.0.14
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/README.md +1 -1
- package/dist/editor/publish/PagePublishDialog.d.ts +1 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/MenuPickerSidebarPanel.d.ts +2 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/ColorInput/Picker.d.ts +3 -1
- package/dist/editor-sample/App/InspectorDrawer/EditorBehavior.d.ts +2 -2
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/repeatRowActions.d.ts +10 -1
- package/dist/editor-sample/App/hooks/page/useSaveHandler.d.ts +1 -0
- package/dist/editor-sample/documents/blocks/MenuPicker/MenuPropsSchema.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/saveAsTemplateUtils.d.ts +29 -5
- package/dist/editor-sample/documents/blocks/helpers/documentUtils.d.ts +12 -0
- package/dist/editor-sample/documents/blocks/helpers/fontFamily.d.ts +12 -0
- package/dist/editor-sample/documents/blocks/helpers/responsiveStyle.d.ts +1 -1
- package/dist/editor-sample/documents/editor/core.d.ts +2 -0
- package/dist/email-builder-core/Reader/responsiveCss.d.ts +12 -0
- package/dist/email-builder-core/blocks/MenuPicker/MenuPropsSchema.d.ts +4 -0
- package/dist/email-builder-core/renderers/renderToStaticMarkup.d.ts +2 -1
- package/dist/index.cjs +1069 -250
- package/dist/index.js +25853 -24316
- package/dist/render-core/combineSections.d.ts +1 -0
- package/dist/render.cjs +108 -105
- package/dist/render.js +3906 -3664
- package/package.json +1 -1
- package/dist/editor-sample/documents/blocks/helpers/responsiveInstanceCss.d.ts +0 -6
package/README.md
CHANGED
|
@@ -784,7 +784,7 @@ a media-library backend — the URL field is the integration point.
|
|
|
784
784
|
|
|
785
785
|
### Pagepilot AI panel
|
|
786
786
|
|
|
787
|
-
Currently a **Coming soon** placeholder. The tab has the purple `AiPanelIcon` in the rail and opens a centered card that says AI-driven page generation is on the way. When the full generator is ported (prompt input + model picker + voice input, per the ahd-fe reference), the panel body swaps in without any other API changes. Hide the tab entirely via `panels={{
|
|
787
|
+
Currently a **Coming soon** placeholder. The tab has the purple `AiPanelIcon` in the rail and opens a centered card that says AI-driven page generation is on the way. When the full generator is ported (prompt input + model picker + voice input, per the ahd-fe reference), the panel body swaps in without any other API changes. Hide the tab entirely via `panels={{ pagepilotAI: false }}`.
|
|
788
788
|
|
|
789
789
|
### Layout panel
|
|
790
790
|
|
|
@@ -22,6 +22,7 @@ interface PagePublishDialogProps {
|
|
|
22
22
|
};
|
|
23
23
|
injectTabsScrollSyncScript?: boolean;
|
|
24
24
|
injectCarouselScript?: boolean;
|
|
25
|
+
injectAnimationScript?: boolean;
|
|
25
26
|
}) => Promise<boolean>;
|
|
26
27
|
}
|
|
27
28
|
export default function PagePublishDialog({ open, onClose, record, apiClient, onSubmit, }: PagePublishDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -29,6 +29,8 @@ type Props = {
|
|
|
29
29
|
* expose an option that would silently be ignored.
|
|
30
30
|
*/
|
|
31
31
|
solidOnly?: boolean;
|
|
32
|
+
/** Heading rendered in the reserved top strip, aligned with the close button. */
|
|
33
|
+
title?: string;
|
|
32
34
|
};
|
|
33
|
-
export default function Picker({ value, onChange, onApply, onTransparent, onClose, noneLabel, hideBrandColors, defaultValue, stickyActions, bodyMaxHeight, solidOnly }: Props): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export default function Picker({ value, onChange, onApply, onTransparent, onClose, noneLabel, hideBrandColors, defaultValue, stickyActions, bodyMaxHeight, solidOnly, title }: Props): import("react/jsx-runtime").JSX.Element;
|
|
34
36
|
export {};
|
|
@@ -18,9 +18,9 @@ export interface EditorPanelToggles {
|
|
|
18
18
|
* Pagepilot AI panel — AI-driven page generation surface. Currently
|
|
19
19
|
* renders a "Coming soon" placeholder; the full generator (prompt +
|
|
20
20
|
* model picker + voice input) will land in a future release. Hidden
|
|
21
|
-
* entirely by passing `
|
|
21
|
+
* entirely by passing `pagepilotAI: false`.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
pagepilotAI?: boolean;
|
|
24
24
|
}
|
|
25
25
|
interface EditorBehaviorProps {
|
|
26
26
|
record: any;
|
|
@@ -16,9 +16,18 @@ export declare function getContainerCapacity(fieldId: string): {
|
|
|
16
16
|
* and grow their single axis. Commits the resized container to the document.
|
|
17
17
|
*/
|
|
18
18
|
export declare function growFieldContainer(fieldId: string, neededSlots: number, direction: 'rows' | 'columns'): void;
|
|
19
|
+
/**
|
|
20
|
+
* Drop repeat rows beyond `keepRows`, removing each surplus clone's subtree from
|
|
21
|
+
* the document in ONE commit (unlike calling removeContainerRepeatRow per row,
|
|
22
|
+
* which re-renders and resets the tab each time). Row 0 is the source block —
|
|
23
|
+
* `keepRows` is clamped to at least 1 so it always survives.
|
|
24
|
+
*/
|
|
25
|
+
export declare function trimFieldRowsTo(fieldId: string, keepRows: number): void;
|
|
19
26
|
/**
|
|
20
27
|
* Seed a container-repeat field from an array of data objects (the Data
|
|
21
|
-
* Reference flow). One object → one repeated copy:
|
|
28
|
+
* Reference flow). One object → one repeated copy: the row count is SYNCED to
|
|
29
|
+
* the data length — surplus rows from a previous, larger fetch are removed
|
|
30
|
+
* first, then rows are grown by stamping
|
|
22
31
|
* clones (up to available container slots) until there's a row per object, then
|
|
23
32
|
* each object's values are written into its row by MATCHING keys to sub-field
|
|
24
33
|
* ids. Non-matching keys are ignored; unmatched sub-fields keep their existing
|
|
@@ -3,6 +3,8 @@ declare const MenuPropsSchema: z.ZodObject<{
|
|
|
3
3
|
menuId: z.ZodDefault<z.ZodString>;
|
|
4
4
|
useCustomMenu: z.ZodDefault<z.ZodBoolean>;
|
|
5
5
|
stickyNav: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
stickyNavTablet: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
7
|
+
stickyNavMobile: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
6
8
|
position: z.ZodDefault<z.ZodEnum<{
|
|
7
9
|
right: "right";
|
|
8
10
|
left: "left";
|
|
@@ -16,6 +16,15 @@ type FormField = any;
|
|
|
16
16
|
export type BlockTemplateConfiguration = {
|
|
17
17
|
isIndividualBlock: true;
|
|
18
18
|
rootBlockId: string;
|
|
19
|
+
/**
|
|
20
|
+
* Every top-level block id in canvas order. Absent (or single-element)
|
|
21
|
+
* for the classic single-block template shape; populated when the author
|
|
22
|
+
* saved a block template whose canvas had additional top-level blocks
|
|
23
|
+
* alongside the primary source (e.g. a Heading placed above the source
|
|
24
|
+
* container). Applying such a template inserts every listed block, not
|
|
25
|
+
* just `rootBlockId`.
|
|
26
|
+
*/
|
|
27
|
+
childrenIds?: string[];
|
|
19
28
|
blocks: BlockMap;
|
|
20
29
|
formFields: FormField[];
|
|
21
30
|
};
|
|
@@ -41,18 +50,33 @@ export declare function extractFormFieldsFromBlocks(blocks: BlockMap, rootBlockI
|
|
|
41
50
|
*
|
|
42
51
|
* `prefillDefaults` (opt-in) flips this: the field's CURRENT value(s) are
|
|
43
52
|
* carried over as the dialog's default value(s) instead of being stripped.
|
|
44
|
-
* Used by the
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* template and must stay empty-by-default.
|
|
53
|
+
* Used by the canvas "Save as block" action and the Variables-panel
|
|
54
|
+
* "Save as new template" shortcut, both of which capture an already-filled-in
|
|
55
|
+
* instance as the starting template.
|
|
48
56
|
*/
|
|
49
57
|
export declare function toAuthoringField(field: FormField, blockIds: Set<string>, prefillDefaults?: boolean): FormField;
|
|
50
58
|
/**
|
|
51
59
|
* Merge the live root formFields (filtered to this subtree) with fields
|
|
52
60
|
* auto-detected from block text, keeping DEFINITIONS only (or prefilled
|
|
53
61
|
* defaults — see `toAuthoringField`).
|
|
62
|
+
*
|
|
63
|
+
* Relevance rules:
|
|
64
|
+
* • container-repeat (`sourceBlockId`) — always kept iff its source block
|
|
65
|
+
* is in `blockIds` (i.e. the container itself came along in the save).
|
|
66
|
+
* • scalar (no `sourceBlockId`) — see `scopeScalarsToDetected` below.
|
|
67
|
+
*
|
|
68
|
+
* `scopeScalarsToDetected` (opt-in) — when true, a scalar root field only
|
|
69
|
+
* survives if its `{{id}}` token was actually detected inside the saved
|
|
70
|
+
* subtree's text by `extractFormFieldsFromBlocks`. Used exclusively by
|
|
71
|
+
* `buildBlockTemplateConfiguration` (the canvas "Save as block" flow) so a
|
|
72
|
+
* block template captures ONLY the scalars its own subtree renders — not
|
|
73
|
+
* every page-level scalar the author authored elsewhere. Off (default)
|
|
74
|
+
* keeps the historical loose behavior for `deriveFromDocument` (whole-page
|
|
75
|
+
* templates, where any authored scalar is fair game) and for
|
|
76
|
+
* `derivePageInitialFormFields` (which has no document to scan and passes
|
|
77
|
+
* `detectedFields=[]`).
|
|
54
78
|
*/
|
|
55
|
-
export declare function buildTemplateFormFields(rootFormFields: FormField[], detectedFields: FormField[], blockIds: Set<string>, prefillDefaults?: boolean): FormField[];
|
|
79
|
+
export declare function buildTemplateFormFields(rootFormFields: FormField[], detectedFields: FormField[], blockIds: Set<string>, prefillDefaults?: boolean, scopeScalarsToDetected?: boolean): FormField[];
|
|
56
80
|
/** Pull color / font-size out of value HTML (`<font color>` or `style="font-size"`). */
|
|
57
81
|
export declare function extractInlineStyle(html: string): {
|
|
58
82
|
color?: string;
|
|
@@ -77,6 +77,18 @@ export declare function writeContainerSlots(block: any, slots: RepeatableSlot[])
|
|
|
77
77
|
* block isn't a repeatable container).
|
|
78
78
|
*/
|
|
79
79
|
export declare function growContainerToFit(documentTree: Record<string, any>, containerId: string, neededSlots: number, direction: 'rows' | 'columns'): Record<string, any>;
|
|
80
|
+
/**
|
|
81
|
+
* Shrink a repeatable container back down to `neededSlots` after a re-seed
|
|
82
|
+
* returned FEWER rows than the previous one. Only trailing EMPTY slots are
|
|
83
|
+
* dropped — a filled slot always stops the shrink, so authored content is never
|
|
84
|
+
* silently deleted. Mirror of growContainerToFit; returns the same document ref
|
|
85
|
+
* when nothing can (or needs to) be removed.
|
|
86
|
+
*
|
|
87
|
+
* Pagination is the case that actually matters visually: its page count is
|
|
88
|
+
* derived from the flat `cells` pool, so leaving 100 cells after a 20-row fetch
|
|
89
|
+
* keeps rendering 9 pager buttons over 80 empty cells.
|
|
90
|
+
*/
|
|
91
|
+
export declare function shrinkContainerToFit(documentTree: Record<string, any>, containerId: string, neededSlots: number): Record<string, any>;
|
|
80
92
|
/**
|
|
81
93
|
* Stamp the subtree rooted at `sourceRootId` (which lives in the container's
|
|
82
94
|
* first filled slot) into the next `count` EMPTY slots. Each stamp is a fresh
|
|
@@ -30,4 +30,16 @@ export declare const QUILL_FONT_OPTIONS: {
|
|
|
30
30
|
css: string;
|
|
31
31
|
}[];
|
|
32
32
|
export declare const QUILL_FONT_WHITELIST: string[];
|
|
33
|
+
export declare const INTER_FONT_FAMILY_VALUE: string;
|
|
34
|
+
/**
|
|
35
|
+
* Normalize `font-family` styles inside pasted HTML against the font list the
|
|
36
|
+
* rich-text picker actually offers. Any family whose first token is not in
|
|
37
|
+
* FONT_FAMILIES is rewritten to Inter (the editor's default) so the pasted
|
|
38
|
+
* content stays readable and consistent with the rest of the document — and
|
|
39
|
+
* the caller can surface a warning listing what was swapped.
|
|
40
|
+
*/
|
|
41
|
+
export declare function normalizePastedFontFamilies(html: string): {
|
|
42
|
+
html: string;
|
|
43
|
+
unsupportedFonts: string[];
|
|
44
|
+
};
|
|
33
45
|
export declare const QUILL_FONT_CSS: string;
|
|
@@ -44,7 +44,7 @@ export declare const RESPONSIVE_PROP_KEYS: readonly ["contentAlignment", "horizo
|
|
|
44
44
|
* {@link nativeKeysForBlock} to get the right set for a block type — never test
|
|
45
45
|
* against this flat list directly.
|
|
46
46
|
*/
|
|
47
|
-
export declare const NATIVE_DEVICE_PROP_KEYS: readonly ["columnsCount", "columnsCountTablet", "columnsCountMobile", "rowsCount", "rowsCountTablet", "rowsCountMobile", "columnsGap", "columnsGapTablet", "columnsGapMobile", "rowsGap", "desktopLayout", "tabletLayout", "mobileLayout", "columnShrink", "columnShrinkTablet", "columnShrinkMobile", "columnsDirection", "columnsDirectionTablet", "columnsDirectionMobile", "widthType", "widthTypeTablet", "widthTypeMobile", "size", "sizeTablet", "sizeMobile", "fixedWidths", "fixedWidthsTablet", "fixedWidthsMobile", "contentAlignmentTablet", "contentAlignmentMobile", "slidesPerView", "slidesPerViewTablet", "slidesPerViewMobile", "width", "widthTablet", "widthMobile", "height", "heightTablet", "heightMobile", "url", "urlTablet", "urlMobile", "iconName", "iconNameTablet", "iconNameMobile", "iconFillColor", "iconFillColorTablet", "iconFillColorMobile", "orientation", "orientationTablet", "orientationMobile", "direction", "directionTablet", "directionMobile", "alignmentTablet", "alignmentMobile", "rotation", "rotationTablet", "rotationMobile", "burgerDropdownBackgroundColor"];
|
|
47
|
+
export declare const NATIVE_DEVICE_PROP_KEYS: readonly ["columnsCount", "columnsCountTablet", "columnsCountMobile", "rowsCount", "rowsCountTablet", "rowsCountMobile", "columnsGap", "columnsGapTablet", "columnsGapMobile", "rowsGap", "desktopLayout", "tabletLayout", "mobileLayout", "columnShrink", "columnShrinkTablet", "columnShrinkMobile", "columnsDirection", "columnsDirectionTablet", "columnsDirectionMobile", "widthType", "widthTypeTablet", "widthTypeMobile", "size", "sizeTablet", "sizeMobile", "fixedWidths", "fixedWidthsTablet", "fixedWidthsMobile", "contentAlignmentTablet", "contentAlignmentMobile", "slidesPerView", "slidesPerViewTablet", "slidesPerViewMobile", "width", "widthTablet", "widthMobile", "height", "heightTablet", "heightMobile", "url", "urlTablet", "urlMobile", "iconName", "iconNameTablet", "iconNameMobile", "iconFillColor", "iconFillColorTablet", "iconFillColorMobile", "orientation", "orientationTablet", "orientationMobile", "direction", "directionTablet", "directionMobile", "alignmentTablet", "alignmentMobile", "rotation", "rotationTablet", "rotationMobile", "burgerDropdownBackgroundColor", "stickyNavTablet", "stickyNavMobile"];
|
|
48
48
|
/**
|
|
49
49
|
* The native per-device prop keys that apply to `blockType`. Unambiguous keys
|
|
50
50
|
* are always native; ambiguous ones only for the block types that actually
|
|
@@ -841,6 +841,8 @@ export declare const EditorBlock: ({ type, data }: import('@usewaypoint/document
|
|
|
841
841
|
menuId: z.ZodDefault<z.ZodString>;
|
|
842
842
|
useCustomMenu: z.ZodDefault<z.ZodBoolean>;
|
|
843
843
|
stickyNav: z.ZodDefault<z.ZodBoolean>;
|
|
844
|
+
stickyNavTablet: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
845
|
+
stickyNavMobile: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
844
846
|
position: z.ZodDefault<z.ZodEnum<{
|
|
845
847
|
right: "right";
|
|
846
848
|
left: "left";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function buildResponsiveStyleCss(elementId: string, responsive: {
|
|
2
|
+
tablet?: {
|
|
3
|
+
style?: Record<string, any>;
|
|
4
|
+
props?: Record<string, any>;
|
|
5
|
+
hidden?: boolean;
|
|
6
|
+
};
|
|
7
|
+
mobile?: {
|
|
8
|
+
style?: Record<string, any>;
|
|
9
|
+
props?: Record<string, any>;
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
};
|
|
12
|
+
} | null | undefined, baseStyle?: Record<string, any> | null, baseProps?: Record<string, any> | null): string;
|
|
@@ -3,6 +3,8 @@ declare const MenuPropsInnerSchema: z.ZodObject<{
|
|
|
3
3
|
menuId: z.ZodDefault<z.ZodString>;
|
|
4
4
|
useCustomMenu: z.ZodDefault<z.ZodBoolean>;
|
|
5
5
|
stickyNav: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
stickyNavTablet: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
7
|
+
stickyNavMobile: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
6
8
|
position: z.ZodDefault<z.ZodEnum<{
|
|
7
9
|
right: "right";
|
|
8
10
|
left: "left";
|
|
@@ -47,6 +49,8 @@ export declare const MenuPropsSchema: z.ZodObject<{
|
|
|
47
49
|
menuId: z.ZodDefault<z.ZodString>;
|
|
48
50
|
useCustomMenu: z.ZodDefault<z.ZodBoolean>;
|
|
49
51
|
stickyNav: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
+
stickyNavTablet: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
53
|
+
stickyNavMobile: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
50
54
|
position: z.ZodDefault<z.ZodEnum<{
|
|
51
55
|
right: "right";
|
|
52
56
|
left: "left";
|
|
@@ -35,7 +35,8 @@ type TOptions = {
|
|
|
35
35
|
isBanner?: boolean;
|
|
36
36
|
injectTabsScrollSyncScript?: boolean;
|
|
37
37
|
injectCarouselScript?: boolean;
|
|
38
|
+
injectAnimationScript?: boolean;
|
|
38
39
|
injectFontAssets?: boolean;
|
|
39
40
|
};
|
|
40
|
-
export default function renderToStaticMarkup(document: TReaderDocument, { rootBlockId, seo, injectElementIds, minifyCss, lang, skipLink, accessibilityTools, includePageCSS, headHtml, bodyBottomHtml, isBanner, injectTabsScrollSyncScript, injectCarouselScript, injectFontAssets, }: TOptions): string;
|
|
41
|
+
export default function renderToStaticMarkup(document: TReaderDocument, { rootBlockId, seo, injectElementIds, minifyCss, lang, skipLink, accessibilityTools, includePageCSS, headHtml, bodyBottomHtml, isBanner, injectTabsScrollSyncScript, injectCarouselScript, injectAnimationScript, injectFontAssets, }: TOptions): string;
|
|
41
42
|
export {};
|