@builder.io/sdk-solid 2.0.3 → 2.0.8
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 -2
- package/lib/browser/dev.js +35 -12
- package/lib/browser/dev.jsx +91 -63
- package/lib/browser/index.js +35 -12
- package/lib/browser/index.jsx +91 -63
- package/lib/edge/dev.js +35 -12
- package/lib/edge/dev.jsx +91 -63
- package/lib/edge/index.js +35 -12
- package/lib/edge/index.jsx +91 -63
- package/lib/node/dev.js +35 -12
- package/lib/node/dev.jsx +91 -63
- package/lib/node/index.js +35 -12
- package/lib/node/index.jsx +91 -63
- package/package.json +1 -1
package/lib/node/dev.js
CHANGED
|
@@ -703,6 +703,9 @@ function assign(target, ..._args) {
|
|
|
703
703
|
return to;
|
|
704
704
|
}
|
|
705
705
|
function bindAnimations(animations) {
|
|
706
|
+
if (TARGET === "reactNative") {
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
706
709
|
for (const animation of animations) {
|
|
707
710
|
switch (animation.trigger) {
|
|
708
711
|
case "pageLoad":
|
|
@@ -1445,7 +1448,7 @@ function Block(props) {
|
|
|
1445
1448
|
registeredComponents: props.registeredComponents,
|
|
1446
1449
|
builderBlock: processedBlock(),
|
|
1447
1450
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
1448
|
-
isInteractive: !blockComponent()?.isRSC
|
|
1451
|
+
isInteractive: !(blockComponent()?.isRSC && TARGET === "rsc")
|
|
1449
1452
|
};
|
|
1450
1453
|
});
|
|
1451
1454
|
onMount(() => {
|
|
@@ -1979,16 +1982,16 @@ function getSrcSet(url) {
|
|
|
1979
1982
|
// src/blocks/image/image.tsx
|
|
1980
1983
|
var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
1981
1984
|
var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
|
|
1982
|
-
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-
|
|
1983
|
-
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-
|
|
1984
|
-
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-
|
|
1985
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-4512e110">`);
|
|
1986
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-4512e110-2>`);
|
|
1987
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-4512e110 {
|
|
1985
1988
|
opacity: 1;
|
|
1986
1989
|
transition: opacity 0.2s ease-in-out;
|
|
1987
|
-
}.div-
|
|
1990
|
+
}.div-4512e110 {
|
|
1988
1991
|
width: 100%;
|
|
1989
1992
|
pointer-events: none;
|
|
1990
1993
|
font-size: 0;
|
|
1991
|
-
}.div-
|
|
1994
|
+
}.div-4512e110-2 {
|
|
1992
1995
|
display: flex;
|
|
1993
1996
|
flex-direction: column;
|
|
1994
1997
|
align-items: stretch;
|
|
@@ -2038,6 +2041,8 @@ function Image(props) {
|
|
|
2038
2041
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
2039
2042
|
return out;
|
|
2040
2043
|
});
|
|
2044
|
+
onMount(() => {
|
|
2045
|
+
});
|
|
2041
2046
|
return [[(() => {
|
|
2042
2047
|
const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
|
|
2043
2048
|
insert(_el$, createComponent(Show, {
|
|
@@ -2051,7 +2056,7 @@ function Image(props) {
|
|
|
2051
2056
|
}
|
|
2052
2057
|
}), _el$3);
|
|
2053
2058
|
effect((_p$) => {
|
|
2054
|
-
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
2059
|
+
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-4512e110", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
|
|
2055
2060
|
"object-position": props.backgroundPosition || "center",
|
|
2056
2061
|
"object-fit": props.backgroundSize || "cover",
|
|
2057
2062
|
...aspectRatioCss()
|
|
@@ -3422,7 +3427,8 @@ delegateEvents(["click"]);
|
|
|
3422
3427
|
// src/blocks/text/component-info.ts
|
|
3423
3428
|
var componentInfo10 = {
|
|
3424
3429
|
shouldReceiveBuilderProps: {
|
|
3425
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
3430
|
+
builderBlock: TARGET === "reactNative" ? true : false,
|
|
3431
|
+
builderContext: true
|
|
3426
3432
|
},
|
|
3427
3433
|
name: "Text",
|
|
3428
3434
|
static: true,
|
|
@@ -3444,10 +3450,27 @@ var componentInfo10 = {
|
|
|
3444
3450
|
};
|
|
3445
3451
|
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
3446
3452
|
function Text(props) {
|
|
3453
|
+
const processedText = createMemo(() => {
|
|
3454
|
+
const context = props.builderContext;
|
|
3455
|
+
const {
|
|
3456
|
+
context: contextContext,
|
|
3457
|
+
localState,
|
|
3458
|
+
rootState,
|
|
3459
|
+
rootSetState
|
|
3460
|
+
} = context;
|
|
3461
|
+
return String(props.text?.toString() || "").replace(/{{([^}]+)}}/g, (match, group) => evaluate({
|
|
3462
|
+
code: group,
|
|
3463
|
+
context: contextContext,
|
|
3464
|
+
localState,
|
|
3465
|
+
rootState,
|
|
3466
|
+
rootSetState,
|
|
3467
|
+
enableCache: false
|
|
3468
|
+
}));
|
|
3469
|
+
});
|
|
3447
3470
|
return (() => {
|
|
3448
3471
|
const _el$ = _tmpl$10();
|
|
3449
3472
|
_el$.style.setProperty("outline", "none");
|
|
3450
|
-
effect(() => _el$.innerHTML =
|
|
3473
|
+
effect(() => _el$.innerHTML = processedText());
|
|
3451
3474
|
return _el$;
|
|
3452
3475
|
})();
|
|
3453
3476
|
}
|
|
@@ -5319,7 +5342,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
5319
5342
|
}
|
|
5320
5343
|
|
|
5321
5344
|
// src/constants/sdk-version.ts
|
|
5322
|
-
var SDK_VERSION = "2.0.
|
|
5345
|
+
var SDK_VERSION = "2.0.8";
|
|
5323
5346
|
|
|
5324
5347
|
// src/functions/register.ts
|
|
5325
5348
|
var registry = {};
|
|
@@ -6194,7 +6217,7 @@ function ContentVariants(props) {
|
|
|
6194
6217
|
},
|
|
6195
6218
|
children: (variant, _index) => {
|
|
6196
6219
|
_index();
|
|
6197
|
-
return createComponent(content_default, {
|
|
6220
|
+
return createComponent(content_default, mergeProps({
|
|
6198
6221
|
get isNestedRender() {
|
|
6199
6222
|
return props.isNestedRender;
|
|
6200
6223
|
},
|
|
@@ -6254,7 +6277,7 @@ function ContentVariants(props) {
|
|
|
6254
6277
|
get trustedHosts() {
|
|
6255
6278
|
return props.trustedHosts;
|
|
6256
6279
|
}
|
|
6257
|
-
});
|
|
6280
|
+
}, {}));
|
|
6258
6281
|
}
|
|
6259
6282
|
})];
|
|
6260
6283
|
}
|
package/lib/node/dev.jsx
CHANGED
|
@@ -692,6 +692,9 @@ function assign(target, ..._args) {
|
|
|
692
692
|
return to;
|
|
693
693
|
}
|
|
694
694
|
function bindAnimations(animations) {
|
|
695
|
+
if (TARGET === "reactNative") {
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
695
698
|
for (const animation of animations) {
|
|
696
699
|
switch (animation.trigger) {
|
|
697
700
|
case "pageLoad":
|
|
@@ -1394,7 +1397,7 @@ function Block(props) {
|
|
|
1394
1397
|
registeredComponents: props.registeredComponents,
|
|
1395
1398
|
builderBlock: processedBlock(),
|
|
1396
1399
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
1397
|
-
isInteractive: !blockComponent()?.isRSC
|
|
1400
|
+
isInteractive: !(blockComponent()?.isRSC && TARGET === "rsc")
|
|
1398
1401
|
};
|
|
1399
1402
|
});
|
|
1400
1403
|
onMount(() => {
|
|
@@ -1719,7 +1722,7 @@ function FragmentComponent(props) {
|
|
|
1719
1722
|
var fragment_default = FragmentComponent;
|
|
1720
1723
|
|
|
1721
1724
|
// src/blocks/image/image.tsx
|
|
1722
|
-
import { Show as Show7, createMemo as createMemo8 } from "solid-js";
|
|
1725
|
+
import { Show as Show7, onMount as onMount2, createMemo as createMemo8 } from "solid-js";
|
|
1723
1726
|
|
|
1724
1727
|
// src/blocks/image/image.helpers.ts
|
|
1725
1728
|
function removeProtocol(path) {
|
|
@@ -1809,12 +1812,14 @@ function Image(props) {
|
|
|
1809
1812
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
1810
1813
|
return out;
|
|
1811
1814
|
});
|
|
1815
|
+
onMount2(() => {
|
|
1816
|
+
});
|
|
1812
1817
|
return <>
|
|
1813
1818
|
<>
|
|
1814
1819
|
<picture>
|
|
1815
1820
|
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
1816
1821
|
<img
|
|
1817
|
-
class={"builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
1822
|
+
class={"builder-image" + (props.className ? " " + props.className : "") + " img-4512e110"}
|
|
1818
1823
|
loading={props.highPriority ? "eager" : "lazy"}
|
|
1819
1824
|
fetchpriority={props.highPriority ? "high" : "auto"}
|
|
1820
1825
|
alt={props.altText}
|
|
@@ -1832,22 +1837,22 @@ function Image(props) {
|
|
|
1832
1837
|
<Show7
|
|
1833
1838
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
1834
1839
|
><div
|
|
1835
|
-
class="builder-image-sizer div-
|
|
1840
|
+
class="builder-image-sizer div-4512e110"
|
|
1836
1841
|
style={{
|
|
1837
1842
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
1838
1843
|
}}
|
|
1839
1844
|
/></Show7>
|
|
1840
1845
|
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
1841
|
-
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-
|
|
1846
|
+
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-4512e110-2">{props.children}</div></Show7>
|
|
1842
1847
|
</>
|
|
1843
|
-
<style>{`.img-
|
|
1848
|
+
<style>{`.img-4512e110 {
|
|
1844
1849
|
opacity: 1;
|
|
1845
1850
|
transition: opacity 0.2s ease-in-out;
|
|
1846
|
-
}.div-
|
|
1851
|
+
}.div-4512e110 {
|
|
1847
1852
|
width: 100%;
|
|
1848
1853
|
pointer-events: none;
|
|
1849
1854
|
font-size: 0;
|
|
1850
|
-
}.div-
|
|
1855
|
+
}.div-4512e110-2 {
|
|
1851
1856
|
display: flex;
|
|
1852
1857
|
flex-direction: column;
|
|
1853
1858
|
align-items: stretch;
|
|
@@ -1883,10 +1888,10 @@ function SectionComponent(props) {
|
|
|
1883
1888
|
var section_default = SectionComponent;
|
|
1884
1889
|
|
|
1885
1890
|
// src/blocks/symbol/symbol.tsx
|
|
1886
|
-
import { onMount as
|
|
1891
|
+
import { onMount as onMount6, on as on3, createEffect as createEffect3, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
1887
1892
|
|
|
1888
1893
|
// src/components/content-variants/content-variants.tsx
|
|
1889
|
-
import { Show as Show14, For as For9, onMount as
|
|
1894
|
+
import { Show as Show14, For as For9, onMount as onMount5, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
1890
1895
|
|
|
1891
1896
|
// src/helpers/url.ts
|
|
1892
1897
|
var getTopLevelDomain = (host) => {
|
|
@@ -2080,7 +2085,7 @@ var handleABTesting = async ({
|
|
|
2080
2085
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2081
2086
|
|
|
2082
2087
|
// src/components/content/content.tsx
|
|
2083
|
-
import { Show as Show13, createSignal as
|
|
2088
|
+
import { Show as Show13, createSignal as createSignal18 } from "solid-js";
|
|
2084
2089
|
|
|
2085
2090
|
// src/blocks/accordion/component-info.ts
|
|
2086
2091
|
var defaultTitle = {
|
|
@@ -3094,7 +3099,8 @@ var tabs_default = Tabs;
|
|
|
3094
3099
|
// src/blocks/text/component-info.ts
|
|
3095
3100
|
var componentInfo10 = {
|
|
3096
3101
|
shouldReceiveBuilderProps: {
|
|
3097
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
3102
|
+
builderBlock: TARGET === "reactNative" ? true : false,
|
|
3103
|
+
builderContext: true
|
|
3098
3104
|
},
|
|
3099
3105
|
name: "Text",
|
|
3100
3106
|
static: true,
|
|
@@ -3116,10 +3122,31 @@ var componentInfo10 = {
|
|
|
3116
3122
|
};
|
|
3117
3123
|
|
|
3118
3124
|
// src/blocks/text/text.tsx
|
|
3125
|
+
import { createMemo as createMemo11 } from "solid-js";
|
|
3119
3126
|
function Text(props) {
|
|
3127
|
+
const processedText = createMemo11(() => {
|
|
3128
|
+
const context = props.builderContext;
|
|
3129
|
+
const {
|
|
3130
|
+
context: contextContext,
|
|
3131
|
+
localState,
|
|
3132
|
+
rootState,
|
|
3133
|
+
rootSetState
|
|
3134
|
+
} = context;
|
|
3135
|
+
return String(props.text?.toString() || "").replace(
|
|
3136
|
+
/{{([^}]+)}}/g,
|
|
3137
|
+
(match, group) => evaluate({
|
|
3138
|
+
code: group,
|
|
3139
|
+
context: contextContext,
|
|
3140
|
+
localState,
|
|
3141
|
+
rootState,
|
|
3142
|
+
rootSetState,
|
|
3143
|
+
enableCache: false
|
|
3144
|
+
})
|
|
3145
|
+
);
|
|
3146
|
+
});
|
|
3120
3147
|
return <><div
|
|
3121
3148
|
class="builder-text"
|
|
3122
|
-
innerHTML={
|
|
3149
|
+
innerHTML={processedText()}
|
|
3123
3150
|
style={{
|
|
3124
3151
|
outline: "none"
|
|
3125
3152
|
}}
|
|
@@ -3153,12 +3180,12 @@ var componentInfo11 = {
|
|
|
3153
3180
|
};
|
|
3154
3181
|
|
|
3155
3182
|
// src/blocks/custom-code/custom-code.tsx
|
|
3156
|
-
import { onMount as
|
|
3183
|
+
import { onMount as onMount3, createSignal as createSignal12 } from "solid-js";
|
|
3157
3184
|
function CustomCode(props) {
|
|
3158
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
3159
|
-
const [scriptsRun, setScriptsRun] =
|
|
3185
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3186
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
3160
3187
|
let elementRef;
|
|
3161
|
-
|
|
3188
|
+
onMount3(() => {
|
|
3162
3189
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
3163
3190
|
return;
|
|
3164
3191
|
}
|
|
@@ -3218,7 +3245,7 @@ var componentInfo12 = {
|
|
|
3218
3245
|
};
|
|
3219
3246
|
|
|
3220
3247
|
// src/blocks/embed/embed.tsx
|
|
3221
|
-
import { on, createEffect, createMemo as
|
|
3248
|
+
import { on, createEffect, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
3222
3249
|
|
|
3223
3250
|
// src/blocks/embed/helpers.ts
|
|
3224
3251
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -3226,9 +3253,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
3226
3253
|
|
|
3227
3254
|
// src/blocks/embed/embed.tsx
|
|
3228
3255
|
function Embed(props) {
|
|
3229
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
3230
|
-
const [scriptsRun, setScriptsRun] =
|
|
3231
|
-
const [ranInitFn, setRanInitFn] =
|
|
3256
|
+
const [scriptsInserted, setScriptsInserted] = createSignal13([]);
|
|
3257
|
+
const [scriptsRun, setScriptsRun] = createSignal13([]);
|
|
3258
|
+
const [ranInitFn, setRanInitFn] = createSignal13(false);
|
|
3232
3259
|
function findAndRunScripts() {
|
|
3233
3260
|
if (!elem || !elem.getElementsByTagName)
|
|
3234
3261
|
return;
|
|
@@ -3252,8 +3279,8 @@ function Embed(props) {
|
|
|
3252
3279
|
}
|
|
3253
3280
|
}
|
|
3254
3281
|
let elem;
|
|
3255
|
-
const onUpdateFn_0_elem =
|
|
3256
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
3282
|
+
const onUpdateFn_0_elem = createMemo13(() => elem);
|
|
3283
|
+
const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
|
|
3257
3284
|
function onUpdateFn_0() {
|
|
3258
3285
|
if (elem && !ranInitFn()) {
|
|
3259
3286
|
setRanInitFn(true);
|
|
@@ -3508,7 +3535,7 @@ var componentInfo13 = {
|
|
|
3508
3535
|
};
|
|
3509
3536
|
|
|
3510
3537
|
// src/blocks/form/form/form.tsx
|
|
3511
|
-
import { Show as Show10, For as For7, createSignal as
|
|
3538
|
+
import { Show as Show10, For as For7, createSignal as createSignal14 } from "solid-js";
|
|
3512
3539
|
|
|
3513
3540
|
// src/functions/get-env.ts
|
|
3514
3541
|
var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
|
|
@@ -3525,9 +3552,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
3525
3552
|
|
|
3526
3553
|
// src/blocks/form/form/form.tsx
|
|
3527
3554
|
function FormComponent(props) {
|
|
3528
|
-
const [formState, setFormState] =
|
|
3529
|
-
const [responseData, setResponseData] =
|
|
3530
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
3555
|
+
const [formState, setFormState] = createSignal14("unsubmitted");
|
|
3556
|
+
const [responseData, setResponseData] = createSignal14(null);
|
|
3557
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal14("");
|
|
3531
3558
|
function mergeNewRootState(newData) {
|
|
3532
3559
|
const combinedState = {
|
|
3533
3560
|
...props.builderContext.rootState,
|
|
@@ -4100,9 +4127,9 @@ var componentInfo19 = {
|
|
|
4100
4127
|
};
|
|
4101
4128
|
|
|
4102
4129
|
// src/blocks/video/video.tsx
|
|
4103
|
-
import { Show as Show11, createMemo as
|
|
4130
|
+
import { Show as Show11, createMemo as createMemo15 } from "solid-js";
|
|
4104
4131
|
function Video(props) {
|
|
4105
|
-
const videoProps =
|
|
4132
|
+
const videoProps = createMemo15(() => {
|
|
4106
4133
|
return {
|
|
4107
4134
|
...props.autoPlay === true ? {
|
|
4108
4135
|
autoPlay: true
|
|
@@ -4121,7 +4148,7 @@ function Video(props) {
|
|
|
4121
4148
|
} : {}
|
|
4122
4149
|
};
|
|
4123
4150
|
});
|
|
4124
|
-
const spreadProps =
|
|
4151
|
+
const spreadProps = createMemo15(() => {
|
|
4125
4152
|
return {
|
|
4126
4153
|
...videoProps()
|
|
4127
4154
|
};
|
|
@@ -4327,11 +4354,11 @@ var Inlined_script_default = InlinedScript;
|
|
|
4327
4354
|
// src/components/content/components/enable-editor.tsx
|
|
4328
4355
|
import {
|
|
4329
4356
|
Show as Show12,
|
|
4330
|
-
onMount as
|
|
4357
|
+
onMount as onMount4,
|
|
4331
4358
|
on as on2,
|
|
4332
4359
|
createEffect as createEffect2,
|
|
4333
|
-
createMemo as
|
|
4334
|
-
createSignal as
|
|
4360
|
+
createMemo as createMemo16,
|
|
4361
|
+
createSignal as createSignal16
|
|
4335
4362
|
} from "solid-js";
|
|
4336
4363
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
4337
4364
|
|
|
@@ -4834,7 +4861,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4834
4861
|
}
|
|
4835
4862
|
|
|
4836
4863
|
// src/constants/sdk-version.ts
|
|
4837
|
-
var SDK_VERSION = "2.0.
|
|
4864
|
+
var SDK_VERSION = "2.0.8";
|
|
4838
4865
|
|
|
4839
4866
|
// src/functions/register.ts
|
|
4840
4867
|
var registry = {};
|
|
@@ -5112,12 +5139,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
5112
5139
|
|
|
5113
5140
|
// src/components/content/components/enable-editor.tsx
|
|
5114
5141
|
function EnableEditor(props) {
|
|
5115
|
-
const [ContentWrapper, setContentWrapper] =
|
|
5142
|
+
const [ContentWrapper, setContentWrapper] = createSignal16(
|
|
5116
5143
|
props.contentWrapper || "div"
|
|
5117
5144
|
);
|
|
5118
|
-
const [httpReqsData, setHttpReqsData] =
|
|
5119
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
5120
|
-
const [clicked, setClicked] =
|
|
5145
|
+
const [httpReqsData, setHttpReqsData] = createSignal16({});
|
|
5146
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal16({});
|
|
5147
|
+
const [clicked, setClicked] = createSignal16(false);
|
|
5121
5148
|
function mergeNewRootState(newData) {
|
|
5122
5149
|
const combinedState = {
|
|
5123
5150
|
...props.builderContextSignal.rootState,
|
|
@@ -5151,7 +5178,7 @@ function EnableEditor(props) {
|
|
|
5151
5178
|
content: newContentValue
|
|
5152
5179
|
}));
|
|
5153
5180
|
}
|
|
5154
|
-
const showContentProps =
|
|
5181
|
+
const showContentProps = createMemo16(() => {
|
|
5155
5182
|
return props.showContent ? {} : {
|
|
5156
5183
|
hidden: true,
|
|
5157
5184
|
"aria-hidden": true
|
|
@@ -5271,7 +5298,7 @@ function EnableEditor(props) {
|
|
|
5271
5298
|
}
|
|
5272
5299
|
}
|
|
5273
5300
|
let elementRef;
|
|
5274
|
-
|
|
5301
|
+
onMount4(() => {
|
|
5275
5302
|
if (isBrowser()) {
|
|
5276
5303
|
if (isEditing()) {
|
|
5277
5304
|
window.addEventListener("message", processMessage);
|
|
@@ -5332,7 +5359,7 @@ function EnableEditor(props) {
|
|
|
5332
5359
|
}
|
|
5333
5360
|
}
|
|
5334
5361
|
});
|
|
5335
|
-
|
|
5362
|
+
onMount4(() => {
|
|
5336
5363
|
if (!props.apiKey) {
|
|
5337
5364
|
logger.error(
|
|
5338
5365
|
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
@@ -5342,14 +5369,14 @@ function EnableEditor(props) {
|
|
|
5342
5369
|
runHttpRequests();
|
|
5343
5370
|
emitStateUpdate();
|
|
5344
5371
|
});
|
|
5345
|
-
const onUpdateFn_0_props_content =
|
|
5372
|
+
const onUpdateFn_0_props_content = createMemo16(() => props.content);
|
|
5346
5373
|
function onUpdateFn_0() {
|
|
5347
5374
|
if (props.content) {
|
|
5348
5375
|
mergeNewContent(props.content);
|
|
5349
5376
|
}
|
|
5350
5377
|
}
|
|
5351
5378
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
5352
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
5379
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo16(() => props.builderContextSignal.content?.data?.jsCode);
|
|
5353
5380
|
function onUpdateFn_1() {
|
|
5354
5381
|
evaluateJsCode();
|
|
5355
5382
|
}
|
|
@@ -5359,7 +5386,7 @@ function EnableEditor(props) {
|
|
|
5359
5386
|
onUpdateFn_1
|
|
5360
5387
|
)
|
|
5361
5388
|
);
|
|
5362
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
5389
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo16(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
5363
5390
|
function onUpdateFn_2() {
|
|
5364
5391
|
runHttpRequests();
|
|
5365
5392
|
}
|
|
@@ -5371,7 +5398,7 @@ function EnableEditor(props) {
|
|
|
5371
5398
|
onUpdateFn_2
|
|
5372
5399
|
)
|
|
5373
5400
|
);
|
|
5374
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
5401
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo16(
|
|
5375
5402
|
() => props.builderContextSignal.rootState
|
|
5376
5403
|
);
|
|
5377
5404
|
function onUpdateFn_3() {
|
|
@@ -5383,14 +5410,14 @@ function EnableEditor(props) {
|
|
|
5383
5410
|
onUpdateFn_3
|
|
5384
5411
|
)
|
|
5385
5412
|
);
|
|
5386
|
-
const onUpdateFn_4_props_data =
|
|
5413
|
+
const onUpdateFn_4_props_data = createMemo16(() => props.data);
|
|
5387
5414
|
function onUpdateFn_4() {
|
|
5388
5415
|
if (props.data) {
|
|
5389
5416
|
mergeNewRootState(props.data);
|
|
5390
5417
|
}
|
|
5391
5418
|
}
|
|
5392
5419
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
5393
|
-
const onUpdateFn_5_props_locale =
|
|
5420
|
+
const onUpdateFn_5_props_locale = createMemo16(() => props.locale);
|
|
5394
5421
|
function onUpdateFn_5() {
|
|
5395
5422
|
if (props.locale) {
|
|
5396
5423
|
mergeNewRootState({
|
|
@@ -5417,9 +5444,9 @@ function EnableEditor(props) {
|
|
|
5417
5444
|
var Enable_editor_default = EnableEditor;
|
|
5418
5445
|
|
|
5419
5446
|
// src/components/content/components/styles.tsx
|
|
5420
|
-
import { createSignal as
|
|
5447
|
+
import { createSignal as createSignal17 } from "solid-js";
|
|
5421
5448
|
function ContentStyles(props) {
|
|
5422
|
-
const [injectedStyles, setInjectedStyles] =
|
|
5449
|
+
const [injectedStyles, setInjectedStyles] = createSignal17(
|
|
5423
5450
|
`
|
|
5424
5451
|
${getCss({
|
|
5425
5452
|
cssCode: props.cssCode,
|
|
@@ -5477,7 +5504,7 @@ var getContentInitialValue = ({
|
|
|
5477
5504
|
|
|
5478
5505
|
// src/components/content/content.tsx
|
|
5479
5506
|
function ContentComponent(props) {
|
|
5480
|
-
const [scriptStr, setScriptStr] =
|
|
5507
|
+
const [scriptStr, setScriptStr] = createSignal18(
|
|
5481
5508
|
getUpdateVariantVisibilityScript({
|
|
5482
5509
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5483
5510
|
variationId: props.content?.testVariationId,
|
|
@@ -5485,7 +5512,7 @@ function ContentComponent(props) {
|
|
|
5485
5512
|
contentId: props.content?.id
|
|
5486
5513
|
})
|
|
5487
5514
|
);
|
|
5488
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
5515
|
+
const [registeredComponents, setRegisteredComponents] = createSignal18(
|
|
5489
5516
|
[
|
|
5490
5517
|
...getDefaultRegisteredComponents(),
|
|
5491
5518
|
...props.customComponents?.filter(({ models }) => {
|
|
@@ -5506,7 +5533,7 @@ function ContentComponent(props) {
|
|
|
5506
5533
|
{}
|
|
5507
5534
|
)
|
|
5508
5535
|
);
|
|
5509
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
5536
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal18({
|
|
5510
5537
|
content: getContentInitialValue({
|
|
5511
5538
|
content: props.content,
|
|
5512
5539
|
data: props.data
|
|
@@ -5596,13 +5623,13 @@ var Content_default = ContentComponent;
|
|
|
5596
5623
|
|
|
5597
5624
|
// src/components/content-variants/content-variants.tsx
|
|
5598
5625
|
function ContentVariants(props) {
|
|
5599
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
5626
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
|
|
5600
5627
|
checkShouldRenderVariants({
|
|
5601
5628
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
5602
5629
|
content: props.content
|
|
5603
5630
|
})
|
|
5604
5631
|
);
|
|
5605
|
-
const updateCookieAndStylesScriptStr =
|
|
5632
|
+
const updateCookieAndStylesScriptStr = createMemo19(() => {
|
|
5606
5633
|
return getUpdateCookieAndStylesScript(
|
|
5607
5634
|
getVariants(props.content).map((value) => ({
|
|
5608
5635
|
id: value.testVariationId,
|
|
@@ -5611,10 +5638,10 @@ function ContentVariants(props) {
|
|
|
5611
5638
|
props.content?.id || ""
|
|
5612
5639
|
);
|
|
5613
5640
|
});
|
|
5614
|
-
const hideVariantsStyleString =
|
|
5641
|
+
const hideVariantsStyleString = createMemo19(() => {
|
|
5615
5642
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
5616
5643
|
});
|
|
5617
|
-
const defaultContent =
|
|
5644
|
+
const defaultContent = createMemo19(() => {
|
|
5618
5645
|
return shouldRenderVariants() ? {
|
|
5619
5646
|
...props.content,
|
|
5620
5647
|
testVariationId: props.content?.id
|
|
@@ -5623,7 +5650,7 @@ function ContentVariants(props) {
|
|
|
5623
5650
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
5624
5651
|
});
|
|
5625
5652
|
});
|
|
5626
|
-
|
|
5653
|
+
onMount5(() => {
|
|
5627
5654
|
setShouldRenderVariants(false);
|
|
5628
5655
|
});
|
|
5629
5656
|
return <><>
|
|
@@ -5667,6 +5694,7 @@ function ContentVariants(props) {
|
|
|
5667
5694
|
contentWrapper={props.contentWrapper}
|
|
5668
5695
|
contentWrapperProps={props.contentWrapperProps}
|
|
5669
5696
|
trustedHosts={props.trustedHosts}
|
|
5697
|
+
{...{}}
|
|
5670
5698
|
/>;
|
|
5671
5699
|
}}</For9>
|
|
5672
5700
|
</Show14>
|
|
@@ -5723,14 +5751,14 @@ var fetchSymbolContent = async ({
|
|
|
5723
5751
|
|
|
5724
5752
|
// src/blocks/symbol/symbol.tsx
|
|
5725
5753
|
function Symbol(props) {
|
|
5726
|
-
const [contentToUse, setContentToUse] =
|
|
5727
|
-
const blocksWrapper =
|
|
5754
|
+
const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
|
|
5755
|
+
const blocksWrapper = createMemo20(() => {
|
|
5728
5756
|
return "div";
|
|
5729
5757
|
});
|
|
5730
|
-
const contentWrapper =
|
|
5758
|
+
const contentWrapper = createMemo20(() => {
|
|
5731
5759
|
return "div";
|
|
5732
5760
|
});
|
|
5733
|
-
const className =
|
|
5761
|
+
const className = createMemo20(() => {
|
|
5734
5762
|
return [
|
|
5735
5763
|
...[props.attributes[getClassPropName()]],
|
|
5736
5764
|
"builder-symbol",
|
|
@@ -5750,9 +5778,9 @@ function Symbol(props) {
|
|
|
5750
5778
|
}
|
|
5751
5779
|
});
|
|
5752
5780
|
}
|
|
5753
|
-
|
|
5781
|
+
onMount6(() => {
|
|
5754
5782
|
});
|
|
5755
|
-
const onUpdateFn_0_props_symbol =
|
|
5783
|
+
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
5756
5784
|
function onUpdateFn_0() {
|
|
5757
5785
|
setContent();
|
|
5758
5786
|
}
|