@builder.io/sdk-solid 1.0.23 → 1.0.25
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 +482 -192
- package/lib/node/dev.jsx +487 -241
- package/lib/node/index.js +481 -191
- package/lib/node/index.jsx +486 -240
- package/package.json +1 -1
package/lib/browser/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
|
|
|
@@ -68,25 +68,29 @@ var getClassPropName = () => {
|
|
|
68
68
|
case "vue":
|
|
69
69
|
case "solid":
|
|
70
70
|
case "qwik":
|
|
71
|
+
case "angular":
|
|
71
72
|
return "class";
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
75
|
|
|
75
76
|
// src/blocks/button/button.tsx
|
|
76
77
|
function Button(props) {
|
|
78
|
+
function attrs() {
|
|
79
|
+
return {
|
|
80
|
+
...props.attributes,
|
|
81
|
+
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
82
|
+
...props.link ? {
|
|
83
|
+
href: props.link,
|
|
84
|
+
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
85
|
+
role: "link"
|
|
86
|
+
} : {
|
|
87
|
+
role: "button"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
77
91
|
return createComponent(dynamic_renderer_default, {
|
|
78
92
|
get attributes() {
|
|
79
|
-
return
|
|
80
|
-
...props.attributes,
|
|
81
|
-
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
82
|
-
...props.link ? {
|
|
83
|
-
href: props.link,
|
|
84
|
-
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
85
|
-
role: "link"
|
|
86
|
-
} : {
|
|
87
|
-
role: "button"
|
|
88
|
-
}
|
|
89
|
-
};
|
|
93
|
+
return attrs();
|
|
90
94
|
},
|
|
91
95
|
get TagName() {
|
|
92
96
|
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
@@ -710,6 +714,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
710
714
|
case "svelte":
|
|
711
715
|
case "vue":
|
|
712
716
|
case "solid":
|
|
717
|
+
case "angular":
|
|
713
718
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
714
719
|
case "qwik":
|
|
715
720
|
case "reactNative":
|
|
@@ -785,6 +790,12 @@ var getRepeatItemData = ({
|
|
|
785
790
|
}));
|
|
786
791
|
return repeatArray;
|
|
787
792
|
};
|
|
793
|
+
var shouldPassLinkComponent = (block) => {
|
|
794
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
795
|
+
};
|
|
796
|
+
var shouldPassRegisteredComponents = (block) => {
|
|
797
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
798
|
+
};
|
|
788
799
|
|
|
789
800
|
// src/constants/device-sizes.ts
|
|
790
801
|
var SIZES = {
|
|
@@ -1041,21 +1052,24 @@ function BlockWrapper(props) {
|
|
|
1041
1052
|
}
|
|
1042
1053
|
var block_wrapper_default = BlockWrapper;
|
|
1043
1054
|
function InteractiveElement(props) {
|
|
1055
|
+
const attributes = createMemo(() => {
|
|
1056
|
+
return props.includeBlockProps ? {
|
|
1057
|
+
...getBlockProperties({
|
|
1058
|
+
block: props.block,
|
|
1059
|
+
context: props.context
|
|
1060
|
+
}),
|
|
1061
|
+
...getBlockActions({
|
|
1062
|
+
block: props.block,
|
|
1063
|
+
rootState: props.context.rootState,
|
|
1064
|
+
rootSetState: props.context.rootSetState,
|
|
1065
|
+
localState: props.context.localState,
|
|
1066
|
+
context: props.context.context
|
|
1067
|
+
})
|
|
1068
|
+
} : {};
|
|
1069
|
+
});
|
|
1044
1070
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
1045
1071
|
get attributes() {
|
|
1046
|
-
return
|
|
1047
|
-
...getBlockProperties({
|
|
1048
|
-
block: props.block,
|
|
1049
|
-
context: props.context
|
|
1050
|
-
}),
|
|
1051
|
-
...getBlockActions({
|
|
1052
|
-
block: props.block,
|
|
1053
|
-
rootState: props.context.rootState,
|
|
1054
|
-
rootSetState: props.context.rootSetState,
|
|
1055
|
-
localState: props.context.localState,
|
|
1056
|
-
context: props.context.context
|
|
1057
|
-
})
|
|
1058
|
-
} : {};
|
|
1072
|
+
return attributes();
|
|
1059
1073
|
},
|
|
1060
1074
|
get component() {
|
|
1061
1075
|
return props.Wrapper;
|
|
@@ -1230,10 +1244,10 @@ function Block(props) {
|
|
|
1230
1244
|
componentOptions: {
|
|
1231
1245
|
...getBlockComponentOptions(processedBlock()),
|
|
1232
1246
|
builderContext: props.context,
|
|
1233
|
-
...
|
|
1247
|
+
...shouldPassLinkComponent(blockComponent()) ? {
|
|
1234
1248
|
builderLinkComponent: props.linkComponent
|
|
1235
1249
|
} : {},
|
|
1236
|
-
...
|
|
1250
|
+
...shouldPassRegisteredComponents(blockComponent()) ? {
|
|
1237
1251
|
builderComponents: props.registeredComponents
|
|
1238
1252
|
} : {}
|
|
1239
1253
|
},
|
|
@@ -1525,6 +1539,11 @@ function Blocks(props) {
|
|
|
1525
1539
|
}
|
|
1526
1540
|
var blocks_default = Blocks;
|
|
1527
1541
|
|
|
1542
|
+
// src/blocks/columns/helpers.ts
|
|
1543
|
+
var getColumnsClass = (id) => {
|
|
1544
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1545
|
+
};
|
|
1546
|
+
|
|
1528
1547
|
// src/blocks/columns/columns.tsx
|
|
1529
1548
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1530
1549
|
function Columns(props) {
|
|
@@ -1532,6 +1551,9 @@ function Columns(props) {
|
|
|
1532
1551
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
1533
1552
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
1534
1553
|
const [flexDir, setFlexDir] = createSignal(props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column");
|
|
1554
|
+
function getTagName(column) {
|
|
1555
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1556
|
+
}
|
|
1535
1557
|
function getWidth(index) {
|
|
1536
1558
|
return cols()[index]?.width || 100 / cols().length;
|
|
1537
1559
|
}
|
|
@@ -1551,7 +1573,7 @@ function Columns(props) {
|
|
|
1551
1573
|
}) {
|
|
1552
1574
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1553
1575
|
}
|
|
1554
|
-
|
|
1576
|
+
function columnsCssVars() {
|
|
1555
1577
|
return {
|
|
1556
1578
|
"--flex-dir": flexDir(),
|
|
1557
1579
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -1559,7 +1581,7 @@ function Columns(props) {
|
|
|
1559
1581
|
desktopStyle: "row"
|
|
1560
1582
|
})
|
|
1561
1583
|
};
|
|
1562
|
-
}
|
|
1584
|
+
}
|
|
1563
1585
|
function columnCssVars(index) {
|
|
1564
1586
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
1565
1587
|
const width = getColumnCssWidth(index);
|
|
@@ -1598,7 +1620,7 @@ function Columns(props) {
|
|
|
1598
1620
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
1599
1621
|
return breakpointSizes[size].max;
|
|
1600
1622
|
}
|
|
1601
|
-
|
|
1623
|
+
function columnsStyles() {
|
|
1602
1624
|
return `
|
|
1603
1625
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1604
1626
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1624,12 +1646,22 @@ function Columns(props) {
|
|
|
1624
1646
|
}
|
|
1625
1647
|
},
|
|
1626
1648
|
`;
|
|
1627
|
-
}
|
|
1649
|
+
}
|
|
1650
|
+
function getAttributes(column, index) {
|
|
1651
|
+
return {
|
|
1652
|
+
...{},
|
|
1653
|
+
...column.link ? {
|
|
1654
|
+
href: column.link
|
|
1655
|
+
} : {},
|
|
1656
|
+
[getClassPropName()]: "builder-column",
|
|
1657
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1628
1660
|
return (() => {
|
|
1629
1661
|
const _el$ = _tmpl$2();
|
|
1630
1662
|
spread(_el$, mergeProps({
|
|
1631
1663
|
get ["class"]() {
|
|
1632
|
-
return
|
|
1664
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
1633
1665
|
display: "flex",
|
|
1634
1666
|
lineHeight: "normal"
|
|
1635
1667
|
});
|
|
@@ -1658,18 +1690,11 @@ function Columns(props) {
|
|
|
1658
1690
|
return createComponent(dynamic_renderer_default, {
|
|
1659
1691
|
key: index,
|
|
1660
1692
|
get TagName() {
|
|
1661
|
-
return column
|
|
1693
|
+
return getTagName(column);
|
|
1662
1694
|
},
|
|
1663
1695
|
actionAttributes: {},
|
|
1664
1696
|
get attributes() {
|
|
1665
|
-
return
|
|
1666
|
-
...{},
|
|
1667
|
-
...column.link ? {
|
|
1668
|
-
href: column.link
|
|
1669
|
-
} : {},
|
|
1670
|
-
[getClassPropName()]: "builder-column",
|
|
1671
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1672
|
-
};
|
|
1697
|
+
return getAttributes(column, index);
|
|
1673
1698
|
},
|
|
1674
1699
|
get children() {
|
|
1675
1700
|
return createComponent(blocks_default, {
|
|
@@ -1868,7 +1893,7 @@ function Image(props) {
|
|
|
1868
1893
|
}
|
|
1869
1894
|
}), createComponent(Show, {
|
|
1870
1895
|
get when() {
|
|
1871
|
-
return !props.fitContent && props.children;
|
|
1896
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
1872
1897
|
},
|
|
1873
1898
|
get children() {
|
|
1874
1899
|
const _el$5 = _tmpl$32();
|
|
@@ -2613,8 +2638,246 @@ var componentInfo7 = {
|
|
|
2613
2638
|
}]
|
|
2614
2639
|
};
|
|
2615
2640
|
|
|
2616
|
-
// src/blocks/
|
|
2641
|
+
// src/blocks/tabs/component-info.ts
|
|
2642
|
+
var defaultTab = {
|
|
2643
|
+
"@type": "@builder.io/sdk:Element",
|
|
2644
|
+
responsiveStyles: {
|
|
2645
|
+
large: {
|
|
2646
|
+
paddingLeft: "20px",
|
|
2647
|
+
paddingRight: "20px",
|
|
2648
|
+
paddingTop: "10px",
|
|
2649
|
+
paddingBottom: "10px",
|
|
2650
|
+
minWidth: "100px",
|
|
2651
|
+
textAlign: "center",
|
|
2652
|
+
display: "flex",
|
|
2653
|
+
flexDirection: "column",
|
|
2654
|
+
cursor: "pointer",
|
|
2655
|
+
userSelect: "none"
|
|
2656
|
+
}
|
|
2657
|
+
},
|
|
2658
|
+
component: {
|
|
2659
|
+
name: "Text",
|
|
2660
|
+
options: {
|
|
2661
|
+
text: "New tab"
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
};
|
|
2665
|
+
var defaultElement = {
|
|
2666
|
+
"@type": "@builder.io/sdk:Element",
|
|
2667
|
+
responsiveStyles: {
|
|
2668
|
+
large: {
|
|
2669
|
+
height: "200px",
|
|
2670
|
+
display: "flex",
|
|
2671
|
+
marginTop: "20px",
|
|
2672
|
+
flexDirection: "column"
|
|
2673
|
+
}
|
|
2674
|
+
},
|
|
2675
|
+
component: {
|
|
2676
|
+
name: "Text",
|
|
2677
|
+
options: {
|
|
2678
|
+
text: "New tab content "
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
};
|
|
2617
2682
|
var componentInfo8 = {
|
|
2683
|
+
name: "Builder: Tabs",
|
|
2684
|
+
inputs: [{
|
|
2685
|
+
name: "tabs",
|
|
2686
|
+
type: "list",
|
|
2687
|
+
broadcast: true,
|
|
2688
|
+
subFields: [{
|
|
2689
|
+
name: "label",
|
|
2690
|
+
type: "uiBlocks",
|
|
2691
|
+
hideFromUI: true,
|
|
2692
|
+
defaultValue: [defaultTab]
|
|
2693
|
+
}, {
|
|
2694
|
+
name: "content",
|
|
2695
|
+
type: "uiBlocks",
|
|
2696
|
+
hideFromUI: true,
|
|
2697
|
+
defaultValue: [defaultElement]
|
|
2698
|
+
}],
|
|
2699
|
+
defaultValue: [{
|
|
2700
|
+
label: [{
|
|
2701
|
+
...defaultTab,
|
|
2702
|
+
component: {
|
|
2703
|
+
name: "Text",
|
|
2704
|
+
options: {
|
|
2705
|
+
text: "Tab 1"
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
}],
|
|
2709
|
+
content: [{
|
|
2710
|
+
...defaultElement,
|
|
2711
|
+
component: {
|
|
2712
|
+
name: "Text",
|
|
2713
|
+
options: {
|
|
2714
|
+
text: "Tab 1 content"
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
}]
|
|
2718
|
+
}, {
|
|
2719
|
+
label: [{
|
|
2720
|
+
...defaultTab,
|
|
2721
|
+
component: {
|
|
2722
|
+
name: "Text",
|
|
2723
|
+
options: {
|
|
2724
|
+
text: "Tab 2"
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
}],
|
|
2728
|
+
content: [{
|
|
2729
|
+
...defaultElement,
|
|
2730
|
+
component: {
|
|
2731
|
+
name: "Text",
|
|
2732
|
+
options: {
|
|
2733
|
+
text: "Tab 2 content"
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
}]
|
|
2737
|
+
}]
|
|
2738
|
+
}, {
|
|
2739
|
+
name: "activeTabStyle",
|
|
2740
|
+
type: "uiStyle",
|
|
2741
|
+
helperText: "CSS styles for the active tab",
|
|
2742
|
+
defaultValue: {
|
|
2743
|
+
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
2744
|
+
}
|
|
2745
|
+
}, {
|
|
2746
|
+
name: "defaultActiveTab",
|
|
2747
|
+
type: "number",
|
|
2748
|
+
helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
|
|
2749
|
+
defaultValue: 1,
|
|
2750
|
+
advanced: true
|
|
2751
|
+
}, {
|
|
2752
|
+
name: "collapsible",
|
|
2753
|
+
type: "boolean",
|
|
2754
|
+
helperText: "If on, clicking an open tab closes it so no tabs are active",
|
|
2755
|
+
defaultValue: false,
|
|
2756
|
+
advanced: true
|
|
2757
|
+
}, {
|
|
2758
|
+
name: "tabHeaderLayout",
|
|
2759
|
+
type: "enum",
|
|
2760
|
+
helperText: "Change the layout of the tab headers (uses justify-content)",
|
|
2761
|
+
defaultValue: "flex-start",
|
|
2762
|
+
enum: [{
|
|
2763
|
+
label: "Center",
|
|
2764
|
+
value: "center"
|
|
2765
|
+
}, {
|
|
2766
|
+
label: "Space between",
|
|
2767
|
+
value: "space-between"
|
|
2768
|
+
}, {
|
|
2769
|
+
label: "Space around",
|
|
2770
|
+
value: "space-around"
|
|
2771
|
+
}, {
|
|
2772
|
+
label: "Left",
|
|
2773
|
+
value: "flex-start"
|
|
2774
|
+
}, {
|
|
2775
|
+
label: "Right",
|
|
2776
|
+
value: "flex-end"
|
|
2777
|
+
}]
|
|
2778
|
+
}]
|
|
2779
|
+
};
|
|
2780
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
|
|
2781
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
2782
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
2783
|
+
function Tabs(props) {
|
|
2784
|
+
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
2785
|
+
function activeTabContent(active) {
|
|
2786
|
+
return props.tabs && props.tabs[active].content;
|
|
2787
|
+
}
|
|
2788
|
+
function getActiveTabStyle(index) {
|
|
2789
|
+
return activeTab() === index ? props.activeTabStyle : {};
|
|
2790
|
+
}
|
|
2791
|
+
return (() => {
|
|
2792
|
+
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
2793
|
+
_el$2.style.setProperty("display", "flex");
|
|
2794
|
+
_el$2.style.setProperty("flex-direction", "row");
|
|
2795
|
+
_el$2.style.setProperty("overflow", "auto");
|
|
2796
|
+
insert(_el$2, createComponent(For, {
|
|
2797
|
+
get each() {
|
|
2798
|
+
return props.tabs;
|
|
2799
|
+
},
|
|
2800
|
+
children: (tab, _index) => {
|
|
2801
|
+
const index = _index();
|
|
2802
|
+
return (() => {
|
|
2803
|
+
const _el$4 = _tmpl$33();
|
|
2804
|
+
_el$4.$$click = (event) => {
|
|
2805
|
+
if (index === activeTab() && props.collapsible) {
|
|
2806
|
+
setActiveTab(-1);
|
|
2807
|
+
} else {
|
|
2808
|
+
setActiveTab(index);
|
|
2809
|
+
}
|
|
2810
|
+
};
|
|
2811
|
+
setAttribute(_el$4, "key", index);
|
|
2812
|
+
insert(_el$4, createComponent(blocks_default, {
|
|
2813
|
+
get parent() {
|
|
2814
|
+
return props.builderBlock.id;
|
|
2815
|
+
},
|
|
2816
|
+
path: `component.options.tabs.${index}.label`,
|
|
2817
|
+
get blocks() {
|
|
2818
|
+
return tab.label;
|
|
2819
|
+
},
|
|
2820
|
+
get context() {
|
|
2821
|
+
return props.builderContext;
|
|
2822
|
+
},
|
|
2823
|
+
get registeredComponents() {
|
|
2824
|
+
return props.builderComponents;
|
|
2825
|
+
},
|
|
2826
|
+
get linkComponent() {
|
|
2827
|
+
return props.builderLinkComponent;
|
|
2828
|
+
}
|
|
2829
|
+
}));
|
|
2830
|
+
effect((_p$) => {
|
|
2831
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
|
|
2832
|
+
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
2833
|
+
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
2834
|
+
return _p$;
|
|
2835
|
+
}, {
|
|
2836
|
+
_v$: void 0,
|
|
2837
|
+
_v$2: void 0
|
|
2838
|
+
});
|
|
2839
|
+
return _el$4;
|
|
2840
|
+
})();
|
|
2841
|
+
}
|
|
2842
|
+
}));
|
|
2843
|
+
insert(_el$, createComponent(Show, {
|
|
2844
|
+
get when() {
|
|
2845
|
+
return activeTabContent(activeTab());
|
|
2846
|
+
},
|
|
2847
|
+
get children() {
|
|
2848
|
+
const _el$3 = _tmpl$7();
|
|
2849
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
2850
|
+
get parent() {
|
|
2851
|
+
return props.builderBlock.id;
|
|
2852
|
+
},
|
|
2853
|
+
get path() {
|
|
2854
|
+
return `component.options.tabs.${activeTab()}.content`;
|
|
2855
|
+
},
|
|
2856
|
+
get blocks() {
|
|
2857
|
+
return activeTabContent(activeTab());
|
|
2858
|
+
},
|
|
2859
|
+
get context() {
|
|
2860
|
+
return props.builderContext;
|
|
2861
|
+
},
|
|
2862
|
+
get registeredComponents() {
|
|
2863
|
+
return props.builderComponents;
|
|
2864
|
+
},
|
|
2865
|
+
get linkComponent() {
|
|
2866
|
+
return props.builderLinkComponent;
|
|
2867
|
+
}
|
|
2868
|
+
}));
|
|
2869
|
+
return _el$3;
|
|
2870
|
+
}
|
|
2871
|
+
}), null);
|
|
2872
|
+
effect(() => (props.tabHeaderLayout || "flex-start") != null ? _el$2.style.setProperty("justify-content", props.tabHeaderLayout || "flex-start") : _el$2.style.removeProperty("justify-content"));
|
|
2873
|
+
return _el$;
|
|
2874
|
+
})();
|
|
2875
|
+
}
|
|
2876
|
+
var tabs_default = Tabs;
|
|
2877
|
+
delegateEvents(["click"]);
|
|
2878
|
+
|
|
2879
|
+
// src/blocks/text/component-info.ts
|
|
2880
|
+
var componentInfo9 = {
|
|
2618
2881
|
name: "Text",
|
|
2619
2882
|
static: true,
|
|
2620
2883
|
isRSC: true,
|
|
@@ -2633,10 +2896,10 @@ var componentInfo8 = {
|
|
|
2633
2896
|
textAlign: "center"
|
|
2634
2897
|
}
|
|
2635
2898
|
};
|
|
2636
|
-
var _tmpl$
|
|
2899
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2637
2900
|
function Text(props) {
|
|
2638
2901
|
return (() => {
|
|
2639
|
-
const _el$ = _tmpl$
|
|
2902
|
+
const _el$ = _tmpl$8();
|
|
2640
2903
|
_el$.style.setProperty("outline", "none");
|
|
2641
2904
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2642
2905
|
return _el$;
|
|
@@ -2645,7 +2908,7 @@ function Text(props) {
|
|
|
2645
2908
|
var text_default = Text;
|
|
2646
2909
|
|
|
2647
2910
|
// src/blocks/custom-code/component-info.ts
|
|
2648
|
-
var
|
|
2911
|
+
var componentInfo10 = {
|
|
2649
2912
|
name: "Custom Code",
|
|
2650
2913
|
static: true,
|
|
2651
2914
|
requiredPermissions: ["editCode"],
|
|
@@ -2668,7 +2931,7 @@ var componentInfo9 = {
|
|
|
2668
2931
|
advanced: true
|
|
2669
2932
|
}]
|
|
2670
2933
|
};
|
|
2671
|
-
var _tmpl$
|
|
2934
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2672
2935
|
function CustomCode(props) {
|
|
2673
2936
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2674
2937
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2703,7 +2966,7 @@ function CustomCode(props) {
|
|
|
2703
2966
|
}
|
|
2704
2967
|
});
|
|
2705
2968
|
return (() => {
|
|
2706
|
-
const _el$ = _tmpl$
|
|
2969
|
+
const _el$ = _tmpl$9();
|
|
2707
2970
|
const _ref$ = elementRef;
|
|
2708
2971
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2709
2972
|
effect((_p$) => {
|
|
@@ -2721,7 +2984,7 @@ function CustomCode(props) {
|
|
|
2721
2984
|
var custom_code_default = CustomCode;
|
|
2722
2985
|
|
|
2723
2986
|
// src/blocks/embed/component-info.ts
|
|
2724
|
-
var
|
|
2987
|
+
var componentInfo11 = {
|
|
2725
2988
|
name: "Embed",
|
|
2726
2989
|
static: true,
|
|
2727
2990
|
inputs: [{
|
|
@@ -2763,7 +3026,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2763
3026
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2764
3027
|
|
|
2765
3028
|
// src/blocks/embed/embed.tsx
|
|
2766
|
-
var _tmpl$
|
|
3029
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2767
3030
|
function Embed(props) {
|
|
2768
3031
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2769
3032
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2801,7 +3064,7 @@ function Embed(props) {
|
|
|
2801
3064
|
}
|
|
2802
3065
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
2803
3066
|
return (() => {
|
|
2804
|
-
const _el$ = _tmpl$
|
|
3067
|
+
const _el$ = _tmpl$10();
|
|
2805
3068
|
const _ref$ = elem;
|
|
2806
3069
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2807
3070
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2811,7 +3074,7 @@ function Embed(props) {
|
|
|
2811
3074
|
var embed_default = Embed;
|
|
2812
3075
|
|
|
2813
3076
|
// src/blocks/form/form/component-info.ts
|
|
2814
|
-
var
|
|
3077
|
+
var componentInfo12 = {
|
|
2815
3078
|
name: "Form:Form",
|
|
2816
3079
|
// editableTags: ['builder-form-error']
|
|
2817
3080
|
defaults: {
|
|
@@ -3058,8 +3321,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3058
3321
|
};
|
|
3059
3322
|
|
|
3060
3323
|
// src/blocks/form/form/form.tsx
|
|
3061
|
-
var _tmpl$
|
|
3062
|
-
var _tmpl$
|
|
3324
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
3325
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
3063
3326
|
function FormComponent(props) {
|
|
3064
3327
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3065
3328
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3245,7 +3508,7 @@ function FormComponent(props) {
|
|
|
3245
3508
|
}
|
|
3246
3509
|
let formRef;
|
|
3247
3510
|
return (() => {
|
|
3248
|
-
const _el$ = _tmpl$
|
|
3511
|
+
const _el$ = _tmpl$24();
|
|
3249
3512
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3250
3513
|
const _ref$ = formRef;
|
|
3251
3514
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3328,7 +3591,7 @@ function FormComponent(props) {
|
|
|
3328
3591
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3329
3592
|
},
|
|
3330
3593
|
get children() {
|
|
3331
|
-
const _el$2 = _tmpl$
|
|
3594
|
+
const _el$2 = _tmpl$11();
|
|
3332
3595
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3333
3596
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3334
3597
|
padding: "10px",
|
|
@@ -3360,7 +3623,7 @@ function FormComponent(props) {
|
|
|
3360
3623
|
var form_default = FormComponent;
|
|
3361
3624
|
|
|
3362
3625
|
// src/blocks/form/input/component-info.ts
|
|
3363
|
-
var
|
|
3626
|
+
var componentInfo13 = {
|
|
3364
3627
|
name: "Form:Input",
|
|
3365
3628
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3366
3629
|
inputs: [
|
|
@@ -3412,10 +3675,10 @@ var componentInfo12 = {
|
|
|
3412
3675
|
borderColor: "#ccc"
|
|
3413
3676
|
}
|
|
3414
3677
|
};
|
|
3415
|
-
var _tmpl$
|
|
3678
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
3416
3679
|
function FormInputComponent(props) {
|
|
3417
3680
|
return (() => {
|
|
3418
|
-
const _el$ = _tmpl$
|
|
3681
|
+
const _el$ = _tmpl$12();
|
|
3419
3682
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3420
3683
|
get key() {
|
|
3421
3684
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3445,7 +3708,7 @@ function FormInputComponent(props) {
|
|
|
3445
3708
|
var input_default = FormInputComponent;
|
|
3446
3709
|
|
|
3447
3710
|
// src/blocks/form/select/component-info.ts
|
|
3448
|
-
var
|
|
3711
|
+
var componentInfo14 = {
|
|
3449
3712
|
name: "Form:Select",
|
|
3450
3713
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3451
3714
|
defaultStyles: {
|
|
@@ -3488,11 +3751,11 @@ var componentInfo13 = {
|
|
|
3488
3751
|
static: true,
|
|
3489
3752
|
noWrap: true
|
|
3490
3753
|
};
|
|
3491
|
-
var _tmpl$
|
|
3492
|
-
var _tmpl$
|
|
3754
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
3755
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
3493
3756
|
function SelectComponent(props) {
|
|
3494
3757
|
return (() => {
|
|
3495
|
-
const _el$ = _tmpl$
|
|
3758
|
+
const _el$ = _tmpl$13();
|
|
3496
3759
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3497
3760
|
get value() {
|
|
3498
3761
|
return props.value;
|
|
@@ -3514,7 +3777,7 @@ function SelectComponent(props) {
|
|
|
3514
3777
|
children: (option, _index) => {
|
|
3515
3778
|
const index = _index();
|
|
3516
3779
|
return (() => {
|
|
3517
|
-
const _el$2 = _tmpl$
|
|
3780
|
+
const _el$2 = _tmpl$25();
|
|
3518
3781
|
insert(_el$2, () => option.name || option.value);
|
|
3519
3782
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3520
3783
|
effect(() => _el$2.value = option.value);
|
|
@@ -3528,7 +3791,7 @@ function SelectComponent(props) {
|
|
|
3528
3791
|
var select_default = SelectComponent;
|
|
3529
3792
|
|
|
3530
3793
|
// src/blocks/form/submit-button/component-info.ts
|
|
3531
|
-
var
|
|
3794
|
+
var componentInfo15 = {
|
|
3532
3795
|
name: "Form:SubmitButton",
|
|
3533
3796
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3534
3797
|
defaultStyles: {
|
|
@@ -3554,10 +3817,10 @@ var componentInfo14 = {
|
|
|
3554
3817
|
// TODO: defaultChildren
|
|
3555
3818
|
// canHaveChildren: true,
|
|
3556
3819
|
};
|
|
3557
|
-
var _tmpl$
|
|
3820
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3558
3821
|
function SubmitButton(props) {
|
|
3559
3822
|
return (() => {
|
|
3560
|
-
const _el$ = _tmpl$
|
|
3823
|
+
const _el$ = _tmpl$14();
|
|
3561
3824
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3562
3825
|
insert(_el$, () => props.text);
|
|
3563
3826
|
return _el$;
|
|
@@ -3566,7 +3829,7 @@ function SubmitButton(props) {
|
|
|
3566
3829
|
var submit_button_default = SubmitButton;
|
|
3567
3830
|
|
|
3568
3831
|
// src/blocks/img/component-info.ts
|
|
3569
|
-
var
|
|
3832
|
+
var componentInfo16 = {
|
|
3570
3833
|
// friendlyName?
|
|
3571
3834
|
name: "Raw:Img",
|
|
3572
3835
|
hideFromInsertMenu: true,
|
|
@@ -3581,10 +3844,10 @@ var componentInfo15 = {
|
|
|
3581
3844
|
noWrap: true,
|
|
3582
3845
|
static: true
|
|
3583
3846
|
};
|
|
3584
|
-
var _tmpl$
|
|
3847
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
3585
3848
|
function ImgComponent(props) {
|
|
3586
3849
|
return (() => {
|
|
3587
|
-
const _el$ = _tmpl$
|
|
3850
|
+
const _el$ = _tmpl$15();
|
|
3588
3851
|
spread(_el$, mergeProps({
|
|
3589
3852
|
get style() {
|
|
3590
3853
|
return {
|
|
@@ -3608,7 +3871,7 @@ function ImgComponent(props) {
|
|
|
3608
3871
|
var img_default = ImgComponent;
|
|
3609
3872
|
|
|
3610
3873
|
// src/blocks/video/component-info.ts
|
|
3611
|
-
var
|
|
3874
|
+
var componentInfo17 = {
|
|
3612
3875
|
name: "Video",
|
|
3613
3876
|
canHaveChildren: true,
|
|
3614
3877
|
defaultStyles: {
|
|
@@ -3690,9 +3953,9 @@ var componentInfo16 = {
|
|
|
3690
3953
|
advanced: true
|
|
3691
3954
|
}]
|
|
3692
3955
|
};
|
|
3693
|
-
var _tmpl$
|
|
3694
|
-
var _tmpl$
|
|
3695
|
-
var _tmpl$
|
|
3956
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
3957
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
|
|
3958
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
3696
3959
|
function Video(props) {
|
|
3697
3960
|
const videoProps = createMemo(() => {
|
|
3698
3961
|
return {
|
|
@@ -3719,7 +3982,7 @@ function Video(props) {
|
|
|
3719
3982
|
};
|
|
3720
3983
|
});
|
|
3721
3984
|
return (() => {
|
|
3722
|
-
const _el$ = _tmpl$
|
|
3985
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
3723
3986
|
_el$.style.setProperty("position", "relative");
|
|
3724
3987
|
spread(_el$2, mergeProps(spreadProps, {
|
|
3725
3988
|
get preload() {
|
|
@@ -3753,7 +4016,7 @@ function Video(props) {
|
|
|
3753
4016
|
return !props.lazyLoad;
|
|
3754
4017
|
},
|
|
3755
4018
|
get children() {
|
|
3756
|
-
const _el$3 = _tmpl$
|
|
4019
|
+
const _el$3 = _tmpl$16();
|
|
3757
4020
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
3758
4021
|
return _el$3;
|
|
3759
4022
|
}
|
|
@@ -3763,7 +4026,7 @@ function Video(props) {
|
|
|
3763
4026
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
3764
4027
|
},
|
|
3765
4028
|
get children() {
|
|
3766
|
-
const _el$4 = _tmpl$
|
|
4029
|
+
const _el$4 = _tmpl$26();
|
|
3767
4030
|
_el$4.style.setProperty("width", "100%");
|
|
3768
4031
|
_el$4.style.setProperty("pointer-events", "none");
|
|
3769
4032
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -3776,7 +4039,7 @@ function Video(props) {
|
|
|
3776
4039
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
3777
4040
|
},
|
|
3778
4041
|
get children() {
|
|
3779
|
-
const _el$5 = _tmpl$
|
|
4042
|
+
const _el$5 = _tmpl$26();
|
|
3780
4043
|
_el$5.style.setProperty("display", "flex");
|
|
3781
4044
|
_el$5.style.setProperty("flex-direction", "column");
|
|
3782
4045
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -3789,7 +4052,7 @@ function Video(props) {
|
|
|
3789
4052
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
3790
4053
|
},
|
|
3791
4054
|
get children() {
|
|
3792
|
-
const _el$6 = _tmpl$
|
|
4055
|
+
const _el$6 = _tmpl$26();
|
|
3793
4056
|
_el$6.style.setProperty("pointer-events", "none");
|
|
3794
4057
|
_el$6.style.setProperty("display", "flex");
|
|
3795
4058
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -3811,28 +4074,28 @@ var video_default = Video;
|
|
|
3811
4074
|
// src/constants/extra-components.ts
|
|
3812
4075
|
var getExtraComponents = () => [{
|
|
3813
4076
|
component: custom_code_default,
|
|
3814
|
-
...
|
|
4077
|
+
...componentInfo10
|
|
3815
4078
|
}, {
|
|
3816
4079
|
component: embed_default,
|
|
3817
|
-
...
|
|
4080
|
+
...componentInfo11
|
|
3818
4081
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3819
4082
|
component: form_default,
|
|
3820
|
-
...
|
|
4083
|
+
...componentInfo12
|
|
3821
4084
|
}, {
|
|
3822
4085
|
component: input_default,
|
|
3823
|
-
...
|
|
4086
|
+
...componentInfo13
|
|
3824
4087
|
}, {
|
|
3825
4088
|
component: submit_button_default,
|
|
3826
|
-
...
|
|
4089
|
+
...componentInfo15
|
|
3827
4090
|
}, {
|
|
3828
4091
|
component: select_default,
|
|
3829
|
-
...
|
|
4092
|
+
...componentInfo14
|
|
3830
4093
|
}], {
|
|
3831
4094
|
component: img_default,
|
|
3832
|
-
...
|
|
4095
|
+
...componentInfo16
|
|
3833
4096
|
}, {
|
|
3834
4097
|
component: video_default,
|
|
3835
|
-
...
|
|
4098
|
+
...componentInfo17
|
|
3836
4099
|
}];
|
|
3837
4100
|
|
|
3838
4101
|
// src/constants/builder-registered-components.ts
|
|
@@ -3859,8 +4122,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3859
4122
|
...componentInfo7
|
|
3860
4123
|
}, {
|
|
3861
4124
|
component: text_default,
|
|
4125
|
+
...componentInfo9
|
|
4126
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
4127
|
+
component: tabs_default,
|
|
3862
4128
|
...componentInfo8
|
|
3863
|
-
}, ...getExtraComponents()];
|
|
4129
|
+
}], ...getExtraComponents()];
|
|
3864
4130
|
|
|
3865
4131
|
// src/functions/register-component.ts
|
|
3866
4132
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -3929,10 +4195,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
3929
4195
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
3930
4196
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
3931
4197
|
)`;
|
|
3932
|
-
var _tmpl$
|
|
4198
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
3933
4199
|
function InlinedScript(props) {
|
|
3934
4200
|
return (() => {
|
|
3935
|
-
const _el$ = _tmpl$
|
|
4201
|
+
const _el$ = _tmpl$17();
|
|
3936
4202
|
effect((_p$) => {
|
|
3937
4203
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
3938
4204
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4431,7 +4697,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4431
4697
|
}
|
|
4432
4698
|
|
|
4433
4699
|
// src/constants/sdk-version.ts
|
|
4434
|
-
var SDK_VERSION = "1.0.
|
|
4700
|
+
var SDK_VERSION = "1.0.25";
|
|
4435
4701
|
|
|
4436
4702
|
// src/functions/register.ts
|
|
4437
4703
|
var registry = {};
|
|
@@ -4628,6 +4894,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4628
4894
|
};
|
|
4629
4895
|
};
|
|
4630
4896
|
|
|
4897
|
+
// src/components/content/components/styles.helpers.ts
|
|
4898
|
+
var getCssFromFont = (font) => {
|
|
4899
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
4900
|
+
const name = family.split(",")[0];
|
|
4901
|
+
const url = font.fileUrl ?? font?.files?.regular;
|
|
4902
|
+
let str = "";
|
|
4903
|
+
if (url && family && name) {
|
|
4904
|
+
str += `
|
|
4905
|
+
@font-face {
|
|
4906
|
+
font-family: "${family}";
|
|
4907
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
4908
|
+
font-display: fallback;
|
|
4909
|
+
font-weight: 400;
|
|
4910
|
+
}
|
|
4911
|
+
`.trim();
|
|
4912
|
+
}
|
|
4913
|
+
if (font.files) {
|
|
4914
|
+
for (const weight in font.files) {
|
|
4915
|
+
const isNumber = String(Number(weight)) === weight;
|
|
4916
|
+
if (!isNumber) {
|
|
4917
|
+
continue;
|
|
4918
|
+
}
|
|
4919
|
+
const weightUrl = font.files[weight];
|
|
4920
|
+
if (weightUrl && weightUrl !== url) {
|
|
4921
|
+
str += `
|
|
4922
|
+
@font-face {
|
|
4923
|
+
font-family: "${family}";
|
|
4924
|
+
src: url('${weightUrl}') format('woff2');
|
|
4925
|
+
font-display: fallback;
|
|
4926
|
+
font-weight: ${weight};
|
|
4927
|
+
}
|
|
4928
|
+
`.trim();
|
|
4929
|
+
}
|
|
4930
|
+
}
|
|
4931
|
+
}
|
|
4932
|
+
return str;
|
|
4933
|
+
};
|
|
4934
|
+
var getFontCss = ({
|
|
4935
|
+
customFonts
|
|
4936
|
+
}) => {
|
|
4937
|
+
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
4938
|
+
};
|
|
4939
|
+
var getCss = ({
|
|
4940
|
+
cssCode,
|
|
4941
|
+
contentId
|
|
4942
|
+
}) => {
|
|
4943
|
+
if (!cssCode) {
|
|
4944
|
+
return "";
|
|
4945
|
+
}
|
|
4946
|
+
if (!contentId) {
|
|
4947
|
+
return cssCode;
|
|
4948
|
+
}
|
|
4949
|
+
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4950
|
+
};
|
|
4951
|
+
var DEFAULT_STYLES = `
|
|
4952
|
+
.builder-button {
|
|
4953
|
+
all: unset;
|
|
4954
|
+
}
|
|
4955
|
+
|
|
4956
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
4957
|
+
margin: 0;
|
|
4958
|
+
}
|
|
4959
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
4960
|
+
color: inherit;
|
|
4961
|
+
line-height: inherit;
|
|
4962
|
+
letter-spacing: inherit;
|
|
4963
|
+
font-weight: inherit;
|
|
4964
|
+
font-size: inherit;
|
|
4965
|
+
text-align: inherit;
|
|
4966
|
+
font-family: inherit;
|
|
4967
|
+
}
|
|
4968
|
+
`;
|
|
4969
|
+
var getDefaultStyles = (isNested) => {
|
|
4970
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
4971
|
+
};
|
|
4972
|
+
var getWrapperClassName = (variationId) => {
|
|
4973
|
+
return `variant-${variationId}`;
|
|
4974
|
+
};
|
|
4975
|
+
|
|
4631
4976
|
// src/components/content/components/enable-editor.tsx
|
|
4632
4977
|
function EnableEditor(props) {
|
|
4633
4978
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -4667,6 +5012,12 @@ function EnableEditor(props) {
|
|
|
4667
5012
|
content: newContentValue
|
|
4668
5013
|
}));
|
|
4669
5014
|
}
|
|
5015
|
+
const showContentProps = createMemo(() => {
|
|
5016
|
+
return props.showContent ? {} : {
|
|
5017
|
+
hidden: true,
|
|
5018
|
+
"aria-hidden": true
|
|
5019
|
+
};
|
|
5020
|
+
});
|
|
4670
5021
|
function processMessage(event) {
|
|
4671
5022
|
return createEditorListener({
|
|
4672
5023
|
model: props.model,
|
|
@@ -4886,7 +5237,7 @@ function EnableEditor(props) {
|
|
|
4886
5237
|
get children() {
|
|
4887
5238
|
return createComponent(Dynamic, mergeProps({
|
|
4888
5239
|
get ["class"]() {
|
|
4889
|
-
return
|
|
5240
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
4890
5241
|
}
|
|
4891
5242
|
}, {}, {
|
|
4892
5243
|
ref(r$) {
|
|
@@ -4900,10 +5251,7 @@ function EnableEditor(props) {
|
|
|
4900
5251
|
get ["builder-model"]() {
|
|
4901
5252
|
return props.model;
|
|
4902
5253
|
}
|
|
4903
|
-
}, {}, () => props.
|
|
4904
|
-
hidden: true,
|
|
4905
|
-
"aria-hidden": true
|
|
4906
|
-
}, () => props.contentWrapperProps, {
|
|
5254
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
4907
5255
|
get component() {
|
|
4908
5256
|
return ContentWrapper();
|
|
4909
5257
|
},
|
|
@@ -4917,84 +5265,6 @@ function EnableEditor(props) {
|
|
|
4917
5265
|
});
|
|
4918
5266
|
}
|
|
4919
5267
|
var enable_editor_default = EnableEditor;
|
|
4920
|
-
|
|
4921
|
-
// src/components/content/components/styles.helpers.ts
|
|
4922
|
-
var getCssFromFont = (font) => {
|
|
4923
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
4924
|
-
const name = family.split(",")[0];
|
|
4925
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
4926
|
-
let str = "";
|
|
4927
|
-
if (url && family && name) {
|
|
4928
|
-
str += `
|
|
4929
|
-
@font-face {
|
|
4930
|
-
font-family: "${family}";
|
|
4931
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
4932
|
-
font-display: fallback;
|
|
4933
|
-
font-weight: 400;
|
|
4934
|
-
}
|
|
4935
|
-
`.trim();
|
|
4936
|
-
}
|
|
4937
|
-
if (font.files) {
|
|
4938
|
-
for (const weight in font.files) {
|
|
4939
|
-
const isNumber = String(Number(weight)) === weight;
|
|
4940
|
-
if (!isNumber) {
|
|
4941
|
-
continue;
|
|
4942
|
-
}
|
|
4943
|
-
const weightUrl = font.files[weight];
|
|
4944
|
-
if (weightUrl && weightUrl !== url) {
|
|
4945
|
-
str += `
|
|
4946
|
-
@font-face {
|
|
4947
|
-
font-family: "${family}";
|
|
4948
|
-
src: url('${weightUrl}') format('woff2');
|
|
4949
|
-
font-display: fallback;
|
|
4950
|
-
font-weight: ${weight};
|
|
4951
|
-
}
|
|
4952
|
-
`.trim();
|
|
4953
|
-
}
|
|
4954
|
-
}
|
|
4955
|
-
}
|
|
4956
|
-
return str;
|
|
4957
|
-
};
|
|
4958
|
-
var getFontCss = ({
|
|
4959
|
-
customFonts
|
|
4960
|
-
}) => {
|
|
4961
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
4962
|
-
};
|
|
4963
|
-
var getCss = ({
|
|
4964
|
-
cssCode,
|
|
4965
|
-
contentId
|
|
4966
|
-
}) => {
|
|
4967
|
-
if (!cssCode) {
|
|
4968
|
-
return "";
|
|
4969
|
-
}
|
|
4970
|
-
if (!contentId) {
|
|
4971
|
-
return cssCode;
|
|
4972
|
-
}
|
|
4973
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4974
|
-
};
|
|
4975
|
-
var DEFAULT_STYLES = `
|
|
4976
|
-
.builder-button {
|
|
4977
|
-
all: unset;
|
|
4978
|
-
}
|
|
4979
|
-
|
|
4980
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
4981
|
-
margin: 0;
|
|
4982
|
-
}
|
|
4983
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
4984
|
-
color: inherit;
|
|
4985
|
-
line-height: inherit;
|
|
4986
|
-
letter-spacing: inherit;
|
|
4987
|
-
font-weight: inherit;
|
|
4988
|
-
font-size: inherit;
|
|
4989
|
-
text-align: inherit;
|
|
4990
|
-
font-family: inherit;
|
|
4991
|
-
}
|
|
4992
|
-
`;
|
|
4993
|
-
var getDefaultStyles = (isNested) => {
|
|
4994
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
4995
|
-
};
|
|
4996
|
-
|
|
4997
|
-
// src/components/content/components/styles.tsx
|
|
4998
5268
|
function ContentStyles(props) {
|
|
4999
5269
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5000
5270
|
${getCss({
|
|
@@ -5413,9 +5683,15 @@ var fetchSymbolContent = async ({
|
|
|
5413
5683
|
};
|
|
5414
5684
|
|
|
5415
5685
|
// src/blocks/symbol/symbol.tsx
|
|
5416
|
-
var _tmpl$
|
|
5686
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
5417
5687
|
function Symbol(props) {
|
|
5418
5688
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5689
|
+
const blocksWrapper = createMemo(() => {
|
|
5690
|
+
return "div";
|
|
5691
|
+
});
|
|
5692
|
+
const contentWrapper = createMemo(() => {
|
|
5693
|
+
return "div";
|
|
5694
|
+
});
|
|
5419
5695
|
const className = createMemo(() => {
|
|
5420
5696
|
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(" ");
|
|
5421
5697
|
});
|
|
@@ -5439,7 +5715,7 @@ function Symbol(props) {
|
|
|
5439
5715
|
}
|
|
5440
5716
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5441
5717
|
return (() => {
|
|
5442
|
-
const _el$ = _tmpl$
|
|
5718
|
+
const _el$ = _tmpl$18();
|
|
5443
5719
|
spread(_el$, mergeProps({
|
|
5444
5720
|
get ["class"]() {
|
|
5445
5721
|
return className();
|
|
@@ -5478,8 +5754,12 @@ function Symbol(props) {
|
|
|
5478
5754
|
get linkComponent() {
|
|
5479
5755
|
return props.builderLinkComponent;
|
|
5480
5756
|
},
|
|
5481
|
-
blocksWrapper
|
|
5482
|
-
|
|
5757
|
+
get blocksWrapper() {
|
|
5758
|
+
return blocksWrapper();
|
|
5759
|
+
},
|
|
5760
|
+
get contentWrapper() {
|
|
5761
|
+
return contentWrapper();
|
|
5762
|
+
}
|
|
5483
5763
|
}));
|
|
5484
5764
|
return _el$;
|
|
5485
5765
|
})();
|