@builder.io/sdk-react-nextjs 0.20.1 → 0.22.0
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/blocks/symbol/symbol.cjs +1 -1
- package/lib/browser/blocks/symbol/symbol.mjs +27 -25
- package/lib/browser/blocks/text/component-info.cjs +1 -1
- package/lib/browser/blocks/text/component-info.mjs +0 -1
- package/lib/browser/blocks/text/text.cjs +1 -1
- package/lib/browser/blocks/text/text.mjs +3 -2
- package/lib/browser/components/block/block.cjs +1 -1
- package/lib/browser/components/block/block.mjs +27 -20
- package/lib/browser/components/block/components/component-ref/component-ref.cjs +1 -1
- package/lib/browser/components/block/components/component-ref/component-ref.mjs +11 -11
- package/lib/browser/components/block/components/interactive-element.cjs +1 -1
- package/lib/browser/components/block/components/interactive-element.mjs +27 -15
- package/lib/browser/components/block/components/live-edit-block-styles.cjs +1 -0
- package/lib/browser/components/block/components/live-edit-block-styles.mjs +94 -0
- package/lib/browser/components/block/components/style-wrapper.cjs +1 -0
- package/lib/browser/components/block/components/style-wrapper.mjs +24 -0
- package/lib/browser/components/blocks/blocks-wrapper.cjs +1 -1
- package/lib/browser/components/blocks/blocks-wrapper.mjs +2 -2
- package/lib/browser/components/content/components/enable-editor.cjs +1 -1
- package/lib/browser/components/content/components/enable-editor.mjs +195 -166
- package/lib/browser/components/live-edit.cjs +1 -0
- package/lib/browser/components/live-edit.mjs +19 -0
- package/lib/browser/constants/builder-registered-components.cjs +1 -1
- package/lib/browser/constants/builder-registered-components.mjs +3 -2
- package/lib/browser/constants/extra-components.cjs +1 -1
- package/lib/browser/constants/extra-components.mjs +3 -2
- package/lib/browser/constants/sdk-version.cjs +1 -1
- package/lib/browser/constants/sdk-version.mjs +1 -1
- package/lib/browser/helpers/find-block.cjs +1 -0
- package/lib/browser/helpers/find-block.mjs +30 -0
- package/lib/browser/helpers/subscribe-to-editor.cjs +1 -1
- package/lib/browser/helpers/subscribe-to-editor.mjs +15 -15
- package/lib/edge/blocks/symbol/symbol.cjs +1 -1
- package/lib/edge/blocks/symbol/symbol.mjs +27 -25
- package/lib/edge/blocks/text/component-info.cjs +1 -1
- package/lib/edge/blocks/text/component-info.mjs +0 -1
- package/lib/edge/blocks/text/text.cjs +1 -1
- package/lib/edge/blocks/text/text.mjs +3 -2
- package/lib/edge/components/block/block.cjs +1 -1
- package/lib/edge/components/block/block.mjs +27 -20
- package/lib/edge/components/block/components/component-ref/component-ref.cjs +1 -1
- package/lib/edge/components/block/components/component-ref/component-ref.mjs +11 -11
- package/lib/edge/components/block/components/interactive-element.cjs +1 -1
- package/lib/edge/components/block/components/interactive-element.mjs +27 -15
- package/lib/edge/components/block/components/live-edit-block-styles.cjs +1 -0
- package/lib/edge/components/block/components/live-edit-block-styles.mjs +94 -0
- package/lib/edge/components/block/components/style-wrapper.cjs +1 -0
- package/lib/edge/components/block/components/style-wrapper.mjs +24 -0
- package/lib/edge/components/blocks/blocks-wrapper.cjs +1 -1
- package/lib/edge/components/blocks/blocks-wrapper.mjs +2 -2
- package/lib/edge/components/content/components/enable-editor.cjs +1 -1
- package/lib/edge/components/content/components/enable-editor.mjs +195 -166
- package/lib/edge/components/live-edit.cjs +1 -0
- package/lib/edge/components/live-edit.mjs +19 -0
- package/lib/edge/constants/builder-registered-components.cjs +1 -1
- package/lib/edge/constants/builder-registered-components.mjs +3 -2
- package/lib/edge/constants/extra-components.cjs +1 -1
- package/lib/edge/constants/extra-components.mjs +3 -2
- package/lib/edge/constants/sdk-version.cjs +1 -1
- package/lib/edge/constants/sdk-version.mjs +1 -1
- package/lib/edge/helpers/find-block.cjs +1 -0
- package/lib/edge/helpers/find-block.mjs +30 -0
- package/lib/edge/helpers/subscribe-to-editor.cjs +1 -1
- package/lib/edge/helpers/subscribe-to-editor.mjs +15 -15
- package/lib/node/blocks/symbol/symbol.cjs +1 -1
- package/lib/node/blocks/symbol/symbol.mjs +27 -25
- package/lib/node/blocks/text/component-info.cjs +1 -1
- package/lib/node/blocks/text/component-info.mjs +0 -1
- package/lib/node/blocks/text/text.cjs +1 -1
- package/lib/node/blocks/text/text.mjs +3 -2
- package/lib/node/components/block/block.cjs +1 -1
- package/lib/node/components/block/block.mjs +27 -20
- package/lib/node/components/block/components/component-ref/component-ref.cjs +1 -1
- package/lib/node/components/block/components/component-ref/component-ref.mjs +11 -11
- package/lib/node/components/block/components/interactive-element.cjs +1 -1
- package/lib/node/components/block/components/interactive-element.mjs +27 -15
- package/lib/node/components/block/components/live-edit-block-styles.cjs +1 -0
- package/lib/node/components/block/components/live-edit-block-styles.mjs +94 -0
- package/lib/node/components/block/components/style-wrapper.cjs +1 -0
- package/lib/node/components/block/components/style-wrapper.mjs +24 -0
- package/lib/node/components/blocks/blocks-wrapper.cjs +1 -1
- package/lib/node/components/blocks/blocks-wrapper.mjs +2 -2
- package/lib/node/components/content/components/enable-editor.cjs +1 -1
- package/lib/node/components/content/components/enable-editor.mjs +195 -166
- package/lib/node/components/live-edit.cjs +1 -0
- package/lib/node/components/live-edit.mjs +19 -0
- package/lib/node/constants/builder-registered-components.cjs +1 -1
- package/lib/node/constants/builder-registered-components.mjs +3 -2
- package/lib/node/constants/extra-components.cjs +1 -1
- package/lib/node/constants/extra-components.mjs +3 -2
- package/lib/node/constants/sdk-version.cjs +1 -1
- package/lib/node/constants/sdk-version.mjs +1 -1
- package/lib/node/helpers/find-block.cjs +1 -0
- package/lib/node/helpers/find-block.mjs +30 -0
- package/lib/node/helpers/subscribe-to-editor.cjs +1 -1
- package/lib/node/helpers/subscribe-to-editor.mjs +15 -15
- package/package.json +1 -1
- package/types/cjs/blocks/symbol/symbol.types.d.ts +1 -2
- package/types/cjs/components/awaiter.d.ts +1 -11
- package/types/cjs/components/awaiter.types.d.ts +7 -0
- package/types/cjs/components/block/components/live-edit-block-styles.d.ts +8 -0
- package/types/cjs/components/block/components/style-wrapper.d.ts +9 -0
- package/types/cjs/components/live-edit.d.ts +9 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/helpers/find-block.d.ts +18 -0
- package/types/cjs/helpers/subscribe-to-editor.d.ts +3 -2
- package/types/esm/blocks/symbol/symbol.types.d.ts +1 -2
- package/types/esm/components/awaiter.d.ts +1 -11
- package/types/esm/components/awaiter.types.d.ts +7 -0
- package/types/esm/components/block/components/live-edit-block-styles.d.ts +8 -0
- package/types/esm/components/block/components/style-wrapper.d.ts +9 -0
- package/types/esm/components/live-edit.d.ts +9 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/helpers/find-block.d.ts +18 -0
- package/types/esm/helpers/subscribe-to-editor.d.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../blocks/custom-code/component-info.cjs"),o=require("../blocks/custom-code/custom-code.cjs"),n=require("../blocks/embed/component-info.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../blocks/custom-code/component-info.cjs"),o=require("../blocks/custom-code/custom-code.cjs"),n=require("../blocks/embed/component-info.cjs"),r=require("../blocks/embed/embed.cjs");require("react/jsx-runtime");require("react");require("../functions/evaluate/node-runtime/safeDynamicRequire.cjs");require("../helpers/user-attributes.cjs");require("../functions/get-fetch.cjs");require("../context/builder.context.cjs");const t=require("../blocks/img/component-info.cjs"),c=require("../blocks/img/img.cjs"),i=require("../blocks/video/component-info.cjs"),m=require("../blocks/video/video.cjs"),u=()=>[{component:o,...e.componentInfo},{component:r,...n.componentInfo},{component:c,...t.componentInfo},{component:m,...i.componentInfo}];exports.getExtraComponents=u;
|
|
@@ -7,11 +7,12 @@ import "react";
|
|
|
7
7
|
import "../functions/evaluate/node-runtime/safeDynamicRequire.mjs";
|
|
8
8
|
import "../helpers/user-attributes.mjs";
|
|
9
9
|
import "../functions/get-fetch.mjs";
|
|
10
|
+
import "../context/builder.context.mjs";
|
|
10
11
|
import { componentInfo as p } from "../blocks/img/component-info.mjs";
|
|
11
12
|
import r from "../blocks/img/img.mjs";
|
|
12
13
|
import { componentInfo as e } from "../blocks/video/component-info.mjs";
|
|
13
14
|
import f from "../blocks/video/video.mjs";
|
|
14
|
-
const
|
|
15
|
+
const h = () => [{
|
|
15
16
|
component: m,
|
|
16
17
|
...o
|
|
17
18
|
}, {
|
|
@@ -25,5 +26,5 @@ const V = () => [{
|
|
|
25
26
|
...e
|
|
26
27
|
}];
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
h as getExtraComponents
|
|
29
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.22.0";exports.SDK_VERSION=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=(e,o)=>{var c;return l((c=e.data)==null?void 0:c.blocks,o)},l=(e,o)=>{var c,r,i;if(!e)return null;for(const n of e){if(n.id===o)return n;if(n.children){const t=l(n.children,o);if(t)return t}if(((c=n.component)==null?void 0:c.name)==="Columns"&&((i=(r=n.component)==null?void 0:r.options)!=null&&i.columns)){for(const t of n.component.options.columns)if(t.blocks){const f=l(t.blocks,o);if(f)return f}}}return null};exports.findBlockById=s;exports.findBlockInTree=l;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const s = (r, o) => {
|
|
2
|
+
var c;
|
|
3
|
+
return l((c = r.data) == null ? void 0 : c.blocks, o);
|
|
4
|
+
}, l = (r, o) => {
|
|
5
|
+
var c, e, i;
|
|
6
|
+
if (!r)
|
|
7
|
+
return null;
|
|
8
|
+
for (const n of r) {
|
|
9
|
+
if (n.id === o)
|
|
10
|
+
return n;
|
|
11
|
+
if (n.children) {
|
|
12
|
+
const t = l(n.children, o);
|
|
13
|
+
if (t)
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
if (((c = n.component) == null ? void 0 : c.name) === "Columns" && ((i = (e = n.component) == null ? void 0 : e.options) != null && i.columns)) {
|
|
17
|
+
for (const t of n.component.options.columns)
|
|
18
|
+
if (t.blocks) {
|
|
19
|
+
const f = l(t.blocks, o);
|
|
20
|
+
if (f)
|
|
21
|
+
return f;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
s as findBlockById,
|
|
29
|
+
l as findBlockInTree
|
|
30
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../functions/is-browser.cjs"),b=require("../functions/is-from-trusted-host.cjs"),g=require("../scripts/init-editing.cjs"),m=require("./logger.cjs"),c=({model:n,trustedHosts:s,callbacks:r})=>i=>{if(!b.isFromTrustedHost(s,i))return;const{data:t}=i;if(t)switch(t.type){case"builder.configureSdk":{r.configureSdk(t.data);break}case"builder.triggerAnimation":{r.animation(t.data);break}case"builder.resetState":{const e=t.data,a=e.model,o=e==null?void 0:e.state,d=e.editType;a===n&&o&&r.stateUpdate(o,d);break}case"builder.contentUpdate":{const e=t.data,a=e.key||e.alias||e.entry||e.modelName,o=e.data,d=e.editType;a===n&&r.contentUpdate(o,d);break}}},p=({model:n,apiKey:s,callback:r,trustedHosts:i})=>{if(!u.isBrowser)return m.logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};g.setupBrowserForEditing({modelName:n,apiKey:s});const t=c({callbacks:{contentUpdate:r,animation:()=>{},configureSdk:()=>{},stateUpdate:()=>{}},model:n,trustedHosts:i});return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}};exports.createEditorListener=c;exports.subscribeToEditor=p;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { isBrowser as
|
|
2
|
-
import { isFromTrustedHost as
|
|
3
|
-
import { setupBrowserForEditing as
|
|
4
|
-
import { logger as
|
|
1
|
+
import { isBrowser as c } from "../functions/is-browser.mjs";
|
|
2
|
+
import { isFromTrustedHost as m } from "../functions/is-from-trusted-host.mjs";
|
|
3
|
+
import { setupBrowserForEditing as u } from "../scripts/init-editing.mjs";
|
|
4
|
+
import { logger as p } from "./logger.mjs";
|
|
5
5
|
const b = ({
|
|
6
6
|
model: o,
|
|
7
|
-
trustedHosts:
|
|
7
|
+
trustedHosts: s,
|
|
8
8
|
callbacks: r
|
|
9
9
|
}) => (n) => {
|
|
10
|
-
if (!
|
|
10
|
+
if (!m(s, n))
|
|
11
11
|
return;
|
|
12
12
|
const {
|
|
13
13
|
data: t
|
|
@@ -23,28 +23,28 @@ const b = ({
|
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
case "builder.resetState": {
|
|
26
|
-
const e = t.data,
|
|
27
|
-
|
|
26
|
+
const e = t.data, a = e.model, i = e == null ? void 0 : e.state, d = e.editType;
|
|
27
|
+
a === o && i && r.stateUpdate(i, d);
|
|
28
28
|
break;
|
|
29
29
|
}
|
|
30
30
|
case "builder.contentUpdate": {
|
|
31
|
-
const e = t.data,
|
|
32
|
-
|
|
31
|
+
const e = t.data, a = e.key || e.alias || e.entry || e.modelName, i = e.data, d = e.editType;
|
|
32
|
+
a === o && r.contentUpdate(i, d);
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}, k = ({
|
|
37
37
|
model: o,
|
|
38
|
-
apiKey:
|
|
38
|
+
apiKey: s,
|
|
39
39
|
callback: r,
|
|
40
40
|
trustedHosts: n
|
|
41
41
|
}) => {
|
|
42
|
-
if (!
|
|
43
|
-
return
|
|
42
|
+
if (!c)
|
|
43
|
+
return p.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
u({
|
|
46
46
|
modelName: o,
|
|
47
|
-
apiKey:
|
|
47
|
+
apiKey: s
|
|
48
48
|
});
|
|
49
49
|
const t = b({
|
|
50
50
|
callbacks: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-nextjs",
|
|
3
3
|
"description": "Builder.io RSC SDK for NextJS App Directory",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.22.0",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
2
|
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
3
|
-
interface SymbolInfo {
|
|
3
|
+
export interface SymbolInfo {
|
|
4
4
|
model?: string;
|
|
5
5
|
entry?: string;
|
|
6
6
|
data?: any;
|
|
@@ -16,4 +16,3 @@ export interface SymbolProps extends BuilderComponentsProp, BuilderDataProps, Bu
|
|
|
16
16
|
inheritState?: boolean;
|
|
17
17
|
renderToLiquid?: boolean;
|
|
18
18
|
}
|
|
19
|
-
export {};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
* Placeholder component to be overridden by specific SDKs.
|
|
4
|
-
* Allows to dynamically import components.
|
|
5
|
-
*/
|
|
6
|
-
type AwaiterProps = {
|
|
7
|
-
load: () => Promise<any>;
|
|
8
|
-
props?: any;
|
|
9
|
-
attributes?: any;
|
|
10
|
-
fallback?: any;
|
|
11
|
-
children?: any;
|
|
12
|
-
};
|
|
2
|
+
import type { AwaiterProps } from "./awaiter.types.js";
|
|
13
3
|
declare function Awaiter(props: AwaiterProps): React.JSX.Element;
|
|
14
4
|
export default Awaiter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type LiveEditBlockStylesProps = {
|
|
3
|
+
id?: any;
|
|
4
|
+
contextProvider: BuilderContextInterface;
|
|
5
|
+
};
|
|
6
|
+
import type { BuilderContextInterface } from "../../../server-index.js";
|
|
7
|
+
declare function LiveEditBlockStyles(props: LiveEditBlockStylesProps): React.JSX.Element;
|
|
8
|
+
export default LiveEditBlockStyles;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type StyleWrapperProps = {
|
|
3
|
+
block: BuilderBlock;
|
|
4
|
+
context: BuilderContextInterface;
|
|
5
|
+
id?: string;
|
|
6
|
+
};
|
|
7
|
+
import { BuilderBlock, BuilderContextInterface } from "../../../server-index.js";
|
|
8
|
+
declare function StyleWrapper(props: StyleWrapperProps): React.JSX.Element;
|
|
9
|
+
export default StyleWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.22.0";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BuilderBlock, BuilderContent } from '../server-index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Recursively searches for a block by ID.
|
|
4
|
+
*
|
|
5
|
+
* @param content The Builder content to search through.
|
|
6
|
+
* @param id The ID of the block to search for.
|
|
7
|
+
* @returns The block if found, otherwise null.
|
|
8
|
+
*/
|
|
9
|
+
export declare const findBlockById: (content: BuilderContent, id: string) => BuilderBlock | null;
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to recursively search through block tree.
|
|
12
|
+
*
|
|
13
|
+
* @param blocks The blocks to search through.
|
|
14
|
+
* @param id The ID of the block to search for.
|
|
15
|
+
* @returns The block if found, otherwise null.
|
|
16
|
+
* @private This is an internal implementation detail.
|
|
17
|
+
*/
|
|
18
|
+
export declare const findBlockInTree: (blocks: BuilderBlock[] | undefined, id: string) => BuilderBlock | null;
|
|
@@ -2,10 +2,11 @@ import type { ContentProps } from '../components/content/content.types.js';
|
|
|
2
2
|
import type { BuilderAnimation } from '../types/builder-block.js';
|
|
3
3
|
import type { BuilderContent } from '../types/builder-content.js';
|
|
4
4
|
import type { Dictionary } from '../types/typescript.js';
|
|
5
|
+
export type EditType = 'client' | 'server' | undefined;
|
|
5
6
|
type ContentListener = Required<Pick<ContentProps, 'model' | 'trustedHosts'>> & {
|
|
6
7
|
callbacks: {
|
|
7
|
-
contentUpdate: (updatedContent: BuilderContent) => void;
|
|
8
|
-
stateUpdate: (newState: Dictionary<string
|
|
8
|
+
contentUpdate: (updatedContent: BuilderContent, editType?: EditType) => void;
|
|
9
|
+
stateUpdate: (newState: Dictionary<string>, editType?: EditType) => void;
|
|
9
10
|
animation: (updatedContent: BuilderAnimation) => void;
|
|
10
11
|
configureSdk: (updatedContent: any) => void;
|
|
11
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
2
|
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
3
|
-
interface SymbolInfo {
|
|
3
|
+
export interface SymbolInfo {
|
|
4
4
|
model?: string;
|
|
5
5
|
entry?: string;
|
|
6
6
|
data?: any;
|
|
@@ -16,4 +16,3 @@ export interface SymbolProps extends BuilderComponentsProp, BuilderDataProps, Bu
|
|
|
16
16
|
inheritState?: boolean;
|
|
17
17
|
renderToLiquid?: boolean;
|
|
18
18
|
}
|
|
19
|
-
export {};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
* Placeholder component to be overridden by specific SDKs.
|
|
4
|
-
* Allows to dynamically import components.
|
|
5
|
-
*/
|
|
6
|
-
type AwaiterProps = {
|
|
7
|
-
load: () => Promise<any>;
|
|
8
|
-
props?: any;
|
|
9
|
-
attributes?: any;
|
|
10
|
-
fallback?: any;
|
|
11
|
-
children?: any;
|
|
12
|
-
};
|
|
2
|
+
import type { AwaiterProps } from "./awaiter.types.js";
|
|
13
3
|
declare function Awaiter(props: AwaiterProps): React.JSX.Element;
|
|
14
4
|
export default Awaiter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type LiveEditBlockStylesProps = {
|
|
3
|
+
id?: any;
|
|
4
|
+
contextProvider: BuilderContextInterface;
|
|
5
|
+
};
|
|
6
|
+
import type { BuilderContextInterface } from "../../../server-index.js";
|
|
7
|
+
declare function LiveEditBlockStyles(props: LiveEditBlockStylesProps): React.JSX.Element;
|
|
8
|
+
export default LiveEditBlockStyles;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type StyleWrapperProps = {
|
|
3
|
+
block: BuilderBlock;
|
|
4
|
+
context: BuilderContextInterface;
|
|
5
|
+
id?: string;
|
|
6
|
+
};
|
|
7
|
+
import { BuilderBlock, BuilderContextInterface } from "../../../server-index.js";
|
|
8
|
+
declare function StyleWrapper(props: StyleWrapperProps): React.JSX.Element;
|
|
9
|
+
export default StyleWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.22.0";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BuilderBlock, BuilderContent } from '../server-index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Recursively searches for a block by ID.
|
|
4
|
+
*
|
|
5
|
+
* @param content The Builder content to search through.
|
|
6
|
+
* @param id The ID of the block to search for.
|
|
7
|
+
* @returns The block if found, otherwise null.
|
|
8
|
+
*/
|
|
9
|
+
export declare const findBlockById: (content: BuilderContent, id: string) => BuilderBlock | null;
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to recursively search through block tree.
|
|
12
|
+
*
|
|
13
|
+
* @param blocks The blocks to search through.
|
|
14
|
+
* @param id The ID of the block to search for.
|
|
15
|
+
* @returns The block if found, otherwise null.
|
|
16
|
+
* @private This is an internal implementation detail.
|
|
17
|
+
*/
|
|
18
|
+
export declare const findBlockInTree: (blocks: BuilderBlock[] | undefined, id: string) => BuilderBlock | null;
|
|
@@ -2,10 +2,11 @@ import type { ContentProps } from '../components/content/content.types.js';
|
|
|
2
2
|
import type { BuilderAnimation } from '../types/builder-block.js';
|
|
3
3
|
import type { BuilderContent } from '../types/builder-content.js';
|
|
4
4
|
import type { Dictionary } from '../types/typescript.js';
|
|
5
|
+
export type EditType = 'client' | 'server' | undefined;
|
|
5
6
|
type ContentListener = Required<Pick<ContentProps, 'model' | 'trustedHosts'>> & {
|
|
6
7
|
callbacks: {
|
|
7
|
-
contentUpdate: (updatedContent: BuilderContent) => void;
|
|
8
|
-
stateUpdate: (newState: Dictionary<string
|
|
8
|
+
contentUpdate: (updatedContent: BuilderContent, editType?: EditType) => void;
|
|
9
|
+
stateUpdate: (newState: Dictionary<string>, editType?: EditType) => void;
|
|
9
10
|
animation: (updatedContent: BuilderAnimation) => void;
|
|
10
11
|
configureSdk: (updatedContent: any) => void;
|
|
11
12
|
};
|