@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.
Files changed (115) hide show
  1. package/lib/browser/blocks/symbol/symbol.cjs +1 -1
  2. package/lib/browser/blocks/symbol/symbol.mjs +27 -25
  3. package/lib/browser/blocks/text/component-info.cjs +1 -1
  4. package/lib/browser/blocks/text/component-info.mjs +0 -1
  5. package/lib/browser/blocks/text/text.cjs +1 -1
  6. package/lib/browser/blocks/text/text.mjs +3 -2
  7. package/lib/browser/components/block/block.cjs +1 -1
  8. package/lib/browser/components/block/block.mjs +27 -20
  9. package/lib/browser/components/block/components/component-ref/component-ref.cjs +1 -1
  10. package/lib/browser/components/block/components/component-ref/component-ref.mjs +11 -11
  11. package/lib/browser/components/block/components/interactive-element.cjs +1 -1
  12. package/lib/browser/components/block/components/interactive-element.mjs +27 -15
  13. package/lib/browser/components/block/components/live-edit-block-styles.cjs +1 -0
  14. package/lib/browser/components/block/components/live-edit-block-styles.mjs +94 -0
  15. package/lib/browser/components/block/components/style-wrapper.cjs +1 -0
  16. package/lib/browser/components/block/components/style-wrapper.mjs +24 -0
  17. package/lib/browser/components/blocks/blocks-wrapper.cjs +1 -1
  18. package/lib/browser/components/blocks/blocks-wrapper.mjs +2 -2
  19. package/lib/browser/components/content/components/enable-editor.cjs +1 -1
  20. package/lib/browser/components/content/components/enable-editor.mjs +195 -166
  21. package/lib/browser/components/live-edit.cjs +1 -0
  22. package/lib/browser/components/live-edit.mjs +19 -0
  23. package/lib/browser/constants/builder-registered-components.cjs +1 -1
  24. package/lib/browser/constants/builder-registered-components.mjs +3 -2
  25. package/lib/browser/constants/extra-components.cjs +1 -1
  26. package/lib/browser/constants/extra-components.mjs +3 -2
  27. package/lib/browser/constants/sdk-version.cjs +1 -1
  28. package/lib/browser/constants/sdk-version.mjs +1 -1
  29. package/lib/browser/helpers/find-block.cjs +1 -0
  30. package/lib/browser/helpers/find-block.mjs +30 -0
  31. package/lib/browser/helpers/subscribe-to-editor.cjs +1 -1
  32. package/lib/browser/helpers/subscribe-to-editor.mjs +15 -15
  33. package/lib/edge/blocks/symbol/symbol.cjs +1 -1
  34. package/lib/edge/blocks/symbol/symbol.mjs +27 -25
  35. package/lib/edge/blocks/text/component-info.cjs +1 -1
  36. package/lib/edge/blocks/text/component-info.mjs +0 -1
  37. package/lib/edge/blocks/text/text.cjs +1 -1
  38. package/lib/edge/blocks/text/text.mjs +3 -2
  39. package/lib/edge/components/block/block.cjs +1 -1
  40. package/lib/edge/components/block/block.mjs +27 -20
  41. package/lib/edge/components/block/components/component-ref/component-ref.cjs +1 -1
  42. package/lib/edge/components/block/components/component-ref/component-ref.mjs +11 -11
  43. package/lib/edge/components/block/components/interactive-element.cjs +1 -1
  44. package/lib/edge/components/block/components/interactive-element.mjs +27 -15
  45. package/lib/edge/components/block/components/live-edit-block-styles.cjs +1 -0
  46. package/lib/edge/components/block/components/live-edit-block-styles.mjs +94 -0
  47. package/lib/edge/components/block/components/style-wrapper.cjs +1 -0
  48. package/lib/edge/components/block/components/style-wrapper.mjs +24 -0
  49. package/lib/edge/components/blocks/blocks-wrapper.cjs +1 -1
  50. package/lib/edge/components/blocks/blocks-wrapper.mjs +2 -2
  51. package/lib/edge/components/content/components/enable-editor.cjs +1 -1
  52. package/lib/edge/components/content/components/enable-editor.mjs +195 -166
  53. package/lib/edge/components/live-edit.cjs +1 -0
  54. package/lib/edge/components/live-edit.mjs +19 -0
  55. package/lib/edge/constants/builder-registered-components.cjs +1 -1
  56. package/lib/edge/constants/builder-registered-components.mjs +3 -2
  57. package/lib/edge/constants/extra-components.cjs +1 -1
  58. package/lib/edge/constants/extra-components.mjs +3 -2
  59. package/lib/edge/constants/sdk-version.cjs +1 -1
  60. package/lib/edge/constants/sdk-version.mjs +1 -1
  61. package/lib/edge/helpers/find-block.cjs +1 -0
  62. package/lib/edge/helpers/find-block.mjs +30 -0
  63. package/lib/edge/helpers/subscribe-to-editor.cjs +1 -1
  64. package/lib/edge/helpers/subscribe-to-editor.mjs +15 -15
  65. package/lib/node/blocks/symbol/symbol.cjs +1 -1
  66. package/lib/node/blocks/symbol/symbol.mjs +27 -25
  67. package/lib/node/blocks/text/component-info.cjs +1 -1
  68. package/lib/node/blocks/text/component-info.mjs +0 -1
  69. package/lib/node/blocks/text/text.cjs +1 -1
  70. package/lib/node/blocks/text/text.mjs +3 -2
  71. package/lib/node/components/block/block.cjs +1 -1
  72. package/lib/node/components/block/block.mjs +27 -20
  73. package/lib/node/components/block/components/component-ref/component-ref.cjs +1 -1
  74. package/lib/node/components/block/components/component-ref/component-ref.mjs +11 -11
  75. package/lib/node/components/block/components/interactive-element.cjs +1 -1
  76. package/lib/node/components/block/components/interactive-element.mjs +27 -15
  77. package/lib/node/components/block/components/live-edit-block-styles.cjs +1 -0
  78. package/lib/node/components/block/components/live-edit-block-styles.mjs +94 -0
  79. package/lib/node/components/block/components/style-wrapper.cjs +1 -0
  80. package/lib/node/components/block/components/style-wrapper.mjs +24 -0
  81. package/lib/node/components/blocks/blocks-wrapper.cjs +1 -1
  82. package/lib/node/components/blocks/blocks-wrapper.mjs +2 -2
  83. package/lib/node/components/content/components/enable-editor.cjs +1 -1
  84. package/lib/node/components/content/components/enable-editor.mjs +195 -166
  85. package/lib/node/components/live-edit.cjs +1 -0
  86. package/lib/node/components/live-edit.mjs +19 -0
  87. package/lib/node/constants/builder-registered-components.cjs +1 -1
  88. package/lib/node/constants/builder-registered-components.mjs +3 -2
  89. package/lib/node/constants/extra-components.cjs +1 -1
  90. package/lib/node/constants/extra-components.mjs +3 -2
  91. package/lib/node/constants/sdk-version.cjs +1 -1
  92. package/lib/node/constants/sdk-version.mjs +1 -1
  93. package/lib/node/helpers/find-block.cjs +1 -0
  94. package/lib/node/helpers/find-block.mjs +30 -0
  95. package/lib/node/helpers/subscribe-to-editor.cjs +1 -1
  96. package/lib/node/helpers/subscribe-to-editor.mjs +15 -15
  97. package/package.json +1 -1
  98. package/types/cjs/blocks/symbol/symbol.types.d.ts +1 -2
  99. package/types/cjs/components/awaiter.d.ts +1 -11
  100. package/types/cjs/components/awaiter.types.d.ts +7 -0
  101. package/types/cjs/components/block/components/live-edit-block-styles.d.ts +8 -0
  102. package/types/cjs/components/block/components/style-wrapper.d.ts +9 -0
  103. package/types/cjs/components/live-edit.d.ts +9 -0
  104. package/types/cjs/constants/sdk-version.d.ts +1 -1
  105. package/types/cjs/helpers/find-block.d.ts +18 -0
  106. package/types/cjs/helpers/subscribe-to-editor.d.ts +3 -2
  107. package/types/esm/blocks/symbol/symbol.types.d.ts +1 -2
  108. package/types/esm/components/awaiter.d.ts +1 -11
  109. package/types/esm/components/awaiter.types.d.ts +7 -0
  110. package/types/esm/components/block/components/live-edit-block-styles.d.ts +8 -0
  111. package/types/esm/components/block/components/style-wrapper.d.ts +9 -0
  112. package/types/esm/components/live-edit.d.ts +9 -0
  113. package/types/esm/constants/sdk-version.d.ts +1 -1
  114. package/types/esm/helpers/find-block.d.ts +18 -0
  115. 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"),t=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");const r=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:t,...n.componentInfo},{component:c,...r.componentInfo},{component:m,...i.componentInfo}];exports.getExtraComponents=u;
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 V = () => [{
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
- V as getExtraComponents
29
+ h as getExtraComponents
29
30
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.20.1";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.22.0";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.20.1";
1
+ const o = "0.22.0";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -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 c=require("../functions/is-browser.cjs"),u=require("../functions/is-from-trusted-host.cjs"),b=require("../scripts/init-editing.cjs"),g=require("./logger.cjs"),d=({model:n,trustedHosts:i,callbacks:r})=>o=>{if(!u.isFromTrustedHost(i,o))return;const{data:t}=o;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,s=e==null?void 0:e.state;a===n&&s&&r.stateUpdate(s);break}case"builder.contentUpdate":{const e=t.data,a=e.key||e.alias||e.entry||e.modelName,s=e.data;a===n&&r.contentUpdate(s);break}}},m=({model:n,apiKey:i,callback:r,trustedHosts:o})=>{if(!c.isBrowser)return g.logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};b.setupBrowserForEditing({modelName:n,apiKey:i});const t=d({callbacks:{contentUpdate:r,animation:()=>{},configureSdk:()=>{},stateUpdate:()=>{}},model:n,trustedHosts:o});return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}};exports.createEditorListener=d;exports.subscribeToEditor=m;
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 d } from "../functions/is-browser.mjs";
2
- import { isFromTrustedHost as c } from "../functions/is-from-trusted-host.mjs";
3
- import { setupBrowserForEditing as m } from "../scripts/init-editing.mjs";
4
- import { logger as u } from "./logger.mjs";
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: i,
7
+ trustedHosts: s,
8
8
  callbacks: r
9
9
  }) => (n) => {
10
- if (!c(i, n))
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, s = e.model, a = e == null ? void 0 : e.state;
27
- s === o && a && r.stateUpdate(a);
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, s = e.key || e.alias || e.entry || e.modelName, a = e.data;
32
- s === o && r.contentUpdate(a);
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: i,
38
+ apiKey: s,
39
39
  callback: r,
40
40
  trustedHosts: n
41
41
  }) => {
42
- if (!d)
43
- return u.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
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
- m({
45
+ u({
46
46
  modelName: o,
47
- apiKey: i
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.20.1",
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,7 @@
1
+ export type AwaiterProps = {
2
+ load: () => Promise<any>;
3
+ props?: any;
4
+ attributes?: any;
5
+ fallback?: any;
6
+ children?: any;
7
+ };
@@ -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;
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ type LiveEditProps = {
3
+ children?: any;
4
+ id?: any;
5
+ Wrapper?: any;
6
+ attributes?: any;
7
+ };
8
+ declare function LiveEdit(props: LiveEditProps): React.JSX.Element;
9
+ export default LiveEdit;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.20.1";
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>) => void;
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,7 @@
1
+ export type AwaiterProps = {
2
+ load: () => Promise<any>;
3
+ props?: any;
4
+ attributes?: any;
5
+ fallback?: any;
6
+ children?: any;
7
+ };
@@ -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;
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ type LiveEditProps = {
3
+ children?: any;
4
+ id?: any;
5
+ Wrapper?: any;
6
+ attributes?: any;
7
+ };
8
+ declare function LiveEdit(props: LiveEditProps): React.JSX.Element;
9
+ export default LiveEdit;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.20.1";
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>) => void;
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
  };