@builder.io/sdk-react-nextjs 0.19.2 → 0.20.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/components/content/components/enable-editor.cjs +1 -1
- package/lib/browser/components/content/components/enable-editor.mjs +198 -176
- package/lib/browser/constants/sdk-version.cjs +1 -1
- package/lib/browser/constants/sdk-version.mjs +1 -1
- package/lib/browser/functions/get-processed-block.cjs +1 -1
- package/lib/browser/functions/get-processed-block.mjs +3 -3
- package/lib/edge/components/content/components/enable-editor.cjs +1 -1
- package/lib/edge/components/content/components/enable-editor.mjs +198 -176
- package/lib/edge/constants/sdk-version.cjs +1 -1
- package/lib/edge/constants/sdk-version.mjs +1 -1
- package/lib/edge/functions/get-processed-block.cjs +1 -1
- package/lib/edge/functions/get-processed-block.mjs +3 -3
- package/lib/node/components/content/components/enable-editor.cjs +1 -1
- package/lib/node/components/content/components/enable-editor.mjs +198 -176
- package/lib/node/constants/sdk-version.cjs +1 -1
- package/lib/node/constants/sdk-version.mjs +1 -1
- package/lib/node/functions/get-processed-block.cjs +1 -1
- package/lib/node/functions/get-processed-block.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
|
@@ -1,282 +1,304 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import
|
|
5
|
-
import { evaluate as
|
|
6
|
-
import { fastClone as
|
|
7
|
-
import { fetchOneEntry as
|
|
8
|
-
import { isBrowser as
|
|
9
|
-
import { isEditing as
|
|
10
|
-
import { isPreviewing as
|
|
11
|
-
import { logFetch as
|
|
12
|
-
import { createRegisterComponentMessage as
|
|
13
|
-
import { _track as
|
|
14
|
-
import { getInteractionPropertiesForEvent as
|
|
15
|
-
import { getDefaultCanTrack as
|
|
16
|
-
import { getCookieSync as
|
|
17
|
-
import { postPreviewContent as
|
|
18
|
-
import { createEditorListener as
|
|
19
|
-
import { setupBrowserForEditing as
|
|
20
|
-
import { triggerAnimation as
|
|
21
|
-
import { needsElementRefDivForEditing as
|
|
22
|
-
import { getWrapperClassName as
|
|
23
|
-
import { useRouter as
|
|
24
|
-
function
|
|
25
|
-
var
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
function
|
|
2
|
+
import { jsx as H } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as K, useState as s, useEffect as l } from "react";
|
|
4
|
+
import A from "../../../context/builder.context.mjs";
|
|
5
|
+
import { evaluate as B } from "../../../functions/evaluate/evaluate.mjs";
|
|
6
|
+
import { fastClone as F } from "../../../functions/fast-clone.mjs";
|
|
7
|
+
import { fetchOneEntry as M } from "../../../functions/get-content/index.mjs";
|
|
8
|
+
import { isBrowser as T } from "../../../functions/is-browser.mjs";
|
|
9
|
+
import { isEditing as b } from "../../../functions/is-editing.mjs";
|
|
10
|
+
import { isPreviewing as J } from "../../../functions/is-previewing.mjs";
|
|
11
|
+
import { logFetch as $ } from "../../../functions/log-fetch.mjs";
|
|
12
|
+
import { createRegisterComponentMessage as z } from "../../../functions/register-component.mjs";
|
|
13
|
+
import { _track as U } from "../../../functions/track/index.mjs";
|
|
14
|
+
import { getInteractionPropertiesForEvent as G } from "../../../functions/track/interaction.mjs";
|
|
15
|
+
import { getDefaultCanTrack as q } from "../../../helpers/canTrack.mjs";
|
|
16
|
+
import { getCookieSync as Q } from "../../../helpers/cookie.mjs";
|
|
17
|
+
import { postPreviewContent as X } from "../../../helpers/preview-lru-cache/set.mjs";
|
|
18
|
+
import { createEditorListener as Y } from "../../../helpers/subscribe-to-editor.mjs";
|
|
19
|
+
import { setupBrowserForEditing as Z } from "../../../scripts/init-editing.mjs";
|
|
20
|
+
import { triggerAnimation as p } from "../../block/animator.mjs";
|
|
21
|
+
import { needsElementRefDivForEditing as D } from "./enable-editor.helpers.mjs";
|
|
22
|
+
import { getWrapperClassName as ee } from "./styles.helpers.mjs";
|
|
23
|
+
import { useRouter as te } from "next/navigation";
|
|
24
|
+
function Le(e) {
|
|
25
|
+
var k, P, L;
|
|
26
|
+
const c = K(null);
|
|
27
|
+
s(() => !1);
|
|
28
|
+
function f(n) {
|
|
29
29
|
var i, o;
|
|
30
|
-
const
|
|
31
|
-
...
|
|
30
|
+
const t = {
|
|
31
|
+
...e.builderContextSignal.rootState,
|
|
32
32
|
...n
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
e.builderContextSignal.rootSetState ? (o = (i = e.builderContextSignal).rootSetState) == null || o.call(i, t) : e.builderContextSignal.rootState = t;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function S(n) {
|
|
37
37
|
var i, o, a, r, d;
|
|
38
|
-
const
|
|
39
|
-
...
|
|
38
|
+
const t = {
|
|
39
|
+
...e.builderContextSignal.content,
|
|
40
40
|
...n,
|
|
41
41
|
data: {
|
|
42
|
-
...(i =
|
|
42
|
+
...(i = e.builderContextSignal.content) == null ? void 0 : i.data,
|
|
43
43
|
...n == null ? void 0 : n.data
|
|
44
44
|
},
|
|
45
45
|
meta: {
|
|
46
|
-
...(o =
|
|
46
|
+
...(o = e.builderContextSignal.content) == null ? void 0 : o.meta,
|
|
47
47
|
...n == null ? void 0 : n.meta,
|
|
48
|
-
breakpoints: ((a = n == null ? void 0 : n.meta) == null ? void 0 : a.breakpoints) || ((d = (r =
|
|
48
|
+
breakpoints: ((a = n == null ? void 0 : n.meta) == null ? void 0 : a.breakpoints) || ((d = (r = e.builderContextSignal.content) == null ? void 0 : r.meta) == null ? void 0 : d.breakpoints)
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
value:
|
|
53
|
-
key:
|
|
51
|
+
X({
|
|
52
|
+
value: t,
|
|
53
|
+
key: t.id,
|
|
54
54
|
url: window.location.pathname
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
57
|
+
function N() {
|
|
58
|
+
return e.showContent ? {} : {
|
|
59
59
|
hidden: !0,
|
|
60
60
|
"aria-hidden": !0
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
const [
|
|
64
|
-
() =>
|
|
63
|
+
const [O, ne] = s(
|
|
64
|
+
() => e.contentWrapper || "div"
|
|
65
65
|
);
|
|
66
|
-
function
|
|
67
|
-
return
|
|
68
|
-
model:
|
|
69
|
-
trustedHosts:
|
|
66
|
+
function x(n) {
|
|
67
|
+
return Y({
|
|
68
|
+
model: e.model,
|
|
69
|
+
trustedHosts: e.trustedHosts,
|
|
70
70
|
callbacks: {
|
|
71
|
-
configureSdk: (
|
|
71
|
+
configureSdk: (t) => {
|
|
72
72
|
var a;
|
|
73
|
-
const { breakpoints: i, contentId: o } =
|
|
74
|
-
!o || o !== ((a =
|
|
73
|
+
const { breakpoints: i, contentId: o } = t;
|
|
74
|
+
!o || o !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id) || i && S({
|
|
75
75
|
meta: {
|
|
76
76
|
breakpoints: i
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
},
|
|
80
|
-
animation: (
|
|
81
|
-
|
|
80
|
+
animation: (t) => {
|
|
81
|
+
p(t);
|
|
82
82
|
},
|
|
83
|
-
contentUpdate: (
|
|
84
|
-
|
|
83
|
+
contentUpdate: (t) => {
|
|
84
|
+
S(t);
|
|
85
85
|
},
|
|
86
|
-
stateUpdate: (
|
|
87
|
-
|
|
86
|
+
stateUpdate: (t) => {
|
|
87
|
+
f(t);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
})(n);
|
|
91
91
|
}
|
|
92
|
-
const [
|
|
93
|
-
function
|
|
94
|
-
var
|
|
95
|
-
if (
|
|
96
|
-
const o = (
|
|
97
|
-
|
|
98
|
-
apiHost:
|
|
92
|
+
const [C, ie] = s(() => ({})), [v, ae] = s(() => ({})), [y, V] = s(() => !1);
|
|
93
|
+
function j(n) {
|
|
94
|
+
var t, i;
|
|
95
|
+
if (e.builderContextSignal.content) {
|
|
96
|
+
const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, a = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
|
|
97
|
+
U({
|
|
98
|
+
apiHost: e.apiHost,
|
|
99
99
|
type: "click",
|
|
100
|
-
canTrack:
|
|
100
|
+
canTrack: q(e.canTrack),
|
|
101
101
|
contentId: a,
|
|
102
|
-
apiKey:
|
|
102
|
+
apiKey: e.apiKey,
|
|
103
103
|
variationId: o !== a ? o : void 0,
|
|
104
|
-
|
|
105
|
-
unique: !
|
|
104
|
+
...G(n),
|
|
105
|
+
unique: !y
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
y || V(!0);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
var
|
|
112
|
-
const n = (o = (i = (
|
|
113
|
-
Object.entries(n).forEach(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
110
|
+
function _() {
|
|
111
|
+
var t, i, o;
|
|
112
|
+
const n = (o = (i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.httpRequests) != null ? o : {};
|
|
113
|
+
Object.entries(n).forEach(
|
|
114
|
+
([a, r]) => {
|
|
115
|
+
if (!r)
|
|
116
|
+
return;
|
|
117
|
+
const d = typeof r == "object" && r["@type"] === "@builder.io/core:Request";
|
|
118
|
+
if (v[a] || C[a] && !b())
|
|
119
|
+
return;
|
|
120
|
+
const h = d ? r.request.url : r;
|
|
121
|
+
v[a] = !0;
|
|
122
|
+
const R = h.replace(
|
|
123
|
+
/{{([^}]+)}}/g,
|
|
124
|
+
(u, W) => String(
|
|
125
|
+
B({
|
|
126
|
+
code: W,
|
|
127
|
+
context: e.context || {},
|
|
128
|
+
localState: void 0,
|
|
129
|
+
rootState: e.builderContextSignal.rootState,
|
|
130
|
+
rootSetState: e.builderContextSignal.rootSetState
|
|
131
|
+
})
|
|
132
|
+
)
|
|
133
|
+
), m = d ? {
|
|
134
|
+
url: R,
|
|
135
|
+
method: r.request.method,
|
|
136
|
+
headers: r.request.headers,
|
|
137
|
+
body: r.request.body
|
|
138
|
+
} : {
|
|
139
|
+
url: R,
|
|
140
|
+
method: "GET"
|
|
141
|
+
};
|
|
142
|
+
$(JSON.stringify(m)), fetch(m.url, {
|
|
143
|
+
method: m.method,
|
|
144
|
+
headers: m.headers,
|
|
145
|
+
body: m.body
|
|
146
|
+
}).then((u) => u.json()).then((u) => {
|
|
147
|
+
f({
|
|
148
|
+
[a]: u
|
|
149
|
+
}), C[a] = !0;
|
|
150
|
+
}).catch((u) => {
|
|
151
|
+
console.error(
|
|
152
|
+
"error fetching dynamic data",
|
|
153
|
+
JSON.stringify(r),
|
|
154
|
+
u
|
|
155
|
+
);
|
|
156
|
+
}).finally(() => {
|
|
157
|
+
v[a] = !1;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
);
|
|
139
161
|
}
|
|
140
|
-
function
|
|
141
|
-
|
|
162
|
+
function g() {
|
|
163
|
+
b() && window.dispatchEvent(
|
|
142
164
|
new CustomEvent(
|
|
143
165
|
"builder:component:stateChange",
|
|
144
166
|
{
|
|
145
167
|
detail: {
|
|
146
|
-
state:
|
|
168
|
+
state: F(e.builderContextSignal.rootState),
|
|
147
169
|
ref: {
|
|
148
|
-
name:
|
|
170
|
+
name: e.model
|
|
149
171
|
}
|
|
150
172
|
}
|
|
151
173
|
}
|
|
152
174
|
)
|
|
153
175
|
);
|
|
154
176
|
}
|
|
155
|
-
function
|
|
156
|
-
var
|
|
157
|
-
window.addEventListener("message",
|
|
158
|
-
...
|
|
159
|
-
locale:
|
|
177
|
+
function E(n) {
|
|
178
|
+
var t;
|
|
179
|
+
window.addEventListener("message", x), Z({
|
|
180
|
+
...e.locale ? {
|
|
181
|
+
locale: e.locale
|
|
160
182
|
} : {},
|
|
161
|
-
...
|
|
162
|
-
enrich:
|
|
183
|
+
...e.enrich ? {
|
|
184
|
+
enrich: e.enrich
|
|
163
185
|
} : {},
|
|
164
|
-
...
|
|
165
|
-
trustedHosts:
|
|
186
|
+
...e.trustedHosts ? {
|
|
187
|
+
trustedHosts: e.trustedHosts
|
|
166
188
|
} : {},
|
|
167
|
-
modelName: (
|
|
168
|
-
apiKey:
|
|
189
|
+
modelName: (t = e.model) != null ? t : "",
|
|
190
|
+
apiKey: e.apiKey
|
|
169
191
|
}), Object.values(
|
|
170
|
-
|
|
192
|
+
e.builderContextSignal.componentInfos
|
|
171
193
|
).forEach((i) => {
|
|
172
194
|
var o, a;
|
|
173
|
-
if (!((o = i.models) != null && o.length) || i.models.includes(
|
|
174
|
-
const r =
|
|
195
|
+
if (!((o = i.models) != null && o.length) || i.models.includes(e.model)) {
|
|
196
|
+
const r = z(i);
|
|
175
197
|
(a = window.parent) == null || a.postMessage(r, "*");
|
|
176
198
|
}
|
|
177
199
|
}), window.addEventListener(
|
|
178
200
|
"builder:component:stateChangeListenerActivated",
|
|
179
|
-
|
|
201
|
+
g
|
|
180
202
|
);
|
|
181
203
|
}
|
|
182
|
-
function
|
|
204
|
+
function I(n) {
|
|
183
205
|
var r;
|
|
184
|
-
const
|
|
206
|
+
const t = new URL(location.href).searchParams, i = t.get("builder.preview"), o = t.get(
|
|
185
207
|
`builder.overrides.${i}`
|
|
186
|
-
), a =
|
|
187
|
-
(i === "BUILDER_STUDIO" || i ===
|
|
188
|
-
model:
|
|
189
|
-
apiKey:
|
|
190
|
-
apiVersion:
|
|
191
|
-
...i === "BUILDER_STUDIO" && ((r =
|
|
208
|
+
), a = t.get("apiKey") || t.get("builder.space");
|
|
209
|
+
(i === "BUILDER_STUDIO" || i === e.model && a === e.apiKey && (!e.content || o === e.content.id)) && M({
|
|
210
|
+
model: e.model,
|
|
211
|
+
apiKey: e.apiKey,
|
|
212
|
+
apiVersion: e.builderContextSignal.apiVersion,
|
|
213
|
+
...i === "BUILDER_STUDIO" && ((r = e.context) != null && r.symbolId) ? {
|
|
192
214
|
query: {
|
|
193
|
-
id:
|
|
215
|
+
id: e.context.symbolId
|
|
194
216
|
}
|
|
195
217
|
} : {}
|
|
196
218
|
}).then((d) => {
|
|
197
|
-
d &&
|
|
219
|
+
d && S(d);
|
|
198
220
|
});
|
|
199
221
|
}
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
return
|
|
222
|
+
te();
|
|
223
|
+
const w = K(!1);
|
|
224
|
+
return w.current || (_(), g(), w.current = !0), l(() => {
|
|
203
225
|
var n;
|
|
204
|
-
return (n =
|
|
226
|
+
return (n = c.current) == null || n.addEventListener(
|
|
205
227
|
"initeditingbldr",
|
|
206
|
-
|
|
228
|
+
E
|
|
207
229
|
), () => {
|
|
208
|
-
var
|
|
209
|
-
return (
|
|
230
|
+
var t;
|
|
231
|
+
return (t = c.current) == null ? void 0 : t.removeEventListener(
|
|
210
232
|
"initeditingbldr",
|
|
211
|
-
|
|
233
|
+
E
|
|
212
234
|
);
|
|
213
235
|
};
|
|
214
|
-
}, []),
|
|
236
|
+
}, []), l(() => {
|
|
215
237
|
var n;
|
|
216
|
-
return (n =
|
|
238
|
+
return (n = c.current) == null || n.addEventListener(
|
|
217
239
|
"initpreviewingbldr",
|
|
218
|
-
|
|
240
|
+
I
|
|
219
241
|
), () => {
|
|
220
|
-
var
|
|
221
|
-
return (
|
|
242
|
+
var t;
|
|
243
|
+
return (t = c.current) == null ? void 0 : t.removeEventListener(
|
|
222
244
|
"initpreviewingbldr",
|
|
223
|
-
|
|
245
|
+
I
|
|
224
246
|
);
|
|
225
247
|
};
|
|
226
|
-
}, []),
|
|
227
|
-
var n,
|
|
228
|
-
if (
|
|
229
|
-
|
|
230
|
-
const o =
|
|
231
|
-
name: `builder.tests.${(n =
|
|
248
|
+
}, []), l(() => {
|
|
249
|
+
var n, t, i;
|
|
250
|
+
if (T()) {
|
|
251
|
+
b() && !e.isNestedRender && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
252
|
+
const o = e.builderContextSignal.content && q(e.canTrack), a = Q({
|
|
253
|
+
name: `builder.tests.${(n = e.builderContextSignal.content) == null ? void 0 : n.id}`,
|
|
232
254
|
canTrack: !0
|
|
233
|
-
}), r = (
|
|
255
|
+
}), r = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId;
|
|
234
256
|
if (o && r === a) {
|
|
235
|
-
const d = (i =
|
|
236
|
-
|
|
237
|
-
apiHost:
|
|
257
|
+
const d = (i = e.builderContextSignal.content) == null ? void 0 : i.id, h = e.apiKey;
|
|
258
|
+
U({
|
|
259
|
+
apiHost: e.apiHost,
|
|
238
260
|
type: "impression",
|
|
239
261
|
canTrack: !0,
|
|
240
262
|
contentId: d,
|
|
241
|
-
apiKey:
|
|
263
|
+
apiKey: h,
|
|
242
264
|
variationId: a !== d ? a : void 0
|
|
243
265
|
});
|
|
244
266
|
}
|
|
245
|
-
|
|
267
|
+
J() && b();
|
|
246
268
|
}
|
|
247
|
-
}, []),
|
|
248
|
-
}, [
|
|
249
|
-
|
|
250
|
-
}, [
|
|
251
|
-
|
|
252
|
-
}, [
|
|
253
|
-
|
|
254
|
-
locale:
|
|
269
|
+
}, []), l(() => {
|
|
270
|
+
}, [e.content]), l(() => {
|
|
271
|
+
g();
|
|
272
|
+
}, [e.builderContextSignal.rootState]), l(() => {
|
|
273
|
+
e.data && f(e.data);
|
|
274
|
+
}, [e.data]), l(() => {
|
|
275
|
+
e.locale && f({
|
|
276
|
+
locale: e.locale
|
|
255
277
|
});
|
|
256
|
-
}, [
|
|
257
|
-
|
|
278
|
+
}, [e.locale]), l(() => () => {
|
|
279
|
+
T() && (window.removeEventListener("message", x), window.removeEventListener(
|
|
258
280
|
"builder:component:stateChangeListenerActivated",
|
|
259
|
-
|
|
281
|
+
g
|
|
260
282
|
));
|
|
261
|
-
}, []), /* @__PURE__ */
|
|
262
|
-
|
|
283
|
+
}, []), /* @__PURE__ */ H(A.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content || D() ? /* @__PURE__ */ H(
|
|
284
|
+
O,
|
|
263
285
|
{
|
|
264
|
-
ref:
|
|
265
|
-
onClick: (n) =>
|
|
266
|
-
"builder-content-id": (
|
|
267
|
-
"builder-model":
|
|
268
|
-
className:
|
|
269
|
-
((
|
|
286
|
+
ref: c,
|
|
287
|
+
onClick: (n) => j(n),
|
|
288
|
+
"builder-content-id": (k = e.builderContextSignal.content) == null ? void 0 : k.id,
|
|
289
|
+
"builder-model": e.model,
|
|
290
|
+
className: ee(
|
|
291
|
+
((P = e.content) == null ? void 0 : P.testVariationId) || ((L = e.content) == null ? void 0 : L.id)
|
|
270
292
|
),
|
|
271
293
|
style: {
|
|
272
|
-
display: !
|
|
294
|
+
display: !e.builderContextSignal.content && D() ? "none" : void 0
|
|
273
295
|
},
|
|
274
|
-
...
|
|
275
|
-
...
|
|
276
|
-
children:
|
|
296
|
+
...N(),
|
|
297
|
+
...e.contentWrapperProps,
|
|
298
|
+
children: e.children
|
|
277
299
|
}
|
|
278
300
|
) : null });
|
|
279
301
|
}
|
|
280
302
|
export {
|
|
281
|
-
|
|
303
|
+
Le as default
|
|
282
304
|
};
|
|
@@ -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.20.0";exports.SDK_VERSION=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../constants/target.cjs"),d=require("../helpers/omit.cjs"),p=require("./evaluate/evaluate.cjs"),f=require("./extract-localized-values.cjs"),g=require("./fast-clone.cjs"),m=require("./set.cjs"),y=require("./transform-block.cjs");function o(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>o(n));if(e["@type"]==="@builder.io/sdk:Element")return e;const t={};for(const n in e)n!=="meta"&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=o(e[n]));return t}const C=["svelte","vue","angular","qwik","solid"].includes(u.TARGET),q=e=>{if(C){const t=g.fastClone(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=o(d.omit(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},v=({block:e,context:t,localState:n,rootState:i,rootSetState:s})=>{if(!e.bindings)return e;const r=q(e);for(const c in e.bindings){const a=e.bindings[c],l=p.evaluate({code:a,localState:n,rootState:i,rootSetState:s,context:t});m.set(r,c,l)}return r};function B({block:e,context:t,localState:n,rootState:i,rootSetState:s}){let r=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../constants/target.cjs"),d=require("../helpers/omit.cjs"),p=require("./evaluate/evaluate.cjs"),f=require("./extract-localized-values.cjs"),g=require("./fast-clone.cjs"),m=require("./set.cjs"),y=require("./transform-block.cjs");function o(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>o(n));if(e["@type"]==="@builder.io/sdk:Element")return e;const t={};for(const n in e)n!=="meta"&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=o(e[n]));return t}const C=["svelte","vue","angular","qwik","solid"].includes(u.TARGET),q=e=>{if(C){const t=g.fastClone(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=o(d.omit(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},v=({block:e,context:t,localState:n,rootState:i,rootSetState:s})=>{if(!e.bindings)return e;const r=q(e);for(const c in e.bindings){const a=e.bindings[c],l=p.evaluate({code:a,localState:n,rootState:i,rootSetState:s,context:t});m.set(r,c,l)}return r};function B({block:e,context:t,localState:n,rootState:i,rootSetState:s}){let r=y.transformBlock(e);return r=v({block:r,localState:n,rootState:i,rootSetState:s,context:t}),r=f.resolveLocalizedValues(r,i.locale),r}exports.deepCloneWithConditions=o;exports.getProcessedBlock=B;
|
|
@@ -72,14 +72,14 @@ function P({
|
|
|
72
72
|
rootState: i,
|
|
73
73
|
rootSetState: o
|
|
74
74
|
}) {
|
|
75
|
-
let n =
|
|
76
|
-
return n =
|
|
75
|
+
let n = g(e);
|
|
76
|
+
return n = O({
|
|
77
77
|
block: n,
|
|
78
78
|
localState: t,
|
|
79
79
|
rootState: i,
|
|
80
80
|
rootSetState: o,
|
|
81
81
|
context: r
|
|
82
|
-
});
|
|
82
|
+
}), n = f(n, i.locale), n;
|
|
83
83
|
}
|
|
84
84
|
export {
|
|
85
85
|
s as deepCloneWithConditions,
|
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.20.0",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.20.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.20.0";
|