@builder.io/sdk-react 0.12.6 → 0.12.8
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/index.cjs +27 -27
- package/lib/browser/index.mjs +645 -606
- package/lib/browser/server-entry-564cbc17.cjs +2 -0
- package/lib/browser/server-entry-db4e2a47.js +690 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +4 -3
- package/lib/edge/index.cjs +44 -44
- package/lib/edge/index.mjs +1921 -1882
- package/lib/edge/server-entry-064c255e.js +690 -0
- package/lib/edge/server-entry-564cbc17.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +4 -3
- package/lib/node/index.cjs +10 -10
- package/lib/node/index.mjs +389 -350
- package/lib/node/server-entry-c063befa.cjs +2 -0
- package/lib/node/server-entry-d816840a.js +690 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +4 -3
- package/package.json +1 -1
- package/types/components/block/animator.d.ts +5 -0
- package/types/components/content-variants/helpers.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/subscribe-to-editor.d.ts +35 -0
- package/types/server-index.d.ts +18 -3
- package/types/types/builder-block.d.ts +18 -1
- package/lib/browser/server-entry-b9bdd327.js +0 -551
- package/lib/browser/server-entry-fc715776.cjs +0 -2
- package/lib/edge/server-entry-57d4ae22.js +0 -551
- package/lib/edge/server-entry-fc715776.cjs +0 -2
- package/lib/node/server-entry-0457c4c8.js +0 -551
- package/lib/node/server-entry-bcb725be.cjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-c063befa.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { _ as t, c as a,
|
|
1
|
+
import { _ as t, c as a, f as r, d as i, e as n, h as o, g, j as c, i as d, a as f, r as h, s as l, b as E, t as p } from "./server-entry-d816840a.js";
|
|
2
2
|
export {
|
|
3
3
|
t as _processContentResult,
|
|
4
4
|
a as createRegisterComponentMessage,
|
|
5
5
|
r as fetchBuilderProps,
|
|
6
6
|
i as fetchEntries,
|
|
7
7
|
n as fetchOneEntry,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
o as getAllContent,
|
|
9
|
+
g as getBuilderSearchParams,
|
|
10
10
|
c as getContent,
|
|
11
11
|
d as isEditing,
|
|
12
12
|
f as isPreviewing,
|
|
13
13
|
h as register,
|
|
14
14
|
l as setEditorSettings,
|
|
15
|
+
E as subscribeToEditor,
|
|
15
16
|
p as track
|
|
16
17
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BuilderAnimation } from '../../types/builder-block.js';
|
|
2
|
+
export declare function bindAnimations(animations: BuilderAnimation[]): void;
|
|
3
|
+
export declare function triggerAnimation(animation: BuilderAnimation): void;
|
|
4
|
+
export declare function bindHoverAnimation(animation: BuilderAnimation): void;
|
|
5
|
+
export declare function bindScrollInViewAnimation(animation: BuilderAnimation): void;
|
|
@@ -6,7 +6,7 @@ export declare const getVariants: (content: Nullable<BuilderContent>) => {
|
|
|
6
6
|
data?: {
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
title?: string;
|
|
9
|
-
blocks?: import("../../
|
|
9
|
+
blocks?: import("../../server-index.js").BuilderBlock[];
|
|
10
10
|
inputs?: import("../../types/input.js").Input[];
|
|
11
11
|
state?: {
|
|
12
12
|
[key: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.12.
|
|
1
|
+
export declare const SDK_VERSION = "0.12.8";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ContentProps } from '../components/content/content.types.js';
|
|
2
|
+
import type { BuilderAnimation } from '../types/builder-block.js';
|
|
3
|
+
import type { BuilderContent } from '../types/builder-content.js';
|
|
4
|
+
type ContentListener = Required<Pick<ContentProps, 'model' | 'trustedHosts'>> & {
|
|
5
|
+
callbacks: {
|
|
6
|
+
contentUpdate: (updatedContent: BuilderContent) => void;
|
|
7
|
+
animation: (updatedContent: BuilderAnimation) => void;
|
|
8
|
+
configureSdk: (updatedContent: any) => void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const createEditorListener: ({ model, trustedHosts, callbacks }: ContentListener) => (event: MessageEvent<any>) => void;
|
|
12
|
+
type SubscribeToEditor = (
|
|
13
|
+
/**
|
|
14
|
+
* The Builder `model` to subscribe to
|
|
15
|
+
*/
|
|
16
|
+
model: string,
|
|
17
|
+
/**
|
|
18
|
+
* The callback function to call when the content is updated.
|
|
19
|
+
*/
|
|
20
|
+
callback: (updatedContent: BuilderContent) => void,
|
|
21
|
+
/**
|
|
22
|
+
* Extra options for the listener.
|
|
23
|
+
*/
|
|
24
|
+
options?: {
|
|
25
|
+
/**
|
|
26
|
+
* List of hosts to allow editing content from.
|
|
27
|
+
*/
|
|
28
|
+
trustedHosts?: string[] | undefined;
|
|
29
|
+
}) => () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Subscribes to the Builder editor and listens to `content` updates of a certain `model`.
|
|
32
|
+
* Sends the updated `content` to the `callback` function.
|
|
33
|
+
*/
|
|
34
|
+
export declare const subscribeToEditor: SubscribeToEditor;
|
|
35
|
+
export {};
|
package/types/server-index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * from './index-helpers/top-of-file.js';
|
|
2
|
+
/**
|
|
3
|
+
* Component Prop types
|
|
4
|
+
*/
|
|
2
5
|
export type { ButtonProps } from './blocks/button/button.types.js';
|
|
3
6
|
export type { ColumnProps } from './blocks/columns/columns.types.js';
|
|
4
7
|
export type { FragmentProps } from './blocks/fragment/fragment.types.js';
|
|
@@ -9,6 +12,16 @@ export type { TextProps } from './blocks/text/text.types.js';
|
|
|
9
12
|
export type { VideoProps } from './blocks/video/video.types.js';
|
|
10
13
|
export type { BlocksProps } from './components/blocks/blocks.types.js';
|
|
11
14
|
export type { ContentVariantsPrps as ContentProps } from './components/content-variants/content-variants.types.js';
|
|
15
|
+
/**
|
|
16
|
+
* General Builder types
|
|
17
|
+
*/
|
|
18
|
+
export type { RegisteredComponent } from './context/types.js';
|
|
19
|
+
export type { BuilderBlock } from './types/builder-block.js';
|
|
20
|
+
export type { BuilderContent } from './types/builder-content.js';
|
|
21
|
+
export type { ComponentInfo } from './types/components.js';
|
|
22
|
+
/**
|
|
23
|
+
* Helper functions
|
|
24
|
+
*/
|
|
12
25
|
export { isEditing } from './functions/is-editing.js';
|
|
13
26
|
export { isPreviewing } from './functions/is-previewing.js';
|
|
14
27
|
export { createRegisterComponentMessage } from './functions/register-component.js';
|
|
@@ -16,9 +29,11 @@ export { register } from './functions/register.js';
|
|
|
16
29
|
export type { InsertMenuConfig, InsertMenuItem } from './functions/register.js';
|
|
17
30
|
export { setEditorSettings } from './functions/set-editor-settings.js';
|
|
18
31
|
export type { Settings } from './functions/set-editor-settings.js';
|
|
19
|
-
export { _processContentResult, fetchEntries, fetchOneEntry, getAllContent, getContent } from './functions/get-content/index.js';
|
|
20
32
|
export { getBuilderSearchParams } from './functions/get-builder-search-params/index.js';
|
|
21
33
|
export { track } from './functions/track/index.js';
|
|
22
|
-
export
|
|
23
|
-
|
|
34
|
+
export { subscribeToEditor } from './helpers/subscribe-to-editor.js';
|
|
35
|
+
/**
|
|
36
|
+
* Content fetching
|
|
37
|
+
*/
|
|
24
38
|
export { fetchBuilderProps } from './functions/fetch-builder-props.js';
|
|
39
|
+
export { _processContentResult, fetchEntries, fetchOneEntry, getAllContent, getContent } from './functions/get-content/index.js';
|
|
@@ -4,6 +4,23 @@ interface JSONObject {
|
|
|
4
4
|
}
|
|
5
5
|
interface JSONArray extends Array<JSONValue> {
|
|
6
6
|
}
|
|
7
|
+
export interface AnimationStep {
|
|
8
|
+
styles: {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
delay?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface BuilderAnimation {
|
|
14
|
+
elementId: string;
|
|
15
|
+
trigger: string;
|
|
16
|
+
steps: AnimationStep[];
|
|
17
|
+
duration: number;
|
|
18
|
+
delay?: number;
|
|
19
|
+
easing?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
repeat?: boolean;
|
|
22
|
+
thresholdPercent?: number;
|
|
23
|
+
}
|
|
7
24
|
/** @todo typedoc this */
|
|
8
25
|
export interface BuilderBlock {
|
|
9
26
|
'@type': '@builder.io/sdk:Element';
|
|
@@ -52,7 +69,7 @@ export interface BuilderBlock {
|
|
|
52
69
|
collection: string;
|
|
53
70
|
itemName?: string;
|
|
54
71
|
} | null;
|
|
55
|
-
animations?:
|
|
72
|
+
animations?: BuilderAnimation[];
|
|
56
73
|
style?: Partial<CSSStyleDeclaration>;
|
|
57
74
|
href?: string;
|
|
58
75
|
/**
|