pagepilot-visual-editor 1.0.4 → 1.0.6
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 +277 -54
- package/dist/api/ApiClientContext.d.ts +17 -0
- package/dist/api/PagepilotApiClient.d.ts +63 -0
- package/dist/api/useTenantPlan.d.ts +25 -0
- package/dist/blocks-internal/block-button/src/index.d.ts +32 -1
- package/dist/blocks-internal/block-button-group/src/index.d.ts +20 -1
- package/dist/blocks-internal/block-columns-container/src/index.d.ts +38 -0
- package/dist/blocks-internal/block-container/src/index.d.ts +44 -5
- package/dist/blocks-internal/block-divider/src/index.d.ts +6 -0
- package/dist/blocks-internal/block-grid/src/index.d.ts +6 -0
- package/dist/blocks-internal/block-heading/src/index.d.ts +3 -2
- package/dist/blocks-internal/block-html/src/index.d.ts +6 -0
- package/dist/blocks-internal/block-iframe/src/index.d.ts +4 -0
- package/dist/blocks-internal/block-image/src/index.d.ts +17 -0
- package/dist/blocks-internal/block-logo/src/index.d.ts +20 -7
- package/dist/blocks-internal/block-stepper/src/index.d.ts +2 -2
- package/dist/blocks-internal/block-text/src/index.d.ts +1 -1
- package/dist/blocks-internal/block-video/src/index.d.ts +4 -0
- package/dist/blocks-internal/block-youtube-url/src/index.d.ts +4 -0
- package/dist/editor/Shell.d.ts +1 -1
- package/dist/editor/blockToggles.d.ts +1 -1
- package/dist/editor/publish/PagePublishDialog.d.ts +21 -0
- package/dist/editor/types.d.ts +63 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/ResponsiveModeContext.d.ts +12 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/blockStyleClipboard.d.ts +4 -4
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/AppBannerPickerSidebarPanel.d.ts +19 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/DemoPickerSidebarPanel.d.ts +31 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/EmailLayoutSidebarPanel.d.ts +26 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/FaqPickerSidebarPanel.d.ts +18 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/FormsPickerSidebarPanel.d.ts +18 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/MenuPickerSidebarPanel.d.ts +34 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/PaginationSidebarPanel.d.ts +7 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/TableSidebarPanel.d.ts +9 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/TimerSidebarPanel.d.ts +7 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/CollapsibleSection.d.ts +8 -2
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/MediaLibraryButton.d.ts +1 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/SectionWrapper.d.ts +2 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/deviceProp.d.ts +14 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/ColorInput/BaseColorInput.d.ts +4 -2
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/ColorInput/Picker.d.ts +7 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/ColorInput/index.d.ts +3 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/PaddingInput.d.ts +4 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/RadiusInput.d.ts +13 -11
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/SelectInput.d.ts +15 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/StepperInput.d.ts +19 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/WidthInputWithSelect.d.ts +4 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/sanitizeAgainstSchema.d.ts +11 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/style-inputs/MultiStylePropertyPanel.d.ts +2 -1
- package/dist/editor-sample/App/InspectorDrawer/EditorBehavior.d.ts +16 -0
- package/dist/editor-sample/App/InspectorDrawer/LayersPanelStyles.d.ts +2 -2
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/SectionsModal.d.ts +15 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/TemplatePreviewDialog.d.ts +14 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/TemplatesList.d.ts +45 -0
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/icons/index.d.ts +37 -1
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateApplyHelpers.d.ts +101 -0
- package/dist/editor-sample/App/InspectorDrawer/PagePilotAiPanel.d.ts +1 -0
- package/dist/editor-sample/App/InspectorDrawer/SeoPanel/SeoFieldLabel.d.ts +7 -0
- package/dist/editor-sample/App/InspectorDrawer/SeoPanel/SeoPanel.styled.d.ts +12 -0
- package/dist/editor-sample/App/InspectorDrawer/SeoPanel/index.d.ts +6 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ApiResponseDialog.d.ts +10 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ArrayFieldEditor.d.ts +14 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ContainerRepeatSection.d.ts +9 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/DataReferenceDialog.d.ts +15 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/DataReferencePanel.d.ts +20 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/GrowDirectionDialog.d.ts +13 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/RowCard.d.ts +23 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/SectionHeader.d.ts +13 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/VariablesPaywall.d.ts +1 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/constants.d.ts +2 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/dataReferenceUtils.d.ts +34 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/index.d.ts +1 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/repeatRowActions.d.ts +31 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/styles.d.ts +53 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/upgradeDialog.d.ts +4 -0
- package/dist/editor-sample/App/InspectorDrawer/components/MiniRichTextInput.d.ts +7 -0
- package/dist/editor-sample/App/InspectorDrawer/components/ScalarFieldInput.d.ts +10 -0
- package/dist/editor-sample/App/shared/editor.styles.d.ts +3 -3
- package/dist/editor-sample/documents/blocks/Accordion/AccordionPropsSchema.d.ts +6 -0
- package/dist/editor-sample/documents/blocks/AppBannerPicker/AppBannerEditor.d.ts +18 -0
- package/dist/editor-sample/documents/blocks/AppBannerPicker/AppBannerPropsSchema.d.ts +14 -0
- package/dist/editor-sample/documents/blocks/AppBannerPicker/appBanner.styled.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/ButtonGroup/ButtonGroupPropsSchema.d.ts +20 -1
- package/dist/editor-sample/documents/blocks/Carousel/CarouselPropsSchema.d.ts +7 -0
- package/dist/editor-sample/documents/blocks/ColumnsContainer/ColumnsContainerPropsSchema.d.ts +38 -0
- package/dist/editor-sample/documents/blocks/Container/ContainerPropsSchema.d.ts +56 -3
- package/dist/editor-sample/documents/blocks/DemoPicker/DemoEditor.d.ts +3 -0
- package/dist/editor-sample/documents/blocks/DemoPicker/DemoPropsSchema.d.ts +37 -0
- package/dist/editor-sample/documents/blocks/EmailLayout/EmailLayoutEditor.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/{PagePilotLayout/PagePilotLayoutPropsSchema.d.ts → EmailLayout/EmailLayoutPropsSchema.d.ts} +51 -4
- package/dist/editor-sample/documents/blocks/FaqPicker/FaqEditor.d.ts +18 -0
- package/dist/editor-sample/documents/blocks/FaqPicker/FaqPickerPropsSchema.d.ts +14 -0
- package/dist/editor-sample/documents/blocks/FaqPicker/faqPicker.styled.d.ts +3 -0
- package/dist/editor-sample/documents/blocks/FlexColumns/FlexColumnsEditor.d.ts +6 -0
- package/dist/editor-sample/documents/blocks/FormsPicker/FormsEditor.d.ts +3 -0
- package/dist/editor-sample/documents/blocks/FormsPicker/FormsPropsSchema.d.ts +33 -0
- package/dist/editor-sample/documents/blocks/Grid/GridPropsSchema.d.ts +13 -2
- package/dist/editor-sample/documents/blocks/Marquee/MarqueePropsSchema.d.ts +12 -0
- package/dist/editor-sample/documents/blocks/MenuPicker/MenuEditor.d.ts +7 -0
- package/dist/editor-sample/documents/blocks/MenuPicker/MenuPropsSchema.d.ts +45 -0
- package/dist/editor-sample/documents/blocks/MenuPicker/mergeMenuItems.d.ts +13 -0
- package/dist/editor-sample/documents/blocks/Pagination/PaginationEditor.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/Pagination/PaginationPropsSchema.d.ts +4 -0
- package/dist/editor-sample/documents/blocks/Table/TableCellEditor.d.ts +11 -0
- package/dist/editor-sample/documents/blocks/Table/TableEditor.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/Table/TablePropsSchema.d.ts +1 -0
- package/dist/editor-sample/documents/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +12 -0
- package/dist/editor-sample/documents/blocks/Timer/TimerEditor.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/Timer/TimerPropsSchema.d.ts +38 -0
- package/dist/editor-sample/documents/blocks/Timer/timerMath.d.ts +9 -0
- package/dist/editor-sample/documents/blocks/Timer/variants/CircularProgressView.d.ts +9 -0
- package/dist/editor-sample/documents/blocks/Timer/variants/DigitalFlipView.d.ts +9 -0
- package/dist/editor-sample/documents/blocks/Timer/variants/TextInlineView.d.ts +9 -0
- package/dist/editor-sample/documents/blocks/helpers/BlockCategories.d.ts +1 -0
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/BlockButton.d.ts +1 -1
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/BlocksMenu.d.ts +1 -1
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/DividerButton.d.ts +2 -1
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/PlaceholderButton.d.ts +2 -1
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/blockMenuStyles.d.ts +11 -0
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/brandButtonDefaults.d.ts +4 -2
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/buttons.d.ts +8 -0
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/gridPresets.d.ts +17 -0
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/index.d.ts +3 -2
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/index.d.ts +2 -1
- package/dist/editor-sample/documents/blocks/helpers/TStyle.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/saveAsTemplateUtils.d.ts +97 -0
- package/dist/editor-sample/documents/blocks/helpers/documentUtils.d.ts +96 -17
- package/dist/editor-sample/documents/blocks/helpers/responsiveStyle.d.ts +106 -0
- package/dist/editor-sample/documents/blocks/helpers/zod.d.ts +1 -1
- package/dist/editor-sample/documents/editor/EditorContext.d.ts +11 -2
- package/dist/editor-sample/documents/editor/core.d.ts +575 -16
- package/dist/editor-sample/documents/editor/templateVariables.d.ts +73 -0
- package/dist/email-builder-core/blocks/Accordion/AccordionPropsSchema.d.ts +6 -0
- package/dist/email-builder-core/blocks/AppBannerPicker/AppBannerPropsSchema.d.ts +16 -0
- package/dist/email-builder-core/blocks/AppBannerPicker/AppBannerReader.d.ts +3 -0
- package/dist/email-builder-core/blocks/ButtonGroup/ButtonGroupPropsSchema.d.ts +20 -1
- package/dist/email-builder-core/blocks/Calendly/CalendlyPropsSchema.d.ts +4 -0
- package/dist/email-builder-core/blocks/Carousel/CarouselPropsSchema.d.ts +6 -0
- package/dist/email-builder-core/blocks/ColumnsContainer/ColumnsContainerPropsSchema.d.ts +38 -0
- package/dist/email-builder-core/blocks/Container/ContainerPropsSchema.d.ts +56 -3
- package/dist/email-builder-core/blocks/DemoPicker/DemoPropsSchema.d.ts +36 -0
- package/dist/email-builder-core/blocks/DemoPicker/DemoReader.d.ts +3 -0
- package/dist/email-builder-core/blocks/{PagePilotLayout/PagePilotLayoutPropsSchema.d.ts → EmailLayout/EmailLayoutPropsSchema.d.ts} +41 -2
- package/dist/email-builder-core/blocks/EmailLayout/EmailLayoutReader.d.ts +3 -0
- package/dist/email-builder-core/blocks/EmailLayout/emailLayoutResponsive.d.ts +46 -0
- package/dist/email-builder-core/blocks/FaqPicker/FaqPickerPropsSchema.d.ts +16 -0
- package/dist/email-builder-core/blocks/FaqPicker/FaqReader.d.ts +3 -0
- package/dist/email-builder-core/blocks/FlexColumns/FlexColumnsPropsSchema.d.ts +23 -2
- package/dist/email-builder-core/blocks/FlexColumns/FlexColumnsReader.d.ts +6 -0
- package/dist/email-builder-core/blocks/FlexColumns/flexColumnsHelpers.d.ts +71 -1
- package/dist/email-builder-core/blocks/FormsPicker/FormsPropsSchema.d.ts +19 -0
- package/dist/email-builder-core/blocks/FormsPicker/FormsReader.d.ts +3 -0
- package/dist/email-builder-core/blocks/Grid/GridPropsSchema.d.ts +12 -2
- package/dist/email-builder-core/blocks/Marquee/MarqueePropsSchema.d.ts +16 -0
- package/dist/email-builder-core/blocks/Marquee/MarqueeReader.d.ts +1 -1
- package/dist/email-builder-core/blocks/Marquee/marqueeMotion.d.ts +40 -0
- package/dist/email-builder-core/blocks/MenuPicker/MenuPropsSchema.d.ts +87 -0
- package/dist/email-builder-core/blocks/MenuPicker/MenuReader.d.ts +3 -0
- package/dist/email-builder-core/blocks/MenuPicker/menuResponsiveCss.d.ts +27 -0
- package/dist/email-builder-core/blocks/Pagination/PaginationPropsSchema.d.ts +119 -0
- package/dist/email-builder-core/blocks/Pagination/PaginationReader.d.ts +2 -0
- package/dist/email-builder-core/blocks/Pagination/paginationShared.d.ts +74 -0
- package/dist/email-builder-core/blocks/Table/TablePropsSchema.d.ts +48 -0
- package/dist/email-builder-core/blocks/Table/TableReader.d.ts +13 -0
- package/dist/email-builder-core/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +12 -0
- package/dist/email-builder-core/blocks/Timer/TimerPropsSchema.d.ts +38 -0
- package/dist/email-builder-core/blocks/Timer/TimerReader.d.ts +2 -0
- package/dist/email-builder-core/blocks/Timer/variants/CircularProgressView.d.ts +11 -0
- package/dist/email-builder-core/blocks/Timer/variants/DigitalFlipView.d.ts +11 -0
- package/dist/email-builder-core/blocks/Timer/variants/TextInlineView.d.ts +11 -0
- package/dist/email-builder-core/blocks/responsiveBreakpoints.d.ts +32 -0
- package/dist/host-stubs/modules/_hostListShim.d.ts +18 -0
- package/dist/host-stubs/modules/appBannerV2/list/appBannerListActions.d.ts +1 -0
- package/dist/host-stubs/modules/appBannerV2/list/appBannerListSelectors.d.ts +1 -0
- package/dist/host-stubs/modules/demo/list/demoListActions.d.ts +1 -0
- package/dist/host-stubs/modules/demo/list/demoListSelectors.d.ts +1 -0
- package/dist/host-stubs/modules/faqGroup/list/faqGroupListActions.d.ts +1 -0
- package/dist/host-stubs/modules/faqGroup/list/faqGroupListSelectors.d.ts +1 -0
- package/dist/host-stubs/modules/forms/formsService.d.ts +9 -0
- package/dist/host-stubs/modules/menu/list/menuListActions.d.ts +1 -0
- package/dist/host-stubs/modules/menu/list/menuListSelectors.d.ts +1 -0
- package/dist/host-stubs/modules/store.d.ts +3 -0
- package/dist/host-stubs/react-redux.d.ts +3 -0
- package/dist/host-stubs/style/menu.styled.d.ts +73 -15
- package/dist/host-stubs/tanstack-react-query.d.ts +9 -0
- package/dist/host-stubs/view/shared/htmlSanitize.d.ts +15 -0
- package/dist/index.cjs +381 -817
- package/dist/index.d.ts +2 -0
- package/dist/index.js +64041 -101752
- package/dist/style.css +1 -1
- package/package.json +2 -10
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/PagePilotLayoutSidebarPanel.d.ts +0 -24
- package/dist/editor-sample/documents/blocks/PagePilotLayout/PagePilotLayoutEditor.d.ts +0 -2
- package/dist/email-builder-core/blocks/PagePilotLayout/PagePilotLayoutReader.d.ts +0 -3
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { FlexColumnsProps } from './FlexColumnsPropsSchema';
|
|
3
|
+
/**
|
|
4
|
+
* FlexColumns layout model
|
|
5
|
+
* ========================
|
|
6
|
+
* ONE source of truth: the per-instance stylesheet this module emits owns ALL
|
|
7
|
+
* row/column sizing, at every breakpoint. Inline styles deliberately set NOTHING
|
|
8
|
+
* that the CSS also sets — otherwise the two fight and you need `!important` to
|
|
9
|
+
* settle it, which is how this block historically broke.
|
|
10
|
+
*
|
|
11
|
+
* Consequences of that rule, and why the code looks the way it does:
|
|
12
|
+
*
|
|
13
|
+
* - Sizing is emitted once per DEVICE (desktop / tablet / mobile), never "base +
|
|
14
|
+
* patches". Each device block fully restates every column kind, so a device is
|
|
15
|
+
* never at the mercy of what an earlier block happened to leave behind.
|
|
16
|
+
*
|
|
17
|
+
* - Every sizing selector is written at the SAME specificity (see `colSelectors`).
|
|
18
|
+
* `@media` adds no specificity, so a device rule can only beat the desktop rule
|
|
19
|
+
* if it matches it exactly. Uniform specificity + source order (desktop, then
|
|
20
|
+
* tablet, then mobile) makes the cascade predictable and removes `!important`.
|
|
21
|
+
*
|
|
22
|
+
* - Column KIND (plain / equal / shrink) is expressed by `:nth-child(n)`, not by a
|
|
23
|
+
* class. A class is baked once at render and cannot differ per breakpoint in
|
|
24
|
+
* static HTML — so a column that shrinks only on mobile is unrepresentable as a
|
|
25
|
+
* class, and the old code had to undo the baked class with override rules.
|
|
26
|
+
* Addressing columns positionally lets each breakpoint state its own truth.
|
|
27
|
+
*/
|
|
3
28
|
export declare function borderRadiusToCss(br: number | {
|
|
4
29
|
topLeft: number;
|
|
5
30
|
topRight: number;
|
|
@@ -7,4 +32,49 @@ export declare function borderRadiusToCss(br: number | {
|
|
|
7
32
|
bottomLeft: number;
|
|
8
33
|
} | null | undefined): string | undefined;
|
|
9
34
|
export declare function buildWrapperStyle(style: FlexColumnsProps['style']): CSSProperties;
|
|
10
|
-
export
|
|
35
|
+
export type FlexRowLayout = 'wrap' | 'row';
|
|
36
|
+
export type FlexDevice = 'desktop' | 'tablet' | 'mobile';
|
|
37
|
+
/** Everything the layout depends on, already resolved for one device. */
|
|
38
|
+
export type DeviceLayout = {
|
|
39
|
+
/** 'row' = columns side by side; 'wrap' = each column on its own full-width line. */
|
|
40
|
+
layout: FlexRowLayout;
|
|
41
|
+
/** Per-column shrink-to-content flags, one entry per column. */
|
|
42
|
+
shrink: boolean[];
|
|
43
|
+
/** All non-shrink columns share the row width equally. */
|
|
44
|
+
equalColumns: boolean;
|
|
45
|
+
reverseColumns: boolean;
|
|
46
|
+
};
|
|
47
|
+
type FlexProps = FlexColumnsProps['props'];
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the layout for one device. Per-device props inherit: tablet falls back
|
|
50
|
+
* to desktop, mobile falls back to tablet. `shrink` is always `columnsCount` long
|
|
51
|
+
* so callers can index it without bounds checks.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveDeviceLayout(props: FlexProps, device: FlexDevice, columnsCount: number): DeviceLayout;
|
|
54
|
+
/**
|
|
55
|
+
* How a column sizes itself in a side-by-side row:
|
|
56
|
+
* shrink — hug content
|
|
57
|
+
* equal — take an identical share of the row, whatever the content
|
|
58
|
+
* plain — grow from natural width
|
|
59
|
+
*/
|
|
60
|
+
export type ColumnKind = 'plain' | 'equal' | 'shrink';
|
|
61
|
+
/**
|
|
62
|
+
* The block's complete stylesheet: structure, then one fully-restated sizing block
|
|
63
|
+
* per device in ascending-specificity-free source order (desktop → tablet → mobile).
|
|
64
|
+
* All selectors sit at the same specificity, so later simply wins — no `!important`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildResponsiveRowCss(instanceClass: string, opts: {
|
|
67
|
+
columnsCount: number;
|
|
68
|
+
desktop: DeviceLayout;
|
|
69
|
+
tablet: DeviceLayout;
|
|
70
|
+
mobile: DeviceLayout;
|
|
71
|
+
}): string;
|
|
72
|
+
/**
|
|
73
|
+
* Inline style for a column. Intentionally carries NO sizing — `buildResponsiveRowCss`
|
|
74
|
+
* owns that at every breakpoint. Kept for the editor canvas, which renders without
|
|
75
|
+
* the stylesheet and needs the active device's sizing directly.
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildColumnStyle(kind: ColumnKind, stacked: boolean): CSSProperties;
|
|
78
|
+
/** The kind of a column on a given device — shared by the editor and the reader. */
|
|
79
|
+
export declare function columnKindFor(index: number, device: DeviceLayout): ColumnKind;
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FormsPropsSchema: z.ZodObject<{
|
|
3
|
+
style: z.ZodNullable<z.ZodOptional<z.ZodObject<{}, z.core.$loose>>>;
|
|
4
|
+
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
5
|
+
formId: z.ZodDefault<z.ZodString>;
|
|
6
|
+
formName: z.ZodDefault<z.ZodString>;
|
|
7
|
+
iframeSrc: z.ZodDefault<z.ZodString>;
|
|
8
|
+
width: z.ZodDefault<z.ZodString>;
|
|
9
|
+
height: z.ZodDefault<z.ZodString>;
|
|
10
|
+
heightTablet: z.ZodOptional<z.ZodString>;
|
|
11
|
+
heightMobile: z.ZodOptional<z.ZodString>;
|
|
12
|
+
alignment: z.ZodDefault<z.ZodEnum<{
|
|
13
|
+
right: "right";
|
|
14
|
+
left: "left";
|
|
15
|
+
center: "center";
|
|
16
|
+
}>>;
|
|
17
|
+
}, z.core.$strip>>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type FormsPickerProps = z.infer<typeof FormsPropsSchema>;
|
|
@@ -8,6 +8,12 @@ declare const GridPropsSchema: z.ZodObject<{
|
|
|
8
8
|
bottom: z.ZodNumber;
|
|
9
9
|
left: z.ZodNumber;
|
|
10
10
|
}, z.core.$strip>>>;
|
|
11
|
+
margin: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
12
|
+
top: z.ZodNumber;
|
|
13
|
+
right: z.ZodNumber;
|
|
14
|
+
bottom: z.ZodNumber;
|
|
15
|
+
left: z.ZodNumber;
|
|
16
|
+
}, z.core.$strip>>>;
|
|
11
17
|
borderRadius: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
12
18
|
topLeft: z.ZodNumber;
|
|
13
19
|
topRight: z.ZodNumber;
|
|
@@ -25,7 +31,13 @@ declare const GridPropsSchema: z.ZodObject<{
|
|
|
25
31
|
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
26
32
|
cells: z.ZodArray<z.ZodObject<{
|
|
27
33
|
childrenIds: z.ZodArray<z.ZodString>;
|
|
34
|
+
colStart: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
35
|
+
colSpan: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
36
|
+
rowStart: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
37
|
+
rowSpan: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
28
38
|
}, z.core.$strip>>;
|
|
39
|
+
columnsCountTablet: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>>;
|
|
40
|
+
columnsCountMobile: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>>;
|
|
29
41
|
contentAlignment: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
30
42
|
top: "top";
|
|
31
43
|
bottom: "bottom";
|
|
@@ -37,8 +49,6 @@ declare const GridPropsSchema: z.ZodObject<{
|
|
|
37
49
|
center: "center";
|
|
38
50
|
}>>>;
|
|
39
51
|
columnsCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
40
|
-
columnsCountTablet: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
41
|
-
columnsCountMobile: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
42
52
|
rowsCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
43
53
|
columnsGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
44
54
|
rowsGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const MarqueePropsSchema: z.ZodObject<{
|
|
3
|
+
responsive: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
4
|
+
tablet: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
5
|
+
mobile: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
6
|
+
}, z.core.$strip>>>;
|
|
3
7
|
style: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
4
8
|
backgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
5
9
|
borderColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
borderWidth: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
11
|
+
top: z.ZodNumber;
|
|
12
|
+
bottom: z.ZodNumber;
|
|
13
|
+
right: z.ZodNumber;
|
|
14
|
+
left: z.ZodNumber;
|
|
15
|
+
}, z.core.$strip>>>;
|
|
6
16
|
borderRadius: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodObject<{
|
|
7
17
|
topLeft: z.ZodNumber;
|
|
8
18
|
topRight: z.ZodNumber;
|
|
@@ -15,6 +25,12 @@ export declare const MarqueePropsSchema: z.ZodObject<{
|
|
|
15
25
|
right: z.ZodNumber;
|
|
16
26
|
left: z.ZodNumber;
|
|
17
27
|
}, z.core.$strip>>>;
|
|
28
|
+
margin: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
29
|
+
top: z.ZodNumber;
|
|
30
|
+
bottom: z.ZodNumber;
|
|
31
|
+
right: z.ZodNumber;
|
|
32
|
+
left: z.ZodNumber;
|
|
33
|
+
}, z.core.$strip>>>;
|
|
18
34
|
itemGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
19
35
|
}, z.core.$strip>>>;
|
|
20
36
|
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MarqueeProps } from './MarqueePropsSchema';
|
|
2
|
-
export default function MarqueeReader({ style, props }: MarqueeProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MarqueeReader({ style, props, responsive }: MarqueeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type MarqueeMotion = {
|
|
2
|
+
speed: number;
|
|
3
|
+
pauseOnHover: boolean;
|
|
4
|
+
fadeEdges: boolean;
|
|
5
|
+
itemGap: number;
|
|
6
|
+
};
|
|
7
|
+
export type ResponsiveSlices = {
|
|
8
|
+
tablet?: {
|
|
9
|
+
style?: Record<string, any>;
|
|
10
|
+
props?: Record<string, any>;
|
|
11
|
+
} | null;
|
|
12
|
+
mobile?: {
|
|
13
|
+
style?: Record<string, any>;
|
|
14
|
+
props?: Record<string, any>;
|
|
15
|
+
} | null;
|
|
16
|
+
} | null | undefined;
|
|
17
|
+
type ResponsiveDevice = 'tablet' | 'mobile';
|
|
18
|
+
export declare const clampRepeat: (v: unknown) => number;
|
|
19
|
+
export declare const isVerticalDirection: (direction: string) => direction is "up" | "down";
|
|
20
|
+
/** The gradient that fades the marquee's leading/trailing edges. */
|
|
21
|
+
export declare const fadeMask: (isVertical: boolean) => "linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent)" | "linear-gradient(to right, transparent, #000 12%, #000 88%, transparent)";
|
|
22
|
+
/** The block's own (desktop) motion — the base every device inherits from. */
|
|
23
|
+
export declare function desktopMotion(style: Record<string, any> | null | undefined, props: Record<string, any> | null | undefined): MarqueeMotion;
|
|
24
|
+
/**
|
|
25
|
+
* A device's motion: its own overrides layered on desktop. Tablet and Mobile
|
|
26
|
+
* each inherit from DESKTOP (not from each other) — the same rule the editor's
|
|
27
|
+
* `resolveBlockDataForDevice` follows, so canvas and published page agree.
|
|
28
|
+
*/
|
|
29
|
+
export declare function deviceMotion(responsive: ResponsiveSlices, device: ResponsiveDevice, desktop: MarqueeMotion): MarqueeMotion;
|
|
30
|
+
export type MarqueeCssArgs = {
|
|
31
|
+
/** Per-instance class the rules are scoped to (also the keyframes' name prefix). */
|
|
32
|
+
instanceId: string;
|
|
33
|
+
direction: string;
|
|
34
|
+
repeat: number;
|
|
35
|
+
desktop: MarqueeMotion;
|
|
36
|
+
responsive: ResponsiveSlices;
|
|
37
|
+
};
|
|
38
|
+
/** The whole scoped stylesheet for one marquee instance, breakpoints included. */
|
|
39
|
+
export declare function buildMarqueeCss({ instanceId, direction, repeat, desktop, responsive, }: MarqueeCssArgs): string;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const MenuPropsInnerSchema: z.ZodObject<{
|
|
3
|
+
menuId: z.ZodDefault<z.ZodString>;
|
|
4
|
+
useCustomMenu: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
+
stickyNav: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
right: "right";
|
|
8
|
+
left: "left";
|
|
9
|
+
center: "center";
|
|
10
|
+
}>>;
|
|
11
|
+
orientation: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
horizontal: "horizontal";
|
|
13
|
+
vertical: "vertical";
|
|
14
|
+
}>>;
|
|
15
|
+
menuItems: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>>;
|
|
16
|
+
startChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
17
|
+
endChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
18
|
+
layout: z.ZodDefault<z.ZodEnum<{
|
|
19
|
+
"menu-only": "menu-only";
|
|
20
|
+
"logo-menu": "logo-menu";
|
|
21
|
+
"menu-cta": "menu-cta";
|
|
22
|
+
"logo-menu-cta": "logo-menu-cta";
|
|
23
|
+
}>>;
|
|
24
|
+
backgroundColor: z.ZodDefault<z.ZodString>;
|
|
25
|
+
textColor: z.ZodDefault<z.ZodString>;
|
|
26
|
+
fontSize: z.ZodDefault<z.ZodString>;
|
|
27
|
+
fontFamily: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
28
|
+
fontWeight: z.ZodDefault<z.ZodString>;
|
|
29
|
+
padding: z.ZodDefault<z.ZodString>;
|
|
30
|
+
blockPadding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
31
|
+
top: z.ZodNumber;
|
|
32
|
+
right: z.ZodNumber;
|
|
33
|
+
bottom: z.ZodNumber;
|
|
34
|
+
left: z.ZodNumber;
|
|
35
|
+
}, z.core.$strip>>>;
|
|
36
|
+
gap: z.ZodDefault<z.ZodString>;
|
|
37
|
+
showIcons: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
+
iconSize: z.ZodDefault<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export declare const MenuPropsSchema: z.ZodObject<{
|
|
41
|
+
style: z.ZodNullable<z.ZodOptional<z.ZodObject<{}, z.core.$loose>>>;
|
|
42
|
+
responsive: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
43
|
+
tablet: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
44
|
+
mobile: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
46
|
+
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
47
|
+
menuId: z.ZodDefault<z.ZodString>;
|
|
48
|
+
useCustomMenu: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
stickyNav: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
51
|
+
right: "right";
|
|
52
|
+
left: "left";
|
|
53
|
+
center: "center";
|
|
54
|
+
}>>;
|
|
55
|
+
orientation: z.ZodDefault<z.ZodEnum<{
|
|
56
|
+
horizontal: "horizontal";
|
|
57
|
+
vertical: "vertical";
|
|
58
|
+
}>>;
|
|
59
|
+
menuItems: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>>;
|
|
60
|
+
startChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
61
|
+
endChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
62
|
+
layout: z.ZodDefault<z.ZodEnum<{
|
|
63
|
+
"menu-only": "menu-only";
|
|
64
|
+
"logo-menu": "logo-menu";
|
|
65
|
+
"menu-cta": "menu-cta";
|
|
66
|
+
"logo-menu-cta": "logo-menu-cta";
|
|
67
|
+
}>>;
|
|
68
|
+
backgroundColor: z.ZodDefault<z.ZodString>;
|
|
69
|
+
textColor: z.ZodDefault<z.ZodString>;
|
|
70
|
+
fontSize: z.ZodDefault<z.ZodString>;
|
|
71
|
+
fontFamily: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
72
|
+
fontWeight: z.ZodDefault<z.ZodString>;
|
|
73
|
+
padding: z.ZodDefault<z.ZodString>;
|
|
74
|
+
blockPadding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
75
|
+
top: z.ZodNumber;
|
|
76
|
+
right: z.ZodNumber;
|
|
77
|
+
bottom: z.ZodNumber;
|
|
78
|
+
left: z.ZodNumber;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
80
|
+
gap: z.ZodDefault<z.ZodString>;
|
|
81
|
+
showIcons: z.ZodDefault<z.ZodBoolean>;
|
|
82
|
+
iconSize: z.ZodDefault<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export type MenuPickerProps = z.infer<typeof MenuPropsSchema>;
|
|
86
|
+
export type MenuPickerInnerProps = z.infer<typeof MenuPropsInnerSchema>;
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block-owned CSS for the Menu (header) block: the burger toggle, the collapsed
|
|
3
|
+
* mobile dropdown, and the base chrome the burger needs.
|
|
4
|
+
*
|
|
5
|
+
* This used to live in `renderDynamicCss.ts` as a global `.ahd-page-root
|
|
6
|
+
* .ahd-menu` stylesheet, duplicated verbatim across an `@media` and a
|
|
7
|
+
* `@container ahd-page` block. Two problems with that:
|
|
8
|
+
*
|
|
9
|
+
* 1. It hardcoded `padding: 8px 16px !important` on the nav at mobile, which
|
|
10
|
+
* stomped the author's own `blockPadding` — the same class of bug as the
|
|
11
|
+
* Container block's hardcoded mobile padding. The author's value now wins:
|
|
12
|
+
* the collapse rules no longer touch padding at all.
|
|
13
|
+
* 2. Being global, it applied to every menu on the page identically and could
|
|
14
|
+
* not vary per instance. Scoping to the block's `menuKey` lets each header
|
|
15
|
+
* carry its own dropdown background and breakpoint.
|
|
16
|
+
*
|
|
17
|
+
* Emitted as a per-instance `<style>` by MenuReader, alongside the sticky CSS.
|
|
18
|
+
* Selectors are scoped to `.ahd-menu-<menuKey>` so one header's rules can never
|
|
19
|
+
* reach another's.
|
|
20
|
+
*
|
|
21
|
+
* The `@container ahd-page` copy is kept: the editor canvas and the preview
|
|
22
|
+
* iframe size the page by container width, not viewport width, so a viewport-only
|
|
23
|
+
* `@media` never fires there and the burger would never appear while editing.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildMenuResponsiveCss(menuKey: string, opts?: {
|
|
26
|
+
dropdownBackground?: string | null;
|
|
27
|
+
}): string;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const PaginationPageSchema: z.ZodObject<{
|
|
3
|
+
contentChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
declare const PaginationCellSchema: z.ZodObject<{
|
|
6
|
+
childrenIds: z.ZodArray<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const PaginationPropsSchema: z.ZodObject<{
|
|
9
|
+
style: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
10
|
+
backgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
11
|
+
borderColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
borderRadius: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodObject<{
|
|
13
|
+
topLeft: z.ZodNumber;
|
|
14
|
+
topRight: z.ZodNumber;
|
|
15
|
+
bottomRight: z.ZodNumber;
|
|
16
|
+
bottomLeft: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>]>>>;
|
|
18
|
+
padding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
19
|
+
top: z.ZodNumber;
|
|
20
|
+
bottom: z.ZodNumber;
|
|
21
|
+
right: z.ZodNumber;
|
|
22
|
+
left: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>>>;
|
|
24
|
+
margin: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
25
|
+
top: z.ZodNumber;
|
|
26
|
+
bottom: z.ZodNumber;
|
|
27
|
+
right: z.ZodNumber;
|
|
28
|
+
left: z.ZodNumber;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
itemGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
31
|
+
columnsGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
32
|
+
rowsGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
33
|
+
controlGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
34
|
+
controlAlign: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
35
|
+
right: "right";
|
|
36
|
+
left: "left";
|
|
37
|
+
center: "center";
|
|
38
|
+
"space-between": "space-between";
|
|
39
|
+
}>>>;
|
|
40
|
+
buttonSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
41
|
+
buttonGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
42
|
+
buttonRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
43
|
+
buttonBg: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
44
|
+
buttonColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
45
|
+
buttonBorderColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
46
|
+
activeButtonBg: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
47
|
+
activeButtonColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
48
|
+
activeButtonBorderColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
49
|
+
arrowColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
50
|
+
fontSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
51
|
+
fontFamily: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
52
|
+
}, z.core.$strip>>>;
|
|
53
|
+
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
54
|
+
items: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
55
|
+
contentChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
56
|
+
}, z.core.$strip>>>>;
|
|
57
|
+
cells: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
58
|
+
childrenIds: z.ZodArray<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>>>>;
|
|
60
|
+
columnsCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
61
|
+
rowsCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
62
|
+
columnsCountTablet: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
63
|
+
columnsCountMobile: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
64
|
+
rowsCountTablet: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
65
|
+
rowsCountMobile: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
66
|
+
contentAlignment: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
top: "top";
|
|
68
|
+
bottom: "bottom";
|
|
69
|
+
middle: "middle";
|
|
70
|
+
}>>>;
|
|
71
|
+
horizontalAlignment: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
right: "right";
|
|
73
|
+
left: "left";
|
|
74
|
+
center: "center";
|
|
75
|
+
}>>>;
|
|
76
|
+
cellsPerPage: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
77
|
+
repeatableEnabled: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
78
|
+
pageParam: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
79
|
+
syncUrl: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
80
|
+
showNumbers: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
81
|
+
showPrevNext: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
82
|
+
showFirstLast: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
83
|
+
maxVisiblePages: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
84
|
+
prevLabel: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
85
|
+
nextLabel: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
86
|
+
firstLabel: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
87
|
+
lastLabel: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
88
|
+
scrollToTopOnChange: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
89
|
+
explicitFirstPage: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
90
|
+
}, z.core.$strip>>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type PaginationProps = z.infer<typeof PaginationPropsSchema>;
|
|
93
|
+
export type PaginationPage = z.infer<typeof PaginationPageSchema>;
|
|
94
|
+
export type PaginationCell = z.infer<typeof PaginationCellSchema>;
|
|
95
|
+
/** Defaults for a newly-added Pagination block's grid. */
|
|
96
|
+
export declare const PAGINATION_GRID_DEFAULTS: {
|
|
97
|
+
columnsCount: number;
|
|
98
|
+
rowsCount: number;
|
|
99
|
+
cellsPerPage: number;
|
|
100
|
+
};
|
|
101
|
+
/** The device the editor preview / reader CSS is resolving columns/rows for. */
|
|
102
|
+
export type PaginationDevice = 'desktop' | 'tablet' | 'mobile';
|
|
103
|
+
type PaginationGridProps = NonNullable<PaginationProps['props']>;
|
|
104
|
+
/**
|
|
105
|
+
* Resolve the grid for a given device: its columns/rows (with per-device
|
|
106
|
+
* fallbacks) and the flat cell pool, padded to at least columnsCount×rowsCount
|
|
107
|
+
* so the base grid always has a full first page of drop-zones.
|
|
108
|
+
*
|
|
109
|
+
* Back-compat: a legacy block (no `cells`, only `items[].contentChildrenIds`)
|
|
110
|
+
* flattens every legacy page's children into the cell pool so it still renders.
|
|
111
|
+
*/
|
|
112
|
+
export declare function resolvePaginationGrid(props: PaginationGridProps | null | undefined, device?: PaginationDevice): {
|
|
113
|
+
columnsCount: number;
|
|
114
|
+
rowsCount: number;
|
|
115
|
+
cells: PaginationCell[];
|
|
116
|
+
};
|
|
117
|
+
export declare function resolveCellsPerPage(props: PaginationGridProps | null | undefined, device?: PaginationDevice): number;
|
|
118
|
+
export declare function slicePagesFromCells(cells: PaginationCell[], cellsPerPage: number): PaginationCell[][];
|
|
119
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { PaginationProps } from './PaginationPropsSchema';
|
|
2
|
+
/**
|
|
3
|
+
* Single source of truth for Pagination defaults and paging math, shared by the
|
|
4
|
+
* editor preview (PaginationEditor) and the published output (PaginationReader +
|
|
5
|
+
* the runtime script). Keeping it here means the editor preview always matches
|
|
6
|
+
* what a visitor sees, and the runtime script derives the same page ranges.
|
|
7
|
+
*/
|
|
8
|
+
export type PaginationResolved = {
|
|
9
|
+
pageParam: string;
|
|
10
|
+
syncUrl: boolean;
|
|
11
|
+
showNumbers: boolean;
|
|
12
|
+
showPrevNext: boolean;
|
|
13
|
+
showFirstLast: boolean;
|
|
14
|
+
maxVisiblePages: number;
|
|
15
|
+
scrollToTopOnChange: boolean;
|
|
16
|
+
explicitFirstPage: boolean;
|
|
17
|
+
prevLabel: string;
|
|
18
|
+
nextLabel: string;
|
|
19
|
+
firstLabel: string;
|
|
20
|
+
lastLabel: string;
|
|
21
|
+
itemGap: number;
|
|
22
|
+
controlGap: number;
|
|
23
|
+
controlAlign: 'left' | 'center' | 'right' | 'space-between';
|
|
24
|
+
buttonSize: number;
|
|
25
|
+
buttonGap: number;
|
|
26
|
+
buttonRadius: number;
|
|
27
|
+
buttonBg: string;
|
|
28
|
+
buttonColor: string;
|
|
29
|
+
buttonBorderColor: string;
|
|
30
|
+
activeButtonBg: string;
|
|
31
|
+
activeButtonColor: string;
|
|
32
|
+
activeButtonBorderColor: string;
|
|
33
|
+
arrowColor: string;
|
|
34
|
+
fontSize: number;
|
|
35
|
+
fontFamily: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
export declare const PAGINATION_DEFAULTS: {
|
|
38
|
+
pageParam: string;
|
|
39
|
+
syncUrl: boolean;
|
|
40
|
+
showNumbers: boolean;
|
|
41
|
+
showPrevNext: boolean;
|
|
42
|
+
showFirstLast: boolean;
|
|
43
|
+
maxVisiblePages: number;
|
|
44
|
+
scrollToTopOnChange: boolean;
|
|
45
|
+
explicitFirstPage: boolean;
|
|
46
|
+
prevLabel: string;
|
|
47
|
+
nextLabel: string;
|
|
48
|
+
firstLabel: string;
|
|
49
|
+
lastLabel: string;
|
|
50
|
+
itemGap: number;
|
|
51
|
+
controlGap: number;
|
|
52
|
+
controlAlign: "center";
|
|
53
|
+
buttonSize: number;
|
|
54
|
+
buttonGap: number;
|
|
55
|
+
buttonRadius: number;
|
|
56
|
+
buttonBg: string;
|
|
57
|
+
buttonColor: string;
|
|
58
|
+
buttonBorderColor: string;
|
|
59
|
+
activeButtonBg: string;
|
|
60
|
+
activeButtonColor: string;
|
|
61
|
+
activeButtonBorderColor: string;
|
|
62
|
+
arrowColor: string;
|
|
63
|
+
fontSize: number;
|
|
64
|
+
};
|
|
65
|
+
export declare function resolvePaginationProps({ style, props }: PaginationProps): PaginationResolved;
|
|
66
|
+
export declare function pageCountOf(pageLen: number): number;
|
|
67
|
+
/**
|
|
68
|
+
* The list of page tokens to render for `current` (1-based) out of `total`,
|
|
69
|
+
* collapsing overflow with an ellipsis when `maxVisible` (>0) is exceeded.
|
|
70
|
+
* First and last page are always kept so the range stays navigable.
|
|
71
|
+
* Returns 1-based page numbers, with the string 'ellipsis' as a gap marker.
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildPageItems(current: number, total: number, maxVisible: number): Array<number | 'ellipsis'>;
|
|
74
|
+
export declare function clampPage(page: number, total: number): number;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TablePropsSchema: z.ZodObject<{
|
|
3
|
+
style: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
4
|
+
padding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
5
|
+
top: z.ZodNumber;
|
|
6
|
+
right: z.ZodNumber;
|
|
7
|
+
bottom: z.ZodNumber;
|
|
8
|
+
left: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>>>;
|
|
10
|
+
textAlign: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
right: "right";
|
|
12
|
+
left: "left";
|
|
13
|
+
center: "center";
|
|
14
|
+
}>>>;
|
|
15
|
+
fontSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
16
|
+
fontFamily: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
17
|
+
color: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
18
|
+
backgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
19
|
+
borderColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
20
|
+
borderWidth: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
+
cellPadding: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
22
|
+
headerBackground: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
headerColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
}, z.core.$strip>>>;
|
|
25
|
+
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
26
|
+
rows: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
27
|
+
columns: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
28
|
+
hasHeader: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
29
|
+
cells: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
30
|
+
caption: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
31
|
+
width: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
32
|
+
}, z.core.$strip>>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type TableProps = z.infer<typeof TablePropsSchema>;
|
|
35
|
+
export declare const TableDefaults: {
|
|
36
|
+
rows: number;
|
|
37
|
+
columns: number;
|
|
38
|
+
hasHeader: boolean;
|
|
39
|
+
width: "100%";
|
|
40
|
+
borderColor: string;
|
|
41
|
+
borderWidth: number;
|
|
42
|
+
cellPadding: number;
|
|
43
|
+
headerBackground: string;
|
|
44
|
+
headerColor: string;
|
|
45
|
+
color: string;
|
|
46
|
+
fontSize: number;
|
|
47
|
+
};
|
|
48
|
+
export declare function buildDefaultCells(rows: number, columns: number, hasHeader: boolean): string[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TableProps, buildDefaultCells } from './TablePropsSchema';
|
|
3
|
+
type CellOverrideRenderer = (args: {
|
|
4
|
+
row: number;
|
|
5
|
+
col: number;
|
|
6
|
+
value: string;
|
|
7
|
+
isHeader: boolean;
|
|
8
|
+
}) => React.ReactNode;
|
|
9
|
+
export type TableReaderProps = TableProps & {
|
|
10
|
+
renderCell?: CellOverrideRenderer;
|
|
11
|
+
};
|
|
12
|
+
export default function TableReader({ style, props, renderCell }: TableReaderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { buildDefaultCells };
|
|
@@ -4,6 +4,10 @@ declare const TabsBlockItemSchema: z.ZodObject<{
|
|
|
4
4
|
contentChildrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export declare const TabsBlockPropsSchema: z.ZodObject<{
|
|
7
|
+
responsive: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
8
|
+
tablet: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
9
|
+
mobile: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
10
|
+
}, z.core.$strip>>>;
|
|
7
11
|
style: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
8
12
|
backgroundColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
13
|
borderColor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -36,6 +40,14 @@ export declare const TabsBlockPropsSchema: z.ZodObject<{
|
|
|
36
40
|
horizontal: "horizontal";
|
|
37
41
|
vertical: "vertical";
|
|
38
42
|
}>>>;
|
|
43
|
+
orientationTablet: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
horizontal: "horizontal";
|
|
45
|
+
vertical: "vertical";
|
|
46
|
+
}>>>;
|
|
47
|
+
orientationMobile: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
horizontal: "horizontal";
|
|
49
|
+
vertical: "vertical";
|
|
50
|
+
}>>>;
|
|
39
51
|
behavior: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
40
52
|
showSelectedSection: "showSelectedSection";
|
|
41
53
|
scrollToSelectedSection: "scrollToSelectedSection";
|