@builder.io/sdk-solid 4.2.0 → 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/dist/index.d.ts +18 -1
- package/lib/browser/dev.js +72 -37
- package/lib/browser/dev.jsx +70 -58
- package/lib/browser/index.js +72 -37
- package/lib/browser/index.jsx +70 -58
- package/lib/edge/dev.js +72 -37
- package/lib/edge/dev.jsx +70 -58
- package/lib/edge/index.js +72 -37
- package/lib/edge/index.jsx +70 -58
- package/lib/node/dev.js +72 -37
- package/lib/node/dev.jsx +70 -58
- package/lib/node/index.js +72 -37
- package/lib/node/index.jsx +70 -58
- package/package.json +1 -1
package/lib/edge/index.js
CHANGED
|
@@ -4492,11 +4492,6 @@ var getWrapperProps = ({
|
|
|
4492
4492
|
function ComponentRef(props) {
|
|
4493
4493
|
createSignal(false);
|
|
4494
4494
|
const [Wrapper, setWrapper] = createSignal(props.isInteractive ? interactive_element_default : props.componentRef);
|
|
4495
|
-
const onUpdateFn_0_props_componentOptions = createMemo(() => props.componentOptions);
|
|
4496
|
-
const onUpdateFn_0_props_blockChildren = createMemo(() => props.blockChildren);
|
|
4497
|
-
function onUpdateFn_0() {
|
|
4498
|
-
}
|
|
4499
|
-
createEffect(on(() => [onUpdateFn_0_props_componentOptions(), onUpdateFn_0_props_blockChildren()], onUpdateFn_0));
|
|
4500
4495
|
return createComponent(Show, {
|
|
4501
4496
|
get when() {
|
|
4502
4497
|
return props.componentRef;
|
|
@@ -4516,25 +4511,32 @@ function ComponentRef(props) {
|
|
|
4516
4511
|
return Wrapper();
|
|
4517
4512
|
},
|
|
4518
4513
|
get children() {
|
|
4519
|
-
return createComponent(
|
|
4520
|
-
get
|
|
4521
|
-
return props.
|
|
4514
|
+
return createComponent(Show, {
|
|
4515
|
+
get when() {
|
|
4516
|
+
return props.componentRef;
|
|
4522
4517
|
},
|
|
4523
|
-
children
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
return child.id;
|
|
4528
|
-
},
|
|
4529
|
-
block: child,
|
|
4530
|
-
get context() {
|
|
4531
|
-
return props.context;
|
|
4532
|
-
},
|
|
4533
|
-
get registeredComponents() {
|
|
4534
|
-
return props.registeredComponents;
|
|
4518
|
+
get children() {
|
|
4519
|
+
return createComponent(For, {
|
|
4520
|
+
get each() {
|
|
4521
|
+
return props.blockChildren;
|
|
4535
4522
|
},
|
|
4536
|
-
|
|
4537
|
-
|
|
4523
|
+
children: (child, _index) => {
|
|
4524
|
+
_index();
|
|
4525
|
+
return createComponent(block_default, {
|
|
4526
|
+
get key() {
|
|
4527
|
+
return child.id;
|
|
4528
|
+
},
|
|
4529
|
+
block: child,
|
|
4530
|
+
get context() {
|
|
4531
|
+
return props.context;
|
|
4532
|
+
},
|
|
4533
|
+
get registeredComponents() {
|
|
4534
|
+
return props.registeredComponents;
|
|
4535
|
+
},
|
|
4536
|
+
get linkComponent() {
|
|
4537
|
+
return props.linkComponent;
|
|
4538
|
+
}
|
|
4539
|
+
});
|
|
4538
4540
|
}
|
|
4539
4541
|
});
|
|
4540
4542
|
}
|
|
@@ -4841,7 +4843,7 @@ function Block(props) {
|
|
|
4841
4843
|
});
|
|
4842
4844
|
}
|
|
4843
4845
|
var block_default = Block;
|
|
4844
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-
|
|
4846
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-4d836538 {
|
|
4845
4847
|
display: flex;
|
|
4846
4848
|
flex-direction: column;
|
|
4847
4849
|
align-items: stretch;
|
|
@@ -4890,7 +4892,7 @@ function BlocksWrapper(props) {
|
|
|
4890
4892
|
createEffect(on(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
|
|
4891
4893
|
return [createComponent(Dynamic, mergeProps({
|
|
4892
4894
|
get ["class"]() {
|
|
4893
|
-
return className() + " dynamic-
|
|
4895
|
+
return className() + " dynamic-4d836538";
|
|
4894
4896
|
},
|
|
4895
4897
|
ref(r$) {
|
|
4896
4898
|
const _ref$ = blocksWrapperRef;
|
|
@@ -7143,6 +7145,9 @@ function Tabs(props) {
|
|
|
7143
7145
|
function activeTabContent(active) {
|
|
7144
7146
|
return props.tabs && props.tabs[active].content;
|
|
7145
7147
|
}
|
|
7148
|
+
function getTabStyle(index) {
|
|
7149
|
+
return index === activeTab() ? props.activeTabStyle : {};
|
|
7150
|
+
}
|
|
7146
7151
|
function onClick(index) {
|
|
7147
7152
|
if (index === activeTab() && props.collapsible) {
|
|
7148
7153
|
setActiveTab(-1);
|
|
@@ -7184,9 +7189,7 @@ function Tabs(props) {
|
|
|
7184
7189
|
}
|
|
7185
7190
|
}));
|
|
7186
7191
|
effect((_p$) => {
|
|
7187
|
-
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 =
|
|
7188
|
-
...activeTab() === index ? props.activeTabStyle : {}
|
|
7189
|
-
};
|
|
7192
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getTabStyle(index);
|
|
7190
7193
|
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
7191
7194
|
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
7192
7195
|
return _p$;
|
|
@@ -7682,9 +7685,9 @@ function logFetch(url) {
|
|
|
7682
7685
|
}
|
|
7683
7686
|
|
|
7684
7687
|
// src/blocks/form/form/form.tsx
|
|
7685
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-
|
|
7688
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-74261216">`);
|
|
7686
7689
|
var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
|
|
7687
|
-
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-
|
|
7690
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-74261216 {
|
|
7688
7691
|
padding: 10px;
|
|
7689
7692
|
color: red;
|
|
7690
7693
|
text-align: center;
|
|
@@ -7707,6 +7710,9 @@ function FormComponent(props) {
|
|
|
7707
7710
|
function submissionState() {
|
|
7708
7711
|
return isEditing() && props.previewState || formState();
|
|
7709
7712
|
}
|
|
7713
|
+
function errorResponse(response) {
|
|
7714
|
+
return JSON.stringify(response, null, 2);
|
|
7715
|
+
}
|
|
7710
7716
|
function onSubmit(event) {
|
|
7711
7717
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
7712
7718
|
if (props.sendSubmissionsTo === "zapier") {
|
|
@@ -7721,13 +7727,13 @@ function FormComponent(props) {
|
|
|
7721
7727
|
const headers = props.customHeaders || {};
|
|
7722
7728
|
let body;
|
|
7723
7729
|
const formData = new FormData(el);
|
|
7724
|
-
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
7730
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).filter((el2) => !!el2.name && (el2.type !== "radio" || el2.checked)).map((el2) => {
|
|
7725
7731
|
let value;
|
|
7726
7732
|
const key = el2.name;
|
|
7727
7733
|
if (el2 instanceof HTMLInputElement) {
|
|
7728
7734
|
if (el2.type === "radio") {
|
|
7729
7735
|
if (el2.checked) {
|
|
7730
|
-
value = el2.
|
|
7736
|
+
value = el2.value;
|
|
7731
7737
|
return {
|
|
7732
7738
|
key,
|
|
7733
7739
|
value
|
|
@@ -7954,7 +7960,7 @@ function FormComponent(props) {
|
|
|
7954
7960
|
},
|
|
7955
7961
|
get children() {
|
|
7956
7962
|
const _el$2 = _tmpl$15();
|
|
7957
|
-
insert(_el$2, () =>
|
|
7963
|
+
insert(_el$2, () => errorResponse(responseData()));
|
|
7958
7964
|
return _el$2;
|
|
7959
7965
|
}
|
|
7960
7966
|
}), null);
|
|
@@ -8670,7 +8676,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8670
8676
|
}
|
|
8671
8677
|
|
|
8672
8678
|
// src/constants/sdk-version.ts
|
|
8673
|
-
var SDK_VERSION = "4.2.
|
|
8679
|
+
var SDK_VERSION = "4.2.2";
|
|
8674
8680
|
|
|
8675
8681
|
// src/helpers/sdk-headers.ts
|
|
8676
8682
|
var getSdkHeaders = () => ({
|
|
@@ -9474,6 +9480,8 @@ var getWrapperClassName = (variationId) => {
|
|
|
9474
9480
|
// src/components/content/components/enable-editor.tsx
|
|
9475
9481
|
function EnableEditor(props) {
|
|
9476
9482
|
createSignal(false);
|
|
9483
|
+
const [prevData, setPrevData] = createSignal(null);
|
|
9484
|
+
const [prevLocale, setPrevLocale] = createSignal("");
|
|
9477
9485
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
9478
9486
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
9479
9487
|
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
@@ -9598,11 +9606,15 @@ function EnableEditor(props) {
|
|
|
9598
9606
|
method: "GET"
|
|
9599
9607
|
};
|
|
9600
9608
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
9601
|
-
|
|
9609
|
+
const fetchOptions = {
|
|
9602
9610
|
method: fetchRequestObj.method,
|
|
9603
9611
|
headers: fetchRequestObj.headers,
|
|
9604
9612
|
body: fetchRequestObj.body
|
|
9605
|
-
}
|
|
9613
|
+
};
|
|
9614
|
+
if (fetchRequestObj.method === "GET") {
|
|
9615
|
+
delete fetchOptions.body;
|
|
9616
|
+
}
|
|
9617
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
9606
9618
|
mergeNewRootState({
|
|
9607
9619
|
[key]: json
|
|
9608
9620
|
});
|
|
@@ -9710,16 +9722,24 @@ function EnableEditor(props) {
|
|
|
9710
9722
|
const onUpdateFn_2_props_data = createMemo(() => props.data);
|
|
9711
9723
|
function onUpdateFn_2() {
|
|
9712
9724
|
if (props.data) {
|
|
9725
|
+
if (prevData() === props.data) {
|
|
9726
|
+
return;
|
|
9727
|
+
}
|
|
9713
9728
|
mergeNewRootState(props.data);
|
|
9729
|
+
setPrevData(props.data);
|
|
9714
9730
|
}
|
|
9715
9731
|
}
|
|
9716
9732
|
createEffect(on(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
9717
9733
|
const onUpdateFn_3_props_locale = createMemo(() => props.locale);
|
|
9718
9734
|
function onUpdateFn_3() {
|
|
9719
9735
|
if (props.locale) {
|
|
9736
|
+
if (prevLocale() === props.locale) {
|
|
9737
|
+
return;
|
|
9738
|
+
}
|
|
9720
9739
|
mergeNewRootState({
|
|
9721
9740
|
locale: props.locale
|
|
9722
9741
|
});
|
|
9742
|
+
setPrevLocale(props.locale);
|
|
9723
9743
|
}
|
|
9724
9744
|
}
|
|
9725
9745
|
createEffect(on(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
@@ -10269,6 +10289,9 @@ function Symbol2(props) {
|
|
|
10269
10289
|
const contentWrapper = createMemo(() => {
|
|
10270
10290
|
return "div";
|
|
10271
10291
|
});
|
|
10292
|
+
const customComponents = createMemo(() => {
|
|
10293
|
+
return Object.values(props.builderComponents);
|
|
10294
|
+
});
|
|
10272
10295
|
const className = createMemo(() => {
|
|
10273
10296
|
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(" ");
|
|
10274
10297
|
});
|
|
@@ -10317,7 +10340,7 @@ function Symbol2(props) {
|
|
|
10317
10340
|
};
|
|
10318
10341
|
},
|
|
10319
10342
|
get customComponents() {
|
|
10320
|
-
return
|
|
10343
|
+
return customComponents();
|
|
10321
10344
|
},
|
|
10322
10345
|
get data() {
|
|
10323
10346
|
return {
|
|
@@ -10378,6 +10401,18 @@ function register(type, info) {
|
|
|
10378
10401
|
}
|
|
10379
10402
|
}
|
|
10380
10403
|
}
|
|
10404
|
+
function registerAction(action) {
|
|
10405
|
+
if (isBrowser()) {
|
|
10406
|
+
const actionClone = JSON.parse(JSON.stringify(action));
|
|
10407
|
+
if (action.action) {
|
|
10408
|
+
actionClone.action = action.action.toString();
|
|
10409
|
+
}
|
|
10410
|
+
window.parent?.postMessage({
|
|
10411
|
+
type: "builder.registerAction",
|
|
10412
|
+
data: actionClone
|
|
10413
|
+
}, "*");
|
|
10414
|
+
}
|
|
10415
|
+
}
|
|
10381
10416
|
|
|
10382
10417
|
// src/functions/set-editor-settings.ts
|
|
10383
10418
|
var settings = {};
|
|
@@ -10414,4 +10449,4 @@ var fetchBuilderProps = async (_args) => {
|
|
|
10414
10449
|
};
|
|
10415
10450
|
};
|
|
10416
10451
|
|
|
10417
|
-
export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setClientUserAttributes, setEditorSettings, subscribeToEditor, track };
|
|
10452
|
+
export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, registerAction, setClientUserAttributes, setEditorSettings, subscribeToEditor, track };
|
package/lib/edge/index.jsx
CHANGED
|
@@ -4376,14 +4376,7 @@ function BlockWrapper(props) {
|
|
|
4376
4376
|
var Block_wrapper_default = BlockWrapper;
|
|
4377
4377
|
|
|
4378
4378
|
// src/components/block/components/component-ref/component-ref.tsx
|
|
4379
|
-
import {
|
|
4380
|
-
Show as Show4,
|
|
4381
|
-
For,
|
|
4382
|
-
on as on2,
|
|
4383
|
-
createEffect as createEffect2,
|
|
4384
|
-
createMemo as createMemo3,
|
|
4385
|
-
createSignal as createSignal3
|
|
4386
|
-
} from "solid-js";
|
|
4379
|
+
import { Show as Show4, For, createSignal as createSignal3 } from "solid-js";
|
|
4387
4380
|
import { Dynamic as Dynamic3 } from "solid-js/web";
|
|
4388
4381
|
|
|
4389
4382
|
// src/components/block/components/interactive-element.tsx
|
|
@@ -4490,23 +4483,6 @@ function ComponentRef(props) {
|
|
|
4490
4483
|
const [Wrapper, setWrapper] = createSignal3(
|
|
4491
4484
|
props.isInteractive ? interactive_element_default : props.componentRef
|
|
4492
4485
|
);
|
|
4493
|
-
const onUpdateFn_0_props_componentOptions = createMemo3(
|
|
4494
|
-
() => props.componentOptions
|
|
4495
|
-
);
|
|
4496
|
-
const onUpdateFn_0_props_blockChildren = createMemo3(
|
|
4497
|
-
() => props.blockChildren
|
|
4498
|
-
);
|
|
4499
|
-
function onUpdateFn_0() {
|
|
4500
|
-
}
|
|
4501
|
-
createEffect2(
|
|
4502
|
-
on2(
|
|
4503
|
-
() => [
|
|
4504
|
-
onUpdateFn_0_props_componentOptions(),
|
|
4505
|
-
onUpdateFn_0_props_blockChildren()
|
|
4506
|
-
],
|
|
4507
|
-
onUpdateFn_0
|
|
4508
|
-
)
|
|
4509
|
-
);
|
|
4510
4486
|
return <><Show4 when={props.componentRef}><Dynamic3
|
|
4511
4487
|
{...getWrapperProps({
|
|
4512
4488
|
componentOptions: props.componentOptions,
|
|
@@ -4519,7 +4495,7 @@ function ComponentRef(props) {
|
|
|
4519
4495
|
contextValue: props.context
|
|
4520
4496
|
})}
|
|
4521
4497
|
component={Wrapper()}
|
|
4522
|
-
><For each={props.blockChildren}>{(child, _index) => {
|
|
4498
|
+
><Show4 when={props.componentRef}><For each={props.blockChildren}>{(child, _index) => {
|
|
4523
4499
|
const index = _index();
|
|
4524
4500
|
return <Block_default
|
|
4525
4501
|
key={child.id}
|
|
@@ -4528,12 +4504,12 @@ function ComponentRef(props) {
|
|
|
4528
4504
|
registeredComponents={props.registeredComponents}
|
|
4529
4505
|
linkComponent={props.linkComponent}
|
|
4530
4506
|
/>;
|
|
4531
|
-
}}</For></Dynamic3></Show4></>;
|
|
4507
|
+
}}</For></Show4></Dynamic3></Show4></>;
|
|
4532
4508
|
}
|
|
4533
4509
|
var Component_ref_default = ComponentRef;
|
|
4534
4510
|
|
|
4535
4511
|
// src/components/block/components/repeated-block.tsx
|
|
4536
|
-
import { on as
|
|
4512
|
+
import { on as on2, createEffect as createEffect2, createMemo as createMemo4, createSignal as createSignal4 } from "solid-js";
|
|
4537
4513
|
function RepeatedBlock(props) {
|
|
4538
4514
|
const [store, setStore] = createSignal4(props.repeatContext);
|
|
4539
4515
|
const onUpdateFn_0_props_repeatContext = createMemo4(
|
|
@@ -4542,7 +4518,7 @@ function RepeatedBlock(props) {
|
|
|
4542
4518
|
function onUpdateFn_0() {
|
|
4543
4519
|
setStore(props.repeatContext);
|
|
4544
4520
|
}
|
|
4545
|
-
|
|
4521
|
+
createEffect2(on2(() => [onUpdateFn_0_props_repeatContext()], onUpdateFn_0));
|
|
4546
4522
|
return <><builder_context_default.Provider value={store()}><Block_default
|
|
4547
4523
|
block={props.block}
|
|
4548
4524
|
context={store()}
|
|
@@ -4711,7 +4687,7 @@ function Block(props) {
|
|
|
4711
4687
|
var Block_default = Block;
|
|
4712
4688
|
|
|
4713
4689
|
// src/components/blocks/blocks-wrapper.tsx
|
|
4714
|
-
import { onMount as onMount3, on as
|
|
4690
|
+
import { onMount as onMount3, on as on4, createEffect as createEffect4, createMemo as createMemo6, createSignal as createSignal6 } from "solid-js";
|
|
4715
4691
|
import { Dynamic as Dynamic4 } from "solid-js/web";
|
|
4716
4692
|
function BlocksWrapper(props) {
|
|
4717
4693
|
const [shouldUpdate, setShouldUpdate] = createSignal6(false);
|
|
@@ -4764,10 +4740,10 @@ function BlocksWrapper(props) {
|
|
|
4764
4740
|
const onUpdateFn_0_props_blocks = createMemo6(() => props.blocks);
|
|
4765
4741
|
function onUpdateFn_0() {
|
|
4766
4742
|
}
|
|
4767
|
-
|
|
4743
|
+
createEffect4(on4(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
|
|
4768
4744
|
return <>
|
|
4769
4745
|
<Dynamic4
|
|
4770
|
-
class={className() + " dynamic-
|
|
4746
|
+
class={className() + " dynamic-4d836538"}
|
|
4771
4747
|
ref={blocksWrapperRef}
|
|
4772
4748
|
builder-path={dataPath()}
|
|
4773
4749
|
builder-parent-id={props.parent}
|
|
@@ -4779,7 +4755,7 @@ function BlocksWrapper(props) {
|
|
|
4779
4755
|
{...props.BlocksWrapperProps}
|
|
4780
4756
|
component={props.BlocksWrapper}
|
|
4781
4757
|
>{props.children}</Dynamic4>
|
|
4782
|
-
<style>{`.dynamic-
|
|
4758
|
+
<style>{`.dynamic-4d836538 {
|
|
4783
4759
|
display: flex;
|
|
4784
4760
|
flex-direction: column;
|
|
4785
4761
|
align-items: stretch;
|
|
@@ -5158,7 +5134,7 @@ function SectionComponent(props) {
|
|
|
5158
5134
|
var section_default = SectionComponent;
|
|
5159
5135
|
|
|
5160
5136
|
// src/blocks/symbol/symbol.tsx
|
|
5161
|
-
import { onMount as onMount10, on as
|
|
5137
|
+
import { onMount as onMount10, on as on8, createEffect as createEffect8, createMemo as createMemo21, createSignal as createSignal21 } from "solid-js";
|
|
5162
5138
|
|
|
5163
5139
|
// src/components/content-variants/content-variants.tsx
|
|
5164
5140
|
import { Show as Show16, For as For9, onMount as onMount9, createSignal as createSignal20, createMemo as createMemo20 } from "solid-js";
|
|
@@ -6798,6 +6774,9 @@ function Tabs(props) {
|
|
|
6798
6774
|
function activeTabContent(active) {
|
|
6799
6775
|
return props.tabs && props.tabs[active].content;
|
|
6800
6776
|
}
|
|
6777
|
+
function getTabStyle(index) {
|
|
6778
|
+
return index === activeTab() ? props.activeTabStyle : {};
|
|
6779
|
+
}
|
|
6801
6780
|
function onClick(index) {
|
|
6802
6781
|
if (index === activeTab() && props.collapsible) {
|
|
6803
6782
|
setActiveTab(-1);
|
|
@@ -6819,9 +6798,7 @@ function Tabs(props) {
|
|
|
6819
6798
|
return <span
|
|
6820
6799
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
6821
6800
|
key={index}
|
|
6822
|
-
style={
|
|
6823
|
-
...activeTab() === index ? props.activeTabStyle : {}
|
|
6824
|
-
}}
|
|
6801
|
+
style={getTabStyle(index)}
|
|
6825
6802
|
onClick={(event) => onClick(index)}
|
|
6826
6803
|
><Blocks_default
|
|
6827
6804
|
parent={props.builderBlock.id}
|
|
@@ -6907,7 +6884,7 @@ var componentInfo12 = {
|
|
|
6907
6884
|
};
|
|
6908
6885
|
|
|
6909
6886
|
// src/blocks/custom-code/custom-code.tsx
|
|
6910
|
-
import { onMount as onMount6, on as
|
|
6887
|
+
import { onMount as onMount6, on as on5, createEffect as createEffect5, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
6911
6888
|
function CustomCode(props) {
|
|
6912
6889
|
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
6913
6890
|
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
@@ -6957,7 +6934,7 @@ function CustomCode(props) {
|
|
|
6957
6934
|
runScripts();
|
|
6958
6935
|
}
|
|
6959
6936
|
}
|
|
6960
|
-
|
|
6937
|
+
createEffect5(on5(() => [onUpdateFn_0_props_code()], onUpdateFn_0));
|
|
6961
6938
|
return <><div
|
|
6962
6939
|
class={"builder-custom-code" + (props.replaceNodes ? " replace-nodes" : "")}
|
|
6963
6940
|
ref={elementRef}
|
|
@@ -6985,7 +6962,7 @@ var componentInfo13 = {
|
|
|
6985
6962
|
};
|
|
6986
6963
|
|
|
6987
6964
|
// src/blocks/embed/embed.tsx
|
|
6988
|
-
import { on as
|
|
6965
|
+
import { on as on6, createEffect as createEffect6, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
|
|
6989
6966
|
|
|
6990
6967
|
// src/blocks/embed/helpers.ts
|
|
6991
6968
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -7027,8 +7004,8 @@ function Embed(props) {
|
|
|
7027
7004
|
findAndRunScripts();
|
|
7028
7005
|
}
|
|
7029
7006
|
}
|
|
7030
|
-
|
|
7031
|
-
|
|
7007
|
+
createEffect6(
|
|
7008
|
+
on6(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0)
|
|
7032
7009
|
);
|
|
7033
7010
|
return <><div class="builder-embed" ref={elem} innerHTML={props.content} /></>;
|
|
7034
7011
|
}
|
|
@@ -7312,6 +7289,9 @@ function FormComponent(props) {
|
|
|
7312
7289
|
function submissionState() {
|
|
7313
7290
|
return isEditing() && props.previewState || formState();
|
|
7314
7291
|
}
|
|
7292
|
+
function errorResponse(response) {
|
|
7293
|
+
return JSON.stringify(response, null, 2);
|
|
7294
|
+
}
|
|
7315
7295
|
function onSubmit(event) {
|
|
7316
7296
|
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
7317
7297
|
if (props.sendSubmissionsTo === "zapier") {
|
|
@@ -7326,13 +7306,15 @@ function FormComponent(props) {
|
|
|
7326
7306
|
const headers = props.customHeaders || {};
|
|
7327
7307
|
let body;
|
|
7328
7308
|
const formData = new FormData(el);
|
|
7329
|
-
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).
|
|
7309
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).filter(
|
|
7310
|
+
(el2) => !!el2.name && (el2.type !== "radio" || el2.checked)
|
|
7311
|
+
).map((el2) => {
|
|
7330
7312
|
let value;
|
|
7331
7313
|
const key = el2.name;
|
|
7332
7314
|
if (el2 instanceof HTMLInputElement) {
|
|
7333
7315
|
if (el2.type === "radio") {
|
|
7334
7316
|
if (el2.checked) {
|
|
7335
|
-
value = el2.
|
|
7317
|
+
value = el2.value;
|
|
7336
7318
|
return {
|
|
7337
7319
|
key,
|
|
7338
7320
|
value
|
|
@@ -7524,14 +7506,14 @@ function FormComponent(props) {
|
|
|
7524
7506
|
blocks={props.sendingMessage}
|
|
7525
7507
|
context={props.builderContext}
|
|
7526
7508
|
/></Show12>
|
|
7527
|
-
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-
|
|
7509
|
+
<Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-74261216">{errorResponse(responseData())}</pre></Show12>
|
|
7528
7510
|
<Show12 when={submissionState() === "success"}><Blocks_default
|
|
7529
7511
|
path="successMessage"
|
|
7530
7512
|
blocks={props.successMessage}
|
|
7531
7513
|
context={props.builderContext}
|
|
7532
7514
|
/></Show12>
|
|
7533
7515
|
</form>
|
|
7534
|
-
<style>{`.pre-
|
|
7516
|
+
<style>{`.pre-74261216 {
|
|
7535
7517
|
padding: 10px;
|
|
7536
7518
|
color: red;
|
|
7537
7519
|
text-align: center;
|
|
@@ -8153,8 +8135,8 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
8153
8135
|
import {
|
|
8154
8136
|
Show as Show14,
|
|
8155
8137
|
onMount as onMount8,
|
|
8156
|
-
on as
|
|
8157
|
-
createEffect as
|
|
8138
|
+
on as on7,
|
|
8139
|
+
createEffect as createEffect7,
|
|
8158
8140
|
createMemo as createMemo17,
|
|
8159
8141
|
createSignal as createSignal17
|
|
8160
8142
|
} from "solid-js";
|
|
@@ -8166,7 +8148,7 @@ function getPreviewContent(_searchParams) {
|
|
|
8166
8148
|
}
|
|
8167
8149
|
|
|
8168
8150
|
// src/constants/sdk-version.ts
|
|
8169
|
-
var SDK_VERSION = "4.2.
|
|
8151
|
+
var SDK_VERSION = "4.2.2";
|
|
8170
8152
|
|
|
8171
8153
|
// src/helpers/sdk-headers.ts
|
|
8172
8154
|
var getSdkHeaders = () => ({
|
|
@@ -8970,6 +8952,8 @@ var getWrapperClassName = (variationId) => {
|
|
|
8970
8952
|
// src/components/content/components/enable-editor.tsx
|
|
8971
8953
|
function EnableEditor(props) {
|
|
8972
8954
|
const [hasExecuted, setHasExecuted] = createSignal17(false);
|
|
8955
|
+
const [prevData, setPrevData] = createSignal17(null);
|
|
8956
|
+
const [prevLocale, setPrevLocale] = createSignal17("");
|
|
8973
8957
|
const [ContentWrapper, setContentWrapper] = createSignal17(
|
|
8974
8958
|
props.contentWrapper || "div"
|
|
8975
8959
|
);
|
|
@@ -9099,11 +9083,15 @@ function EnableEditor(props) {
|
|
|
9099
9083
|
method: "GET"
|
|
9100
9084
|
};
|
|
9101
9085
|
logFetch(JSON.stringify(fetchRequestObj));
|
|
9102
|
-
|
|
9086
|
+
const fetchOptions = {
|
|
9103
9087
|
method: fetchRequestObj.method,
|
|
9104
9088
|
headers: fetchRequestObj.headers,
|
|
9105
9089
|
body: fetchRequestObj.body
|
|
9106
|
-
}
|
|
9090
|
+
};
|
|
9091
|
+
if (fetchRequestObj.method === "GET") {
|
|
9092
|
+
delete fetchOptions.body;
|
|
9093
|
+
}
|
|
9094
|
+
fetch(fetchRequestObj.url, fetchOptions).then((response) => response.json()).then((json) => {
|
|
9107
9095
|
mergeNewRootState({
|
|
9108
9096
|
[key]: json
|
|
9109
9097
|
});
|
|
@@ -9215,15 +9203,15 @@ function EnableEditor(props) {
|
|
|
9215
9203
|
mergeNewContent(props.content);
|
|
9216
9204
|
}
|
|
9217
9205
|
}
|
|
9218
|
-
|
|
9206
|
+
createEffect7(on7(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
9219
9207
|
const onUpdateFn_1_props_builderContextSignal_rootState = createMemo17(
|
|
9220
9208
|
() => props.builderContextSignal.rootState
|
|
9221
9209
|
);
|
|
9222
9210
|
function onUpdateFn_1() {
|
|
9223
9211
|
emitStateUpdate();
|
|
9224
9212
|
}
|
|
9225
|
-
|
|
9226
|
-
|
|
9213
|
+
createEffect7(
|
|
9214
|
+
on7(
|
|
9227
9215
|
() => [onUpdateFn_1_props_builderContextSignal_rootState()],
|
|
9228
9216
|
onUpdateFn_1
|
|
9229
9217
|
)
|
|
@@ -9231,19 +9219,27 @@ function EnableEditor(props) {
|
|
|
9231
9219
|
const onUpdateFn_2_props_data = createMemo17(() => props.data);
|
|
9232
9220
|
function onUpdateFn_2() {
|
|
9233
9221
|
if (props.data) {
|
|
9222
|
+
if (prevData() === props.data) {
|
|
9223
|
+
return;
|
|
9224
|
+
}
|
|
9234
9225
|
mergeNewRootState(props.data);
|
|
9226
|
+
setPrevData(props.data);
|
|
9235
9227
|
}
|
|
9236
9228
|
}
|
|
9237
|
-
|
|
9229
|
+
createEffect7(on7(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
|
|
9238
9230
|
const onUpdateFn_3_props_locale = createMemo17(() => props.locale);
|
|
9239
9231
|
function onUpdateFn_3() {
|
|
9240
9232
|
if (props.locale) {
|
|
9233
|
+
if (prevLocale() === props.locale) {
|
|
9234
|
+
return;
|
|
9235
|
+
}
|
|
9241
9236
|
mergeNewRootState({
|
|
9242
9237
|
locale: props.locale
|
|
9243
9238
|
});
|
|
9239
|
+
setPrevLocale(props.locale);
|
|
9244
9240
|
}
|
|
9245
9241
|
}
|
|
9246
|
-
|
|
9242
|
+
createEffect7(on7(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
|
|
9247
9243
|
return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
|
|
9248
9244
|
when={props.builderContextSignal.content || needsElementRefDivForEditing()}
|
|
9249
9245
|
><Dynamic5
|
|
@@ -9603,6 +9599,9 @@ function Symbol2(props) {
|
|
|
9603
9599
|
const contentWrapper = createMemo21(() => {
|
|
9604
9600
|
return "div";
|
|
9605
9601
|
});
|
|
9602
|
+
const customComponents = createMemo21(() => {
|
|
9603
|
+
return Object.values(props.builderComponents);
|
|
9604
|
+
});
|
|
9606
9605
|
const className = createMemo21(() => {
|
|
9607
9606
|
return [
|
|
9608
9607
|
...[props.attributes[getClassPropName()]],
|
|
@@ -9630,7 +9629,7 @@ function Symbol2(props) {
|
|
|
9630
9629
|
function onUpdateFn_0() {
|
|
9631
9630
|
setContent();
|
|
9632
9631
|
}
|
|
9633
|
-
|
|
9632
|
+
createEffect8(on8(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
9634
9633
|
return <><div class={className()} {...{}} {...props.attributes} {...{}}><Content_variants_default
|
|
9635
9634
|
nonce={props.builderContext.nonce}
|
|
9636
9635
|
isNestedRender={true}
|
|
@@ -9640,7 +9639,7 @@ function Symbol2(props) {
|
|
|
9640
9639
|
...props.builderContext.context,
|
|
9641
9640
|
symbolId: props.builderBlock?.id
|
|
9642
9641
|
}}
|
|
9643
|
-
customComponents={
|
|
9642
|
+
customComponents={customComponents()}
|
|
9644
9643
|
data={{
|
|
9645
9644
|
...props.symbol?.data,
|
|
9646
9645
|
...props.builderContext.localState,
|
|
@@ -9684,6 +9683,18 @@ function register(type, info) {
|
|
|
9684
9683
|
}
|
|
9685
9684
|
}
|
|
9686
9685
|
}
|
|
9686
|
+
function registerAction(action) {
|
|
9687
|
+
if (isBrowser()) {
|
|
9688
|
+
const actionClone = JSON.parse(JSON.stringify(action));
|
|
9689
|
+
if (action.action) {
|
|
9690
|
+
actionClone.action = action.action.toString();
|
|
9691
|
+
}
|
|
9692
|
+
window.parent?.postMessage({
|
|
9693
|
+
type: "builder.registerAction",
|
|
9694
|
+
data: actionClone
|
|
9695
|
+
}, "*");
|
|
9696
|
+
}
|
|
9697
|
+
}
|
|
9687
9698
|
|
|
9688
9699
|
// src/functions/set-editor-settings.ts
|
|
9689
9700
|
var settings = {};
|
|
@@ -9740,6 +9751,7 @@ export {
|
|
|
9740
9751
|
isEditing,
|
|
9741
9752
|
isPreviewing,
|
|
9742
9753
|
register,
|
|
9754
|
+
registerAction,
|
|
9743
9755
|
setClientUserAttributes,
|
|
9744
9756
|
setEditorSettings,
|
|
9745
9757
|
subscribeToEditor,
|