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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TimeParts } from '../timerMath';
|
|
2
|
+
type Props = {
|
|
3
|
+
parts: TimeParts;
|
|
4
|
+
showLabels: boolean;
|
|
5
|
+
accentColor?: string | null;
|
|
6
|
+
textColor?: string | null;
|
|
7
|
+
};
|
|
8
|
+
export default function DigitalFlipView({ parts, showLabels, accentColor, textColor }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TimeParts } from '../timerMath';
|
|
2
|
+
type Props = {
|
|
3
|
+
parts: TimeParts;
|
|
4
|
+
showLabels: boolean;
|
|
5
|
+
accentColor?: string | null;
|
|
6
|
+
textColor?: string | null;
|
|
7
|
+
};
|
|
8
|
+
export default function TextInlineView({ parts, showLabels, accentColor, textColor }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BLOCK_CATEGORIES: string[];
|
package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/BlockButton.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ type BlockMenuButtonProps = {
|
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
highlighted?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export default function BlockTypeButton({ label, icon, onClick, highlighted }: BlockMenuButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function BlockTypeButton({ label, icon, onClick, highlighted, }: BlockMenuButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/BlocksMenu.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TEditorBlock } from '../../../../editor/core';
|
|
|
2
2
|
type BlocksMenuProps = {
|
|
3
3
|
anchorEl: HTMLElement | null;
|
|
4
4
|
setAnchorEl: (v: HTMLElement | null) => void;
|
|
5
|
-
onSelect: (block: TEditorBlock) => void;
|
|
5
|
+
onSelect: (block: TEditorBlock, preassignedId?: string) => void;
|
|
6
6
|
onPaste?: () => void;
|
|
7
7
|
};
|
|
8
8
|
export default function BlocksMenu({ anchorEl, setAnchorEl, onSelect, onPaste }: BlocksMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
type Props = {
|
|
3
3
|
buttonElement: HTMLElement | null;
|
|
4
4
|
onClick: () => void;
|
|
5
|
+
hideIcon?: boolean;
|
|
5
6
|
};
|
|
6
|
-
export default function DividerButton({ buttonElement, onClick }: Props): React.ReactPortal;
|
|
7
|
+
export default function DividerButton({ buttonElement, onClick, hideIcon }: Props): React.ReactPortal;
|
|
7
8
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
type Props = {
|
|
2
2
|
onClick: () => void;
|
|
3
|
+
hideIcon?: boolean;
|
|
3
4
|
};
|
|
4
|
-
export default function PlaceholderButton({ onClick }: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default function PlaceholderButton({ onClick, hideIcon }: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
export declare const BLOCK_MENU_MIN_WIDTH = "368px";
|
|
3
|
+
export declare const menuRootSx: (theme: Theme) => SxProps<Theme>;
|
|
4
|
+
export declare const searchHeaderSx: (theme: Theme) => SxProps<Theme>;
|
|
5
|
+
export declare const scrollAreaSx: (theme: Theme) => SxProps<Theme>;
|
|
6
|
+
export declare const gridSx: SxProps<Theme>;
|
|
7
|
+
export declare const emptyStateSx: SxProps<Theme>;
|
|
8
|
+
export declare const emptyIconBadgeSx: (theme: Theme) => SxProps<Theme>;
|
|
9
|
+
export declare const blockButtonSx: (theme: Theme, highlighted: boolean) => SxProps<Theme>;
|
|
10
|
+
export declare const blockButtonIconSx: SxProps<Theme>;
|
|
11
|
+
export declare const blockButtonLabelSx: SxProps<Theme>;
|
package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/buttons.d.ts
CHANGED
|
@@ -2,6 +2,14 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { TEditorBlock } from '../../../../editor/core';
|
|
3
3
|
type TButtonProps = {
|
|
4
4
|
label: string;
|
|
5
|
+
/**
|
|
6
|
+
* Palette section this tile belongs to. Used by BlocksPanel to group
|
|
7
|
+
* tiles under section headers ("Text/Content", "Media",
|
|
8
|
+
* "Layout/Structure", "Actions/Controls", "Embeds/Integrations",
|
|
9
|
+
* "Support/Utility"). Order and header labels come from
|
|
10
|
+
* `BlockCategories.ts`.
|
|
11
|
+
*/
|
|
12
|
+
category: string;
|
|
5
13
|
icon: React.JSX.Element;
|
|
6
14
|
block: () => TEditorBlock;
|
|
7
15
|
};
|
package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/gridPresets.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TEditorBlock } from '../../../../editor/core';
|
|
2
|
+
export type GridPresetId = 'single' | 'twoColumn' | 'twoRow' | 'threeColumn' | 'twoByTwo' | 'threeByTwo' | 'heroLeft' | 'heroTop' | 'bento' | 'masonry' | 'magazine' | 'collage' | 'panorama' | 'horizontalStrip' | 'verticalStrip';
|
|
3
|
+
export type GridPresetCell = {
|
|
4
|
+
colStart: number;
|
|
5
|
+
colSpan: number;
|
|
6
|
+
rowStart: number;
|
|
7
|
+
rowSpan: number;
|
|
8
|
+
};
|
|
9
|
+
export type GridPresetDef = {
|
|
10
|
+
id: GridPresetId;
|
|
11
|
+
labelKey: string;
|
|
12
|
+
columnsCount: number;
|
|
13
|
+
rowsCount: number;
|
|
14
|
+
cells: GridPresetCell[];
|
|
15
|
+
};
|
|
16
|
+
export declare const GRID_PRESETS: GridPresetDef[];
|
|
17
|
+
export declare function buildGridPresetBlock(preset: GridPresetDef): TEditorBlock;
|
package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/index.d.ts
CHANGED
|
@@ -5,11 +5,12 @@ export type ContainerNeighbor = {
|
|
|
5
5
|
};
|
|
6
6
|
type Props = {
|
|
7
7
|
placeholder?: boolean;
|
|
8
|
-
|
|
8
|
+
suppressAdd?: boolean;
|
|
9
|
+
onSelect: (block: TEditorBlock, preassignedId?: string) => void;
|
|
9
10
|
onPaste?: () => void;
|
|
10
11
|
containerNeighbors?: ContainerNeighbor[];
|
|
11
12
|
onInsertIntoContainer?: (block: TEditorBlock, containerId: string, insertAt: 'start' | 'end') => void;
|
|
12
13
|
insertAboveCallback?: (block: TEditorBlock) => void;
|
|
13
14
|
};
|
|
14
|
-
export default function AddBlockButton({ onSelect, onPaste, placeholder, containerNeighbors, onInsertIntoContainer, insertAboveCallback, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default function AddBlockButton({ onSelect, onPaste, placeholder, suppressAdd, containerNeighbors, onInsertIntoContainer, insertAboveCallback, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export {};
|
|
@@ -11,5 +11,6 @@ export type EditorChildrenIdsProps = {
|
|
|
11
11
|
maxChildren?: number;
|
|
12
12
|
showContainerScopePrompt?: boolean;
|
|
13
13
|
insertAboveCallback?: (block: TEditorBlock) => void;
|
|
14
|
+
suppressAdd?: boolean;
|
|
14
15
|
};
|
|
15
|
-
export default function EditorChildrenIds({ childrenIds, onChange, maxChildren, showContainerScopePrompt, insertAboveCallback, }: EditorChildrenIdsProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default function EditorChildrenIds({ childrenIds, onChange, maxChildren, showContainerScopePrompt, insertAboveCallback, suppressAdd, }: EditorChildrenIdsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,7 @@ export type TStyle = {
|
|
|
2
2
|
backgroundColor?: any;
|
|
3
3
|
backgroundImage?: any;
|
|
4
4
|
backgroundSize?: any;
|
|
5
|
+
backgroundRepeat?: any;
|
|
5
6
|
borderColor?: any;
|
|
6
7
|
borderRadius?: any;
|
|
7
8
|
color?: any;
|
|
@@ -12,6 +13,7 @@ export type TStyle = {
|
|
|
12
13
|
fontStyle?: any;
|
|
13
14
|
textDecoration?: any;
|
|
14
15
|
padding?: any;
|
|
16
|
+
margin?: any;
|
|
15
17
|
textAlign?: any;
|
|
16
18
|
buttonTextAlign?: any;
|
|
17
19
|
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Save as template" capture logic.
|
|
3
|
+
*
|
|
4
|
+
* Turns a selected on-canvas block subtree into the configuration object stored
|
|
5
|
+
* on a template record. Kept as pure functions (no React / editor-store access)
|
|
6
|
+
* so they're easy to test and reuse; the editor document + live form fields are
|
|
7
|
+
* passed in by the caller (TuneMenu).
|
|
8
|
+
*
|
|
9
|
+
* See CLAUDE.md ("Template Variables") for how formFields flow end to end.
|
|
10
|
+
*/
|
|
11
|
+
/** Loose block shape — the editor document isn't strongly typed here. */
|
|
12
|
+
type AnyBlock = any;
|
|
13
|
+
type BlockMap = Record<string, AnyBlock>;
|
|
14
|
+
type FormField = any;
|
|
15
|
+
/** The configuration payload persisted for a block-type template. */
|
|
16
|
+
export type BlockTemplateConfiguration = {
|
|
17
|
+
isIndividualBlock: true;
|
|
18
|
+
rootBlockId: string;
|
|
19
|
+
blocks: BlockMap;
|
|
20
|
+
formFields: FormField[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Collect `rootBlockId` and every descendant block (following each container
|
|
24
|
+
* type's own child-id layout) into a flat `{ id: block }` map.
|
|
25
|
+
*/
|
|
26
|
+
export declare function collectBlockSubtree(document: BlockMap, rootBlockId: string): BlockMap;
|
|
27
|
+
/**
|
|
28
|
+
* Parse `{{tokens}}` out of a block subtree's text and return field DEFINITIONS:
|
|
29
|
+
* - `{{#each id}}…{{this.sub}}…{{/each}}` → an array field with row sub-fields
|
|
30
|
+
* - `{{this.sub}}` (no explicit #each) → a synthetic `items` array field bound
|
|
31
|
+
* to `rootBlockId` (container-repeat)
|
|
32
|
+
* - `{{id}}` → a scalar text field
|
|
33
|
+
*/
|
|
34
|
+
export declare function extractFormFieldsFromBlocks(blocks: BlockMap, rootBlockId: string): FormField[];
|
|
35
|
+
/**
|
|
36
|
+
* Convert one live root field into an authoring field for the template dialog.
|
|
37
|
+
* Only the DEFINITION is kept (id, name, type, itemFields, target blocks);
|
|
38
|
+
* runtime content (`value`, `rowIds`) and default content (`defaultValue`,
|
|
39
|
+
* `defaultRows`, `defaultRowsByBlock`) are dropped so the dialog opens with
|
|
40
|
+
* empty default inputs.
|
|
41
|
+
*
|
|
42
|
+
* `prefillDefaults` (opt-in) flips this: the field's CURRENT value(s) are
|
|
43
|
+
* carried over as the dialog's default value(s) instead of being stripped.
|
|
44
|
+
* Used by the Variables-panel "Save as new template" shortcut, which captures
|
|
45
|
+
* one specific (already-filled-in) instance as a starting template — unlike
|
|
46
|
+
* the canvas "Save as template" action, which authors a blank, reusable
|
|
47
|
+
* template and must stay empty-by-default.
|
|
48
|
+
*/
|
|
49
|
+
export declare function toAuthoringField(field: FormField, blockIds: Set<string>, prefillDefaults?: boolean): FormField;
|
|
50
|
+
/**
|
|
51
|
+
* Merge the live root formFields (filtered to this subtree) with fields
|
|
52
|
+
* auto-detected from block text, keeping DEFINITIONS only (or prefilled
|
|
53
|
+
* defaults — see `toAuthoringField`).
|
|
54
|
+
*/
|
|
55
|
+
export declare function buildTemplateFormFields(rootFormFields: FormField[], detectedFields: FormField[], blockIds: Set<string>, prefillDefaults?: boolean): FormField[];
|
|
56
|
+
/** Pull color / font-size out of value HTML (`<font color>` or `style="font-size"`). */
|
|
57
|
+
export declare function extractInlineStyle(html: string): {
|
|
58
|
+
color?: string;
|
|
59
|
+
fontSize?: number;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* When a token-bound Text/Heading/Button block shows a single `{{token}}`, the
|
|
63
|
+
* user's inline color/font-size lives in the field VALUE's HTML, not on the
|
|
64
|
+
* block. Lift that styling onto the block's own `data.style` so Save-as-Template
|
|
65
|
+
* preserves it while leaving the token (and its repeatability) untouched.
|
|
66
|
+
*/
|
|
67
|
+
export declare function enrichTokenBlockStyleFromValue(block: AnyBlock, fields: FormField[], rowContext: Record<string, string> | null): AnyBlock;
|
|
68
|
+
/**
|
|
69
|
+
* Build the template configuration for saving `rootBlockId` (and its subtree)
|
|
70
|
+
* as a block-type template.
|
|
71
|
+
*
|
|
72
|
+
* @param document live editor document ({ id: block })
|
|
73
|
+
* @param rootBlockId the selected block being saved
|
|
74
|
+
* @param liveFormFields live root formFields (from editor state) — carry the
|
|
75
|
+
* user's typed-in / styled values used to enrich block styles
|
|
76
|
+
* @param prefillDefaults when true, the dialog's default-value inputs are
|
|
77
|
+
* seeded from the block's CURRENT content instead of
|
|
78
|
+
* opening blank. Used by the Variables-panel "Save as
|
|
79
|
+
* new template" shortcut (captures one filled-in
|
|
80
|
+
* instance); the canvas "Save as template" action keeps
|
|
81
|
+
* this false so authored templates stay default-empty.
|
|
82
|
+
*/
|
|
83
|
+
export declare function buildBlockTemplateConfiguration(document: BlockMap, rootBlockId: string, liveFormFields: FormField[], prefillDefaults?: boolean): BlockTemplateConfiguration;
|
|
84
|
+
/**
|
|
85
|
+
* True when the configuration has authored `formFields` embedded on one of its
|
|
86
|
+
* document roots — meaning the record was already saved with the new
|
|
87
|
+
* placement rule (fields inside `configuration`). Used to decide whether to
|
|
88
|
+
* trust the derived-from-configuration fields or fall back to the legacy
|
|
89
|
+
* top-level `templateRecord.formFields` mirror on old records.
|
|
90
|
+
*
|
|
91
|
+
* Only counts NON-EMPTY authored arrays; a `formFields: []` at the root or on
|
|
92
|
+
* a step counts as "no authored fields there" so token auto-detection doesn't
|
|
93
|
+
* suppress legacy top-level content.
|
|
94
|
+
*/
|
|
95
|
+
export declare function hasAuthoredFormFieldsInConfiguration(record: any): boolean;
|
|
96
|
+
export declare function derivePageInitialFormFields(record: any): FormField[];
|
|
97
|
+
export {};
|
|
@@ -36,6 +36,93 @@ export declare const addRepeatRow: (documentTree: Record<string, any>, sourceBlo
|
|
|
36
36
|
* arrays. Used to delete a repeat row's cloned container subtree.
|
|
37
37
|
*/
|
|
38
38
|
export declare function removeSubtree(documentTree: Record<string, any>, idsToRemove: Set<string>): Record<string, any>;
|
|
39
|
+
export type RepeatableSlot = {
|
|
40
|
+
childrenIds: string[];
|
|
41
|
+
};
|
|
42
|
+
export type RepeatableContainerInfo = {
|
|
43
|
+
containerId: string;
|
|
44
|
+
type: 'Grid' | 'FlexColumns' | 'Carousel';
|
|
45
|
+
/** Total fixed slots (grid cells / flex columns / carousel slides). */
|
|
46
|
+
slotCount: number;
|
|
47
|
+
/** Each slot's current child ids, normalized to `slotCount` length. */
|
|
48
|
+
slots: RepeatableSlot[];
|
|
49
|
+
/** Index of the first non-empty slot, or -1 if the container is empty. */
|
|
50
|
+
firstFilledSlot: number;
|
|
51
|
+
/** How many slots are currently empty. */
|
|
52
|
+
emptySlotCount: number;
|
|
53
|
+
};
|
|
54
|
+
/** True if the block is a slot-based container the repeat feature supports. */
|
|
55
|
+
export declare function isRepeatableContainerType(type: string | undefined): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Describe a repeatable container's slot layout (empty vs filled). Returns null
|
|
58
|
+
* when the block isn't a supported slot container. Used by the Variables tab to
|
|
59
|
+
* decide whether to show the Repeatable controls for the selected block.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getRepeatableContainerInfo(documentTree: Record<string, any>, containerId: string): RepeatableContainerInfo | null;
|
|
62
|
+
/** Write a container's slots back onto the block (Grid → cells, Carousel →
|
|
63
|
+
* items[].contentChildrenIds, else → columns). */
|
|
64
|
+
export declare function writeContainerSlots(block: any, slots: RepeatableSlot[]): any;
|
|
65
|
+
/**
|
|
66
|
+
* Grow a repeatable container so it has at least `neededSlots` cells/columns/slides.
|
|
67
|
+
*
|
|
68
|
+
* - Grid: `direction: 'rows'` bumps `rowsCount` (keeps columns), `'columns'`
|
|
69
|
+
* bumps `columnsCount` (keeps rows), until columns×rows ≥ neededSlots. The
|
|
70
|
+
* `cells` array is padded with empty slots to match the new total.
|
|
71
|
+
* - FlexColumns: single-axis — grows `columnsCount` (and pads `columns`)
|
|
72
|
+
* regardless of `direction`.
|
|
73
|
+
* - Carousel: single-axis — grows `items` (new empty slides) up to the
|
|
74
|
+
* block's 20-slide schema cap; `neededSlots` beyond that are left unmet.
|
|
75
|
+
*
|
|
76
|
+
* Returns the updated document (or the same ref when no growth was needed / the
|
|
77
|
+
* block isn't a repeatable container).
|
|
78
|
+
*/
|
|
79
|
+
export declare function growContainerToFit(documentTree: Record<string, any>, containerId: string, neededSlots: number, direction: 'rows' | 'columns'): Record<string, any>;
|
|
80
|
+
/**
|
|
81
|
+
* Stamp the subtree rooted at `sourceRootId` (which lives in the container's
|
|
82
|
+
* first filled slot) into the next `count` EMPTY slots. Each stamp is a fresh
|
|
83
|
+
* clone (new block ids), so its text tokens are editable independently while
|
|
84
|
+
* sharing the source's styling. Returns the updated document plus the new clone
|
|
85
|
+
* root ids (one per filled empty slot), or null when the block/slots are invalid.
|
|
86
|
+
*
|
|
87
|
+
* `count` is clamped to the number of empty slots — the container never grows;
|
|
88
|
+
* callers surface "add more cells" when `count` exceeds capacity.
|
|
89
|
+
*/
|
|
90
|
+
export declare function stampTemplateIntoEmptySlots(documentTree: Record<string, any>, containerId: string, sourceRootId: string, count: number): {
|
|
91
|
+
updatedDocument: Record<string, any>;
|
|
92
|
+
newRootIds: string[];
|
|
93
|
+
} | null;
|
|
94
|
+
/** Find the repeatable container whose slots hold `childId`. */
|
|
95
|
+
export declare function findRepeatableContainerOf(documentTree: Record<string, any>, childId: string): string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Reconcile a container-repeat field's `value` array against the actually
|
|
98
|
+
* rendered cards. When `value` has MORE entries than there are materialized
|
|
99
|
+
* rows (e.g. a row was appended server-side, or on another device), stamp the
|
|
100
|
+
* template into empty grid cells so each value entry gets a card, and register
|
|
101
|
+
* the new clone roots as `rowIds`. Existing cards + their block subtrees are
|
|
102
|
+
* untouched; capped at available empty slots.
|
|
103
|
+
*
|
|
104
|
+
* Returns `{ document, fields }` (possibly the same refs when nothing changed)
|
|
105
|
+
* plus how many rows were materialized vs. still missing for capacity warnings.
|
|
106
|
+
*/
|
|
107
|
+
export declare function reconcileRepeatFieldValues(documentTree: Record<string, any>, fields: any[]): {
|
|
108
|
+
document: Record<string, any>;
|
|
109
|
+
fields: any[];
|
|
110
|
+
materialized: number;
|
|
111
|
+
missing: number;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Copy the STYLING (block `data.style` + text-formatting props) from every
|
|
115
|
+
* block in the source cell's subtree onto the structurally-corresponding block
|
|
116
|
+
* in each target cell's subtree. Text / token values are left untouched — only
|
|
117
|
+
* look-and-feel (color, font, size, alignment, padding, etc.) propagates.
|
|
118
|
+
*
|
|
119
|
+
* Correspondence is positional: `collectSubtreeIds` walks both subtrees in the
|
|
120
|
+
* same deterministic order, so index i in the source maps to index i in a copy
|
|
121
|
+
* (the copies were produced by `cloneSubtree`, which preserves structure).
|
|
122
|
+
*
|
|
123
|
+
* Returns the updated document, or null when the source subtree is missing.
|
|
124
|
+
*/
|
|
125
|
+
export declare function syncCellStyles(documentTree: Record<string, any>, sourceRootId: string, targetRootIds: string[]): Record<string, any> | null;
|
|
39
126
|
export type DropPosition = 'before' | 'after' | 'inside';
|
|
40
127
|
export declare const PALETTE_DRAG_MIME = "application/x-ahd-palette-block";
|
|
41
128
|
/**
|
|
@@ -88,14 +175,13 @@ export declare const cloneCopiedBlocks: (copiedConfig: {
|
|
|
88
175
|
}) => {
|
|
89
176
|
newBlocks: Record<string, any>;
|
|
90
177
|
newRootId: string;
|
|
178
|
+
idMap: Record<string, string>;
|
|
91
179
|
};
|
|
92
180
|
export declare const pasteBlockAsNew: (documentTree: Record<string, any>, copiedConfig: {
|
|
93
181
|
rootBlockId: string;
|
|
94
182
|
blocks: Record<string, any>;
|
|
95
183
|
}) => {
|
|
96
|
-
updatedDocument:
|
|
97
|
-
[x: string]: any;
|
|
98
|
-
};
|
|
184
|
+
updatedDocument: Record<string, any>;
|
|
99
185
|
newRootId: string;
|
|
100
186
|
};
|
|
101
187
|
export declare const pasteBlock: (documentTree: Record<string, any>, targetBlockId: string, copiedConfig: {
|
|
@@ -105,20 +191,13 @@ export declare const pasteBlock: (documentTree: Record<string, any>, targetBlock
|
|
|
105
191
|
updatedDocument: Record<string, any>;
|
|
106
192
|
newRootId: string;
|
|
107
193
|
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
* instead of crashing the canvas inside `BlockComponent` (which throws
|
|
116
|
-
* "Cannot read properties of undefined (reading 'Component')" the moment an
|
|
117
|
-
* unknown type tries to render).
|
|
118
|
-
*
|
|
119
|
-
* Returns the sanitized document, the de-duped list of removed type names
|
|
120
|
-
* (for a user-facing toast), and whether any pruning happened.
|
|
121
|
-
*/
|
|
194
|
+
export declare const replaceBlock: (documentTree: Record<string, any>, targetBlockId: string, copiedConfig: {
|
|
195
|
+
rootBlockId: string;
|
|
196
|
+
blocks: Record<string, any>;
|
|
197
|
+
}) => {
|
|
198
|
+
updatedDocument: Record<string, any>;
|
|
199
|
+
newRootId: string;
|
|
200
|
+
};
|
|
122
201
|
export declare function sanitizeAgainstKnownTypes(doc: Record<string, any>, knownTypes: ReadonlySet<string>): {
|
|
123
202
|
sanitized: Record<string, any>;
|
|
124
203
|
removedTypes: string[];
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const DEVICE_TYPES: readonly ["desktop", "tablet", "mobile"];
|
|
3
|
+
export type TDeviceType = (typeof DEVICE_TYPES)[number];
|
|
4
|
+
/** Non-desktop breakpoints that carry override slices. */
|
|
5
|
+
export type TResponsiveDevice = Exclude<TDeviceType, 'desktop'>;
|
|
6
|
+
/** A deep-partial override of a block's `data` (style + props + any field). */
|
|
7
|
+
export type TDeviceOverride = Record<string, any>;
|
|
8
|
+
/** Override slices keyed by breakpoint. Absent = "inherit desktop". */
|
|
9
|
+
export type TResponsiveOverrides = Partial<Record<TResponsiveDevice, TDeviceOverride>>;
|
|
10
|
+
/** The subset of a block's `data` this module reads/writes. */
|
|
11
|
+
export type TResponsiveBlockData = {
|
|
12
|
+
responsive?: TResponsiveOverrides | null;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Viewport widths (px) each device tab represents. These match the actual
|
|
17
|
+
* `@media (max-width: …)` breakpoints emitted by the responsive blocks (Grid,
|
|
18
|
+
* FlexColumns, Carousel, Pagination — see their *Reader.tsx / *helpers.ts), so
|
|
19
|
+
* the number shown in the sidebar is the real breakpoint, not an approximation.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DEVICE_VIEWPORT_WIDTH: Record<TDeviceType, number>;
|
|
22
|
+
/**
|
|
23
|
+
* The ONLY properties that may differ per device. Content (text, url, id,
|
|
24
|
+
* image src, actions) and appearance that should stay consistent (colours,
|
|
25
|
+
* borders) are intentionally excluded — they're edited once on Desktop and
|
|
26
|
+
* shared across breakpoints. A per-device edit that isn't in these allowlists
|
|
27
|
+
* is dropped by {@link applyDeviceEdit}, so overrides can never carry content.
|
|
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", "arrowSize", "dotSize", "slideGap", "buttonSize", "buttonGap", "buttonRadius", "controlGap", "backgroundImage", "backgroundSize", "backgroundRepeat"];
|
|
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
|
+
/**
|
|
32
|
+
* NATIVE per-device props: a few layout blocks (Grid / FlexColumns / Pagination)
|
|
33
|
+
* are already truly responsive via `@media` CSS keyed off dedicated props. Their
|
|
34
|
+
* device-specific keys must always be written to the BASE data (never folded
|
|
35
|
+
* into a `responsive` slice), so their existing `@media` rendering keeps working
|
|
36
|
+
* unchanged. The sidebar targets the right suffixed key per device via
|
|
37
|
+
* `deviceProp.ts`; `applyDeviceEdit` passes these straight through to base.
|
|
38
|
+
*
|
|
39
|
+
* IMPORTANT — native-ness is PER BLOCK, not global. A key is only native for the
|
|
40
|
+
* blocks that actually ship suffixed-prop `@media` rendering for it. `height`,
|
|
41
|
+
* for example, is native for Video (which emits heightTablet/heightMobile CSS)
|
|
42
|
+
* but NOT for Spacer, which has no such CSS: routing Spacer's height to base
|
|
43
|
+
* would make a Mobile edit overwrite the Desktop value. Use
|
|
44
|
+
* {@link nativeKeysForBlock} to get the right set for a block type — never test
|
|
45
|
+
* against this flat list directly.
|
|
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"];
|
|
48
|
+
/**
|
|
49
|
+
* The native per-device prop keys that apply to `blockType`. Unambiguous keys
|
|
50
|
+
* are always native; ambiguous ones only for the block types that actually
|
|
51
|
+
* render them with `@media` CSS (see {@link AMBIGUOUS_NATIVE_KEY_OWNERS}).
|
|
52
|
+
*/
|
|
53
|
+
export declare function nativeKeysForBlock(blockType: string | undefined): string[];
|
|
54
|
+
/** Read the raw (user-authored) override slice for a device. */
|
|
55
|
+
export declare function getDeviceOverride(data: TResponsiveBlockData | null | undefined, device: TResponsiveDevice): TDeviceOverride;
|
|
56
|
+
/** True when the user has authored at least one override for the device. */
|
|
57
|
+
export declare function hasDeviceOverride(data: TResponsiveBlockData | null | undefined, device: TResponsiveDevice): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The resolved `data` a block should render/edit at `device`:
|
|
60
|
+
* desktop → the base data unchanged (`responsive` stripped)
|
|
61
|
+
* tablet / mobile → base deep-merged with `responsive[device]`
|
|
62
|
+
*
|
|
63
|
+
* The `responsive` key itself is never part of the resolved data handed to a
|
|
64
|
+
* block component — only the merged style/props are.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveBlockDataForDevice<T extends TResponsiveBlockData>(data: T | null | undefined, device: TDeviceType): T;
|
|
67
|
+
/**
|
|
68
|
+
* Where a responsive field lives on the override slice:
|
|
69
|
+
* - `style` / `props` → nested under `data.style` / `data.props`
|
|
70
|
+
* - `root` → a top-level `data` field (e.g. `data.hidden` for visibility)
|
|
71
|
+
*/
|
|
72
|
+
export type ResponsiveGroup = 'style' | 'props' | 'root';
|
|
73
|
+
/**
|
|
74
|
+
* Write a single responsive field's value into the device slice and return the
|
|
75
|
+
* new stored data (desktop base untouched). `group: 'root'` writes the key at
|
|
76
|
+
* the slice's top level (→ merges onto `data.<key>`); `style`/`props` nest it.
|
|
77
|
+
* Passing `undefined` clears that field (reverting it to inherit desktop); an
|
|
78
|
+
* empty group / slice is dropped so we never persist `{ mobile: { style: {} } }`.
|
|
79
|
+
*/
|
|
80
|
+
export declare function setResponsiveField<T extends TResponsiveBlockData>(data: T, device: TResponsiveDevice, group: ResponsiveGroup, key: string, value: any): T;
|
|
81
|
+
/** True when this exact field is overridden on the device. */
|
|
82
|
+
export declare function isFieldOverridden(data: TResponsiveBlockData | null | undefined, device: TResponsiveDevice, group: ResponsiveGroup, key: string): boolean;
|
|
83
|
+
/** Clear a single overridden field back to the desktop value. */
|
|
84
|
+
export declare function clearResponsiveField<T extends TResponsiveBlockData>(data: T, device: TResponsiveDevice, group: ResponsiveGroup, key: string): T;
|
|
85
|
+
/**
|
|
86
|
+
* Legacy full-data write kept for callers (e.g. BlockStyleClipboardBar) that
|
|
87
|
+
* hand over a whole `{ style, props }` diff. Only the responsive-allowed keys
|
|
88
|
+
* survive — content in the diff is dropped so a device slice can never hold it.
|
|
89
|
+
*/
|
|
90
|
+
export declare function applyDeviceEdit<T extends TResponsiveBlockData>(data: T, device: TResponsiveDevice, nextResolvedData: TResponsiveBlockData, blockType?: string): T;
|
|
91
|
+
/** Clear a device's entire override slice (reset the whole breakpoint). */
|
|
92
|
+
export declare function clearDeviceOverride<T extends TResponsiveBlockData>(data: T, device: TResponsiveDevice): T;
|
|
93
|
+
/** Whether the block is hidden on `device` (visibility override). */
|
|
94
|
+
export declare function isHiddenOnDevice(data: TResponsiveBlockData | null | undefined, device: TResponsiveDevice): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Zod schema for the `responsive` field, spliced into a block's props schema so
|
|
97
|
+
* the override survives `safeParse`. Permissive by design — each slice is a
|
|
98
|
+
* subset of fields the block's own schema already validates on the base data.
|
|
99
|
+
*
|
|
100
|
+
* Add to a block schema like:
|
|
101
|
+
* z.object({ style: {...}, props: {...}, responsive: ResponsiveSchema })
|
|
102
|
+
*/
|
|
103
|
+
export declare const ResponsiveSchema: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
104
|
+
tablet: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
105
|
+
mobile: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
106
|
+
}, z.core.$strip>>>;
|
|
@@ -32,8 +32,8 @@ export declare function zFontFamily(): z.ZodEnum<{
|
|
|
32
32
|
BEBAS_NEUE: "BEBAS_NEUE";
|
|
33
33
|
}>;
|
|
34
34
|
export declare function zFontWeight(): z.ZodEnum<{
|
|
35
|
-
normal: "normal";
|
|
36
35
|
bold: "bold";
|
|
36
|
+
normal: "normal";
|
|
37
37
|
}>;
|
|
38
38
|
export declare function zTextAlign(): z.ZodEnum<{
|
|
39
39
|
right: "right";
|
|
@@ -7,6 +7,12 @@ type TValue = {
|
|
|
7
7
|
selectedSidebarTab: 'block-configuration' | 'styles' | 'behaviour' | 'layout' | 'settings' | 'background' | 'page-pilot-ai' | 'layers' | 'brand' | 'seo' | 'variables' | 'research';
|
|
8
8
|
selectedMainTab: 'editor' | 'preview' | 'json' | 'html';
|
|
9
9
|
selectedScreenSize: 'desktop' | 'mobile' | 'tablet';
|
|
10
|
+
/**
|
|
11
|
+
* Which device the responsive sidebar tabs are currently authoring
|
|
12
|
+
* for. Independent of `selectedScreenSize` (the top-toolbar preview
|
|
13
|
+
* device) — flipping this must NOT resize the canvas.
|
|
14
|
+
*/
|
|
15
|
+
sidebarEditingDevice: 'desktop' | 'mobile' | 'tablet';
|
|
10
16
|
inspectorDrawerOpen: boolean;
|
|
11
17
|
samplesDrawerOpen: boolean;
|
|
12
18
|
activeStepIndex: number;
|
|
@@ -104,7 +110,10 @@ export declare function useSelectedBlockId(): string;
|
|
|
104
110
|
* re-renders A and B, not every other block on the canvas.
|
|
105
111
|
*/
|
|
106
112
|
export declare function useIsBlockSelected(id: string): boolean;
|
|
107
|
-
export declare function useSelectedScreenSize(): "
|
|
113
|
+
export declare function useSelectedScreenSize(): "tablet" | "mobile" | "desktop";
|
|
114
|
+
/** Which device's properties the sidebar is currently editing (see ResponsiveDeviceTabs). */
|
|
115
|
+
export declare function useSidebarEditingDevice(): "tablet" | "mobile" | "desktop";
|
|
116
|
+
export declare function setSidebarEditingDevice(sidebarEditingDevice: TValue['sidebarEditingDevice']): void;
|
|
108
117
|
export declare function useSelectedMainTab(): "html" | "editor" | "preview" | "json";
|
|
109
118
|
export declare function useActiveStepIndex(): number;
|
|
110
119
|
export declare function useSelectors(): string[];
|
|
@@ -150,7 +159,7 @@ type SetActiveStepIndexOptions = {
|
|
|
150
159
|
};
|
|
151
160
|
export declare function setActiveStepIndex(activeStepIndex: number, options?: SetActiveStepIndexOptions): void;
|
|
152
161
|
export declare function setSelectedMainTab(selectedMainTab: TValue['selectedMainTab']): void;
|
|
153
|
-
export declare function useSelectedSidebarTab(): "layout" | "
|
|
162
|
+
export declare function useSelectedSidebarTab(): "layout" | "behaviour" | "block-configuration" | "styles" | "settings" | "background" | "page-pilot-ai" | "layers" | "brand" | "seo" | "variables" | "research";
|
|
154
163
|
export declare function useInspectorDrawerOpen(): boolean;
|
|
155
164
|
export declare function useSamplesDrawerOpen(): boolean;
|
|
156
165
|
export declare function useInlineEditingEnabled(): boolean;
|