@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
package/lib/node/index.qwik.mjs
CHANGED
|
@@ -497,6 +497,7 @@ function getProcessedBlock({ block, context, shouldEvaluateBindings, localState,
|
|
|
497
497
|
else
|
|
498
498
|
return transformedBlock;
|
|
499
499
|
}
|
|
500
|
+
const camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
500
501
|
function throttle(func, wait, options = {}) {
|
|
501
502
|
let context;
|
|
502
503
|
let args;
|
|
@@ -543,7 +544,6 @@ function assign(target, ..._args) {
|
|
|
543
544
|
}
|
|
544
545
|
return to;
|
|
545
546
|
}
|
|
546
|
-
const camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
547
547
|
function bindAnimations(animations) {
|
|
548
548
|
for (const animation of animations)
|
|
549
549
|
switch (animation.trigger) {
|
|
@@ -594,7 +594,7 @@ function triggerAnimation(animation) {
|
|
|
594
594
|
element.style.transitionDelay = "0";
|
|
595
595
|
assign(element.style, animation.steps[0].styles);
|
|
596
596
|
setTimeout(() => {
|
|
597
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
597
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
598
598
|
if (animation.delay)
|
|
599
599
|
element.style.transitionDelay = animation.delay + "s";
|
|
600
600
|
assign(element.style, animation.steps[1].styles);
|
|
@@ -652,7 +652,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
652
652
|
}
|
|
653
653
|
attachDefaultState();
|
|
654
654
|
setTimeout(() => {
|
|
655
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
655
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
656
656
|
if (animation.delay)
|
|
657
657
|
element.style.transitionDelay = animation.delay + "s";
|
|
658
658
|
});
|
|
@@ -663,7 +663,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
663
663
|
immediateOnScroll();
|
|
664
664
|
});
|
|
665
665
|
}
|
|
666
|
-
const camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
667
666
|
const convertStyleMapToCSSArray = (style) => {
|
|
668
667
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
669
668
|
if (typeof value === "string")
|
|
@@ -767,7 +766,8 @@ const shouldPassLinkComponent = (block) => {
|
|
|
767
766
|
"Symbol",
|
|
768
767
|
"Columns",
|
|
769
768
|
"Form:Form",
|
|
770
|
-
"Builder: Tabs"
|
|
769
|
+
"Builder: Tabs",
|
|
770
|
+
"Builder:Accordion"
|
|
771
771
|
].includes(block.name));
|
|
772
772
|
};
|
|
773
773
|
const shouldPassRegisteredComponents = (block) => {
|
|
@@ -775,7 +775,8 @@ const shouldPassRegisteredComponents = (block) => {
|
|
|
775
775
|
"Symbol",
|
|
776
776
|
"Columns",
|
|
777
777
|
"Form:Form",
|
|
778
|
-
"Builder: Tabs"
|
|
778
|
+
"Builder: Tabs",
|
|
779
|
+
"Builder:Accordion"
|
|
779
780
|
].includes(block.name));
|
|
780
781
|
};
|
|
781
782
|
const SIZES = {
|
|
@@ -893,7 +894,7 @@ const BlockStyles = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pro
|
|
|
893
894
|
className: `${className}:hover`,
|
|
894
895
|
styles: {
|
|
895
896
|
...hoverStyles,
|
|
896
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
897
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(hoverAnimation.easing)}`,
|
|
897
898
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
898
899
|
}
|
|
899
900
|
}) || "";
|
|
@@ -1484,7 +1485,7 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
1484
1485
|
}, 1, "jN_4") : null
|
|
1485
1486
|
}, 1, "jN_5");
|
|
1486
1487
|
}, "Block_component_nnPv0RY0U0k"));
|
|
1487
|
-
const onClick$
|
|
1488
|
+
const onClick$3 = function onClick2(props, state, className) {
|
|
1488
1489
|
var _a, _b;
|
|
1489
1490
|
if (isEditing() && !((_a = props.blocks) == null ? void 0 : _a.length))
|
|
1490
1491
|
(_b = window.parent) == null ? void 0 : _b.postMessage({
|
|
@@ -1531,7 +1532,7 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
1531
1532
|
},
|
|
1532
1533
|
onClick$: /* @__PURE__ */ inlinedQrl((event) => {
|
|
1533
1534
|
const [className2, props2, state2] = useLexicalScope();
|
|
1534
|
-
return onClick$
|
|
1535
|
+
return onClick$3(props2);
|
|
1535
1536
|
}, "BlocksWrapper_component_onClick_ufezvOupQrM", [
|
|
1536
1537
|
className,
|
|
1537
1538
|
props,
|
|
@@ -1539,7 +1540,7 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
1539
1540
|
]),
|
|
1540
1541
|
onKeyPress$: /* @__PURE__ */ inlinedQrl((event) => {
|
|
1541
1542
|
const [className2, props2, state2] = useLexicalScope();
|
|
1542
|
-
return onClick$
|
|
1543
|
+
return onClick$3(props2);
|
|
1543
1544
|
}, "BlocksWrapper_component_onKeyPress_9bz8vCQc3kg", [
|
|
1544
1545
|
className,
|
|
1545
1546
|
props,
|
|
@@ -2214,6 +2215,364 @@ const handleABTesting = async ({ item, canTrack }) => {
|
|
|
2214
2215
|
};
|
|
2215
2216
|
};
|
|
2216
2217
|
const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2218
|
+
const defaultTitle = {
|
|
2219
|
+
"@type": "@builder.io/sdk:Element",
|
|
2220
|
+
layerName: "Accordion item title",
|
|
2221
|
+
responsiveStyles: {
|
|
2222
|
+
large: {
|
|
2223
|
+
marginTop: "10px",
|
|
2224
|
+
position: "relative",
|
|
2225
|
+
display: "flex",
|
|
2226
|
+
alignItems: "stretch",
|
|
2227
|
+
flexDirection: "column",
|
|
2228
|
+
paddingBottom: "10px"
|
|
2229
|
+
}
|
|
2230
|
+
},
|
|
2231
|
+
children: [
|
|
2232
|
+
{
|
|
2233
|
+
"@type": "@builder.io/sdk:Element",
|
|
2234
|
+
responsiveStyles: {
|
|
2235
|
+
large: {
|
|
2236
|
+
textAlign: "left",
|
|
2237
|
+
display: "flex",
|
|
2238
|
+
flexDirection: "column"
|
|
2239
|
+
}
|
|
2240
|
+
},
|
|
2241
|
+
component: {
|
|
2242
|
+
name: "Text",
|
|
2243
|
+
options: {
|
|
2244
|
+
text: "I am an accordion title. Click me!"
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
]
|
|
2249
|
+
};
|
|
2250
|
+
const defaultDetail = {
|
|
2251
|
+
"@type": "@builder.io/sdk:Element",
|
|
2252
|
+
layerName: "Accordion item detail",
|
|
2253
|
+
responsiveStyles: {
|
|
2254
|
+
large: {
|
|
2255
|
+
position: "relative",
|
|
2256
|
+
display: "flex",
|
|
2257
|
+
alignItems: "stretch",
|
|
2258
|
+
flexDirection: "column",
|
|
2259
|
+
marginTop: "10px",
|
|
2260
|
+
paddingBottom: "10px"
|
|
2261
|
+
}
|
|
2262
|
+
},
|
|
2263
|
+
children: [
|
|
2264
|
+
{
|
|
2265
|
+
"@type": "@builder.io/sdk:Element",
|
|
2266
|
+
responsiveStyles: {
|
|
2267
|
+
large: {
|
|
2268
|
+
paddingTop: "50px",
|
|
2269
|
+
textAlign: "left",
|
|
2270
|
+
display: "flex",
|
|
2271
|
+
flexDirection: "column",
|
|
2272
|
+
paddingBottom: "50px"
|
|
2273
|
+
}
|
|
2274
|
+
},
|
|
2275
|
+
component: {
|
|
2276
|
+
name: "Text",
|
|
2277
|
+
options: {
|
|
2278
|
+
text: "I am an accordion detail, hello!"
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
]
|
|
2283
|
+
};
|
|
2284
|
+
const componentInfo$h = {
|
|
2285
|
+
name: "Builder:Accordion",
|
|
2286
|
+
canHaveChildren: true,
|
|
2287
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
2288
|
+
defaultStyles: {
|
|
2289
|
+
display: "flex",
|
|
2290
|
+
flexDirection: "column",
|
|
2291
|
+
alignItems: "stretch"
|
|
2292
|
+
},
|
|
2293
|
+
inputs: [
|
|
2294
|
+
{
|
|
2295
|
+
name: "items",
|
|
2296
|
+
type: "list",
|
|
2297
|
+
broadcast: true,
|
|
2298
|
+
subFields: [
|
|
2299
|
+
{
|
|
2300
|
+
name: "title",
|
|
2301
|
+
type: "uiBlocks",
|
|
2302
|
+
hideFromUI: true,
|
|
2303
|
+
defaultValue: [
|
|
2304
|
+
defaultTitle
|
|
2305
|
+
]
|
|
2306
|
+
},
|
|
2307
|
+
{
|
|
2308
|
+
name: "detail",
|
|
2309
|
+
type: "uiBlocks",
|
|
2310
|
+
hideFromUI: true,
|
|
2311
|
+
defaultValue: [
|
|
2312
|
+
defaultDetail
|
|
2313
|
+
]
|
|
2314
|
+
}
|
|
2315
|
+
],
|
|
2316
|
+
defaultValue: [
|
|
2317
|
+
{
|
|
2318
|
+
title: [
|
|
2319
|
+
defaultTitle
|
|
2320
|
+
],
|
|
2321
|
+
detail: [
|
|
2322
|
+
defaultDetail
|
|
2323
|
+
]
|
|
2324
|
+
},
|
|
2325
|
+
{
|
|
2326
|
+
title: [
|
|
2327
|
+
defaultTitle
|
|
2328
|
+
],
|
|
2329
|
+
detail: [
|
|
2330
|
+
defaultDetail
|
|
2331
|
+
]
|
|
2332
|
+
}
|
|
2333
|
+
],
|
|
2334
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
2335
|
+
},
|
|
2336
|
+
{
|
|
2337
|
+
name: "oneAtATime",
|
|
2338
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
2339
|
+
type: "boolean",
|
|
2340
|
+
defaultValue: false
|
|
2341
|
+
},
|
|
2342
|
+
{
|
|
2343
|
+
name: "grid",
|
|
2344
|
+
helperText: "Display as a grid",
|
|
2345
|
+
type: "boolean",
|
|
2346
|
+
defaultValue: false
|
|
2347
|
+
},
|
|
2348
|
+
{
|
|
2349
|
+
name: "gridRowWidth",
|
|
2350
|
+
helperText: "Display as a grid",
|
|
2351
|
+
type: "string",
|
|
2352
|
+
showIf: (options) => options.get("grid"),
|
|
2353
|
+
defaultValue: "25%"
|
|
2354
|
+
},
|
|
2355
|
+
{
|
|
2356
|
+
name: "useChildrenForItems",
|
|
2357
|
+
type: "boolean",
|
|
2358
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
2359
|
+
advanced: true,
|
|
2360
|
+
defaultValue: false,
|
|
2361
|
+
onChange: (options) => {
|
|
2362
|
+
if (options.get("useChildrenForItems") === true)
|
|
2363
|
+
options.set("items", []);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
]
|
|
2367
|
+
};
|
|
2368
|
+
const convertOrderNumberToString = (order) => {
|
|
2369
|
+
return order.toString();
|
|
2370
|
+
};
|
|
2371
|
+
const getAccordionTitleClassName = function getAccordionTitleClassName2(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index) {
|
|
2372
|
+
return `builder-accordion-title builder-accordion-title-${state.open.includes(index) ? "open" : "closed"}`;
|
|
2373
|
+
};
|
|
2374
|
+
const getAccordionDetailClassName = function getAccordionDetailClassName2(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index) {
|
|
2375
|
+
return `builder-accordion-detail builder-accordion-detail-${state.open.includes(index) ? "open" : "closed"}`;
|
|
2376
|
+
};
|
|
2377
|
+
const onClick$2 = function onClick22(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index) {
|
|
2378
|
+
if (state.open.includes(index))
|
|
2379
|
+
state.open = onlyOneAtATime.value ? [] : state.open.filter((item) => item !== index);
|
|
2380
|
+
else
|
|
2381
|
+
state.open = onlyOneAtATime.value ? [
|
|
2382
|
+
index
|
|
2383
|
+
] : state.open.concat(index);
|
|
2384
|
+
};
|
|
2385
|
+
const Accordion = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
2386
|
+
const state = useStore({
|
|
2387
|
+
open: []
|
|
2388
|
+
});
|
|
2389
|
+
const onlyOneAtATime = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2390
|
+
const [props2] = useLexicalScope();
|
|
2391
|
+
return Boolean(props2.grid || props2.oneAtATime);
|
|
2392
|
+
}, "Accordion_component_onlyOneAtATime_useComputed_QYD7IoPU2HY", [
|
|
2393
|
+
props
|
|
2394
|
+
]));
|
|
2395
|
+
const accordionStyles = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2396
|
+
const [props2] = useLexicalScope();
|
|
2397
|
+
const styles = {
|
|
2398
|
+
display: "flex",
|
|
2399
|
+
alignItems: "stretch",
|
|
2400
|
+
flexDirection: "column",
|
|
2401
|
+
...props2.grid && {
|
|
2402
|
+
flexDirection: "row",
|
|
2403
|
+
alignItems: "flex-start",
|
|
2404
|
+
flexWrap: "wrap"
|
|
2405
|
+
}
|
|
2406
|
+
};
|
|
2407
|
+
return styles;
|
|
2408
|
+
}, "Accordion_component_accordionStyles_useComputed_Jrd0cwGn25U", [
|
|
2409
|
+
props
|
|
2410
|
+
]));
|
|
2411
|
+
const accordionTitleStyles = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2412
|
+
const shared = {
|
|
2413
|
+
display: "flex",
|
|
2414
|
+
flexDirection: "column"
|
|
2415
|
+
};
|
|
2416
|
+
const styles = {
|
|
2417
|
+
...shared,
|
|
2418
|
+
alignItems: "stretch",
|
|
2419
|
+
cursor: "pointer"
|
|
2420
|
+
};
|
|
2421
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
2422
|
+
}, "Accordion_component_accordionTitleStyles_useComputed_FopdBMH0V6U"));
|
|
2423
|
+
const openGridItemOrder = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2424
|
+
const [props2, state2] = useLexicalScope();
|
|
2425
|
+
let itemOrder = null;
|
|
2426
|
+
const getOpenGridItemPosition = props2.grid && state2.open.length;
|
|
2427
|
+
if (getOpenGridItemPosition && document) {
|
|
2428
|
+
const openItemIndex = state2.open[0];
|
|
2429
|
+
const openItem = document.querySelector(`.builder-accordion-title[data-index="${openItemIndex}"]`);
|
|
2430
|
+
let subjectItem = openItem;
|
|
2431
|
+
itemOrder = openItemIndex;
|
|
2432
|
+
if (subjectItem) {
|
|
2433
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
2434
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling)
|
|
2435
|
+
if (subjectItem) {
|
|
2436
|
+
if (subjectItem.classList.contains("builder-accordion-detail"))
|
|
2437
|
+
continue;
|
|
2438
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
2439
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
2440
|
+
const index = parseInt(subjectItem.getAttribute("data-index") || "", 10);
|
|
2441
|
+
if (!isNaN(index)) {
|
|
2442
|
+
prevItemRect = subjectItemRect;
|
|
2443
|
+
itemOrder = index;
|
|
2444
|
+
}
|
|
2445
|
+
} else
|
|
2446
|
+
break;
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
if (typeof itemOrder === "number")
|
|
2451
|
+
itemOrder = itemOrder + 1;
|
|
2452
|
+
return itemOrder;
|
|
2453
|
+
}, "Accordion_component_openGridItemOrder_useComputed_cCQY1Vnxll0", [
|
|
2454
|
+
props,
|
|
2455
|
+
state
|
|
2456
|
+
]));
|
|
2457
|
+
const accordionDetailStyles = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
2458
|
+
const [openGridItemOrder2, props2] = useLexicalScope();
|
|
2459
|
+
const styles = {
|
|
2460
|
+
order: typeof openGridItemOrder2.value === "number" ? openGridItemOrder2.value : void 0,
|
|
2461
|
+
...props2.grid && {
|
|
2462
|
+
width: "100%"
|
|
2463
|
+
}
|
|
2464
|
+
};
|
|
2465
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
2466
|
+
}, "Accordion_component_accordionDetailStyles_useComputed_S0QmQzGJoRo", [
|
|
2467
|
+
openGridItemOrder,
|
|
2468
|
+
props
|
|
2469
|
+
]));
|
|
2470
|
+
return /* @__PURE__ */ _jsxQ("div", null, {
|
|
2471
|
+
class: "builder-accordion",
|
|
2472
|
+
style: _fnSignal((p0) => p0.value, [
|
|
2473
|
+
accordionStyles
|
|
2474
|
+
], "p0.value")
|
|
2475
|
+
}, (props.items || []).map((item, index) => {
|
|
2476
|
+
_jsxBranch();
|
|
2477
|
+
return /* @__PURE__ */ _jsxC(Fragment$1, {
|
|
2478
|
+
children: [
|
|
2479
|
+
/* @__PURE__ */ _jsxQ("div", {
|
|
2480
|
+
class: getAccordionTitleClassName(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index),
|
|
2481
|
+
"data-index": index,
|
|
2482
|
+
onClick$: /* @__PURE__ */ inlinedQrl((event) => {
|
|
2483
|
+
const [accordionDetailStyles2, accordionStyles2, accordionTitleStyles2, index2, onlyOneAtATime2, openGridItemOrder2, props2, state2] = useLexicalScope();
|
|
2484
|
+
return onClick$2(props2, state2, onlyOneAtATime2, accordionStyles2, accordionTitleStyles2, openGridItemOrder2, accordionDetailStyles2, index2);
|
|
2485
|
+
}, "Accordion_component_div_Fragment_div_onClick_VtzhhJnK0XI", [
|
|
2486
|
+
accordionDetailStyles,
|
|
2487
|
+
accordionStyles,
|
|
2488
|
+
accordionTitleStyles,
|
|
2489
|
+
index,
|
|
2490
|
+
onlyOneAtATime,
|
|
2491
|
+
openGridItemOrder,
|
|
2492
|
+
props,
|
|
2493
|
+
state
|
|
2494
|
+
]),
|
|
2495
|
+
style: {
|
|
2496
|
+
...accordionTitleStyles.value,
|
|
2497
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
2498
|
+
order: openGridItemOrder.value !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
2499
|
+
}
|
|
2500
|
+
}, null, /* @__PURE__ */ _jsxC(Blocks, {
|
|
2501
|
+
get blocks() {
|
|
2502
|
+
return item.title;
|
|
2503
|
+
},
|
|
2504
|
+
path: `items.${index}.title`,
|
|
2505
|
+
get parent() {
|
|
2506
|
+
return props.builderBlock.id;
|
|
2507
|
+
},
|
|
2508
|
+
get context() {
|
|
2509
|
+
return props.builderContext;
|
|
2510
|
+
},
|
|
2511
|
+
get registeredComponents() {
|
|
2512
|
+
return props.builderComponents;
|
|
2513
|
+
},
|
|
2514
|
+
get linkComponent() {
|
|
2515
|
+
return props.builderLinkComponent;
|
|
2516
|
+
},
|
|
2517
|
+
[_IMMUTABLE]: {
|
|
2518
|
+
blocks: _wrapProp(item, "title"),
|
|
2519
|
+
context: _fnSignal((p0) => p0.builderContext, [
|
|
2520
|
+
props
|
|
2521
|
+
], "p0.builderContext"),
|
|
2522
|
+
linkComponent: _fnSignal((p0) => p0.builderLinkComponent, [
|
|
2523
|
+
props
|
|
2524
|
+
], "p0.builderLinkComponent"),
|
|
2525
|
+
parent: _fnSignal((p0) => p0.builderBlock.id, [
|
|
2526
|
+
props
|
|
2527
|
+
], "p0.builderBlock.id"),
|
|
2528
|
+
registeredComponents: _fnSignal((p0) => p0.builderComponents, [
|
|
2529
|
+
props
|
|
2530
|
+
], "p0.builderComponents")
|
|
2531
|
+
}
|
|
2532
|
+
}, 3, "hf_0"), 0, null),
|
|
2533
|
+
state.open.includes(index) ? /* @__PURE__ */ _jsxQ("div", {
|
|
2534
|
+
class: getAccordionDetailClassName(props, state, onlyOneAtATime, accordionStyles, accordionTitleStyles, openGridItemOrder, accordionDetailStyles, index)
|
|
2535
|
+
}, {
|
|
2536
|
+
style: _fnSignal((p0) => p0.value, [
|
|
2537
|
+
accordionDetailStyles
|
|
2538
|
+
], "p0.value")
|
|
2539
|
+
}, /* @__PURE__ */ _jsxC(Blocks, {
|
|
2540
|
+
get blocks() {
|
|
2541
|
+
return item.detail;
|
|
2542
|
+
},
|
|
2543
|
+
path: `items.${index}.detail`,
|
|
2544
|
+
get parent() {
|
|
2545
|
+
return props.builderBlock.id;
|
|
2546
|
+
},
|
|
2547
|
+
get context() {
|
|
2548
|
+
return props.builderContext;
|
|
2549
|
+
},
|
|
2550
|
+
get registeredComponents() {
|
|
2551
|
+
return props.builderComponents;
|
|
2552
|
+
},
|
|
2553
|
+
get linkComponent() {
|
|
2554
|
+
return props.builderLinkComponent;
|
|
2555
|
+
},
|
|
2556
|
+
[_IMMUTABLE]: {
|
|
2557
|
+
blocks: _wrapProp(item, "detail"),
|
|
2558
|
+
context: _fnSignal((p0) => p0.builderContext, [
|
|
2559
|
+
props
|
|
2560
|
+
], "p0.builderContext"),
|
|
2561
|
+
linkComponent: _fnSignal((p0) => p0.builderLinkComponent, [
|
|
2562
|
+
props
|
|
2563
|
+
], "p0.builderLinkComponent"),
|
|
2564
|
+
parent: _fnSignal((p0) => p0.builderBlock.id, [
|
|
2565
|
+
props
|
|
2566
|
+
], "p0.builderBlock.id"),
|
|
2567
|
+
registeredComponents: _fnSignal((p0) => p0.builderComponents, [
|
|
2568
|
+
props
|
|
2569
|
+
], "p0.builderComponents")
|
|
2570
|
+
}
|
|
2571
|
+
}, 3, "hf_1"), 1, "hf_2") : null
|
|
2572
|
+
]
|
|
2573
|
+
}, 1, "hf_3");
|
|
2574
|
+
}), 1, "hf_4");
|
|
2575
|
+
}, "Accordion_component_jkuUCHm0nt0"));
|
|
2217
2576
|
const componentInfo$g = {
|
|
2218
2577
|
name: "Core:Button",
|
|
2219
2578
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
@@ -2960,8 +3319,11 @@ const componentInfo$9 = {
|
|
|
2960
3319
|
const activeTabContent = function activeTabContent2(props, state, active) {
|
|
2961
3320
|
return props.tabs && props.tabs[active].content;
|
|
2962
3321
|
};
|
|
2963
|
-
const
|
|
2964
|
-
|
|
3322
|
+
const onClick$1 = function onClick23(props, state, index) {
|
|
3323
|
+
if (index === state.activeTab && props.collapsible)
|
|
3324
|
+
state.activeTab = -1;
|
|
3325
|
+
else
|
|
3326
|
+
state.activeTab = index;
|
|
2965
3327
|
};
|
|
2966
3328
|
const Tabs = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
2967
3329
|
_jsxBranch();
|
|
@@ -2984,16 +3346,15 @@ const Tabs = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
|
|
|
2984
3346
|
class: `builder-tab-wrap ${state.activeTab === index ? "builder-tab-active" : ""}`,
|
|
2985
3347
|
onClick$: /* @__PURE__ */ inlinedQrl((event) => {
|
|
2986
3348
|
const [index2, props2, state2] = useLexicalScope();
|
|
2987
|
-
|
|
2988
|
-
state2.activeTab = -1;
|
|
2989
|
-
else
|
|
2990
|
-
state2.activeTab = index2;
|
|
3349
|
+
return onClick$1(props2, state2, index2);
|
|
2991
3350
|
}, "Tabs_component_div_div_span_onClick_hSTBabAHGks", [
|
|
2992
3351
|
index,
|
|
2993
3352
|
props,
|
|
2994
3353
|
state
|
|
2995
3354
|
]),
|
|
2996
|
-
style:
|
|
3355
|
+
style: {
|
|
3356
|
+
...state.activeTab === index ? props.activeTabStyle : {}
|
|
3357
|
+
}
|
|
2997
3358
|
}, null, /* @__PURE__ */ _jsxC(Blocks, {
|
|
2998
3359
|
get parent() {
|
|
2999
3360
|
return props.builderBlock.id;
|
|
@@ -3589,11 +3950,11 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
3589
3950
|
return;
|
|
3590
3951
|
}
|
|
3591
3952
|
event.preventDefault();
|
|
3592
|
-
const el = event.currentTarget;
|
|
3953
|
+
const el = event.currentTarget || event.target;
|
|
3593
3954
|
const headers = props.customHeaders || {};
|
|
3594
3955
|
let body;
|
|
3595
3956
|
const formData = new FormData(el);
|
|
3596
|
-
const formPairs = Array.from(
|
|
3957
|
+
const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
3597
3958
|
let value;
|
|
3598
3959
|
const key = el2.name;
|
|
3599
3960
|
if (el2 instanceof HTMLInputElement) {
|
|
@@ -3840,6 +4201,7 @@ const FormComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
|
|
|
3840
4201
|
name: _fnSignal((p0) => p0.name, [
|
|
3841
4202
|
props
|
|
3842
4203
|
], "p0.name"),
|
|
4204
|
+
"preventdefault:submit": true,
|
|
3843
4205
|
validate: _fnSignal((p0) => p0.validate, [
|
|
3844
4206
|
props
|
|
3845
4207
|
], "p0.validate")
|
|
@@ -4378,6 +4740,10 @@ const getDefaultRegisteredComponents = () => [
|
|
|
4378
4740
|
{
|
|
4379
4741
|
component: Tabs,
|
|
4380
4742
|
...componentInfo$9
|
|
4743
|
+
},
|
|
4744
|
+
{
|
|
4745
|
+
component: Accordion,
|
|
4746
|
+
...componentInfo$h
|
|
4381
4747
|
}
|
|
4382
4748
|
],
|
|
4383
4749
|
...getExtraComponents()
|
|
@@ -4836,7 +5202,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4836
5202
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
4837
5203
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
4838
5204
|
}
|
|
4839
|
-
const SDK_VERSION = "0.14.
|
|
5205
|
+
const SDK_VERSION = "0.14.23";
|
|
4840
5206
|
const registry = {};
|
|
4841
5207
|
function register(type, info) {
|
|
4842
5208
|
let typeList = registry[type];
|
|
@@ -5157,7 +5523,7 @@ const evaluateJsCode = function evaluateJsCode2(props, state, showContentProps,
|
|
|
5157
5523
|
enableCache: false
|
|
5158
5524
|
});
|
|
5159
5525
|
};
|
|
5160
|
-
const onClick = function
|
|
5526
|
+
const onClick = function onClick24(props, state, showContentProps, elementRef, event) {
|
|
5161
5527
|
var _a, _b;
|
|
5162
5528
|
if (props.builderContextSignal.content) {
|
|
5163
5529
|
const variationId = (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
|
|
@@ -5316,7 +5682,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
5316
5682
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
5317
5683
|
const [elementRef2, props2, showContentProps2, state2] = useLexicalScope();
|
|
5318
5684
|
if (!props2.apiKey)
|
|
5319
|
-
logger.error("No API key provided to `
|
|
5685
|
+
logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
5320
5686
|
evaluateJsCode(props2);
|
|
5321
5687
|
runHttpRequests(props2, state2, showContentProps2, elementRef2);
|
|
5322
5688
|
emitStateUpdate(props2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-qwik",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.23",
|
|
4
4
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/qwik",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
"@builder.io/qwik": "^1.5.1",
|
|
113
113
|
"@builder.io/sdks": "workspace:*",
|
|
114
114
|
"@types/node": "latest",
|
|
115
|
-
"nx": "
|
|
116
|
-
"nx-cloud": "
|
|
115
|
+
"nx": "16.10.0",
|
|
116
|
+
"nx-cloud": "16.5.2",
|
|
117
117
|
"typescript": "^5.1.6",
|
|
118
118
|
"vite": "^4.3.2"
|
|
119
119
|
},
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AccordionProps } from "./accordion.types";
|
|
2
|
+
export declare const getAccordionTitleClassName: (props: any, state: any, onlyOneAtATime: any, accordionStyles: any, accordionTitleStyles: any, openGridItemOrder: any, accordionDetailStyles: any, index: number) => string;
|
|
3
|
+
export declare const getAccordionDetailClassName: (props: any, state: any, onlyOneAtATime: any, accordionStyles: any, accordionTitleStyles: any, openGridItemOrder: any, accordionDetailStyles: any, index: number) => string;
|
|
4
|
+
export declare const onClick: (props: any, state: any, onlyOneAtATime: any, accordionStyles: any, accordionTitleStyles: any, openGridItemOrder: any, accordionDetailStyles: any, index: number) => void;
|
|
5
|
+
export declare const Accordion: import("@builder.io/qwik").Component<AccordionProps>;
|
|
6
|
+
export default Accordion;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block';
|
|
2
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props';
|
|
3
|
+
export interface AccordionProps extends BuilderComponentsProp, BuilderLinkComponentProp, BuilderDataProps {
|
|
4
|
+
items: {
|
|
5
|
+
title: BuilderBlock[];
|
|
6
|
+
detail: BuilderBlock[];
|
|
7
|
+
}[];
|
|
8
|
+
oneAtATime?: boolean;
|
|
9
|
+
grid?: boolean;
|
|
10
|
+
gridRowWidth?: string;
|
|
11
|
+
useChildrenForItems?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertOrderNumberToString: (order: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './accordion.jsx';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TabsProps } from "./tabs.types";
|
|
2
2
|
export declare const activeTabContent: (props: any, state: any, active: number) => any;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const onClick: (props: any, state: any, index: number) => void;
|
|
4
4
|
export declare const Tabs: import("@builder.io/qwik").Component<TabsProps>;
|
|
5
5
|
export default Tabs;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { BuilderAnimation } from '../../types/builder-block';
|
|
2
|
-
export declare const camelCaseToKebabCase: (str?: string) => string;
|
|
3
2
|
export declare function bindAnimations(animations: BuilderAnimation[]): void;
|
|
4
3
|
export declare function triggerAnimation(animation: BuilderAnimation): void;
|
|
5
4
|
export declare function bindScrollInViewAnimation(animation: BuilderAnimation): void;
|
|
@@ -22,7 +22,7 @@ export interface ContentVariantsPrps {
|
|
|
22
22
|
*/
|
|
23
23
|
context?: BuilderRenderContext;
|
|
24
24
|
/**
|
|
25
|
-
* Your API Key: needed to dynamically fetch symbols (required).
|
|
25
|
+
* Your API Key: needed to enable visual editing, and to dynamically fetch symbols (required).
|
|
26
26
|
*/
|
|
27
27
|
apiKey: string;
|
|
28
28
|
apiVersion?: ApiVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.14.
|
|
1
|
+
export declare const SDK_VERSION = "0.14.23";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const camelToKebabCase: (
|
|
1
|
+
export declare const camelToKebabCase: (str?: string) => string;
|