@builder.io/sdk-solid 3.0.7 → 4.0.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/dist/index.d.ts +15 -15
- package/lib/browser/dev.js +80 -32
- package/lib/browser/dev.jsx +84 -20
- package/lib/browser/index.js +79 -32
- package/lib/browser/index.jsx +83 -20
- package/lib/edge/dev.js +80 -32
- package/lib/edge/dev.jsx +84 -20
- package/lib/edge/index.js +79 -32
- package/lib/edge/index.jsx +83 -20
- package/lib/node/dev.js +80 -32
- package/lib/node/dev.jsx +84 -20
- package/lib/node/index.js +79 -32
- package/lib/node/index.jsx +83 -20
- package/package.json +1 -1
package/lib/edge/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo
|
|
1
|
+
import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, use, Dynamic, memo } from 'solid-js/web';
|
|
2
2
|
import { createContext, useContext, Show, For, createMemo, createSignal, onMount, createEffect, on } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
@@ -8221,10 +8221,10 @@ var componentInfo20 = {
|
|
|
8221
8221
|
builderBlock: true
|
|
8222
8222
|
}
|
|
8223
8223
|
};
|
|
8224
|
-
var _tmpl$21 = /* @__PURE__ */ template(`<
|
|
8225
|
-
var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
|
|
8226
|
-
var _tmpl$35 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
8224
|
+
var _tmpl$21 = /* @__PURE__ */ template(`<div>`);
|
|
8225
|
+
var _tmpl$29 = /* @__PURE__ */ template(`<div><video class=builder-video><source type=video/mp4>`);
|
|
8227
8226
|
function Video(props) {
|
|
8227
|
+
const [lazyVideoObserver, setLazyVideoObserver] = createSignal(void 0);
|
|
8228
8228
|
const videoProps = createMemo(() => {
|
|
8229
8229
|
return {
|
|
8230
8230
|
...props.autoPlay === true ? {
|
|
@@ -8249,12 +8249,41 @@ function Video(props) {
|
|
|
8249
8249
|
...videoProps()
|
|
8250
8250
|
};
|
|
8251
8251
|
});
|
|
8252
|
+
let videoRef;
|
|
8253
|
+
onMount(() => {
|
|
8254
|
+
if (props.lazyLoad) {
|
|
8255
|
+
const oberver = new IntersectionObserver(function(entries) {
|
|
8256
|
+
entries.forEach(function(entry) {
|
|
8257
|
+
if (!entry.isIntersecting)
|
|
8258
|
+
return;
|
|
8259
|
+
const videoElement = entry.target;
|
|
8260
|
+
try {
|
|
8261
|
+
Array.from(videoElement.children).filter((child) => child instanceof HTMLElement && child.tagName === "SOURCE").forEach((source) => {
|
|
8262
|
+
const src = source.dataset.src;
|
|
8263
|
+
if (src) {
|
|
8264
|
+
source.src = src;
|
|
8265
|
+
}
|
|
8266
|
+
});
|
|
8267
|
+
videoElement.load();
|
|
8268
|
+
oberver.unobserve(videoElement);
|
|
8269
|
+
} catch (error) {
|
|
8270
|
+
}
|
|
8271
|
+
});
|
|
8272
|
+
});
|
|
8273
|
+
if (videoRef) {
|
|
8274
|
+
oberver.observe(videoRef);
|
|
8275
|
+
}
|
|
8276
|
+
setLazyVideoObserver(oberver);
|
|
8277
|
+
}
|
|
8278
|
+
});
|
|
8252
8279
|
return (() => {
|
|
8253
|
-
const _el$ = _tmpl$
|
|
8280
|
+
const _el$ = _tmpl$29(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
|
|
8254
8281
|
_el$.style.setProperty("position", "relative");
|
|
8282
|
+
const _ref$ = videoRef;
|
|
8283
|
+
typeof _ref$ === "function" ? use(_ref$, _el$2) : videoRef = _el$2;
|
|
8255
8284
|
spread(_el$2, mergeProps(spreadProps, {
|
|
8256
8285
|
get preload() {
|
|
8257
|
-
return props.preload || "metadata";
|
|
8286
|
+
return props.lazyLoad ? "none" : props.preload || "metadata";
|
|
8258
8287
|
},
|
|
8259
8288
|
get style() {
|
|
8260
8289
|
return {
|
|
@@ -8271,29 +8300,21 @@ function Video(props) {
|
|
|
8271
8300
|
} : null
|
|
8272
8301
|
};
|
|
8273
8302
|
},
|
|
8274
|
-
get src() {
|
|
8275
|
-
return props.video || "no-src";
|
|
8276
|
-
},
|
|
8277
8303
|
get poster() {
|
|
8278
8304
|
return props.posterImage;
|
|
8279
8305
|
}
|
|
8280
8306
|
}), false, true);
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
const _el$3 = _tmpl$21();
|
|
8287
|
-
effect(() => setAttribute(_el$3, "src", props.video));
|
|
8288
|
-
return _el$3;
|
|
8289
|
-
}
|
|
8290
|
-
}));
|
|
8307
|
+
spread(_el$3, mergeProps(() => props.lazyLoad ? {
|
|
8308
|
+
"data-src": props.video
|
|
8309
|
+
} : {
|
|
8310
|
+
src: props.video
|
|
8311
|
+
}), false, false);
|
|
8291
8312
|
insert(_el$, createComponent(Show, {
|
|
8292
8313
|
get when() {
|
|
8293
8314
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
8294
8315
|
},
|
|
8295
8316
|
get children() {
|
|
8296
|
-
const _el$4 = _tmpl$
|
|
8317
|
+
const _el$4 = _tmpl$21();
|
|
8297
8318
|
_el$4.style.setProperty("width", "100%");
|
|
8298
8319
|
_el$4.style.setProperty("pointer-events", "none");
|
|
8299
8320
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -8306,7 +8327,7 @@ function Video(props) {
|
|
|
8306
8327
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
8307
8328
|
},
|
|
8308
8329
|
get children() {
|
|
8309
|
-
const _el$5 = _tmpl$
|
|
8330
|
+
const _el$5 = _tmpl$21();
|
|
8310
8331
|
_el$5.style.setProperty("display", "flex");
|
|
8311
8332
|
_el$5.style.setProperty("flex-direction", "column");
|
|
8312
8333
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -8319,7 +8340,7 @@ function Video(props) {
|
|
|
8319
8340
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
8320
8341
|
},
|
|
8321
8342
|
get children() {
|
|
8322
|
-
const _el$6 = _tmpl$
|
|
8343
|
+
const _el$6 = _tmpl$21();
|
|
8323
8344
|
_el$6.style.setProperty("pointer-events", "none");
|
|
8324
8345
|
_el$6.style.setProperty("display", "flex");
|
|
8325
8346
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -8476,7 +8497,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8476
8497
|
}
|
|
8477
8498
|
|
|
8478
8499
|
// src/constants/sdk-version.ts
|
|
8479
|
-
var SDK_VERSION = "
|
|
8500
|
+
var SDK_VERSION = "4.0.1";
|
|
8480
8501
|
|
|
8481
8502
|
// src/helpers/sdk-headers.ts
|
|
8482
8503
|
var getSdkHeaders = () => ({
|
|
@@ -9078,7 +9099,7 @@ var registerInsertMenu = () => {
|
|
|
9078
9099
|
});
|
|
9079
9100
|
};
|
|
9080
9101
|
var isSetupForEditing = false;
|
|
9081
|
-
var setupBrowserForEditing = (options
|
|
9102
|
+
var setupBrowserForEditing = (options) => {
|
|
9082
9103
|
if (isSetupForEditing) {
|
|
9083
9104
|
return;
|
|
9084
9105
|
}
|
|
@@ -9094,6 +9115,8 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
9094
9115
|
// scope our '+ add block' button styling
|
|
9095
9116
|
supportsAddBlockScoping: true,
|
|
9096
9117
|
supportsCustomBreakpoints: true,
|
|
9118
|
+
modelName: options.modelName,
|
|
9119
|
+
apiKey: options.apiKey,
|
|
9097
9120
|
supportsXSmallBreakpoint: TARGET === "reactNative" ? false : true,
|
|
9098
9121
|
blockLevelPersonalization: true
|
|
9099
9122
|
}
|
|
@@ -9186,6 +9209,15 @@ var createEditorListener = ({
|
|
|
9186
9209
|
callbacks.animation(data.data);
|
|
9187
9210
|
break;
|
|
9188
9211
|
}
|
|
9212
|
+
case "builder.resetState": {
|
|
9213
|
+
const messageContent = data.data;
|
|
9214
|
+
const modelName = messageContent.model;
|
|
9215
|
+
const newState = messageContent?.state;
|
|
9216
|
+
if (modelName === model && newState) {
|
|
9217
|
+
callbacks.stateUpdate(newState);
|
|
9218
|
+
}
|
|
9219
|
+
break;
|
|
9220
|
+
}
|
|
9189
9221
|
case "builder.contentUpdate": {
|
|
9190
9222
|
const messageContent = data.data;
|
|
9191
9223
|
const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
|
|
@@ -9199,23 +9231,33 @@ var createEditorListener = ({
|
|
|
9199
9231
|
}
|
|
9200
9232
|
};
|
|
9201
9233
|
};
|
|
9202
|
-
var subscribeToEditor = (
|
|
9234
|
+
var subscribeToEditor = ({
|
|
9235
|
+
model,
|
|
9236
|
+
apiKey,
|
|
9237
|
+
callback,
|
|
9238
|
+
trustedHosts
|
|
9239
|
+
}) => {
|
|
9203
9240
|
if (!isBrowser) {
|
|
9204
9241
|
logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server.");
|
|
9205
9242
|
return () => {
|
|
9206
9243
|
};
|
|
9207
9244
|
}
|
|
9208
|
-
setupBrowserForEditing(
|
|
9245
|
+
setupBrowserForEditing({
|
|
9246
|
+
modelName: model,
|
|
9247
|
+
apiKey
|
|
9248
|
+
});
|
|
9209
9249
|
const listener = createEditorListener({
|
|
9210
9250
|
callbacks: {
|
|
9211
9251
|
contentUpdate: callback,
|
|
9212
9252
|
animation: () => {
|
|
9213
9253
|
},
|
|
9214
9254
|
configureSdk: () => {
|
|
9255
|
+
},
|
|
9256
|
+
stateUpdate: () => {
|
|
9215
9257
|
}
|
|
9216
9258
|
},
|
|
9217
9259
|
model,
|
|
9218
|
-
trustedHosts
|
|
9260
|
+
trustedHosts
|
|
9219
9261
|
});
|
|
9220
9262
|
window.addEventListener("message", listener);
|
|
9221
9263
|
return () => {
|
|
@@ -9379,6 +9421,9 @@ function EnableEditor(props) {
|
|
|
9379
9421
|
},
|
|
9380
9422
|
contentUpdate: (newContent) => {
|
|
9381
9423
|
mergeNewContent(newContent);
|
|
9424
|
+
},
|
|
9425
|
+
stateUpdate: (newState) => {
|
|
9426
|
+
mergeNewRootState(newState);
|
|
9382
9427
|
}
|
|
9383
9428
|
}
|
|
9384
9429
|
})(event);
|
|
@@ -9460,10 +9505,12 @@ function EnableEditor(props) {
|
|
|
9460
9505
|
} : {},
|
|
9461
9506
|
...props.trustedHosts ? {
|
|
9462
9507
|
trustedHosts: props.trustedHosts
|
|
9463
|
-
} : {}
|
|
9508
|
+
} : {},
|
|
9509
|
+
modelName: props.model ?? "",
|
|
9510
|
+
apiKey: props.apiKey
|
|
9464
9511
|
});
|
|
9465
9512
|
Object.values(props.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
9466
|
-
if (!
|
|
9513
|
+
if (!registeredComponent.models?.length || registeredComponent.models.includes(props.model)) {
|
|
9467
9514
|
const message = createRegisterComponentMessage(registeredComponent);
|
|
9468
9515
|
window.parent?.postMessage(message, "*");
|
|
9469
9516
|
}
|
|
@@ -9491,7 +9538,7 @@ function EnableEditor(props) {
|
|
|
9491
9538
|
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
9492
9539
|
if (searchParamPreviewModel === "BUILDER_STUDIO" || searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id)) {
|
|
9493
9540
|
fetchOneEntry({
|
|
9494
|
-
model: props.model
|
|
9541
|
+
model: props.model,
|
|
9495
9542
|
apiKey: props.apiKey,
|
|
9496
9543
|
apiVersion: props.builderContextSignal.apiVersion,
|
|
9497
9544
|
...searchParamPreviewModel === "BUILDER_STUDIO" && props.context?.symbolId ? {
|
|
@@ -9685,7 +9732,7 @@ function ContentComponent(props) {
|
|
|
9685
9732
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
9686
9733
|
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
9687
9734
|
nonce: props.nonce || "",
|
|
9688
|
-
model: props.model
|
|
9735
|
+
model: props.model
|
|
9689
9736
|
});
|
|
9690
9737
|
function contentSetState(newRootState) {
|
|
9691
9738
|
setBuilderContextSignal((PREVIOUS_VALUE) => ({
|
|
@@ -10126,7 +10173,7 @@ function Symbol2(props) {
|
|
|
10126
10173
|
return props.builderContext.canTrack;
|
|
10127
10174
|
},
|
|
10128
10175
|
get model() {
|
|
10129
|
-
return props.symbol?.model;
|
|
10176
|
+
return props.symbol?.model ?? "";
|
|
10130
10177
|
},
|
|
10131
10178
|
get content() {
|
|
10132
10179
|
return contentToUse();
|
package/lib/edge/index.jsx
CHANGED
|
@@ -5091,10 +5091,10 @@ function SectionComponent(props) {
|
|
|
5091
5091
|
var section_default = SectionComponent;
|
|
5092
5092
|
|
|
5093
5093
|
// src/blocks/symbol/symbol.tsx
|
|
5094
|
-
import { onMount as
|
|
5094
|
+
import { onMount as onMount9, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
5095
5095
|
|
|
5096
5096
|
// src/components/content-variants/content-variants.tsx
|
|
5097
|
-
import { Show as Show16, For as For9, onMount as
|
|
5097
|
+
import { Show as Show16, For as For9, onMount as onMount8, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
5098
5098
|
|
|
5099
5099
|
// src/helpers/url.ts
|
|
5100
5100
|
var getTopLevelDomain = (host) => {
|
|
@@ -7737,8 +7737,9 @@ var componentInfo20 = {
|
|
|
7737
7737
|
};
|
|
7738
7738
|
|
|
7739
7739
|
// src/blocks/video/video.tsx
|
|
7740
|
-
import { Show as Show13, createMemo as createMemo15 } from "solid-js";
|
|
7740
|
+
import { Show as Show13, onMount as onMount6, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
|
|
7741
7741
|
function Video(props) {
|
|
7742
|
+
const [lazyVideoObserver, setLazyVideoObserver] = createSignal15(void 0);
|
|
7742
7743
|
const videoProps = createMemo15(() => {
|
|
7743
7744
|
return {
|
|
7744
7745
|
...props.autoPlay === true ? {
|
|
@@ -7763,6 +7764,35 @@ function Video(props) {
|
|
|
7763
7764
|
...videoProps()
|
|
7764
7765
|
};
|
|
7765
7766
|
});
|
|
7767
|
+
let videoRef;
|
|
7768
|
+
onMount6(() => {
|
|
7769
|
+
if (props.lazyLoad) {
|
|
7770
|
+
const oberver = new IntersectionObserver(function(entries) {
|
|
7771
|
+
entries.forEach(function(entry) {
|
|
7772
|
+
if (!entry.isIntersecting)
|
|
7773
|
+
return;
|
|
7774
|
+
const videoElement = entry.target;
|
|
7775
|
+
try {
|
|
7776
|
+
Array.from(videoElement.children).filter(
|
|
7777
|
+
(child) => child instanceof HTMLElement && child.tagName === "SOURCE"
|
|
7778
|
+
).forEach((source) => {
|
|
7779
|
+
const src = source.dataset.src;
|
|
7780
|
+
if (src) {
|
|
7781
|
+
source.src = src;
|
|
7782
|
+
}
|
|
7783
|
+
});
|
|
7784
|
+
videoElement.load();
|
|
7785
|
+
oberver.unobserve(videoElement);
|
|
7786
|
+
} catch (error) {
|
|
7787
|
+
}
|
|
7788
|
+
});
|
|
7789
|
+
});
|
|
7790
|
+
if (videoRef) {
|
|
7791
|
+
oberver.observe(videoRef);
|
|
7792
|
+
}
|
|
7793
|
+
setLazyVideoObserver(oberver);
|
|
7794
|
+
}
|
|
7795
|
+
});
|
|
7766
7796
|
return <><div
|
|
7767
7797
|
style={{
|
|
7768
7798
|
position: "relative"
|
|
@@ -7771,7 +7801,8 @@ function Video(props) {
|
|
|
7771
7801
|
<video
|
|
7772
7802
|
class="builder-video"
|
|
7773
7803
|
{...spreadProps()}
|
|
7774
|
-
|
|
7804
|
+
ref={videoRef}
|
|
7805
|
+
preload={props.lazyLoad ? "none" : props.preload || "metadata"}
|
|
7775
7806
|
style={{
|
|
7776
7807
|
width: "100%",
|
|
7777
7808
|
height: "100%",
|
|
@@ -7785,9 +7816,15 @@ function Video(props) {
|
|
|
7785
7816
|
position: "absolute"
|
|
7786
7817
|
} : null
|
|
7787
7818
|
}}
|
|
7788
|
-
src={props.video || "no-src"}
|
|
7789
7819
|
poster={props.posterImage}
|
|
7790
|
-
><
|
|
7820
|
+
><source
|
|
7821
|
+
type="video/mp4"
|
|
7822
|
+
{...props.lazyLoad ? {
|
|
7823
|
+
"data-src": props.video
|
|
7824
|
+
} : {
|
|
7825
|
+
src: props.video
|
|
7826
|
+
}}
|
|
7827
|
+
/></video>
|
|
7791
7828
|
<Show13
|
|
7792
7829
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
7793
7830
|
><div
|
|
@@ -7957,7 +7994,7 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7957
7994
|
// src/components/content/components/enable-editor.tsx
|
|
7958
7995
|
import {
|
|
7959
7996
|
Show as Show14,
|
|
7960
|
-
onMount as
|
|
7997
|
+
onMount as onMount7,
|
|
7961
7998
|
on as on3,
|
|
7962
7999
|
createEffect as createEffect3,
|
|
7963
8000
|
createMemo as createMemo16,
|
|
@@ -7971,7 +8008,7 @@ function getPreviewContent(_searchParams) {
|
|
|
7971
8008
|
}
|
|
7972
8009
|
|
|
7973
8010
|
// src/constants/sdk-version.ts
|
|
7974
|
-
var SDK_VERSION = "
|
|
8011
|
+
var SDK_VERSION = "4.0.1";
|
|
7975
8012
|
|
|
7976
8013
|
// src/helpers/sdk-headers.ts
|
|
7977
8014
|
var getSdkHeaders = () => ({
|
|
@@ -8573,7 +8610,7 @@ var registerInsertMenu = () => {
|
|
|
8573
8610
|
});
|
|
8574
8611
|
};
|
|
8575
8612
|
var isSetupForEditing = false;
|
|
8576
|
-
var setupBrowserForEditing = (options
|
|
8613
|
+
var setupBrowserForEditing = (options) => {
|
|
8577
8614
|
if (isSetupForEditing) {
|
|
8578
8615
|
return;
|
|
8579
8616
|
}
|
|
@@ -8589,6 +8626,8 @@ var setupBrowserForEditing = (options = {}) => {
|
|
|
8589
8626
|
// scope our '+ add block' button styling
|
|
8590
8627
|
supportsAddBlockScoping: true,
|
|
8591
8628
|
supportsCustomBreakpoints: true,
|
|
8629
|
+
modelName: options.modelName,
|
|
8630
|
+
apiKey: options.apiKey,
|
|
8592
8631
|
supportsXSmallBreakpoint: TARGET === "reactNative" ? false : true,
|
|
8593
8632
|
blockLevelPersonalization: true
|
|
8594
8633
|
}
|
|
@@ -8681,6 +8720,15 @@ var createEditorListener = ({
|
|
|
8681
8720
|
callbacks.animation(data.data);
|
|
8682
8721
|
break;
|
|
8683
8722
|
}
|
|
8723
|
+
case "builder.resetState": {
|
|
8724
|
+
const messageContent = data.data;
|
|
8725
|
+
const modelName = messageContent.model;
|
|
8726
|
+
const newState = messageContent?.state;
|
|
8727
|
+
if (modelName === model && newState) {
|
|
8728
|
+
callbacks.stateUpdate(newState);
|
|
8729
|
+
}
|
|
8730
|
+
break;
|
|
8731
|
+
}
|
|
8684
8732
|
case "builder.contentUpdate": {
|
|
8685
8733
|
const messageContent = data.data;
|
|
8686
8734
|
const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
|
|
@@ -8694,23 +8742,33 @@ var createEditorListener = ({
|
|
|
8694
8742
|
}
|
|
8695
8743
|
};
|
|
8696
8744
|
};
|
|
8697
|
-
var subscribeToEditor = (
|
|
8745
|
+
var subscribeToEditor = ({
|
|
8746
|
+
model,
|
|
8747
|
+
apiKey,
|
|
8748
|
+
callback,
|
|
8749
|
+
trustedHosts
|
|
8750
|
+
}) => {
|
|
8698
8751
|
if (!isBrowser) {
|
|
8699
8752
|
logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server.");
|
|
8700
8753
|
return () => {
|
|
8701
8754
|
};
|
|
8702
8755
|
}
|
|
8703
|
-
setupBrowserForEditing(
|
|
8756
|
+
setupBrowserForEditing({
|
|
8757
|
+
modelName: model,
|
|
8758
|
+
apiKey
|
|
8759
|
+
});
|
|
8704
8760
|
const listener = createEditorListener({
|
|
8705
8761
|
callbacks: {
|
|
8706
8762
|
contentUpdate: callback,
|
|
8707
8763
|
animation: () => {
|
|
8708
8764
|
},
|
|
8709
8765
|
configureSdk: () => {
|
|
8766
|
+
},
|
|
8767
|
+
stateUpdate: () => {
|
|
8710
8768
|
}
|
|
8711
8769
|
},
|
|
8712
8770
|
model,
|
|
8713
|
-
trustedHosts
|
|
8771
|
+
trustedHosts
|
|
8714
8772
|
});
|
|
8715
8773
|
window.addEventListener("message", listener);
|
|
8716
8774
|
return () => {
|
|
@@ -8873,6 +8931,9 @@ function EnableEditor(props) {
|
|
|
8873
8931
|
},
|
|
8874
8932
|
contentUpdate: (newContent) => {
|
|
8875
8933
|
mergeNewContent(newContent);
|
|
8934
|
+
},
|
|
8935
|
+
stateUpdate: (newState) => {
|
|
8936
|
+
mergeNewRootState(newState);
|
|
8876
8937
|
}
|
|
8877
8938
|
}
|
|
8878
8939
|
})(event);
|
|
@@ -8950,7 +9011,7 @@ function EnableEditor(props) {
|
|
|
8950
9011
|
let elementRef;
|
|
8951
9012
|
runHttpRequests();
|
|
8952
9013
|
emitStateUpdate();
|
|
8953
|
-
|
|
9014
|
+
onMount7(() => {
|
|
8954
9015
|
if (isBrowser()) {
|
|
8955
9016
|
if (isEditing() && !props.isNestedRender) {
|
|
8956
9017
|
window.addEventListener("message", processMessage);
|
|
@@ -8964,12 +9025,14 @@ function EnableEditor(props) {
|
|
|
8964
9025
|
} : {},
|
|
8965
9026
|
...props.trustedHosts ? {
|
|
8966
9027
|
trustedHosts: props.trustedHosts
|
|
8967
|
-
} : {}
|
|
9028
|
+
} : {},
|
|
9029
|
+
modelName: props.model ?? "",
|
|
9030
|
+
apiKey: props.apiKey
|
|
8968
9031
|
});
|
|
8969
9032
|
Object.values(
|
|
8970
9033
|
props.builderContextSignal.componentInfos
|
|
8971
9034
|
).forEach((registeredComponent) => {
|
|
8972
|
-
if (!
|
|
9035
|
+
if (!registeredComponent.models?.length || registeredComponent.models.includes(props.model)) {
|
|
8973
9036
|
const message = createRegisterComponentMessage(registeredComponent);
|
|
8974
9037
|
window.parent?.postMessage(message, "*");
|
|
8975
9038
|
}
|
|
@@ -9002,7 +9065,7 @@ function EnableEditor(props) {
|
|
|
9002
9065
|
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
9003
9066
|
if (searchParamPreviewModel === "BUILDER_STUDIO" || searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id)) {
|
|
9004
9067
|
fetchOneEntry({
|
|
9005
|
-
model: props.model
|
|
9068
|
+
model: props.model,
|
|
9006
9069
|
apiKey: props.apiKey,
|
|
9007
9070
|
apiVersion: props.builderContextSignal.apiVersion,
|
|
9008
9071
|
...searchParamPreviewModel === "BUILDER_STUDIO" && props.context?.symbolId ? {
|
|
@@ -9190,7 +9253,7 @@ function ContentComponent(props) {
|
|
|
9190
9253
|
BlocksWrapper: props.blocksWrapper || "div",
|
|
9191
9254
|
BlocksWrapperProps: props.blocksWrapperProps || {},
|
|
9192
9255
|
nonce: props.nonce || "",
|
|
9193
|
-
model: props.model
|
|
9256
|
+
model: props.model
|
|
9194
9257
|
});
|
|
9195
9258
|
function contentSetState(newRootState) {
|
|
9196
9259
|
setBuilderContextSignal((PREVIOUS_VALUE) => ({
|
|
@@ -9295,7 +9358,7 @@ function ContentVariants(props) {
|
|
|
9295
9358
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
9296
9359
|
});
|
|
9297
9360
|
});
|
|
9298
|
-
|
|
9361
|
+
onMount8(() => {
|
|
9299
9362
|
setShouldRenderVariants(false);
|
|
9300
9363
|
});
|
|
9301
9364
|
return <><>
|
|
@@ -9425,7 +9488,7 @@ function Symbol2(props) {
|
|
|
9425
9488
|
}
|
|
9426
9489
|
});
|
|
9427
9490
|
}
|
|
9428
|
-
|
|
9491
|
+
onMount9(() => {
|
|
9429
9492
|
});
|
|
9430
9493
|
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
9431
9494
|
function onUpdateFn_0() {
|
|
@@ -9448,7 +9511,7 @@ function Symbol2(props) {
|
|
|
9448
9511
|
...contentToUse()?.data?.state
|
|
9449
9512
|
}}
|
|
9450
9513
|
canTrack={props.builderContext.canTrack}
|
|
9451
|
-
model={props.symbol?.model}
|
|
9514
|
+
model={props.symbol?.model ?? ""}
|
|
9452
9515
|
content={contentToUse()}
|
|
9453
9516
|
linkComponent={props.builderLinkComponent}
|
|
9454
9517
|
blocksWrapper={blocksWrapper()}
|