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