@builder.io/sdk-solid 4.2.1 → 4.2.2
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 +57 -34
- package/lib/browser/dev.jsx +53 -56
- package/lib/browser/index.js +57 -34
- package/lib/browser/index.jsx +53 -56
- package/lib/edge/dev.js +57 -34
- package/lib/edge/dev.jsx +53 -56
- package/lib/edge/index.js +57 -34
- package/lib/edge/index.jsx +53 -56
- package/lib/node/dev.js +57 -34
- package/lib/node/dev.jsx +53 -56
- package/lib/node/index.js +57 -34
- package/lib/node/index.jsx +53 -56
- package/package.json +1 -1
package/lib/node/index.js
CHANGED
|
@@ -1480,11 +1480,6 @@ var getWrapperProps = ({
|
|
|
1480
1480
|
function ComponentRef(props) {
|
|
1481
1481
|
createSignal(false);
|
|
1482
1482
|
const [Wrapper, setWrapper] = createSignal(props.isInteractive ? interactive_element_default : props.componentRef);
|
|
1483
|
-
const onUpdateFn_0_props_componentOptions = createMemo(() => props.componentOptions);
|
|
1484
|
-
const onUpdateFn_0_props_blockChildren = createMemo(() => props.blockChildren);
|
|
1485
|
-
function onUpdateFn_0() {
|
|
1486
|
-
}
|
|
1487
|
-
createEffect(on(() => [onUpdateFn_0_props_componentOptions(), onUpdateFn_0_props_blockChildren()], onUpdateFn_0));
|
|
1488
1483
|
return createComponent(Show, {
|
|
1489
1484
|
get when() {
|
|
1490
1485
|
return props.componentRef;
|
|
@@ -1504,25 +1499,32 @@ function ComponentRef(props) {
|
|
|
1504
1499
|
return Wrapper();
|
|
1505
1500
|
},
|
|
1506
1501
|
get children() {
|
|
1507
|
-
return createComponent(
|
|
1508
|
-
get
|
|
1509
|
-
return props.
|
|
1502
|
+
return createComponent(Show, {
|
|
1503
|
+
get when() {
|
|
1504
|
+
return props.componentRef;
|
|
1510
1505
|
},
|
|
1511
|
-
children
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
return child.id;
|
|
1516
|
-
},
|
|
1517
|
-
block: child,
|
|
1518
|
-
get context() {
|
|
1519
|
-
return props.context;
|
|
1520
|
-
},
|
|
1521
|
-
get registeredComponents() {
|
|
1522
|
-
return props.registeredComponents;
|
|
1506
|
+
get children() {
|
|
1507
|
+
return createComponent(For, {
|
|
1508
|
+
get each() {
|
|
1509
|
+
return props.blockChildren;
|
|
1523
1510
|
},
|
|
1524
|
-
|
|
1525
|
-
|
|
1511
|
+
children: (child, _index) => {
|
|
1512
|
+
_index();
|
|
1513
|
+
return createComponent(block_default, {
|
|
1514
|
+
get key() {
|
|
1515
|
+
return child.id;
|
|
1516
|
+
},
|
|
1517
|
+
block: child,
|
|
1518
|
+
get context() {
|
|
1519
|
+
return props.context;
|
|
1520
|
+
},
|
|
1521
|
+
get registeredComponents() {
|
|
1522
|
+
return props.registeredComponents;
|
|
1523
|
+
},
|
|
1524
|
+
get linkComponent() {
|
|
1525
|
+
return props.linkComponent;
|
|
1526
|
+
}
|
|
1527
|
+
});
|
|
1526
1528
|
}
|
|
1527
1529
|
});
|
|
1528
1530
|
}
|
|
@@ -1829,7 +1831,7 @@ function Block(props) {
|
|
|
1829
1831
|
});
|
|
1830
1832
|
}
|
|
1831
1833
|
var block_default = Block;
|
|
1832
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-
|
|
1834
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-4d836538 {
|
|
1833
1835
|
display: flex;
|
|
1834
1836
|
flex-direction: column;
|
|
1835
1837
|
align-items: stretch;
|
|
@@ -1878,7 +1880,7 @@ function BlocksWrapper(props) {
|
|
|
1878
1880
|
createEffect(on(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
|
|
1879
1881
|
return [createComponent(Dynamic, mergeProps({
|
|
1880
1882
|
get ["class"]() {
|
|
1881
|
-
return className() + " dynamic-
|
|
1883
|
+
return className() + " dynamic-4d836538";
|
|
1882
1884
|
},
|
|
1883
1885
|
ref(r$) {
|
|
1884
1886
|
const _ref$ = blocksWrapperRef;
|
|
@@ -4131,6 +4133,9 @@ function Tabs(props) {
|
|
|
4131
4133
|
function activeTabContent(active) {
|
|
4132
4134
|
return props.tabs && props.tabs[active].content;
|
|
4133
4135
|
}
|
|
4136
|
+
function getTabStyle(index) {
|
|
4137
|
+
return index === activeTab() ? props.activeTabStyle : {};
|
|
4138
|
+
}
|
|
4134
4139
|
function onClick(index) {
|
|
4135
4140
|
if (index === activeTab() && props.collapsible) {
|
|
4136
4141
|
setActiveTab(-1);
|
|
@@ -4172,9 +4177,7 @@ function Tabs(props) {
|
|
|
4172
4177
|
}
|
|
4173
4178
|
}));
|
|
4174
4179
|
effect((_p$) => {
|
|
4175
|
-
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 =
|
|
4176
|
-
...activeTab() === index ? props.activeTabStyle : {}
|
|
4177
|
-
};
|
|
4180
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getTabStyle(index);
|
|
4178
4181
|
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
4179
4182
|
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
4180
4183
|
return _p$;
|
|
@@ -4670,9 +4673,9 @@ function logFetch(url) {
|
|
|
4670
4673
|
}
|
|
4671
4674
|
|
|
4672
4675
|
// src/blocks/form/form/form.tsx
|
|
4673
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-
|
|
4676
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-74261216">`);
|
|
4674
4677
|
var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
|
|
4675
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
4678
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-74261216 {
|
|
4676
4679
|
padding: 10px;
|
|
4677
4680
|
color: red;
|
|
4678
4681
|
text-align: center;
|
|
@@ -4695,6 +4698,9 @@ function FormComponent(props) {
|
|
|
4695
4698
|
function submissionState() {
|
|
4696
4699
|
return isEditing() && props.previewState || formState();
|
|
4697
4700
|
}
|
|
4701
|
+
function errorResponse(response) {
|
|
4702
|
+
return JSON.stringify(response, null, 2);
|
|
4703
|
+
}
|
|
4698
4704
|
function onSubmit(event) {
|
|
4699
4705
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
4700
4706
|
if (props.sendSubmissionsTo === "zapier") {
|
|
@@ -4942,7 +4948,7 @@ function FormComponent(props) {
|
|
|
4942
4948
|
},
|
|
4943
4949
|
get children() {
|
|
4944
4950
|
const _el$2 = _tmpl$15();
|
|
4945
|
-
insert(_el$2, () =>
|
|
4951
|
+
insert(_el$2, () => errorResponse(responseData()));
|
|
4946
4952
|
return _el$2;
|
|
4947
4953
|
}
|
|
4948
4954
|
}), null);
|
|
@@ -5658,7 +5664,7 @@ function getPreviewContent(_searchParams) {
|
|
|
5658
5664
|
}
|
|
5659
5665
|
|
|
5660
5666
|
// src/constants/sdk-version.ts
|
|
5661
|
-
var SDK_VERSION = "4.2.
|
|
5667
|
+
var SDK_VERSION = "4.2.2";
|
|
5662
5668
|
|
|
5663
5669
|
// src/helpers/sdk-headers.ts
|
|
5664
5670
|
var getSdkHeaders = () => ({
|
|
@@ -6462,6 +6468,8 @@ var getWrapperClassName = (variationId) => {
|
|
|
6462
6468
|
// src/components/content/components/enable-editor.tsx
|
|
6463
6469
|
function EnableEditor(props) {
|
|
6464
6470
|
createSignal(false);
|
|
6471
|
+
const [prevData, setPrevData] = createSignal(null);
|
|
6472
|
+
const [prevLocale, setPrevLocale] = createSignal("");
|
|
6465
6473
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
6466
6474
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
6467
6475
|
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
@@ -6586,11 +6594,15 @@ function EnableEditor(props) {
|
|
|
6586
6594
|
method: "GET"
|
|
6587
6595
|
};
|
|
6588
6596
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
6589
|
-
|
|
6597
|
+
const fetchOptions = {
|
|
6590
6598
|
method: fetchRequestObj.method,
|
|
6591
6599
|
headers: fetchRequestObj.headers,
|
|
6592
6600
|
body: fetchRequestObj.body
|
|
6593
|
-
}
|
|
6601
|
+
};
|
|
6602
|
+
if (fetchRequestObj.method === "GET") {
|
|
6603
|
+
delete fetchOptions.body;
|
|
6604
|
+
}
|
|
6605
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
6594
6606
|
mergeNewRootState({
|
|
6595
6607
|
[key]: json
|
|
6596
6608
|
});
|
|
@@ -6698,16 +6710,24 @@ function EnableEditor(props) {
|
|
|
6698
6710
|
const onUpdateFn_2_props_data = createMemo(() => props.data);
|
|
6699
6711
|
function onUpdateFn_2() {
|
|
6700
6712
|
if (props.data) {
|
|
6713
|
+
if (prevData() === props.data) {
|
|
6714
|
+
return;
|
|
6715
|
+
}
|
|
6701
6716
|
mergeNewRootState(props.data);
|
|
6717
|
+
setPrevData(props.data);
|
|
6702
6718
|
}
|
|
6703
6719
|
}
|
|
6704
6720
|
createEffect(on(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
6705
6721
|
const onUpdateFn_3_props_locale = createMemo(() => props.locale);
|
|
6706
6722
|
function onUpdateFn_3() {
|
|
6707
6723
|
if (props.locale) {
|
|
6724
|
+
if (prevLocale() === props.locale) {
|
|
6725
|
+
return;
|
|
6726
|
+
}
|
|
6708
6727
|
mergeNewRootState({
|
|
6709
6728
|
locale: props.locale
|
|
6710
6729
|
});
|
|
6730
|
+
setPrevLocale(props.locale);
|
|
6711
6731
|
}
|
|
6712
6732
|
}
|
|
6713
6733
|
createEffect(on(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
@@ -7257,6 +7277,9 @@ function Symbol(props) {
|
|
|
7257
7277
|
const contentWrapper = createMemo(() => {
|
|
7258
7278
|
return "div";
|
|
7259
7279
|
});
|
|
7280
|
+
const customComponents = createMemo(() => {
|
|
7281
|
+
return Object.values(props.builderComponents);
|
|
7282
|
+
});
|
|
7260
7283
|
const className = createMemo(() => {
|
|
7261
7284
|
return [...[props.attributes[getClassPropName()]], "builder-symbol", props.symbol?.inline ? "builder-inline-symbol" : void 0, props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0].filter(Boolean).join(" ");
|
|
7262
7285
|
});
|
|
@@ -7305,7 +7328,7 @@ function Symbol(props) {
|
|
|
7305
7328
|
};
|
|
7306
7329
|
},
|
|
7307
7330
|
get customComponents() {
|
|
7308
|
-
return
|
|
7331
|
+
return customComponents();
|
|
7309
7332
|
},
|
|
7310
7333
|
get data() {
|
|
7311
7334
|
return {
|
package/lib/node/index.jsx
CHANGED
|
@@ -1364,14 +1364,7 @@ function BlockWrapper(props) {
|
|
|
1364
1364
|
var Block_wrapper_default = BlockWrapper;
|
|
1365
1365
|
|
|
1366
1366
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
1367
|
-
import {
|
|
1368
|
-
Show as Show4,
|
|
1369
|
-
For,
|
|
1370
|
-
on as on2,
|
|
1371
|
-
createEffect as createEffect2,
|
|
1372
|
-
createMemo as createMemo3,
|
|
1373
|
-
createSignal as createSignal3
|
|
1374
|
-
} from "solid-js";
|
|
1367
|
+
import { Show as Show4, For, createSignal as createSignal3 } from "solid-js";
|
|
1375
1368
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
1376
1369
|
|
|
1377
1370
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -1478,23 +1471,6 @@ function ComponentRef(props) {
|
|
|
1478
1471
|
const [Wrapper, setWrapper] = createSignal3(
|
|
1479
1472
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
1480
1473
|
);
|
|
1481
|
-
const onUpdateFn_0_props_componentOptions = createMemo3(
|
|
1482
|
-
() => props.componentOptions
|
|
1483
|
-
);
|
|
1484
|
-
const onUpdateFn_0_props_blockChildren = createMemo3(
|
|
1485
|
-
() => props.blockChildren
|
|
1486
|
-
);
|
|
1487
|
-
function onUpdateFn_0() {
|
|
1488
|
-
}
|
|
1489
|
-
createEffect2(
|
|
1490
|
-
on2(
|
|
1491
|
-
() => [
|
|
1492
|
-
onUpdateFn_0_props_componentOptions(),
|
|
1493
|
-
onUpdateFn_0_props_blockChildren()
|
|
1494
|
-
],
|
|
1495
|
-
onUpdateFn_0
|
|
1496
|
-
)
|
|
1497
|
-
);
|
|
1498
1474
|
return <><Show4 when={props.componentRef}><Dynamic3
|
|
1499
1475
|
{...getWrapperProps({
|
|
1500
1476
|
componentOptions: props.componentOptions,
|
|
@@ -1507,7 +1483,7 @@ function ComponentRef(props) {
|
|
|
1507
1483
|
contextValue: props.context
|
|
1508
1484
|
})}
|
|
1509
1485
|
component={Wrapper()}
|
|
1510
|
-
><For each={props.blockChildren}>{(child, _index) => {
|
|
1486
|
+
><Show4 when={props.componentRef}><For each={props.blockChildren}>{(child, _index) => {
|
|
1511
1487
|
const index = _index();
|
|
1512
1488
|
return <Block_default
|
|
1513
1489
|
key={child.id}
|
|
@@ -1516,12 +1492,12 @@ function ComponentRef(props) {
|
|
|
1516
1492
|
registeredComponents={props.registeredComponents}
|
|
1517
1493
|
linkComponent={props.linkComponent}
|
|
1518
1494
|
/>;
|
|
1519
|
-
}}</For></Dynamic3></Show4></>;
|
|
1495
|
+
}}</For></Show4></Dynamic3></Show4></>;
|
|
1520
1496
|
}
|
|
1521
1497
|
var Component_ref_default = ComponentRef;
|
|
1522
1498
|
|
|
1523
1499
|
// src/components/block/components/repeated-block.tsx
|
|
1524
|
-
import { on as
|
|
1500
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo4, createSignal as createSignal4 } from "solid-js";
|
|
1525
1501
|
function RepeatedBlock(props) {
|
|
1526
1502
|
const [store, setStore] = createSignal4(props.repeatContext);
|
|
1527
1503
|
const onUpdateFn_0_props_repeatContext = createMemo4(
|
|
@@ -1530,7 +1506,7 @@ function RepeatedBlock(props) {
|
|
|
1530
1506
|
function onUpdateFn_0() {
|
|
1531
1507
|
setStore(props.repeatContext);
|
|
1532
1508
|
}
|
|
1533
|
-
|
|
1509
|
+
createEffect2(on2(() => [onUpdateFn_0_props_repeatContext()], onUpdateFn_0));
|
|
1534
1510
|
return <><builder_context_default.Provider value={store()}><Block_default
|
|
1535
1511
|
block={props.block}
|
|
1536
1512
|
context={store()}
|
|
@@ -1699,7 +1675,7 @@ function Block(props) {
|
|
|
1699
1675
|
var Block_default = Block;
|
|
1700
1676
|
|
|
1701
1677
|
// src/components/blocks/blocks-wrapper.tsx
|
|
1702
|
-
import { onMount as onMount3, on as
|
|
1678
|
+
import { onMount as onMount3, on as on4, createEffect as createEffect4, createMemo as createMemo6, createSignal as createSignal6 } from "solid-js";
|
|
1703
1679
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
1704
1680
|
function BlocksWrapper(props) {
|
|
1705
1681
|
const [shouldUpdate, setShouldUpdate] = createSignal6(false);
|
|
@@ -1752,10 +1728,10 @@ function BlocksWrapper(props) {
|
|
|
1752
1728
|
const onUpdateFn_0_props_blocks = createMemo6(() => props.blocks);
|
|
1753
1729
|
function onUpdateFn_0() {
|
|
1754
1730
|
}
|
|
1755
|
-
|
|
1731
|
+
createEffect4(on4(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
|
|
1756
1732
|
return <>
|
|
1757
1733
|
<Dynamic4
|
|
1758
|
-
class={className() + " dynamic-
|
|
1734
|
+
class={className() + " dynamic-4d836538"}
|
|
1759
1735
|
ref={blocksWrapperRef}
|
|
1760
1736
|
builder-path={dataPath()}
|
|
1761
1737
|
builder-parent-id={props.parent}
|
|
@@ -1767,7 +1743,7 @@ function BlocksWrapper(props) {
|
|
|
1767
1743
|
{...props.BlocksWrapperProps}
|
|
1768
1744
|
component={props.BlocksWrapper}
|
|
1769
1745
|
>{props.children}</Dynamic4>
|
|
1770
|
-
<style>{`.dynamic-
|
|
1746
|
+
<style>{`.dynamic-4d836538 {
|
|
1771
1747
|
display: flex;
|
|
1772
1748
|
flex-direction: column;
|
|
1773
1749
|
align-items: stretch;
|
|
@@ -2146,7 +2122,7 @@ function SectionComponent(props) {
|
|
|
2146
2122
|
var section_default = SectionComponent;
|
|
2147
2123
|
|
|
2148
2124
|
// src/blocks/symbol/symbol.tsx
|
|
2149
|
-
import { onMount as onMount10, on as
|
|
2125
|
+
import { onMount as onMount10, on as on8, createEffect as createEffect8, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
|
|
2150
2126
|
|
|
2151
2127
|
// src/components/content-variants/content-variants.tsx
|
|
2152
2128
|
import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
|
|
@@ -3786,6 +3762,9 @@ function Tabs(props) {
|
|
|
3786
3762
|
function activeTabContent(active) {
|
|
3787
3763
|
return props.tabs && props.tabs[active].content;
|
|
3788
3764
|
}
|
|
3765
|
+
function getTabStyle(index) {
|
|
3766
|
+
return index === activeTab() ? props.activeTabStyle : {};
|
|
3767
|
+
}
|
|
3789
3768
|
function onClick(index) {
|
|
3790
3769
|
if (index === activeTab() && props.collapsible) {
|
|
3791
3770
|
setActiveTab(-1);
|
|
@@ -3807,9 +3786,7 @@ function Tabs(props) {
|
|
|
3807
3786
|
return <span
|
|
3808
3787
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
3809
3788
|
key={index}
|
|
3810
|
-
style={
|
|
3811
|
-
...activeTab() === index ? props.activeTabStyle : {}
|
|
3812
|
-
}}
|
|
3789
|
+
style={getTabStyle(index)}
|
|
3813
3790
|
onClick={(event) => onClick(index)}
|
|
3814
3791
|
><Blocks_default
|
|
3815
3792
|
parent={props.builderBlock.id}
|
|
@@ -3895,7 +3872,7 @@ var componentInfo12 = {
|
|
|
3895
3872
|
};
|
|
3896
3873
|
|
|
3897
3874
|
// src/blocks/custom-code/custom-code.tsx
|
|
3898
|
-
import { onMount as onMount6, on as
|
|
3875
|
+
import { onMount as onMount6, on as on5, createEffect as createEffect5, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
3899
3876
|
function CustomCode(props) {
|
|
3900
3877
|
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3901
3878
|
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
@@ -3945,7 +3922,7 @@ function CustomCode(props) {
|
|
|
3945
3922
|
runScripts();
|
|
3946
3923
|
}
|
|
3947
3924
|
}
|
|
3948
|
-
|
|
3925
|
+
createEffect5(on5(() => [onUpdateFn_0_props_code()], onUpdateFn_0));
|
|
3949
3926
|
return <><div
|
|
3950
3927
|
class={"builder-custom-code" + (props.replaceNodes ? " replace-nodes" : "")}
|
|
3951
3928
|
ref={elementRef}
|
|
@@ -3973,7 +3950,7 @@ var componentInfo13 = {
|
|
|
3973
3950
|
};
|
|
3974
3951
|
|
|
3975
3952
|
// src/blocks/embed/embed.tsx
|
|
3976
|
-
import { on as
|
|
3953
|
+
import { on as on6, createEffect as createEffect6, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
3977
3954
|
|
|
3978
3955
|
// src/blocks/embed/helpers.ts
|
|
3979
3956
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -4015,8 +3992,8 @@ function Embed(props) {
|
|
|
4015
3992
|
findAndRunScripts();
|
|
4016
3993
|
}
|
|
4017
3994
|
}
|
|
4018
|
-
|
|
4019
|
-
|
|
3995
|
+
createEffect6(
|
|
3996
|
+
on6(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
|
|
4020
3997
|
);
|
|
4021
3998
|
return <><div class="builder-embed" ref={elem} innerHTML={props.content} /></>;
|
|
4022
3999
|
}
|
|
@@ -4300,6 +4277,9 @@ function FormComponent(props) {
|
|
|
4300
4277
|
function submissionState() {
|
|
4301
4278
|
return isEditing() && props.previewState || formState();
|
|
4302
4279
|
}
|
|
4280
|
+
function errorResponse(response) {
|
|
4281
|
+
return JSON.stringify(response, null, 2);
|
|
4282
|
+
}
|
|
4303
4283
|
function onSubmit(event) {
|
|
4304
4284
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
4305
4285
|
if (props.sendSubmissionsTo === "zapier") {
|
|
@@ -4514,14 +4494,14 @@ function FormComponent(props) {
|
|
|
4514
4494
|
blocks={props.sendingMessage}
|
|
4515
4495
|
context={props.builderContext}
|
|
4516
4496
|
/></Show12>
|
|
4517
|
-
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-
|
|
4497
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-74261216">{errorResponse(responseData())}</pre></Show12>
|
|
4518
4498
|
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
4519
4499
|
path="successMessage"
|
|
4520
4500
|
blocks={props.successMessage}
|
|
4521
4501
|
context={props.builderContext}
|
|
4522
4502
|
/></Show12>
|
|
4523
4503
|
</form>
|
|
4524
|
-
<style>{`.pre-
|
|
4504
|
+
<style>{`.pre-74261216 {
|
|
4525
4505
|
padding: 10px;
|
|
4526
4506
|
color: red;
|
|
4527
4507
|
text-align: center;
|
|
@@ -5143,8 +5123,8 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
5143
5123
|
import {
|
|
5144
5124
|
Show as Show14,
|
|
5145
5125
|
onMount as onMount8,
|
|
5146
|
-
on as
|
|
5147
|
-
createEffect as
|
|
5126
|
+
on as on7,
|
|
5127
|
+
createEffect as createEffect7,
|
|
5148
5128
|
createMemo as createMemo17,
|
|
5149
5129
|
createSignal as createSignal17
|
|
5150
5130
|
} from "solid-js";
|
|
@@ -5156,7 +5136,7 @@ function getPreviewContent(_searchParams) {
|
|
|
5156
5136
|
}
|
|
5157
5137
|
|
|
5158
5138
|
// src/constants/sdk-version.ts
|
|
5159
|
-
var SDK_VERSION = "4.2.
|
|
5139
|
+
var SDK_VERSION = "4.2.2";
|
|
5160
5140
|
|
|
5161
5141
|
// src/helpers/sdk-headers.ts
|
|
5162
5142
|
var getSdkHeaders = () => ({
|
|
@@ -5960,6 +5940,8 @@ var getWrapperClassName = (variationId) => {
|
|
|
5960
5940
|
// src/components/content/components/enable-editor.tsx
|
|
5961
5941
|
function EnableEditor(props) {
|
|
5962
5942
|
const [hasExecuted, setHasExecuted] = createSignal17(false);
|
|
5943
|
+
const [prevData, setPrevData] = createSignal17(null);
|
|
5944
|
+
const [prevLocale, setPrevLocale] = createSignal17("");
|
|
5963
5945
|
const [ContentWrapper, setContentWrapper] = createSignal17(
|
|
5964
5946
|
props.contentWrapper || "div"
|
|
5965
5947
|
);
|
|
@@ -6089,11 +6071,15 @@ function EnableEditor(props) {
|
|
|
6089
6071
|
method: "GET"
|
|
6090
6072
|
};
|
|
6091
6073
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
6092
|
-
|
|
6074
|
+
const fetchOptions = {
|
|
6093
6075
|
method: fetchRequestObj.method,
|
|
6094
6076
|
headers: fetchRequestObj.headers,
|
|
6095
6077
|
body: fetchRequestObj.body
|
|
6096
|
-
}
|
|
6078
|
+
};
|
|
6079
|
+
if (fetchRequestObj.method === "GET") {
|
|
6080
|
+
delete fetchOptions.body;
|
|
6081
|
+
}
|
|
6082
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
6097
6083
|
mergeNewRootState({
|
|
6098
6084
|
[key]: json
|
|
6099
6085
|
});
|
|
@@ -6205,15 +6191,15 @@ function EnableEditor(props) {
|
|
|
6205
6191
|
mergeNewContent(props.content);
|
|
6206
6192
|
}
|
|
6207
6193
|
}
|
|
6208
|
-
|
|
6194
|
+
createEffect7(on7(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
6209
6195
|
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
|
|
6210
6196
|
() => props.builderContextSignal.rootState
|
|
6211
6197
|
);
|
|
6212
6198
|
function onUpdateFn_1() {
|
|
6213
6199
|
emitStateUpdate();
|
|
6214
6200
|
}
|
|
6215
|
-
|
|
6216
|
-
|
|
6201
|
+
createEffect7(
|
|
6202
|
+
on7(
|
|
6217
6203
|
() => [onUpdateFn_1_props_builderContextSignal_rootState()],
|
|
6218
6204
|
onUpdateFn_1
|
|
6219
6205
|
)
|
|
@@ -6221,19 +6207,27 @@ function EnableEditor(props) {
|
|
|
6221
6207
|
const onUpdateFn_2_props_data = createMemo17(() => props.data);
|
|
6222
6208
|
function onUpdateFn_2() {
|
|
6223
6209
|
if (props.data) {
|
|
6210
|
+
if (prevData() === props.data) {
|
|
6211
|
+
return;
|
|
6212
|
+
}
|
|
6224
6213
|
mergeNewRootState(props.data);
|
|
6214
|
+
setPrevData(props.data);
|
|
6225
6215
|
}
|
|
6226
6216
|
}
|
|
6227
|
-
|
|
6217
|
+
createEffect7(on7(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
6228
6218
|
const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
|
|
6229
6219
|
function onUpdateFn_3() {
|
|
6230
6220
|
if (props.locale) {
|
|
6221
|
+
if (prevLocale() === props.locale) {
|
|
6222
|
+
return;
|
|
6223
|
+
}
|
|
6231
6224
|
mergeNewRootState({
|
|
6232
6225
|
locale: props.locale
|
|
6233
6226
|
});
|
|
6227
|
+
setPrevLocale(props.locale);
|
|
6234
6228
|
}
|
|
6235
6229
|
}
|
|
6236
|
-
|
|
6230
|
+
createEffect7(on7(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
6237
6231
|
return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
|
|
6238
6232
|
when={props.builderContextSignal.content || needsElementRefDivForEditing()}
|
|
6239
6233
|
><Dynamic5
|
|
@@ -6593,6 +6587,9 @@ function Symbol(props) {
|
|
|
6593
6587
|
const contentWrapper = createMemo21(() => {
|
|
6594
6588
|
return "div";
|
|
6595
6589
|
});
|
|
6590
|
+
const customComponents = createMemo21(() => {
|
|
6591
|
+
return Object.values(props.builderComponents);
|
|
6592
|
+
});
|
|
6596
6593
|
const className = createMemo21(() => {
|
|
6597
6594
|
return [
|
|
6598
6595
|
...[props.attributes[getClassPropName()]],
|
|
@@ -6620,7 +6617,7 @@ function Symbol(props) {
|
|
|
6620
6617
|
function onUpdateFn_0() {
|
|
6621
6618
|
setContent();
|
|
6622
6619
|
}
|
|
6623
|
-
|
|
6620
|
+
createEffect8(on8(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
6624
6621
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
6625
6622
|
nonce={props.builderContext.nonce}
|
|
6626
6623
|
isNestedRender={true}
|
|
@@ -6630,7 +6627,7 @@ function Symbol(props) {
|
|
|
6630
6627
|
...props.builderContext.context,
|
|
6631
6628
|
symbolId: props.builderBlock?.id
|
|
6632
6629
|
}}
|
|
6633
|
-
customComponents={
|
|
6630
|
+
customComponents={customComponents()}
|
|
6634
6631
|
data={{
|
|
6635
6632
|
...props.symbol?.data,
|
|
6636
6633
|
...props.builderContext.localState,
|