pagepilot-visual-editor 1.0.17 → 1.0.19

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 (24) hide show
  1. package/dist/blocks-internal/block-container/src/index.d.ts +1 -1
  2. package/dist/editor-sample/App/shared/PagePreviewFrame.d.ts +2 -9
  3. package/dist/editor-sample/documents/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +3 -0
  4. package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/constants.d.ts +1 -0
  5. package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/hooks/useToolbarCommands.d.ts +11 -0
  6. package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/primitives/dropdownCoordinator.d.ts +21 -0
  7. package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/selection.d.ts +11 -1
  8. package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/types.d.ts +4 -0
  9. package/dist/editor-sample/documents/blocks/helpers/multilevelList.d.ts +56 -0
  10. package/dist/editor-sample/documents/blocks/helpers/renumberOrderedLists.d.ts +6 -0
  11. package/dist/editor-sample/documents/blocks/helpers/responsiveStyle.d.ts +13 -1
  12. package/dist/editor-sample/documents/editor/core.d.ts +2 -0
  13. package/dist/email-builder-core/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +3 -0
  14. package/dist/{index-BPcOuA23.js → index-DScxm18w.js} +23459 -22930
  15. package/dist/{index-CVMg3yQl.cjs → index-nJH3Oq5R.cjs} +378 -241
  16. package/dist/{index-DXHkxy8p.cjs → index-pQS27xrn.cjs} +1 -1
  17. package/dist/{index-DxxdHQFS.js → index-sAPSABTZ.js} +1 -1
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/render.cjs +215 -103
  21. package/dist/render.js +3360 -3188
  22. package/dist/{xlsx-BIwL8IKs.cjs → xlsx-Be6fzxE8.cjs} +1 -1
  23. package/dist/{xlsx-ByOGYYTp.js → xlsx-DlxnjX4w.js} +1 -1
  24. package/package.json +1 -1
@@ -123,7 +123,7 @@ export type ContainerProps = z.infer<typeof ContainerPropsSchema> & {
123
123
  };
124
124
  export declare const ContainerPropsDefaults: {
125
125
  readonly fullWidth: false;
126
- readonly widthType: "fit";
126
+ readonly widthType: "fill";
127
127
  readonly width: 300;
128
128
  readonly widthUnit: "px";
129
129
  readonly alignment: "left";
@@ -1,16 +1,9 @@
1
1
  import { TReaderDocument } from '../../../email-builder-core/index.ts';
2
2
  export declare function ensureFullHtmlDocument(html: string): string;
3
3
  export declare function getBodyMarkup(html: string): string;
4
- /**
5
- * Renders a page document (or pre-rendered HTML) inside an iframe that
6
- * auto-sizes to its content height. A ResizeObserver measures the content's
7
- * natural layout at the iframe's current width (so the page's own @media
8
- * queries fire correctly) and sets the iframe height to exactly fit — meaning
9
- * the iframe never shows its own scrollbar and never leaves blank space below
10
- * short content. The surrounding container is responsible for any scrolling.
11
- */
12
- export declare function PagePreviewFrame({ savedContent, document, }: {
4
+ export declare function PagePreviewFrame({ savedContent, document, fallbackHeight, }: {
13
5
  savedContent?: string | null;
14
6
  document: TReaderDocument;
7
+ fallbackHeight?: number | string;
15
8
  }): import("react/jsx-runtime").JSX.Element;
16
9
  export default PagePreviewFrame;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export declare const TABS_DEFAULT_NAV_WIDTH = 160;
2
3
  declare const TabsBlockItemSchema: z.ZodObject<{
3
4
  label: z.ZodNullable<z.ZodOptional<z.ZodString>>;
4
5
  contentChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
@@ -35,7 +36,9 @@ declare const TabsBlockPropsSchema: z.ZodObject<{
35
36
  tabGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
36
37
  contentGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
37
38
  navBorderColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
39
+ navWidth: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
38
40
  fontSize: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
41
+ lineHeight: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
39
42
  activeFontSize: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
40
43
  showActiveBorder: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
41
44
  fontFamily: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -18,5 +18,6 @@ export declare const BLOCK_STYLES: Array<{
18
18
  }>;
19
19
  export declare const BLOCK_TAG_SHORT_LABEL: Record<string, string>;
20
20
  export declare const BLOCK_LEVEL_TAGS: Set<string>;
21
+ export declare const BLOCK_TAG_DEFAULT_FONT_SIZE: Record<string, number>;
21
22
  export declare const BLOCK_PREVIEW_STYLE: Record<string, React.CSSProperties>;
22
23
  export declare const COMPACT_THRESHOLD = 1180;
@@ -52,6 +52,17 @@ export type ToolbarCommandsApi = {
52
52
  handleInsertCode: () => void;
53
53
  handleInsertHorizontalRule: () => void;
54
54
  handleSpeechResult: (text: string) => void;
55
+ /** Move the current list item one level deeper (nests under prev sibling). */
56
+ runIndent: () => void;
57
+ /** Move the current list item one level shallower (or out of the list). */
58
+ runOutdent: () => void;
59
+ /**
60
+ * Apply a Word-style multi-level list scheme to the caret's list. If the
61
+ * caret isn't in a list yet, first creates one of the scheme's list-tag
62
+ * (ol / ul) and then tags it. Pass `''` to strip the scheme (revert to a
63
+ * plain <ul>/<ol>).
64
+ */
65
+ applyMultilevelList: (schemeId: string) => void;
55
66
  /** Plain-text of the currently saved selection (for prefilling Link dialog). */
56
67
  getSavedSelectionText: () => string;
57
68
  /** Existing-link info when the selection sits inside an <a>, else null. */
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Ensures only one toolbar dropdown/popover is open at a time.
3
+ *
4
+ * Each Dropdown/ColorSwatchPopover instance manages its own open state and
5
+ * its own outside-click listener independently, with no built-in awareness
6
+ * of sibling instances. Without coordination, opening one while another is
7
+ * already open leaves the first one's state stuck `open=true` (just visually
8
+ * covered), which can produce stale toggle behavior on the next click. This
9
+ * module lets each instance register a `closeSelf` callback while mounted
10
+ * and broadcast "I'm opening" so every other registered instance closes.
11
+ */
12
+ type CloseFn = () => void;
13
+ export declare function registerDropdownInstance(closeSelf: CloseFn): () => void;
14
+ /**
15
+ * Closes every currently-registered (i.e. open) instance. Callers invoke
16
+ * this right before opening themselves, at which point they are not yet
17
+ * registered (registration only happens while `open === true`), so there
18
+ * is no need to exclude "self" here.
19
+ */
20
+ export declare function closeAllDropdowns(): void;
21
+ export {};
@@ -13,7 +13,17 @@
13
13
  */
14
14
  export declare function isRangeInside(range: Range | null, el: HTMLElement | null): boolean;
15
15
  export declare function saveSelectionInside(el: HTMLElement | null): Range | null;
16
- export declare function restoreSelection(range: Range | null, el: HTMLElement | null): void;
16
+ /**
17
+ * Restores a previously-saved range and reports whether it actually landed
18
+ * inside `el`. A range captured before a DOM-mutating command (span
19
+ * replacement, unwrapping, etc.) can end up pointing at nodes that no
20
+ * longer exist by the time the NEXT command runs — `addRange` on a
21
+ * detached range either throws (caught below) or silently produces a
22
+ * selection outside `el`. Callers use the return value to fall back to a
23
+ * known-good position instead of proceeding on a selection that isn't
24
+ * really there.
25
+ */
26
+ export declare function restoreSelection(range: Range | null, el: HTMLElement | null): boolean;
17
27
  /**
18
28
  * Read the actual applied color at the caret, preserving alpha.
19
29
  *
@@ -21,6 +21,10 @@ export type FormatSnapshot = {
21
21
  /** Unitless multiplier (e.g. "1.5") if the block carries an inline
22
22
  * line-height; empty string when the block inherits its default. */
23
23
  lineHeight: string;
24
+ /** ID of the multi-level list scheme applied to the outermost list around
25
+ * the caret (see multilevelList.ts). Empty string when the caret is not
26
+ * inside a scheme-tagged list. */
27
+ mllScheme: string;
24
28
  };
25
29
  export declare const DEFAULT_FORMAT: FormatSnapshot;
26
30
  export type InlineTextToolbarProps = {
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Word-style multi-level list schemes for the Rich Text (Text) block.
3
+ *
4
+ * A "scheme" defines what marker each nesting depth uses. Applied by writing
5
+ * `data-mll="<schemeId>"` onto the OUTERMOST <ol>/<ul>; every descendant list
6
+ * inherits the scheme via `[data-mll="…"] ol/ul` CSS. This keeps the model
7
+ * simple: only the top-level list carries the scheme, so indent/outdent (which
8
+ * creates or unwraps nested lists) doesn't need to keep the attribute in sync
9
+ * across levels.
10
+ *
11
+ * Spacing goals (all matched to Word's built-in Multi-level List defaults):
12
+ * - Text indent per level ≈ 0.5" / 48px (Word uses 0.25"–0.5" per level;
13
+ * 48px is generous enough for markers up to "1.1.1.1" without collision).
14
+ * - Marker column sits in a 40px "hanging" area to the left of the text.
15
+ * - ~4px gap between list items so a multi-item list breathes like Word's
16
+ * 6pt "space after" paragraph default.
17
+ *
18
+ * `list-style-type`-based schemes cover the roman/alpha/decimal permutations
19
+ * and bullet variants. "decimal-dot" (1. / 1.1 / 1.1.1) has to use CSS
20
+ * counters because list-style-type can't concatenate ancestor counters.
21
+ */
22
+ export type MllScheme = {
23
+ id: string;
24
+ label: string;
25
+ /** Short sample rendered as the dropdown row preview. */
26
+ preview: string;
27
+ /** Which list element the top level must be — 'ol' for numbered schemes,
28
+ * 'ul' for bullet-based schemes. */
29
+ listTag: 'ol' | 'ul';
30
+ };
31
+ export declare const MLL_SCHEMES: MllScheme[];
32
+ /**
33
+ * Name of the OUTERMOST-level CSS counter each scheme uses.
34
+ *
35
+ * `renumberOrderedLists` reads this to "continue numbering" across separated
36
+ * `data-mll` ordered lists: it writes an inline `counter-reset: <name> N-1`
37
+ * onto the second-and-later top-level <ol>s so the CSS `::before` counters
38
+ * pick up where the previous list left off — mirroring Word's behavior when
39
+ * you exit a list, type a paragraph, then start a new list of the same style.
40
+ *
41
+ * Schemes NOT in this map use native `list-style-type` counting; those are
42
+ * handled by the browser's `<ol start="N">` attribute (also set by
43
+ * renumberOrderedLists).
44
+ */
45
+ export declare const SCHEME_OUTER_COUNTER: Record<string, string>;
46
+ /**
47
+ * CSS that renders each scheme's per-depth markers. The block-text renderer
48
+ * inlines this so the output HTML is self-contained (works in the canvas,
49
+ * inline editor, preview iframe, and exported email). Kept as one big string
50
+ * to sit next to the block's other injected styles.
51
+ *
52
+ * IMPORTANT: keep selectors as `[data-mll="…"]` on the OUTERMOST list only.
53
+ * Nested ol/ul that carry no attribute pick up the right marker from the
54
+ * descendant selectors below.
55
+ */
56
+ export declare const MLL_CSS: string;
@@ -13,6 +13,12 @@
13
13
  * running count of items across every prior top-level `<ol>` so numbering
14
14
  * continues seamlessly regardless of what content sits between them.
15
15
  *
16
+ * Multi-level list schemes ({@link SCHEME_OUTER_COUNTER}) drive their outer
17
+ * marker off a CSS counter (`::before { content: counter(mll-1) }`), which
18
+ * ignores the `<ol start>` attribute. For those, ALSO write an inline
19
+ * `counter-reset: <name> <N-1>` so the next `counter-increment` inside the
20
+ * list produces `<N>` as the first visible marker.
21
+ *
16
22
  * Nested lists (inside an `<li>`) keep their natural per-level numbering, since
17
23
  * the browser renders them with their own counter scope.
18
24
  */
@@ -26,7 +26,7 @@ export declare const DEVICE_VIEWPORT_WIDTH: Record<TDeviceType, number>;
26
26
  * shared across breakpoints. A per-device edit that isn't in these allowlists
27
27
  * is dropped by {@link applyDeviceEdit}, so overrides can never carry content.
28
28
  */
29
- export declare const RESPONSIVE_STYLE_KEYS: readonly ["fontSize", "fontFamily", "fontWeight", "fontStyle", "textDecoration", "lineHeight", "textAlign", "buttonTextAlign", "padding", "margin", "marginBottom", "width", "height", "borderRadius", "activeFontSize", "showActiveBorder", "tabGap", "contentGap", "starSize", "starGap", "itemGap", "viewportHeight", "arrowSize", "dotSize", "slideGap", "buttonSize", "buttonGap", "buttonRadius", "controlGap", "backgroundImage", "backgroundSize", "backgroundRepeat"];
29
+ export declare const RESPONSIVE_STYLE_KEYS: readonly ["fontSize", "fontFamily", "fontWeight", "fontStyle", "textDecoration", "lineHeight", "textAlign", "buttonTextAlign", "padding", "margin", "marginBottom", "width", "height", "borderRadius", "activeFontSize", "showActiveBorder", "tabGap", "contentGap", "navWidth", "starSize", "starGap", "itemGap", "viewportHeight", "arrowSize", "dotSize", "slideGap", "buttonSize", "buttonGap", "buttonRadius", "controlGap", "backgroundImage", "backgroundSize", "backgroundRepeat"];
30
30
  export declare const RESPONSIVE_PROP_KEYS: readonly ["contentAlignment", "horizontalAlignment", "width", "fontSize", "fontFamily", "fontWeight", "padding", "margin", "blockPadding", "gap", "borderRadius", "iconSize", "lineHeight", "speed", "pauseOnHover", "fadeEdges", "dotSize", "dotSpacing", "numericFontSize", "numericPosition"];
31
31
  /**
32
32
  * NATIVE per-device props: a few layout blocks (Grid / FlexColumns / Pagination)
@@ -51,6 +51,18 @@ export declare const NATIVE_DEVICE_PROP_KEYS: readonly ["columnsCount", "columns
51
51
  * render them with `@media` CSS (see {@link AMBIGUOUS_NATIVE_KEY_OWNERS}).
52
52
  */
53
53
  export declare function nativeKeysForBlock(blockType: string | undefined): string[];
54
+ /**
55
+ * Keep only the responsive-allowed keys from a `{ style?, props? }` override.
56
+ * Anything outside the allowlists (text, url, colours, …) is stripped so it
57
+ * never lands in a device slice.
58
+ *
59
+ * `nativeKeys` is the set this block routes to BASE props instead (see
60
+ * {@link nativeKeysForBlock}); those are excluded here so a value is never
61
+ * written to both places. A prop that is native for SOME block but not this one
62
+ * (e.g. `height` on Spacer) is sliceable here — that's what makes its per-device
63
+ * override actually persist instead of clobbering the desktop base.
64
+ */
65
+ export declare function pickResponsiveOverride(override: Record<string, any>, nativeKeys?: readonly string[]): TDeviceOverride;
54
66
  /** Read the raw (user-authored) override slice for a device. */
55
67
  export declare function getDeviceOverride(data: TResponsiveBlockData | null | undefined, device: TResponsiveDevice): TDeviceOverride;
56
68
  /** True when the user has authored at least one override for the device. */
@@ -480,7 +480,9 @@ export declare const EditorBlock: ({ type, data }: import('@usewaypoint/document
480
480
  tabGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
481
481
  contentGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
482
482
  navBorderColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
483
+ navWidth: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
483
484
  fontSize: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
485
+ lineHeight: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
484
486
  activeFontSize: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
485
487
  showActiveBorder: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
486
488
  fontFamily: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export declare const TABS_DEFAULT_NAV_WIDTH = 160;
2
3
  declare const TabsBlockItemSchema: z.ZodObject<{
3
4
  label: z.ZodNullable<z.ZodOptional<z.ZodString>>;
4
5
  contentChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
@@ -35,7 +36,9 @@ export declare const TabsBlockPropsSchema: z.ZodObject<{
35
36
  tabGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
36
37
  contentGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
37
38
  navBorderColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
39
+ navWidth: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
38
40
  fontSize: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
41
+ lineHeight: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
39
42
  activeFontSize: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
40
43
  showActiveBorder: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
41
44
  fontFamily: z.ZodNullable<z.ZodOptional<z.ZodString>>;