@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/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";
|
|
@@ -369,7 +373,6 @@ function evaluate({
|
|
|
369
373
|
enableCache
|
|
370
374
|
}) {
|
|
371
375
|
if (code === "") {
|
|
372
|
-
logger.warn("Skipping evaluation of empty code block.");
|
|
373
376
|
return void 0;
|
|
374
377
|
}
|
|
375
378
|
const args = {
|
|
@@ -711,6 +714,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
711
714
|
case "svelte":
|
|
712
715
|
case "vue":
|
|
713
716
|
case "solid":
|
|
717
|
+
case "angular":
|
|
714
718
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
715
719
|
case "qwik":
|
|
716
720
|
case "reactNative":
|
|
@@ -786,6 +790,12 @@ var getRepeatItemData = ({
|
|
|
786
790
|
}));
|
|
787
791
|
return repeatArray;
|
|
788
792
|
};
|
|
793
|
+
var shouldPassLinkComponent = (blockName) => {
|
|
794
|
+
return blockName && ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
795
|
+
};
|
|
796
|
+
var shouldPassRegisteredComponents = (blockName) => {
|
|
797
|
+
return blockName && ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(blockName);
|
|
798
|
+
};
|
|
789
799
|
|
|
790
800
|
// src/constants/device-sizes.ts
|
|
791
801
|
var SIZES = {
|
|
@@ -1042,21 +1052,24 @@ function BlockWrapper(props) {
|
|
|
1042
1052
|
}
|
|
1043
1053
|
var block_wrapper_default = BlockWrapper;
|
|
1044
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
|
+
});
|
|
1045
1070
|
return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
|
|
1046
1071
|
get attributes() {
|
|
1047
|
-
return
|
|
1048
|
-
...getBlockProperties({
|
|
1049
|
-
block: props.block,
|
|
1050
|
-
context: props.context
|
|
1051
|
-
}),
|
|
1052
|
-
...getBlockActions({
|
|
1053
|
-
block: props.block,
|
|
1054
|
-
rootState: props.context.rootState,
|
|
1055
|
-
rootSetState: props.context.rootSetState,
|
|
1056
|
-
localState: props.context.localState,
|
|
1057
|
-
context: props.context.context
|
|
1058
|
-
})
|
|
1059
|
-
} : {};
|
|
1072
|
+
return attributes();
|
|
1060
1073
|
},
|
|
1061
1074
|
get component() {
|
|
1062
1075
|
return props.Wrapper;
|
|
@@ -1231,10 +1244,10 @@ function Block(props) {
|
|
|
1231
1244
|
componentOptions: {
|
|
1232
1245
|
...getBlockComponentOptions(processedBlock()),
|
|
1233
1246
|
builderContext: props.context,
|
|
1234
|
-
...
|
|
1247
|
+
...shouldPassLinkComponent(blockComponent()?.name) ? {
|
|
1235
1248
|
builderLinkComponent: props.linkComponent
|
|
1236
1249
|
} : {},
|
|
1237
|
-
...
|
|
1250
|
+
...shouldPassRegisteredComponents(blockComponent()?.name) ? {
|
|
1238
1251
|
builderComponents: props.registeredComponents
|
|
1239
1252
|
} : {}
|
|
1240
1253
|
},
|
|
@@ -1526,6 +1539,11 @@ function Blocks(props) {
|
|
|
1526
1539
|
}
|
|
1527
1540
|
var blocks_default = Blocks;
|
|
1528
1541
|
|
|
1542
|
+
// src/blocks/columns/helpers.ts
|
|
1543
|
+
var getColumnsClass = (id) => {
|
|
1544
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1545
|
+
};
|
|
1546
|
+
|
|
1529
1547
|
// src/blocks/columns/columns.tsx
|
|
1530
1548
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
1531
1549
|
function Columns(props) {
|
|
@@ -1533,6 +1551,9 @@ function Columns(props) {
|
|
|
1533
1551
|
const [cols, setCols] = createSignal(props.columns || []);
|
|
1534
1552
|
const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
|
|
1535
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
|
+
}
|
|
1536
1557
|
function getWidth(index) {
|
|
1537
1558
|
return cols()[index]?.width || 100 / cols().length;
|
|
1538
1559
|
}
|
|
@@ -1552,7 +1573,7 @@ function Columns(props) {
|
|
|
1552
1573
|
}) {
|
|
1553
1574
|
return stackAt() === "never" ? desktopStyle : stackedStyle;
|
|
1554
1575
|
}
|
|
1555
|
-
|
|
1576
|
+
function columnsCssVars() {
|
|
1556
1577
|
return {
|
|
1557
1578
|
"--flex-dir": flexDir(),
|
|
1558
1579
|
"--flex-dir-tablet": getTabletStyle({
|
|
@@ -1560,7 +1581,7 @@ function Columns(props) {
|
|
|
1560
1581
|
desktopStyle: "row"
|
|
1561
1582
|
})
|
|
1562
1583
|
};
|
|
1563
|
-
}
|
|
1584
|
+
}
|
|
1564
1585
|
function columnCssVars(index) {
|
|
1565
1586
|
const gutter = index === 0 ? 0 : gutterSize();
|
|
1566
1587
|
const width = getColumnCssWidth(index);
|
|
@@ -1599,7 +1620,7 @@ function Columns(props) {
|
|
|
1599
1620
|
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
1600
1621
|
return breakpointSizes[size].max;
|
|
1601
1622
|
}
|
|
1602
|
-
|
|
1623
|
+
function columnsStyles() {
|
|
1603
1624
|
return `
|
|
1604
1625
|
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
1605
1626
|
.${props.builderBlock.id}-breakpoints {
|
|
@@ -1625,12 +1646,22 @@ function Columns(props) {
|
|
|
1625
1646
|
}
|
|
1626
1647
|
},
|
|
1627
1648
|
`;
|
|
1628
|
-
}
|
|
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
|
+
}
|
|
1629
1660
|
return (() => {
|
|
1630
1661
|
const _el$ = _tmpl$2();
|
|
1631
1662
|
spread(_el$, mergeProps({
|
|
1632
1663
|
get ["class"]() {
|
|
1633
|
-
return
|
|
1664
|
+
return getColumnsClass(props.builderBlock?.id) + " " + css({
|
|
1634
1665
|
display: "flex",
|
|
1635
1666
|
lineHeight: "normal"
|
|
1636
1667
|
});
|
|
@@ -1659,18 +1690,11 @@ function Columns(props) {
|
|
|
1659
1690
|
return createComponent(dynamic_renderer_default, {
|
|
1660
1691
|
key: index,
|
|
1661
1692
|
get TagName() {
|
|
1662
|
-
return column
|
|
1693
|
+
return getTagName(column);
|
|
1663
1694
|
},
|
|
1664
1695
|
actionAttributes: {},
|
|
1665
1696
|
get attributes() {
|
|
1666
|
-
return
|
|
1667
|
-
...{},
|
|
1668
|
-
...column.link ? {
|
|
1669
|
-
href: column.link
|
|
1670
|
-
} : {},
|
|
1671
|
-
[getClassPropName()]: "builder-column",
|
|
1672
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(index))
|
|
1673
|
-
};
|
|
1697
|
+
return getAttributes(column, index);
|
|
1674
1698
|
},
|
|
1675
1699
|
get children() {
|
|
1676
1700
|
return createComponent(blocks_default, {
|
|
@@ -1869,7 +1893,7 @@ function Image(props) {
|
|
|
1869
1893
|
}
|
|
1870
1894
|
}), createComponent(Show, {
|
|
1871
1895
|
get when() {
|
|
1872
|
-
return !props.fitContent && props.children;
|
|
1896
|
+
return !props.fitContent && props.builderBlock?.children?.length;
|
|
1873
1897
|
},
|
|
1874
1898
|
get children() {
|
|
1875
1899
|
const _el$5 = _tmpl$32();
|
|
@@ -2614,8 +2638,246 @@ var componentInfo7 = {
|
|
|
2614
2638
|
}]
|
|
2615
2639
|
};
|
|
2616
2640
|
|
|
2617
|
-
// 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
|
+
};
|
|
2618
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 = {
|
|
2619
2881
|
name: "Text",
|
|
2620
2882
|
static: true,
|
|
2621
2883
|
isRSC: true,
|
|
@@ -2634,10 +2896,10 @@ var componentInfo8 = {
|
|
|
2634
2896
|
textAlign: "center"
|
|
2635
2897
|
}
|
|
2636
2898
|
};
|
|
2637
|
-
var _tmpl$
|
|
2899
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
|
|
2638
2900
|
function Text(props) {
|
|
2639
2901
|
return (() => {
|
|
2640
|
-
const _el$ = _tmpl$
|
|
2902
|
+
const _el$ = _tmpl$8();
|
|
2641
2903
|
_el$.style.setProperty("outline", "none");
|
|
2642
2904
|
effect(() => _el$.innerHTML = props.text?.toString() || "");
|
|
2643
2905
|
return _el$;
|
|
@@ -2646,7 +2908,7 @@ function Text(props) {
|
|
|
2646
2908
|
var text_default = Text;
|
|
2647
2909
|
|
|
2648
2910
|
// src/blocks/custom-code/component-info.ts
|
|
2649
|
-
var
|
|
2911
|
+
var componentInfo10 = {
|
|
2650
2912
|
name: "Custom Code",
|
|
2651
2913
|
static: true,
|
|
2652
2914
|
requiredPermissions: ["editCode"],
|
|
@@ -2669,7 +2931,7 @@ var componentInfo9 = {
|
|
|
2669
2931
|
advanced: true
|
|
2670
2932
|
}]
|
|
2671
2933
|
};
|
|
2672
|
-
var _tmpl$
|
|
2934
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
|
|
2673
2935
|
function CustomCode(props) {
|
|
2674
2936
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2675
2937
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2704,7 +2966,7 @@ function CustomCode(props) {
|
|
|
2704
2966
|
}
|
|
2705
2967
|
});
|
|
2706
2968
|
return (() => {
|
|
2707
|
-
const _el$ = _tmpl$
|
|
2969
|
+
const _el$ = _tmpl$9();
|
|
2708
2970
|
const _ref$ = elementRef;
|
|
2709
2971
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
2710
2972
|
effect((_p$) => {
|
|
@@ -2722,7 +2984,7 @@ function CustomCode(props) {
|
|
|
2722
2984
|
var custom_code_default = CustomCode;
|
|
2723
2985
|
|
|
2724
2986
|
// src/blocks/embed/component-info.ts
|
|
2725
|
-
var
|
|
2987
|
+
var componentInfo11 = {
|
|
2726
2988
|
name: "Embed",
|
|
2727
2989
|
static: true,
|
|
2728
2990
|
inputs: [{
|
|
@@ -2764,7 +3026,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
2764
3026
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2765
3027
|
|
|
2766
3028
|
// src/blocks/embed/embed.tsx
|
|
2767
|
-
var _tmpl$
|
|
3029
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
2768
3030
|
function Embed(props) {
|
|
2769
3031
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
2770
3032
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -2802,7 +3064,7 @@ function Embed(props) {
|
|
|
2802
3064
|
}
|
|
2803
3065
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
2804
3066
|
return (() => {
|
|
2805
|
-
const _el$ = _tmpl$
|
|
3067
|
+
const _el$ = _tmpl$10();
|
|
2806
3068
|
const _ref$ = elem;
|
|
2807
3069
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
2808
3070
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -2812,7 +3074,7 @@ function Embed(props) {
|
|
|
2812
3074
|
var embed_default = Embed;
|
|
2813
3075
|
|
|
2814
3076
|
// src/blocks/form/form/component-info.ts
|
|
2815
|
-
var
|
|
3077
|
+
var componentInfo12 = {
|
|
2816
3078
|
name: "Form:Form",
|
|
2817
3079
|
// editableTags: ['builder-form-error']
|
|
2818
3080
|
defaults: {
|
|
@@ -3059,8 +3321,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3059
3321
|
};
|
|
3060
3322
|
|
|
3061
3323
|
// src/blocks/form/form/form.tsx
|
|
3062
|
-
var _tmpl$
|
|
3063
|
-
var _tmpl$
|
|
3324
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
|
|
3325
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
|
|
3064
3326
|
function FormComponent(props) {
|
|
3065
3327
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3066
3328
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3246,7 +3508,7 @@ function FormComponent(props) {
|
|
|
3246
3508
|
}
|
|
3247
3509
|
let formRef;
|
|
3248
3510
|
return (() => {
|
|
3249
|
-
const _el$ = _tmpl$
|
|
3511
|
+
const _el$ = _tmpl$24();
|
|
3250
3512
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3251
3513
|
const _ref$ = formRef;
|
|
3252
3514
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3329,7 +3591,7 @@ function FormComponent(props) {
|
|
|
3329
3591
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3330
3592
|
},
|
|
3331
3593
|
get children() {
|
|
3332
|
-
const _el$2 = _tmpl$
|
|
3594
|
+
const _el$2 = _tmpl$11();
|
|
3333
3595
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3334
3596
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3335
3597
|
padding: "10px",
|
|
@@ -3361,7 +3623,7 @@ function FormComponent(props) {
|
|
|
3361
3623
|
var form_default = FormComponent;
|
|
3362
3624
|
|
|
3363
3625
|
// src/blocks/form/input/component-info.ts
|
|
3364
|
-
var
|
|
3626
|
+
var componentInfo13 = {
|
|
3365
3627
|
name: "Form:Input",
|
|
3366
3628
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3367
3629
|
inputs: [
|
|
@@ -3413,10 +3675,10 @@ var componentInfo12 = {
|
|
|
3413
3675
|
borderColor: "#ccc"
|
|
3414
3676
|
}
|
|
3415
3677
|
};
|
|
3416
|
-
var _tmpl$
|
|
3678
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
|
|
3417
3679
|
function FormInputComponent(props) {
|
|
3418
3680
|
return (() => {
|
|
3419
|
-
const _el$ = _tmpl$
|
|
3681
|
+
const _el$ = _tmpl$12();
|
|
3420
3682
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3421
3683
|
get key() {
|
|
3422
3684
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3446,7 +3708,7 @@ function FormInputComponent(props) {
|
|
|
3446
3708
|
var input_default = FormInputComponent;
|
|
3447
3709
|
|
|
3448
3710
|
// src/blocks/form/select/component-info.ts
|
|
3449
|
-
var
|
|
3711
|
+
var componentInfo14 = {
|
|
3450
3712
|
name: "Form:Select",
|
|
3451
3713
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3452
3714
|
defaultStyles: {
|
|
@@ -3489,11 +3751,11 @@ var componentInfo13 = {
|
|
|
3489
3751
|
static: true,
|
|
3490
3752
|
noWrap: true
|
|
3491
3753
|
};
|
|
3492
|
-
var _tmpl$
|
|
3493
|
-
var _tmpl$
|
|
3754
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
|
|
3755
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
|
|
3494
3756
|
function SelectComponent(props) {
|
|
3495
3757
|
return (() => {
|
|
3496
|
-
const _el$ = _tmpl$
|
|
3758
|
+
const _el$ = _tmpl$13();
|
|
3497
3759
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3498
3760
|
get value() {
|
|
3499
3761
|
return props.value;
|
|
@@ -3515,7 +3777,7 @@ function SelectComponent(props) {
|
|
|
3515
3777
|
children: (option, _index) => {
|
|
3516
3778
|
const index = _index();
|
|
3517
3779
|
return (() => {
|
|
3518
|
-
const _el$2 = _tmpl$
|
|
3780
|
+
const _el$2 = _tmpl$25();
|
|
3519
3781
|
insert(_el$2, () => option.name || option.value);
|
|
3520
3782
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3521
3783
|
effect(() => _el$2.value = option.value);
|
|
@@ -3529,7 +3791,7 @@ function SelectComponent(props) {
|
|
|
3529
3791
|
var select_default = SelectComponent;
|
|
3530
3792
|
|
|
3531
3793
|
// src/blocks/form/submit-button/component-info.ts
|
|
3532
|
-
var
|
|
3794
|
+
var componentInfo15 = {
|
|
3533
3795
|
name: "Form:SubmitButton",
|
|
3534
3796
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3535
3797
|
defaultStyles: {
|
|
@@ -3555,10 +3817,10 @@ var componentInfo14 = {
|
|
|
3555
3817
|
// TODO: defaultChildren
|
|
3556
3818
|
// canHaveChildren: true,
|
|
3557
3819
|
};
|
|
3558
|
-
var _tmpl$
|
|
3820
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3559
3821
|
function SubmitButton(props) {
|
|
3560
3822
|
return (() => {
|
|
3561
|
-
const _el$ = _tmpl$
|
|
3823
|
+
const _el$ = _tmpl$14();
|
|
3562
3824
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3563
3825
|
insert(_el$, () => props.text);
|
|
3564
3826
|
return _el$;
|
|
@@ -3567,7 +3829,7 @@ function SubmitButton(props) {
|
|
|
3567
3829
|
var submit_button_default = SubmitButton;
|
|
3568
3830
|
|
|
3569
3831
|
// src/blocks/img/component-info.ts
|
|
3570
|
-
var
|
|
3832
|
+
var componentInfo16 = {
|
|
3571
3833
|
// friendlyName?
|
|
3572
3834
|
name: "Raw:Img",
|
|
3573
3835
|
hideFromInsertMenu: true,
|
|
@@ -3582,10 +3844,10 @@ var componentInfo15 = {
|
|
|
3582
3844
|
noWrap: true,
|
|
3583
3845
|
static: true
|
|
3584
3846
|
};
|
|
3585
|
-
var _tmpl$
|
|
3847
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
|
|
3586
3848
|
function ImgComponent(props) {
|
|
3587
3849
|
return (() => {
|
|
3588
|
-
const _el$ = _tmpl$
|
|
3850
|
+
const _el$ = _tmpl$15();
|
|
3589
3851
|
spread(_el$, mergeProps({
|
|
3590
3852
|
get style() {
|
|
3591
3853
|
return {
|
|
@@ -3609,7 +3871,7 @@ function ImgComponent(props) {
|
|
|
3609
3871
|
var img_default = ImgComponent;
|
|
3610
3872
|
|
|
3611
3873
|
// src/blocks/video/component-info.ts
|
|
3612
|
-
var
|
|
3874
|
+
var componentInfo17 = {
|
|
3613
3875
|
name: "Video",
|
|
3614
3876
|
canHaveChildren: true,
|
|
3615
3877
|
defaultStyles: {
|
|
@@ -3691,9 +3953,9 @@ var componentInfo16 = {
|
|
|
3691
3953
|
advanced: true
|
|
3692
3954
|
}]
|
|
3693
3955
|
};
|
|
3694
|
-
var _tmpl$
|
|
3695
|
-
var _tmpl$
|
|
3696
|
-
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>`);
|
|
3697
3959
|
function Video(props) {
|
|
3698
3960
|
const videoProps = createMemo(() => {
|
|
3699
3961
|
return {
|
|
@@ -3720,7 +3982,7 @@ function Video(props) {
|
|
|
3720
3982
|
};
|
|
3721
3983
|
});
|
|
3722
3984
|
return (() => {
|
|
3723
|
-
const _el$ = _tmpl$
|
|
3985
|
+
const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
|
|
3724
3986
|
_el$.style.setProperty("position", "relative");
|
|
3725
3987
|
spread(_el$2, mergeProps(spreadProps, {
|
|
3726
3988
|
get preload() {
|
|
@@ -3754,7 +4016,7 @@ function Video(props) {
|
|
|
3754
4016
|
return !props.lazyLoad;
|
|
3755
4017
|
},
|
|
3756
4018
|
get children() {
|
|
3757
|
-
const _el$3 = _tmpl$
|
|
4019
|
+
const _el$3 = _tmpl$16();
|
|
3758
4020
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
3759
4021
|
return _el$3;
|
|
3760
4022
|
}
|
|
@@ -3764,7 +4026,7 @@ function Video(props) {
|
|
|
3764
4026
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
3765
4027
|
},
|
|
3766
4028
|
get children() {
|
|
3767
|
-
const _el$4 = _tmpl$
|
|
4029
|
+
const _el$4 = _tmpl$26();
|
|
3768
4030
|
_el$4.style.setProperty("width", "100%");
|
|
3769
4031
|
_el$4.style.setProperty("pointer-events", "none");
|
|
3770
4032
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -3777,7 +4039,7 @@ function Video(props) {
|
|
|
3777
4039
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
3778
4040
|
},
|
|
3779
4041
|
get children() {
|
|
3780
|
-
const _el$5 = _tmpl$
|
|
4042
|
+
const _el$5 = _tmpl$26();
|
|
3781
4043
|
_el$5.style.setProperty("display", "flex");
|
|
3782
4044
|
_el$5.style.setProperty("flex-direction", "column");
|
|
3783
4045
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -3790,7 +4052,7 @@ function Video(props) {
|
|
|
3790
4052
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
3791
4053
|
},
|
|
3792
4054
|
get children() {
|
|
3793
|
-
const _el$6 = _tmpl$
|
|
4055
|
+
const _el$6 = _tmpl$26();
|
|
3794
4056
|
_el$6.style.setProperty("pointer-events", "none");
|
|
3795
4057
|
_el$6.style.setProperty("display", "flex");
|
|
3796
4058
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -3812,28 +4074,28 @@ var video_default = Video;
|
|
|
3812
4074
|
// src/constants/extra-components.ts
|
|
3813
4075
|
var getExtraComponents = () => [{
|
|
3814
4076
|
component: custom_code_default,
|
|
3815
|
-
...
|
|
4077
|
+
...componentInfo10
|
|
3816
4078
|
}, {
|
|
3817
4079
|
component: embed_default,
|
|
3818
|
-
...
|
|
4080
|
+
...componentInfo11
|
|
3819
4081
|
}, ...TARGET === "rsc" ? [] : [{
|
|
3820
4082
|
component: form_default,
|
|
3821
|
-
...
|
|
4083
|
+
...componentInfo12
|
|
3822
4084
|
}, {
|
|
3823
4085
|
component: input_default,
|
|
3824
|
-
...
|
|
4086
|
+
...componentInfo13
|
|
3825
4087
|
}, {
|
|
3826
4088
|
component: submit_button_default,
|
|
3827
|
-
...
|
|
4089
|
+
...componentInfo15
|
|
3828
4090
|
}, {
|
|
3829
4091
|
component: select_default,
|
|
3830
|
-
...
|
|
4092
|
+
...componentInfo14
|
|
3831
4093
|
}], {
|
|
3832
4094
|
component: img_default,
|
|
3833
|
-
...
|
|
4095
|
+
...componentInfo16
|
|
3834
4096
|
}, {
|
|
3835
4097
|
component: video_default,
|
|
3836
|
-
...
|
|
4098
|
+
...componentInfo17
|
|
3837
4099
|
}];
|
|
3838
4100
|
|
|
3839
4101
|
// src/constants/builder-registered-components.ts
|
|
@@ -3860,8 +4122,11 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
3860
4122
|
...componentInfo7
|
|
3861
4123
|
}, {
|
|
3862
4124
|
component: text_default,
|
|
4125
|
+
...componentInfo9
|
|
4126
|
+
}, ...TARGET === "rsc" ? [] : [{
|
|
4127
|
+
component: tabs_default,
|
|
3863
4128
|
...componentInfo8
|
|
3864
|
-
}, ...getExtraComponents()];
|
|
4129
|
+
}], ...getExtraComponents()];
|
|
3865
4130
|
|
|
3866
4131
|
// src/functions/register-component.ts
|
|
3867
4132
|
var createRegisterComponentMessage = (info) => ({
|
|
@@ -3930,10 +4195,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
3930
4195
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
3931
4196
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
3932
4197
|
)`;
|
|
3933
|
-
var _tmpl$
|
|
4198
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
|
|
3934
4199
|
function InlinedScript(props) {
|
|
3935
4200
|
return (() => {
|
|
3936
|
-
const _el$ = _tmpl$
|
|
4201
|
+
const _el$ = _tmpl$17();
|
|
3937
4202
|
effect((_p$) => {
|
|
3938
4203
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
3939
4204
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4432,7 +4697,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4432
4697
|
}
|
|
4433
4698
|
|
|
4434
4699
|
// src/constants/sdk-version.ts
|
|
4435
|
-
var SDK_VERSION = "1.0.
|
|
4700
|
+
var SDK_VERSION = "1.0.24";
|
|
4436
4701
|
|
|
4437
4702
|
// src/functions/register.ts
|
|
4438
4703
|
var registry = {};
|
|
@@ -4629,6 +4894,85 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4629
4894
|
};
|
|
4630
4895
|
};
|
|
4631
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
|
+
|
|
4632
4976
|
// src/components/content/components/enable-editor.tsx
|
|
4633
4977
|
function EnableEditor(props) {
|
|
4634
4978
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
@@ -4668,6 +5012,12 @@ function EnableEditor(props) {
|
|
|
4668
5012
|
content: newContentValue
|
|
4669
5013
|
}));
|
|
4670
5014
|
}
|
|
5015
|
+
const showContentProps = createMemo(() => {
|
|
5016
|
+
return props.showContent ? {} : {
|
|
5017
|
+
hidden: true,
|
|
5018
|
+
"aria-hidden": true
|
|
5019
|
+
};
|
|
5020
|
+
});
|
|
4671
5021
|
function processMessage(event) {
|
|
4672
5022
|
return createEditorListener({
|
|
4673
5023
|
model: props.model,
|
|
@@ -4887,7 +5237,7 @@ function EnableEditor(props) {
|
|
|
4887
5237
|
get children() {
|
|
4888
5238
|
return createComponent(Dynamic, mergeProps({
|
|
4889
5239
|
get ["class"]() {
|
|
4890
|
-
return
|
|
5240
|
+
return getWrapperClassName(props.content?.testVariationId || props.content?.id);
|
|
4891
5241
|
}
|
|
4892
5242
|
}, {}, {
|
|
4893
5243
|
ref(r$) {
|
|
@@ -4901,10 +5251,7 @@ function EnableEditor(props) {
|
|
|
4901
5251
|
get ["builder-model"]() {
|
|
4902
5252
|
return props.model;
|
|
4903
5253
|
}
|
|
4904
|
-
}, {}, () => props.
|
|
4905
|
-
hidden: true,
|
|
4906
|
-
"aria-hidden": true
|
|
4907
|
-
}, () => props.contentWrapperProps, {
|
|
5254
|
+
}, {}, showContentProps, () => props.contentWrapperProps, {
|
|
4908
5255
|
get component() {
|
|
4909
5256
|
return ContentWrapper();
|
|
4910
5257
|
},
|
|
@@ -4918,84 +5265,6 @@ function EnableEditor(props) {
|
|
|
4918
5265
|
});
|
|
4919
5266
|
}
|
|
4920
5267
|
var enable_editor_default = EnableEditor;
|
|
4921
|
-
|
|
4922
|
-
// src/components/content/components/styles.helpers.ts
|
|
4923
|
-
var getCssFromFont = (font) => {
|
|
4924
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
4925
|
-
const name = family.split(",")[0];
|
|
4926
|
-
const url = font.fileUrl ?? font?.files?.regular;
|
|
4927
|
-
let str = "";
|
|
4928
|
-
if (url && family && name) {
|
|
4929
|
-
str += `
|
|
4930
|
-
@font-face {
|
|
4931
|
-
font-family: "${family}";
|
|
4932
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
4933
|
-
font-display: fallback;
|
|
4934
|
-
font-weight: 400;
|
|
4935
|
-
}
|
|
4936
|
-
`.trim();
|
|
4937
|
-
}
|
|
4938
|
-
if (font.files) {
|
|
4939
|
-
for (const weight in font.files) {
|
|
4940
|
-
const isNumber = String(Number(weight)) === weight;
|
|
4941
|
-
if (!isNumber) {
|
|
4942
|
-
continue;
|
|
4943
|
-
}
|
|
4944
|
-
const weightUrl = font.files[weight];
|
|
4945
|
-
if (weightUrl && weightUrl !== url) {
|
|
4946
|
-
str += `
|
|
4947
|
-
@font-face {
|
|
4948
|
-
font-family: "${family}";
|
|
4949
|
-
src: url('${weightUrl}') format('woff2');
|
|
4950
|
-
font-display: fallback;
|
|
4951
|
-
font-weight: ${weight};
|
|
4952
|
-
}
|
|
4953
|
-
`.trim();
|
|
4954
|
-
}
|
|
4955
|
-
}
|
|
4956
|
-
}
|
|
4957
|
-
return str;
|
|
4958
|
-
};
|
|
4959
|
-
var getFontCss = ({
|
|
4960
|
-
customFonts
|
|
4961
|
-
}) => {
|
|
4962
|
-
return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
|
|
4963
|
-
};
|
|
4964
|
-
var getCss = ({
|
|
4965
|
-
cssCode,
|
|
4966
|
-
contentId
|
|
4967
|
-
}) => {
|
|
4968
|
-
if (!cssCode) {
|
|
4969
|
-
return "";
|
|
4970
|
-
}
|
|
4971
|
-
if (!contentId) {
|
|
4972
|
-
return cssCode;
|
|
4973
|
-
}
|
|
4974
|
-
return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
|
|
4975
|
-
};
|
|
4976
|
-
var DEFAULT_STYLES = `
|
|
4977
|
-
.builder-button {
|
|
4978
|
-
all: unset;
|
|
4979
|
-
}
|
|
4980
|
-
|
|
4981
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
4982
|
-
margin: 0;
|
|
4983
|
-
}
|
|
4984
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
4985
|
-
color: inherit;
|
|
4986
|
-
line-height: inherit;
|
|
4987
|
-
letter-spacing: inherit;
|
|
4988
|
-
font-weight: inherit;
|
|
4989
|
-
font-size: inherit;
|
|
4990
|
-
text-align: inherit;
|
|
4991
|
-
font-family: inherit;
|
|
4992
|
-
}
|
|
4993
|
-
`;
|
|
4994
|
-
var getDefaultStyles = (isNested) => {
|
|
4995
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
4996
|
-
};
|
|
4997
|
-
|
|
4998
|
-
// src/components/content/components/styles.tsx
|
|
4999
5268
|
function ContentStyles(props) {
|
|
5000
5269
|
const [injectedStyles, setInjectedStyles] = createSignal(`
|
|
5001
5270
|
${getCss({
|
|
@@ -5414,9 +5683,15 @@ var fetchSymbolContent = async ({
|
|
|
5414
5683
|
};
|
|
5415
5684
|
|
|
5416
5685
|
// src/blocks/symbol/symbol.tsx
|
|
5417
|
-
var _tmpl$
|
|
5686
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
|
|
5418
5687
|
function Symbol(props) {
|
|
5419
5688
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5689
|
+
const blocksWrapper = createMemo(() => {
|
|
5690
|
+
return "div";
|
|
5691
|
+
});
|
|
5692
|
+
const contentWrapper = createMemo(() => {
|
|
5693
|
+
return "div";
|
|
5694
|
+
});
|
|
5420
5695
|
const className = createMemo(() => {
|
|
5421
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(" ");
|
|
5422
5697
|
});
|
|
@@ -5440,7 +5715,7 @@ function Symbol(props) {
|
|
|
5440
5715
|
}
|
|
5441
5716
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5442
5717
|
return (() => {
|
|
5443
|
-
const _el$ = _tmpl$
|
|
5718
|
+
const _el$ = _tmpl$18();
|
|
5444
5719
|
spread(_el$, mergeProps({
|
|
5445
5720
|
get ["class"]() {
|
|
5446
5721
|
return className();
|
|
@@ -5479,8 +5754,12 @@ function Symbol(props) {
|
|
|
5479
5754
|
get linkComponent() {
|
|
5480
5755
|
return props.builderLinkComponent;
|
|
5481
5756
|
},
|
|
5482
|
-
blocksWrapper
|
|
5483
|
-
|
|
5757
|
+
get blocksWrapper() {
|
|
5758
|
+
return blocksWrapper();
|
|
5759
|
+
},
|
|
5760
|
+
get contentWrapper() {
|
|
5761
|
+
return contentWrapper();
|
|
5762
|
+
}
|
|
5484
5763
|
}));
|
|
5485
5764
|
return _el$;
|
|
5486
5765
|
})();
|