@builder.io/sdk-qwik 0.14.16 → 0.14.18
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/README.md +11 -157
- package/lib/browser/index.qwik.cjs +585 -246
- package/lib/browser/index.qwik.mjs +585 -246
- package/lib/edge/index.qwik.cjs +585 -246
- package/lib/edge/index.qwik.mjs +585 -246
- package/lib/node/index.qwik.cjs +585 -246
- package/lib/node/index.qwik.mjs +585 -246
- package/package.json +1 -1
- package/types/src/blocks/button/button.d.ts +1 -0
- package/types/src/blocks/columns/columns.d.ts +8 -1
- package/types/src/blocks/columns/columns.types.d.ts +1 -1
- package/types/src/blocks/columns/helpers.d.ts +1 -0
- package/types/src/blocks/symbol/symbol.d.ts +1 -1
- package/types/src/blocks/tabs/component-info.d.ts +2 -0
- package/types/src/blocks/tabs/index.d.ts +1 -0
- package/types/src/blocks/tabs/tabs.d.ts +5 -0
- package/types/src/blocks/tabs/tabs.types.d.ts +13 -0
- package/types/src/blocks/text/text.types.d.ts +2 -1
- package/types/src/components/block/block.helpers.d.ts +2 -0
- package/types/src/components/blocks/blocks-wrapper.d.ts +2 -2
- package/types/src/components/content/components/enable-editor.d.ts +7 -7
- package/types/src/components/content/components/styles.helpers.d.ts +1 -0
- package/types/src/components/dynamic-div.d.ts +14 -0
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/types/targets.d.ts +1 -1
package/lib/node/index.qwik.cjs
CHANGED
|
@@ -53,22 +53,26 @@ const getClassPropName = () => {
|
|
|
53
53
|
case "vue":
|
|
54
54
|
case "solid":
|
|
55
55
|
case "qwik":
|
|
56
|
+
case "angular":
|
|
56
57
|
return "class";
|
|
57
58
|
}
|
|
58
59
|
};
|
|
60
|
+
const attrs = function attrs2(props, state) {
|
|
61
|
+
return {
|
|
62
|
+
...props.attributes,
|
|
63
|
+
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
64
|
+
...props.link ? {
|
|
65
|
+
href: props.link,
|
|
66
|
+
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
67
|
+
role: "link"
|
|
68
|
+
} : {
|
|
69
|
+
role: "button"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
59
73
|
const Button = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
60
74
|
return /* @__PURE__ */ qwik._jsxC(DynamicRenderer, {
|
|
61
|
-
attributes:
|
|
62
|
-
...props.attributes,
|
|
63
|
-
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
64
|
-
...props.link ? {
|
|
65
|
-
href: props.link,
|
|
66
|
-
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
67
|
-
role: "link"
|
|
68
|
-
} : {
|
|
69
|
-
role: "button"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
75
|
+
attributes: attrs(props),
|
|
72
76
|
get TagName() {
|
|
73
77
|
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
74
78
|
},
|
|
@@ -409,10 +413,8 @@ _EvalCache.cacheLimit = 20;
|
|
|
409
413
|
_EvalCache.cache = /* @__PURE__ */ new Map();
|
|
410
414
|
let EvalCache = _EvalCache;
|
|
411
415
|
function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression = true, enableCache }) {
|
|
412
|
-
if (code === "")
|
|
413
|
-
logger.warn("Skipping evaluation of empty code block.");
|
|
416
|
+
if (code === "")
|
|
414
417
|
return void 0;
|
|
415
|
-
}
|
|
416
418
|
const args = {
|
|
417
419
|
code: parseCode(code, {
|
|
418
420
|
isExpression
|
|
@@ -690,6 +692,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
690
692
|
case "svelte":
|
|
691
693
|
case "vue":
|
|
692
694
|
case "solid":
|
|
695
|
+
case "angular":
|
|
693
696
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
694
697
|
case "qwik":
|
|
695
698
|
case "reactNative":
|
|
@@ -750,6 +753,23 @@ const getRepeatItemData = ({ block, context }) => {
|
|
|
750
753
|
}));
|
|
751
754
|
return repeatArray;
|
|
752
755
|
};
|
|
756
|
+
const shouldPassLinkComponent = (blockName) => {
|
|
757
|
+
return blockName && [
|
|
758
|
+
"Core:Button",
|
|
759
|
+
"Symbol",
|
|
760
|
+
"Columns",
|
|
761
|
+
"Form:Form",
|
|
762
|
+
"Builder: Tabs"
|
|
763
|
+
].includes(blockName);
|
|
764
|
+
};
|
|
765
|
+
const shouldPassRegisteredComponents = (blockName) => {
|
|
766
|
+
return blockName && [
|
|
767
|
+
"Symbol",
|
|
768
|
+
"Columns",
|
|
769
|
+
"Form:Form",
|
|
770
|
+
"Builder: Tabs"
|
|
771
|
+
].includes(blockName);
|
|
772
|
+
};
|
|
753
773
|
const SIZES = {
|
|
754
774
|
small: {
|
|
755
775
|
min: 320,
|
|
@@ -993,22 +1013,35 @@ const BlockWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
993
1013
|
}, 1, "87_1");
|
|
994
1014
|
}, "BlockWrapper_component_kOI0j0aW8Nw"));
|
|
995
1015
|
const InteractiveElement = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1016
|
+
const attributes = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1017
|
+
const [props2] = qwik.useLexicalScope();
|
|
1018
|
+
return props2.includeBlockProps ? {
|
|
999
1019
|
...getBlockProperties({
|
|
1000
|
-
block:
|
|
1001
|
-
context:
|
|
1020
|
+
block: props2.block,
|
|
1021
|
+
context: props2.context
|
|
1002
1022
|
}),
|
|
1003
1023
|
...getBlockActions({
|
|
1004
|
-
block:
|
|
1005
|
-
rootState:
|
|
1006
|
-
rootSetState:
|
|
1007
|
-
localState:
|
|
1008
|
-
context:
|
|
1024
|
+
block: props2.block,
|
|
1025
|
+
rootState: props2.context.rootState,
|
|
1026
|
+
rootSetState: props2.context.rootSetState,
|
|
1027
|
+
localState: props2.context.localState,
|
|
1028
|
+
context: props2.context.context
|
|
1009
1029
|
})
|
|
1010
|
-
} : {}
|
|
1011
|
-
|
|
1030
|
+
} : {};
|
|
1031
|
+
}, "InteractiveElement_component_attributes_useComputed_0kUhl8Qa4CE", [
|
|
1032
|
+
props
|
|
1033
|
+
]));
|
|
1034
|
+
return /* @__PURE__ */ qwik._jsxC(props.Wrapper, {
|
|
1035
|
+
...props.wrapperProps,
|
|
1036
|
+
get attributes() {
|
|
1037
|
+
return attributes.value;
|
|
1038
|
+
},
|
|
1039
|
+
children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "q0_0"),
|
|
1040
|
+
[qwik._IMMUTABLE]: {
|
|
1041
|
+
attributes: qwik._fnSignal((p0) => p0.value, [
|
|
1042
|
+
attributes
|
|
1043
|
+
], "p0.value")
|
|
1044
|
+
}
|
|
1012
1045
|
}, 0, "q0_1");
|
|
1013
1046
|
}, "InteractiveElement_component_0UqfJpjhn0g"));
|
|
1014
1047
|
const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
|
|
@@ -1186,7 +1219,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1186
1219
|
repeatItem
|
|
1187
1220
|
]));
|
|
1188
1221
|
const componentRefProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1189
|
-
var _a2, _b, _c, _d, _e
|
|
1222
|
+
var _a2, _b, _c, _d, _e;
|
|
1190
1223
|
const [blockComponent2, processedBlock2, props2] = qwik.useLexicalScope();
|
|
1191
1224
|
return {
|
|
1192
1225
|
blockChildren: processedBlock2.value.children ?? [],
|
|
@@ -1194,10 +1227,10 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1194
1227
|
componentOptions: {
|
|
1195
1228
|
...getBlockComponentOptions(processedBlock2.value),
|
|
1196
1229
|
builderContext: props2.context,
|
|
1197
|
-
...((_b = blockComponent2.value) == null ? void 0 : _b.name)
|
|
1230
|
+
...shouldPassLinkComponent((_b = blockComponent2.value) == null ? void 0 : _b.name) ? {
|
|
1198
1231
|
builderLinkComponent: props2.linkComponent
|
|
1199
1232
|
} : {},
|
|
1200
|
-
...((
|
|
1233
|
+
...shouldPassRegisteredComponents((_c = blockComponent2.value) == null ? void 0 : _c.name) ? {
|
|
1201
1234
|
builderComponents: props2.registeredComponents
|
|
1202
1235
|
} : {}
|
|
1203
1236
|
},
|
|
@@ -1205,8 +1238,8 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1205
1238
|
linkComponent: props2.linkComponent,
|
|
1206
1239
|
registeredComponents: props2.registeredComponents,
|
|
1207
1240
|
builderBlock: processedBlock2.value,
|
|
1208
|
-
includeBlockProps: ((
|
|
1209
|
-
isInteractive: !((
|
|
1241
|
+
includeBlockProps: ((_d = blockComponent2.value) == null ? void 0 : _d.noWrap) === true,
|
|
1242
|
+
isInteractive: !((_e = blockComponent2.value) == null ? void 0 : _e.isRSC)
|
|
1210
1243
|
};
|
|
1211
1244
|
}, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
|
|
1212
1245
|
blockComponent,
|
|
@@ -1443,7 +1476,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1443
1476
|
}, 1, "jN_4") : null
|
|
1444
1477
|
}, 1, "jN_5");
|
|
1445
1478
|
}, "Block_component_nnPv0RY0U0k"));
|
|
1446
|
-
const onClick$1 = function onClick2(props, state) {
|
|
1479
|
+
const onClick$1 = function onClick2(props, state, className) {
|
|
1447
1480
|
var _a, _b;
|
|
1448
1481
|
if (isEditing() && !((_a = props.blocks) == null ? void 0 : _a.length))
|
|
1449
1482
|
(_b = window.parent) == null ? void 0 : _b.postMessage({
|
|
@@ -1454,7 +1487,7 @@ const onClick$1 = function onClick2(props, state) {
|
|
|
1454
1487
|
}
|
|
1455
1488
|
}, "*");
|
|
1456
1489
|
};
|
|
1457
|
-
const onMouseEnter = function onMouseEnter2(props, state) {
|
|
1490
|
+
const onMouseEnter = function onMouseEnter2(props, state, className) {
|
|
1458
1491
|
var _a, _b;
|
|
1459
1492
|
if (isEditing() && !((_a = props.blocks) == null ? void 0 : _a.length))
|
|
1460
1493
|
(_b = window.parent) == null ? void 0 : _b.postMessage({
|
|
@@ -1489,23 +1522,26 @@ const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
1489
1522
|
return props.styleProp;
|
|
1490
1523
|
},
|
|
1491
1524
|
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
1492
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1525
|
+
const [className2, props2, state2] = qwik.useLexicalScope();
|
|
1493
1526
|
return onClick$1(props2);
|
|
1494
1527
|
}, "BlocksWrapper_component_onClick_ufezvOupQrM", [
|
|
1528
|
+
className,
|
|
1495
1529
|
props,
|
|
1496
1530
|
state
|
|
1497
1531
|
]),
|
|
1498
1532
|
onKeyPress$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
1499
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1533
|
+
const [className2, props2, state2] = qwik.useLexicalScope();
|
|
1500
1534
|
return onClick$1(props2);
|
|
1501
1535
|
}, "BlocksWrapper_component_onKeyPress_9bz8vCQc3kg", [
|
|
1536
|
+
className,
|
|
1502
1537
|
props,
|
|
1503
1538
|
state
|
|
1504
1539
|
]),
|
|
1505
1540
|
onMouseEnter$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
1506
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1541
|
+
const [className2, props2, state2] = qwik.useLexicalScope();
|
|
1507
1542
|
return onMouseEnter(props2);
|
|
1508
1543
|
}, "BlocksWrapper_component_onMouseEnter_j4FJjnLtraQ", [
|
|
1544
|
+
className,
|
|
1509
1545
|
props,
|
|
1510
1546
|
state
|
|
1511
1547
|
]),
|
|
@@ -1618,6 +1654,12 @@ const Blocks = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl
|
|
|
1618
1654
|
function deoptSignal(value) {
|
|
1619
1655
|
return value;
|
|
1620
1656
|
}
|
|
1657
|
+
const getColumnsClass = (id) => {
|
|
1658
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1659
|
+
};
|
|
1660
|
+
const getTagName = function getTagName2(props, state, column) {
|
|
1661
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1662
|
+
};
|
|
1621
1663
|
const getWidth = function getWidth2(props, state, index) {
|
|
1622
1664
|
var _a;
|
|
1623
1665
|
return ((_a = state.cols[index]) == null ? void 0 : _a.width) || 100 / state.cols.length;
|
|
@@ -1632,6 +1674,15 @@ const getTabletStyle = function getTabletStyle2(props, state, { stackedStyle, de
|
|
|
1632
1674
|
const getMobileStyle = function getMobileStyle2(props, state, { stackedStyle, desktopStyle }) {
|
|
1633
1675
|
return state.stackAt === "never" ? desktopStyle : stackedStyle;
|
|
1634
1676
|
};
|
|
1677
|
+
const columnsCssVars = function columnsCssVars2(props, state) {
|
|
1678
|
+
return {
|
|
1679
|
+
"--flex-dir": state.flexDir,
|
|
1680
|
+
"--flex-dir-tablet": getTabletStyle(props, state, {
|
|
1681
|
+
stackedStyle: state.flexDir,
|
|
1682
|
+
desktopStyle: "row"
|
|
1683
|
+
})
|
|
1684
|
+
};
|
|
1685
|
+
};
|
|
1635
1686
|
const columnCssVars = function columnCssVars2(props, state, index) {
|
|
1636
1687
|
const gutter = index === 0 ? 0 : state.gutterSize;
|
|
1637
1688
|
const width = getColumnCssWidth(props, state, index);
|
|
@@ -1671,90 +1722,68 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
|
|
|
1671
1722
|
const breakpointSizes = getSizesForBreakpoints(((_b = (_a = props.builderContext.content) == null ? void 0 : _a.meta) == null ? void 0 : _b.breakpoints) || {});
|
|
1672
1723
|
return breakpointSizes[size].max;
|
|
1673
1724
|
};
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
1679
|
-
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
1680
|
-
stackAt: props.stackColumnsAt || "tablet"
|
|
1681
|
-
});
|
|
1682
|
-
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
|
|
1683
|
-
const columnsCssVars = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1684
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1685
|
-
return {
|
|
1686
|
-
"--flex-dir": state2.flexDir,
|
|
1687
|
-
"--flex-dir-tablet": getTabletStyle(props2, state2, {
|
|
1688
|
-
stackedStyle: state2.flexDir,
|
|
1689
|
-
desktopStyle: "row"
|
|
1690
|
-
})
|
|
1691
|
-
};
|
|
1692
|
-
}, "Columns_component_columnsCssVars_useComputed_adFEq2RWT9s", [
|
|
1693
|
-
props,
|
|
1694
|
-
state
|
|
1695
|
-
]));
|
|
1696
|
-
const columnsStyles = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1697
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1698
|
-
return `
|
|
1699
|
-
@media (max-width: ${getWidthForBreakpointSize(props2, state2, "medium")}px) {
|
|
1700
|
-
.${props2.builderBlock.id}-breakpoints {
|
|
1725
|
+
const columnsStyles = function columnsStyles2(props, state) {
|
|
1726
|
+
return `
|
|
1727
|
+
@media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
|
|
1728
|
+
.${props.builderBlock.id}-breakpoints {
|
|
1701
1729
|
flex-direction: var(--flex-dir-tablet);
|
|
1702
1730
|
align-items: stretch;
|
|
1703
1731
|
}
|
|
1704
1732
|
|
|
1705
|
-
.${
|
|
1733
|
+
.${props.builderBlock.id}-breakpoints > .builder-column {
|
|
1706
1734
|
width: var(--column-width-tablet) !important;
|
|
1707
1735
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
1708
1736
|
}
|
|
1709
1737
|
}
|
|
1710
1738
|
|
|
1711
|
-
@media (max-width: ${getWidthForBreakpointSize(
|
|
1712
|
-
.${
|
|
1739
|
+
@media (max-width: ${getWidthForBreakpointSize(props, state, "small")}px) {
|
|
1740
|
+
.${props.builderBlock.id}-breakpoints {
|
|
1713
1741
|
flex-direction: var(--flex-dir);
|
|
1714
1742
|
align-items: stretch;
|
|
1715
1743
|
}
|
|
1716
1744
|
|
|
1717
|
-
.${
|
|
1745
|
+
.${props.builderBlock.id}-breakpoints > .builder-column {
|
|
1718
1746
|
width: var(--column-width-mobile) !important;
|
|
1719
1747
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
1720
1748
|
}
|
|
1721
1749
|
},
|
|
1722
1750
|
`;
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1751
|
+
};
|
|
1752
|
+
const getAttributes = function getAttributes2(props, state, column, index) {
|
|
1753
|
+
return {
|
|
1754
|
+
...column.link ? {
|
|
1755
|
+
href: column.link
|
|
1756
|
+
} : {},
|
|
1757
|
+
[getClassPropName()]: "builder-column",
|
|
1758
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(props, state, index))
|
|
1759
|
+
};
|
|
1760
|
+
};
|
|
1761
|
+
const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1762
|
+
var _a;
|
|
1763
|
+
qwik._jsxBranch();
|
|
1764
|
+
const state = qwik.useStore({
|
|
1765
|
+
cols: props.columns || [],
|
|
1766
|
+
flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
1767
|
+
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
1768
|
+
stackAt: props.stackColumnsAt || "tablet"
|
|
1769
|
+
});
|
|
1770
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
|
|
1771
|
+
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
1772
|
+
class: getColumnsClass((_a = props.builderBlock) == null ? void 0 : _a.id) + " div-Columns",
|
|
1773
|
+
style: columnsCssVars(props, state)
|
|
1774
|
+
}, null, [
|
|
1735
1775
|
/* @__PURE__ */ qwik._jsxC(InlinedStyles, {
|
|
1736
1776
|
id: "builderio-columns",
|
|
1737
|
-
|
|
1738
|
-
return columnsStyles.value;
|
|
1739
|
-
},
|
|
1777
|
+
styles: columnsStyles(props, state),
|
|
1740
1778
|
[qwik._IMMUTABLE]: {
|
|
1741
|
-
id: qwik._IMMUTABLE
|
|
1742
|
-
styles: qwik._fnSignal((p0) => p0.value, [
|
|
1743
|
-
columnsStyles
|
|
1744
|
-
], "p0.value")
|
|
1779
|
+
id: qwik._IMMUTABLE
|
|
1745
1780
|
}
|
|
1746
1781
|
}, 3, "c0_0"),
|
|
1747
1782
|
(props.columns || []).map((column, index) => {
|
|
1748
1783
|
return /* @__PURE__ */ qwik._jsxC(DynamicRenderer, {
|
|
1749
|
-
TagName:
|
|
1784
|
+
TagName: getTagName(props, state, column),
|
|
1750
1785
|
actionAttributes: {},
|
|
1751
|
-
attributes:
|
|
1752
|
-
...column.link ? {
|
|
1753
|
-
href: column.link
|
|
1754
|
-
} : {},
|
|
1755
|
-
[getClassPropName()]: "builder-column",
|
|
1756
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(props, state, index))
|
|
1757
|
-
},
|
|
1786
|
+
attributes: getAttributes(props, state, column, index),
|
|
1758
1787
|
children: /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
1759
1788
|
path: `component.options.columns.${index}.blocks`,
|
|
1760
1789
|
get parent() {
|
|
@@ -1862,7 +1891,7 @@ function getSrcSet(url) {
|
|
|
1862
1891
|
return url;
|
|
1863
1892
|
}
|
|
1864
1893
|
const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1865
|
-
var _a, _b, _c, _d;
|
|
1894
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1866
1895
|
qwik._jsxBranch();
|
|
1867
1896
|
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$1, "Image_component_useStylesScoped_fBMYiVf9fuU"));
|
|
1868
1897
|
const srcSetToUse = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -1958,7 +1987,7 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1958
1987
|
], '{paddingTop:p0.aspectRatio*100+"%"}')
|
|
1959
1988
|
}, null, 3, "0A_1") : null,
|
|
1960
1989
|
((_d = (_c = props.builderBlock) == null ? void 0 : _c.children) == null ? void 0 : _d.length) && props.fitContent ? /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "0A_2") : null,
|
|
1961
|
-
!props.fitContent && props.children ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
1990
|
+
!props.fitContent && ((_f = (_e = props.builderBlock) == null ? void 0 : _e.children) == null ? void 0 : _f.length) ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
1962
1991
|
class: "div-Image-2"
|
|
1963
1992
|
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "0A_3"), 1, "0A_4") : null
|
|
1964
1993
|
]
|
|
@@ -2177,7 +2206,7 @@ const handleABTesting = async ({ item, canTrack }) => {
|
|
|
2177
2206
|
};
|
|
2178
2207
|
};
|
|
2179
2208
|
const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2180
|
-
const componentInfo$
|
|
2209
|
+
const componentInfo$g = {
|
|
2181
2210
|
name: "Core:Button",
|
|
2182
2211
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
2183
2212
|
defaultStyles: {
|
|
@@ -2215,7 +2244,7 @@ const componentInfo$f = {
|
|
|
2215
2244
|
static: true,
|
|
2216
2245
|
noWrap: true
|
|
2217
2246
|
};
|
|
2218
|
-
const componentInfo$
|
|
2247
|
+
const componentInfo$f = {
|
|
2219
2248
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
2220
2249
|
name: "Columns",
|
|
2221
2250
|
isRSC: true,
|
|
@@ -2457,14 +2486,14 @@ const componentInfo$e = {
|
|
|
2457
2486
|
}
|
|
2458
2487
|
]
|
|
2459
2488
|
};
|
|
2460
|
-
const componentInfo$
|
|
2489
|
+
const componentInfo$e = {
|
|
2461
2490
|
name: "Fragment",
|
|
2462
2491
|
static: true,
|
|
2463
2492
|
hidden: true,
|
|
2464
2493
|
canHaveChildren: true,
|
|
2465
2494
|
noWrap: true
|
|
2466
2495
|
};
|
|
2467
|
-
const componentInfo$
|
|
2496
|
+
const componentInfo$d = {
|
|
2468
2497
|
name: "Image",
|
|
2469
2498
|
static: true,
|
|
2470
2499
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -2612,7 +2641,7 @@ const componentInfo$c = {
|
|
|
2612
2641
|
}
|
|
2613
2642
|
]
|
|
2614
2643
|
};
|
|
2615
|
-
const componentInfo$
|
|
2644
|
+
const componentInfo$c = {
|
|
2616
2645
|
name: "Core:Section",
|
|
2617
2646
|
static: true,
|
|
2618
2647
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2657,7 +2686,7 @@ const componentInfo$b = {
|
|
|
2657
2686
|
}
|
|
2658
2687
|
]
|
|
2659
2688
|
};
|
|
2660
|
-
const componentInfo$
|
|
2689
|
+
const componentInfo$b = {
|
|
2661
2690
|
name: "Slot",
|
|
2662
2691
|
isRSC: true,
|
|
2663
2692
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -2712,7 +2741,7 @@ const Slot = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2712
2741
|
}
|
|
2713
2742
|
}, 0, "B1_1");
|
|
2714
2743
|
}, "Slot_component_WWgWgfV0bb0"));
|
|
2715
|
-
const componentInfo$
|
|
2744
|
+
const componentInfo$a = {
|
|
2716
2745
|
name: "Symbol",
|
|
2717
2746
|
noWrap: true,
|
|
2718
2747
|
static: true,
|
|
@@ -2752,6 +2781,282 @@ const componentInfo$9 = {
|
|
|
2752
2781
|
}
|
|
2753
2782
|
]
|
|
2754
2783
|
};
|
|
2784
|
+
const defaultTab = {
|
|
2785
|
+
"@type": "@builder.io/sdk:Element",
|
|
2786
|
+
responsiveStyles: {
|
|
2787
|
+
large: {
|
|
2788
|
+
paddingLeft: "20px",
|
|
2789
|
+
paddingRight: "20px",
|
|
2790
|
+
paddingTop: "10px",
|
|
2791
|
+
paddingBottom: "10px",
|
|
2792
|
+
minWidth: "100px",
|
|
2793
|
+
textAlign: "center",
|
|
2794
|
+
display: "flex",
|
|
2795
|
+
flexDirection: "column",
|
|
2796
|
+
cursor: "pointer",
|
|
2797
|
+
userSelect: "none"
|
|
2798
|
+
}
|
|
2799
|
+
},
|
|
2800
|
+
component: {
|
|
2801
|
+
name: "Text",
|
|
2802
|
+
options: {
|
|
2803
|
+
text: "New tab"
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
};
|
|
2807
|
+
const defaultElement = {
|
|
2808
|
+
"@type": "@builder.io/sdk:Element",
|
|
2809
|
+
responsiveStyles: {
|
|
2810
|
+
large: {
|
|
2811
|
+
height: "200px",
|
|
2812
|
+
display: "flex",
|
|
2813
|
+
marginTop: "20px",
|
|
2814
|
+
flexDirection: "column"
|
|
2815
|
+
}
|
|
2816
|
+
},
|
|
2817
|
+
component: {
|
|
2818
|
+
name: "Text",
|
|
2819
|
+
options: {
|
|
2820
|
+
text: "New tab content "
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
};
|
|
2824
|
+
const componentInfo$9 = {
|
|
2825
|
+
name: "Builder: Tabs",
|
|
2826
|
+
inputs: [
|
|
2827
|
+
{
|
|
2828
|
+
name: "tabs",
|
|
2829
|
+
type: "list",
|
|
2830
|
+
broadcast: true,
|
|
2831
|
+
subFields: [
|
|
2832
|
+
{
|
|
2833
|
+
name: "label",
|
|
2834
|
+
type: "uiBlocks",
|
|
2835
|
+
hideFromUI: true,
|
|
2836
|
+
defaultValue: [
|
|
2837
|
+
defaultTab
|
|
2838
|
+
]
|
|
2839
|
+
},
|
|
2840
|
+
{
|
|
2841
|
+
name: "content",
|
|
2842
|
+
type: "uiBlocks",
|
|
2843
|
+
hideFromUI: true,
|
|
2844
|
+
defaultValue: [
|
|
2845
|
+
defaultElement
|
|
2846
|
+
]
|
|
2847
|
+
}
|
|
2848
|
+
],
|
|
2849
|
+
defaultValue: [
|
|
2850
|
+
{
|
|
2851
|
+
label: [
|
|
2852
|
+
{
|
|
2853
|
+
...defaultTab,
|
|
2854
|
+
component: {
|
|
2855
|
+
name: "Text",
|
|
2856
|
+
options: {
|
|
2857
|
+
text: "Tab 1"
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
],
|
|
2862
|
+
content: [
|
|
2863
|
+
{
|
|
2864
|
+
...defaultElement,
|
|
2865
|
+
component: {
|
|
2866
|
+
name: "Text",
|
|
2867
|
+
options: {
|
|
2868
|
+
text: "Tab 1 content"
|
|
2869
|
+
}
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
]
|
|
2873
|
+
},
|
|
2874
|
+
{
|
|
2875
|
+
label: [
|
|
2876
|
+
{
|
|
2877
|
+
...defaultTab,
|
|
2878
|
+
component: {
|
|
2879
|
+
name: "Text",
|
|
2880
|
+
options: {
|
|
2881
|
+
text: "Tab 2"
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
],
|
|
2886
|
+
content: [
|
|
2887
|
+
{
|
|
2888
|
+
...defaultElement,
|
|
2889
|
+
component: {
|
|
2890
|
+
name: "Text",
|
|
2891
|
+
options: {
|
|
2892
|
+
text: "Tab 2 content"
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
]
|
|
2897
|
+
}
|
|
2898
|
+
]
|
|
2899
|
+
},
|
|
2900
|
+
{
|
|
2901
|
+
name: "activeTabStyle",
|
|
2902
|
+
type: "uiStyle",
|
|
2903
|
+
helperText: "CSS styles for the active tab",
|
|
2904
|
+
defaultValue: {
|
|
2905
|
+
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
2906
|
+
}
|
|
2907
|
+
},
|
|
2908
|
+
{
|
|
2909
|
+
name: "defaultActiveTab",
|
|
2910
|
+
type: "number",
|
|
2911
|
+
helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
|
|
2912
|
+
defaultValue: 1,
|
|
2913
|
+
advanced: true
|
|
2914
|
+
},
|
|
2915
|
+
{
|
|
2916
|
+
name: "collapsible",
|
|
2917
|
+
type: "boolean",
|
|
2918
|
+
helperText: "If on, clicking an open tab closes it so no tabs are active",
|
|
2919
|
+
defaultValue: false,
|
|
2920
|
+
advanced: true
|
|
2921
|
+
},
|
|
2922
|
+
{
|
|
2923
|
+
name: "tabHeaderLayout",
|
|
2924
|
+
type: "enum",
|
|
2925
|
+
helperText: "Change the layout of the tab headers (uses justify-content)",
|
|
2926
|
+
defaultValue: "flex-start",
|
|
2927
|
+
enum: [
|
|
2928
|
+
{
|
|
2929
|
+
label: "Center",
|
|
2930
|
+
value: "center"
|
|
2931
|
+
},
|
|
2932
|
+
{
|
|
2933
|
+
label: "Space between",
|
|
2934
|
+
value: "space-between"
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
label: "Space around",
|
|
2938
|
+
value: "space-around"
|
|
2939
|
+
},
|
|
2940
|
+
{
|
|
2941
|
+
label: "Left",
|
|
2942
|
+
value: "flex-start"
|
|
2943
|
+
},
|
|
2944
|
+
{
|
|
2945
|
+
label: "Right",
|
|
2946
|
+
value: "flex-end"
|
|
2947
|
+
}
|
|
2948
|
+
]
|
|
2949
|
+
}
|
|
2950
|
+
]
|
|
2951
|
+
};
|
|
2952
|
+
const activeTabContent = function activeTabContent2(props, state, active) {
|
|
2953
|
+
return props.tabs && props.tabs[active].content;
|
|
2954
|
+
};
|
|
2955
|
+
const getActiveTabStyle = function getActiveTabStyle2(props, state, index) {
|
|
2956
|
+
return state.activeTab === index ? props.activeTabStyle : {};
|
|
2957
|
+
};
|
|
2958
|
+
const Tabs = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2959
|
+
qwik._jsxBranch();
|
|
2960
|
+
const state = qwik.useStore({
|
|
2961
|
+
activeTab: props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
|
|
2962
|
+
});
|
|
2963
|
+
return /* @__PURE__ */ qwik._jsxQ("div", null, null, [
|
|
2964
|
+
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2965
|
+
class: "builder-tabs-wrap",
|
|
2966
|
+
style: qwik._fnSignal((p0) => ({
|
|
2967
|
+
display: "flex",
|
|
2968
|
+
flexDirection: "row",
|
|
2969
|
+
justifyContent: p0.tabHeaderLayout || "flex-start",
|
|
2970
|
+
overflow: "auto"
|
|
2971
|
+
}), [
|
|
2972
|
+
props
|
|
2973
|
+
], '{display:"flex",flexDirection:"row",justifyContent:p0.tabHeaderLayout||"flex-start",overflow:"auto"}')
|
|
2974
|
+
}, (props.tabs || []).map((tab, index) => {
|
|
2975
|
+
return /* @__PURE__ */ qwik._jsxQ("span", {
|
|
2976
|
+
class: `builder-tab-wrap ${state.activeTab === index ? "builder-tab-active" : ""}`,
|
|
2977
|
+
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
2978
|
+
const [index2, props2, state2] = qwik.useLexicalScope();
|
|
2979
|
+
if (index2 === state2.activeTab && props2.collapsible)
|
|
2980
|
+
state2.activeTab = -1;
|
|
2981
|
+
else
|
|
2982
|
+
state2.activeTab = index2;
|
|
2983
|
+
}, "Tabs_component_div_div_span_onClick_hSTBabAHGks", [
|
|
2984
|
+
index,
|
|
2985
|
+
props,
|
|
2986
|
+
state
|
|
2987
|
+
]),
|
|
2988
|
+
style: getActiveTabStyle(props, state, index)
|
|
2989
|
+
}, null, /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
2990
|
+
get parent() {
|
|
2991
|
+
return props.builderBlock.id;
|
|
2992
|
+
},
|
|
2993
|
+
path: `component.options.tabs.${index}.label`,
|
|
2994
|
+
get blocks() {
|
|
2995
|
+
return tab.label;
|
|
2996
|
+
},
|
|
2997
|
+
get context() {
|
|
2998
|
+
return props.builderContext;
|
|
2999
|
+
},
|
|
3000
|
+
get registeredComponents() {
|
|
3001
|
+
return props.builderComponents;
|
|
3002
|
+
},
|
|
3003
|
+
get linkComponent() {
|
|
3004
|
+
return props.builderLinkComponent;
|
|
3005
|
+
},
|
|
3006
|
+
[qwik._IMMUTABLE]: {
|
|
3007
|
+
blocks: qwik._wrapProp(tab, "label"),
|
|
3008
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3009
|
+
props
|
|
3010
|
+
], "p0.builderContext"),
|
|
3011
|
+
linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
|
|
3012
|
+
props
|
|
3013
|
+
], "p0.builderLinkComponent"),
|
|
3014
|
+
parent: qwik._fnSignal((p0) => p0.builderBlock.id, [
|
|
3015
|
+
props
|
|
3016
|
+
], "p0.builderBlock.id"),
|
|
3017
|
+
registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
|
|
3018
|
+
props
|
|
3019
|
+
], "p0.builderComponents")
|
|
3020
|
+
}
|
|
3021
|
+
}, 3, "6k_0"), 0, index);
|
|
3022
|
+
}), 1, null),
|
|
3023
|
+
activeTabContent(props, state, state.activeTab) ? /* @__PURE__ */ qwik._jsxQ("div", null, null, /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
3024
|
+
get parent() {
|
|
3025
|
+
return props.builderBlock.id;
|
|
3026
|
+
},
|
|
3027
|
+
get path() {
|
|
3028
|
+
return `component.options.tabs.${state.activeTab}.content`;
|
|
3029
|
+
},
|
|
3030
|
+
blocks: activeTabContent(props, state, state.activeTab),
|
|
3031
|
+
get context() {
|
|
3032
|
+
return props.builderContext;
|
|
3033
|
+
},
|
|
3034
|
+
get registeredComponents() {
|
|
3035
|
+
return props.builderComponents;
|
|
3036
|
+
},
|
|
3037
|
+
get linkComponent() {
|
|
3038
|
+
return props.builderLinkComponent;
|
|
3039
|
+
},
|
|
3040
|
+
[qwik._IMMUTABLE]: {
|
|
3041
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3042
|
+
props
|
|
3043
|
+
], "p0.builderContext"),
|
|
3044
|
+
linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
|
|
3045
|
+
props
|
|
3046
|
+
], "p0.builderLinkComponent"),
|
|
3047
|
+
parent: qwik._fnSignal((p0) => p0.builderBlock.id, [
|
|
3048
|
+
props
|
|
3049
|
+
], "p0.builderBlock.id"),
|
|
3050
|
+
path: qwik._fnSignal((p0) => `component.options.tabs.${p0.activeTab}.content`, [
|
|
3051
|
+
state
|
|
3052
|
+
], "`component.options.tabs.${p0.activeTab}.content`"),
|
|
3053
|
+
registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
|
|
3054
|
+
props
|
|
3055
|
+
], "p0.builderComponents")
|
|
3056
|
+
}
|
|
3057
|
+
}, 3, "6k_1"), 1, "6k_2") : null
|
|
3058
|
+
], 1, "6k_3");
|
|
3059
|
+
}, "Tabs_component_MhWcxXy0lMY"));
|
|
2755
3060
|
const componentInfo$8 = {
|
|
2756
3061
|
name: "Text",
|
|
2757
3062
|
static: true,
|
|
@@ -4031,36 +4336,42 @@ const getExtraComponents = () => [
|
|
|
4031
4336
|
const getDefaultRegisteredComponents = () => [
|
|
4032
4337
|
{
|
|
4033
4338
|
component: Button,
|
|
4034
|
-
...componentInfo$
|
|
4339
|
+
...componentInfo$g
|
|
4035
4340
|
},
|
|
4036
4341
|
{
|
|
4037
4342
|
component: Columns,
|
|
4038
|
-
...componentInfo$
|
|
4343
|
+
...componentInfo$f
|
|
4039
4344
|
},
|
|
4040
4345
|
{
|
|
4041
4346
|
component: FragmentComponent,
|
|
4042
|
-
...componentInfo$
|
|
4347
|
+
...componentInfo$e
|
|
4043
4348
|
},
|
|
4044
4349
|
{
|
|
4045
4350
|
component: Image,
|
|
4046
|
-
...componentInfo$
|
|
4351
|
+
...componentInfo$d
|
|
4047
4352
|
},
|
|
4048
4353
|
{
|
|
4049
4354
|
component: SectionComponent,
|
|
4050
|
-
...componentInfo$
|
|
4355
|
+
...componentInfo$c
|
|
4051
4356
|
},
|
|
4052
4357
|
{
|
|
4053
4358
|
component: Slot,
|
|
4054
|
-
...componentInfo$
|
|
4359
|
+
...componentInfo$b
|
|
4055
4360
|
},
|
|
4056
4361
|
{
|
|
4057
4362
|
component: Symbol$1,
|
|
4058
|
-
...componentInfo$
|
|
4363
|
+
...componentInfo$a
|
|
4059
4364
|
},
|
|
4060
4365
|
{
|
|
4061
4366
|
component: Text,
|
|
4062
4367
|
...componentInfo$8
|
|
4063
4368
|
},
|
|
4369
|
+
...[
|
|
4370
|
+
{
|
|
4371
|
+
component: Tabs,
|
|
4372
|
+
...componentInfo$9
|
|
4373
|
+
}
|
|
4374
|
+
],
|
|
4064
4375
|
...getExtraComponents()
|
|
4065
4376
|
];
|
|
4066
4377
|
const createRegisterComponentMessage = (info) => ({
|
|
@@ -4506,7 +4817,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4506
4817
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
4507
4818
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
4508
4819
|
}
|
|
4509
|
-
const SDK_VERSION = "0.14.
|
|
4820
|
+
const SDK_VERSION = "0.14.18";
|
|
4510
4821
|
const registry = {};
|
|
4511
4822
|
function register(type, info) {
|
|
4512
4823
|
let typeList = registry[type];
|
|
@@ -4689,7 +5000,75 @@ const subscribeToEditor = (model, callback, options) => {
|
|
|
4689
5000
|
window.removeEventListener("message", listener);
|
|
4690
5001
|
};
|
|
4691
5002
|
};
|
|
4692
|
-
const
|
|
5003
|
+
const getCssFromFont = (font) => {
|
|
5004
|
+
var _a;
|
|
5005
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5006
|
+
const name = family.split(",")[0];
|
|
5007
|
+
const url = font.fileUrl ?? ((_a = font == null ? void 0 : font.files) == null ? void 0 : _a.regular);
|
|
5008
|
+
let str = "";
|
|
5009
|
+
if (url && family && name)
|
|
5010
|
+
str += `
|
|
5011
|
+
@font-face {
|
|
5012
|
+
font-family: "${family}";
|
|
5013
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
5014
|
+
font-display: fallback;
|
|
5015
|
+
font-weight: 400;
|
|
5016
|
+
}
|
|
5017
|
+
`.trim();
|
|
5018
|
+
if (font.files)
|
|
5019
|
+
for (const weight in font.files) {
|
|
5020
|
+
const isNumber = String(Number(weight)) === weight;
|
|
5021
|
+
if (!isNumber)
|
|
5022
|
+
continue;
|
|
5023
|
+
const weightUrl = font.files[weight];
|
|
5024
|
+
if (weightUrl && weightUrl !== url)
|
|
5025
|
+
str += `
|
|
5026
|
+
@font-face {
|
|
5027
|
+
font-family: "${family}";
|
|
5028
|
+
src: url('${weightUrl}') format('woff2');
|
|
5029
|
+
font-display: fallback;
|
|
5030
|
+
font-weight: ${weight};
|
|
5031
|
+
}
|
|
5032
|
+
`.trim();
|
|
5033
|
+
}
|
|
5034
|
+
return str;
|
|
5035
|
+
};
|
|
5036
|
+
const getFontCss = ({ customFonts }) => {
|
|
5037
|
+
var _a;
|
|
5038
|
+
return ((_a = customFonts == null ? void 0 : customFonts.map((font) => getCssFromFont(font))) == null ? void 0 : _a.join(" ")) || "";
|
|
5039
|
+
};
|
|
5040
|
+
const getCss = ({ cssCode, contentId }) => {
|
|
5041
|
+
if (!cssCode)
|
|
5042
|
+
return "";
|
|
5043
|
+
if (!contentId)
|
|
5044
|
+
return cssCode;
|
|
5045
|
+
return (cssCode == null ? void 0 : cssCode.replace(/&/g, `div[builder-content-id="${contentId}"]`)) || "";
|
|
5046
|
+
};
|
|
5047
|
+
const DEFAULT_STYLES = `
|
|
5048
|
+
.builder-button {
|
|
5049
|
+
all: unset;
|
|
5050
|
+
}
|
|
5051
|
+
|
|
5052
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5053
|
+
margin: 0;
|
|
5054
|
+
}
|
|
5055
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5056
|
+
color: inherit;
|
|
5057
|
+
line-height: inherit;
|
|
5058
|
+
letter-spacing: inherit;
|
|
5059
|
+
font-weight: inherit;
|
|
5060
|
+
font-size: inherit;
|
|
5061
|
+
text-align: inherit;
|
|
5062
|
+
font-family: inherit;
|
|
5063
|
+
}
|
|
5064
|
+
`;
|
|
5065
|
+
const getDefaultStyles = (isNested) => {
|
|
5066
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
5067
|
+
};
|
|
5068
|
+
const getWrapperClassName = (variationId) => {
|
|
5069
|
+
return `variant-${variationId}`;
|
|
5070
|
+
};
|
|
5071
|
+
const mergeNewRootState = function mergeNewRootState22(props, state, showContentProps, elementRef, newData) {
|
|
4693
5072
|
var _a, _b;
|
|
4694
5073
|
const combinedState = {
|
|
4695
5074
|
...props.builderContextSignal.rootState,
|
|
@@ -4700,7 +5079,7 @@ const mergeNewRootState = function mergeNewRootState22(props, state, elementRef,
|
|
|
4700
5079
|
else
|
|
4701
5080
|
props.builderContextSignal.rootState = combinedState;
|
|
4702
5081
|
};
|
|
4703
|
-
const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
|
|
5082
|
+
const mergeNewContent = function mergeNewContent2(props, state, showContentProps, elementRef, newContent) {
|
|
4704
5083
|
var _a, _b, _c, _d, _e;
|
|
4705
5084
|
const newContentValue = {
|
|
4706
5085
|
...props.builderContextSignal.content,
|
|
@@ -4717,7 +5096,7 @@ const mergeNewContent = function mergeNewContent2(props, state, elementRef, newC
|
|
|
4717
5096
|
};
|
|
4718
5097
|
props.builderContextSignal.content = newContentValue;
|
|
4719
5098
|
};
|
|
4720
|
-
const processMessage = function processMessage2(props, state, elementRef, event) {
|
|
5099
|
+
const processMessage = function processMessage2(props, state, showContentProps, elementRef, event) {
|
|
4721
5100
|
return createEditorListener({
|
|
4722
5101
|
model: props.model,
|
|
4723
5102
|
trustedHosts: props.trustedHosts,
|
|
@@ -4728,7 +5107,7 @@ const processMessage = function processMessage2(props, state, elementRef, event)
|
|
|
4728
5107
|
if (!contentId || contentId !== ((_a = props.builderContextSignal.content) == null ? void 0 : _a.id))
|
|
4729
5108
|
return;
|
|
4730
5109
|
if (breakpoints)
|
|
4731
|
-
mergeNewContent(props, state, elementRef, {
|
|
5110
|
+
mergeNewContent(props, state, showContentProps, elementRef, {
|
|
4732
5111
|
meta: {
|
|
4733
5112
|
breakpoints
|
|
4734
5113
|
}
|
|
@@ -4738,12 +5117,12 @@ const processMessage = function processMessage2(props, state, elementRef, event)
|
|
|
4738
5117
|
triggerAnimation(animation);
|
|
4739
5118
|
},
|
|
4740
5119
|
contentUpdate: (newContent) => {
|
|
4741
|
-
mergeNewContent(props, state, elementRef, newContent);
|
|
5120
|
+
mergeNewContent(props, state, showContentProps, elementRef, newContent);
|
|
4742
5121
|
}
|
|
4743
5122
|
}
|
|
4744
5123
|
})(event);
|
|
4745
5124
|
};
|
|
4746
|
-
const evaluateJsCode = function evaluateJsCode2(props, state, elementRef) {
|
|
5125
|
+
const evaluateJsCode = function evaluateJsCode2(props, state, showContentProps, elementRef) {
|
|
4747
5126
|
var _a, _b;
|
|
4748
5127
|
const jsCode = (_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.jsCode;
|
|
4749
5128
|
if (jsCode)
|
|
@@ -4759,7 +5138,7 @@ const evaluateJsCode = function evaluateJsCode2(props, state, elementRef) {
|
|
|
4759
5138
|
enableCache: false
|
|
4760
5139
|
});
|
|
4761
5140
|
};
|
|
4762
|
-
const onClick = function onClick22(props, state, elementRef, event) {
|
|
5141
|
+
const onClick = function onClick22(props, state, showContentProps, elementRef, event) {
|
|
4763
5142
|
var _a, _b;
|
|
4764
5143
|
if (props.builderContextSignal.content) {
|
|
4765
5144
|
const variationId = (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
|
|
@@ -4777,7 +5156,7 @@ const onClick = function onClick22(props, state, elementRef, event) {
|
|
|
4777
5156
|
if (!state.clicked)
|
|
4778
5157
|
state.clicked = true;
|
|
4779
5158
|
};
|
|
4780
|
-
const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
5159
|
+
const runHttpRequests = function runHttpRequests2(props, state, showContentProps, elementRef) {
|
|
4781
5160
|
var _a, _b;
|
|
4782
5161
|
const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
|
|
4783
5162
|
Object.entries(requests).forEach(([key, url]) => {
|
|
@@ -4797,7 +5176,7 @@ const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
|
4797
5176
|
enableCache: true
|
|
4798
5177
|
})));
|
|
4799
5178
|
fetch$1(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4800
|
-
mergeNewRootState(props, state, elementRef, {
|
|
5179
|
+
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
4801
5180
|
[key]: json
|
|
4802
5181
|
});
|
|
4803
5182
|
state.httpReqsData[key] = true;
|
|
@@ -4808,7 +5187,7 @@ const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
|
4808
5187
|
});
|
|
4809
5188
|
});
|
|
4810
5189
|
};
|
|
4811
|
-
const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
5190
|
+
const emitStateUpdate = function emitStateUpdate2(props, state, showContentProps, elementRef) {
|
|
4812
5191
|
if (isEditing())
|
|
4813
5192
|
window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
|
|
4814
5193
|
detail: {
|
|
@@ -4820,7 +5199,17 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
4820
5199
|
}));
|
|
4821
5200
|
};
|
|
4822
5201
|
const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
5202
|
+
var _a, _b;
|
|
4823
5203
|
qwik._jsxBranch();
|
|
5204
|
+
const showContentProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
5205
|
+
const [props2] = qwik.useLexicalScope();
|
|
5206
|
+
return props2.showContent ? {} : {
|
|
5207
|
+
hidden: true,
|
|
5208
|
+
"aria-hidden": true
|
|
5209
|
+
};
|
|
5210
|
+
}, "EnableEditor_component_showContentProps_useComputed_aHr3V0Y8sNs", [
|
|
5211
|
+
props
|
|
5212
|
+
]));
|
|
4824
5213
|
const elementRef = qwik.useSignal();
|
|
4825
5214
|
const state = qwik.useStore({
|
|
4826
5215
|
ContentWrapper: props.contentWrapper || "div",
|
|
@@ -4831,8 +5220,8 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4831
5220
|
deep: true
|
|
4832
5221
|
});
|
|
4833
5222
|
qwik.useOn("initeditingbldr", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
4834
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
4835
|
-
window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
|
|
5223
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
5224
|
+
window.addEventListener("message", processMessage.bind(null, props2, state2, showContentProps2, elementRef2));
|
|
4836
5225
|
registerInsertMenu();
|
|
4837
5226
|
setupBrowserForEditing({
|
|
4838
5227
|
...props2.locale ? {
|
|
@@ -4846,18 +5235,19 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4846
5235
|
} : {}
|
|
4847
5236
|
});
|
|
4848
5237
|
Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
4849
|
-
var
|
|
5238
|
+
var _a2;
|
|
4850
5239
|
const message = createRegisterComponentMessage(registeredComponent);
|
|
4851
|
-
(
|
|
5240
|
+
(_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
|
|
4852
5241
|
});
|
|
4853
|
-
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
|
|
5242
|
+
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, showContentProps2, elementRef2));
|
|
4854
5243
|
}, "EnableEditor_component_useOn_Qs8c0yql2i0", [
|
|
4855
5244
|
elementRef,
|
|
4856
5245
|
props,
|
|
5246
|
+
showContentProps,
|
|
4857
5247
|
state
|
|
4858
5248
|
]));
|
|
4859
5249
|
qwik.useOn("initpreviewingbldr", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
4860
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5250
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4861
5251
|
const searchParams = new URL(location.href).searchParams;
|
|
4862
5252
|
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
4863
5253
|
const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
|
|
@@ -4869,23 +5259,24 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4869
5259
|
apiVersion: props2.builderContextSignal.apiVersion
|
|
4870
5260
|
}).then((content) => {
|
|
4871
5261
|
if (content)
|
|
4872
|
-
mergeNewContent(props2, state2, elementRef2, content);
|
|
5262
|
+
mergeNewContent(props2, state2, showContentProps2, elementRef2, content);
|
|
4873
5263
|
});
|
|
4874
5264
|
}, "EnableEditor_component_useOn_1_F94YipmknvI", [
|
|
4875
5265
|
elementRef,
|
|
4876
5266
|
props,
|
|
5267
|
+
showContentProps,
|
|
4877
5268
|
state
|
|
4878
5269
|
]));
|
|
4879
5270
|
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
4880
|
-
var
|
|
5271
|
+
var _a2, _b2, _c, _d;
|
|
4881
5272
|
if (isBrowser()) {
|
|
4882
5273
|
if (isEditing()) {
|
|
4883
5274
|
if (element)
|
|
4884
5275
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
4885
5276
|
}
|
|
4886
|
-
const shouldTrackImpression = ((
|
|
5277
|
+
const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
|
|
4887
5278
|
if (shouldTrackImpression) {
|
|
4888
|
-
const variationId = (
|
|
5279
|
+
const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
|
|
4889
5280
|
const contentId = (_c = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c.value;
|
|
4890
5281
|
const apiKeyProp = (_d = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d.value;
|
|
4891
5282
|
_track({
|
|
@@ -4904,80 +5295,87 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4904
5295
|
}, "EnableEditor_component_useOn_2_FyR0YPSlJlw"));
|
|
4905
5296
|
qwik.useContextProvider(builderContext, props.builderContextSignal);
|
|
4906
5297
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
4907
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5298
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4908
5299
|
if (!props2.apiKey)
|
|
4909
5300
|
logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
4910
5301
|
evaluateJsCode(props2);
|
|
4911
|
-
runHttpRequests(props2, state2, elementRef2);
|
|
5302
|
+
runHttpRequests(props2, state2, showContentProps2, elementRef2);
|
|
4912
5303
|
emitStateUpdate(props2);
|
|
4913
5304
|
}, "EnableEditor_component_useTask_Nb2VI04qp0M", [
|
|
4914
5305
|
elementRef,
|
|
4915
5306
|
props,
|
|
5307
|
+
showContentProps,
|
|
4916
5308
|
state
|
|
4917
5309
|
]));
|
|
4918
5310
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4919
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5311
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4920
5312
|
track2(() => props2.content);
|
|
4921
5313
|
if (props2.content)
|
|
4922
|
-
mergeNewContent(props2, state2, elementRef2, props2.content);
|
|
5314
|
+
mergeNewContent(props2, state2, showContentProps2, elementRef2, props2.content);
|
|
4923
5315
|
}, "EnableEditor_component_useTask_1_m0y1Z9vk4eQ", [
|
|
4924
5316
|
elementRef,
|
|
4925
5317
|
props,
|
|
5318
|
+
showContentProps,
|
|
4926
5319
|
state
|
|
4927
5320
|
]));
|
|
4928
5321
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4929
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5322
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4930
5323
|
track2(() => {
|
|
4931
|
-
var
|
|
4932
|
-
return (
|
|
5324
|
+
var _a2, _b2;
|
|
5325
|
+
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
|
|
4933
5326
|
});
|
|
4934
5327
|
evaluateJsCode(props2);
|
|
4935
5328
|
}, "EnableEditor_component_useTask_2_xVyv0tDqZLs", [
|
|
4936
5329
|
elementRef,
|
|
4937
5330
|
props,
|
|
5331
|
+
showContentProps,
|
|
4938
5332
|
state
|
|
4939
5333
|
]));
|
|
4940
5334
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4941
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5335
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4942
5336
|
track2(() => {
|
|
4943
|
-
var
|
|
4944
|
-
return (
|
|
5337
|
+
var _a2, _b2;
|
|
5338
|
+
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.httpRequests;
|
|
4945
5339
|
});
|
|
4946
|
-
runHttpRequests(props2, state2, elementRef2);
|
|
5340
|
+
runHttpRequests(props2, state2, showContentProps2, elementRef2);
|
|
4947
5341
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
4948
5342
|
elementRef,
|
|
4949
5343
|
props,
|
|
5344
|
+
showContentProps,
|
|
4950
5345
|
state
|
|
4951
5346
|
]));
|
|
4952
5347
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4953
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5348
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4954
5349
|
track2(() => props2.builderContextSignal.rootState);
|
|
4955
5350
|
emitStateUpdate(props2);
|
|
4956
5351
|
}, "EnableEditor_component_useTask_4_moHYZG8uNVU", [
|
|
4957
5352
|
elementRef,
|
|
4958
5353
|
props,
|
|
5354
|
+
showContentProps,
|
|
4959
5355
|
state
|
|
4960
5356
|
]));
|
|
4961
5357
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4962
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5358
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4963
5359
|
track2(() => props2.data);
|
|
4964
5360
|
if (props2.data)
|
|
4965
|
-
mergeNewRootState(props2, state2, elementRef2, props2.data);
|
|
5361
|
+
mergeNewRootState(props2, state2, showContentProps2, elementRef2, props2.data);
|
|
4966
5362
|
}, "EnableEditor_component_useTask_5_24QxS0r0KF8", [
|
|
4967
5363
|
elementRef,
|
|
4968
5364
|
props,
|
|
5365
|
+
showContentProps,
|
|
4969
5366
|
state
|
|
4970
5367
|
]));
|
|
4971
5368
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4972
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5369
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4973
5370
|
track2(() => props2.locale);
|
|
4974
5371
|
if (props2.locale)
|
|
4975
|
-
mergeNewRootState(props2, state2, elementRef2, {
|
|
5372
|
+
mergeNewRootState(props2, state2, showContentProps2, elementRef2, {
|
|
4976
5373
|
locale: props2.locale
|
|
4977
5374
|
});
|
|
4978
5375
|
}, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
|
|
4979
5376
|
elementRef,
|
|
4980
5377
|
props,
|
|
5378
|
+
showContentProps,
|
|
4981
5379
|
state
|
|
4982
5380
|
]));
|
|
4983
5381
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
@@ -4986,69 +5384,58 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4986
5384
|
return props.apiKey;
|
|
4987
5385
|
},
|
|
4988
5386
|
get contentId() {
|
|
4989
|
-
var
|
|
4990
|
-
return (
|
|
5387
|
+
var _a2;
|
|
5388
|
+
return (_a2 = props.builderContextSignal.content) == null ? void 0 : _a2.id;
|
|
4991
5389
|
},
|
|
4992
5390
|
get variationId() {
|
|
4993
|
-
var
|
|
4994
|
-
return (
|
|
5391
|
+
var _a2;
|
|
5392
|
+
return (_a2 = props.builderContextSignal.content) == null ? void 0 : _a2.testVariationId;
|
|
4995
5393
|
},
|
|
4996
5394
|
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
4997
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
4998
|
-
return onClick(props2, state2, elementRef2, event);
|
|
5395
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
5396
|
+
return onClick(props2, state2, showContentProps2, elementRef2, event);
|
|
4999
5397
|
}, "EnableEditor_component__Fragment_onClick_b4nYT3DrjEk", [
|
|
5000
5398
|
elementRef,
|
|
5001
5399
|
props,
|
|
5400
|
+
showContentProps,
|
|
5002
5401
|
state
|
|
5003
5402
|
]),
|
|
5004
5403
|
ref: elementRef,
|
|
5005
5404
|
shouldTrack: String(props.builderContextSignal.content && getDefaultCanTrack(props.canTrack)),
|
|
5006
5405
|
get "builder-content-id"() {
|
|
5007
|
-
var
|
|
5008
|
-
return (
|
|
5406
|
+
var _a2;
|
|
5407
|
+
return (_a2 = props.builderContextSignal.content) == null ? void 0 : _a2.id;
|
|
5009
5408
|
},
|
|
5010
5409
|
get "builder-model"() {
|
|
5011
5410
|
return props.model;
|
|
5012
5411
|
},
|
|
5013
|
-
...
|
|
5014
|
-
hidden: true,
|
|
5015
|
-
"aria-hidden": true
|
|
5016
|
-
},
|
|
5412
|
+
...showContentProps.value,
|
|
5017
5413
|
...props.contentWrapperProps,
|
|
5018
|
-
get class() {
|
|
5019
|
-
var _a, _b;
|
|
5020
|
-
return `variant-${((_a = props.content) == null ? void 0 : _a.testVariationId) || ((_b = props.content) == null ? void 0 : _b.id)}`;
|
|
5021
|
-
},
|
|
5022
5414
|
children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0"),
|
|
5415
|
+
class: getWrapperClassName(((_a = props.content) == null ? void 0 : _a.testVariationId) || ((_b = props.content) == null ? void 0 : _b.id)),
|
|
5023
5416
|
[qwik._IMMUTABLE]: {
|
|
5024
5417
|
apiKey: qwik._fnSignal((p0) => p0.apiKey, [
|
|
5025
5418
|
props
|
|
5026
5419
|
], "p0.apiKey"),
|
|
5027
5420
|
"builder-content-id": qwik._fnSignal((p0) => {
|
|
5028
|
-
var
|
|
5029
|
-
return (
|
|
5421
|
+
var _a2;
|
|
5422
|
+
return (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.id;
|
|
5030
5423
|
}, [
|
|
5031
5424
|
props
|
|
5032
5425
|
], "p0.builderContextSignal.content?.id"),
|
|
5033
5426
|
"builder-model": qwik._fnSignal((p0) => p0.model, [
|
|
5034
5427
|
props
|
|
5035
5428
|
], "p0.model"),
|
|
5036
|
-
class: qwik._fnSignal((p0) => {
|
|
5037
|
-
var _a, _b;
|
|
5038
|
-
return `variant-${((_a = p0.content) == null ? void 0 : _a.testVariationId) || ((_b = p0.content) == null ? void 0 : _b.id)}`;
|
|
5039
|
-
}, [
|
|
5040
|
-
props
|
|
5041
|
-
], "`variant-${p0.content?.testVariationId||p0.content?.id}`"),
|
|
5042
5429
|
contentId: qwik._fnSignal((p0) => {
|
|
5043
|
-
var
|
|
5044
|
-
return (
|
|
5430
|
+
var _a2;
|
|
5431
|
+
return (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.id;
|
|
5045
5432
|
}, [
|
|
5046
5433
|
props
|
|
5047
5434
|
], "p0.builderContextSignal.content?.id"),
|
|
5048
5435
|
ref: qwik._IMMUTABLE,
|
|
5049
5436
|
variationId: qwik._fnSignal((p0) => {
|
|
5050
|
-
var
|
|
5051
|
-
return (
|
|
5437
|
+
var _a2;
|
|
5438
|
+
return (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.testVariationId;
|
|
5052
5439
|
}, [
|
|
5053
5440
|
props
|
|
5054
5441
|
], "p0.builderContextSignal.content?.testVariationId")
|
|
@@ -5056,71 +5443,6 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
5056
5443
|
}, 0, "06_1") : null
|
|
5057
5444
|
}, 1, "06_2");
|
|
5058
5445
|
}, "EnableEditor_component_ko1mO8oaj8k"));
|
|
5059
|
-
const getCssFromFont = (font) => {
|
|
5060
|
-
var _a;
|
|
5061
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
5062
|
-
const name = family.split(",")[0];
|
|
5063
|
-
const url = font.fileUrl ?? ((_a = font == null ? void 0 : font.files) == null ? void 0 : _a.regular);
|
|
5064
|
-
let str = "";
|
|
5065
|
-
if (url && family && name)
|
|
5066
|
-
str += `
|
|
5067
|
-
@font-face {
|
|
5068
|
-
font-family: "${family}";
|
|
5069
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
5070
|
-
font-display: fallback;
|
|
5071
|
-
font-weight: 400;
|
|
5072
|
-
}
|
|
5073
|
-
`.trim();
|
|
5074
|
-
if (font.files)
|
|
5075
|
-
for (const weight in font.files) {
|
|
5076
|
-
const isNumber = String(Number(weight)) === weight;
|
|
5077
|
-
if (!isNumber)
|
|
5078
|
-
continue;
|
|
5079
|
-
const weightUrl = font.files[weight];
|
|
5080
|
-
if (weightUrl && weightUrl !== url)
|
|
5081
|
-
str += `
|
|
5082
|
-
@font-face {
|
|
5083
|
-
font-family: "${family}";
|
|
5084
|
-
src: url('${weightUrl}') format('woff2');
|
|
5085
|
-
font-display: fallback;
|
|
5086
|
-
font-weight: ${weight};
|
|
5087
|
-
}
|
|
5088
|
-
`.trim();
|
|
5089
|
-
}
|
|
5090
|
-
return str;
|
|
5091
|
-
};
|
|
5092
|
-
const getFontCss = ({ customFonts }) => {
|
|
5093
|
-
var _a;
|
|
5094
|
-
return ((_a = customFonts == null ? void 0 : customFonts.map((font) => getCssFromFont(font))) == null ? void 0 : _a.join(" ")) || "";
|
|
5095
|
-
};
|
|
5096
|
-
const getCss = ({ cssCode, contentId }) => {
|
|
5097
|
-
if (!cssCode)
|
|
5098
|
-
return "";
|
|
5099
|
-
if (!contentId)
|
|
5100
|
-
return cssCode;
|
|
5101
|
-
return (cssCode == null ? void 0 : cssCode.replace(/&/g, `div[builder-content-id="${contentId}"]`)) || "";
|
|
5102
|
-
};
|
|
5103
|
-
const DEFAULT_STYLES = `
|
|
5104
|
-
.builder-button {
|
|
5105
|
-
all: unset;
|
|
5106
|
-
}
|
|
5107
|
-
|
|
5108
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
5109
|
-
margin: 0;
|
|
5110
|
-
}
|
|
5111
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
5112
|
-
color: inherit;
|
|
5113
|
-
line-height: inherit;
|
|
5114
|
-
letter-spacing: inherit;
|
|
5115
|
-
font-weight: inherit;
|
|
5116
|
-
font-size: inherit;
|
|
5117
|
-
text-align: inherit;
|
|
5118
|
-
font-family: inherit;
|
|
5119
|
-
}
|
|
5120
|
-
`;
|
|
5121
|
-
const getDefaultStyles = (isNested) => {
|
|
5122
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
5123
|
-
};
|
|
5124
5446
|
const ContentStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
5125
5447
|
const state = qwik.useStore({
|
|
5126
5448
|
injectedStyles: `
|
|
@@ -5725,7 +6047,7 @@ const fetchSymbolContent = async ({ builderContextValue, symbol }) => {
|
|
|
5725
6047
|
});
|
|
5726
6048
|
return void 0;
|
|
5727
6049
|
};
|
|
5728
|
-
const setContent = function setContent2(props, state) {
|
|
6050
|
+
const setContent = function setContent2(props, state, blocksWrapper, contentWrapper, className) {
|
|
5729
6051
|
if (state.contentToUse)
|
|
5730
6052
|
return;
|
|
5731
6053
|
fetchSymbolContent({
|
|
@@ -5738,6 +6060,12 @@ const setContent = function setContent2(props, state) {
|
|
|
5738
6060
|
};
|
|
5739
6061
|
const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
5740
6062
|
var _a;
|
|
6063
|
+
const blocksWrapper = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
6064
|
+
return "div";
|
|
6065
|
+
}, "Symbol_component_blocksWrapper_useComputed_B5dlF985gMM"));
|
|
6066
|
+
const contentWrapper = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
6067
|
+
return "div";
|
|
6068
|
+
}, "Symbol_component_contentWrapper_useComputed_EvmPpPj8JTo"));
|
|
5741
6069
|
const className = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
5742
6070
|
var _a2, _b;
|
|
5743
6071
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -5754,10 +6082,13 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
5754
6082
|
contentToUse: (_a = props.symbol) == null ? void 0 : _a.content
|
|
5755
6083
|
});
|
|
5756
6084
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
5757
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
6085
|
+
const [blocksWrapper2, className2, contentWrapper2, props2, state2] = qwik.useLexicalScope();
|
|
5758
6086
|
track2(() => props2.symbol);
|
|
5759
6087
|
setContent(props2, state2);
|
|
5760
6088
|
}, "Symbol_component_useTask_NIAWAC1bMBo", [
|
|
6089
|
+
blocksWrapper,
|
|
6090
|
+
className,
|
|
6091
|
+
contentWrapper,
|
|
5761
6092
|
props,
|
|
5762
6093
|
state
|
|
5763
6094
|
]));
|
|
@@ -5799,8 +6130,12 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
5799
6130
|
get linkComponent() {
|
|
5800
6131
|
return props.builderLinkComponent;
|
|
5801
6132
|
},
|
|
5802
|
-
blocksWrapper
|
|
5803
|
-
|
|
6133
|
+
get blocksWrapper() {
|
|
6134
|
+
return blocksWrapper.value;
|
|
6135
|
+
},
|
|
6136
|
+
get contentWrapper() {
|
|
6137
|
+
return contentWrapper.value;
|
|
6138
|
+
},
|
|
5804
6139
|
[qwik._IMMUTABLE]: {
|
|
5805
6140
|
apiKey: qwik._fnSignal((p0) => p0.builderContext.apiKey, [
|
|
5806
6141
|
props
|
|
@@ -5808,11 +6143,15 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
5808
6143
|
apiVersion: qwik._fnSignal((p0) => p0.builderContext.apiVersion, [
|
|
5809
6144
|
props
|
|
5810
6145
|
], "p0.builderContext.apiVersion"),
|
|
5811
|
-
blocksWrapper: qwik.
|
|
6146
|
+
blocksWrapper: qwik._fnSignal((p0) => p0.value, [
|
|
6147
|
+
blocksWrapper
|
|
6148
|
+
], "p0.value"),
|
|
5812
6149
|
content: qwik._fnSignal((p0) => p0.contentToUse, [
|
|
5813
6150
|
state
|
|
5814
6151
|
], "p0.contentToUse"),
|
|
5815
|
-
contentWrapper: qwik.
|
|
6152
|
+
contentWrapper: qwik._fnSignal((p0) => p0.value, [
|
|
6153
|
+
contentWrapper
|
|
6154
|
+
], "p0.value"),
|
|
5816
6155
|
context: qwik._fnSignal((p0) => {
|
|
5817
6156
|
var _a2;
|
|
5818
6157
|
return {
|