@builder.io/sdk-react-nextjs 0.11.2 → 0.11.3
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/lib/browser/{USE_CLIENT_BUNDLE-27f8858d.cjs → USE_CLIENT_BUNDLE-2986f66f.cjs} +4 -4
- package/lib/{node/USE_CLIENT_BUNDLE-fef58fdc.js → browser/USE_CLIENT_BUNDLE-812d744e.js} +32 -32
- package/lib/{edge/USE_SERVER_BUNDLE-8b1e2888.cjs → browser/USE_SERVER_BUNDLE-3646ae12.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-bc0c817b.js → browser/USE_SERVER_BUNDLE-7d93f151.js} +1 -1
- package/lib/browser/{bundle-4ee84dab.js → bundle-062859d6.js} +353 -378
- package/lib/browser/bundle-b781019e.cjs +168 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-cdd14ec9.cjs → edge/USE_CLIENT_BUNDLE-7f127af4.cjs} +4 -4
- package/lib/{browser/USE_CLIENT_BUNDLE-336f80e4.js → edge/USE_CLIENT_BUNDLE-dc52931c.js} +32 -32
- package/lib/{node/USE_SERVER_BUNDLE-0bc450f5.js → edge/USE_SERVER_BUNDLE-207cbf86.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-830537df.cjs → edge/USE_SERVER_BUNDLE-29a862aa.cjs} +1 -1
- package/lib/edge/{bundle-d029deb6.cjs → bundle-24c6dba3.cjs} +32 -32
- package/lib/edge/{bundle-cd2b1a4d.js → bundle-52f65e64.js} +1018 -1043
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-c3dc5e68.cjs → node/USE_CLIENT_BUNDLE-c9e8796d.cjs} +4 -4
- package/lib/{edge/USE_CLIENT_BUNDLE-73820ea9.js → node/USE_CLIENT_BUNDLE-d5a78124.js} +32 -32
- package/lib/{browser/USE_SERVER_BUNDLE-657cf8f3.js → node/USE_SERVER_BUNDLE-5a34a612.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-57d976dd.cjs → node/USE_SERVER_BUNDLE-f94a06b5.cjs} +1 -1
- package/lib/node/{bundle-e760a35e.js → bundle-829842dd.js} +232 -257
- package/lib/node/{bundle-a03659b6.cjs → bundle-b0598b3a.cjs} +11 -11
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +97 -5
- package/types/cjs/blocks/button/button.d.ts +1 -9
- package/types/cjs/blocks/button/button.types.d.ts +6 -0
- package/types/cjs/blocks/columns/columns.d.ts +2 -14
- package/types/cjs/blocks/columns/columns.types.d.ts +15 -0
- package/types/cjs/blocks/fragment/fragment.d.ts +1 -5
- package/types/cjs/blocks/fragment/fragment.types.d.ts +5 -0
- package/types/cjs/blocks/image/image.d.ts +1 -19
- package/types/cjs/blocks/image/image.types.d.ts +19 -0
- package/types/cjs/blocks/section/section.d.ts +1 -9
- package/types/cjs/blocks/section/section.types.d.ts +6 -0
- package/types/cjs/blocks/symbol/symbol.d.ts +2 -23
- package/types/cjs/blocks/symbol/symbol.types.d.ts +18 -0
- package/types/cjs/blocks/text/text.d.ts +1 -3
- package/types/cjs/blocks/text/text.types.d.ts +3 -0
- package/types/cjs/blocks/video/video.d.ts +1 -21
- package/types/cjs/blocks/video/video.types.d.ts +21 -0
- package/types/cjs/components/blocks/blocks.d.ts +1 -6
- package/types/cjs/components/blocks/blocks.types.d.ts +6 -0
- package/types/cjs/components/content-variants/content-variants.types.d.ts +30 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-content/index.d.ts +1 -1
- package/types/cjs/functions/get-content/types.d.ts +2 -2
- package/types/cjs/server-index.d.ts +10 -1
- package/types/esm/blocks/button/button.d.ts +1 -9
- package/types/esm/blocks/button/button.types.d.ts +6 -0
- package/types/esm/blocks/columns/columns.d.ts +2 -14
- package/types/esm/blocks/columns/columns.types.d.ts +15 -0
- package/types/esm/blocks/fragment/fragment.d.ts +1 -5
- package/types/esm/blocks/fragment/fragment.types.d.ts +5 -0
- package/types/esm/blocks/image/image.d.ts +1 -19
- package/types/esm/blocks/image/image.types.d.ts +19 -0
- package/types/esm/blocks/section/section.d.ts +1 -9
- package/types/esm/blocks/section/section.types.d.ts +6 -0
- package/types/esm/blocks/symbol/symbol.d.ts +2 -23
- package/types/esm/blocks/symbol/symbol.types.d.ts +18 -0
- package/types/esm/blocks/text/text.d.ts +1 -3
- package/types/esm/blocks/text/text.types.d.ts +3 -0
- package/types/esm/blocks/video/video.d.ts +1 -21
- package/types/esm/blocks/video/video.types.d.ts +21 -0
- package/types/esm/components/blocks/blocks.d.ts +1 -6
- package/types/esm/components/blocks/blocks.types.d.ts +6 -0
- package/types/esm/components/content-variants/content-variants.types.d.ts +30 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-content/index.d.ts +1 -1
- package/types/esm/functions/get-content/types.d.ts +2 -2
- package/types/esm/server-index.d.ts +10 -1
- package/lib/browser/bundle-343c6c9c.cjs +0 -168
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export interface SymbolInfo {
|
|
6
|
-
model?: string;
|
|
7
|
-
entry?: string;
|
|
8
|
-
data?: any;
|
|
9
|
-
content?: BuilderContent;
|
|
10
|
-
inline?: boolean;
|
|
11
|
-
dynamic?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* This import is used by the Svelte SDK. Do not remove.
|
|
15
|
-
*/
|
|
16
|
-
export interface SymbolProps extends BuilderComponentsProp {
|
|
17
|
-
symbol?: SymbolInfo;
|
|
18
|
-
dataOnly?: boolean;
|
|
19
|
-
dynamic?: boolean;
|
|
20
|
-
attributes?: any;
|
|
21
|
-
inheritState?: boolean;
|
|
22
|
-
}
|
|
23
|
-
import type { BuilderContent } from "../../types/builder-content.js";
|
|
24
|
-
import type { BuilderComponentsProp, PropsWithBuilderData } from "../../types/builder-props.js";
|
|
2
|
+
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
3
|
+
import type { SymbolProps } from "./symbol.types.js";
|
|
25
4
|
declare function Symbol(props: PropsWithBuilderData<SymbolProps>): Promise<React.JSX.Element>;
|
|
26
5
|
export default Symbol;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
|
+
import type { BuilderComponentsProp } from '../../types/builder-props.js';
|
|
3
|
+
interface SymbolInfo {
|
|
4
|
+
model?: string;
|
|
5
|
+
entry?: string;
|
|
6
|
+
data?: any;
|
|
7
|
+
content?: BuilderContent;
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
dynamic?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SymbolProps extends BuilderComponentsProp {
|
|
12
|
+
symbol?: SymbolInfo;
|
|
13
|
+
dataOnly?: boolean;
|
|
14
|
+
dynamic?: boolean;
|
|
15
|
+
attributes?: any;
|
|
16
|
+
inheritState?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
attributes?: any;
|
|
4
|
-
video?: string;
|
|
5
|
-
autoPlay?: boolean;
|
|
6
|
-
controls?: boolean;
|
|
7
|
-
muted?: boolean;
|
|
8
|
-
loop?: boolean;
|
|
9
|
-
playsInline?: boolean;
|
|
10
|
-
aspectRatio?: number;
|
|
11
|
-
width?: number;
|
|
12
|
-
height?: number;
|
|
13
|
-
fit?: "contain" | "cover" | "fill";
|
|
14
|
-
preload?: "auto" | "metadata" | "none";
|
|
15
|
-
position?: "center" | "top" | "left" | "right" | "bottom" | "top left" | "top right" | "bottom left" | "bottom right";
|
|
16
|
-
posterImage?: string;
|
|
17
|
-
lazyLoad?: boolean;
|
|
18
|
-
children?: any;
|
|
19
|
-
fitContent?: boolean;
|
|
20
|
-
builderBlock?: BuilderBlock;
|
|
21
|
-
}
|
|
22
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
2
|
+
import type { VideoProps } from "./video.types.js";
|
|
23
3
|
declare function Video(props: VideoProps): React.JSX.Element;
|
|
24
4
|
export default Video;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
|
+
export interface VideoProps {
|
|
3
|
+
attributes?: any;
|
|
4
|
+
video?: string;
|
|
5
|
+
autoPlay?: boolean;
|
|
6
|
+
controls?: boolean;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
playsInline?: boolean;
|
|
10
|
+
aspectRatio?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
fit?: 'contain' | 'cover' | 'fill';
|
|
14
|
+
preload?: 'auto' | 'metadata' | 'none';
|
|
15
|
+
position?: 'center' | 'top' | 'left' | 'right' | 'bottom' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
|
|
16
|
+
posterImage?: string;
|
|
17
|
+
lazyLoad?: boolean;
|
|
18
|
+
children?: any;
|
|
19
|
+
fitContent?: boolean;
|
|
20
|
+
builderBlock?: BuilderBlock;
|
|
21
|
+
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
context?: BuilderContextInterface;
|
|
4
|
-
registeredComponents?: RegisteredComponents;
|
|
5
|
-
};
|
|
6
|
-
import type { BuilderContextInterface, RegisteredComponents } from "../../context/types.js";
|
|
7
|
-
import type { BlocksWrapperProps } from "./blocks-wrapper.js";
|
|
2
|
+
import type { BlocksProps } from "./blocks.types.js";
|
|
8
3
|
declare function Blocks(props: BlocksProps): React.JSX.Element;
|
|
9
4
|
export default Blocks;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BuilderContextInterface, RegisteredComponents } from '../../context/types.js';
|
|
2
|
+
import type { BlocksWrapperProps } from './blocks-wrapper.js';
|
|
3
|
+
export type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'>> & {
|
|
4
|
+
context?: BuilderContextInterface;
|
|
5
|
+
registeredComponents?: RegisteredComponents;
|
|
6
|
+
};
|
|
@@ -3,19 +3,48 @@ import type { ApiVersion } from '../../types/api-version.js';
|
|
|
3
3
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
4
4
|
import type { Nullable } from '../../types/typescript.js';
|
|
5
5
|
export interface ContentVariantsPrps {
|
|
6
|
+
/**
|
|
7
|
+
* The Builder content JSON to render (required).
|
|
8
|
+
*/
|
|
6
9
|
content?: Nullable<BuilderContent>;
|
|
10
|
+
/**
|
|
11
|
+
* The Builder content `model` to render (required).
|
|
12
|
+
*/
|
|
7
13
|
model?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional data to inject into your Builder content (optional).
|
|
16
|
+
*/
|
|
8
17
|
data?: {
|
|
9
18
|
[key: string]: any;
|
|
10
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
11
23
|
context?: BuilderRenderContext;
|
|
24
|
+
/**
|
|
25
|
+
* Your API Key: needed to dynamically fetch symbols (required).
|
|
26
|
+
*/
|
|
12
27
|
apiKey: string;
|
|
13
28
|
apiVersion?: ApiVersion;
|
|
29
|
+
/**
|
|
30
|
+
* An array of custom components to register (optional).
|
|
31
|
+
*/
|
|
14
32
|
customComponents?: RegisteredComponent[];
|
|
33
|
+
/**
|
|
34
|
+
* A boolean to enable or disable tracking (optional). Defaults to `true`.
|
|
35
|
+
*/
|
|
15
36
|
canTrack?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* If provided, the API will auto-resolve localized objects to the value of this `locale` key (optional).
|
|
39
|
+
*/
|
|
16
40
|
locale?: string;
|
|
17
|
-
/** @deprecated use `enrich` instead
|
|
41
|
+
/** @deprecated use `enrich` instead */
|
|
18
42
|
includeRefs?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* A boolean to enable or disable enriching API content (optional).
|
|
45
|
+
*
|
|
46
|
+
* Enriching will Include multilevel references in the response. Defaults to `false`.
|
|
47
|
+
*/
|
|
19
48
|
enrich?: boolean;
|
|
20
49
|
/**
|
|
21
50
|
* The element that wraps your content. Defaults to `div` ('ScrollView' in React Native).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.11.
|
|
1
|
+
export declare const SDK_VERSION = "0.11.3";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
2
|
import type { GetContentOptions } from './types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Returns
|
|
4
|
+
* Returns the first content entry that matches the given options.
|
|
5
5
|
*/
|
|
6
6
|
export declare function fetchOneEntry(options: GetContentOptions): Promise<BuilderContent | null>;
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface GetContentOptions {
|
|
2
|
-
/** The model to get content for */
|
|
2
|
+
/** The model to get content for (required) */
|
|
3
3
|
model: string;
|
|
4
|
-
/** Your public API key */
|
|
4
|
+
/** Your public API key (required) */
|
|
5
5
|
apiKey: string;
|
|
6
6
|
/** Number of items to fetch. Default is 1 */
|
|
7
7
|
limit?: number;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
export * from './index-helpers/top-of-file.js';
|
|
2
|
+
export type { ButtonProps } from './blocks/button/button.types.js';
|
|
3
|
+
export type { ColumnProps } from './blocks/columns/columns.types.js';
|
|
4
|
+
export type { FragmentProps } from './blocks/fragment/fragment.types.js';
|
|
5
|
+
export type { ImageProps } from './blocks/image/image.types.js';
|
|
6
|
+
export type { SectionProps } from './blocks/section/section.types.js';
|
|
7
|
+
export type { SymbolProps } from './blocks/symbol/symbol.types.js';
|
|
8
|
+
export type { TextProps } from './blocks/text/text.types.js';
|
|
9
|
+
export type { VideoProps } from './blocks/video/video.types.js';
|
|
10
|
+
export type { BlocksProps } from './components/blocks/blocks.types.js';
|
|
11
|
+
export type { ContentVariantsPrps as ContentProps } from './components/content-variants/content-variants.types.js';
|
|
2
12
|
export { isEditing } from './functions/is-editing.js';
|
|
3
13
|
export { isPreviewing } from './functions/is-previewing.js';
|
|
4
14
|
export { createRegisterComponentMessage } from './functions/register-component.js';
|
|
@@ -9,7 +19,6 @@ export type { Settings } from './functions/set-editor-settings.js';
|
|
|
9
19
|
export { _processContentResult, fetchEntries, fetchOneEntry, getAllContent, getContent } from './functions/get-content/index.js';
|
|
10
20
|
export { getBuilderSearchParams } from './functions/get-builder-search-params/index.js';
|
|
11
21
|
export { track } from './functions/track/index.js';
|
|
12
|
-
export type { ContentProps } from './components/content/content.types.js';
|
|
13
22
|
export type { RegisteredComponent } from './context/types.js';
|
|
14
23
|
export type { ComponentInfo } from './types/components.js';
|
|
15
24
|
export { fetchBuilderProps } from './functions/fetch-builder-props.js';
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
* This import is used by the Svelte SDK. Do not remove.
|
|
4
|
-
*/
|
|
5
|
-
export interface ButtonProps {
|
|
6
|
-
attributes?: any;
|
|
7
|
-
text?: string;
|
|
8
|
-
link?: string;
|
|
9
|
-
openLinkInNewTab?: boolean;
|
|
10
|
-
}
|
|
2
|
+
import type { ButtonProps } from "./button.types.js";
|
|
11
3
|
declare function Button(props: ButtonProps): React.JSX.Element;
|
|
12
4
|
export default Button;
|
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
width?: number;
|
|
5
|
-
};
|
|
6
|
-
type StackColumnsAt = "tablet" | "mobile" | "never";
|
|
7
|
-
export interface ColumnProps extends BuilderComponentsProp {
|
|
8
|
-
columns?: Column[];
|
|
9
|
-
builderBlock: BuilderBlock;
|
|
10
|
-
space?: number;
|
|
11
|
-
stackColumnsAt?: StackColumnsAt;
|
|
12
|
-
reverseColumnsWhenStacked?: boolean;
|
|
13
|
-
}
|
|
14
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
15
|
-
import type { BuilderComponentsProp, PropsWithBuilderData } from "../../types/builder-props.js";
|
|
2
|
+
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
3
|
+
import type { ColumnProps } from "./columns.types.js";
|
|
16
4
|
declare function Columns(props: PropsWithBuilderData<ColumnProps>): React.JSX.Element;
|
|
17
5
|
export default Columns;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
|
+
import type { BuilderComponentsProp } from '../../types/builder-props.js';
|
|
3
|
+
type Column = {
|
|
4
|
+
blocks: BuilderBlock[];
|
|
5
|
+
width?: number;
|
|
6
|
+
};
|
|
7
|
+
type StackColumnsAt = 'tablet' | 'mobile' | 'never';
|
|
8
|
+
export interface ColumnProps extends BuilderComponentsProp {
|
|
9
|
+
columns?: Column[];
|
|
10
|
+
builderBlock: BuilderBlock;
|
|
11
|
+
space?: number;
|
|
12
|
+
stackColumnsAt?: StackColumnsAt;
|
|
13
|
+
reverseColumnsWhenStacked?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
maxWidth?: number;
|
|
4
|
-
attributes?: any;
|
|
5
|
-
children?: any;
|
|
6
|
-
}
|
|
2
|
+
import type { FragmentProps } from "./fragment.types.js";
|
|
7
3
|
declare function FragmentComponent(props: FragmentProps): React.JSX.Element;
|
|
8
4
|
export default FragmentComponent;
|
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
className?: string;
|
|
4
|
-
image: string;
|
|
5
|
-
sizes?: string;
|
|
6
|
-
lazy?: boolean;
|
|
7
|
-
height?: number;
|
|
8
|
-
width?: number;
|
|
9
|
-
altText?: string;
|
|
10
|
-
backgroundSize?: "cover" | "contain";
|
|
11
|
-
backgroundPosition?: string;
|
|
12
|
-
srcset?: string;
|
|
13
|
-
aspectRatio?: number;
|
|
14
|
-
children?: any;
|
|
15
|
-
fitContent?: boolean;
|
|
16
|
-
builderBlock?: BuilderBlock;
|
|
17
|
-
noWebp?: boolean;
|
|
18
|
-
src?: string;
|
|
19
|
-
}
|
|
20
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
2
|
+
import type { ImageProps } from "./image.types.js";
|
|
21
3
|
declare function Image(props: ImageProps): React.JSX.Element;
|
|
22
4
|
export default Image;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
|
+
export interface ImageProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
image: string;
|
|
5
|
+
sizes?: string;
|
|
6
|
+
lazy?: boolean;
|
|
7
|
+
height?: number;
|
|
8
|
+
width?: number;
|
|
9
|
+
altText?: string;
|
|
10
|
+
backgroundSize?: 'cover' | 'contain';
|
|
11
|
+
backgroundPosition?: string;
|
|
12
|
+
srcset?: string;
|
|
13
|
+
aspectRatio?: number;
|
|
14
|
+
children?: any;
|
|
15
|
+
fitContent?: boolean;
|
|
16
|
+
builderBlock?: BuilderBlock;
|
|
17
|
+
noWebp?: boolean;
|
|
18
|
+
src?: string;
|
|
19
|
+
}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
* This import is used by the Svelte SDK. Do not remove.
|
|
4
|
-
*/
|
|
5
|
-
export interface SectionProps {
|
|
6
|
-
maxWidth?: number;
|
|
7
|
-
attributes?: any;
|
|
8
|
-
children?: any;
|
|
9
|
-
builderBlock?: any;
|
|
10
|
-
}
|
|
2
|
+
import type { SectionProps } from "./section.types.js";
|
|
11
3
|
declare function SectionComponent(props: SectionProps): React.JSX.Element;
|
|
12
4
|
export default SectionComponent;
|
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export interface SymbolInfo {
|
|
6
|
-
model?: string;
|
|
7
|
-
entry?: string;
|
|
8
|
-
data?: any;
|
|
9
|
-
content?: BuilderContent;
|
|
10
|
-
inline?: boolean;
|
|
11
|
-
dynamic?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* This import is used by the Svelte SDK. Do not remove.
|
|
15
|
-
*/
|
|
16
|
-
export interface SymbolProps extends BuilderComponentsProp {
|
|
17
|
-
symbol?: SymbolInfo;
|
|
18
|
-
dataOnly?: boolean;
|
|
19
|
-
dynamic?: boolean;
|
|
20
|
-
attributes?: any;
|
|
21
|
-
inheritState?: boolean;
|
|
22
|
-
}
|
|
23
|
-
import type { BuilderContent } from "../../types/builder-content.js";
|
|
24
|
-
import type { BuilderComponentsProp, PropsWithBuilderData } from "../../types/builder-props.js";
|
|
2
|
+
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
3
|
+
import type { SymbolProps } from "./symbol.types.js";
|
|
25
4
|
declare function Symbol(props: PropsWithBuilderData<SymbolProps>): Promise<React.JSX.Element>;
|
|
26
5
|
export default Symbol;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
|
+
import type { BuilderComponentsProp } from '../../types/builder-props.js';
|
|
3
|
+
interface SymbolInfo {
|
|
4
|
+
model?: string;
|
|
5
|
+
entry?: string;
|
|
6
|
+
data?: any;
|
|
7
|
+
content?: BuilderContent;
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
dynamic?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SymbolProps extends BuilderComponentsProp {
|
|
12
|
+
symbol?: SymbolInfo;
|
|
13
|
+
dataOnly?: boolean;
|
|
14
|
+
dynamic?: boolean;
|
|
15
|
+
attributes?: any;
|
|
16
|
+
inheritState?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
attributes?: any;
|
|
4
|
-
video?: string;
|
|
5
|
-
autoPlay?: boolean;
|
|
6
|
-
controls?: boolean;
|
|
7
|
-
muted?: boolean;
|
|
8
|
-
loop?: boolean;
|
|
9
|
-
playsInline?: boolean;
|
|
10
|
-
aspectRatio?: number;
|
|
11
|
-
width?: number;
|
|
12
|
-
height?: number;
|
|
13
|
-
fit?: "contain" | "cover" | "fill";
|
|
14
|
-
preload?: "auto" | "metadata" | "none";
|
|
15
|
-
position?: "center" | "top" | "left" | "right" | "bottom" | "top left" | "top right" | "bottom left" | "bottom right";
|
|
16
|
-
posterImage?: string;
|
|
17
|
-
lazyLoad?: boolean;
|
|
18
|
-
children?: any;
|
|
19
|
-
fitContent?: boolean;
|
|
20
|
-
builderBlock?: BuilderBlock;
|
|
21
|
-
}
|
|
22
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
2
|
+
import type { VideoProps } from "./video.types.js";
|
|
23
3
|
declare function Video(props: VideoProps): React.JSX.Element;
|
|
24
4
|
export default Video;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
|
+
export interface VideoProps {
|
|
3
|
+
attributes?: any;
|
|
4
|
+
video?: string;
|
|
5
|
+
autoPlay?: boolean;
|
|
6
|
+
controls?: boolean;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
playsInline?: boolean;
|
|
10
|
+
aspectRatio?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
fit?: 'contain' | 'cover' | 'fill';
|
|
14
|
+
preload?: 'auto' | 'metadata' | 'none';
|
|
15
|
+
position?: 'center' | 'top' | 'left' | 'right' | 'bottom' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
|
|
16
|
+
posterImage?: string;
|
|
17
|
+
lazyLoad?: boolean;
|
|
18
|
+
children?: any;
|
|
19
|
+
fitContent?: boolean;
|
|
20
|
+
builderBlock?: BuilderBlock;
|
|
21
|
+
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
context?: BuilderContextInterface;
|
|
4
|
-
registeredComponents?: RegisteredComponents;
|
|
5
|
-
};
|
|
6
|
-
import type { BuilderContextInterface, RegisteredComponents } from "../../context/types.js";
|
|
7
|
-
import type { BlocksWrapperProps } from "./blocks-wrapper.js";
|
|
2
|
+
import type { BlocksProps } from "./blocks.types.js";
|
|
8
3
|
declare function Blocks(props: BlocksProps): React.JSX.Element;
|
|
9
4
|
export default Blocks;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BuilderContextInterface, RegisteredComponents } from '../../context/types.js';
|
|
2
|
+
import type { BlocksWrapperProps } from './blocks-wrapper.js';
|
|
3
|
+
export type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'>> & {
|
|
4
|
+
context?: BuilderContextInterface;
|
|
5
|
+
registeredComponents?: RegisteredComponents;
|
|
6
|
+
};
|
|
@@ -3,19 +3,48 @@ import type { ApiVersion } from '../../types/api-version.js';
|
|
|
3
3
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
4
4
|
import type { Nullable } from '../../types/typescript.js';
|
|
5
5
|
export interface ContentVariantsPrps {
|
|
6
|
+
/**
|
|
7
|
+
* The Builder content JSON to render (required).
|
|
8
|
+
*/
|
|
6
9
|
content?: Nullable<BuilderContent>;
|
|
10
|
+
/**
|
|
11
|
+
* The Builder content `model` to render (required).
|
|
12
|
+
*/
|
|
7
13
|
model?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional data to inject into your Builder content (optional).
|
|
16
|
+
*/
|
|
8
17
|
data?: {
|
|
9
18
|
[key: string]: any;
|
|
10
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
11
23
|
context?: BuilderRenderContext;
|
|
24
|
+
/**
|
|
25
|
+
* Your API Key: needed to dynamically fetch symbols (required).
|
|
26
|
+
*/
|
|
12
27
|
apiKey: string;
|
|
13
28
|
apiVersion?: ApiVersion;
|
|
29
|
+
/**
|
|
30
|
+
* An array of custom components to register (optional).
|
|
31
|
+
*/
|
|
14
32
|
customComponents?: RegisteredComponent[];
|
|
33
|
+
/**
|
|
34
|
+
* A boolean to enable or disable tracking (optional). Defaults to `true`.
|
|
35
|
+
*/
|
|
15
36
|
canTrack?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* If provided, the API will auto-resolve localized objects to the value of this `locale` key (optional).
|
|
39
|
+
*/
|
|
16
40
|
locale?: string;
|
|
17
|
-
/** @deprecated use `enrich` instead
|
|
41
|
+
/** @deprecated use `enrich` instead */
|
|
18
42
|
includeRefs?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* A boolean to enable or disable enriching API content (optional).
|
|
45
|
+
*
|
|
46
|
+
* Enriching will Include multilevel references in the response. Defaults to `false`.
|
|
47
|
+
*/
|
|
19
48
|
enrich?: boolean;
|
|
20
49
|
/**
|
|
21
50
|
* The element that wraps your content. Defaults to `div` ('ScrollView' in React Native).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.11.
|
|
1
|
+
export declare const SDK_VERSION = "0.11.3";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
2
|
import type { GetContentOptions } from './types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Returns
|
|
4
|
+
* Returns the first content entry that matches the given options.
|
|
5
5
|
*/
|
|
6
6
|
export declare function fetchOneEntry(options: GetContentOptions): Promise<BuilderContent | null>;
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface GetContentOptions {
|
|
2
|
-
/** The model to get content for */
|
|
2
|
+
/** The model to get content for (required) */
|
|
3
3
|
model: string;
|
|
4
|
-
/** Your public API key */
|
|
4
|
+
/** Your public API key (required) */
|
|
5
5
|
apiKey: string;
|
|
6
6
|
/** Number of items to fetch. Default is 1 */
|
|
7
7
|
limit?: number;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
export * from './index-helpers/top-of-file.js';
|
|
2
|
+
export type { ButtonProps } from './blocks/button/button.types.js';
|
|
3
|
+
export type { ColumnProps } from './blocks/columns/columns.types.js';
|
|
4
|
+
export type { FragmentProps } from './blocks/fragment/fragment.types.js';
|
|
5
|
+
export type { ImageProps } from './blocks/image/image.types.js';
|
|
6
|
+
export type { SectionProps } from './blocks/section/section.types.js';
|
|
7
|
+
export type { SymbolProps } from './blocks/symbol/symbol.types.js';
|
|
8
|
+
export type { TextProps } from './blocks/text/text.types.js';
|
|
9
|
+
export type { VideoProps } from './blocks/video/video.types.js';
|
|
10
|
+
export type { BlocksProps } from './components/blocks/blocks.types.js';
|
|
11
|
+
export type { ContentVariantsPrps as ContentProps } from './components/content-variants/content-variants.types.js';
|
|
2
12
|
export { isEditing } from './functions/is-editing.js';
|
|
3
13
|
export { isPreviewing } from './functions/is-previewing.js';
|
|
4
14
|
export { createRegisterComponentMessage } from './functions/register-component.js';
|
|
@@ -9,7 +19,6 @@ export type { Settings } from './functions/set-editor-settings.js';
|
|
|
9
19
|
export { _processContentResult, fetchEntries, fetchOneEntry, getAllContent, getContent } from './functions/get-content/index.js';
|
|
10
20
|
export { getBuilderSearchParams } from './functions/get-builder-search-params/index.js';
|
|
11
21
|
export { track } from './functions/track/index.js';
|
|
12
|
-
export type { ContentProps } from './components/content/content.types.js';
|
|
13
22
|
export type { RegisteredComponent } from './context/types.js';
|
|
14
23
|
export type { ComponentInfo } from './types/components.js';
|
|
15
24
|
export { fetchBuilderProps } from './functions/fetch-builder-props.js';
|