@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/dev.js CHANGED
@@ -638,6 +638,9 @@ function getProcessedBlock({
638
638
  }
639
639
  }
640
640
 
641
+ // src/functions/camel-to-kebab-case.ts
642
+ var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
643
+
641
644
  // src/components/block/animator.ts
642
645
  function throttle(func, wait, options = {}) {
643
646
  let context;
@@ -688,7 +691,6 @@ function assign(target, ..._args) {
688
691
  }
689
692
  return to;
690
693
  }
691
- var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
692
694
  function bindAnimations(animations) {
693
695
  for (const animation of animations) {
694
696
  switch (animation.trigger) {
@@ -741,7 +743,7 @@ function triggerAnimation(animation) {
741
743
  element.style.transitionDelay = "0";
742
744
  assign(element.style, animation.steps[0].styles);
743
745
  setTimeout(() => {
744
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
746
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
745
747
  if (animation.delay) {
746
748
  element.style.transitionDelay = animation.delay + "s";
747
749
  }
@@ -801,7 +803,7 @@ function bindScrollInViewAnimation(animation) {
801
803
  }
802
804
  attachDefaultState();
803
805
  setTimeout(() => {
804
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
806
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
805
807
  if (animation.delay) {
806
808
  element.style.transitionDelay = animation.delay + "s";
807
809
  }
@@ -814,9 +816,6 @@ function bindScrollInViewAnimation(animation) {
814
816
  });
815
817
  }
816
818
 
817
- // src/functions/camel-to-kebab-case.ts
818
- var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
819
-
820
819
  // src/helpers/css.ts
821
820
  var convertStyleMapToCSSArray = (style) => {
822
821
  const cssProps = Object.entries(style).map(([key, value]) => {
@@ -946,10 +945,10 @@ var getRepeatItemData = ({
946
945
  return repeatArray;
947
946
  };
948
947
  var shouldPassLinkComponent = (block) => {
949
- return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
948
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
950
949
  };
951
950
  var shouldPassRegisteredComponents = (block) => {
952
- return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
951
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
953
952
  };
954
953
 
955
954
  // src/constants/device-sizes.ts
@@ -1078,7 +1077,7 @@ function BlockStyles(props) {
1078
1077
  className: `${className}:hover`,
1079
1078
  styles: {
1080
1079
  ...hoverStyles,
1081
- transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(hoverAnimation.easing)}`,
1080
+ transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(hoverAnimation.easing)}`,
1082
1081
  transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
1083
1082
  }
1084
1083
  }) || "";
@@ -2285,8 +2284,320 @@ var handleABTesting = async ({
2285
2284
  // src/helpers/canTrack.ts
2286
2285
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
2287
2286
 
2288
- // src/blocks/button/component-info.ts
2287
+ // src/blocks/accordion/component-info.ts
2288
+ var defaultTitle = {
2289
+ "@type": "@builder.io/sdk:Element",
2290
+ layerName: "Accordion item title",
2291
+ responsiveStyles: {
2292
+ large: {
2293
+ marginTop: "10px",
2294
+ position: "relative",
2295
+ display: "flex",
2296
+ alignItems: "stretch",
2297
+ flexDirection: "column",
2298
+ paddingBottom: "10px"
2299
+ }
2300
+ },
2301
+ children: [{
2302
+ "@type": "@builder.io/sdk:Element",
2303
+ responsiveStyles: {
2304
+ large: {
2305
+ textAlign: "left",
2306
+ display: "flex",
2307
+ flexDirection: "column"
2308
+ }
2309
+ },
2310
+ component: {
2311
+ name: "Text",
2312
+ options: {
2313
+ text: "I am an accordion title. Click me!"
2314
+ }
2315
+ }
2316
+ }]
2317
+ };
2318
+ var defaultDetail = {
2319
+ "@type": "@builder.io/sdk:Element",
2320
+ layerName: "Accordion item detail",
2321
+ responsiveStyles: {
2322
+ large: {
2323
+ position: "relative",
2324
+ display: "flex",
2325
+ alignItems: "stretch",
2326
+ flexDirection: "column",
2327
+ marginTop: "10px",
2328
+ paddingBottom: "10px"
2329
+ }
2330
+ },
2331
+ children: [{
2332
+ "@type": "@builder.io/sdk:Element",
2333
+ responsiveStyles: {
2334
+ large: {
2335
+ paddingTop: "50px",
2336
+ textAlign: "left",
2337
+ display: "flex",
2338
+ flexDirection: "column",
2339
+ paddingBottom: "50px"
2340
+ }
2341
+ },
2342
+ component: {
2343
+ name: "Text",
2344
+ options: {
2345
+ text: "I am an accordion detail, hello!"
2346
+ }
2347
+ }
2348
+ }]
2349
+ };
2289
2350
  var componentInfo = {
2351
+ name: "Builder:Accordion",
2352
+ canHaveChildren: true,
2353
+ image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
2354
+ defaultStyles: {
2355
+ display: "flex",
2356
+ flexDirection: "column",
2357
+ alignItems: "stretch"
2358
+ },
2359
+ inputs: [{
2360
+ name: "items",
2361
+ type: "list",
2362
+ broadcast: true,
2363
+ subFields: [{
2364
+ name: "title",
2365
+ type: "uiBlocks",
2366
+ hideFromUI: true,
2367
+ defaultValue: [defaultTitle]
2368
+ }, {
2369
+ name: "detail",
2370
+ type: "uiBlocks",
2371
+ hideFromUI: true,
2372
+ defaultValue: [defaultDetail]
2373
+ }],
2374
+ defaultValue: [{
2375
+ title: [defaultTitle],
2376
+ detail: [defaultDetail]
2377
+ }, {
2378
+ title: [defaultTitle],
2379
+ detail: [defaultDetail]
2380
+ }],
2381
+ showIf: (options) => !options.get("useChildrenForItems")
2382
+ }, {
2383
+ name: "oneAtATime",
2384
+ helperText: "Only allow opening one at a time (collapse all others when new item openned)",
2385
+ type: "boolean",
2386
+ defaultValue: false
2387
+ }, {
2388
+ name: "grid",
2389
+ helperText: "Display as a grid",
2390
+ type: "boolean",
2391
+ defaultValue: false
2392
+ }, {
2393
+ name: "gridRowWidth",
2394
+ helperText: "Display as a grid",
2395
+ type: "string",
2396
+ showIf: (options) => options.get("grid"),
2397
+ defaultValue: "25%"
2398
+ }, {
2399
+ name: "useChildrenForItems",
2400
+ type: "boolean",
2401
+ helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
2402
+ advanced: true,
2403
+ defaultValue: false,
2404
+ onChange: (options) => {
2405
+ if (options.get("useChildrenForItems") === true) {
2406
+ options.set("items", []);
2407
+ }
2408
+ }
2409
+ }]
2410
+ };
2411
+
2412
+ // src/blocks/accordion/helpers.ts
2413
+ var convertOrderNumberToString = (order) => {
2414
+ return order.toString();
2415
+ };
2416
+
2417
+ // src/blocks/accordion/accordion.tsx
2418
+ var _tmpl$6 = /* @__PURE__ */ template(`<div class=builder-accordion>`);
2419
+ var _tmpl$23 = /* @__PURE__ */ template(`<div>`);
2420
+ function Accordion(props) {
2421
+ const [open, setOpen] = createSignal([]);
2422
+ const onlyOneAtATime = createMemo(() => {
2423
+ return Boolean(props.grid || props.oneAtATime);
2424
+ });
2425
+ const accordionStyles = createMemo(() => {
2426
+ const styles = {
2427
+ display: "flex",
2428
+ alignItems: "stretch",
2429
+ flexDirection: "column",
2430
+ ...props.grid && {
2431
+ flexDirection: "row",
2432
+ alignItems: "flex-start",
2433
+ flexWrap: "wrap"
2434
+ }
2435
+ };
2436
+ return Object.fromEntries(Object.entries(styles).map(([key, value]) => [camelToKebabCase(key), value]));
2437
+ });
2438
+ const accordionTitleStyles = createMemo(() => {
2439
+ const shared = {
2440
+ display: "flex",
2441
+ flexDirection: "column"
2442
+ };
2443
+ const styles = Object.fromEntries(Object.entries({
2444
+ ...shared,
2445
+ alignItems: "stretch",
2446
+ cursor: "pointer"
2447
+ }).map(([key, value]) => [camelToKebabCase(key), value]));
2448
+ return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
2449
+ });
2450
+ function getAccordionTitleClassName(index) {
2451
+ return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
2452
+ }
2453
+ function getAccordionDetailClassName(index) {
2454
+ return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
2455
+ }
2456
+ const openGridItemOrder = createMemo(() => {
2457
+ let itemOrder = null;
2458
+ const getOpenGridItemPosition = props.grid && open().length;
2459
+ if (getOpenGridItemPosition && document) {
2460
+ const openItemIndex = open()[0];
2461
+ const openItem = document.querySelector(`.builder-accordion-title[data-index="${openItemIndex}"]`);
2462
+ let subjectItem = openItem;
2463
+ itemOrder = openItemIndex;
2464
+ if (subjectItem) {
2465
+ let prevItemRect = subjectItem.getBoundingClientRect();
2466
+ while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
2467
+ if (subjectItem) {
2468
+ if (subjectItem.classList.contains("builder-accordion-detail")) {
2469
+ continue;
2470
+ }
2471
+ const subjectItemRect = subjectItem.getBoundingClientRect();
2472
+ if (subjectItemRect.left > prevItemRect.left) {
2473
+ const index = parseInt(subjectItem.getAttribute("data-index") || "", 10);
2474
+ if (!isNaN(index)) {
2475
+ prevItemRect = subjectItemRect;
2476
+ itemOrder = index;
2477
+ }
2478
+ } else {
2479
+ break;
2480
+ }
2481
+ }
2482
+ }
2483
+ }
2484
+ }
2485
+ if (typeof itemOrder === "number") {
2486
+ itemOrder = itemOrder + 1;
2487
+ }
2488
+ return itemOrder;
2489
+ });
2490
+ const accordionDetailStyles = createMemo(() => {
2491
+ const styles = {
2492
+ ...{
2493
+ order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
2494
+ },
2495
+ ...props.grid && {
2496
+ width: "100%"
2497
+ }
2498
+ };
2499
+ return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
2500
+ });
2501
+ function onClick(index) {
2502
+ if (open().includes(index)) {
2503
+ setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
2504
+ } else {
2505
+ setOpen(onlyOneAtATime() ? [index] : open().concat(index));
2506
+ }
2507
+ }
2508
+ return (() => {
2509
+ const _el$ = _tmpl$6();
2510
+ insert(_el$, createComponent(For, {
2511
+ get each() {
2512
+ return props.items;
2513
+ },
2514
+ children: (item, _index) => {
2515
+ const index = _index();
2516
+ return [(() => {
2517
+ const _el$2 = _tmpl$23();
2518
+ _el$2.$$click = (event) => onClick(index);
2519
+ setAttribute(_el$2, "data-index", index);
2520
+ insert(_el$2, createComponent(blocks_default, {
2521
+ get blocks() {
2522
+ return item.title;
2523
+ },
2524
+ path: `items.${index}.title`,
2525
+ get parent() {
2526
+ return props.builderBlock.id;
2527
+ },
2528
+ get context() {
2529
+ return props.builderContext;
2530
+ },
2531
+ get registeredComponents() {
2532
+ return props.builderComponents;
2533
+ },
2534
+ get linkComponent() {
2535
+ return props.builderLinkComponent;
2536
+ }
2537
+ }));
2538
+ effect((_p$) => {
2539
+ const _v$ = getAccordionTitleClassName(index), _v$2 = {
2540
+ ...accordionTitleStyles(),
2541
+ width: props.grid ? props.gridRowWidth : void 0,
2542
+ ...{
2543
+ order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2544
+ }
2545
+ };
2546
+ _v$ !== _p$._v$ && className(_el$2, _p$._v$ = _v$);
2547
+ _p$._v$2 = style(_el$2, _v$2, _p$._v$2);
2548
+ return _p$;
2549
+ }, {
2550
+ _v$: void 0,
2551
+ _v$2: void 0
2552
+ });
2553
+ return _el$2;
2554
+ })(), createComponent(Show, {
2555
+ get when() {
2556
+ return open().includes(index);
2557
+ },
2558
+ get children() {
2559
+ const _el$3 = _tmpl$23();
2560
+ insert(_el$3, createComponent(blocks_default, {
2561
+ get blocks() {
2562
+ return item.detail;
2563
+ },
2564
+ path: `items.${index}.detail`,
2565
+ get parent() {
2566
+ return props.builderBlock.id;
2567
+ },
2568
+ get context() {
2569
+ return props.builderContext;
2570
+ },
2571
+ get registeredComponents() {
2572
+ return props.builderComponents;
2573
+ },
2574
+ get linkComponent() {
2575
+ return props.builderLinkComponent;
2576
+ }
2577
+ }));
2578
+ effect((_p$) => {
2579
+ const _v$3 = getAccordionDetailClassName(index), _v$4 = accordionDetailStyles();
2580
+ _v$3 !== _p$._v$3 && className(_el$3, _p$._v$3 = _v$3);
2581
+ _p$._v$4 = style(_el$3, _v$4, _p$._v$4);
2582
+ return _p$;
2583
+ }, {
2584
+ _v$3: void 0,
2585
+ _v$4: void 0
2586
+ });
2587
+ return _el$3;
2588
+ }
2589
+ })];
2590
+ }
2591
+ }));
2592
+ effect((_$p) => style(_el$, accordionStyles(), _$p));
2593
+ return _el$;
2594
+ })();
2595
+ }
2596
+ var accordion_default = Accordion;
2597
+ delegateEvents(["click"]);
2598
+
2599
+ // src/blocks/button/component-info.ts
2600
+ var componentInfo2 = {
2290
2601
  name: "Core:Button",
2291
2602
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
2292
2603
  defaultStyles: {
@@ -2322,7 +2633,7 @@ var componentInfo = {
2322
2633
  };
2323
2634
 
2324
2635
  // src/blocks/columns/component-info.ts
2325
- var componentInfo2 = {
2636
+ var componentInfo3 = {
2326
2637
  // TODO: ways to statically preprocess JSON for references, functions, etc
2327
2638
  name: "Columns",
2328
2639
  isRSC: true,
@@ -2542,7 +2853,7 @@ var componentInfo2 = {
2542
2853
  };
2543
2854
 
2544
2855
  // src/blocks/fragment/component-info.ts
2545
- var componentInfo3 = {
2856
+ var componentInfo4 = {
2546
2857
  name: "Fragment",
2547
2858
  static: true,
2548
2859
  hidden: true,
@@ -2551,7 +2862,7 @@ var componentInfo3 = {
2551
2862
  };
2552
2863
 
2553
2864
  // src/blocks/image/component-info.ts
2554
- var componentInfo4 = {
2865
+ var componentInfo5 = {
2555
2866
  name: "Image",
2556
2867
  static: true,
2557
2868
  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",
@@ -2674,7 +2985,7 @@ var componentInfo4 = {
2674
2985
  };
2675
2986
 
2676
2987
  // src/blocks/section/component-info.ts
2677
- var componentInfo5 = {
2988
+ var componentInfo6 = {
2678
2989
  name: "Core:Section",
2679
2990
  static: true,
2680
2991
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2716,7 +3027,7 @@ var componentInfo5 = {
2716
3027
  };
2717
3028
 
2718
3029
  // src/blocks/slot/component-info.ts
2719
- var componentInfo6 = {
3030
+ var componentInfo7 = {
2720
3031
  name: "Slot",
2721
3032
  isRSC: true,
2722
3033
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -2730,10 +3041,10 @@ var componentInfo6 = {
2730
3041
  defaultValue: "children"
2731
3042
  }]
2732
3043
  };
2733
- var _tmpl$6 = /* @__PURE__ */ template(`<div>`);
3044
+ var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
2734
3045
  function Slot(props) {
2735
3046
  return (() => {
2736
- const _el$ = _tmpl$6();
3047
+ const _el$ = _tmpl$7();
2737
3048
  _el$.style.setProperty("pointer-events", "auto");
2738
3049
  spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
2739
3050
  "builder-slot": props.name
@@ -2758,7 +3069,7 @@ function Slot(props) {
2758
3069
  var slot_default = Slot;
2759
3070
 
2760
3071
  // src/blocks/symbol/component-info.ts
2761
- var componentInfo7 = {
3072
+ var componentInfo8 = {
2762
3073
  name: "Symbol",
2763
3074
  noWrap: true,
2764
3075
  static: true,
@@ -2834,7 +3145,7 @@ var defaultElement = {
2834
3145
  }
2835
3146
  }
2836
3147
  };
2837
- var componentInfo8 = {
3148
+ var componentInfo9 = {
2838
3149
  name: "Builder: Tabs",
2839
3150
  inputs: [{
2840
3151
  name: "tabs",
@@ -2932,19 +3243,23 @@ var componentInfo8 = {
2932
3243
  }]
2933
3244
  }]
2934
3245
  };
2935
- var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
2936
- var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
3246
+ var _tmpl$8 = /* @__PURE__ */ template(`<div>`);
3247
+ var _tmpl$24 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
2937
3248
  var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
2938
3249
  function Tabs(props) {
2939
3250
  const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
2940
3251
  function activeTabContent(active) {
2941
3252
  return props.tabs && props.tabs[active].content;
2942
3253
  }
2943
- function getActiveTabStyle(index) {
2944
- return activeTab() === index ? props.activeTabStyle : {};
3254
+ function onClick(index) {
3255
+ if (index === activeTab() && props.collapsible) {
3256
+ setActiveTab(-1);
3257
+ } else {
3258
+ setActiveTab(index);
3259
+ }
2945
3260
  }
2946
3261
  return (() => {
2947
- const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
3262
+ const _el$ = _tmpl$24(), _el$2 = _el$.firstChild;
2948
3263
  _el$2.style.setProperty("display", "flex");
2949
3264
  _el$2.style.setProperty("flex-direction", "row");
2950
3265
  _el$2.style.setProperty("overflow", "auto");
@@ -2956,13 +3271,7 @@ function Tabs(props) {
2956
3271
  const index = _index();
2957
3272
  return (() => {
2958
3273
  const _el$4 = _tmpl$33();
2959
- _el$4.$$click = (event) => {
2960
- if (index === activeTab() && props.collapsible) {
2961
- setActiveTab(-1);
2962
- } else {
2963
- setActiveTab(index);
2964
- }
2965
- };
3274
+ _el$4.$$click = (event) => onClick(index);
2966
3275
  setAttribute(_el$4, "key", index);
2967
3276
  insert(_el$4, createComponent(blocks_default, {
2968
3277
  get parent() {
@@ -2983,7 +3292,9 @@ function Tabs(props) {
2983
3292
  }
2984
3293
  }));
2985
3294
  effect((_p$) => {
2986
- const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
3295
+ const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = {
3296
+ ...activeTab() === index ? props.activeTabStyle : {}
3297
+ };
2987
3298
  _v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
2988
3299
  _p$._v$2 = style(_el$4, _v$2, _p$._v$2);
2989
3300
  return _p$;
@@ -3000,7 +3311,7 @@ function Tabs(props) {
3000
3311
  return activeTabContent(activeTab());
3001
3312
  },
3002
3313
  get children() {
3003
- const _el$3 = _tmpl$7();
3314
+ const _el$3 = _tmpl$8();
3004
3315
  insert(_el$3, createComponent(blocks_default, {
3005
3316
  get parent() {
3006
3317
  return props.builderBlock.id;
@@ -3032,7 +3343,7 @@ var tabs_default = Tabs;
3032
3343
  delegateEvents(["click"]);
3033
3344
 
3034
3345
  // src/blocks/text/component-info.ts
3035
- var componentInfo9 = {
3346
+ var componentInfo10 = {
3036
3347
  name: "Text",
3037
3348
  static: true,
3038
3349
  isRSC: true,
@@ -3051,10 +3362,10 @@ var componentInfo9 = {
3051
3362
  textAlign: "center"
3052
3363
  }
3053
3364
  };
3054
- var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
3365
+ var _tmpl$9 = /* @__PURE__ */ template(`<div class=builder-text>`);
3055
3366
  function Text(props) {
3056
3367
  return (() => {
3057
- const _el$ = _tmpl$8();
3368
+ const _el$ = _tmpl$9();
3058
3369
  _el$.style.setProperty("outline", "none");
3059
3370
  effect(() => _el$.innerHTML = props.text?.toString() || "");
3060
3371
  return _el$;
@@ -3063,7 +3374,7 @@ function Text(props) {
3063
3374
  var text_default = Text;
3064
3375
 
3065
3376
  // src/blocks/custom-code/component-info.ts
3066
- var componentInfo10 = {
3377
+ var componentInfo11 = {
3067
3378
  name: "Custom Code",
3068
3379
  static: true,
3069
3380
  requiredPermissions: ["editCode"],
@@ -3086,7 +3397,7 @@ var componentInfo10 = {
3086
3397
  advanced: true
3087
3398
  }]
3088
3399
  };
3089
- var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
3400
+ var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
3090
3401
  function CustomCode(props) {
3091
3402
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
3092
3403
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -3121,7 +3432,7 @@ function CustomCode(props) {
3121
3432
  }
3122
3433
  });
3123
3434
  return (() => {
3124
- const _el$ = _tmpl$9();
3435
+ const _el$ = _tmpl$10();
3125
3436
  const _ref$ = elementRef;
3126
3437
  typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
3127
3438
  effect((_p$) => {
@@ -3139,7 +3450,7 @@ function CustomCode(props) {
3139
3450
  var custom_code_default = CustomCode;
3140
3451
 
3141
3452
  // src/blocks/embed/component-info.ts
3142
- var componentInfo11 = {
3453
+ var componentInfo12 = {
3143
3454
  name: "Embed",
3144
3455
  static: true,
3145
3456
  inputs: [{
@@ -3181,7 +3492,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
3181
3492
  var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
3182
3493
 
3183
3494
  // src/blocks/embed/embed.tsx
3184
- var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
3495
+ var _tmpl$11 = /* @__PURE__ */ template(`<div class=builder-embed>`);
3185
3496
  function Embed(props) {
3186
3497
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
3187
3498
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -3219,7 +3530,7 @@ function Embed(props) {
3219
3530
  }
3220
3531
  createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
3221
3532
  return (() => {
3222
- const _el$ = _tmpl$10();
3533
+ const _el$ = _tmpl$11();
3223
3534
  const _ref$ = elem;
3224
3535
  typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
3225
3536
  effect(() => _el$.innerHTML = props.content);
@@ -3229,7 +3540,7 @@ function Embed(props) {
3229
3540
  var embed_default = Embed;
3230
3541
 
3231
3542
  // src/blocks/form/form/component-info.ts
3232
- var componentInfo12 = {
3543
+ var componentInfo13 = {
3233
3544
  name: "Form:Form",
3234
3545
  // editableTags: ['builder-form-error']
3235
3546
  defaults: {
@@ -3476,8 +3787,8 @@ var get = (obj, path, defaultValue) => {
3476
3787
  };
3477
3788
 
3478
3789
  // src/blocks/form/form/form.tsx
3479
- var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
3480
- var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
3790
+ var _tmpl$12 = /* @__PURE__ */ template(`<pre>`);
3791
+ var _tmpl$25 = /* @__PURE__ */ template(`<form>`);
3481
3792
  function FormComponent(props) {
3482
3793
  const [formState, setFormState] = createSignal("unsubmitted");
3483
3794
  const [responseData, setResponseData] = createSignal(null);
@@ -3506,11 +3817,11 @@ function FormComponent(props) {
3506
3817
  return;
3507
3818
  }
3508
3819
  event.preventDefault();
3509
- const el = event.currentTarget;
3820
+ const el = event.currentTarget || event.target;
3510
3821
  const headers = props.customHeaders || {};
3511
3822
  let body;
3512
3823
  const formData = new FormData(el);
3513
- const formPairs = Array.from(event.currentTarget.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
3824
+ const formPairs = Array.from(el.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
3514
3825
  let value;
3515
3826
  const key = el2.name;
3516
3827
  if (el2 instanceof HTMLInputElement) {
@@ -3663,7 +3974,7 @@ function FormComponent(props) {
3663
3974
  }
3664
3975
  let formRef;
3665
3976
  return (() => {
3666
- const _el$ = _tmpl$24();
3977
+ const _el$ = _tmpl$25();
3667
3978
  _el$.addEventListener("submit", (event) => onSubmit(event));
3668
3979
  const _ref$ = formRef;
3669
3980
  typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
@@ -3680,7 +3991,7 @@ function FormComponent(props) {
3680
3991
  get name() {
3681
3992
  return props.name;
3682
3993
  }
3683
- }, {}, () => props.attributes), false, true);
3994
+ }, {}, {}, () => props.attributes), false, true);
3684
3995
  insert(_el$, createComponent(Show, {
3685
3996
  get when() {
3686
3997
  return props.builderBlock && props.builderBlock.children;
@@ -3746,7 +4057,7 @@ function FormComponent(props) {
3746
4057
  return memo(() => submissionState() === "error")() && responseData();
3747
4058
  },
3748
4059
  get children() {
3749
- const _el$2 = _tmpl$11();
4060
+ const _el$2 = _tmpl$12();
3750
4061
  insert(_el$2, () => JSON.stringify(responseData(), null, 2));
3751
4062
  effect(() => className(_el$2, "builder-form-error-text " + css({
3752
4063
  padding: "10px",
@@ -3778,7 +4089,7 @@ function FormComponent(props) {
3778
4089
  var form_default = FormComponent;
3779
4090
 
3780
4091
  // src/blocks/form/input/component-info.ts
3781
- var componentInfo13 = {
4092
+ var componentInfo14 = {
3782
4093
  name: "Form:Input",
3783
4094
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3784
4095
  inputs: [
@@ -3830,10 +4141,10 @@ var componentInfo13 = {
3830
4141
  borderColor: "#ccc"
3831
4142
  }
3832
4143
  };
3833
- var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
4144
+ var _tmpl$13 = /* @__PURE__ */ template(`<input>`);
3834
4145
  function FormInputComponent(props) {
3835
4146
  return (() => {
3836
- const _el$ = _tmpl$12();
4147
+ const _el$ = _tmpl$13();
3837
4148
  spread(_el$, mergeProps({}, () => props.attributes, {
3838
4149
  get key() {
3839
4150
  return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
@@ -3863,7 +4174,7 @@ function FormInputComponent(props) {
3863
4174
  var input_default = FormInputComponent;
3864
4175
 
3865
4176
  // src/blocks/form/select/component-info.ts
3866
- var componentInfo14 = {
4177
+ var componentInfo15 = {
3867
4178
  name: "Form:Select",
3868
4179
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3869
4180
  defaultStyles: {
@@ -3906,11 +4217,11 @@ var componentInfo14 = {
3906
4217
  static: true,
3907
4218
  noWrap: true
3908
4219
  };
3909
- var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
3910
- var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
4220
+ var _tmpl$14 = /* @__PURE__ */ template(`<select>`);
4221
+ var _tmpl$26 = /* @__PURE__ */ template(`<option>`);
3911
4222
  function SelectComponent(props) {
3912
4223
  return (() => {
3913
- const _el$ = _tmpl$13();
4224
+ const _el$ = _tmpl$14();
3914
4225
  spread(_el$, mergeProps({}, () => props.attributes, {
3915
4226
  get value() {
3916
4227
  return props.value;
@@ -3932,7 +4243,7 @@ function SelectComponent(props) {
3932
4243
  children: (option, _index) => {
3933
4244
  const index = _index();
3934
4245
  return (() => {
3935
- const _el$2 = _tmpl$25();
4246
+ const _el$2 = _tmpl$26();
3936
4247
  insert(_el$2, () => option.name || option.value);
3937
4248
  effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
3938
4249
  effect(() => _el$2.value = option.value);
@@ -3946,7 +4257,7 @@ function SelectComponent(props) {
3946
4257
  var select_default = SelectComponent;
3947
4258
 
3948
4259
  // src/blocks/form/submit-button/component-info.ts
3949
- var componentInfo15 = {
4260
+ var componentInfo16 = {
3950
4261
  name: "Form:SubmitButton",
3951
4262
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3952
4263
  defaultStyles: {
@@ -3972,10 +4283,10 @@ var componentInfo15 = {
3972
4283
  // TODO: defaultChildren
3973
4284
  // canHaveChildren: true,
3974
4285
  };
3975
- var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
4286
+ var _tmpl$15 = /* @__PURE__ */ template(`<button type=submit>`);
3976
4287
  function SubmitButton(props) {
3977
4288
  return (() => {
3978
- const _el$ = _tmpl$14();
4289
+ const _el$ = _tmpl$15();
3979
4290
  spread(_el$, mergeProps({}, () => props.attributes), false, true);
3980
4291
  insert(_el$, () => props.text);
3981
4292
  return _el$;
@@ -3984,7 +4295,7 @@ function SubmitButton(props) {
3984
4295
  var submit_button_default = SubmitButton;
3985
4296
 
3986
4297
  // src/blocks/img/component-info.ts
3987
- var componentInfo16 = {
4298
+ var componentInfo17 = {
3988
4299
  // friendlyName?
3989
4300
  name: "Raw:Img",
3990
4301
  hideFromInsertMenu: true,
@@ -3999,10 +4310,10 @@ var componentInfo16 = {
3999
4310
  noWrap: true,
4000
4311
  static: true
4001
4312
  };
4002
- var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
4313
+ var _tmpl$16 = /* @__PURE__ */ template(`<img>`);
4003
4314
  function ImgComponent(props) {
4004
4315
  return (() => {
4005
- const _el$ = _tmpl$15();
4316
+ const _el$ = _tmpl$16();
4006
4317
  spread(_el$, mergeProps({
4007
4318
  get style() {
4008
4319
  return {
@@ -4026,7 +4337,7 @@ function ImgComponent(props) {
4026
4337
  var img_default = ImgComponent;
4027
4338
 
4028
4339
  // src/blocks/video/component-info.ts
4029
- var componentInfo17 = {
4340
+ var componentInfo18 = {
4030
4341
  name: "Video",
4031
4342
  canHaveChildren: true,
4032
4343
  defaultStyles: {
@@ -4108,8 +4419,8 @@ var componentInfo17 = {
4108
4419
  advanced: true
4109
4420
  }]
4110
4421
  };
4111
- var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
4112
- var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
4422
+ var _tmpl$17 = /* @__PURE__ */ template(`<source type=video/mp4>`);
4423
+ var _tmpl$27 = /* @__PURE__ */ template(`<div>`);
4113
4424
  var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
4114
4425
  function Video(props) {
4115
4426
  const videoProps = createMemo(() => {
@@ -4171,7 +4482,7 @@ function Video(props) {
4171
4482
  return !props.lazyLoad;
4172
4483
  },
4173
4484
  get children() {
4174
- const _el$3 = _tmpl$16();
4485
+ const _el$3 = _tmpl$17();
4175
4486
  effect(() => setAttribute(_el$3, "src", props.video));
4176
4487
  return _el$3;
4177
4488
  }
@@ -4181,7 +4492,7 @@ function Video(props) {
4181
4492
  return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
4182
4493
  },
4183
4494
  get children() {
4184
- const _el$4 = _tmpl$26();
4495
+ const _el$4 = _tmpl$27();
4185
4496
  _el$4.style.setProperty("width", "100%");
4186
4497
  _el$4.style.setProperty("pointer-events", "none");
4187
4498
  _el$4.style.setProperty("font-size", "0px");
@@ -4194,7 +4505,7 @@ function Video(props) {
4194
4505
  return props.builderBlock?.children?.length && props.fitContent;
4195
4506
  },
4196
4507
  get children() {
4197
- const _el$5 = _tmpl$26();
4508
+ const _el$5 = _tmpl$27();
4198
4509
  _el$5.style.setProperty("display", "flex");
4199
4510
  _el$5.style.setProperty("flex-direction", "column");
4200
4511
  _el$5.style.setProperty("align-items", "stretch");
@@ -4207,7 +4518,7 @@ function Video(props) {
4207
4518
  return props.builderBlock?.children?.length && !props.fitContent;
4208
4519
  },
4209
4520
  get children() {
4210
- const _el$6 = _tmpl$26();
4521
+ const _el$6 = _tmpl$27();
4211
4522
  _el$6.style.setProperty("pointer-events", "none");
4212
4523
  _el$6.style.setProperty("display", "flex");
4213
4524
  _el$6.style.setProperty("flex-direction", "column");
@@ -4229,58 +4540,61 @@ var video_default = Video;
4229
4540
  // src/constants/extra-components.ts
4230
4541
  var getExtraComponents = () => [{
4231
4542
  component: custom_code_default,
4232
- ...componentInfo10
4543
+ ...componentInfo11
4233
4544
  }, {
4234
4545
  component: embed_default,
4235
- ...componentInfo11
4546
+ ...componentInfo12
4236
4547
  }, ...TARGET === "rsc" ? [] : [{
4237
4548
  component: form_default,
4238
- ...componentInfo12
4549
+ ...componentInfo13
4239
4550
  }, {
4240
4551
  component: input_default,
4241
- ...componentInfo13
4552
+ ...componentInfo14
4242
4553
  }, {
4243
4554
  component: submit_button_default,
4244
- ...componentInfo15
4555
+ ...componentInfo16
4245
4556
  }, {
4246
4557
  component: select_default,
4247
- ...componentInfo14
4558
+ ...componentInfo15
4248
4559
  }], {
4249
4560
  component: img_default,
4250
- ...componentInfo16
4561
+ ...componentInfo17
4251
4562
  }, {
4252
4563
  component: video_default,
4253
- ...componentInfo17
4564
+ ...componentInfo18
4254
4565
  }];
4255
4566
 
4256
4567
  // src/constants/builder-registered-components.ts
4257
4568
  var getDefaultRegisteredComponents = () => [{
4258
4569
  component: button_default,
4259
- ...componentInfo
4570
+ ...componentInfo2
4260
4571
  }, {
4261
4572
  component: columns_default,
4262
- ...componentInfo2
4573
+ ...componentInfo3
4263
4574
  }, {
4264
4575
  component: fragment_default,
4265
- ...componentInfo3
4576
+ ...componentInfo4
4266
4577
  }, {
4267
4578
  component: image_default,
4268
- ...componentInfo4
4579
+ ...componentInfo5
4269
4580
  }, {
4270
4581
  component: section_default,
4271
- ...componentInfo5
4582
+ ...componentInfo6
4272
4583
  }, {
4273
4584
  component: slot_default,
4274
- ...componentInfo6
4585
+ ...componentInfo7
4275
4586
  }, {
4276
4587
  component: symbol_default,
4277
- ...componentInfo7
4588
+ ...componentInfo8
4278
4589
  }, {
4279
4590
  component: text_default,
4280
- ...componentInfo9
4591
+ ...componentInfo10
4281
4592
  }, ...TARGET === "rsc" ? [] : [{
4282
4593
  component: tabs_default,
4283
- ...componentInfo8
4594
+ ...componentInfo9
4595
+ }, {
4596
+ component: accordion_default,
4597
+ ...componentInfo
4284
4598
  }], ...getExtraComponents()];
4285
4599
 
4286
4600
  // src/functions/register-component.ts
@@ -4350,10 +4664,10 @@ var getUpdateVariantVisibilityScript = ({
4350
4664
  }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
4351
4665
  "${variationId}", "${contentId}", ${isHydrationTarget}
4352
4666
  )`;
4353
- var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
4667
+ var _tmpl$18 = /* @__PURE__ */ template(`<script>`);
4354
4668
  function InlinedScript(props) {
4355
4669
  return (() => {
4356
- const _el$ = _tmpl$17();
4670
+ const _el$ = _tmpl$18();
4357
4671
  effect((_p$) => {
4358
4672
  const _v$ = props.scriptStr, _v$2 = props.id;
4359
4673
  _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
@@ -4864,7 +5178,7 @@ function isFromTrustedHost(trustedHosts, e) {
4864
5178
  }
4865
5179
 
4866
5180
  // src/constants/sdk-version.ts
4867
- var SDK_VERSION = "1.0.27";
5181
+ var SDK_VERSION = "1.0.29";
4868
5182
 
4869
5183
  // src/functions/register.ts
4870
5184
  var registry = {};
@@ -5330,7 +5644,7 @@ function EnableEditor(props) {
5330
5644
  if (isPreviewing() && !isEditing()) {
5331
5645
  const searchParams = new URL(location.href).searchParams;
5332
5646
  const searchParamPreviewModel = searchParams.get("builder.preview");
5333
- const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
5647
+ const searchParamPreviewId = searchParams.get(`builder.overrides.${searchParamPreviewModel}`);
5334
5648
  const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
5335
5649
  if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id)) {
5336
5650
  fetchOneEntry({
@@ -5348,7 +5662,7 @@ function EnableEditor(props) {
5348
5662
  });
5349
5663
  onMount(() => {
5350
5664
  if (!props.apiKey) {
5351
- logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
5665
+ logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
5352
5666
  }
5353
5667
  evaluateJsCode();
5354
5668
  runHttpRequests();
@@ -5850,7 +6164,7 @@ var fetchSymbolContent = async ({
5850
6164
  };
5851
6165
 
5852
6166
  // src/blocks/symbol/symbol.tsx
5853
- var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
6167
+ var _tmpl$19 = /* @__PURE__ */ template(`<div>`);
5854
6168
  function Symbol(props) {
5855
6169
  const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
5856
6170
  const blocksWrapper = createMemo(() => {
@@ -5882,7 +6196,7 @@ function Symbol(props) {
5882
6196
  }
5883
6197
  createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
5884
6198
  return (() => {
5885
- const _el$ = _tmpl$18();
6199
+ const _el$ = _tmpl$19();
5886
6200
  spread(_el$, mergeProps({
5887
6201
  get ["class"]() {
5888
6202
  return className();