@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/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";
|
|
@@ -367,7 +371,6 @@ function evaluate({
|
|
|
367
371
|
enableCache
|
|
368
372
|
}) {
|
|
369
373
|
if (code === "") {
|
|
370
|
-
logger.warn("Skipping evaluation of empty code block.");
|
|
371
374
|
return void 0;
|
|
372
375
|
}
|
|
373
376
|
const args = {
|
|
@@ -708,6 +711,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
708
711
|
case "svelte":
|
|
709
712
|
case "vue":
|
|
710
713
|
case "solid":
|
|
714
|
+
case "angular":
|
|
711
715
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
712
716
|
case "qwik":
|
|
713
717
|
case "reactNative":
|
|
@@ -780,6 +784,12 @@ var getRepeatItemData = ({
|
|
|
780
784
|
}));
|
|
781
785
|
return repeatArray;
|
|
782
786
|
};
|
|
787
|
+
var shouldPassLinkComponent = (blockName) => {
|
|
788
|
+
return blockName && ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
789
|
+
};
|
|
790
|
+
var shouldPassRegisteredComponents = (blockName) => {
|
|
791
|
+
return blockName && ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
792
|
+
};
|
|
783
793
|
|
|
784
794
|
// src/constants/device-sizes.ts
|
|
785
795
|
var SIZES = {
|
|
@@ -1036,21 +1046,24 @@ function BlockWrapper(props) {
|
|
|
1036
1046
|
}
|
|
1037
1047
|
var block_wrapper_default = BlockWrapper;
|
|
1038
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
|
+
});
|
|
1039
1064
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
1040
1065
|
get attributes() {
|
|
1041
|
-
return
|
|
1042
|
-
...getBlockProperties({
|
|
1043
|
-
block: props.block,
|
|
1044
|
-
context: props.context
|
|
1045
|
-
}),
|
|
1046
|
-
...getBlockActions({
|
|
1047
|
-
block: props.block,
|
|
1048
|
-
rootState: props.context.rootState,
|
|
1049
|
-
rootSetState: props.context.rootSetState,
|
|
1050
|
-
localState: props.context.localState,
|
|
1051
|
-
context: props.context.context
|
|
1052
|
-
})
|
|
1053
|
-
} : {};
|
|
1066
|
+
return attributes();
|
|
1054
1067
|
},
|
|
1055
1068
|
get component() {
|
|
1056
1069
|
return props.Wrapper;
|
|
@@ -1225,10 +1238,10 @@ function Block(props) {
|
|
|
1225
1238
|
componentOptions: {
|
|
1226
1239
|
...getBlockComponentOptions(processedBlock()),
|
|
1227
1240
|
builderContext: props.context,
|
|
1228
|
-
...
|
|
1241
|
+
...shouldPassLinkComponent(blockComponent()?.name) ? {
|
|
1229
1242
|
builderLinkComponent: props.linkComponent
|
|
1230
1243
|
} : {},
|
|
1231
|
-
...
|
|
1244
|
+
...shouldPassRegisteredComponents(blockComponent()?.name) ? {
|
|
1232
1245
|
builderComponents: props.registeredComponents
|
|
1233
1246
|
} : {}
|
|
1234
1247
|
},
|
|
@@ -1520,6 +1533,11 @@ function Blocks(props) {
|
|
|
1520
1533
|
}
|
|
1521
1534
|
var blocks_default = Blocks;
|
|
1522
1535
|
|
|
1536
|
+
// src/blocks/columns/helpers.ts
|
|
1537
|
+
var getColumnsClass = (id) => {
|
|
1538
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1523
1541
|
// src/blocks/columns/columns.tsx
|
|
1524
1542
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1525
1543
|
function Columns(props) {
|
|
@@ -1527,6 +1545,9 @@ function Columns(props) {
|
|
|
1527
1545
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
1528
1546
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
1529
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
|
+
}
|
|
1530
1551
|
function getWidth(index) {
|
|
1531
1552
|
return cols()[index]?.width || 100 / cols().length;
|
|
1532
1553
|
}
|
|
@@ -1546,7 +1567,7 @@ function Columns(props) {
|
|
|
1546
1567
|
}) {
|
|
1547
1568
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1548
1569
|
}
|
|
1549
|
-
|
|
1570
|
+
function columnsCssVars() {
|
|
1550
1571
|
return {
|
|
1551
1572
|
"--flex-dir": flexDir(),
|
|
1552
1573
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -1554,7 +1575,7 @@ function Columns(props) {
|
|
|
1554
1575
|
desktopStyle: "row"
|
|
1555
1576
|
})
|
|
1556
1577
|
};
|
|
1557
|
-
}
|
|
1578
|
+
}
|
|
1558
1579
|
function columnCssVars(index) {
|
|
1559
1580
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
1560
1581
|
const width = getColumnCssWidth(index);
|
|
@@ -1593,7 +1614,7 @@ function Columns(props) {
|
|
|
1593
1614
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
1594
1615
|
return breakpointSizes[size].max;
|
|
1595
1616
|
}
|
|
1596
|
-
|
|
1617
|
+
function columnsStyles() {
|
|
1597
1618
|
return `
|
|
1598
1619
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1599
1620
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1619,12 +1640,22 @@ function Columns(props) {
|
|
|
1619
1640
|
}
|
|
1620
1641
|
},
|
|
1621
1642
|
`;
|
|
1622
|
-
}
|
|
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
|
+
}
|
|
1623
1654
|
return (() => {
|
|
1624
1655
|
const _el$ = _tmpl$2();
|
|
1625
1656
|
spread(_el$, mergeProps({
|
|
1626
1657
|
get ["class"]() {
|
|
1627
|
-
return
|
|
1658
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
1628
1659
|
display: "flex",
|
|
1629
1660
|
lineHeight: "normal"
|
|
1630
1661
|
});
|
|
@@ -1653,18 +1684,11 @@ function Columns(props) {
|
|
|
1653
1684
|
return createComponent(dynamic_renderer_default, {
|
|
1654
1685
|
key: index,
|
|
1655
1686
|
get TagName() {
|
|
1656
|
-
return column
|
|
1687
|
+
return getTagName(column);
|
|
1657
1688
|
},
|
|
1658
1689
|
actionAttributes: {},
|
|
1659
1690
|
get attributes() {
|
|
1660
|
-
return
|
|
1661
|
-
...{},
|
|
1662
|
-
...column.link ? {
|
|
1663
|
-
href: column.link
|
|
1664
|
-
} : {},
|
|
1665
|
-
[getClassPropName()]: "builder-column",
|
|
1666
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1667
|
-
};
|
|
1691
|
+
return getAttributes(column, index);
|
|
1668
1692
|
},
|
|
1669
1693
|
get children() {
|
|
1670
1694
|
return createComponent(blocks_default, {
|
|
@@ -1862,7 +1886,7 @@ function Image(props) {
|
|
|
1862
1886
|
}
|
|
1863
1887
|
}), createComponent(Show, {
|
|
1864
1888
|
get when() {
|
|
1865
|
-
return !props.fitContent && props.children;
|
|
1889
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
1866
1890
|
},
|
|
1867
1891
|
get children() {
|
|
1868
1892
|
const _el$5 = _tmpl$32();
|
|
@@ -2606,8 +2630,246 @@ var componentInfo7 = {
|
|
|
2606
2630
|
}]
|
|
2607
2631
|
};
|
|
2608
2632
|
|
|
2609
|
-
// 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
|
+
};
|
|
2610
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 = {
|
|
2611
2873
|
name: "Text",
|
|
2612
2874
|
static: true,
|
|
2613
2875
|
isRSC: true,
|
|
@@ -2626,10 +2888,10 @@ var componentInfo8 = {
|
|
|
2626
2888
|
textAlign: "center"
|
|
2627
2889
|
}
|
|
2628
2890
|
};
|
|
2629
|
-
var _tmpl$
|
|
2891
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2630
2892
|
function Text(props) {
|
|
2631
2893
|
return (() => {
|
|
2632
|
-
const _el$ = _tmpl$
|
|
2894
|
+
const _el$ = _tmpl$8();
|
|
2633
2895
|
_el$.style.setProperty("outline", "none");
|
|
2634
2896
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2635
2897
|
return _el$;
|
|
@@ -2638,7 +2900,7 @@ function Text(props) {
|
|
|
2638
2900
|
var text_default = Text;
|
|
2639
2901
|
|
|
2640
2902
|
// src/blocks/custom-code/component-info.ts
|
|
2641
|
-
var
|
|
2903
|
+
var componentInfo10 = {
|
|
2642
2904
|
name: "Custom Code",
|
|
2643
2905
|
static: true,
|
|
2644
2906
|
requiredPermissions: ["editCode"],
|
|
@@ -2661,7 +2923,7 @@ var componentInfo9 = {
|
|
|
2661
2923
|
advanced: true
|
|
2662
2924
|
}]
|
|
2663
2925
|
};
|
|
2664
|
-
var _tmpl$
|
|
2926
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2665
2927
|
function CustomCode(props) {
|
|
2666
2928
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2667
2929
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2695,7 +2957,7 @@ function CustomCode(props) {
|
|
|
2695
2957
|
}
|
|
2696
2958
|
});
|
|
2697
2959
|
return (() => {
|
|
2698
|
-
const _el$ = _tmpl$
|
|
2960
|
+
const _el$ = _tmpl$9();
|
|
2699
2961
|
const _ref$ = elementRef;
|
|
2700
2962
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2701
2963
|
effect((_p$) => {
|
|
@@ -2713,7 +2975,7 @@ function CustomCode(props) {
|
|
|
2713
2975
|
var custom_code_default = CustomCode;
|
|
2714
2976
|
|
|
2715
2977
|
// src/blocks/embed/component-info.ts
|
|
2716
|
-
var
|
|
2978
|
+
var componentInfo11 = {
|
|
2717
2979
|
name: "Embed",
|
|
2718
2980
|
static: true,
|
|
2719
2981
|
inputs: [{
|
|
@@ -2755,7 +3017,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2755
3017
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2756
3018
|
|
|
2757
3019
|
// src/blocks/embed/embed.tsx
|
|
2758
|
-
var _tmpl$
|
|
3020
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2759
3021
|
function Embed(props) {
|
|
2760
3022
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2761
3023
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2792,7 +3054,7 @@ function Embed(props) {
|
|
|
2792
3054
|
}
|
|
2793
3055
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
2794
3056
|
return (() => {
|
|
2795
|
-
const _el$ = _tmpl$
|
|
3057
|
+
const _el$ = _tmpl$10();
|
|
2796
3058
|
const _ref$ = elem;
|
|
2797
3059
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2798
3060
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2802,7 +3064,7 @@ function Embed(props) {
|
|
|
2802
3064
|
var embed_default = Embed;
|
|
2803
3065
|
|
|
2804
3066
|
// src/blocks/form/form/component-info.ts
|
|
2805
|
-
var
|
|
3067
|
+
var componentInfo12 = {
|
|
2806
3068
|
name: "Form:Form",
|
|
2807
3069
|
// editableTags: ['builder-form-error']
|
|
2808
3070
|
defaults: {
|
|
@@ -3049,8 +3311,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3049
3311
|
};
|
|
3050
3312
|
|
|
3051
3313
|
// src/blocks/form/form/form.tsx
|
|
3052
|
-
var _tmpl$
|
|
3053
|
-
var _tmpl$
|
|
3314
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
3315
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
3054
3316
|
function FormComponent(props) {
|
|
3055
3317
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3056
3318
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3236,7 +3498,7 @@ function FormComponent(props) {
|
|
|
3236
3498
|
}
|
|
3237
3499
|
let formRef;
|
|
3238
3500
|
return (() => {
|
|
3239
|
-
const _el$ = _tmpl$
|
|
3501
|
+
const _el$ = _tmpl$24();
|
|
3240
3502
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3241
3503
|
const _ref$ = formRef;
|
|
3242
3504
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3319,7 +3581,7 @@ function FormComponent(props) {
|
|
|
3319
3581
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3320
3582
|
},
|
|
3321
3583
|
get children() {
|
|
3322
|
-
const _el$2 = _tmpl$
|
|
3584
|
+
const _el$2 = _tmpl$11();
|
|
3323
3585
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3324
3586
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3325
3587
|
padding: "10px",
|
|
@@ -3351,7 +3613,7 @@ function FormComponent(props) {
|
|
|
3351
3613
|
var form_default = FormComponent;
|
|
3352
3614
|
|
|
3353
3615
|
// src/blocks/form/input/component-info.ts
|
|
3354
|
-
var
|
|
3616
|
+
var componentInfo13 = {
|
|
3355
3617
|
name: "Form:Input",
|
|
3356
3618
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3357
3619
|
inputs: [
|
|
@@ -3403,10 +3665,10 @@ var componentInfo12 = {
|
|
|
3403
3665
|
borderColor: "#ccc"
|
|
3404
3666
|
}
|
|
3405
3667
|
};
|
|
3406
|
-
var _tmpl$
|
|
3668
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
3407
3669
|
function FormInputComponent(props) {
|
|
3408
3670
|
return (() => {
|
|
3409
|
-
const _el$ = _tmpl$
|
|
3671
|
+
const _el$ = _tmpl$12();
|
|
3410
3672
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3411
3673
|
get key() {
|
|
3412
3674
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3436,7 +3698,7 @@ function FormInputComponent(props) {
|
|
|
3436
3698
|
var input_default = FormInputComponent;
|
|
3437
3699
|
|
|
3438
3700
|
// src/blocks/form/select/component-info.ts
|
|
3439
|
-
var
|
|
3701
|
+
var componentInfo14 = {
|
|
3440
3702
|
name: "Form:Select",
|
|
3441
3703
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3442
3704
|
defaultStyles: {
|
|
@@ -3479,11 +3741,11 @@ var componentInfo13 = {
|
|
|
3479
3741
|
static: true,
|
|
3480
3742
|
noWrap: true
|
|
3481
3743
|
};
|
|
3482
|
-
var _tmpl$
|
|
3483
|
-
var _tmpl$
|
|
3744
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
3745
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
3484
3746
|
function SelectComponent(props) {
|
|
3485
3747
|
return (() => {
|
|
3486
|
-
const _el$ = _tmpl$
|
|
3748
|
+
const _el$ = _tmpl$13();
|
|
3487
3749
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3488
3750
|
get value() {
|
|
3489
3751
|
return props.value;
|
|
@@ -3505,7 +3767,7 @@ function SelectComponent(props) {
|
|
|
3505
3767
|
children: (option, _index) => {
|
|
3506
3768
|
const index = _index();
|
|
3507
3769
|
return (() => {
|
|
3508
|
-
const _el$2 = _tmpl$
|
|
3770
|
+
const _el$2 = _tmpl$25();
|
|
3509
3771
|
insert(_el$2, () => option.name || option.value);
|
|
3510
3772
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3511
3773
|
effect(() => _el$2.value = option.value);
|
|
@@ -3519,7 +3781,7 @@ function SelectComponent(props) {
|
|
|
3519
3781
|
var select_default = SelectComponent;
|
|
3520
3782
|
|
|
3521
3783
|
// src/blocks/form/submit-button/component-info.ts
|
|
3522
|
-
var
|
|
3784
|
+
var componentInfo15 = {
|
|
3523
3785
|
name: "Form:SubmitButton",
|
|
3524
3786
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3525
3787
|
defaultStyles: {
|
|
@@ -3545,10 +3807,10 @@ var componentInfo14 = {
|
|
|
3545
3807
|
// TODO: defaultChildren
|
|
3546
3808
|
// canHaveChildren: true,
|
|
3547
3809
|
};
|
|
3548
|
-
var _tmpl$
|
|
3810
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3549
3811
|
function SubmitButton(props) {
|
|
3550
3812
|
return (() => {
|
|
3551
|
-
const _el$ = _tmpl$
|
|
3813
|
+
const _el$ = _tmpl$14();
|
|
3552
3814
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3553
3815
|
insert(_el$, () => props.text);
|
|
3554
3816
|
return _el$;
|
|
@@ -3557,7 +3819,7 @@ function SubmitButton(props) {
|
|
|
3557
3819
|
var submit_button_default = SubmitButton;
|
|
3558
3820
|
|
|
3559
3821
|
// src/blocks/img/component-info.ts
|
|
3560
|
-
var
|
|
3822
|
+
var componentInfo16 = {
|
|
3561
3823
|
// friendlyName?
|
|
3562
3824
|
name: "Raw:Img",
|
|
3563
3825
|
hideFromInsertMenu: true,
|
|
@@ -3572,10 +3834,10 @@ var componentInfo15 = {
|
|
|
3572
3834
|
noWrap: true,
|
|
3573
3835
|
static: true
|
|
3574
3836
|
};
|
|
3575
|
-
var _tmpl$
|
|
3837
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
3576
3838
|
function ImgComponent(props) {
|
|
3577
3839
|
return (() => {
|
|
3578
|
-
const _el$ = _tmpl$
|
|
3840
|
+
const _el$ = _tmpl$15();
|
|
3579
3841
|
spread(_el$, mergeProps({
|
|
3580
3842
|
get style() {
|
|
3581
3843
|
return {
|
|
@@ -3599,7 +3861,7 @@ function ImgComponent(props) {
|
|
|
3599
3861
|
var img_default = ImgComponent;
|
|
3600
3862
|
|
|
3601
3863
|
// src/blocks/video/component-info.ts
|
|
3602
|
-
var
|
|
3864
|
+
var componentInfo17 = {
|
|
3603
3865
|
name: "Video",
|
|
3604
3866
|
canHaveChildren: true,
|
|
3605
3867
|
defaultStyles: {
|
|
@@ -3681,9 +3943,9 @@ var componentInfo16 = {
|
|
|
3681
3943
|
advanced: true
|
|
3682
3944
|
}]
|
|
3683
3945
|
};
|
|
3684
|
-
var _tmpl$
|
|
3685
|
-
var _tmpl$
|
|
3686
|
-
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>`);
|
|
3687
3949
|
function Video(props) {
|
|
3688
3950
|
const videoProps = createMemo(() => {
|
|
3689
3951
|
return {
|
|
@@ -3710,7 +3972,7 @@ function Video(props) {
|
|
|
3710
3972
|
};
|
|
3711
3973
|
});
|
|
3712
3974
|
return (() => {
|
|
3713
|
-
const _el$ = _tmpl$
|
|
3975
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
3714
3976
|
_el$.style.setProperty("position", "relative");
|
|
3715
3977
|
spread(_el$2, mergeProps(spreadProps, {
|
|
3716
3978
|
get preload() {
|
|
@@ -3744,7 +4006,7 @@ function Video(props) {
|
|
|
3744
4006
|
return !props.lazyLoad;
|
|
3745
4007
|
},
|
|
3746
4008
|
get children() {
|
|
3747
|
-
const _el$3 = _tmpl$
|
|
4009
|
+
const _el$3 = _tmpl$16();
|
|
3748
4010
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
3749
4011
|
return _el$3;
|
|
3750
4012
|
}
|
|
@@ -3754,7 +4016,7 @@ function Video(props) {
|
|
|
3754
4016
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
3755
4017
|
},
|
|
3756
4018
|
get children() {
|
|
3757
|
-
const _el$4 = _tmpl$
|
|
4019
|
+
const _el$4 = _tmpl$26();
|
|
3758
4020
|
_el$4.style.setProperty("width", "100%");
|
|
3759
4021
|
_el$4.style.setProperty("pointer-events", "none");
|
|
3760
4022
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -3767,7 +4029,7 @@ function Video(props) {
|
|
|
3767
4029
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
3768
4030
|
},
|
|
3769
4031
|
get children() {
|
|
3770
|
-
const _el$5 = _tmpl$
|
|
4032
|
+
const _el$5 = _tmpl$26();
|
|
3771
4033
|
_el$5.style.setProperty("display", "flex");
|
|
3772
4034
|
_el$5.style.setProperty("flex-direction", "column");
|
|
3773
4035
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -3780,7 +4042,7 @@ function Video(props) {
|
|
|
3780
4042
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
3781
4043
|
},
|
|
3782
4044
|
get children() {
|
|
3783
|
-
const _el$6 = _tmpl$
|
|
4045
|
+
const _el$6 = _tmpl$26();
|
|
3784
4046
|
_el$6.style.setProperty("pointer-events", "none");
|
|
3785
4047
|
_el$6.style.setProperty("display", "flex");
|
|
3786
4048
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -3802,28 +4064,28 @@ var video_default = Video;
|
|
|
3802
4064
|
// src/constants/extra-components.ts
|
|
3803
4065
|
var getExtraComponents = () => [{
|
|
3804
4066
|
component: custom_code_default,
|
|
3805
|
-
...
|
|
4067
|
+
...componentInfo10
|
|
3806
4068
|
}, {
|
|
3807
4069
|
component: embed_default,
|
|
3808
|
-
...
|
|
4070
|
+
...componentInfo11
|
|
3809
4071
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3810
4072
|
component: form_default,
|
|
3811
|
-
...
|
|
4073
|
+
...componentInfo12
|
|
3812
4074
|
}, {
|
|
3813
4075
|
component: input_default,
|
|
3814
|
-
...
|
|
4076
|
+
...componentInfo13
|
|
3815
4077
|
}, {
|
|
3816
4078
|
component: submit_button_default,
|
|
3817
|
-
...
|
|
4079
|
+
...componentInfo15
|
|
3818
4080
|
}, {
|
|
3819
4081
|
component: select_default,
|
|
3820
|
-
...
|
|
4082
|
+
...componentInfo14
|
|
3821
4083
|
}], {
|
|
3822
4084
|
component: img_default,
|
|
3823
|
-
...
|
|
4085
|
+
...componentInfo16
|
|
3824
4086
|
}, {
|
|
3825
4087
|
component: video_default,
|
|
3826
|
-
...
|
|
4088
|
+
...componentInfo17
|
|
3827
4089
|
}];
|
|
3828
4090
|
|
|
3829
4091
|
// src/constants/builder-registered-components.ts
|
|
@@ -3850,8 +4112,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3850
4112
|
...componentInfo7
|
|
3851
4113
|
}, {
|
|
3852
4114
|
component: text_default,
|
|
4115
|
+
...componentInfo9
|
|
4116
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
4117
|
+
component: tabs_default,
|
|
3853
4118
|
...componentInfo8
|
|
3854
|
-
}, ...getExtraComponents()];
|
|
4119
|
+
}], ...getExtraComponents()];
|
|
3855
4120
|
|
|
3856
4121
|
// src/functions/register-component.ts
|
|
3857
4122
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -3920,10 +4185,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
3920
4185
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
3921
4186
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
3922
4187
|
)`;
|
|
3923
|
-
var _tmpl$
|
|
4188
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
3924
4189
|
function InlinedScript(props) {
|
|
3925
4190
|
return (() => {
|
|
3926
|
-
const _el$ = _tmpl$
|
|
4191
|
+
const _el$ = _tmpl$17();
|
|
3927
4192
|
effect((_p$) => {
|
|
3928
4193
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
3929
4194
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4417,7 +4682,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4417
4682
|
}
|
|
4418
4683
|
|
|
4419
4684
|
// src/constants/sdk-version.ts
|
|
4420
|
-
var SDK_VERSION = "1.0.
|
|
4685
|
+
var SDK_VERSION = "1.0.24";
|
|
4421
4686
|
|
|
4422
4687
|
// src/functions/register.ts
|
|
4423
4688
|
var registry = {};
|
|
@@ -4613,6 +4878,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4613
4878
|
};
|
|
4614
4879
|
};
|
|
4615
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
|
+
|
|
4616
4960
|
// src/components/content/components/enable-editor.tsx
|
|
4617
4961
|
function EnableEditor(props) {
|
|
4618
4962
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -4652,6 +4996,12 @@ function EnableEditor(props) {
|
|
|
4652
4996
|
content: newContentValue
|
|
4653
4997
|
}));
|
|
4654
4998
|
}
|
|
4999
|
+
const showContentProps = createMemo(() => {
|
|
5000
|
+
return props.showContent ? {} : {
|
|
5001
|
+
hidden: true,
|
|
5002
|
+
"aria-hidden": true
|
|
5003
|
+
};
|
|
5004
|
+
});
|
|
4655
5005
|
function processMessage(event) {
|
|
4656
5006
|
return createEditorListener({
|
|
4657
5007
|
model: props.model,
|
|
@@ -4870,7 +5220,7 @@ function EnableEditor(props) {
|
|
|
4870
5220
|
get children() {
|
|
4871
5221
|
return createComponent(Dynamic, mergeProps({
|
|
4872
5222
|
get ["class"]() {
|
|
4873
|
-
return
|
|
5223
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
4874
5224
|
}
|
|
4875
5225
|
}, {}, {
|
|
4876
5226
|
ref(r$) {
|
|
@@ -4884,10 +5234,7 @@ function EnableEditor(props) {
|
|
|
4884
5234
|
get ["builder-model"]() {
|
|
4885
5235
|
return props.model;
|
|
4886
5236
|
}
|
|
4887
|
-
}, {}, () => props.
|
|
4888
|
-
hidden: true,
|
|
4889
|
-
"aria-hidden": true
|
|
4890
|
-
}, () => props.contentWrapperProps, {
|
|
5237
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
4891
5238
|
get component() {
|
|
4892
5239
|
return ContentWrapper();
|
|
4893
5240
|
},
|
|
@@ -4901,84 +5248,6 @@ function EnableEditor(props) {
|
|
|
4901
5248
|
});
|
|
4902
5249
|
}
|
|
4903
5250
|
var enable_editor_default = EnableEditor;
|
|
4904
|
-
|
|
4905
|
-
// src/components/content/components/styles.helpers.ts
|
|
4906
|
-
var getCssFromFont = (font) => {
|
|
4907
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
4908
|
-
const name = family.split(",")[0];
|
|
4909
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
4910
|
-
let str = "";
|
|
4911
|
-
if (url && family && name) {
|
|
4912
|
-
str += `
|
|
4913
|
-
@font-face {
|
|
4914
|
-
font-family: "${family}";
|
|
4915
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
4916
|
-
font-display: fallback;
|
|
4917
|
-
font-weight: 400;
|
|
4918
|
-
}
|
|
4919
|
-
`.trim();
|
|
4920
|
-
}
|
|
4921
|
-
if (font.files) {
|
|
4922
|
-
for (const weight in font.files) {
|
|
4923
|
-
const isNumber = String(Number(weight)) === weight;
|
|
4924
|
-
if (!isNumber) {
|
|
4925
|
-
continue;
|
|
4926
|
-
}
|
|
4927
|
-
const weightUrl = font.files[weight];
|
|
4928
|
-
if (weightUrl && weightUrl !== url) {
|
|
4929
|
-
str += `
|
|
4930
|
-
@font-face {
|
|
4931
|
-
font-family: "${family}";
|
|
4932
|
-
src: url('${weightUrl}') format('woff2');
|
|
4933
|
-
font-display: fallback;
|
|
4934
|
-
font-weight: ${weight};
|
|
4935
|
-
}
|
|
4936
|
-
`.trim();
|
|
4937
|
-
}
|
|
4938
|
-
}
|
|
4939
|
-
}
|
|
4940
|
-
return str;
|
|
4941
|
-
};
|
|
4942
|
-
var getFontCss = ({
|
|
4943
|
-
customFonts
|
|
4944
|
-
}) => {
|
|
4945
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
4946
|
-
};
|
|
4947
|
-
var getCss = ({
|
|
4948
|
-
cssCode,
|
|
4949
|
-
contentId
|
|
4950
|
-
}) => {
|
|
4951
|
-
if (!cssCode) {
|
|
4952
|
-
return "";
|
|
4953
|
-
}
|
|
4954
|
-
if (!contentId) {
|
|
4955
|
-
return cssCode;
|
|
4956
|
-
}
|
|
4957
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4958
|
-
};
|
|
4959
|
-
var DEFAULT_STYLES = `
|
|
4960
|
-
.builder-button {
|
|
4961
|
-
all: unset;
|
|
4962
|
-
}
|
|
4963
|
-
|
|
4964
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
4965
|
-
margin: 0;
|
|
4966
|
-
}
|
|
4967
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
4968
|
-
color: inherit;
|
|
4969
|
-
line-height: inherit;
|
|
4970
|
-
letter-spacing: inherit;
|
|
4971
|
-
font-weight: inherit;
|
|
4972
|
-
font-size: inherit;
|
|
4973
|
-
text-align: inherit;
|
|
4974
|
-
font-family: inherit;
|
|
4975
|
-
}
|
|
4976
|
-
`;
|
|
4977
|
-
var getDefaultStyles = (isNested) => {
|
|
4978
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
4979
|
-
};
|
|
4980
|
-
|
|
4981
|
-
// src/components/content/components/styles.tsx
|
|
4982
5251
|
function ContentStyles(props) {
|
|
4983
5252
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
4984
5253
|
${getCss({
|
|
@@ -5397,9 +5666,15 @@ var fetchSymbolContent = async ({
|
|
|
5397
5666
|
};
|
|
5398
5667
|
|
|
5399
5668
|
// src/blocks/symbol/symbol.tsx
|
|
5400
|
-
var _tmpl$
|
|
5669
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
5401
5670
|
function Symbol(props) {
|
|
5402
5671
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5672
|
+
const blocksWrapper = createMemo(() => {
|
|
5673
|
+
return "div";
|
|
5674
|
+
});
|
|
5675
|
+
const contentWrapper = createMemo(() => {
|
|
5676
|
+
return "div";
|
|
5677
|
+
});
|
|
5403
5678
|
const className = createMemo(() => {
|
|
5404
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(" ");
|
|
5405
5680
|
});
|
|
@@ -5423,7 +5698,7 @@ function Symbol(props) {
|
|
|
5423
5698
|
}
|
|
5424
5699
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5425
5700
|
return (() => {
|
|
5426
|
-
const _el$ = _tmpl$
|
|
5701
|
+
const _el$ = _tmpl$18();
|
|
5427
5702
|
spread(_el$, mergeProps({
|
|
5428
5703
|
get ["class"]() {
|
|
5429
5704
|
return className();
|
|
@@ -5462,8 +5737,12 @@ function Symbol(props) {
|
|
|
5462
5737
|
get linkComponent() {
|
|
5463
5738
|
return props.builderLinkComponent;
|
|
5464
5739
|
},
|
|
5465
|
-
blocksWrapper
|
|
5466
|
-
|
|
5740
|
+
get blocksWrapper() {
|
|
5741
|
+
return blocksWrapper();
|
|
5742
|
+
},
|
|
5743
|
+
get contentWrapper() {
|
|
5744
|
+
return contentWrapper();
|
|
5745
|
+
}
|
|
5467
5746
|
}));
|
|
5468
5747
|
return _el$;
|
|
5469
5748
|
})();
|