@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/dev.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";
|
|
@@ -855,6 +859,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
855
859
|
case "svelte":
|
|
856
860
|
case "vue":
|
|
857
861
|
case "solid":
|
|
862
|
+
case "angular":
|
|
858
863
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
859
864
|
case "qwik":
|
|
860
865
|
case "reactNative":
|
|
@@ -930,6 +935,12 @@ var getRepeatItemData = ({
|
|
|
930
935
|
}));
|
|
931
936
|
return repeatArray;
|
|
932
937
|
};
|
|
938
|
+
var shouldPassLinkComponent = (blockName) => {
|
|
939
|
+
return blockName && ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
940
|
+
};
|
|
941
|
+
var shouldPassRegisteredComponents = (blockName) => {
|
|
942
|
+
return blockName && ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
943
|
+
};
|
|
933
944
|
|
|
934
945
|
// src/constants/device-sizes.ts
|
|
935
946
|
var SIZES = {
|
|
@@ -1186,21 +1197,24 @@ function BlockWrapper(props) {
|
|
|
1186
1197
|
}
|
|
1187
1198
|
var block_wrapper_default = BlockWrapper;
|
|
1188
1199
|
function InteractiveElement(props) {
|
|
1200
|
+
const attributes = createMemo(() => {
|
|
1201
|
+
return props.includeBlockProps ? {
|
|
1202
|
+
...getBlockProperties({
|
|
1203
|
+
block: props.block,
|
|
1204
|
+
context: props.context
|
|
1205
|
+
}),
|
|
1206
|
+
...getBlockActions({
|
|
1207
|
+
block: props.block,
|
|
1208
|
+
rootState: props.context.rootState,
|
|
1209
|
+
rootSetState: props.context.rootSetState,
|
|
1210
|
+
localState: props.context.localState,
|
|
1211
|
+
context: props.context.context
|
|
1212
|
+
})
|
|
1213
|
+
} : {};
|
|
1214
|
+
});
|
|
1189
1215
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
1190
1216
|
get attributes() {
|
|
1191
|
-
return
|
|
1192
|
-
...getBlockProperties({
|
|
1193
|
-
block: props.block,
|
|
1194
|
-
context: props.context
|
|
1195
|
-
}),
|
|
1196
|
-
...getBlockActions({
|
|
1197
|
-
block: props.block,
|
|
1198
|
-
rootState: props.context.rootState,
|
|
1199
|
-
rootSetState: props.context.rootSetState,
|
|
1200
|
-
localState: props.context.localState,
|
|
1201
|
-
context: props.context.context
|
|
1202
|
-
})
|
|
1203
|
-
} : {};
|
|
1217
|
+
return attributes();
|
|
1204
1218
|
},
|
|
1205
1219
|
get component() {
|
|
1206
1220
|
return props.Wrapper;
|
|
@@ -1375,10 +1389,10 @@ function Block(props) {
|
|
|
1375
1389
|
componentOptions: {
|
|
1376
1390
|
...getBlockComponentOptions(processedBlock()),
|
|
1377
1391
|
builderContext: props.context,
|
|
1378
|
-
...
|
|
1392
|
+
...shouldPassLinkComponent(blockComponent()?.name) ? {
|
|
1379
1393
|
builderLinkComponent: props.linkComponent
|
|
1380
1394
|
} : {},
|
|
1381
|
-
...
|
|
1395
|
+
...shouldPassRegisteredComponents(blockComponent()?.name) ? {
|
|
1382
1396
|
builderComponents: props.registeredComponents
|
|
1383
1397
|
} : {}
|
|
1384
1398
|
},
|
|
@@ -1670,6 +1684,11 @@ function Blocks(props) {
|
|
|
1670
1684
|
}
|
|
1671
1685
|
var blocks_default = Blocks;
|
|
1672
1686
|
|
|
1687
|
+
// src/blocks/columns/helpers.ts
|
|
1688
|
+
var getColumnsClass = (id) => {
|
|
1689
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1690
|
+
};
|
|
1691
|
+
|
|
1673
1692
|
// src/blocks/columns/columns.tsx
|
|
1674
1693
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1675
1694
|
function Columns(props) {
|
|
@@ -1677,6 +1696,9 @@ function Columns(props) {
|
|
|
1677
1696
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
1678
1697
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
1679
1698
|
const [flexDir, setFlexDir] = createSignal(props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column");
|
|
1699
|
+
function getTagName(column) {
|
|
1700
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1701
|
+
}
|
|
1680
1702
|
function getWidth(index) {
|
|
1681
1703
|
return cols()[index]?.width || 100 / cols().length;
|
|
1682
1704
|
}
|
|
@@ -1696,7 +1718,7 @@ function Columns(props) {
|
|
|
1696
1718
|
}) {
|
|
1697
1719
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1698
1720
|
}
|
|
1699
|
-
|
|
1721
|
+
function columnsCssVars() {
|
|
1700
1722
|
return {
|
|
1701
1723
|
"--flex-dir": flexDir(),
|
|
1702
1724
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -1704,7 +1726,7 @@ function Columns(props) {
|
|
|
1704
1726
|
desktopStyle: "row"
|
|
1705
1727
|
})
|
|
1706
1728
|
};
|
|
1707
|
-
}
|
|
1729
|
+
}
|
|
1708
1730
|
function columnCssVars(index) {
|
|
1709
1731
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
1710
1732
|
const width = getColumnCssWidth(index);
|
|
@@ -1743,7 +1765,7 @@ function Columns(props) {
|
|
|
1743
1765
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
1744
1766
|
return breakpointSizes[size].max;
|
|
1745
1767
|
}
|
|
1746
|
-
|
|
1768
|
+
function columnsStyles() {
|
|
1747
1769
|
return `
|
|
1748
1770
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1749
1771
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1769,12 +1791,22 @@ function Columns(props) {
|
|
|
1769
1791
|
}
|
|
1770
1792
|
},
|
|
1771
1793
|
`;
|
|
1772
|
-
}
|
|
1794
|
+
}
|
|
1795
|
+
function getAttributes(column, index) {
|
|
1796
|
+
return {
|
|
1797
|
+
...{},
|
|
1798
|
+
...column.link ? {
|
|
1799
|
+
href: column.link
|
|
1800
|
+
} : {},
|
|
1801
|
+
[getClassPropName()]: "builder-column",
|
|
1802
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1773
1805
|
return (() => {
|
|
1774
1806
|
const _el$ = _tmpl$2();
|
|
1775
1807
|
spread(_el$, mergeProps({
|
|
1776
1808
|
get ["class"]() {
|
|
1777
|
-
return
|
|
1809
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
1778
1810
|
display: "flex",
|
|
1779
1811
|
lineHeight: "normal"
|
|
1780
1812
|
});
|
|
@@ -1803,18 +1835,11 @@ function Columns(props) {
|
|
|
1803
1835
|
return createComponent(dynamic_renderer_default, {
|
|
1804
1836
|
key: index,
|
|
1805
1837
|
get TagName() {
|
|
1806
|
-
return column
|
|
1838
|
+
return getTagName(column);
|
|
1807
1839
|
},
|
|
1808
1840
|
actionAttributes: {},
|
|
1809
1841
|
get attributes() {
|
|
1810
|
-
return
|
|
1811
|
-
...{},
|
|
1812
|
-
...column.link ? {
|
|
1813
|
-
href: column.link
|
|
1814
|
-
} : {},
|
|
1815
|
-
[getClassPropName()]: "builder-column",
|
|
1816
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1817
|
-
};
|
|
1842
|
+
return getAttributes(column, index);
|
|
1818
1843
|
},
|
|
1819
1844
|
get children() {
|
|
1820
1845
|
return createComponent(blocks_default, {
|
|
@@ -2013,7 +2038,7 @@ function Image(props) {
|
|
|
2013
2038
|
}
|
|
2014
2039
|
}), createComponent(Show, {
|
|
2015
2040
|
get when() {
|
|
2016
|
-
return !props.fitContent && props.children;
|
|
2041
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
2017
2042
|
},
|
|
2018
2043
|
get children() {
|
|
2019
2044
|
const _el$5 = _tmpl$32();
|
|
@@ -2758,8 +2783,246 @@ var componentInfo7 = {
|
|
|
2758
2783
|
}]
|
|
2759
2784
|
};
|
|
2760
2785
|
|
|
2761
|
-
// src/blocks/
|
|
2786
|
+
// src/blocks/tabs/component-info.ts
|
|
2787
|
+
var defaultTab = {
|
|
2788
|
+
"@type": "@builder.io/sdk:Element",
|
|
2789
|
+
responsiveStyles: {
|
|
2790
|
+
large: {
|
|
2791
|
+
paddingLeft: "20px",
|
|
2792
|
+
paddingRight: "20px",
|
|
2793
|
+
paddingTop: "10px",
|
|
2794
|
+
paddingBottom: "10px",
|
|
2795
|
+
minWidth: "100px",
|
|
2796
|
+
textAlign: "center",
|
|
2797
|
+
display: "flex",
|
|
2798
|
+
flexDirection: "column",
|
|
2799
|
+
cursor: "pointer",
|
|
2800
|
+
userSelect: "none"
|
|
2801
|
+
}
|
|
2802
|
+
},
|
|
2803
|
+
component: {
|
|
2804
|
+
name: "Text",
|
|
2805
|
+
options: {
|
|
2806
|
+
text: "New tab"
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
};
|
|
2810
|
+
var defaultElement = {
|
|
2811
|
+
"@type": "@builder.io/sdk:Element",
|
|
2812
|
+
responsiveStyles: {
|
|
2813
|
+
large: {
|
|
2814
|
+
height: "200px",
|
|
2815
|
+
display: "flex",
|
|
2816
|
+
marginTop: "20px",
|
|
2817
|
+
flexDirection: "column"
|
|
2818
|
+
}
|
|
2819
|
+
},
|
|
2820
|
+
component: {
|
|
2821
|
+
name: "Text",
|
|
2822
|
+
options: {
|
|
2823
|
+
text: "New tab content "
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
};
|
|
2762
2827
|
var componentInfo8 = {
|
|
2828
|
+
name: "Builder: Tabs",
|
|
2829
|
+
inputs: [{
|
|
2830
|
+
name: "tabs",
|
|
2831
|
+
type: "list",
|
|
2832
|
+
broadcast: true,
|
|
2833
|
+
subFields: [{
|
|
2834
|
+
name: "label",
|
|
2835
|
+
type: "uiBlocks",
|
|
2836
|
+
hideFromUI: true,
|
|
2837
|
+
defaultValue: [defaultTab]
|
|
2838
|
+
}, {
|
|
2839
|
+
name: "content",
|
|
2840
|
+
type: "uiBlocks",
|
|
2841
|
+
hideFromUI: true,
|
|
2842
|
+
defaultValue: [defaultElement]
|
|
2843
|
+
}],
|
|
2844
|
+
defaultValue: [{
|
|
2845
|
+
label: [{
|
|
2846
|
+
...defaultTab,
|
|
2847
|
+
component: {
|
|
2848
|
+
name: "Text",
|
|
2849
|
+
options: {
|
|
2850
|
+
text: "Tab 1"
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
}],
|
|
2854
|
+
content: [{
|
|
2855
|
+
...defaultElement,
|
|
2856
|
+
component: {
|
|
2857
|
+
name: "Text",
|
|
2858
|
+
options: {
|
|
2859
|
+
text: "Tab 1 content"
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
}]
|
|
2863
|
+
}, {
|
|
2864
|
+
label: [{
|
|
2865
|
+
...defaultTab,
|
|
2866
|
+
component: {
|
|
2867
|
+
name: "Text",
|
|
2868
|
+
options: {
|
|
2869
|
+
text: "Tab 2"
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
}],
|
|
2873
|
+
content: [{
|
|
2874
|
+
...defaultElement,
|
|
2875
|
+
component: {
|
|
2876
|
+
name: "Text",
|
|
2877
|
+
options: {
|
|
2878
|
+
text: "Tab 2 content"
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
}]
|
|
2882
|
+
}]
|
|
2883
|
+
}, {
|
|
2884
|
+
name: "activeTabStyle",
|
|
2885
|
+
type: "uiStyle",
|
|
2886
|
+
helperText: "CSS styles for the active tab",
|
|
2887
|
+
defaultValue: {
|
|
2888
|
+
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
2889
|
+
}
|
|
2890
|
+
}, {
|
|
2891
|
+
name: "defaultActiveTab",
|
|
2892
|
+
type: "number",
|
|
2893
|
+
helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
|
|
2894
|
+
defaultValue: 1,
|
|
2895
|
+
advanced: true
|
|
2896
|
+
}, {
|
|
2897
|
+
name: "collapsible",
|
|
2898
|
+
type: "boolean",
|
|
2899
|
+
helperText: "If on, clicking an open tab closes it so no tabs are active",
|
|
2900
|
+
defaultValue: false,
|
|
2901
|
+
advanced: true
|
|
2902
|
+
}, {
|
|
2903
|
+
name: "tabHeaderLayout",
|
|
2904
|
+
type: "enum",
|
|
2905
|
+
helperText: "Change the layout of the tab headers (uses justify-content)",
|
|
2906
|
+
defaultValue: "flex-start",
|
|
2907
|
+
enum: [{
|
|
2908
|
+
label: "Center",
|
|
2909
|
+
value: "center"
|
|
2910
|
+
}, {
|
|
2911
|
+
label: "Space between",
|
|
2912
|
+
value: "space-between"
|
|
2913
|
+
}, {
|
|
2914
|
+
label: "Space around",
|
|
2915
|
+
value: "space-around"
|
|
2916
|
+
}, {
|
|
2917
|
+
label: "Left",
|
|
2918
|
+
value: "flex-start"
|
|
2919
|
+
}, {
|
|
2920
|
+
label: "Right",
|
|
2921
|
+
value: "flex-end"
|
|
2922
|
+
}]
|
|
2923
|
+
}]
|
|
2924
|
+
};
|
|
2925
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
|
|
2926
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
2927
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
2928
|
+
function Tabs(props) {
|
|
2929
|
+
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
2930
|
+
function activeTabContent(active) {
|
|
2931
|
+
return props.tabs && props.tabs[active].content;
|
|
2932
|
+
}
|
|
2933
|
+
function getActiveTabStyle(index) {
|
|
2934
|
+
return activeTab() === index ? props.activeTabStyle : {};
|
|
2935
|
+
}
|
|
2936
|
+
return (() => {
|
|
2937
|
+
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
2938
|
+
_el$2.style.setProperty("display", "flex");
|
|
2939
|
+
_el$2.style.setProperty("flex-direction", "row");
|
|
2940
|
+
_el$2.style.setProperty("overflow", "auto");
|
|
2941
|
+
insert(_el$2, createComponent(For, {
|
|
2942
|
+
get each() {
|
|
2943
|
+
return props.tabs;
|
|
2944
|
+
},
|
|
2945
|
+
children: (tab, _index) => {
|
|
2946
|
+
const index = _index();
|
|
2947
|
+
return (() => {
|
|
2948
|
+
const _el$4 = _tmpl$33();
|
|
2949
|
+
_el$4.$$click = (event) => {
|
|
2950
|
+
if (index === activeTab() && props.collapsible) {
|
|
2951
|
+
setActiveTab(-1);
|
|
2952
|
+
} else {
|
|
2953
|
+
setActiveTab(index);
|
|
2954
|
+
}
|
|
2955
|
+
};
|
|
2956
|
+
setAttribute(_el$4, "key", index);
|
|
2957
|
+
insert(_el$4, createComponent(blocks_default, {
|
|
2958
|
+
get parent() {
|
|
2959
|
+
return props.builderBlock.id;
|
|
2960
|
+
},
|
|
2961
|
+
path: `component.options.tabs.${index}.label`,
|
|
2962
|
+
get blocks() {
|
|
2963
|
+
return tab.label;
|
|
2964
|
+
},
|
|
2965
|
+
get context() {
|
|
2966
|
+
return props.builderContext;
|
|
2967
|
+
},
|
|
2968
|
+
get registeredComponents() {
|
|
2969
|
+
return props.builderComponents;
|
|
2970
|
+
},
|
|
2971
|
+
get linkComponent() {
|
|
2972
|
+
return props.builderLinkComponent;
|
|
2973
|
+
}
|
|
2974
|
+
}));
|
|
2975
|
+
effect((_p$) => {
|
|
2976
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
|
|
2977
|
+
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
2978
|
+
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
2979
|
+
return _p$;
|
|
2980
|
+
}, {
|
|
2981
|
+
_v$: void 0,
|
|
2982
|
+
_v$2: void 0
|
|
2983
|
+
});
|
|
2984
|
+
return _el$4;
|
|
2985
|
+
})();
|
|
2986
|
+
}
|
|
2987
|
+
}));
|
|
2988
|
+
insert(_el$, createComponent(Show, {
|
|
2989
|
+
get when() {
|
|
2990
|
+
return activeTabContent(activeTab());
|
|
2991
|
+
},
|
|
2992
|
+
get children() {
|
|
2993
|
+
const _el$3 = _tmpl$7();
|
|
2994
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
2995
|
+
get parent() {
|
|
2996
|
+
return props.builderBlock.id;
|
|
2997
|
+
},
|
|
2998
|
+
get path() {
|
|
2999
|
+
return `component.options.tabs.${activeTab()}.content`;
|
|
3000
|
+
},
|
|
3001
|
+
get blocks() {
|
|
3002
|
+
return activeTabContent(activeTab());
|
|
3003
|
+
},
|
|
3004
|
+
get context() {
|
|
3005
|
+
return props.builderContext;
|
|
3006
|
+
},
|
|
3007
|
+
get registeredComponents() {
|
|
3008
|
+
return props.builderComponents;
|
|
3009
|
+
},
|
|
3010
|
+
get linkComponent() {
|
|
3011
|
+
return props.builderLinkComponent;
|
|
3012
|
+
}
|
|
3013
|
+
}));
|
|
3014
|
+
return _el$3;
|
|
3015
|
+
}
|
|
3016
|
+
}), null);
|
|
3017
|
+
effect(() => (props.tabHeaderLayout || "flex-start") != null ? _el$2.style.setProperty("justify-content", props.tabHeaderLayout || "flex-start") : _el$2.style.removeProperty("justify-content"));
|
|
3018
|
+
return _el$;
|
|
3019
|
+
})();
|
|
3020
|
+
}
|
|
3021
|
+
var tabs_default = Tabs;
|
|
3022
|
+
delegateEvents(["click"]);
|
|
3023
|
+
|
|
3024
|
+
// src/blocks/text/component-info.ts
|
|
3025
|
+
var componentInfo9 = {
|
|
2763
3026
|
name: "Text",
|
|
2764
3027
|
static: true,
|
|
2765
3028
|
isRSC: true,
|
|
@@ -2778,10 +3041,10 @@ var componentInfo8 = {
|
|
|
2778
3041
|
textAlign: "center"
|
|
2779
3042
|
}
|
|
2780
3043
|
};
|
|
2781
|
-
var _tmpl$
|
|
3044
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2782
3045
|
function Text(props) {
|
|
2783
3046
|
return (() => {
|
|
2784
|
-
const _el$ = _tmpl$
|
|
3047
|
+
const _el$ = _tmpl$8();
|
|
2785
3048
|
_el$.style.setProperty("outline", "none");
|
|
2786
3049
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2787
3050
|
return _el$;
|
|
@@ -2790,7 +3053,7 @@ function Text(props) {
|
|
|
2790
3053
|
var text_default = Text;
|
|
2791
3054
|
|
|
2792
3055
|
// src/blocks/custom-code/component-info.ts
|
|
2793
|
-
var
|
|
3056
|
+
var componentInfo10 = {
|
|
2794
3057
|
name: "Custom Code",
|
|
2795
3058
|
static: true,
|
|
2796
3059
|
requiredPermissions: ["editCode"],
|
|
@@ -2813,7 +3076,7 @@ var componentInfo9 = {
|
|
|
2813
3076
|
advanced: true
|
|
2814
3077
|
}]
|
|
2815
3078
|
};
|
|
2816
|
-
var _tmpl$
|
|
3079
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2817
3080
|
function CustomCode(props) {
|
|
2818
3081
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2819
3082
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2848,7 +3111,7 @@ function CustomCode(props) {
|
|
|
2848
3111
|
}
|
|
2849
3112
|
});
|
|
2850
3113
|
return (() => {
|
|
2851
|
-
const _el$ = _tmpl$
|
|
3114
|
+
const _el$ = _tmpl$9();
|
|
2852
3115
|
const _ref$ = elementRef;
|
|
2853
3116
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2854
3117
|
effect((_p$) => {
|
|
@@ -2866,7 +3129,7 @@ function CustomCode(props) {
|
|
|
2866
3129
|
var custom_code_default = CustomCode;
|
|
2867
3130
|
|
|
2868
3131
|
// src/blocks/embed/component-info.ts
|
|
2869
|
-
var
|
|
3132
|
+
var componentInfo11 = {
|
|
2870
3133
|
name: "Embed",
|
|
2871
3134
|
static: true,
|
|
2872
3135
|
inputs: [{
|
|
@@ -2908,7 +3171,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2908
3171
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2909
3172
|
|
|
2910
3173
|
// src/blocks/embed/embed.tsx
|
|
2911
|
-
var _tmpl$
|
|
3174
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2912
3175
|
function Embed(props) {
|
|
2913
3176
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2914
3177
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2946,7 +3209,7 @@ function Embed(props) {
|
|
|
2946
3209
|
}
|
|
2947
3210
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
2948
3211
|
return (() => {
|
|
2949
|
-
const _el$ = _tmpl$
|
|
3212
|
+
const _el$ = _tmpl$10();
|
|
2950
3213
|
const _ref$ = elem;
|
|
2951
3214
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2952
3215
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2956,7 +3219,7 @@ function Embed(props) {
|
|
|
2956
3219
|
var embed_default = Embed;
|
|
2957
3220
|
|
|
2958
3221
|
// src/blocks/form/form/component-info.ts
|
|
2959
|
-
var
|
|
3222
|
+
var componentInfo12 = {
|
|
2960
3223
|
name: "Form:Form",
|
|
2961
3224
|
// editableTags: ['builder-form-error']
|
|
2962
3225
|
defaults: {
|
|
@@ -3203,8 +3466,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3203
3466
|
};
|
|
3204
3467
|
|
|
3205
3468
|
// src/blocks/form/form/form.tsx
|
|
3206
|
-
var _tmpl$
|
|
3207
|
-
var _tmpl$
|
|
3469
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
3470
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
3208
3471
|
function FormComponent(props) {
|
|
3209
3472
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3210
3473
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3390,7 +3653,7 @@ function FormComponent(props) {
|
|
|
3390
3653
|
}
|
|
3391
3654
|
let formRef;
|
|
3392
3655
|
return (() => {
|
|
3393
|
-
const _el$ = _tmpl$
|
|
3656
|
+
const _el$ = _tmpl$24();
|
|
3394
3657
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3395
3658
|
const _ref$ = formRef;
|
|
3396
3659
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3473,7 +3736,7 @@ function FormComponent(props) {
|
|
|
3473
3736
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3474
3737
|
},
|
|
3475
3738
|
get children() {
|
|
3476
|
-
const _el$2 = _tmpl$
|
|
3739
|
+
const _el$2 = _tmpl$11();
|
|
3477
3740
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3478
3741
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3479
3742
|
padding: "10px",
|
|
@@ -3505,7 +3768,7 @@ function FormComponent(props) {
|
|
|
3505
3768
|
var form_default = FormComponent;
|
|
3506
3769
|
|
|
3507
3770
|
// src/blocks/form/input/component-info.ts
|
|
3508
|
-
var
|
|
3771
|
+
var componentInfo13 = {
|
|
3509
3772
|
name: "Form:Input",
|
|
3510
3773
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3511
3774
|
inputs: [
|
|
@@ -3557,10 +3820,10 @@ var componentInfo12 = {
|
|
|
3557
3820
|
borderColor: "#ccc"
|
|
3558
3821
|
}
|
|
3559
3822
|
};
|
|
3560
|
-
var _tmpl$
|
|
3823
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
3561
3824
|
function FormInputComponent(props) {
|
|
3562
3825
|
return (() => {
|
|
3563
|
-
const _el$ = _tmpl$
|
|
3826
|
+
const _el$ = _tmpl$12();
|
|
3564
3827
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3565
3828
|
get key() {
|
|
3566
3829
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3590,7 +3853,7 @@ function FormInputComponent(props) {
|
|
|
3590
3853
|
var input_default = FormInputComponent;
|
|
3591
3854
|
|
|
3592
3855
|
// src/blocks/form/select/component-info.ts
|
|
3593
|
-
var
|
|
3856
|
+
var componentInfo14 = {
|
|
3594
3857
|
name: "Form:Select",
|
|
3595
3858
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3596
3859
|
defaultStyles: {
|
|
@@ -3633,11 +3896,11 @@ var componentInfo13 = {
|
|
|
3633
3896
|
static: true,
|
|
3634
3897
|
noWrap: true
|
|
3635
3898
|
};
|
|
3636
|
-
var _tmpl$
|
|
3637
|
-
var _tmpl$
|
|
3899
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
3900
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
3638
3901
|
function SelectComponent(props) {
|
|
3639
3902
|
return (() => {
|
|
3640
|
-
const _el$ = _tmpl$
|
|
3903
|
+
const _el$ = _tmpl$13();
|
|
3641
3904
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3642
3905
|
get value() {
|
|
3643
3906
|
return props.value;
|
|
@@ -3659,7 +3922,7 @@ function SelectComponent(props) {
|
|
|
3659
3922
|
children: (option, _index) => {
|
|
3660
3923
|
const index = _index();
|
|
3661
3924
|
return (() => {
|
|
3662
|
-
const _el$2 = _tmpl$
|
|
3925
|
+
const _el$2 = _tmpl$25();
|
|
3663
3926
|
insert(_el$2, () => option.name || option.value);
|
|
3664
3927
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3665
3928
|
effect(() => _el$2.value = option.value);
|
|
@@ -3673,7 +3936,7 @@ function SelectComponent(props) {
|
|
|
3673
3936
|
var select_default = SelectComponent;
|
|
3674
3937
|
|
|
3675
3938
|
// src/blocks/form/submit-button/component-info.ts
|
|
3676
|
-
var
|
|
3939
|
+
var componentInfo15 = {
|
|
3677
3940
|
name: "Form:SubmitButton",
|
|
3678
3941
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3679
3942
|
defaultStyles: {
|
|
@@ -3699,10 +3962,10 @@ var componentInfo14 = {
|
|
|
3699
3962
|
// TODO: defaultChildren
|
|
3700
3963
|
// canHaveChildren: true,
|
|
3701
3964
|
};
|
|
3702
|
-
var _tmpl$
|
|
3965
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3703
3966
|
function SubmitButton(props) {
|
|
3704
3967
|
return (() => {
|
|
3705
|
-
const _el$ = _tmpl$
|
|
3968
|
+
const _el$ = _tmpl$14();
|
|
3706
3969
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3707
3970
|
insert(_el$, () => props.text);
|
|
3708
3971
|
return _el$;
|
|
@@ -3711,7 +3974,7 @@ function SubmitButton(props) {
|
|
|
3711
3974
|
var submit_button_default = SubmitButton;
|
|
3712
3975
|
|
|
3713
3976
|
// src/blocks/img/component-info.ts
|
|
3714
|
-
var
|
|
3977
|
+
var componentInfo16 = {
|
|
3715
3978
|
// friendlyName?
|
|
3716
3979
|
name: "Raw:Img",
|
|
3717
3980
|
hideFromInsertMenu: true,
|
|
@@ -3726,10 +3989,10 @@ var componentInfo15 = {
|
|
|
3726
3989
|
noWrap: true,
|
|
3727
3990
|
static: true
|
|
3728
3991
|
};
|
|
3729
|
-
var _tmpl$
|
|
3992
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
3730
3993
|
function ImgComponent(props) {
|
|
3731
3994
|
return (() => {
|
|
3732
|
-
const _el$ = _tmpl$
|
|
3995
|
+
const _el$ = _tmpl$15();
|
|
3733
3996
|
spread(_el$, mergeProps({
|
|
3734
3997
|
get style() {
|
|
3735
3998
|
return {
|
|
@@ -3753,7 +4016,7 @@ function ImgComponent(props) {
|
|
|
3753
4016
|
var img_default = ImgComponent;
|
|
3754
4017
|
|
|
3755
4018
|
// src/blocks/video/component-info.ts
|
|
3756
|
-
var
|
|
4019
|
+
var componentInfo17 = {
|
|
3757
4020
|
name: "Video",
|
|
3758
4021
|
canHaveChildren: true,
|
|
3759
4022
|
defaultStyles: {
|
|
@@ -3835,9 +4098,9 @@ var componentInfo16 = {
|
|
|
3835
4098
|
advanced: true
|
|
3836
4099
|
}]
|
|
3837
4100
|
};
|
|
3838
|
-
var _tmpl$
|
|
3839
|
-
var _tmpl$
|
|
3840
|
-
var _tmpl$
|
|
4101
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
4102
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
|
|
4103
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
3841
4104
|
function Video(props) {
|
|
3842
4105
|
const videoProps = createMemo(() => {
|
|
3843
4106
|
return {
|
|
@@ -3864,7 +4127,7 @@ function Video(props) {
|
|
|
3864
4127
|
};
|
|
3865
4128
|
});
|
|
3866
4129
|
return (() => {
|
|
3867
|
-
const _el$ = _tmpl$
|
|
4130
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
3868
4131
|
_el$.style.setProperty("position", "relative");
|
|
3869
4132
|
spread(_el$2, mergeProps(spreadProps, {
|
|
3870
4133
|
get preload() {
|
|
@@ -3898,7 +4161,7 @@ function Video(props) {
|
|
|
3898
4161
|
return !props.lazyLoad;
|
|
3899
4162
|
},
|
|
3900
4163
|
get children() {
|
|
3901
|
-
const _el$3 = _tmpl$
|
|
4164
|
+
const _el$3 = _tmpl$16();
|
|
3902
4165
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
3903
4166
|
return _el$3;
|
|
3904
4167
|
}
|
|
@@ -3908,7 +4171,7 @@ function Video(props) {
|
|
|
3908
4171
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
3909
4172
|
},
|
|
3910
4173
|
get children() {
|
|
3911
|
-
const _el$4 = _tmpl$
|
|
4174
|
+
const _el$4 = _tmpl$26();
|
|
3912
4175
|
_el$4.style.setProperty("width", "100%");
|
|
3913
4176
|
_el$4.style.setProperty("pointer-events", "none");
|
|
3914
4177
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -3921,7 +4184,7 @@ function Video(props) {
|
|
|
3921
4184
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
3922
4185
|
},
|
|
3923
4186
|
get children() {
|
|
3924
|
-
const _el$5 = _tmpl$
|
|
4187
|
+
const _el$5 = _tmpl$26();
|
|
3925
4188
|
_el$5.style.setProperty("display", "flex");
|
|
3926
4189
|
_el$5.style.setProperty("flex-direction", "column");
|
|
3927
4190
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -3934,7 +4197,7 @@ function Video(props) {
|
|
|
3934
4197
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
3935
4198
|
},
|
|
3936
4199
|
get children() {
|
|
3937
|
-
const _el$6 = _tmpl$
|
|
4200
|
+
const _el$6 = _tmpl$26();
|
|
3938
4201
|
_el$6.style.setProperty("pointer-events", "none");
|
|
3939
4202
|
_el$6.style.setProperty("display", "flex");
|
|
3940
4203
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -3956,28 +4219,28 @@ var video_default = Video;
|
|
|
3956
4219
|
// src/constants/extra-components.ts
|
|
3957
4220
|
var getExtraComponents = () => [{
|
|
3958
4221
|
component: custom_code_default,
|
|
3959
|
-
...
|
|
4222
|
+
...componentInfo10
|
|
3960
4223
|
}, {
|
|
3961
4224
|
component: embed_default,
|
|
3962
|
-
...
|
|
4225
|
+
...componentInfo11
|
|
3963
4226
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3964
4227
|
component: form_default,
|
|
3965
|
-
...
|
|
4228
|
+
...componentInfo12
|
|
3966
4229
|
}, {
|
|
3967
4230
|
component: input_default,
|
|
3968
|
-
...
|
|
4231
|
+
...componentInfo13
|
|
3969
4232
|
}, {
|
|
3970
4233
|
component: submit_button_default,
|
|
3971
|
-
...
|
|
4234
|
+
...componentInfo15
|
|
3972
4235
|
}, {
|
|
3973
4236
|
component: select_default,
|
|
3974
|
-
...
|
|
4237
|
+
...componentInfo14
|
|
3975
4238
|
}], {
|
|
3976
4239
|
component: img_default,
|
|
3977
|
-
...
|
|
4240
|
+
...componentInfo16
|
|
3978
4241
|
}, {
|
|
3979
4242
|
component: video_default,
|
|
3980
|
-
...
|
|
4243
|
+
...componentInfo17
|
|
3981
4244
|
}];
|
|
3982
4245
|
|
|
3983
4246
|
// src/constants/builder-registered-components.ts
|
|
@@ -4004,8 +4267,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
4004
4267
|
...componentInfo7
|
|
4005
4268
|
}, {
|
|
4006
4269
|
component: text_default,
|
|
4270
|
+
...componentInfo9
|
|
4271
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
4272
|
+
component: tabs_default,
|
|
4007
4273
|
...componentInfo8
|
|
4008
|
-
}, ...getExtraComponents()];
|
|
4274
|
+
}], ...getExtraComponents()];
|
|
4009
4275
|
|
|
4010
4276
|
// src/functions/register-component.ts
|
|
4011
4277
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -4074,10 +4340,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4074
4340
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
4075
4341
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4076
4342
|
)`;
|
|
4077
|
-
var _tmpl$
|
|
4343
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
4078
4344
|
function InlinedScript(props) {
|
|
4079
4345
|
return (() => {
|
|
4080
|
-
const _el$ = _tmpl$
|
|
4346
|
+
const _el$ = _tmpl$17();
|
|
4081
4347
|
effect((_p$) => {
|
|
4082
4348
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
4083
4349
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4576,7 +4842,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4576
4842
|
}
|
|
4577
4843
|
|
|
4578
4844
|
// src/constants/sdk-version.ts
|
|
4579
|
-
var SDK_VERSION = "1.0.
|
|
4845
|
+
var SDK_VERSION = "1.0.24";
|
|
4580
4846
|
|
|
4581
4847
|
// src/functions/register.ts
|
|
4582
4848
|
var registry = {};
|
|
@@ -4773,6 +5039,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4773
5039
|
};
|
|
4774
5040
|
};
|
|
4775
5041
|
|
|
5042
|
+
// src/components/content/components/styles.helpers.ts
|
|
5043
|
+
var getCssFromFont = (font) => {
|
|
5044
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5045
|
+
const name = family.split(",")[0];
|
|
5046
|
+
const url = font.fileUrl ?? font?.files?.regular;
|
|
5047
|
+
let str = "";
|
|
5048
|
+
if (url && family && name) {
|
|
5049
|
+
str += `
|
|
5050
|
+
@font-face {
|
|
5051
|
+
font-family: "${family}";
|
|
5052
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
5053
|
+
font-display: fallback;
|
|
5054
|
+
font-weight: 400;
|
|
5055
|
+
}
|
|
5056
|
+
`.trim();
|
|
5057
|
+
}
|
|
5058
|
+
if (font.files) {
|
|
5059
|
+
for (const weight in font.files) {
|
|
5060
|
+
const isNumber = String(Number(weight)) === weight;
|
|
5061
|
+
if (!isNumber) {
|
|
5062
|
+
continue;
|
|
5063
|
+
}
|
|
5064
|
+
const weightUrl = font.files[weight];
|
|
5065
|
+
if (weightUrl && weightUrl !== url) {
|
|
5066
|
+
str += `
|
|
5067
|
+
@font-face {
|
|
5068
|
+
font-family: "${family}";
|
|
5069
|
+
src: url('${weightUrl}') format('woff2');
|
|
5070
|
+
font-display: fallback;
|
|
5071
|
+
font-weight: ${weight};
|
|
5072
|
+
}
|
|
5073
|
+
`.trim();
|
|
5074
|
+
}
|
|
5075
|
+
}
|
|
5076
|
+
}
|
|
5077
|
+
return str;
|
|
5078
|
+
};
|
|
5079
|
+
var getFontCss = ({
|
|
5080
|
+
customFonts
|
|
5081
|
+
}) => {
|
|
5082
|
+
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
5083
|
+
};
|
|
5084
|
+
var getCss = ({
|
|
5085
|
+
cssCode,
|
|
5086
|
+
contentId
|
|
5087
|
+
}) => {
|
|
5088
|
+
if (!cssCode) {
|
|
5089
|
+
return "";
|
|
5090
|
+
}
|
|
5091
|
+
if (!contentId) {
|
|
5092
|
+
return cssCode;
|
|
5093
|
+
}
|
|
5094
|
+
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5095
|
+
};
|
|
5096
|
+
var DEFAULT_STYLES = `
|
|
5097
|
+
.builder-button {
|
|
5098
|
+
all: unset;
|
|
5099
|
+
}
|
|
5100
|
+
|
|
5101
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5102
|
+
margin: 0;
|
|
5103
|
+
}
|
|
5104
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5105
|
+
color: inherit;
|
|
5106
|
+
line-height: inherit;
|
|
5107
|
+
letter-spacing: inherit;
|
|
5108
|
+
font-weight: inherit;
|
|
5109
|
+
font-size: inherit;
|
|
5110
|
+
text-align: inherit;
|
|
5111
|
+
font-family: inherit;
|
|
5112
|
+
}
|
|
5113
|
+
`;
|
|
5114
|
+
var getDefaultStyles = (isNested) => {
|
|
5115
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
5116
|
+
};
|
|
5117
|
+
var getWrapperClassName = (variationId) => {
|
|
5118
|
+
return `variant-${variationId}`;
|
|
5119
|
+
};
|
|
5120
|
+
|
|
4776
5121
|
// src/components/content/components/enable-editor.tsx
|
|
4777
5122
|
function EnableEditor(props) {
|
|
4778
5123
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -4812,6 +5157,12 @@ function EnableEditor(props) {
|
|
|
4812
5157
|
content: newContentValue
|
|
4813
5158
|
}));
|
|
4814
5159
|
}
|
|
5160
|
+
const showContentProps = createMemo(() => {
|
|
5161
|
+
return props.showContent ? {} : {
|
|
5162
|
+
hidden: true,
|
|
5163
|
+
"aria-hidden": true
|
|
5164
|
+
};
|
|
5165
|
+
});
|
|
4815
5166
|
function processMessage(event) {
|
|
4816
5167
|
return createEditorListener({
|
|
4817
5168
|
model: props.model,
|
|
@@ -5031,7 +5382,7 @@ function EnableEditor(props) {
|
|
|
5031
5382
|
get children() {
|
|
5032
5383
|
return createComponent(Dynamic, mergeProps({
|
|
5033
5384
|
get ["class"]() {
|
|
5034
|
-
return
|
|
5385
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
5035
5386
|
}
|
|
5036
5387
|
}, {}, {
|
|
5037
5388
|
ref(r$) {
|
|
@@ -5045,10 +5396,7 @@ function EnableEditor(props) {
|
|
|
5045
5396
|
get ["builder-model"]() {
|
|
5046
5397
|
return props.model;
|
|
5047
5398
|
}
|
|
5048
|
-
}, {}, () => props.
|
|
5049
|
-
hidden: true,
|
|
5050
|
-
"aria-hidden": true
|
|
5051
|
-
}, () => props.contentWrapperProps, {
|
|
5399
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
5052
5400
|
get component() {
|
|
5053
5401
|
return ContentWrapper();
|
|
5054
5402
|
},
|
|
@@ -5062,84 +5410,6 @@ function EnableEditor(props) {
|
|
|
5062
5410
|
});
|
|
5063
5411
|
}
|
|
5064
5412
|
var enable_editor_default = EnableEditor;
|
|
5065
|
-
|
|
5066
|
-
// src/components/content/components/styles.helpers.ts
|
|
5067
|
-
var getCssFromFont = (font) => {
|
|
5068
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5069
|
-
const name = family.split(",")[0];
|
|
5070
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
5071
|
-
let str = "";
|
|
5072
|
-
if (url && family && name) {
|
|
5073
|
-
str += `
|
|
5074
|
-
@font-face {
|
|
5075
|
-
font-family: "${family}";
|
|
5076
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
5077
|
-
font-display: fallback;
|
|
5078
|
-
font-weight: 400;
|
|
5079
|
-
}
|
|
5080
|
-
`.trim();
|
|
5081
|
-
}
|
|
5082
|
-
if (font.files) {
|
|
5083
|
-
for (const weight in font.files) {
|
|
5084
|
-
const isNumber = String(Number(weight)) === weight;
|
|
5085
|
-
if (!isNumber) {
|
|
5086
|
-
continue;
|
|
5087
|
-
}
|
|
5088
|
-
const weightUrl = font.files[weight];
|
|
5089
|
-
if (weightUrl && weightUrl !== url) {
|
|
5090
|
-
str += `
|
|
5091
|
-
@font-face {
|
|
5092
|
-
font-family: "${family}";
|
|
5093
|
-
src: url('${weightUrl}') format('woff2');
|
|
5094
|
-
font-display: fallback;
|
|
5095
|
-
font-weight: ${weight};
|
|
5096
|
-
}
|
|
5097
|
-
`.trim();
|
|
5098
|
-
}
|
|
5099
|
-
}
|
|
5100
|
-
}
|
|
5101
|
-
return str;
|
|
5102
|
-
};
|
|
5103
|
-
var getFontCss = ({
|
|
5104
|
-
customFonts
|
|
5105
|
-
}) => {
|
|
5106
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
5107
|
-
};
|
|
5108
|
-
var getCss = ({
|
|
5109
|
-
cssCode,
|
|
5110
|
-
contentId
|
|
5111
|
-
}) => {
|
|
5112
|
-
if (!cssCode) {
|
|
5113
|
-
return "";
|
|
5114
|
-
}
|
|
5115
|
-
if (!contentId) {
|
|
5116
|
-
return cssCode;
|
|
5117
|
-
}
|
|
5118
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5119
|
-
};
|
|
5120
|
-
var DEFAULT_STYLES = `
|
|
5121
|
-
.builder-button {
|
|
5122
|
-
all: unset;
|
|
5123
|
-
}
|
|
5124
|
-
|
|
5125
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5126
|
-
margin: 0;
|
|
5127
|
-
}
|
|
5128
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5129
|
-
color: inherit;
|
|
5130
|
-
line-height: inherit;
|
|
5131
|
-
letter-spacing: inherit;
|
|
5132
|
-
font-weight: inherit;
|
|
5133
|
-
font-size: inherit;
|
|
5134
|
-
text-align: inherit;
|
|
5135
|
-
font-family: inherit;
|
|
5136
|
-
}
|
|
5137
|
-
`;
|
|
5138
|
-
var getDefaultStyles = (isNested) => {
|
|
5139
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
5140
|
-
};
|
|
5141
|
-
|
|
5142
|
-
// src/components/content/components/styles.tsx
|
|
5143
5413
|
function ContentStyles(props) {
|
|
5144
5414
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5145
5415
|
${getCss({
|
|
@@ -5558,9 +5828,15 @@ var fetchSymbolContent = async ({
|
|
|
5558
5828
|
};
|
|
5559
5829
|
|
|
5560
5830
|
// src/blocks/symbol/symbol.tsx
|
|
5561
|
-
var _tmpl$
|
|
5831
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
5562
5832
|
function Symbol(props) {
|
|
5563
5833
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5834
|
+
const blocksWrapper = createMemo(() => {
|
|
5835
|
+
return "div";
|
|
5836
|
+
});
|
|
5837
|
+
const contentWrapper = createMemo(() => {
|
|
5838
|
+
return "div";
|
|
5839
|
+
});
|
|
5564
5840
|
const className = createMemo(() => {
|
|
5565
5841
|
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(" ");
|
|
5566
5842
|
});
|
|
@@ -5584,7 +5860,7 @@ function Symbol(props) {
|
|
|
5584
5860
|
}
|
|
5585
5861
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5586
5862
|
return (() => {
|
|
5587
|
-
const _el$ = _tmpl$
|
|
5863
|
+
const _el$ = _tmpl$18();
|
|
5588
5864
|
spread(_el$, mergeProps({
|
|
5589
5865
|
get ["class"]() {
|
|
5590
5866
|
return className();
|
|
@@ -5623,8 +5899,12 @@ function Symbol(props) {
|
|
|
5623
5899
|
get linkComponent() {
|
|
5624
5900
|
return props.builderLinkComponent;
|
|
5625
5901
|
},
|
|
5626
|
-
blocksWrapper
|
|
5627
|
-
|
|
5902
|
+
get blocksWrapper() {
|
|
5903
|
+
return blocksWrapper();
|
|
5904
|
+
},
|
|
5905
|
+
get contentWrapper() {
|
|
5906
|
+
return contentWrapper();
|
|
5907
|
+
}
|
|
5628
5908
|
}));
|
|
5629
5909
|
return _el$;
|
|
5630
5910
|
})();
|