@builder.io/sdk-solid 1.0.27 → 1.0.28
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 +1 -1
- package/lib/browser/dev.js +379 -65
- package/lib/browser/dev.jsx +393 -115
- package/lib/browser/index.js +379 -65
- package/lib/browser/index.jsx +393 -115
- package/lib/edge/dev.js +379 -65
- package/lib/edge/dev.jsx +393 -115
- package/lib/edge/index.js +379 -65
- package/lib/edge/index.jsx +393 -115
- package/lib/node/dev.js +379 -65
- package/lib/node/dev.jsx +393 -115
- package/lib/node/index.js +379 -65
- package/lib/node/index.jsx +393 -115
- package/package.json +1 -1
package/lib/edge/dev.jsx
CHANGED
|
@@ -3625,6 +3625,9 @@ function getProcessedBlock({
|
|
|
3625
3625
|
}
|
|
3626
3626
|
}
|
|
3627
3627
|
|
|
3628
|
+
// src/functions/camel-to-kebab-case.ts
|
|
3629
|
+
var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
3630
|
+
|
|
3628
3631
|
// src/components/block/animator.ts
|
|
3629
3632
|
function throttle(func, wait, options = {}) {
|
|
3630
3633
|
let context;
|
|
@@ -3675,7 +3678,6 @@ function assign(target, ..._args) {
|
|
|
3675
3678
|
}
|
|
3676
3679
|
return to;
|
|
3677
3680
|
}
|
|
3678
|
-
var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
3679
3681
|
function bindAnimations(animations) {
|
|
3680
3682
|
for (const animation of animations) {
|
|
3681
3683
|
switch (animation.trigger) {
|
|
@@ -3728,7 +3730,7 @@ function triggerAnimation(animation) {
|
|
|
3728
3730
|
element.style.transitionDelay = "0";
|
|
3729
3731
|
assign(element.style, animation.steps[0].styles);
|
|
3730
3732
|
setTimeout(() => {
|
|
3731
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
3733
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
3732
3734
|
if (animation.delay) {
|
|
3733
3735
|
element.style.transitionDelay = animation.delay + "s";
|
|
3734
3736
|
}
|
|
@@ -3788,7 +3790,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
3788
3790
|
}
|
|
3789
3791
|
attachDefaultState();
|
|
3790
3792
|
setTimeout(() => {
|
|
3791
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
3793
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
3792
3794
|
if (animation.delay) {
|
|
3793
3795
|
element.style.transitionDelay = animation.delay + "s";
|
|
3794
3796
|
}
|
|
@@ -3801,9 +3803,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
3801
3803
|
});
|
|
3802
3804
|
}
|
|
3803
3805
|
|
|
3804
|
-
// src/functions/camel-to-kebab-case.ts
|
|
3805
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
3806
|
-
|
|
3807
3806
|
// src/helpers/css.ts
|
|
3808
3807
|
var convertStyleMapToCSSArray = (style) => {
|
|
3809
3808
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -3933,10 +3932,10 @@ var getRepeatItemData = ({
|
|
|
3933
3932
|
return repeatArray;
|
|
3934
3933
|
};
|
|
3935
3934
|
var shouldPassLinkComponent = (block) => {
|
|
3936
|
-
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3935
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
3937
3936
|
};
|
|
3938
3937
|
var shouldPassRegisteredComponents = (block) => {
|
|
3939
|
-
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3938
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
3940
3939
|
};
|
|
3941
3940
|
|
|
3942
3941
|
// src/components/block/components/block-styles.tsx
|
|
@@ -4065,7 +4064,7 @@ function BlockStyles(props) {
|
|
|
4065
4064
|
className: `${className}:hover`,
|
|
4066
4065
|
styles: {
|
|
4067
4066
|
...hoverStyles,
|
|
4068
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
4067
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
|
|
4069
4068
|
hoverAnimation.easing
|
|
4070
4069
|
)}`,
|
|
4071
4070
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
@@ -4830,10 +4829,10 @@ function SectionComponent(props) {
|
|
|
4830
4829
|
var section_default = SectionComponent;
|
|
4831
4830
|
|
|
4832
4831
|
// src/blocks/symbol/symbol.tsx
|
|
4833
|
-
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as
|
|
4832
|
+
import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
|
|
4834
4833
|
|
|
4835
4834
|
// src/components/content-variants/content-variants.tsx
|
|
4836
|
-
import { Show as
|
|
4835
|
+
import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
|
|
4837
4836
|
|
|
4838
4837
|
// src/helpers/url.ts
|
|
4839
4838
|
var getTopLevelDomain = (host) => {
|
|
@@ -5027,7 +5026,7 @@ var handleABTesting = async ({
|
|
|
5027
5026
|
var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
5028
5027
|
|
|
5029
5028
|
// src/components/content/content.tsx
|
|
5030
|
-
import { Show as
|
|
5029
|
+
import { Show as Show13, createSignal as createSignal17 } from "solid-js";
|
|
5031
5030
|
|
|
5032
5031
|
// src/blocks/button/component-info.ts
|
|
5033
5032
|
var componentInfo = {
|
|
@@ -5678,8 +5677,12 @@ function Tabs(props) {
|
|
|
5678
5677
|
function activeTabContent(active) {
|
|
5679
5678
|
return props.tabs && props.tabs[active].content;
|
|
5680
5679
|
}
|
|
5681
|
-
function
|
|
5682
|
-
|
|
5680
|
+
function onClick(index) {
|
|
5681
|
+
if (index === activeTab() && props.collapsible) {
|
|
5682
|
+
setActiveTab(-1);
|
|
5683
|
+
} else {
|
|
5684
|
+
setActiveTab(index);
|
|
5685
|
+
}
|
|
5683
5686
|
}
|
|
5684
5687
|
return <div>
|
|
5685
5688
|
<div
|
|
@@ -5695,14 +5698,10 @@ function Tabs(props) {
|
|
|
5695
5698
|
return <span
|
|
5696
5699
|
class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
|
|
5697
5700
|
key={index}
|
|
5698
|
-
style={
|
|
5699
|
-
|
|
5700
|
-
if (index === activeTab() && props.collapsible) {
|
|
5701
|
-
setActiveTab(-1);
|
|
5702
|
-
} else {
|
|
5703
|
-
setActiveTab(index);
|
|
5704
|
-
}
|
|
5701
|
+
style={{
|
|
5702
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
5705
5703
|
}}
|
|
5704
|
+
onClick={(event) => onClick(index)}
|
|
5706
5705
|
><Blocks_default
|
|
5707
5706
|
parent={props.builderBlock.id}
|
|
5708
5707
|
path={`component.options.tabs.${index}.label`}
|
|
@@ -5757,8 +5756,284 @@ function Text(props) {
|
|
|
5757
5756
|
}
|
|
5758
5757
|
var text_default = Text;
|
|
5759
5758
|
|
|
5760
|
-
// src/blocks/
|
|
5759
|
+
// src/blocks/accordion/accordion.tsx
|
|
5760
|
+
import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
|
|
5761
|
+
|
|
5762
|
+
// src/blocks/accordion/helpers.ts
|
|
5763
|
+
var convertOrderNumberToString = (order) => {
|
|
5764
|
+
return order.toString();
|
|
5765
|
+
};
|
|
5766
|
+
|
|
5767
|
+
// src/blocks/accordion/accordion.tsx
|
|
5768
|
+
function Accordion(props) {
|
|
5769
|
+
const [open, setOpen] = createSignal10([]);
|
|
5770
|
+
const onlyOneAtATime = createMemo10(() => {
|
|
5771
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
5772
|
+
});
|
|
5773
|
+
const accordionStyles = createMemo10(() => {
|
|
5774
|
+
const styles = {
|
|
5775
|
+
display: "flex",
|
|
5776
|
+
alignItems: "stretch",
|
|
5777
|
+
flexDirection: "column",
|
|
5778
|
+
...props.grid && {
|
|
5779
|
+
flexDirection: "row",
|
|
5780
|
+
alignItems: "flex-start",
|
|
5781
|
+
flexWrap: "wrap"
|
|
5782
|
+
}
|
|
5783
|
+
};
|
|
5784
|
+
return Object.fromEntries(
|
|
5785
|
+
Object.entries(styles).map(([key, value]) => [
|
|
5786
|
+
camelToKebabCase(key),
|
|
5787
|
+
value
|
|
5788
|
+
])
|
|
5789
|
+
);
|
|
5790
|
+
});
|
|
5791
|
+
const accordionTitleStyles = createMemo10(() => {
|
|
5792
|
+
const shared = {
|
|
5793
|
+
display: "flex",
|
|
5794
|
+
flexDirection: "column"
|
|
5795
|
+
};
|
|
5796
|
+
const styles = Object.fromEntries(
|
|
5797
|
+
Object.entries({
|
|
5798
|
+
...shared,
|
|
5799
|
+
alignItems: "stretch",
|
|
5800
|
+
cursor: "pointer"
|
|
5801
|
+
}).map(([key, value]) => [camelToKebabCase(key), value])
|
|
5802
|
+
);
|
|
5803
|
+
return Object.fromEntries(
|
|
5804
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
5805
|
+
);
|
|
5806
|
+
});
|
|
5807
|
+
function getAccordionTitleClassName(index) {
|
|
5808
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
5809
|
+
}
|
|
5810
|
+
function getAccordionDetailClassName(index) {
|
|
5811
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
5812
|
+
}
|
|
5813
|
+
const openGridItemOrder = createMemo10(() => {
|
|
5814
|
+
let itemOrder = null;
|
|
5815
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
5816
|
+
if (getOpenGridItemPosition && document) {
|
|
5817
|
+
const openItemIndex = open()[0];
|
|
5818
|
+
const openItem = document.querySelector(
|
|
5819
|
+
`.builder-accordion-title[data-index="${openItemIndex}"]`
|
|
5820
|
+
);
|
|
5821
|
+
let subjectItem = openItem;
|
|
5822
|
+
itemOrder = openItemIndex;
|
|
5823
|
+
if (subjectItem) {
|
|
5824
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
5825
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
5826
|
+
if (subjectItem) {
|
|
5827
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
5828
|
+
continue;
|
|
5829
|
+
}
|
|
5830
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
5831
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
5832
|
+
const index = parseInt(
|
|
5833
|
+
subjectItem.getAttribute("data-index") || "",
|
|
5834
|
+
10
|
|
5835
|
+
);
|
|
5836
|
+
if (!isNaN(index)) {
|
|
5837
|
+
prevItemRect = subjectItemRect;
|
|
5838
|
+
itemOrder = index;
|
|
5839
|
+
}
|
|
5840
|
+
} else {
|
|
5841
|
+
break;
|
|
5842
|
+
}
|
|
5843
|
+
}
|
|
5844
|
+
}
|
|
5845
|
+
}
|
|
5846
|
+
}
|
|
5847
|
+
if (typeof itemOrder === "number") {
|
|
5848
|
+
itemOrder = itemOrder + 1;
|
|
5849
|
+
}
|
|
5850
|
+
return itemOrder;
|
|
5851
|
+
});
|
|
5852
|
+
const accordionDetailStyles = createMemo10(() => {
|
|
5853
|
+
const styles = {
|
|
5854
|
+
...{
|
|
5855
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
5856
|
+
},
|
|
5857
|
+
...props.grid && {
|
|
5858
|
+
width: "100%"
|
|
5859
|
+
}
|
|
5860
|
+
};
|
|
5861
|
+
return Object.fromEntries(
|
|
5862
|
+
Object.entries(styles).filter(([_, value]) => value !== void 0)
|
|
5863
|
+
);
|
|
5864
|
+
});
|
|
5865
|
+
function onClick(index) {
|
|
5866
|
+
if (open().includes(index)) {
|
|
5867
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
5868
|
+
} else {
|
|
5869
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
5870
|
+
}
|
|
5871
|
+
}
|
|
5872
|
+
return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
|
|
5873
|
+
const index = _index();
|
|
5874
|
+
return <>
|
|
5875
|
+
<div
|
|
5876
|
+
class={getAccordionTitleClassName(index)}
|
|
5877
|
+
style={{
|
|
5878
|
+
...accordionTitleStyles(),
|
|
5879
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
5880
|
+
...{
|
|
5881
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
5882
|
+
}
|
|
5883
|
+
}}
|
|
5884
|
+
data-index={index}
|
|
5885
|
+
onClick={(event) => onClick(index)}
|
|
5886
|
+
><Blocks_default
|
|
5887
|
+
blocks={item.title}
|
|
5888
|
+
path={`items.${index}.title`}
|
|
5889
|
+
parent={props.builderBlock.id}
|
|
5890
|
+
context={props.builderContext}
|
|
5891
|
+
registeredComponents={props.builderComponents}
|
|
5892
|
+
linkComponent={props.builderLinkComponent}
|
|
5893
|
+
/></div>
|
|
5894
|
+
<Show9 when={open().includes(index)}><div
|
|
5895
|
+
class={getAccordionDetailClassName(index)}
|
|
5896
|
+
style={accordionDetailStyles()}
|
|
5897
|
+
><Blocks_default
|
|
5898
|
+
blocks={item.detail}
|
|
5899
|
+
path={`items.${index}.detail`}
|
|
5900
|
+
parent={props.builderBlock.id}
|
|
5901
|
+
context={props.builderContext}
|
|
5902
|
+
registeredComponents={props.builderComponents}
|
|
5903
|
+
linkComponent={props.builderLinkComponent}
|
|
5904
|
+
/></div></Show9>
|
|
5905
|
+
</>;
|
|
5906
|
+
}}</For6></div>;
|
|
5907
|
+
}
|
|
5908
|
+
var accordion_default = Accordion;
|
|
5909
|
+
|
|
5910
|
+
// src/blocks/accordion/component-info.ts
|
|
5911
|
+
var defaultTitle = {
|
|
5912
|
+
"@type": "@builder.io/sdk:Element",
|
|
5913
|
+
layerName: "Accordion item title",
|
|
5914
|
+
responsiveStyles: {
|
|
5915
|
+
large: {
|
|
5916
|
+
marginTop: "10px",
|
|
5917
|
+
position: "relative",
|
|
5918
|
+
display: "flex",
|
|
5919
|
+
alignItems: "stretch",
|
|
5920
|
+
flexDirection: "column",
|
|
5921
|
+
paddingBottom: "10px"
|
|
5922
|
+
}
|
|
5923
|
+
},
|
|
5924
|
+
children: [{
|
|
5925
|
+
"@type": "@builder.io/sdk:Element",
|
|
5926
|
+
responsiveStyles: {
|
|
5927
|
+
large: {
|
|
5928
|
+
textAlign: "left",
|
|
5929
|
+
display: "flex",
|
|
5930
|
+
flexDirection: "column"
|
|
5931
|
+
}
|
|
5932
|
+
},
|
|
5933
|
+
component: {
|
|
5934
|
+
name: "Text",
|
|
5935
|
+
options: {
|
|
5936
|
+
text: "I am an accordion title. Click me!"
|
|
5937
|
+
}
|
|
5938
|
+
}
|
|
5939
|
+
}]
|
|
5940
|
+
};
|
|
5941
|
+
var defaultDetail = {
|
|
5942
|
+
"@type": "@builder.io/sdk:Element",
|
|
5943
|
+
layerName: "Accordion item detail",
|
|
5944
|
+
responsiveStyles: {
|
|
5945
|
+
large: {
|
|
5946
|
+
position: "relative",
|
|
5947
|
+
display: "flex",
|
|
5948
|
+
alignItems: "stretch",
|
|
5949
|
+
flexDirection: "column",
|
|
5950
|
+
marginTop: "10px",
|
|
5951
|
+
paddingBottom: "10px"
|
|
5952
|
+
}
|
|
5953
|
+
},
|
|
5954
|
+
children: [{
|
|
5955
|
+
"@type": "@builder.io/sdk:Element",
|
|
5956
|
+
responsiveStyles: {
|
|
5957
|
+
large: {
|
|
5958
|
+
paddingTop: "50px",
|
|
5959
|
+
textAlign: "left",
|
|
5960
|
+
display: "flex",
|
|
5961
|
+
flexDirection: "column",
|
|
5962
|
+
paddingBottom: "50px"
|
|
5963
|
+
}
|
|
5964
|
+
},
|
|
5965
|
+
component: {
|
|
5966
|
+
name: "Text",
|
|
5967
|
+
options: {
|
|
5968
|
+
text: "I am an accordion detail, hello!"
|
|
5969
|
+
}
|
|
5970
|
+
}
|
|
5971
|
+
}]
|
|
5972
|
+
};
|
|
5761
5973
|
var componentInfo10 = {
|
|
5974
|
+
name: "Builder:Accordion",
|
|
5975
|
+
canHaveChildren: true,
|
|
5976
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
5977
|
+
defaultStyles: {
|
|
5978
|
+
display: "flex",
|
|
5979
|
+
flexDirection: "column",
|
|
5980
|
+
alignItems: "stretch"
|
|
5981
|
+
},
|
|
5982
|
+
inputs: [{
|
|
5983
|
+
name: "items",
|
|
5984
|
+
type: "list",
|
|
5985
|
+
broadcast: true,
|
|
5986
|
+
subFields: [{
|
|
5987
|
+
name: "title",
|
|
5988
|
+
type: "uiBlocks",
|
|
5989
|
+
hideFromUI: true,
|
|
5990
|
+
defaultValue: [defaultTitle]
|
|
5991
|
+
}, {
|
|
5992
|
+
name: "detail",
|
|
5993
|
+
type: "uiBlocks",
|
|
5994
|
+
hideFromUI: true,
|
|
5995
|
+
defaultValue: [defaultDetail]
|
|
5996
|
+
}],
|
|
5997
|
+
defaultValue: [{
|
|
5998
|
+
title: [defaultTitle],
|
|
5999
|
+
detail: [defaultDetail]
|
|
6000
|
+
}, {
|
|
6001
|
+
title: [defaultTitle],
|
|
6002
|
+
detail: [defaultDetail]
|
|
6003
|
+
}],
|
|
6004
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
6005
|
+
}, {
|
|
6006
|
+
name: "oneAtATime",
|
|
6007
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
6008
|
+
type: "boolean",
|
|
6009
|
+
defaultValue: false
|
|
6010
|
+
}, {
|
|
6011
|
+
name: "grid",
|
|
6012
|
+
helperText: "Display as a grid",
|
|
6013
|
+
type: "boolean",
|
|
6014
|
+
defaultValue: false
|
|
6015
|
+
}, {
|
|
6016
|
+
name: "gridRowWidth",
|
|
6017
|
+
helperText: "Display as a grid",
|
|
6018
|
+
type: "string",
|
|
6019
|
+
showIf: (options) => options.get("grid"),
|
|
6020
|
+
defaultValue: "25%"
|
|
6021
|
+
}, {
|
|
6022
|
+
name: "useChildrenForItems",
|
|
6023
|
+
type: "boolean",
|
|
6024
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
6025
|
+
advanced: true,
|
|
6026
|
+
defaultValue: false,
|
|
6027
|
+
onChange: (options) => {
|
|
6028
|
+
if (options.get("useChildrenForItems") === true) {
|
|
6029
|
+
options.set("items", []);
|
|
6030
|
+
}
|
|
6031
|
+
}
|
|
6032
|
+
}]
|
|
6033
|
+
};
|
|
6034
|
+
|
|
6035
|
+
// src/blocks/custom-code/component-info.ts
|
|
6036
|
+
var componentInfo11 = {
|
|
5762
6037
|
name: "Custom Code",
|
|
5763
6038
|
static: true,
|
|
5764
6039
|
requiredPermissions: ["editCode"],
|
|
@@ -5783,10 +6058,10 @@ var componentInfo10 = {
|
|
|
5783
6058
|
};
|
|
5784
6059
|
|
|
5785
6060
|
// src/blocks/custom-code/custom-code.tsx
|
|
5786
|
-
import { onMount as onMount2, createSignal as
|
|
6061
|
+
import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
|
|
5787
6062
|
function CustomCode(props) {
|
|
5788
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
5789
|
-
const [scriptsRun, setScriptsRun] =
|
|
6063
|
+
const [scriptsInserted, setScriptsInserted] = createSignal11([]);
|
|
6064
|
+
const [scriptsRun, setScriptsRun] = createSignal11([]);
|
|
5790
6065
|
let elementRef;
|
|
5791
6066
|
onMount2(() => {
|
|
5792
6067
|
if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
|
|
@@ -5830,7 +6105,7 @@ function CustomCode(props) {
|
|
|
5830
6105
|
var custom_code_default = CustomCode;
|
|
5831
6106
|
|
|
5832
6107
|
// src/blocks/embed/component-info.ts
|
|
5833
|
-
var
|
|
6108
|
+
var componentInfo12 = {
|
|
5834
6109
|
name: "Embed",
|
|
5835
6110
|
static: true,
|
|
5836
6111
|
inputs: [{
|
|
@@ -5868,7 +6143,7 @@ var componentInfo11 = {
|
|
|
5868
6143
|
};
|
|
5869
6144
|
|
|
5870
6145
|
// src/blocks/embed/embed.tsx
|
|
5871
|
-
import { on, createEffect, createMemo as
|
|
6146
|
+
import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
|
|
5872
6147
|
|
|
5873
6148
|
// src/blocks/embed/helpers.ts
|
|
5874
6149
|
var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
|
|
@@ -5876,9 +6151,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
|
5876
6151
|
|
|
5877
6152
|
// src/blocks/embed/embed.tsx
|
|
5878
6153
|
function Embed(props) {
|
|
5879
|
-
const [scriptsInserted, setScriptsInserted] =
|
|
5880
|
-
const [scriptsRun, setScriptsRun] =
|
|
5881
|
-
const [ranInitFn, setRanInitFn] =
|
|
6154
|
+
const [scriptsInserted, setScriptsInserted] = createSignal12([]);
|
|
6155
|
+
const [scriptsRun, setScriptsRun] = createSignal12([]);
|
|
6156
|
+
const [ranInitFn, setRanInitFn] = createSignal12(false);
|
|
5882
6157
|
function findAndRunScripts() {
|
|
5883
6158
|
if (!elem || !elem.getElementsByTagName)
|
|
5884
6159
|
return;
|
|
@@ -5902,8 +6177,8 @@ function Embed(props) {
|
|
|
5902
6177
|
}
|
|
5903
6178
|
}
|
|
5904
6179
|
let elem;
|
|
5905
|
-
const onUpdateFn_0_elem =
|
|
5906
|
-
const onUpdateFn_0_ranInitFn__ =
|
|
6180
|
+
const onUpdateFn_0_elem = createMemo12(() => elem);
|
|
6181
|
+
const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
|
|
5907
6182
|
function onUpdateFn_0() {
|
|
5908
6183
|
if (elem && !ranInitFn()) {
|
|
5909
6184
|
setRanInitFn(true);
|
|
@@ -5918,7 +6193,7 @@ function Embed(props) {
|
|
|
5918
6193
|
var embed_default = Embed;
|
|
5919
6194
|
|
|
5920
6195
|
// src/blocks/form/form/component-info.ts
|
|
5921
|
-
var
|
|
6196
|
+
var componentInfo13 = {
|
|
5922
6197
|
name: "Form:Form",
|
|
5923
6198
|
// editableTags: ['builder-form-error']
|
|
5924
6199
|
defaults: {
|
|
@@ -6152,7 +6427,7 @@ var componentInfo12 = {
|
|
|
6152
6427
|
};
|
|
6153
6428
|
|
|
6154
6429
|
// src/blocks/form/form/form.tsx
|
|
6155
|
-
import { Show as
|
|
6430
|
+
import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
|
|
6156
6431
|
import { css as css4 } from "solid-styled-components";
|
|
6157
6432
|
|
|
6158
6433
|
// src/functions/get-env.ts
|
|
@@ -6170,9 +6445,9 @@ var get = (obj, path, defaultValue) => {
|
|
|
6170
6445
|
|
|
6171
6446
|
// src/blocks/form/form/form.tsx
|
|
6172
6447
|
function FormComponent(props) {
|
|
6173
|
-
const [formState, setFormState] =
|
|
6174
|
-
const [responseData, setResponseData] =
|
|
6175
|
-
const [formErrorMessage, setFormErrorMessage] =
|
|
6448
|
+
const [formState, setFormState] = createSignal13("unsubmitted");
|
|
6449
|
+
const [responseData, setResponseData] = createSignal13(null);
|
|
6450
|
+
const [formErrorMessage, setFormErrorMessage] = createSignal13("");
|
|
6176
6451
|
function mergeNewRootState(newData) {
|
|
6177
6452
|
const combinedState = {
|
|
6178
6453
|
...props.builderContext.rootState,
|
|
@@ -6368,7 +6643,7 @@ function FormComponent(props) {
|
|
|
6368
6643
|
{...{}}
|
|
6369
6644
|
{...props.attributes}
|
|
6370
6645
|
>
|
|
6371
|
-
<
|
|
6646
|
+
<Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
|
|
6372
6647
|
const idx = _index();
|
|
6373
6648
|
return <Block_default
|
|
6374
6649
|
key={`form-block-${idx}`}
|
|
@@ -6377,35 +6652,35 @@ function FormComponent(props) {
|
|
|
6377
6652
|
registeredComponents={props.builderComponents}
|
|
6378
6653
|
linkComponent={props.builderLinkComponent}
|
|
6379
6654
|
/>;
|
|
6380
|
-
}}</
|
|
6381
|
-
<
|
|
6655
|
+
}}</For7></Show10>
|
|
6656
|
+
<Show10 when={submissionState() === "error"}><Blocks_default
|
|
6382
6657
|
path="errorMessage"
|
|
6383
6658
|
blocks={props.errorMessage}
|
|
6384
6659
|
context={props.builderContext}
|
|
6385
|
-
/></
|
|
6386
|
-
<
|
|
6660
|
+
/></Show10>
|
|
6661
|
+
<Show10 when={submissionState() === "sending"}><Blocks_default
|
|
6387
6662
|
path="sendingMessage"
|
|
6388
6663
|
blocks={props.sendingMessage}
|
|
6389
6664
|
context={props.builderContext}
|
|
6390
|
-
/></
|
|
6391
|
-
<
|
|
6665
|
+
/></Show10>
|
|
6666
|
+
<Show10 when={submissionState() === "error" && responseData()}><pre
|
|
6392
6667
|
class={"builder-form-error-text " + css4({
|
|
6393
6668
|
padding: "10px",
|
|
6394
6669
|
color: "red",
|
|
6395
6670
|
textAlign: "center"
|
|
6396
6671
|
})}
|
|
6397
|
-
>{JSON.stringify(responseData(), null, 2)}</pre></
|
|
6398
|
-
<
|
|
6672
|
+
>{JSON.stringify(responseData(), null, 2)}</pre></Show10>
|
|
6673
|
+
<Show10 when={submissionState() === "success"}><Blocks_default
|
|
6399
6674
|
path="successMessage"
|
|
6400
6675
|
blocks={props.successMessage}
|
|
6401
6676
|
context={props.builderContext}
|
|
6402
|
-
/></
|
|
6677
|
+
/></Show10>
|
|
6403
6678
|
</form>;
|
|
6404
6679
|
}
|
|
6405
6680
|
var form_default = FormComponent;
|
|
6406
6681
|
|
|
6407
6682
|
// src/blocks/form/input/component-info.ts
|
|
6408
|
-
var
|
|
6683
|
+
var componentInfo14 = {
|
|
6409
6684
|
name: "Form:Input",
|
|
6410
6685
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6411
6686
|
inputs: [
|
|
@@ -6475,7 +6750,7 @@ function FormInputComponent(props) {
|
|
|
6475
6750
|
var input_default = FormInputComponent;
|
|
6476
6751
|
|
|
6477
6752
|
// src/blocks/form/select/component-info.ts
|
|
6478
|
-
var
|
|
6753
|
+
var componentInfo15 = {
|
|
6479
6754
|
name: "Form:Select",
|
|
6480
6755
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6481
6756
|
defaultStyles: {
|
|
@@ -6520,7 +6795,7 @@ var componentInfo14 = {
|
|
|
6520
6795
|
};
|
|
6521
6796
|
|
|
6522
6797
|
// src/blocks/form/select/select.tsx
|
|
6523
|
-
import { For as
|
|
6798
|
+
import { For as For8 } from "solid-js";
|
|
6524
6799
|
function SelectComponent(props) {
|
|
6525
6800
|
return <select
|
|
6526
6801
|
{...{}}
|
|
@@ -6529,15 +6804,15 @@ function SelectComponent(props) {
|
|
|
6529
6804
|
key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
|
|
6530
6805
|
defaultValue={props.defaultValue}
|
|
6531
6806
|
name={props.name}
|
|
6532
|
-
><
|
|
6807
|
+
><For8 each={props.options}>{(option, _index) => {
|
|
6533
6808
|
const index = _index();
|
|
6534
6809
|
return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
|
|
6535
|
-
}}</
|
|
6810
|
+
}}</For8></select>;
|
|
6536
6811
|
}
|
|
6537
6812
|
var select_default = SelectComponent;
|
|
6538
6813
|
|
|
6539
6814
|
// src/blocks/form/submit-button/component-info.ts
|
|
6540
|
-
var
|
|
6815
|
+
var componentInfo16 = {
|
|
6541
6816
|
name: "Form:SubmitButton",
|
|
6542
6817
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
6543
6818
|
defaultStyles: {
|
|
@@ -6571,7 +6846,7 @@ function SubmitButton(props) {
|
|
|
6571
6846
|
var submit_button_default = SubmitButton;
|
|
6572
6847
|
|
|
6573
6848
|
// src/blocks/img/component-info.ts
|
|
6574
|
-
var
|
|
6849
|
+
var componentInfo17 = {
|
|
6575
6850
|
// friendlyName?
|
|
6576
6851
|
name: "Raw:Img",
|
|
6577
6852
|
hideFromInsertMenu: true,
|
|
@@ -6604,7 +6879,7 @@ function ImgComponent(props) {
|
|
|
6604
6879
|
var img_default = ImgComponent;
|
|
6605
6880
|
|
|
6606
6881
|
// src/blocks/video/component-info.ts
|
|
6607
|
-
var
|
|
6882
|
+
var componentInfo18 = {
|
|
6608
6883
|
name: "Video",
|
|
6609
6884
|
canHaveChildren: true,
|
|
6610
6885
|
defaultStyles: {
|
|
@@ -6688,9 +6963,9 @@ var componentInfo17 = {
|
|
|
6688
6963
|
};
|
|
6689
6964
|
|
|
6690
6965
|
// src/blocks/video/video.tsx
|
|
6691
|
-
import { Show as
|
|
6966
|
+
import { Show as Show11, createMemo as createMemo14 } from "solid-js";
|
|
6692
6967
|
function Video(props) {
|
|
6693
|
-
const videoProps =
|
|
6968
|
+
const videoProps = createMemo14(() => {
|
|
6694
6969
|
return {
|
|
6695
6970
|
...props.autoPlay === true ? {
|
|
6696
6971
|
autoPlay: true
|
|
@@ -6709,7 +6984,7 @@ function Video(props) {
|
|
|
6709
6984
|
} : {}
|
|
6710
6985
|
};
|
|
6711
6986
|
});
|
|
6712
|
-
const spreadProps =
|
|
6987
|
+
const spreadProps = createMemo14(() => {
|
|
6713
6988
|
return {
|
|
6714
6989
|
...videoProps()
|
|
6715
6990
|
};
|
|
@@ -6739,8 +7014,8 @@ function Video(props) {
|
|
|
6739
7014
|
}}
|
|
6740
7015
|
src={props.video || "no-src"}
|
|
6741
7016
|
poster={props.posterImage}
|
|
6742
|
-
><
|
|
6743
|
-
<
|
|
7017
|
+
><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
|
|
7018
|
+
<Show11
|
|
6744
7019
|
when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
|
|
6745
7020
|
><div
|
|
6746
7021
|
style={{
|
|
@@ -6749,15 +7024,15 @@ function Video(props) {
|
|
|
6749
7024
|
"pointer-events": "none",
|
|
6750
7025
|
"font-size": "0px"
|
|
6751
7026
|
}}
|
|
6752
|
-
/></
|
|
6753
|
-
<
|
|
7027
|
+
/></Show11>
|
|
7028
|
+
<Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
|
|
6754
7029
|
style={{
|
|
6755
7030
|
display: "flex",
|
|
6756
7031
|
"flex-direction": "column",
|
|
6757
7032
|
"align-items": "stretch"
|
|
6758
7033
|
}}
|
|
6759
|
-
>{props.children}</div></
|
|
6760
|
-
<
|
|
7034
|
+
>{props.children}</div></Show11>
|
|
7035
|
+
<Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
|
|
6761
7036
|
style={{
|
|
6762
7037
|
"pointer-events": "none",
|
|
6763
7038
|
display: "flex",
|
|
@@ -6769,7 +7044,7 @@ function Video(props) {
|
|
|
6769
7044
|
width: "100%",
|
|
6770
7045
|
height: "100%"
|
|
6771
7046
|
}}
|
|
6772
|
-
>{props.children}</div></
|
|
7047
|
+
>{props.children}</div></Show11>
|
|
6773
7048
|
</div>;
|
|
6774
7049
|
}
|
|
6775
7050
|
var video_default = Video;
|
|
@@ -6777,28 +7052,28 @@ var video_default = Video;
|
|
|
6777
7052
|
// src/constants/extra-components.ts
|
|
6778
7053
|
var getExtraComponents = () => [{
|
|
6779
7054
|
component: custom_code_default,
|
|
6780
|
-
...
|
|
7055
|
+
...componentInfo11
|
|
6781
7056
|
}, {
|
|
6782
7057
|
component: embed_default,
|
|
6783
|
-
...
|
|
7058
|
+
...componentInfo12
|
|
6784
7059
|
}, ...TARGET === "rsc" ? [] : [{
|
|
6785
7060
|
component: form_default,
|
|
6786
|
-
...
|
|
7061
|
+
...componentInfo13
|
|
6787
7062
|
}, {
|
|
6788
7063
|
component: input_default,
|
|
6789
|
-
...
|
|
7064
|
+
...componentInfo14
|
|
6790
7065
|
}, {
|
|
6791
7066
|
component: submit_button_default,
|
|
6792
|
-
...
|
|
7067
|
+
...componentInfo16
|
|
6793
7068
|
}, {
|
|
6794
7069
|
component: select_default,
|
|
6795
|
-
...
|
|
7070
|
+
...componentInfo15
|
|
6796
7071
|
}], {
|
|
6797
7072
|
component: img_default,
|
|
6798
|
-
...
|
|
7073
|
+
...componentInfo17
|
|
6799
7074
|
}, {
|
|
6800
7075
|
component: video_default,
|
|
6801
|
-
...
|
|
7076
|
+
...componentInfo18
|
|
6802
7077
|
}];
|
|
6803
7078
|
|
|
6804
7079
|
// src/constants/builder-registered-components.ts
|
|
@@ -6829,6 +7104,9 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
6829
7104
|
}, ...TARGET === "rsc" ? [] : [{
|
|
6830
7105
|
component: tabs_default,
|
|
6831
7106
|
...componentInfo8
|
|
7107
|
+
}, {
|
|
7108
|
+
component: accordion_default,
|
|
7109
|
+
...componentInfo10
|
|
6832
7110
|
}], ...getExtraComponents()];
|
|
6833
7111
|
|
|
6834
7112
|
// src/functions/register-component.ts
|
|
@@ -6907,12 +7185,12 @@ var Inlined_script_default = InlinedScript;
|
|
|
6907
7185
|
|
|
6908
7186
|
// src/components/content/components/enable-editor.tsx
|
|
6909
7187
|
import {
|
|
6910
|
-
Show as
|
|
7188
|
+
Show as Show12,
|
|
6911
7189
|
onMount as onMount3,
|
|
6912
7190
|
on as on2,
|
|
6913
7191
|
createEffect as createEffect2,
|
|
6914
|
-
createMemo as
|
|
6915
|
-
createSignal as
|
|
7192
|
+
createMemo as createMemo15,
|
|
7193
|
+
createSignal as createSignal15
|
|
6916
7194
|
} from "solid-js";
|
|
6917
7195
|
import { Dynamic as Dynamic5 } from "solid-js/web";
|
|
6918
7196
|
|
|
@@ -7412,7 +7690,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7412
7690
|
}
|
|
7413
7691
|
|
|
7414
7692
|
// src/constants/sdk-version.ts
|
|
7415
|
-
var SDK_VERSION = "1.0.
|
|
7693
|
+
var SDK_VERSION = "1.0.28";
|
|
7416
7694
|
|
|
7417
7695
|
// src/functions/register.ts
|
|
7418
7696
|
var registry = {};
|
|
@@ -7690,12 +7968,12 @@ var getWrapperClassName = (variationId) => {
|
|
|
7690
7968
|
|
|
7691
7969
|
// src/components/content/components/enable-editor.tsx
|
|
7692
7970
|
function EnableEditor(props) {
|
|
7693
|
-
const [ContentWrapper, setContentWrapper] =
|
|
7971
|
+
const [ContentWrapper, setContentWrapper] = createSignal15(
|
|
7694
7972
|
props.contentWrapper || "div"
|
|
7695
7973
|
);
|
|
7696
|
-
const [httpReqsData, setHttpReqsData] =
|
|
7697
|
-
const [httpReqsPending, setHttpReqsPending] =
|
|
7698
|
-
const [clicked, setClicked] =
|
|
7974
|
+
const [httpReqsData, setHttpReqsData] = createSignal15({});
|
|
7975
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal15({});
|
|
7976
|
+
const [clicked, setClicked] = createSignal15(false);
|
|
7699
7977
|
function mergeNewRootState(newData) {
|
|
7700
7978
|
const combinedState = {
|
|
7701
7979
|
...props.builderContextSignal.rootState,
|
|
@@ -7729,7 +8007,7 @@ function EnableEditor(props) {
|
|
|
7729
8007
|
content: newContentValue
|
|
7730
8008
|
}));
|
|
7731
8009
|
}
|
|
7732
|
-
const showContentProps =
|
|
8010
|
+
const showContentProps = createMemo15(() => {
|
|
7733
8011
|
return props.showContent ? {} : {
|
|
7734
8012
|
hidden: true,
|
|
7735
8013
|
"aria-hidden": true
|
|
@@ -7913,21 +8191,21 @@ function EnableEditor(props) {
|
|
|
7913
8191
|
onMount3(() => {
|
|
7914
8192
|
if (!props.apiKey) {
|
|
7915
8193
|
logger.error(
|
|
7916
|
-
"No API key provided to `
|
|
8194
|
+
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
7917
8195
|
);
|
|
7918
8196
|
}
|
|
7919
8197
|
evaluateJsCode();
|
|
7920
8198
|
runHttpRequests();
|
|
7921
8199
|
emitStateUpdate();
|
|
7922
8200
|
});
|
|
7923
|
-
const onUpdateFn_0_props_content =
|
|
8201
|
+
const onUpdateFn_0_props_content = createMemo15(() => props.content);
|
|
7924
8202
|
function onUpdateFn_0() {
|
|
7925
8203
|
if (props.content) {
|
|
7926
8204
|
mergeNewContent(props.content);
|
|
7927
8205
|
}
|
|
7928
8206
|
}
|
|
7929
8207
|
createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
|
|
7930
|
-
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode =
|
|
8208
|
+
const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
|
|
7931
8209
|
function onUpdateFn_1() {
|
|
7932
8210
|
evaluateJsCode();
|
|
7933
8211
|
}
|
|
@@ -7937,7 +8215,7 @@ function EnableEditor(props) {
|
|
|
7937
8215
|
onUpdateFn_1
|
|
7938
8216
|
)
|
|
7939
8217
|
);
|
|
7940
|
-
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests =
|
|
8218
|
+
const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
|
|
7941
8219
|
function onUpdateFn_2() {
|
|
7942
8220
|
runHttpRequests();
|
|
7943
8221
|
}
|
|
@@ -7949,7 +8227,7 @@ function EnableEditor(props) {
|
|
|
7949
8227
|
onUpdateFn_2
|
|
7950
8228
|
)
|
|
7951
8229
|
);
|
|
7952
|
-
const onUpdateFn_3_props_builderContextSignal_rootState =
|
|
8230
|
+
const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
|
|
7953
8231
|
() => props.builderContextSignal.rootState
|
|
7954
8232
|
);
|
|
7955
8233
|
function onUpdateFn_3() {
|
|
@@ -7961,14 +8239,14 @@ function EnableEditor(props) {
|
|
|
7961
8239
|
onUpdateFn_3
|
|
7962
8240
|
)
|
|
7963
8241
|
);
|
|
7964
|
-
const onUpdateFn_4_props_data =
|
|
8242
|
+
const onUpdateFn_4_props_data = createMemo15(() => props.data);
|
|
7965
8243
|
function onUpdateFn_4() {
|
|
7966
8244
|
if (props.data) {
|
|
7967
8245
|
mergeNewRootState(props.data);
|
|
7968
8246
|
}
|
|
7969
8247
|
}
|
|
7970
8248
|
createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
|
|
7971
|
-
const onUpdateFn_5_props_locale =
|
|
8249
|
+
const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
|
|
7972
8250
|
function onUpdateFn_5() {
|
|
7973
8251
|
if (props.locale) {
|
|
7974
8252
|
mergeNewRootState({
|
|
@@ -7977,7 +8255,7 @@ function EnableEditor(props) {
|
|
|
7977
8255
|
}
|
|
7978
8256
|
}
|
|
7979
8257
|
createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
|
|
7980
|
-
return <builder_context_default.Provider value={props.builderContextSignal}><
|
|
8258
|
+
return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
|
|
7981
8259
|
class={getWrapperClassName(
|
|
7982
8260
|
props.content?.testVariationId || props.content?.id
|
|
7983
8261
|
)}
|
|
@@ -7990,14 +8268,14 @@ function EnableEditor(props) {
|
|
|
7990
8268
|
{...showContentProps()}
|
|
7991
8269
|
{...props.contentWrapperProps}
|
|
7992
8270
|
component={ContentWrapper()}
|
|
7993
|
-
>{props.children}</Dynamic5></
|
|
8271
|
+
>{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
|
|
7994
8272
|
}
|
|
7995
8273
|
var Enable_editor_default = EnableEditor;
|
|
7996
8274
|
|
|
7997
8275
|
// src/components/content/components/styles.tsx
|
|
7998
|
-
import { createSignal as
|
|
8276
|
+
import { createSignal as createSignal16 } from "solid-js";
|
|
7999
8277
|
function ContentStyles(props) {
|
|
8000
|
-
const [injectedStyles, setInjectedStyles] =
|
|
8278
|
+
const [injectedStyles, setInjectedStyles] = createSignal16(
|
|
8001
8279
|
`
|
|
8002
8280
|
${getCss({
|
|
8003
8281
|
cssCode: props.cssCode,
|
|
@@ -8054,7 +8332,7 @@ var getContentInitialValue = ({
|
|
|
8054
8332
|
|
|
8055
8333
|
// src/components/content/content.tsx
|
|
8056
8334
|
function ContentComponent(props) {
|
|
8057
|
-
const [scriptStr, setScriptStr] =
|
|
8335
|
+
const [scriptStr, setScriptStr] = createSignal17(
|
|
8058
8336
|
getUpdateVariantVisibilityScript({
|
|
8059
8337
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
8060
8338
|
variationId: props.content?.testVariationId,
|
|
@@ -8062,7 +8340,7 @@ function ContentComponent(props) {
|
|
|
8062
8340
|
contentId: props.content?.id
|
|
8063
8341
|
})
|
|
8064
8342
|
);
|
|
8065
|
-
const [registeredComponents, setRegisteredComponents] =
|
|
8343
|
+
const [registeredComponents, setRegisteredComponents] = createSignal17(
|
|
8066
8344
|
[
|
|
8067
8345
|
...getDefaultRegisteredComponents(),
|
|
8068
8346
|
...props.customComponents || []
|
|
@@ -8077,7 +8355,7 @@ function ContentComponent(props) {
|
|
|
8077
8355
|
{}
|
|
8078
8356
|
)
|
|
8079
8357
|
);
|
|
8080
|
-
const [builderContextSignal, setBuilderContextSignal] =
|
|
8358
|
+
const [builderContextSignal, setBuilderContextSignal] = createSignal17({
|
|
8081
8359
|
content: getContentInitialValue({
|
|
8082
8360
|
content: props.content,
|
|
8083
8361
|
data: props.data
|
|
@@ -8135,16 +8413,16 @@ function ContentComponent(props) {
|
|
|
8135
8413
|
setBuilderContextSignal
|
|
8136
8414
|
}}
|
|
8137
8415
|
>
|
|
8138
|
-
<
|
|
8416
|
+
<Show13 when={props.isSsrAbTest}><Inlined_script_default
|
|
8139
8417
|
id="builderio-variant-visibility"
|
|
8140
8418
|
scriptStr={scriptStr()}
|
|
8141
|
-
/></
|
|
8142
|
-
<
|
|
8419
|
+
/></Show13>
|
|
8420
|
+
<Show13 when={TARGET !== "reactNative"}><Styles_default
|
|
8143
8421
|
isNestedRender={props.isNestedRender}
|
|
8144
8422
|
contentId={builderContextSignal().content?.id}
|
|
8145
8423
|
cssCode={builderContextSignal().content?.data?.cssCode}
|
|
8146
8424
|
customFonts={builderContextSignal().content?.data?.customFonts}
|
|
8147
|
-
/></
|
|
8425
|
+
/></Show13>
|
|
8148
8426
|
<Blocks_default
|
|
8149
8427
|
blocks={builderContextSignal().content?.data?.blocks}
|
|
8150
8428
|
context={builderContextSignal()}
|
|
@@ -8157,13 +8435,13 @@ var Content_default = ContentComponent;
|
|
|
8157
8435
|
|
|
8158
8436
|
// src/components/content-variants/content-variants.tsx
|
|
8159
8437
|
function ContentVariants(props) {
|
|
8160
|
-
const [shouldRenderVariants, setShouldRenderVariants] =
|
|
8438
|
+
const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
|
|
8161
8439
|
checkShouldRenderVariants({
|
|
8162
8440
|
canTrack: getDefaultCanTrack(props.canTrack),
|
|
8163
8441
|
content: props.content
|
|
8164
8442
|
})
|
|
8165
8443
|
);
|
|
8166
|
-
const updateCookieAndStylesScriptStr =
|
|
8444
|
+
const updateCookieAndStylesScriptStr = createMemo18(() => {
|
|
8167
8445
|
return getUpdateCookieAndStylesScript(
|
|
8168
8446
|
getVariants(props.content).map((value) => ({
|
|
8169
8447
|
id: value.testVariationId,
|
|
@@ -8172,10 +8450,10 @@ function ContentVariants(props) {
|
|
|
8172
8450
|
props.content?.id || ""
|
|
8173
8451
|
);
|
|
8174
8452
|
});
|
|
8175
|
-
const hideVariantsStyleString =
|
|
8453
|
+
const hideVariantsStyleString = createMemo18(() => {
|
|
8176
8454
|
return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
|
|
8177
8455
|
});
|
|
8178
|
-
const defaultContent =
|
|
8456
|
+
const defaultContent = createMemo18(() => {
|
|
8179
8457
|
return shouldRenderVariants() ? {
|
|
8180
8458
|
...props.content,
|
|
8181
8459
|
testVariationId: props.content?.id
|
|
@@ -8188,11 +8466,11 @@ function ContentVariants(props) {
|
|
|
8188
8466
|
setShouldRenderVariants(false);
|
|
8189
8467
|
});
|
|
8190
8468
|
return <>
|
|
8191
|
-
<
|
|
8469
|
+
<Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
|
|
8192
8470
|
id="builderio-init-variants-fns"
|
|
8193
8471
|
scriptStr={getInitVariantsFnsScriptString()}
|
|
8194
|
-
/></
|
|
8195
|
-
<
|
|
8472
|
+
/></Show14>
|
|
8473
|
+
<Show14 when={shouldRenderVariants()}>
|
|
8196
8474
|
<Inlined_styles_default
|
|
8197
8475
|
id="builderio-variants"
|
|
8198
8476
|
styles={hideVariantsStyleString()}
|
|
@@ -8201,7 +8479,7 @@ function ContentVariants(props) {
|
|
|
8201
8479
|
id="builderio-variants-visibility"
|
|
8202
8480
|
scriptStr={updateCookieAndStylesScriptStr()}
|
|
8203
8481
|
/>
|
|
8204
|
-
<
|
|
8482
|
+
<For9 each={getVariants(props.content)}>{(variant, _index) => {
|
|
8205
8483
|
const index = _index();
|
|
8206
8484
|
return <Content_default
|
|
8207
8485
|
isNestedRender={props.isNestedRender}
|
|
@@ -8225,8 +8503,8 @@ function ContentVariants(props) {
|
|
|
8225
8503
|
contentWrapperProps={props.contentWrapperProps}
|
|
8226
8504
|
trustedHosts={props.trustedHosts}
|
|
8227
8505
|
/>;
|
|
8228
|
-
}}</
|
|
8229
|
-
</
|
|
8506
|
+
}}</For9>
|
|
8507
|
+
</Show14>
|
|
8230
8508
|
<Content_default
|
|
8231
8509
|
isNestedRender={props.isNestedRender}
|
|
8232
8510
|
{...{}}
|
|
@@ -8279,14 +8557,14 @@ var fetchSymbolContent = async ({
|
|
|
8279
8557
|
|
|
8280
8558
|
// src/blocks/symbol/symbol.tsx
|
|
8281
8559
|
function Symbol2(props) {
|
|
8282
|
-
const [contentToUse, setContentToUse] =
|
|
8283
|
-
const blocksWrapper =
|
|
8560
|
+
const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
|
|
8561
|
+
const blocksWrapper = createMemo19(() => {
|
|
8284
8562
|
return "div";
|
|
8285
8563
|
});
|
|
8286
|
-
const contentWrapper =
|
|
8564
|
+
const contentWrapper = createMemo19(() => {
|
|
8287
8565
|
return "div";
|
|
8288
8566
|
});
|
|
8289
|
-
const className =
|
|
8567
|
+
const className = createMemo19(() => {
|
|
8290
8568
|
return [
|
|
8291
8569
|
...[props.attributes[getClassPropName()]],
|
|
8292
8570
|
"builder-symbol",
|
|
@@ -8308,7 +8586,7 @@ function Symbol2(props) {
|
|
|
8308
8586
|
}
|
|
8309
8587
|
onMount5(() => {
|
|
8310
8588
|
});
|
|
8311
|
-
const onUpdateFn_0_props_symbol =
|
|
8589
|
+
const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
|
|
8312
8590
|
function onUpdateFn_0() {
|
|
8313
8591
|
setContent();
|
|
8314
8592
|
}
|