@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/index.js
CHANGED
|
@@ -5488,8 +5488,8 @@ var DEFAULT_INDEX = "default";
|
|
|
5488
5488
|
var FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME = "filterWithCustomTargeting";
|
|
5489
5489
|
var BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME = "builderIoPersonalization";
|
|
5490
5490
|
var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "updateVisibilityStylesScript";
|
|
5491
|
-
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte"];
|
|
5492
|
-
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte"];
|
|
5491
|
+
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte", "qwik"];
|
|
5492
|
+
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte", "qwik"];
|
|
5493
5493
|
function checkShouldRenderVariants(variants, canTrack) {
|
|
5494
5494
|
const hasVariants = variants && variants.length > 0;
|
|
5495
5495
|
if (TARGET === "reactNative")
|
|
@@ -5747,6 +5747,11 @@ var handleABTesting = async ({
|
|
|
5747
5747
|
};
|
|
5748
5748
|
};
|
|
5749
5749
|
|
|
5750
|
+
// src/helpers/no-serialize-wrapper.ts
|
|
5751
|
+
function noSerializeWrapper(fn) {
|
|
5752
|
+
return fn;
|
|
5753
|
+
}
|
|
5754
|
+
|
|
5750
5755
|
// src/helpers/user-attributes.ts
|
|
5751
5756
|
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
5752
5757
|
function createUserAttributesService() {
|
|
@@ -5777,18 +5782,32 @@ function createUserAttributesService() {
|
|
|
5777
5782
|
canTrack
|
|
5778
5783
|
}) || "{}");
|
|
5779
5784
|
},
|
|
5780
|
-
subscribeOnUserAttributesChange(callback
|
|
5785
|
+
subscribeOnUserAttributesChange(callback, {
|
|
5786
|
+
fireImmediately
|
|
5787
|
+
} = {}) {
|
|
5781
5788
|
subscribers.add(callback);
|
|
5782
|
-
|
|
5789
|
+
if (fireImmediately) {
|
|
5790
|
+
callback(this.getUserAttributes());
|
|
5791
|
+
}
|
|
5792
|
+
return noSerializeWrapper(function() {
|
|
5783
5793
|
subscribers.delete(callback);
|
|
5784
|
-
};
|
|
5794
|
+
});
|
|
5785
5795
|
},
|
|
5786
5796
|
setCanTrack(value) {
|
|
5787
5797
|
canTrack = value;
|
|
5788
5798
|
}
|
|
5789
5799
|
};
|
|
5790
5800
|
}
|
|
5791
|
-
var
|
|
5801
|
+
var _userAttributesService;
|
|
5802
|
+
if (isBrowser() && TARGET === "qwik") {
|
|
5803
|
+
if (!window.__BUILDER_USER_ATTRIBUTES_SERVICE__) {
|
|
5804
|
+
window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = createUserAttributesService();
|
|
5805
|
+
}
|
|
5806
|
+
_userAttributesService = window.__BUILDER_USER_ATTRIBUTES_SERVICE__;
|
|
5807
|
+
} else {
|
|
5808
|
+
_userAttributesService = createUserAttributesService();
|
|
5809
|
+
}
|
|
5810
|
+
var userAttributesService = _userAttributesService;
|
|
5792
5811
|
var setClientUserAttributes = (attributes) => {
|
|
5793
5812
|
userAttributesService.setUserAttributes(attributes);
|
|
5794
5813
|
};
|
|
@@ -6643,6 +6662,8 @@ function PersonalizationContainer(props) {
|
|
|
6643
6662
|
setShouldResetVariants(true);
|
|
6644
6663
|
const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs2) => {
|
|
6645
6664
|
setUserAttributes(attrs2);
|
|
6665
|
+
}, {
|
|
6666
|
+
fireImmediately: TARGET === "qwik"
|
|
6646
6667
|
});
|
|
6647
6668
|
if (!(isEditing() || isPreviewing())) {
|
|
6648
6669
|
const variant = filteredVariants()[0];
|
|
@@ -7660,9 +7681,9 @@ function logFetch(url) {
|
|
|
7660
7681
|
}
|
|
7661
7682
|
|
|
7662
7683
|
// src/blocks/form/form/form.tsx
|
|
7663
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-
|
|
7684
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-7430044e">`);
|
|
7664
7685
|
var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
|
|
7665
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
7686
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-7430044e {
|
|
7666
7687
|
padding: 10px;
|
|
7667
7688
|
color: red;
|
|
7668
7689
|
text-align: center;
|
|
@@ -7774,6 +7795,14 @@ function FormComponent(props) {
|
|
|
7774
7795
|
}
|
|
7775
7796
|
}
|
|
7776
7797
|
setFormState("sending");
|
|
7798
|
+
if (props.sendSubmissionsTo === "email" && (props.sendSubmissionsToEmail === "your@email.com" || !props.sendSubmissionsToEmail)) {
|
|
7799
|
+
const message = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
|
|
7800
|
+
setFormState("error");
|
|
7801
|
+
mergeNewRootState({
|
|
7802
|
+
formErrorMessage: message
|
|
7803
|
+
});
|
|
7804
|
+
return;
|
|
7805
|
+
}
|
|
7777
7806
|
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 || "")}`;
|
|
7778
7807
|
const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
|
|
7779
7808
|
logFetch(url);
|
|
@@ -7789,17 +7818,30 @@ function FormComponent(props) {
|
|
|
7789
7818
|
} else {
|
|
7790
7819
|
body2 = await res.text();
|
|
7791
7820
|
}
|
|
7792
|
-
if (!res.ok
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7821
|
+
if (!res.ok) {
|
|
7822
|
+
const submitErrorEvent = new CustomEvent("submit:error", {
|
|
7823
|
+
detail: {
|
|
7824
|
+
error: body2,
|
|
7825
|
+
status: res.status
|
|
7797
7826
|
}
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7827
|
+
});
|
|
7828
|
+
if (formRef?.nativeElement) {
|
|
7829
|
+
formRef?.nativeElement.dispatchEvent(submitErrorEvent);
|
|
7830
|
+
if (submitErrorEvent.defaultPrevented) {
|
|
7831
|
+
return;
|
|
7832
|
+
}
|
|
7833
|
+
}
|
|
7834
|
+
setResponseData(body2);
|
|
7835
|
+
setFormState("error");
|
|
7836
|
+
let message = props.errorMessagePath ? get(body2, props.errorMessagePath) : body2.message || body2.error || body2;
|
|
7837
|
+
if (typeof message !== "string") {
|
|
7838
|
+
message = JSON.stringify(message);
|
|
7802
7839
|
}
|
|
7840
|
+
setFormErrorMessage(message);
|
|
7841
|
+
mergeNewRootState({
|
|
7842
|
+
formErrorMessage: message
|
|
7843
|
+
});
|
|
7844
|
+
return;
|
|
7803
7845
|
}
|
|
7804
7846
|
setResponseData(body2);
|
|
7805
7847
|
setFormState(res.ok ? "success" : "error");
|
|
@@ -8227,6 +8269,16 @@ var componentInfo19 = {
|
|
|
8227
8269
|
};
|
|
8228
8270
|
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
8229
8271
|
function ImgComponent(props) {
|
|
8272
|
+
const srcSetToUse = createMemo(() => {
|
|
8273
|
+
const url = props.imgSrc || props.image;
|
|
8274
|
+
if (!url || typeof url !== "string") {
|
|
8275
|
+
return void 0;
|
|
8276
|
+
}
|
|
8277
|
+
if (!url.match(/builder\.io/)) {
|
|
8278
|
+
return void 0;
|
|
8279
|
+
}
|
|
8280
|
+
return getSrcSet(url);
|
|
8281
|
+
});
|
|
8230
8282
|
return (() => {
|
|
8231
8283
|
const _el$ = _tmpl$20();
|
|
8232
8284
|
spread(_el$, mergeProps({
|
|
@@ -8244,6 +8296,9 @@ function ImgComponent(props) {
|
|
|
8244
8296
|
},
|
|
8245
8297
|
get src() {
|
|
8246
8298
|
return props.imgSrc || props.image;
|
|
8299
|
+
},
|
|
8300
|
+
get srcSet() {
|
|
8301
|
+
return srcSetToUse();
|
|
8247
8302
|
}
|
|
8248
8303
|
}, {}, () => props.attributes), false, false);
|
|
8249
8304
|
return _el$;
|
|
@@ -8614,7 +8669,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8614
8669
|
}
|
|
8615
8670
|
|
|
8616
8671
|
// src/constants/sdk-version.ts
|
|
8617
|
-
var SDK_VERSION = "4.0
|
|
8672
|
+
var SDK_VERSION = "4.1.0";
|
|
8618
8673
|
|
|
8619
8674
|
// src/helpers/sdk-headers.ts
|
|
8620
8675
|
var getSdkHeaders = () => ({
|
package/lib/edge/index.jsx
CHANGED
|
@@ -5157,10 +5157,10 @@ function SectionComponent(props) {
|
|
|
5157
5157
|
var section_default = SectionComponent;
|
|
5158
5158
|
|
|
5159
5159
|
// src/blocks/symbol/symbol.tsx
|
|
5160
|
-
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as
|
|
5160
|
+
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
|
|
5161
5161
|
|
|
5162
5162
|
// src/components/content-variants/content-variants.tsx
|
|
5163
|
-
import { Show as Show16, For as For9, onMount as onMount9, createSignal as
|
|
5163
|
+
import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
|
|
5164
5164
|
|
|
5165
5165
|
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
5166
5166
|
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
@@ -5251,8 +5251,8 @@ var DEFAULT_INDEX = "default";
|
|
|
5251
5251
|
var FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME = "filterWithCustomTargeting";
|
|
5252
5252
|
var BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME = "builderIoPersonalization";
|
|
5253
5253
|
var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "updateVisibilityStylesScript";
|
|
5254
|
-
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte"];
|
|
5255
|
-
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte"];
|
|
5254
|
+
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte", "qwik"];
|
|
5255
|
+
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte", "qwik"];
|
|
5256
5256
|
function checkShouldRenderVariants(variants, canTrack) {
|
|
5257
5257
|
const hasVariants = variants && variants.length > 0;
|
|
5258
5258
|
if (TARGET === "reactNative")
|
|
@@ -5510,6 +5510,11 @@ var handleABTesting = async ({
|
|
|
5510
5510
|
};
|
|
5511
5511
|
};
|
|
5512
5512
|
|
|
5513
|
+
// src/helpers/no-serialize-wrapper.ts
|
|
5514
|
+
function noSerializeWrapper(fn) {
|
|
5515
|
+
return fn;
|
|
5516
|
+
}
|
|
5517
|
+
|
|
5513
5518
|
// src/helpers/user-attributes.ts
|
|
5514
5519
|
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
5515
5520
|
function createUserAttributesService() {
|
|
@@ -5540,18 +5545,32 @@ function createUserAttributesService() {
|
|
|
5540
5545
|
canTrack
|
|
5541
5546
|
}) || "{}");
|
|
5542
5547
|
},
|
|
5543
|
-
subscribeOnUserAttributesChange(callback
|
|
5548
|
+
subscribeOnUserAttributesChange(callback, {
|
|
5549
|
+
fireImmediately
|
|
5550
|
+
} = {}) {
|
|
5544
5551
|
subscribers.add(callback);
|
|
5545
|
-
|
|
5552
|
+
if (fireImmediately) {
|
|
5553
|
+
callback(this.getUserAttributes());
|
|
5554
|
+
}
|
|
5555
|
+
return noSerializeWrapper(function() {
|
|
5546
5556
|
subscribers.delete(callback);
|
|
5547
|
-
};
|
|
5557
|
+
});
|
|
5548
5558
|
},
|
|
5549
5559
|
setCanTrack(value) {
|
|
5550
5560
|
canTrack = value;
|
|
5551
5561
|
}
|
|
5552
5562
|
};
|
|
5553
5563
|
}
|
|
5554
|
-
var
|
|
5564
|
+
var _userAttributesService;
|
|
5565
|
+
if (isBrowser() && TARGET === "qwik") {
|
|
5566
|
+
if (!window.__BUILDER_USER_ATTRIBUTES_SERVICE__) {
|
|
5567
|
+
window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = createUserAttributesService();
|
|
5568
|
+
}
|
|
5569
|
+
_userAttributesService = window.__BUILDER_USER_ATTRIBUTES_SERVICE__;
|
|
5570
|
+
} else {
|
|
5571
|
+
_userAttributesService = createUserAttributesService();
|
|
5572
|
+
}
|
|
5573
|
+
var userAttributesService = _userAttributesService;
|
|
5555
5574
|
var setClientUserAttributes = (attributes) => {
|
|
5556
5575
|
userAttributesService.setUserAttributes(attributes);
|
|
5557
5576
|
};
|
|
@@ -5564,7 +5583,7 @@ var getDefaultCanTrack = (canTrack) => {
|
|
|
5564
5583
|
};
|
|
5565
5584
|
|
|
5566
5585
|
// src/components/content/content.tsx
|
|
5567
|
-
import { Show as Show15, createSignal as
|
|
5586
|
+
import { Show as Show15, createSignal as createSignal19 } from "solid-js";
|
|
5568
5587
|
|
|
5569
5588
|
// src/blocks/accordion/component-info.ts
|
|
5570
5589
|
var defaultTitle = {
|
|
@@ -6393,6 +6412,9 @@ function PersonalizationContainer(props) {
|
|
|
6393
6412
|
const unsub = userAttributesService.subscribeOnUserAttributesChange(
|
|
6394
6413
|
(attrs2) => {
|
|
6395
6414
|
setUserAttributes(attrs2);
|
|
6415
|
+
},
|
|
6416
|
+
{
|
|
6417
|
+
fireImmediately: TARGET === "qwik"
|
|
6396
6418
|
}
|
|
6397
6419
|
);
|
|
6398
6420
|
if (!(isEditing() || isPreviewing())) {
|
|
@@ -7373,6 +7395,14 @@ function FormComponent(props) {
|
|
|
7373
7395
|
}
|
|
7374
7396
|
}
|
|
7375
7397
|
setFormState("sending");
|
|
7398
|
+
if (props.sendSubmissionsTo === "email" && (props.sendSubmissionsToEmail === "your@email.com" || !props.sendSubmissionsToEmail)) {
|
|
7399
|
+
const message = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
|
|
7400
|
+
setFormState("error");
|
|
7401
|
+
mergeNewRootState({
|
|
7402
|
+
formErrorMessage: message
|
|
7403
|
+
});
|
|
7404
|
+
return;
|
|
7405
|
+
}
|
|
7376
7406
|
const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(
|
|
7377
7407
|
props.sendSubmissionsToEmail || ""
|
|
7378
7408
|
)}&name=${encodeURIComponent(props.name || "")}`;
|
|
@@ -7391,17 +7421,30 @@ function FormComponent(props) {
|
|
|
7391
7421
|
} else {
|
|
7392
7422
|
body2 = await res.text();
|
|
7393
7423
|
}
|
|
7394
|
-
if (!res.ok
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7424
|
+
if (!res.ok) {
|
|
7425
|
+
const submitErrorEvent = new CustomEvent("submit:error", {
|
|
7426
|
+
detail: {
|
|
7427
|
+
error: body2,
|
|
7428
|
+
status: res.status
|
|
7429
|
+
}
|
|
7430
|
+
});
|
|
7431
|
+
if (formRef?.nativeElement) {
|
|
7432
|
+
formRef?.nativeElement.dispatchEvent(submitErrorEvent);
|
|
7433
|
+
if (submitErrorEvent.defaultPrevented) {
|
|
7434
|
+
return;
|
|
7399
7435
|
}
|
|
7400
|
-
setFormErrorMessage(message);
|
|
7401
|
-
mergeNewRootState({
|
|
7402
|
-
formErrorMessage: message
|
|
7403
|
-
});
|
|
7404
7436
|
}
|
|
7437
|
+
setResponseData(body2);
|
|
7438
|
+
setFormState("error");
|
|
7439
|
+
let message = props.errorMessagePath ? get(body2, props.errorMessagePath) : body2.message || body2.error || body2;
|
|
7440
|
+
if (typeof message !== "string") {
|
|
7441
|
+
message = JSON.stringify(message);
|
|
7442
|
+
}
|
|
7443
|
+
setFormErrorMessage(message);
|
|
7444
|
+
mergeNewRootState({
|
|
7445
|
+
formErrorMessage: message
|
|
7446
|
+
});
|
|
7447
|
+
return;
|
|
7405
7448
|
}
|
|
7406
7449
|
setResponseData(body2);
|
|
7407
7450
|
setFormState(res.ok ? "success" : "error");
|
|
@@ -7480,14 +7523,14 @@ function FormComponent(props) {
|
|
|
7480
7523
|
blocks={props.sendingMessage}
|
|
7481
7524
|
context={props.builderContext}
|
|
7482
7525
|
/></Show12>
|
|
7483
|
-
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-
|
|
7526
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-7430044e">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
|
|
7484
7527
|
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
7485
7528
|
path="successMessage"
|
|
7486
7529
|
blocks={props.successMessage}
|
|
7487
7530
|
context={props.builderContext}
|
|
7488
7531
|
/></Show12>
|
|
7489
7532
|
</form>
|
|
7490
|
-
<style>{`.pre-
|
|
7533
|
+
<style>{`.pre-7430044e {
|
|
7491
7534
|
padding: 10px;
|
|
7492
7535
|
color: red;
|
|
7493
7536
|
text-align: center;
|
|
@@ -7734,7 +7777,18 @@ var componentInfo19 = {
|
|
|
7734
7777
|
};
|
|
7735
7778
|
|
|
7736
7779
|
// src/blocks/img/img.tsx
|
|
7780
|
+
import { createMemo as createMemo15 } from "solid-js";
|
|
7737
7781
|
function ImgComponent(props) {
|
|
7782
|
+
const srcSetToUse = createMemo15(() => {
|
|
7783
|
+
const url = props.imgSrc || props.image;
|
|
7784
|
+
if (!url || typeof url !== "string") {
|
|
7785
|
+
return void 0;
|
|
7786
|
+
}
|
|
7787
|
+
if (!url.match(/builder\.io/)) {
|
|
7788
|
+
return void 0;
|
|
7789
|
+
}
|
|
7790
|
+
return getSrcSet(url);
|
|
7791
|
+
});
|
|
7738
7792
|
return <><img
|
|
7739
7793
|
style={{
|
|
7740
7794
|
"object-fit": props.backgroundSize || "cover",
|
|
@@ -7743,6 +7797,7 @@ function ImgComponent(props) {
|
|
|
7743
7797
|
key={isEditing() && props.imgSrc || "default-key"}
|
|
7744
7798
|
alt={props.altText}
|
|
7745
7799
|
src={props.imgSrc || props.image}
|
|
7800
|
+
srcSet={srcSetToUse()}
|
|
7746
7801
|
{...{}}
|
|
7747
7802
|
{...props.attributes}
|
|
7748
7803
|
/></>;
|
|
@@ -7837,10 +7892,10 @@ var componentInfo20 = {
|
|
|
7837
7892
|
};
|
|
7838
7893
|
|
|
7839
7894
|
// src/blocks/video/video.tsx
|
|
7840
|
-
import { Show as Show13, onMount as onMount7, createSignal as
|
|
7895
|
+
import { Show as Show13, onMount as onMount7, createSignal as createSignal16, createMemo as createMemo16 } from "solid-js";
|
|
7841
7896
|
function Video(props) {
|
|
7842
|
-
const [lazyVideoObserver, setLazyVideoObserver] =
|
|
7843
|
-
const videoProps =
|
|
7897
|
+
const [lazyVideoObserver, setLazyVideoObserver] = createSignal16(void 0);
|
|
7898
|
+
const videoProps = createMemo16(() => {
|
|
7844
7899
|
return {
|
|
7845
7900
|
...props.autoPlay === true ? {
|
|
7846
7901
|
autoPlay: true
|
|
@@ -7859,7 +7914,7 @@ function Video(props) {
|
|
|
7859
7914
|
} : {}
|
|
7860
7915
|
};
|
|
7861
7916
|
});
|
|
7862
|
-
const spreadProps =
|
|
7917
|
+
const spreadProps = createMemo16(() => {
|
|
7863
7918
|
return {
|
|
7864
7919
|
...videoProps()
|
|
7865
7920
|
};
|
|
@@ -8098,8 +8153,8 @@ import {
|
|
|
8098
8153
|
onMount as onMount8,
|
|
8099
8154
|
on as on8,
|
|
8100
8155
|
createEffect as createEffect8,
|
|
8101
|
-
createMemo as
|
|
8102
|
-
createSignal as
|
|
8156
|
+
createMemo as createMemo17,
|
|
8157
|
+
createSignal as createSignal17
|
|
8103
8158
|
} from "solid-js";
|
|
8104
8159
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
8105
8160
|
|
|
@@ -8109,7 +8164,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8109
8164
|
}
|
|
8110
8165
|
|
|
8111
8166
|
// src/constants/sdk-version.ts
|
|
8112
|
-
var SDK_VERSION = "4.0
|
|
8167
|
+
var SDK_VERSION = "4.1.0";
|
|
8113
8168
|
|
|
8114
8169
|
// src/helpers/sdk-headers.ts
|
|
8115
8170
|
var getSdkHeaders = () => ({
|
|
@@ -8964,13 +9019,13 @@ var getWrapperClassName = (variationId) => {
|
|
|
8964
9019
|
|
|
8965
9020
|
// src/components/content/components/enable-editor.tsx
|
|
8966
9021
|
function EnableEditor(props) {
|
|
8967
|
-
const [hasExecuted, setHasExecuted] =
|
|
8968
|
-
const [ContentWrapper, setContentWrapper] =
|
|
9022
|
+
const [hasExecuted, setHasExecuted] = createSignal17(false);
|
|
9023
|
+
const [ContentWrapper, setContentWrapper] = createSignal17(
|
|
8969
9024
|
props.contentWrapper || "div"
|
|
8970
9025
|
);
|
|
8971
|
-
const [httpReqsData, setHttpReqsData] =
|
|
8972
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
8973
|
-
const [clicked, setClicked] =
|
|
9026
|
+
const [httpReqsData, setHttpReqsData] = createSignal17({});
|
|
9027
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal17({});
|
|
9028
|
+
const [clicked, setClicked] = createSignal17(false);
|
|
8974
9029
|
function mergeNewRootState(newData) {
|
|
8975
9030
|
const combinedState = {
|
|
8976
9031
|
...props.builderContextSignal.rootState,
|
|
@@ -9004,7 +9059,7 @@ function EnableEditor(props) {
|
|
|
9004
9059
|
content: newContentValue
|
|
9005
9060
|
}));
|
|
9006
9061
|
}
|
|
9007
|
-
const showContentProps =
|
|
9062
|
+
const showContentProps = createMemo17(() => {
|
|
9008
9063
|
return props.showContent ? {} : {
|
|
9009
9064
|
hidden: true,
|
|
9010
9065
|
"aria-hidden": true
|
|
@@ -9188,14 +9243,14 @@ function EnableEditor(props) {
|
|
|
9188
9243
|
}
|
|
9189
9244
|
}
|
|
9190
9245
|
});
|
|
9191
|
-
const onUpdateFn_0_props_content =
|
|
9246
|
+
const onUpdateFn_0_props_content = createMemo17(() => props.content);
|
|
9192
9247
|
function onUpdateFn_0() {
|
|
9193
9248
|
if (props.content) {
|
|
9194
9249
|
mergeNewContent(props.content);
|
|
9195
9250
|
}
|
|
9196
9251
|
}
|
|
9197
9252
|
createEffect8(on8(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
9198
|
-
const onUpdateFn_1_props_builderContextSignal_rootState =
|
|
9253
|
+
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
|
|
9199
9254
|
() => props.builderContextSignal.rootState
|
|
9200
9255
|
);
|
|
9201
9256
|
function onUpdateFn_1() {
|
|
@@ -9207,14 +9262,14 @@ function EnableEditor(props) {
|
|
|
9207
9262
|
onUpdateFn_1
|
|
9208
9263
|
)
|
|
9209
9264
|
);
|
|
9210
|
-
const onUpdateFn_2_props_data =
|
|
9265
|
+
const onUpdateFn_2_props_data = createMemo17(() => props.data);
|
|
9211
9266
|
function onUpdateFn_2() {
|
|
9212
9267
|
if (props.data) {
|
|
9213
9268
|
mergeNewRootState(props.data);
|
|
9214
9269
|
}
|
|
9215
9270
|
}
|
|
9216
9271
|
createEffect8(on8(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
9217
|
-
const onUpdateFn_3_props_locale =
|
|
9272
|
+
const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
|
|
9218
9273
|
function onUpdateFn_3() {
|
|
9219
9274
|
if (props.locale) {
|
|
9220
9275
|
mergeNewRootState({
|
|
@@ -9246,9 +9301,9 @@ function EnableEditor(props) {
|
|
|
9246
9301
|
var Enable_editor_default = EnableEditor;
|
|
9247
9302
|
|
|
9248
9303
|
// src/components/content/components/styles.tsx
|
|
9249
|
-
import { createSignal as
|
|
9304
|
+
import { createSignal as createSignal18 } from "solid-js";
|
|
9250
9305
|
function ContentStyles(props) {
|
|
9251
|
-
const [injectedStyles, setInjectedStyles] =
|
|
9306
|
+
const [injectedStyles, setInjectedStyles] = createSignal18(
|
|
9252
9307
|
`
|
|
9253
9308
|
${getCss({
|
|
9254
9309
|
cssCode: props.cssCode,
|
|
@@ -9306,7 +9361,7 @@ var getContentInitialValue = ({
|
|
|
9306
9361
|
|
|
9307
9362
|
// src/components/content/content.tsx
|
|
9308
9363
|
function ContentComponent(props) {
|
|
9309
|
-
const [scriptStr, setScriptStr] =
|
|
9364
|
+
const [scriptStr, setScriptStr] = createSignal19(
|
|
9310
9365
|
getUpdateVariantVisibilityScript({
|
|
9311
9366
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
9312
9367
|
variationId: props.content?.testVariationId,
|
|
@@ -9314,7 +9369,7 @@ function ContentComponent(props) {
|
|
|
9314
9369
|
contentId: props.content?.id
|
|
9315
9370
|
})
|
|
9316
9371
|
);
|
|
9317
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
9372
|
+
const [registeredComponents, setRegisteredComponents] = createSignal19(
|
|
9318
9373
|
[
|
|
9319
9374
|
...getDefaultRegisteredComponents(),
|
|
9320
9375
|
...props.customComponents || []
|
|
@@ -9329,7 +9384,7 @@ function ContentComponent(props) {
|
|
|
9329
9384
|
{}
|
|
9330
9385
|
)
|
|
9331
9386
|
);
|
|
9332
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
9387
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal19({
|
|
9333
9388
|
content: getContentInitialValue({
|
|
9334
9389
|
content: props.content,
|
|
9335
9390
|
data: props.data
|
|
@@ -9437,13 +9492,13 @@ var Content_default = ContentComponent;
|
|
|
9437
9492
|
|
|
9438
9493
|
// src/components/content-variants/content-variants.tsx
|
|
9439
9494
|
function ContentVariants(props) {
|
|
9440
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
9495
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal20(
|
|
9441
9496
|
checkShouldRenderVariants2({
|
|
9442
9497
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
9443
9498
|
content: props.content
|
|
9444
9499
|
})
|
|
9445
9500
|
);
|
|
9446
|
-
const updateCookieAndStylesScriptStr =
|
|
9501
|
+
const updateCookieAndStylesScriptStr = createMemo20(() => {
|
|
9447
9502
|
return getUpdateCookieAndStylesScript(
|
|
9448
9503
|
getVariants(props.content).map((value) => ({
|
|
9449
9504
|
id: value.testVariationId,
|
|
@@ -9452,10 +9507,10 @@ function ContentVariants(props) {
|
|
|
9452
9507
|
props.content?.id || ""
|
|
9453
9508
|
);
|
|
9454
9509
|
});
|
|
9455
|
-
const hideVariantsStyleString =
|
|
9510
|
+
const hideVariantsStyleString = createMemo20(() => {
|
|
9456
9511
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
9457
9512
|
});
|
|
9458
|
-
const defaultContent =
|
|
9513
|
+
const defaultContent = createMemo20(() => {
|
|
9459
9514
|
return shouldRenderVariants() ? {
|
|
9460
9515
|
...props.content,
|
|
9461
9516
|
testVariationId: props.content?.id
|
|
@@ -9574,15 +9629,15 @@ var fetchSymbolContent = async ({
|
|
|
9574
9629
|
|
|
9575
9630
|
// src/blocks/symbol/symbol.tsx
|
|
9576
9631
|
function Symbol2(props) {
|
|
9577
|
-
const [contentToUse, setContentToUse] =
|
|
9578
|
-
const [symbolEntry, setSymbolEntry] =
|
|
9579
|
-
const blocksWrapper =
|
|
9632
|
+
const [contentToUse, setContentToUse] = createSignal21(props.symbol?.content);
|
|
9633
|
+
const [symbolEntry, setSymbolEntry] = createSignal21(props.symbol?.entry);
|
|
9634
|
+
const blocksWrapper = createMemo21(() => {
|
|
9580
9635
|
return "div";
|
|
9581
9636
|
});
|
|
9582
|
-
const contentWrapper =
|
|
9637
|
+
const contentWrapper = createMemo21(() => {
|
|
9583
9638
|
return "div";
|
|
9584
9639
|
});
|
|
9585
|
-
const className =
|
|
9640
|
+
const className = createMemo21(() => {
|
|
9586
9641
|
return [
|
|
9587
9642
|
...[props.attributes[getClassPropName()]],
|
|
9588
9643
|
"builder-symbol",
|
|
@@ -9605,7 +9660,7 @@ function Symbol2(props) {
|
|
|
9605
9660
|
}
|
|
9606
9661
|
onMount10(() => {
|
|
9607
9662
|
});
|
|
9608
|
-
const onUpdateFn_0_props_symbol =
|
|
9663
|
+
const onUpdateFn_0_props_symbol = createMemo21(() => props.symbol);
|
|
9609
9664
|
function onUpdateFn_0() {
|
|
9610
9665
|
setContent();
|
|
9611
9666
|
}
|