@builder.io/sdk-solid 1.0.23 → 1.0.24
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 +458 -178
- package/lib/browser/dev.jsx +463 -227
- package/lib/browser/index.js +458 -178
- package/lib/browser/index.jsx +463 -227
- package/lib/edge/dev.js +458 -178
- package/lib/edge/dev.jsx +463 -227
- package/lib/edge/index.js +458 -178
- package/lib/edge/index.jsx +463 -227
- package/lib/node/dev.js +458 -178
- package/lib/node/dev.jsx +463 -227
- package/lib/node/index.js +458 -178
- package/lib/node/index.jsx +463 -227
- package/package.json +1 -1
package/lib/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
|
|
1
|
+
import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
|
|
2
2
|
import { createContext, useContext, Show, For, createSignal, createMemo, onMount, createEffect, on } from 'solid-js';
|
|
3
3
|
import { css } from 'solid-styled-components';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
@@ -69,25 +69,29 @@ var getClassPropName = () => {
|
|
|
69
69
|
case "vue":
|
|
70
70
|
case "solid":
|
|
71
71
|
case "qwik":
|
|
72
|
+
case "angular":
|
|
72
73
|
return "class";
|
|
73
74
|
}
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
// src/blocks/button/button.tsx
|
|
77
78
|
function Button(props) {
|
|
79
|
+
function attrs() {
|
|
80
|
+
return {
|
|
81
|
+
...props.attributes,
|
|
82
|
+
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
83
|
+
...props.link ? {
|
|
84
|
+
href: props.link,
|
|
85
|
+
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
86
|
+
role: "link"
|
|
87
|
+
} : {
|
|
88
|
+
role: "button"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
78
92
|
return createComponent(dynamic_renderer_default, {
|
|
79
93
|
get attributes() {
|
|
80
|
-
return
|
|
81
|
-
...props.attributes,
|
|
82
|
-
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
83
|
-
...props.link ? {
|
|
84
|
-
href: props.link,
|
|
85
|
-
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
86
|
-
role: "link"
|
|
87
|
-
} : {
|
|
88
|
-
role: "button"
|
|
89
|
-
}
|
|
90
|
-
};
|
|
94
|
+
return attrs();
|
|
91
95
|
},
|
|
92
96
|
get TagName() {
|
|
93
97
|
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
@@ -852,6 +856,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
852
856
|
case "svelte":
|
|
853
857
|
case "vue":
|
|
854
858
|
case "solid":
|
|
859
|
+
case "angular":
|
|
855
860
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
856
861
|
case "qwik":
|
|
857
862
|
case "reactNative":
|
|
@@ -924,6 +929,12 @@ var getRepeatItemData = ({
|
|
|
924
929
|
}));
|
|
925
930
|
return repeatArray;
|
|
926
931
|
};
|
|
932
|
+
var shouldPassLinkComponent = (blockName) => {
|
|
933
|
+
return blockName && ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
934
|
+
};
|
|
935
|
+
var shouldPassRegisteredComponents = (blockName) => {
|
|
936
|
+
return blockName && ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
937
|
+
};
|
|
927
938
|
|
|
928
939
|
// src/constants/device-sizes.ts
|
|
929
940
|
var SIZES = {
|
|
@@ -1180,21 +1191,24 @@ function BlockWrapper(props) {
|
|
|
1180
1191
|
}
|
|
1181
1192
|
var block_wrapper_default = BlockWrapper;
|
|
1182
1193
|
function InteractiveElement(props) {
|
|
1194
|
+
const attributes = createMemo(() => {
|
|
1195
|
+
return props.includeBlockProps ? {
|
|
1196
|
+
...getBlockProperties({
|
|
1197
|
+
block: props.block,
|
|
1198
|
+
context: props.context
|
|
1199
|
+
}),
|
|
1200
|
+
...getBlockActions({
|
|
1201
|
+
block: props.block,
|
|
1202
|
+
rootState: props.context.rootState,
|
|
1203
|
+
rootSetState: props.context.rootSetState,
|
|
1204
|
+
localState: props.context.localState,
|
|
1205
|
+
context: props.context.context
|
|
1206
|
+
})
|
|
1207
|
+
} : {};
|
|
1208
|
+
});
|
|
1183
1209
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
1184
1210
|
get attributes() {
|
|
1185
|
-
return
|
|
1186
|
-
...getBlockProperties({
|
|
1187
|
-
block: props.block,
|
|
1188
|
-
context: props.context
|
|
1189
|
-
}),
|
|
1190
|
-
...getBlockActions({
|
|
1191
|
-
block: props.block,
|
|
1192
|
-
rootState: props.context.rootState,
|
|
1193
|
-
rootSetState: props.context.rootSetState,
|
|
1194
|
-
localState: props.context.localState,
|
|
1195
|
-
context: props.context.context
|
|
1196
|
-
})
|
|
1197
|
-
} : {};
|
|
1211
|
+
return attributes();
|
|
1198
1212
|
},
|
|
1199
1213
|
get component() {
|
|
1200
1214
|
return props.Wrapper;
|
|
@@ -1369,10 +1383,10 @@ function Block(props) {
|
|
|
1369
1383
|
componentOptions: {
|
|
1370
1384
|
...getBlockComponentOptions(processedBlock()),
|
|
1371
1385
|
builderContext: props.context,
|
|
1372
|
-
...
|
|
1386
|
+
...shouldPassLinkComponent(blockComponent()?.name) ? {
|
|
1373
1387
|
builderLinkComponent: props.linkComponent
|
|
1374
1388
|
} : {},
|
|
1375
|
-
...
|
|
1389
|
+
...shouldPassRegisteredComponents(blockComponent()?.name) ? {
|
|
1376
1390
|
builderComponents: props.registeredComponents
|
|
1377
1391
|
} : {}
|
|
1378
1392
|
},
|
|
@@ -1664,6 +1678,11 @@ function Blocks(props) {
|
|
|
1664
1678
|
}
|
|
1665
1679
|
var blocks_default = Blocks;
|
|
1666
1680
|
|
|
1681
|
+
// src/blocks/columns/helpers.ts
|
|
1682
|
+
var getColumnsClass = (id) => {
|
|
1683
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1667
1686
|
// src/blocks/columns/columns.tsx
|
|
1668
1687
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1669
1688
|
function Columns(props) {
|
|
@@ -1671,6 +1690,9 @@ function Columns(props) {
|
|
|
1671
1690
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
1672
1691
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
1673
1692
|
const [flexDir, setFlexDir] = createSignal(props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column");
|
|
1693
|
+
function getTagName(column) {
|
|
1694
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1695
|
+
}
|
|
1674
1696
|
function getWidth(index) {
|
|
1675
1697
|
return cols()[index]?.width || 100 / cols().length;
|
|
1676
1698
|
}
|
|
@@ -1690,7 +1712,7 @@ function Columns(props) {
|
|
|
1690
1712
|
}) {
|
|
1691
1713
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1692
1714
|
}
|
|
1693
|
-
|
|
1715
|
+
function columnsCssVars() {
|
|
1694
1716
|
return {
|
|
1695
1717
|
"--flex-dir": flexDir(),
|
|
1696
1718
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -1698,7 +1720,7 @@ function Columns(props) {
|
|
|
1698
1720
|
desktopStyle: "row"
|
|
1699
1721
|
})
|
|
1700
1722
|
};
|
|
1701
|
-
}
|
|
1723
|
+
}
|
|
1702
1724
|
function columnCssVars(index) {
|
|
1703
1725
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
1704
1726
|
const width = getColumnCssWidth(index);
|
|
@@ -1737,7 +1759,7 @@ function Columns(props) {
|
|
|
1737
1759
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
1738
1760
|
return breakpointSizes[size].max;
|
|
1739
1761
|
}
|
|
1740
|
-
|
|
1762
|
+
function columnsStyles() {
|
|
1741
1763
|
return `
|
|
1742
1764
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1743
1765
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1763,12 +1785,22 @@ function Columns(props) {
|
|
|
1763
1785
|
}
|
|
1764
1786
|
},
|
|
1765
1787
|
`;
|
|
1766
|
-
}
|
|
1788
|
+
}
|
|
1789
|
+
function getAttributes(column, index) {
|
|
1790
|
+
return {
|
|
1791
|
+
...{},
|
|
1792
|
+
...column.link ? {
|
|
1793
|
+
href: column.link
|
|
1794
|
+
} : {},
|
|
1795
|
+
[getClassPropName()]: "builder-column",
|
|
1796
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1797
|
+
};
|
|
1798
|
+
}
|
|
1767
1799
|
return (() => {
|
|
1768
1800
|
const _el$ = _tmpl$2();
|
|
1769
1801
|
spread(_el$, mergeProps({
|
|
1770
1802
|
get ["class"]() {
|
|
1771
|
-
return
|
|
1803
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
1772
1804
|
display: "flex",
|
|
1773
1805
|
lineHeight: "normal"
|
|
1774
1806
|
});
|
|
@@ -1797,18 +1829,11 @@ function Columns(props) {
|
|
|
1797
1829
|
return createComponent(dynamic_renderer_default, {
|
|
1798
1830
|
key: index,
|
|
1799
1831
|
get TagName() {
|
|
1800
|
-
return column
|
|
1832
|
+
return getTagName(column);
|
|
1801
1833
|
},
|
|
1802
1834
|
actionAttributes: {},
|
|
1803
1835
|
get attributes() {
|
|
1804
|
-
return
|
|
1805
|
-
...{},
|
|
1806
|
-
...column.link ? {
|
|
1807
|
-
href: column.link
|
|
1808
|
-
} : {},
|
|
1809
|
-
[getClassPropName()]: "builder-column",
|
|
1810
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1811
|
-
};
|
|
1836
|
+
return getAttributes(column, index);
|
|
1812
1837
|
},
|
|
1813
1838
|
get children() {
|
|
1814
1839
|
return createComponent(blocks_default, {
|
|
@@ -2006,7 +2031,7 @@ function Image(props) {
|
|
|
2006
2031
|
}
|
|
2007
2032
|
}), createComponent(Show, {
|
|
2008
2033
|
get when() {
|
|
2009
|
-
return !props.fitContent && props.children;
|
|
2034
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
2010
2035
|
},
|
|
2011
2036
|
get children() {
|
|
2012
2037
|
const _el$5 = _tmpl$32();
|
|
@@ -2750,8 +2775,246 @@ var componentInfo7 = {
|
|
|
2750
2775
|
}]
|
|
2751
2776
|
};
|
|
2752
2777
|
|
|
2753
|
-
// src/blocks/
|
|
2778
|
+
// src/blocks/tabs/component-info.ts
|
|
2779
|
+
var defaultTab = {
|
|
2780
|
+
"@type": "@builder.io/sdk:Element",
|
|
2781
|
+
responsiveStyles: {
|
|
2782
|
+
large: {
|
|
2783
|
+
paddingLeft: "20px",
|
|
2784
|
+
paddingRight: "20px",
|
|
2785
|
+
paddingTop: "10px",
|
|
2786
|
+
paddingBottom: "10px",
|
|
2787
|
+
minWidth: "100px",
|
|
2788
|
+
textAlign: "center",
|
|
2789
|
+
display: "flex",
|
|
2790
|
+
flexDirection: "column",
|
|
2791
|
+
cursor: "pointer",
|
|
2792
|
+
userSelect: "none"
|
|
2793
|
+
}
|
|
2794
|
+
},
|
|
2795
|
+
component: {
|
|
2796
|
+
name: "Text",
|
|
2797
|
+
options: {
|
|
2798
|
+
text: "New tab"
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
};
|
|
2802
|
+
var defaultElement = {
|
|
2803
|
+
"@type": "@builder.io/sdk:Element",
|
|
2804
|
+
responsiveStyles: {
|
|
2805
|
+
large: {
|
|
2806
|
+
height: "200px",
|
|
2807
|
+
display: "flex",
|
|
2808
|
+
marginTop: "20px",
|
|
2809
|
+
flexDirection: "column"
|
|
2810
|
+
}
|
|
2811
|
+
},
|
|
2812
|
+
component: {
|
|
2813
|
+
name: "Text",
|
|
2814
|
+
options: {
|
|
2815
|
+
text: "New tab content "
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
};
|
|
2754
2819
|
var componentInfo8 = {
|
|
2820
|
+
name: "Builder: Tabs",
|
|
2821
|
+
inputs: [{
|
|
2822
|
+
name: "tabs",
|
|
2823
|
+
type: "list",
|
|
2824
|
+
broadcast: true,
|
|
2825
|
+
subFields: [{
|
|
2826
|
+
name: "label",
|
|
2827
|
+
type: "uiBlocks",
|
|
2828
|
+
hideFromUI: true,
|
|
2829
|
+
defaultValue: [defaultTab]
|
|
2830
|
+
}, {
|
|
2831
|
+
name: "content",
|
|
2832
|
+
type: "uiBlocks",
|
|
2833
|
+
hideFromUI: true,
|
|
2834
|
+
defaultValue: [defaultElement]
|
|
2835
|
+
}],
|
|
2836
|
+
defaultValue: [{
|
|
2837
|
+
label: [{
|
|
2838
|
+
...defaultTab,
|
|
2839
|
+
component: {
|
|
2840
|
+
name: "Text",
|
|
2841
|
+
options: {
|
|
2842
|
+
text: "Tab 1"
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
}],
|
|
2846
|
+
content: [{
|
|
2847
|
+
...defaultElement,
|
|
2848
|
+
component: {
|
|
2849
|
+
name: "Text",
|
|
2850
|
+
options: {
|
|
2851
|
+
text: "Tab 1 content"
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
}]
|
|
2855
|
+
}, {
|
|
2856
|
+
label: [{
|
|
2857
|
+
...defaultTab,
|
|
2858
|
+
component: {
|
|
2859
|
+
name: "Text",
|
|
2860
|
+
options: {
|
|
2861
|
+
text: "Tab 2"
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
}],
|
|
2865
|
+
content: [{
|
|
2866
|
+
...defaultElement,
|
|
2867
|
+
component: {
|
|
2868
|
+
name: "Text",
|
|
2869
|
+
options: {
|
|
2870
|
+
text: "Tab 2 content"
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
}]
|
|
2874
|
+
}]
|
|
2875
|
+
}, {
|
|
2876
|
+
name: "activeTabStyle",
|
|
2877
|
+
type: "uiStyle",
|
|
2878
|
+
helperText: "CSS styles for the active tab",
|
|
2879
|
+
defaultValue: {
|
|
2880
|
+
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
2881
|
+
}
|
|
2882
|
+
}, {
|
|
2883
|
+
name: "defaultActiveTab",
|
|
2884
|
+
type: "number",
|
|
2885
|
+
helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
|
|
2886
|
+
defaultValue: 1,
|
|
2887
|
+
advanced: true
|
|
2888
|
+
}, {
|
|
2889
|
+
name: "collapsible",
|
|
2890
|
+
type: "boolean",
|
|
2891
|
+
helperText: "If on, clicking an open tab closes it so no tabs are active",
|
|
2892
|
+
defaultValue: false,
|
|
2893
|
+
advanced: true
|
|
2894
|
+
}, {
|
|
2895
|
+
name: "tabHeaderLayout",
|
|
2896
|
+
type: "enum",
|
|
2897
|
+
helperText: "Change the layout of the tab headers (uses justify-content)",
|
|
2898
|
+
defaultValue: "flex-start",
|
|
2899
|
+
enum: [{
|
|
2900
|
+
label: "Center",
|
|
2901
|
+
value: "center"
|
|
2902
|
+
}, {
|
|
2903
|
+
label: "Space between",
|
|
2904
|
+
value: "space-between"
|
|
2905
|
+
}, {
|
|
2906
|
+
label: "Space around",
|
|
2907
|
+
value: "space-around"
|
|
2908
|
+
}, {
|
|
2909
|
+
label: "Left",
|
|
2910
|
+
value: "flex-start"
|
|
2911
|
+
}, {
|
|
2912
|
+
label: "Right",
|
|
2913
|
+
value: "flex-end"
|
|
2914
|
+
}]
|
|
2915
|
+
}]
|
|
2916
|
+
};
|
|
2917
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
|
|
2918
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
2919
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
2920
|
+
function Tabs(props) {
|
|
2921
|
+
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
2922
|
+
function activeTabContent(active) {
|
|
2923
|
+
return props.tabs && props.tabs[active].content;
|
|
2924
|
+
}
|
|
2925
|
+
function getActiveTabStyle(index) {
|
|
2926
|
+
return activeTab() === index ? props.activeTabStyle : {};
|
|
2927
|
+
}
|
|
2928
|
+
return (() => {
|
|
2929
|
+
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
2930
|
+
_el$2.style.setProperty("display", "flex");
|
|
2931
|
+
_el$2.style.setProperty("flex-direction", "row");
|
|
2932
|
+
_el$2.style.setProperty("overflow", "auto");
|
|
2933
|
+
insert(_el$2, createComponent(For, {
|
|
2934
|
+
get each() {
|
|
2935
|
+
return props.tabs;
|
|
2936
|
+
},
|
|
2937
|
+
children: (tab, _index) => {
|
|
2938
|
+
const index = _index();
|
|
2939
|
+
return (() => {
|
|
2940
|
+
const _el$4 = _tmpl$33();
|
|
2941
|
+
_el$4.$$click = (event) => {
|
|
2942
|
+
if (index === activeTab() && props.collapsible) {
|
|
2943
|
+
setActiveTab(-1);
|
|
2944
|
+
} else {
|
|
2945
|
+
setActiveTab(index);
|
|
2946
|
+
}
|
|
2947
|
+
};
|
|
2948
|
+
setAttribute(_el$4, "key", index);
|
|
2949
|
+
insert(_el$4, createComponent(blocks_default, {
|
|
2950
|
+
get parent() {
|
|
2951
|
+
return props.builderBlock.id;
|
|
2952
|
+
},
|
|
2953
|
+
path: `component.options.tabs.${index}.label`,
|
|
2954
|
+
get blocks() {
|
|
2955
|
+
return tab.label;
|
|
2956
|
+
},
|
|
2957
|
+
get context() {
|
|
2958
|
+
return props.builderContext;
|
|
2959
|
+
},
|
|
2960
|
+
get registeredComponents() {
|
|
2961
|
+
return props.builderComponents;
|
|
2962
|
+
},
|
|
2963
|
+
get linkComponent() {
|
|
2964
|
+
return props.builderLinkComponent;
|
|
2965
|
+
}
|
|
2966
|
+
}));
|
|
2967
|
+
effect((_p$) => {
|
|
2968
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
|
|
2969
|
+
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
2970
|
+
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
2971
|
+
return _p$;
|
|
2972
|
+
}, {
|
|
2973
|
+
_v$: void 0,
|
|
2974
|
+
_v$2: void 0
|
|
2975
|
+
});
|
|
2976
|
+
return _el$4;
|
|
2977
|
+
})();
|
|
2978
|
+
}
|
|
2979
|
+
}));
|
|
2980
|
+
insert(_el$, createComponent(Show, {
|
|
2981
|
+
get when() {
|
|
2982
|
+
return activeTabContent(activeTab());
|
|
2983
|
+
},
|
|
2984
|
+
get children() {
|
|
2985
|
+
const _el$3 = _tmpl$7();
|
|
2986
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
2987
|
+
get parent() {
|
|
2988
|
+
return props.builderBlock.id;
|
|
2989
|
+
},
|
|
2990
|
+
get path() {
|
|
2991
|
+
return `component.options.tabs.${activeTab()}.content`;
|
|
2992
|
+
},
|
|
2993
|
+
get blocks() {
|
|
2994
|
+
return activeTabContent(activeTab());
|
|
2995
|
+
},
|
|
2996
|
+
get context() {
|
|
2997
|
+
return props.builderContext;
|
|
2998
|
+
},
|
|
2999
|
+
get registeredComponents() {
|
|
3000
|
+
return props.builderComponents;
|
|
3001
|
+
},
|
|
3002
|
+
get linkComponent() {
|
|
3003
|
+
return props.builderLinkComponent;
|
|
3004
|
+
}
|
|
3005
|
+
}));
|
|
3006
|
+
return _el$3;
|
|
3007
|
+
}
|
|
3008
|
+
}), null);
|
|
3009
|
+
effect(() => (props.tabHeaderLayout || "flex-start") != null ? _el$2.style.setProperty("justify-content", props.tabHeaderLayout || "flex-start") : _el$2.style.removeProperty("justify-content"));
|
|
3010
|
+
return _el$;
|
|
3011
|
+
})();
|
|
3012
|
+
}
|
|
3013
|
+
var tabs_default = Tabs;
|
|
3014
|
+
delegateEvents(["click"]);
|
|
3015
|
+
|
|
3016
|
+
// src/blocks/text/component-info.ts
|
|
3017
|
+
var componentInfo9 = {
|
|
2755
3018
|
name: "Text",
|
|
2756
3019
|
static: true,
|
|
2757
3020
|
isRSC: true,
|
|
@@ -2770,10 +3033,10 @@ var componentInfo8 = {
|
|
|
2770
3033
|
textAlign: "center"
|
|
2771
3034
|
}
|
|
2772
3035
|
};
|
|
2773
|
-
var _tmpl$
|
|
3036
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2774
3037
|
function Text(props) {
|
|
2775
3038
|
return (() => {
|
|
2776
|
-
const _el$ = _tmpl$
|
|
3039
|
+
const _el$ = _tmpl$8();
|
|
2777
3040
|
_el$.style.setProperty("outline", "none");
|
|
2778
3041
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2779
3042
|
return _el$;
|
|
@@ -2782,7 +3045,7 @@ function Text(props) {
|
|
|
2782
3045
|
var text_default = Text;
|
|
2783
3046
|
|
|
2784
3047
|
// src/blocks/custom-code/component-info.ts
|
|
2785
|
-
var
|
|
3048
|
+
var componentInfo10 = {
|
|
2786
3049
|
name: "Custom Code",
|
|
2787
3050
|
static: true,
|
|
2788
3051
|
requiredPermissions: ["editCode"],
|
|
@@ -2805,7 +3068,7 @@ var componentInfo9 = {
|
|
|
2805
3068
|
advanced: true
|
|
2806
3069
|
}]
|
|
2807
3070
|
};
|
|
2808
|
-
var _tmpl$
|
|
3071
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2809
3072
|
function CustomCode(props) {
|
|
2810
3073
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2811
3074
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2839,7 +3102,7 @@ function CustomCode(props) {
|
|
|
2839
3102
|
}
|
|
2840
3103
|
});
|
|
2841
3104
|
return (() => {
|
|
2842
|
-
const _el$ = _tmpl$
|
|
3105
|
+
const _el$ = _tmpl$9();
|
|
2843
3106
|
const _ref$ = elementRef;
|
|
2844
3107
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2845
3108
|
effect((_p$) => {
|
|
@@ -2857,7 +3120,7 @@ function CustomCode(props) {
|
|
|
2857
3120
|
var custom_code_default = CustomCode;
|
|
2858
3121
|
|
|
2859
3122
|
// src/blocks/embed/component-info.ts
|
|
2860
|
-
var
|
|
3123
|
+
var componentInfo11 = {
|
|
2861
3124
|
name: "Embed",
|
|
2862
3125
|
static: true,
|
|
2863
3126
|
inputs: [{
|
|
@@ -2899,7 +3162,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2899
3162
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2900
3163
|
|
|
2901
3164
|
// src/blocks/embed/embed.tsx
|
|
2902
|
-
var _tmpl$
|
|
3165
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2903
3166
|
function Embed(props) {
|
|
2904
3167
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2905
3168
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2936,7 +3199,7 @@ function Embed(props) {
|
|
|
2936
3199
|
}
|
|
2937
3200
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
2938
3201
|
return (() => {
|
|
2939
|
-
const _el$ = _tmpl$
|
|
3202
|
+
const _el$ = _tmpl$10();
|
|
2940
3203
|
const _ref$ = elem;
|
|
2941
3204
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2942
3205
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2946,7 +3209,7 @@ function Embed(props) {
|
|
|
2946
3209
|
var embed_default = Embed;
|
|
2947
3210
|
|
|
2948
3211
|
// src/blocks/form/form/component-info.ts
|
|
2949
|
-
var
|
|
3212
|
+
var componentInfo12 = {
|
|
2950
3213
|
name: "Form:Form",
|
|
2951
3214
|
// editableTags: ['builder-form-error']
|
|
2952
3215
|
defaults: {
|
|
@@ -3193,8 +3456,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3193
3456
|
};
|
|
3194
3457
|
|
|
3195
3458
|
// src/blocks/form/form/form.tsx
|
|
3196
|
-
var _tmpl$
|
|
3197
|
-
var _tmpl$
|
|
3459
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
3460
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
3198
3461
|
function FormComponent(props) {
|
|
3199
3462
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3200
3463
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3380,7 +3643,7 @@ function FormComponent(props) {
|
|
|
3380
3643
|
}
|
|
3381
3644
|
let formRef;
|
|
3382
3645
|
return (() => {
|
|
3383
|
-
const _el$ = _tmpl$
|
|
3646
|
+
const _el$ = _tmpl$24();
|
|
3384
3647
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3385
3648
|
const _ref$ = formRef;
|
|
3386
3649
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3463,7 +3726,7 @@ function FormComponent(props) {
|
|
|
3463
3726
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3464
3727
|
},
|
|
3465
3728
|
get children() {
|
|
3466
|
-
const _el$2 = _tmpl$
|
|
3729
|
+
const _el$2 = _tmpl$11();
|
|
3467
3730
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3468
3731
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3469
3732
|
padding: "10px",
|
|
@@ -3495,7 +3758,7 @@ function FormComponent(props) {
|
|
|
3495
3758
|
var form_default = FormComponent;
|
|
3496
3759
|
|
|
3497
3760
|
// src/blocks/form/input/component-info.ts
|
|
3498
|
-
var
|
|
3761
|
+
var componentInfo13 = {
|
|
3499
3762
|
name: "Form:Input",
|
|
3500
3763
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3501
3764
|
inputs: [
|
|
@@ -3547,10 +3810,10 @@ var componentInfo12 = {
|
|
|
3547
3810
|
borderColor: "#ccc"
|
|
3548
3811
|
}
|
|
3549
3812
|
};
|
|
3550
|
-
var _tmpl$
|
|
3813
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
3551
3814
|
function FormInputComponent(props) {
|
|
3552
3815
|
return (() => {
|
|
3553
|
-
const _el$ = _tmpl$
|
|
3816
|
+
const _el$ = _tmpl$12();
|
|
3554
3817
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3555
3818
|
get key() {
|
|
3556
3819
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3580,7 +3843,7 @@ function FormInputComponent(props) {
|
|
|
3580
3843
|
var input_default = FormInputComponent;
|
|
3581
3844
|
|
|
3582
3845
|
// src/blocks/form/select/component-info.ts
|
|
3583
|
-
var
|
|
3846
|
+
var componentInfo14 = {
|
|
3584
3847
|
name: "Form:Select",
|
|
3585
3848
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3586
3849
|
defaultStyles: {
|
|
@@ -3623,11 +3886,11 @@ var componentInfo13 = {
|
|
|
3623
3886
|
static: true,
|
|
3624
3887
|
noWrap: true
|
|
3625
3888
|
};
|
|
3626
|
-
var _tmpl$
|
|
3627
|
-
var _tmpl$
|
|
3889
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
3890
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
3628
3891
|
function SelectComponent(props) {
|
|
3629
3892
|
return (() => {
|
|
3630
|
-
const _el$ = _tmpl$
|
|
3893
|
+
const _el$ = _tmpl$13();
|
|
3631
3894
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3632
3895
|
get value() {
|
|
3633
3896
|
return props.value;
|
|
@@ -3649,7 +3912,7 @@ function SelectComponent(props) {
|
|
|
3649
3912
|
children: (option, _index) => {
|
|
3650
3913
|
const index = _index();
|
|
3651
3914
|
return (() => {
|
|
3652
|
-
const _el$2 = _tmpl$
|
|
3915
|
+
const _el$2 = _tmpl$25();
|
|
3653
3916
|
insert(_el$2, () => option.name || option.value);
|
|
3654
3917
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3655
3918
|
effect(() => _el$2.value = option.value);
|
|
@@ -3663,7 +3926,7 @@ function SelectComponent(props) {
|
|
|
3663
3926
|
var select_default = SelectComponent;
|
|
3664
3927
|
|
|
3665
3928
|
// src/blocks/form/submit-button/component-info.ts
|
|
3666
|
-
var
|
|
3929
|
+
var componentInfo15 = {
|
|
3667
3930
|
name: "Form:SubmitButton",
|
|
3668
3931
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3669
3932
|
defaultStyles: {
|
|
@@ -3689,10 +3952,10 @@ var componentInfo14 = {
|
|
|
3689
3952
|
// TODO: defaultChildren
|
|
3690
3953
|
// canHaveChildren: true,
|
|
3691
3954
|
};
|
|
3692
|
-
var _tmpl$
|
|
3955
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3693
3956
|
function SubmitButton(props) {
|
|
3694
3957
|
return (() => {
|
|
3695
|
-
const _el$ = _tmpl$
|
|
3958
|
+
const _el$ = _tmpl$14();
|
|
3696
3959
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3697
3960
|
insert(_el$, () => props.text);
|
|
3698
3961
|
return _el$;
|
|
@@ -3701,7 +3964,7 @@ function SubmitButton(props) {
|
|
|
3701
3964
|
var submit_button_default = SubmitButton;
|
|
3702
3965
|
|
|
3703
3966
|
// src/blocks/img/component-info.ts
|
|
3704
|
-
var
|
|
3967
|
+
var componentInfo16 = {
|
|
3705
3968
|
// friendlyName?
|
|
3706
3969
|
name: "Raw:Img",
|
|
3707
3970
|
hideFromInsertMenu: true,
|
|
@@ -3716,10 +3979,10 @@ var componentInfo15 = {
|
|
|
3716
3979
|
noWrap: true,
|
|
3717
3980
|
static: true
|
|
3718
3981
|
};
|
|
3719
|
-
var _tmpl$
|
|
3982
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
3720
3983
|
function ImgComponent(props) {
|
|
3721
3984
|
return (() => {
|
|
3722
|
-
const _el$ = _tmpl$
|
|
3985
|
+
const _el$ = _tmpl$15();
|
|
3723
3986
|
spread(_el$, mergeProps({
|
|
3724
3987
|
get style() {
|
|
3725
3988
|
return {
|
|
@@ -3743,7 +4006,7 @@ function ImgComponent(props) {
|
|
|
3743
4006
|
var img_default = ImgComponent;
|
|
3744
4007
|
|
|
3745
4008
|
// src/blocks/video/component-info.ts
|
|
3746
|
-
var
|
|
4009
|
+
var componentInfo17 = {
|
|
3747
4010
|
name: "Video",
|
|
3748
4011
|
canHaveChildren: true,
|
|
3749
4012
|
defaultStyles: {
|
|
@@ -3825,9 +4088,9 @@ var componentInfo16 = {
|
|
|
3825
4088
|
advanced: true
|
|
3826
4089
|
}]
|
|
3827
4090
|
};
|
|
3828
|
-
var _tmpl$
|
|
3829
|
-
var _tmpl$
|
|
3830
|
-
var _tmpl$
|
|
4091
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
4092
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
|
|
4093
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
3831
4094
|
function Video(props) {
|
|
3832
4095
|
const videoProps = createMemo(() => {
|
|
3833
4096
|
return {
|
|
@@ -3854,7 +4117,7 @@ function Video(props) {
|
|
|
3854
4117
|
};
|
|
3855
4118
|
});
|
|
3856
4119
|
return (() => {
|
|
3857
|
-
const _el$ = _tmpl$
|
|
4120
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
3858
4121
|
_el$.style.setProperty("position", "relative");
|
|
3859
4122
|
spread(_el$2, mergeProps(spreadProps, {
|
|
3860
4123
|
get preload() {
|
|
@@ -3888,7 +4151,7 @@ function Video(props) {
|
|
|
3888
4151
|
return !props.lazyLoad;
|
|
3889
4152
|
},
|
|
3890
4153
|
get children() {
|
|
3891
|
-
const _el$3 = _tmpl$
|
|
4154
|
+
const _el$3 = _tmpl$16();
|
|
3892
4155
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
3893
4156
|
return _el$3;
|
|
3894
4157
|
}
|
|
@@ -3898,7 +4161,7 @@ function Video(props) {
|
|
|
3898
4161
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
3899
4162
|
},
|
|
3900
4163
|
get children() {
|
|
3901
|
-
const _el$4 = _tmpl$
|
|
4164
|
+
const _el$4 = _tmpl$26();
|
|
3902
4165
|
_el$4.style.setProperty("width", "100%");
|
|
3903
4166
|
_el$4.style.setProperty("pointer-events", "none");
|
|
3904
4167
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -3911,7 +4174,7 @@ function Video(props) {
|
|
|
3911
4174
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
3912
4175
|
},
|
|
3913
4176
|
get children() {
|
|
3914
|
-
const _el$5 = _tmpl$
|
|
4177
|
+
const _el$5 = _tmpl$26();
|
|
3915
4178
|
_el$5.style.setProperty("display", "flex");
|
|
3916
4179
|
_el$5.style.setProperty("flex-direction", "column");
|
|
3917
4180
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -3924,7 +4187,7 @@ function Video(props) {
|
|
|
3924
4187
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
3925
4188
|
},
|
|
3926
4189
|
get children() {
|
|
3927
|
-
const _el$6 = _tmpl$
|
|
4190
|
+
const _el$6 = _tmpl$26();
|
|
3928
4191
|
_el$6.style.setProperty("pointer-events", "none");
|
|
3929
4192
|
_el$6.style.setProperty("display", "flex");
|
|
3930
4193
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -3946,28 +4209,28 @@ var video_default = Video;
|
|
|
3946
4209
|
// src/constants/extra-components.ts
|
|
3947
4210
|
var getExtraComponents = () => [{
|
|
3948
4211
|
component: custom_code_default,
|
|
3949
|
-
...
|
|
4212
|
+
...componentInfo10
|
|
3950
4213
|
}, {
|
|
3951
4214
|
component: embed_default,
|
|
3952
|
-
...
|
|
4215
|
+
...componentInfo11
|
|
3953
4216
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3954
4217
|
component: form_default,
|
|
3955
|
-
...
|
|
4218
|
+
...componentInfo12
|
|
3956
4219
|
}, {
|
|
3957
4220
|
component: input_default,
|
|
3958
|
-
...
|
|
4221
|
+
...componentInfo13
|
|
3959
4222
|
}, {
|
|
3960
4223
|
component: submit_button_default,
|
|
3961
|
-
...
|
|
4224
|
+
...componentInfo15
|
|
3962
4225
|
}, {
|
|
3963
4226
|
component: select_default,
|
|
3964
|
-
...
|
|
4227
|
+
...componentInfo14
|
|
3965
4228
|
}], {
|
|
3966
4229
|
component: img_default,
|
|
3967
|
-
...
|
|
4230
|
+
...componentInfo16
|
|
3968
4231
|
}, {
|
|
3969
4232
|
component: video_default,
|
|
3970
|
-
...
|
|
4233
|
+
...componentInfo17
|
|
3971
4234
|
}];
|
|
3972
4235
|
|
|
3973
4236
|
// src/constants/builder-registered-components.ts
|
|
@@ -3994,8 +4257,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3994
4257
|
...componentInfo7
|
|
3995
4258
|
}, {
|
|
3996
4259
|
component: text_default,
|
|
4260
|
+
...componentInfo9
|
|
4261
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
4262
|
+
component: tabs_default,
|
|
3997
4263
|
...componentInfo8
|
|
3998
|
-
}, ...getExtraComponents()];
|
|
4264
|
+
}], ...getExtraComponents()];
|
|
3999
4265
|
|
|
4000
4266
|
// src/functions/register-component.ts
|
|
4001
4267
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -4064,10 +4330,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4064
4330
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
4065
4331
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4066
4332
|
)`;
|
|
4067
|
-
var _tmpl$
|
|
4333
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
4068
4334
|
function InlinedScript(props) {
|
|
4069
4335
|
return (() => {
|
|
4070
|
-
const _el$ = _tmpl$
|
|
4336
|
+
const _el$ = _tmpl$17();
|
|
4071
4337
|
effect((_p$) => {
|
|
4072
4338
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
4073
4339
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4561,7 +4827,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4561
4827
|
}
|
|
4562
4828
|
|
|
4563
4829
|
// src/constants/sdk-version.ts
|
|
4564
|
-
var SDK_VERSION = "1.0.
|
|
4830
|
+
var SDK_VERSION = "1.0.24";
|
|
4565
4831
|
|
|
4566
4832
|
// src/functions/register.ts
|
|
4567
4833
|
var registry = {};
|
|
@@ -4757,6 +5023,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4757
5023
|
};
|
|
4758
5024
|
};
|
|
4759
5025
|
|
|
5026
|
+
// src/components/content/components/styles.helpers.ts
|
|
5027
|
+
var getCssFromFont = (font) => {
|
|
5028
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5029
|
+
const name = family.split(",")[0];
|
|
5030
|
+
const url = font.fileUrl ?? font?.files?.regular;
|
|
5031
|
+
let str = "";
|
|
5032
|
+
if (url && family && name) {
|
|
5033
|
+
str += `
|
|
5034
|
+
@font-face {
|
|
5035
|
+
font-family: "${family}";
|
|
5036
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
5037
|
+
font-display: fallback;
|
|
5038
|
+
font-weight: 400;
|
|
5039
|
+
}
|
|
5040
|
+
`.trim();
|
|
5041
|
+
}
|
|
5042
|
+
if (font.files) {
|
|
5043
|
+
for (const weight in font.files) {
|
|
5044
|
+
const isNumber = String(Number(weight)) === weight;
|
|
5045
|
+
if (!isNumber) {
|
|
5046
|
+
continue;
|
|
5047
|
+
}
|
|
5048
|
+
const weightUrl = font.files[weight];
|
|
5049
|
+
if (weightUrl && weightUrl !== url) {
|
|
5050
|
+
str += `
|
|
5051
|
+
@font-face {
|
|
5052
|
+
font-family: "${family}";
|
|
5053
|
+
src: url('${weightUrl}') format('woff2');
|
|
5054
|
+
font-display: fallback;
|
|
5055
|
+
font-weight: ${weight};
|
|
5056
|
+
}
|
|
5057
|
+
`.trim();
|
|
5058
|
+
}
|
|
5059
|
+
}
|
|
5060
|
+
}
|
|
5061
|
+
return str;
|
|
5062
|
+
};
|
|
5063
|
+
var getFontCss = ({
|
|
5064
|
+
customFonts
|
|
5065
|
+
}) => {
|
|
5066
|
+
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
5067
|
+
};
|
|
5068
|
+
var getCss = ({
|
|
5069
|
+
cssCode,
|
|
5070
|
+
contentId
|
|
5071
|
+
}) => {
|
|
5072
|
+
if (!cssCode) {
|
|
5073
|
+
return "";
|
|
5074
|
+
}
|
|
5075
|
+
if (!contentId) {
|
|
5076
|
+
return cssCode;
|
|
5077
|
+
}
|
|
5078
|
+
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5079
|
+
};
|
|
5080
|
+
var DEFAULT_STYLES = `
|
|
5081
|
+
.builder-button {
|
|
5082
|
+
all: unset;
|
|
5083
|
+
}
|
|
5084
|
+
|
|
5085
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5086
|
+
margin: 0;
|
|
5087
|
+
}
|
|
5088
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5089
|
+
color: inherit;
|
|
5090
|
+
line-height: inherit;
|
|
5091
|
+
letter-spacing: inherit;
|
|
5092
|
+
font-weight: inherit;
|
|
5093
|
+
font-size: inherit;
|
|
5094
|
+
text-align: inherit;
|
|
5095
|
+
font-family: inherit;
|
|
5096
|
+
}
|
|
5097
|
+
`;
|
|
5098
|
+
var getDefaultStyles = (isNested) => {
|
|
5099
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
5100
|
+
};
|
|
5101
|
+
var getWrapperClassName = (variationId) => {
|
|
5102
|
+
return `variant-${variationId}`;
|
|
5103
|
+
};
|
|
5104
|
+
|
|
4760
5105
|
// src/components/content/components/enable-editor.tsx
|
|
4761
5106
|
function EnableEditor(props) {
|
|
4762
5107
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -4796,6 +5141,12 @@ function EnableEditor(props) {
|
|
|
4796
5141
|
content: newContentValue
|
|
4797
5142
|
}));
|
|
4798
5143
|
}
|
|
5144
|
+
const showContentProps = createMemo(() => {
|
|
5145
|
+
return props.showContent ? {} : {
|
|
5146
|
+
hidden: true,
|
|
5147
|
+
"aria-hidden": true
|
|
5148
|
+
};
|
|
5149
|
+
});
|
|
4799
5150
|
function processMessage(event) {
|
|
4800
5151
|
return createEditorListener({
|
|
4801
5152
|
model: props.model,
|
|
@@ -5014,7 +5365,7 @@ function EnableEditor(props) {
|
|
|
5014
5365
|
get children() {
|
|
5015
5366
|
return createComponent(Dynamic, mergeProps({
|
|
5016
5367
|
get ["class"]() {
|
|
5017
|
-
return
|
|
5368
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
5018
5369
|
}
|
|
5019
5370
|
}, {}, {
|
|
5020
5371
|
ref(r$) {
|
|
@@ -5028,10 +5379,7 @@ function EnableEditor(props) {
|
|
|
5028
5379
|
get ["builder-model"]() {
|
|
5029
5380
|
return props.model;
|
|
5030
5381
|
}
|
|
5031
|
-
}, {}, () => props.
|
|
5032
|
-
hidden: true,
|
|
5033
|
-
"aria-hidden": true
|
|
5034
|
-
}, () => props.contentWrapperProps, {
|
|
5382
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
5035
5383
|
get component() {
|
|
5036
5384
|
return ContentWrapper();
|
|
5037
5385
|
},
|
|
@@ -5045,84 +5393,6 @@ function EnableEditor(props) {
|
|
|
5045
5393
|
});
|
|
5046
5394
|
}
|
|
5047
5395
|
var enable_editor_default = EnableEditor;
|
|
5048
|
-
|
|
5049
|
-
// src/components/content/components/styles.helpers.ts
|
|
5050
|
-
var getCssFromFont = (font) => {
|
|
5051
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5052
|
-
const name = family.split(",")[0];
|
|
5053
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
5054
|
-
let str = "";
|
|
5055
|
-
if (url && family && name) {
|
|
5056
|
-
str += `
|
|
5057
|
-
@font-face {
|
|
5058
|
-
font-family: "${family}";
|
|
5059
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
5060
|
-
font-display: fallback;
|
|
5061
|
-
font-weight: 400;
|
|
5062
|
-
}
|
|
5063
|
-
`.trim();
|
|
5064
|
-
}
|
|
5065
|
-
if (font.files) {
|
|
5066
|
-
for (const weight in font.files) {
|
|
5067
|
-
const isNumber = String(Number(weight)) === weight;
|
|
5068
|
-
if (!isNumber) {
|
|
5069
|
-
continue;
|
|
5070
|
-
}
|
|
5071
|
-
const weightUrl = font.files[weight];
|
|
5072
|
-
if (weightUrl && weightUrl !== url) {
|
|
5073
|
-
str += `
|
|
5074
|
-
@font-face {
|
|
5075
|
-
font-family: "${family}";
|
|
5076
|
-
src: url('${weightUrl}') format('woff2');
|
|
5077
|
-
font-display: fallback;
|
|
5078
|
-
font-weight: ${weight};
|
|
5079
|
-
}
|
|
5080
|
-
`.trim();
|
|
5081
|
-
}
|
|
5082
|
-
}
|
|
5083
|
-
}
|
|
5084
|
-
return str;
|
|
5085
|
-
};
|
|
5086
|
-
var getFontCss = ({
|
|
5087
|
-
customFonts
|
|
5088
|
-
}) => {
|
|
5089
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
5090
|
-
};
|
|
5091
|
-
var getCss = ({
|
|
5092
|
-
cssCode,
|
|
5093
|
-
contentId
|
|
5094
|
-
}) => {
|
|
5095
|
-
if (!cssCode) {
|
|
5096
|
-
return "";
|
|
5097
|
-
}
|
|
5098
|
-
if (!contentId) {
|
|
5099
|
-
return cssCode;
|
|
5100
|
-
}
|
|
5101
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5102
|
-
};
|
|
5103
|
-
var DEFAULT_STYLES = `
|
|
5104
|
-
.builder-button {
|
|
5105
|
-
all: unset;
|
|
5106
|
-
}
|
|
5107
|
-
|
|
5108
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5109
|
-
margin: 0;
|
|
5110
|
-
}
|
|
5111
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5112
|
-
color: inherit;
|
|
5113
|
-
line-height: inherit;
|
|
5114
|
-
letter-spacing: inherit;
|
|
5115
|
-
font-weight: inherit;
|
|
5116
|
-
font-size: inherit;
|
|
5117
|
-
text-align: inherit;
|
|
5118
|
-
font-family: inherit;
|
|
5119
|
-
}
|
|
5120
|
-
`;
|
|
5121
|
-
var getDefaultStyles = (isNested) => {
|
|
5122
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
5123
|
-
};
|
|
5124
|
-
|
|
5125
|
-
// src/components/content/components/styles.tsx
|
|
5126
5396
|
function ContentStyles(props) {
|
|
5127
5397
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5128
5398
|
${getCss({
|
|
@@ -5541,9 +5811,15 @@ var fetchSymbolContent = async ({
|
|
|
5541
5811
|
};
|
|
5542
5812
|
|
|
5543
5813
|
// src/blocks/symbol/symbol.tsx
|
|
5544
|
-
var _tmpl$
|
|
5814
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
5545
5815
|
function Symbol(props) {
|
|
5546
5816
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5817
|
+
const blocksWrapper = createMemo(() => {
|
|
5818
|
+
return "div";
|
|
5819
|
+
});
|
|
5820
|
+
const contentWrapper = createMemo(() => {
|
|
5821
|
+
return "div";
|
|
5822
|
+
});
|
|
5547
5823
|
const className = createMemo(() => {
|
|
5548
5824
|
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(" ");
|
|
5549
5825
|
});
|
|
@@ -5567,7 +5843,7 @@ function Symbol(props) {
|
|
|
5567
5843
|
}
|
|
5568
5844
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5569
5845
|
return (() => {
|
|
5570
|
-
const _el$ = _tmpl$
|
|
5846
|
+
const _el$ = _tmpl$18();
|
|
5571
5847
|
spread(_el$, mergeProps({
|
|
5572
5848
|
get ["class"]() {
|
|
5573
5849
|
return className();
|
|
@@ -5606,8 +5882,12 @@ function Symbol(props) {
|
|
|
5606
5882
|
get linkComponent() {
|
|
5607
5883
|
return props.builderLinkComponent;
|
|
5608
5884
|
},
|
|
5609
|
-
blocksWrapper
|
|
5610
|
-
|
|
5885
|
+
get blocksWrapper() {
|
|
5886
|
+
return blocksWrapper();
|
|
5887
|
+
},
|
|
5888
|
+
get contentWrapper() {
|
|
5889
|
+
return contentWrapper();
|
|
5890
|
+
}
|
|
5611
5891
|
}));
|
|
5612
5892
|
return _el$;
|
|
5613
5893
|
})();
|