@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/edge/dev.jsx CHANGED
@@ -3625,6 +3625,9 @@ function getProcessedBlock({
3625
3625
  }
3626
3626
  }
3627
3627
 
3628
+ // src/functions/camel-to-kebab-case.ts
3629
+ var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
3630
+
3628
3631
  // src/components/block/animator.ts
3629
3632
  function throttle(func, wait, options = {}) {
3630
3633
  let context;
@@ -3675,7 +3678,6 @@ function assign(target, ..._args) {
3675
3678
  }
3676
3679
  return to;
3677
3680
  }
3678
- var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
3679
3681
  function bindAnimations(animations) {
3680
3682
  for (const animation of animations) {
3681
3683
  switch (animation.trigger) {
@@ -3728,7 +3730,7 @@ function triggerAnimation(animation) {
3728
3730
  element.style.transitionDelay = "0";
3729
3731
  assign(element.style, animation.steps[0].styles);
3730
3732
  setTimeout(() => {
3731
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
3733
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
3732
3734
  if (animation.delay) {
3733
3735
  element.style.transitionDelay = animation.delay + "s";
3734
3736
  }
@@ -3788,7 +3790,7 @@ function bindScrollInViewAnimation(animation) {
3788
3790
  }
3789
3791
  attachDefaultState();
3790
3792
  setTimeout(() => {
3791
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
3793
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
3792
3794
  if (animation.delay) {
3793
3795
  element.style.transitionDelay = animation.delay + "s";
3794
3796
  }
@@ -3801,9 +3803,6 @@ function bindScrollInViewAnimation(animation) {
3801
3803
  });
3802
3804
  }
3803
3805
 
3804
- // src/functions/camel-to-kebab-case.ts
3805
- var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
3806
-
3807
3806
  // src/helpers/css.ts
3808
3807
  var convertStyleMapToCSSArray = (style) => {
3809
3808
  const cssProps = Object.entries(style).map(([key, value]) => {
@@ -3933,10 +3932,10 @@ var getRepeatItemData = ({
3933
3932
  return repeatArray;
3934
3933
  };
3935
3934
  var shouldPassLinkComponent = (block) => {
3936
- return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
3935
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
3937
3936
  };
3938
3937
  var shouldPassRegisteredComponents = (block) => {
3939
- return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
3938
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
3940
3939
  };
3941
3940
 
3942
3941
  // src/components/block/components/block-styles.tsx
@@ -4065,7 +4064,7 @@ function BlockStyles(props) {
4065
4064
  className: `${className}:hover`,
4066
4065
  styles: {
4067
4066
  ...hoverStyles,
4068
- transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(
4067
+ transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
4069
4068
  hoverAnimation.easing
4070
4069
  )}`,
4071
4070
  transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
@@ -4830,10 +4829,10 @@ function SectionComponent(props) {
4830
4829
  var section_default = SectionComponent;
4831
4830
 
4832
4831
  // src/blocks/symbol/symbol.tsx
4833
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
4832
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
4834
4833
 
4835
4834
  // src/components/content-variants/content-variants.tsx
4836
- import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
4835
+ import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
4837
4836
 
4838
4837
  // src/helpers/url.ts
4839
4838
  var getTopLevelDomain = (host) => {
@@ -5027,7 +5026,7 @@ var handleABTesting = async ({
5027
5026
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
5028
5027
 
5029
5028
  // src/components/content/content.tsx
5030
- import { Show as Show12, createSignal as createSignal16 } from "solid-js";
5029
+ import { Show as Show13, createSignal as createSignal17 } from "solid-js";
5031
5030
 
5032
5031
  // src/blocks/button/component-info.ts
5033
5032
  var componentInfo = {
@@ -5678,8 +5677,12 @@ function Tabs(props) {
5678
5677
  function activeTabContent(active) {
5679
5678
  return props.tabs && props.tabs[active].content;
5680
5679
  }
5681
- function getActiveTabStyle(index) {
5682
- return activeTab() === index ? props.activeTabStyle : {};
5680
+ function onClick(index) {
5681
+ if (index === activeTab() && props.collapsible) {
5682
+ setActiveTab(-1);
5683
+ } else {
5684
+ setActiveTab(index);
5685
+ }
5683
5686
  }
5684
5687
  return <div>
5685
5688
  <div
@@ -5695,14 +5698,10 @@ function Tabs(props) {
5695
5698
  return <span
5696
5699
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
5697
5700
  key={index}
5698
- style={getActiveTabStyle(index)}
5699
- onClick={(event) => {
5700
- if (index === activeTab() && props.collapsible) {
5701
- setActiveTab(-1);
5702
- } else {
5703
- setActiveTab(index);
5704
- }
5701
+ style={{
5702
+ ...activeTab() === index ? props.activeTabStyle : {}
5705
5703
  }}
5704
+ onClick={(event) => onClick(index)}
5706
5705
  ><Blocks_default
5707
5706
  parent={props.builderBlock.id}
5708
5707
  path={`component.options.tabs.${index}.label`}
@@ -5757,8 +5756,284 @@ function Text(props) {
5757
5756
  }
5758
5757
  var text_default = Text;
5759
5758
 
5760
- // src/blocks/custom-code/component-info.ts
5759
+ // src/blocks/accordion/accordion.tsx
5760
+ import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
5761
+
5762
+ // src/blocks/accordion/helpers.ts
5763
+ var convertOrderNumberToString = (order) => {
5764
+ return order.toString();
5765
+ };
5766
+
5767
+ // src/blocks/accordion/accordion.tsx
5768
+ function Accordion(props) {
5769
+ const [open, setOpen] = createSignal10([]);
5770
+ const onlyOneAtATime = createMemo10(() => {
5771
+ return Boolean(props.grid || props.oneAtATime);
5772
+ });
5773
+ const accordionStyles = createMemo10(() => {
5774
+ const styles = {
5775
+ display: "flex",
5776
+ alignItems: "stretch",
5777
+ flexDirection: "column",
5778
+ ...props.grid && {
5779
+ flexDirection: "row",
5780
+ alignItems: "flex-start",
5781
+ flexWrap: "wrap"
5782
+ }
5783
+ };
5784
+ return Object.fromEntries(
5785
+ Object.entries(styles).map(([key, value]) => [
5786
+ camelToKebabCase(key),
5787
+ value
5788
+ ])
5789
+ );
5790
+ });
5791
+ const accordionTitleStyles = createMemo10(() => {
5792
+ const shared = {
5793
+ display: "flex",
5794
+ flexDirection: "column"
5795
+ };
5796
+ const styles = Object.fromEntries(
5797
+ Object.entries({
5798
+ ...shared,
5799
+ alignItems: "stretch",
5800
+ cursor: "pointer"
5801
+ }).map(([key, value]) => [camelToKebabCase(key), value])
5802
+ );
5803
+ return Object.fromEntries(
5804
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
5805
+ );
5806
+ });
5807
+ function getAccordionTitleClassName(index) {
5808
+ return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
5809
+ }
5810
+ function getAccordionDetailClassName(index) {
5811
+ return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
5812
+ }
5813
+ const openGridItemOrder = createMemo10(() => {
5814
+ let itemOrder = null;
5815
+ const getOpenGridItemPosition = props.grid && open().length;
5816
+ if (getOpenGridItemPosition && document) {
5817
+ const openItemIndex = open()[0];
5818
+ const openItem = document.querySelector(
5819
+ `.builder-accordion-title[data-index="${openItemIndex}"]`
5820
+ );
5821
+ let subjectItem = openItem;
5822
+ itemOrder = openItemIndex;
5823
+ if (subjectItem) {
5824
+ let prevItemRect = subjectItem.getBoundingClientRect();
5825
+ while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
5826
+ if (subjectItem) {
5827
+ if (subjectItem.classList.contains("builder-accordion-detail")) {
5828
+ continue;
5829
+ }
5830
+ const subjectItemRect = subjectItem.getBoundingClientRect();
5831
+ if (subjectItemRect.left > prevItemRect.left) {
5832
+ const index = parseInt(
5833
+ subjectItem.getAttribute("data-index") || "",
5834
+ 10
5835
+ );
5836
+ if (!isNaN(index)) {
5837
+ prevItemRect = subjectItemRect;
5838
+ itemOrder = index;
5839
+ }
5840
+ } else {
5841
+ break;
5842
+ }
5843
+ }
5844
+ }
5845
+ }
5846
+ }
5847
+ if (typeof itemOrder === "number") {
5848
+ itemOrder = itemOrder + 1;
5849
+ }
5850
+ return itemOrder;
5851
+ });
5852
+ const accordionDetailStyles = createMemo10(() => {
5853
+ const styles = {
5854
+ ...{
5855
+ order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
5856
+ },
5857
+ ...props.grid && {
5858
+ width: "100%"
5859
+ }
5860
+ };
5861
+ return Object.fromEntries(
5862
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
5863
+ );
5864
+ });
5865
+ function onClick(index) {
5866
+ if (open().includes(index)) {
5867
+ setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
5868
+ } else {
5869
+ setOpen(onlyOneAtATime() ? [index] : open().concat(index));
5870
+ }
5871
+ }
5872
+ return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
5873
+ const index = _index();
5874
+ return <>
5875
+ <div
5876
+ class={getAccordionTitleClassName(index)}
5877
+ style={{
5878
+ ...accordionTitleStyles(),
5879
+ width: props.grid ? props.gridRowWidth : void 0,
5880
+ ...{
5881
+ order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
5882
+ }
5883
+ }}
5884
+ data-index={index}
5885
+ onClick={(event) => onClick(index)}
5886
+ ><Blocks_default
5887
+ blocks={item.title}
5888
+ path={`items.${index}.title`}
5889
+ parent={props.builderBlock.id}
5890
+ context={props.builderContext}
5891
+ registeredComponents={props.builderComponents}
5892
+ linkComponent={props.builderLinkComponent}
5893
+ /></div>
5894
+ <Show9 when={open().includes(index)}><div
5895
+ class={getAccordionDetailClassName(index)}
5896
+ style={accordionDetailStyles()}
5897
+ ><Blocks_default
5898
+ blocks={item.detail}
5899
+ path={`items.${index}.detail`}
5900
+ parent={props.builderBlock.id}
5901
+ context={props.builderContext}
5902
+ registeredComponents={props.builderComponents}
5903
+ linkComponent={props.builderLinkComponent}
5904
+ /></div></Show9>
5905
+ </>;
5906
+ }}</For6></div>;
5907
+ }
5908
+ var accordion_default = Accordion;
5909
+
5910
+ // src/blocks/accordion/component-info.ts
5911
+ var defaultTitle = {
5912
+ "@type": "@builder.io/sdk:Element",
5913
+ layerName: "Accordion item title",
5914
+ responsiveStyles: {
5915
+ large: {
5916
+ marginTop: "10px",
5917
+ position: "relative",
5918
+ display: "flex",
5919
+ alignItems: "stretch",
5920
+ flexDirection: "column",
5921
+ paddingBottom: "10px"
5922
+ }
5923
+ },
5924
+ children: [{
5925
+ "@type": "@builder.io/sdk:Element",
5926
+ responsiveStyles: {
5927
+ large: {
5928
+ textAlign: "left",
5929
+ display: "flex",
5930
+ flexDirection: "column"
5931
+ }
5932
+ },
5933
+ component: {
5934
+ name: "Text",
5935
+ options: {
5936
+ text: "I am an accordion title. Click me!"
5937
+ }
5938
+ }
5939
+ }]
5940
+ };
5941
+ var defaultDetail = {
5942
+ "@type": "@builder.io/sdk:Element",
5943
+ layerName: "Accordion item detail",
5944
+ responsiveStyles: {
5945
+ large: {
5946
+ position: "relative",
5947
+ display: "flex",
5948
+ alignItems: "stretch",
5949
+ flexDirection: "column",
5950
+ marginTop: "10px",
5951
+ paddingBottom: "10px"
5952
+ }
5953
+ },
5954
+ children: [{
5955
+ "@type": "@builder.io/sdk:Element",
5956
+ responsiveStyles: {
5957
+ large: {
5958
+ paddingTop: "50px",
5959
+ textAlign: "left",
5960
+ display: "flex",
5961
+ flexDirection: "column",
5962
+ paddingBottom: "50px"
5963
+ }
5964
+ },
5965
+ component: {
5966
+ name: "Text",
5967
+ options: {
5968
+ text: "I am an accordion detail, hello!"
5969
+ }
5970
+ }
5971
+ }]
5972
+ };
5761
5973
  var componentInfo10 = {
5974
+ name: "Builder:Accordion",
5975
+ canHaveChildren: true,
5976
+ image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
5977
+ defaultStyles: {
5978
+ display: "flex",
5979
+ flexDirection: "column",
5980
+ alignItems: "stretch"
5981
+ },
5982
+ inputs: [{
5983
+ name: "items",
5984
+ type: "list",
5985
+ broadcast: true,
5986
+ subFields: [{
5987
+ name: "title",
5988
+ type: "uiBlocks",
5989
+ hideFromUI: true,
5990
+ defaultValue: [defaultTitle]
5991
+ }, {
5992
+ name: "detail",
5993
+ type: "uiBlocks",
5994
+ hideFromUI: true,
5995
+ defaultValue: [defaultDetail]
5996
+ }],
5997
+ defaultValue: [{
5998
+ title: [defaultTitle],
5999
+ detail: [defaultDetail]
6000
+ }, {
6001
+ title: [defaultTitle],
6002
+ detail: [defaultDetail]
6003
+ }],
6004
+ showIf: (options) => !options.get("useChildrenForItems")
6005
+ }, {
6006
+ name: "oneAtATime",
6007
+ helperText: "Only allow opening one at a time (collapse all others when new item openned)",
6008
+ type: "boolean",
6009
+ defaultValue: false
6010
+ }, {
6011
+ name: "grid",
6012
+ helperText: "Display as a grid",
6013
+ type: "boolean",
6014
+ defaultValue: false
6015
+ }, {
6016
+ name: "gridRowWidth",
6017
+ helperText: "Display as a grid",
6018
+ type: "string",
6019
+ showIf: (options) => options.get("grid"),
6020
+ defaultValue: "25%"
6021
+ }, {
6022
+ name: "useChildrenForItems",
6023
+ type: "boolean",
6024
+ helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
6025
+ advanced: true,
6026
+ defaultValue: false,
6027
+ onChange: (options) => {
6028
+ if (options.get("useChildrenForItems") === true) {
6029
+ options.set("items", []);
6030
+ }
6031
+ }
6032
+ }]
6033
+ };
6034
+
6035
+ // src/blocks/custom-code/component-info.ts
6036
+ var componentInfo11 = {
5762
6037
  name: "Custom Code",
5763
6038
  static: true,
5764
6039
  requiredPermissions: ["editCode"],
@@ -5783,10 +6058,10 @@ var componentInfo10 = {
5783
6058
  };
5784
6059
 
5785
6060
  // src/blocks/custom-code/custom-code.tsx
5786
- import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
6061
+ import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
5787
6062
  function CustomCode(props) {
5788
- const [scriptsInserted, setScriptsInserted] = createSignal10([]);
5789
- const [scriptsRun, setScriptsRun] = createSignal10([]);
6063
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
6064
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
5790
6065
  let elementRef;
5791
6066
  onMount2(() => {
5792
6067
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -5830,7 +6105,7 @@ function CustomCode(props) {
5830
6105
  var custom_code_default = CustomCode;
5831
6106
 
5832
6107
  // src/blocks/embed/component-info.ts
5833
- var componentInfo11 = {
6108
+ var componentInfo12 = {
5834
6109
  name: "Embed",
5835
6110
  static: true,
5836
6111
  inputs: [{
@@ -5868,7 +6143,7 @@ var componentInfo11 = {
5868
6143
  };
5869
6144
 
5870
6145
  // src/blocks/embed/embed.tsx
5871
- import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
6146
+ import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
5872
6147
 
5873
6148
  // src/blocks/embed/helpers.ts
5874
6149
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -5876,9 +6151,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
5876
6151
 
5877
6152
  // src/blocks/embed/embed.tsx
5878
6153
  function Embed(props) {
5879
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
5880
- const [scriptsRun, setScriptsRun] = createSignal11([]);
5881
- const [ranInitFn, setRanInitFn] = createSignal11(false);
6154
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
6155
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
6156
+ const [ranInitFn, setRanInitFn] = createSignal12(false);
5882
6157
  function findAndRunScripts() {
5883
6158
  if (!elem || !elem.getElementsByTagName)
5884
6159
  return;
@@ -5902,8 +6177,8 @@ function Embed(props) {
5902
6177
  }
5903
6178
  }
5904
6179
  let elem;
5905
- const onUpdateFn_0_elem = createMemo11(() => elem);
5906
- const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
6180
+ const onUpdateFn_0_elem = createMemo12(() => elem);
6181
+ const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
5907
6182
  function onUpdateFn_0() {
5908
6183
  if (elem && !ranInitFn()) {
5909
6184
  setRanInitFn(true);
@@ -5918,7 +6193,7 @@ function Embed(props) {
5918
6193
  var embed_default = Embed;
5919
6194
 
5920
6195
  // src/blocks/form/form/component-info.ts
5921
- var componentInfo12 = {
6196
+ var componentInfo13 = {
5922
6197
  name: "Form:Form",
5923
6198
  // editableTags: ['builder-form-error']
5924
6199
  defaults: {
@@ -6152,7 +6427,7 @@ var componentInfo12 = {
6152
6427
  };
6153
6428
 
6154
6429
  // src/blocks/form/form/form.tsx
6155
- import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
6430
+ import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
6156
6431
  import { css as css4 } from "solid-styled-components";
6157
6432
 
6158
6433
  // src/functions/get-env.ts
@@ -6170,9 +6445,9 @@ var get = (obj, path, defaultValue) => {
6170
6445
 
6171
6446
  // src/blocks/form/form/form.tsx
6172
6447
  function FormComponent(props) {
6173
- const [formState, setFormState] = createSignal12("unsubmitted");
6174
- const [responseData, setResponseData] = createSignal12(null);
6175
- const [formErrorMessage, setFormErrorMessage] = createSignal12("");
6448
+ const [formState, setFormState] = createSignal13("unsubmitted");
6449
+ const [responseData, setResponseData] = createSignal13(null);
6450
+ const [formErrorMessage, setFormErrorMessage] = createSignal13("");
6176
6451
  function mergeNewRootState(newData) {
6177
6452
  const combinedState = {
6178
6453
  ...props.builderContext.rootState,
@@ -6368,7 +6643,7 @@ function FormComponent(props) {
6368
6643
  {...{}}
6369
6644
  {...props.attributes}
6370
6645
  >
6371
- <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
6646
+ <Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
6372
6647
  const idx = _index();
6373
6648
  return <Block_default
6374
6649
  key={`form-block-${idx}`}
@@ -6377,35 +6652,35 @@ function FormComponent(props) {
6377
6652
  registeredComponents={props.builderComponents}
6378
6653
  linkComponent={props.builderLinkComponent}
6379
6654
  />;
6380
- }}</For6></Show9>
6381
- <Show9 when={submissionState() === "error"}><Blocks_default
6655
+ }}</For7></Show10>
6656
+ <Show10 when={submissionState() === "error"}><Blocks_default
6382
6657
  path="errorMessage"
6383
6658
  blocks={props.errorMessage}
6384
6659
  context={props.builderContext}
6385
- /></Show9>
6386
- <Show9 when={submissionState() === "sending"}><Blocks_default
6660
+ /></Show10>
6661
+ <Show10 when={submissionState() === "sending"}><Blocks_default
6387
6662
  path="sendingMessage"
6388
6663
  blocks={props.sendingMessage}
6389
6664
  context={props.builderContext}
6390
- /></Show9>
6391
- <Show9 when={submissionState() === "error" && responseData()}><pre
6665
+ /></Show10>
6666
+ <Show10 when={submissionState() === "error" && responseData()}><pre
6392
6667
  class={"builder-form-error-text " + css4({
6393
6668
  padding: "10px",
6394
6669
  color: "red",
6395
6670
  textAlign: "center"
6396
6671
  })}
6397
- >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
6398
- <Show9 when={submissionState() === "success"}><Blocks_default
6672
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show10>
6673
+ <Show10 when={submissionState() === "success"}><Blocks_default
6399
6674
  path="successMessage"
6400
6675
  blocks={props.successMessage}
6401
6676
  context={props.builderContext}
6402
- /></Show9>
6677
+ /></Show10>
6403
6678
  </form>;
6404
6679
  }
6405
6680
  var form_default = FormComponent;
6406
6681
 
6407
6682
  // src/blocks/form/input/component-info.ts
6408
- var componentInfo13 = {
6683
+ var componentInfo14 = {
6409
6684
  name: "Form:Input",
6410
6685
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
6411
6686
  inputs: [
@@ -6475,7 +6750,7 @@ function FormInputComponent(props) {
6475
6750
  var input_default = FormInputComponent;
6476
6751
 
6477
6752
  // src/blocks/form/select/component-info.ts
6478
- var componentInfo14 = {
6753
+ var componentInfo15 = {
6479
6754
  name: "Form:Select",
6480
6755
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
6481
6756
  defaultStyles: {
@@ -6520,7 +6795,7 @@ var componentInfo14 = {
6520
6795
  };
6521
6796
 
6522
6797
  // src/blocks/form/select/select.tsx
6523
- import { For as For7 } from "solid-js";
6798
+ import { For as For8 } from "solid-js";
6524
6799
  function SelectComponent(props) {
6525
6800
  return <select
6526
6801
  {...{}}
@@ -6529,15 +6804,15 @@ function SelectComponent(props) {
6529
6804
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
6530
6805
  defaultValue={props.defaultValue}
6531
6806
  name={props.name}
6532
- ><For7 each={props.options}>{(option, _index) => {
6807
+ ><For8 each={props.options}>{(option, _index) => {
6533
6808
  const index = _index();
6534
6809
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
6535
- }}</For7></select>;
6810
+ }}</For8></select>;
6536
6811
  }
6537
6812
  var select_default = SelectComponent;
6538
6813
 
6539
6814
  // src/blocks/form/submit-button/component-info.ts
6540
- var componentInfo15 = {
6815
+ var componentInfo16 = {
6541
6816
  name: "Form:SubmitButton",
6542
6817
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
6543
6818
  defaultStyles: {
@@ -6571,7 +6846,7 @@ function SubmitButton(props) {
6571
6846
  var submit_button_default = SubmitButton;
6572
6847
 
6573
6848
  // src/blocks/img/component-info.ts
6574
- var componentInfo16 = {
6849
+ var componentInfo17 = {
6575
6850
  // friendlyName?
6576
6851
  name: "Raw:Img",
6577
6852
  hideFromInsertMenu: true,
@@ -6604,7 +6879,7 @@ function ImgComponent(props) {
6604
6879
  var img_default = ImgComponent;
6605
6880
 
6606
6881
  // src/blocks/video/component-info.ts
6607
- var componentInfo17 = {
6882
+ var componentInfo18 = {
6608
6883
  name: "Video",
6609
6884
  canHaveChildren: true,
6610
6885
  defaultStyles: {
@@ -6688,9 +6963,9 @@ var componentInfo17 = {
6688
6963
  };
6689
6964
 
6690
6965
  // src/blocks/video/video.tsx
6691
- import { Show as Show10, createMemo as createMemo13 } from "solid-js";
6966
+ import { Show as Show11, createMemo as createMemo14 } from "solid-js";
6692
6967
  function Video(props) {
6693
- const videoProps = createMemo13(() => {
6968
+ const videoProps = createMemo14(() => {
6694
6969
  return {
6695
6970
  ...props.autoPlay === true ? {
6696
6971
  autoPlay: true
@@ -6709,7 +6984,7 @@ function Video(props) {
6709
6984
  } : {}
6710
6985
  };
6711
6986
  });
6712
- const spreadProps = createMemo13(() => {
6987
+ const spreadProps = createMemo14(() => {
6713
6988
  return {
6714
6989
  ...videoProps()
6715
6990
  };
@@ -6739,8 +7014,8 @@ function Video(props) {
6739
7014
  }}
6740
7015
  src={props.video || "no-src"}
6741
7016
  poster={props.posterImage}
6742
- ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
6743
- <Show10
7017
+ ><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
7018
+ <Show11
6744
7019
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
6745
7020
  ><div
6746
7021
  style={{
@@ -6749,15 +7024,15 @@ function Video(props) {
6749
7024
  "pointer-events": "none",
6750
7025
  "font-size": "0px"
6751
7026
  }}
6752
- /></Show10>
6753
- <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
7027
+ /></Show11>
7028
+ <Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
6754
7029
  style={{
6755
7030
  display: "flex",
6756
7031
  "flex-direction": "column",
6757
7032
  "align-items": "stretch"
6758
7033
  }}
6759
- >{props.children}</div></Show10>
6760
- <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
7034
+ >{props.children}</div></Show11>
7035
+ <Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
6761
7036
  style={{
6762
7037
  "pointer-events": "none",
6763
7038
  display: "flex",
@@ -6769,7 +7044,7 @@ function Video(props) {
6769
7044
  width: "100%",
6770
7045
  height: "100%"
6771
7046
  }}
6772
- >{props.children}</div></Show10>
7047
+ >{props.children}</div></Show11>
6773
7048
  </div>;
6774
7049
  }
6775
7050
  var video_default = Video;
@@ -6777,28 +7052,28 @@ var video_default = Video;
6777
7052
  // src/constants/extra-components.ts
6778
7053
  var getExtraComponents = () => [{
6779
7054
  component: custom_code_default,
6780
- ...componentInfo10
7055
+ ...componentInfo11
6781
7056
  }, {
6782
7057
  component: embed_default,
6783
- ...componentInfo11
7058
+ ...componentInfo12
6784
7059
  }, ...TARGET === "rsc" ? [] : [{
6785
7060
  component: form_default,
6786
- ...componentInfo12
7061
+ ...componentInfo13
6787
7062
  }, {
6788
7063
  component: input_default,
6789
- ...componentInfo13
7064
+ ...componentInfo14
6790
7065
  }, {
6791
7066
  component: submit_button_default,
6792
- ...componentInfo15
7067
+ ...componentInfo16
6793
7068
  }, {
6794
7069
  component: select_default,
6795
- ...componentInfo14
7070
+ ...componentInfo15
6796
7071
  }], {
6797
7072
  component: img_default,
6798
- ...componentInfo16
7073
+ ...componentInfo17
6799
7074
  }, {
6800
7075
  component: video_default,
6801
- ...componentInfo17
7076
+ ...componentInfo18
6802
7077
  }];
6803
7078
 
6804
7079
  // src/constants/builder-registered-components.ts
@@ -6829,6 +7104,9 @@ var getDefaultRegisteredComponents = () => [{
6829
7104
  }, ...TARGET === "rsc" ? [] : [{
6830
7105
  component: tabs_default,
6831
7106
  ...componentInfo8
7107
+ }, {
7108
+ component: accordion_default,
7109
+ ...componentInfo10
6832
7110
  }], ...getExtraComponents()];
6833
7111
 
6834
7112
  // src/functions/register-component.ts
@@ -6907,12 +7185,12 @@ var Inlined_script_default = InlinedScript;
6907
7185
 
6908
7186
  // src/components/content/components/enable-editor.tsx
6909
7187
  import {
6910
- Show as Show11,
7188
+ Show as Show12,
6911
7189
  onMount as onMount3,
6912
7190
  on as on2,
6913
7191
  createEffect as createEffect2,
6914
- createMemo as createMemo14,
6915
- createSignal as createSignal14
7192
+ createMemo as createMemo15,
7193
+ createSignal as createSignal15
6916
7194
  } from "solid-js";
6917
7195
  import { Dynamic as Dynamic5 } from "solid-js/web";
6918
7196
 
@@ -6965,6 +7243,18 @@ function flatten(object, path = null, separator = ".") {
6965
7243
  };
6966
7244
  }, {});
6967
7245
  }
7246
+ function flattenMongoQuery(obj, _current, _res = {}) {
7247
+ for (const key in obj) {
7248
+ const value = obj[key];
7249
+ const newKey = _current ? _current + "." + key : key;
7250
+ if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$"))) {
7251
+ flattenMongoQuery(value, newKey, _res);
7252
+ } else {
7253
+ _res[newKey] = value;
7254
+ }
7255
+ }
7256
+ return _res;
7257
+ }
6968
7258
 
6969
7259
  // src/types/api-version.ts
6970
7260
  var DEFAULT_API_VERSION = "v3";
@@ -7066,7 +7356,7 @@ var generateContentUrl = (options) => {
7066
7356
  url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
7067
7357
  }
7068
7358
  if (query) {
7069
- const flattened2 = flatten({
7359
+ const flattened2 = flattenMongoQuery({
7070
7360
  query
7071
7361
  });
7072
7362
  for (const key in flattened2) {
@@ -7400,7 +7690,7 @@ function isFromTrustedHost(trustedHosts, e) {
7400
7690
  }
7401
7691
 
7402
7692
  // src/constants/sdk-version.ts
7403
- var SDK_VERSION = "1.0.26";
7693
+ var SDK_VERSION = "1.0.28";
7404
7694
 
7405
7695
  // src/functions/register.ts
7406
7696
  var registry = {};
@@ -7678,12 +7968,12 @@ var getWrapperClassName = (variationId) => {
7678
7968
 
7679
7969
  // src/components/content/components/enable-editor.tsx
7680
7970
  function EnableEditor(props) {
7681
- const [ContentWrapper, setContentWrapper] = createSignal14(
7971
+ const [ContentWrapper, setContentWrapper] = createSignal15(
7682
7972
  props.contentWrapper || "div"
7683
7973
  );
7684
- const [httpReqsData, setHttpReqsData] = createSignal14({});
7685
- const [httpReqsPending, setHttpReqsPending] = createSignal14({});
7686
- const [clicked, setClicked] = createSignal14(false);
7974
+ const [httpReqsData, setHttpReqsData] = createSignal15({});
7975
+ const [httpReqsPending, setHttpReqsPending] = createSignal15({});
7976
+ const [clicked, setClicked] = createSignal15(false);
7687
7977
  function mergeNewRootState(newData) {
7688
7978
  const combinedState = {
7689
7979
  ...props.builderContextSignal.rootState,
@@ -7717,7 +8007,7 @@ function EnableEditor(props) {
7717
8007
  content: newContentValue
7718
8008
  }));
7719
8009
  }
7720
- const showContentProps = createMemo14(() => {
8010
+ const showContentProps = createMemo15(() => {
7721
8011
  return props.showContent ? {} : {
7722
8012
  hidden: true,
7723
8013
  "aria-hidden": true
@@ -7901,21 +8191,21 @@ function EnableEditor(props) {
7901
8191
  onMount3(() => {
7902
8192
  if (!props.apiKey) {
7903
8193
  logger.error(
7904
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
8194
+ "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
7905
8195
  );
7906
8196
  }
7907
8197
  evaluateJsCode();
7908
8198
  runHttpRequests();
7909
8199
  emitStateUpdate();
7910
8200
  });
7911
- const onUpdateFn_0_props_content = createMemo14(() => props.content);
8201
+ const onUpdateFn_0_props_content = createMemo15(() => props.content);
7912
8202
  function onUpdateFn_0() {
7913
8203
  if (props.content) {
7914
8204
  mergeNewContent(props.content);
7915
8205
  }
7916
8206
  }
7917
8207
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
7918
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
8208
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
7919
8209
  function onUpdateFn_1() {
7920
8210
  evaluateJsCode();
7921
8211
  }
@@ -7925,7 +8215,7 @@ function EnableEditor(props) {
7925
8215
  onUpdateFn_1
7926
8216
  )
7927
8217
  );
7928
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
8218
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
7929
8219
  function onUpdateFn_2() {
7930
8220
  runHttpRequests();
7931
8221
  }
@@ -7937,7 +8227,7 @@ function EnableEditor(props) {
7937
8227
  onUpdateFn_2
7938
8228
  )
7939
8229
  );
7940
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
8230
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
7941
8231
  () => props.builderContextSignal.rootState
7942
8232
  );
7943
8233
  function onUpdateFn_3() {
@@ -7949,14 +8239,14 @@ function EnableEditor(props) {
7949
8239
  onUpdateFn_3
7950
8240
  )
7951
8241
  );
7952
- const onUpdateFn_4_props_data = createMemo14(() => props.data);
8242
+ const onUpdateFn_4_props_data = createMemo15(() => props.data);
7953
8243
  function onUpdateFn_4() {
7954
8244
  if (props.data) {
7955
8245
  mergeNewRootState(props.data);
7956
8246
  }
7957
8247
  }
7958
8248
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
7959
- const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
8249
+ const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
7960
8250
  function onUpdateFn_5() {
7961
8251
  if (props.locale) {
7962
8252
  mergeNewRootState({
@@ -7965,7 +8255,7 @@ function EnableEditor(props) {
7965
8255
  }
7966
8256
  }
7967
8257
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
7968
- return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
8258
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
7969
8259
  class={getWrapperClassName(
7970
8260
  props.content?.testVariationId || props.content?.id
7971
8261
  )}
@@ -7978,14 +8268,14 @@ function EnableEditor(props) {
7978
8268
  {...showContentProps()}
7979
8269
  {...props.contentWrapperProps}
7980
8270
  component={ContentWrapper()}
7981
- >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
8271
+ >{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
7982
8272
  }
7983
8273
  var Enable_editor_default = EnableEditor;
7984
8274
 
7985
8275
  // src/components/content/components/styles.tsx
7986
- import { createSignal as createSignal15 } from "solid-js";
8276
+ import { createSignal as createSignal16 } from "solid-js";
7987
8277
  function ContentStyles(props) {
7988
- const [injectedStyles, setInjectedStyles] = createSignal15(
8278
+ const [injectedStyles, setInjectedStyles] = createSignal16(
7989
8279
  `
7990
8280
  ${getCss({
7991
8281
  cssCode: props.cssCode,
@@ -8042,7 +8332,7 @@ var getContentInitialValue = ({
8042
8332
 
8043
8333
  // src/components/content/content.tsx
8044
8334
  function ContentComponent(props) {
8045
- const [scriptStr, setScriptStr] = createSignal16(
8335
+ const [scriptStr, setScriptStr] = createSignal17(
8046
8336
  getUpdateVariantVisibilityScript({
8047
8337
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
8048
8338
  variationId: props.content?.testVariationId,
@@ -8050,7 +8340,7 @@ function ContentComponent(props) {
8050
8340
  contentId: props.content?.id
8051
8341
  })
8052
8342
  );
8053
- const [registeredComponents, setRegisteredComponents] = createSignal16(
8343
+ const [registeredComponents, setRegisteredComponents] = createSignal17(
8054
8344
  [
8055
8345
  ...getDefaultRegisteredComponents(),
8056
8346
  ...props.customComponents || []
@@ -8065,7 +8355,7 @@ function ContentComponent(props) {
8065
8355
  {}
8066
8356
  )
8067
8357
  );
8068
- const [builderContextSignal, setBuilderContextSignal] = createSignal16({
8358
+ const [builderContextSignal, setBuilderContextSignal] = createSignal17({
8069
8359
  content: getContentInitialValue({
8070
8360
  content: props.content,
8071
8361
  data: props.data
@@ -8123,16 +8413,16 @@ function ContentComponent(props) {
8123
8413
  setBuilderContextSignal
8124
8414
  }}
8125
8415
  >
8126
- <Show12 when={props.isSsrAbTest}><Inlined_script_default
8416
+ <Show13 when={props.isSsrAbTest}><Inlined_script_default
8127
8417
  id="builderio-variant-visibility"
8128
8418
  scriptStr={scriptStr()}
8129
- /></Show12>
8130
- <Show12 when={TARGET !== "reactNative"}><Styles_default
8419
+ /></Show13>
8420
+ <Show13 when={TARGET !== "reactNative"}><Styles_default
8131
8421
  isNestedRender={props.isNestedRender}
8132
8422
  contentId={builderContextSignal().content?.id}
8133
8423
  cssCode={builderContextSignal().content?.data?.cssCode}
8134
8424
  customFonts={builderContextSignal().content?.data?.customFonts}
8135
- /></Show12>
8425
+ /></Show13>
8136
8426
  <Blocks_default
8137
8427
  blocks={builderContextSignal().content?.data?.blocks}
8138
8428
  context={builderContextSignal()}
@@ -8145,13 +8435,13 @@ var Content_default = ContentComponent;
8145
8435
 
8146
8436
  // src/components/content-variants/content-variants.tsx
8147
8437
  function ContentVariants(props) {
8148
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
8438
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
8149
8439
  checkShouldRenderVariants({
8150
8440
  canTrack: getDefaultCanTrack(props.canTrack),
8151
8441
  content: props.content
8152
8442
  })
8153
8443
  );
8154
- const updateCookieAndStylesScriptStr = createMemo17(() => {
8444
+ const updateCookieAndStylesScriptStr = createMemo18(() => {
8155
8445
  return getUpdateCookieAndStylesScript(
8156
8446
  getVariants(props.content).map((value) => ({
8157
8447
  id: value.testVariationId,
@@ -8160,10 +8450,10 @@ function ContentVariants(props) {
8160
8450
  props.content?.id || ""
8161
8451
  );
8162
8452
  });
8163
- const hideVariantsStyleString = createMemo17(() => {
8453
+ const hideVariantsStyleString = createMemo18(() => {
8164
8454
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
8165
8455
  });
8166
- const defaultContent = createMemo17(() => {
8456
+ const defaultContent = createMemo18(() => {
8167
8457
  return shouldRenderVariants() ? {
8168
8458
  ...props.content,
8169
8459
  testVariationId: props.content?.id
@@ -8176,11 +8466,11 @@ function ContentVariants(props) {
8176
8466
  setShouldRenderVariants(false);
8177
8467
  });
8178
8468
  return <>
8179
- <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
8469
+ <Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
8180
8470
  id="builderio-init-variants-fns"
8181
8471
  scriptStr={getInitVariantsFnsScriptString()}
8182
- /></Show13>
8183
- <Show13 when={shouldRenderVariants()}>
8472
+ /></Show14>
8473
+ <Show14 when={shouldRenderVariants()}>
8184
8474
  <Inlined_styles_default
8185
8475
  id="builderio-variants"
8186
8476
  styles={hideVariantsStyleString()}
@@ -8189,7 +8479,7 @@ function ContentVariants(props) {
8189
8479
  id="builderio-variants-visibility"
8190
8480
  scriptStr={updateCookieAndStylesScriptStr()}
8191
8481
  />
8192
- <For8 each={getVariants(props.content)}>{(variant, _index) => {
8482
+ <For9 each={getVariants(props.content)}>{(variant, _index) => {
8193
8483
  const index = _index();
8194
8484
  return <Content_default
8195
8485
  isNestedRender={props.isNestedRender}
@@ -8213,8 +8503,8 @@ function ContentVariants(props) {
8213
8503
  contentWrapperProps={props.contentWrapperProps}
8214
8504
  trustedHosts={props.trustedHosts}
8215
8505
  />;
8216
- }}</For8>
8217
- </Show13>
8506
+ }}</For9>
8507
+ </Show14>
8218
8508
  <Content_default
8219
8509
  isNestedRender={props.isNestedRender}
8220
8510
  {...{}}
@@ -8267,14 +8557,14 @@ var fetchSymbolContent = async ({
8267
8557
 
8268
8558
  // src/blocks/symbol/symbol.tsx
8269
8559
  function Symbol2(props) {
8270
- const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
8271
- const blocksWrapper = createMemo18(() => {
8560
+ const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
8561
+ const blocksWrapper = createMemo19(() => {
8272
8562
  return "div";
8273
8563
  });
8274
- const contentWrapper = createMemo18(() => {
8564
+ const contentWrapper = createMemo19(() => {
8275
8565
  return "div";
8276
8566
  });
8277
- const className = createMemo18(() => {
8567
+ const className = createMemo19(() => {
8278
8568
  return [
8279
8569
  ...[props.attributes[getClassPropName()]],
8280
8570
  "builder-symbol",
@@ -8296,7 +8586,7 @@ function Symbol2(props) {
8296
8586
  }
8297
8587
  onMount5(() => {
8298
8588
  });
8299
- const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
8589
+ const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
8300
8590
  function onUpdateFn_0() {
8301
8591
  setContent();
8302
8592
  }