@builder.io/sdk-solid 1.0.22 → 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 -179
- package/lib/browser/dev.jsx +463 -228
- package/lib/browser/index.js +458 -179
- package/lib/browser/index.jsx +463 -228
- package/lib/edge/dev.js +458 -179
- package/lib/edge/dev.jsx +463 -228
- package/lib/edge/index.js +458 -179
- package/lib/edge/index.jsx +463 -228
- package/lib/node/dev.js +458 -179
- package/lib/node/dev.jsx +463 -228
- package/lib/node/index.js +458 -179
- package/lib/node/index.jsx +463 -228
- 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";
|
|
@@ -525,7 +529,6 @@ function evaluate({
|
|
|
525
529
|
enableCache
|
|
526
530
|
}) {
|
|
527
531
|
if (code === "") {
|
|
528
|
-
logger.warn("Skipping evaluation of empty code block.");
|
|
529
532
|
return void 0;
|
|
530
533
|
}
|
|
531
534
|
const args = {
|
|
@@ -853,6 +856,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
853
856
|
case "svelte":
|
|
854
857
|
case "vue":
|
|
855
858
|
case "solid":
|
|
859
|
+
case "angular":
|
|
856
860
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
857
861
|
case "qwik":
|
|
858
862
|
case "reactNative":
|
|
@@ -925,6 +929,12 @@ var getRepeatItemData = ({
|
|
|
925
929
|
}));
|
|
926
930
|
return repeatArray;
|
|
927
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
|
+
};
|
|
928
938
|
|
|
929
939
|
// src/constants/device-sizes.ts
|
|
930
940
|
var SIZES = {
|
|
@@ -1181,21 +1191,24 @@ function BlockWrapper(props) {
|
|
|
1181
1191
|
}
|
|
1182
1192
|
var block_wrapper_default = BlockWrapper;
|
|
1183
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
|
+
});
|
|
1184
1209
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
1185
1210
|
get attributes() {
|
|
1186
|
-
return
|
|
1187
|
-
...getBlockProperties({
|
|
1188
|
-
block: props.block,
|
|
1189
|
-
context: props.context
|
|
1190
|
-
}),
|
|
1191
|
-
...getBlockActions({
|
|
1192
|
-
block: props.block,
|
|
1193
|
-
rootState: props.context.rootState,
|
|
1194
|
-
rootSetState: props.context.rootSetState,
|
|
1195
|
-
localState: props.context.localState,
|
|
1196
|
-
context: props.context.context
|
|
1197
|
-
})
|
|
1198
|
-
} : {};
|
|
1211
|
+
return attributes();
|
|
1199
1212
|
},
|
|
1200
1213
|
get component() {
|
|
1201
1214
|
return props.Wrapper;
|
|
@@ -1370,10 +1383,10 @@ function Block(props) {
|
|
|
1370
1383
|
componentOptions: {
|
|
1371
1384
|
...getBlockComponentOptions(processedBlock()),
|
|
1372
1385
|
builderContext: props.context,
|
|
1373
|
-
...
|
|
1386
|
+
...shouldPassLinkComponent(blockComponent()?.name) ? {
|
|
1374
1387
|
builderLinkComponent: props.linkComponent
|
|
1375
1388
|
} : {},
|
|
1376
|
-
...
|
|
1389
|
+
...shouldPassRegisteredComponents(blockComponent()?.name) ? {
|
|
1377
1390
|
builderComponents: props.registeredComponents
|
|
1378
1391
|
} : {}
|
|
1379
1392
|
},
|
|
@@ -1665,6 +1678,11 @@ function Blocks(props) {
|
|
|
1665
1678
|
}
|
|
1666
1679
|
var blocks_default = Blocks;
|
|
1667
1680
|
|
|
1681
|
+
// src/blocks/columns/helpers.ts
|
|
1682
|
+
var getColumnsClass = (id) => {
|
|
1683
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1668
1686
|
// src/blocks/columns/columns.tsx
|
|
1669
1687
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1670
1688
|
function Columns(props) {
|
|
@@ -1672,6 +1690,9 @@ function Columns(props) {
|
|
|
1672
1690
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
1673
1691
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
1674
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
|
+
}
|
|
1675
1696
|
function getWidth(index) {
|
|
1676
1697
|
return cols()[index]?.width || 100 / cols().length;
|
|
1677
1698
|
}
|
|
@@ -1691,7 +1712,7 @@ function Columns(props) {
|
|
|
1691
1712
|
}) {
|
|
1692
1713
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1693
1714
|
}
|
|
1694
|
-
|
|
1715
|
+
function columnsCssVars() {
|
|
1695
1716
|
return {
|
|
1696
1717
|
"--flex-dir": flexDir(),
|
|
1697
1718
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -1699,7 +1720,7 @@ function Columns(props) {
|
|
|
1699
1720
|
desktopStyle: "row"
|
|
1700
1721
|
})
|
|
1701
1722
|
};
|
|
1702
|
-
}
|
|
1723
|
+
}
|
|
1703
1724
|
function columnCssVars(index) {
|
|
1704
1725
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
1705
1726
|
const width = getColumnCssWidth(index);
|
|
@@ -1738,7 +1759,7 @@ function Columns(props) {
|
|
|
1738
1759
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
1739
1760
|
return breakpointSizes[size].max;
|
|
1740
1761
|
}
|
|
1741
|
-
|
|
1762
|
+
function columnsStyles() {
|
|
1742
1763
|
return `
|
|
1743
1764
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1744
1765
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1764,12 +1785,22 @@ function Columns(props) {
|
|
|
1764
1785
|
}
|
|
1765
1786
|
},
|
|
1766
1787
|
`;
|
|
1767
|
-
}
|
|
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
|
+
}
|
|
1768
1799
|
return (() => {
|
|
1769
1800
|
const _el$ = _tmpl$2();
|
|
1770
1801
|
spread(_el$, mergeProps({
|
|
1771
1802
|
get ["class"]() {
|
|
1772
|
-
return
|
|
1803
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
1773
1804
|
display: "flex",
|
|
1774
1805
|
lineHeight: "normal"
|
|
1775
1806
|
});
|
|
@@ -1798,18 +1829,11 @@ function Columns(props) {
|
|
|
1798
1829
|
return createComponent(dynamic_renderer_default, {
|
|
1799
1830
|
key: index,
|
|
1800
1831
|
get TagName() {
|
|
1801
|
-
return column
|
|
1832
|
+
return getTagName(column);
|
|
1802
1833
|
},
|
|
1803
1834
|
actionAttributes: {},
|
|
1804
1835
|
get attributes() {
|
|
1805
|
-
return
|
|
1806
|
-
...{},
|
|
1807
|
-
...column.link ? {
|
|
1808
|
-
href: column.link
|
|
1809
|
-
} : {},
|
|
1810
|
-
[getClassPropName()]: "builder-column",
|
|
1811
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1812
|
-
};
|
|
1836
|
+
return getAttributes(column, index);
|
|
1813
1837
|
},
|
|
1814
1838
|
get children() {
|
|
1815
1839
|
return createComponent(blocks_default, {
|
|
@@ -2007,7 +2031,7 @@ function Image(props) {
|
|
|
2007
2031
|
}
|
|
2008
2032
|
}), createComponent(Show, {
|
|
2009
2033
|
get when() {
|
|
2010
|
-
return !props.fitContent && props.children;
|
|
2034
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
2011
2035
|
},
|
|
2012
2036
|
get children() {
|
|
2013
2037
|
const _el$5 = _tmpl$32();
|
|
@@ -2751,8 +2775,246 @@ var componentInfo7 = {
|
|
|
2751
2775
|
}]
|
|
2752
2776
|
};
|
|
2753
2777
|
|
|
2754
|
-
// 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
|
+
};
|
|
2755
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 = {
|
|
2756
3018
|
name: "Text",
|
|
2757
3019
|
static: true,
|
|
2758
3020
|
isRSC: true,
|
|
@@ -2771,10 +3033,10 @@ var componentInfo8 = {
|
|
|
2771
3033
|
textAlign: "center"
|
|
2772
3034
|
}
|
|
2773
3035
|
};
|
|
2774
|
-
var _tmpl$
|
|
3036
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2775
3037
|
function Text(props) {
|
|
2776
3038
|
return (() => {
|
|
2777
|
-
const _el$ = _tmpl$
|
|
3039
|
+
const _el$ = _tmpl$8();
|
|
2778
3040
|
_el$.style.setProperty("outline", "none");
|
|
2779
3041
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2780
3042
|
return _el$;
|
|
@@ -2783,7 +3045,7 @@ function Text(props) {
|
|
|
2783
3045
|
var text_default = Text;
|
|
2784
3046
|
|
|
2785
3047
|
// src/blocks/custom-code/component-info.ts
|
|
2786
|
-
var
|
|
3048
|
+
var componentInfo10 = {
|
|
2787
3049
|
name: "Custom Code",
|
|
2788
3050
|
static: true,
|
|
2789
3051
|
requiredPermissions: ["editCode"],
|
|
@@ -2806,7 +3068,7 @@ var componentInfo9 = {
|
|
|
2806
3068
|
advanced: true
|
|
2807
3069
|
}]
|
|
2808
3070
|
};
|
|
2809
|
-
var _tmpl$
|
|
3071
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2810
3072
|
function CustomCode(props) {
|
|
2811
3073
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2812
3074
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2840,7 +3102,7 @@ function CustomCode(props) {
|
|
|
2840
3102
|
}
|
|
2841
3103
|
});
|
|
2842
3104
|
return (() => {
|
|
2843
|
-
const _el$ = _tmpl$
|
|
3105
|
+
const _el$ = _tmpl$9();
|
|
2844
3106
|
const _ref$ = elementRef;
|
|
2845
3107
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2846
3108
|
effect((_p$) => {
|
|
@@ -2858,7 +3120,7 @@ function CustomCode(props) {
|
|
|
2858
3120
|
var custom_code_default = CustomCode;
|
|
2859
3121
|
|
|
2860
3122
|
// src/blocks/embed/component-info.ts
|
|
2861
|
-
var
|
|
3123
|
+
var componentInfo11 = {
|
|
2862
3124
|
name: "Embed",
|
|
2863
3125
|
static: true,
|
|
2864
3126
|
inputs: [{
|
|
@@ -2900,7 +3162,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2900
3162
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2901
3163
|
|
|
2902
3164
|
// src/blocks/embed/embed.tsx
|
|
2903
|
-
var _tmpl$
|
|
3165
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2904
3166
|
function Embed(props) {
|
|
2905
3167
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2906
3168
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2937,7 +3199,7 @@ function Embed(props) {
|
|
|
2937
3199
|
}
|
|
2938
3200
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
2939
3201
|
return (() => {
|
|
2940
|
-
const _el$ = _tmpl$
|
|
3202
|
+
const _el$ = _tmpl$10();
|
|
2941
3203
|
const _ref$ = elem;
|
|
2942
3204
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2943
3205
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2947,7 +3209,7 @@ function Embed(props) {
|
|
|
2947
3209
|
var embed_default = Embed;
|
|
2948
3210
|
|
|
2949
3211
|
// src/blocks/form/form/component-info.ts
|
|
2950
|
-
var
|
|
3212
|
+
var componentInfo12 = {
|
|
2951
3213
|
name: "Form:Form",
|
|
2952
3214
|
// editableTags: ['builder-form-error']
|
|
2953
3215
|
defaults: {
|
|
@@ -3194,8 +3456,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3194
3456
|
};
|
|
3195
3457
|
|
|
3196
3458
|
// src/blocks/form/form/form.tsx
|
|
3197
|
-
var _tmpl$
|
|
3198
|
-
var _tmpl$
|
|
3459
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
3460
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
3199
3461
|
function FormComponent(props) {
|
|
3200
3462
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3201
3463
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3381,7 +3643,7 @@ function FormComponent(props) {
|
|
|
3381
3643
|
}
|
|
3382
3644
|
let formRef;
|
|
3383
3645
|
return (() => {
|
|
3384
|
-
const _el$ = _tmpl$
|
|
3646
|
+
const _el$ = _tmpl$24();
|
|
3385
3647
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3386
3648
|
const _ref$ = formRef;
|
|
3387
3649
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3464,7 +3726,7 @@ function FormComponent(props) {
|
|
|
3464
3726
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3465
3727
|
},
|
|
3466
3728
|
get children() {
|
|
3467
|
-
const _el$2 = _tmpl$
|
|
3729
|
+
const _el$2 = _tmpl$11();
|
|
3468
3730
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3469
3731
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3470
3732
|
padding: "10px",
|
|
@@ -3496,7 +3758,7 @@ function FormComponent(props) {
|
|
|
3496
3758
|
var form_default = FormComponent;
|
|
3497
3759
|
|
|
3498
3760
|
// src/blocks/form/input/component-info.ts
|
|
3499
|
-
var
|
|
3761
|
+
var componentInfo13 = {
|
|
3500
3762
|
name: "Form:Input",
|
|
3501
3763
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3502
3764
|
inputs: [
|
|
@@ -3548,10 +3810,10 @@ var componentInfo12 = {
|
|
|
3548
3810
|
borderColor: "#ccc"
|
|
3549
3811
|
}
|
|
3550
3812
|
};
|
|
3551
|
-
var _tmpl$
|
|
3813
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
3552
3814
|
function FormInputComponent(props) {
|
|
3553
3815
|
return (() => {
|
|
3554
|
-
const _el$ = _tmpl$
|
|
3816
|
+
const _el$ = _tmpl$12();
|
|
3555
3817
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3556
3818
|
get key() {
|
|
3557
3819
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3581,7 +3843,7 @@ function FormInputComponent(props) {
|
|
|
3581
3843
|
var input_default = FormInputComponent;
|
|
3582
3844
|
|
|
3583
3845
|
// src/blocks/form/select/component-info.ts
|
|
3584
|
-
var
|
|
3846
|
+
var componentInfo14 = {
|
|
3585
3847
|
name: "Form:Select",
|
|
3586
3848
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3587
3849
|
defaultStyles: {
|
|
@@ -3624,11 +3886,11 @@ var componentInfo13 = {
|
|
|
3624
3886
|
static: true,
|
|
3625
3887
|
noWrap: true
|
|
3626
3888
|
};
|
|
3627
|
-
var _tmpl$
|
|
3628
|
-
var _tmpl$
|
|
3889
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
3890
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
3629
3891
|
function SelectComponent(props) {
|
|
3630
3892
|
return (() => {
|
|
3631
|
-
const _el$ = _tmpl$
|
|
3893
|
+
const _el$ = _tmpl$13();
|
|
3632
3894
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3633
3895
|
get value() {
|
|
3634
3896
|
return props.value;
|
|
@@ -3650,7 +3912,7 @@ function SelectComponent(props) {
|
|
|
3650
3912
|
children: (option, _index) => {
|
|
3651
3913
|
const index = _index();
|
|
3652
3914
|
return (() => {
|
|
3653
|
-
const _el$2 = _tmpl$
|
|
3915
|
+
const _el$2 = _tmpl$25();
|
|
3654
3916
|
insert(_el$2, () => option.name || option.value);
|
|
3655
3917
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3656
3918
|
effect(() => _el$2.value = option.value);
|
|
@@ -3664,7 +3926,7 @@ function SelectComponent(props) {
|
|
|
3664
3926
|
var select_default = SelectComponent;
|
|
3665
3927
|
|
|
3666
3928
|
// src/blocks/form/submit-button/component-info.ts
|
|
3667
|
-
var
|
|
3929
|
+
var componentInfo15 = {
|
|
3668
3930
|
name: "Form:SubmitButton",
|
|
3669
3931
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3670
3932
|
defaultStyles: {
|
|
@@ -3690,10 +3952,10 @@ var componentInfo14 = {
|
|
|
3690
3952
|
// TODO: defaultChildren
|
|
3691
3953
|
// canHaveChildren: true,
|
|
3692
3954
|
};
|
|
3693
|
-
var _tmpl$
|
|
3955
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3694
3956
|
function SubmitButton(props) {
|
|
3695
3957
|
return (() => {
|
|
3696
|
-
const _el$ = _tmpl$
|
|
3958
|
+
const _el$ = _tmpl$14();
|
|
3697
3959
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3698
3960
|
insert(_el$, () => props.text);
|
|
3699
3961
|
return _el$;
|
|
@@ -3702,7 +3964,7 @@ function SubmitButton(props) {
|
|
|
3702
3964
|
var submit_button_default = SubmitButton;
|
|
3703
3965
|
|
|
3704
3966
|
// src/blocks/img/component-info.ts
|
|
3705
|
-
var
|
|
3967
|
+
var componentInfo16 = {
|
|
3706
3968
|
// friendlyName?
|
|
3707
3969
|
name: "Raw:Img",
|
|
3708
3970
|
hideFromInsertMenu: true,
|
|
@@ -3717,10 +3979,10 @@ var componentInfo15 = {
|
|
|
3717
3979
|
noWrap: true,
|
|
3718
3980
|
static: true
|
|
3719
3981
|
};
|
|
3720
|
-
var _tmpl$
|
|
3982
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
3721
3983
|
function ImgComponent(props) {
|
|
3722
3984
|
return (() => {
|
|
3723
|
-
const _el$ = _tmpl$
|
|
3985
|
+
const _el$ = _tmpl$15();
|
|
3724
3986
|
spread(_el$, mergeProps({
|
|
3725
3987
|
get style() {
|
|
3726
3988
|
return {
|
|
@@ -3744,7 +4006,7 @@ function ImgComponent(props) {
|
|
|
3744
4006
|
var img_default = ImgComponent;
|
|
3745
4007
|
|
|
3746
4008
|
// src/blocks/video/component-info.ts
|
|
3747
|
-
var
|
|
4009
|
+
var componentInfo17 = {
|
|
3748
4010
|
name: "Video",
|
|
3749
4011
|
canHaveChildren: true,
|
|
3750
4012
|
defaultStyles: {
|
|
@@ -3826,9 +4088,9 @@ var componentInfo16 = {
|
|
|
3826
4088
|
advanced: true
|
|
3827
4089
|
}]
|
|
3828
4090
|
};
|
|
3829
|
-
var _tmpl$
|
|
3830
|
-
var _tmpl$
|
|
3831
|
-
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>`);
|
|
3832
4094
|
function Video(props) {
|
|
3833
4095
|
const videoProps = createMemo(() => {
|
|
3834
4096
|
return {
|
|
@@ -3855,7 +4117,7 @@ function Video(props) {
|
|
|
3855
4117
|
};
|
|
3856
4118
|
});
|
|
3857
4119
|
return (() => {
|
|
3858
|
-
const _el$ = _tmpl$
|
|
4120
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
3859
4121
|
_el$.style.setProperty("position", "relative");
|
|
3860
4122
|
spread(_el$2, mergeProps(spreadProps, {
|
|
3861
4123
|
get preload() {
|
|
@@ -3889,7 +4151,7 @@ function Video(props) {
|
|
|
3889
4151
|
return !props.lazyLoad;
|
|
3890
4152
|
},
|
|
3891
4153
|
get children() {
|
|
3892
|
-
const _el$3 = _tmpl$
|
|
4154
|
+
const _el$3 = _tmpl$16();
|
|
3893
4155
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
3894
4156
|
return _el$3;
|
|
3895
4157
|
}
|
|
@@ -3899,7 +4161,7 @@ function Video(props) {
|
|
|
3899
4161
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
3900
4162
|
},
|
|
3901
4163
|
get children() {
|
|
3902
|
-
const _el$4 = _tmpl$
|
|
4164
|
+
const _el$4 = _tmpl$26();
|
|
3903
4165
|
_el$4.style.setProperty("width", "100%");
|
|
3904
4166
|
_el$4.style.setProperty("pointer-events", "none");
|
|
3905
4167
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -3912,7 +4174,7 @@ function Video(props) {
|
|
|
3912
4174
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
3913
4175
|
},
|
|
3914
4176
|
get children() {
|
|
3915
|
-
const _el$5 = _tmpl$
|
|
4177
|
+
const _el$5 = _tmpl$26();
|
|
3916
4178
|
_el$5.style.setProperty("display", "flex");
|
|
3917
4179
|
_el$5.style.setProperty("flex-direction", "column");
|
|
3918
4180
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -3925,7 +4187,7 @@ function Video(props) {
|
|
|
3925
4187
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
3926
4188
|
},
|
|
3927
4189
|
get children() {
|
|
3928
|
-
const _el$6 = _tmpl$
|
|
4190
|
+
const _el$6 = _tmpl$26();
|
|
3929
4191
|
_el$6.style.setProperty("pointer-events", "none");
|
|
3930
4192
|
_el$6.style.setProperty("display", "flex");
|
|
3931
4193
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -3947,28 +4209,28 @@ var video_default = Video;
|
|
|
3947
4209
|
// src/constants/extra-components.ts
|
|
3948
4210
|
var getExtraComponents = () => [{
|
|
3949
4211
|
component: custom_code_default,
|
|
3950
|
-
...
|
|
4212
|
+
...componentInfo10
|
|
3951
4213
|
}, {
|
|
3952
4214
|
component: embed_default,
|
|
3953
|
-
...
|
|
4215
|
+
...componentInfo11
|
|
3954
4216
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3955
4217
|
component: form_default,
|
|
3956
|
-
...
|
|
4218
|
+
...componentInfo12
|
|
3957
4219
|
}, {
|
|
3958
4220
|
component: input_default,
|
|
3959
|
-
...
|
|
4221
|
+
...componentInfo13
|
|
3960
4222
|
}, {
|
|
3961
4223
|
component: submit_button_default,
|
|
3962
|
-
...
|
|
4224
|
+
...componentInfo15
|
|
3963
4225
|
}, {
|
|
3964
4226
|
component: select_default,
|
|
3965
|
-
...
|
|
4227
|
+
...componentInfo14
|
|
3966
4228
|
}], {
|
|
3967
4229
|
component: img_default,
|
|
3968
|
-
...
|
|
4230
|
+
...componentInfo16
|
|
3969
4231
|
}, {
|
|
3970
4232
|
component: video_default,
|
|
3971
|
-
...
|
|
4233
|
+
...componentInfo17
|
|
3972
4234
|
}];
|
|
3973
4235
|
|
|
3974
4236
|
// src/constants/builder-registered-components.ts
|
|
@@ -3995,8 +4257,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3995
4257
|
...componentInfo7
|
|
3996
4258
|
}, {
|
|
3997
4259
|
component: text_default,
|
|
4260
|
+
...componentInfo9
|
|
4261
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
4262
|
+
component: tabs_default,
|
|
3998
4263
|
...componentInfo8
|
|
3999
|
-
}, ...getExtraComponents()];
|
|
4264
|
+
}], ...getExtraComponents()];
|
|
4000
4265
|
|
|
4001
4266
|
// src/functions/register-component.ts
|
|
4002
4267
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -4065,10 +4330,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4065
4330
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
4066
4331
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4067
4332
|
)`;
|
|
4068
|
-
var _tmpl$
|
|
4333
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
4069
4334
|
function InlinedScript(props) {
|
|
4070
4335
|
return (() => {
|
|
4071
|
-
const _el$ = _tmpl$
|
|
4336
|
+
const _el$ = _tmpl$17();
|
|
4072
4337
|
effect((_p$) => {
|
|
4073
4338
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
4074
4339
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4562,7 +4827,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4562
4827
|
}
|
|
4563
4828
|
|
|
4564
4829
|
// src/constants/sdk-version.ts
|
|
4565
|
-
var SDK_VERSION = "1.0.
|
|
4830
|
+
var SDK_VERSION = "1.0.24";
|
|
4566
4831
|
|
|
4567
4832
|
// src/functions/register.ts
|
|
4568
4833
|
var registry = {};
|
|
@@ -4758,6 +5023,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4758
5023
|
};
|
|
4759
5024
|
};
|
|
4760
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
|
+
|
|
4761
5105
|
// src/components/content/components/enable-editor.tsx
|
|
4762
5106
|
function EnableEditor(props) {
|
|
4763
5107
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -4797,6 +5141,12 @@ function EnableEditor(props) {
|
|
|
4797
5141
|
content: newContentValue
|
|
4798
5142
|
}));
|
|
4799
5143
|
}
|
|
5144
|
+
const showContentProps = createMemo(() => {
|
|
5145
|
+
return props.showContent ? {} : {
|
|
5146
|
+
hidden: true,
|
|
5147
|
+
"aria-hidden": true
|
|
5148
|
+
};
|
|
5149
|
+
});
|
|
4800
5150
|
function processMessage(event) {
|
|
4801
5151
|
return createEditorListener({
|
|
4802
5152
|
model: props.model,
|
|
@@ -5015,7 +5365,7 @@ function EnableEditor(props) {
|
|
|
5015
5365
|
get children() {
|
|
5016
5366
|
return createComponent(Dynamic, mergeProps({
|
|
5017
5367
|
get ["class"]() {
|
|
5018
|
-
return
|
|
5368
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
5019
5369
|
}
|
|
5020
5370
|
}, {}, {
|
|
5021
5371
|
ref(r$) {
|
|
@@ -5029,10 +5379,7 @@ function EnableEditor(props) {
|
|
|
5029
5379
|
get ["builder-model"]() {
|
|
5030
5380
|
return props.model;
|
|
5031
5381
|
}
|
|
5032
|
-
}, {}, () => props.
|
|
5033
|
-
hidden: true,
|
|
5034
|
-
"aria-hidden": true
|
|
5035
|
-
}, () => props.contentWrapperProps, {
|
|
5382
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
5036
5383
|
get component() {
|
|
5037
5384
|
return ContentWrapper();
|
|
5038
5385
|
},
|
|
@@ -5046,84 +5393,6 @@ function EnableEditor(props) {
|
|
|
5046
5393
|
});
|
|
5047
5394
|
}
|
|
5048
5395
|
var enable_editor_default = EnableEditor;
|
|
5049
|
-
|
|
5050
|
-
// src/components/content/components/styles.helpers.ts
|
|
5051
|
-
var getCssFromFont = (font) => {
|
|
5052
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5053
|
-
const name = family.split(",")[0];
|
|
5054
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
5055
|
-
let str = "";
|
|
5056
|
-
if (url && family && name) {
|
|
5057
|
-
str += `
|
|
5058
|
-
@font-face {
|
|
5059
|
-
font-family: "${family}";
|
|
5060
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
5061
|
-
font-display: fallback;
|
|
5062
|
-
font-weight: 400;
|
|
5063
|
-
}
|
|
5064
|
-
`.trim();
|
|
5065
|
-
}
|
|
5066
|
-
if (font.files) {
|
|
5067
|
-
for (const weight in font.files) {
|
|
5068
|
-
const isNumber = String(Number(weight)) === weight;
|
|
5069
|
-
if (!isNumber) {
|
|
5070
|
-
continue;
|
|
5071
|
-
}
|
|
5072
|
-
const weightUrl = font.files[weight];
|
|
5073
|
-
if (weightUrl && weightUrl !== url) {
|
|
5074
|
-
str += `
|
|
5075
|
-
@font-face {
|
|
5076
|
-
font-family: "${family}";
|
|
5077
|
-
src: url('${weightUrl}') format('woff2');
|
|
5078
|
-
font-display: fallback;
|
|
5079
|
-
font-weight: ${weight};
|
|
5080
|
-
}
|
|
5081
|
-
`.trim();
|
|
5082
|
-
}
|
|
5083
|
-
}
|
|
5084
|
-
}
|
|
5085
|
-
return str;
|
|
5086
|
-
};
|
|
5087
|
-
var getFontCss = ({
|
|
5088
|
-
customFonts
|
|
5089
|
-
}) => {
|
|
5090
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
5091
|
-
};
|
|
5092
|
-
var getCss = ({
|
|
5093
|
-
cssCode,
|
|
5094
|
-
contentId
|
|
5095
|
-
}) => {
|
|
5096
|
-
if (!cssCode) {
|
|
5097
|
-
return "";
|
|
5098
|
-
}
|
|
5099
|
-
if (!contentId) {
|
|
5100
|
-
return cssCode;
|
|
5101
|
-
}
|
|
5102
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5103
|
-
};
|
|
5104
|
-
var DEFAULT_STYLES = `
|
|
5105
|
-
.builder-button {
|
|
5106
|
-
all: unset;
|
|
5107
|
-
}
|
|
5108
|
-
|
|
5109
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5110
|
-
margin: 0;
|
|
5111
|
-
}
|
|
5112
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5113
|
-
color: inherit;
|
|
5114
|
-
line-height: inherit;
|
|
5115
|
-
letter-spacing: inherit;
|
|
5116
|
-
font-weight: inherit;
|
|
5117
|
-
font-size: inherit;
|
|
5118
|
-
text-align: inherit;
|
|
5119
|
-
font-family: inherit;
|
|
5120
|
-
}
|
|
5121
|
-
`;
|
|
5122
|
-
var getDefaultStyles = (isNested) => {
|
|
5123
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
5124
|
-
};
|
|
5125
|
-
|
|
5126
|
-
// src/components/content/components/styles.tsx
|
|
5127
5396
|
function ContentStyles(props) {
|
|
5128
5397
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5129
5398
|
${getCss({
|
|
@@ -5542,9 +5811,15 @@ var fetchSymbolContent = async ({
|
|
|
5542
5811
|
};
|
|
5543
5812
|
|
|
5544
5813
|
// src/blocks/symbol/symbol.tsx
|
|
5545
|
-
var _tmpl$
|
|
5814
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
5546
5815
|
function Symbol(props) {
|
|
5547
5816
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5817
|
+
const blocksWrapper = createMemo(() => {
|
|
5818
|
+
return "div";
|
|
5819
|
+
});
|
|
5820
|
+
const contentWrapper = createMemo(() => {
|
|
5821
|
+
return "div";
|
|
5822
|
+
});
|
|
5548
5823
|
const className = createMemo(() => {
|
|
5549
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(" ");
|
|
5550
5825
|
});
|
|
@@ -5568,7 +5843,7 @@ function Symbol(props) {
|
|
|
5568
5843
|
}
|
|
5569
5844
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5570
5845
|
return (() => {
|
|
5571
|
-
const _el$ = _tmpl$
|
|
5846
|
+
const _el$ = _tmpl$18();
|
|
5572
5847
|
spread(_el$, mergeProps({
|
|
5573
5848
|
get ["class"]() {
|
|
5574
5849
|
return className();
|
|
@@ -5607,8 +5882,12 @@ function Symbol(props) {
|
|
|
5607
5882
|
get linkComponent() {
|
|
5608
5883
|
return props.builderLinkComponent;
|
|
5609
5884
|
},
|
|
5610
|
-
blocksWrapper
|
|
5611
|
-
|
|
5885
|
+
get blocksWrapper() {
|
|
5886
|
+
return blocksWrapper();
|
|
5887
|
+
},
|
|
5888
|
+
get contentWrapper() {
|
|
5889
|
+
return contentWrapper();
|
|
5890
|
+
}
|
|
5612
5891
|
}));
|
|
5613
5892
|
return _el$;
|
|
5614
5893
|
})();
|