@builder.io/sdk-react-nextjs 0.19.3 → 0.20.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/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/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/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/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/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/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/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/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,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.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/edge/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/edge/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;
|