@builder.io/sdk-solid 1.0.27 → 1.0.28

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.
@@ -470,6 +470,9 @@ function getProcessedBlock({
470
470
  }
471
471
  }
472
472
 
473
+ // src/functions/camel-to-kebab-case.ts
474
+ var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
475
+
473
476
  // src/components/block/animator.ts
474
477
  function throttle(func, wait, options = {}) {
475
478
  let context;
@@ -520,7 +523,6 @@ function assign(target, ..._args) {
520
523
  }
521
524
  return to;
522
525
  }
523
- var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
524
526
  function bindAnimations(animations) {
525
527
  for (const animation of animations) {
526
528
  switch (animation.trigger) {
@@ -573,7 +575,7 @@ function triggerAnimation(animation) {
573
575
  element.style.transitionDelay = "0";
574
576
  assign(element.style, animation.steps[0].styles);
575
577
  setTimeout(() => {
576
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
578
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
577
579
  if (animation.delay) {
578
580
  element.style.transitionDelay = animation.delay + "s";
579
581
  }
@@ -633,7 +635,7 @@ function bindScrollInViewAnimation(animation) {
633
635
  }
634
636
  attachDefaultState();
635
637
  setTimeout(() => {
636
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
638
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
637
639
  if (animation.delay) {
638
640
  element.style.transitionDelay = animation.delay + "s";
639
641
  }
@@ -646,9 +648,6 @@ function bindScrollInViewAnimation(animation) {
646
648
  });
647
649
  }
648
650
 
649
- // src/functions/camel-to-kebab-case.ts
650
- var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
651
-
652
651
  // src/helpers/css.ts
653
652
  var convertStyleMapToCSSArray = (style) => {
654
653
  const cssProps = Object.entries(style).map(([key, value]) => {
@@ -778,10 +777,10 @@ var getRepeatItemData = ({
778
777
  return repeatArray;
779
778
  };
780
779
  var shouldPassLinkComponent = (block) => {
781
- return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
780
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
782
781
  };
783
782
  var shouldPassRegisteredComponents = (block) => {
784
- return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
783
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
785
784
  };
786
785
 
787
786
  // src/components/block/components/block-styles.tsx
@@ -910,7 +909,7 @@ function BlockStyles(props) {
910
909
  className: `${className}:hover`,
911
910
  styles: {
912
911
  ...hoverStyles,
913
- transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(
912
+ transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
914
913
  hoverAnimation.easing
915
914
  )}`,
916
915
  transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
@@ -1675,10 +1674,10 @@ function SectionComponent(props) {
1675
1674
  var section_default = SectionComponent;
1676
1675
 
1677
1676
  // src/blocks/symbol/symbol.tsx
1678
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
1677
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
1679
1678
 
1680
1679
  // src/components/content-variants/content-variants.tsx
1681
- import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
1680
+ import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
1682
1681
 
1683
1682
  // src/helpers/url.ts
1684
1683
  var getTopLevelDomain = (host) => {
@@ -1872,7 +1871,7 @@ var handleABTesting = async ({
1872
1871
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1873
1872
 
1874
1873
  // src/components/content/content.tsx
1875
- import { Show as Show12, createSignal as createSignal16 } from "solid-js";
1874
+ import { Show as Show13, createSignal as createSignal17 } from "solid-js";
1876
1875
 
1877
1876
  // src/blocks/button/component-info.ts
1878
1877
  var componentInfo = {
@@ -2523,8 +2522,12 @@ function Tabs(props) {
2523
2522
  function activeTabContent(active) {
2524
2523
  return props.tabs && props.tabs[active].content;
2525
2524
  }
2526
- function getActiveTabStyle(index) {
2527
- return activeTab() === index ? props.activeTabStyle : {};
2525
+ function onClick(index) {
2526
+ if (index === activeTab() && props.collapsible) {
2527
+ setActiveTab(-1);
2528
+ } else {
2529
+ setActiveTab(index);
2530
+ }
2528
2531
  }
2529
2532
  return <div>
2530
2533
  <div
@@ -2540,14 +2543,10 @@ function Tabs(props) {
2540
2543
  return <span
2541
2544
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2542
2545
  key={index}
2543
- style={getActiveTabStyle(index)}
2544
- onClick={(event) => {
2545
- if (index === activeTab() && props.collapsible) {
2546
- setActiveTab(-1);
2547
- } else {
2548
- setActiveTab(index);
2549
- }
2546
+ style={{
2547
+ ...activeTab() === index ? props.activeTabStyle : {}
2550
2548
  }}
2549
+ onClick={(event) => onClick(index)}
2551
2550
  ><Blocks_default
2552
2551
  parent={props.builderBlock.id}
2553
2552
  path={`component.options.tabs.${index}.label`}
@@ -2602,8 +2601,284 @@ function Text(props) {
2602
2601
  }
2603
2602
  var text_default = Text;
2604
2603
 
2605
- // src/blocks/custom-code/component-info.ts
2604
+ // src/blocks/accordion/accordion.tsx
2605
+ import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
2606
+
2607
+ // src/blocks/accordion/helpers.ts
2608
+ var convertOrderNumberToString = (order) => {
2609
+ return order.toString();
2610
+ };
2611
+
2612
+ // src/blocks/accordion/accordion.tsx
2613
+ function Accordion(props) {
2614
+ const [open, setOpen] = createSignal10([]);
2615
+ const onlyOneAtATime = createMemo10(() => {
2616
+ return Boolean(props.grid || props.oneAtATime);
2617
+ });
2618
+ const accordionStyles = createMemo10(() => {
2619
+ const styles = {
2620
+ display: "flex",
2621
+ alignItems: "stretch",
2622
+ flexDirection: "column",
2623
+ ...props.grid && {
2624
+ flexDirection: "row",
2625
+ alignItems: "flex-start",
2626
+ flexWrap: "wrap"
2627
+ }
2628
+ };
2629
+ return Object.fromEntries(
2630
+ Object.entries(styles).map(([key, value]) => [
2631
+ camelToKebabCase(key),
2632
+ value
2633
+ ])
2634
+ );
2635
+ });
2636
+ const accordionTitleStyles = createMemo10(() => {
2637
+ const shared = {
2638
+ display: "flex",
2639
+ flexDirection: "column"
2640
+ };
2641
+ const styles = Object.fromEntries(
2642
+ Object.entries({
2643
+ ...shared,
2644
+ alignItems: "stretch",
2645
+ cursor: "pointer"
2646
+ }).map(([key, value]) => [camelToKebabCase(key), value])
2647
+ );
2648
+ return Object.fromEntries(
2649
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
2650
+ );
2651
+ });
2652
+ function getAccordionTitleClassName(index) {
2653
+ return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
2654
+ }
2655
+ function getAccordionDetailClassName(index) {
2656
+ return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
2657
+ }
2658
+ const openGridItemOrder = createMemo10(() => {
2659
+ let itemOrder = null;
2660
+ const getOpenGridItemPosition = props.grid && open().length;
2661
+ if (getOpenGridItemPosition && document) {
2662
+ const openItemIndex = open()[0];
2663
+ const openItem = document.querySelector(
2664
+ `.builder-accordion-title[data-index="${openItemIndex}"]`
2665
+ );
2666
+ let subjectItem = openItem;
2667
+ itemOrder = openItemIndex;
2668
+ if (subjectItem) {
2669
+ let prevItemRect = subjectItem.getBoundingClientRect();
2670
+ while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
2671
+ if (subjectItem) {
2672
+ if (subjectItem.classList.contains("builder-accordion-detail")) {
2673
+ continue;
2674
+ }
2675
+ const subjectItemRect = subjectItem.getBoundingClientRect();
2676
+ if (subjectItemRect.left > prevItemRect.left) {
2677
+ const index = parseInt(
2678
+ subjectItem.getAttribute("data-index") || "",
2679
+ 10
2680
+ );
2681
+ if (!isNaN(index)) {
2682
+ prevItemRect = subjectItemRect;
2683
+ itemOrder = index;
2684
+ }
2685
+ } else {
2686
+ break;
2687
+ }
2688
+ }
2689
+ }
2690
+ }
2691
+ }
2692
+ if (typeof itemOrder === "number") {
2693
+ itemOrder = itemOrder + 1;
2694
+ }
2695
+ return itemOrder;
2696
+ });
2697
+ const accordionDetailStyles = createMemo10(() => {
2698
+ const styles = {
2699
+ ...{
2700
+ order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
2701
+ },
2702
+ ...props.grid && {
2703
+ width: "100%"
2704
+ }
2705
+ };
2706
+ return Object.fromEntries(
2707
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
2708
+ );
2709
+ });
2710
+ function onClick(index) {
2711
+ if (open().includes(index)) {
2712
+ setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
2713
+ } else {
2714
+ setOpen(onlyOneAtATime() ? [index] : open().concat(index));
2715
+ }
2716
+ }
2717
+ return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
2718
+ const index = _index();
2719
+ return <>
2720
+ <div
2721
+ class={getAccordionTitleClassName(index)}
2722
+ style={{
2723
+ ...accordionTitleStyles(),
2724
+ width: props.grid ? props.gridRowWidth : void 0,
2725
+ ...{
2726
+ order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2727
+ }
2728
+ }}
2729
+ data-index={index}
2730
+ onClick={(event) => onClick(index)}
2731
+ ><Blocks_default
2732
+ blocks={item.title}
2733
+ path={`items.${index}.title`}
2734
+ parent={props.builderBlock.id}
2735
+ context={props.builderContext}
2736
+ registeredComponents={props.builderComponents}
2737
+ linkComponent={props.builderLinkComponent}
2738
+ /></div>
2739
+ <Show9 when={open().includes(index)}><div
2740
+ class={getAccordionDetailClassName(index)}
2741
+ style={accordionDetailStyles()}
2742
+ ><Blocks_default
2743
+ blocks={item.detail}
2744
+ path={`items.${index}.detail`}
2745
+ parent={props.builderBlock.id}
2746
+ context={props.builderContext}
2747
+ registeredComponents={props.builderComponents}
2748
+ linkComponent={props.builderLinkComponent}
2749
+ /></div></Show9>
2750
+ </>;
2751
+ }}</For6></div>;
2752
+ }
2753
+ var accordion_default = Accordion;
2754
+
2755
+ // src/blocks/accordion/component-info.ts
2756
+ var defaultTitle = {
2757
+ "@type": "@builder.io/sdk:Element",
2758
+ layerName: "Accordion item title",
2759
+ responsiveStyles: {
2760
+ large: {
2761
+ marginTop: "10px",
2762
+ position: "relative",
2763
+ display: "flex",
2764
+ alignItems: "stretch",
2765
+ flexDirection: "column",
2766
+ paddingBottom: "10px"
2767
+ }
2768
+ },
2769
+ children: [{
2770
+ "@type": "@builder.io/sdk:Element",
2771
+ responsiveStyles: {
2772
+ large: {
2773
+ textAlign: "left",
2774
+ display: "flex",
2775
+ flexDirection: "column"
2776
+ }
2777
+ },
2778
+ component: {
2779
+ name: "Text",
2780
+ options: {
2781
+ text: "I am an accordion title. Click me!"
2782
+ }
2783
+ }
2784
+ }]
2785
+ };
2786
+ var defaultDetail = {
2787
+ "@type": "@builder.io/sdk:Element",
2788
+ layerName: "Accordion item detail",
2789
+ responsiveStyles: {
2790
+ large: {
2791
+ position: "relative",
2792
+ display: "flex",
2793
+ alignItems: "stretch",
2794
+ flexDirection: "column",
2795
+ marginTop: "10px",
2796
+ paddingBottom: "10px"
2797
+ }
2798
+ },
2799
+ children: [{
2800
+ "@type": "@builder.io/sdk:Element",
2801
+ responsiveStyles: {
2802
+ large: {
2803
+ paddingTop: "50px",
2804
+ textAlign: "left",
2805
+ display: "flex",
2806
+ flexDirection: "column",
2807
+ paddingBottom: "50px"
2808
+ }
2809
+ },
2810
+ component: {
2811
+ name: "Text",
2812
+ options: {
2813
+ text: "I am an accordion detail, hello!"
2814
+ }
2815
+ }
2816
+ }]
2817
+ };
2606
2818
  var componentInfo10 = {
2819
+ name: "Builder:Accordion",
2820
+ canHaveChildren: true,
2821
+ image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
2822
+ defaultStyles: {
2823
+ display: "flex",
2824
+ flexDirection: "column",
2825
+ alignItems: "stretch"
2826
+ },
2827
+ inputs: [{
2828
+ name: "items",
2829
+ type: "list",
2830
+ broadcast: true,
2831
+ subFields: [{
2832
+ name: "title",
2833
+ type: "uiBlocks",
2834
+ hideFromUI: true,
2835
+ defaultValue: [defaultTitle]
2836
+ }, {
2837
+ name: "detail",
2838
+ type: "uiBlocks",
2839
+ hideFromUI: true,
2840
+ defaultValue: [defaultDetail]
2841
+ }],
2842
+ defaultValue: [{
2843
+ title: [defaultTitle],
2844
+ detail: [defaultDetail]
2845
+ }, {
2846
+ title: [defaultTitle],
2847
+ detail: [defaultDetail]
2848
+ }],
2849
+ showIf: (options) => !options.get("useChildrenForItems")
2850
+ }, {
2851
+ name: "oneAtATime",
2852
+ helperText: "Only allow opening one at a time (collapse all others when new item openned)",
2853
+ type: "boolean",
2854
+ defaultValue: false
2855
+ }, {
2856
+ name: "grid",
2857
+ helperText: "Display as a grid",
2858
+ type: "boolean",
2859
+ defaultValue: false
2860
+ }, {
2861
+ name: "gridRowWidth",
2862
+ helperText: "Display as a grid",
2863
+ type: "string",
2864
+ showIf: (options) => options.get("grid"),
2865
+ defaultValue: "25%"
2866
+ }, {
2867
+ name: "useChildrenForItems",
2868
+ type: "boolean",
2869
+ helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
2870
+ advanced: true,
2871
+ defaultValue: false,
2872
+ onChange: (options) => {
2873
+ if (options.get("useChildrenForItems") === true) {
2874
+ options.set("items", []);
2875
+ }
2876
+ }
2877
+ }]
2878
+ };
2879
+
2880
+ // src/blocks/custom-code/component-info.ts
2881
+ var componentInfo11 = {
2607
2882
  name: "Custom Code",
2608
2883
  static: true,
2609
2884
  requiredPermissions: ["editCode"],
@@ -2628,10 +2903,10 @@ var componentInfo10 = {
2628
2903
  };
2629
2904
 
2630
2905
  // src/blocks/custom-code/custom-code.tsx
2631
- import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
2906
+ import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
2632
2907
  function CustomCode(props) {
2633
- const [scriptsInserted, setScriptsInserted] = createSignal10([]);
2634
- const [scriptsRun, setScriptsRun] = createSignal10([]);
2908
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2909
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
2635
2910
  let elementRef;
2636
2911
  onMount2(() => {
2637
2912
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -2675,7 +2950,7 @@ function CustomCode(props) {
2675
2950
  var custom_code_default = CustomCode;
2676
2951
 
2677
2952
  // src/blocks/embed/component-info.ts
2678
- var componentInfo11 = {
2953
+ var componentInfo12 = {
2679
2954
  name: "Embed",
2680
2955
  static: true,
2681
2956
  inputs: [{
@@ -2713,7 +2988,7 @@ var componentInfo11 = {
2713
2988
  };
2714
2989
 
2715
2990
  // src/blocks/embed/embed.tsx
2716
- import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
2991
+ import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
2717
2992
 
2718
2993
  // src/blocks/embed/helpers.ts
2719
2994
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -2721,9 +2996,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2721
2996
 
2722
2997
  // src/blocks/embed/embed.tsx
2723
2998
  function Embed(props) {
2724
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2725
- const [scriptsRun, setScriptsRun] = createSignal11([]);
2726
- const [ranInitFn, setRanInitFn] = createSignal11(false);
2999
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3000
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
3001
+ const [ranInitFn, setRanInitFn] = createSignal12(false);
2727
3002
  function findAndRunScripts() {
2728
3003
  if (!elem || !elem.getElementsByTagName)
2729
3004
  return;
@@ -2747,8 +3022,8 @@ function Embed(props) {
2747
3022
  }
2748
3023
  }
2749
3024
  let elem;
2750
- const onUpdateFn_0_elem = createMemo11(() => elem);
2751
- const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
3025
+ const onUpdateFn_0_elem = createMemo12(() => elem);
3026
+ const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
2752
3027
  function onUpdateFn_0() {
2753
3028
  if (elem && !ranInitFn()) {
2754
3029
  setRanInitFn(true);
@@ -2763,7 +3038,7 @@ function Embed(props) {
2763
3038
  var embed_default = Embed;
2764
3039
 
2765
3040
  // src/blocks/form/form/component-info.ts
2766
- var componentInfo12 = {
3041
+ var componentInfo13 = {
2767
3042
  name: "Form:Form",
2768
3043
  // editableTags: ['builder-form-error']
2769
3044
  defaults: {
@@ -2997,7 +3272,7 @@ var componentInfo12 = {
2997
3272
  };
2998
3273
 
2999
3274
  // src/blocks/form/form/form.tsx
3000
- import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
3275
+ import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
3001
3276
  import { css as css4 } from "solid-styled-components";
3002
3277
 
3003
3278
  // src/functions/get-env.ts
@@ -3015,9 +3290,9 @@ var get = (obj, path, defaultValue) => {
3015
3290
 
3016
3291
  // src/blocks/form/form/form.tsx
3017
3292
  function FormComponent(props) {
3018
- const [formState, setFormState] = createSignal12("unsubmitted");
3019
- const [responseData, setResponseData] = createSignal12(null);
3020
- const [formErrorMessage, setFormErrorMessage] = createSignal12("");
3293
+ const [formState, setFormState] = createSignal13("unsubmitted");
3294
+ const [responseData, setResponseData] = createSignal13(null);
3295
+ const [formErrorMessage, setFormErrorMessage] = createSignal13("");
3021
3296
  function mergeNewRootState(newData) {
3022
3297
  const combinedState = {
3023
3298
  ...props.builderContext.rootState,
@@ -3213,7 +3488,7 @@ function FormComponent(props) {
3213
3488
  {...{}}
3214
3489
  {...props.attributes}
3215
3490
  >
3216
- <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
3491
+ <Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
3217
3492
  const idx = _index();
3218
3493
  return <Block_default
3219
3494
  key={`form-block-${idx}`}
@@ -3222,35 +3497,35 @@ function FormComponent(props) {
3222
3497
  registeredComponents={props.builderComponents}
3223
3498
  linkComponent={props.builderLinkComponent}
3224
3499
  />;
3225
- }}</For6></Show9>
3226
- <Show9 when={submissionState() === "error"}><Blocks_default
3500
+ }}</For7></Show10>
3501
+ <Show10 when={submissionState() === "error"}><Blocks_default
3227
3502
  path="errorMessage"
3228
3503
  blocks={props.errorMessage}
3229
3504
  context={props.builderContext}
3230
- /></Show9>
3231
- <Show9 when={submissionState() === "sending"}><Blocks_default
3505
+ /></Show10>
3506
+ <Show10 when={submissionState() === "sending"}><Blocks_default
3232
3507
  path="sendingMessage"
3233
3508
  blocks={props.sendingMessage}
3234
3509
  context={props.builderContext}
3235
- /></Show9>
3236
- <Show9 when={submissionState() === "error" && responseData()}><pre
3510
+ /></Show10>
3511
+ <Show10 when={submissionState() === "error" && responseData()}><pre
3237
3512
  class={"builder-form-error-text " + css4({
3238
3513
  padding: "10px",
3239
3514
  color: "red",
3240
3515
  textAlign: "center"
3241
3516
  })}
3242
- >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
3243
- <Show9 when={submissionState() === "success"}><Blocks_default
3517
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show10>
3518
+ <Show10 when={submissionState() === "success"}><Blocks_default
3244
3519
  path="successMessage"
3245
3520
  blocks={props.successMessage}
3246
3521
  context={props.builderContext}
3247
- /></Show9>
3522
+ /></Show10>
3248
3523
  </form>;
3249
3524
  }
3250
3525
  var form_default = FormComponent;
3251
3526
 
3252
3527
  // src/blocks/form/input/component-info.ts
3253
- var componentInfo13 = {
3528
+ var componentInfo14 = {
3254
3529
  name: "Form:Input",
3255
3530
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3256
3531
  inputs: [
@@ -3320,7 +3595,7 @@ function FormInputComponent(props) {
3320
3595
  var input_default = FormInputComponent;
3321
3596
 
3322
3597
  // src/blocks/form/select/component-info.ts
3323
- var componentInfo14 = {
3598
+ var componentInfo15 = {
3324
3599
  name: "Form:Select",
3325
3600
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3326
3601
  defaultStyles: {
@@ -3365,7 +3640,7 @@ var componentInfo14 = {
3365
3640
  };
3366
3641
 
3367
3642
  // src/blocks/form/select/select.tsx
3368
- import { For as For7 } from "solid-js";
3643
+ import { For as For8 } from "solid-js";
3369
3644
  function SelectComponent(props) {
3370
3645
  return <select
3371
3646
  {...{}}
@@ -3374,15 +3649,15 @@ function SelectComponent(props) {
3374
3649
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
3375
3650
  defaultValue={props.defaultValue}
3376
3651
  name={props.name}
3377
- ><For7 each={props.options}>{(option, _index) => {
3652
+ ><For8 each={props.options}>{(option, _index) => {
3378
3653
  const index = _index();
3379
3654
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
3380
- }}</For7></select>;
3655
+ }}</For8></select>;
3381
3656
  }
3382
3657
  var select_default = SelectComponent;
3383
3658
 
3384
3659
  // src/blocks/form/submit-button/component-info.ts
3385
- var componentInfo15 = {
3660
+ var componentInfo16 = {
3386
3661
  name: "Form:SubmitButton",
3387
3662
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3388
3663
  defaultStyles: {
@@ -3416,7 +3691,7 @@ function SubmitButton(props) {
3416
3691
  var submit_button_default = SubmitButton;
3417
3692
 
3418
3693
  // src/blocks/img/component-info.ts
3419
- var componentInfo16 = {
3694
+ var componentInfo17 = {
3420
3695
  // friendlyName?
3421
3696
  name: "Raw:Img",
3422
3697
  hideFromInsertMenu: true,
@@ -3449,7 +3724,7 @@ function ImgComponent(props) {
3449
3724
  var img_default = ImgComponent;
3450
3725
 
3451
3726
  // src/blocks/video/component-info.ts
3452
- var componentInfo17 = {
3727
+ var componentInfo18 = {
3453
3728
  name: "Video",
3454
3729
  canHaveChildren: true,
3455
3730
  defaultStyles: {
@@ -3533,9 +3808,9 @@ var componentInfo17 = {
3533
3808
  };
3534
3809
 
3535
3810
  // src/blocks/video/video.tsx
3536
- import { Show as Show10, createMemo as createMemo13 } from "solid-js";
3811
+ import { Show as Show11, createMemo as createMemo14 } from "solid-js";
3537
3812
  function Video(props) {
3538
- const videoProps = createMemo13(() => {
3813
+ const videoProps = createMemo14(() => {
3539
3814
  return {
3540
3815
  ...props.autoPlay === true ? {
3541
3816
  autoPlay: true
@@ -3554,7 +3829,7 @@ function Video(props) {
3554
3829
  } : {}
3555
3830
  };
3556
3831
  });
3557
- const spreadProps = createMemo13(() => {
3832
+ const spreadProps = createMemo14(() => {
3558
3833
  return {
3559
3834
  ...videoProps()
3560
3835
  };
@@ -3584,8 +3859,8 @@ function Video(props) {
3584
3859
  }}
3585
3860
  src={props.video || "no-src"}
3586
3861
  poster={props.posterImage}
3587
- ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
3588
- <Show10
3862
+ ><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
3863
+ <Show11
3589
3864
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
3590
3865
  ><div
3591
3866
  style={{
@@ -3594,15 +3869,15 @@ function Video(props) {
3594
3869
  "pointer-events": "none",
3595
3870
  "font-size": "0px"
3596
3871
  }}
3597
- /></Show10>
3598
- <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
3872
+ /></Show11>
3873
+ <Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
3599
3874
  style={{
3600
3875
  display: "flex",
3601
3876
  "flex-direction": "column",
3602
3877
  "align-items": "stretch"
3603
3878
  }}
3604
- >{props.children}</div></Show10>
3605
- <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
3879
+ >{props.children}</div></Show11>
3880
+ <Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
3606
3881
  style={{
3607
3882
  "pointer-events": "none",
3608
3883
  display: "flex",
@@ -3614,7 +3889,7 @@ function Video(props) {
3614
3889
  width: "100%",
3615
3890
  height: "100%"
3616
3891
  }}
3617
- >{props.children}</div></Show10>
3892
+ >{props.children}</div></Show11>
3618
3893
  </div>;
3619
3894
  }
3620
3895
  var video_default = Video;
@@ -3622,28 +3897,28 @@ var video_default = Video;
3622
3897
  // src/constants/extra-components.ts
3623
3898
  var getExtraComponents = () => [{
3624
3899
  component: custom_code_default,
3625
- ...componentInfo10
3900
+ ...componentInfo11
3626
3901
  }, {
3627
3902
  component: embed_default,
3628
- ...componentInfo11
3903
+ ...componentInfo12
3629
3904
  }, ...TARGET === "rsc" ? [] : [{
3630
3905
  component: form_default,
3631
- ...componentInfo12
3906
+ ...componentInfo13
3632
3907
  }, {
3633
3908
  component: input_default,
3634
- ...componentInfo13
3909
+ ...componentInfo14
3635
3910
  }, {
3636
3911
  component: submit_button_default,
3637
- ...componentInfo15
3912
+ ...componentInfo16
3638
3913
  }, {
3639
3914
  component: select_default,
3640
- ...componentInfo14
3915
+ ...componentInfo15
3641
3916
  }], {
3642
3917
  component: img_default,
3643
- ...componentInfo16
3918
+ ...componentInfo17
3644
3919
  }, {
3645
3920
  component: video_default,
3646
- ...componentInfo17
3921
+ ...componentInfo18
3647
3922
  }];
3648
3923
 
3649
3924
  // src/constants/builder-registered-components.ts
@@ -3674,6 +3949,9 @@ var getDefaultRegisteredComponents = () => [{
3674
3949
  }, ...TARGET === "rsc" ? [] : [{
3675
3950
  component: tabs_default,
3676
3951
  ...componentInfo8
3952
+ }, {
3953
+ component: accordion_default,
3954
+ ...componentInfo10
3677
3955
  }], ...getExtraComponents()];
3678
3956
 
3679
3957
  // src/functions/register-component.ts
@@ -3752,12 +4030,12 @@ var Inlined_script_default = InlinedScript;
3752
4030
 
3753
4031
  // src/components/content/components/enable-editor.tsx
3754
4032
  import {
3755
- Show as Show11,
4033
+ Show as Show12,
3756
4034
  onMount as onMount3,
3757
4035
  on as on2,
3758
4036
  createEffect as createEffect2,
3759
- createMemo as createMemo14,
3760
- createSignal as createSignal14
4037
+ createMemo as createMemo15,
4038
+ createSignal as createSignal15
3761
4039
  } from "solid-js";
3762
4040
  import { Dynamic as Dynamic5 } from "solid-js/web";
3763
4041
 
@@ -4257,7 +4535,7 @@ function isFromTrustedHost(trustedHosts, e) {
4257
4535
  }
4258
4536
 
4259
4537
  // src/constants/sdk-version.ts
4260
- var SDK_VERSION = "1.0.27";
4538
+ var SDK_VERSION = "1.0.28";
4261
4539
 
4262
4540
  // src/functions/register.ts
4263
4541
  var registry = {};
@@ -4535,12 +4813,12 @@ var getWrapperClassName = (variationId) => {
4535
4813
 
4536
4814
  // src/components/content/components/enable-editor.tsx
4537
4815
  function EnableEditor(props) {
4538
- const [ContentWrapper, setContentWrapper] = createSignal14(
4816
+ const [ContentWrapper, setContentWrapper] = createSignal15(
4539
4817
  props.contentWrapper || "div"
4540
4818
  );
4541
- const [httpReqsData, setHttpReqsData] = createSignal14({});
4542
- const [httpReqsPending, setHttpReqsPending] = createSignal14({});
4543
- const [clicked, setClicked] = createSignal14(false);
4819
+ const [httpReqsData, setHttpReqsData] = createSignal15({});
4820
+ const [httpReqsPending, setHttpReqsPending] = createSignal15({});
4821
+ const [clicked, setClicked] = createSignal15(false);
4544
4822
  function mergeNewRootState(newData) {
4545
4823
  const combinedState = {
4546
4824
  ...props.builderContextSignal.rootState,
@@ -4574,7 +4852,7 @@ function EnableEditor(props) {
4574
4852
  content: newContentValue
4575
4853
  }));
4576
4854
  }
4577
- const showContentProps = createMemo14(() => {
4855
+ const showContentProps = createMemo15(() => {
4578
4856
  return props.showContent ? {} : {
4579
4857
  hidden: true,
4580
4858
  "aria-hidden": true
@@ -4758,21 +5036,21 @@ function EnableEditor(props) {
4758
5036
  onMount3(() => {
4759
5037
  if (!props.apiKey) {
4760
5038
  logger.error(
4761
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
5039
+ "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
4762
5040
  );
4763
5041
  }
4764
5042
  evaluateJsCode();
4765
5043
  runHttpRequests();
4766
5044
  emitStateUpdate();
4767
5045
  });
4768
- const onUpdateFn_0_props_content = createMemo14(() => props.content);
5046
+ const onUpdateFn_0_props_content = createMemo15(() => props.content);
4769
5047
  function onUpdateFn_0() {
4770
5048
  if (props.content) {
4771
5049
  mergeNewContent(props.content);
4772
5050
  }
4773
5051
  }
4774
5052
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4775
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
5053
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
4776
5054
  function onUpdateFn_1() {
4777
5055
  evaluateJsCode();
4778
5056
  }
@@ -4782,7 +5060,7 @@ function EnableEditor(props) {
4782
5060
  onUpdateFn_1
4783
5061
  )
4784
5062
  );
4785
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
5063
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
4786
5064
  function onUpdateFn_2() {
4787
5065
  runHttpRequests();
4788
5066
  }
@@ -4794,7 +5072,7 @@ function EnableEditor(props) {
4794
5072
  onUpdateFn_2
4795
5073
  )
4796
5074
  );
4797
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
5075
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
4798
5076
  () => props.builderContextSignal.rootState
4799
5077
  );
4800
5078
  function onUpdateFn_3() {
@@ -4806,14 +5084,14 @@ function EnableEditor(props) {
4806
5084
  onUpdateFn_3
4807
5085
  )
4808
5086
  );
4809
- const onUpdateFn_4_props_data = createMemo14(() => props.data);
5087
+ const onUpdateFn_4_props_data = createMemo15(() => props.data);
4810
5088
  function onUpdateFn_4() {
4811
5089
  if (props.data) {
4812
5090
  mergeNewRootState(props.data);
4813
5091
  }
4814
5092
  }
4815
5093
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4816
- const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
5094
+ const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
4817
5095
  function onUpdateFn_5() {
4818
5096
  if (props.locale) {
4819
5097
  mergeNewRootState({
@@ -4822,7 +5100,7 @@ function EnableEditor(props) {
4822
5100
  }
4823
5101
  }
4824
5102
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4825
- return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
5103
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
4826
5104
  class={getWrapperClassName(
4827
5105
  props.content?.testVariationId || props.content?.id
4828
5106
  )}
@@ -4835,14 +5113,14 @@ function EnableEditor(props) {
4835
5113
  {...showContentProps()}
4836
5114
  {...props.contentWrapperProps}
4837
5115
  component={ContentWrapper()}
4838
- >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
5116
+ >{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
4839
5117
  }
4840
5118
  var Enable_editor_default = EnableEditor;
4841
5119
 
4842
5120
  // src/components/content/components/styles.tsx
4843
- import { createSignal as createSignal15 } from "solid-js";
5121
+ import { createSignal as createSignal16 } from "solid-js";
4844
5122
  function ContentStyles(props) {
4845
- const [injectedStyles, setInjectedStyles] = createSignal15(
5123
+ const [injectedStyles, setInjectedStyles] = createSignal16(
4846
5124
  `
4847
5125
  ${getCss({
4848
5126
  cssCode: props.cssCode,
@@ -4899,7 +5177,7 @@ var getContentInitialValue = ({
4899
5177
 
4900
5178
  // src/components/content/content.tsx
4901
5179
  function ContentComponent(props) {
4902
- const [scriptStr, setScriptStr] = createSignal16(
5180
+ const [scriptStr, setScriptStr] = createSignal17(
4903
5181
  getUpdateVariantVisibilityScript({
4904
5182
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
4905
5183
  variationId: props.content?.testVariationId,
@@ -4907,7 +5185,7 @@ function ContentComponent(props) {
4907
5185
  contentId: props.content?.id
4908
5186
  })
4909
5187
  );
4910
- const [registeredComponents, setRegisteredComponents] = createSignal16(
5188
+ const [registeredComponents, setRegisteredComponents] = createSignal17(
4911
5189
  [
4912
5190
  ...getDefaultRegisteredComponents(),
4913
5191
  ...props.customComponents || []
@@ -4922,7 +5200,7 @@ function ContentComponent(props) {
4922
5200
  {}
4923
5201
  )
4924
5202
  );
4925
- const [builderContextSignal, setBuilderContextSignal] = createSignal16({
5203
+ const [builderContextSignal, setBuilderContextSignal] = createSignal17({
4926
5204
  content: getContentInitialValue({
4927
5205
  content: props.content,
4928
5206
  data: props.data
@@ -4980,16 +5258,16 @@ function ContentComponent(props) {
4980
5258
  setBuilderContextSignal
4981
5259
  }}
4982
5260
  >
4983
- <Show12 when={props.isSsrAbTest}><Inlined_script_default
5261
+ <Show13 when={props.isSsrAbTest}><Inlined_script_default
4984
5262
  id="builderio-variant-visibility"
4985
5263
  scriptStr={scriptStr()}
4986
- /></Show12>
4987
- <Show12 when={TARGET !== "reactNative"}><Styles_default
5264
+ /></Show13>
5265
+ <Show13 when={TARGET !== "reactNative"}><Styles_default
4988
5266
  isNestedRender={props.isNestedRender}
4989
5267
  contentId={builderContextSignal().content?.id}
4990
5268
  cssCode={builderContextSignal().content?.data?.cssCode}
4991
5269
  customFonts={builderContextSignal().content?.data?.customFonts}
4992
- /></Show12>
5270
+ /></Show13>
4993
5271
  <Blocks_default
4994
5272
  blocks={builderContextSignal().content?.data?.blocks}
4995
5273
  context={builderContextSignal()}
@@ -5002,13 +5280,13 @@ var Content_default = ContentComponent;
5002
5280
 
5003
5281
  // src/components/content-variants/content-variants.tsx
5004
5282
  function ContentVariants(props) {
5005
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
5283
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
5006
5284
  checkShouldRenderVariants({
5007
5285
  canTrack: getDefaultCanTrack(props.canTrack),
5008
5286
  content: props.content
5009
5287
  })
5010
5288
  );
5011
- const updateCookieAndStylesScriptStr = createMemo17(() => {
5289
+ const updateCookieAndStylesScriptStr = createMemo18(() => {
5012
5290
  return getUpdateCookieAndStylesScript(
5013
5291
  getVariants(props.content).map((value) => ({
5014
5292
  id: value.testVariationId,
@@ -5017,10 +5295,10 @@ function ContentVariants(props) {
5017
5295
  props.content?.id || ""
5018
5296
  );
5019
5297
  });
5020
- const hideVariantsStyleString = createMemo17(() => {
5298
+ const hideVariantsStyleString = createMemo18(() => {
5021
5299
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
5022
5300
  });
5023
- const defaultContent = createMemo17(() => {
5301
+ const defaultContent = createMemo18(() => {
5024
5302
  return shouldRenderVariants() ? {
5025
5303
  ...props.content,
5026
5304
  testVariationId: props.content?.id
@@ -5033,11 +5311,11 @@ function ContentVariants(props) {
5033
5311
  setShouldRenderVariants(false);
5034
5312
  });
5035
5313
  return <>
5036
- <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5314
+ <Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5037
5315
  id="builderio-init-variants-fns"
5038
5316
  scriptStr={getInitVariantsFnsScriptString()}
5039
- /></Show13>
5040
- <Show13 when={shouldRenderVariants()}>
5317
+ /></Show14>
5318
+ <Show14 when={shouldRenderVariants()}>
5041
5319
  <Inlined_styles_default
5042
5320
  id="builderio-variants"
5043
5321
  styles={hideVariantsStyleString()}
@@ -5046,7 +5324,7 @@ function ContentVariants(props) {
5046
5324
  id="builderio-variants-visibility"
5047
5325
  scriptStr={updateCookieAndStylesScriptStr()}
5048
5326
  />
5049
- <For8 each={getVariants(props.content)}>{(variant, _index) => {
5327
+ <For9 each={getVariants(props.content)}>{(variant, _index) => {
5050
5328
  const index = _index();
5051
5329
  return <Content_default
5052
5330
  isNestedRender={props.isNestedRender}
@@ -5070,8 +5348,8 @@ function ContentVariants(props) {
5070
5348
  contentWrapperProps={props.contentWrapperProps}
5071
5349
  trustedHosts={props.trustedHosts}
5072
5350
  />;
5073
- }}</For8>
5074
- </Show13>
5351
+ }}</For9>
5352
+ </Show14>
5075
5353
  <Content_default
5076
5354
  isNestedRender={props.isNestedRender}
5077
5355
  {...{}}
@@ -5124,14 +5402,14 @@ var fetchSymbolContent = async ({
5124
5402
 
5125
5403
  // src/blocks/symbol/symbol.tsx
5126
5404
  function Symbol(props) {
5127
- const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
5128
- const blocksWrapper = createMemo18(() => {
5405
+ const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
5406
+ const blocksWrapper = createMemo19(() => {
5129
5407
  return "div";
5130
5408
  });
5131
- const contentWrapper = createMemo18(() => {
5409
+ const contentWrapper = createMemo19(() => {
5132
5410
  return "div";
5133
5411
  });
5134
- const className = createMemo18(() => {
5412
+ const className = createMemo19(() => {
5135
5413
  return [
5136
5414
  ...[props.attributes[getClassPropName()]],
5137
5415
  "builder-symbol",
@@ -5153,7 +5431,7 @@ function Symbol(props) {
5153
5431
  }
5154
5432
  onMount5(() => {
5155
5433
  });
5156
- const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
5434
+ const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
5157
5435
  function onUpdateFn_0() {
5158
5436
  setContent();
5159
5437
  }