@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/browser/index.js
CHANGED
|
@@ -1311,11 +1311,6 @@ var getWrapperProps = ({
|
|
|
1311
1311
|
function ComponentRef(props) {
|
|
1312
1312
|
createSignal(false);
|
|
1313
1313
|
const [Wrapper, setWrapper] = createSignal(props.isInteractive ? interactive_element_default : props.componentRef);
|
|
1314
|
-
const onUpdateFn_0_props_componentOptions = createMemo(() => props.componentOptions);
|
|
1315
|
-
const onUpdateFn_0_props_blockChildren = createMemo(() => props.blockChildren);
|
|
1316
|
-
function onUpdateFn_0() {
|
|
1317
|
-
}
|
|
1318
|
-
createEffect(on(() => [onUpdateFn_0_props_componentOptions(), onUpdateFn_0_props_blockChildren()], onUpdateFn_0));
|
|
1319
1314
|
return createComponent(Show, {
|
|
1320
1315
|
get when() {
|
|
1321
1316
|
return props.componentRef;
|
|
@@ -1335,25 +1330,32 @@ function ComponentRef(props) {
|
|
|
1335
1330
|
return Wrapper();
|
|
1336
1331
|
},
|
|
1337
1332
|
get children() {
|
|
1338
|
-
return createComponent(
|
|
1339
|
-
get
|
|
1340
|
-
return props.
|
|
1333
|
+
return createComponent(Show, {
|
|
1334
|
+
get when() {
|
|
1335
|
+
return props.componentRef;
|
|
1341
1336
|
},
|
|
1342
|
-
children
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
return child.id;
|
|
1347
|
-
},
|
|
1348
|
-
block: child,
|
|
1349
|
-
get context() {
|
|
1350
|
-
return props.context;
|
|
1351
|
-
},
|
|
1352
|
-
get registeredComponents() {
|
|
1353
|
-
return props.registeredComponents;
|
|
1337
|
+
get children() {
|
|
1338
|
+
return createComponent(For, {
|
|
1339
|
+
get each() {
|
|
1340
|
+
return props.blockChildren;
|
|
1354
1341
|
},
|
|
1355
|
-
|
|
1356
|
-
|
|
1342
|
+
children: (child, _index) => {
|
|
1343
|
+
_index();
|
|
1344
|
+
return createComponent(block_default, {
|
|
1345
|
+
get key() {
|
|
1346
|
+
return child.id;
|
|
1347
|
+
},
|
|
1348
|
+
block: child,
|
|
1349
|
+
get context() {
|
|
1350
|
+
return props.context;
|
|
1351
|
+
},
|
|
1352
|
+
get registeredComponents() {
|
|
1353
|
+
return props.registeredComponents;
|
|
1354
|
+
},
|
|
1355
|
+
get linkComponent() {
|
|
1356
|
+
return props.linkComponent;
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1357
1359
|
}
|
|
1358
1360
|
});
|
|
1359
1361
|
}
|
|
@@ -1660,7 +1662,7 @@ function Block(props) {
|
|
|
1660
1662
|
});
|
|
1661
1663
|
}
|
|
1662
1664
|
var block_default = Block;
|
|
1663
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-
|
|
1665
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-4d836538 {
|
|
1664
1666
|
display: flex;
|
|
1665
1667
|
flex-direction: column;
|
|
1666
1668
|
align-items: stretch;
|
|
@@ -1709,7 +1711,7 @@ function BlocksWrapper(props) {
|
|
|
1709
1711
|
createEffect(on(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
|
|
1710
1712
|
return [createComponent(Dynamic, mergeProps({
|
|
1711
1713
|
get ["class"]() {
|
|
1712
|
-
return className() + " dynamic-
|
|
1714
|
+
return className() + " dynamic-4d836538";
|
|
1713
1715
|
},
|
|
1714
1716
|
ref(r$) {
|
|
1715
1717
|
const _ref$ = blocksWrapperRef;
|
|
@@ -3962,6 +3964,9 @@ function Tabs(props) {
|
|
|
3962
3964
|
function activeTabContent(active) {
|
|
3963
3965
|
return props.tabs && props.tabs[active].content;
|
|
3964
3966
|
}
|
|
3967
|
+
function getTabStyle(index) {
|
|
3968
|
+
return index === activeTab() ? props.activeTabStyle : {};
|
|
3969
|
+
}
|
|
3965
3970
|
function onClick(index) {
|
|
3966
3971
|
if (index === activeTab() && props.collapsible) {
|
|
3967
3972
|
setActiveTab(-1);
|
|
@@ -4003,9 +4008,7 @@ function Tabs(props) {
|
|
|
4003
4008
|
}
|
|
4004
4009
|
}));
|
|
4005
4010
|
effect((_p$) => {
|
|
4006
|
-
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 =
|
|
4007
|
-
...activeTab() === index ? props.activeTabStyle : {}
|
|
4008
|
-
};
|
|
4011
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getTabStyle(index);
|
|
4009
4012
|
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
4010
4013
|
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
4011
4014
|
return _p$;
|
|
@@ -4501,9 +4504,9 @@ function logFetch(url) {
|
|
|
4501
4504
|
}
|
|
4502
4505
|
|
|
4503
4506
|
// src/blocks/form/form/form.tsx
|
|
4504
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-
|
|
4507
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-74261216">`);
|
|
4505
4508
|
var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
|
|
4506
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
4509
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-74261216 {
|
|
4507
4510
|
padding: 10px;
|
|
4508
4511
|
color: red;
|
|
4509
4512
|
text-align: center;
|
|
@@ -4526,6 +4529,9 @@ function FormComponent(props) {
|
|
|
4526
4529
|
function submissionState() {
|
|
4527
4530
|
return isEditing() && props.previewState || formState();
|
|
4528
4531
|
}
|
|
4532
|
+
function errorResponse(response) {
|
|
4533
|
+
return JSON.stringify(response, null, 2);
|
|
4534
|
+
}
|
|
4529
4535
|
function onSubmit(event) {
|
|
4530
4536
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
4531
4537
|
if (props.sendSubmissionsTo === "zapier") {
|
|
@@ -4773,7 +4779,7 @@ function FormComponent(props) {
|
|
|
4773
4779
|
},
|
|
4774
4780
|
get children() {
|
|
4775
4781
|
const _el$2 = _tmpl$15();
|
|
4776
|
-
insert(_el$2, () =>
|
|
4782
|
+
insert(_el$2, () => errorResponse(responseData()));
|
|
4777
4783
|
return _el$2;
|
|
4778
4784
|
}
|
|
4779
4785
|
}), null);
|
|
@@ -5489,7 +5495,7 @@ function getPreviewContent(_searchParams) {
|
|
|
5489
5495
|
}
|
|
5490
5496
|
|
|
5491
5497
|
// src/constants/sdk-version.ts
|
|
5492
|
-
var SDK_VERSION = "4.2.
|
|
5498
|
+
var SDK_VERSION = "4.2.2";
|
|
5493
5499
|
|
|
5494
5500
|
// src/helpers/sdk-headers.ts
|
|
5495
5501
|
var getSdkHeaders = () => ({
|
|
@@ -6293,6 +6299,8 @@ var getWrapperClassName = (variationId) => {
|
|
|
6293
6299
|
// src/components/content/components/enable-editor.tsx
|
|
6294
6300
|
function EnableEditor(props) {
|
|
6295
6301
|
createSignal(false);
|
|
6302
|
+
const [prevData, setPrevData] = createSignal(null);
|
|
6303
|
+
const [prevLocale, setPrevLocale] = createSignal("");
|
|
6296
6304
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
6297
6305
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
6298
6306
|
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
@@ -6417,11 +6425,15 @@ function EnableEditor(props) {
|
|
|
6417
6425
|
method: "GET"
|
|
6418
6426
|
};
|
|
6419
6427
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
6420
|
-
|
|
6428
|
+
const fetchOptions = {
|
|
6421
6429
|
method: fetchRequestObj.method,
|
|
6422
6430
|
headers: fetchRequestObj.headers,
|
|
6423
6431
|
body: fetchRequestObj.body
|
|
6424
|
-
}
|
|
6432
|
+
};
|
|
6433
|
+
if (fetchRequestObj.method === "GET") {
|
|
6434
|
+
delete fetchOptions.body;
|
|
6435
|
+
}
|
|
6436
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
6425
6437
|
mergeNewRootState({
|
|
6426
6438
|
[key]: json
|
|
6427
6439
|
});
|
|
@@ -6529,16 +6541,24 @@ function EnableEditor(props) {
|
|
|
6529
6541
|
const onUpdateFn_2_props_data = createMemo(() => props.data);
|
|
6530
6542
|
function onUpdateFn_2() {
|
|
6531
6543
|
if (props.data) {
|
|
6544
|
+
if (prevData() === props.data) {
|
|
6545
|
+
return;
|
|
6546
|
+
}
|
|
6532
6547
|
mergeNewRootState(props.data);
|
|
6548
|
+
setPrevData(props.data);
|
|
6533
6549
|
}
|
|
6534
6550
|
}
|
|
6535
6551
|
createEffect(on(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
6536
6552
|
const onUpdateFn_3_props_locale = createMemo(() => props.locale);
|
|
6537
6553
|
function onUpdateFn_3() {
|
|
6538
6554
|
if (props.locale) {
|
|
6555
|
+
if (prevLocale() === props.locale) {
|
|
6556
|
+
return;
|
|
6557
|
+
}
|
|
6539
6558
|
mergeNewRootState({
|
|
6540
6559
|
locale: props.locale
|
|
6541
6560
|
});
|
|
6561
|
+
setPrevLocale(props.locale);
|
|
6542
6562
|
}
|
|
6543
6563
|
}
|
|
6544
6564
|
createEffect(on(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
@@ -7088,6 +7108,9 @@ function Symbol(props) {
|
|
|
7088
7108
|
const contentWrapper = createMemo(() => {
|
|
7089
7109
|
return "div";
|
|
7090
7110
|
});
|
|
7111
|
+
const customComponents = createMemo(() => {
|
|
7112
|
+
return Object.values(props.builderComponents);
|
|
7113
|
+
});
|
|
7091
7114
|
const className = createMemo(() => {
|
|
7092
7115
|
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(" ");
|
|
7093
7116
|
});
|
|
@@ -7136,7 +7159,7 @@ function Symbol(props) {
|
|
|
7136
7159
|
};
|
|
7137
7160
|
},
|
|
7138
7161
|
get customComponents() {
|
|
7139
|
-
return
|
|
7162
|
+
return customComponents();
|
|
7140
7163
|
},
|
|
7141
7164
|
get data() {
|
|
7142
7165
|
return {
|
package/lib/browser/index.jsx
CHANGED
|
@@ -1193,14 +1193,7 @@ function BlockWrapper(props) {
|
|
|
1193
1193
|
var Block_wrapper_default = BlockWrapper;
|
|
1194
1194
|
|
|
1195
1195
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
1196
|
-
import {
|
|
1197
|
-
Show as Show4,
|
|
1198
|
-
For,
|
|
1199
|
-
on as on2,
|
|
1200
|
-
createEffect as createEffect2,
|
|
1201
|
-
createMemo as createMemo3,
|
|
1202
|
-
createSignal as createSignal3
|
|
1203
|
-
} from "solid-js";
|
|
1196
|
+
import { Show as Show4, For, createSignal as createSignal3 } from "solid-js";
|
|
1204
1197
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
1205
1198
|
|
|
1206
1199
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -1307,23 +1300,6 @@ function ComponentRef(props) {
|
|
|
1307
1300
|
const [Wrapper, setWrapper] = createSignal3(
|
|
1308
1301
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
1309
1302
|
);
|
|
1310
|
-
const onUpdateFn_0_props_componentOptions = createMemo3(
|
|
1311
|
-
() => props.componentOptions
|
|
1312
|
-
);
|
|
1313
|
-
const onUpdateFn_0_props_blockChildren = createMemo3(
|
|
1314
|
-
() => props.blockChildren
|
|
1315
|
-
);
|
|
1316
|
-
function onUpdateFn_0() {
|
|
1317
|
-
}
|
|
1318
|
-
createEffect2(
|
|
1319
|
-
on2(
|
|
1320
|
-
() => [
|
|
1321
|
-
onUpdateFn_0_props_componentOptions(),
|
|
1322
|
-
onUpdateFn_0_props_blockChildren()
|
|
1323
|
-
],
|
|
1324
|
-
onUpdateFn_0
|
|
1325
|
-
)
|
|
1326
|
-
);
|
|
1327
1303
|
return <><Show4 when={props.componentRef}><Dynamic3
|
|
1328
1304
|
{...getWrapperProps({
|
|
1329
1305
|
componentOptions: props.componentOptions,
|
|
@@ -1336,7 +1312,7 @@ function ComponentRef(props) {
|
|
|
1336
1312
|
contextValue: props.context
|
|
1337
1313
|
})}
|
|
1338
1314
|
component={Wrapper()}
|
|
1339
|
-
><For each={props.blockChildren}>{(child, _index) => {
|
|
1315
|
+
><Show4 when={props.componentRef}><For each={props.blockChildren}>{(child, _index) => {
|
|
1340
1316
|
const index = _index();
|
|
1341
1317
|
return <Block_default
|
|
1342
1318
|
key={child.id}
|
|
@@ -1345,12 +1321,12 @@ function ComponentRef(props) {
|
|
|
1345
1321
|
registeredComponents={props.registeredComponents}
|
|
1346
1322
|
linkComponent={props.linkComponent}
|
|
1347
1323
|
/>;
|
|
1348
|
-
}}</For></Dynamic3></Show4></>;
|
|
1324
|
+
}}</For></Show4></Dynamic3></Show4></>;
|
|
1349
1325
|
}
|
|
1350
1326
|
var Component_ref_default = ComponentRef;
|
|
1351
1327
|
|
|
1352
1328
|
// src/components/block/components/repeated-block.tsx
|
|
1353
|
-
import { on as
|
|
1329
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo4, createSignal as createSignal4 } from "solid-js";
|
|
1354
1330
|
function RepeatedBlock(props) {
|
|
1355
1331
|
const [store, setStore] = createSignal4(props.repeatContext);
|
|
1356
1332
|
const onUpdateFn_0_props_repeatContext = createMemo4(
|
|
@@ -1359,7 +1335,7 @@ function RepeatedBlock(props) {
|
|
|
1359
1335
|
function onUpdateFn_0() {
|
|
1360
1336
|
setStore(props.repeatContext);
|
|
1361
1337
|
}
|
|
1362
|
-
|
|
1338
|
+
createEffect2(on2(() => [onUpdateFn_0_props_repeatContext()], onUpdateFn_0));
|
|
1363
1339
|
return <><builder_context_default.Provider value={store()}><Block_default
|
|
1364
1340
|
block={props.block}
|
|
1365
1341
|
context={store()}
|
|
@@ -1528,7 +1504,7 @@ function Block(props) {
|
|
|
1528
1504
|
var Block_default = Block;
|
|
1529
1505
|
|
|
1530
1506
|
// src/components/blocks/blocks-wrapper.tsx
|
|
1531
|
-
import { onMount as onMount3, on as
|
|
1507
|
+
import { onMount as onMount3, on as on4, createEffect as createEffect4, createMemo as createMemo6, createSignal as createSignal6 } from "solid-js";
|
|
1532
1508
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
1533
1509
|
function BlocksWrapper(props) {
|
|
1534
1510
|
const [shouldUpdate, setShouldUpdate] = createSignal6(false);
|
|
@@ -1581,10 +1557,10 @@ function BlocksWrapper(props) {
|
|
|
1581
1557
|
const onUpdateFn_0_props_blocks = createMemo6(() => props.blocks);
|
|
1582
1558
|
function onUpdateFn_0() {
|
|
1583
1559
|
}
|
|
1584
|
-
|
|
1560
|
+
createEffect4(on4(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
|
|
1585
1561
|
return <>
|
|
1586
1562
|
<Dynamic4
|
|
1587
|
-
class={className() + " dynamic-
|
|
1563
|
+
class={className() + " dynamic-4d836538"}
|
|
1588
1564
|
ref={blocksWrapperRef}
|
|
1589
1565
|
builder-path={dataPath()}
|
|
1590
1566
|
builder-parent-id={props.parent}
|
|
@@ -1596,7 +1572,7 @@ function BlocksWrapper(props) {
|
|
|
1596
1572
|
{...props.BlocksWrapperProps}
|
|
1597
1573
|
component={props.BlocksWrapper}
|
|
1598
1574
|
>{props.children}</Dynamic4>
|
|
1599
|
-
<style>{`.dynamic-
|
|
1575
|
+
<style>{`.dynamic-4d836538 {
|
|
1600
1576
|
display: flex;
|
|
1601
1577
|
flex-direction: column;
|
|
1602
1578
|
align-items: stretch;
|
|
@@ -1975,7 +1951,7 @@ function SectionComponent(props) {
|
|
|
1975
1951
|
var section_default = SectionComponent;
|
|
1976
1952
|
|
|
1977
1953
|
// src/blocks/symbol/symbol.tsx
|
|
1978
|
-
import { onMount as onMount10, on as
|
|
1954
|
+
import { onMount as onMount10, on as on8, createEffect as createEffect8, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
|
|
1979
1955
|
|
|
1980
1956
|
// src/components/content-variants/content-variants.tsx
|
|
1981
1957
|
import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
|
|
@@ -3615,6 +3591,9 @@ function Tabs(props) {
|
|
|
3615
3591
|
function activeTabContent(active) {
|
|
3616
3592
|
return props.tabs && props.tabs[active].content;
|
|
3617
3593
|
}
|
|
3594
|
+
function getTabStyle(index) {
|
|
3595
|
+
return index === activeTab() ? props.activeTabStyle : {};
|
|
3596
|
+
}
|
|
3618
3597
|
function onClick(index) {
|
|
3619
3598
|
if (index === activeTab() && props.collapsible) {
|
|
3620
3599
|
setActiveTab(-1);
|
|
@@ -3636,9 +3615,7 @@ function Tabs(props) {
|
|
|
3636
3615
|
return <span
|
|
3637
3616
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
3638
3617
|
key={index}
|
|
3639
|
-
style={
|
|
3640
|
-
...activeTab() === index ? props.activeTabStyle : {}
|
|
3641
|
-
}}
|
|
3618
|
+
style={getTabStyle(index)}
|
|
3642
3619
|
onClick={(event) => onClick(index)}
|
|
3643
3620
|
><Blocks_default
|
|
3644
3621
|
parent={props.builderBlock.id}
|
|
@@ -3724,7 +3701,7 @@ var componentInfo12 = {
|
|
|
3724
3701
|
};
|
|
3725
3702
|
|
|
3726
3703
|
// src/blocks/custom-code/custom-code.tsx
|
|
3727
|
-
import { onMount as onMount6, on as
|
|
3704
|
+
import { onMount as onMount6, on as on5, createEffect as createEffect5, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
3728
3705
|
function CustomCode(props) {
|
|
3729
3706
|
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3730
3707
|
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
@@ -3774,7 +3751,7 @@ function CustomCode(props) {
|
|
|
3774
3751
|
runScripts();
|
|
3775
3752
|
}
|
|
3776
3753
|
}
|
|
3777
|
-
|
|
3754
|
+
createEffect5(on5(() => [onUpdateFn_0_props_code()], onUpdateFn_0));
|
|
3778
3755
|
return <><div
|
|
3779
3756
|
class={"builder-custom-code" + (props.replaceNodes ? " replace-nodes" : "")}
|
|
3780
3757
|
ref={elementRef}
|
|
@@ -3802,7 +3779,7 @@ var componentInfo13 = {
|
|
|
3802
3779
|
};
|
|
3803
3780
|
|
|
3804
3781
|
// src/blocks/embed/embed.tsx
|
|
3805
|
-
import { on as
|
|
3782
|
+
import { on as on6, createEffect as createEffect6, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
3806
3783
|
|
|
3807
3784
|
// src/blocks/embed/helpers.ts
|
|
3808
3785
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -3844,8 +3821,8 @@ function Embed(props) {
|
|
|
3844
3821
|
findAndRunScripts();
|
|
3845
3822
|
}
|
|
3846
3823
|
}
|
|
3847
|
-
|
|
3848
|
-
|
|
3824
|
+
createEffect6(
|
|
3825
|
+
on6(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
|
|
3849
3826
|
);
|
|
3850
3827
|
return <><div class="builder-embed" ref={elem} innerHTML={props.content} /></>;
|
|
3851
3828
|
}
|
|
@@ -4129,6 +4106,9 @@ function FormComponent(props) {
|
|
|
4129
4106
|
function submissionState() {
|
|
4130
4107
|
return isEditing() && props.previewState || formState();
|
|
4131
4108
|
}
|
|
4109
|
+
function errorResponse(response) {
|
|
4110
|
+
return JSON.stringify(response, null, 2);
|
|
4111
|
+
}
|
|
4132
4112
|
function onSubmit(event) {
|
|
4133
4113
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
4134
4114
|
if (props.sendSubmissionsTo === "zapier") {
|
|
@@ -4343,14 +4323,14 @@ function FormComponent(props) {
|
|
|
4343
4323
|
blocks={props.sendingMessage}
|
|
4344
4324
|
context={props.builderContext}
|
|
4345
4325
|
/></Show12>
|
|
4346
|
-
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-
|
|
4326
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-74261216">{errorResponse(responseData())}</pre></Show12>
|
|
4347
4327
|
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
4348
4328
|
path="successMessage"
|
|
4349
4329
|
blocks={props.successMessage}
|
|
4350
4330
|
context={props.builderContext}
|
|
4351
4331
|
/></Show12>
|
|
4352
4332
|
</form>
|
|
4353
|
-
<style>{`.pre-
|
|
4333
|
+
<style>{`.pre-74261216 {
|
|
4354
4334
|
padding: 10px;
|
|
4355
4335
|
color: red;
|
|
4356
4336
|
text-align: center;
|
|
@@ -4972,8 +4952,8 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4972
4952
|
import {
|
|
4973
4953
|
Show as Show14,
|
|
4974
4954
|
onMount as onMount8,
|
|
4975
|
-
on as
|
|
4976
|
-
createEffect as
|
|
4955
|
+
on as on7,
|
|
4956
|
+
createEffect as createEffect7,
|
|
4977
4957
|
createMemo as createMemo17,
|
|
4978
4958
|
createSignal as createSignal17
|
|
4979
4959
|
} from "solid-js";
|
|
@@ -4985,7 +4965,7 @@ function getPreviewContent(_searchParams) {
|
|
|
4985
4965
|
}
|
|
4986
4966
|
|
|
4987
4967
|
// src/constants/sdk-version.ts
|
|
4988
|
-
var SDK_VERSION = "4.2.
|
|
4968
|
+
var SDK_VERSION = "4.2.2";
|
|
4989
4969
|
|
|
4990
4970
|
// src/helpers/sdk-headers.ts
|
|
4991
4971
|
var getSdkHeaders = () => ({
|
|
@@ -5789,6 +5769,8 @@ var getWrapperClassName = (variationId) => {
|
|
|
5789
5769
|
// src/components/content/components/enable-editor.tsx
|
|
5790
5770
|
function EnableEditor(props) {
|
|
5791
5771
|
const [hasExecuted, setHasExecuted] = createSignal17(false);
|
|
5772
|
+
const [prevData, setPrevData] = createSignal17(null);
|
|
5773
|
+
const [prevLocale, setPrevLocale] = createSignal17("");
|
|
5792
5774
|
const [ContentWrapper, setContentWrapper] = createSignal17(
|
|
5793
5775
|
props.contentWrapper || "div"
|
|
5794
5776
|
);
|
|
@@ -5918,11 +5900,15 @@ function EnableEditor(props) {
|
|
|
5918
5900
|
method: "GET"
|
|
5919
5901
|
};
|
|
5920
5902
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
5921
|
-
|
|
5903
|
+
const fetchOptions = {
|
|
5922
5904
|
method: fetchRequestObj.method,
|
|
5923
5905
|
headers: fetchRequestObj.headers,
|
|
5924
5906
|
body: fetchRequestObj.body
|
|
5925
|
-
}
|
|
5907
|
+
};
|
|
5908
|
+
if (fetchRequestObj.method === "GET") {
|
|
5909
|
+
delete fetchOptions.body;
|
|
5910
|
+
}
|
|
5911
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
5926
5912
|
mergeNewRootState({
|
|
5927
5913
|
[key]: json
|
|
5928
5914
|
});
|
|
@@ -6034,15 +6020,15 @@ function EnableEditor(props) {
|
|
|
6034
6020
|
mergeNewContent(props.content);
|
|
6035
6021
|
}
|
|
6036
6022
|
}
|
|
6037
|
-
|
|
6023
|
+
createEffect7(on7(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
6038
6024
|
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
|
|
6039
6025
|
() => props.builderContextSignal.rootState
|
|
6040
6026
|
);
|
|
6041
6027
|
function onUpdateFn_1() {
|
|
6042
6028
|
emitStateUpdate();
|
|
6043
6029
|
}
|
|
6044
|
-
|
|
6045
|
-
|
|
6030
|
+
createEffect7(
|
|
6031
|
+
on7(
|
|
6046
6032
|
() => [onUpdateFn_1_props_builderContextSignal_rootState()],
|
|
6047
6033
|
onUpdateFn_1
|
|
6048
6034
|
)
|
|
@@ -6050,19 +6036,27 @@ function EnableEditor(props) {
|
|
|
6050
6036
|
const onUpdateFn_2_props_data = createMemo17(() => props.data);
|
|
6051
6037
|
function onUpdateFn_2() {
|
|
6052
6038
|
if (props.data) {
|
|
6039
|
+
if (prevData() === props.data) {
|
|
6040
|
+
return;
|
|
6041
|
+
}
|
|
6053
6042
|
mergeNewRootState(props.data);
|
|
6043
|
+
setPrevData(props.data);
|
|
6054
6044
|
}
|
|
6055
6045
|
}
|
|
6056
|
-
|
|
6046
|
+
createEffect7(on7(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
6057
6047
|
const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
|
|
6058
6048
|
function onUpdateFn_3() {
|
|
6059
6049
|
if (props.locale) {
|
|
6050
|
+
if (prevLocale() === props.locale) {
|
|
6051
|
+
return;
|
|
6052
|
+
}
|
|
6060
6053
|
mergeNewRootState({
|
|
6061
6054
|
locale: props.locale
|
|
6062
6055
|
});
|
|
6056
|
+
setPrevLocale(props.locale);
|
|
6063
6057
|
}
|
|
6064
6058
|
}
|
|
6065
|
-
|
|
6059
|
+
createEffect7(on7(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
6066
6060
|
return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
|
|
6067
6061
|
when={props.builderContextSignal.content || needsElementRefDivForEditing()}
|
|
6068
6062
|
><Dynamic5
|
|
@@ -6422,6 +6416,9 @@ function Symbol(props) {
|
|
|
6422
6416
|
const contentWrapper = createMemo21(() => {
|
|
6423
6417
|
return "div";
|
|
6424
6418
|
});
|
|
6419
|
+
const customComponents = createMemo21(() => {
|
|
6420
|
+
return Object.values(props.builderComponents);
|
|
6421
|
+
});
|
|
6425
6422
|
const className = createMemo21(() => {
|
|
6426
6423
|
return [
|
|
6427
6424
|
...[props.attributes[getClassPropName()]],
|
|
@@ -6449,7 +6446,7 @@ function Symbol(props) {
|
|
|
6449
6446
|
function onUpdateFn_0() {
|
|
6450
6447
|
setContent();
|
|
6451
6448
|
}
|
|
6452
|
-
|
|
6449
|
+
createEffect8(on8(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
6453
6450
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
6454
6451
|
nonce={props.builderContext.nonce}
|
|
6455
6452
|
isNestedRender={true}
|
|
@@ -6459,7 +6456,7 @@ function Symbol(props) {
|
|
|
6459
6456
|
...props.builderContext.context,
|
|
6460
6457
|
symbolId: props.builderBlock?.id
|
|
6461
6458
|
}}
|
|
6462
|
-
customComponents={
|
|
6459
|
+
customComponents={customComponents()}
|
|
6463
6460
|
data={{
|
|
6464
6461
|
...props.symbol?.data,
|
|
6465
6462
|
...props.builderContext.localState,
|