@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/browser/index.js
CHANGED
|
@@ -2307,8 +2307,8 @@ var DEFAULT_INDEX = "default";
|
|
|
2307
2307
|
var FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME = "filterWithCustomTargeting";
|
|
2308
2308
|
var BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME = "builderIoPersonalization";
|
|
2309
2309
|
var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "updateVisibilityStylesScript";
|
|
2310
|
-
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte"];
|
|
2311
|
-
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte"];
|
|
2310
|
+
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte", "qwik"];
|
|
2311
|
+
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte", "qwik"];
|
|
2312
2312
|
function checkShouldRenderVariants(variants, canTrack) {
|
|
2313
2313
|
const hasVariants = variants && variants.length > 0;
|
|
2314
2314
|
if (TARGET === "reactNative")
|
|
@@ -2566,6 +2566,11 @@ var handleABTesting = async ({
|
|
|
2566
2566
|
};
|
|
2567
2567
|
};
|
|
2568
2568
|
|
|
2569
|
+
// src/helpers/no-serialize-wrapper.ts
|
|
2570
|
+
function noSerializeWrapper(fn) {
|
|
2571
|
+
return fn;
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2569
2574
|
// src/helpers/user-attributes.ts
|
|
2570
2575
|
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
2571
2576
|
function createUserAttributesService() {
|
|
@@ -2596,18 +2601,32 @@ function createUserAttributesService() {
|
|
|
2596
2601
|
canTrack
|
|
2597
2602
|
}) || "{}");
|
|
2598
2603
|
},
|
|
2599
|
-
subscribeOnUserAttributesChange(callback
|
|
2604
|
+
subscribeOnUserAttributesChange(callback, {
|
|
2605
|
+
fireImmediately
|
|
2606
|
+
} = {}) {
|
|
2600
2607
|
subscribers.add(callback);
|
|
2601
|
-
|
|
2608
|
+
if (fireImmediately) {
|
|
2609
|
+
callback(this.getUserAttributes());
|
|
2610
|
+
}
|
|
2611
|
+
return noSerializeWrapper(function() {
|
|
2602
2612
|
subscribers.delete(callback);
|
|
2603
|
-
};
|
|
2613
|
+
});
|
|
2604
2614
|
},
|
|
2605
2615
|
setCanTrack(value) {
|
|
2606
2616
|
canTrack = value;
|
|
2607
2617
|
}
|
|
2608
2618
|
};
|
|
2609
2619
|
}
|
|
2610
|
-
var
|
|
2620
|
+
var _userAttributesService;
|
|
2621
|
+
if (isBrowser() && TARGET === "qwik") {
|
|
2622
|
+
if (!window.__BUILDER_USER_ATTRIBUTES_SERVICE__) {
|
|
2623
|
+
window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = createUserAttributesService();
|
|
2624
|
+
}
|
|
2625
|
+
_userAttributesService = window.__BUILDER_USER_ATTRIBUTES_SERVICE__;
|
|
2626
|
+
} else {
|
|
2627
|
+
_userAttributesService = createUserAttributesService();
|
|
2628
|
+
}
|
|
2629
|
+
var userAttributesService = _userAttributesService;
|
|
2611
2630
|
var setClientUserAttributes = (attributes) => {
|
|
2612
2631
|
userAttributesService.setUserAttributes(attributes);
|
|
2613
2632
|
};
|
|
@@ -3462,6 +3481,8 @@ function PersonalizationContainer(props) {
|
|
|
3462
3481
|
setShouldResetVariants(true);
|
|
3463
3482
|
const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs2) => {
|
|
3464
3483
|
setUserAttributes(attrs2);
|
|
3484
|
+
}, {
|
|
3485
|
+
fireImmediately: TARGET === "qwik"
|
|
3465
3486
|
});
|
|
3466
3487
|
if (!(isEditing() || isPreviewing())) {
|
|
3467
3488
|
const variant = filteredVariants()[0];
|
|
@@ -4479,9 +4500,9 @@ function logFetch(url) {
|
|
|
4479
4500
|
}
|
|
4480
4501
|
|
|
4481
4502
|
// src/blocks/form/form/form.tsx
|
|
4482
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-
|
|
4503
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-7430044e">`);
|
|
4483
4504
|
var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
|
|
4484
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
4505
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-7430044e {
|
|
4485
4506
|
padding: 10px;
|
|
4486
4507
|
color: red;
|
|
4487
4508
|
text-align: center;
|
|
@@ -4593,6 +4614,14 @@ function FormComponent(props) {
|
|
|
4593
4614
|
}
|
|
4594
4615
|
}
|
|
4595
4616
|
setFormState("sending");
|
|
4617
|
+
if (props.sendSubmissionsTo === "email" && (props.sendSubmissionsToEmail === "your@email.com" || !props.sendSubmissionsToEmail)) {
|
|
4618
|
+
const message = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
|
|
4619
|
+
setFormState("error");
|
|
4620
|
+
mergeNewRootState({
|
|
4621
|
+
formErrorMessage: message
|
|
4622
|
+
});
|
|
4623
|
+
return;
|
|
4624
|
+
}
|
|
4596
4625
|
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 || "")}`;
|
|
4597
4626
|
const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
|
|
4598
4627
|
logFetch(url);
|
|
@@ -4608,17 +4637,30 @@ function FormComponent(props) {
|
|
|
4608
4637
|
} else {
|
|
4609
4638
|
body2 = await res.text();
|
|
4610
4639
|
}
|
|
4611
|
-
if (!res.ok
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4640
|
+
if (!res.ok) {
|
|
4641
|
+
const submitErrorEvent = new CustomEvent("submit:error", {
|
|
4642
|
+
detail: {
|
|
4643
|
+
error: body2,
|
|
4644
|
+
status: res.status
|
|
4616
4645
|
}
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4646
|
+
});
|
|
4647
|
+
if (formRef?.nativeElement) {
|
|
4648
|
+
formRef?.nativeElement.dispatchEvent(submitErrorEvent);
|
|
4649
|
+
if (submitErrorEvent.defaultPrevented) {
|
|
4650
|
+
return;
|
|
4651
|
+
}
|
|
4652
|
+
}
|
|
4653
|
+
setResponseData(body2);
|
|
4654
|
+
setFormState("error");
|
|
4655
|
+
let message = props.errorMessagePath ? get(body2, props.errorMessagePath) : body2.message || body2.error || body2;
|
|
4656
|
+
if (typeof message !== "string") {
|
|
4657
|
+
message = JSON.stringify(message);
|
|
4621
4658
|
}
|
|
4659
|
+
setFormErrorMessage(message);
|
|
4660
|
+
mergeNewRootState({
|
|
4661
|
+
formErrorMessage: message
|
|
4662
|
+
});
|
|
4663
|
+
return;
|
|
4622
4664
|
}
|
|
4623
4665
|
setResponseData(body2);
|
|
4624
4666
|
setFormState(res.ok ? "success" : "error");
|
|
@@ -5046,6 +5088,16 @@ var componentInfo19 = {
|
|
|
5046
5088
|
};
|
|
5047
5089
|
var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
|
|
5048
5090
|
function ImgComponent(props) {
|
|
5091
|
+
const srcSetToUse = createMemo(() => {
|
|
5092
|
+
const url = props.imgSrc || props.image;
|
|
5093
|
+
if (!url || typeof url !== "string") {
|
|
5094
|
+
return void 0;
|
|
5095
|
+
}
|
|
5096
|
+
if (!url.match(/builder\.io/)) {
|
|
5097
|
+
return void 0;
|
|
5098
|
+
}
|
|
5099
|
+
return getSrcSet(url);
|
|
5100
|
+
});
|
|
5049
5101
|
return (() => {
|
|
5050
5102
|
const _el$ = _tmpl$20();
|
|
5051
5103
|
spread(_el$, mergeProps({
|
|
@@ -5063,6 +5115,9 @@ function ImgComponent(props) {
|
|
|
5063
5115
|
},
|
|
5064
5116
|
get src() {
|
|
5065
5117
|
return props.imgSrc || props.image;
|
|
5118
|
+
},
|
|
5119
|
+
get srcSet() {
|
|
5120
|
+
return srcSetToUse();
|
|
5066
5121
|
}
|
|
5067
5122
|
}, {}, () => props.attributes), false, false);
|
|
5068
5123
|
return _el$;
|
|
@@ -5433,7 +5488,7 @@ function getPreviewContent(_searchParams) {
|
|
|
5433
5488
|
}
|
|
5434
5489
|
|
|
5435
5490
|
// src/constants/sdk-version.ts
|
|
5436
|
-
var SDK_VERSION = "4.0
|
|
5491
|
+
var SDK_VERSION = "4.1.0";
|
|
5437
5492
|
|
|
5438
5493
|
// src/helpers/sdk-headers.ts
|
|
5439
5494
|
var getSdkHeaders = () => ({
|
package/lib/browser/index.jsx
CHANGED
|
@@ -1974,10 +1974,10 @@ function SectionComponent(props) {
|
|
|
1974
1974
|
var section_default = SectionComponent;
|
|
1975
1975
|
|
|
1976
1976
|
// src/blocks/symbol/symbol.tsx
|
|
1977
|
-
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as
|
|
1977
|
+
import { onMount as onMount10, on as on9, createEffect as createEffect9, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
|
|
1978
1978
|
|
|
1979
1979
|
// src/components/content-variants/content-variants.tsx
|
|
1980
|
-
import { Show as Show16, For as For9, onMount as onMount9, createSignal as
|
|
1980
|
+
import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
|
|
1981
1981
|
|
|
1982
1982
|
// src/blocks/personalization-container/helpers/inlined-fns.ts
|
|
1983
1983
|
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
@@ -2068,8 +2068,8 @@ var DEFAULT_INDEX = "default";
|
|
|
2068
2068
|
var FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME = "filterWithCustomTargeting";
|
|
2069
2069
|
var BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME = "builderIoPersonalization";
|
|
2070
2070
|
var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "updateVisibilityStylesScript";
|
|
2071
|
-
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte"];
|
|
2072
|
-
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte"];
|
|
2071
|
+
var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte", "qwik"];
|
|
2072
|
+
var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte", "qwik"];
|
|
2073
2073
|
function checkShouldRenderVariants(variants, canTrack) {
|
|
2074
2074
|
const hasVariants = variants && variants.length > 0;
|
|
2075
2075
|
if (TARGET === "reactNative")
|
|
@@ -2327,6 +2327,11 @@ var handleABTesting = async ({
|
|
|
2327
2327
|
};
|
|
2328
2328
|
};
|
|
2329
2329
|
|
|
2330
|
+
// src/helpers/no-serialize-wrapper.ts
|
|
2331
|
+
function noSerializeWrapper(fn) {
|
|
2332
|
+
return fn;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2330
2335
|
// src/helpers/user-attributes.ts
|
|
2331
2336
|
var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
|
|
2332
2337
|
function createUserAttributesService() {
|
|
@@ -2357,18 +2362,32 @@ function createUserAttributesService() {
|
|
|
2357
2362
|
canTrack
|
|
2358
2363
|
}) || "{}");
|
|
2359
2364
|
},
|
|
2360
|
-
subscribeOnUserAttributesChange(callback
|
|
2365
|
+
subscribeOnUserAttributesChange(callback, {
|
|
2366
|
+
fireImmediately
|
|
2367
|
+
} = {}) {
|
|
2361
2368
|
subscribers.add(callback);
|
|
2362
|
-
|
|
2369
|
+
if (fireImmediately) {
|
|
2370
|
+
callback(this.getUserAttributes());
|
|
2371
|
+
}
|
|
2372
|
+
return noSerializeWrapper(function() {
|
|
2363
2373
|
subscribers.delete(callback);
|
|
2364
|
-
};
|
|
2374
|
+
});
|
|
2365
2375
|
},
|
|
2366
2376
|
setCanTrack(value) {
|
|
2367
2377
|
canTrack = value;
|
|
2368
2378
|
}
|
|
2369
2379
|
};
|
|
2370
2380
|
}
|
|
2371
|
-
var
|
|
2381
|
+
var _userAttributesService;
|
|
2382
|
+
if (isBrowser() && TARGET === "qwik") {
|
|
2383
|
+
if (!window.__BUILDER_USER_ATTRIBUTES_SERVICE__) {
|
|
2384
|
+
window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = createUserAttributesService();
|
|
2385
|
+
}
|
|
2386
|
+
_userAttributesService = window.__BUILDER_USER_ATTRIBUTES_SERVICE__;
|
|
2387
|
+
} else {
|
|
2388
|
+
_userAttributesService = createUserAttributesService();
|
|
2389
|
+
}
|
|
2390
|
+
var userAttributesService = _userAttributesService;
|
|
2372
2391
|
var setClientUserAttributes = (attributes) => {
|
|
2373
2392
|
userAttributesService.setUserAttributes(attributes);
|
|
2374
2393
|
};
|
|
@@ -2381,7 +2400,7 @@ var getDefaultCanTrack = (canTrack) => {
|
|
|
2381
2400
|
};
|
|
2382
2401
|
|
|
2383
2402
|
// src/components/content/content.tsx
|
|
2384
|
-
import { Show as Show15, createSignal as
|
|
2403
|
+
import { Show as Show15, createSignal as createSignal19 } from "solid-js";
|
|
2385
2404
|
|
|
2386
2405
|
// src/blocks/accordion/component-info.ts
|
|
2387
2406
|
var defaultTitle = {
|
|
@@ -3210,6 +3229,9 @@ function PersonalizationContainer(props) {
|
|
|
3210
3229
|
const unsub = userAttributesService.subscribeOnUserAttributesChange(
|
|
3211
3230
|
(attrs2) => {
|
|
3212
3231
|
setUserAttributes(attrs2);
|
|
3232
|
+
},
|
|
3233
|
+
{
|
|
3234
|
+
fireImmediately: TARGET === "qwik"
|
|
3213
3235
|
}
|
|
3214
3236
|
);
|
|
3215
3237
|
if (!(isEditing() || isPreviewing())) {
|
|
@@ -4190,6 +4212,14 @@ function FormComponent(props) {
|
|
|
4190
4212
|
}
|
|
4191
4213
|
}
|
|
4192
4214
|
setFormState("sending");
|
|
4215
|
+
if (props.sendSubmissionsTo === "email" && (props.sendSubmissionsToEmail === "your@email.com" || !props.sendSubmissionsToEmail)) {
|
|
4216
|
+
const message = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
|
|
4217
|
+
setFormState("error");
|
|
4218
|
+
mergeNewRootState({
|
|
4219
|
+
formErrorMessage: message
|
|
4220
|
+
});
|
|
4221
|
+
return;
|
|
4222
|
+
}
|
|
4193
4223
|
const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(
|
|
4194
4224
|
props.sendSubmissionsToEmail || ""
|
|
4195
4225
|
)}&name=${encodeURIComponent(props.name || "")}`;
|
|
@@ -4208,17 +4238,30 @@ function FormComponent(props) {
|
|
|
4208
4238
|
} else {
|
|
4209
4239
|
body2 = await res.text();
|
|
4210
4240
|
}
|
|
4211
|
-
if (!res.ok
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4241
|
+
if (!res.ok) {
|
|
4242
|
+
const submitErrorEvent = new CustomEvent("submit:error", {
|
|
4243
|
+
detail: {
|
|
4244
|
+
error: body2,
|
|
4245
|
+
status: res.status
|
|
4246
|
+
}
|
|
4247
|
+
});
|
|
4248
|
+
if (formRef?.nativeElement) {
|
|
4249
|
+
formRef?.nativeElement.dispatchEvent(submitErrorEvent);
|
|
4250
|
+
if (submitErrorEvent.defaultPrevented) {
|
|
4251
|
+
return;
|
|
4216
4252
|
}
|
|
4217
|
-
setFormErrorMessage(message);
|
|
4218
|
-
mergeNewRootState({
|
|
4219
|
-
formErrorMessage: message
|
|
4220
|
-
});
|
|
4221
4253
|
}
|
|
4254
|
+
setResponseData(body2);
|
|
4255
|
+
setFormState("error");
|
|
4256
|
+
let message = props.errorMessagePath ? get(body2, props.errorMessagePath) : body2.message || body2.error || body2;
|
|
4257
|
+
if (typeof message !== "string") {
|
|
4258
|
+
message = JSON.stringify(message);
|
|
4259
|
+
}
|
|
4260
|
+
setFormErrorMessage(message);
|
|
4261
|
+
mergeNewRootState({
|
|
4262
|
+
formErrorMessage: message
|
|
4263
|
+
});
|
|
4264
|
+
return;
|
|
4222
4265
|
}
|
|
4223
4266
|
setResponseData(body2);
|
|
4224
4267
|
setFormState(res.ok ? "success" : "error");
|
|
@@ -4297,14 +4340,14 @@ function FormComponent(props) {
|
|
|
4297
4340
|
blocks={props.sendingMessage}
|
|
4298
4341
|
context={props.builderContext}
|
|
4299
4342
|
/></Show12>
|
|
4300
|
-
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-
|
|
4343
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-7430044e">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
|
|
4301
4344
|
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
4302
4345
|
path="successMessage"
|
|
4303
4346
|
blocks={props.successMessage}
|
|
4304
4347
|
context={props.builderContext}
|
|
4305
4348
|
/></Show12>
|
|
4306
4349
|
</form>
|
|
4307
|
-
<style>{`.pre-
|
|
4350
|
+
<style>{`.pre-7430044e {
|
|
4308
4351
|
padding: 10px;
|
|
4309
4352
|
color: red;
|
|
4310
4353
|
text-align: center;
|
|
@@ -4551,7 +4594,18 @@ var componentInfo19 = {
|
|
|
4551
4594
|
};
|
|
4552
4595
|
|
|
4553
4596
|
// src/blocks/img/img.tsx
|
|
4597
|
+
import { createMemo as createMemo15 } from "solid-js";
|
|
4554
4598
|
function ImgComponent(props) {
|
|
4599
|
+
const srcSetToUse = createMemo15(() => {
|
|
4600
|
+
const url = props.imgSrc || props.image;
|
|
4601
|
+
if (!url || typeof url !== "string") {
|
|
4602
|
+
return void 0;
|
|
4603
|
+
}
|
|
4604
|
+
if (!url.match(/builder\.io/)) {
|
|
4605
|
+
return void 0;
|
|
4606
|
+
}
|
|
4607
|
+
return getSrcSet(url);
|
|
4608
|
+
});
|
|
4555
4609
|
return <><img
|
|
4556
4610
|
style={{
|
|
4557
4611
|
"object-fit": props.backgroundSize || "cover",
|
|
@@ -4560,6 +4614,7 @@ function ImgComponent(props) {
|
|
|
4560
4614
|
key={isEditing() && props.imgSrc || "default-key"}
|
|
4561
4615
|
alt={props.altText}
|
|
4562
4616
|
src={props.imgSrc || props.image}
|
|
4617
|
+
srcSet={srcSetToUse()}
|
|
4563
4618
|
{...{}}
|
|
4564
4619
|
{...props.attributes}
|
|
4565
4620
|
/></>;
|
|
@@ -4654,10 +4709,10 @@ var componentInfo20 = {
|
|
|
4654
4709
|
};
|
|
4655
4710
|
|
|
4656
4711
|
// src/blocks/video/video.tsx
|
|
4657
|
-
import { Show as Show13, onMount as onMount7, createSignal as
|
|
4712
|
+
import { Show as Show13, onMount as onMount7, createSignal as createSignal16, createMemo as createMemo16 } from "solid-js";
|
|
4658
4713
|
function Video(props) {
|
|
4659
|
-
const [lazyVideoObserver, setLazyVideoObserver] =
|
|
4660
|
-
const videoProps =
|
|
4714
|
+
const [lazyVideoObserver, setLazyVideoObserver] = createSignal16(void 0);
|
|
4715
|
+
const videoProps = createMemo16(() => {
|
|
4661
4716
|
return {
|
|
4662
4717
|
...props.autoPlay === true ? {
|
|
4663
4718
|
autoPlay: true
|
|
@@ -4676,7 +4731,7 @@ function Video(props) {
|
|
|
4676
4731
|
} : {}
|
|
4677
4732
|
};
|
|
4678
4733
|
});
|
|
4679
|
-
const spreadProps =
|
|
4734
|
+
const spreadProps = createMemo16(() => {
|
|
4680
4735
|
return {
|
|
4681
4736
|
...videoProps()
|
|
4682
4737
|
};
|
|
@@ -4915,8 +4970,8 @@ import {
|
|
|
4915
4970
|
onMount as onMount8,
|
|
4916
4971
|
on as on8,
|
|
4917
4972
|
createEffect as createEffect8,
|
|
4918
|
-
createMemo as
|
|
4919
|
-
createSignal as
|
|
4973
|
+
createMemo as createMemo17,
|
|
4974
|
+
createSignal as createSignal17
|
|
4920
4975
|
} from "solid-js";
|
|
4921
4976
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
4922
4977
|
|
|
@@ -4926,7 +4981,7 @@ function getPreviewContent(_searchParams) {
|
|
|
4926
4981
|
}
|
|
4927
4982
|
|
|
4928
4983
|
// src/constants/sdk-version.ts
|
|
4929
|
-
var SDK_VERSION = "4.0
|
|
4984
|
+
var SDK_VERSION = "4.1.0";
|
|
4930
4985
|
|
|
4931
4986
|
// src/helpers/sdk-headers.ts
|
|
4932
4987
|
var getSdkHeaders = () => ({
|
|
@@ -5781,13 +5836,13 @@ var getWrapperClassName = (variationId) => {
|
|
|
5781
5836
|
|
|
5782
5837
|
// src/components/content/components/enable-editor.tsx
|
|
5783
5838
|
function EnableEditor(props) {
|
|
5784
|
-
const [hasExecuted, setHasExecuted] =
|
|
5785
|
-
const [ContentWrapper, setContentWrapper] =
|
|
5839
|
+
const [hasExecuted, setHasExecuted] = createSignal17(false);
|
|
5840
|
+
const [ContentWrapper, setContentWrapper] = createSignal17(
|
|
5786
5841
|
props.contentWrapper || "div"
|
|
5787
5842
|
);
|
|
5788
|
-
const [httpReqsData, setHttpReqsData] =
|
|
5789
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
5790
|
-
const [clicked, setClicked] =
|
|
5843
|
+
const [httpReqsData, setHttpReqsData] = createSignal17({});
|
|
5844
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal17({});
|
|
5845
|
+
const [clicked, setClicked] = createSignal17(false);
|
|
5791
5846
|
function mergeNewRootState(newData) {
|
|
5792
5847
|
const combinedState = {
|
|
5793
5848
|
...props.builderContextSignal.rootState,
|
|
@@ -5821,7 +5876,7 @@ function EnableEditor(props) {
|
|
|
5821
5876
|
content: newContentValue
|
|
5822
5877
|
}));
|
|
5823
5878
|
}
|
|
5824
|
-
const showContentProps =
|
|
5879
|
+
const showContentProps = createMemo17(() => {
|
|
5825
5880
|
return props.showContent ? {} : {
|
|
5826
5881
|
hidden: true,
|
|
5827
5882
|
"aria-hidden": true
|
|
@@ -6005,14 +6060,14 @@ function EnableEditor(props) {
|
|
|
6005
6060
|
}
|
|
6006
6061
|
}
|
|
6007
6062
|
});
|
|
6008
|
-
const onUpdateFn_0_props_content =
|
|
6063
|
+
const onUpdateFn_0_props_content = createMemo17(() => props.content);
|
|
6009
6064
|
function onUpdateFn_0() {
|
|
6010
6065
|
if (props.content) {
|
|
6011
6066
|
mergeNewContent(props.content);
|
|
6012
6067
|
}
|
|
6013
6068
|
}
|
|
6014
6069
|
createEffect8(on8(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
6015
|
-
const onUpdateFn_1_props_builderContextSignal_rootState =
|
|
6070
|
+
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
|
|
6016
6071
|
() => props.builderContextSignal.rootState
|
|
6017
6072
|
);
|
|
6018
6073
|
function onUpdateFn_1() {
|
|
@@ -6024,14 +6079,14 @@ function EnableEditor(props) {
|
|
|
6024
6079
|
onUpdateFn_1
|
|
6025
6080
|
)
|
|
6026
6081
|
);
|
|
6027
|
-
const onUpdateFn_2_props_data =
|
|
6082
|
+
const onUpdateFn_2_props_data = createMemo17(() => props.data);
|
|
6028
6083
|
function onUpdateFn_2() {
|
|
6029
6084
|
if (props.data) {
|
|
6030
6085
|
mergeNewRootState(props.data);
|
|
6031
6086
|
}
|
|
6032
6087
|
}
|
|
6033
6088
|
createEffect8(on8(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
6034
|
-
const onUpdateFn_3_props_locale =
|
|
6089
|
+
const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
|
|
6035
6090
|
function onUpdateFn_3() {
|
|
6036
6091
|
if (props.locale) {
|
|
6037
6092
|
mergeNewRootState({
|
|
@@ -6063,9 +6118,9 @@ function EnableEditor(props) {
|
|
|
6063
6118
|
var Enable_editor_default = EnableEditor;
|
|
6064
6119
|
|
|
6065
6120
|
// src/components/content/components/styles.tsx
|
|
6066
|
-
import { createSignal as
|
|
6121
|
+
import { createSignal as createSignal18 } from "solid-js";
|
|
6067
6122
|
function ContentStyles(props) {
|
|
6068
|
-
const [injectedStyles, setInjectedStyles] =
|
|
6123
|
+
const [injectedStyles, setInjectedStyles] = createSignal18(
|
|
6069
6124
|
`
|
|
6070
6125
|
${getCss({
|
|
6071
6126
|
cssCode: props.cssCode,
|
|
@@ -6123,7 +6178,7 @@ var getContentInitialValue = ({
|
|
|
6123
6178
|
|
|
6124
6179
|
// src/components/content/content.tsx
|
|
6125
6180
|
function ContentComponent(props) {
|
|
6126
|
-
const [scriptStr, setScriptStr] =
|
|
6181
|
+
const [scriptStr, setScriptStr] = createSignal19(
|
|
6127
6182
|
getUpdateVariantVisibilityScript({
|
|
6128
6183
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
6129
6184
|
variationId: props.content?.testVariationId,
|
|
@@ -6131,7 +6186,7 @@ function ContentComponent(props) {
|
|
|
6131
6186
|
contentId: props.content?.id
|
|
6132
6187
|
})
|
|
6133
6188
|
);
|
|
6134
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
6189
|
+
const [registeredComponents, setRegisteredComponents] = createSignal19(
|
|
6135
6190
|
[
|
|
6136
6191
|
...getDefaultRegisteredComponents(),
|
|
6137
6192
|
...props.customComponents || []
|
|
@@ -6146,7 +6201,7 @@ function ContentComponent(props) {
|
|
|
6146
6201
|
{}
|
|
6147
6202
|
)
|
|
6148
6203
|
);
|
|
6149
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
6204
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal19({
|
|
6150
6205
|
content: getContentInitialValue({
|
|
6151
6206
|
content: props.content,
|
|
6152
6207
|
data: props.data
|
|
@@ -6254,13 +6309,13 @@ var Content_default = ContentComponent;
|
|
|
6254
6309
|
|
|
6255
6310
|
// src/components/content-variants/content-variants.tsx
|
|
6256
6311
|
function ContentVariants(props) {
|
|
6257
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
6312
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal20(
|
|
6258
6313
|
checkShouldRenderVariants2({
|
|
6259
6314
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
6260
6315
|
content: props.content
|
|
6261
6316
|
})
|
|
6262
6317
|
);
|
|
6263
|
-
const updateCookieAndStylesScriptStr =
|
|
6318
|
+
const updateCookieAndStylesScriptStr = createMemo20(() => {
|
|
6264
6319
|
return getUpdateCookieAndStylesScript(
|
|
6265
6320
|
getVariants(props.content).map((value) => ({
|
|
6266
6321
|
id: value.testVariationId,
|
|
@@ -6269,10 +6324,10 @@ function ContentVariants(props) {
|
|
|
6269
6324
|
props.content?.id || ""
|
|
6270
6325
|
);
|
|
6271
6326
|
});
|
|
6272
|
-
const hideVariantsStyleString =
|
|
6327
|
+
const hideVariantsStyleString = createMemo20(() => {
|
|
6273
6328
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
6274
6329
|
});
|
|
6275
|
-
const defaultContent =
|
|
6330
|
+
const defaultContent = createMemo20(() => {
|
|
6276
6331
|
return shouldRenderVariants() ? {
|
|
6277
6332
|
...props.content,
|
|
6278
6333
|
testVariationId: props.content?.id
|
|
@@ -6391,15 +6446,15 @@ var fetchSymbolContent = async ({
|
|
|
6391
6446
|
|
|
6392
6447
|
// src/blocks/symbol/symbol.tsx
|
|
6393
6448
|
function Symbol(props) {
|
|
6394
|
-
const [contentToUse, setContentToUse] =
|
|
6395
|
-
const [symbolEntry, setSymbolEntry] =
|
|
6396
|
-
const blocksWrapper =
|
|
6449
|
+
const [contentToUse, setContentToUse] = createSignal21(props.symbol?.content);
|
|
6450
|
+
const [symbolEntry, setSymbolEntry] = createSignal21(props.symbol?.entry);
|
|
6451
|
+
const blocksWrapper = createMemo21(() => {
|
|
6397
6452
|
return "div";
|
|
6398
6453
|
});
|
|
6399
|
-
const contentWrapper =
|
|
6454
|
+
const contentWrapper = createMemo21(() => {
|
|
6400
6455
|
return "div";
|
|
6401
6456
|
});
|
|
6402
|
-
const className =
|
|
6457
|
+
const className = createMemo21(() => {
|
|
6403
6458
|
return [
|
|
6404
6459
|
...[props.attributes[getClassPropName()]],
|
|
6405
6460
|
"builder-symbol",
|
|
@@ -6422,7 +6477,7 @@ function Symbol(props) {
|
|
|
6422
6477
|
}
|
|
6423
6478
|
onMount10(() => {
|
|
6424
6479
|
});
|
|
6425
|
-
const onUpdateFn_0_props_symbol =
|
|
6480
|
+
const onUpdateFn_0_props_symbol = createMemo21(() => props.symbol);
|
|
6426
6481
|
function onUpdateFn_0() {
|
|
6427
6482
|
setContent();
|
|
6428
6483
|
}
|