@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/dev.js
CHANGED
|
@@ -1320,11 +1320,6 @@ var getWrapperProps = ({
|
|
|
1320
1320
|
function ComponentRef(props) {
|
|
1321
1321
|
createSignal(false);
|
|
1322
1322
|
const [Wrapper, setWrapper] = createSignal(props.isInteractive ? interactive_element_default : props.componentRef);
|
|
1323
|
-
const onUpdateFn_0_props_componentOptions = createMemo(() => props.componentOptions);
|
|
1324
|
-
const onUpdateFn_0_props_blockChildren = createMemo(() => props.blockChildren);
|
|
1325
|
-
function onUpdateFn_0() {
|
|
1326
|
-
}
|
|
1327
|
-
createEffect(on(() => [onUpdateFn_0_props_componentOptions(), onUpdateFn_0_props_blockChildren()], onUpdateFn_0));
|
|
1328
1323
|
return createComponent(Show, {
|
|
1329
1324
|
get when() {
|
|
1330
1325
|
return props.componentRef;
|
|
@@ -1344,25 +1339,32 @@ function ComponentRef(props) {
|
|
|
1344
1339
|
return Wrapper();
|
|
1345
1340
|
},
|
|
1346
1341
|
get children() {
|
|
1347
|
-
return createComponent(
|
|
1348
|
-
get
|
|
1349
|
-
return props.
|
|
1342
|
+
return createComponent(Show, {
|
|
1343
|
+
get when() {
|
|
1344
|
+
return props.componentRef;
|
|
1350
1345
|
},
|
|
1351
|
-
children
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
return child.id;
|
|
1356
|
-
},
|
|
1357
|
-
block: child,
|
|
1358
|
-
get context() {
|
|
1359
|
-
return props.context;
|
|
1360
|
-
},
|
|
1361
|
-
get registeredComponents() {
|
|
1362
|
-
return props.registeredComponents;
|
|
1346
|
+
get children() {
|
|
1347
|
+
return createComponent(For, {
|
|
1348
|
+
get each() {
|
|
1349
|
+
return props.blockChildren;
|
|
1363
1350
|
},
|
|
1364
|
-
|
|
1365
|
-
|
|
1351
|
+
children: (child, _index) => {
|
|
1352
|
+
_index();
|
|
1353
|
+
return createComponent(block_default, {
|
|
1354
|
+
get key() {
|
|
1355
|
+
return child.id;
|
|
1356
|
+
},
|
|
1357
|
+
block: child,
|
|
1358
|
+
get context() {
|
|
1359
|
+
return props.context;
|
|
1360
|
+
},
|
|
1361
|
+
get registeredComponents() {
|
|
1362
|
+
return props.registeredComponents;
|
|
1363
|
+
},
|
|
1364
|
+
get linkComponent() {
|
|
1365
|
+
return props.linkComponent;
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1366
1368
|
}
|
|
1367
1369
|
});
|
|
1368
1370
|
}
|
|
@@ -1669,7 +1671,7 @@ function Block(props) {
|
|
|
1669
1671
|
});
|
|
1670
1672
|
}
|
|
1671
1673
|
var block_default = Block;
|
|
1672
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-
|
|
1674
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-4d836538 {
|
|
1673
1675
|
display: flex;
|
|
1674
1676
|
flex-direction: column;
|
|
1675
1677
|
align-items: stretch;
|
|
@@ -1718,7 +1720,7 @@ function BlocksWrapper(props) {
|
|
|
1718
1720
|
createEffect(on(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
|
|
1719
1721
|
return [createComponent(Dynamic, mergeProps({
|
|
1720
1722
|
get ["class"]() {
|
|
1721
|
-
return className() + " dynamic-
|
|
1723
|
+
return className() + " dynamic-4d836538";
|
|
1722
1724
|
},
|
|
1723
1725
|
ref(r$) {
|
|
1724
1726
|
const _ref$ = blocksWrapperRef;
|
|
@@ -3973,6 +3975,9 @@ function Tabs(props) {
|
|
|
3973
3975
|
function activeTabContent(active) {
|
|
3974
3976
|
return props.tabs && props.tabs[active].content;
|
|
3975
3977
|
}
|
|
3978
|
+
function getTabStyle(index) {
|
|
3979
|
+
return index === activeTab() ? props.activeTabStyle : {};
|
|
3980
|
+
}
|
|
3976
3981
|
function onClick(index) {
|
|
3977
3982
|
if (index === activeTab() && props.collapsible) {
|
|
3978
3983
|
setActiveTab(-1);
|
|
@@ -4014,9 +4019,7 @@ function Tabs(props) {
|
|
|
4014
4019
|
}
|
|
4015
4020
|
}));
|
|
4016
4021
|
effect((_p$) => {
|
|
4017
|
-
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 =
|
|
4018
|
-
...activeTab() === index ? props.activeTabStyle : {}
|
|
4019
|
-
};
|
|
4022
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getTabStyle(index);
|
|
4020
4023
|
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
4021
4024
|
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
4022
4025
|
return _p$;
|
|
@@ -4512,9 +4515,9 @@ function logFetch(url) {
|
|
|
4512
4515
|
}
|
|
4513
4516
|
|
|
4514
4517
|
// src/blocks/form/form/form.tsx
|
|
4515
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-
|
|
4518
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-74261216">`);
|
|
4516
4519
|
var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
|
|
4517
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
4520
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-74261216 {
|
|
4518
4521
|
padding: 10px;
|
|
4519
4522
|
color: red;
|
|
4520
4523
|
text-align: center;
|
|
@@ -4537,6 +4540,9 @@ function FormComponent(props) {
|
|
|
4537
4540
|
function submissionState() {
|
|
4538
4541
|
return isEditing() && props.previewState || formState();
|
|
4539
4542
|
}
|
|
4543
|
+
function errorResponse(response) {
|
|
4544
|
+
return JSON.stringify(response, null, 2);
|
|
4545
|
+
}
|
|
4540
4546
|
function onSubmit(event) {
|
|
4541
4547
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
4542
4548
|
if (props.sendSubmissionsTo === "zapier") {
|
|
@@ -4785,7 +4791,7 @@ function FormComponent(props) {
|
|
|
4785
4791
|
},
|
|
4786
4792
|
get children() {
|
|
4787
4793
|
const _el$2 = _tmpl$15();
|
|
4788
|
-
insert(_el$2, () =>
|
|
4794
|
+
insert(_el$2, () => errorResponse(responseData()));
|
|
4789
4795
|
return _el$2;
|
|
4790
4796
|
}
|
|
4791
4797
|
}), null);
|
|
@@ -5502,7 +5508,7 @@ function getPreviewContent(_searchParams) {
|
|
|
5502
5508
|
}
|
|
5503
5509
|
|
|
5504
5510
|
// src/constants/sdk-version.ts
|
|
5505
|
-
var SDK_VERSION = "4.2.
|
|
5511
|
+
var SDK_VERSION = "4.2.2";
|
|
5506
5512
|
|
|
5507
5513
|
// src/helpers/sdk-headers.ts
|
|
5508
5514
|
var getSdkHeaders = () => ({
|
|
@@ -6311,6 +6317,8 @@ var getWrapperClassName = (variationId) => {
|
|
|
6311
6317
|
// src/components/content/components/enable-editor.tsx
|
|
6312
6318
|
function EnableEditor(props) {
|
|
6313
6319
|
createSignal(false);
|
|
6320
|
+
const [prevData, setPrevData] = createSignal(null);
|
|
6321
|
+
const [prevLocale, setPrevLocale] = createSignal("");
|
|
6314
6322
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
6315
6323
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
6316
6324
|
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
@@ -6435,11 +6443,15 @@ function EnableEditor(props) {
|
|
|
6435
6443
|
method: "GET"
|
|
6436
6444
|
};
|
|
6437
6445
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
6438
|
-
|
|
6446
|
+
const fetchOptions = {
|
|
6439
6447
|
method: fetchRequestObj.method,
|
|
6440
6448
|
headers: fetchRequestObj.headers,
|
|
6441
6449
|
body: fetchRequestObj.body
|
|
6442
|
-
}
|
|
6450
|
+
};
|
|
6451
|
+
if (fetchRequestObj.method === "GET") {
|
|
6452
|
+
delete fetchOptions.body;
|
|
6453
|
+
}
|
|
6454
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
6443
6455
|
mergeNewRootState({
|
|
6444
6456
|
[key]: json
|
|
6445
6457
|
});
|
|
@@ -6548,16 +6560,24 @@ function EnableEditor(props) {
|
|
|
6548
6560
|
const onUpdateFn_2_props_data = createMemo(() => props.data);
|
|
6549
6561
|
function onUpdateFn_2() {
|
|
6550
6562
|
if (props.data) {
|
|
6563
|
+
if (prevData() === props.data) {
|
|
6564
|
+
return;
|
|
6565
|
+
}
|
|
6551
6566
|
mergeNewRootState(props.data);
|
|
6567
|
+
setPrevData(props.data);
|
|
6552
6568
|
}
|
|
6553
6569
|
}
|
|
6554
6570
|
createEffect(on(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
6555
6571
|
const onUpdateFn_3_props_locale = createMemo(() => props.locale);
|
|
6556
6572
|
function onUpdateFn_3() {
|
|
6557
6573
|
if (props.locale) {
|
|
6574
|
+
if (prevLocale() === props.locale) {
|
|
6575
|
+
return;
|
|
6576
|
+
}
|
|
6558
6577
|
mergeNewRootState({
|
|
6559
6578
|
locale: props.locale
|
|
6560
6579
|
});
|
|
6580
|
+
setPrevLocale(props.locale);
|
|
6561
6581
|
}
|
|
6562
6582
|
}
|
|
6563
6583
|
createEffect(on(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
@@ -7107,6 +7127,9 @@ function Symbol(props) {
|
|
|
7107
7127
|
const contentWrapper = createMemo(() => {
|
|
7108
7128
|
return "div";
|
|
7109
7129
|
});
|
|
7130
|
+
const customComponents = createMemo(() => {
|
|
7131
|
+
return Object.values(props.builderComponents);
|
|
7132
|
+
});
|
|
7110
7133
|
const className = createMemo(() => {
|
|
7111
7134
|
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(" ");
|
|
7112
7135
|
});
|
|
@@ -7155,7 +7178,7 @@ function Symbol(props) {
|
|
|
7155
7178
|
};
|
|
7156
7179
|
},
|
|
7157
7180
|
get customComponents() {
|
|
7158
|
-
return
|
|
7181
|
+
return customComponents();
|
|
7159
7182
|
},
|
|
7160
7183
|
get data() {
|
|
7161
7184
|
return {
|
package/lib/browser/dev.jsx
CHANGED
|
@@ -1200,14 +1200,7 @@ function BlockWrapper(props) {
|
|
|
1200
1200
|
var Block_wrapper_default = BlockWrapper;
|
|
1201
1201
|
|
|
1202
1202
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
1203
|
-
import {
|
|
1204
|
-
Show as Show4,
|
|
1205
|
-
For,
|
|
1206
|
-
on as on2,
|
|
1207
|
-
createEffect as createEffect2,
|
|
1208
|
-
createMemo as createMemo3,
|
|
1209
|
-
createSignal as createSignal3
|
|
1210
|
-
} from "solid-js";
|
|
1203
|
+
import { Show as Show4, For, createSignal as createSignal3 } from "solid-js";
|
|
1211
1204
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
1212
1205
|
|
|
1213
1206
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -1314,23 +1307,6 @@ function ComponentRef(props) {
|
|
|
1314
1307
|
const [Wrapper, setWrapper] = createSignal3(
|
|
1315
1308
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
1316
1309
|
);
|
|
1317
|
-
const onUpdateFn_0_props_componentOptions = createMemo3(
|
|
1318
|
-
() => props.componentOptions
|
|
1319
|
-
);
|
|
1320
|
-
const onUpdateFn_0_props_blockChildren = createMemo3(
|
|
1321
|
-
() => props.blockChildren
|
|
1322
|
-
);
|
|
1323
|
-
function onUpdateFn_0() {
|
|
1324
|
-
}
|
|
1325
|
-
createEffect2(
|
|
1326
|
-
on2(
|
|
1327
|
-
() => [
|
|
1328
|
-
onUpdateFn_0_props_componentOptions(),
|
|
1329
|
-
onUpdateFn_0_props_blockChildren()
|
|
1330
|
-
],
|
|
1331
|
-
onUpdateFn_0
|
|
1332
|
-
)
|
|
1333
|
-
);
|
|
1334
1310
|
return <><Show4 when={props.componentRef}><Dynamic3
|
|
1335
1311
|
{...getWrapperProps({
|
|
1336
1312
|
componentOptions: props.componentOptions,
|
|
@@ -1343,7 +1319,7 @@ function ComponentRef(props) {
|
|
|
1343
1319
|
contextValue: props.context
|
|
1344
1320
|
})}
|
|
1345
1321
|
component={Wrapper()}
|
|
1346
|
-
><For each={props.blockChildren}>{(child, _index) => {
|
|
1322
|
+
><Show4 when={props.componentRef}><For each={props.blockChildren}>{(child, _index) => {
|
|
1347
1323
|
const index = _index();
|
|
1348
1324
|
return <Block_default
|
|
1349
1325
|
key={child.id}
|
|
@@ -1352,12 +1328,12 @@ function ComponentRef(props) {
|
|
|
1352
1328
|
registeredComponents={props.registeredComponents}
|
|
1353
1329
|
linkComponent={props.linkComponent}
|
|
1354
1330
|
/>;
|
|
1355
|
-
}}</For></Dynamic3></Show4></>;
|
|
1331
|
+
}}</For></Show4></Dynamic3></Show4></>;
|
|
1356
1332
|
}
|
|
1357
1333
|
var Component_ref_default = ComponentRef;
|
|
1358
1334
|
|
|
1359
1335
|
// src/components/block/components/repeated-block.tsx
|
|
1360
|
-
import { on as
|
|
1336
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo4, createSignal as createSignal4 } from "solid-js";
|
|
1361
1337
|
function RepeatedBlock(props) {
|
|
1362
1338
|
const [store, setStore] = createSignal4(props.repeatContext);
|
|
1363
1339
|
const onUpdateFn_0_props_repeatContext = createMemo4(
|
|
@@ -1366,7 +1342,7 @@ function RepeatedBlock(props) {
|
|
|
1366
1342
|
function onUpdateFn_0() {
|
|
1367
1343
|
setStore(props.repeatContext);
|
|
1368
1344
|
}
|
|
1369
|
-
|
|
1345
|
+
createEffect2(on2(() => [onUpdateFn_0_props_repeatContext()], onUpdateFn_0));
|
|
1370
1346
|
return <><builder_context_default.Provider value={store()}><Block_default
|
|
1371
1347
|
block={props.block}
|
|
1372
1348
|
context={store()}
|
|
@@ -1535,7 +1511,7 @@ function Block(props) {
|
|
|
1535
1511
|
var Block_default = Block;
|
|
1536
1512
|
|
|
1537
1513
|
// src/components/blocks/blocks-wrapper.tsx
|
|
1538
|
-
import { onMount as onMount3, on as
|
|
1514
|
+
import { onMount as onMount3, on as on4, createEffect as createEffect4, createMemo as createMemo6, createSignal as createSignal6 } from "solid-js";
|
|
1539
1515
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
1540
1516
|
function BlocksWrapper(props) {
|
|
1541
1517
|
const [shouldUpdate, setShouldUpdate] = createSignal6(false);
|
|
@@ -1588,10 +1564,10 @@ function BlocksWrapper(props) {
|
|
|
1588
1564
|
const onUpdateFn_0_props_blocks = createMemo6(() => props.blocks);
|
|
1589
1565
|
function onUpdateFn_0() {
|
|
1590
1566
|
}
|
|
1591
|
-
|
|
1567
|
+
createEffect4(on4(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
|
|
1592
1568
|
return <>
|
|
1593
1569
|
<Dynamic4
|
|
1594
|
-
class={className() + " dynamic-
|
|
1570
|
+
class={className() + " dynamic-4d836538"}
|
|
1595
1571
|
ref={blocksWrapperRef}
|
|
1596
1572
|
builder-path={dataPath()}
|
|
1597
1573
|
builder-parent-id={props.parent}
|
|
@@ -1603,7 +1579,7 @@ function BlocksWrapper(props) {
|
|
|
1603
1579
|
{...props.BlocksWrapperProps}
|
|
1604
1580
|
component={props.BlocksWrapper}
|
|
1605
1581
|
>{props.children}</Dynamic4>
|
|
1606
|
-
<style>{`.dynamic-
|
|
1582
|
+
<style>{`.dynamic-4d836538 {
|
|
1607
1583
|
display: flex;
|
|
1608
1584
|
flex-direction: column;
|
|
1609
1585
|
align-items: stretch;
|
|
@@ -1983,7 +1959,7 @@ function SectionComponent(props) {
|
|
|
1983
1959
|
var section_default = SectionComponent;
|
|
1984
1960
|
|
|
1985
1961
|
// src/blocks/symbol/symbol.tsx
|
|
1986
|
-
import { onMount as onMount10, on as
|
|
1962
|
+
import { onMount as onMount10, on as on8, createEffect as createEffect8, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
|
|
1987
1963
|
|
|
1988
1964
|
// src/components/content-variants/content-variants.tsx
|
|
1989
1965
|
import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
|
|
@@ -3624,6 +3600,9 @@ function Tabs(props) {
|
|
|
3624
3600
|
function activeTabContent(active) {
|
|
3625
3601
|
return props.tabs && props.tabs[active].content;
|
|
3626
3602
|
}
|
|
3603
|
+
function getTabStyle(index) {
|
|
3604
|
+
return index === activeTab() ? props.activeTabStyle : {};
|
|
3605
|
+
}
|
|
3627
3606
|
function onClick(index) {
|
|
3628
3607
|
if (index === activeTab() && props.collapsible) {
|
|
3629
3608
|
setActiveTab(-1);
|
|
@@ -3645,9 +3624,7 @@ function Tabs(props) {
|
|
|
3645
3624
|
return <span
|
|
3646
3625
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
3647
3626
|
key={index}
|
|
3648
|
-
style={
|
|
3649
|
-
...activeTab() === index ? props.activeTabStyle : {}
|
|
3650
|
-
}}
|
|
3627
|
+
style={getTabStyle(index)}
|
|
3651
3628
|
onClick={(event) => onClick(index)}
|
|
3652
3629
|
><Blocks_default
|
|
3653
3630
|
parent={props.builderBlock.id}
|
|
@@ -3733,7 +3710,7 @@ var componentInfo12 = {
|
|
|
3733
3710
|
};
|
|
3734
3711
|
|
|
3735
3712
|
// src/blocks/custom-code/custom-code.tsx
|
|
3736
|
-
import { onMount as onMount6, on as
|
|
3713
|
+
import { onMount as onMount6, on as on5, createEffect as createEffect5, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
3737
3714
|
function CustomCode(props) {
|
|
3738
3715
|
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
3739
3716
|
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
@@ -3783,7 +3760,7 @@ function CustomCode(props) {
|
|
|
3783
3760
|
runScripts();
|
|
3784
3761
|
}
|
|
3785
3762
|
}
|
|
3786
|
-
|
|
3763
|
+
createEffect5(on5(() => [onUpdateFn_0_props_code()], onUpdateFn_0));
|
|
3787
3764
|
return <><div
|
|
3788
3765
|
class={"builder-custom-code" + (props.replaceNodes ? " replace-nodes" : "")}
|
|
3789
3766
|
ref={elementRef}
|
|
@@ -3811,7 +3788,7 @@ var componentInfo13 = {
|
|
|
3811
3788
|
};
|
|
3812
3789
|
|
|
3813
3790
|
// src/blocks/embed/embed.tsx
|
|
3814
|
-
import { on as
|
|
3791
|
+
import { on as on6, createEffect as createEffect6, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
3815
3792
|
|
|
3816
3793
|
// src/blocks/embed/helpers.ts
|
|
3817
3794
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -3853,8 +3830,8 @@ function Embed(props) {
|
|
|
3853
3830
|
findAndRunScripts();
|
|
3854
3831
|
}
|
|
3855
3832
|
}
|
|
3856
|
-
|
|
3857
|
-
|
|
3833
|
+
createEffect6(
|
|
3834
|
+
on6(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
|
|
3858
3835
|
);
|
|
3859
3836
|
return <><div class="builder-embed" ref={elem} innerHTML={props.content} /></>;
|
|
3860
3837
|
}
|
|
@@ -4138,6 +4115,9 @@ function FormComponent(props) {
|
|
|
4138
4115
|
function submissionState() {
|
|
4139
4116
|
return isEditing() && props.previewState || formState();
|
|
4140
4117
|
}
|
|
4118
|
+
function errorResponse(response) {
|
|
4119
|
+
return JSON.stringify(response, null, 2);
|
|
4120
|
+
}
|
|
4141
4121
|
function onSubmit(event) {
|
|
4142
4122
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
4143
4123
|
if (props.sendSubmissionsTo === "zapier") {
|
|
@@ -4353,14 +4333,14 @@ function FormComponent(props) {
|
|
|
4353
4333
|
blocks={props.sendingMessage}
|
|
4354
4334
|
context={props.builderContext}
|
|
4355
4335
|
/></Show12>
|
|
4356
|
-
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-
|
|
4336
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-74261216">{errorResponse(responseData())}</pre></Show12>
|
|
4357
4337
|
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
4358
4338
|
path="successMessage"
|
|
4359
4339
|
blocks={props.successMessage}
|
|
4360
4340
|
context={props.builderContext}
|
|
4361
4341
|
/></Show12>
|
|
4362
4342
|
</form>
|
|
4363
|
-
<style>{`.pre-
|
|
4343
|
+
<style>{`.pre-74261216 {
|
|
4364
4344
|
padding: 10px;
|
|
4365
4345
|
color: red;
|
|
4366
4346
|
text-align: center;
|
|
@@ -4983,8 +4963,8 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4983
4963
|
import {
|
|
4984
4964
|
Show as Show14,
|
|
4985
4965
|
onMount as onMount8,
|
|
4986
|
-
on as
|
|
4987
|
-
createEffect as
|
|
4966
|
+
on as on7,
|
|
4967
|
+
createEffect as createEffect7,
|
|
4988
4968
|
createMemo as createMemo17,
|
|
4989
4969
|
createSignal as createSignal17
|
|
4990
4970
|
} from "solid-js";
|
|
@@ -4996,7 +4976,7 @@ function getPreviewContent(_searchParams) {
|
|
|
4996
4976
|
}
|
|
4997
4977
|
|
|
4998
4978
|
// src/constants/sdk-version.ts
|
|
4999
|
-
var SDK_VERSION = "4.2.
|
|
4979
|
+
var SDK_VERSION = "4.2.2";
|
|
5000
4980
|
|
|
5001
4981
|
// src/helpers/sdk-headers.ts
|
|
5002
4982
|
var getSdkHeaders = () => ({
|
|
@@ -5805,6 +5785,8 @@ var getWrapperClassName = (variationId) => {
|
|
|
5805
5785
|
// src/components/content/components/enable-editor.tsx
|
|
5806
5786
|
function EnableEditor(props) {
|
|
5807
5787
|
const [hasExecuted, setHasExecuted] = createSignal17(false);
|
|
5788
|
+
const [prevData, setPrevData] = createSignal17(null);
|
|
5789
|
+
const [prevLocale, setPrevLocale] = createSignal17("");
|
|
5808
5790
|
const [ContentWrapper, setContentWrapper] = createSignal17(
|
|
5809
5791
|
props.contentWrapper || "div"
|
|
5810
5792
|
);
|
|
@@ -5934,11 +5916,15 @@ function EnableEditor(props) {
|
|
|
5934
5916
|
method: "GET"
|
|
5935
5917
|
};
|
|
5936
5918
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
5937
|
-
|
|
5919
|
+
const fetchOptions = {
|
|
5938
5920
|
method: fetchRequestObj.method,
|
|
5939
5921
|
headers: fetchRequestObj.headers,
|
|
5940
5922
|
body: fetchRequestObj.body
|
|
5941
|
-
}
|
|
5923
|
+
};
|
|
5924
|
+
if (fetchRequestObj.method === "GET") {
|
|
5925
|
+
delete fetchOptions.body;
|
|
5926
|
+
}
|
|
5927
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
5942
5928
|
mergeNewRootState({
|
|
5943
5929
|
[key]: json
|
|
5944
5930
|
});
|
|
@@ -6055,15 +6041,15 @@ function EnableEditor(props) {
|
|
|
6055
6041
|
mergeNewContent(props.content);
|
|
6056
6042
|
}
|
|
6057
6043
|
}
|
|
6058
|
-
|
|
6044
|
+
createEffect7(on7(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
6059
6045
|
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
|
|
6060
6046
|
() => props.builderContextSignal.rootState
|
|
6061
6047
|
);
|
|
6062
6048
|
function onUpdateFn_1() {
|
|
6063
6049
|
emitStateUpdate();
|
|
6064
6050
|
}
|
|
6065
|
-
|
|
6066
|
-
|
|
6051
|
+
createEffect7(
|
|
6052
|
+
on7(
|
|
6067
6053
|
() => [onUpdateFn_1_props_builderContextSignal_rootState()],
|
|
6068
6054
|
onUpdateFn_1
|
|
6069
6055
|
)
|
|
@@ -6071,19 +6057,27 @@ function EnableEditor(props) {
|
|
|
6071
6057
|
const onUpdateFn_2_props_data = createMemo17(() => props.data);
|
|
6072
6058
|
function onUpdateFn_2() {
|
|
6073
6059
|
if (props.data) {
|
|
6060
|
+
if (prevData() === props.data) {
|
|
6061
|
+
return;
|
|
6062
|
+
}
|
|
6074
6063
|
mergeNewRootState(props.data);
|
|
6064
|
+
setPrevData(props.data);
|
|
6075
6065
|
}
|
|
6076
6066
|
}
|
|
6077
|
-
|
|
6067
|
+
createEffect7(on7(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
6078
6068
|
const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
|
|
6079
6069
|
function onUpdateFn_3() {
|
|
6080
6070
|
if (props.locale) {
|
|
6071
|
+
if (prevLocale() === props.locale) {
|
|
6072
|
+
return;
|
|
6073
|
+
}
|
|
6081
6074
|
mergeNewRootState({
|
|
6082
6075
|
locale: props.locale
|
|
6083
6076
|
});
|
|
6077
|
+
setPrevLocale(props.locale);
|
|
6084
6078
|
}
|
|
6085
6079
|
}
|
|
6086
|
-
|
|
6080
|
+
createEffect7(on7(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
6087
6081
|
return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
|
|
6088
6082
|
when={props.builderContextSignal.content || needsElementRefDivForEditing()}
|
|
6089
6083
|
><Dynamic5
|
|
@@ -6443,6 +6437,9 @@ function Symbol(props) {
|
|
|
6443
6437
|
const contentWrapper = createMemo21(() => {
|
|
6444
6438
|
return "div";
|
|
6445
6439
|
});
|
|
6440
|
+
const customComponents = createMemo21(() => {
|
|
6441
|
+
return Object.values(props.builderComponents);
|
|
6442
|
+
});
|
|
6446
6443
|
const className = createMemo21(() => {
|
|
6447
6444
|
return [
|
|
6448
6445
|
...[props.attributes[getClassPropName()]],
|
|
@@ -6470,7 +6467,7 @@ function Symbol(props) {
|
|
|
6470
6467
|
function onUpdateFn_0() {
|
|
6471
6468
|
setContent();
|
|
6472
6469
|
}
|
|
6473
|
-
|
|
6470
|
+
createEffect8(on8(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
6474
6471
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
6475
6472
|
nonce={props.builderContext.nonce}
|
|
6476
6473
|
isNestedRender={true}
|
|
@@ -6480,7 +6477,7 @@ function Symbol(props) {
|
|
|
6480
6477
|
...props.builderContext.context,
|
|
6481
6478
|
symbolId: props.builderBlock?.id
|
|
6482
6479
|
}}
|
|
6483
|
-
customComponents={
|
|
6480
|
+
customComponents={customComponents()}
|
|
6484
6481
|
data={{
|
|
6485
6482
|
...props.symbol?.data,
|
|
6486
6483
|
...props.builderContext.localState,
|