@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/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
|
|
|
@@ -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";
|
|
@@ -707,6 +711,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
707
711
|
case "svelte":
|
|
708
712
|
case "vue":
|
|
709
713
|
case "solid":
|
|
714
|
+
case "angular":
|
|
710
715
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
711
716
|
case "qwik":
|
|
712
717
|
case "reactNative":
|
|
@@ -779,6 +784,12 @@ var getRepeatItemData = ({
|
|
|
779
784
|
}));
|
|
780
785
|
return repeatArray;
|
|
781
786
|
};
|
|
787
|
+
var shouldPassLinkComponent = (block) => {
|
|
788
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
789
|
+
};
|
|
790
|
+
var shouldPassRegisteredComponents = (block) => {
|
|
791
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
792
|
+
};
|
|
782
793
|
|
|
783
794
|
// src/constants/device-sizes.ts
|
|
784
795
|
var SIZES = {
|
|
@@ -1035,21 +1046,24 @@ function BlockWrapper(props) {
|
|
|
1035
1046
|
}
|
|
1036
1047
|
var block_wrapper_default = BlockWrapper;
|
|
1037
1048
|
function InteractiveElement(props) {
|
|
1049
|
+
const attributes = createMemo(() => {
|
|
1050
|
+
return props.includeBlockProps ? {
|
|
1051
|
+
...getBlockProperties({
|
|
1052
|
+
block: props.block,
|
|
1053
|
+
context: props.context
|
|
1054
|
+
}),
|
|
1055
|
+
...getBlockActions({
|
|
1056
|
+
block: props.block,
|
|
1057
|
+
rootState: props.context.rootState,
|
|
1058
|
+
rootSetState: props.context.rootSetState,
|
|
1059
|
+
localState: props.context.localState,
|
|
1060
|
+
context: props.context.context
|
|
1061
|
+
})
|
|
1062
|
+
} : {};
|
|
1063
|
+
});
|
|
1038
1064
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
1039
1065
|
get attributes() {
|
|
1040
|
-
return
|
|
1041
|
-
...getBlockProperties({
|
|
1042
|
-
block: props.block,
|
|
1043
|
-
context: props.context
|
|
1044
|
-
}),
|
|
1045
|
-
...getBlockActions({
|
|
1046
|
-
block: props.block,
|
|
1047
|
-
rootState: props.context.rootState,
|
|
1048
|
-
rootSetState: props.context.rootSetState,
|
|
1049
|
-
localState: props.context.localState,
|
|
1050
|
-
context: props.context.context
|
|
1051
|
-
})
|
|
1052
|
-
} : {};
|
|
1066
|
+
return attributes();
|
|
1053
1067
|
},
|
|
1054
1068
|
get component() {
|
|
1055
1069
|
return props.Wrapper;
|
|
@@ -1224,10 +1238,10 @@ function Block(props) {
|
|
|
1224
1238
|
componentOptions: {
|
|
1225
1239
|
...getBlockComponentOptions(processedBlock()),
|
|
1226
1240
|
builderContext: props.context,
|
|
1227
|
-
...
|
|
1241
|
+
...shouldPassLinkComponent(blockComponent()) ? {
|
|
1228
1242
|
builderLinkComponent: props.linkComponent
|
|
1229
1243
|
} : {},
|
|
1230
|
-
...
|
|
1244
|
+
...shouldPassRegisteredComponents(blockComponent()) ? {
|
|
1231
1245
|
builderComponents: props.registeredComponents
|
|
1232
1246
|
} : {}
|
|
1233
1247
|
},
|
|
@@ -1519,6 +1533,11 @@ function Blocks(props) {
|
|
|
1519
1533
|
}
|
|
1520
1534
|
var blocks_default = Blocks;
|
|
1521
1535
|
|
|
1536
|
+
// src/blocks/columns/helpers.ts
|
|
1537
|
+
var getColumnsClass = (id) => {
|
|
1538
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1522
1541
|
// src/blocks/columns/columns.tsx
|
|
1523
1542
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1524
1543
|
function Columns(props) {
|
|
@@ -1526,6 +1545,9 @@ function Columns(props) {
|
|
|
1526
1545
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
1527
1546
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
1528
1547
|
const [flexDir, setFlexDir] = createSignal(props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column");
|
|
1548
|
+
function getTagName(column) {
|
|
1549
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1550
|
+
}
|
|
1529
1551
|
function getWidth(index) {
|
|
1530
1552
|
return cols()[index]?.width || 100 / cols().length;
|
|
1531
1553
|
}
|
|
@@ -1545,7 +1567,7 @@ function Columns(props) {
|
|
|
1545
1567
|
}) {
|
|
1546
1568
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1547
1569
|
}
|
|
1548
|
-
|
|
1570
|
+
function columnsCssVars() {
|
|
1549
1571
|
return {
|
|
1550
1572
|
"--flex-dir": flexDir(),
|
|
1551
1573
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -1553,7 +1575,7 @@ function Columns(props) {
|
|
|
1553
1575
|
desktopStyle: "row"
|
|
1554
1576
|
})
|
|
1555
1577
|
};
|
|
1556
|
-
}
|
|
1578
|
+
}
|
|
1557
1579
|
function columnCssVars(index) {
|
|
1558
1580
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
1559
1581
|
const width = getColumnCssWidth(index);
|
|
@@ -1592,7 +1614,7 @@ function Columns(props) {
|
|
|
1592
1614
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
1593
1615
|
return breakpointSizes[size].max;
|
|
1594
1616
|
}
|
|
1595
|
-
|
|
1617
|
+
function columnsStyles() {
|
|
1596
1618
|
return `
|
|
1597
1619
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1598
1620
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1618,12 +1640,22 @@ function Columns(props) {
|
|
|
1618
1640
|
}
|
|
1619
1641
|
},
|
|
1620
1642
|
`;
|
|
1621
|
-
}
|
|
1643
|
+
}
|
|
1644
|
+
function getAttributes(column, index) {
|
|
1645
|
+
return {
|
|
1646
|
+
...{},
|
|
1647
|
+
...column.link ? {
|
|
1648
|
+
href: column.link
|
|
1649
|
+
} : {},
|
|
1650
|
+
[getClassPropName()]: "builder-column",
|
|
1651
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1622
1654
|
return (() => {
|
|
1623
1655
|
const _el$ = _tmpl$2();
|
|
1624
1656
|
spread(_el$, mergeProps({
|
|
1625
1657
|
get ["class"]() {
|
|
1626
|
-
return
|
|
1658
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
1627
1659
|
display: "flex",
|
|
1628
1660
|
lineHeight: "normal"
|
|
1629
1661
|
});
|
|
@@ -1652,18 +1684,11 @@ function Columns(props) {
|
|
|
1652
1684
|
return createComponent(dynamic_renderer_default, {
|
|
1653
1685
|
key: index,
|
|
1654
1686
|
get TagName() {
|
|
1655
|
-
return column
|
|
1687
|
+
return getTagName(column);
|
|
1656
1688
|
},
|
|
1657
1689
|
actionAttributes: {},
|
|
1658
1690
|
get attributes() {
|
|
1659
|
-
return
|
|
1660
|
-
...{},
|
|
1661
|
-
...column.link ? {
|
|
1662
|
-
href: column.link
|
|
1663
|
-
} : {},
|
|
1664
|
-
[getClassPropName()]: "builder-column",
|
|
1665
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1666
|
-
};
|
|
1691
|
+
return getAttributes(column, index);
|
|
1667
1692
|
},
|
|
1668
1693
|
get children() {
|
|
1669
1694
|
return createComponent(blocks_default, {
|
|
@@ -1861,7 +1886,7 @@ function Image(props) {
|
|
|
1861
1886
|
}
|
|
1862
1887
|
}), createComponent(Show, {
|
|
1863
1888
|
get when() {
|
|
1864
|
-
return !props.fitContent && props.children;
|
|
1889
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
1865
1890
|
},
|
|
1866
1891
|
get children() {
|
|
1867
1892
|
const _el$5 = _tmpl$32();
|
|
@@ -2605,8 +2630,246 @@ var componentInfo7 = {
|
|
|
2605
2630
|
}]
|
|
2606
2631
|
};
|
|
2607
2632
|
|
|
2608
|
-
// src/blocks/
|
|
2633
|
+
// src/blocks/tabs/component-info.ts
|
|
2634
|
+
var defaultTab = {
|
|
2635
|
+
"@type": "@builder.io/sdk:Element",
|
|
2636
|
+
responsiveStyles: {
|
|
2637
|
+
large: {
|
|
2638
|
+
paddingLeft: "20px",
|
|
2639
|
+
paddingRight: "20px",
|
|
2640
|
+
paddingTop: "10px",
|
|
2641
|
+
paddingBottom: "10px",
|
|
2642
|
+
minWidth: "100px",
|
|
2643
|
+
textAlign: "center",
|
|
2644
|
+
display: "flex",
|
|
2645
|
+
flexDirection: "column",
|
|
2646
|
+
cursor: "pointer",
|
|
2647
|
+
userSelect: "none"
|
|
2648
|
+
}
|
|
2649
|
+
},
|
|
2650
|
+
component: {
|
|
2651
|
+
name: "Text",
|
|
2652
|
+
options: {
|
|
2653
|
+
text: "New tab"
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
};
|
|
2657
|
+
var defaultElement = {
|
|
2658
|
+
"@type": "@builder.io/sdk:Element",
|
|
2659
|
+
responsiveStyles: {
|
|
2660
|
+
large: {
|
|
2661
|
+
height: "200px",
|
|
2662
|
+
display: "flex",
|
|
2663
|
+
marginTop: "20px",
|
|
2664
|
+
flexDirection: "column"
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2667
|
+
component: {
|
|
2668
|
+
name: "Text",
|
|
2669
|
+
options: {
|
|
2670
|
+
text: "New tab content "
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
};
|
|
2609
2674
|
var componentInfo8 = {
|
|
2675
|
+
name: "Builder: Tabs",
|
|
2676
|
+
inputs: [{
|
|
2677
|
+
name: "tabs",
|
|
2678
|
+
type: "list",
|
|
2679
|
+
broadcast: true,
|
|
2680
|
+
subFields: [{
|
|
2681
|
+
name: "label",
|
|
2682
|
+
type: "uiBlocks",
|
|
2683
|
+
hideFromUI: true,
|
|
2684
|
+
defaultValue: [defaultTab]
|
|
2685
|
+
}, {
|
|
2686
|
+
name: "content",
|
|
2687
|
+
type: "uiBlocks",
|
|
2688
|
+
hideFromUI: true,
|
|
2689
|
+
defaultValue: [defaultElement]
|
|
2690
|
+
}],
|
|
2691
|
+
defaultValue: [{
|
|
2692
|
+
label: [{
|
|
2693
|
+
...defaultTab,
|
|
2694
|
+
component: {
|
|
2695
|
+
name: "Text",
|
|
2696
|
+
options: {
|
|
2697
|
+
text: "Tab 1"
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
}],
|
|
2701
|
+
content: [{
|
|
2702
|
+
...defaultElement,
|
|
2703
|
+
component: {
|
|
2704
|
+
name: "Text",
|
|
2705
|
+
options: {
|
|
2706
|
+
text: "Tab 1 content"
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
}]
|
|
2710
|
+
}, {
|
|
2711
|
+
label: [{
|
|
2712
|
+
...defaultTab,
|
|
2713
|
+
component: {
|
|
2714
|
+
name: "Text",
|
|
2715
|
+
options: {
|
|
2716
|
+
text: "Tab 2"
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
}],
|
|
2720
|
+
content: [{
|
|
2721
|
+
...defaultElement,
|
|
2722
|
+
component: {
|
|
2723
|
+
name: "Text",
|
|
2724
|
+
options: {
|
|
2725
|
+
text: "Tab 2 content"
|
|
2726
|
+
}
|
|
2727
|
+
}
|
|
2728
|
+
}]
|
|
2729
|
+
}]
|
|
2730
|
+
}, {
|
|
2731
|
+
name: "activeTabStyle",
|
|
2732
|
+
type: "uiStyle",
|
|
2733
|
+
helperText: "CSS styles for the active tab",
|
|
2734
|
+
defaultValue: {
|
|
2735
|
+
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
2736
|
+
}
|
|
2737
|
+
}, {
|
|
2738
|
+
name: "defaultActiveTab",
|
|
2739
|
+
type: "number",
|
|
2740
|
+
helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
|
|
2741
|
+
defaultValue: 1,
|
|
2742
|
+
advanced: true
|
|
2743
|
+
}, {
|
|
2744
|
+
name: "collapsible",
|
|
2745
|
+
type: "boolean",
|
|
2746
|
+
helperText: "If on, clicking an open tab closes it so no tabs are active",
|
|
2747
|
+
defaultValue: false,
|
|
2748
|
+
advanced: true
|
|
2749
|
+
}, {
|
|
2750
|
+
name: "tabHeaderLayout",
|
|
2751
|
+
type: "enum",
|
|
2752
|
+
helperText: "Change the layout of the tab headers (uses justify-content)",
|
|
2753
|
+
defaultValue: "flex-start",
|
|
2754
|
+
enum: [{
|
|
2755
|
+
label: "Center",
|
|
2756
|
+
value: "center"
|
|
2757
|
+
}, {
|
|
2758
|
+
label: "Space between",
|
|
2759
|
+
value: "space-between"
|
|
2760
|
+
}, {
|
|
2761
|
+
label: "Space around",
|
|
2762
|
+
value: "space-around"
|
|
2763
|
+
}, {
|
|
2764
|
+
label: "Left",
|
|
2765
|
+
value: "flex-start"
|
|
2766
|
+
}, {
|
|
2767
|
+
label: "Right",
|
|
2768
|
+
value: "flex-end"
|
|
2769
|
+
}]
|
|
2770
|
+
}]
|
|
2771
|
+
};
|
|
2772
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
|
|
2773
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
|
|
2774
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
2775
|
+
function Tabs(props) {
|
|
2776
|
+
const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
|
|
2777
|
+
function activeTabContent(active) {
|
|
2778
|
+
return props.tabs && props.tabs[active].content;
|
|
2779
|
+
}
|
|
2780
|
+
function getActiveTabStyle(index) {
|
|
2781
|
+
return activeTab() === index ? props.activeTabStyle : {};
|
|
2782
|
+
}
|
|
2783
|
+
return (() => {
|
|
2784
|
+
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
2785
|
+
_el$2.style.setProperty("display", "flex");
|
|
2786
|
+
_el$2.style.setProperty("flex-direction", "row");
|
|
2787
|
+
_el$2.style.setProperty("overflow", "auto");
|
|
2788
|
+
insert(_el$2, createComponent(For, {
|
|
2789
|
+
get each() {
|
|
2790
|
+
return props.tabs;
|
|
2791
|
+
},
|
|
2792
|
+
children: (tab, _index) => {
|
|
2793
|
+
const index = _index();
|
|
2794
|
+
return (() => {
|
|
2795
|
+
const _el$4 = _tmpl$33();
|
|
2796
|
+
_el$4.$$click = (event) => {
|
|
2797
|
+
if (index === activeTab() && props.collapsible) {
|
|
2798
|
+
setActiveTab(-1);
|
|
2799
|
+
} else {
|
|
2800
|
+
setActiveTab(index);
|
|
2801
|
+
}
|
|
2802
|
+
};
|
|
2803
|
+
setAttribute(_el$4, "key", index);
|
|
2804
|
+
insert(_el$4, createComponent(blocks_default, {
|
|
2805
|
+
get parent() {
|
|
2806
|
+
return props.builderBlock.id;
|
|
2807
|
+
},
|
|
2808
|
+
path: `component.options.tabs.${index}.label`,
|
|
2809
|
+
get blocks() {
|
|
2810
|
+
return tab.label;
|
|
2811
|
+
},
|
|
2812
|
+
get context() {
|
|
2813
|
+
return props.builderContext;
|
|
2814
|
+
},
|
|
2815
|
+
get registeredComponents() {
|
|
2816
|
+
return props.builderComponents;
|
|
2817
|
+
},
|
|
2818
|
+
get linkComponent() {
|
|
2819
|
+
return props.builderLinkComponent;
|
|
2820
|
+
}
|
|
2821
|
+
}));
|
|
2822
|
+
effect((_p$) => {
|
|
2823
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
|
|
2824
|
+
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
2825
|
+
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
2826
|
+
return _p$;
|
|
2827
|
+
}, {
|
|
2828
|
+
_v$: void 0,
|
|
2829
|
+
_v$2: void 0
|
|
2830
|
+
});
|
|
2831
|
+
return _el$4;
|
|
2832
|
+
})();
|
|
2833
|
+
}
|
|
2834
|
+
}));
|
|
2835
|
+
insert(_el$, createComponent(Show, {
|
|
2836
|
+
get when() {
|
|
2837
|
+
return activeTabContent(activeTab());
|
|
2838
|
+
},
|
|
2839
|
+
get children() {
|
|
2840
|
+
const _el$3 = _tmpl$7();
|
|
2841
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
2842
|
+
get parent() {
|
|
2843
|
+
return props.builderBlock.id;
|
|
2844
|
+
},
|
|
2845
|
+
get path() {
|
|
2846
|
+
return `component.options.tabs.${activeTab()}.content`;
|
|
2847
|
+
},
|
|
2848
|
+
get blocks() {
|
|
2849
|
+
return activeTabContent(activeTab());
|
|
2850
|
+
},
|
|
2851
|
+
get context() {
|
|
2852
|
+
return props.builderContext;
|
|
2853
|
+
},
|
|
2854
|
+
get registeredComponents() {
|
|
2855
|
+
return props.builderComponents;
|
|
2856
|
+
},
|
|
2857
|
+
get linkComponent() {
|
|
2858
|
+
return props.builderLinkComponent;
|
|
2859
|
+
}
|
|
2860
|
+
}));
|
|
2861
|
+
return _el$3;
|
|
2862
|
+
}
|
|
2863
|
+
}), null);
|
|
2864
|
+
effect(() => (props.tabHeaderLayout || "flex-start") != null ? _el$2.style.setProperty("justify-content", props.tabHeaderLayout || "flex-start") : _el$2.style.removeProperty("justify-content"));
|
|
2865
|
+
return _el$;
|
|
2866
|
+
})();
|
|
2867
|
+
}
|
|
2868
|
+
var tabs_default = Tabs;
|
|
2869
|
+
delegateEvents(["click"]);
|
|
2870
|
+
|
|
2871
|
+
// src/blocks/text/component-info.ts
|
|
2872
|
+
var componentInfo9 = {
|
|
2610
2873
|
name: "Text",
|
|
2611
2874
|
static: true,
|
|
2612
2875
|
isRSC: true,
|
|
@@ -2625,10 +2888,10 @@ var componentInfo8 = {
|
|
|
2625
2888
|
textAlign: "center"
|
|
2626
2889
|
}
|
|
2627
2890
|
};
|
|
2628
|
-
var _tmpl$
|
|
2891
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2629
2892
|
function Text(props) {
|
|
2630
2893
|
return (() => {
|
|
2631
|
-
const _el$ = _tmpl$
|
|
2894
|
+
const _el$ = _tmpl$8();
|
|
2632
2895
|
_el$.style.setProperty("outline", "none");
|
|
2633
2896
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2634
2897
|
return _el$;
|
|
@@ -2637,7 +2900,7 @@ function Text(props) {
|
|
|
2637
2900
|
var text_default = Text;
|
|
2638
2901
|
|
|
2639
2902
|
// src/blocks/custom-code/component-info.ts
|
|
2640
|
-
var
|
|
2903
|
+
var componentInfo10 = {
|
|
2641
2904
|
name: "Custom Code",
|
|
2642
2905
|
static: true,
|
|
2643
2906
|
requiredPermissions: ["editCode"],
|
|
@@ -2660,7 +2923,7 @@ var componentInfo9 = {
|
|
|
2660
2923
|
advanced: true
|
|
2661
2924
|
}]
|
|
2662
2925
|
};
|
|
2663
|
-
var _tmpl$
|
|
2926
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2664
2927
|
function CustomCode(props) {
|
|
2665
2928
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2666
2929
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2694,7 +2957,7 @@ function CustomCode(props) {
|
|
|
2694
2957
|
}
|
|
2695
2958
|
});
|
|
2696
2959
|
return (() => {
|
|
2697
|
-
const _el$ = _tmpl$
|
|
2960
|
+
const _el$ = _tmpl$9();
|
|
2698
2961
|
const _ref$ = elementRef;
|
|
2699
2962
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2700
2963
|
effect((_p$) => {
|
|
@@ -2712,7 +2975,7 @@ function CustomCode(props) {
|
|
|
2712
2975
|
var custom_code_default = CustomCode;
|
|
2713
2976
|
|
|
2714
2977
|
// src/blocks/embed/component-info.ts
|
|
2715
|
-
var
|
|
2978
|
+
var componentInfo11 = {
|
|
2716
2979
|
name: "Embed",
|
|
2717
2980
|
static: true,
|
|
2718
2981
|
inputs: [{
|
|
@@ -2754,7 +3017,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2754
3017
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2755
3018
|
|
|
2756
3019
|
// src/blocks/embed/embed.tsx
|
|
2757
|
-
var _tmpl$
|
|
3020
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2758
3021
|
function Embed(props) {
|
|
2759
3022
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2760
3023
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2791,7 +3054,7 @@ function Embed(props) {
|
|
|
2791
3054
|
}
|
|
2792
3055
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
2793
3056
|
return (() => {
|
|
2794
|
-
const _el$ = _tmpl$
|
|
3057
|
+
const _el$ = _tmpl$10();
|
|
2795
3058
|
const _ref$ = elem;
|
|
2796
3059
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2797
3060
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2801,7 +3064,7 @@ function Embed(props) {
|
|
|
2801
3064
|
var embed_default = Embed;
|
|
2802
3065
|
|
|
2803
3066
|
// src/blocks/form/form/component-info.ts
|
|
2804
|
-
var
|
|
3067
|
+
var componentInfo12 = {
|
|
2805
3068
|
name: "Form:Form",
|
|
2806
3069
|
// editableTags: ['builder-form-error']
|
|
2807
3070
|
defaults: {
|
|
@@ -3048,8 +3311,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3048
3311
|
};
|
|
3049
3312
|
|
|
3050
3313
|
// src/blocks/form/form/form.tsx
|
|
3051
|
-
var _tmpl$
|
|
3052
|
-
var _tmpl$
|
|
3314
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
3315
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
3053
3316
|
function FormComponent(props) {
|
|
3054
3317
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3055
3318
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3235,7 +3498,7 @@ function FormComponent(props) {
|
|
|
3235
3498
|
}
|
|
3236
3499
|
let formRef;
|
|
3237
3500
|
return (() => {
|
|
3238
|
-
const _el$ = _tmpl$
|
|
3501
|
+
const _el$ = _tmpl$24();
|
|
3239
3502
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3240
3503
|
const _ref$ = formRef;
|
|
3241
3504
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3318,7 +3581,7 @@ function FormComponent(props) {
|
|
|
3318
3581
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3319
3582
|
},
|
|
3320
3583
|
get children() {
|
|
3321
|
-
const _el$2 = _tmpl$
|
|
3584
|
+
const _el$2 = _tmpl$11();
|
|
3322
3585
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3323
3586
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3324
3587
|
padding: "10px",
|
|
@@ -3350,7 +3613,7 @@ function FormComponent(props) {
|
|
|
3350
3613
|
var form_default = FormComponent;
|
|
3351
3614
|
|
|
3352
3615
|
// src/blocks/form/input/component-info.ts
|
|
3353
|
-
var
|
|
3616
|
+
var componentInfo13 = {
|
|
3354
3617
|
name: "Form:Input",
|
|
3355
3618
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3356
3619
|
inputs: [
|
|
@@ -3402,10 +3665,10 @@ var componentInfo12 = {
|
|
|
3402
3665
|
borderColor: "#ccc"
|
|
3403
3666
|
}
|
|
3404
3667
|
};
|
|
3405
|
-
var _tmpl$
|
|
3668
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
3406
3669
|
function FormInputComponent(props) {
|
|
3407
3670
|
return (() => {
|
|
3408
|
-
const _el$ = _tmpl$
|
|
3671
|
+
const _el$ = _tmpl$12();
|
|
3409
3672
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3410
3673
|
get key() {
|
|
3411
3674
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3435,7 +3698,7 @@ function FormInputComponent(props) {
|
|
|
3435
3698
|
var input_default = FormInputComponent;
|
|
3436
3699
|
|
|
3437
3700
|
// src/blocks/form/select/component-info.ts
|
|
3438
|
-
var
|
|
3701
|
+
var componentInfo14 = {
|
|
3439
3702
|
name: "Form:Select",
|
|
3440
3703
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3441
3704
|
defaultStyles: {
|
|
@@ -3478,11 +3741,11 @@ var componentInfo13 = {
|
|
|
3478
3741
|
static: true,
|
|
3479
3742
|
noWrap: true
|
|
3480
3743
|
};
|
|
3481
|
-
var _tmpl$
|
|
3482
|
-
var _tmpl$
|
|
3744
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
3745
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
3483
3746
|
function SelectComponent(props) {
|
|
3484
3747
|
return (() => {
|
|
3485
|
-
const _el$ = _tmpl$
|
|
3748
|
+
const _el$ = _tmpl$13();
|
|
3486
3749
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3487
3750
|
get value() {
|
|
3488
3751
|
return props.value;
|
|
@@ -3504,7 +3767,7 @@ function SelectComponent(props) {
|
|
|
3504
3767
|
children: (option, _index) => {
|
|
3505
3768
|
const index = _index();
|
|
3506
3769
|
return (() => {
|
|
3507
|
-
const _el$2 = _tmpl$
|
|
3770
|
+
const _el$2 = _tmpl$25();
|
|
3508
3771
|
insert(_el$2, () => option.name || option.value);
|
|
3509
3772
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3510
3773
|
effect(() => _el$2.value = option.value);
|
|
@@ -3518,7 +3781,7 @@ function SelectComponent(props) {
|
|
|
3518
3781
|
var select_default = SelectComponent;
|
|
3519
3782
|
|
|
3520
3783
|
// src/blocks/form/submit-button/component-info.ts
|
|
3521
|
-
var
|
|
3784
|
+
var componentInfo15 = {
|
|
3522
3785
|
name: "Form:SubmitButton",
|
|
3523
3786
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3524
3787
|
defaultStyles: {
|
|
@@ -3544,10 +3807,10 @@ var componentInfo14 = {
|
|
|
3544
3807
|
// TODO: defaultChildren
|
|
3545
3808
|
// canHaveChildren: true,
|
|
3546
3809
|
};
|
|
3547
|
-
var _tmpl$
|
|
3810
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3548
3811
|
function SubmitButton(props) {
|
|
3549
3812
|
return (() => {
|
|
3550
|
-
const _el$ = _tmpl$
|
|
3813
|
+
const _el$ = _tmpl$14();
|
|
3551
3814
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3552
3815
|
insert(_el$, () => props.text);
|
|
3553
3816
|
return _el$;
|
|
@@ -3556,7 +3819,7 @@ function SubmitButton(props) {
|
|
|
3556
3819
|
var submit_button_default = SubmitButton;
|
|
3557
3820
|
|
|
3558
3821
|
// src/blocks/img/component-info.ts
|
|
3559
|
-
var
|
|
3822
|
+
var componentInfo16 = {
|
|
3560
3823
|
// friendlyName?
|
|
3561
3824
|
name: "Raw:Img",
|
|
3562
3825
|
hideFromInsertMenu: true,
|
|
@@ -3571,10 +3834,10 @@ var componentInfo15 = {
|
|
|
3571
3834
|
noWrap: true,
|
|
3572
3835
|
static: true
|
|
3573
3836
|
};
|
|
3574
|
-
var _tmpl$
|
|
3837
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
3575
3838
|
function ImgComponent(props) {
|
|
3576
3839
|
return (() => {
|
|
3577
|
-
const _el$ = _tmpl$
|
|
3840
|
+
const _el$ = _tmpl$15();
|
|
3578
3841
|
spread(_el$, mergeProps({
|
|
3579
3842
|
get style() {
|
|
3580
3843
|
return {
|
|
@@ -3598,7 +3861,7 @@ function ImgComponent(props) {
|
|
|
3598
3861
|
var img_default = ImgComponent;
|
|
3599
3862
|
|
|
3600
3863
|
// src/blocks/video/component-info.ts
|
|
3601
|
-
var
|
|
3864
|
+
var componentInfo17 = {
|
|
3602
3865
|
name: "Video",
|
|
3603
3866
|
canHaveChildren: true,
|
|
3604
3867
|
defaultStyles: {
|
|
@@ -3680,9 +3943,9 @@ var componentInfo16 = {
|
|
|
3680
3943
|
advanced: true
|
|
3681
3944
|
}]
|
|
3682
3945
|
};
|
|
3683
|
-
var _tmpl$
|
|
3684
|
-
var _tmpl$
|
|
3685
|
-
var _tmpl$
|
|
3946
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
3947
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
|
|
3948
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
3686
3949
|
function Video(props) {
|
|
3687
3950
|
const videoProps = createMemo(() => {
|
|
3688
3951
|
return {
|
|
@@ -3709,7 +3972,7 @@ function Video(props) {
|
|
|
3709
3972
|
};
|
|
3710
3973
|
});
|
|
3711
3974
|
return (() => {
|
|
3712
|
-
const _el$ = _tmpl$
|
|
3975
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
3713
3976
|
_el$.style.setProperty("position", "relative");
|
|
3714
3977
|
spread(_el$2, mergeProps(spreadProps, {
|
|
3715
3978
|
get preload() {
|
|
@@ -3743,7 +4006,7 @@ function Video(props) {
|
|
|
3743
4006
|
return !props.lazyLoad;
|
|
3744
4007
|
},
|
|
3745
4008
|
get children() {
|
|
3746
|
-
const _el$3 = _tmpl$
|
|
4009
|
+
const _el$3 = _tmpl$16();
|
|
3747
4010
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
3748
4011
|
return _el$3;
|
|
3749
4012
|
}
|
|
@@ -3753,7 +4016,7 @@ function Video(props) {
|
|
|
3753
4016
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
3754
4017
|
},
|
|
3755
4018
|
get children() {
|
|
3756
|
-
const _el$4 = _tmpl$
|
|
4019
|
+
const _el$4 = _tmpl$26();
|
|
3757
4020
|
_el$4.style.setProperty("width", "100%");
|
|
3758
4021
|
_el$4.style.setProperty("pointer-events", "none");
|
|
3759
4022
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -3766,7 +4029,7 @@ function Video(props) {
|
|
|
3766
4029
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
3767
4030
|
},
|
|
3768
4031
|
get children() {
|
|
3769
|
-
const _el$5 = _tmpl$
|
|
4032
|
+
const _el$5 = _tmpl$26();
|
|
3770
4033
|
_el$5.style.setProperty("display", "flex");
|
|
3771
4034
|
_el$5.style.setProperty("flex-direction", "column");
|
|
3772
4035
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -3779,7 +4042,7 @@ function Video(props) {
|
|
|
3779
4042
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
3780
4043
|
},
|
|
3781
4044
|
get children() {
|
|
3782
|
-
const _el$6 = _tmpl$
|
|
4045
|
+
const _el$6 = _tmpl$26();
|
|
3783
4046
|
_el$6.style.setProperty("pointer-events", "none");
|
|
3784
4047
|
_el$6.style.setProperty("display", "flex");
|
|
3785
4048
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -3801,28 +4064,28 @@ var video_default = Video;
|
|
|
3801
4064
|
// src/constants/extra-components.ts
|
|
3802
4065
|
var getExtraComponents = () => [{
|
|
3803
4066
|
component: custom_code_default,
|
|
3804
|
-
...
|
|
4067
|
+
...componentInfo10
|
|
3805
4068
|
}, {
|
|
3806
4069
|
component: embed_default,
|
|
3807
|
-
...
|
|
4070
|
+
...componentInfo11
|
|
3808
4071
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3809
4072
|
component: form_default,
|
|
3810
|
-
...
|
|
4073
|
+
...componentInfo12
|
|
3811
4074
|
}, {
|
|
3812
4075
|
component: input_default,
|
|
3813
|
-
...
|
|
4076
|
+
...componentInfo13
|
|
3814
4077
|
}, {
|
|
3815
4078
|
component: submit_button_default,
|
|
3816
|
-
...
|
|
4079
|
+
...componentInfo15
|
|
3817
4080
|
}, {
|
|
3818
4081
|
component: select_default,
|
|
3819
|
-
...
|
|
4082
|
+
...componentInfo14
|
|
3820
4083
|
}], {
|
|
3821
4084
|
component: img_default,
|
|
3822
|
-
...
|
|
4085
|
+
...componentInfo16
|
|
3823
4086
|
}, {
|
|
3824
4087
|
component: video_default,
|
|
3825
|
-
...
|
|
4088
|
+
...componentInfo17
|
|
3826
4089
|
}];
|
|
3827
4090
|
|
|
3828
4091
|
// src/constants/builder-registered-components.ts
|
|
@@ -3849,8 +4112,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3849
4112
|
...componentInfo7
|
|
3850
4113
|
}, {
|
|
3851
4114
|
component: text_default,
|
|
4115
|
+
...componentInfo9
|
|
4116
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
4117
|
+
component: tabs_default,
|
|
3852
4118
|
...componentInfo8
|
|
3853
|
-
}, ...getExtraComponents()];
|
|
4119
|
+
}], ...getExtraComponents()];
|
|
3854
4120
|
|
|
3855
4121
|
// src/functions/register-component.ts
|
|
3856
4122
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -3919,10 +4185,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
3919
4185
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
3920
4186
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
3921
4187
|
)`;
|
|
3922
|
-
var _tmpl$
|
|
4188
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
3923
4189
|
function InlinedScript(props) {
|
|
3924
4190
|
return (() => {
|
|
3925
|
-
const _el$ = _tmpl$
|
|
4191
|
+
const _el$ = _tmpl$17();
|
|
3926
4192
|
effect((_p$) => {
|
|
3927
4193
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
3928
4194
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4416,7 +4682,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4416
4682
|
}
|
|
4417
4683
|
|
|
4418
4684
|
// src/constants/sdk-version.ts
|
|
4419
|
-
var SDK_VERSION = "1.0.
|
|
4685
|
+
var SDK_VERSION = "1.0.25";
|
|
4420
4686
|
|
|
4421
4687
|
// src/functions/register.ts
|
|
4422
4688
|
var registry = {};
|
|
@@ -4612,6 +4878,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4612
4878
|
};
|
|
4613
4879
|
};
|
|
4614
4880
|
|
|
4881
|
+
// src/components/content/components/styles.helpers.ts
|
|
4882
|
+
var getCssFromFont = (font) => {
|
|
4883
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
4884
|
+
const name = family.split(",")[0];
|
|
4885
|
+
const url = font.fileUrl ?? font?.files?.regular;
|
|
4886
|
+
let str = "";
|
|
4887
|
+
if (url && family && name) {
|
|
4888
|
+
str += `
|
|
4889
|
+
@font-face {
|
|
4890
|
+
font-family: "${family}";
|
|
4891
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
4892
|
+
font-display: fallback;
|
|
4893
|
+
font-weight: 400;
|
|
4894
|
+
}
|
|
4895
|
+
`.trim();
|
|
4896
|
+
}
|
|
4897
|
+
if (font.files) {
|
|
4898
|
+
for (const weight in font.files) {
|
|
4899
|
+
const isNumber = String(Number(weight)) === weight;
|
|
4900
|
+
if (!isNumber) {
|
|
4901
|
+
continue;
|
|
4902
|
+
}
|
|
4903
|
+
const weightUrl = font.files[weight];
|
|
4904
|
+
if (weightUrl && weightUrl !== url) {
|
|
4905
|
+
str += `
|
|
4906
|
+
@font-face {
|
|
4907
|
+
font-family: "${family}";
|
|
4908
|
+
src: url('${weightUrl}') format('woff2');
|
|
4909
|
+
font-display: fallback;
|
|
4910
|
+
font-weight: ${weight};
|
|
4911
|
+
}
|
|
4912
|
+
`.trim();
|
|
4913
|
+
}
|
|
4914
|
+
}
|
|
4915
|
+
}
|
|
4916
|
+
return str;
|
|
4917
|
+
};
|
|
4918
|
+
var getFontCss = ({
|
|
4919
|
+
customFonts
|
|
4920
|
+
}) => {
|
|
4921
|
+
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
4922
|
+
};
|
|
4923
|
+
var getCss = ({
|
|
4924
|
+
cssCode,
|
|
4925
|
+
contentId
|
|
4926
|
+
}) => {
|
|
4927
|
+
if (!cssCode) {
|
|
4928
|
+
return "";
|
|
4929
|
+
}
|
|
4930
|
+
if (!contentId) {
|
|
4931
|
+
return cssCode;
|
|
4932
|
+
}
|
|
4933
|
+
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4934
|
+
};
|
|
4935
|
+
var DEFAULT_STYLES = `
|
|
4936
|
+
.builder-button {
|
|
4937
|
+
all: unset;
|
|
4938
|
+
}
|
|
4939
|
+
|
|
4940
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
4941
|
+
margin: 0;
|
|
4942
|
+
}
|
|
4943
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
4944
|
+
color: inherit;
|
|
4945
|
+
line-height: inherit;
|
|
4946
|
+
letter-spacing: inherit;
|
|
4947
|
+
font-weight: inherit;
|
|
4948
|
+
font-size: inherit;
|
|
4949
|
+
text-align: inherit;
|
|
4950
|
+
font-family: inherit;
|
|
4951
|
+
}
|
|
4952
|
+
`;
|
|
4953
|
+
var getDefaultStyles = (isNested) => {
|
|
4954
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
4955
|
+
};
|
|
4956
|
+
var getWrapperClassName = (variationId) => {
|
|
4957
|
+
return `variant-${variationId}`;
|
|
4958
|
+
};
|
|
4959
|
+
|
|
4615
4960
|
// src/components/content/components/enable-editor.tsx
|
|
4616
4961
|
function EnableEditor(props) {
|
|
4617
4962
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -4651,6 +4996,12 @@ function EnableEditor(props) {
|
|
|
4651
4996
|
content: newContentValue
|
|
4652
4997
|
}));
|
|
4653
4998
|
}
|
|
4999
|
+
const showContentProps = createMemo(() => {
|
|
5000
|
+
return props.showContent ? {} : {
|
|
5001
|
+
hidden: true,
|
|
5002
|
+
"aria-hidden": true
|
|
5003
|
+
};
|
|
5004
|
+
});
|
|
4654
5005
|
function processMessage(event) {
|
|
4655
5006
|
return createEditorListener({
|
|
4656
5007
|
model: props.model,
|
|
@@ -4869,7 +5220,7 @@ function EnableEditor(props) {
|
|
|
4869
5220
|
get children() {
|
|
4870
5221
|
return createComponent(Dynamic, mergeProps({
|
|
4871
5222
|
get ["class"]() {
|
|
4872
|
-
return
|
|
5223
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
4873
5224
|
}
|
|
4874
5225
|
}, {}, {
|
|
4875
5226
|
ref(r$) {
|
|
@@ -4883,10 +5234,7 @@ function EnableEditor(props) {
|
|
|
4883
5234
|
get ["builder-model"]() {
|
|
4884
5235
|
return props.model;
|
|
4885
5236
|
}
|
|
4886
|
-
}, {}, () => props.
|
|
4887
|
-
hidden: true,
|
|
4888
|
-
"aria-hidden": true
|
|
4889
|
-
}, () => props.contentWrapperProps, {
|
|
5237
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
4890
5238
|
get component() {
|
|
4891
5239
|
return ContentWrapper();
|
|
4892
5240
|
},
|
|
@@ -4900,84 +5248,6 @@ function EnableEditor(props) {
|
|
|
4900
5248
|
});
|
|
4901
5249
|
}
|
|
4902
5250
|
var enable_editor_default = EnableEditor;
|
|
4903
|
-
|
|
4904
|
-
// src/components/content/components/styles.helpers.ts
|
|
4905
|
-
var getCssFromFont = (font) => {
|
|
4906
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
4907
|
-
const name = family.split(",")[0];
|
|
4908
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
4909
|
-
let str = "";
|
|
4910
|
-
if (url && family && name) {
|
|
4911
|
-
str += `
|
|
4912
|
-
@font-face {
|
|
4913
|
-
font-family: "${family}";
|
|
4914
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
4915
|
-
font-display: fallback;
|
|
4916
|
-
font-weight: 400;
|
|
4917
|
-
}
|
|
4918
|
-
`.trim();
|
|
4919
|
-
}
|
|
4920
|
-
if (font.files) {
|
|
4921
|
-
for (const weight in font.files) {
|
|
4922
|
-
const isNumber = String(Number(weight)) === weight;
|
|
4923
|
-
if (!isNumber) {
|
|
4924
|
-
continue;
|
|
4925
|
-
}
|
|
4926
|
-
const weightUrl = font.files[weight];
|
|
4927
|
-
if (weightUrl && weightUrl !== url) {
|
|
4928
|
-
str += `
|
|
4929
|
-
@font-face {
|
|
4930
|
-
font-family: "${family}";
|
|
4931
|
-
src: url('${weightUrl}') format('woff2');
|
|
4932
|
-
font-display: fallback;
|
|
4933
|
-
font-weight: ${weight};
|
|
4934
|
-
}
|
|
4935
|
-
`.trim();
|
|
4936
|
-
}
|
|
4937
|
-
}
|
|
4938
|
-
}
|
|
4939
|
-
return str;
|
|
4940
|
-
};
|
|
4941
|
-
var getFontCss = ({
|
|
4942
|
-
customFonts
|
|
4943
|
-
}) => {
|
|
4944
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
4945
|
-
};
|
|
4946
|
-
var getCss = ({
|
|
4947
|
-
cssCode,
|
|
4948
|
-
contentId
|
|
4949
|
-
}) => {
|
|
4950
|
-
if (!cssCode) {
|
|
4951
|
-
return "";
|
|
4952
|
-
}
|
|
4953
|
-
if (!contentId) {
|
|
4954
|
-
return cssCode;
|
|
4955
|
-
}
|
|
4956
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4957
|
-
};
|
|
4958
|
-
var DEFAULT_STYLES = `
|
|
4959
|
-
.builder-button {
|
|
4960
|
-
all: unset;
|
|
4961
|
-
}
|
|
4962
|
-
|
|
4963
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
4964
|
-
margin: 0;
|
|
4965
|
-
}
|
|
4966
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
4967
|
-
color: inherit;
|
|
4968
|
-
line-height: inherit;
|
|
4969
|
-
letter-spacing: inherit;
|
|
4970
|
-
font-weight: inherit;
|
|
4971
|
-
font-size: inherit;
|
|
4972
|
-
text-align: inherit;
|
|
4973
|
-
font-family: inherit;
|
|
4974
|
-
}
|
|
4975
|
-
`;
|
|
4976
|
-
var getDefaultStyles = (isNested) => {
|
|
4977
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
4978
|
-
};
|
|
4979
|
-
|
|
4980
|
-
// src/components/content/components/styles.tsx
|
|
4981
5251
|
function ContentStyles(props) {
|
|
4982
5252
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
4983
5253
|
${getCss({
|
|
@@ -5396,9 +5666,15 @@ var fetchSymbolContent = async ({
|
|
|
5396
5666
|
};
|
|
5397
5667
|
|
|
5398
5668
|
// src/blocks/symbol/symbol.tsx
|
|
5399
|
-
var _tmpl$
|
|
5669
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
5400
5670
|
function Symbol(props) {
|
|
5401
5671
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5672
|
+
const blocksWrapper = createMemo(() => {
|
|
5673
|
+
return "div";
|
|
5674
|
+
});
|
|
5675
|
+
const contentWrapper = createMemo(() => {
|
|
5676
|
+
return "div";
|
|
5677
|
+
});
|
|
5402
5678
|
const className = createMemo(() => {
|
|
5403
5679
|
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(" ");
|
|
5404
5680
|
});
|
|
@@ -5422,7 +5698,7 @@ function Symbol(props) {
|
|
|
5422
5698
|
}
|
|
5423
5699
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5424
5700
|
return (() => {
|
|
5425
|
-
const _el$ = _tmpl$
|
|
5701
|
+
const _el$ = _tmpl$18();
|
|
5426
5702
|
spread(_el$, mergeProps({
|
|
5427
5703
|
get ["class"]() {
|
|
5428
5704
|
return className();
|
|
@@ -5461,8 +5737,12 @@ function Symbol(props) {
|
|
|
5461
5737
|
get linkComponent() {
|
|
5462
5738
|
return props.builderLinkComponent;
|
|
5463
5739
|
},
|
|
5464
|
-
blocksWrapper
|
|
5465
|
-
|
|
5740
|
+
get blocksWrapper() {
|
|
5741
|
+
return blocksWrapper();
|
|
5742
|
+
},
|
|
5743
|
+
get contentWrapper() {
|
|
5744
|
+
return contentWrapper();
|
|
5745
|
+
}
|
|
5466
5746
|
}));
|
|
5467
5747
|
return _el$;
|
|
5468
5748
|
})();
|