@builder.io/sdk-react-nextjs 0.20.0 → 0.21.1
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/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/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 +81 -70
- package/lib/browser/constants/sdk-version.cjs +1 -1
- package/lib/browser/constants/sdk-version.mjs +1 -1
- package/lib/browser/functions/register.cjs +1 -1
- package/lib/browser/functions/register.mjs +24 -13
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +26 -25
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +18 -17
- package/lib/edge/blocks/symbol/symbol.cjs +1 -1
- package/lib/edge/blocks/symbol/symbol.mjs +27 -25
- 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/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 +81 -70
- package/lib/edge/constants/sdk-version.cjs +1 -1
- package/lib/edge/constants/sdk-version.mjs +1 -1
- package/lib/edge/functions/register.cjs +1 -1
- package/lib/edge/functions/register.mjs +24 -13
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +26 -25
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +18 -17
- package/lib/node/blocks/symbol/symbol.cjs +1 -1
- package/lib/node/blocks/symbol/symbol.mjs +27 -25
- 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/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 +81 -70
- package/lib/node/constants/sdk-version.cjs +1 -1
- package/lib/node/constants/sdk-version.mjs +1 -1
- package/lib/node/functions/register.cjs +1 -1
- package/lib/node/functions/register.mjs +24 -13
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +26 -25
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +18 -17
- 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/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/register.d.ts +18 -0
- package/types/cjs/server-index.d.ts +1 -1
- 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/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/register.d.ts +18 -0
- package/types/esm/server-index.d.ts +1 -1
|
@@ -1,30 +1,31 @@
|
|
|
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
|
|
2
|
+
import { jsx as K } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as T, useState as u, useEffect as l } from "react";
|
|
4
|
+
import J from "../../../context/builder.context.mjs";
|
|
5
|
+
import { evaluate as $ } from "../../../functions/evaluate/evaluate.mjs";
|
|
6
|
+
import { fastClone as z } from "../../../functions/fast-clone.mjs";
|
|
7
|
+
import { fetchOneEntry as Q } from "../../../functions/get-content/index.mjs";
|
|
8
|
+
import { isBrowser as D } from "../../../functions/is-browser.mjs";
|
|
9
9
|
import { isEditing as b } from "../../../functions/is-editing.mjs";
|
|
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 c =
|
|
27
|
-
|
|
10
|
+
import { isPreviewing as X } from "../../../functions/is-previewing.mjs";
|
|
11
|
+
import { logFetch as Y } from "../../../functions/log-fetch.mjs";
|
|
12
|
+
import { createRegisterComponentMessage as Z } from "../../../functions/register-component.mjs";
|
|
13
|
+
import { _track as O } from "../../../functions/track/index.mjs";
|
|
14
|
+
import { getInteractionPropertiesForEvent as p } from "../../../functions/track/interaction.mjs";
|
|
15
|
+
import { getDefaultCanTrack as U } from "../../../helpers/canTrack.mjs";
|
|
16
|
+
import { getCookieSync as ee } from "../../../helpers/cookie.mjs";
|
|
17
|
+
import { postPreviewContent as te } from "../../../helpers/preview-lru-cache/set.mjs";
|
|
18
|
+
import { createEditorListener as ne } from "../../../helpers/subscribe-to-editor.mjs";
|
|
19
|
+
import { setupBrowserForEditing as ie } from "../../../scripts/init-editing.mjs";
|
|
20
|
+
import { triggerAnimation as ae } from "../../block/animator.mjs";
|
|
21
|
+
import { needsElementRefDivForEditing as q } from "./enable-editor.helpers.mjs";
|
|
22
|
+
import { getWrapperClassName as oe } from "./styles.helpers.mjs";
|
|
23
|
+
import { useRouter as re } from "next/navigation";
|
|
24
|
+
function De(e) {
|
|
25
|
+
var P, k, L;
|
|
26
|
+
const c = T(null);
|
|
27
|
+
u(() => !1);
|
|
28
|
+
const [N, V] = u(() => null), [j, _] = u(() => "");
|
|
28
29
|
function f(n) {
|
|
29
30
|
var i, o;
|
|
30
31
|
const t = {
|
|
@@ -48,23 +49,23 @@ function Le(e) {
|
|
|
48
49
|
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
50
|
}
|
|
50
51
|
};
|
|
51
|
-
|
|
52
|
+
te({
|
|
52
53
|
value: t,
|
|
53
54
|
key: t.id,
|
|
54
55
|
url: window.location.pathname
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
+
function W() {
|
|
58
59
|
return e.showContent ? {} : {
|
|
59
60
|
hidden: !0,
|
|
60
61
|
"aria-hidden": !0
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
|
-
const [
|
|
64
|
+
const [A, de] = u(
|
|
64
65
|
() => e.contentWrapper || "div"
|
|
65
66
|
);
|
|
66
67
|
function x(n) {
|
|
67
|
-
return
|
|
68
|
+
return ne({
|
|
68
69
|
model: e.model,
|
|
69
70
|
trustedHosts: e.trustedHosts,
|
|
70
71
|
callbacks: {
|
|
@@ -78,7 +79,7 @@ function Le(e) {
|
|
|
78
79
|
});
|
|
79
80
|
},
|
|
80
81
|
animation: (t) => {
|
|
81
|
-
|
|
82
|
+
ae(t);
|
|
82
83
|
},
|
|
83
84
|
contentUpdate: (t) => {
|
|
84
85
|
S(t);
|
|
@@ -89,25 +90,25 @@ function Le(e) {
|
|
|
89
90
|
}
|
|
90
91
|
})(n);
|
|
91
92
|
}
|
|
92
|
-
const [C,
|
|
93
|
-
function
|
|
93
|
+
const [C, le] = u(() => ({})), [v, ce] = u(() => ({})), [y, B] = u(() => !1);
|
|
94
|
+
function F(n) {
|
|
94
95
|
var t, i;
|
|
95
96
|
if (e.builderContextSignal.content) {
|
|
96
97
|
const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, a = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
|
|
97
|
-
|
|
98
|
+
O({
|
|
98
99
|
apiHost: e.apiHost,
|
|
99
100
|
type: "click",
|
|
100
|
-
canTrack:
|
|
101
|
+
canTrack: U(e.canTrack),
|
|
101
102
|
contentId: a,
|
|
102
103
|
apiKey: e.apiKey,
|
|
103
104
|
variationId: o !== a ? o : void 0,
|
|
104
|
-
...
|
|
105
|
+
...p(n),
|
|
105
106
|
unique: !y
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
|
-
y ||
|
|
109
|
+
y || B(!0);
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function M() {
|
|
111
112
|
var t, i, o;
|
|
112
113
|
const n = (o = (i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.httpRequests) != null ? o : {};
|
|
113
114
|
Object.entries(n).forEach(
|
|
@@ -121,9 +122,9 @@ function Le(e) {
|
|
|
121
122
|
v[a] = !0;
|
|
122
123
|
const R = h.replace(
|
|
123
124
|
/{{([^}]+)}}/g,
|
|
124
|
-
(
|
|
125
|
-
|
|
126
|
-
code:
|
|
125
|
+
(s, G) => String(
|
|
126
|
+
$({
|
|
127
|
+
code: G,
|
|
127
128
|
context: e.context || {},
|
|
128
129
|
localState: void 0,
|
|
129
130
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -139,19 +140,21 @@ function Le(e) {
|
|
|
139
140
|
url: R,
|
|
140
141
|
method: "GET"
|
|
141
142
|
};
|
|
142
|
-
|
|
143
|
+
Y(JSON.stringify(m));
|
|
144
|
+
const H = {
|
|
143
145
|
method: m.method,
|
|
144
146
|
headers: m.headers,
|
|
145
147
|
body: m.body
|
|
146
|
-
}
|
|
148
|
+
};
|
|
149
|
+
m.method === "GET" && delete H.body, fetch(m.url, H).then((s) => s.json()).then((s) => {
|
|
147
150
|
f({
|
|
148
|
-
[a]:
|
|
151
|
+
[a]: s
|
|
149
152
|
}), C[a] = !0;
|
|
150
|
-
}).catch((
|
|
153
|
+
}).catch((s) => {
|
|
151
154
|
console.error(
|
|
152
155
|
"error fetching dynamic data",
|
|
153
156
|
JSON.stringify(r),
|
|
154
|
-
|
|
157
|
+
s
|
|
155
158
|
);
|
|
156
159
|
}).finally(() => {
|
|
157
160
|
v[a] = !1;
|
|
@@ -165,7 +168,7 @@ function Le(e) {
|
|
|
165
168
|
"builder:component:stateChange",
|
|
166
169
|
{
|
|
167
170
|
detail: {
|
|
168
|
-
state:
|
|
171
|
+
state: z(e.builderContextSignal.rootState),
|
|
169
172
|
ref: {
|
|
170
173
|
name: e.model
|
|
171
174
|
}
|
|
@@ -176,7 +179,7 @@ function Le(e) {
|
|
|
176
179
|
}
|
|
177
180
|
function E(n) {
|
|
178
181
|
var t;
|
|
179
|
-
window.addEventListener("message", x),
|
|
182
|
+
window.addEventListener("message", x), ie({
|
|
180
183
|
...e.locale ? {
|
|
181
184
|
locale: e.locale
|
|
182
185
|
} : {},
|
|
@@ -193,7 +196,7 @@ function Le(e) {
|
|
|
193
196
|
).forEach((i) => {
|
|
194
197
|
var o, a;
|
|
195
198
|
if (!((o = i.models) != null && o.length) || i.models.includes(e.model)) {
|
|
196
|
-
const r =
|
|
199
|
+
const r = Z(i);
|
|
197
200
|
(a = window.parent) == null || a.postMessage(r, "*");
|
|
198
201
|
}
|
|
199
202
|
}), window.addEventListener(
|
|
@@ -206,7 +209,7 @@ function Le(e) {
|
|
|
206
209
|
const t = new URL(location.href).searchParams, i = t.get("builder.preview"), o = t.get(
|
|
207
210
|
`builder.overrides.${i}`
|
|
208
211
|
), a = t.get("apiKey") || t.get("builder.space");
|
|
209
|
-
(i === "BUILDER_STUDIO" || i === e.model && a === e.apiKey && (!e.content || o === e.content.id)) &&
|
|
212
|
+
(i === "BUILDER_STUDIO" || i === e.model && a === e.apiKey && (!e.content || o === e.content.id)) && Q({
|
|
210
213
|
model: e.model,
|
|
211
214
|
apiKey: e.apiKey,
|
|
212
215
|
apiVersion: e.builderContextSignal.apiVersion,
|
|
@@ -219,9 +222,9 @@ function Le(e) {
|
|
|
219
222
|
d && S(d);
|
|
220
223
|
});
|
|
221
224
|
}
|
|
222
|
-
|
|
223
|
-
const w =
|
|
224
|
-
return w.current || (
|
|
225
|
+
re();
|
|
226
|
+
const w = T(!1);
|
|
227
|
+
return w.current || (M(), g(), w.current = !0), l(() => {
|
|
225
228
|
var n;
|
|
226
229
|
return (n = c.current) == null || n.addEventListener(
|
|
227
230
|
"initeditingbldr",
|
|
@@ -247,15 +250,15 @@ function Le(e) {
|
|
|
247
250
|
};
|
|
248
251
|
}, []), l(() => {
|
|
249
252
|
var n, t, i;
|
|
250
|
-
if (
|
|
253
|
+
if (D()) {
|
|
251
254
|
b() && !e.isNestedRender && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
252
|
-
const o = e.builderContextSignal.content &&
|
|
255
|
+
const o = e.builderContextSignal.content && U(e.canTrack), a = ee({
|
|
253
256
|
name: `builder.tests.${(n = e.builderContextSignal.content) == null ? void 0 : n.id}`,
|
|
254
257
|
canTrack: !0
|
|
255
258
|
}), r = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId;
|
|
256
259
|
if (o && r === a) {
|
|
257
260
|
const d = (i = e.builderContextSignal.content) == null ? void 0 : i.id, h = e.apiKey;
|
|
258
|
-
|
|
261
|
+
O({
|
|
259
262
|
apiHost: e.apiHost,
|
|
260
263
|
type: "impression",
|
|
261
264
|
canTrack: !0,
|
|
@@ -264,41 +267,49 @@ function Le(e) {
|
|
|
264
267
|
variationId: a !== d ? a : void 0
|
|
265
268
|
});
|
|
266
269
|
}
|
|
267
|
-
|
|
270
|
+
X() && b();
|
|
268
271
|
}
|
|
269
272
|
}, []), l(() => {
|
|
270
273
|
}, [e.content]), l(() => {
|
|
271
274
|
g();
|
|
272
275
|
}, [e.builderContextSignal.rootState]), l(() => {
|
|
273
|
-
|
|
276
|
+
if (e.data) {
|
|
277
|
+
if (N === e.data)
|
|
278
|
+
return;
|
|
279
|
+
f(e.data), V(e.data);
|
|
280
|
+
}
|
|
274
281
|
}, [e.data]), l(() => {
|
|
275
|
-
e.locale
|
|
276
|
-
|
|
277
|
-
|
|
282
|
+
if (e.locale) {
|
|
283
|
+
if (j === e.locale)
|
|
284
|
+
return;
|
|
285
|
+
f({
|
|
286
|
+
locale: e.locale
|
|
287
|
+
}), _(e.locale);
|
|
288
|
+
}
|
|
278
289
|
}, [e.locale]), l(() => () => {
|
|
279
|
-
|
|
290
|
+
D() && (window.removeEventListener("message", x), window.removeEventListener(
|
|
280
291
|
"builder:component:stateChangeListenerActivated",
|
|
281
292
|
g
|
|
282
293
|
));
|
|
283
|
-
}, []), /* @__PURE__ */
|
|
284
|
-
|
|
294
|
+
}, []), /* @__PURE__ */ K(J.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content || q() ? /* @__PURE__ */ K(
|
|
295
|
+
A,
|
|
285
296
|
{
|
|
286
297
|
ref: c,
|
|
287
|
-
onClick: (n) =>
|
|
288
|
-
"builder-content-id": (
|
|
298
|
+
onClick: (n) => F(n),
|
|
299
|
+
"builder-content-id": (P = e.builderContextSignal.content) == null ? void 0 : P.id,
|
|
289
300
|
"builder-model": e.model,
|
|
290
|
-
className:
|
|
291
|
-
((
|
|
301
|
+
className: oe(
|
|
302
|
+
((k = e.content) == null ? void 0 : k.testVariationId) || ((L = e.content) == null ? void 0 : L.id)
|
|
292
303
|
),
|
|
293
304
|
style: {
|
|
294
|
-
display: !e.builderContextSignal.content &&
|
|
305
|
+
display: !e.builderContextSignal.content && q() ? "none" : void 0
|
|
295
306
|
},
|
|
296
|
-
...
|
|
307
|
+
...W(),
|
|
297
308
|
...e.contentWrapperProps,
|
|
298
309
|
children: e.children
|
|
299
310
|
}
|
|
300
311
|
) : null });
|
|
301
312
|
}
|
|
302
313
|
export {
|
|
303
|
-
|
|
314
|
+
De as default
|
|
304
315
|
};
|
|
@@ -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.21.1";exports.SDK_VERSION=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./is-browser.cjs"),g=require("./register-component.cjs"),i={};function a(e,t){e==="plugin"&&(t=g.serializeIncludingFunctions(t));let r=i[e];if(r||(r=i[e]=[]),r.push(t),o.isBrowser()){const s={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(s,"*"),parent!==window&&window.postMessage(s,"*")}catch(n){console.debug("Could not postmessage",n)}}}function c(e){var t;if(o.isBrowser()){const r=JSON.parse(JSON.stringify(e));e.action&&(r.action=e.action.toString()),(t=window.parent)==null||t.postMessage({type:"builder.registerAction",data:r},"*")}}exports.register=a;exports.registerAction=c;
|
|
@@ -1,24 +1,35 @@
|
|
|
1
|
-
import { isBrowser as
|
|
1
|
+
import { isBrowser as o } from "./is-browser.mjs";
|
|
2
2
|
import { serializeIncludingFunctions as a } from "./register-component.mjs";
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
let
|
|
7
|
-
if (
|
|
8
|
-
const
|
|
3
|
+
const r = {};
|
|
4
|
+
function p(t, e) {
|
|
5
|
+
t === "plugin" && (e = a(e));
|
|
6
|
+
let i = r[t];
|
|
7
|
+
if (i || (i = r[t] = []), i.push(e), o()) {
|
|
8
|
+
const s = {
|
|
9
9
|
type: "builder.register",
|
|
10
10
|
data: {
|
|
11
|
-
type:
|
|
12
|
-
info:
|
|
11
|
+
type: t,
|
|
12
|
+
info: e
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
try {
|
|
16
|
-
parent.postMessage(
|
|
17
|
-
} catch (
|
|
18
|
-
console.debug("Could not postmessage",
|
|
16
|
+
parent.postMessage(s, "*"), parent !== window && window.postMessage(s, "*");
|
|
17
|
+
} catch (n) {
|
|
18
|
+
console.debug("Could not postmessage", n);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
function d(t) {
|
|
23
|
+
var e;
|
|
24
|
+
if (o()) {
|
|
25
|
+
const i = JSON.parse(JSON.stringify(t));
|
|
26
|
+
t.action && (i.action = t.action.toString()), (e = window.parent) == null || e.postMessage({
|
|
27
|
+
type: "builder.registerAction",
|
|
28
|
+
data: i
|
|
29
|
+
}, "*");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
22
32
|
export {
|
|
23
|
-
|
|
33
|
+
p as register,
|
|
34
|
+
d as registerAction
|
|
24
35
|
};
|
package/lib/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./blocks/button/button.cjs"),i=require("./blocks/columns/columns.cjs"),s=require("./blocks/fragment/fragment.cjs"),n=require("./blocks/image/image.cjs"),o=require("./blocks/section/section.cjs"),c=require("./blocks/symbol/symbol.cjs"),u=require("./blocks/text/text.cjs"),g=require("./blocks/video/video.cjs"),d=require("./components/blocks/blocks.cjs"),q=require("./components/content-variants/content-variants.cjs"),a=require("./context/builder.context.cjs"),l=require("./helpers/user-attributes.cjs"),b=require("./functions/is-editing.cjs"),m=require("./functions/is-previewing.cjs"),E=require("./functions/register-component.cjs"),t=require("./functions/register.cjs"),C=require("./functions/set-editor-settings.cjs"),f=require("./functions/get-builder-search-params/index.cjs"),h=require("./functions/track/index.cjs"),p=require("./helpers/subscribe-to-editor.cjs"),P=require("./functions/fetch-builder-props.cjs"),e=require("./functions/get-content/index.cjs");exports.Button=r;exports.Columns=i;exports.Fragment=s;exports.Image=n;exports.Section=o;exports.Symbol=c;exports.Text=u;exports.Video=g;exports.Blocks=d;exports.Content=q;exports.BuilderContext=a;exports.setClientUserAttributes=l.setClientUserAttributes;exports.isEditing=b.isEditing;exports.isPreviewing=m.isPreviewing;exports.createRegisterComponentMessage=E.createRegisterComponentMessage;exports.register=t.register;exports.registerAction=t.registerAction;exports.setEditorSettings=C.setEditorSettings;exports.getBuilderSearchParams=f.getBuilderSearchParams;exports.track=h.track;exports.subscribeToEditor=p.subscribeToEditor;exports.fetchBuilderProps=P.fetchBuilderProps;exports._processContentResult=e._processContentResult;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;
|
package/lib/node/index.mjs
CHANGED
|
@@ -3,23 +3,23 @@ import { default as f } from "./blocks/columns/columns.mjs";
|
|
|
3
3
|
import { default as a } from "./blocks/fragment/fragment.mjs";
|
|
4
4
|
import { default as p } from "./blocks/image/image.mjs";
|
|
5
5
|
import { default as i } from "./blocks/section/section.mjs";
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
6
|
+
import { default as n } from "./blocks/symbol/symbol.mjs";
|
|
7
|
+
import { default as d } from "./blocks/text/text.mjs";
|
|
8
8
|
import { default as g } from "./blocks/video/video.mjs";
|
|
9
9
|
import { default as B } from "./components/blocks/blocks.mjs";
|
|
10
10
|
import { default as b } from "./components/content-variants/content-variants.mjs";
|
|
11
11
|
import { default as S } from "./context/builder.context.mjs";
|
|
12
12
|
import { setClientUserAttributes as k } from "./helpers/user-attributes.mjs";
|
|
13
|
-
import { isEditing as
|
|
14
|
-
import { isPreviewing as
|
|
15
|
-
import { createRegisterComponentMessage as
|
|
16
|
-
import { register as I } from "./functions/register.mjs";
|
|
17
|
-
import { setEditorSettings as
|
|
18
|
-
import { getBuilderSearchParams as
|
|
19
|
-
import { track as
|
|
20
|
-
import { subscribeToEditor as
|
|
21
|
-
import { fetchBuilderProps as
|
|
22
|
-
import { _processContentResult as
|
|
13
|
+
import { isEditing as A } from "./functions/is-editing.mjs";
|
|
14
|
+
import { isPreviewing as T } from "./functions/is-previewing.mjs";
|
|
15
|
+
import { createRegisterComponentMessage as w } from "./functions/register-component.mjs";
|
|
16
|
+
import { register as I, registerAction as M } from "./functions/register.mjs";
|
|
17
|
+
import { setEditorSettings as U } from "./functions/set-editor-settings.mjs";
|
|
18
|
+
import { getBuilderSearchParams as _ } from "./functions/get-builder-search-params/index.mjs";
|
|
19
|
+
import { track as q } from "./functions/track/index.mjs";
|
|
20
|
+
import { subscribeToEditor as D } from "./helpers/subscribe-to-editor.mjs";
|
|
21
|
+
import { fetchBuilderProps as H } from "./functions/fetch-builder-props.mjs";
|
|
22
|
+
import { _processContentResult as K, fetchEntries as L, fetchOneEntry as N } from "./functions/get-content/index.mjs";
|
|
23
23
|
export {
|
|
24
24
|
B as Blocks,
|
|
25
25
|
S as BuilderContext,
|
|
@@ -29,20 +29,21 @@ export {
|
|
|
29
29
|
a as Fragment,
|
|
30
30
|
p as Image,
|
|
31
31
|
i as Section,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
n as Symbol,
|
|
33
|
+
d as Text,
|
|
34
34
|
g as Video,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
K as _processContentResult,
|
|
36
|
+
w as createRegisterComponentMessage,
|
|
37
|
+
H as fetchBuilderProps,
|
|
38
|
+
L as fetchEntries,
|
|
39
|
+
N as fetchOneEntry,
|
|
40
|
+
_ as getBuilderSearchParams,
|
|
41
|
+
A as isEditing,
|
|
42
|
+
T as isPreviewing,
|
|
43
43
|
I as register,
|
|
44
|
+
M as registerAction,
|
|
44
45
|
k as setClientUserAttributes,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
U as setEditorSettings,
|
|
47
|
+
D as subscribeToEditor,
|
|
48
|
+
q as track
|
|
48
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./functions/is-editing.cjs"),i=require("./functions/is-previewing.cjs"),s=require("./functions/register-component.cjs"),r=require("./functions/register.cjs"),n=require("./functions/set-editor-settings.cjs"),o=require("./functions/get-builder-search-params/index.cjs"),c=require("./functions/track/index.cjs"),g=require("./helpers/subscribe-to-editor.cjs"),u=require("./functions/fetch-builder-props.cjs"),e=require("./functions/get-content/index.cjs");exports.isEditing=t.isEditing;exports.isPreviewing=i.isPreviewing;exports.createRegisterComponentMessage=s.createRegisterComponentMessage;exports.register=r.register;exports.registerAction=r.registerAction;exports.setEditorSettings=n.setEditorSettings;exports.getBuilderSearchParams=o.getBuilderSearchParams;exports.track=c.track;exports.subscribeToEditor=g.subscribeToEditor;exports.fetchBuilderProps=u.fetchBuilderProps;exports._processContentResult=e._processContentResult;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { isEditing as t } from "./functions/is-editing.mjs";
|
|
2
|
-
import { isPreviewing as
|
|
2
|
+
import { isPreviewing as i } from "./functions/is-previewing.mjs";
|
|
3
3
|
import { createRegisterComponentMessage as f } from "./functions/register-component.mjs";
|
|
4
|
-
import { register as m } from "./functions/register.mjs";
|
|
5
|
-
import { setEditorSettings as
|
|
6
|
-
import { getBuilderSearchParams as
|
|
7
|
-
import { track as
|
|
8
|
-
import { subscribeToEditor as
|
|
9
|
-
import { fetchBuilderProps as
|
|
10
|
-
import { _processContentResult as
|
|
4
|
+
import { register as m, registerAction as n } from "./functions/register.mjs";
|
|
5
|
+
import { setEditorSettings as c } from "./functions/set-editor-settings.mjs";
|
|
6
|
+
import { getBuilderSearchParams as a } from "./functions/get-builder-search-params/index.mjs";
|
|
7
|
+
import { track as E } from "./functions/track/index.mjs";
|
|
8
|
+
import { subscribeToEditor as u } from "./helpers/subscribe-to-editor.mjs";
|
|
9
|
+
import { fetchBuilderProps as P } from "./functions/fetch-builder-props.mjs";
|
|
10
|
+
import { _processContentResult as B, fetchEntries as C, fetchOneEntry as R } from "./functions/get-content/index.mjs";
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
B as _processContentResult,
|
|
13
13
|
f as createRegisterComponentMessage,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
P as fetchBuilderProps,
|
|
15
|
+
C as fetchEntries,
|
|
16
|
+
R as fetchOneEntry,
|
|
17
|
+
a as getBuilderSearchParams,
|
|
18
18
|
t as isEditing,
|
|
19
|
-
|
|
19
|
+
i as isPreviewing,
|
|
20
20
|
m as register,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
n as registerAction,
|
|
22
|
+
c as setEditorSettings,
|
|
23
|
+
u as subscribeToEditor,
|
|
24
|
+
E as track
|
|
24
25
|
};
|
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.21.1",
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.21.1";
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import type { BuilderBlock } from '../types/builder-block.js';
|
|
2
2
|
import type { DeepPartial } from '../types/deep-partial.js';
|
|
3
|
+
import type { Input } from '../types/input.js';
|
|
4
|
+
export interface Action {
|
|
5
|
+
name: string;
|
|
6
|
+
inputs?: readonly Input[];
|
|
7
|
+
returnType?: Input;
|
|
8
|
+
action: (options: Record<string, any>) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Is an action for expression (e.g. calculating a binding like a formula
|
|
11
|
+
* to fill a value based on locale) or a function (e.g. something to trigger
|
|
12
|
+
* on an event like add to cart) or either (e.g. a custom code block)
|
|
13
|
+
*/
|
|
14
|
+
kind: 'expression' | 'function' | 'any';
|
|
15
|
+
/**
|
|
16
|
+
* Globally unique ID for an action, e.g. "@builder.io:setState"
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
}
|
|
3
20
|
export interface InsertMenuItem {
|
|
4
21
|
name: string;
|
|
5
22
|
icon?: string;
|
|
@@ -14,3 +31,4 @@ export interface InsertMenuConfig {
|
|
|
14
31
|
}
|
|
15
32
|
export declare function register(type: 'insertMenu', info: InsertMenuConfig): void;
|
|
16
33
|
export declare function register(type: string, info: any): void;
|
|
34
|
+
export declare function registerAction(action: Action): void;
|
|
@@ -25,7 +25,7 @@ export type { ComponentInfo } from './types/components.js';
|
|
|
25
25
|
export { isEditing } from './functions/is-editing.js';
|
|
26
26
|
export { isPreviewing } from './functions/is-previewing.js';
|
|
27
27
|
export { createRegisterComponentMessage } from './functions/register-component.js';
|
|
28
|
-
export { register } from './functions/register.js';
|
|
28
|
+
export { register, registerAction } from './functions/register.js';
|
|
29
29
|
export type { InsertMenuConfig, InsertMenuItem } from './functions/register.js';
|
|
30
30
|
export { setEditorSettings } from './functions/set-editor-settings.js';
|
|
31
31
|
export type { Settings } from './functions/set-editor-settings.js';
|
|
@@ -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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.21.1";
|