@builder.io/sdk-qwik 0.14.21 → 0.14.23
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 +388 -22
- package/lib/browser/index.qwik.mjs +388 -22
- package/lib/edge/index.qwik.cjs +388 -22
- package/lib/edge/index.qwik.mjs +388 -22
- package/lib/node/index.qwik.cjs +388 -22
- package/lib/node/index.qwik.mjs +388 -22
- package/package.json +3 -3
- 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
|
@@ -365,6 +365,7 @@ function getProcessedBlock({ block, context, shouldEvaluateBindings, localState,
|
|
|
365
365
|
else
|
|
366
366
|
return transformedBlock;
|
|
367
367
|
}
|
|
368
|
+
const camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
368
369
|
function throttle(func, wait, options = {}) {
|
|
369
370
|
let context;
|
|
370
371
|
let args;
|
|
@@ -411,7 +412,6 @@ function assign(target, ..._args) {
|
|
|
411
412
|
}
|
|
412
413
|
return to;
|
|
413
414
|
}
|
|
414
|
-
const camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
415
415
|
function bindAnimations(animations) {
|
|
416
416
|
for (const animation of animations)
|
|
417
417
|
switch (animation.trigger) {
|
|
@@ -462,7 +462,7 @@ function triggerAnimation(animation) {
|
|
|
462
462
|
element.style.transitionDelay = "0";
|
|
463
463
|
assign(element.style, animation.steps[0].styles);
|
|
464
464
|
setTimeout(() => {
|
|
465
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
465
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
466
466
|
if (animation.delay)
|
|
467
467
|
element.style.transitionDelay = animation.delay + "s";
|
|
468
468
|
assign(element.style, animation.steps[1].styles);
|
|
@@ -520,7 +520,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
520
520
|
}
|
|
521
521
|
attachDefaultState();
|
|
522
522
|
setTimeout(() => {
|
|
523
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
523
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
524
524
|
if (animation.delay)
|
|
525
525
|
element.style.transitionDelay = animation.delay + "s";
|
|
526
526
|
});
|
|
@@ -531,7 +531,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
531
531
|
immediateOnScroll();
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
|
-
const camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
535
534
|
const convertStyleMapToCSSArray = (style) => {
|
|
536
535
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
537
536
|
if (typeof value === "string")
|
|
@@ -635,7 +634,8 @@ const shouldPassLinkComponent = (block) => {
|
|
|
635
634
|
"Symbol",
|
|
636
635
|
"Columns",
|
|
637
636
|
"Form:Form",
|
|
638
|
-
"Builder: Tabs"
|
|
637
|
+
"Builder: Tabs",
|
|
638
|
+
"Builder:Accordion"
|
|
639
639
|
].includes(block.name));
|
|
640
640
|
};
|
|
641
641
|
const shouldPassRegisteredComponents = (block) => {
|
|
@@ -643,7 +643,8 @@ const shouldPassRegisteredComponents = (block) => {
|
|
|
643
643
|
"Symbol",
|
|
644
644
|
"Columns",
|
|
645
645
|
"Form:Form",
|
|
646
|
-
"Builder: Tabs"
|
|
646
|
+
"Builder: Tabs",
|
|
647
|
+
"Builder:Accordion"
|
|
647
648
|
].includes(block.name));
|
|
648
649
|
};
|
|
649
650
|
const SIZES = {
|
|
@@ -761,7 +762,7 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
761
762
|
className: `${className}:hover`,
|
|
762
763
|
styles: {
|
|
763
764
|
...hoverStyles,
|
|
764
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
765
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(hoverAnimation.easing)}`,
|
|
765
766
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
766
767
|
}
|
|
767
768
|
}) || "";
|
|
@@ -1352,7 +1353,7 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
1352
1353
|
}, 1, "jN_4") : null
|
|
1353
1354
|
}, 1, "jN_5");
|
|
1354
1355
|
}, "Block_component_nnPv0RY0U0k"));
|
|
1355
|
-
const onClick$
|
|
1356
|
+
const onClick$3 = function onClick2(props, state, className) {
|
|
1356
1357
|
var _a, _b;
|
|
1357
1358
|
if (isEditing() && !((_a = props.blocks) == null ? void 0 : _a.length))
|
|
1358
1359
|
(_b = window.parent) == null ? void 0 : _b.postMessage({
|
|
@@ -1399,7 +1400,7 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
1399
1400
|
},
|
|
1400
1401
|
onClick$: /* @__PURE__ */ inlinedQrl((event) => {
|
|
1401
1402
|
const [className2, props2, state2] = useLexicalScope();
|
|
1402
|
-
return onClick$
|
|
1403
|
+
return onClick$3(props2);
|
|
1403
1404
|
}, "BlocksWrapper_component_onClick_ufezvOupQrM", [
|
|
1404
1405
|
className,
|
|
1405
1406
|
props,
|
|
@@ -1407,7 +1408,7 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
1407
1408
|
]),
|
|
1408
1409
|
onKeyPress$: /* @__PURE__ */ inlinedQrl((event) => {
|
|
1409
1410
|
const [className2, props2, state2] = useLexicalScope();
|
|
1410
|
-
return onClick$
|
|
1411
|
+
return onClick$3(props2);
|
|
1411
1412
|
}, "BlocksWrapper_component_onKeyPress_9bz8vCQc3kg", [
|
|
1412
1413
|
className,
|
|
1413
1414
|
props,
|
|
@@ -2082,6 +2083,364 @@ const handleABTesting = async ({ item, canTrack }) => {
|
|
|
2082
2083
|
};
|
|
2083
2084
|
};
|
|
2084
2085
|
const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2086
|
+
const defaultTitle = {
|
|
2087
|
+
"@type": "@builder.io/sdk:Element",
|
|
2088
|
+
layerName: "Accordion item title",
|
|
2089
|
+
responsiveStyles: {
|
|
2090
|
+
large: {
|
|
2091
|
+
marginTop: "10px",
|
|
2092
|
+
position: "relative",
|
|
2093
|
+
display: "flex",
|
|
2094
|
+
alignItems: "stretch",
|
|
2095
|
+
flexDirection: "column",
|
|
2096
|
+
paddingBottom: "10px"
|
|
2097
|
+
}
|
|
2098
|
+
},
|
|
2099
|
+
children: [
|
|
2100
|
+
{
|
|
2101
|
+
"@type": "@builder.io/sdk:Element",
|
|
2102
|
+
responsiveStyles: {
|
|
2103
|
+
large: {
|
|
2104
|
+
textAlign: "left",
|
|
2105
|
+
display: "flex",
|
|
2106
|
+
flexDirection: "column"
|
|
2107
|
+
}
|
|
2108
|
+
},
|
|
2109
|
+
component: {
|
|
2110
|
+
name: "Text",
|
|
2111
|
+
options: {
|
|
2112
|
+
text: "I am an accordion title. Click me!"
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
]
|
|
2117
|
+
};
|
|
2118
|
+
const defaultDetail = {
|
|
2119
|
+
"@type": "@builder.io/sdk:Element",
|
|
2120
|
+
layerName: "Accordion item detail",
|
|
2121
|
+
responsiveStyles: {
|
|
2122
|
+
large: {
|
|
2123
|
+
position: "relative",
|
|
2124
|
+
display: "flex",
|
|
2125
|
+
alignItems: "stretch",
|
|
2126
|
+
flexDirection: "column",
|
|
2127
|
+
marginTop: "10px",
|
|
2128
|
+
paddingBottom: "10px"
|
|
2129
|
+
}
|
|
2130
|
+
},
|
|
2131
|
+
children: [
|
|
2132
|
+
{
|
|
2133
|
+
"@type": "@builder.io/sdk:Element",
|
|
2134
|
+
responsiveStyles: {
|
|
2135
|
+
large: {
|
|
2136
|
+
paddingTop: "50px",
|
|
2137
|
+
textAlign: "left",
|
|
2138
|
+
display: "flex",
|
|
2139
|
+
flexDirection: "column",
|
|
2140
|
+
paddingBottom: "50px"
|
|
2141
|
+
}
|
|
2142
|
+
},
|
|
2143
|
+
component: {
|
|
2144
|
+
name: "Text",
|
|
2145
|
+
options: {
|
|
2146
|
+
text: "I am an accordion detail, hello!"
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
]
|
|
2151
|
+
};
|
|
2152
|
+
const componentInfo$h = {
|
|
2153
|
+
name: "Builder:Accordion",
|
|
2154
|
+
canHaveChildren: true,
|
|
2155
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
2156
|
+
defaultStyles: {
|
|
2157
|
+
display: "flex",
|
|
2158
|
+
flexDirection: "column",
|
|
2159
|
+
alignItems: "stretch"
|
|
2160
|
+
},
|
|
2161
|
+
inputs: [
|
|
2162
|
+
{
|
|
2163
|
+
name: "items",
|
|
2164
|
+
type: "list",
|
|
2165
|
+
broadcast: true,
|
|
2166
|
+
subFields: [
|
|
2167
|
+
{
|
|
2168
|
+
name: "title",
|
|
2169
|
+
type: "uiBlocks",
|
|
2170
|
+
hideFromUI: true,
|
|
2171
|
+
defaultValue: [
|
|
2172
|
+
defaultTitle
|
|
2173
|
+
]
|
|
2174
|
+
},
|
|
2175
|
+
{
|
|
2176
|
+
name: "detail",
|
|
2177
|
+
type: "uiBlocks",
|
|
2178
|
+
hideFromUI: true,
|
|
2179
|
+
defaultValue: [
|
|
2180
|
+
defaultDetail
|
|
2181
|
+
]
|
|
2182
|
+
}
|
|
2183
|
+
],
|
|
2184
|
+
defaultValue: [
|
|
2185
|
+
{
|
|
2186
|
+
title: [
|
|
2187
|
+
defaultTitle
|
|
2188
|
+
],
|
|
2189
|
+
detail: [
|
|
2190
|
+
defaultDetail
|
|
2191
|
+
]
|
|
2192
|
+
},
|
|
2193
|
+
{
|
|
2194
|
+
title: [
|
|
2195
|
+
defaultTitle
|
|
2196
|
+
],
|
|
2197
|
+
detail: [
|
|
2198
|
+
defaultDetail
|
|
2199
|
+
]
|
|
2200
|
+
}
|
|
2201
|
+
],
|
|
2202
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
2203
|
+
},
|
|
2204
|
+
{
|
|
2205
|
+
name: "oneAtATime",
|
|
2206
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
2207
|
+
type: "boolean",
|
|
2208
|
+
defaultValue: false
|
|
2209
|
+
},
|
|
2210
|
+
{
|
|
2211
|
+
name: "grid",
|
|
2212
|
+
helperText: "Display as a grid",
|
|
2213
|
+
type: "boolean",
|
|
2214
|
+
defaultValue: false
|
|
2215
|
+
},
|
|
2216
|
+
{
|
|
2217
|
+
name: "gridRowWidth",
|
|
2218
|
+
helperText: "Display as a grid",
|
|
2219
|
+
type: "string",
|
|
2220
|
+
showIf: (options) => options.get("grid"),
|
|
2221
|
+
defaultValue: "25%"
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
name: "useChildrenForItems",
|
|
2225
|
+
type: "boolean",
|
|
2226
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
2227
|
+
advanced: true,
|
|
2228
|
+
defaultValue: false,
|
|
2229
|
+
onChange: (options) => {
|
|
2230
|
+
if (options.get("useChildrenForItems") === true)
|
|
2231
|
+
options.set("items", []);
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
]
|
|
2235
|
+
};
|
|
2236
|
+
const convertOrderNumberToString = (order) => {
|
|
2237
|
+
return order.toString();
|
|
2238
|
+
};
|
|
2239
|
+
const getAccordionTitleClassName = function getAccordionTitleClassName2(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index) {
|
|
2240
|
+
return `builder-accordion-title builder-accordion-title-${state.open.includes(index) ? "open" : "closed"}`;
|
|
2241
|
+
};
|
|
2242
|
+
const getAccordionDetailClassName = function getAccordionDetailClassName2(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index) {
|
|
2243
|
+
return `builder-accordion-detail builder-accordion-detail-${state.open.includes(index) ? "open" : "closed"}`;
|
|
2244
|
+
};
|
|
2245
|
+
const onClick$2 = function onClick22(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index) {
|
|
2246
|
+
if (state.open.includes(index))
|
|
2247
|
+
state.open = onlyOneAtATime.value ? [] : state.open.filter((item) => item !== index);
|
|
2248
|
+
else
|
|
2249
|
+
state.open = onlyOneAtATime.value ? [
|
|
2250
|
+
index
|
|
2251
|
+
] : state.open.concat(index);
|
|
2252
|
+
};
|
|
2253
|
+
const Accordion = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
2254
|
+
const state = useStore({
|
|
2255
|
+
open: []
|
|
2256
|
+
});
|
|
2257
|
+
const onlyOneAtATime = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2258
|
+
const [props2] = useLexicalScope();
|
|
2259
|
+
return Boolean(props2.grid || props2.oneAtATime);
|
|
2260
|
+
}, "Accordion_component_onlyOneAtATime_useComputed_QYD7IoPU2HY", [
|
|
2261
|
+
props
|
|
2262
|
+
]));
|
|
2263
|
+
const accordionStyles = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2264
|
+
const [props2] = useLexicalScope();
|
|
2265
|
+
const styles = {
|
|
2266
|
+
display: "flex",
|
|
2267
|
+
alignItems: "stretch",
|
|
2268
|
+
flexDirection: "column",
|
|
2269
|
+
...props2.grid && {
|
|
2270
|
+
flexDirection: "row",
|
|
2271
|
+
alignItems: "flex-start",
|
|
2272
|
+
flexWrap: "wrap"
|
|
2273
|
+
}
|
|
2274
|
+
};
|
|
2275
|
+
return styles;
|
|
2276
|
+
}, "Accordion_component_accordionStyles_useComputed_Jrd0cwGn25U", [
|
|
2277
|
+
props
|
|
2278
|
+
]));
|
|
2279
|
+
const accordionTitleStyles = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2280
|
+
const shared = {
|
|
2281
|
+
display: "flex",
|
|
2282
|
+
flexDirection: "column"
|
|
2283
|
+
};
|
|
2284
|
+
const styles = {
|
|
2285
|
+
...shared,
|
|
2286
|
+
alignItems: "stretch",
|
|
2287
|
+
cursor: "pointer"
|
|
2288
|
+
};
|
|
2289
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
2290
|
+
}, "Accordion_component_accordionTitleStyles_useComputed_FopdBMH0V6U"));
|
|
2291
|
+
const openGridItemOrder = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2292
|
+
const [props2, state2] = useLexicalScope();
|
|
2293
|
+
let itemOrder = null;
|
|
2294
|
+
const getOpenGridItemPosition = props2.grid && state2.open.length;
|
|
2295
|
+
if (getOpenGridItemPosition && document) {
|
|
2296
|
+
const openItemIndex = state2.open[0];
|
|
2297
|
+
const openItem = document.querySelector(`.builder-accordion-title[data-index="${openItemIndex}"]`);
|
|
2298
|
+
let subjectItem = openItem;
|
|
2299
|
+
itemOrder = openItemIndex;
|
|
2300
|
+
if (subjectItem) {
|
|
2301
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
2302
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling)
|
|
2303
|
+
if (subjectItem) {
|
|
2304
|
+
if (subjectItem.classList.contains("builder-accordion-detail"))
|
|
2305
|
+
continue;
|
|
2306
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
2307
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
2308
|
+
const index = parseInt(subjectItem.getAttribute("data-index") || "", 10);
|
|
2309
|
+
if (!isNaN(index)) {
|
|
2310
|
+
prevItemRect = subjectItemRect;
|
|
2311
|
+
itemOrder = index;
|
|
2312
|
+
}
|
|
2313
|
+
} else
|
|
2314
|
+
break;
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
if (typeof itemOrder === "number")
|
|
2319
|
+
itemOrder = itemOrder + 1;
|
|
2320
|
+
return itemOrder;
|
|
2321
|
+
}, "Accordion_component_openGridItemOrder_useComputed_cCQY1Vnxll0", [
|
|
2322
|
+
props,
|
|
2323
|
+
state
|
|
2324
|
+
]));
|
|
2325
|
+
const accordionDetailStyles = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2326
|
+
const [openGridItemOrder2, props2] = useLexicalScope();
|
|
2327
|
+
const styles = {
|
|
2328
|
+
order: typeof openGridItemOrder2.value === "number" ? openGridItemOrder2.value : void 0,
|
|
2329
|
+
...props2.grid && {
|
|
2330
|
+
width: "100%"
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
2334
|
+
}, "Accordion_component_accordionDetailStyles_useComputed_S0QmQzGJoRo", [
|
|
2335
|
+
openGridItemOrder,
|
|
2336
|
+
props
|
|
2337
|
+
]));
|
|
2338
|
+
return /* @__PURE__ */ _jsxQ("div", null, {
|
|
2339
|
+
class: "builder-accordion",
|
|
2340
|
+
style: _fnSignal((p0) => p0.value, [
|
|
2341
|
+
accordionStyles
|
|
2342
|
+
], "p0.value")
|
|
2343
|
+
}, (props.items || []).map((item, index) => {
|
|
2344
|
+
_jsxBranch();
|
|
2345
|
+
return /* @__PURE__ */ _jsxC(Fragment$1, {
|
|
2346
|
+
children: [
|
|
2347
|
+
/* @__PURE__ */ _jsxQ("div", {
|
|
2348
|
+
class: getAccordionTitleClassName(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index),
|
|
2349
|
+
"data-index": index,
|
|
2350
|
+
onClick$: /* @__PURE__ */ inlinedQrl((event) => {
|
|
2351
|
+
const [accordionDetailStyles2, accordionStyles2, accordionTitleStyles2, index2, onlyOneAtATime2, openGridItemOrder2, props2, state2] = useLexicalScope();
|
|
2352
|
+
return onClick$2(props2, state2, onlyOneAtATime2, accordionStyles2, accordionTitleStyles2, openGridItemOrder2, accordionDetailStyles2, index2);
|
|
2353
|
+
}, "Accordion_component_div_Fragment_div_onClick_VtzhhJnK0XI", [
|
|
2354
|
+
accordionDetailStyles,
|
|
2355
|
+
accordionStyles,
|
|
2356
|
+
accordionTitleStyles,
|
|
2357
|
+
index,
|
|
2358
|
+
onlyOneAtATime,
|
|
2359
|
+
openGridItemOrder,
|
|
2360
|
+
props,
|
|
2361
|
+
state
|
|
2362
|
+
]),
|
|
2363
|
+
style: {
|
|
2364
|
+
...accordionTitleStyles.value,
|
|
2365
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
2366
|
+
order: openGridItemOrder.value !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
2367
|
+
}
|
|
2368
|
+
}, null, /* @__PURE__ */ _jsxC(Blocks, {
|
|
2369
|
+
get blocks() {
|
|
2370
|
+
return item.title;
|
|
2371
|
+
},
|
|
2372
|
+
path: `items.${index}.title`,
|
|
2373
|
+
get parent() {
|
|
2374
|
+
return props.builderBlock.id;
|
|
2375
|
+
},
|
|
2376
|
+
get context() {
|
|
2377
|
+
return props.builderContext;
|
|
2378
|
+
},
|
|
2379
|
+
get registeredComponents() {
|
|
2380
|
+
return props.builderComponents;
|
|
2381
|
+
},
|
|
2382
|
+
get linkComponent() {
|
|
2383
|
+
return props.builderLinkComponent;
|
|
2384
|
+
},
|
|
2385
|
+
[_IMMUTABLE]: {
|
|
2386
|
+
blocks: _wrapProp(item, "title"),
|
|
2387
|
+
context: _fnSignal((p0) => p0.builderContext, [
|
|
2388
|
+
props
|
|
2389
|
+
], "p0.builderContext"),
|
|
2390
|
+
linkComponent: _fnSignal((p0) => p0.builderLinkComponent, [
|
|
2391
|
+
props
|
|
2392
|
+
], "p0.builderLinkComponent"),
|
|
2393
|
+
parent: _fnSignal((p0) => p0.builderBlock.id, [
|
|
2394
|
+
props
|
|
2395
|
+
], "p0.builderBlock.id"),
|
|
2396
|
+
registeredComponents: _fnSignal((p0) => p0.builderComponents, [
|
|
2397
|
+
props
|
|
2398
|
+
], "p0.builderComponents")
|
|
2399
|
+
}
|
|
2400
|
+
}, 3, "hf_0"), 0, null),
|
|
2401
|
+
state.open.includes(index) ? /* @__PURE__ */ _jsxQ("div", {
|
|
2402
|
+
class: getAccordionDetailClassName(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index)
|
|
2403
|
+
}, {
|
|
2404
|
+
style: _fnSignal((p0) => p0.value, [
|
|
2405
|
+
accordionDetailStyles
|
|
2406
|
+
], "p0.value")
|
|
2407
|
+
}, /* @__PURE__ */ _jsxC(Blocks, {
|
|
2408
|
+
get blocks() {
|
|
2409
|
+
return item.detail;
|
|
2410
|
+
},
|
|
2411
|
+
path: `items.${index}.detail`,
|
|
2412
|
+
get parent() {
|
|
2413
|
+
return props.builderBlock.id;
|
|
2414
|
+
},
|
|
2415
|
+
get context() {
|
|
2416
|
+
return props.builderContext;
|
|
2417
|
+
},
|
|
2418
|
+
get registeredComponents() {
|
|
2419
|
+
return props.builderComponents;
|
|
2420
|
+
},
|
|
2421
|
+
get linkComponent() {
|
|
2422
|
+
return props.builderLinkComponent;
|
|
2423
|
+
},
|
|
2424
|
+
[_IMMUTABLE]: {
|
|
2425
|
+
blocks: _wrapProp(item, "detail"),
|
|
2426
|
+
context: _fnSignal((p0) => p0.builderContext, [
|
|
2427
|
+
props
|
|
2428
|
+
], "p0.builderContext"),
|
|
2429
|
+
linkComponent: _fnSignal((p0) => p0.builderLinkComponent, [
|
|
2430
|
+
props
|
|
2431
|
+
], "p0.builderLinkComponent"),
|
|
2432
|
+
parent: _fnSignal((p0) => p0.builderBlock.id, [
|
|
2433
|
+
props
|
|
2434
|
+
], "p0.builderBlock.id"),
|
|
2435
|
+
registeredComponents: _fnSignal((p0) => p0.builderComponents, [
|
|
2436
|
+
props
|
|
2437
|
+
], "p0.builderComponents")
|
|
2438
|
+
}
|
|
2439
|
+
}, 3, "hf_1"), 1, "hf_2") : null
|
|
2440
|
+
]
|
|
2441
|
+
}, 1, "hf_3");
|
|
2442
|
+
}), 1, "hf_4");
|
|
2443
|
+
}, "Accordion_component_jkuUCHm0nt0"));
|
|
2085
2444
|
const componentInfo$g = {
|
|
2086
2445
|
name: "Core:Button",
|
|
2087
2446
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
@@ -2828,8 +3187,11 @@ const componentInfo$9 = {
|
|
|
2828
3187
|
const activeTabContent = function activeTabContent2(props, state, active) {
|
|
2829
3188
|
return props.tabs && props.tabs[active].content;
|
|
2830
3189
|
};
|
|
2831
|
-
const
|
|
2832
|
-
|
|
3190
|
+
const onClick$1 = function onClick23(props, state, index) {
|
|
3191
|
+
if (index === state.activeTab && props.collapsible)
|
|
3192
|
+
state.activeTab = -1;
|
|
3193
|
+
else
|
|
3194
|
+
state.activeTab = index;
|
|
2833
3195
|
};
|
|
2834
3196
|
const Tabs = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
2835
3197
|
_jsxBranch();
|
|
@@ -2852,16 +3214,15 @@ const Tabs = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
2852
3214
|
class: `builder-tab-wrap ${state.activeTab === index ? "builder-tab-active" : ""}`,
|
|
2853
3215
|
onClick$: /* @__PURE__ */ inlinedQrl((event) => {
|
|
2854
3216
|
const [index2, props2, state2] = useLexicalScope();
|
|
2855
|
-
|
|
2856
|
-
state2.activeTab = -1;
|
|
2857
|
-
else
|
|
2858
|
-
state2.activeTab = index2;
|
|
3217
|
+
return onClick$1(props2, state2, index2);
|
|
2859
3218
|
}, "Tabs_component_div_div_span_onClick_hSTBabAHGks", [
|
|
2860
3219
|
index,
|
|
2861
3220
|
props,
|
|
2862
3221
|
state
|
|
2863
3222
|
]),
|
|
2864
|
-
style:
|
|
3223
|
+
style: {
|
|
3224
|
+
...state.activeTab === index ? props.activeTabStyle : {}
|
|
3225
|
+
}
|
|
2865
3226
|
}, null, /* @__PURE__ */ _jsxC(Blocks, {
|
|
2866
3227
|
get parent() {
|
|
2867
3228
|
return props.builderBlock.id;
|
|
@@ -3457,11 +3818,11 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
3457
3818
|
return;
|
|
3458
3819
|
}
|
|
3459
3820
|
event.preventDefault();
|
|
3460
|
-
const el = event.currentTarget;
|
|
3821
|
+
const el = event.currentTarget || event.target;
|
|
3461
3822
|
const headers = props.customHeaders || {};
|
|
3462
3823
|
let body;
|
|
3463
3824
|
const formData = new FormData(el);
|
|
3464
|
-
const formPairs = Array.from(
|
|
3825
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
3465
3826
|
let value;
|
|
3466
3827
|
const key = el2.name;
|
|
3467
3828
|
if (el2 instanceof HTMLInputElement) {
|
|
@@ -3708,6 +4069,7 @@ const FormComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3708
4069
|
name: _fnSignal((p0) => p0.name, [
|
|
3709
4070
|
props
|
|
3710
4071
|
], "p0.name"),
|
|
4072
|
+
"preventdefault:submit": true,
|
|
3711
4073
|
validate: _fnSignal((p0) => p0.validate, [
|
|
3712
4074
|
props
|
|
3713
4075
|
], "p0.validate")
|
|
@@ -4246,6 +4608,10 @@ const getDefaultRegisteredComponents = () => [
|
|
|
4246
4608
|
{
|
|
4247
4609
|
component: Tabs,
|
|
4248
4610
|
...componentInfo$9
|
|
4611
|
+
},
|
|
4612
|
+
{
|
|
4613
|
+
component: Accordion,
|
|
4614
|
+
...componentInfo$h
|
|
4249
4615
|
}
|
|
4250
4616
|
],
|
|
4251
4617
|
...getExtraComponents()
|
|
@@ -4704,7 +5070,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4704
5070
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
4705
5071
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
4706
5072
|
}
|
|
4707
|
-
const SDK_VERSION = "0.14.
|
|
5073
|
+
const SDK_VERSION = "0.14.23";
|
|
4708
5074
|
const registry = {};
|
|
4709
5075
|
function register(type, info) {
|
|
4710
5076
|
let typeList = registry[type];
|
|
@@ -5025,7 +5391,7 @@ const evaluateJsCode = function evaluateJsCode2(props, state, showContentProps,
|
|
|
5025
5391
|
enableCache: false
|
|
5026
5392
|
});
|
|
5027
5393
|
};
|
|
5028
|
-
const onClick = function
|
|
5394
|
+
const onClick = function onClick24(props, state, showContentProps, elementRef, event) {
|
|
5029
5395
|
var _a, _b;
|
|
5030
5396
|
if (props.builderContextSignal.content) {
|
|
5031
5397
|
const variationId = (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
|
|
@@ -5184,7 +5550,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
5184
5550
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
5185
5551
|
const [elementRef2, props2, showContentProps2, state2] = useLexicalScope();
|
|
5186
5552
|
if (!props2.apiKey)
|
|
5187
|
-
logger.error("No API key provided to `
|
|
5553
|
+
logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
5188
5554
|
evaluateJsCode(props2);
|
|
5189
5555
|
runHttpRequests(props2, state2, showContentProps2, elementRef2);
|
|
5190
5556
|
emitStateUpdate(props2);
|