@builder.io/sdk-qwik 0.14.20 → 0.14.22
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/lib/browser/index.qwik.cjs +415 -39
- package/lib/browser/index.qwik.mjs +415 -39
- package/lib/edge/index.qwik.cjs +415 -39
- package/lib/edge/index.qwik.mjs +415 -39
- package/lib/node/index.qwik.cjs +415 -39
- package/lib/node/index.qwik.mjs +415 -39
- package/package.json +1 -1
- package/types/src/blocks/accordion/accordion.d.ts +6 -0
- package/types/src/blocks/accordion/accordion.types.d.ts +12 -0
- package/types/src/blocks/accordion/component-info.d.ts +2 -0
- package/types/src/blocks/accordion/helpers.d.ts +1 -0
- package/types/src/blocks/accordion/index.d.ts +1 -0
- package/types/src/blocks/tabs/tabs.d.ts +1 -1
- package/types/src/components/block/animator.d.ts +0 -1
- package/types/src/components/content-variants/content-variants.types.d.ts +1 -1
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/functions/camel-to-kebab-case.d.ts +1 -1
- package/types/src/helpers/flatten.d.ts +10 -0
|
@@ -367,6 +367,7 @@ function getProcessedBlock({ block, context, shouldEvaluateBindings, localState,
|
|
|
367
367
|
else
|
|
368
368
|
return transformedBlock;
|
|
369
369
|
}
|
|
370
|
+
const camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
370
371
|
function throttle(func, wait, options = {}) {
|
|
371
372
|
let context;
|
|
372
373
|
let args;
|
|
@@ -413,7 +414,6 @@ function assign(target, ..._args) {
|
|
|
413
414
|
}
|
|
414
415
|
return to;
|
|
415
416
|
}
|
|
416
|
-
const camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
417
417
|
function bindAnimations(animations) {
|
|
418
418
|
for (const animation of animations)
|
|
419
419
|
switch (animation.trigger) {
|
|
@@ -464,7 +464,7 @@ function triggerAnimation(animation) {
|
|
|
464
464
|
element.style.transitionDelay = "0";
|
|
465
465
|
assign(element.style, animation.steps[0].styles);
|
|
466
466
|
setTimeout(() => {
|
|
467
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
467
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
468
468
|
if (animation.delay)
|
|
469
469
|
element.style.transitionDelay = animation.delay + "s";
|
|
470
470
|
assign(element.style, animation.steps[1].styles);
|
|
@@ -522,7 +522,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
522
522
|
}
|
|
523
523
|
attachDefaultState();
|
|
524
524
|
setTimeout(() => {
|
|
525
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
525
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
526
526
|
if (animation.delay)
|
|
527
527
|
element.style.transitionDelay = animation.delay + "s";
|
|
528
528
|
});
|
|
@@ -533,7 +533,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
533
533
|
immediateOnScroll();
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
|
-
const camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
537
536
|
const convertStyleMapToCSSArray = (style) => {
|
|
538
537
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
539
538
|
if (typeof value === "string")
|
|
@@ -637,7 +636,8 @@ const shouldPassLinkComponent = (block) => {
|
|
|
637
636
|
"Symbol",
|
|
638
637
|
"Columns",
|
|
639
638
|
"Form:Form",
|
|
640
|
-
"Builder: Tabs"
|
|
639
|
+
"Builder: Tabs",
|
|
640
|
+
"Builder:Accordion"
|
|
641
641
|
].includes(block.name));
|
|
642
642
|
};
|
|
643
643
|
const shouldPassRegisteredComponents = (block) => {
|
|
@@ -645,7 +645,8 @@ const shouldPassRegisteredComponents = (block) => {
|
|
|
645
645
|
"Symbol",
|
|
646
646
|
"Columns",
|
|
647
647
|
"Form:Form",
|
|
648
|
-
"Builder: Tabs"
|
|
648
|
+
"Builder: Tabs",
|
|
649
|
+
"Builder:Accordion"
|
|
649
650
|
].includes(block.name));
|
|
650
651
|
};
|
|
651
652
|
const SIZES = {
|
|
@@ -763,7 +764,7 @@ const BlockStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlin
|
|
|
763
764
|
className: `${className}:hover`,
|
|
764
765
|
styles: {
|
|
765
766
|
...hoverStyles,
|
|
766
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
767
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(hoverAnimation.easing)}`,
|
|
767
768
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
768
769
|
}
|
|
769
770
|
}) || "";
|
|
@@ -1354,7 +1355,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1354
1355
|
}, 1, "jN_4") : null
|
|
1355
1356
|
}, 1, "jN_5");
|
|
1356
1357
|
}, "Block_component_nnPv0RY0U0k"));
|
|
1357
|
-
const onClick$
|
|
1358
|
+
const onClick$3 = function onClick2(props, state, className) {
|
|
1358
1359
|
var _a, _b;
|
|
1359
1360
|
if (isEditing() && !((_a = props.blocks) == null ? void 0 : _a.length))
|
|
1360
1361
|
(_b = window.parent) == null ? void 0 : _b.postMessage({
|
|
@@ -1401,7 +1402,7 @@ const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
1401
1402
|
},
|
|
1402
1403
|
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
1403
1404
|
const [className2, props2, state2] = qwik.useLexicalScope();
|
|
1404
|
-
return onClick$
|
|
1405
|
+
return onClick$3(props2);
|
|
1405
1406
|
}, "BlocksWrapper_component_onClick_ufezvOupQrM", [
|
|
1406
1407
|
className,
|
|
1407
1408
|
props,
|
|
@@ -1409,7 +1410,7 @@ const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
1409
1410
|
]),
|
|
1410
1411
|
onKeyPress$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
1411
1412
|
const [className2, props2, state2] = qwik.useLexicalScope();
|
|
1412
|
-
return onClick$
|
|
1413
|
+
return onClick$3(props2);
|
|
1413
1414
|
}, "BlocksWrapper_component_onKeyPress_9bz8vCQc3kg", [
|
|
1414
1415
|
className,
|
|
1415
1416
|
props,
|
|
@@ -2084,7 +2085,7 @@ const handleABTesting = async ({ item, canTrack }) => {
|
|
|
2084
2085
|
};
|
|
2085
2086
|
};
|
|
2086
2087
|
const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2087
|
-
const componentInfo$
|
|
2088
|
+
const componentInfo$h = {
|
|
2088
2089
|
name: "Core:Button",
|
|
2089
2090
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
2090
2091
|
defaultStyles: {
|
|
@@ -2122,7 +2123,7 @@ const componentInfo$g = {
|
|
|
2122
2123
|
static: true,
|
|
2123
2124
|
noWrap: true
|
|
2124
2125
|
};
|
|
2125
|
-
const componentInfo$
|
|
2126
|
+
const componentInfo$g = {
|
|
2126
2127
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
2127
2128
|
name: "Columns",
|
|
2128
2129
|
isRSC: true,
|
|
@@ -2364,14 +2365,14 @@ const componentInfo$f = {
|
|
|
2364
2365
|
}
|
|
2365
2366
|
]
|
|
2366
2367
|
};
|
|
2367
|
-
const componentInfo$
|
|
2368
|
+
const componentInfo$f = {
|
|
2368
2369
|
name: "Fragment",
|
|
2369
2370
|
static: true,
|
|
2370
2371
|
hidden: true,
|
|
2371
2372
|
canHaveChildren: true,
|
|
2372
2373
|
noWrap: true
|
|
2373
2374
|
};
|
|
2374
|
-
const componentInfo$
|
|
2375
|
+
const componentInfo$e = {
|
|
2375
2376
|
name: "Image",
|
|
2376
2377
|
static: true,
|
|
2377
2378
|
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",
|
|
@@ -2519,7 +2520,7 @@ const componentInfo$d = {
|
|
|
2519
2520
|
}
|
|
2520
2521
|
]
|
|
2521
2522
|
};
|
|
2522
|
-
const componentInfo$
|
|
2523
|
+
const componentInfo$d = {
|
|
2523
2524
|
name: "Core:Section",
|
|
2524
2525
|
static: true,
|
|
2525
2526
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2564,7 +2565,7 @@ const componentInfo$c = {
|
|
|
2564
2565
|
}
|
|
2565
2566
|
]
|
|
2566
2567
|
};
|
|
2567
|
-
const componentInfo$
|
|
2568
|
+
const componentInfo$c = {
|
|
2568
2569
|
name: "Slot",
|
|
2569
2570
|
isRSC: true,
|
|
2570
2571
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -2619,7 +2620,7 @@ const Slot = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2619
2620
|
}
|
|
2620
2621
|
}, 0, "B1_1");
|
|
2621
2622
|
}, "Slot_component_WWgWgfV0bb0"));
|
|
2622
|
-
const componentInfo$
|
|
2623
|
+
const componentInfo$b = {
|
|
2623
2624
|
name: "Symbol",
|
|
2624
2625
|
noWrap: true,
|
|
2625
2626
|
static: true,
|
|
@@ -2699,7 +2700,7 @@ const defaultElement = {
|
|
|
2699
2700
|
}
|
|
2700
2701
|
}
|
|
2701
2702
|
};
|
|
2702
|
-
const componentInfo$
|
|
2703
|
+
const componentInfo$a = {
|
|
2703
2704
|
name: "Builder: Tabs",
|
|
2704
2705
|
inputs: [
|
|
2705
2706
|
{
|
|
@@ -2830,8 +2831,11 @@ const componentInfo$9 = {
|
|
|
2830
2831
|
const activeTabContent = function activeTabContent2(props, state, active) {
|
|
2831
2832
|
return props.tabs && props.tabs[active].content;
|
|
2832
2833
|
};
|
|
2833
|
-
const
|
|
2834
|
-
|
|
2834
|
+
const onClick$2 = function onClick22(props, state, index) {
|
|
2835
|
+
if (index === state.activeTab && props.collapsible)
|
|
2836
|
+
state.activeTab = -1;
|
|
2837
|
+
else
|
|
2838
|
+
state.activeTab = index;
|
|
2835
2839
|
};
|
|
2836
2840
|
const Tabs = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2837
2841
|
qwik._jsxBranch();
|
|
@@ -2854,16 +2858,15 @@ const Tabs = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2854
2858
|
class: `builder-tab-wrap ${state.activeTab === index ? "builder-tab-active" : ""}`,
|
|
2855
2859
|
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
2856
2860
|
const [index2, props2, state2] = qwik.useLexicalScope();
|
|
2857
|
-
|
|
2858
|
-
state2.activeTab = -1;
|
|
2859
|
-
else
|
|
2860
|
-
state2.activeTab = index2;
|
|
2861
|
+
return onClick$2(props2, state2, index2);
|
|
2861
2862
|
}, "Tabs_component_div_div_span_onClick_hSTBabAHGks", [
|
|
2862
2863
|
index,
|
|
2863
2864
|
props,
|
|
2864
2865
|
state
|
|
2865
2866
|
]),
|
|
2866
|
-
style:
|
|
2867
|
+
style: {
|
|
2868
|
+
...state.activeTab === index ? props.activeTabStyle : {}
|
|
2869
|
+
}
|
|
2867
2870
|
}, null, /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
2868
2871
|
get parent() {
|
|
2869
2872
|
return props.builderBlock.id;
|
|
@@ -2935,7 +2938,7 @@ const Tabs = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2935
2938
|
}, 3, "6k_1"), 1, "6k_2") : null
|
|
2936
2939
|
], 1, "6k_3");
|
|
2937
2940
|
}, "Tabs_component_MhWcxXy0lMY"));
|
|
2938
|
-
const componentInfo$
|
|
2941
|
+
const componentInfo$9 = {
|
|
2939
2942
|
name: "Text",
|
|
2940
2943
|
static: true,
|
|
2941
2944
|
isRSC: true,
|
|
@@ -2970,6 +2973,364 @@ const Text = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2970
2973
|
}
|
|
2971
2974
|
}, null, 3, "yO_0");
|
|
2972
2975
|
}, "Text_component_15p0cKUxgIE"));
|
|
2976
|
+
const convertOrderNumberToString = (order) => {
|
|
2977
|
+
return order.toString();
|
|
2978
|
+
};
|
|
2979
|
+
const getAccordionTitleClassName = function getAccordionTitleClassName2(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index) {
|
|
2980
|
+
return `builder-accordion-title builder-accordion-title-${state.open.includes(index) ? "open" : "closed"}`;
|
|
2981
|
+
};
|
|
2982
|
+
const getAccordionDetailClassName = function getAccordionDetailClassName2(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index) {
|
|
2983
|
+
return `builder-accordion-detail builder-accordion-detail-${state.open.includes(index) ? "open" : "closed"}`;
|
|
2984
|
+
};
|
|
2985
|
+
const onClick$1 = function onClick23(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index) {
|
|
2986
|
+
if (state.open.includes(index))
|
|
2987
|
+
state.open = onlyOneAtATime.value ? [] : state.open.filter((item) => item !== index);
|
|
2988
|
+
else
|
|
2989
|
+
state.open = onlyOneAtATime.value ? [
|
|
2990
|
+
index
|
|
2991
|
+
] : state.open.concat(index);
|
|
2992
|
+
};
|
|
2993
|
+
const Accordion = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2994
|
+
const state = qwik.useStore({
|
|
2995
|
+
open: []
|
|
2996
|
+
});
|
|
2997
|
+
const onlyOneAtATime = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
2998
|
+
const [props2] = qwik.useLexicalScope();
|
|
2999
|
+
return Boolean(props2.grid || props2.oneAtATime);
|
|
3000
|
+
}, "Accordion_component_onlyOneAtATime_useComputed_QYD7IoPU2HY", [
|
|
3001
|
+
props
|
|
3002
|
+
]));
|
|
3003
|
+
const accordionStyles = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
3004
|
+
const [props2] = qwik.useLexicalScope();
|
|
3005
|
+
const styles = {
|
|
3006
|
+
display: "flex",
|
|
3007
|
+
alignItems: "stretch",
|
|
3008
|
+
flexDirection: "column",
|
|
3009
|
+
...props2.grid && {
|
|
3010
|
+
flexDirection: "row",
|
|
3011
|
+
alignItems: "flex-start",
|
|
3012
|
+
flexWrap: "wrap"
|
|
3013
|
+
}
|
|
3014
|
+
};
|
|
3015
|
+
return styles;
|
|
3016
|
+
}, "Accordion_component_accordionStyles_useComputed_Jrd0cwGn25U", [
|
|
3017
|
+
props
|
|
3018
|
+
]));
|
|
3019
|
+
const accordionTitleStyles = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
3020
|
+
const shared = {
|
|
3021
|
+
display: "flex",
|
|
3022
|
+
flexDirection: "column"
|
|
3023
|
+
};
|
|
3024
|
+
const styles = {
|
|
3025
|
+
...shared,
|
|
3026
|
+
alignItems: "stretch",
|
|
3027
|
+
cursor: "pointer"
|
|
3028
|
+
};
|
|
3029
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
3030
|
+
}, "Accordion_component_accordionTitleStyles_useComputed_FopdBMH0V6U"));
|
|
3031
|
+
const openGridItemOrder = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
3032
|
+
const [props2, state2] = qwik.useLexicalScope();
|
|
3033
|
+
let itemOrder = null;
|
|
3034
|
+
const getOpenGridItemPosition = props2.grid && state2.open.length;
|
|
3035
|
+
if (getOpenGridItemPosition && document) {
|
|
3036
|
+
const openItemIndex = state2.open[0];
|
|
3037
|
+
const openItem = document.querySelector(`.builder-accordion-title[data-index="${openItemIndex}"]`);
|
|
3038
|
+
let subjectItem = openItem;
|
|
3039
|
+
itemOrder = openItemIndex;
|
|
3040
|
+
if (subjectItem) {
|
|
3041
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
3042
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling)
|
|
3043
|
+
if (subjectItem) {
|
|
3044
|
+
if (subjectItem.classList.contains("builder-accordion-detail"))
|
|
3045
|
+
continue;
|
|
3046
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
3047
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
3048
|
+
const index = parseInt(subjectItem.getAttribute("data-index") || "", 10);
|
|
3049
|
+
if (!isNaN(index)) {
|
|
3050
|
+
prevItemRect = subjectItemRect;
|
|
3051
|
+
itemOrder = index;
|
|
3052
|
+
}
|
|
3053
|
+
} else
|
|
3054
|
+
break;
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
if (typeof itemOrder === "number")
|
|
3059
|
+
itemOrder = itemOrder + 1;
|
|
3060
|
+
return itemOrder;
|
|
3061
|
+
}, "Accordion_component_openGridItemOrder_useComputed_cCQY1Vnxll0", [
|
|
3062
|
+
props,
|
|
3063
|
+
state
|
|
3064
|
+
]));
|
|
3065
|
+
const accordionDetailStyles = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
3066
|
+
const [openGridItemOrder2, props2] = qwik.useLexicalScope();
|
|
3067
|
+
const styles = {
|
|
3068
|
+
order: typeof openGridItemOrder2.value === "number" ? openGridItemOrder2.value : void 0,
|
|
3069
|
+
...props2.grid && {
|
|
3070
|
+
width: "100%"
|
|
3071
|
+
}
|
|
3072
|
+
};
|
|
3073
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
3074
|
+
}, "Accordion_component_accordionDetailStyles_useComputed_S0QmQzGJoRo", [
|
|
3075
|
+
openGridItemOrder,
|
|
3076
|
+
props
|
|
3077
|
+
]));
|
|
3078
|
+
return /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
3079
|
+
class: "builder-accordion",
|
|
3080
|
+
style: qwik._fnSignal((p0) => p0.value, [
|
|
3081
|
+
accordionStyles
|
|
3082
|
+
], "p0.value")
|
|
3083
|
+
}, (props.items || []).map((item, index) => {
|
|
3084
|
+
qwik._jsxBranch();
|
|
3085
|
+
return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
|
|
3086
|
+
children: [
|
|
3087
|
+
/* @__PURE__ */ qwik._jsxQ("div", {
|
|
3088
|
+
class: getAccordionTitleClassName(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index),
|
|
3089
|
+
"data-index": index,
|
|
3090
|
+
onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
3091
|
+
const [accordionDetailStyles2, accordionStyles2, accordionTitleStyles2, index2, onlyOneAtATime2, openGridItemOrder2, props2, state2] = qwik.useLexicalScope();
|
|
3092
|
+
return onClick$1(props2, state2, onlyOneAtATime2, accordionStyles2, accordionTitleStyles2, openGridItemOrder2, accordionDetailStyles2, index2);
|
|
3093
|
+
}, "Accordion_component_div_Fragment_div_onClick_VtzhhJnK0XI", [
|
|
3094
|
+
accordionDetailStyles,
|
|
3095
|
+
accordionStyles,
|
|
3096
|
+
accordionTitleStyles,
|
|
3097
|
+
index,
|
|
3098
|
+
onlyOneAtATime,
|
|
3099
|
+
openGridItemOrder,
|
|
3100
|
+
props,
|
|
3101
|
+
state
|
|
3102
|
+
]),
|
|
3103
|
+
style: {
|
|
3104
|
+
...accordionTitleStyles.value,
|
|
3105
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
3106
|
+
order: openGridItemOrder.value !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
3107
|
+
}
|
|
3108
|
+
}, null, /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
3109
|
+
get blocks() {
|
|
3110
|
+
return item.title;
|
|
3111
|
+
},
|
|
3112
|
+
path: `items.${index}.title`,
|
|
3113
|
+
get parent() {
|
|
3114
|
+
return props.builderBlock.id;
|
|
3115
|
+
},
|
|
3116
|
+
get context() {
|
|
3117
|
+
return props.builderContext;
|
|
3118
|
+
},
|
|
3119
|
+
get registeredComponents() {
|
|
3120
|
+
return props.builderComponents;
|
|
3121
|
+
},
|
|
3122
|
+
get linkComponent() {
|
|
3123
|
+
return props.builderLinkComponent;
|
|
3124
|
+
},
|
|
3125
|
+
[qwik._IMMUTABLE]: {
|
|
3126
|
+
blocks: qwik._wrapProp(item, "title"),
|
|
3127
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3128
|
+
props
|
|
3129
|
+
], "p0.builderContext"),
|
|
3130
|
+
linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
|
|
3131
|
+
props
|
|
3132
|
+
], "p0.builderLinkComponent"),
|
|
3133
|
+
parent: qwik._fnSignal((p0) => p0.builderBlock.id, [
|
|
3134
|
+
props
|
|
3135
|
+
], "p0.builderBlock.id"),
|
|
3136
|
+
registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
|
|
3137
|
+
props
|
|
3138
|
+
], "p0.builderComponents")
|
|
3139
|
+
}
|
|
3140
|
+
}, 3, "hf_0"), 0, null),
|
|
3141
|
+
state.open.includes(index) ? /* @__PURE__ */ qwik._jsxQ("div", {
|
|
3142
|
+
class: getAccordionDetailClassName(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index)
|
|
3143
|
+
}, {
|
|
3144
|
+
style: qwik._fnSignal((p0) => p0.value, [
|
|
3145
|
+
accordionDetailStyles
|
|
3146
|
+
], "p0.value")
|
|
3147
|
+
}, /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
3148
|
+
get blocks() {
|
|
3149
|
+
return item.detail;
|
|
3150
|
+
},
|
|
3151
|
+
path: `items.${index}.detail`,
|
|
3152
|
+
get parent() {
|
|
3153
|
+
return props.builderBlock.id;
|
|
3154
|
+
},
|
|
3155
|
+
get context() {
|
|
3156
|
+
return props.builderContext;
|
|
3157
|
+
},
|
|
3158
|
+
get registeredComponents() {
|
|
3159
|
+
return props.builderComponents;
|
|
3160
|
+
},
|
|
3161
|
+
get linkComponent() {
|
|
3162
|
+
return props.builderLinkComponent;
|
|
3163
|
+
},
|
|
3164
|
+
[qwik._IMMUTABLE]: {
|
|
3165
|
+
blocks: qwik._wrapProp(item, "detail"),
|
|
3166
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3167
|
+
props
|
|
3168
|
+
], "p0.builderContext"),
|
|
3169
|
+
linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
|
|
3170
|
+
props
|
|
3171
|
+
], "p0.builderLinkComponent"),
|
|
3172
|
+
parent: qwik._fnSignal((p0) => p0.builderBlock.id, [
|
|
3173
|
+
props
|
|
3174
|
+
], "p0.builderBlock.id"),
|
|
3175
|
+
registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
|
|
3176
|
+
props
|
|
3177
|
+
], "p0.builderComponents")
|
|
3178
|
+
}
|
|
3179
|
+
}, 3, "hf_1"), 1, "hf_2") : null
|
|
3180
|
+
]
|
|
3181
|
+
}, 1, "hf_3");
|
|
3182
|
+
}), 1, "hf_4");
|
|
3183
|
+
}, "Accordion_component_jkuUCHm0nt0"));
|
|
3184
|
+
const defaultTitle = {
|
|
3185
|
+
"@type": "@builder.io/sdk:Element",
|
|
3186
|
+
layerName: "Accordion item title",
|
|
3187
|
+
responsiveStyles: {
|
|
3188
|
+
large: {
|
|
3189
|
+
marginTop: "10px",
|
|
3190
|
+
position: "relative",
|
|
3191
|
+
display: "flex",
|
|
3192
|
+
alignItems: "stretch",
|
|
3193
|
+
flexDirection: "column",
|
|
3194
|
+
paddingBottom: "10px"
|
|
3195
|
+
}
|
|
3196
|
+
},
|
|
3197
|
+
children: [
|
|
3198
|
+
{
|
|
3199
|
+
"@type": "@builder.io/sdk:Element",
|
|
3200
|
+
responsiveStyles: {
|
|
3201
|
+
large: {
|
|
3202
|
+
textAlign: "left",
|
|
3203
|
+
display: "flex",
|
|
3204
|
+
flexDirection: "column"
|
|
3205
|
+
}
|
|
3206
|
+
},
|
|
3207
|
+
component: {
|
|
3208
|
+
name: "Text",
|
|
3209
|
+
options: {
|
|
3210
|
+
text: "I am an accordion title. Click me!"
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3214
|
+
]
|
|
3215
|
+
};
|
|
3216
|
+
const defaultDetail = {
|
|
3217
|
+
"@type": "@builder.io/sdk:Element",
|
|
3218
|
+
layerName: "Accordion item detail",
|
|
3219
|
+
responsiveStyles: {
|
|
3220
|
+
large: {
|
|
3221
|
+
position: "relative",
|
|
3222
|
+
display: "flex",
|
|
3223
|
+
alignItems: "stretch",
|
|
3224
|
+
flexDirection: "column",
|
|
3225
|
+
marginTop: "10px",
|
|
3226
|
+
paddingBottom: "10px"
|
|
3227
|
+
}
|
|
3228
|
+
},
|
|
3229
|
+
children: [
|
|
3230
|
+
{
|
|
3231
|
+
"@type": "@builder.io/sdk:Element",
|
|
3232
|
+
responsiveStyles: {
|
|
3233
|
+
large: {
|
|
3234
|
+
paddingTop: "50px",
|
|
3235
|
+
textAlign: "left",
|
|
3236
|
+
display: "flex",
|
|
3237
|
+
flexDirection: "column",
|
|
3238
|
+
paddingBottom: "50px"
|
|
3239
|
+
}
|
|
3240
|
+
},
|
|
3241
|
+
component: {
|
|
3242
|
+
name: "Text",
|
|
3243
|
+
options: {
|
|
3244
|
+
text: "I am an accordion detail, hello!"
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
]
|
|
3249
|
+
};
|
|
3250
|
+
const componentInfo$8 = {
|
|
3251
|
+
name: "Builder:Accordion",
|
|
3252
|
+
canHaveChildren: true,
|
|
3253
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
3254
|
+
defaultStyles: {
|
|
3255
|
+
display: "flex",
|
|
3256
|
+
flexDirection: "column",
|
|
3257
|
+
alignItems: "stretch"
|
|
3258
|
+
},
|
|
3259
|
+
inputs: [
|
|
3260
|
+
{
|
|
3261
|
+
name: "items",
|
|
3262
|
+
type: "list",
|
|
3263
|
+
broadcast: true,
|
|
3264
|
+
subFields: [
|
|
3265
|
+
{
|
|
3266
|
+
name: "title",
|
|
3267
|
+
type: "uiBlocks",
|
|
3268
|
+
hideFromUI: true,
|
|
3269
|
+
defaultValue: [
|
|
3270
|
+
defaultTitle
|
|
3271
|
+
]
|
|
3272
|
+
},
|
|
3273
|
+
{
|
|
3274
|
+
name: "detail",
|
|
3275
|
+
type: "uiBlocks",
|
|
3276
|
+
hideFromUI: true,
|
|
3277
|
+
defaultValue: [
|
|
3278
|
+
defaultDetail
|
|
3279
|
+
]
|
|
3280
|
+
}
|
|
3281
|
+
],
|
|
3282
|
+
defaultValue: [
|
|
3283
|
+
{
|
|
3284
|
+
title: [
|
|
3285
|
+
defaultTitle
|
|
3286
|
+
],
|
|
3287
|
+
detail: [
|
|
3288
|
+
defaultDetail
|
|
3289
|
+
]
|
|
3290
|
+
},
|
|
3291
|
+
{
|
|
3292
|
+
title: [
|
|
3293
|
+
defaultTitle
|
|
3294
|
+
],
|
|
3295
|
+
detail: [
|
|
3296
|
+
defaultDetail
|
|
3297
|
+
]
|
|
3298
|
+
}
|
|
3299
|
+
],
|
|
3300
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
3301
|
+
},
|
|
3302
|
+
{
|
|
3303
|
+
name: "oneAtATime",
|
|
3304
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
3305
|
+
type: "boolean",
|
|
3306
|
+
defaultValue: false
|
|
3307
|
+
},
|
|
3308
|
+
{
|
|
3309
|
+
name: "grid",
|
|
3310
|
+
helperText: "Display as a grid",
|
|
3311
|
+
type: "boolean",
|
|
3312
|
+
defaultValue: false
|
|
3313
|
+
},
|
|
3314
|
+
{
|
|
3315
|
+
name: "gridRowWidth",
|
|
3316
|
+
helperText: "Display as a grid",
|
|
3317
|
+
type: "string",
|
|
3318
|
+
showIf: (options) => options.get("grid"),
|
|
3319
|
+
defaultValue: "25%"
|
|
3320
|
+
},
|
|
3321
|
+
{
|
|
3322
|
+
name: "useChildrenForItems",
|
|
3323
|
+
type: "boolean",
|
|
3324
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
3325
|
+
advanced: true,
|
|
3326
|
+
defaultValue: false,
|
|
3327
|
+
onChange: (options) => {
|
|
3328
|
+
if (options.get("useChildrenForItems") === true)
|
|
3329
|
+
options.set("items", []);
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
]
|
|
3333
|
+
};
|
|
2973
3334
|
const componentInfo$7 = {
|
|
2974
3335
|
name: "Custom Code",
|
|
2975
3336
|
static: true,
|
|
@@ -4214,40 +4575,44 @@ const getExtraComponents = () => [
|
|
|
4214
4575
|
const getDefaultRegisteredComponents = () => [
|
|
4215
4576
|
{
|
|
4216
4577
|
component: Button,
|
|
4217
|
-
...componentInfo$
|
|
4578
|
+
...componentInfo$h
|
|
4218
4579
|
},
|
|
4219
4580
|
{
|
|
4220
4581
|
component: Columns,
|
|
4221
|
-
...componentInfo$
|
|
4582
|
+
...componentInfo$g
|
|
4222
4583
|
},
|
|
4223
4584
|
{
|
|
4224
4585
|
component: FragmentComponent,
|
|
4225
|
-
...componentInfo$
|
|
4586
|
+
...componentInfo$f
|
|
4226
4587
|
},
|
|
4227
4588
|
{
|
|
4228
4589
|
component: Image,
|
|
4229
|
-
...componentInfo$
|
|
4590
|
+
...componentInfo$e
|
|
4230
4591
|
},
|
|
4231
4592
|
{
|
|
4232
4593
|
component: SectionComponent,
|
|
4233
|
-
...componentInfo$
|
|
4594
|
+
...componentInfo$d
|
|
4234
4595
|
},
|
|
4235
4596
|
{
|
|
4236
4597
|
component: Slot,
|
|
4237
|
-
...componentInfo$
|
|
4598
|
+
...componentInfo$c
|
|
4238
4599
|
},
|
|
4239
4600
|
{
|
|
4240
4601
|
component: Symbol$1,
|
|
4241
|
-
...componentInfo$
|
|
4602
|
+
...componentInfo$b
|
|
4242
4603
|
},
|
|
4243
4604
|
{
|
|
4244
4605
|
component: Text,
|
|
4245
|
-
...componentInfo$
|
|
4606
|
+
...componentInfo$9
|
|
4246
4607
|
},
|
|
4247
4608
|
...[
|
|
4248
4609
|
{
|
|
4249
4610
|
component: Tabs,
|
|
4250
|
-
...componentInfo$
|
|
4611
|
+
...componentInfo$a
|
|
4612
|
+
},
|
|
4613
|
+
{
|
|
4614
|
+
component: Accordion,
|
|
4615
|
+
...componentInfo$8
|
|
4251
4616
|
}
|
|
4252
4617
|
],
|
|
4253
4618
|
...getExtraComponents()
|
|
@@ -4353,6 +4718,17 @@ function flatten(object, path = null, separator = ".") {
|
|
|
4353
4718
|
};
|
|
4354
4719
|
}, {});
|
|
4355
4720
|
}
|
|
4721
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
4722
|
+
for (const key in obj) {
|
|
4723
|
+
const value = obj[key];
|
|
4724
|
+
const newKey = _current ? _current + "." + key : key;
|
|
4725
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$")))
|
|
4726
|
+
flattenMongoQuery(value, newKey, _res);
|
|
4727
|
+
else
|
|
4728
|
+
_res[newKey] = value;
|
|
4729
|
+
}
|
|
4730
|
+
return _res;
|
|
4731
|
+
}
|
|
4356
4732
|
const DEFAULT_API_VERSION = "v3";
|
|
4357
4733
|
const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
|
|
4358
4734
|
const BUILDER_OPTIONS_PREFIX = "options.";
|
|
@@ -4422,7 +4798,7 @@ const generateContentUrl = (options) => {
|
|
|
4422
4798
|
if (userAttributes)
|
|
4423
4799
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
4424
4800
|
if (query) {
|
|
4425
|
-
const flattened2 =
|
|
4801
|
+
const flattened2 = flattenMongoQuery({
|
|
4426
4802
|
query
|
|
4427
4803
|
});
|
|
4428
4804
|
for (const key in flattened2)
|
|
@@ -4695,7 +5071,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4695
5071
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
4696
5072
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
4697
5073
|
}
|
|
4698
|
-
const SDK_VERSION = "0.14.
|
|
5074
|
+
const SDK_VERSION = "0.14.22";
|
|
4699
5075
|
const registry = {};
|
|
4700
5076
|
function register(type, info) {
|
|
4701
5077
|
let typeList = registry[type];
|
|
@@ -5016,7 +5392,7 @@ const evaluateJsCode = function evaluateJsCode2(props, state, showContentProps,
|
|
|
5016
5392
|
enableCache: false
|
|
5017
5393
|
});
|
|
5018
5394
|
};
|
|
5019
|
-
const onClick = function
|
|
5395
|
+
const onClick = function onClick24(props, state, showContentProps, elementRef, event) {
|
|
5020
5396
|
var _a, _b;
|
|
5021
5397
|
if (props.builderContextSignal.content) {
|
|
5022
5398
|
const variationId = (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
|
|
@@ -5175,7 +5551,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
5175
5551
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
5176
5552
|
const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
|
|
5177
5553
|
if (!props2.apiKey)
|
|
5178
|
-
logger.error("No API key provided to `
|
|
5554
|
+
logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
5179
5555
|
evaluateJsCode(props2);
|
|
5180
5556
|
runHttpRequests(props2, state2, showContentProps2, elementRef2);
|
|
5181
5557
|
emitStateUpdate(props2);
|