@builder.io/sdk-react-native 0.4.3 → 0.4.5
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/dist/blocks/columns/columns.js +2 -2
- package/dist/blocks/symbol/symbol.js +8 -6
- package/dist/components/block/block.helpers.js +113 -0
- package/dist/components/block/block.js +171 -0
- package/dist/components/block/components/block-styles.js +95 -0
- package/dist/components/block/components/component.js +41 -0
- package/dist/components/block/components/repeated-block.js +40 -0
- package/dist/components/block/types.js +1 -0
- package/dist/components/blocks/blocks-wrapper.js +66 -0
- package/dist/components/blocks/blocks.js +41 -0
- package/dist/components/content/components/content-styles.helpers.js +55 -0
- package/dist/components/content/components/content-styles.js +61 -0
- package/dist/components/content/components/enable-editor.js +313 -0
- package/dist/components/content/content.helpers.js +42 -0
- package/dist/components/content/content.js +127 -0
- package/dist/components/content/content.types.js +1 -0
- package/dist/components/content/index.js +8 -0
- package/dist/components/content/wrap-component-ref.js +5 -0
- package/dist/components/content-variants/content-variants.js +73 -0
- package/dist/components/content-variants/helpers.js +139 -0
- package/dist/components/inlined-script.js +32 -0
- package/dist/components/{render-inlined-styles.js → inlined-styles.js} +2 -2
- package/dist/components/render-block/block-styles.js +2 -2
- package/dist/components/render-content/components/render-styles.js +2 -2
- package/dist/components/render-content/render-content.js +10 -8
- package/dist/components/render-content-variants/helpers.js +49 -20
- package/dist/components/render-content-variants/render-content-variants.js +29 -24
- package/dist/components/render-content-variants/render-content-variants.types.js +1 -0
- package/dist/constants/sdk-version.js +1 -1
- package/dist/functions/track/index.js +1 -1
- package/dist/helpers/ab-tests.js +3 -0
- package/dist/types/builder-props.js +1 -0
- package/dist/types/enforced-partials.js +1 -0
- package/package.json +1 -1
- package/src/blocks/columns/columns.jsx +2 -2
- package/src/blocks/symbol/symbol.jsx +8 -5
- package/src/components/inlined-script.jsx +18 -0
- package/src/components/{render-inlined-styles.jsx → inlined-styles.jsx} +2 -2
- package/src/components/render-block/block-styles.jsx +2 -2
- package/src/components/render-content/components/render-styles.jsx +2 -2
- package/src/components/render-content/render-content.jsx +8 -6
- package/src/components/render-content-variants/helpers.js +49 -20
- package/src/components/render-content-variants/render-content-variants.jsx +57 -35
- package/src/components/render-content-variants/render-content-variants.types.js +0 -0
- package/src/constants/sdk-version.js +1 -1
- package/src/functions/track/index.js +1 -1
- package/src/helpers/ab-tests.js +3 -0
- package/src/types/enforced-partials.js +0 -0
- package/dist/blocks/BaseText.d.ts +0 -6
- package/dist/blocks/button/button.d.ts +0 -9
- package/dist/blocks/button/component-info.d.ts +0 -2
- package/dist/blocks/columns/columns.d.ts +0 -16
- package/dist/blocks/columns/component-info.d.ts +0 -2
- package/dist/blocks/custom-code/component-info.d.ts +0 -2
- package/dist/blocks/custom-code/custom-code.d.ts +0 -5
- package/dist/blocks/embed/component-info.d.ts +0 -2
- package/dist/blocks/embed/embed.d.ts +0 -5
- package/dist/blocks/embed/helpers.d.ts +0 -1
- package/dist/blocks/form/component-info.d.ts +0 -2
- package/dist/blocks/form/form.d.ts +0 -28
- package/dist/blocks/fragment/component-info.d.ts +0 -2
- package/dist/blocks/fragment/fragment.d.ts +0 -8
- package/dist/blocks/image/component-info.d.ts +0 -2
- package/dist/blocks/image/image.d.ts +0 -17
- package/dist/blocks/image/image.helpers.d.ts +0 -1
- package/dist/blocks/img/component-info.d.ts +0 -2
- package/dist/blocks/img/img.d.ts +0 -11
- package/dist/blocks/input/component-info.d.ts +0 -2
- package/dist/blocks/input/input.d.ts +0 -12
- package/dist/blocks/raw-text/component-info.d.ts +0 -2
- package/dist/blocks/raw-text/raw-text.d.ts +0 -5
- package/dist/blocks/section/component-info.d.ts +0 -2
- package/dist/blocks/section/section.d.ts +0 -9
- package/dist/blocks/select/component-info.d.ts +0 -2
- package/dist/blocks/select/select.d.ts +0 -13
- package/dist/blocks/submit-button/component-info.d.ts +0 -2
- package/dist/blocks/submit-button/submit-button.d.ts +0 -7
- package/dist/blocks/symbol/component-info.d.ts +0 -2
- package/dist/blocks/symbol/symbol.d.ts +0 -21
- package/dist/blocks/text/component-info.d.ts +0 -2
- package/dist/blocks/text/text.d.ts +0 -7
- package/dist/blocks/textarea/component-info.d.ts +0 -2
- package/dist/blocks/textarea/textarea.d.ts +0 -10
- package/dist/blocks/util.d.ts +0 -4
- package/dist/blocks/video/component-info.d.ts +0 -2
- package/dist/blocks/video/video.d.ts +0 -31
- package/dist/components/render-block/block-styles.d.ts +0 -9
- package/dist/components/render-block/render-block.d.ts +0 -9
- package/dist/components/render-block/render-block.helpers.d.ts +0 -12
- package/dist/components/render-block/render-component.d.ts +0 -17
- package/dist/components/render-block/render-repeated-block.d.ts +0 -9
- package/dist/components/render-block/types.d.ts +0 -6
- package/dist/components/render-blocks.d.ts +0 -10
- package/dist/components/render-content/builder-editing.d.ts +0 -3
- package/dist/components/render-content/components/render-styles.d.ts +0 -9
- package/dist/components/render-content/components/render-styles.helpers.d.ts +0 -15
- package/dist/components/render-content/index.d.ts +0 -1
- package/dist/components/render-content/render-content.d.ts +0 -4
- package/dist/components/render-content/render-content.helpers.d.ts +0 -7
- package/dist/components/render-content/render-content.types.d.ts +0 -38
- package/dist/components/render-content/wrap-component-ref.d.ts +0 -6
- package/dist/components/render-content-variants/helpers.d.ts +0 -17
- package/dist/components/render-content-variants/render-content-variants.d.ts +0 -5
- package/dist/components/render-inlined-styles.d.ts +0 -7
- package/dist/constants/builder-registered-components.d.ts +0 -6
- package/dist/constants/device-sizes.d.ts +0 -13
- package/dist/constants/sdk-version.d.ts +0 -1
- package/dist/constants/target.d.ts +0 -3
- package/dist/context/builder.context.d.ts +0 -3
- package/dist/context/types.d.ts +0 -35
- package/dist/functions/camel-to-kebab-case.d.ts +0 -1
- package/dist/functions/evaluate.d.ts +0 -7
- package/dist/functions/evaluate.test.d.ts +0 -1
- package/dist/functions/event-handler-name.d.ts +0 -1
- package/dist/functions/extract-text-styles.d.ts +0 -4
- package/dist/functions/fast-clone.d.ts +0 -4
- package/dist/functions/get-block-actions-handler.d.ts +0 -8
- package/dist/functions/get-block-actions.d.ts +0 -9
- package/dist/functions/get-block-component-options.d.ts +0 -2
- package/dist/functions/get-block-properties.d.ts +0 -2
- package/dist/functions/get-builder-search-params/fn.test.d.ts +0 -1
- package/dist/functions/get-builder-search-params/index.d.ts +0 -12
- package/dist/functions/get-content/generate-content-url.d.ts +0 -2
- package/dist/functions/get-content/generate-content-url.test.d.ts +0 -1
- package/dist/functions/get-content/index.d.ts +0 -16
- package/dist/functions/get-content/types.d.ts +0 -51
- package/dist/functions/get-fetch.d.ts +0 -1
- package/dist/functions/get-processed-block.d.ts +0 -10
- package/dist/functions/get-processed-block.test.d.ts +0 -1
- package/dist/functions/get-react-native-block-styles.d.ts +0 -7
- package/dist/functions/if-target.d.ts +0 -7
- package/dist/functions/is-browser.d.ts +0 -1
- package/dist/functions/is-editing.d.ts +0 -1
- package/dist/functions/is-iframe.d.ts +0 -1
- package/dist/functions/is-previewing.d.ts +0 -1
- package/dist/functions/on-change.d.ts +0 -7
- package/dist/functions/on-change.test.d.ts +0 -1
- package/dist/functions/register-component.d.ts +0 -14
- package/dist/functions/register.d.ts +0 -16
- package/dist/functions/sanitize-react-native-block-styles.d.ts +0 -3
- package/dist/functions/set-editor-settings.d.ts +0 -4
- package/dist/functions/set.d.ts +0 -7
- package/dist/functions/set.test.d.ts +0 -1
- package/dist/functions/track/helpers.d.ts +0 -5
- package/dist/functions/track/index.d.ts +0 -51
- package/dist/functions/track/interaction.d.ts +0 -13
- package/dist/functions/transform-block-properties.d.ts +0 -3
- package/dist/functions/transform-block.d.ts +0 -2
- package/dist/helpers/ab-tests.d.ts +0 -9
- package/dist/helpers/canTrack.d.ts +0 -1
- package/dist/helpers/cookie.d.ts +0 -9
- package/dist/helpers/css.d.ts +0 -7
- package/dist/helpers/flatten.d.ts +0 -6
- package/dist/helpers/localStorage.d.ts +0 -9
- package/dist/helpers/logger.d.ts +0 -6
- package/dist/helpers/nullable.d.ts +0 -2
- package/dist/helpers/sessionId.d.ts +0 -6
- package/dist/helpers/time.d.ts +0 -1
- package/dist/helpers/url.d.ts +0 -6
- package/dist/helpers/url.test.d.ts +0 -1
- package/dist/helpers/uuid.d.ts +0 -8
- package/dist/helpers/visitorId.d.ts +0 -6
- package/dist/index-helpers/blocks-exports.d.ts +0 -8
- package/dist/index-helpers/top-of-file.d.ts +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/scripts/init-editing.d.ts +0 -6
- package/dist/types/api-version.d.ts +0 -2
- package/dist/types/builder-block.d.ts +0 -66
- package/dist/types/builder-content.d.ts +0 -44
- package/dist/types/can-track.d.ts +0 -3
- package/dist/types/components.d.ts +0 -105
- package/dist/types/deep-partial.d.ts +0 -3
- package/dist/types/element.d.ts +0 -59
- package/dist/types/input.d.ts +0 -121
- package/dist/types/targets.d.ts +0 -3
- package/dist/types/typescript.d.ts +0 -5
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface SymbolInfo {
|
|
3
|
-
model?: string;
|
|
4
|
-
entry?: string;
|
|
5
|
-
data?: any;
|
|
6
|
-
content?: BuilderContent;
|
|
7
|
-
inline?: boolean;
|
|
8
|
-
dynamic?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface SymbolProps {
|
|
11
|
-
symbol?: SymbolInfo;
|
|
12
|
-
dataOnly?: boolean;
|
|
13
|
-
dynamic?: boolean;
|
|
14
|
-
builderBlock?: BuilderBlock;
|
|
15
|
-
attributes?: any;
|
|
16
|
-
inheritState?: boolean;
|
|
17
|
-
}
|
|
18
|
-
import type { BuilderContent } from "../../types/builder-content.js";
|
|
19
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
20
|
-
declare function Symbol(props: SymbolProps): JSX.Element;
|
|
21
|
-
export default Symbol;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface TextareaProps {
|
|
3
|
-
attributes?: any;
|
|
4
|
-
name?: string;
|
|
5
|
-
value?: string;
|
|
6
|
-
defaultValue?: string;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
}
|
|
9
|
-
declare function Textarea(props: TextareaProps): JSX.Element;
|
|
10
|
-
export default Textarea;
|
package/dist/blocks/util.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @typedef {{
|
|
5
|
-
* attributes?: any;
|
|
6
|
-
* video?: string;
|
|
7
|
-
* autoPlay?: boolean;
|
|
8
|
-
* controls?: boolean;
|
|
9
|
-
* muted?: boolean;
|
|
10
|
-
* loop?: boolean;
|
|
11
|
-
* playsInline?: boolean;
|
|
12
|
-
* aspectRatio?: number;
|
|
13
|
-
* fit?: 'contain' | 'cover' | 'stretch';
|
|
14
|
-
* position?:
|
|
15
|
-
* | 'center'
|
|
16
|
-
* | 'top'
|
|
17
|
-
* | 'left'
|
|
18
|
-
* | 'right'
|
|
19
|
-
* | 'bottom'
|
|
20
|
-
* | 'top left'
|
|
21
|
-
* | 'top right'
|
|
22
|
-
* | 'bottom left'
|
|
23
|
-
* | 'bottom right';
|
|
24
|
-
* posterImage?: string;
|
|
25
|
-
* children?: any;
|
|
26
|
-
* }} VideoProps
|
|
27
|
-
*/
|
|
28
|
-
/**
|
|
29
|
-
* @param {VideoProps} props
|
|
30
|
-
*/
|
|
31
|
-
export default function Video(props: any): JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export type BlockStylesProps = {
|
|
3
|
-
block: BuilderBlock;
|
|
4
|
-
context: BuilderContextInterface;
|
|
5
|
-
};
|
|
6
|
-
import type { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
8
|
-
declare function BlockStyles(props: BlockStylesProps): JSX.Element;
|
|
9
|
-
export default BlockStyles;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export type RenderBlockProps = {
|
|
3
|
-
block: BuilderBlock;
|
|
4
|
-
context: BuilderContextInterface;
|
|
5
|
-
};
|
|
6
|
-
import type { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
8
|
-
declare function RenderBlock(props: RenderBlockProps): JSX.Element;
|
|
9
|
-
export default RenderBlock;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../../context/types';
|
|
2
|
-
import type { BuilderBlock } from '../../types/builder-block';
|
|
3
|
-
import type { RepeatData } from './types';
|
|
4
|
-
export declare const isEmptyHtmlElement: (tagName: unknown) => boolean;
|
|
5
|
-
export declare const getComponent: ({ block, context, }: {
|
|
6
|
-
block: BuilderBlock;
|
|
7
|
-
context: BuilderContextInterface;
|
|
8
|
-
}) => import("../../context/types").RegisteredComponent | null | undefined;
|
|
9
|
-
export declare const getRepeatItemData: ({ block, context, }: {
|
|
10
|
-
block: BuilderBlock;
|
|
11
|
-
context: BuilderContextInterface;
|
|
12
|
-
}) => RepeatData[] | undefined;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type ComponentOptions = {
|
|
3
|
-
[index: string]: any;
|
|
4
|
-
attributes?: {
|
|
5
|
-
[index: string]: any;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export interface RenderComponentProps {
|
|
9
|
-
componentRef: any;
|
|
10
|
-
componentOptions: ComponentOptions;
|
|
11
|
-
blockChildren: BuilderBlock[];
|
|
12
|
-
context: BuilderContextInterface;
|
|
13
|
-
}
|
|
14
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
15
|
-
import type { BuilderContextInterface } from "../../context/types.js";
|
|
16
|
-
declare function RenderComponent(props: RenderComponentProps): JSX.Element;
|
|
17
|
-
export default RenderComponent;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type Props = {
|
|
3
|
-
block: BuilderBlock;
|
|
4
|
-
repeatContext: BuilderContextInterface;
|
|
5
|
-
};
|
|
6
|
-
import type { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
-
import type { BuilderBlock } from "../../types/builder-block";
|
|
8
|
-
declare function RenderRepeatedBlock(props: Props): JSX.Element;
|
|
9
|
-
export default RenderRepeatedBlock;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export type RenderBlockProps = {
|
|
3
|
-
blocks?: BuilderBlock[];
|
|
4
|
-
parent?: string;
|
|
5
|
-
path?: string;
|
|
6
|
-
styleProp?: Record<string, any>;
|
|
7
|
-
};
|
|
8
|
-
import type { BuilderBlock } from "../types/builder-block.js";
|
|
9
|
-
declare function RenderBlocks(props: RenderBlockProps): JSX.Element;
|
|
10
|
-
export default RenderBlocks;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface Props {
|
|
3
|
-
cssCode?: string;
|
|
4
|
-
customFonts?: CustomFont[];
|
|
5
|
-
contentId?: string;
|
|
6
|
-
}
|
|
7
|
-
import type { CustomFont } from "./render-styles.helpers";
|
|
8
|
-
declare function RenderContentStyles(props: Props): JSX.Element;
|
|
9
|
-
export default RenderContentStyles;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface CustomFont {
|
|
2
|
-
family?: string;
|
|
3
|
-
kind?: string;
|
|
4
|
-
fileUrl?: string;
|
|
5
|
-
files?: {
|
|
6
|
-
[key: string]: string;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export declare const getFontCss: ({ customFonts }: {
|
|
10
|
-
customFonts?: CustomFont[] | undefined;
|
|
11
|
-
}) => string;
|
|
12
|
-
export declare const getCss: ({ cssCode, contentId, }: {
|
|
13
|
-
cssCode?: string | undefined;
|
|
14
|
-
contentId?: string | undefined;
|
|
15
|
-
}) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './render-content';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BuilderContent } from '../../types/builder-content';
|
|
2
|
-
import type { Nullable } from '../../types/typescript';
|
|
3
|
-
import type { RenderContentProps } from './render-content.types';
|
|
4
|
-
export declare const getContextStateInitialValue: ({ content, data, locale, }: Pick<RenderContentProps, 'content' | 'data' | 'locale'>) => {
|
|
5
|
-
[x: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
export declare const getContentInitialValue: ({ content, data, }: Pick<RenderContentProps, 'content' | 'data'>) => Nullable<BuilderContent>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { BuilderRenderContext, RegisteredComponent, BuilderRenderState } from '../../context/types';
|
|
2
|
-
import type { BuilderContent } from '../../types/builder-content';
|
|
3
|
-
import type { Nullable } from '../../types/typescript';
|
|
4
|
-
import type { ApiVersion } from '../../types/api-version';
|
|
5
|
-
export interface RenderContentProps {
|
|
6
|
-
content?: Nullable<BuilderContent>;
|
|
7
|
-
model?: string;
|
|
8
|
-
data?: {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
context?: BuilderRenderContext;
|
|
12
|
-
apiKey: string;
|
|
13
|
-
apiVersion?: ApiVersion;
|
|
14
|
-
customComponents?: RegisteredComponent[];
|
|
15
|
-
canTrack?: boolean;
|
|
16
|
-
locale?: string;
|
|
17
|
-
/** @deprecated use `enrich` instead **/
|
|
18
|
-
includeRefs?: boolean;
|
|
19
|
-
enrich?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* TO-DO: improve qwik generator to not remap this name for non-HTML tags, then name it `className`
|
|
22
|
-
*/
|
|
23
|
-
classNameProp?: string;
|
|
24
|
-
hideContent?: boolean;
|
|
25
|
-
parentContentId?: string;
|
|
26
|
-
isSsrAbTest?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface BuilderComponentStateChange {
|
|
29
|
-
state: BuilderRenderState;
|
|
30
|
-
ref: {
|
|
31
|
-
name?: string;
|
|
32
|
-
props?: {
|
|
33
|
-
builderBlock?: {
|
|
34
|
-
id?: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Nullable } from '../../helpers/nullable';
|
|
2
|
-
import type { BuilderContent } from '../../types/builder-content';
|
|
3
|
-
export declare const getVariants: (content: Nullable<BuilderContent>) => import("../../types/builder-content").BuilderContentVariation[];
|
|
4
|
-
export declare const checkShouldRunVariants: ({ canTrack, content, }: {
|
|
5
|
-
canTrack: Nullable<boolean>;
|
|
6
|
-
content: Nullable<BuilderContent>;
|
|
7
|
-
}) => boolean;
|
|
8
|
-
type VariantData = {
|
|
9
|
-
id: string;
|
|
10
|
-
testRatio?: number;
|
|
11
|
-
};
|
|
12
|
-
export declare const getVariantsScriptString: (variants: VariantData[], contentId: string) => string;
|
|
13
|
-
export declare const getRenderContentScriptString: ({ parentContentId, contentId, }: {
|
|
14
|
-
contentId: string;
|
|
15
|
-
parentContentId: string;
|
|
16
|
-
}) => string;
|
|
17
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type VariantsProviderProps = RenderContentProps;
|
|
3
|
-
import type { RenderContentProps } from "../render-content/render-content.types";
|
|
4
|
-
declare function RenderContentVariants(props: VariantsProviderProps): JSX.Element;
|
|
5
|
-
export default RenderContentVariants;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { RegisteredComponent } from '../context/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Returns a list of all registered components.
|
|
4
|
-
* NOTE: This needs to be a function to work around ESM circular dependencies.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getDefaultRegisteredComponents: () => RegisteredComponent[];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type SizeName = 'large' | 'medium' | 'small';
|
|
2
|
-
interface Size {
|
|
3
|
-
min: number;
|
|
4
|
-
default: number;
|
|
5
|
-
max: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const getMaxWidthQueryForSize: (size: SizeName, sizeValues?: Record<SizeName, Size>) => string;
|
|
8
|
-
interface Breakpoints {
|
|
9
|
-
small?: number;
|
|
10
|
-
medium?: number;
|
|
11
|
-
}
|
|
12
|
-
export declare const getSizesForBreakpoints: ({ small, medium }: Breakpoints) => Record<SizeName, Size>;
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "UNKNOWN_VERSION";
|
package/dist/context/types.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { BuilderContent } from '../types/builder-content.js';
|
|
2
|
-
import type { ComponentInfo } from '../types/components.js';
|
|
3
|
-
import type { Dictionary, Nullable } from '../types/typescript.js';
|
|
4
|
-
import type { ApiVersion } from '../types/api-version.js';
|
|
5
|
-
export type RegisteredComponent = ComponentInfo & {
|
|
6
|
-
component: any;
|
|
7
|
-
};
|
|
8
|
-
export type RegisteredComponents = Dictionary<RegisteredComponent>;
|
|
9
|
-
export type BuilderRenderState = Record<string, unknown>;
|
|
10
|
-
export type BuilderRenderContext = Record<string, unknown>;
|
|
11
|
-
export interface BuilderContextInterface {
|
|
12
|
-
content: Nullable<BuilderContent>;
|
|
13
|
-
context: BuilderRenderContext;
|
|
14
|
-
/**
|
|
15
|
-
* The state of the application.
|
|
16
|
-
*
|
|
17
|
-
* NOTE: see `localState` below to understand how it is different from `rootState`.
|
|
18
|
-
*/
|
|
19
|
-
rootState: BuilderRenderState;
|
|
20
|
-
/**
|
|
21
|
-
* Some frameworks have a `setState` function which needs to be invoked to notify
|
|
22
|
-
* the framework of state change. (other frameworks don't in which case it is `undefined')
|
|
23
|
-
*/
|
|
24
|
-
rootSetState: ((rootState: BuilderRenderState) => void) | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* The local state of the current component. This is different from `rootState` in that
|
|
27
|
-
* it can be a child state created by a repeater containing local state.
|
|
28
|
-
* The `rootState` is where all of the state mutations are actually stored.
|
|
29
|
-
*/
|
|
30
|
-
localState: BuilderRenderState | undefined;
|
|
31
|
-
apiKey: string | null;
|
|
32
|
-
apiVersion: ApiVersion | undefined;
|
|
33
|
-
registeredComponents: RegisteredComponents;
|
|
34
|
-
inheritedStyles: Record<string, unknown>;
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const camelToKebabCase: (string: string) => string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BuilderContextInterface, BuilderRenderState } from '../context/types.js';
|
|
2
|
-
export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression, }: {
|
|
3
|
-
code: string;
|
|
4
|
-
event?: Event;
|
|
5
|
-
isExpression?: boolean;
|
|
6
|
-
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): any;
|
|
7
|
-
export declare function flattenState(rootState: Record<string | symbol, any>, localState: Record<string | symbol, any> | undefined, rootSetState: ((rootState: BuilderRenderState) => void) | undefined): BuilderRenderState;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getEventHandlerName: (key: string) => string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
-
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
-
type Options = {
|
|
4
|
-
block: BuilderBlock;
|
|
5
|
-
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>;
|
|
6
|
-
type EventHandler = (event: Event) => any;
|
|
7
|
-
export declare const createEventHandler: (value: string, options: Options) => EventHandler;
|
|
8
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
-
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
-
type Actions = {
|
|
4
|
-
[index: string]: (event: Event) => any;
|
|
5
|
-
};
|
|
6
|
-
export declare function getBlockActions(options: {
|
|
7
|
-
block: BuilderBlock;
|
|
8
|
-
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): Actions;
|
|
9
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type QueryObject = Record<string, string | string[]>;
|
|
2
|
-
export declare const convertSearchParamsToQueryObject: (searchParams: URLSearchParams) => QueryObject;
|
|
3
|
-
/**
|
|
4
|
-
* Receives a `URLSearchParams` object or a regular query object, and returns the subset of query params that are
|
|
5
|
-
* relevant to the Builder SDK.
|
|
6
|
-
*
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare const getBuilderSearchParams: (_options: QueryObject | URLSearchParams | undefined) => QueryObject;
|
|
10
|
-
export declare const getBuilderSearchParamsFromWindow: () => QueryObject;
|
|
11
|
-
export declare const normalizeSearchParams: (searchParams: QueryObject | URLSearchParams) => QueryObject;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
|
-
import type { GetContentOptions } from './types.js';
|
|
3
|
-
export declare function getContent(options: GetContentOptions): Promise<BuilderContent | null>;
|
|
4
|
-
type ContentResults = {
|
|
5
|
-
results: BuilderContent[];
|
|
6
|
-
};
|
|
7
|
-
type ContentResponse = ContentResults | {
|
|
8
|
-
status: number;
|
|
9
|
-
message: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Exported only for testing purposes. Should not be used directly.
|
|
13
|
-
*/
|
|
14
|
-
export declare const processContentResult: (options: GetContentOptions, content: ContentResults) => Promise<ContentResults>;
|
|
15
|
-
export declare function getAllContent(options: GetContentOptions): Promise<ContentResponse | null>;
|
|
16
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export interface GetContentOptions {
|
|
2
|
-
/** The model to get content for */
|
|
3
|
-
model: string;
|
|
4
|
-
/** Your public API key */
|
|
5
|
-
apiKey: string;
|
|
6
|
-
/** Number of items to fetch. Default is 1 */
|
|
7
|
-
limit?: number;
|
|
8
|
-
/** User attributes to target on, such as { urlPath: '/foo', device: 'mobile', ...etc } */
|
|
9
|
-
userAttributes?: (Record<string, string> & {
|
|
10
|
-
urlPath?: string;
|
|
11
|
-
}) | null;
|
|
12
|
-
/** Custom query */
|
|
13
|
-
query?: Record<string, any>;
|
|
14
|
-
/**
|
|
15
|
-
* Any other API options.
|
|
16
|
-
* Accepts both a key/value object or a `URLSearchParams` instance
|
|
17
|
-
* */
|
|
18
|
-
options?: Record<string, any> | URLSearchParams;
|
|
19
|
-
/**
|
|
20
|
-
* If set to `true`, it will lazy load symbols/references.
|
|
21
|
-
* If set to `false`, it will render the entire content tree eagerly.
|
|
22
|
-
* @deprecated use `enrich` instead
|
|
23
|
-
*/
|
|
24
|
-
noTraverse?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* If set to `false`, it will not use cookies to target content. Therefore, A/B Testing will be disabled and
|
|
27
|
-
* only the default variation will be returned to every user.
|
|
28
|
-
*
|
|
29
|
-
* Defaults to `true`.
|
|
30
|
-
*/
|
|
31
|
-
canTrack?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Include references in the response. Defaults to `true`.
|
|
34
|
-
* @deprecated use `enrich` instead
|
|
35
|
-
*/
|
|
36
|
-
includeRefs?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Include multilevel references in the response.
|
|
39
|
-
*/
|
|
40
|
-
enrich?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* If provided, the API will auto-resolve localized objects to the value of this `locale` key.
|
|
43
|
-
*/
|
|
44
|
-
locale?: string;
|
|
45
|
-
/**
|
|
46
|
-
* If provided, sets the Builder API version used to fetch content.
|
|
47
|
-
*
|
|
48
|
-
* Defaults to `v3`.
|
|
49
|
-
*/
|
|
50
|
-
apiVersion?: 'v2' | 'v3';
|
|
51
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const fetch: any;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
-
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
-
export declare function getProcessedBlock({ block, context, shouldEvaluateBindings, localState, rootState, rootSetState, }: {
|
|
4
|
-
block: BuilderBlock;
|
|
5
|
-
/**
|
|
6
|
-
* In some cases, we want to avoid evaluating bindings and only want framework-specific block transformation. It is
|
|
7
|
-
* also sometimes too early to consider bindings, e.g. when we might be looking at a repeated block.
|
|
8
|
-
*/
|
|
9
|
-
shouldEvaluateBindings: boolean;
|
|
10
|
-
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): BuilderBlock;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
-
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
-
export declare function getReactNativeBlockStyles({ block, context, blockStyles, }: {
|
|
4
|
-
block: BuilderBlock;
|
|
5
|
-
context: BuilderContextInterface;
|
|
6
|
-
blockStyles: any;
|
|
7
|
-
}): CSSStyleDeclaration | Record<string, string | undefined>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isBrowser(): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isEditing(): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isIframe(): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isPreviewing(): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RegisteredComponent } from '../context/types.js';
|
|
2
|
-
import type { ComponentInfo } from '../types/components.js';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.
|
|
5
|
-
*/
|
|
6
|
-
export declare const components: RegisteredComponent[];
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.
|
|
9
|
-
*/
|
|
10
|
-
export declare function registerComponent(component: any, info: ComponentInfo): void;
|
|
11
|
-
export declare const createRegisterComponentMessage: ({ component: _, ...info }: RegisteredComponent) => {
|
|
12
|
-
type: string;
|
|
13
|
-
data: ComponentInfo;
|
|
14
|
-
};
|