@builder.io/sdk-react-nextjs 0.18.10 → 0.18.11

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 (41) hide show
  1. package/lib/browser/blocks/image/image.cjs +4 -4
  2. package/lib/browser/blocks/image/image.mjs +19 -17
  3. package/lib/browser/blocks/text/component-info.cjs +1 -1
  4. package/lib/browser/blocks/text/component-info.mjs +1 -4
  5. package/lib/browser/components/block/block.cjs +1 -1
  6. package/lib/browser/components/block/block.helpers.cjs +2 -2
  7. package/lib/browser/components/block/block.helpers.mjs +19 -18
  8. package/lib/browser/components/block/block.mjs +34 -34
  9. package/lib/browser/components/block/components/interactive-element.cjs +1 -1
  10. package/lib/browser/components/block/components/interactive-element.mjs +10 -7
  11. package/lib/browser/constants/sdk-version.cjs +1 -1
  12. package/lib/browser/constants/sdk-version.mjs +1 -1
  13. package/lib/edge/blocks/image/image.cjs +4 -4
  14. package/lib/edge/blocks/image/image.mjs +19 -17
  15. package/lib/edge/blocks/text/component-info.cjs +1 -1
  16. package/lib/edge/blocks/text/component-info.mjs +1 -4
  17. package/lib/edge/components/block/block.cjs +1 -1
  18. package/lib/edge/components/block/block.helpers.cjs +2 -2
  19. package/lib/edge/components/block/block.helpers.mjs +19 -18
  20. package/lib/edge/components/block/block.mjs +34 -34
  21. package/lib/edge/components/block/components/interactive-element.cjs +1 -1
  22. package/lib/edge/components/block/components/interactive-element.mjs +10 -7
  23. package/lib/edge/constants/sdk-version.cjs +1 -1
  24. package/lib/edge/constants/sdk-version.mjs +1 -1
  25. package/lib/node/blocks/image/image.cjs +4 -4
  26. package/lib/node/blocks/image/image.mjs +19 -17
  27. package/lib/node/blocks/text/component-info.cjs +1 -1
  28. package/lib/node/blocks/text/component-info.mjs +1 -4
  29. package/lib/node/components/block/block.cjs +1 -1
  30. package/lib/node/components/block/block.helpers.cjs +2 -2
  31. package/lib/node/components/block/block.helpers.mjs +19 -18
  32. package/lib/node/components/block/block.mjs +34 -34
  33. package/lib/node/components/block/components/interactive-element.cjs +1 -1
  34. package/lib/node/components/block/components/interactive-element.mjs +10 -7
  35. package/lib/node/constants/sdk-version.cjs +1 -1
  36. package/lib/node/constants/sdk-version.mjs +1 -1
  37. package/package.json +1 -1
  38. package/types/cjs/components/block/block.helpers.d.ts +1 -0
  39. package/types/cjs/constants/sdk-version.d.ts +1 -1
  40. package/types/esm/components/block/block.helpers.d.ts +1 -0
  41. package/types/esm/constants/sdk-version.d.ts +1 -1
@@ -1,18 +1,18 @@
1
1
  import { jsx as l, Fragment as u, jsxs as h } from "react/jsx-runtime";
2
- import { TARGET as v } from "../../constants/target.mjs";
3
- import { getBlockComponentOptions as S } from "../../functions/get-block-component-options.mjs";
4
- import { getProcessedBlock as P } from "../../functions/get-processed-block.mjs";
5
- import { isPreviewing as I } from "../../functions/is-previewing.mjs";
2
+ import { TARGET as S } from "../../constants/target.mjs";
3
+ import { getBlockComponentOptions as P } from "../../functions/get-block-component-options.mjs";
4
+ import { getProcessedBlock as I } from "../../functions/get-processed-block.mjs";
5
+ import { isPreviewing as O } from "../../functions/is-previewing.mjs";
6
6
  import "../../functions/get-fetch.mjs";
7
- import { getRepeatItemData as O, getComponent as w, provideBuilderBlock as W, provideBuilderContext as T, provideLinkComponent as L, provideRegisteredComponents as U } from "./block.helpers.mjs";
8
- import j from "./components/block-styles.mjs";
7
+ import { generateKey as x, getRepeatItemData as w, getComponent as W, provideBuilderBlock as T, provideBuilderContext as L, provideLinkComponent as U, provideRegisteredComponents as j } from "./block.helpers.mjs";
8
+ import y from "./components/block-styles.mjs";
9
9
  import N from "./components/block-wrapper.mjs";
10
- import x from "./components/component-ref/component-ref.mjs";
11
- import b from "./components/repeated-block.mjs";
12
- function y(e) {
10
+ import b from "./components/component-ref/component-ref.mjs";
11
+ import g from "./components/repeated-block.mjs";
12
+ function A(e) {
13
13
  var a, C, p, f;
14
14
  const d = function() {
15
- return O({
15
+ return w({
16
16
  block: e.block,
17
17
  context: e.context
18
18
  });
@@ -21,9 +21,9 @@ function y(e) {
21
21
  update: !1
22
22
  }, n = function() {
23
23
  var i;
24
- if (s.value && !s.update && !I())
24
+ if (s.value && !s.update && !O())
25
25
  return s.value;
26
- const c = (i = e.block.repeat) != null && i.collection ? e.block : P({
26
+ const c = (i = e.block.repeat) != null && i.collection ? e.block : I({
27
27
  block: e.block,
28
28
  localState: e.context.localState,
29
29
  rootState: e.context.rootState,
@@ -32,21 +32,21 @@ function y(e) {
32
32
  });
33
33
  return s.value = c, s.update = !1, c;
34
34
  }, r = function() {
35
- return w({
35
+ return W({
36
36
  block: n(),
37
37
  registeredComponents: e.registeredComponents,
38
38
  model: e.context.model
39
39
  });
40
- }, g = function() {
40
+ }, B = function() {
41
41
  var i;
42
42
  return e.block.tagName === "a" || ((i = n().properties) == null ? void 0 : i.href) || n().href ? e.linkComponent || "a" : e.block.tagName || "div";
43
- }, B = function() {
43
+ }, R = function() {
44
44
  var m, k;
45
45
  if ((m = e.block.repeat) != null && m.collection)
46
46
  return !!((k = d()) != null && k.length);
47
47
  const c = "hide" in n() ? n().hide : !1;
48
48
  return ("show" in n() ? n().show : !0) && !c;
49
- }, R = function() {
49
+ }, v = function() {
50
50
  var i, m;
51
51
  return !((i = r()) != null && i.component) && !d() ? (m = n().children) != null ? m : [] : [];
52
52
  }, o = function() {
@@ -55,11 +55,11 @@ function y(e) {
55
55
  blockChildren: (c = n().children) != null ? c : [],
56
56
  componentRef: (i = r()) == null ? void 0 : i.component,
57
57
  componentOptions: {
58
- ...S(n(), e.context),
59
- ...W(r(), n()),
60
- ...T(r(), e.context),
61
- ...L(r(), e.linkComponent),
62
- ...U(
58
+ ...P(n(), e.context),
59
+ ...T(r(), n()),
60
+ ...L(r(), e.context),
61
+ ...U(r(), e.linkComponent),
62
+ ...j(
63
63
  r(),
64
64
  e.registeredComponents,
65
65
  e.context.model
@@ -70,22 +70,22 @@ function y(e) {
70
70
  registeredComponents: e.registeredComponents,
71
71
  builderBlock: n(),
72
72
  includeBlockProps: ((m = r()) == null ? void 0 : m.noWrap) === !0,
73
- isInteractive: !((k = r()) != null && k.isRSC && v === "rsc")
73
+ isInteractive: !((k = r()) != null && k.isRSC && S === "rsc")
74
74
  };
75
75
  };
76
- return /* @__PURE__ */ l(u, { children: B() ? /* @__PURE__ */ h(u, { children: [
77
- /* @__PURE__ */ l(j, { block: n(), context: e.context }),
76
+ return /* @__PURE__ */ l(u, { children: R() ? /* @__PURE__ */ h(u, { children: [
77
+ /* @__PURE__ */ l(y, { block: n(), context: e.context }),
78
78
  (a = r()) != null && a.noWrap ? d() ? /* @__PURE__ */ l(u, { children: (f = d()) == null ? void 0 : f.map((t, c) => /* @__PURE__ */ l(
79
- b,
79
+ g,
80
80
  {
81
81
  repeatContext: t.context,
82
82
  block: t.block,
83
83
  registeredComponents: e.registeredComponents,
84
84
  linkComponent: e.linkComponent
85
85
  },
86
- c
86
+ x(c)
87
87
  )) }) : /* @__PURE__ */ l(
88
- x,
88
+ b,
89
89
  {
90
90
  componentRef: o().componentRef,
91
91
  componentOptions: o().componentOptions,
@@ -98,23 +98,23 @@ function y(e) {
98
98
  isInteractive: o().isInteractive
99
99
  }
100
100
  ) : /* @__PURE__ */ l(u, { children: d() ? /* @__PURE__ */ l(u, { children: (p = d()) == null ? void 0 : p.map((t, c) => /* @__PURE__ */ l(
101
- b,
101
+ g,
102
102
  {
103
103
  repeatContext: t.context,
104
104
  block: t.block,
105
105
  registeredComponents: e.registeredComponents,
106
106
  linkComponent: e.linkComponent
107
107
  },
108
- c
108
+ x(c)
109
109
  )) }) : /* @__PURE__ */ h(
110
110
  N,
111
111
  {
112
- Wrapper: g(),
112
+ Wrapper: B(),
113
113
  block: n(),
114
114
  context: e.context,
115
115
  children: [
116
116
  /* @__PURE__ */ l(
117
- x,
117
+ b,
118
118
  {
119
119
  componentRef: o().componentRef,
120
120
  componentOptions: o().componentOptions,
@@ -127,8 +127,8 @@ function y(e) {
127
127
  isInteractive: o().isInteractive
128
128
  }
129
129
  ),
130
- (C = R()) == null ? void 0 : C.map((t) => /* @__PURE__ */ l(
131
- y,
130
+ (C = v()) == null ? void 0 : C.map((t) => /* @__PURE__ */ l(
131
+ A,
132
132
  {
133
133
  block: t,
134
134
  registeredComponents: e.registeredComponents,
@@ -143,5 +143,5 @@ function y(e) {
143
143
  ] }) : null });
144
144
  }
145
145
  export {
146
- y as default
146
+ A as default
147
147
  };
@@ -1 +1 @@
1
- "use client";"use strict";const e=require("react/jsx-runtime"),r=require("../../../functions/get-block-actions.cjs"),n=require("../../../functions/get-block-properties.cjs"),o=require("../../awaiter.cjs");function a(t){function c(){return t.includeBlockProps?{...n.getBlockProperties({block:t.block,context:t.context}),...r.getBlockActions({block:t.block,rootState:t.context.rootState,rootSetState:t.context.rootSetState,localState:t.context.localState,context:t.context.context})}:{}}return e.jsx(e.Fragment,{children:t.Wrapper.load?e.jsx(e.Fragment,{children:e.jsx(o,{load:t.Wrapper.load,fallback:t.Wrapper.fallback,props:t.wrapperProps,attributes:c(),children:t.children})}):e.jsx(t.Wrapper,{...t.wrapperProps,attributes:c(),children:t.children})})}module.exports=a;
1
+ "use client";"use strict";const e=require("react/jsx-runtime"),n=require("../../../functions/get-block-actions.cjs"),o=require("../../../functions/get-block-properties.cjs"),a=require("../../awaiter.cjs");function l(t){function r(){return t.includeBlockProps?{...o.getBlockProperties({block:t.block,context:t.context}),...n.getBlockActions({block:t.block,rootState:t.context.rootState,rootSetState:t.context.rootSetState,localState:t.context.localState,context:t.context.context})}:{}}function c(){return t.wrapperProps}return e.jsx(e.Fragment,{children:t.Wrapper.load?e.jsx(e.Fragment,{children:e.jsx(a,{load:t.Wrapper.load,fallback:t.Wrapper.fallback,props:t.wrapperProps,attributes:r(),children:t.children})}):e.jsx(t.Wrapper,{...c(),attributes:r(),children:t.children})})}module.exports=l;
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import { jsx as e, Fragment as c } from "react/jsx-runtime";
3
- import { getBlockActions as o } from "../../../functions/get-block-actions.mjs";
4
- import { getBlockProperties as a } from "../../../functions/get-block-properties.mjs";
3
+ import { getBlockActions as a } from "../../../functions/get-block-actions.mjs";
4
+ import { getBlockProperties as n } from "../../../functions/get-block-properties.mjs";
5
5
  import l from "../../awaiter.mjs";
6
- function u(t) {
6
+ function m(t) {
7
7
  function r() {
8
8
  return t.includeBlockProps ? {
9
- ...a({
9
+ ...n({
10
10
  block: t.block,
11
11
  context: t.context
12
12
  }),
13
- ...o({
13
+ ...a({
14
14
  block: t.block,
15
15
  rootState: t.context.rootState,
16
16
  rootSetState: t.context.rootSetState,
@@ -19,6 +19,9 @@ function u(t) {
19
19
  })
20
20
  } : {};
21
21
  }
22
+ function o() {
23
+ return t.wrapperProps;
24
+ }
22
25
  return /* @__PURE__ */ e(c, { children: t.Wrapper.load ? /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
23
26
  l,
24
27
  {
@@ -28,8 +31,8 @@ function u(t) {
28
31
  attributes: r(),
29
32
  children: t.children
30
33
  }
31
- ) }) : /* @__PURE__ */ e(t.Wrapper, { ...t.wrapperProps, attributes: r(), children: t.children }) });
34
+ ) }) : /* @__PURE__ */ e(t.Wrapper, { ...o(), attributes: r(), children: t.children }) });
32
35
  }
33
36
  export {
34
- u as default
37
+ m as default
35
38
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.18.10";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.18.11";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.18.10";
1
+ const o = "0.18.11";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
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.18.10",
4
+ "version": "0.18.11",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
6
6
  "repository": {
7
7
  "type": "git",
@@ -36,3 +36,4 @@ export declare const provideBuilderContext: (block: RegisteredComponent | null |
36
36
  } | {
37
37
  builderContext?: undefined;
38
38
  };
39
+ export declare const generateKey: (index: number) => string;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.18.10";
1
+ export declare const SDK_VERSION = "0.18.11";
@@ -36,3 +36,4 @@ export declare const provideBuilderContext: (block: RegisteredComponent | null |
36
36
  } | {
37
37
  builderContext?: undefined;
38
38
  };
39
+ export declare const generateKey: (index: number) => string;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.18.10";
1
+ export declare const SDK_VERSION = "0.18.11";