@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/dist/index.d.ts
CHANGED
|
@@ -480,13 +480,20 @@ interface ComponentInfo {
|
|
|
480
480
|
}
|
|
481
481
|
type Permission = 'read' | 'publish' | 'editCode' | 'editDesigns' | 'admin' | 'create';
|
|
482
482
|
|
|
483
|
+
/**
|
|
484
|
+
* no-op type for extra context types on a per-SDK basis
|
|
485
|
+
* See `overrides/react-native/src/context/extra-context-types.ts` for an example
|
|
486
|
+
* */
|
|
487
|
+
interface ExtraContextTypes {
|
|
488
|
+
}
|
|
489
|
+
|
|
483
490
|
type RegisteredComponent = ComponentInfo & {
|
|
484
491
|
component: any;
|
|
485
492
|
};
|
|
486
493
|
type RegisteredComponents = Dictionary<RegisteredComponent>;
|
|
487
494
|
type BuilderRenderState = Record<string, unknown>;
|
|
488
495
|
type BuilderRenderContext = Record<string, unknown>;
|
|
489
|
-
interface BuilderContextInterface extends Pick<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'
|
|
496
|
+
interface BuilderContextInterface extends Pick<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'>, ExtraContextTypes {
|
|
490
497
|
content: Nullable<BuilderContent>;
|
|
491
498
|
context: BuilderRenderContext;
|
|
492
499
|
/**
|
|
@@ -558,6 +565,7 @@ interface FragmentProps {
|
|
|
558
565
|
declare function FragmentComponent(props: FragmentProps): solid_js.JSX.Element;
|
|
559
566
|
|
|
560
567
|
interface ImageProps {
|
|
568
|
+
attributes?: string;
|
|
561
569
|
highPriority?: boolean;
|
|
562
570
|
className?: string;
|
|
563
571
|
image: string;
|
|
@@ -570,6 +578,7 @@ interface ImageProps {
|
|
|
570
578
|
backgroundPosition?: string;
|
|
571
579
|
srcset?: string;
|
|
572
580
|
aspectRatio?: number;
|
|
581
|
+
lockAspectRatio?: boolean;
|
|
573
582
|
children?: any;
|
|
574
583
|
fitContent?: boolean;
|
|
575
584
|
builderBlock?: BuilderBlock;
|
|
@@ -602,6 +611,7 @@ interface SymbolProps extends BuilderComponentsProp, BuilderDataProps, BuilderLi
|
|
|
602
611
|
dynamic?: boolean;
|
|
603
612
|
attributes?: any;
|
|
604
613
|
inheritState?: boolean;
|
|
614
|
+
renderToLiquid?: boolean;
|
|
605
615
|
}
|
|
606
616
|
|
|
607
617
|
declare function Symbol(props: SymbolProps): solid_js.JSX.Element;
|
|
@@ -643,7 +653,10 @@ type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWra
|
|
|
643
653
|
|
|
644
654
|
declare function Blocks(props: BlocksProps): solid_js.JSX.Element;
|
|
645
655
|
|
|
646
|
-
interface
|
|
656
|
+
interface ExtraFrameworkProps {
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
interface ContentVariantsPrps extends ExtraFrameworkProps {
|
|
647
660
|
/**
|
|
648
661
|
* The Builder content JSON to render (required).
|
|
649
662
|
*/
|
package/lib/browser/dev.js
CHANGED
|
@@ -533,6 +533,9 @@ function assign(target, ..._args) {
|
|
|
533
533
|
return to;
|
|
534
534
|
}
|
|
535
535
|
function bindAnimations(animations) {
|
|
536
|
+
if (TARGET === "reactNative") {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
536
539
|
for (const animation of animations) {
|
|
537
540
|
switch (animation.trigger) {
|
|
538
541
|
case "pageLoad":
|
|
@@ -1275,7 +1278,7 @@ function Block(props) {
|
|
|
1275
1278
|
registeredComponents: props.registeredComponents,
|
|
1276
1279
|
builderBlock: processedBlock(),
|
|
1277
1280
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
1278
|
-
isInteractive: !blockComponent()?.isRSC
|
|
1281
|
+
isInteractive: !(blockComponent()?.isRSC && TARGET === "rsc")
|
|
1279
1282
|
};
|
|
1280
1283
|
});
|
|
1281
1284
|
onMount(() => {
|
|
@@ -1809,16 +1812,16 @@ function getSrcSet(url) {
|
|
|
1809
1812
|
// src/blocks/image/image.tsx
|
|
1810
1813
|
var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
|
|
1811
1814
|
var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
|
|
1812
|
-
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-
|
|
1813
|
-
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-
|
|
1814
|
-
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-
|
|
1815
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-4512e110">`);
|
|
1816
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-4512e110-2>`);
|
|
1817
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-4512e110 {
|
|
1815
1818
|
opacity: 1;
|
|
1816
1819
|
transition: opacity 0.2s ease-in-out;
|
|
1817
|
-
}.div-
|
|
1820
|
+
}.div-4512e110 {
|
|
1818
1821
|
width: 100%;
|
|
1819
1822
|
pointer-events: none;
|
|
1820
1823
|
font-size: 0;
|
|
1821
|
-
}.div-
|
|
1824
|
+
}.div-4512e110-2 {
|
|
1822
1825
|
display: flex;
|
|
1823
1826
|
flex-direction: column;
|
|
1824
1827
|
align-items: stretch;
|
|
@@ -1868,6 +1871,8 @@ function Image(props) {
|
|
|
1868
1871
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
1869
1872
|
return out;
|
|
1870
1873
|
});
|
|
1874
|
+
onMount(() => {
|
|
1875
|
+
});
|
|
1871
1876
|
return [[(() => {
|
|
1872
1877
|
const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
|
|
1873
1878
|
insert(_el$, createComponent(Show, {
|
|
@@ -1881,7 +1886,7 @@ function Image(props) {
|
|
|
1881
1886
|
}
|
|
1882
1887
|
}), _el$3);
|
|
1883
1888
|
effect((_p$) => {
|
|
1884
|
-
const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
1889
|
+
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 = {
|
|
1885
1890
|
"object-position": props.backgroundPosition || "center",
|
|
1886
1891
|
"object-fit": props.backgroundSize || "cover",
|
|
1887
1892
|
...aspectRatioCss()
|
|
@@ -3252,7 +3257,8 @@ delegateEvents(["click"]);
|
|
|
3252
3257
|
// src/blocks/text/component-info.ts
|
|
3253
3258
|
var componentInfo10 = {
|
|
3254
3259
|
shouldReceiveBuilderProps: {
|
|
3255
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
3260
|
+
builderBlock: TARGET === "reactNative" ? true : false,
|
|
3261
|
+
builderContext: true
|
|
3256
3262
|
},
|
|
3257
3263
|
name: "Text",
|
|
3258
3264
|
static: true,
|
|
@@ -3274,10 +3280,27 @@ var componentInfo10 = {
|
|
|
3274
3280
|
};
|
|
3275
3281
|
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
3276
3282
|
function Text(props) {
|
|
3283
|
+
const processedText = createMemo(() => {
|
|
3284
|
+
const context = props.builderContext;
|
|
3285
|
+
const {
|
|
3286
|
+
context: contextContext,
|
|
3287
|
+
localState,
|
|
3288
|
+
rootState,
|
|
3289
|
+
rootSetState
|
|
3290
|
+
} = context;
|
|
3291
|
+
return String(props.text?.toString() || "").replace(/{{([^}]+)}}/g, (match, group) => evaluate({
|
|
3292
|
+
code: group,
|
|
3293
|
+
context: contextContext,
|
|
3294
|
+
localState,
|
|
3295
|
+
rootState,
|
|
3296
|
+
rootSetState,
|
|
3297
|
+
enableCache: false
|
|
3298
|
+
}));
|
|
3299
|
+
});
|
|
3277
3300
|
return (() => {
|
|
3278
3301
|
const _el$ = _tmpl$10();
|
|
3279
3302
|
_el$.style.setProperty("outline", "none");
|
|
3280
|
-
effect(() => _el$.innerHTML =
|
|
3303
|
+
effect(() => _el$.innerHTML = processedText());
|
|
3281
3304
|
return _el$;
|
|
3282
3305
|
})();
|
|
3283
3306
|
}
|
|
@@ -5149,7 +5172,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
5149
5172
|
}
|
|
5150
5173
|
|
|
5151
5174
|
// src/constants/sdk-version.ts
|
|
5152
|
-
var SDK_VERSION = "2.0.
|
|
5175
|
+
var SDK_VERSION = "2.0.8";
|
|
5153
5176
|
|
|
5154
5177
|
// src/functions/register.ts
|
|
5155
5178
|
var registry = {};
|
|
@@ -6024,7 +6047,7 @@ function ContentVariants(props) {
|
|
|
6024
6047
|
},
|
|
6025
6048
|
children: (variant, _index) => {
|
|
6026
6049
|
_index();
|
|
6027
|
-
return createComponent(content_default, {
|
|
6050
|
+
return createComponent(content_default, mergeProps({
|
|
6028
6051
|
get isNestedRender() {
|
|
6029
6052
|
return props.isNestedRender;
|
|
6030
6053
|
},
|
|
@@ -6084,7 +6107,7 @@ function ContentVariants(props) {
|
|
|
6084
6107
|
get trustedHosts() {
|
|
6085
6108
|
return props.trustedHosts;
|
|
6086
6109
|
}
|
|
6087
|
-
});
|
|
6110
|
+
}, {}));
|
|
6088
6111
|
}
|
|
6089
6112
|
})];
|
|
6090
6113
|
}
|
package/lib/browser/dev.jsx
CHANGED
|
@@ -520,6 +520,9 @@ function assign(target, ..._args) {
|
|
|
520
520
|
return to;
|
|
521
521
|
}
|
|
522
522
|
function bindAnimations(animations) {
|
|
523
|
+
if (TARGET === "reactNative") {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
523
526
|
for (const animation of animations) {
|
|
524
527
|
switch (animation.trigger) {
|
|
525
528
|
case "pageLoad":
|
|
@@ -1222,7 +1225,7 @@ function Block(props) {
|
|
|
1222
1225
|
registeredComponents: props.registeredComponents,
|
|
1223
1226
|
builderBlock: processedBlock(),
|
|
1224
1227
|
includeBlockProps: blockComponent()?.noWrap === true,
|
|
1225
|
-
isInteractive: !blockComponent()?.isRSC
|
|
1228
|
+
isInteractive: !(blockComponent()?.isRSC && TARGET === "rsc")
|
|
1226
1229
|
};
|
|
1227
1230
|
});
|
|
1228
1231
|
onMount(() => {
|
|
@@ -1547,7 +1550,7 @@ function FragmentComponent(props) {
|
|
|
1547
1550
|
var fragment_default = FragmentComponent;
|
|
1548
1551
|
|
|
1549
1552
|
// src/blocks/image/image.tsx
|
|
1550
|
-
import { Show as Show7, createMemo as createMemo8 } from "solid-js";
|
|
1553
|
+
import { Show as Show7, onMount as onMount2, createMemo as createMemo8 } from "solid-js";
|
|
1551
1554
|
|
|
1552
1555
|
// src/blocks/image/image.helpers.ts
|
|
1553
1556
|
function removeProtocol(path) {
|
|
@@ -1637,12 +1640,14 @@ function Image(props) {
|
|
|
1637
1640
|
const out = props.aspectRatio ? aspectRatioStyles : void 0;
|
|
1638
1641
|
return out;
|
|
1639
1642
|
});
|
|
1643
|
+
onMount2(() => {
|
|
1644
|
+
});
|
|
1640
1645
|
return <>
|
|
1641
1646
|
<>
|
|
1642
1647
|
<picture>
|
|
1643
1648
|
<Show7 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show7>
|
|
1644
1649
|
<img
|
|
1645
|
-
class={"builder-image" + (props.className ? " " + props.className : "") + " img-
|
|
1650
|
+
class={"builder-image" + (props.className ? " " + props.className : "") + " img-4512e110"}
|
|
1646
1651
|
loading={props.highPriority ? "eager" : "lazy"}
|
|
1647
1652
|
fetchpriority={props.highPriority ? "high" : "auto"}
|
|
1648
1653
|
alt={props.altText}
|
|
@@ -1660,22 +1665,22 @@ function Image(props) {
|
|
|
1660
1665
|
<Show7
|
|
1661
1666
|
when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
|
|
1662
1667
|
><div
|
|
1663
|
-
class="builder-image-sizer div-
|
|
1668
|
+
class="builder-image-sizer div-4512e110"
|
|
1664
1669
|
style={{
|
|
1665
1670
|
"padding-top": props.aspectRatio * 100 + "%"
|
|
1666
1671
|
}}
|
|
1667
1672
|
/></Show7>
|
|
1668
1673
|
<Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
|
|
1669
|
-
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-
|
|
1674
|
+
<Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-4512e110-2">{props.children}</div></Show7>
|
|
1670
1675
|
</>
|
|
1671
|
-
<style>{`.img-
|
|
1676
|
+
<style>{`.img-4512e110 {
|
|
1672
1677
|
opacity: 1;
|
|
1673
1678
|
transition: opacity 0.2s ease-in-out;
|
|
1674
|
-
}.div-
|
|
1679
|
+
}.div-4512e110 {
|
|
1675
1680
|
width: 100%;
|
|
1676
1681
|
pointer-events: none;
|
|
1677
1682
|
font-size: 0;
|
|
1678
|
-
}.div-
|
|
1683
|
+
}.div-4512e110-2 {
|
|
1679
1684
|
display: flex;
|
|
1680
1685
|
flex-direction: column;
|
|
1681
1686
|
align-items: stretch;
|
|
@@ -1711,10 +1716,10 @@ function SectionComponent(props) {
|
|
|
1711
1716
|
var section_default = SectionComponent;
|
|
1712
1717
|
|
|
1713
1718
|
// src/blocks/symbol/symbol.tsx
|
|
1714
|
-
import { onMount as
|
|
1719
|
+
import { onMount as onMount6, on as on3, createEffect as createEffect3, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
|
|
1715
1720
|
|
|
1716
1721
|
// src/components/content-variants/content-variants.tsx
|
|
1717
|
-
import { Show as Show14, For as For9, onMount as
|
|
1722
|
+
import { Show as Show14, For as For9, onMount as onMount5, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
|
|
1718
1723
|
|
|
1719
1724
|
// src/helpers/url.ts
|
|
1720
1725
|
var getTopLevelDomain = (host) => {
|
|
@@ -1908,7 +1913,7 @@ var handleABTesting = async ({
|
|
|
1908
1913
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
1909
1914
|
|
|
1910
1915
|
// src/components/content/content.tsx
|
|
1911
|
-
import { Show as Show13, createSignal as
|
|
1916
|
+
import { Show as Show13, createSignal as createSignal18 } from "solid-js";
|
|
1912
1917
|
|
|
1913
1918
|
// src/blocks/accordion/component-info.ts
|
|
1914
1919
|
var defaultTitle = {
|
|
@@ -2922,7 +2927,8 @@ var tabs_default = Tabs;
|
|
|
2922
2927
|
// src/blocks/text/component-info.ts
|
|
2923
2928
|
var componentInfo10 = {
|
|
2924
2929
|
shouldReceiveBuilderProps: {
|
|
2925
|
-
builderBlock: TARGET === "reactNative" ? true : false
|
|
2930
|
+
builderBlock: TARGET === "reactNative" ? true : false,
|
|
2931
|
+
builderContext: true
|
|
2926
2932
|
},
|
|
2927
2933
|
name: "Text",
|
|
2928
2934
|
static: true,
|
|
@@ -2944,10 +2950,31 @@ var componentInfo10 = {
|
|
|
2944
2950
|
};
|
|
2945
2951
|
|
|
2946
2952
|
// src/blocks/text/text.tsx
|
|
2953
|
+
import { createMemo as createMemo11 } from "solid-js";
|
|
2947
2954
|
function Text(props) {
|
|
2955
|
+
const processedText = createMemo11(() => {
|
|
2956
|
+
const context = props.builderContext;
|
|
2957
|
+
const {
|
|
2958
|
+
context: contextContext,
|
|
2959
|
+
localState,
|
|
2960
|
+
rootState,
|
|
2961
|
+
rootSetState
|
|
2962
|
+
} = context;
|
|
2963
|
+
return String(props.text?.toString() || "").replace(
|
|
2964
|
+
/{{([^}]+)}}/g,
|
|
2965
|
+
(match, group) => evaluate({
|
|
2966
|
+
code: group,
|
|
2967
|
+
context: contextContext,
|
|
2968
|
+
localState,
|
|
2969
|
+
rootState,
|
|
2970
|
+
rootSetState,
|
|
2971
|
+
enableCache: false
|
|
2972
|
+
})
|
|
2973
|
+
);
|
|
2974
|
+
});
|
|
2948
2975
|
return <><div
|
|
2949
2976
|
class="builder-text"
|
|
2950
|
-
innerHTML={
|
|
2977
|
+
innerHTML={processedText()}
|
|
2951
2978
|
style={{
|
|
2952
2979
|
outline: "none"
|
|
2953
2980
|
}}
|
|
@@ -2981,12 +3008,12 @@ var componentInfo11 = {
|
|
|
2981
3008
|
};
|
|
2982
3009
|
|
|
2983
3010
|
// src/blocks/custom-code/custom-code.tsx
|
|
2984
|
-
import { onMount as
|
|
3011
|
+
import { onMount as onMount3, createSignal as createSignal12 } from "solid-js";
|
|
2985
3012
|
function CustomCode(props) {
|
|
2986
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
2987
|
-
const [scriptsRun, setScriptsRun] =
|
|
3013
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3014
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
2988
3015
|
let elementRef;
|
|
2989
|
-
|
|
3016
|
+
onMount3(() => {
|
|
2990
3017
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
2991
3018
|
return;
|
|
2992
3019
|
}
|
|
@@ -3046,7 +3073,7 @@ var componentInfo12 = {
|
|
|
3046
3073
|
};
|
|
3047
3074
|
|
|
3048
3075
|
// src/blocks/embed/embed.tsx
|
|
3049
|
-
import { on, createEffect, createMemo as
|
|
3076
|
+
import { on, createEffect, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
3050
3077
|
|
|
3051
3078
|
// src/blocks/embed/helpers.ts
|
|
3052
3079
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -3054,9 +3081,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
3054
3081
|
|
|
3055
3082
|
// src/blocks/embed/embed.tsx
|
|
3056
3083
|
function Embed(props) {
|
|
3057
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
3058
|
-
const [scriptsRun, setScriptsRun] =
|
|
3059
|
-
const [ranInitFn, setRanInitFn] =
|
|
3084
|
+
const [scriptsInserted, setScriptsInserted] = createSignal13([]);
|
|
3085
|
+
const [scriptsRun, setScriptsRun] = createSignal13([]);
|
|
3086
|
+
const [ranInitFn, setRanInitFn] = createSignal13(false);
|
|
3060
3087
|
function findAndRunScripts() {
|
|
3061
3088
|
if (!elem || !elem.getElementsByTagName)
|
|
3062
3089
|
return;
|
|
@@ -3080,8 +3107,8 @@ function Embed(props) {
|
|
|
3080
3107
|
}
|
|
3081
3108
|
}
|
|
3082
3109
|
let elem;
|
|
3083
|
-
const onUpdateFn_0_elem =
|
|
3084
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
3110
|
+
const onUpdateFn_0_elem = createMemo13(() => elem);
|
|
3111
|
+
const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
|
|
3085
3112
|
function onUpdateFn_0() {
|
|
3086
3113
|
if (elem && !ranInitFn()) {
|
|
3087
3114
|
setRanInitFn(true);
|
|
@@ -3336,7 +3363,7 @@ var componentInfo13 = {
|
|
|
3336
3363
|
};
|
|
3337
3364
|
|
|
3338
3365
|
// src/blocks/form/form/form.tsx
|
|
3339
|
-
import { Show as Show10, For as For7, createSignal as
|
|
3366
|
+
import { Show as Show10, For as For7, createSignal as createSignal14 } from "solid-js";
|
|
3340
3367
|
|
|
3341
3368
|
// src/functions/get-env.ts
|
|
3342
3369
|
var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
|
|
@@ -3353,9 +3380,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
3353
3380
|
|
|
3354
3381
|
// src/blocks/form/form/form.tsx
|
|
3355
3382
|
function FormComponent(props) {
|
|
3356
|
-
const [formState, setFormState] =
|
|
3357
|
-
const [responseData, setResponseData] =
|
|
3358
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
3383
|
+
const [formState, setFormState] = createSignal14("unsubmitted");
|
|
3384
|
+
const [responseData, setResponseData] = createSignal14(null);
|
|
3385
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal14("");
|
|
3359
3386
|
function mergeNewRootState(newData) {
|
|
3360
3387
|
const combinedState = {
|
|
3361
3388
|
...props.builderContext.rootState,
|
|
@@ -3928,9 +3955,9 @@ var componentInfo19 = {
|
|
|
3928
3955
|
};
|
|
3929
3956
|
|
|
3930
3957
|
// src/blocks/video/video.tsx
|
|
3931
|
-
import { Show as Show11, createMemo as
|
|
3958
|
+
import { Show as Show11, createMemo as createMemo15 } from "solid-js";
|
|
3932
3959
|
function Video(props) {
|
|
3933
|
-
const videoProps =
|
|
3960
|
+
const videoProps = createMemo15(() => {
|
|
3934
3961
|
return {
|
|
3935
3962
|
...props.autoPlay === true ? {
|
|
3936
3963
|
autoPlay: true
|
|
@@ -3949,7 +3976,7 @@ function Video(props) {
|
|
|
3949
3976
|
} : {}
|
|
3950
3977
|
};
|
|
3951
3978
|
});
|
|
3952
|
-
const spreadProps =
|
|
3979
|
+
const spreadProps = createMemo15(() => {
|
|
3953
3980
|
return {
|
|
3954
3981
|
...videoProps()
|
|
3955
3982
|
};
|
|
@@ -4155,11 +4182,11 @@ var Inlined_script_default = InlinedScript;
|
|
|
4155
4182
|
// src/components/content/components/enable-editor.tsx
|
|
4156
4183
|
import {
|
|
4157
4184
|
Show as Show12,
|
|
4158
|
-
onMount as
|
|
4185
|
+
onMount as onMount4,
|
|
4159
4186
|
on as on2,
|
|
4160
4187
|
createEffect as createEffect2,
|
|
4161
|
-
createMemo as
|
|
4162
|
-
createSignal as
|
|
4188
|
+
createMemo as createMemo16,
|
|
4189
|
+
createSignal as createSignal16
|
|
4163
4190
|
} from "solid-js";
|
|
4164
4191
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
4165
4192
|
|
|
@@ -4662,7 +4689,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4662
4689
|
}
|
|
4663
4690
|
|
|
4664
4691
|
// src/constants/sdk-version.ts
|
|
4665
|
-
var SDK_VERSION = "2.0.
|
|
4692
|
+
var SDK_VERSION = "2.0.8";
|
|
4666
4693
|
|
|
4667
4694
|
// src/functions/register.ts
|
|
4668
4695
|
var registry = {};
|
|
@@ -4940,12 +4967,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
4940
4967
|
|
|
4941
4968
|
// src/components/content/components/enable-editor.tsx
|
|
4942
4969
|
function EnableEditor(props) {
|
|
4943
|
-
const [ContentWrapper, setContentWrapper] =
|
|
4970
|
+
const [ContentWrapper, setContentWrapper] = createSignal16(
|
|
4944
4971
|
props.contentWrapper || "div"
|
|
4945
4972
|
);
|
|
4946
|
-
const [httpReqsData, setHttpReqsData] =
|
|
4947
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
4948
|
-
const [clicked, setClicked] =
|
|
4973
|
+
const [httpReqsData, setHttpReqsData] = createSignal16({});
|
|
4974
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal16({});
|
|
4975
|
+
const [clicked, setClicked] = createSignal16(false);
|
|
4949
4976
|
function mergeNewRootState(newData) {
|
|
4950
4977
|
const combinedState = {
|
|
4951
4978
|
...props.builderContextSignal.rootState,
|
|
@@ -4979,7 +5006,7 @@ function EnableEditor(props) {
|
|
|
4979
5006
|
content: newContentValue
|
|
4980
5007
|
}));
|
|
4981
5008
|
}
|
|
4982
|
-
const showContentProps =
|
|
5009
|
+
const showContentProps = createMemo16(() => {
|
|
4983
5010
|
return props.showContent ? {} : {
|
|
4984
5011
|
hidden: true,
|
|
4985
5012
|
"aria-hidden": true
|
|
@@ -5099,7 +5126,7 @@ function EnableEditor(props) {
|
|
|
5099
5126
|
}
|
|
5100
5127
|
}
|
|
5101
5128
|
let elementRef;
|
|
5102
|
-
|
|
5129
|
+
onMount4(() => {
|
|
5103
5130
|
if (isBrowser()) {
|
|
5104
5131
|
if (isEditing()) {
|
|
5105
5132
|
window.addEventListener("message", processMessage);
|
|
@@ -5160,7 +5187,7 @@ function EnableEditor(props) {
|
|
|
5160
5187
|
}
|
|
5161
5188
|
}
|
|
5162
5189
|
});
|
|
5163
|
-
|
|
5190
|
+
onMount4(() => {
|
|
5164
5191
|
if (!props.apiKey) {
|
|
5165
5192
|
logger.error(
|
|
5166
5193
|
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
@@ -5170,14 +5197,14 @@ function EnableEditor(props) {
|
|
|
5170
5197
|
runHttpRequests();
|
|
5171
5198
|
emitStateUpdate();
|
|
5172
5199
|
});
|
|
5173
|
-
const onUpdateFn_0_props_content =
|
|
5200
|
+
const onUpdateFn_0_props_content = createMemo16(() => props.content);
|
|
5174
5201
|
function onUpdateFn_0() {
|
|
5175
5202
|
if (props.content) {
|
|
5176
5203
|
mergeNewContent(props.content);
|
|
5177
5204
|
}
|
|
5178
5205
|
}
|
|
5179
5206
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
5180
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
5207
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo16(() => props.builderContextSignal.content?.data?.jsCode);
|
|
5181
5208
|
function onUpdateFn_1() {
|
|
5182
5209
|
evaluateJsCode();
|
|
5183
5210
|
}
|
|
@@ -5187,7 +5214,7 @@ function EnableEditor(props) {
|
|
|
5187
5214
|
onUpdateFn_1
|
|
5188
5215
|
)
|
|
5189
5216
|
);
|
|
5190
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
5217
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo16(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
5191
5218
|
function onUpdateFn_2() {
|
|
5192
5219
|
runHttpRequests();
|
|
5193
5220
|
}
|
|
@@ -5199,7 +5226,7 @@ function EnableEditor(props) {
|
|
|
5199
5226
|
onUpdateFn_2
|
|
5200
5227
|
)
|
|
5201
5228
|
);
|
|
5202
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
5229
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo16(
|
|
5203
5230
|
() => props.builderContextSignal.rootState
|
|
5204
5231
|
);
|
|
5205
5232
|
function onUpdateFn_3() {
|
|
@@ -5211,14 +5238,14 @@ function EnableEditor(props) {
|
|
|
5211
5238
|
onUpdateFn_3
|
|
5212
5239
|
)
|
|
5213
5240
|
);
|
|
5214
|
-
const onUpdateFn_4_props_data =
|
|
5241
|
+
const onUpdateFn_4_props_data = createMemo16(() => props.data);
|
|
5215
5242
|
function onUpdateFn_4() {
|
|
5216
5243
|
if (props.data) {
|
|
5217
5244
|
mergeNewRootState(props.data);
|
|
5218
5245
|
}
|
|
5219
5246
|
}
|
|
5220
5247
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
5221
|
-
const onUpdateFn_5_props_locale =
|
|
5248
|
+
const onUpdateFn_5_props_locale = createMemo16(() => props.locale);
|
|
5222
5249
|
function onUpdateFn_5() {
|
|
5223
5250
|
if (props.locale) {
|
|
5224
5251
|
mergeNewRootState({
|
|
@@ -5245,9 +5272,9 @@ function EnableEditor(props) {
|
|
|
5245
5272
|
var Enable_editor_default = EnableEditor;
|
|
5246
5273
|
|
|
5247
5274
|
// src/components/content/components/styles.tsx
|
|
5248
|
-
import { createSignal as
|
|
5275
|
+
import { createSignal as createSignal17 } from "solid-js";
|
|
5249
5276
|
function ContentStyles(props) {
|
|
5250
|
-
const [injectedStyles, setInjectedStyles] =
|
|
5277
|
+
const [injectedStyles, setInjectedStyles] = createSignal17(
|
|
5251
5278
|
`
|
|
5252
5279
|
${getCss({
|
|
5253
5280
|
cssCode: props.cssCode,
|
|
@@ -5305,7 +5332,7 @@ var getContentInitialValue = ({
|
|
|
5305
5332
|
|
|
5306
5333
|
// src/components/content/content.tsx
|
|
5307
5334
|
function ContentComponent(props) {
|
|
5308
|
-
const [scriptStr, setScriptStr] =
|
|
5335
|
+
const [scriptStr, setScriptStr] = createSignal18(
|
|
5309
5336
|
getUpdateVariantVisibilityScript({
|
|
5310
5337
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
5311
5338
|
variationId: props.content?.testVariationId,
|
|
@@ -5313,7 +5340,7 @@ function ContentComponent(props) {
|
|
|
5313
5340
|
contentId: props.content?.id
|
|
5314
5341
|
})
|
|
5315
5342
|
);
|
|
5316
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
5343
|
+
const [registeredComponents, setRegisteredComponents] = createSignal18(
|
|
5317
5344
|
[
|
|
5318
5345
|
...getDefaultRegisteredComponents(),
|
|
5319
5346
|
...props.customComponents?.filter(({ models }) => {
|
|
@@ -5334,7 +5361,7 @@ function ContentComponent(props) {
|
|
|
5334
5361
|
{}
|
|
5335
5362
|
)
|
|
5336
5363
|
);
|
|
5337
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
5364
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal18({
|
|
5338
5365
|
content: getContentInitialValue({
|
|
5339
5366
|
content: props.content,
|
|
5340
5367
|
data: props.data
|
|
@@ -5424,13 +5451,13 @@ var Content_default = ContentComponent;
|
|
|
5424
5451
|
|
|
5425
5452
|
// src/components/content-variants/content-variants.tsx
|
|
5426
5453
|
function ContentVariants(props) {
|
|
5427
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
5454
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
|
|
5428
5455
|
checkShouldRenderVariants({
|
|
5429
5456
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
5430
5457
|
content: props.content
|
|
5431
5458
|
})
|
|
5432
5459
|
);
|
|
5433
|
-
const updateCookieAndStylesScriptStr =
|
|
5460
|
+
const updateCookieAndStylesScriptStr = createMemo19(() => {
|
|
5434
5461
|
return getUpdateCookieAndStylesScript(
|
|
5435
5462
|
getVariants(props.content).map((value) => ({
|
|
5436
5463
|
id: value.testVariationId,
|
|
@@ -5439,10 +5466,10 @@ function ContentVariants(props) {
|
|
|
5439
5466
|
props.content?.id || ""
|
|
5440
5467
|
);
|
|
5441
5468
|
});
|
|
5442
|
-
const hideVariantsStyleString =
|
|
5469
|
+
const hideVariantsStyleString = createMemo19(() => {
|
|
5443
5470
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
5444
5471
|
});
|
|
5445
|
-
const defaultContent =
|
|
5472
|
+
const defaultContent = createMemo19(() => {
|
|
5446
5473
|
return shouldRenderVariants() ? {
|
|
5447
5474
|
...props.content,
|
|
5448
5475
|
testVariationId: props.content?.id
|
|
@@ -5451,7 +5478,7 @@ function ContentVariants(props) {
|
|
|
5451
5478
|
canTrack: getDefaultCanTrack(props.canTrack)
|
|
5452
5479
|
});
|
|
5453
5480
|
});
|
|
5454
|
-
|
|
5481
|
+
onMount5(() => {
|
|
5455
5482
|
setShouldRenderVariants(false);
|
|
5456
5483
|
});
|
|
5457
5484
|
return <><>
|
|
@@ -5495,6 +5522,7 @@ function ContentVariants(props) {
|
|
|
5495
5522
|
contentWrapper={props.contentWrapper}
|
|
5496
5523
|
contentWrapperProps={props.contentWrapperProps}
|
|
5497
5524
|
trustedHosts={props.trustedHosts}
|
|
5525
|
+
{...{}}
|
|
5498
5526
|
/>;
|
|
5499
5527
|
}}</For9>
|
|
5500
5528
|
</Show14>
|
|
@@ -5551,14 +5579,14 @@ var fetchSymbolContent = async ({
|
|
|
5551
5579
|
|
|
5552
5580
|
// src/blocks/symbol/symbol.tsx
|
|
5553
5581
|
function Symbol(props) {
|
|
5554
|
-
const [contentToUse, setContentToUse] =
|
|
5555
|
-
const blocksWrapper =
|
|
5582
|
+
const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
|
|
5583
|
+
const blocksWrapper = createMemo20(() => {
|
|
5556
5584
|
return "div";
|
|
5557
5585
|
});
|
|
5558
|
-
const contentWrapper =
|
|
5586
|
+
const contentWrapper = createMemo20(() => {
|
|
5559
5587
|
return "div";
|
|
5560
5588
|
});
|
|
5561
|
-
const className =
|
|
5589
|
+
const className = createMemo20(() => {
|
|
5562
5590
|
return [
|
|
5563
5591
|
...[props.attributes[getClassPropName()]],
|
|
5564
5592
|
"builder-symbol",
|
|
@@ -5578,9 +5606,9 @@ function Symbol(props) {
|
|
|
5578
5606
|
}
|
|
5579
5607
|
});
|
|
5580
5608
|
}
|
|
5581
|
-
|
|
5609
|
+
onMount6(() => {
|
|
5582
5610
|
});
|
|
5583
|
-
const onUpdateFn_0_props_symbol =
|
|
5611
|
+
const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
|
|
5584
5612
|
function onUpdateFn_0() {
|
|
5585
5613
|
setContent();
|
|
5586
5614
|
}
|