@builder.io/sdk-qwik 0.14.17 → 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 +584 -243
- package/lib/browser/index.qwik.mjs +584 -243
- package/lib/edge/index.qwik.cjs +584 -243
- package/lib/edge/index.qwik.mjs +584 -243
- package/lib/node/index.qwik.cjs +584 -243
- package/lib/node/index.qwik.mjs +584 -243
- 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
|
@@ -51,22 +51,26 @@ const getClassPropName = () => {
|
|
|
51
51
|
case "vue":
|
|
52
52
|
case "solid":
|
|
53
53
|
case "qwik":
|
|
54
|
+
case "angular":
|
|
54
55
|
return "class";
|
|
55
56
|
}
|
|
56
57
|
};
|
|
58
|
+
const attrs = function attrs2(props, state) {
|
|
59
|
+
return {
|
|
60
|
+
...props.attributes,
|
|
61
|
+
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
62
|
+
...props.link ? {
|
|
63
|
+
href: props.link,
|
|
64
|
+
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
65
|
+
role: "link"
|
|
66
|
+
} : {
|
|
67
|
+
role: "button"
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
57
71
|
const Button = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
58
72
|
return /* @__PURE__ */ qwik._jsxC(DynamicRenderer, {
|
|
59
|
-
attributes:
|
|
60
|
-
...props.attributes,
|
|
61
|
-
[getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
|
|
62
|
-
...props.link ? {
|
|
63
|
-
href: props.link,
|
|
64
|
-
target: props.openLinkInNewTab ? "_blank" : void 0,
|
|
65
|
-
role: "link"
|
|
66
|
-
} : {
|
|
67
|
-
role: "button"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
73
|
+
attributes: attrs(props),
|
|
70
74
|
get TagName() {
|
|
71
75
|
return props.link ? props.builderLinkComponent || "a" : "button";
|
|
72
76
|
},
|
|
@@ -566,6 +570,7 @@ function mapStyleObjToStrIfNeeded(style) {
|
|
|
566
570
|
case "svelte":
|
|
567
571
|
case "vue":
|
|
568
572
|
case "solid":
|
|
573
|
+
case "angular":
|
|
569
574
|
return convertStyleMapToCSSArray(style).join(" ");
|
|
570
575
|
case "qwik":
|
|
571
576
|
case "reactNative":
|
|
@@ -626,6 +631,23 @@ const getRepeatItemData = ({ block, context }) => {
|
|
|
626
631
|
}));
|
|
627
632
|
return repeatArray;
|
|
628
633
|
};
|
|
634
|
+
const shouldPassLinkComponent = (blockName) => {
|
|
635
|
+
return blockName && [
|
|
636
|
+
"Core:Button",
|
|
637
|
+
"Symbol",
|
|
638
|
+
"Columns",
|
|
639
|
+
"Form:Form",
|
|
640
|
+
"Builder: Tabs"
|
|
641
|
+
].includes(blockName);
|
|
642
|
+
};
|
|
643
|
+
const shouldPassRegisteredComponents = (blockName) => {
|
|
644
|
+
return blockName && [
|
|
645
|
+
"Symbol",
|
|
646
|
+
"Columns",
|
|
647
|
+
"Form:Form",
|
|
648
|
+
"Builder: Tabs"
|
|
649
|
+
].includes(blockName);
|
|
650
|
+
};
|
|
629
651
|
const SIZES = {
|
|
630
652
|
small: {
|
|
631
653
|
min: 320,
|
|
@@ -869,22 +891,35 @@ const BlockWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
869
891
|
}, 1, "87_1");
|
|
870
892
|
}, "BlockWrapper_component_kOI0j0aW8Nw"));
|
|
871
893
|
const InteractiveElement = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
894
|
+
const attributes = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
895
|
+
const [props2] = qwik.useLexicalScope();
|
|
896
|
+
return props2.includeBlockProps ? {
|
|
875
897
|
...getBlockProperties({
|
|
876
|
-
block:
|
|
877
|
-
context:
|
|
898
|
+
block: props2.block,
|
|
899
|
+
context: props2.context
|
|
878
900
|
}),
|
|
879
901
|
...getBlockActions({
|
|
880
|
-
block:
|
|
881
|
-
rootState:
|
|
882
|
-
rootSetState:
|
|
883
|
-
localState:
|
|
884
|
-
context:
|
|
902
|
+
block: props2.block,
|
|
903
|
+
rootState: props2.context.rootState,
|
|
904
|
+
rootSetState: props2.context.rootSetState,
|
|
905
|
+
localState: props2.context.localState,
|
|
906
|
+
context: props2.context.context
|
|
885
907
|
})
|
|
886
|
-
} : {}
|
|
887
|
-
|
|
908
|
+
} : {};
|
|
909
|
+
}, "InteractiveElement_component_attributes_useComputed_0kUhl8Qa4CE", [
|
|
910
|
+
props
|
|
911
|
+
]));
|
|
912
|
+
return /* @__PURE__ */ qwik._jsxC(props.Wrapper, {
|
|
913
|
+
...props.wrapperProps,
|
|
914
|
+
get attributes() {
|
|
915
|
+
return attributes.value;
|
|
916
|
+
},
|
|
917
|
+
children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "q0_0"),
|
|
918
|
+
[qwik._IMMUTABLE]: {
|
|
919
|
+
attributes: qwik._fnSignal((p0) => p0.value, [
|
|
920
|
+
attributes
|
|
921
|
+
], "p0.value")
|
|
922
|
+
}
|
|
888
923
|
}, 0, "q0_1");
|
|
889
924
|
}, "InteractiveElement_component_0UqfJpjhn0g"));
|
|
890
925
|
const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
|
|
@@ -1062,7 +1097,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1062
1097
|
repeatItem
|
|
1063
1098
|
]));
|
|
1064
1099
|
const componentRefProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1065
|
-
var _a2, _b, _c, _d, _e
|
|
1100
|
+
var _a2, _b, _c, _d, _e;
|
|
1066
1101
|
const [blockComponent2, processedBlock2, props2] = qwik.useLexicalScope();
|
|
1067
1102
|
return {
|
|
1068
1103
|
blockChildren: processedBlock2.value.children ?? [],
|
|
@@ -1070,10 +1105,10 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1070
1105
|
componentOptions: {
|
|
1071
1106
|
...getBlockComponentOptions(processedBlock2.value),
|
|
1072
1107
|
builderContext: props2.context,
|
|
1073
|
-
...((_b = blockComponent2.value) == null ? void 0 : _b.name)
|
|
1108
|
+
...shouldPassLinkComponent((_b = blockComponent2.value) == null ? void 0 : _b.name) ? {
|
|
1074
1109
|
builderLinkComponent: props2.linkComponent
|
|
1075
1110
|
} : {},
|
|
1076
|
-
...((
|
|
1111
|
+
...shouldPassRegisteredComponents((_c = blockComponent2.value) == null ? void 0 : _c.name) ? {
|
|
1077
1112
|
builderComponents: props2.registeredComponents
|
|
1078
1113
|
} : {}
|
|
1079
1114
|
},
|
|
@@ -1081,8 +1116,8 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1081
1116
|
linkComponent: props2.linkComponent,
|
|
1082
1117
|
registeredComponents: props2.registeredComponents,
|
|
1083
1118
|
builderBlock: processedBlock2.value,
|
|
1084
|
-
includeBlockProps: ((
|
|
1085
|
-
isInteractive: !((
|
|
1119
|
+
includeBlockProps: ((_d = blockComponent2.value) == null ? void 0 : _d.noWrap) === true,
|
|
1120
|
+
isInteractive: !((_e = blockComponent2.value) == null ? void 0 : _e.isRSC)
|
|
1086
1121
|
};
|
|
1087
1122
|
}, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
|
|
1088
1123
|
blockComponent,
|
|
@@ -1319,7 +1354,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1319
1354
|
}, 1, "jN_4") : null
|
|
1320
1355
|
}, 1, "jN_5");
|
|
1321
1356
|
}, "Block_component_nnPv0RY0U0k"));
|
|
1322
|
-
const onClick$1 = function onClick2(props, state) {
|
|
1357
|
+
const onClick$1 = function onClick2(props, state, className) {
|
|
1323
1358
|
var _a, _b;
|
|
1324
1359
|
if (isEditing() && !((_a = props.blocks) == null ? void 0 : _a.length))
|
|
1325
1360
|
(_b = window.parent) == null ? void 0 : _b.postMessage({
|
|
@@ -1330,7 +1365,7 @@ const onClick$1 = function onClick2(props, state) {
|
|
|
1330
1365
|
}
|
|
1331
1366
|
}, "*");
|
|
1332
1367
|
};
|
|
1333
|
-
const onMouseEnter = function onMouseEnter2(props, state) {
|
|
1368
|
+
const onMouseEnter = function onMouseEnter2(props, state, className) {
|
|
1334
1369
|
var _a, _b;
|
|
1335
1370
|
if (isEditing() && !((_a = props.blocks) == null ? void 0 : _a.length))
|
|
1336
1371
|
(_b = window.parent) == null ? void 0 : _b.postMessage({
|
|
@@ -1365,23 +1400,26 @@ const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
1365
1400
|
return props.styleProp;
|
|
1366
1401
|
},
|
|
1367
1402
|
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
1368
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1403
|
+
const [className2, props2, state2] = qwik.useLexicalScope();
|
|
1369
1404
|
return onClick$1(props2);
|
|
1370
1405
|
}, "BlocksWrapper_component_onClick_ufezvOupQrM", [
|
|
1406
|
+
className,
|
|
1371
1407
|
props,
|
|
1372
1408
|
state
|
|
1373
1409
|
]),
|
|
1374
1410
|
onKeyPress$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
1375
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1411
|
+
const [className2, props2, state2] = qwik.useLexicalScope();
|
|
1376
1412
|
return onClick$1(props2);
|
|
1377
1413
|
}, "BlocksWrapper_component_onKeyPress_9bz8vCQc3kg", [
|
|
1414
|
+
className,
|
|
1378
1415
|
props,
|
|
1379
1416
|
state
|
|
1380
1417
|
]),
|
|
1381
1418
|
onMouseEnter$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
1382
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1419
|
+
const [className2, props2, state2] = qwik.useLexicalScope();
|
|
1383
1420
|
return onMouseEnter(props2);
|
|
1384
1421
|
}, "BlocksWrapper_component_onMouseEnter_j4FJjnLtraQ", [
|
|
1422
|
+
className,
|
|
1385
1423
|
props,
|
|
1386
1424
|
state
|
|
1387
1425
|
]),
|
|
@@ -1494,6 +1532,12 @@ const Blocks = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl
|
|
|
1494
1532
|
function deoptSignal(value) {
|
|
1495
1533
|
return value;
|
|
1496
1534
|
}
|
|
1535
|
+
const getColumnsClass = (id) => {
|
|
1536
|
+
return `builder-columns ${id}-breakpoints`;
|
|
1537
|
+
};
|
|
1538
|
+
const getTagName = function getTagName2(props, state, column) {
|
|
1539
|
+
return column.link ? props.builderLinkComponent || "a" : "div";
|
|
1540
|
+
};
|
|
1497
1541
|
const getWidth = function getWidth2(props, state, index) {
|
|
1498
1542
|
var _a;
|
|
1499
1543
|
return ((_a = state.cols[index]) == null ? void 0 : _a.width) || 100 / state.cols.length;
|
|
@@ -1508,6 +1552,15 @@ const getTabletStyle = function getTabletStyle2(props, state, { stackedStyle, de
|
|
|
1508
1552
|
const getMobileStyle = function getMobileStyle2(props, state, { stackedStyle, desktopStyle }) {
|
|
1509
1553
|
return state.stackAt === "never" ? desktopStyle : stackedStyle;
|
|
1510
1554
|
};
|
|
1555
|
+
const columnsCssVars = function columnsCssVars2(props, state) {
|
|
1556
|
+
return {
|
|
1557
|
+
"--flex-dir": state.flexDir,
|
|
1558
|
+
"--flex-dir-tablet": getTabletStyle(props, state, {
|
|
1559
|
+
stackedStyle: state.flexDir,
|
|
1560
|
+
desktopStyle: "row"
|
|
1561
|
+
})
|
|
1562
|
+
};
|
|
1563
|
+
};
|
|
1511
1564
|
const columnCssVars = function columnCssVars2(props, state, index) {
|
|
1512
1565
|
const gutter = index === 0 ? 0 : state.gutterSize;
|
|
1513
1566
|
const width = getColumnCssWidth(props, state, index);
|
|
@@ -1547,90 +1600,68 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
|
|
|
1547
1600
|
const breakpointSizes = getSizesForBreakpoints(((_b = (_a = props.builderContext.content) == null ? void 0 : _a.meta) == null ? void 0 : _b.breakpoints) || {});
|
|
1548
1601
|
return breakpointSizes[size].max;
|
|
1549
1602
|
};
|
|
1550
|
-
const
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
1555
|
-
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
1556
|
-
stackAt: props.stackColumnsAt || "tablet"
|
|
1557
|
-
});
|
|
1558
|
-
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
|
|
1559
|
-
const columnsCssVars = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1560
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1561
|
-
return {
|
|
1562
|
-
"--flex-dir": state2.flexDir,
|
|
1563
|
-
"--flex-dir-tablet": getTabletStyle(props2, state2, {
|
|
1564
|
-
stackedStyle: state2.flexDir,
|
|
1565
|
-
desktopStyle: "row"
|
|
1566
|
-
})
|
|
1567
|
-
};
|
|
1568
|
-
}, "Columns_component_columnsCssVars_useComputed_adFEq2RWT9s", [
|
|
1569
|
-
props,
|
|
1570
|
-
state
|
|
1571
|
-
]));
|
|
1572
|
-
const columnsStyles = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1573
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
1574
|
-
return `
|
|
1575
|
-
@media (max-width: ${getWidthForBreakpointSize(props2, state2, "medium")}px) {
|
|
1576
|
-
.${props2.builderBlock.id}-breakpoints {
|
|
1603
|
+
const columnsStyles = function columnsStyles2(props, state) {
|
|
1604
|
+
return `
|
|
1605
|
+
@media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
|
|
1606
|
+
.${props.builderBlock.id}-breakpoints {
|
|
1577
1607
|
flex-direction: var(--flex-dir-tablet);
|
|
1578
1608
|
align-items: stretch;
|
|
1579
1609
|
}
|
|
1580
1610
|
|
|
1581
|
-
.${
|
|
1611
|
+
.${props.builderBlock.id}-breakpoints > .builder-column {
|
|
1582
1612
|
width: var(--column-width-tablet) !important;
|
|
1583
1613
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
1584
1614
|
}
|
|
1585
1615
|
}
|
|
1586
1616
|
|
|
1587
|
-
@media (max-width: ${getWidthForBreakpointSize(
|
|
1588
|
-
.${
|
|
1617
|
+
@media (max-width: ${getWidthForBreakpointSize(props, state, "small")}px) {
|
|
1618
|
+
.${props.builderBlock.id}-breakpoints {
|
|
1589
1619
|
flex-direction: var(--flex-dir);
|
|
1590
1620
|
align-items: stretch;
|
|
1591
1621
|
}
|
|
1592
1622
|
|
|
1593
|
-
.${
|
|
1623
|
+
.${props.builderBlock.id}-breakpoints > .builder-column {
|
|
1594
1624
|
width: var(--column-width-mobile) !important;
|
|
1595
1625
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
1596
1626
|
}
|
|
1597
1627
|
},
|
|
1598
1628
|
`;
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1629
|
+
};
|
|
1630
|
+
const getAttributes = function getAttributes2(props, state, column, index) {
|
|
1631
|
+
return {
|
|
1632
|
+
...column.link ? {
|
|
1633
|
+
href: column.link
|
|
1634
|
+
} : {},
|
|
1635
|
+
[getClassPropName()]: "builder-column",
|
|
1636
|
+
style: mapStyleObjToStrIfNeeded(columnCssVars(props, state, index))
|
|
1637
|
+
};
|
|
1638
|
+
};
|
|
1639
|
+
const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1640
|
+
var _a;
|
|
1641
|
+
qwik._jsxBranch();
|
|
1642
|
+
const state = qwik.useStore({
|
|
1643
|
+
cols: props.columns || [],
|
|
1644
|
+
flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
1645
|
+
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
1646
|
+
stackAt: props.stackColumnsAt || "tablet"
|
|
1647
|
+
});
|
|
1648
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
|
|
1649
|
+
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
1650
|
+
class: getColumnsClass((_a = props.builderBlock) == null ? void 0 : _a.id) + " div-Columns",
|
|
1651
|
+
style: columnsCssVars(props, state)
|
|
1652
|
+
}, null, [
|
|
1611
1653
|
/* @__PURE__ */ qwik._jsxC(InlinedStyles, {
|
|
1612
1654
|
id: "builderio-columns",
|
|
1613
|
-
|
|
1614
|
-
return columnsStyles.value;
|
|
1615
|
-
},
|
|
1655
|
+
styles: columnsStyles(props, state),
|
|
1616
1656
|
[qwik._IMMUTABLE]: {
|
|
1617
|
-
id: qwik._IMMUTABLE
|
|
1618
|
-
styles: qwik._fnSignal((p0) => p0.value, [
|
|
1619
|
-
columnsStyles
|
|
1620
|
-
], "p0.value")
|
|
1657
|
+
id: qwik._IMMUTABLE
|
|
1621
1658
|
}
|
|
1622
1659
|
}, 3, "c0_0"),
|
|
1623
1660
|
(props.columns || []).map((column, index) => {
|
|
1624
1661
|
return /* @__PURE__ */ qwik._jsxC(DynamicRenderer, {
|
|
1625
|
-
TagName:
|
|
1662
|
+
TagName: getTagName(props, state, column),
|
|
1626
1663
|
actionAttributes: {},
|
|
1627
|
-
attributes:
|
|
1628
|
-
...column.link ? {
|
|
1629
|
-
href: column.link
|
|
1630
|
-
} : {},
|
|
1631
|
-
[getClassPropName()]: "builder-column",
|
|
1632
|
-
style: mapStyleObjToStrIfNeeded(columnCssVars(props, state, index))
|
|
1633
|
-
},
|
|
1664
|
+
attributes: getAttributes(props, state, column, index),
|
|
1634
1665
|
children: /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
1635
1666
|
path: `component.options.columns.${index}.blocks`,
|
|
1636
1667
|
get parent() {
|
|
@@ -1738,7 +1769,7 @@ function getSrcSet(url) {
|
|
|
1738
1769
|
return url;
|
|
1739
1770
|
}
|
|
1740
1771
|
const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1741
|
-
var _a, _b, _c, _d;
|
|
1772
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1742
1773
|
qwik._jsxBranch();
|
|
1743
1774
|
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$1, "Image_component_useStylesScoped_fBMYiVf9fuU"));
|
|
1744
1775
|
const srcSetToUse = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
@@ -1834,7 +1865,7 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1834
1865
|
], '{paddingTop:p0.aspectRatio*100+"%"}')
|
|
1835
1866
|
}, null, 3, "0A_1") : null,
|
|
1836
1867
|
((_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,
|
|
1837
|
-
!props.fitContent && props.children ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
1868
|
+
!props.fitContent && ((_f = (_e = props.builderBlock) == null ? void 0 : _e.children) == null ? void 0 : _f.length) ? /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
1838
1869
|
class: "div-Image-2"
|
|
1839
1870
|
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "0A_3"), 1, "0A_4") : null
|
|
1840
1871
|
]
|
|
@@ -2053,7 +2084,7 @@ const handleABTesting = async ({ item, canTrack }) => {
|
|
|
2053
2084
|
};
|
|
2054
2085
|
};
|
|
2055
2086
|
const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2056
|
-
const componentInfo$
|
|
2087
|
+
const componentInfo$g = {
|
|
2057
2088
|
name: "Core:Button",
|
|
2058
2089
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
2059
2090
|
defaultStyles: {
|
|
@@ -2091,7 +2122,7 @@ const componentInfo$f = {
|
|
|
2091
2122
|
static: true,
|
|
2092
2123
|
noWrap: true
|
|
2093
2124
|
};
|
|
2094
|
-
const componentInfo$
|
|
2125
|
+
const componentInfo$f = {
|
|
2095
2126
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
2096
2127
|
name: "Columns",
|
|
2097
2128
|
isRSC: true,
|
|
@@ -2333,14 +2364,14 @@ const componentInfo$e = {
|
|
|
2333
2364
|
}
|
|
2334
2365
|
]
|
|
2335
2366
|
};
|
|
2336
|
-
const componentInfo$
|
|
2367
|
+
const componentInfo$e = {
|
|
2337
2368
|
name: "Fragment",
|
|
2338
2369
|
static: true,
|
|
2339
2370
|
hidden: true,
|
|
2340
2371
|
canHaveChildren: true,
|
|
2341
2372
|
noWrap: true
|
|
2342
2373
|
};
|
|
2343
|
-
const componentInfo$
|
|
2374
|
+
const componentInfo$d = {
|
|
2344
2375
|
name: "Image",
|
|
2345
2376
|
static: true,
|
|
2346
2377
|
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",
|
|
@@ -2488,7 +2519,7 @@ const componentInfo$c = {
|
|
|
2488
2519
|
}
|
|
2489
2520
|
]
|
|
2490
2521
|
};
|
|
2491
|
-
const componentInfo$
|
|
2522
|
+
const componentInfo$c = {
|
|
2492
2523
|
name: "Core:Section",
|
|
2493
2524
|
static: true,
|
|
2494
2525
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2533,7 +2564,7 @@ const componentInfo$b = {
|
|
|
2533
2564
|
}
|
|
2534
2565
|
]
|
|
2535
2566
|
};
|
|
2536
|
-
const componentInfo$
|
|
2567
|
+
const componentInfo$b = {
|
|
2537
2568
|
name: "Slot",
|
|
2538
2569
|
isRSC: true,
|
|
2539
2570
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -2588,7 +2619,7 @@ const Slot = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2588
2619
|
}
|
|
2589
2620
|
}, 0, "B1_1");
|
|
2590
2621
|
}, "Slot_component_WWgWgfV0bb0"));
|
|
2591
|
-
const componentInfo$
|
|
2622
|
+
const componentInfo$a = {
|
|
2592
2623
|
name: "Symbol",
|
|
2593
2624
|
noWrap: true,
|
|
2594
2625
|
static: true,
|
|
@@ -2628,6 +2659,282 @@ const componentInfo$9 = {
|
|
|
2628
2659
|
}
|
|
2629
2660
|
]
|
|
2630
2661
|
};
|
|
2662
|
+
const defaultTab = {
|
|
2663
|
+
"@type": "@builder.io/sdk:Element",
|
|
2664
|
+
responsiveStyles: {
|
|
2665
|
+
large: {
|
|
2666
|
+
paddingLeft: "20px",
|
|
2667
|
+
paddingRight: "20px",
|
|
2668
|
+
paddingTop: "10px",
|
|
2669
|
+
paddingBottom: "10px",
|
|
2670
|
+
minWidth: "100px",
|
|
2671
|
+
textAlign: "center",
|
|
2672
|
+
display: "flex",
|
|
2673
|
+
flexDirection: "column",
|
|
2674
|
+
cursor: "pointer",
|
|
2675
|
+
userSelect: "none"
|
|
2676
|
+
}
|
|
2677
|
+
},
|
|
2678
|
+
component: {
|
|
2679
|
+
name: "Text",
|
|
2680
|
+
options: {
|
|
2681
|
+
text: "New tab"
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
};
|
|
2685
|
+
const defaultElement = {
|
|
2686
|
+
"@type": "@builder.io/sdk:Element",
|
|
2687
|
+
responsiveStyles: {
|
|
2688
|
+
large: {
|
|
2689
|
+
height: "200px",
|
|
2690
|
+
display: "flex",
|
|
2691
|
+
marginTop: "20px",
|
|
2692
|
+
flexDirection: "column"
|
|
2693
|
+
}
|
|
2694
|
+
},
|
|
2695
|
+
component: {
|
|
2696
|
+
name: "Text",
|
|
2697
|
+
options: {
|
|
2698
|
+
text: "New tab content "
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
};
|
|
2702
|
+
const componentInfo$9 = {
|
|
2703
|
+
name: "Builder: Tabs",
|
|
2704
|
+
inputs: [
|
|
2705
|
+
{
|
|
2706
|
+
name: "tabs",
|
|
2707
|
+
type: "list",
|
|
2708
|
+
broadcast: true,
|
|
2709
|
+
subFields: [
|
|
2710
|
+
{
|
|
2711
|
+
name: "label",
|
|
2712
|
+
type: "uiBlocks",
|
|
2713
|
+
hideFromUI: true,
|
|
2714
|
+
defaultValue: [
|
|
2715
|
+
defaultTab
|
|
2716
|
+
]
|
|
2717
|
+
},
|
|
2718
|
+
{
|
|
2719
|
+
name: "content",
|
|
2720
|
+
type: "uiBlocks",
|
|
2721
|
+
hideFromUI: true,
|
|
2722
|
+
defaultValue: [
|
|
2723
|
+
defaultElement
|
|
2724
|
+
]
|
|
2725
|
+
}
|
|
2726
|
+
],
|
|
2727
|
+
defaultValue: [
|
|
2728
|
+
{
|
|
2729
|
+
label: [
|
|
2730
|
+
{
|
|
2731
|
+
...defaultTab,
|
|
2732
|
+
component: {
|
|
2733
|
+
name: "Text",
|
|
2734
|
+
options: {
|
|
2735
|
+
text: "Tab 1"
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
],
|
|
2740
|
+
content: [
|
|
2741
|
+
{
|
|
2742
|
+
...defaultElement,
|
|
2743
|
+
component: {
|
|
2744
|
+
name: "Text",
|
|
2745
|
+
options: {
|
|
2746
|
+
text: "Tab 1 content"
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
]
|
|
2751
|
+
},
|
|
2752
|
+
{
|
|
2753
|
+
label: [
|
|
2754
|
+
{
|
|
2755
|
+
...defaultTab,
|
|
2756
|
+
component: {
|
|
2757
|
+
name: "Text",
|
|
2758
|
+
options: {
|
|
2759
|
+
text: "Tab 2"
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
],
|
|
2764
|
+
content: [
|
|
2765
|
+
{
|
|
2766
|
+
...defaultElement,
|
|
2767
|
+
component: {
|
|
2768
|
+
name: "Text",
|
|
2769
|
+
options: {
|
|
2770
|
+
text: "Tab 2 content"
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
]
|
|
2775
|
+
}
|
|
2776
|
+
]
|
|
2777
|
+
},
|
|
2778
|
+
{
|
|
2779
|
+
name: "activeTabStyle",
|
|
2780
|
+
type: "uiStyle",
|
|
2781
|
+
helperText: "CSS styles for the active tab",
|
|
2782
|
+
defaultValue: {
|
|
2783
|
+
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
2784
|
+
}
|
|
2785
|
+
},
|
|
2786
|
+
{
|
|
2787
|
+
name: "defaultActiveTab",
|
|
2788
|
+
type: "number",
|
|
2789
|
+
helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
|
|
2790
|
+
defaultValue: 1,
|
|
2791
|
+
advanced: true
|
|
2792
|
+
},
|
|
2793
|
+
{
|
|
2794
|
+
name: "collapsible",
|
|
2795
|
+
type: "boolean",
|
|
2796
|
+
helperText: "If on, clicking an open tab closes it so no tabs are active",
|
|
2797
|
+
defaultValue: false,
|
|
2798
|
+
advanced: true
|
|
2799
|
+
},
|
|
2800
|
+
{
|
|
2801
|
+
name: "tabHeaderLayout",
|
|
2802
|
+
type: "enum",
|
|
2803
|
+
helperText: "Change the layout of the tab headers (uses justify-content)",
|
|
2804
|
+
defaultValue: "flex-start",
|
|
2805
|
+
enum: [
|
|
2806
|
+
{
|
|
2807
|
+
label: "Center",
|
|
2808
|
+
value: "center"
|
|
2809
|
+
},
|
|
2810
|
+
{
|
|
2811
|
+
label: "Space between",
|
|
2812
|
+
value: "space-between"
|
|
2813
|
+
},
|
|
2814
|
+
{
|
|
2815
|
+
label: "Space around",
|
|
2816
|
+
value: "space-around"
|
|
2817
|
+
},
|
|
2818
|
+
{
|
|
2819
|
+
label: "Left",
|
|
2820
|
+
value: "flex-start"
|
|
2821
|
+
},
|
|
2822
|
+
{
|
|
2823
|
+
label: "Right",
|
|
2824
|
+
value: "flex-end"
|
|
2825
|
+
}
|
|
2826
|
+
]
|
|
2827
|
+
}
|
|
2828
|
+
]
|
|
2829
|
+
};
|
|
2830
|
+
const activeTabContent = function activeTabContent2(props, state, active) {
|
|
2831
|
+
return props.tabs && props.tabs[active].content;
|
|
2832
|
+
};
|
|
2833
|
+
const getActiveTabStyle = function getActiveTabStyle2(props, state, index) {
|
|
2834
|
+
return state.activeTab === index ? props.activeTabStyle : {};
|
|
2835
|
+
};
|
|
2836
|
+
const Tabs = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2837
|
+
qwik._jsxBranch();
|
|
2838
|
+
const state = qwik.useStore({
|
|
2839
|
+
activeTab: props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
|
|
2840
|
+
});
|
|
2841
|
+
return /* @__PURE__ */ qwik._jsxQ("div", null, null, [
|
|
2842
|
+
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
2843
|
+
class: "builder-tabs-wrap",
|
|
2844
|
+
style: qwik._fnSignal((p0) => ({
|
|
2845
|
+
display: "flex",
|
|
2846
|
+
flexDirection: "row",
|
|
2847
|
+
justifyContent: p0.tabHeaderLayout || "flex-start",
|
|
2848
|
+
overflow: "auto"
|
|
2849
|
+
}), [
|
|
2850
|
+
props
|
|
2851
|
+
], '{display:"flex",flexDirection:"row",justifyContent:p0.tabHeaderLayout||"flex-start",overflow:"auto"}')
|
|
2852
|
+
}, (props.tabs || []).map((tab, index) => {
|
|
2853
|
+
return /* @__PURE__ */ qwik._jsxQ("span", {
|
|
2854
|
+
class: `builder-tab-wrap ${state.activeTab === index ? "builder-tab-active" : ""}`,
|
|
2855
|
+
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
2856
|
+
const [index2, props2, state2] = qwik.useLexicalScope();
|
|
2857
|
+
if (index2 === state2.activeTab && props2.collapsible)
|
|
2858
|
+
state2.activeTab = -1;
|
|
2859
|
+
else
|
|
2860
|
+
state2.activeTab = index2;
|
|
2861
|
+
}, "Tabs_component_div_div_span_onClick_hSTBabAHGks", [
|
|
2862
|
+
index,
|
|
2863
|
+
props,
|
|
2864
|
+
state
|
|
2865
|
+
]),
|
|
2866
|
+
style: getActiveTabStyle(props, state, index)
|
|
2867
|
+
}, null, /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
2868
|
+
get parent() {
|
|
2869
|
+
return props.builderBlock.id;
|
|
2870
|
+
},
|
|
2871
|
+
path: `component.options.tabs.${index}.label`,
|
|
2872
|
+
get blocks() {
|
|
2873
|
+
return tab.label;
|
|
2874
|
+
},
|
|
2875
|
+
get context() {
|
|
2876
|
+
return props.builderContext;
|
|
2877
|
+
},
|
|
2878
|
+
get registeredComponents() {
|
|
2879
|
+
return props.builderComponents;
|
|
2880
|
+
},
|
|
2881
|
+
get linkComponent() {
|
|
2882
|
+
return props.builderLinkComponent;
|
|
2883
|
+
},
|
|
2884
|
+
[qwik._IMMUTABLE]: {
|
|
2885
|
+
blocks: qwik._wrapProp(tab, "label"),
|
|
2886
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
2887
|
+
props
|
|
2888
|
+
], "p0.builderContext"),
|
|
2889
|
+
linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
|
|
2890
|
+
props
|
|
2891
|
+
], "p0.builderLinkComponent"),
|
|
2892
|
+
parent: qwik._fnSignal((p0) => p0.builderBlock.id, [
|
|
2893
|
+
props
|
|
2894
|
+
], "p0.builderBlock.id"),
|
|
2895
|
+
registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
|
|
2896
|
+
props
|
|
2897
|
+
], "p0.builderComponents")
|
|
2898
|
+
}
|
|
2899
|
+
}, 3, "6k_0"), 0, index);
|
|
2900
|
+
}), 1, null),
|
|
2901
|
+
activeTabContent(props, state, state.activeTab) ? /* @__PURE__ */ qwik._jsxQ("div", null, null, /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
2902
|
+
get parent() {
|
|
2903
|
+
return props.builderBlock.id;
|
|
2904
|
+
},
|
|
2905
|
+
get path() {
|
|
2906
|
+
return `component.options.tabs.${state.activeTab}.content`;
|
|
2907
|
+
},
|
|
2908
|
+
blocks: activeTabContent(props, state, state.activeTab),
|
|
2909
|
+
get context() {
|
|
2910
|
+
return props.builderContext;
|
|
2911
|
+
},
|
|
2912
|
+
get registeredComponents() {
|
|
2913
|
+
return props.builderComponents;
|
|
2914
|
+
},
|
|
2915
|
+
get linkComponent() {
|
|
2916
|
+
return props.builderLinkComponent;
|
|
2917
|
+
},
|
|
2918
|
+
[qwik._IMMUTABLE]: {
|
|
2919
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
2920
|
+
props
|
|
2921
|
+
], "p0.builderContext"),
|
|
2922
|
+
linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
|
|
2923
|
+
props
|
|
2924
|
+
], "p0.builderLinkComponent"),
|
|
2925
|
+
parent: qwik._fnSignal((p0) => p0.builderBlock.id, [
|
|
2926
|
+
props
|
|
2927
|
+
], "p0.builderBlock.id"),
|
|
2928
|
+
path: qwik._fnSignal((p0) => `component.options.tabs.${p0.activeTab}.content`, [
|
|
2929
|
+
state
|
|
2930
|
+
], "`component.options.tabs.${p0.activeTab}.content`"),
|
|
2931
|
+
registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
|
|
2932
|
+
props
|
|
2933
|
+
], "p0.builderComponents")
|
|
2934
|
+
}
|
|
2935
|
+
}, 3, "6k_1"), 1, "6k_2") : null
|
|
2936
|
+
], 1, "6k_3");
|
|
2937
|
+
}, "Tabs_component_MhWcxXy0lMY"));
|
|
2631
2938
|
const componentInfo$8 = {
|
|
2632
2939
|
name: "Text",
|
|
2633
2940
|
static: true,
|
|
@@ -3907,36 +4214,42 @@ const getExtraComponents = () => [
|
|
|
3907
4214
|
const getDefaultRegisteredComponents = () => [
|
|
3908
4215
|
{
|
|
3909
4216
|
component: Button,
|
|
3910
|
-
...componentInfo$
|
|
4217
|
+
...componentInfo$g
|
|
3911
4218
|
},
|
|
3912
4219
|
{
|
|
3913
4220
|
component: Columns,
|
|
3914
|
-
...componentInfo$
|
|
4221
|
+
...componentInfo$f
|
|
3915
4222
|
},
|
|
3916
4223
|
{
|
|
3917
4224
|
component: FragmentComponent,
|
|
3918
|
-
...componentInfo$
|
|
4225
|
+
...componentInfo$e
|
|
3919
4226
|
},
|
|
3920
4227
|
{
|
|
3921
4228
|
component: Image,
|
|
3922
|
-
...componentInfo$
|
|
4229
|
+
...componentInfo$d
|
|
3923
4230
|
},
|
|
3924
4231
|
{
|
|
3925
4232
|
component: SectionComponent,
|
|
3926
|
-
...componentInfo$
|
|
4233
|
+
...componentInfo$c
|
|
3927
4234
|
},
|
|
3928
4235
|
{
|
|
3929
4236
|
component: Slot,
|
|
3930
|
-
...componentInfo$
|
|
4237
|
+
...componentInfo$b
|
|
3931
4238
|
},
|
|
3932
4239
|
{
|
|
3933
4240
|
component: Symbol$1,
|
|
3934
|
-
...componentInfo$
|
|
4241
|
+
...componentInfo$a
|
|
3935
4242
|
},
|
|
3936
4243
|
{
|
|
3937
4244
|
component: Text,
|
|
3938
4245
|
...componentInfo$8
|
|
3939
4246
|
},
|
|
4247
|
+
...[
|
|
4248
|
+
{
|
|
4249
|
+
component: Tabs,
|
|
4250
|
+
...componentInfo$9
|
|
4251
|
+
}
|
|
4252
|
+
],
|
|
3940
4253
|
...getExtraComponents()
|
|
3941
4254
|
];
|
|
3942
4255
|
const createRegisterComponentMessage = (info) => ({
|
|
@@ -4382,7 +4695,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4382
4695
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
4383
4696
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
4384
4697
|
}
|
|
4385
|
-
const SDK_VERSION = "0.14.
|
|
4698
|
+
const SDK_VERSION = "0.14.18";
|
|
4386
4699
|
const registry = {};
|
|
4387
4700
|
function register(type, info) {
|
|
4388
4701
|
let typeList = registry[type];
|
|
@@ -4565,7 +4878,75 @@ const subscribeToEditor = (model, callback, options) => {
|
|
|
4565
4878
|
window.removeEventListener("message", listener);
|
|
4566
4879
|
};
|
|
4567
4880
|
};
|
|
4568
|
-
const
|
|
4881
|
+
const getCssFromFont = (font) => {
|
|
4882
|
+
var _a;
|
|
4883
|
+
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
4884
|
+
const name = family.split(",")[0];
|
|
4885
|
+
const url = font.fileUrl ?? ((_a = font == null ? void 0 : font.files) == null ? void 0 : _a.regular);
|
|
4886
|
+
let str = "";
|
|
4887
|
+
if (url && family && name)
|
|
4888
|
+
str += `
|
|
4889
|
+
@font-face {
|
|
4890
|
+
font-family: "${family}";
|
|
4891
|
+
src: local("${name}"), url('${url}') format('woff2');
|
|
4892
|
+
font-display: fallback;
|
|
4893
|
+
font-weight: 400;
|
|
4894
|
+
}
|
|
4895
|
+
`.trim();
|
|
4896
|
+
if (font.files)
|
|
4897
|
+
for (const weight in font.files) {
|
|
4898
|
+
const isNumber = String(Number(weight)) === weight;
|
|
4899
|
+
if (!isNumber)
|
|
4900
|
+
continue;
|
|
4901
|
+
const weightUrl = font.files[weight];
|
|
4902
|
+
if (weightUrl && weightUrl !== url)
|
|
4903
|
+
str += `
|
|
4904
|
+
@font-face {
|
|
4905
|
+
font-family: "${family}";
|
|
4906
|
+
src: url('${weightUrl}') format('woff2');
|
|
4907
|
+
font-display: fallback;
|
|
4908
|
+
font-weight: ${weight};
|
|
4909
|
+
}
|
|
4910
|
+
`.trim();
|
|
4911
|
+
}
|
|
4912
|
+
return str;
|
|
4913
|
+
};
|
|
4914
|
+
const getFontCss = ({ customFonts }) => {
|
|
4915
|
+
var _a;
|
|
4916
|
+
return ((_a = customFonts == null ? void 0 : customFonts.map((font) => getCssFromFont(font))) == null ? void 0 : _a.join(" ")) || "";
|
|
4917
|
+
};
|
|
4918
|
+
const getCss = ({ cssCode, contentId }) => {
|
|
4919
|
+
if (!cssCode)
|
|
4920
|
+
return "";
|
|
4921
|
+
if (!contentId)
|
|
4922
|
+
return cssCode;
|
|
4923
|
+
return (cssCode == null ? void 0 : cssCode.replace(/&/g, `div[builder-content-id="${contentId}"]`)) || "";
|
|
4924
|
+
};
|
|
4925
|
+
const DEFAULT_STYLES = `
|
|
4926
|
+
.builder-button {
|
|
4927
|
+
all: unset;
|
|
4928
|
+
}
|
|
4929
|
+
|
|
4930
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
4931
|
+
margin: 0;
|
|
4932
|
+
}
|
|
4933
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
4934
|
+
color: inherit;
|
|
4935
|
+
line-height: inherit;
|
|
4936
|
+
letter-spacing: inherit;
|
|
4937
|
+
font-weight: inherit;
|
|
4938
|
+
font-size: inherit;
|
|
4939
|
+
text-align: inherit;
|
|
4940
|
+
font-family: inherit;
|
|
4941
|
+
}
|
|
4942
|
+
`;
|
|
4943
|
+
const getDefaultStyles = (isNested) => {
|
|
4944
|
+
return !isNested ? DEFAULT_STYLES : "";
|
|
4945
|
+
};
|
|
4946
|
+
const getWrapperClassName = (variationId) => {
|
|
4947
|
+
return `variant-${variationId}`;
|
|
4948
|
+
};
|
|
4949
|
+
const mergeNewRootState = function mergeNewRootState22(props, state, showContentProps, elementRef, newData) {
|
|
4569
4950
|
var _a, _b;
|
|
4570
4951
|
const combinedState = {
|
|
4571
4952
|
...props.builderContextSignal.rootState,
|
|
@@ -4576,7 +4957,7 @@ const mergeNewRootState = function mergeNewRootState22(props, state, elementRef,
|
|
|
4576
4957
|
else
|
|
4577
4958
|
props.builderContextSignal.rootState = combinedState;
|
|
4578
4959
|
};
|
|
4579
|
-
const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
|
|
4960
|
+
const mergeNewContent = function mergeNewContent2(props, state, showContentProps, elementRef, newContent) {
|
|
4580
4961
|
var _a, _b, _c, _d, _e;
|
|
4581
4962
|
const newContentValue = {
|
|
4582
4963
|
...props.builderContextSignal.content,
|
|
@@ -4593,7 +4974,7 @@ const mergeNewContent = function mergeNewContent2(props, state, elementRef, newC
|
|
|
4593
4974
|
};
|
|
4594
4975
|
props.builderContextSignal.content = newContentValue;
|
|
4595
4976
|
};
|
|
4596
|
-
const processMessage = function processMessage2(props, state, elementRef, event) {
|
|
4977
|
+
const processMessage = function processMessage2(props, state, showContentProps, elementRef, event) {
|
|
4597
4978
|
return createEditorListener({
|
|
4598
4979
|
model: props.model,
|
|
4599
4980
|
trustedHosts: props.trustedHosts,
|
|
@@ -4604,7 +4985,7 @@ const processMessage = function processMessage2(props, state, elementRef, event)
|
|
|
4604
4985
|
if (!contentId || contentId !== ((_a = props.builderContextSignal.content) == null ? void 0 : _a.id))
|
|
4605
4986
|
return;
|
|
4606
4987
|
if (breakpoints)
|
|
4607
|
-
mergeNewContent(props, state, elementRef, {
|
|
4988
|
+
mergeNewContent(props, state, showContentProps, elementRef, {
|
|
4608
4989
|
meta: {
|
|
4609
4990
|
breakpoints
|
|
4610
4991
|
}
|
|
@@ -4614,12 +4995,12 @@ const processMessage = function processMessage2(props, state, elementRef, event)
|
|
|
4614
4995
|
triggerAnimation(animation);
|
|
4615
4996
|
},
|
|
4616
4997
|
contentUpdate: (newContent) => {
|
|
4617
|
-
mergeNewContent(props, state, elementRef, newContent);
|
|
4998
|
+
mergeNewContent(props, state, showContentProps, elementRef, newContent);
|
|
4618
4999
|
}
|
|
4619
5000
|
}
|
|
4620
5001
|
})(event);
|
|
4621
5002
|
};
|
|
4622
|
-
const evaluateJsCode = function evaluateJsCode2(props, state, elementRef) {
|
|
5003
|
+
const evaluateJsCode = function evaluateJsCode2(props, state, showContentProps, elementRef) {
|
|
4623
5004
|
var _a, _b;
|
|
4624
5005
|
const jsCode = (_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.jsCode;
|
|
4625
5006
|
if (jsCode)
|
|
@@ -4635,7 +5016,7 @@ const evaluateJsCode = function evaluateJsCode2(props, state, elementRef) {
|
|
|
4635
5016
|
enableCache: false
|
|
4636
5017
|
});
|
|
4637
5018
|
};
|
|
4638
|
-
const onClick = function onClick22(props, state, elementRef, event) {
|
|
5019
|
+
const onClick = function onClick22(props, state, showContentProps, elementRef, event) {
|
|
4639
5020
|
var _a, _b;
|
|
4640
5021
|
if (props.builderContextSignal.content) {
|
|
4641
5022
|
const variationId = (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
|
|
@@ -4653,7 +5034,7 @@ const onClick = function onClick22(props, state, elementRef, event) {
|
|
|
4653
5034
|
if (!state.clicked)
|
|
4654
5035
|
state.clicked = true;
|
|
4655
5036
|
};
|
|
4656
|
-
const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
5037
|
+
const runHttpRequests = function runHttpRequests2(props, state, showContentProps, elementRef) {
|
|
4657
5038
|
var _a, _b;
|
|
4658
5039
|
const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
|
|
4659
5040
|
Object.entries(requests).forEach(([key, url]) => {
|
|
@@ -4673,7 +5054,7 @@ const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
|
4673
5054
|
enableCache: true
|
|
4674
5055
|
})));
|
|
4675
5056
|
fetch$1(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4676
|
-
mergeNewRootState(props, state, elementRef, {
|
|
5057
|
+
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
4677
5058
|
[key]: json
|
|
4678
5059
|
});
|
|
4679
5060
|
state.httpReqsData[key] = true;
|
|
@@ -4684,7 +5065,7 @@ const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
|
4684
5065
|
});
|
|
4685
5066
|
});
|
|
4686
5067
|
};
|
|
4687
|
-
const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
5068
|
+
const emitStateUpdate = function emitStateUpdate2(props, state, showContentProps, elementRef) {
|
|
4688
5069
|
if (isEditing())
|
|
4689
5070
|
window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
|
|
4690
5071
|
detail: {
|
|
@@ -4696,7 +5077,17 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
4696
5077
|
}));
|
|
4697
5078
|
};
|
|
4698
5079
|
const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
5080
|
+
var _a, _b;
|
|
4699
5081
|
qwik._jsxBranch();
|
|
5082
|
+
const showContentProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
5083
|
+
const [props2] = qwik.useLexicalScope();
|
|
5084
|
+
return props2.showContent ? {} : {
|
|
5085
|
+
hidden: true,
|
|
5086
|
+
"aria-hidden": true
|
|
5087
|
+
};
|
|
5088
|
+
}, "EnableEditor_component_showContentProps_useComputed_aHr3V0Y8sNs", [
|
|
5089
|
+
props
|
|
5090
|
+
]));
|
|
4700
5091
|
const elementRef = qwik.useSignal();
|
|
4701
5092
|
const state = qwik.useStore({
|
|
4702
5093
|
ContentWrapper: props.contentWrapper || "div",
|
|
@@ -4707,8 +5098,8 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4707
5098
|
deep: true
|
|
4708
5099
|
});
|
|
4709
5100
|
qwik.useOn("initeditingbldr", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
4710
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
4711
|
-
window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
|
|
5101
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
5102
|
+
window.addEventListener("message", processMessage.bind(null, props2, state2, showContentProps2, elementRef2));
|
|
4712
5103
|
registerInsertMenu();
|
|
4713
5104
|
setupBrowserForEditing({
|
|
4714
5105
|
...props2.locale ? {
|
|
@@ -4722,18 +5113,19 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4722
5113
|
} : {}
|
|
4723
5114
|
});
|
|
4724
5115
|
Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
4725
|
-
var
|
|
5116
|
+
var _a2;
|
|
4726
5117
|
const message = createRegisterComponentMessage(registeredComponent);
|
|
4727
|
-
(
|
|
5118
|
+
(_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
|
|
4728
5119
|
});
|
|
4729
|
-
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
|
|
5120
|
+
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, showContentProps2, elementRef2));
|
|
4730
5121
|
}, "EnableEditor_component_useOn_Qs8c0yql2i0", [
|
|
4731
5122
|
elementRef,
|
|
4732
5123
|
props,
|
|
5124
|
+
showContentProps,
|
|
4733
5125
|
state
|
|
4734
5126
|
]));
|
|
4735
5127
|
qwik.useOn("initpreviewingbldr", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
4736
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5128
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4737
5129
|
const searchParams = new URL(location.href).searchParams;
|
|
4738
5130
|
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
4739
5131
|
const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
|
|
@@ -4745,23 +5137,24 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4745
5137
|
apiVersion: props2.builderContextSignal.apiVersion
|
|
4746
5138
|
}).then((content) => {
|
|
4747
5139
|
if (content)
|
|
4748
|
-
mergeNewContent(props2, state2, elementRef2, content);
|
|
5140
|
+
mergeNewContent(props2, state2, showContentProps2, elementRef2, content);
|
|
4749
5141
|
});
|
|
4750
5142
|
}, "EnableEditor_component_useOn_1_F94YipmknvI", [
|
|
4751
5143
|
elementRef,
|
|
4752
5144
|
props,
|
|
5145
|
+
showContentProps,
|
|
4753
5146
|
state
|
|
4754
5147
|
]));
|
|
4755
5148
|
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
4756
|
-
var
|
|
5149
|
+
var _a2, _b2, _c, _d;
|
|
4757
5150
|
if (isBrowser()) {
|
|
4758
5151
|
if (isEditing()) {
|
|
4759
5152
|
if (element)
|
|
4760
5153
|
element.dispatchEvent(new CustomEvent("initeditingbldr"));
|
|
4761
5154
|
}
|
|
4762
|
-
const shouldTrackImpression = ((
|
|
5155
|
+
const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
|
|
4763
5156
|
if (shouldTrackImpression) {
|
|
4764
|
-
const variationId = (
|
|
5157
|
+
const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
|
|
4765
5158
|
const contentId = (_c = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c.value;
|
|
4766
5159
|
const apiKeyProp = (_d = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d.value;
|
|
4767
5160
|
_track({
|
|
@@ -4780,80 +5173,87 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4780
5173
|
}, "EnableEditor_component_useOn_2_FyR0YPSlJlw"));
|
|
4781
5174
|
qwik.useContextProvider(builderContext, props.builderContextSignal);
|
|
4782
5175
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
4783
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5176
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4784
5177
|
if (!props2.apiKey)
|
|
4785
5178
|
logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
4786
5179
|
evaluateJsCode(props2);
|
|
4787
|
-
runHttpRequests(props2, state2, elementRef2);
|
|
5180
|
+
runHttpRequests(props2, state2, showContentProps2, elementRef2);
|
|
4788
5181
|
emitStateUpdate(props2);
|
|
4789
5182
|
}, "EnableEditor_component_useTask_Nb2VI04qp0M", [
|
|
4790
5183
|
elementRef,
|
|
4791
5184
|
props,
|
|
5185
|
+
showContentProps,
|
|
4792
5186
|
state
|
|
4793
5187
|
]));
|
|
4794
5188
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4795
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5189
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4796
5190
|
track2(() => props2.content);
|
|
4797
5191
|
if (props2.content)
|
|
4798
|
-
mergeNewContent(props2, state2, elementRef2, props2.content);
|
|
5192
|
+
mergeNewContent(props2, state2, showContentProps2, elementRef2, props2.content);
|
|
4799
5193
|
}, "EnableEditor_component_useTask_1_m0y1Z9vk4eQ", [
|
|
4800
5194
|
elementRef,
|
|
4801
5195
|
props,
|
|
5196
|
+
showContentProps,
|
|
4802
5197
|
state
|
|
4803
5198
|
]));
|
|
4804
5199
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4805
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5200
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4806
5201
|
track2(() => {
|
|
4807
|
-
var
|
|
4808
|
-
return (
|
|
5202
|
+
var _a2, _b2;
|
|
5203
|
+
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
|
|
4809
5204
|
});
|
|
4810
5205
|
evaluateJsCode(props2);
|
|
4811
5206
|
}, "EnableEditor_component_useTask_2_xVyv0tDqZLs", [
|
|
4812
5207
|
elementRef,
|
|
4813
5208
|
props,
|
|
5209
|
+
showContentProps,
|
|
4814
5210
|
state
|
|
4815
5211
|
]));
|
|
4816
5212
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4817
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5213
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4818
5214
|
track2(() => {
|
|
4819
|
-
var
|
|
4820
|
-
return (
|
|
5215
|
+
var _a2, _b2;
|
|
5216
|
+
return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.httpRequests;
|
|
4821
5217
|
});
|
|
4822
|
-
runHttpRequests(props2, state2, elementRef2);
|
|
5218
|
+
runHttpRequests(props2, state2, showContentProps2, elementRef2);
|
|
4823
5219
|
}, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
|
|
4824
5220
|
elementRef,
|
|
4825
5221
|
props,
|
|
5222
|
+
showContentProps,
|
|
4826
5223
|
state
|
|
4827
5224
|
]));
|
|
4828
5225
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4829
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5226
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4830
5227
|
track2(() => props2.builderContextSignal.rootState);
|
|
4831
5228
|
emitStateUpdate(props2);
|
|
4832
5229
|
}, "EnableEditor_component_useTask_4_moHYZG8uNVU", [
|
|
4833
5230
|
elementRef,
|
|
4834
5231
|
props,
|
|
5232
|
+
showContentProps,
|
|
4835
5233
|
state
|
|
4836
5234
|
]));
|
|
4837
5235
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4838
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5236
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4839
5237
|
track2(() => props2.data);
|
|
4840
5238
|
if (props2.data)
|
|
4841
|
-
mergeNewRootState(props2, state2, elementRef2, props2.data);
|
|
5239
|
+
mergeNewRootState(props2, state2, showContentProps2, elementRef2, props2.data);
|
|
4842
5240
|
}, "EnableEditor_component_useTask_5_24QxS0r0KF8", [
|
|
4843
5241
|
elementRef,
|
|
4844
5242
|
props,
|
|
5243
|
+
showContentProps,
|
|
4845
5244
|
state
|
|
4846
5245
|
]));
|
|
4847
5246
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
4848
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
5247
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
4849
5248
|
track2(() => props2.locale);
|
|
4850
5249
|
if (props2.locale)
|
|
4851
|
-
mergeNewRootState(props2, state2, elementRef2, {
|
|
5250
|
+
mergeNewRootState(props2, state2, showContentProps2, elementRef2, {
|
|
4852
5251
|
locale: props2.locale
|
|
4853
5252
|
});
|
|
4854
5253
|
}, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
|
|
4855
5254
|
elementRef,
|
|
4856
5255
|
props,
|
|
5256
|
+
showContentProps,
|
|
4857
5257
|
state
|
|
4858
5258
|
]));
|
|
4859
5259
|
return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
@@ -4862,69 +5262,58 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4862
5262
|
return props.apiKey;
|
|
4863
5263
|
},
|
|
4864
5264
|
get contentId() {
|
|
4865
|
-
var
|
|
4866
|
-
return (
|
|
5265
|
+
var _a2;
|
|
5266
|
+
return (_a2 = props.builderContextSignal.content) == null ? void 0 : _a2.id;
|
|
4867
5267
|
},
|
|
4868
5268
|
get variationId() {
|
|
4869
|
-
var
|
|
4870
|
-
return (
|
|
5269
|
+
var _a2;
|
|
5270
|
+
return (_a2 = props.builderContextSignal.content) == null ? void 0 : _a2.testVariationId;
|
|
4871
5271
|
},
|
|
4872
5272
|
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
4873
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
4874
|
-
return onClick(props2, state2, elementRef2, event);
|
|
5273
|
+
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
5274
|
+
return onClick(props2, state2, showContentProps2, elementRef2, event);
|
|
4875
5275
|
}, "EnableEditor_component__Fragment_onClick_b4nYT3DrjEk", [
|
|
4876
5276
|
elementRef,
|
|
4877
5277
|
props,
|
|
5278
|
+
showContentProps,
|
|
4878
5279
|
state
|
|
4879
5280
|
]),
|
|
4880
5281
|
ref: elementRef,
|
|
4881
5282
|
shouldTrack: String(props.builderContextSignal.content && getDefaultCanTrack(props.canTrack)),
|
|
4882
5283
|
get "builder-content-id"() {
|
|
4883
|
-
var
|
|
4884
|
-
return (
|
|
5284
|
+
var _a2;
|
|
5285
|
+
return (_a2 = props.builderContextSignal.content) == null ? void 0 : _a2.id;
|
|
4885
5286
|
},
|
|
4886
5287
|
get "builder-model"() {
|
|
4887
5288
|
return props.model;
|
|
4888
5289
|
},
|
|
4889
|
-
...
|
|
4890
|
-
hidden: true,
|
|
4891
|
-
"aria-hidden": true
|
|
4892
|
-
},
|
|
5290
|
+
...showContentProps.value,
|
|
4893
5291
|
...props.contentWrapperProps,
|
|
4894
|
-
get class() {
|
|
4895
|
-
var _a, _b;
|
|
4896
|
-
return `variant-${((_a = props.content) == null ? void 0 : _a.testVariationId) || ((_b = props.content) == null ? void 0 : _b.id)}`;
|
|
4897
|
-
},
|
|
4898
5292
|
children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0"),
|
|
5293
|
+
class: getWrapperClassName(((_a = props.content) == null ? void 0 : _a.testVariationId) || ((_b = props.content) == null ? void 0 : _b.id)),
|
|
4899
5294
|
[qwik._IMMUTABLE]: {
|
|
4900
5295
|
apiKey: qwik._fnSignal((p0) => p0.apiKey, [
|
|
4901
5296
|
props
|
|
4902
5297
|
], "p0.apiKey"),
|
|
4903
5298
|
"builder-content-id": qwik._fnSignal((p0) => {
|
|
4904
|
-
var
|
|
4905
|
-
return (
|
|
5299
|
+
var _a2;
|
|
5300
|
+
return (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.id;
|
|
4906
5301
|
}, [
|
|
4907
5302
|
props
|
|
4908
5303
|
], "p0.builderContextSignal.content?.id"),
|
|
4909
5304
|
"builder-model": qwik._fnSignal((p0) => p0.model, [
|
|
4910
5305
|
props
|
|
4911
5306
|
], "p0.model"),
|
|
4912
|
-
class: qwik._fnSignal((p0) => {
|
|
4913
|
-
var _a, _b;
|
|
4914
|
-
return `variant-${((_a = p0.content) == null ? void 0 : _a.testVariationId) || ((_b = p0.content) == null ? void 0 : _b.id)}`;
|
|
4915
|
-
}, [
|
|
4916
|
-
props
|
|
4917
|
-
], "`variant-${p0.content?.testVariationId||p0.content?.id}`"),
|
|
4918
5307
|
contentId: qwik._fnSignal((p0) => {
|
|
4919
|
-
var
|
|
4920
|
-
return (
|
|
5308
|
+
var _a2;
|
|
5309
|
+
return (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.id;
|
|
4921
5310
|
}, [
|
|
4922
5311
|
props
|
|
4923
5312
|
], "p0.builderContextSignal.content?.id"),
|
|
4924
5313
|
ref: qwik._IMMUTABLE,
|
|
4925
5314
|
variationId: qwik._fnSignal((p0) => {
|
|
4926
|
-
var
|
|
4927
|
-
return (
|
|
5315
|
+
var _a2;
|
|
5316
|
+
return (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.testVariationId;
|
|
4928
5317
|
}, [
|
|
4929
5318
|
props
|
|
4930
5319
|
], "p0.builderContextSignal.content?.testVariationId")
|
|
@@ -4932,71 +5321,6 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
4932
5321
|
}, 0, "06_1") : null
|
|
4933
5322
|
}, 1, "06_2");
|
|
4934
5323
|
}, "EnableEditor_component_ko1mO8oaj8k"));
|
|
4935
|
-
const getCssFromFont = (font) => {
|
|
4936
|
-
var _a;
|
|
4937
|
-
const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
|
|
4938
|
-
const name = family.split(",")[0];
|
|
4939
|
-
const url = font.fileUrl ?? ((_a = font == null ? void 0 : font.files) == null ? void 0 : _a.regular);
|
|
4940
|
-
let str = "";
|
|
4941
|
-
if (url && family && name)
|
|
4942
|
-
str += `
|
|
4943
|
-
@font-face {
|
|
4944
|
-
font-family: "${family}";
|
|
4945
|
-
src: local("${name}"), url('${url}') format('woff2');
|
|
4946
|
-
font-display: fallback;
|
|
4947
|
-
font-weight: 400;
|
|
4948
|
-
}
|
|
4949
|
-
`.trim();
|
|
4950
|
-
if (font.files)
|
|
4951
|
-
for (const weight in font.files) {
|
|
4952
|
-
const isNumber = String(Number(weight)) === weight;
|
|
4953
|
-
if (!isNumber)
|
|
4954
|
-
continue;
|
|
4955
|
-
const weightUrl = font.files[weight];
|
|
4956
|
-
if (weightUrl && weightUrl !== url)
|
|
4957
|
-
str += `
|
|
4958
|
-
@font-face {
|
|
4959
|
-
font-family: "${family}";
|
|
4960
|
-
src: url('${weightUrl}') format('woff2');
|
|
4961
|
-
font-display: fallback;
|
|
4962
|
-
font-weight: ${weight};
|
|
4963
|
-
}
|
|
4964
|
-
`.trim();
|
|
4965
|
-
}
|
|
4966
|
-
return str;
|
|
4967
|
-
};
|
|
4968
|
-
const getFontCss = ({ customFonts }) => {
|
|
4969
|
-
var _a;
|
|
4970
|
-
return ((_a = customFonts == null ? void 0 : customFonts.map((font) => getCssFromFont(font))) == null ? void 0 : _a.join(" ")) || "";
|
|
4971
|
-
};
|
|
4972
|
-
const getCss = ({ cssCode, contentId }) => {
|
|
4973
|
-
if (!cssCode)
|
|
4974
|
-
return "";
|
|
4975
|
-
if (!contentId)
|
|
4976
|
-
return cssCode;
|
|
4977
|
-
return (cssCode == null ? void 0 : cssCode.replace(/&/g, `div[builder-content-id="${contentId}"]`)) || "";
|
|
4978
|
-
};
|
|
4979
|
-
const DEFAULT_STYLES = `
|
|
4980
|
-
.builder-button {
|
|
4981
|
-
all: unset;
|
|
4982
|
-
}
|
|
4983
|
-
|
|
4984
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
4985
|
-
margin: 0;
|
|
4986
|
-
}
|
|
4987
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
4988
|
-
color: inherit;
|
|
4989
|
-
line-height: inherit;
|
|
4990
|
-
letter-spacing: inherit;
|
|
4991
|
-
font-weight: inherit;
|
|
4992
|
-
font-size: inherit;
|
|
4993
|
-
text-align: inherit;
|
|
4994
|
-
font-family: inherit;
|
|
4995
|
-
}
|
|
4996
|
-
`;
|
|
4997
|
-
const getDefaultStyles = (isNested) => {
|
|
4998
|
-
return !isNested ? DEFAULT_STYLES : "";
|
|
4999
|
-
};
|
|
5000
5324
|
const ContentStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
5001
5325
|
const state = qwik.useStore({
|
|
5002
5326
|
injectedStyles: `
|
|
@@ -5601,7 +5925,7 @@ const fetchSymbolContent = async ({ builderContextValue, symbol }) => {
|
|
|
5601
5925
|
});
|
|
5602
5926
|
return void 0;
|
|
5603
5927
|
};
|
|
5604
|
-
const setContent = function setContent2(props, state) {
|
|
5928
|
+
const setContent = function setContent2(props, state, blocksWrapper, contentWrapper, className) {
|
|
5605
5929
|
if (state.contentToUse)
|
|
5606
5930
|
return;
|
|
5607
5931
|
fetchSymbolContent({
|
|
@@ -5614,6 +5938,12 @@ const setContent = function setContent2(props, state) {
|
|
|
5614
5938
|
};
|
|
5615
5939
|
const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
5616
5940
|
var _a;
|
|
5941
|
+
const blocksWrapper = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
5942
|
+
return "div";
|
|
5943
|
+
}, "Symbol_component_blocksWrapper_useComputed_B5dlF985gMM"));
|
|
5944
|
+
const contentWrapper = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
5945
|
+
return "div";
|
|
5946
|
+
}, "Symbol_component_contentWrapper_useComputed_EvmPpPj8JTo"));
|
|
5617
5947
|
const className = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
5618
5948
|
var _a2, _b;
|
|
5619
5949
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -5630,10 +5960,13 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
5630
5960
|
contentToUse: (_a = props.symbol) == null ? void 0 : _a.content
|
|
5631
5961
|
});
|
|
5632
5962
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
5633
|
-
const [props2, state2] = qwik.useLexicalScope();
|
|
5963
|
+
const [blocksWrapper2, className2, contentWrapper2, props2, state2] = qwik.useLexicalScope();
|
|
5634
5964
|
track2(() => props2.symbol);
|
|
5635
5965
|
setContent(props2, state2);
|
|
5636
5966
|
}, "Symbol_component_useTask_NIAWAC1bMBo", [
|
|
5967
|
+
blocksWrapper,
|
|
5968
|
+
className,
|
|
5969
|
+
contentWrapper,
|
|
5637
5970
|
props,
|
|
5638
5971
|
state
|
|
5639
5972
|
]));
|
|
@@ -5675,8 +6008,12 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
5675
6008
|
get linkComponent() {
|
|
5676
6009
|
return props.builderLinkComponent;
|
|
5677
6010
|
},
|
|
5678
|
-
blocksWrapper
|
|
5679
|
-
|
|
6011
|
+
get blocksWrapper() {
|
|
6012
|
+
return blocksWrapper.value;
|
|
6013
|
+
},
|
|
6014
|
+
get contentWrapper() {
|
|
6015
|
+
return contentWrapper.value;
|
|
6016
|
+
},
|
|
5680
6017
|
[qwik._IMMUTABLE]: {
|
|
5681
6018
|
apiKey: qwik._fnSignal((p0) => p0.builderContext.apiKey, [
|
|
5682
6019
|
props
|
|
@@ -5684,11 +6021,15 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
|
|
|
5684
6021
|
apiVersion: qwik._fnSignal((p0) => p0.builderContext.apiVersion, [
|
|
5685
6022
|
props
|
|
5686
6023
|
], "p0.builderContext.apiVersion"),
|
|
5687
|
-
blocksWrapper: qwik.
|
|
6024
|
+
blocksWrapper: qwik._fnSignal((p0) => p0.value, [
|
|
6025
|
+
blocksWrapper
|
|
6026
|
+
], "p0.value"),
|
|
5688
6027
|
content: qwik._fnSignal((p0) => p0.contentToUse, [
|
|
5689
6028
|
state
|
|
5690
6029
|
], "p0.contentToUse"),
|
|
5691
|
-
contentWrapper: qwik.
|
|
6030
|
+
contentWrapper: qwik._fnSignal((p0) => p0.value, [
|
|
6031
|
+
contentWrapper
|
|
6032
|
+
], "p0.value"),
|
|
5692
6033
|
context: qwik._fnSignal((p0) => {
|
|
5693
6034
|
var _a2;
|
|
5694
6035
|
return {
|