@builder.io/sdk-solid 1.0.26 → 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.
package/lib/node/dev.jsx CHANGED
@@ -627,6 +627,9 @@ function getProcessedBlock({
627
627
  }
628
628
  }
629
629
 
630
+ // src/functions/camel-to-kebab-case.ts
631
+ var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
632
+
630
633
  // src/components/block/animator.ts
631
634
  function throttle(func, wait, options = {}) {
632
635
  let context;
@@ -677,7 +680,6 @@ function assign(target, ..._args) {
677
680
  }
678
681
  return to;
679
682
  }
680
- var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
681
683
  function bindAnimations(animations) {
682
684
  for (const animation of animations) {
683
685
  switch (animation.trigger) {
@@ -730,7 +732,7 @@ function triggerAnimation(animation) {
730
732
  element.style.transitionDelay = "0";
731
733
  assign(element.style, animation.steps[0].styles);
732
734
  setTimeout(() => {
733
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
735
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
734
736
  if (animation.delay) {
735
737
  element.style.transitionDelay = animation.delay + "s";
736
738
  }
@@ -790,7 +792,7 @@ function bindScrollInViewAnimation(animation) {
790
792
  }
791
793
  attachDefaultState();
792
794
  setTimeout(() => {
793
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
795
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
794
796
  if (animation.delay) {
795
797
  element.style.transitionDelay = animation.delay + "s";
796
798
  }
@@ -803,9 +805,6 @@ function bindScrollInViewAnimation(animation) {
803
805
  });
804
806
  }
805
807
 
806
- // src/functions/camel-to-kebab-case.ts
807
- var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
808
-
809
808
  // src/helpers/css.ts
810
809
  var convertStyleMapToCSSArray = (style) => {
811
810
  const cssProps = Object.entries(style).map(([key, value]) => {
@@ -935,10 +934,10 @@ var getRepeatItemData = ({
935
934
  return repeatArray;
936
935
  };
937
936
  var shouldPassLinkComponent = (block) => {
938
- return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
937
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
939
938
  };
940
939
  var shouldPassRegisteredComponents = (block) => {
941
- return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
940
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
942
941
  };
943
942
 
944
943
  // src/components/block/components/block-styles.tsx
@@ -1067,7 +1066,7 @@ function BlockStyles(props) {
1067
1066
  className: `${className}:hover`,
1068
1067
  styles: {
1069
1068
  ...hoverStyles,
1070
- transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(
1069
+ transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
1071
1070
  hoverAnimation.easing
1072
1071
  )}`,
1073
1072
  transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
@@ -1832,10 +1831,10 @@ function SectionComponent(props) {
1832
1831
  var section_default = SectionComponent;
1833
1832
 
1834
1833
  // src/blocks/symbol/symbol.tsx
1835
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
1834
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
1836
1835
 
1837
1836
  // src/components/content-variants/content-variants.tsx
1838
- import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
1837
+ import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
1839
1838
 
1840
1839
  // src/helpers/url.ts
1841
1840
  var getTopLevelDomain = (host) => {
@@ -2029,7 +2028,7 @@ var handleABTesting = async ({
2029
2028
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
2030
2029
 
2031
2030
  // src/components/content/content.tsx
2032
- import { Show as Show12, createSignal as createSignal16 } from "solid-js";
2031
+ import { Show as Show13, createSignal as createSignal17 } from "solid-js";
2033
2032
 
2034
2033
  // src/blocks/button/component-info.ts
2035
2034
  var componentInfo = {
@@ -2680,8 +2679,12 @@ function Tabs(props) {
2680
2679
  function activeTabContent(active) {
2681
2680
  return props.tabs && props.tabs[active].content;
2682
2681
  }
2683
- function getActiveTabStyle(index) {
2684
- return activeTab() === index ? props.activeTabStyle : {};
2682
+ function onClick(index) {
2683
+ if (index === activeTab() && props.collapsible) {
2684
+ setActiveTab(-1);
2685
+ } else {
2686
+ setActiveTab(index);
2687
+ }
2685
2688
  }
2686
2689
  return <div>
2687
2690
  <div
@@ -2697,14 +2700,10 @@ function Tabs(props) {
2697
2700
  return <span
2698
2701
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
2699
2702
  key={index}
2700
- style={getActiveTabStyle(index)}
2701
- onClick={(event) => {
2702
- if (index === activeTab() && props.collapsible) {
2703
- setActiveTab(-1);
2704
- } else {
2705
- setActiveTab(index);
2706
- }
2703
+ style={{
2704
+ ...activeTab() === index ? props.activeTabStyle : {}
2707
2705
  }}
2706
+ onClick={(event) => onClick(index)}
2708
2707
  ><Blocks_default
2709
2708
  parent={props.builderBlock.id}
2710
2709
  path={`component.options.tabs.${index}.label`}
@@ -2759,8 +2758,284 @@ function Text(props) {
2759
2758
  }
2760
2759
  var text_default = Text;
2761
2760
 
2762
- // src/blocks/custom-code/component-info.ts
2761
+ // src/blocks/accordion/accordion.tsx
2762
+ import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
2763
+
2764
+ // src/blocks/accordion/helpers.ts
2765
+ var convertOrderNumberToString = (order) => {
2766
+ return order.toString();
2767
+ };
2768
+
2769
+ // src/blocks/accordion/accordion.tsx
2770
+ function Accordion(props) {
2771
+ const [open, setOpen] = createSignal10([]);
2772
+ const onlyOneAtATime = createMemo10(() => {
2773
+ return Boolean(props.grid || props.oneAtATime);
2774
+ });
2775
+ const accordionStyles = createMemo10(() => {
2776
+ const styles = {
2777
+ display: "flex",
2778
+ alignItems: "stretch",
2779
+ flexDirection: "column",
2780
+ ...props.grid && {
2781
+ flexDirection: "row",
2782
+ alignItems: "flex-start",
2783
+ flexWrap: "wrap"
2784
+ }
2785
+ };
2786
+ return Object.fromEntries(
2787
+ Object.entries(styles).map(([key, value]) => [
2788
+ camelToKebabCase(key),
2789
+ value
2790
+ ])
2791
+ );
2792
+ });
2793
+ const accordionTitleStyles = createMemo10(() => {
2794
+ const shared = {
2795
+ display: "flex",
2796
+ flexDirection: "column"
2797
+ };
2798
+ const styles = Object.fromEntries(
2799
+ Object.entries({
2800
+ ...shared,
2801
+ alignItems: "stretch",
2802
+ cursor: "pointer"
2803
+ }).map(([key, value]) => [camelToKebabCase(key), value])
2804
+ );
2805
+ return Object.fromEntries(
2806
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
2807
+ );
2808
+ });
2809
+ function getAccordionTitleClassName(index) {
2810
+ return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
2811
+ }
2812
+ function getAccordionDetailClassName(index) {
2813
+ return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
2814
+ }
2815
+ const openGridItemOrder = createMemo10(() => {
2816
+ let itemOrder = null;
2817
+ const getOpenGridItemPosition = props.grid && open().length;
2818
+ if (getOpenGridItemPosition && document) {
2819
+ const openItemIndex = open()[0];
2820
+ const openItem = document.querySelector(
2821
+ `.builder-accordion-title[data-index="${openItemIndex}"]`
2822
+ );
2823
+ let subjectItem = openItem;
2824
+ itemOrder = openItemIndex;
2825
+ if (subjectItem) {
2826
+ let prevItemRect = subjectItem.getBoundingClientRect();
2827
+ while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
2828
+ if (subjectItem) {
2829
+ if (subjectItem.classList.contains("builder-accordion-detail")) {
2830
+ continue;
2831
+ }
2832
+ const subjectItemRect = subjectItem.getBoundingClientRect();
2833
+ if (subjectItemRect.left > prevItemRect.left) {
2834
+ const index = parseInt(
2835
+ subjectItem.getAttribute("data-index") || "",
2836
+ 10
2837
+ );
2838
+ if (!isNaN(index)) {
2839
+ prevItemRect = subjectItemRect;
2840
+ itemOrder = index;
2841
+ }
2842
+ } else {
2843
+ break;
2844
+ }
2845
+ }
2846
+ }
2847
+ }
2848
+ }
2849
+ if (typeof itemOrder === "number") {
2850
+ itemOrder = itemOrder + 1;
2851
+ }
2852
+ return itemOrder;
2853
+ });
2854
+ const accordionDetailStyles = createMemo10(() => {
2855
+ const styles = {
2856
+ ...{
2857
+ order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
2858
+ },
2859
+ ...props.grid && {
2860
+ width: "100%"
2861
+ }
2862
+ };
2863
+ return Object.fromEntries(
2864
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
2865
+ );
2866
+ });
2867
+ function onClick(index) {
2868
+ if (open().includes(index)) {
2869
+ setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
2870
+ } else {
2871
+ setOpen(onlyOneAtATime() ? [index] : open().concat(index));
2872
+ }
2873
+ }
2874
+ return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
2875
+ const index = _index();
2876
+ return <>
2877
+ <div
2878
+ class={getAccordionTitleClassName(index)}
2879
+ style={{
2880
+ ...accordionTitleStyles(),
2881
+ width: props.grid ? props.gridRowWidth : void 0,
2882
+ ...{
2883
+ order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
2884
+ }
2885
+ }}
2886
+ data-index={index}
2887
+ onClick={(event) => onClick(index)}
2888
+ ><Blocks_default
2889
+ blocks={item.title}
2890
+ path={`items.${index}.title`}
2891
+ parent={props.builderBlock.id}
2892
+ context={props.builderContext}
2893
+ registeredComponents={props.builderComponents}
2894
+ linkComponent={props.builderLinkComponent}
2895
+ /></div>
2896
+ <Show9 when={open().includes(index)}><div
2897
+ class={getAccordionDetailClassName(index)}
2898
+ style={accordionDetailStyles()}
2899
+ ><Blocks_default
2900
+ blocks={item.detail}
2901
+ path={`items.${index}.detail`}
2902
+ parent={props.builderBlock.id}
2903
+ context={props.builderContext}
2904
+ registeredComponents={props.builderComponents}
2905
+ linkComponent={props.builderLinkComponent}
2906
+ /></div></Show9>
2907
+ </>;
2908
+ }}</For6></div>;
2909
+ }
2910
+ var accordion_default = Accordion;
2911
+
2912
+ // src/blocks/accordion/component-info.ts
2913
+ var defaultTitle = {
2914
+ "@type": "@builder.io/sdk:Element",
2915
+ layerName: "Accordion item title",
2916
+ responsiveStyles: {
2917
+ large: {
2918
+ marginTop: "10px",
2919
+ position: "relative",
2920
+ display: "flex",
2921
+ alignItems: "stretch",
2922
+ flexDirection: "column",
2923
+ paddingBottom: "10px"
2924
+ }
2925
+ },
2926
+ children: [{
2927
+ "@type": "@builder.io/sdk:Element",
2928
+ responsiveStyles: {
2929
+ large: {
2930
+ textAlign: "left",
2931
+ display: "flex",
2932
+ flexDirection: "column"
2933
+ }
2934
+ },
2935
+ component: {
2936
+ name: "Text",
2937
+ options: {
2938
+ text: "I am an accordion title. Click me!"
2939
+ }
2940
+ }
2941
+ }]
2942
+ };
2943
+ var defaultDetail = {
2944
+ "@type": "@builder.io/sdk:Element",
2945
+ layerName: "Accordion item detail",
2946
+ responsiveStyles: {
2947
+ large: {
2948
+ position: "relative",
2949
+ display: "flex",
2950
+ alignItems: "stretch",
2951
+ flexDirection: "column",
2952
+ marginTop: "10px",
2953
+ paddingBottom: "10px"
2954
+ }
2955
+ },
2956
+ children: [{
2957
+ "@type": "@builder.io/sdk:Element",
2958
+ responsiveStyles: {
2959
+ large: {
2960
+ paddingTop: "50px",
2961
+ textAlign: "left",
2962
+ display: "flex",
2963
+ flexDirection: "column",
2964
+ paddingBottom: "50px"
2965
+ }
2966
+ },
2967
+ component: {
2968
+ name: "Text",
2969
+ options: {
2970
+ text: "I am an accordion detail, hello!"
2971
+ }
2972
+ }
2973
+ }]
2974
+ };
2763
2975
  var componentInfo10 = {
2976
+ name: "Builder:Accordion",
2977
+ canHaveChildren: true,
2978
+ image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
2979
+ defaultStyles: {
2980
+ display: "flex",
2981
+ flexDirection: "column",
2982
+ alignItems: "stretch"
2983
+ },
2984
+ inputs: [{
2985
+ name: "items",
2986
+ type: "list",
2987
+ broadcast: true,
2988
+ subFields: [{
2989
+ name: "title",
2990
+ type: "uiBlocks",
2991
+ hideFromUI: true,
2992
+ defaultValue: [defaultTitle]
2993
+ }, {
2994
+ name: "detail",
2995
+ type: "uiBlocks",
2996
+ hideFromUI: true,
2997
+ defaultValue: [defaultDetail]
2998
+ }],
2999
+ defaultValue: [{
3000
+ title: [defaultTitle],
3001
+ detail: [defaultDetail]
3002
+ }, {
3003
+ title: [defaultTitle],
3004
+ detail: [defaultDetail]
3005
+ }],
3006
+ showIf: (options) => !options.get("useChildrenForItems")
3007
+ }, {
3008
+ name: "oneAtATime",
3009
+ helperText: "Only allow opening one at a time (collapse all others when new item openned)",
3010
+ type: "boolean",
3011
+ defaultValue: false
3012
+ }, {
3013
+ name: "grid",
3014
+ helperText: "Display as a grid",
3015
+ type: "boolean",
3016
+ defaultValue: false
3017
+ }, {
3018
+ name: "gridRowWidth",
3019
+ helperText: "Display as a grid",
3020
+ type: "string",
3021
+ showIf: (options) => options.get("grid"),
3022
+ defaultValue: "25%"
3023
+ }, {
3024
+ name: "useChildrenForItems",
3025
+ type: "boolean",
3026
+ helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
3027
+ advanced: true,
3028
+ defaultValue: false,
3029
+ onChange: (options) => {
3030
+ if (options.get("useChildrenForItems") === true) {
3031
+ options.set("items", []);
3032
+ }
3033
+ }
3034
+ }]
3035
+ };
3036
+
3037
+ // src/blocks/custom-code/component-info.ts
3038
+ var componentInfo11 = {
2764
3039
  name: "Custom Code",
2765
3040
  static: true,
2766
3041
  requiredPermissions: ["editCode"],
@@ -2785,10 +3060,10 @@ var componentInfo10 = {
2785
3060
  };
2786
3061
 
2787
3062
  // src/blocks/custom-code/custom-code.tsx
2788
- import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
3063
+ import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
2789
3064
  function CustomCode(props) {
2790
- const [scriptsInserted, setScriptsInserted] = createSignal10([]);
2791
- const [scriptsRun, setScriptsRun] = createSignal10([]);
3065
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
3066
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
2792
3067
  let elementRef;
2793
3068
  onMount2(() => {
2794
3069
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -2832,7 +3107,7 @@ function CustomCode(props) {
2832
3107
  var custom_code_default = CustomCode;
2833
3108
 
2834
3109
  // src/blocks/embed/component-info.ts
2835
- var componentInfo11 = {
3110
+ var componentInfo12 = {
2836
3111
  name: "Embed",
2837
3112
  static: true,
2838
3113
  inputs: [{
@@ -2870,7 +3145,7 @@ var componentInfo11 = {
2870
3145
  };
2871
3146
 
2872
3147
  // src/blocks/embed/embed.tsx
2873
- import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
3148
+ import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
2874
3149
 
2875
3150
  // src/blocks/embed/helpers.ts
2876
3151
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -2878,9 +3153,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2878
3153
 
2879
3154
  // src/blocks/embed/embed.tsx
2880
3155
  function Embed(props) {
2881
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
2882
- const [scriptsRun, setScriptsRun] = createSignal11([]);
2883
- const [ranInitFn, setRanInitFn] = createSignal11(false);
3156
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3157
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
3158
+ const [ranInitFn, setRanInitFn] = createSignal12(false);
2884
3159
  function findAndRunScripts() {
2885
3160
  if (!elem || !elem.getElementsByTagName)
2886
3161
  return;
@@ -2904,8 +3179,8 @@ function Embed(props) {
2904
3179
  }
2905
3180
  }
2906
3181
  let elem;
2907
- const onUpdateFn_0_elem = createMemo11(() => elem);
2908
- const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
3182
+ const onUpdateFn_0_elem = createMemo12(() => elem);
3183
+ const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
2909
3184
  function onUpdateFn_0() {
2910
3185
  if (elem && !ranInitFn()) {
2911
3186
  setRanInitFn(true);
@@ -2920,7 +3195,7 @@ function Embed(props) {
2920
3195
  var embed_default = Embed;
2921
3196
 
2922
3197
  // src/blocks/form/form/component-info.ts
2923
- var componentInfo12 = {
3198
+ var componentInfo13 = {
2924
3199
  name: "Form:Form",
2925
3200
  // editableTags: ['builder-form-error']
2926
3201
  defaults: {
@@ -3154,7 +3429,7 @@ var componentInfo12 = {
3154
3429
  };
3155
3430
 
3156
3431
  // src/blocks/form/form/form.tsx
3157
- import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
3432
+ import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
3158
3433
  import { css as css4 } from "solid-styled-components";
3159
3434
 
3160
3435
  // src/functions/get-env.ts
@@ -3172,9 +3447,9 @@ var get = (obj, path, defaultValue) => {
3172
3447
 
3173
3448
  // src/blocks/form/form/form.tsx
3174
3449
  function FormComponent(props) {
3175
- const [formState, setFormState] = createSignal12("unsubmitted");
3176
- const [responseData, setResponseData] = createSignal12(null);
3177
- const [formErrorMessage, setFormErrorMessage] = createSignal12("");
3450
+ const [formState, setFormState] = createSignal13("unsubmitted");
3451
+ const [responseData, setResponseData] = createSignal13(null);
3452
+ const [formErrorMessage, setFormErrorMessage] = createSignal13("");
3178
3453
  function mergeNewRootState(newData) {
3179
3454
  const combinedState = {
3180
3455
  ...props.builderContext.rootState,
@@ -3370,7 +3645,7 @@ function FormComponent(props) {
3370
3645
  {...{}}
3371
3646
  {...props.attributes}
3372
3647
  >
3373
- <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
3648
+ <Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
3374
3649
  const idx = _index();
3375
3650
  return <Block_default
3376
3651
  key={`form-block-${idx}`}
@@ -3379,35 +3654,35 @@ function FormComponent(props) {
3379
3654
  registeredComponents={props.builderComponents}
3380
3655
  linkComponent={props.builderLinkComponent}
3381
3656
  />;
3382
- }}</For6></Show9>
3383
- <Show9 when={submissionState() === "error"}><Blocks_default
3657
+ }}</For7></Show10>
3658
+ <Show10 when={submissionState() === "error"}><Blocks_default
3384
3659
  path="errorMessage"
3385
3660
  blocks={props.errorMessage}
3386
3661
  context={props.builderContext}
3387
- /></Show9>
3388
- <Show9 when={submissionState() === "sending"}><Blocks_default
3662
+ /></Show10>
3663
+ <Show10 when={submissionState() === "sending"}><Blocks_default
3389
3664
  path="sendingMessage"
3390
3665
  blocks={props.sendingMessage}
3391
3666
  context={props.builderContext}
3392
- /></Show9>
3393
- <Show9 when={submissionState() === "error" && responseData()}><pre
3667
+ /></Show10>
3668
+ <Show10 when={submissionState() === "error" && responseData()}><pre
3394
3669
  class={"builder-form-error-text " + css4({
3395
3670
  padding: "10px",
3396
3671
  color: "red",
3397
3672
  textAlign: "center"
3398
3673
  })}
3399
- >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
3400
- <Show9 when={submissionState() === "success"}><Blocks_default
3674
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show10>
3675
+ <Show10 when={submissionState() === "success"}><Blocks_default
3401
3676
  path="successMessage"
3402
3677
  blocks={props.successMessage}
3403
3678
  context={props.builderContext}
3404
- /></Show9>
3679
+ /></Show10>
3405
3680
  </form>;
3406
3681
  }
3407
3682
  var form_default = FormComponent;
3408
3683
 
3409
3684
  // src/blocks/form/input/component-info.ts
3410
- var componentInfo13 = {
3685
+ var componentInfo14 = {
3411
3686
  name: "Form:Input",
3412
3687
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3413
3688
  inputs: [
@@ -3477,7 +3752,7 @@ function FormInputComponent(props) {
3477
3752
  var input_default = FormInputComponent;
3478
3753
 
3479
3754
  // src/blocks/form/select/component-info.ts
3480
- var componentInfo14 = {
3755
+ var componentInfo15 = {
3481
3756
  name: "Form:Select",
3482
3757
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3483
3758
  defaultStyles: {
@@ -3522,7 +3797,7 @@ var componentInfo14 = {
3522
3797
  };
3523
3798
 
3524
3799
  // src/blocks/form/select/select.tsx
3525
- import { For as For7 } from "solid-js";
3800
+ import { For as For8 } from "solid-js";
3526
3801
  function SelectComponent(props) {
3527
3802
  return <select
3528
3803
  {...{}}
@@ -3531,15 +3806,15 @@ function SelectComponent(props) {
3531
3806
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
3532
3807
  defaultValue={props.defaultValue}
3533
3808
  name={props.name}
3534
- ><For7 each={props.options}>{(option, _index) => {
3809
+ ><For8 each={props.options}>{(option, _index) => {
3535
3810
  const index = _index();
3536
3811
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
3537
- }}</For7></select>;
3812
+ }}</For8></select>;
3538
3813
  }
3539
3814
  var select_default = SelectComponent;
3540
3815
 
3541
3816
  // src/blocks/form/submit-button/component-info.ts
3542
- var componentInfo15 = {
3817
+ var componentInfo16 = {
3543
3818
  name: "Form:SubmitButton",
3544
3819
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3545
3820
  defaultStyles: {
@@ -3573,7 +3848,7 @@ function SubmitButton(props) {
3573
3848
  var submit_button_default = SubmitButton;
3574
3849
 
3575
3850
  // src/blocks/img/component-info.ts
3576
- var componentInfo16 = {
3851
+ var componentInfo17 = {
3577
3852
  // friendlyName?
3578
3853
  name: "Raw:Img",
3579
3854
  hideFromInsertMenu: true,
@@ -3606,7 +3881,7 @@ function ImgComponent(props) {
3606
3881
  var img_default = ImgComponent;
3607
3882
 
3608
3883
  // src/blocks/video/component-info.ts
3609
- var componentInfo17 = {
3884
+ var componentInfo18 = {
3610
3885
  name: "Video",
3611
3886
  canHaveChildren: true,
3612
3887
  defaultStyles: {
@@ -3690,9 +3965,9 @@ var componentInfo17 = {
3690
3965
  };
3691
3966
 
3692
3967
  // src/blocks/video/video.tsx
3693
- import { Show as Show10, createMemo as createMemo13 } from "solid-js";
3968
+ import { Show as Show11, createMemo as createMemo14 } from "solid-js";
3694
3969
  function Video(props) {
3695
- const videoProps = createMemo13(() => {
3970
+ const videoProps = createMemo14(() => {
3696
3971
  return {
3697
3972
  ...props.autoPlay === true ? {
3698
3973
  autoPlay: true
@@ -3711,7 +3986,7 @@ function Video(props) {
3711
3986
  } : {}
3712
3987
  };
3713
3988
  });
3714
- const spreadProps = createMemo13(() => {
3989
+ const spreadProps = createMemo14(() => {
3715
3990
  return {
3716
3991
  ...videoProps()
3717
3992
  };
@@ -3741,8 +4016,8 @@ function Video(props) {
3741
4016
  }}
3742
4017
  src={props.video || "no-src"}
3743
4018
  poster={props.posterImage}
3744
- ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
3745
- <Show10
4019
+ ><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
4020
+ <Show11
3746
4021
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
3747
4022
  ><div
3748
4023
  style={{
@@ -3751,15 +4026,15 @@ function Video(props) {
3751
4026
  "pointer-events": "none",
3752
4027
  "font-size": "0px"
3753
4028
  }}
3754
- /></Show10>
3755
- <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
4029
+ /></Show11>
4030
+ <Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
3756
4031
  style={{
3757
4032
  display: "flex",
3758
4033
  "flex-direction": "column",
3759
4034
  "align-items": "stretch"
3760
4035
  }}
3761
- >{props.children}</div></Show10>
3762
- <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
4036
+ >{props.children}</div></Show11>
4037
+ <Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
3763
4038
  style={{
3764
4039
  "pointer-events": "none",
3765
4040
  display: "flex",
@@ -3771,7 +4046,7 @@ function Video(props) {
3771
4046
  width: "100%",
3772
4047
  height: "100%"
3773
4048
  }}
3774
- >{props.children}</div></Show10>
4049
+ >{props.children}</div></Show11>
3775
4050
  </div>;
3776
4051
  }
3777
4052
  var video_default = Video;
@@ -3779,28 +4054,28 @@ var video_default = Video;
3779
4054
  // src/constants/extra-components.ts
3780
4055
  var getExtraComponents = () => [{
3781
4056
  component: custom_code_default,
3782
- ...componentInfo10
4057
+ ...componentInfo11
3783
4058
  }, {
3784
4059
  component: embed_default,
3785
- ...componentInfo11
4060
+ ...componentInfo12
3786
4061
  }, ...TARGET === "rsc" ? [] : [{
3787
4062
  component: form_default,
3788
- ...componentInfo12
4063
+ ...componentInfo13
3789
4064
  }, {
3790
4065
  component: input_default,
3791
- ...componentInfo13
4066
+ ...componentInfo14
3792
4067
  }, {
3793
4068
  component: submit_button_default,
3794
- ...componentInfo15
4069
+ ...componentInfo16
3795
4070
  }, {
3796
4071
  component: select_default,
3797
- ...componentInfo14
4072
+ ...componentInfo15
3798
4073
  }], {
3799
4074
  component: img_default,
3800
- ...componentInfo16
4075
+ ...componentInfo17
3801
4076
  }, {
3802
4077
  component: video_default,
3803
- ...componentInfo17
4078
+ ...componentInfo18
3804
4079
  }];
3805
4080
 
3806
4081
  // src/constants/builder-registered-components.ts
@@ -3831,6 +4106,9 @@ var getDefaultRegisteredComponents = () => [{
3831
4106
  }, ...TARGET === "rsc" ? [] : [{
3832
4107
  component: tabs_default,
3833
4108
  ...componentInfo8
4109
+ }, {
4110
+ component: accordion_default,
4111
+ ...componentInfo10
3834
4112
  }], ...getExtraComponents()];
3835
4113
 
3836
4114
  // src/functions/register-component.ts
@@ -3909,12 +4187,12 @@ var Inlined_script_default = InlinedScript;
3909
4187
 
3910
4188
  // src/components/content/components/enable-editor.tsx
3911
4189
  import {
3912
- Show as Show11,
4190
+ Show as Show12,
3913
4191
  onMount as onMount3,
3914
4192
  on as on2,
3915
4193
  createEffect as createEffect2,
3916
- createMemo as createMemo14,
3917
- createSignal as createSignal14
4194
+ createMemo as createMemo15,
4195
+ createSignal as createSignal15
3918
4196
  } from "solid-js";
3919
4197
  import { Dynamic as Dynamic5 } from "solid-js/web";
3920
4198
 
@@ -3967,6 +4245,18 @@ function flatten(object, path = null, separator = ".") {
3967
4245
  };
3968
4246
  }, {});
3969
4247
  }
4248
+ function flattenMongoQuery(obj, _current, _res = {}) {
4249
+ for (const key in obj) {
4250
+ const value = obj[key];
4251
+ const newKey = _current ? _current + "." + key : key;
4252
+ if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$"))) {
4253
+ flattenMongoQuery(value, newKey, _res);
4254
+ } else {
4255
+ _res[newKey] = value;
4256
+ }
4257
+ }
4258
+ return _res;
4259
+ }
3970
4260
 
3971
4261
  // src/types/api-version.ts
3972
4262
  var DEFAULT_API_VERSION = "v3";
@@ -4068,7 +4358,7 @@ var generateContentUrl = (options) => {
4068
4358
  url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
4069
4359
  }
4070
4360
  if (query) {
4071
- const flattened2 = flatten({
4361
+ const flattened2 = flattenMongoQuery({
4072
4362
  query
4073
4363
  });
4074
4364
  for (const key in flattened2) {
@@ -4402,7 +4692,7 @@ function isFromTrustedHost(trustedHosts, e) {
4402
4692
  }
4403
4693
 
4404
4694
  // src/constants/sdk-version.ts
4405
- var SDK_VERSION = "1.0.26";
4695
+ var SDK_VERSION = "1.0.28";
4406
4696
 
4407
4697
  // src/functions/register.ts
4408
4698
  var registry = {};
@@ -4680,12 +4970,12 @@ var getWrapperClassName = (variationId) => {
4680
4970
 
4681
4971
  // src/components/content/components/enable-editor.tsx
4682
4972
  function EnableEditor(props) {
4683
- const [ContentWrapper, setContentWrapper] = createSignal14(
4973
+ const [ContentWrapper, setContentWrapper] = createSignal15(
4684
4974
  props.contentWrapper || "div"
4685
4975
  );
4686
- const [httpReqsData, setHttpReqsData] = createSignal14({});
4687
- const [httpReqsPending, setHttpReqsPending] = createSignal14({});
4688
- const [clicked, setClicked] = createSignal14(false);
4976
+ const [httpReqsData, setHttpReqsData] = createSignal15({});
4977
+ const [httpReqsPending, setHttpReqsPending] = createSignal15({});
4978
+ const [clicked, setClicked] = createSignal15(false);
4689
4979
  function mergeNewRootState(newData) {
4690
4980
  const combinedState = {
4691
4981
  ...props.builderContextSignal.rootState,
@@ -4719,7 +5009,7 @@ function EnableEditor(props) {
4719
5009
  content: newContentValue
4720
5010
  }));
4721
5011
  }
4722
- const showContentProps = createMemo14(() => {
5012
+ const showContentProps = createMemo15(() => {
4723
5013
  return props.showContent ? {} : {
4724
5014
  hidden: true,
4725
5015
  "aria-hidden": true
@@ -4903,21 +5193,21 @@ function EnableEditor(props) {
4903
5193
  onMount3(() => {
4904
5194
  if (!props.apiKey) {
4905
5195
  logger.error(
4906
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
5196
+ "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
4907
5197
  );
4908
5198
  }
4909
5199
  evaluateJsCode();
4910
5200
  runHttpRequests();
4911
5201
  emitStateUpdate();
4912
5202
  });
4913
- const onUpdateFn_0_props_content = createMemo14(() => props.content);
5203
+ const onUpdateFn_0_props_content = createMemo15(() => props.content);
4914
5204
  function onUpdateFn_0() {
4915
5205
  if (props.content) {
4916
5206
  mergeNewContent(props.content);
4917
5207
  }
4918
5208
  }
4919
5209
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
4920
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
5210
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
4921
5211
  function onUpdateFn_1() {
4922
5212
  evaluateJsCode();
4923
5213
  }
@@ -4927,7 +5217,7 @@ function EnableEditor(props) {
4927
5217
  onUpdateFn_1
4928
5218
  )
4929
5219
  );
4930
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
5220
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
4931
5221
  function onUpdateFn_2() {
4932
5222
  runHttpRequests();
4933
5223
  }
@@ -4939,7 +5229,7 @@ function EnableEditor(props) {
4939
5229
  onUpdateFn_2
4940
5230
  )
4941
5231
  );
4942
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
5232
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
4943
5233
  () => props.builderContextSignal.rootState
4944
5234
  );
4945
5235
  function onUpdateFn_3() {
@@ -4951,14 +5241,14 @@ function EnableEditor(props) {
4951
5241
  onUpdateFn_3
4952
5242
  )
4953
5243
  );
4954
- const onUpdateFn_4_props_data = createMemo14(() => props.data);
5244
+ const onUpdateFn_4_props_data = createMemo15(() => props.data);
4955
5245
  function onUpdateFn_4() {
4956
5246
  if (props.data) {
4957
5247
  mergeNewRootState(props.data);
4958
5248
  }
4959
5249
  }
4960
5250
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
4961
- const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
5251
+ const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
4962
5252
  function onUpdateFn_5() {
4963
5253
  if (props.locale) {
4964
5254
  mergeNewRootState({
@@ -4967,7 +5257,7 @@ function EnableEditor(props) {
4967
5257
  }
4968
5258
  }
4969
5259
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
4970
- return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
5260
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
4971
5261
  class={getWrapperClassName(
4972
5262
  props.content?.testVariationId || props.content?.id
4973
5263
  )}
@@ -4980,14 +5270,14 @@ function EnableEditor(props) {
4980
5270
  {...showContentProps()}
4981
5271
  {...props.contentWrapperProps}
4982
5272
  component={ContentWrapper()}
4983
- >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
5273
+ >{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
4984
5274
  }
4985
5275
  var Enable_editor_default = EnableEditor;
4986
5276
 
4987
5277
  // src/components/content/components/styles.tsx
4988
- import { createSignal as createSignal15 } from "solid-js";
5278
+ import { createSignal as createSignal16 } from "solid-js";
4989
5279
  function ContentStyles(props) {
4990
- const [injectedStyles, setInjectedStyles] = createSignal15(
5280
+ const [injectedStyles, setInjectedStyles] = createSignal16(
4991
5281
  `
4992
5282
  ${getCss({
4993
5283
  cssCode: props.cssCode,
@@ -5044,7 +5334,7 @@ var getContentInitialValue = ({
5044
5334
 
5045
5335
  // src/components/content/content.tsx
5046
5336
  function ContentComponent(props) {
5047
- const [scriptStr, setScriptStr] = createSignal16(
5337
+ const [scriptStr, setScriptStr] = createSignal17(
5048
5338
  getUpdateVariantVisibilityScript({
5049
5339
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
5050
5340
  variationId: props.content?.testVariationId,
@@ -5052,7 +5342,7 @@ function ContentComponent(props) {
5052
5342
  contentId: props.content?.id
5053
5343
  })
5054
5344
  );
5055
- const [registeredComponents, setRegisteredComponents] = createSignal16(
5345
+ const [registeredComponents, setRegisteredComponents] = createSignal17(
5056
5346
  [
5057
5347
  ...getDefaultRegisteredComponents(),
5058
5348
  ...props.customComponents || []
@@ -5067,7 +5357,7 @@ function ContentComponent(props) {
5067
5357
  {}
5068
5358
  )
5069
5359
  );
5070
- const [builderContextSignal, setBuilderContextSignal] = createSignal16({
5360
+ const [builderContextSignal, setBuilderContextSignal] = createSignal17({
5071
5361
  content: getContentInitialValue({
5072
5362
  content: props.content,
5073
5363
  data: props.data
@@ -5125,16 +5415,16 @@ function ContentComponent(props) {
5125
5415
  setBuilderContextSignal
5126
5416
  }}
5127
5417
  >
5128
- <Show12 when={props.isSsrAbTest}><Inlined_script_default
5418
+ <Show13 when={props.isSsrAbTest}><Inlined_script_default
5129
5419
  id="builderio-variant-visibility"
5130
5420
  scriptStr={scriptStr()}
5131
- /></Show12>
5132
- <Show12 when={TARGET !== "reactNative"}><Styles_default
5421
+ /></Show13>
5422
+ <Show13 when={TARGET !== "reactNative"}><Styles_default
5133
5423
  isNestedRender={props.isNestedRender}
5134
5424
  contentId={builderContextSignal().content?.id}
5135
5425
  cssCode={builderContextSignal().content?.data?.cssCode}
5136
5426
  customFonts={builderContextSignal().content?.data?.customFonts}
5137
- /></Show12>
5427
+ /></Show13>
5138
5428
  <Blocks_default
5139
5429
  blocks={builderContextSignal().content?.data?.blocks}
5140
5430
  context={builderContextSignal()}
@@ -5147,13 +5437,13 @@ var Content_default = ContentComponent;
5147
5437
 
5148
5438
  // src/components/content-variants/content-variants.tsx
5149
5439
  function ContentVariants(props) {
5150
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
5440
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
5151
5441
  checkShouldRenderVariants({
5152
5442
  canTrack: getDefaultCanTrack(props.canTrack),
5153
5443
  content: props.content
5154
5444
  })
5155
5445
  );
5156
- const updateCookieAndStylesScriptStr = createMemo17(() => {
5446
+ const updateCookieAndStylesScriptStr = createMemo18(() => {
5157
5447
  return getUpdateCookieAndStylesScript(
5158
5448
  getVariants(props.content).map((value) => ({
5159
5449
  id: value.testVariationId,
@@ -5162,10 +5452,10 @@ function ContentVariants(props) {
5162
5452
  props.content?.id || ""
5163
5453
  );
5164
5454
  });
5165
- const hideVariantsStyleString = createMemo17(() => {
5455
+ const hideVariantsStyleString = createMemo18(() => {
5166
5456
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
5167
5457
  });
5168
- const defaultContent = createMemo17(() => {
5458
+ const defaultContent = createMemo18(() => {
5169
5459
  return shouldRenderVariants() ? {
5170
5460
  ...props.content,
5171
5461
  testVariationId: props.content?.id
@@ -5178,11 +5468,11 @@ function ContentVariants(props) {
5178
5468
  setShouldRenderVariants(false);
5179
5469
  });
5180
5470
  return <>
5181
- <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5471
+ <Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5182
5472
  id="builderio-init-variants-fns"
5183
5473
  scriptStr={getInitVariantsFnsScriptString()}
5184
- /></Show13>
5185
- <Show13 when={shouldRenderVariants()}>
5474
+ /></Show14>
5475
+ <Show14 when={shouldRenderVariants()}>
5186
5476
  <Inlined_styles_default
5187
5477
  id="builderio-variants"
5188
5478
  styles={hideVariantsStyleString()}
@@ -5191,7 +5481,7 @@ function ContentVariants(props) {
5191
5481
  id="builderio-variants-visibility"
5192
5482
  scriptStr={updateCookieAndStylesScriptStr()}
5193
5483
  />
5194
- <For8 each={getVariants(props.content)}>{(variant, _index) => {
5484
+ <For9 each={getVariants(props.content)}>{(variant, _index) => {
5195
5485
  const index = _index();
5196
5486
  return <Content_default
5197
5487
  isNestedRender={props.isNestedRender}
@@ -5215,8 +5505,8 @@ function ContentVariants(props) {
5215
5505
  contentWrapperProps={props.contentWrapperProps}
5216
5506
  trustedHosts={props.trustedHosts}
5217
5507
  />;
5218
- }}</For8>
5219
- </Show13>
5508
+ }}</For9>
5509
+ </Show14>
5220
5510
  <Content_default
5221
5511
  isNestedRender={props.isNestedRender}
5222
5512
  {...{}}
@@ -5269,14 +5559,14 @@ var fetchSymbolContent = async ({
5269
5559
 
5270
5560
  // src/blocks/symbol/symbol.tsx
5271
5561
  function Symbol(props) {
5272
- const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
5273
- const blocksWrapper = createMemo18(() => {
5562
+ const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
5563
+ const blocksWrapper = createMemo19(() => {
5274
5564
  return "div";
5275
5565
  });
5276
- const contentWrapper = createMemo18(() => {
5566
+ const contentWrapper = createMemo19(() => {
5277
5567
  return "div";
5278
5568
  });
5279
- const className = createMemo18(() => {
5569
+ const className = createMemo19(() => {
5280
5570
  return [
5281
5571
  ...[props.attributes[getClassPropName()]],
5282
5572
  "builder-symbol",
@@ -5298,7 +5588,7 @@ function Symbol(props) {
5298
5588
  }
5299
5589
  onMount5(() => {
5300
5590
  });
5301
- const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
5591
+ const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
5302
5592
  function onUpdateFn_0() {
5303
5593
  setContent();
5304
5594
  }