@builder.io/sdk-solid 1.0.27 → 1.0.29

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/node/index.js CHANGED
@@ -636,6 +636,9 @@ function getProcessedBlock({
636
636
  }
637
637
  }
638
638
 
639
+ // src/functions/camel-to-kebab-case.ts
640
+ var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
641
+
639
642
  // src/components/block/animator.ts
640
643
  function throttle(func, wait, options = {}) {
641
644
  let context;
@@ -686,7 +689,6 @@ function assign(target, ..._args) {
686
689
  }
687
690
  return to;
688
691
  }
689
- var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
690
692
  function bindAnimations(animations) {
691
693
  for (const animation of animations) {
692
694
  switch (animation.trigger) {
@@ -738,7 +740,7 @@ function triggerAnimation(animation) {
738
740
  element.style.transitionDelay = "0";
739
741
  assign(element.style, animation.steps[0].styles);
740
742
  setTimeout(() => {
741
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
743
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
742
744
  if (animation.delay) {
743
745
  element.style.transitionDelay = animation.delay + "s";
744
746
  }
@@ -798,7 +800,7 @@ function bindScrollInViewAnimation(animation) {
798
800
  }
799
801
  attachDefaultState();
800
802
  setTimeout(() => {
801
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
803
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
802
804
  if (animation.delay) {
803
805
  element.style.transitionDelay = animation.delay + "s";
804
806
  }
@@ -811,9 +813,6 @@ function bindScrollInViewAnimation(animation) {
811
813
  });
812
814
  }
813
815
 
814
- // src/functions/camel-to-kebab-case.ts
815
- var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
816
-
817
816
  // src/helpers/css.ts
818
817
  var convertStyleMapToCSSArray = (style) => {
819
818
  const cssProps = Object.entries(style).map(([key, value]) => {
@@ -940,10 +939,10 @@ var getRepeatItemData = ({
940
939
  return repeatArray;
941
940
  };
942
941
  var shouldPassLinkComponent = (block) => {
943
- return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
942
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
944
943
  };
945
944
  var shouldPassRegisteredComponents = (block) => {
946
- return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
945
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
947
946
  };
948
947
 
949
948
  // src/constants/device-sizes.ts
@@ -1072,7 +1071,7 @@ function BlockStyles(props) {
1072
1071
  className: `${className}:hover`,
1073
1072
  styles: {
1074
1073
  ...hoverStyles,
1075
- transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(hoverAnimation.easing)}`,
1074
+ transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(hoverAnimation.easing)}`,
1076
1075
  transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
1077
1076
  }
1078
1077
  }) || "";
@@ -2278,8 +2277,320 @@ var handleABTesting = async ({
2278
2277
  // src/helpers/canTrack.ts
2279
2278
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
2280
2279
 
2281
- // src/blocks/button/component-info.ts
2280
+ // src/blocks/accordion/component-info.ts
2281
+ var defaultTitle = {
2282
+ "@type": "@builder.io/sdk:Element",
2283
+ layerName: "Accordion item title",
2284
+ responsiveStyles: {
2285
+ large: {
2286
+ marginTop: "10px",
2287
+ position: "relative",
2288
+ display: "flex",
2289
+ alignItems: "stretch",
2290
+ flexDirection: "column",
2291
+ paddingBottom: "10px"
2292
+ }
2293
+ },
2294
+ children: [{
2295
+ "@type": "@builder.io/sdk:Element",
2296
+ responsiveStyles: {
2297
+ large: {
2298
+ textAlign: "left",
2299
+ display: "flex",
2300
+ flexDirection: "column"
2301
+ }
2302
+ },
2303
+ component: {
2304
+ name: "Text",
2305
+ options: {
2306
+ text: "I am an accordion title. Click me!"
2307
+ }
2308
+ }
2309
+ }]
2310
+ };
2311
+ var defaultDetail = {
2312
+ "@type": "@builder.io/sdk:Element",
2313
+ layerName: "Accordion item detail",
2314
+ responsiveStyles: {
2315
+ large: {
2316
+ position: "relative",
2317
+ display: "flex",
2318
+ alignItems: "stretch",
2319
+ flexDirection: "column",
2320
+ marginTop: "10px",
2321
+ paddingBottom: "10px"
2322
+ }
2323
+ },
2324
+ children: [{
2325
+ "@type": "@builder.io/sdk:Element",
2326
+ responsiveStyles: {
2327
+ large: {
2328
+ paddingTop: "50px",
2329
+ textAlign: "left",
2330
+ display: "flex",
2331
+ flexDirection: "column",
2332
+ paddingBottom: "50px"
2333
+ }
2334
+ },
2335
+ component: {
2336
+ name: "Text",
2337
+ options: {
2338
+ text: "I am an accordion detail, hello!"
2339
+ }
2340
+ }
2341
+ }]
2342
+ };
2282
2343
  var componentInfo = {
2344
+ name: "Builder:Accordion",
2345
+ canHaveChildren: true,
2346
+ image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
2347
+ defaultStyles: {
2348
+ display: "flex",
2349
+ flexDirection: "column",
2350
+ alignItems: "stretch"
2351
+ },
2352
+ inputs: [{
2353
+ name: "items",
2354
+ type: "list",
2355
+ broadcast: true,
2356
+ subFields: [{
2357
+ name: "title",
2358
+ type: "uiBlocks",
2359
+ hideFromUI: true,
2360
+ defaultValue: [defaultTitle]
2361
+ }, {
2362
+ name: "detail",
2363
+ type: "uiBlocks",
2364
+ hideFromUI: true,
2365
+ defaultValue: [defaultDetail]
2366
+ }],
2367
+ defaultValue: [{
2368
+ title: [defaultTitle],
2369
+ detail: [defaultDetail]
2370
+ }, {
2371
+ title: [defaultTitle],
2372
+ detail: [defaultDetail]
2373
+ }],
2374
+ showIf: (options) => !options.get("useChildrenForItems")
2375
+ }, {
2376
+ name: "oneAtATime",
2377
+ helperText: "Only allow opening one at a time (collapse all others when new item openned)",
2378
+ type: "boolean",
2379
+ defaultValue: false
2380
+ }, {
2381
+ name: "grid",
2382
+ helperText: "Display as a grid",
2383
+ type: "boolean",
2384
+ defaultValue: false
2385
+ }, {
2386
+ name: "gridRowWidth",
2387
+ helperText: "Display as a grid",
2388
+ type: "string",
2389
+ showIf: (options) => options.get("grid"),
2390
+ defaultValue: "25%"
2391
+ }, {
2392
+ name: "useChildrenForItems",
2393
+ type: "boolean",
2394
+ helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
2395
+ advanced: true,
2396
+ defaultValue: false,
2397
+ onChange: (options) => {
2398
+ if (options.get("useChildrenForItems") === true) {
2399
+ options.set("items", []);
2400
+ }
2401
+ }
2402
+ }]
2403
+ };
2404
+
2405
+ // src/blocks/accordion/helpers.ts
2406
+ var convertOrderNumberToString = (order) => {
2407
+ return order.toString();
2408
+ };
2409
+
2410
+ // src/blocks/accordion/accordion.tsx
2411
+ var _tmpl$6 = /* @__PURE__ */ template(`<div class=builder-accordion>`);
2412
+ var _tmpl$23 = /* @__PURE__ */ template(`<div>`);
2413
+ function Accordion(props) {
2414
+ const [open, setOpen] = createSignal([]);
2415
+ const onlyOneAtATime = createMemo(() => {
2416
+ return Boolean(props.grid || props.oneAtATime);
2417
+ });
2418
+ const accordionStyles = createMemo(() => {
2419
+ const styles = {
2420
+ display: "flex",
2421
+ alignItems: "stretch",
2422
+ flexDirection: "column",
2423
+ ...props.grid && {
2424
+ flexDirection: "row",
2425
+ alignItems: "flex-start",
2426
+ flexWrap: "wrap"
2427
+ }
2428
+ };
2429
+ return Object.fromEntries(Object.entries(styles).map(([key, value]) => [camelToKebabCase(key), value]));
2430
+ });
2431
+ const accordionTitleStyles = createMemo(() => {
2432
+ const shared = {
2433
+ display: "flex",
2434
+ flexDirection: "column"
2435
+ };
2436
+ const styles = Object.fromEntries(Object.entries({
2437
+ ...shared,
2438
+ alignItems: "stretch",
2439
+ cursor: "pointer"
2440
+ }).map(([key, value]) => [camelToKebabCase(key), value]));
2441
+ return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
2442
+ });
2443
+ function getAccordionTitleClassName(index) {
2444
+ return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
2445
+ }
2446
+ function getAccordionDetailClassName(index) {
2447
+ return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
2448
+ }
2449
+ const openGridItemOrder = createMemo(() => {
2450
+ let itemOrder = null;
2451
+ const getOpenGridItemPosition = props.grid && open().length;
2452
+ if (getOpenGridItemPosition && document) {
2453
+ const openItemIndex = open()[0];
2454
+ const openItem = document.querySelector(`.builder-accordion-title[data-index="${openItemIndex}"]`);
2455
+ let subjectItem = openItem;
2456
+ itemOrder = openItemIndex;
2457
+ if (subjectItem) {
2458
+ let prevItemRect = subjectItem.getBoundingClientRect();
2459
+ while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
2460
+ if (subjectItem) {
2461
+ if (subjectItem.classList.contains("builder-accordion-detail")) {
2462
+ continue;
2463
+ }
2464
+ const subjectItemRect = subjectItem.getBoundingClientRect();
2465
+ if (subjectItemRect.left > prevItemRect.left) {
2466
+ const index = parseInt(subjectItem.getAttribute("data-index") || "", 10);
2467
+ if (!isNaN(index)) {
2468
+ prevItemRect = subjectItemRect;
2469
+ itemOrder = index;
2470
+ }
2471
+ } else {
2472
+ break;
2473
+ }
2474
+ }
2475
+ }
2476
+ }
2477
+ }
2478
+ if (typeof itemOrder === "number") {
2479
+ itemOrder = itemOrder + 1;
2480
+ }
2481
+ return itemOrder;
2482
+ });
2483
+ const accordionDetailStyles = createMemo(() => {
2484
+ const styles = {
2485
+ ...{
2486
+ order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
2487
+ },
2488
+ ...props.grid && {
2489
+ width: "100%"
2490
+ }
2491
+ };
2492
+ return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
2493
+ });
2494
+ function onClick(index) {
2495
+ if (open().includes(index)) {
2496
+ setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
2497
+ } else {
2498
+ setOpen(onlyOneAtATime() ? [index] : open().concat(index));
2499
+ }
2500
+ }
2501
+ return (() => {
2502
+ const _el$ = _tmpl$6();
2503
+ insert(_el$, createComponent(For, {
2504
+ get each() {
2505
+ return props.items;
2506
+ },
2507
+ children: (item, _index) => {
2508
+ const index = _index();
2509
+ return [(() => {
2510
+ const _el$2 = _tmpl$23();
2511
+ _el$2.$$click = (event) => onClick(index);
2512
+ setAttribute(_el$2, "data-index", index);
2513
+ insert(_el$2, createComponent(blocks_default, {
2514
+ get blocks() {
2515
+ return item.title;
2516
+ },
2517
+ path: `items.${index}.title`,
2518
+ get parent() {
2519
+ return props.builderBlock.id;
2520
+ },
2521
+ get context() {
2522
+ return props.builderContext;
2523
+ },
2524
+ get registeredComponents() {
2525
+ return props.builderComponents;
2526
+ },
2527
+ get linkComponent() {
2528
+ return props.builderLinkComponent;
2529
+ }
2530
+ }));
2531
+ effect((_p$) => {
2532
+ const _v$ = getAccordionTitleClassName(index), _v$2 = {
2533
+ ...accordionTitleStyles(),
2534
+ width: props.grid ? props.gridRowWidth : void 0,
2535
+ ...{
2536
+ order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2537
+ }
2538
+ };
2539
+ _v$ !== _p$._v$ && className(_el$2, _p$._v$ = _v$);
2540
+ _p$._v$2 = style(_el$2, _v$2, _p$._v$2);
2541
+ return _p$;
2542
+ }, {
2543
+ _v$: void 0,
2544
+ _v$2: void 0
2545
+ });
2546
+ return _el$2;
2547
+ })(), createComponent(Show, {
2548
+ get when() {
2549
+ return open().includes(index);
2550
+ },
2551
+ get children() {
2552
+ const _el$3 = _tmpl$23();
2553
+ insert(_el$3, createComponent(blocks_default, {
2554
+ get blocks() {
2555
+ return item.detail;
2556
+ },
2557
+ path: `items.${index}.detail`,
2558
+ get parent() {
2559
+ return props.builderBlock.id;
2560
+ },
2561
+ get context() {
2562
+ return props.builderContext;
2563
+ },
2564
+ get registeredComponents() {
2565
+ return props.builderComponents;
2566
+ },
2567
+ get linkComponent() {
2568
+ return props.builderLinkComponent;
2569
+ }
2570
+ }));
2571
+ effect((_p$) => {
2572
+ const _v$3 = getAccordionDetailClassName(index), _v$4 = accordionDetailStyles();
2573
+ _v$3 !== _p$._v$3 && className(_el$3, _p$._v$3 = _v$3);
2574
+ _p$._v$4 = style(_el$3, _v$4, _p$._v$4);
2575
+ return _p$;
2576
+ }, {
2577
+ _v$3: void 0,
2578
+ _v$4: void 0
2579
+ });
2580
+ return _el$3;
2581
+ }
2582
+ })];
2583
+ }
2584
+ }));
2585
+ effect((_$p) => style(_el$, accordionStyles(), _$p));
2586
+ return _el$;
2587
+ })();
2588
+ }
2589
+ var accordion_default = Accordion;
2590
+ delegateEvents(["click"]);
2591
+
2592
+ // src/blocks/button/component-info.ts
2593
+ var componentInfo2 = {
2283
2594
  name: "Core:Button",
2284
2595
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
2285
2596
  defaultStyles: {
@@ -2315,7 +2626,7 @@ var componentInfo = {
2315
2626
  };
2316
2627
 
2317
2628
  // src/blocks/columns/component-info.ts
2318
- var componentInfo2 = {
2629
+ var componentInfo3 = {
2319
2630
  // TODO: ways to statically preprocess JSON for references, functions, etc
2320
2631
  name: "Columns",
2321
2632
  isRSC: true,
@@ -2535,7 +2846,7 @@ var componentInfo2 = {
2535
2846
  };
2536
2847
 
2537
2848
  // src/blocks/fragment/component-info.ts
2538
- var componentInfo3 = {
2849
+ var componentInfo4 = {
2539
2850
  name: "Fragment",
2540
2851
  static: true,
2541
2852
  hidden: true,
@@ -2544,7 +2855,7 @@ var componentInfo3 = {
2544
2855
  };
2545
2856
 
2546
2857
  // src/blocks/image/component-info.ts
2547
- var componentInfo4 = {
2858
+ var componentInfo5 = {
2548
2859
  name: "Image",
2549
2860
  static: true,
2550
2861
  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",
@@ -2666,7 +2977,7 @@ var componentInfo4 = {
2666
2977
  };
2667
2978
 
2668
2979
  // src/blocks/section/component-info.ts
2669
- var componentInfo5 = {
2980
+ var componentInfo6 = {
2670
2981
  name: "Core:Section",
2671
2982
  static: true,
2672
2983
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2708,7 +3019,7 @@ var componentInfo5 = {
2708
3019
  };
2709
3020
 
2710
3021
  // src/blocks/slot/component-info.ts
2711
- var componentInfo6 = {
3022
+ var componentInfo7 = {
2712
3023
  name: "Slot",
2713
3024
  isRSC: true,
2714
3025
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -2722,10 +3033,10 @@ var componentInfo6 = {
2722
3033
  defaultValue: "children"
2723
3034
  }]
2724
3035
  };
2725
- var _tmpl$6 = /* @__PURE__ */ template(`<div>`);
3036
+ var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
2726
3037
  function Slot(props) {
2727
3038
  return (() => {
2728
- const _el$ = _tmpl$6();
3039
+ const _el$ = _tmpl$7();
2729
3040
  _el$.style.setProperty("pointer-events", "auto");
2730
3041
  spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
2731
3042
  "builder-slot": props.name
@@ -2750,7 +3061,7 @@ function Slot(props) {
2750
3061
  var slot_default = Slot;
2751
3062
 
2752
3063
  // src/blocks/symbol/component-info.ts
2753
- var componentInfo7 = {
3064
+ var componentInfo8 = {
2754
3065
  name: "Symbol",
2755
3066
  noWrap: true,
2756
3067
  static: true,
@@ -2826,7 +3137,7 @@ var defaultElement = {
2826
3137
  }
2827
3138
  }
2828
3139
  };
2829
- var componentInfo8 = {
3140
+ var componentInfo9 = {
2830
3141
  name: "Builder: Tabs",
2831
3142
  inputs: [{
2832
3143
  name: "tabs",
@@ -2924,19 +3235,23 @@ var componentInfo8 = {
2924
3235
  }]
2925
3236
  }]
2926
3237
  };
2927
- var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
2928
- var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
3238
+ var _tmpl$8 = /* @__PURE__ */ template(`<div>`);
3239
+ var _tmpl$24 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
2929
3240
  var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
2930
3241
  function Tabs(props) {
2931
3242
  const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
2932
3243
  function activeTabContent(active) {
2933
3244
  return props.tabs && props.tabs[active].content;
2934
3245
  }
2935
- function getActiveTabStyle(index) {
2936
- return activeTab() === index ? props.activeTabStyle : {};
3246
+ function onClick(index) {
3247
+ if (index === activeTab() && props.collapsible) {
3248
+ setActiveTab(-1);
3249
+ } else {
3250
+ setActiveTab(index);
3251
+ }
2937
3252
  }
2938
3253
  return (() => {
2939
- const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
3254
+ const _el$ = _tmpl$24(), _el$2 = _el$.firstChild;
2940
3255
  _el$2.style.setProperty("display", "flex");
2941
3256
  _el$2.style.setProperty("flex-direction", "row");
2942
3257
  _el$2.style.setProperty("overflow", "auto");
@@ -2948,13 +3263,7 @@ function Tabs(props) {
2948
3263
  const index = _index();
2949
3264
  return (() => {
2950
3265
  const _el$4 = _tmpl$33();
2951
- _el$4.$$click = (event) => {
2952
- if (index === activeTab() && props.collapsible) {
2953
- setActiveTab(-1);
2954
- } else {
2955
- setActiveTab(index);
2956
- }
2957
- };
3266
+ _el$4.$$click = (event) => onClick(index);
2958
3267
  setAttribute(_el$4, "key", index);
2959
3268
  insert(_el$4, createComponent(blocks_default, {
2960
3269
  get parent() {
@@ -2975,7 +3284,9 @@ function Tabs(props) {
2975
3284
  }
2976
3285
  }));
2977
3286
  effect((_p$) => {
2978
- const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
3287
+ const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = {
3288
+ ...activeTab() === index ? props.activeTabStyle : {}
3289
+ };
2979
3290
  _v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
2980
3291
  _p$._v$2 = style(_el$4, _v$2, _p$._v$2);
2981
3292
  return _p$;
@@ -2992,7 +3303,7 @@ function Tabs(props) {
2992
3303
  return activeTabContent(activeTab());
2993
3304
  },
2994
3305
  get children() {
2995
- const _el$3 = _tmpl$7();
3306
+ const _el$3 = _tmpl$8();
2996
3307
  insert(_el$3, createComponent(blocks_default, {
2997
3308
  get parent() {
2998
3309
  return props.builderBlock.id;
@@ -3024,7 +3335,7 @@ var tabs_default = Tabs;
3024
3335
  delegateEvents(["click"]);
3025
3336
 
3026
3337
  // src/blocks/text/component-info.ts
3027
- var componentInfo9 = {
3338
+ var componentInfo10 = {
3028
3339
  name: "Text",
3029
3340
  static: true,
3030
3341
  isRSC: true,
@@ -3043,10 +3354,10 @@ var componentInfo9 = {
3043
3354
  textAlign: "center"
3044
3355
  }
3045
3356
  };
3046
- var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
3357
+ var _tmpl$9 = /* @__PURE__ */ template(`<div class=builder-text>`);
3047
3358
  function Text(props) {
3048
3359
  return (() => {
3049
- const _el$ = _tmpl$8();
3360
+ const _el$ = _tmpl$9();
3050
3361
  _el$.style.setProperty("outline", "none");
3051
3362
  effect(() => _el$.innerHTML = props.text?.toString() || "");
3052
3363
  return _el$;
@@ -3055,7 +3366,7 @@ function Text(props) {
3055
3366
  var text_default = Text;
3056
3367
 
3057
3368
  // src/blocks/custom-code/component-info.ts
3058
- var componentInfo10 = {
3369
+ var componentInfo11 = {
3059
3370
  name: "Custom Code",
3060
3371
  static: true,
3061
3372
  requiredPermissions: ["editCode"],
@@ -3078,7 +3389,7 @@ var componentInfo10 = {
3078
3389
  advanced: true
3079
3390
  }]
3080
3391
  };
3081
- var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
3392
+ var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
3082
3393
  function CustomCode(props) {
3083
3394
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
3084
3395
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -3112,7 +3423,7 @@ function CustomCode(props) {
3112
3423
  }
3113
3424
  });
3114
3425
  return (() => {
3115
- const _el$ = _tmpl$9();
3426
+ const _el$ = _tmpl$10();
3116
3427
  const _ref$ = elementRef;
3117
3428
  typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
3118
3429
  effect((_p$) => {
@@ -3130,7 +3441,7 @@ function CustomCode(props) {
3130
3441
  var custom_code_default = CustomCode;
3131
3442
 
3132
3443
  // src/blocks/embed/component-info.ts
3133
- var componentInfo11 = {
3444
+ var componentInfo12 = {
3134
3445
  name: "Embed",
3135
3446
  static: true,
3136
3447
  inputs: [{
@@ -3172,7 +3483,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
3172
3483
  var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
3173
3484
 
3174
3485
  // src/blocks/embed/embed.tsx
3175
- var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
3486
+ var _tmpl$11 = /* @__PURE__ */ template(`<div class=builder-embed>`);
3176
3487
  function Embed(props) {
3177
3488
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
3178
3489
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -3209,7 +3520,7 @@ function Embed(props) {
3209
3520
  }
3210
3521
  createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
3211
3522
  return (() => {
3212
- const _el$ = _tmpl$10();
3523
+ const _el$ = _tmpl$11();
3213
3524
  const _ref$ = elem;
3214
3525
  typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
3215
3526
  effect(() => _el$.innerHTML = props.content);
@@ -3219,7 +3530,7 @@ function Embed(props) {
3219
3530
  var embed_default = Embed;
3220
3531
 
3221
3532
  // src/blocks/form/form/component-info.ts
3222
- var componentInfo12 = {
3533
+ var componentInfo13 = {
3223
3534
  name: "Form:Form",
3224
3535
  // editableTags: ['builder-form-error']
3225
3536
  defaults: {
@@ -3466,8 +3777,8 @@ var get = (obj, path, defaultValue) => {
3466
3777
  };
3467
3778
 
3468
3779
  // src/blocks/form/form/form.tsx
3469
- var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
3470
- var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
3780
+ var _tmpl$12 = /* @__PURE__ */ template(`<pre>`);
3781
+ var _tmpl$25 = /* @__PURE__ */ template(`<form>`);
3471
3782
  function FormComponent(props) {
3472
3783
  const [formState, setFormState] = createSignal("unsubmitted");
3473
3784
  const [responseData, setResponseData] = createSignal(null);
@@ -3496,11 +3807,11 @@ function FormComponent(props) {
3496
3807
  return;
3497
3808
  }
3498
3809
  event.preventDefault();
3499
- const el = event.currentTarget;
3810
+ const el = event.currentTarget || event.target;
3500
3811
  const headers = props.customHeaders || {};
3501
3812
  let body;
3502
3813
  const formData = new FormData(el);
3503
- const formPairs = Array.from(event.currentTarget.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
3814
+ const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
3504
3815
  let value;
3505
3816
  const key = el2.name;
3506
3817
  if (el2 instanceof HTMLInputElement) {
@@ -3653,7 +3964,7 @@ function FormComponent(props) {
3653
3964
  }
3654
3965
  let formRef;
3655
3966
  return (() => {
3656
- const _el$ = _tmpl$24();
3967
+ const _el$ = _tmpl$25();
3657
3968
  _el$.addEventListener("submit", (event) => onSubmit(event));
3658
3969
  const _ref$ = formRef;
3659
3970
  typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
@@ -3670,7 +3981,7 @@ function FormComponent(props) {
3670
3981
  get name() {
3671
3982
  return props.name;
3672
3983
  }
3673
- }, {}, () => props.attributes), false, true);
3984
+ }, {}, {}, () => props.attributes), false, true);
3674
3985
  insert(_el$, createComponent(Show, {
3675
3986
  get when() {
3676
3987
  return props.builderBlock && props.builderBlock.children;
@@ -3736,7 +4047,7 @@ function FormComponent(props) {
3736
4047
  return memo(() => submissionState() === "error")() && responseData();
3737
4048
  },
3738
4049
  get children() {
3739
- const _el$2 = _tmpl$11();
4050
+ const _el$2 = _tmpl$12();
3740
4051
  insert(_el$2, () => JSON.stringify(responseData(), null, 2));
3741
4052
  effect(() => className(_el$2, "builder-form-error-text " + css({
3742
4053
  padding: "10px",
@@ -3768,7 +4079,7 @@ function FormComponent(props) {
3768
4079
  var form_default = FormComponent;
3769
4080
 
3770
4081
  // src/blocks/form/input/component-info.ts
3771
- var componentInfo13 = {
4082
+ var componentInfo14 = {
3772
4083
  name: "Form:Input",
3773
4084
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3774
4085
  inputs: [
@@ -3820,10 +4131,10 @@ var componentInfo13 = {
3820
4131
  borderColor: "#ccc"
3821
4132
  }
3822
4133
  };
3823
- var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
4134
+ var _tmpl$13 = /* @__PURE__ */ template(`<input>`);
3824
4135
  function FormInputComponent(props) {
3825
4136
  return (() => {
3826
- const _el$ = _tmpl$12();
4137
+ const _el$ = _tmpl$13();
3827
4138
  spread(_el$, mergeProps({}, () => props.attributes, {
3828
4139
  get key() {
3829
4140
  return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
@@ -3853,7 +4164,7 @@ function FormInputComponent(props) {
3853
4164
  var input_default = FormInputComponent;
3854
4165
 
3855
4166
  // src/blocks/form/select/component-info.ts
3856
- var componentInfo14 = {
4167
+ var componentInfo15 = {
3857
4168
  name: "Form:Select",
3858
4169
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3859
4170
  defaultStyles: {
@@ -3896,11 +4207,11 @@ var componentInfo14 = {
3896
4207
  static: true,
3897
4208
  noWrap: true
3898
4209
  };
3899
- var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
3900
- var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
4210
+ var _tmpl$14 = /* @__PURE__ */ template(`<select>`);
4211
+ var _tmpl$26 = /* @__PURE__ */ template(`<option>`);
3901
4212
  function SelectComponent(props) {
3902
4213
  return (() => {
3903
- const _el$ = _tmpl$13();
4214
+ const _el$ = _tmpl$14();
3904
4215
  spread(_el$, mergeProps({}, () => props.attributes, {
3905
4216
  get value() {
3906
4217
  return props.value;
@@ -3922,7 +4233,7 @@ function SelectComponent(props) {
3922
4233
  children: (option, _index) => {
3923
4234
  const index = _index();
3924
4235
  return (() => {
3925
- const _el$2 = _tmpl$25();
4236
+ const _el$2 = _tmpl$26();
3926
4237
  insert(_el$2, () => option.name || option.value);
3927
4238
  effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
3928
4239
  effect(() => _el$2.value = option.value);
@@ -3936,7 +4247,7 @@ function SelectComponent(props) {
3936
4247
  var select_default = SelectComponent;
3937
4248
 
3938
4249
  // src/blocks/form/submit-button/component-info.ts
3939
- var componentInfo15 = {
4250
+ var componentInfo16 = {
3940
4251
  name: "Form:SubmitButton",
3941
4252
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3942
4253
  defaultStyles: {
@@ -3962,10 +4273,10 @@ var componentInfo15 = {
3962
4273
  // TODO: defaultChildren
3963
4274
  // canHaveChildren: true,
3964
4275
  };
3965
- var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
4276
+ var _tmpl$15 = /* @__PURE__ */ template(`<button type=submit>`);
3966
4277
  function SubmitButton(props) {
3967
4278
  return (() => {
3968
- const _el$ = _tmpl$14();
4279
+ const _el$ = _tmpl$15();
3969
4280
  spread(_el$, mergeProps({}, () => props.attributes), false, true);
3970
4281
  insert(_el$, () => props.text);
3971
4282
  return _el$;
@@ -3974,7 +4285,7 @@ function SubmitButton(props) {
3974
4285
  var submit_button_default = SubmitButton;
3975
4286
 
3976
4287
  // src/blocks/img/component-info.ts
3977
- var componentInfo16 = {
4288
+ var componentInfo17 = {
3978
4289
  // friendlyName?
3979
4290
  name: "Raw:Img",
3980
4291
  hideFromInsertMenu: true,
@@ -3989,10 +4300,10 @@ var componentInfo16 = {
3989
4300
  noWrap: true,
3990
4301
  static: true
3991
4302
  };
3992
- var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
4303
+ var _tmpl$16 = /* @__PURE__ */ template(`<img>`);
3993
4304
  function ImgComponent(props) {
3994
4305
  return (() => {
3995
- const _el$ = _tmpl$15();
4306
+ const _el$ = _tmpl$16();
3996
4307
  spread(_el$, mergeProps({
3997
4308
  get style() {
3998
4309
  return {
@@ -4016,7 +4327,7 @@ function ImgComponent(props) {
4016
4327
  var img_default = ImgComponent;
4017
4328
 
4018
4329
  // src/blocks/video/component-info.ts
4019
- var componentInfo17 = {
4330
+ var componentInfo18 = {
4020
4331
  name: "Video",
4021
4332
  canHaveChildren: true,
4022
4333
  defaultStyles: {
@@ -4098,8 +4409,8 @@ var componentInfo17 = {
4098
4409
  advanced: true
4099
4410
  }]
4100
4411
  };
4101
- var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
4102
- var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
4412
+ var _tmpl$17 = /* @__PURE__ */ template(`<source type=video/mp4>`);
4413
+ var _tmpl$27 = /* @__PURE__ */ template(`<div>`);
4103
4414
  var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
4104
4415
  function Video(props) {
4105
4416
  const videoProps = createMemo(() => {
@@ -4161,7 +4472,7 @@ function Video(props) {
4161
4472
  return !props.lazyLoad;
4162
4473
  },
4163
4474
  get children() {
4164
- const _el$3 = _tmpl$16();
4475
+ const _el$3 = _tmpl$17();
4165
4476
  effect(() => setAttribute(_el$3, "src", props.video));
4166
4477
  return _el$3;
4167
4478
  }
@@ -4171,7 +4482,7 @@ function Video(props) {
4171
4482
  return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
4172
4483
  },
4173
4484
  get children() {
4174
- const _el$4 = _tmpl$26();
4485
+ const _el$4 = _tmpl$27();
4175
4486
  _el$4.style.setProperty("width", "100%");
4176
4487
  _el$4.style.setProperty("pointer-events", "none");
4177
4488
  _el$4.style.setProperty("font-size", "0px");
@@ -4184,7 +4495,7 @@ function Video(props) {
4184
4495
  return props.builderBlock?.children?.length && props.fitContent;
4185
4496
  },
4186
4497
  get children() {
4187
- const _el$5 = _tmpl$26();
4498
+ const _el$5 = _tmpl$27();
4188
4499
  _el$5.style.setProperty("display", "flex");
4189
4500
  _el$5.style.setProperty("flex-direction", "column");
4190
4501
  _el$5.style.setProperty("align-items", "stretch");
@@ -4197,7 +4508,7 @@ function Video(props) {
4197
4508
  return props.builderBlock?.children?.length && !props.fitContent;
4198
4509
  },
4199
4510
  get children() {
4200
- const _el$6 = _tmpl$26();
4511
+ const _el$6 = _tmpl$27();
4201
4512
  _el$6.style.setProperty("pointer-events", "none");
4202
4513
  _el$6.style.setProperty("display", "flex");
4203
4514
  _el$6.style.setProperty("flex-direction", "column");
@@ -4219,58 +4530,61 @@ var video_default = Video;
4219
4530
  // src/constants/extra-components.ts
4220
4531
  var getExtraComponents = () => [{
4221
4532
  component: custom_code_default,
4222
- ...componentInfo10
4533
+ ...componentInfo11
4223
4534
  }, {
4224
4535
  component: embed_default,
4225
- ...componentInfo11
4536
+ ...componentInfo12
4226
4537
  }, ...TARGET === "rsc" ? [] : [{
4227
4538
  component: form_default,
4228
- ...componentInfo12
4539
+ ...componentInfo13
4229
4540
  }, {
4230
4541
  component: input_default,
4231
- ...componentInfo13
4542
+ ...componentInfo14
4232
4543
  }, {
4233
4544
  component: submit_button_default,
4234
- ...componentInfo15
4545
+ ...componentInfo16
4235
4546
  }, {
4236
4547
  component: select_default,
4237
- ...componentInfo14
4548
+ ...componentInfo15
4238
4549
  }], {
4239
4550
  component: img_default,
4240
- ...componentInfo16
4551
+ ...componentInfo17
4241
4552
  }, {
4242
4553
  component: video_default,
4243
- ...componentInfo17
4554
+ ...componentInfo18
4244
4555
  }];
4245
4556
 
4246
4557
  // src/constants/builder-registered-components.ts
4247
4558
  var getDefaultRegisteredComponents = () => [{
4248
4559
  component: button_default,
4249
- ...componentInfo
4560
+ ...componentInfo2
4250
4561
  }, {
4251
4562
  component: columns_default,
4252
- ...componentInfo2
4563
+ ...componentInfo3
4253
4564
  }, {
4254
4565
  component: fragment_default,
4255
- ...componentInfo3
4566
+ ...componentInfo4
4256
4567
  }, {
4257
4568
  component: image_default,
4258
- ...componentInfo4
4569
+ ...componentInfo5
4259
4570
  }, {
4260
4571
  component: section_default,
4261
- ...componentInfo5
4572
+ ...componentInfo6
4262
4573
  }, {
4263
4574
  component: slot_default,
4264
- ...componentInfo6
4575
+ ...componentInfo7
4265
4576
  }, {
4266
4577
  component: symbol_default,
4267
- ...componentInfo7
4578
+ ...componentInfo8
4268
4579
  }, {
4269
4580
  component: text_default,
4270
- ...componentInfo9
4581
+ ...componentInfo10
4271
4582
  }, ...TARGET === "rsc" ? [] : [{
4272
4583
  component: tabs_default,
4273
- ...componentInfo8
4584
+ ...componentInfo9
4585
+ }, {
4586
+ component: accordion_default,
4587
+ ...componentInfo
4274
4588
  }], ...getExtraComponents()];
4275
4589
 
4276
4590
  // src/functions/register-component.ts
@@ -4340,10 +4654,10 @@ var getUpdateVariantVisibilityScript = ({
4340
4654
  }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
4341
4655
  "${variationId}", "${contentId}", ${isHydrationTarget}
4342
4656
  )`;
4343
- var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
4657
+ var _tmpl$18 = /* @__PURE__ */ template(`<script>`);
4344
4658
  function InlinedScript(props) {
4345
4659
  return (() => {
4346
- const _el$ = _tmpl$17();
4660
+ const _el$ = _tmpl$18();
4347
4661
  effect((_p$) => {
4348
4662
  const _v$ = props.scriptStr, _v$2 = props.id;
4349
4663
  _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
@@ -4849,7 +5163,7 @@ function isFromTrustedHost(trustedHosts, e) {
4849
5163
  }
4850
5164
 
4851
5165
  // src/constants/sdk-version.ts
4852
- var SDK_VERSION = "1.0.27";
5166
+ var SDK_VERSION = "1.0.29";
4853
5167
 
4854
5168
  // src/functions/register.ts
4855
5169
  var registry = {};
@@ -5313,7 +5627,7 @@ function EnableEditor(props) {
5313
5627
  if (isPreviewing() && !isEditing()) {
5314
5628
  const searchParams = new URL(location.href).searchParams;
5315
5629
  const searchParamPreviewModel = searchParams.get("builder.preview");
5316
- const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
5630
+ const searchParamPreviewId = searchParams.get(`builder.overrides.${searchParamPreviewModel}`);
5317
5631
  const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
5318
5632
  if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id)) {
5319
5633
  fetchOneEntry({
@@ -5331,7 +5645,7 @@ function EnableEditor(props) {
5331
5645
  });
5332
5646
  onMount(() => {
5333
5647
  if (!props.apiKey) {
5334
- logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
5648
+ logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
5335
5649
  }
5336
5650
  evaluateJsCode();
5337
5651
  runHttpRequests();
@@ -5833,7 +6147,7 @@ var fetchSymbolContent = async ({
5833
6147
  };
5834
6148
 
5835
6149
  // src/blocks/symbol/symbol.tsx
5836
- var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
6150
+ var _tmpl$19 = /* @__PURE__ */ template(`<div>`);
5837
6151
  function Symbol(props) {
5838
6152
  const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
5839
6153
  const blocksWrapper = createMemo(() => {
@@ -5865,7 +6179,7 @@ function Symbol(props) {
5865
6179
  }
5866
6180
  createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
5867
6181
  return (() => {
5868
- const _el$ = _tmpl$18();
6182
+ const _el$ = _tmpl$19();
5869
6183
  spread(_el$, mergeProps({
5870
6184
  get ["class"]() {
5871
6185
  return className();