@builder.io/sdk-solid 4.0.9 → 4.1.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/dev.js +74 -18
- package/lib/browser/dev.jsx +108 -52
- package/lib/browser/index.js +73 -18
- package/lib/browser/index.jsx +107 -52
- package/lib/edge/dev.js +74 -18
- package/lib/edge/dev.jsx +108 -52
- package/lib/edge/index.js +73 -18
- package/lib/edge/index.jsx +107 -52
- package/lib/node/dev.js +74 -18
- package/lib/node/dev.jsx +108 -52
- package/lib/node/index.js +73 -18
- package/lib/node/index.jsx +107 -52
- package/package.json +1 -1
package/lib/edge/dev.js
CHANGED
|
@@ -5498,8 +5498,8 @@ var DEFAULT_INDEX = "default";
|
|
|
5498
5498
|
var FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME = "filterWithCustomTargeting";
|
|
5499
5499
|
var BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME = "builderIoPersonalization";
|
|
5500
5500
|
var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "updateVisibilityStylesScript";
|
|
5501
|
-
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte"];
|
|
5502
|
-
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte"];
|
|
5501
|
+
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte", "qwik"];
|
|
5502
|
+
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte", "qwik"];
|
|
5503
5503
|
function checkShouldRenderVariants(variants, canTrack) {
|
|
5504
5504
|
const hasVariants = variants && variants.length > 0;
|
|
5505
5505
|
if (TARGET === "reactNative")
|
|
@@ -5757,6 +5757,11 @@ var handleABTesting = async ({
|
|
|
5757
5757
|
};
|
|
5758
5758
|
};
|
|
5759
5759
|
|
|
5760
|
+
// src/helpers/no-serialize-wrapper.ts
|
|
5761
|
+
function noSerializeWrapper(fn) {
|
|
5762
|
+
return fn;
|
|
5763
|
+
}
|
|
5764
|
+
|
|
5760
5765
|
// src/helpers/user-attributes.ts
|
|
5761
5766
|
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
5762
5767
|
function createUserAttributesService() {
|
|
@@ -5787,18 +5792,32 @@ function createUserAttributesService() {
|
|
|
5787
5792
|
canTrack
|
|
5788
5793
|
}) || "{}");
|
|
5789
5794
|
},
|
|
5790
|
-
subscribeOnUserAttributesChange(callback
|
|
5795
|
+
subscribeOnUserAttributesChange(callback, {
|
|
5796
|
+
fireImmediately
|
|
5797
|
+
} = {}) {
|
|
5791
5798
|
subscribers.add(callback);
|
|
5792
|
-
|
|
5799
|
+
if (fireImmediately) {
|
|
5800
|
+
callback(this.getUserAttributes());
|
|
5801
|
+
}
|
|
5802
|
+
return noSerializeWrapper(function() {
|
|
5793
5803
|
subscribers.delete(callback);
|
|
5794
|
-
};
|
|
5804
|
+
});
|
|
5795
5805
|
},
|
|
5796
5806
|
setCanTrack(value) {
|
|
5797
5807
|
canTrack = value;
|
|
5798
5808
|
}
|
|
5799
5809
|
};
|
|
5800
5810
|
}
|
|
5801
|
-
var
|
|
5811
|
+
var _userAttributesService;
|
|
5812
|
+
if (isBrowser() && TARGET === "qwik") {
|
|
5813
|
+
if (!window.__BUILDER_USER_ATTRIBUTES_SERVICE__) {
|
|
5814
|
+
window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = createUserAttributesService();
|
|
5815
|
+
}
|
|
5816
|
+
_userAttributesService = window.__BUILDER_USER_ATTRIBUTES_SERVICE__;
|
|
5817
|
+
} else {
|
|
5818
|
+
_userAttributesService = createUserAttributesService();
|
|
5819
|
+
}
|
|
5820
|
+
var userAttributesService = _userAttributesService;
|
|
5802
5821
|
var setClientUserAttributes = (attributes) => {
|
|
5803
5822
|
userAttributesService.setUserAttributes(attributes);
|
|
5804
5823
|
};
|
|
@@ -6654,6 +6673,8 @@ function PersonalizationContainer(props) {
|
|
|
6654
6673
|
setShouldResetVariants(true);
|
|
6655
6674
|
const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs2) => {
|
|
6656
6675
|
setUserAttributes(attrs2);
|
|
6676
|
+
}, {
|
|
6677
|
+
fireImmediately: TARGET === "qwik"
|
|
6657
6678
|
});
|
|
6658
6679
|
if (!(isEditing() || isPreviewing())) {
|
|
6659
6680
|
const variant = filteredVariants()[0];
|
|
@@ -7671,9 +7692,9 @@ function logFetch(url) {
|
|
|
7671
7692
|
}
|
|
7672
7693
|
|
|
7673
7694
|
// src/blocks/form/form/form.tsx
|
|
7674
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-
|
|
7695
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-7430044e">`);
|
|
7675
7696
|
var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
|
|
7676
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
7697
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-7430044e {
|
|
7677
7698
|
padding: 10px;
|
|
7678
7699
|
color: red;
|
|
7679
7700
|
text-align: center;
|
|
@@ -7785,6 +7806,15 @@ function FormComponent(props) {
|
|
|
7785
7806
|
}
|
|
7786
7807
|
}
|
|
7787
7808
|
setFormState("sending");
|
|
7809
|
+
if (props.sendSubmissionsTo === "email" && (props.sendSubmissionsToEmail === "your@email.com" || !props.sendSubmissionsToEmail)) {
|
|
7810
|
+
const message = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
|
|
7811
|
+
console.error(message);
|
|
7812
|
+
setFormState("error");
|
|
7813
|
+
mergeNewRootState({
|
|
7814
|
+
formErrorMessage: message
|
|
7815
|
+
});
|
|
7816
|
+
return;
|
|
7817
|
+
}
|
|
7788
7818
|
const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
|
|
7789
7819
|
const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
|
|
7790
7820
|
logFetch(url);
|
|
@@ -7800,17 +7830,30 @@ function FormComponent(props) {
|
|
|
7800
7830
|
} else {
|
|
7801
7831
|
body2 = await res.text();
|
|
7802
7832
|
}
|
|
7803
|
-
if (!res.ok
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7833
|
+
if (!res.ok) {
|
|
7834
|
+
const submitErrorEvent = new CustomEvent("submit:error", {
|
|
7835
|
+
detail: {
|
|
7836
|
+
error: body2,
|
|
7837
|
+
status: res.status
|
|
7808
7838
|
}
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7839
|
+
});
|
|
7840
|
+
if (formRef?.nativeElement) {
|
|
7841
|
+
formRef?.nativeElement.dispatchEvent(submitErrorEvent);
|
|
7842
|
+
if (submitErrorEvent.defaultPrevented) {
|
|
7843
|
+
return;
|
|
7844
|
+
}
|
|
7845
|
+
}
|
|
7846
|
+
setResponseData(body2);
|
|
7847
|
+
setFormState("error");
|
|
7848
|
+
let message = props.errorMessagePath ? get(body2, props.errorMessagePath) : body2.message || body2.error || body2;
|
|
7849
|
+
if (typeof message !== "string") {
|
|
7850
|
+
message = JSON.stringify(message);
|
|
7813
7851
|
}
|
|
7852
|
+
setFormErrorMessage(message);
|
|
7853
|
+
mergeNewRootState({
|
|
7854
|
+
formErrorMessage: message
|
|
7855
|
+
});
|
|
7856
|
+
return;
|
|
7814
7857
|
}
|
|
7815
7858
|
setResponseData(body2);
|
|
7816
7859
|
setFormState(res.ok ? "success" : "error");
|
|
@@ -8238,6 +8281,16 @@ var componentInfo19 = {
|
|
|
8238
8281
|
};
|
|
8239
8282
|
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
8240
8283
|
function ImgComponent(props) {
|
|
8284
|
+
const srcSetToUse = createMemo(() => {
|
|
8285
|
+
const url = props.imgSrc || props.image;
|
|
8286
|
+
if (!url || typeof url !== "string") {
|
|
8287
|
+
return void 0;
|
|
8288
|
+
}
|
|
8289
|
+
if (!url.match(/builder\.io/)) {
|
|
8290
|
+
return void 0;
|
|
8291
|
+
}
|
|
8292
|
+
return getSrcSet(url);
|
|
8293
|
+
});
|
|
8241
8294
|
return (() => {
|
|
8242
8295
|
const _el$ = _tmpl$20();
|
|
8243
8296
|
spread(_el$, mergeProps({
|
|
@@ -8255,6 +8308,9 @@ function ImgComponent(props) {
|
|
|
8255
8308
|
},
|
|
8256
8309
|
get src() {
|
|
8257
8310
|
return props.imgSrc || props.image;
|
|
8311
|
+
},
|
|
8312
|
+
get srcSet() {
|
|
8313
|
+
return srcSetToUse();
|
|
8258
8314
|
}
|
|
8259
8315
|
}, {}, () => props.attributes), false, false);
|
|
8260
8316
|
return _el$;
|
|
@@ -8626,7 +8682,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8626
8682
|
}
|
|
8627
8683
|
|
|
8628
8684
|
// src/constants/sdk-version.ts
|
|
8629
|
-
var SDK_VERSION = "4.0
|
|
8685
|
+
var SDK_VERSION = "4.1.0";
|
|
8630
8686
|
|
|
8631
8687
|
// src/helpers/sdk-headers.ts
|
|
8632
8688
|
var getSdkHeaders = () => ({
|
package/lib/edge/dev.jsx
CHANGED
|
@@ -5165,10 +5165,10 @@ function SectionComponent(props) {
|
|
|
5165
5165
|
var section_default = SectionComponent;
|
|
5166
5166
|
|
|
5167
5167
|
// src/blocks/symbol/symbol.tsx
|
|
5168
|
-
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as
|
|
5168
|
+
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
|
|
5169
5169
|
|
|
5170
5170
|
// src/components/content-variants/content-variants.tsx
|
|
5171
|
-
import { Show as Show16, For as For9, onMount as onMount9, createSignal as
|
|
5171
|
+
import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
|
|
5172
5172
|
|
|
5173
5173
|
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
5174
5174
|
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
@@ -5259,8 +5259,8 @@ var DEFAULT_INDEX = "default";
|
|
|
5259
5259
|
var FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME = "filterWithCustomTargeting";
|
|
5260
5260
|
var BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME = "builderIoPersonalization";
|
|
5261
5261
|
var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "updateVisibilityStylesScript";
|
|
5262
|
-
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte"];
|
|
5263
|
-
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte"];
|
|
5262
|
+
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte", "qwik"];
|
|
5263
|
+
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte", "qwik"];
|
|
5264
5264
|
function checkShouldRenderVariants(variants, canTrack) {
|
|
5265
5265
|
const hasVariants = variants && variants.length > 0;
|
|
5266
5266
|
if (TARGET === "reactNative")
|
|
@@ -5518,6 +5518,11 @@ var handleABTesting = async ({
|
|
|
5518
5518
|
};
|
|
5519
5519
|
};
|
|
5520
5520
|
|
|
5521
|
+
// src/helpers/no-serialize-wrapper.ts
|
|
5522
|
+
function noSerializeWrapper(fn) {
|
|
5523
|
+
return fn;
|
|
5524
|
+
}
|
|
5525
|
+
|
|
5521
5526
|
// src/helpers/user-attributes.ts
|
|
5522
5527
|
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
5523
5528
|
function createUserAttributesService() {
|
|
@@ -5548,18 +5553,32 @@ function createUserAttributesService() {
|
|
|
5548
5553
|
canTrack
|
|
5549
5554
|
}) || "{}");
|
|
5550
5555
|
},
|
|
5551
|
-
subscribeOnUserAttributesChange(callback
|
|
5556
|
+
subscribeOnUserAttributesChange(callback, {
|
|
5557
|
+
fireImmediately
|
|
5558
|
+
} = {}) {
|
|
5552
5559
|
subscribers.add(callback);
|
|
5553
|
-
|
|
5560
|
+
if (fireImmediately) {
|
|
5561
|
+
callback(this.getUserAttributes());
|
|
5562
|
+
}
|
|
5563
|
+
return noSerializeWrapper(function() {
|
|
5554
5564
|
subscribers.delete(callback);
|
|
5555
|
-
};
|
|
5565
|
+
});
|
|
5556
5566
|
},
|
|
5557
5567
|
setCanTrack(value) {
|
|
5558
5568
|
canTrack = value;
|
|
5559
5569
|
}
|
|
5560
5570
|
};
|
|
5561
5571
|
}
|
|
5562
|
-
var
|
|
5572
|
+
var _userAttributesService;
|
|
5573
|
+
if (isBrowser() && TARGET === "qwik") {
|
|
5574
|
+
if (!window.__BUILDER_USER_ATTRIBUTES_SERVICE__) {
|
|
5575
|
+
window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = createUserAttributesService();
|
|
5576
|
+
}
|
|
5577
|
+
_userAttributesService = window.__BUILDER_USER_ATTRIBUTES_SERVICE__;
|
|
5578
|
+
} else {
|
|
5579
|
+
_userAttributesService = createUserAttributesService();
|
|
5580
|
+
}
|
|
5581
|
+
var userAttributesService = _userAttributesService;
|
|
5563
5582
|
var setClientUserAttributes = (attributes) => {
|
|
5564
5583
|
userAttributesService.setUserAttributes(attributes);
|
|
5565
5584
|
};
|
|
@@ -5572,7 +5591,7 @@ var getDefaultCanTrack = (canTrack) => {
|
|
|
5572
5591
|
};
|
|
5573
5592
|
|
|
5574
5593
|
// src/components/content/content.tsx
|
|
5575
|
-
import { Show as Show15, createSignal as
|
|
5594
|
+
import { Show as Show15, createSignal as createSignal19 } from "solid-js";
|
|
5576
5595
|
|
|
5577
5596
|
// src/blocks/accordion/component-info.ts
|
|
5578
5597
|
var defaultTitle = {
|
|
@@ -6402,6 +6421,9 @@ function PersonalizationContainer(props) {
|
|
|
6402
6421
|
const unsub = userAttributesService.subscribeOnUserAttributesChange(
|
|
6403
6422
|
(attrs2) => {
|
|
6404
6423
|
setUserAttributes(attrs2);
|
|
6424
|
+
},
|
|
6425
|
+
{
|
|
6426
|
+
fireImmediately: TARGET === "qwik"
|
|
6405
6427
|
}
|
|
6406
6428
|
);
|
|
6407
6429
|
if (!(isEditing() || isPreviewing())) {
|
|
@@ -7382,6 +7404,15 @@ function FormComponent(props) {
|
|
|
7382
7404
|
}
|
|
7383
7405
|
}
|
|
7384
7406
|
setFormState("sending");
|
|
7407
|
+
if (props.sendSubmissionsTo === "email" && (props.sendSubmissionsToEmail === "your@email.com" || !props.sendSubmissionsToEmail)) {
|
|
7408
|
+
const message = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
|
|
7409
|
+
console.error(message);
|
|
7410
|
+
setFormState("error");
|
|
7411
|
+
mergeNewRootState({
|
|
7412
|
+
formErrorMessage: message
|
|
7413
|
+
});
|
|
7414
|
+
return;
|
|
7415
|
+
}
|
|
7385
7416
|
const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(
|
|
7386
7417
|
props.sendSubmissionsToEmail || ""
|
|
7387
7418
|
)}&name=${encodeURIComponent(props.name || "")}`;
|
|
@@ -7400,17 +7431,30 @@ function FormComponent(props) {
|
|
|
7400
7431
|
} else {
|
|
7401
7432
|
body2 = await res.text();
|
|
7402
7433
|
}
|
|
7403
|
-
if (!res.ok
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7434
|
+
if (!res.ok) {
|
|
7435
|
+
const submitErrorEvent = new CustomEvent("submit:error", {
|
|
7436
|
+
detail: {
|
|
7437
|
+
error: body2,
|
|
7438
|
+
status: res.status
|
|
7439
|
+
}
|
|
7440
|
+
});
|
|
7441
|
+
if (formRef?.nativeElement) {
|
|
7442
|
+
formRef?.nativeElement.dispatchEvent(submitErrorEvent);
|
|
7443
|
+
if (submitErrorEvent.defaultPrevented) {
|
|
7444
|
+
return;
|
|
7408
7445
|
}
|
|
7409
|
-
setFormErrorMessage(message);
|
|
7410
|
-
mergeNewRootState({
|
|
7411
|
-
formErrorMessage: message
|
|
7412
|
-
});
|
|
7413
7446
|
}
|
|
7447
|
+
setResponseData(body2);
|
|
7448
|
+
setFormState("error");
|
|
7449
|
+
let message = props.errorMessagePath ? get(body2, props.errorMessagePath) : body2.message || body2.error || body2;
|
|
7450
|
+
if (typeof message !== "string") {
|
|
7451
|
+
message = JSON.stringify(message);
|
|
7452
|
+
}
|
|
7453
|
+
setFormErrorMessage(message);
|
|
7454
|
+
mergeNewRootState({
|
|
7455
|
+
formErrorMessage: message
|
|
7456
|
+
});
|
|
7457
|
+
return;
|
|
7414
7458
|
}
|
|
7415
7459
|
setResponseData(body2);
|
|
7416
7460
|
setFormState(res.ok ? "success" : "error");
|
|
@@ -7489,14 +7533,14 @@ function FormComponent(props) {
|
|
|
7489
7533
|
blocks={props.sendingMessage}
|
|
7490
7534
|
context={props.builderContext}
|
|
7491
7535
|
/></Show12>
|
|
7492
|
-
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-
|
|
7536
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-7430044e">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
|
|
7493
7537
|
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
7494
7538
|
path="successMessage"
|
|
7495
7539
|
blocks={props.successMessage}
|
|
7496
7540
|
context={props.builderContext}
|
|
7497
7541
|
/></Show12>
|
|
7498
7542
|
</form>
|
|
7499
|
-
<style>{`.pre-
|
|
7543
|
+
<style>{`.pre-7430044e {
|
|
7500
7544
|
padding: 10px;
|
|
7501
7545
|
color: red;
|
|
7502
7546
|
text-align: center;
|
|
@@ -7743,7 +7787,18 @@ var componentInfo19 = {
|
|
|
7743
7787
|
};
|
|
7744
7788
|
|
|
7745
7789
|
// src/blocks/img/img.tsx
|
|
7790
|
+
import { createMemo as createMemo15 } from "solid-js";
|
|
7746
7791
|
function ImgComponent(props) {
|
|
7792
|
+
const srcSetToUse = createMemo15(() => {
|
|
7793
|
+
const url = props.imgSrc || props.image;
|
|
7794
|
+
if (!url || typeof url !== "string") {
|
|
7795
|
+
return void 0;
|
|
7796
|
+
}
|
|
7797
|
+
if (!url.match(/builder\.io/)) {
|
|
7798
|
+
return void 0;
|
|
7799
|
+
}
|
|
7800
|
+
return getSrcSet(url);
|
|
7801
|
+
});
|
|
7747
7802
|
return <><img
|
|
7748
7803
|
style={{
|
|
7749
7804
|
"object-fit": props.backgroundSize || "cover",
|
|
@@ -7752,6 +7807,7 @@ function ImgComponent(props) {
|
|
|
7752
7807
|
key={isEditing() && props.imgSrc || "default-key"}
|
|
7753
7808
|
alt={props.altText}
|
|
7754
7809
|
src={props.imgSrc || props.image}
|
|
7810
|
+
srcSet={srcSetToUse()}
|
|
7755
7811
|
{...{}}
|
|
7756
7812
|
{...props.attributes}
|
|
7757
7813
|
/></>;
|
|
@@ -7846,10 +7902,10 @@ var componentInfo20 = {
|
|
|
7846
7902
|
};
|
|
7847
7903
|
|
|
7848
7904
|
// src/blocks/video/video.tsx
|
|
7849
|
-
import { Show as Show13, onMount as onMount7, createSignal as
|
|
7905
|
+
import { Show as Show13, onMount as onMount7, createSignal as createSignal16, createMemo as createMemo16 } from "solid-js";
|
|
7850
7906
|
function Video(props) {
|
|
7851
|
-
const [lazyVideoObserver, setLazyVideoObserver] =
|
|
7852
|
-
const videoProps =
|
|
7907
|
+
const [lazyVideoObserver, setLazyVideoObserver] = createSignal16(void 0);
|
|
7908
|
+
const videoProps = createMemo16(() => {
|
|
7853
7909
|
return {
|
|
7854
7910
|
...props.autoPlay === true ? {
|
|
7855
7911
|
autoPlay: true
|
|
@@ -7868,7 +7924,7 @@ function Video(props) {
|
|
|
7868
7924
|
} : {}
|
|
7869
7925
|
};
|
|
7870
7926
|
});
|
|
7871
|
-
const spreadProps =
|
|
7927
|
+
const spreadProps = createMemo16(() => {
|
|
7872
7928
|
return {
|
|
7873
7929
|
...videoProps()
|
|
7874
7930
|
};
|
|
@@ -8108,8 +8164,8 @@ import {
|
|
|
8108
8164
|
onMount as onMount8,
|
|
8109
8165
|
on as on8,
|
|
8110
8166
|
createEffect as createEffect8,
|
|
8111
|
-
createMemo as
|
|
8112
|
-
createSignal as
|
|
8167
|
+
createMemo as createMemo17,
|
|
8168
|
+
createSignal as createSignal17
|
|
8113
8169
|
} from "solid-js";
|
|
8114
8170
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
8115
8171
|
|
|
@@ -8119,7 +8175,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8119
8175
|
}
|
|
8120
8176
|
|
|
8121
8177
|
// src/constants/sdk-version.ts
|
|
8122
|
-
var SDK_VERSION = "4.0
|
|
8178
|
+
var SDK_VERSION = "4.1.0";
|
|
8123
8179
|
|
|
8124
8180
|
// src/helpers/sdk-headers.ts
|
|
8125
8181
|
var getSdkHeaders = () => ({
|
|
@@ -8980,13 +9036,13 @@ var getWrapperClassName = (variationId) => {
|
|
|
8980
9036
|
|
|
8981
9037
|
// src/components/content/components/enable-editor.tsx
|
|
8982
9038
|
function EnableEditor(props) {
|
|
8983
|
-
const [hasExecuted, setHasExecuted] =
|
|
8984
|
-
const [ContentWrapper, setContentWrapper] =
|
|
9039
|
+
const [hasExecuted, setHasExecuted] = createSignal17(false);
|
|
9040
|
+
const [ContentWrapper, setContentWrapper] = createSignal17(
|
|
8985
9041
|
props.contentWrapper || "div"
|
|
8986
9042
|
);
|
|
8987
|
-
const [httpReqsData, setHttpReqsData] =
|
|
8988
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
8989
|
-
const [clicked, setClicked] =
|
|
9043
|
+
const [httpReqsData, setHttpReqsData] = createSignal17({});
|
|
9044
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal17({});
|
|
9045
|
+
const [clicked, setClicked] = createSignal17(false);
|
|
8990
9046
|
function mergeNewRootState(newData) {
|
|
8991
9047
|
const combinedState = {
|
|
8992
9048
|
...props.builderContextSignal.rootState,
|
|
@@ -9020,7 +9076,7 @@ function EnableEditor(props) {
|
|
|
9020
9076
|
content: newContentValue
|
|
9021
9077
|
}));
|
|
9022
9078
|
}
|
|
9023
|
-
const showContentProps =
|
|
9079
|
+
const showContentProps = createMemo17(() => {
|
|
9024
9080
|
return props.showContent ? {} : {
|
|
9025
9081
|
hidden: true,
|
|
9026
9082
|
"aria-hidden": true
|
|
@@ -9205,14 +9261,14 @@ function EnableEditor(props) {
|
|
|
9205
9261
|
}
|
|
9206
9262
|
}
|
|
9207
9263
|
});
|
|
9208
|
-
const onUpdateFn_0_props_content =
|
|
9264
|
+
const onUpdateFn_0_props_content = createMemo17(() => props.content);
|
|
9209
9265
|
function onUpdateFn_0() {
|
|
9210
9266
|
if (props.content) {
|
|
9211
9267
|
mergeNewContent(props.content);
|
|
9212
9268
|
}
|
|
9213
9269
|
}
|
|
9214
9270
|
createEffect8(on8(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
9215
|
-
const onUpdateFn_1_props_builderContextSignal_rootState =
|
|
9271
|
+
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
|
|
9216
9272
|
() => props.builderContextSignal.rootState
|
|
9217
9273
|
);
|
|
9218
9274
|
function onUpdateFn_1() {
|
|
@@ -9224,14 +9280,14 @@ function EnableEditor(props) {
|
|
|
9224
9280
|
onUpdateFn_1
|
|
9225
9281
|
)
|
|
9226
9282
|
);
|
|
9227
|
-
const onUpdateFn_2_props_data =
|
|
9283
|
+
const onUpdateFn_2_props_data = createMemo17(() => props.data);
|
|
9228
9284
|
function onUpdateFn_2() {
|
|
9229
9285
|
if (props.data) {
|
|
9230
9286
|
mergeNewRootState(props.data);
|
|
9231
9287
|
}
|
|
9232
9288
|
}
|
|
9233
9289
|
createEffect8(on8(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
9234
|
-
const onUpdateFn_3_props_locale =
|
|
9290
|
+
const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
|
|
9235
9291
|
function onUpdateFn_3() {
|
|
9236
9292
|
if (props.locale) {
|
|
9237
9293
|
mergeNewRootState({
|
|
@@ -9263,9 +9319,9 @@ function EnableEditor(props) {
|
|
|
9263
9319
|
var Enable_editor_default = EnableEditor;
|
|
9264
9320
|
|
|
9265
9321
|
// src/components/content/components/styles.tsx
|
|
9266
|
-
import { createSignal as
|
|
9322
|
+
import { createSignal as createSignal18 } from "solid-js";
|
|
9267
9323
|
function ContentStyles(props) {
|
|
9268
|
-
const [injectedStyles, setInjectedStyles] =
|
|
9324
|
+
const [injectedStyles, setInjectedStyles] = createSignal18(
|
|
9269
9325
|
`
|
|
9270
9326
|
${getCss({
|
|
9271
9327
|
cssCode: props.cssCode,
|
|
@@ -9323,7 +9379,7 @@ var getContentInitialValue = ({
|
|
|
9323
9379
|
|
|
9324
9380
|
// src/components/content/content.tsx
|
|
9325
9381
|
function ContentComponent(props) {
|
|
9326
|
-
const [scriptStr, setScriptStr] =
|
|
9382
|
+
const [scriptStr, setScriptStr] = createSignal19(
|
|
9327
9383
|
getUpdateVariantVisibilityScript({
|
|
9328
9384
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
9329
9385
|
variationId: props.content?.testVariationId,
|
|
@@ -9331,7 +9387,7 @@ function ContentComponent(props) {
|
|
|
9331
9387
|
contentId: props.content?.id
|
|
9332
9388
|
})
|
|
9333
9389
|
);
|
|
9334
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
9390
|
+
const [registeredComponents, setRegisteredComponents] = createSignal19(
|
|
9335
9391
|
[
|
|
9336
9392
|
...getDefaultRegisteredComponents(),
|
|
9337
9393
|
...props.customComponents || []
|
|
@@ -9346,7 +9402,7 @@ function ContentComponent(props) {
|
|
|
9346
9402
|
{}
|
|
9347
9403
|
)
|
|
9348
9404
|
);
|
|
9349
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
9405
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal19({
|
|
9350
9406
|
content: getContentInitialValue({
|
|
9351
9407
|
content: props.content,
|
|
9352
9408
|
data: props.data
|
|
@@ -9454,13 +9510,13 @@ var Content_default = ContentComponent;
|
|
|
9454
9510
|
|
|
9455
9511
|
// src/components/content-variants/content-variants.tsx
|
|
9456
9512
|
function ContentVariants(props) {
|
|
9457
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
9513
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal20(
|
|
9458
9514
|
checkShouldRenderVariants2({
|
|
9459
9515
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
9460
9516
|
content: props.content
|
|
9461
9517
|
})
|
|
9462
9518
|
);
|
|
9463
|
-
const updateCookieAndStylesScriptStr =
|
|
9519
|
+
const updateCookieAndStylesScriptStr = createMemo20(() => {
|
|
9464
9520
|
return getUpdateCookieAndStylesScript(
|
|
9465
9521
|
getVariants(props.content).map((value) => ({
|
|
9466
9522
|
id: value.testVariationId,
|
|
@@ -9469,10 +9525,10 @@ function ContentVariants(props) {
|
|
|
9469
9525
|
props.content?.id || ""
|
|
9470
9526
|
);
|
|
9471
9527
|
});
|
|
9472
|
-
const hideVariantsStyleString =
|
|
9528
|
+
const hideVariantsStyleString = createMemo20(() => {
|
|
9473
9529
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
9474
9530
|
});
|
|
9475
|
-
const defaultContent =
|
|
9531
|
+
const defaultContent = createMemo20(() => {
|
|
9476
9532
|
return shouldRenderVariants() ? {
|
|
9477
9533
|
...props.content,
|
|
9478
9534
|
testVariationId: props.content?.id
|
|
@@ -9591,15 +9647,15 @@ var fetchSymbolContent = async ({
|
|
|
9591
9647
|
|
|
9592
9648
|
// src/blocks/symbol/symbol.tsx
|
|
9593
9649
|
function Symbol2(props) {
|
|
9594
|
-
const [contentToUse, setContentToUse] =
|
|
9595
|
-
const [symbolEntry, setSymbolEntry] =
|
|
9596
|
-
const blocksWrapper =
|
|
9650
|
+
const [contentToUse, setContentToUse] = createSignal21(props.symbol?.content);
|
|
9651
|
+
const [symbolEntry, setSymbolEntry] = createSignal21(props.symbol?.entry);
|
|
9652
|
+
const blocksWrapper = createMemo21(() => {
|
|
9597
9653
|
return "div";
|
|
9598
9654
|
});
|
|
9599
|
-
const contentWrapper =
|
|
9655
|
+
const contentWrapper = createMemo21(() => {
|
|
9600
9656
|
return "div";
|
|
9601
9657
|
});
|
|
9602
|
-
const className =
|
|
9658
|
+
const className = createMemo21(() => {
|
|
9603
9659
|
return [
|
|
9604
9660
|
...[props.attributes[getClassPropName()]],
|
|
9605
9661
|
"builder-symbol",
|
|
@@ -9622,7 +9678,7 @@ function Symbol2(props) {
|
|
|
9622
9678
|
}
|
|
9623
9679
|
onMount10(() => {
|
|
9624
9680
|
});
|
|
9625
|
-
const onUpdateFn_0_props_symbol =
|
|
9681
|
+
const onUpdateFn_0_props_symbol = createMemo21(() => props.symbol);
|
|
9626
9682
|
function onUpdateFn_0() {
|
|
9627
9683
|
setContent();
|
|
9628
9684
|
}
|