@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/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";
|
|
@@ -527,7 +531,6 @@ function evaluate({
|
|
|
527
531
|
enableCache
|
|
528
532
|
}) {
|
|
529
533
|
if (code === "") {
|
|
530
|
-
logger.warn("Skipping evaluation of empty code block.");
|
|
531
534
|
return void 0;
|
|
532
535
|
}
|
|
533
536
|
const args = {
|
|
@@ -856,6 +859,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
856
859
|
case "svelte":
|
|
857
860
|
case "vue":
|
|
858
861
|
case "solid":
|
|
862
|
+
case "angular":
|
|
859
863
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
860
864
|
case "qwik":
|
|
861
865
|
case "reactNative":
|
|
@@ -931,6 +935,12 @@ var getRepeatItemData = ({
|
|
|
931
935
|
}));
|
|
932
936
|
return repeatArray;
|
|
933
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
|
+
};
|
|
934
944
|
|
|
935
945
|
// src/constants/device-sizes.ts
|
|
936
946
|
var SIZES = {
|
|
@@ -1187,21 +1197,24 @@ function BlockWrapper(props) {
|
|
|
1187
1197
|
}
|
|
1188
1198
|
var block_wrapper_default = BlockWrapper;
|
|
1189
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
|
+
});
|
|
1190
1215
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
1191
1216
|
get attributes() {
|
|
1192
|
-
return
|
|
1193
|
-
...getBlockProperties({
|
|
1194
|
-
block: props.block,
|
|
1195
|
-
context: props.context
|
|
1196
|
-
}),
|
|
1197
|
-
...getBlockActions({
|
|
1198
|
-
block: props.block,
|
|
1199
|
-
rootState: props.context.rootState,
|
|
1200
|
-
rootSetState: props.context.rootSetState,
|
|
1201
|
-
localState: props.context.localState,
|
|
1202
|
-
context: props.context.context
|
|
1203
|
-
})
|
|
1204
|
-
} : {};
|
|
1217
|
+
return attributes();
|
|
1205
1218
|
},
|
|
1206
1219
|
get component() {
|
|
1207
1220
|
return props.Wrapper;
|
|
@@ -1376,10 +1389,10 @@ function Block(props) {
|
|
|
1376
1389
|
componentOptions: {
|
|
1377
1390
|
...getBlockComponentOptions(processedBlock()),
|
|
1378
1391
|
builderContext: props.context,
|
|
1379
|
-
...
|
|
1392
|
+
...shouldPassLinkComponent(blockComponent()?.name) ? {
|
|
1380
1393
|
builderLinkComponent: props.linkComponent
|
|
1381
1394
|
} : {},
|
|
1382
|
-
...
|
|
1395
|
+
...shouldPassRegisteredComponents(blockComponent()?.name) ? {
|
|
1383
1396
|
builderComponents: props.registeredComponents
|
|
1384
1397
|
} : {}
|
|
1385
1398
|
},
|
|
@@ -1671,6 +1684,11 @@ function Blocks(props) {
|
|
|
1671
1684
|
}
|
|
1672
1685
|
var blocks_default = Blocks;
|
|
1673
1686
|
|
|
1687
|
+
// src/blocks/columns/helpers.ts
|
|
1688
|
+
var getColumnsClass = (id) => {
|
|
1689
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1690
|
+
};
|
|
1691
|
+
|
|
1674
1692
|
// src/blocks/columns/columns.tsx
|
|
1675
1693
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1676
1694
|
function Columns(props) {
|
|
@@ -1678,6 +1696,9 @@ function Columns(props) {
|
|
|
1678
1696
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
1679
1697
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
1680
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
|
+
}
|
|
1681
1702
|
function getWidth(index) {
|
|
1682
1703
|
return cols()[index]?.width || 100 / cols().length;
|
|
1683
1704
|
}
|
|
@@ -1697,7 +1718,7 @@ function Columns(props) {
|
|
|
1697
1718
|
}) {
|
|
1698
1719
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1699
1720
|
}
|
|
1700
|
-
|
|
1721
|
+
function columnsCssVars() {
|
|
1701
1722
|
return {
|
|
1702
1723
|
"--flex-dir": flexDir(),
|
|
1703
1724
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -1705,7 +1726,7 @@ function Columns(props) {
|
|
|
1705
1726
|
desktopStyle: "row"
|
|
1706
1727
|
})
|
|
1707
1728
|
};
|
|
1708
|
-
}
|
|
1729
|
+
}
|
|
1709
1730
|
function columnCssVars(index) {
|
|
1710
1731
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
1711
1732
|
const width = getColumnCssWidth(index);
|
|
@@ -1744,7 +1765,7 @@ function Columns(props) {
|
|
|
1744
1765
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
1745
1766
|
return breakpointSizes[size].max;
|
|
1746
1767
|
}
|
|
1747
|
-
|
|
1768
|
+
function columnsStyles() {
|
|
1748
1769
|
return `
|
|
1749
1770
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1750
1771
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1770,12 +1791,22 @@ function Columns(props) {
|
|
|
1770
1791
|
}
|
|
1771
1792
|
},
|
|
1772
1793
|
`;
|
|
1773
|
-
}
|
|
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
|
+
}
|
|
1774
1805
|
return (() => {
|
|
1775
1806
|
const _el$ = _tmpl$2();
|
|
1776
1807
|
spread(_el$, mergeProps({
|
|
1777
1808
|
get ["class"]() {
|
|
1778
|
-
return
|
|
1809
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
1779
1810
|
display: "flex",
|
|
1780
1811
|
lineHeight: "normal"
|
|
1781
1812
|
});
|
|
@@ -1804,18 +1835,11 @@ function Columns(props) {
|
|
|
1804
1835
|
return createComponent(dynamic_renderer_default, {
|
|
1805
1836
|
key: index,
|
|
1806
1837
|
get TagName() {
|
|
1807
|
-
return column
|
|
1838
|
+
return getTagName(column);
|
|
1808
1839
|
},
|
|
1809
1840
|
actionAttributes: {},
|
|
1810
1841
|
get attributes() {
|
|
1811
|
-
return
|
|
1812
|
-
...{},
|
|
1813
|
-
...column.link ? {
|
|
1814
|
-
href: column.link
|
|
1815
|
-
} : {},
|
|
1816
|
-
[getClassPropName()]: "builder-column",
|
|
1817
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1818
|
-
};
|
|
1842
|
+
return getAttributes(column, index);
|
|
1819
1843
|
},
|
|
1820
1844
|
get children() {
|
|
1821
1845
|
return createComponent(blocks_default, {
|
|
@@ -2014,7 +2038,7 @@ function Image(props) {
|
|
|
2014
2038
|
}
|
|
2015
2039
|
}), createComponent(Show, {
|
|
2016
2040
|
get when() {
|
|
2017
|
-
return !props.fitContent && props.children;
|
|
2041
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
2018
2042
|
},
|
|
2019
2043
|
get children() {
|
|
2020
2044
|
const _el$5 = _tmpl$32();
|
|
@@ -2759,8 +2783,246 @@ var componentInfo7 = {
|
|
|
2759
2783
|
}]
|
|
2760
2784
|
};
|
|
2761
2785
|
|
|
2762
|
-
// 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
|
+
};
|
|
2763
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 = {
|
|
2764
3026
|
name: "Text",
|
|
2765
3027
|
static: true,
|
|
2766
3028
|
isRSC: true,
|
|
@@ -2779,10 +3041,10 @@ var componentInfo8 = {
|
|
|
2779
3041
|
textAlign: "center"
|
|
2780
3042
|
}
|
|
2781
3043
|
};
|
|
2782
|
-
var _tmpl$
|
|
3044
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2783
3045
|
function Text(props) {
|
|
2784
3046
|
return (() => {
|
|
2785
|
-
const _el$ = _tmpl$
|
|
3047
|
+
const _el$ = _tmpl$8();
|
|
2786
3048
|
_el$.style.setProperty("outline", "none");
|
|
2787
3049
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2788
3050
|
return _el$;
|
|
@@ -2791,7 +3053,7 @@ function Text(props) {
|
|
|
2791
3053
|
var text_default = Text;
|
|
2792
3054
|
|
|
2793
3055
|
// src/blocks/custom-code/component-info.ts
|
|
2794
|
-
var
|
|
3056
|
+
var componentInfo10 = {
|
|
2795
3057
|
name: "Custom Code",
|
|
2796
3058
|
static: true,
|
|
2797
3059
|
requiredPermissions: ["editCode"],
|
|
@@ -2814,7 +3076,7 @@ var componentInfo9 = {
|
|
|
2814
3076
|
advanced: true
|
|
2815
3077
|
}]
|
|
2816
3078
|
};
|
|
2817
|
-
var _tmpl$
|
|
3079
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2818
3080
|
function CustomCode(props) {
|
|
2819
3081
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2820
3082
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2849,7 +3111,7 @@ function CustomCode(props) {
|
|
|
2849
3111
|
}
|
|
2850
3112
|
});
|
|
2851
3113
|
return (() => {
|
|
2852
|
-
const _el$ = _tmpl$
|
|
3114
|
+
const _el$ = _tmpl$9();
|
|
2853
3115
|
const _ref$ = elementRef;
|
|
2854
3116
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2855
3117
|
effect((_p$) => {
|
|
@@ -2867,7 +3129,7 @@ function CustomCode(props) {
|
|
|
2867
3129
|
var custom_code_default = CustomCode;
|
|
2868
3130
|
|
|
2869
3131
|
// src/blocks/embed/component-info.ts
|
|
2870
|
-
var
|
|
3132
|
+
var componentInfo11 = {
|
|
2871
3133
|
name: "Embed",
|
|
2872
3134
|
static: true,
|
|
2873
3135
|
inputs: [{
|
|
@@ -2909,7 +3171,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2909
3171
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2910
3172
|
|
|
2911
3173
|
// src/blocks/embed/embed.tsx
|
|
2912
|
-
var _tmpl$
|
|
3174
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2913
3175
|
function Embed(props) {
|
|
2914
3176
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2915
3177
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2947,7 +3209,7 @@ function Embed(props) {
|
|
|
2947
3209
|
}
|
|
2948
3210
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
2949
3211
|
return (() => {
|
|
2950
|
-
const _el$ = _tmpl$
|
|
3212
|
+
const _el$ = _tmpl$10();
|
|
2951
3213
|
const _ref$ = elem;
|
|
2952
3214
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2953
3215
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2957,7 +3219,7 @@ function Embed(props) {
|
|
|
2957
3219
|
var embed_default = Embed;
|
|
2958
3220
|
|
|
2959
3221
|
// src/blocks/form/form/component-info.ts
|
|
2960
|
-
var
|
|
3222
|
+
var componentInfo12 = {
|
|
2961
3223
|
name: "Form:Form",
|
|
2962
3224
|
// editableTags: ['builder-form-error']
|
|
2963
3225
|
defaults: {
|
|
@@ -3204,8 +3466,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3204
3466
|
};
|
|
3205
3467
|
|
|
3206
3468
|
// src/blocks/form/form/form.tsx
|
|
3207
|
-
var _tmpl$
|
|
3208
|
-
var _tmpl$
|
|
3469
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
3470
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
3209
3471
|
function FormComponent(props) {
|
|
3210
3472
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3211
3473
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3391,7 +3653,7 @@ function FormComponent(props) {
|
|
|
3391
3653
|
}
|
|
3392
3654
|
let formRef;
|
|
3393
3655
|
return (() => {
|
|
3394
|
-
const _el$ = _tmpl$
|
|
3656
|
+
const _el$ = _tmpl$24();
|
|
3395
3657
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3396
3658
|
const _ref$ = formRef;
|
|
3397
3659
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3474,7 +3736,7 @@ function FormComponent(props) {
|
|
|
3474
3736
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3475
3737
|
},
|
|
3476
3738
|
get children() {
|
|
3477
|
-
const _el$2 = _tmpl$
|
|
3739
|
+
const _el$2 = _tmpl$11();
|
|
3478
3740
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3479
3741
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3480
3742
|
padding: "10px",
|
|
@@ -3506,7 +3768,7 @@ function FormComponent(props) {
|
|
|
3506
3768
|
var form_default = FormComponent;
|
|
3507
3769
|
|
|
3508
3770
|
// src/blocks/form/input/component-info.ts
|
|
3509
|
-
var
|
|
3771
|
+
var componentInfo13 = {
|
|
3510
3772
|
name: "Form:Input",
|
|
3511
3773
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3512
3774
|
inputs: [
|
|
@@ -3558,10 +3820,10 @@ var componentInfo12 = {
|
|
|
3558
3820
|
borderColor: "#ccc"
|
|
3559
3821
|
}
|
|
3560
3822
|
};
|
|
3561
|
-
var _tmpl$
|
|
3823
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
3562
3824
|
function FormInputComponent(props) {
|
|
3563
3825
|
return (() => {
|
|
3564
|
-
const _el$ = _tmpl$
|
|
3826
|
+
const _el$ = _tmpl$12();
|
|
3565
3827
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3566
3828
|
get key() {
|
|
3567
3829
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3591,7 +3853,7 @@ function FormInputComponent(props) {
|
|
|
3591
3853
|
var input_default = FormInputComponent;
|
|
3592
3854
|
|
|
3593
3855
|
// src/blocks/form/select/component-info.ts
|
|
3594
|
-
var
|
|
3856
|
+
var componentInfo14 = {
|
|
3595
3857
|
name: "Form:Select",
|
|
3596
3858
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3597
3859
|
defaultStyles: {
|
|
@@ -3634,11 +3896,11 @@ var componentInfo13 = {
|
|
|
3634
3896
|
static: true,
|
|
3635
3897
|
noWrap: true
|
|
3636
3898
|
};
|
|
3637
|
-
var _tmpl$
|
|
3638
|
-
var _tmpl$
|
|
3899
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
3900
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
3639
3901
|
function SelectComponent(props) {
|
|
3640
3902
|
return (() => {
|
|
3641
|
-
const _el$ = _tmpl$
|
|
3903
|
+
const _el$ = _tmpl$13();
|
|
3642
3904
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3643
3905
|
get value() {
|
|
3644
3906
|
return props.value;
|
|
@@ -3660,7 +3922,7 @@ function SelectComponent(props) {
|
|
|
3660
3922
|
children: (option, _index) => {
|
|
3661
3923
|
const index = _index();
|
|
3662
3924
|
return (() => {
|
|
3663
|
-
const _el$2 = _tmpl$
|
|
3925
|
+
const _el$2 = _tmpl$25();
|
|
3664
3926
|
insert(_el$2, () => option.name || option.value);
|
|
3665
3927
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3666
3928
|
effect(() => _el$2.value = option.value);
|
|
@@ -3674,7 +3936,7 @@ function SelectComponent(props) {
|
|
|
3674
3936
|
var select_default = SelectComponent;
|
|
3675
3937
|
|
|
3676
3938
|
// src/blocks/form/submit-button/component-info.ts
|
|
3677
|
-
var
|
|
3939
|
+
var componentInfo15 = {
|
|
3678
3940
|
name: "Form:SubmitButton",
|
|
3679
3941
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3680
3942
|
defaultStyles: {
|
|
@@ -3700,10 +3962,10 @@ var componentInfo14 = {
|
|
|
3700
3962
|
// TODO: defaultChildren
|
|
3701
3963
|
// canHaveChildren: true,
|
|
3702
3964
|
};
|
|
3703
|
-
var _tmpl$
|
|
3965
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3704
3966
|
function SubmitButton(props) {
|
|
3705
3967
|
return (() => {
|
|
3706
|
-
const _el$ = _tmpl$
|
|
3968
|
+
const _el$ = _tmpl$14();
|
|
3707
3969
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3708
3970
|
insert(_el$, () => props.text);
|
|
3709
3971
|
return _el$;
|
|
@@ -3712,7 +3974,7 @@ function SubmitButton(props) {
|
|
|
3712
3974
|
var submit_button_default = SubmitButton;
|
|
3713
3975
|
|
|
3714
3976
|
// src/blocks/img/component-info.ts
|
|
3715
|
-
var
|
|
3977
|
+
var componentInfo16 = {
|
|
3716
3978
|
// friendlyName?
|
|
3717
3979
|
name: "Raw:Img",
|
|
3718
3980
|
hideFromInsertMenu: true,
|
|
@@ -3727,10 +3989,10 @@ var componentInfo15 = {
|
|
|
3727
3989
|
noWrap: true,
|
|
3728
3990
|
static: true
|
|
3729
3991
|
};
|
|
3730
|
-
var _tmpl$
|
|
3992
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
3731
3993
|
function ImgComponent(props) {
|
|
3732
3994
|
return (() => {
|
|
3733
|
-
const _el$ = _tmpl$
|
|
3995
|
+
const _el$ = _tmpl$15();
|
|
3734
3996
|
spread(_el$, mergeProps({
|
|
3735
3997
|
get style() {
|
|
3736
3998
|
return {
|
|
@@ -3754,7 +4016,7 @@ function ImgComponent(props) {
|
|
|
3754
4016
|
var img_default = ImgComponent;
|
|
3755
4017
|
|
|
3756
4018
|
// src/blocks/video/component-info.ts
|
|
3757
|
-
var
|
|
4019
|
+
var componentInfo17 = {
|
|
3758
4020
|
name: "Video",
|
|
3759
4021
|
canHaveChildren: true,
|
|
3760
4022
|
defaultStyles: {
|
|
@@ -3836,9 +4098,9 @@ var componentInfo16 = {
|
|
|
3836
4098
|
advanced: true
|
|
3837
4099
|
}]
|
|
3838
4100
|
};
|
|
3839
|
-
var _tmpl$
|
|
3840
|
-
var _tmpl$
|
|
3841
|
-
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>`);
|
|
3842
4104
|
function Video(props) {
|
|
3843
4105
|
const videoProps = createMemo(() => {
|
|
3844
4106
|
return {
|
|
@@ -3865,7 +4127,7 @@ function Video(props) {
|
|
|
3865
4127
|
};
|
|
3866
4128
|
});
|
|
3867
4129
|
return (() => {
|
|
3868
|
-
const _el$ = _tmpl$
|
|
4130
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
3869
4131
|
_el$.style.setProperty("position", "relative");
|
|
3870
4132
|
spread(_el$2, mergeProps(spreadProps, {
|
|
3871
4133
|
get preload() {
|
|
@@ -3899,7 +4161,7 @@ function Video(props) {
|
|
|
3899
4161
|
return !props.lazyLoad;
|
|
3900
4162
|
},
|
|
3901
4163
|
get children() {
|
|
3902
|
-
const _el$3 = _tmpl$
|
|
4164
|
+
const _el$3 = _tmpl$16();
|
|
3903
4165
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
3904
4166
|
return _el$3;
|
|
3905
4167
|
}
|
|
@@ -3909,7 +4171,7 @@ function Video(props) {
|
|
|
3909
4171
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
3910
4172
|
},
|
|
3911
4173
|
get children() {
|
|
3912
|
-
const _el$4 = _tmpl$
|
|
4174
|
+
const _el$4 = _tmpl$26();
|
|
3913
4175
|
_el$4.style.setProperty("width", "100%");
|
|
3914
4176
|
_el$4.style.setProperty("pointer-events", "none");
|
|
3915
4177
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -3922,7 +4184,7 @@ function Video(props) {
|
|
|
3922
4184
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
3923
4185
|
},
|
|
3924
4186
|
get children() {
|
|
3925
|
-
const _el$5 = _tmpl$
|
|
4187
|
+
const _el$5 = _tmpl$26();
|
|
3926
4188
|
_el$5.style.setProperty("display", "flex");
|
|
3927
4189
|
_el$5.style.setProperty("flex-direction", "column");
|
|
3928
4190
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -3935,7 +4197,7 @@ function Video(props) {
|
|
|
3935
4197
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
3936
4198
|
},
|
|
3937
4199
|
get children() {
|
|
3938
|
-
const _el$6 = _tmpl$
|
|
4200
|
+
const _el$6 = _tmpl$26();
|
|
3939
4201
|
_el$6.style.setProperty("pointer-events", "none");
|
|
3940
4202
|
_el$6.style.setProperty("display", "flex");
|
|
3941
4203
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -3957,28 +4219,28 @@ var video_default = Video;
|
|
|
3957
4219
|
// src/constants/extra-components.ts
|
|
3958
4220
|
var getExtraComponents = () => [{
|
|
3959
4221
|
component: custom_code_default,
|
|
3960
|
-
...
|
|
4222
|
+
...componentInfo10
|
|
3961
4223
|
}, {
|
|
3962
4224
|
component: embed_default,
|
|
3963
|
-
...
|
|
4225
|
+
...componentInfo11
|
|
3964
4226
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3965
4227
|
component: form_default,
|
|
3966
|
-
...
|
|
4228
|
+
...componentInfo12
|
|
3967
4229
|
}, {
|
|
3968
4230
|
component: input_default,
|
|
3969
|
-
...
|
|
4231
|
+
...componentInfo13
|
|
3970
4232
|
}, {
|
|
3971
4233
|
component: submit_button_default,
|
|
3972
|
-
...
|
|
4234
|
+
...componentInfo15
|
|
3973
4235
|
}, {
|
|
3974
4236
|
component: select_default,
|
|
3975
|
-
...
|
|
4237
|
+
...componentInfo14
|
|
3976
4238
|
}], {
|
|
3977
4239
|
component: img_default,
|
|
3978
|
-
...
|
|
4240
|
+
...componentInfo16
|
|
3979
4241
|
}, {
|
|
3980
4242
|
component: video_default,
|
|
3981
|
-
...
|
|
4243
|
+
...componentInfo17
|
|
3982
4244
|
}];
|
|
3983
4245
|
|
|
3984
4246
|
// src/constants/builder-registered-components.ts
|
|
@@ -4005,8 +4267,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
4005
4267
|
...componentInfo7
|
|
4006
4268
|
}, {
|
|
4007
4269
|
component: text_default,
|
|
4270
|
+
...componentInfo9
|
|
4271
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
4272
|
+
component: tabs_default,
|
|
4008
4273
|
...componentInfo8
|
|
4009
|
-
}, ...getExtraComponents()];
|
|
4274
|
+
}], ...getExtraComponents()];
|
|
4010
4275
|
|
|
4011
4276
|
// src/functions/register-component.ts
|
|
4012
4277
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -4075,10 +4340,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4075
4340
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
4076
4341
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4077
4342
|
)`;
|
|
4078
|
-
var _tmpl$
|
|
4343
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
4079
4344
|
function InlinedScript(props) {
|
|
4080
4345
|
return (() => {
|
|
4081
|
-
const _el$ = _tmpl$
|
|
4346
|
+
const _el$ = _tmpl$17();
|
|
4082
4347
|
effect((_p$) => {
|
|
4083
4348
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
4084
4349
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4577,7 +4842,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4577
4842
|
}
|
|
4578
4843
|
|
|
4579
4844
|
// src/constants/sdk-version.ts
|
|
4580
|
-
var SDK_VERSION = "1.0.
|
|
4845
|
+
var SDK_VERSION = "1.0.24";
|
|
4581
4846
|
|
|
4582
4847
|
// src/functions/register.ts
|
|
4583
4848
|
var registry = {};
|
|
@@ -4774,6 +5039,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4774
5039
|
};
|
|
4775
5040
|
};
|
|
4776
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
|
+
|
|
4777
5121
|
// src/components/content/components/enable-editor.tsx
|
|
4778
5122
|
function EnableEditor(props) {
|
|
4779
5123
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -4813,6 +5157,12 @@ function EnableEditor(props) {
|
|
|
4813
5157
|
content: newContentValue
|
|
4814
5158
|
}));
|
|
4815
5159
|
}
|
|
5160
|
+
const showContentProps = createMemo(() => {
|
|
5161
|
+
return props.showContent ? {} : {
|
|
5162
|
+
hidden: true,
|
|
5163
|
+
"aria-hidden": true
|
|
5164
|
+
};
|
|
5165
|
+
});
|
|
4816
5166
|
function processMessage(event) {
|
|
4817
5167
|
return createEditorListener({
|
|
4818
5168
|
model: props.model,
|
|
@@ -5032,7 +5382,7 @@ function EnableEditor(props) {
|
|
|
5032
5382
|
get children() {
|
|
5033
5383
|
return createComponent(Dynamic, mergeProps({
|
|
5034
5384
|
get ["class"]() {
|
|
5035
|
-
return
|
|
5385
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
5036
5386
|
}
|
|
5037
5387
|
}, {}, {
|
|
5038
5388
|
ref(r$) {
|
|
@@ -5046,10 +5396,7 @@ function EnableEditor(props) {
|
|
|
5046
5396
|
get ["builder-model"]() {
|
|
5047
5397
|
return props.model;
|
|
5048
5398
|
}
|
|
5049
|
-
}, {}, () => props.
|
|
5050
|
-
hidden: true,
|
|
5051
|
-
"aria-hidden": true
|
|
5052
|
-
}, () => props.contentWrapperProps, {
|
|
5399
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
5053
5400
|
get component() {
|
|
5054
5401
|
return ContentWrapper();
|
|
5055
5402
|
},
|
|
@@ -5063,84 +5410,6 @@ function EnableEditor(props) {
|
|
|
5063
5410
|
});
|
|
5064
5411
|
}
|
|
5065
5412
|
var enable_editor_default = EnableEditor;
|
|
5066
|
-
|
|
5067
|
-
// src/components/content/components/styles.helpers.ts
|
|
5068
|
-
var getCssFromFont = (font) => {
|
|
5069
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5070
|
-
const name = family.split(",")[0];
|
|
5071
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
5072
|
-
let str = "";
|
|
5073
|
-
if (url && family && name) {
|
|
5074
|
-
str += `
|
|
5075
|
-
@font-face {
|
|
5076
|
-
font-family: "${family}";
|
|
5077
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
5078
|
-
font-display: fallback;
|
|
5079
|
-
font-weight: 400;
|
|
5080
|
-
}
|
|
5081
|
-
`.trim();
|
|
5082
|
-
}
|
|
5083
|
-
if (font.files) {
|
|
5084
|
-
for (const weight in font.files) {
|
|
5085
|
-
const isNumber = String(Number(weight)) === weight;
|
|
5086
|
-
if (!isNumber) {
|
|
5087
|
-
continue;
|
|
5088
|
-
}
|
|
5089
|
-
const weightUrl = font.files[weight];
|
|
5090
|
-
if (weightUrl && weightUrl !== url) {
|
|
5091
|
-
str += `
|
|
5092
|
-
@font-face {
|
|
5093
|
-
font-family: "${family}";
|
|
5094
|
-
src: url('${weightUrl}') format('woff2');
|
|
5095
|
-
font-display: fallback;
|
|
5096
|
-
font-weight: ${weight};
|
|
5097
|
-
}
|
|
5098
|
-
`.trim();
|
|
5099
|
-
}
|
|
5100
|
-
}
|
|
5101
|
-
}
|
|
5102
|
-
return str;
|
|
5103
|
-
};
|
|
5104
|
-
var getFontCss = ({
|
|
5105
|
-
customFonts
|
|
5106
|
-
}) => {
|
|
5107
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
5108
|
-
};
|
|
5109
|
-
var getCss = ({
|
|
5110
|
-
cssCode,
|
|
5111
|
-
contentId
|
|
5112
|
-
}) => {
|
|
5113
|
-
if (!cssCode) {
|
|
5114
|
-
return "";
|
|
5115
|
-
}
|
|
5116
|
-
if (!contentId) {
|
|
5117
|
-
return cssCode;
|
|
5118
|
-
}
|
|
5119
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
5120
|
-
};
|
|
5121
|
-
var DEFAULT_STYLES = `
|
|
5122
|
-
.builder-button {
|
|
5123
|
-
all: unset;
|
|
5124
|
-
}
|
|
5125
|
-
|
|
5126
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5127
|
-
margin: 0;
|
|
5128
|
-
}
|
|
5129
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5130
|
-
color: inherit;
|
|
5131
|
-
line-height: inherit;
|
|
5132
|
-
letter-spacing: inherit;
|
|
5133
|
-
font-weight: inherit;
|
|
5134
|
-
font-size: inherit;
|
|
5135
|
-
text-align: inherit;
|
|
5136
|
-
font-family: inherit;
|
|
5137
|
-
}
|
|
5138
|
-
`;
|
|
5139
|
-
var getDefaultStyles = (isNested) => {
|
|
5140
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
5141
|
-
};
|
|
5142
|
-
|
|
5143
|
-
// src/components/content/components/styles.tsx
|
|
5144
5413
|
function ContentStyles(props) {
|
|
5145
5414
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5146
5415
|
${getCss({
|
|
@@ -5559,9 +5828,15 @@ var fetchSymbolContent = async ({
|
|
|
5559
5828
|
};
|
|
5560
5829
|
|
|
5561
5830
|
// src/blocks/symbol/symbol.tsx
|
|
5562
|
-
var _tmpl$
|
|
5831
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
5563
5832
|
function Symbol(props) {
|
|
5564
5833
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5834
|
+
const blocksWrapper = createMemo(() => {
|
|
5835
|
+
return "div";
|
|
5836
|
+
});
|
|
5837
|
+
const contentWrapper = createMemo(() => {
|
|
5838
|
+
return "div";
|
|
5839
|
+
});
|
|
5565
5840
|
const className = createMemo(() => {
|
|
5566
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(" ");
|
|
5567
5842
|
});
|
|
@@ -5585,7 +5860,7 @@ function Symbol(props) {
|
|
|
5585
5860
|
}
|
|
5586
5861
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5587
5862
|
return (() => {
|
|
5588
|
-
const _el$ = _tmpl$
|
|
5863
|
+
const _el$ = _tmpl$18();
|
|
5589
5864
|
spread(_el$, mergeProps({
|
|
5590
5865
|
get ["class"]() {
|
|
5591
5866
|
return className();
|
|
@@ -5624,8 +5899,12 @@ function Symbol(props) {
|
|
|
5624
5899
|
get linkComponent() {
|
|
5625
5900
|
return props.builderLinkComponent;
|
|
5626
5901
|
},
|
|
5627
|
-
blocksWrapper
|
|
5628
|
-
|
|
5902
|
+
get blocksWrapper() {
|
|
5903
|
+
return blocksWrapper();
|
|
5904
|
+
},
|
|
5905
|
+
get contentWrapper() {
|
|
5906
|
+
return contentWrapper();
|
|
5907
|
+
}
|
|
5629
5908
|
}));
|
|
5630
5909
|
return _el$;
|
|
5631
5910
|
})();
|