@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.
@@ -468,6 +468,9 @@ function getProcessedBlock({
468
468
  }
469
469
  }
470
470
 
471
+ // src/functions/camel-to-kebab-case.ts
472
+ var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
473
+
471
474
  // src/components/block/animator.ts
472
475
  function throttle(func, wait, options = {}) {
473
476
  let context;
@@ -518,7 +521,6 @@ function assign(target, ..._args) {
518
521
  }
519
522
  return to;
520
523
  }
521
- var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
522
524
  function bindAnimations(animations) {
523
525
  for (const animation of animations) {
524
526
  switch (animation.trigger) {
@@ -570,7 +572,7 @@ function triggerAnimation(animation) {
570
572
  element.style.transitionDelay = "0";
571
573
  assign(element.style, animation.steps[0].styles);
572
574
  setTimeout(() => {
573
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
575
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
574
576
  if (animation.delay) {
575
577
  element.style.transitionDelay = animation.delay + "s";
576
578
  }
@@ -630,7 +632,7 @@ function bindScrollInViewAnimation(animation) {
630
632
  }
631
633
  attachDefaultState();
632
634
  setTimeout(() => {
633
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
635
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
634
636
  if (animation.delay) {
635
637
  element.style.transitionDelay = animation.delay + "s";
636
638
  }
@@ -643,9 +645,6 @@ function bindScrollInViewAnimation(animation) {
643
645
  });
644
646
  }
645
647
 
646
- // src/functions/camel-to-kebab-case.ts
647
- var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
648
-
649
648
  // src/helpers/css.ts
650
649
  var convertStyleMapToCSSArray = (style) => {
651
650
  const cssProps = Object.entries(style).map(([key, value]) => {
@@ -772,10 +771,10 @@ var getRepeatItemData = ({
772
771
  return repeatArray;
773
772
  };
774
773
  var shouldPassLinkComponent = (block) => {
775
- return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
774
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
776
775
  };
777
776
  var shouldPassRegisteredComponents = (block) => {
778
- return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
777
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
779
778
  };
780
779
 
781
780
  // src/components/block/components/block-styles.tsx
@@ -904,7 +903,7 @@ function BlockStyles(props) {
904
903
  className: `${className}:hover`,
905
904
  styles: {
906
905
  ...hoverStyles,
907
- transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(
906
+ transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
908
907
  hoverAnimation.easing
909
908
  )}`,
910
909
  transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
@@ -1668,10 +1667,10 @@ function SectionComponent(props) {
1668
1667
  var section_default = SectionComponent;
1669
1668
 
1670
1669
  // src/blocks/symbol/symbol.tsx
1671
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
1670
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
1672
1671
 
1673
1672
  // src/components/content-variants/content-variants.tsx
1674
- import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
1673
+ import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
1675
1674
 
1676
1675
  // src/helpers/url.ts
1677
1676
  var getTopLevelDomain = (host) => {
@@ -1865,7 +1864,7 @@ var handleABTesting = async ({
1865
1864
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
1866
1865
 
1867
1866
  // src/components/content/content.tsx
1868
- import { Show as Show12, createSignal as createSignal16 } from "solid-js";
1867
+ import { Show as Show13, createSignal as createSignal17 } from "solid-js";
1869
1868
 
1870
1869
  // src/blocks/button/component-info.ts
1871
1870
  var componentInfo = {
@@ -2515,8 +2514,12 @@ function Tabs(props) {
2515
2514
  function activeTabContent(active) {
2516
2515
  return props.tabs && props.tabs[active].content;
2517
2516
  }
2518
- function getActiveTabStyle(index) {
2519
- return activeTab() === index ? props.activeTabStyle : {};
2517
+ function onClick(index) {
2518
+ if (index === activeTab() && props.collapsible) {
2519
+ setActiveTab(-1);
2520
+ } else {
2521
+ setActiveTab(index);
2522
+ }
2520
2523
  }
2521
2524
  return <div>
2522
2525
  <div
@@ -2532,14 +2535,10 @@ function Tabs(props) {
2532
2535
  return <span
2533
2536
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2534
2537
  key={index}
2535
- style={getActiveTabStyle(index)}
2536
- onClick={(event) => {
2537
- if (index === activeTab() && props.collapsible) {
2538
- setActiveTab(-1);
2539
- } else {
2540
- setActiveTab(index);
2541
- }
2538
+ style={{
2539
+ ...activeTab() === index ? props.activeTabStyle : {}
2542
2540
  }}
2541
+ onClick={(event) => onClick(index)}
2543
2542
  ><Blocks_default
2544
2543
  parent={props.builderBlock.id}
2545
2544
  path={`component.options.tabs.${index}.label`}
@@ -2594,8 +2593,284 @@ function Text(props) {
2594
2593
  }
2595
2594
  var text_default = Text;
2596
2595
 
2597
- // src/blocks/custom-code/component-info.ts
2596
+ // src/blocks/accordion/accordion.tsx
2597
+ import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
2598
+
2599
+ // src/blocks/accordion/helpers.ts
2600
+ var convertOrderNumberToString = (order) => {
2601
+ return order.toString();
2602
+ };
2603
+
2604
+ // src/blocks/accordion/accordion.tsx
2605
+ function Accordion(props) {
2606
+ const [open, setOpen] = createSignal10([]);
2607
+ const onlyOneAtATime = createMemo10(() => {
2608
+ return Boolean(props.grid || props.oneAtATime);
2609
+ });
2610
+ const accordionStyles = createMemo10(() => {
2611
+ const styles = {
2612
+ display: "flex",
2613
+ alignItems: "stretch",
2614
+ flexDirection: "column",
2615
+ ...props.grid && {
2616
+ flexDirection: "row",
2617
+ alignItems: "flex-start",
2618
+ flexWrap: "wrap"
2619
+ }
2620
+ };
2621
+ return Object.fromEntries(
2622
+ Object.entries(styles).map(([key, value]) => [
2623
+ camelToKebabCase(key),
2624
+ value
2625
+ ])
2626
+ );
2627
+ });
2628
+ const accordionTitleStyles = createMemo10(() => {
2629
+ const shared = {
2630
+ display: "flex",
2631
+ flexDirection: "column"
2632
+ };
2633
+ const styles = Object.fromEntries(
2634
+ Object.entries({
2635
+ ...shared,
2636
+ alignItems: "stretch",
2637
+ cursor: "pointer"
2638
+ }).map(([key, value]) => [camelToKebabCase(key), value])
2639
+ );
2640
+ return Object.fromEntries(
2641
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
2642
+ );
2643
+ });
2644
+ function getAccordionTitleClassName(index) {
2645
+ return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
2646
+ }
2647
+ function getAccordionDetailClassName(index) {
2648
+ return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
2649
+ }
2650
+ const openGridItemOrder = createMemo10(() => {
2651
+ let itemOrder = null;
2652
+ const getOpenGridItemPosition = props.grid && open().length;
2653
+ if (getOpenGridItemPosition && document) {
2654
+ const openItemIndex = open()[0];
2655
+ const openItem = document.querySelector(
2656
+ `.builder-accordion-title[data-index="${openItemIndex}"]`
2657
+ );
2658
+ let subjectItem = openItem;
2659
+ itemOrder = openItemIndex;
2660
+ if (subjectItem) {
2661
+ let prevItemRect = subjectItem.getBoundingClientRect();
2662
+ while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
2663
+ if (subjectItem) {
2664
+ if (subjectItem.classList.contains("builder-accordion-detail")) {
2665
+ continue;
2666
+ }
2667
+ const subjectItemRect = subjectItem.getBoundingClientRect();
2668
+ if (subjectItemRect.left > prevItemRect.left) {
2669
+ const index = parseInt(
2670
+ subjectItem.getAttribute("data-index") || "",
2671
+ 10
2672
+ );
2673
+ if (!isNaN(index)) {
2674
+ prevItemRect = subjectItemRect;
2675
+ itemOrder = index;
2676
+ }
2677
+ } else {
2678
+ break;
2679
+ }
2680
+ }
2681
+ }
2682
+ }
2683
+ }
2684
+ if (typeof itemOrder === "number") {
2685
+ itemOrder = itemOrder + 1;
2686
+ }
2687
+ return itemOrder;
2688
+ });
2689
+ const accordionDetailStyles = createMemo10(() => {
2690
+ const styles = {
2691
+ ...{
2692
+ order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
2693
+ },
2694
+ ...props.grid && {
2695
+ width: "100%"
2696
+ }
2697
+ };
2698
+ return Object.fromEntries(
2699
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
2700
+ );
2701
+ });
2702
+ function onClick(index) {
2703
+ if (open().includes(index)) {
2704
+ setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
2705
+ } else {
2706
+ setOpen(onlyOneAtATime() ? [index] : open().concat(index));
2707
+ }
2708
+ }
2709
+ return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
2710
+ const index = _index();
2711
+ return <>
2712
+ <div
2713
+ class={getAccordionTitleClassName(index)}
2714
+ style={{
2715
+ ...accordionTitleStyles(),
2716
+ width: props.grid ? props.gridRowWidth : void 0,
2717
+ ...{
2718
+ order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2719
+ }
2720
+ }}
2721
+ data-index={index}
2722
+ onClick={(event) => onClick(index)}
2723
+ ><Blocks_default
2724
+ blocks={item.title}
2725
+ path={`items.${index}.title`}
2726
+ parent={props.builderBlock.id}
2727
+ context={props.builderContext}
2728
+ registeredComponents={props.builderComponents}
2729
+ linkComponent={props.builderLinkComponent}
2730
+ /></div>
2731
+ <Show9 when={open().includes(index)}><div
2732
+ class={getAccordionDetailClassName(index)}
2733
+ style={accordionDetailStyles()}
2734
+ ><Blocks_default
2735
+ blocks={item.detail}
2736
+ path={`items.${index}.detail`}
2737
+ parent={props.builderBlock.id}
2738
+ context={props.builderContext}
2739
+ registeredComponents={props.builderComponents}
2740
+ linkComponent={props.builderLinkComponent}
2741
+ /></div></Show9>
2742
+ </>;
2743
+ }}</For6></div>;
2744
+ }
2745
+ var accordion_default = Accordion;
2746
+
2747
+ // src/blocks/accordion/component-info.ts
2748
+ var defaultTitle = {
2749
+ "@type": "@builder.io/sdk:Element",
2750
+ layerName: "Accordion item title",
2751
+ responsiveStyles: {
2752
+ large: {
2753
+ marginTop: "10px",
2754
+ position: "relative",
2755
+ display: "flex",
2756
+ alignItems: "stretch",
2757
+ flexDirection: "column",
2758
+ paddingBottom: "10px"
2759
+ }
2760
+ },
2761
+ children: [{
2762
+ "@type": "@builder.io/sdk:Element",
2763
+ responsiveStyles: {
2764
+ large: {
2765
+ textAlign: "left",
2766
+ display: "flex",
2767
+ flexDirection: "column"
2768
+ }
2769
+ },
2770
+ component: {
2771
+ name: "Text",
2772
+ options: {
2773
+ text: "I am an accordion title. Click me!"
2774
+ }
2775
+ }
2776
+ }]
2777
+ };
2778
+ var defaultDetail = {
2779
+ "@type": "@builder.io/sdk:Element",
2780
+ layerName: "Accordion item detail",
2781
+ responsiveStyles: {
2782
+ large: {
2783
+ position: "relative",
2784
+ display: "flex",
2785
+ alignItems: "stretch",
2786
+ flexDirection: "column",
2787
+ marginTop: "10px",
2788
+ paddingBottom: "10px"
2789
+ }
2790
+ },
2791
+ children: [{
2792
+ "@type": "@builder.io/sdk:Element",
2793
+ responsiveStyles: {
2794
+ large: {
2795
+ paddingTop: "50px",
2796
+ textAlign: "left",
2797
+ display: "flex",
2798
+ flexDirection: "column",
2799
+ paddingBottom: "50px"
2800
+ }
2801
+ },
2802
+ component: {
2803
+ name: "Text",
2804
+ options: {
2805
+ text: "I am an accordion detail, hello!"
2806
+ }
2807
+ }
2808
+ }]
2809
+ };
2598
2810
  var componentInfo10 = {
2811
+ name: "Builder:Accordion",
2812
+ canHaveChildren: true,
2813
+ image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
2814
+ defaultStyles: {
2815
+ display: "flex",
2816
+ flexDirection: "column",
2817
+ alignItems: "stretch"
2818
+ },
2819
+ inputs: [{
2820
+ name: "items",
2821
+ type: "list",
2822
+ broadcast: true,
2823
+ subFields: [{
2824
+ name: "title",
2825
+ type: "uiBlocks",
2826
+ hideFromUI: true,
2827
+ defaultValue: [defaultTitle]
2828
+ }, {
2829
+ name: "detail",
2830
+ type: "uiBlocks",
2831
+ hideFromUI: true,
2832
+ defaultValue: [defaultDetail]
2833
+ }],
2834
+ defaultValue: [{
2835
+ title: [defaultTitle],
2836
+ detail: [defaultDetail]
2837
+ }, {
2838
+ title: [defaultTitle],
2839
+ detail: [defaultDetail]
2840
+ }],
2841
+ showIf: (options) => !options.get("useChildrenForItems")
2842
+ }, {
2843
+ name: "oneAtATime",
2844
+ helperText: "Only allow opening one at a time (collapse all others when new item openned)",
2845
+ type: "boolean",
2846
+ defaultValue: false
2847
+ }, {
2848
+ name: "grid",
2849
+ helperText: "Display as a grid",
2850
+ type: "boolean",
2851
+ defaultValue: false
2852
+ }, {
2853
+ name: "gridRowWidth",
2854
+ helperText: "Display as a grid",
2855
+ type: "string",
2856
+ showIf: (options) => options.get("grid"),
2857
+ defaultValue: "25%"
2858
+ }, {
2859
+ name: "useChildrenForItems",
2860
+ type: "boolean",
2861
+ helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
2862
+ advanced: true,
2863
+ defaultValue: false,
2864
+ onChange: (options) => {
2865
+ if (options.get("useChildrenForItems") === true) {
2866
+ options.set("items", []);
2867
+ }
2868
+ }
2869
+ }]
2870
+ };
2871
+
2872
+ // src/blocks/custom-code/component-info.ts
2873
+ var componentInfo11 = {
2599
2874
  name: "Custom Code",
2600
2875
  static: true,
2601
2876
  requiredPermissions: ["editCode"],
@@ -2620,10 +2895,10 @@ var componentInfo10 = {
2620
2895
  };
2621
2896
 
2622
2897
  // src/blocks/custom-code/custom-code.tsx
2623
- import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
2898
+ import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
2624
2899
  function CustomCode(props) {
2625
- const [scriptsInserted, setScriptsInserted] = createSignal10([]);
2626
- const [scriptsRun, setScriptsRun] = createSignal10([]);
2900
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2901
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
2627
2902
  let elementRef;
2628
2903
  onMount2(() => {
2629
2904
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -2666,7 +2941,7 @@ function CustomCode(props) {
2666
2941
  var custom_code_default = CustomCode;
2667
2942
 
2668
2943
  // src/blocks/embed/component-info.ts
2669
- var componentInfo11 = {
2944
+ var componentInfo12 = {
2670
2945
  name: "Embed",
2671
2946
  static: true,
2672
2947
  inputs: [{
@@ -2704,7 +2979,7 @@ var componentInfo11 = {
2704
2979
  };
2705
2980
 
2706
2981
  // src/blocks/embed/embed.tsx
2707
- import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
2982
+ import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
2708
2983
 
2709
2984
  // src/blocks/embed/helpers.ts
2710
2985
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -2712,9 +2987,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2712
2987
 
2713
2988
  // src/blocks/embed/embed.tsx
2714
2989
  function Embed(props) {
2715
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2716
- const [scriptsRun, setScriptsRun] = createSignal11([]);
2717
- const [ranInitFn, setRanInitFn] = createSignal11(false);
2990
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
2991
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
2992
+ const [ranInitFn, setRanInitFn] = createSignal12(false);
2718
2993
  function findAndRunScripts() {
2719
2994
  if (!elem || !elem.getElementsByTagName)
2720
2995
  return;
@@ -2737,8 +3012,8 @@ function Embed(props) {
2737
3012
  }
2738
3013
  }
2739
3014
  let elem;
2740
- const onUpdateFn_0_elem = createMemo11(() => elem);
2741
- const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
3015
+ const onUpdateFn_0_elem = createMemo12(() => elem);
3016
+ const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
2742
3017
  function onUpdateFn_0() {
2743
3018
  if (elem && !ranInitFn()) {
2744
3019
  setRanInitFn(true);
@@ -2753,7 +3028,7 @@ function Embed(props) {
2753
3028
  var embed_default = Embed;
2754
3029
 
2755
3030
  // src/blocks/form/form/component-info.ts
2756
- var componentInfo12 = {
3031
+ var componentInfo13 = {
2757
3032
  name: "Form:Form",
2758
3033
  // editableTags: ['builder-form-error']
2759
3034
  defaults: {
@@ -2987,7 +3262,7 @@ var componentInfo12 = {
2987
3262
  };
2988
3263
 
2989
3264
  // src/blocks/form/form/form.tsx
2990
- import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
3265
+ import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
2991
3266
  import { css as css4 } from "solid-styled-components";
2992
3267
 
2993
3268
  // src/functions/get-env.ts
@@ -3005,9 +3280,9 @@ var get = (obj, path, defaultValue) => {
3005
3280
 
3006
3281
  // src/blocks/form/form/form.tsx
3007
3282
  function FormComponent(props) {
3008
- const [formState, setFormState] = createSignal12("unsubmitted");
3009
- const [responseData, setResponseData] = createSignal12(null);
3010
- const [formErrorMessage, setFormErrorMessage] = createSignal12("");
3283
+ const [formState, setFormState] = createSignal13("unsubmitted");
3284
+ const [responseData, setResponseData] = createSignal13(null);
3285
+ const [formErrorMessage, setFormErrorMessage] = createSignal13("");
3011
3286
  function mergeNewRootState(newData) {
3012
3287
  const combinedState = {
3013
3288
  ...props.builderContext.rootState,
@@ -3203,7 +3478,7 @@ function FormComponent(props) {
3203
3478
  {...{}}
3204
3479
  {...props.attributes}
3205
3480
  >
3206
- <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
3481
+ <Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
3207
3482
  const idx = _index();
3208
3483
  return <Block_default
3209
3484
  key={`form-block-${idx}`}
@@ -3212,35 +3487,35 @@ function FormComponent(props) {
3212
3487
  registeredComponents={props.builderComponents}
3213
3488
  linkComponent={props.builderLinkComponent}
3214
3489
  />;
3215
- }}</For6></Show9>
3216
- <Show9 when={submissionState() === "error"}><Blocks_default
3490
+ }}</For7></Show10>
3491
+ <Show10 when={submissionState() === "error"}><Blocks_default
3217
3492
  path="errorMessage"
3218
3493
  blocks={props.errorMessage}
3219
3494
  context={props.builderContext}
3220
- /></Show9>
3221
- <Show9 when={submissionState() === "sending"}><Blocks_default
3495
+ /></Show10>
3496
+ <Show10 when={submissionState() === "sending"}><Blocks_default
3222
3497
  path="sendingMessage"
3223
3498
  blocks={props.sendingMessage}
3224
3499
  context={props.builderContext}
3225
- /></Show9>
3226
- <Show9 when={submissionState() === "error" && responseData()}><pre
3500
+ /></Show10>
3501
+ <Show10 when={submissionState() === "error" && responseData()}><pre
3227
3502
  class={"builder-form-error-text " + css4({
3228
3503
  padding: "10px",
3229
3504
  color: "red",
3230
3505
  textAlign: "center"
3231
3506
  })}
3232
- >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
3233
- <Show9 when={submissionState() === "success"}><Blocks_default
3507
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show10>
3508
+ <Show10 when={submissionState() === "success"}><Blocks_default
3234
3509
  path="successMessage"
3235
3510
  blocks={props.successMessage}
3236
3511
  context={props.builderContext}
3237
- /></Show9>
3512
+ /></Show10>
3238
3513
  </form>;
3239
3514
  }
3240
3515
  var form_default = FormComponent;
3241
3516
 
3242
3517
  // src/blocks/form/input/component-info.ts
3243
- var componentInfo13 = {
3518
+ var componentInfo14 = {
3244
3519
  name: "Form:Input",
3245
3520
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3246
3521
  inputs: [
@@ -3310,7 +3585,7 @@ function FormInputComponent(props) {
3310
3585
  var input_default = FormInputComponent;
3311
3586
 
3312
3587
  // src/blocks/form/select/component-info.ts
3313
- var componentInfo14 = {
3588
+ var componentInfo15 = {
3314
3589
  name: "Form:Select",
3315
3590
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3316
3591
  defaultStyles: {
@@ -3355,7 +3630,7 @@ var componentInfo14 = {
3355
3630
  };
3356
3631
 
3357
3632
  // src/blocks/form/select/select.tsx
3358
- import { For as For7 } from "solid-js";
3633
+ import { For as For8 } from "solid-js";
3359
3634
  function SelectComponent(props) {
3360
3635
  return <select
3361
3636
  {...{}}
@@ -3364,15 +3639,15 @@ function SelectComponent(props) {
3364
3639
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
3365
3640
  defaultValue={props.defaultValue}
3366
3641
  name={props.name}
3367
- ><For7 each={props.options}>{(option, _index) => {
3642
+ ><For8 each={props.options}>{(option, _index) => {
3368
3643
  const index = _index();
3369
3644
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
3370
- }}</For7></select>;
3645
+ }}</For8></select>;
3371
3646
  }
3372
3647
  var select_default = SelectComponent;
3373
3648
 
3374
3649
  // src/blocks/form/submit-button/component-info.ts
3375
- var componentInfo15 = {
3650
+ var componentInfo16 = {
3376
3651
  name: "Form:SubmitButton",
3377
3652
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3378
3653
  defaultStyles: {
@@ -3406,7 +3681,7 @@ function SubmitButton(props) {
3406
3681
  var submit_button_default = SubmitButton;
3407
3682
 
3408
3683
  // src/blocks/img/component-info.ts
3409
- var componentInfo16 = {
3684
+ var componentInfo17 = {
3410
3685
  // friendlyName?
3411
3686
  name: "Raw:Img",
3412
3687
  hideFromInsertMenu: true,
@@ -3439,7 +3714,7 @@ function ImgComponent(props) {
3439
3714
  var img_default = ImgComponent;
3440
3715
 
3441
3716
  // src/blocks/video/component-info.ts
3442
- var componentInfo17 = {
3717
+ var componentInfo18 = {
3443
3718
  name: "Video",
3444
3719
  canHaveChildren: true,
3445
3720
  defaultStyles: {
@@ -3523,9 +3798,9 @@ var componentInfo17 = {
3523
3798
  };
3524
3799
 
3525
3800
  // src/blocks/video/video.tsx
3526
- import { Show as Show10, createMemo as createMemo13 } from "solid-js";
3801
+ import { Show as Show11, createMemo as createMemo14 } from "solid-js";
3527
3802
  function Video(props) {
3528
- const videoProps = createMemo13(() => {
3803
+ const videoProps = createMemo14(() => {
3529
3804
  return {
3530
3805
  ...props.autoPlay === true ? {
3531
3806
  autoPlay: true
@@ -3544,7 +3819,7 @@ function Video(props) {
3544
3819
  } : {}
3545
3820
  };
3546
3821
  });
3547
- const spreadProps = createMemo13(() => {
3822
+ const spreadProps = createMemo14(() => {
3548
3823
  return {
3549
3824
  ...videoProps()
3550
3825
  };
@@ -3574,8 +3849,8 @@ function Video(props) {
3574
3849
  }}
3575
3850
  src={props.video || "no-src"}
3576
3851
  poster={props.posterImage}
3577
- ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
3578
- <Show10
3852
+ ><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
3853
+ <Show11
3579
3854
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
3580
3855
  ><div
3581
3856
  style={{
@@ -3584,15 +3859,15 @@ function Video(props) {
3584
3859
  "pointer-events": "none",
3585
3860
  "font-size": "0px"
3586
3861
  }}
3587
- /></Show10>
3588
- <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
3862
+ /></Show11>
3863
+ <Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
3589
3864
  style={{
3590
3865
  display: "flex",
3591
3866
  "flex-direction": "column",
3592
3867
  "align-items": "stretch"
3593
3868
  }}
3594
- >{props.children}</div></Show10>
3595
- <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
3869
+ >{props.children}</div></Show11>
3870
+ <Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
3596
3871
  style={{
3597
3872
  "pointer-events": "none",
3598
3873
  display: "flex",
@@ -3604,7 +3879,7 @@ function Video(props) {
3604
3879
  width: "100%",
3605
3880
  height: "100%"
3606
3881
  }}
3607
- >{props.children}</div></Show10>
3882
+ >{props.children}</div></Show11>
3608
3883
  </div>;
3609
3884
  }
3610
3885
  var video_default = Video;
@@ -3612,28 +3887,28 @@ var video_default = Video;
3612
3887
  // src/constants/extra-components.ts
3613
3888
  var getExtraComponents = () => [{
3614
3889
  component: custom_code_default,
3615
- ...componentInfo10
3890
+ ...componentInfo11
3616
3891
  }, {
3617
3892
  component: embed_default,
3618
- ...componentInfo11
3893
+ ...componentInfo12
3619
3894
  }, ...TARGET === "rsc" ? [] : [{
3620
3895
  component: form_default,
3621
- ...componentInfo12
3896
+ ...componentInfo13
3622
3897
  }, {
3623
3898
  component: input_default,
3624
- ...componentInfo13
3899
+ ...componentInfo14
3625
3900
  }, {
3626
3901
  component: submit_button_default,
3627
- ...componentInfo15
3902
+ ...componentInfo16
3628
3903
  }, {
3629
3904
  component: select_default,
3630
- ...componentInfo14
3905
+ ...componentInfo15
3631
3906
  }], {
3632
3907
  component: img_default,
3633
- ...componentInfo16
3908
+ ...componentInfo17
3634
3909
  }, {
3635
3910
  component: video_default,
3636
- ...componentInfo17
3911
+ ...componentInfo18
3637
3912
  }];
3638
3913
 
3639
3914
  // src/constants/builder-registered-components.ts
@@ -3664,6 +3939,9 @@ var getDefaultRegisteredComponents = () => [{
3664
3939
  }, ...TARGET === "rsc" ? [] : [{
3665
3940
  component: tabs_default,
3666
3941
  ...componentInfo8
3942
+ }, {
3943
+ component: accordion_default,
3944
+ ...componentInfo10
3667
3945
  }], ...getExtraComponents()];
3668
3946
 
3669
3947
  // src/functions/register-component.ts
@@ -3742,12 +4020,12 @@ var Inlined_script_default = InlinedScript;
3742
4020
 
3743
4021
  // src/components/content/components/enable-editor.tsx
3744
4022
  import {
3745
- Show as Show11,
4023
+ Show as Show12,
3746
4024
  onMount as onMount3,
3747
4025
  on as on2,
3748
4026
  createEffect as createEffect2,
3749
- createMemo as createMemo14,
3750
- createSignal as createSignal14
4027
+ createMemo as createMemo15,
4028
+ createSignal as createSignal15
3751
4029
  } from "solid-js";
3752
4030
  import { Dynamic as Dynamic5 } from "solid-js/web";
3753
4031
 
@@ -4242,7 +4520,7 @@ function isFromTrustedHost(trustedHosts, e) {
4242
4520
  }
4243
4521
 
4244
4522
  // src/constants/sdk-version.ts
4245
- var SDK_VERSION = "1.0.27";
4523
+ var SDK_VERSION = "1.0.28";
4246
4524
 
4247
4525
  // src/functions/register.ts
4248
4526
  var registry = {};
@@ -4519,12 +4797,12 @@ var getWrapperClassName = (variationId) => {
4519
4797
 
4520
4798
  // src/components/content/components/enable-editor.tsx
4521
4799
  function EnableEditor(props) {
4522
- const [ContentWrapper, setContentWrapper] = createSignal14(
4800
+ const [ContentWrapper, setContentWrapper] = createSignal15(
4523
4801
  props.contentWrapper || "div"
4524
4802
  );
4525
- const [httpReqsData, setHttpReqsData] = createSignal14({});
4526
- const [httpReqsPending, setHttpReqsPending] = createSignal14({});
4527
- const [clicked, setClicked] = createSignal14(false);
4803
+ const [httpReqsData, setHttpReqsData] = createSignal15({});
4804
+ const [httpReqsPending, setHttpReqsPending] = createSignal15({});
4805
+ const [clicked, setClicked] = createSignal15(false);
4528
4806
  function mergeNewRootState(newData) {
4529
4807
  const combinedState = {
4530
4808
  ...props.builderContextSignal.rootState,
@@ -4558,7 +4836,7 @@ function EnableEditor(props) {
4558
4836
  content: newContentValue
4559
4837
  }));
4560
4838
  }
4561
- const showContentProps = createMemo14(() => {
4839
+ const showContentProps = createMemo15(() => {
4562
4840
  return props.showContent ? {} : {
4563
4841
  hidden: true,
4564
4842
  "aria-hidden": true
@@ -4741,21 +5019,21 @@ function EnableEditor(props) {
4741
5019
  onMount3(() => {
4742
5020
  if (!props.apiKey) {
4743
5021
  logger.error(
4744
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
5022
+ "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
4745
5023
  );
4746
5024
  }
4747
5025
  evaluateJsCode();
4748
5026
  runHttpRequests();
4749
5027
  emitStateUpdate();
4750
5028
  });
4751
- const onUpdateFn_0_props_content = createMemo14(() => props.content);
5029
+ const onUpdateFn_0_props_content = createMemo15(() => props.content);
4752
5030
  function onUpdateFn_0() {
4753
5031
  if (props.content) {
4754
5032
  mergeNewContent(props.content);
4755
5033
  }
4756
5034
  }
4757
5035
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4758
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
5036
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
4759
5037
  function onUpdateFn_1() {
4760
5038
  evaluateJsCode();
4761
5039
  }
@@ -4765,7 +5043,7 @@ function EnableEditor(props) {
4765
5043
  onUpdateFn_1
4766
5044
  )
4767
5045
  );
4768
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
5046
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
4769
5047
  function onUpdateFn_2() {
4770
5048
  runHttpRequests();
4771
5049
  }
@@ -4777,7 +5055,7 @@ function EnableEditor(props) {
4777
5055
  onUpdateFn_2
4778
5056
  )
4779
5057
  );
4780
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
5058
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
4781
5059
  () => props.builderContextSignal.rootState
4782
5060
  );
4783
5061
  function onUpdateFn_3() {
@@ -4789,14 +5067,14 @@ function EnableEditor(props) {
4789
5067
  onUpdateFn_3
4790
5068
  )
4791
5069
  );
4792
- const onUpdateFn_4_props_data = createMemo14(() => props.data);
5070
+ const onUpdateFn_4_props_data = createMemo15(() => props.data);
4793
5071
  function onUpdateFn_4() {
4794
5072
  if (props.data) {
4795
5073
  mergeNewRootState(props.data);
4796
5074
  }
4797
5075
  }
4798
5076
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4799
- const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
5077
+ const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
4800
5078
  function onUpdateFn_5() {
4801
5079
  if (props.locale) {
4802
5080
  mergeNewRootState({
@@ -4805,7 +5083,7 @@ function EnableEditor(props) {
4805
5083
  }
4806
5084
  }
4807
5085
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4808
- return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
5086
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
4809
5087
  class={getWrapperClassName(
4810
5088
  props.content?.testVariationId || props.content?.id
4811
5089
  )}
@@ -4818,14 +5096,14 @@ function EnableEditor(props) {
4818
5096
  {...showContentProps()}
4819
5097
  {...props.contentWrapperProps}
4820
5098
  component={ContentWrapper()}
4821
- >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
5099
+ >{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
4822
5100
  }
4823
5101
  var Enable_editor_default = EnableEditor;
4824
5102
 
4825
5103
  // src/components/content/components/styles.tsx
4826
- import { createSignal as createSignal15 } from "solid-js";
5104
+ import { createSignal as createSignal16 } from "solid-js";
4827
5105
  function ContentStyles(props) {
4828
- const [injectedStyles, setInjectedStyles] = createSignal15(
5106
+ const [injectedStyles, setInjectedStyles] = createSignal16(
4829
5107
  `
4830
5108
  ${getCss({
4831
5109
  cssCode: props.cssCode,
@@ -4882,7 +5160,7 @@ var getContentInitialValue = ({
4882
5160
 
4883
5161
  // src/components/content/content.tsx
4884
5162
  function ContentComponent(props) {
4885
- const [scriptStr, setScriptStr] = createSignal16(
5163
+ const [scriptStr, setScriptStr] = createSignal17(
4886
5164
  getUpdateVariantVisibilityScript({
4887
5165
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
4888
5166
  variationId: props.content?.testVariationId,
@@ -4890,7 +5168,7 @@ function ContentComponent(props) {
4890
5168
  contentId: props.content?.id
4891
5169
  })
4892
5170
  );
4893
- const [registeredComponents, setRegisteredComponents] = createSignal16(
5171
+ const [registeredComponents, setRegisteredComponents] = createSignal17(
4894
5172
  [
4895
5173
  ...getDefaultRegisteredComponents(),
4896
5174
  ...props.customComponents || []
@@ -4905,7 +5183,7 @@ function ContentComponent(props) {
4905
5183
  {}
4906
5184
  )
4907
5185
  );
4908
- const [builderContextSignal, setBuilderContextSignal] = createSignal16({
5186
+ const [builderContextSignal, setBuilderContextSignal] = createSignal17({
4909
5187
  content: getContentInitialValue({
4910
5188
  content: props.content,
4911
5189
  data: props.data
@@ -4963,16 +5241,16 @@ function ContentComponent(props) {
4963
5241
  setBuilderContextSignal
4964
5242
  }}
4965
5243
  >
4966
- <Show12 when={props.isSsrAbTest}><Inlined_script_default
5244
+ <Show13 when={props.isSsrAbTest}><Inlined_script_default
4967
5245
  id="builderio-variant-visibility"
4968
5246
  scriptStr={scriptStr()}
4969
- /></Show12>
4970
- <Show12 when={TARGET !== "reactNative"}><Styles_default
5247
+ /></Show13>
5248
+ <Show13 when={TARGET !== "reactNative"}><Styles_default
4971
5249
  isNestedRender={props.isNestedRender}
4972
5250
  contentId={builderContextSignal().content?.id}
4973
5251
  cssCode={builderContextSignal().content?.data?.cssCode}
4974
5252
  customFonts={builderContextSignal().content?.data?.customFonts}
4975
- /></Show12>
5253
+ /></Show13>
4976
5254
  <Blocks_default
4977
5255
  blocks={builderContextSignal().content?.data?.blocks}
4978
5256
  context={builderContextSignal()}
@@ -4985,13 +5263,13 @@ var Content_default = ContentComponent;
4985
5263
 
4986
5264
  // src/components/content-variants/content-variants.tsx
4987
5265
  function ContentVariants(props) {
4988
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
5266
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
4989
5267
  checkShouldRenderVariants({
4990
5268
  canTrack: getDefaultCanTrack(props.canTrack),
4991
5269
  content: props.content
4992
5270
  })
4993
5271
  );
4994
- const updateCookieAndStylesScriptStr = createMemo17(() => {
5272
+ const updateCookieAndStylesScriptStr = createMemo18(() => {
4995
5273
  return getUpdateCookieAndStylesScript(
4996
5274
  getVariants(props.content).map((value) => ({
4997
5275
  id: value.testVariationId,
@@ -5000,10 +5278,10 @@ function ContentVariants(props) {
5000
5278
  props.content?.id || ""
5001
5279
  );
5002
5280
  });
5003
- const hideVariantsStyleString = createMemo17(() => {
5281
+ const hideVariantsStyleString = createMemo18(() => {
5004
5282
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
5005
5283
  });
5006
- const defaultContent = createMemo17(() => {
5284
+ const defaultContent = createMemo18(() => {
5007
5285
  return shouldRenderVariants() ? {
5008
5286
  ...props.content,
5009
5287
  testVariationId: props.content?.id
@@ -5016,11 +5294,11 @@ function ContentVariants(props) {
5016
5294
  setShouldRenderVariants(false);
5017
5295
  });
5018
5296
  return <>
5019
- <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5297
+ <Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5020
5298
  id="builderio-init-variants-fns"
5021
5299
  scriptStr={getInitVariantsFnsScriptString()}
5022
- /></Show13>
5023
- <Show13 when={shouldRenderVariants()}>
5300
+ /></Show14>
5301
+ <Show14 when={shouldRenderVariants()}>
5024
5302
  <Inlined_styles_default
5025
5303
  id="builderio-variants"
5026
5304
  styles={hideVariantsStyleString()}
@@ -5029,7 +5307,7 @@ function ContentVariants(props) {
5029
5307
  id="builderio-variants-visibility"
5030
5308
  scriptStr={updateCookieAndStylesScriptStr()}
5031
5309
  />
5032
- <For8 each={getVariants(props.content)}>{(variant, _index) => {
5310
+ <For9 each={getVariants(props.content)}>{(variant, _index) => {
5033
5311
  const index = _index();
5034
5312
  return <Content_default
5035
5313
  isNestedRender={props.isNestedRender}
@@ -5053,8 +5331,8 @@ function ContentVariants(props) {
5053
5331
  contentWrapperProps={props.contentWrapperProps}
5054
5332
  trustedHosts={props.trustedHosts}
5055
5333
  />;
5056
- }}</For8>
5057
- </Show13>
5334
+ }}</For9>
5335
+ </Show14>
5058
5336
  <Content_default
5059
5337
  isNestedRender={props.isNestedRender}
5060
5338
  {...{}}
@@ -5107,14 +5385,14 @@ var fetchSymbolContent = async ({
5107
5385
 
5108
5386
  // src/blocks/symbol/symbol.tsx
5109
5387
  function Symbol(props) {
5110
- const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
5111
- const blocksWrapper = createMemo18(() => {
5388
+ const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
5389
+ const blocksWrapper = createMemo19(() => {
5112
5390
  return "div";
5113
5391
  });
5114
- const contentWrapper = createMemo18(() => {
5392
+ const contentWrapper = createMemo19(() => {
5115
5393
  return "div";
5116
5394
  });
5117
- const className = createMemo18(() => {
5395
+ const className = createMemo19(() => {
5118
5396
  return [
5119
5397
  ...[props.attributes[getClassPropName()]],
5120
5398
  "builder-symbol",
@@ -5136,7 +5414,7 @@ function Symbol(props) {
5136
5414
  }
5137
5415
  onMount5(() => {
5138
5416
  });
5139
- const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
5417
+ const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
5140
5418
  function onUpdateFn_0() {
5141
5419
  setContent();
5142
5420
  }