@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.
@@ -3623,6 +3623,9 @@ function getProcessedBlock({
3623
3623
  }
3624
3624
  }
3625
3625
 
3626
+ // src/functions/camel-to-kebab-case.ts
3627
+ var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
3628
+
3626
3629
  // src/components/block/animator.ts
3627
3630
  function throttle(func, wait, options = {}) {
3628
3631
  let context;
@@ -3673,7 +3676,6 @@ function assign(target, ..._args) {
3673
3676
  }
3674
3677
  return to;
3675
3678
  }
3676
- var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
3677
3679
  function bindAnimations(animations) {
3678
3680
  for (const animation of animations) {
3679
3681
  switch (animation.trigger) {
@@ -3725,7 +3727,7 @@ function triggerAnimation(animation) {
3725
3727
  element.style.transitionDelay = "0";
3726
3728
  assign(element.style, animation.steps[0].styles);
3727
3729
  setTimeout(() => {
3728
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
3730
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
3729
3731
  if (animation.delay) {
3730
3732
  element.style.transitionDelay = animation.delay + "s";
3731
3733
  }
@@ -3785,7 +3787,7 @@ function bindScrollInViewAnimation(animation) {
3785
3787
  }
3786
3788
  attachDefaultState();
3787
3789
  setTimeout(() => {
3788
- element.style.transition = `all ${animation.duration}s ${camelCaseToKebabCase(animation.easing)}`;
3790
+ element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
3789
3791
  if (animation.delay) {
3790
3792
  element.style.transitionDelay = animation.delay + "s";
3791
3793
  }
@@ -3798,9 +3800,6 @@ function bindScrollInViewAnimation(animation) {
3798
3800
  });
3799
3801
  }
3800
3802
 
3801
- // src/functions/camel-to-kebab-case.ts
3802
- var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
3803
-
3804
3803
  // src/helpers/css.ts
3805
3804
  var convertStyleMapToCSSArray = (style) => {
3806
3805
  const cssProps = Object.entries(style).map(([key, value]) => {
@@ -3927,10 +3926,10 @@ var getRepeatItemData = ({
3927
3926
  return repeatArray;
3928
3927
  };
3929
3928
  var shouldPassLinkComponent = (block) => {
3930
- return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
3929
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
3931
3930
  };
3932
3931
  var shouldPassRegisteredComponents = (block) => {
3933
- return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
3932
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
3934
3933
  };
3935
3934
 
3936
3935
  // src/components/block/components/block-styles.tsx
@@ -4059,7 +4058,7 @@ function BlockStyles(props) {
4059
4058
  className: `${className}:hover`,
4060
4059
  styles: {
4061
4060
  ...hoverStyles,
4062
- transition: `all ${hoverAnimation.duration}s ${camelCaseToKebabCase(
4061
+ transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(
4063
4062
  hoverAnimation.easing
4064
4063
  )}`,
4065
4064
  transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
@@ -4823,10 +4822,10 @@ function SectionComponent(props) {
4823
4822
  var section_default = SectionComponent;
4824
4823
 
4825
4824
  // src/blocks/symbol/symbol.tsx
4826
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
4825
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
4827
4826
 
4828
4827
  // src/components/content-variants/content-variants.tsx
4829
- import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
4828
+ import { Show as Show14, For as For9, onMount as onMount4, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
4830
4829
 
4831
4830
  // src/helpers/url.ts
4832
4831
  var getTopLevelDomain = (host) => {
@@ -5020,7 +5019,7 @@ var handleABTesting = async ({
5020
5019
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
5021
5020
 
5022
5021
  // src/components/content/content.tsx
5023
- import { Show as Show12, createSignal as createSignal16 } from "solid-js";
5022
+ import { Show as Show13, createSignal as createSignal17 } from "solid-js";
5024
5023
 
5025
5024
  // src/blocks/button/component-info.ts
5026
5025
  var componentInfo = {
@@ -5670,8 +5669,12 @@ function Tabs(props) {
5670
5669
  function activeTabContent(active) {
5671
5670
  return props.tabs && props.tabs[active].content;
5672
5671
  }
5673
- function getActiveTabStyle(index) {
5674
- return activeTab() === index ? props.activeTabStyle : {};
5672
+ function onClick(index) {
5673
+ if (index === activeTab() && props.collapsible) {
5674
+ setActiveTab(-1);
5675
+ } else {
5676
+ setActiveTab(index);
5677
+ }
5675
5678
  }
5676
5679
  return <div>
5677
5680
  <div
@@ -5687,14 +5690,10 @@ function Tabs(props) {
5687
5690
  return <span
5688
5691
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
5689
5692
  key={index}
5690
- style={getActiveTabStyle(index)}
5691
- onClick={(event) => {
5692
- if (index === activeTab() && props.collapsible) {
5693
- setActiveTab(-1);
5694
- } else {
5695
- setActiveTab(index);
5696
- }
5693
+ style={{
5694
+ ...activeTab() === index ? props.activeTabStyle : {}
5697
5695
  }}
5696
+ onClick={(event) => onClick(index)}
5698
5697
  ><Blocks_default
5699
5698
  parent={props.builderBlock.id}
5700
5699
  path={`component.options.tabs.${index}.label`}
@@ -5749,8 +5748,284 @@ function Text(props) {
5749
5748
  }
5750
5749
  var text_default = Text;
5751
5750
 
5752
- // src/blocks/custom-code/component-info.ts
5751
+ // src/blocks/accordion/accordion.tsx
5752
+ import { Show as Show9, For as For6, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
5753
+
5754
+ // src/blocks/accordion/helpers.ts
5755
+ var convertOrderNumberToString = (order) => {
5756
+ return order.toString();
5757
+ };
5758
+
5759
+ // src/blocks/accordion/accordion.tsx
5760
+ function Accordion(props) {
5761
+ const [open, setOpen] = createSignal10([]);
5762
+ const onlyOneAtATime = createMemo10(() => {
5763
+ return Boolean(props.grid || props.oneAtATime);
5764
+ });
5765
+ const accordionStyles = createMemo10(() => {
5766
+ const styles = {
5767
+ display: "flex",
5768
+ alignItems: "stretch",
5769
+ flexDirection: "column",
5770
+ ...props.grid && {
5771
+ flexDirection: "row",
5772
+ alignItems: "flex-start",
5773
+ flexWrap: "wrap"
5774
+ }
5775
+ };
5776
+ return Object.fromEntries(
5777
+ Object.entries(styles).map(([key, value]) => [
5778
+ camelToKebabCase(key),
5779
+ value
5780
+ ])
5781
+ );
5782
+ });
5783
+ const accordionTitleStyles = createMemo10(() => {
5784
+ const shared = {
5785
+ display: "flex",
5786
+ flexDirection: "column"
5787
+ };
5788
+ const styles = Object.fromEntries(
5789
+ Object.entries({
5790
+ ...shared,
5791
+ alignItems: "stretch",
5792
+ cursor: "pointer"
5793
+ }).map(([key, value]) => [camelToKebabCase(key), value])
5794
+ );
5795
+ return Object.fromEntries(
5796
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
5797
+ );
5798
+ });
5799
+ function getAccordionTitleClassName(index) {
5800
+ return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
5801
+ }
5802
+ function getAccordionDetailClassName(index) {
5803
+ return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
5804
+ }
5805
+ const openGridItemOrder = createMemo10(() => {
5806
+ let itemOrder = null;
5807
+ const getOpenGridItemPosition = props.grid && open().length;
5808
+ if (getOpenGridItemPosition && document) {
5809
+ const openItemIndex = open()[0];
5810
+ const openItem = document.querySelector(
5811
+ `.builder-accordion-title[data-index="${openItemIndex}"]`
5812
+ );
5813
+ let subjectItem = openItem;
5814
+ itemOrder = openItemIndex;
5815
+ if (subjectItem) {
5816
+ let prevItemRect = subjectItem.getBoundingClientRect();
5817
+ while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
5818
+ if (subjectItem) {
5819
+ if (subjectItem.classList.contains("builder-accordion-detail")) {
5820
+ continue;
5821
+ }
5822
+ const subjectItemRect = subjectItem.getBoundingClientRect();
5823
+ if (subjectItemRect.left > prevItemRect.left) {
5824
+ const index = parseInt(
5825
+ subjectItem.getAttribute("data-index") || "",
5826
+ 10
5827
+ );
5828
+ if (!isNaN(index)) {
5829
+ prevItemRect = subjectItemRect;
5830
+ itemOrder = index;
5831
+ }
5832
+ } else {
5833
+ break;
5834
+ }
5835
+ }
5836
+ }
5837
+ }
5838
+ }
5839
+ if (typeof itemOrder === "number") {
5840
+ itemOrder = itemOrder + 1;
5841
+ }
5842
+ return itemOrder;
5843
+ });
5844
+ const accordionDetailStyles = createMemo10(() => {
5845
+ const styles = {
5846
+ ...{
5847
+ order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
5848
+ },
5849
+ ...props.grid && {
5850
+ width: "100%"
5851
+ }
5852
+ };
5853
+ return Object.fromEntries(
5854
+ Object.entries(styles).filter(([_, value]) => value !== void 0)
5855
+ );
5856
+ });
5857
+ function onClick(index) {
5858
+ if (open().includes(index)) {
5859
+ setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
5860
+ } else {
5861
+ setOpen(onlyOneAtATime() ? [index] : open().concat(index));
5862
+ }
5863
+ }
5864
+ return <div class="builder-accordion" style={accordionStyles()}><For6 each={props.items}>{(item, _index) => {
5865
+ const index = _index();
5866
+ return <>
5867
+ <div
5868
+ class={getAccordionTitleClassName(index)}
5869
+ style={{
5870
+ ...accordionTitleStyles(),
5871
+ width: props.grid ? props.gridRowWidth : void 0,
5872
+ ...{
5873
+ order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
5874
+ }
5875
+ }}
5876
+ data-index={index}
5877
+ onClick={(event) => onClick(index)}
5878
+ ><Blocks_default
5879
+ blocks={item.title}
5880
+ path={`items.${index}.title`}
5881
+ parent={props.builderBlock.id}
5882
+ context={props.builderContext}
5883
+ registeredComponents={props.builderComponents}
5884
+ linkComponent={props.builderLinkComponent}
5885
+ /></div>
5886
+ <Show9 when={open().includes(index)}><div
5887
+ class={getAccordionDetailClassName(index)}
5888
+ style={accordionDetailStyles()}
5889
+ ><Blocks_default
5890
+ blocks={item.detail}
5891
+ path={`items.${index}.detail`}
5892
+ parent={props.builderBlock.id}
5893
+ context={props.builderContext}
5894
+ registeredComponents={props.builderComponents}
5895
+ linkComponent={props.builderLinkComponent}
5896
+ /></div></Show9>
5897
+ </>;
5898
+ }}</For6></div>;
5899
+ }
5900
+ var accordion_default = Accordion;
5901
+
5902
+ // src/blocks/accordion/component-info.ts
5903
+ var defaultTitle = {
5904
+ "@type": "@builder.io/sdk:Element",
5905
+ layerName: "Accordion item title",
5906
+ responsiveStyles: {
5907
+ large: {
5908
+ marginTop: "10px",
5909
+ position: "relative",
5910
+ display: "flex",
5911
+ alignItems: "stretch",
5912
+ flexDirection: "column",
5913
+ paddingBottom: "10px"
5914
+ }
5915
+ },
5916
+ children: [{
5917
+ "@type": "@builder.io/sdk:Element",
5918
+ responsiveStyles: {
5919
+ large: {
5920
+ textAlign: "left",
5921
+ display: "flex",
5922
+ flexDirection: "column"
5923
+ }
5924
+ },
5925
+ component: {
5926
+ name: "Text",
5927
+ options: {
5928
+ text: "I am an accordion title. Click me!"
5929
+ }
5930
+ }
5931
+ }]
5932
+ };
5933
+ var defaultDetail = {
5934
+ "@type": "@builder.io/sdk:Element",
5935
+ layerName: "Accordion item detail",
5936
+ responsiveStyles: {
5937
+ large: {
5938
+ position: "relative",
5939
+ display: "flex",
5940
+ alignItems: "stretch",
5941
+ flexDirection: "column",
5942
+ marginTop: "10px",
5943
+ paddingBottom: "10px"
5944
+ }
5945
+ },
5946
+ children: [{
5947
+ "@type": "@builder.io/sdk:Element",
5948
+ responsiveStyles: {
5949
+ large: {
5950
+ paddingTop: "50px",
5951
+ textAlign: "left",
5952
+ display: "flex",
5953
+ flexDirection: "column",
5954
+ paddingBottom: "50px"
5955
+ }
5956
+ },
5957
+ component: {
5958
+ name: "Text",
5959
+ options: {
5960
+ text: "I am an accordion detail, hello!"
5961
+ }
5962
+ }
5963
+ }]
5964
+ };
5753
5965
  var componentInfo10 = {
5966
+ name: "Builder:Accordion",
5967
+ canHaveChildren: true,
5968
+ image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
5969
+ defaultStyles: {
5970
+ display: "flex",
5971
+ flexDirection: "column",
5972
+ alignItems: "stretch"
5973
+ },
5974
+ inputs: [{
5975
+ name: "items",
5976
+ type: "list",
5977
+ broadcast: true,
5978
+ subFields: [{
5979
+ name: "title",
5980
+ type: "uiBlocks",
5981
+ hideFromUI: true,
5982
+ defaultValue: [defaultTitle]
5983
+ }, {
5984
+ name: "detail",
5985
+ type: "uiBlocks",
5986
+ hideFromUI: true,
5987
+ defaultValue: [defaultDetail]
5988
+ }],
5989
+ defaultValue: [{
5990
+ title: [defaultTitle],
5991
+ detail: [defaultDetail]
5992
+ }, {
5993
+ title: [defaultTitle],
5994
+ detail: [defaultDetail]
5995
+ }],
5996
+ showIf: (options) => !options.get("useChildrenForItems")
5997
+ }, {
5998
+ name: "oneAtATime",
5999
+ helperText: "Only allow opening one at a time (collapse all others when new item openned)",
6000
+ type: "boolean",
6001
+ defaultValue: false
6002
+ }, {
6003
+ name: "grid",
6004
+ helperText: "Display as a grid",
6005
+ type: "boolean",
6006
+ defaultValue: false
6007
+ }, {
6008
+ name: "gridRowWidth",
6009
+ helperText: "Display as a grid",
6010
+ type: "string",
6011
+ showIf: (options) => options.get("grid"),
6012
+ defaultValue: "25%"
6013
+ }, {
6014
+ name: "useChildrenForItems",
6015
+ type: "boolean",
6016
+ helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
6017
+ advanced: true,
6018
+ defaultValue: false,
6019
+ onChange: (options) => {
6020
+ if (options.get("useChildrenForItems") === true) {
6021
+ options.set("items", []);
6022
+ }
6023
+ }
6024
+ }]
6025
+ };
6026
+
6027
+ // src/blocks/custom-code/component-info.ts
6028
+ var componentInfo11 = {
5754
6029
  name: "Custom Code",
5755
6030
  static: true,
5756
6031
  requiredPermissions: ["editCode"],
@@ -5775,10 +6050,10 @@ var componentInfo10 = {
5775
6050
  };
5776
6051
 
5777
6052
  // src/blocks/custom-code/custom-code.tsx
5778
- import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
6053
+ import { onMount as onMount2, createSignal as createSignal11 } from "solid-js";
5779
6054
  function CustomCode(props) {
5780
- const [scriptsInserted, setScriptsInserted] = createSignal10([]);
5781
- const [scriptsRun, setScriptsRun] = createSignal10([]);
6055
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
6056
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
5782
6057
  let elementRef;
5783
6058
  onMount2(() => {
5784
6059
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -5821,7 +6096,7 @@ function CustomCode(props) {
5821
6096
  var custom_code_default = CustomCode;
5822
6097
 
5823
6098
  // src/blocks/embed/component-info.ts
5824
- var componentInfo11 = {
6099
+ var componentInfo12 = {
5825
6100
  name: "Embed",
5826
6101
  static: true,
5827
6102
  inputs: [{
@@ -5859,7 +6134,7 @@ var componentInfo11 = {
5859
6134
  };
5860
6135
 
5861
6136
  // src/blocks/embed/embed.tsx
5862
- import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
6137
+ import { on, createEffect, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
5863
6138
 
5864
6139
  // src/blocks/embed/helpers.ts
5865
6140
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -5867,9 +6142,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
5867
6142
 
5868
6143
  // src/blocks/embed/embed.tsx
5869
6144
  function Embed(props) {
5870
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
5871
- const [scriptsRun, setScriptsRun] = createSignal11([]);
5872
- const [ranInitFn, setRanInitFn] = createSignal11(false);
6145
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
6146
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
6147
+ const [ranInitFn, setRanInitFn] = createSignal12(false);
5873
6148
  function findAndRunScripts() {
5874
6149
  if (!elem || !elem.getElementsByTagName)
5875
6150
  return;
@@ -5892,8 +6167,8 @@ function Embed(props) {
5892
6167
  }
5893
6168
  }
5894
6169
  let elem;
5895
- const onUpdateFn_0_elem = createMemo11(() => elem);
5896
- const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
6170
+ const onUpdateFn_0_elem = createMemo12(() => elem);
6171
+ const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
5897
6172
  function onUpdateFn_0() {
5898
6173
  if (elem && !ranInitFn()) {
5899
6174
  setRanInitFn(true);
@@ -5908,7 +6183,7 @@ function Embed(props) {
5908
6183
  var embed_default = Embed;
5909
6184
 
5910
6185
  // src/blocks/form/form/component-info.ts
5911
- var componentInfo12 = {
6186
+ var componentInfo13 = {
5912
6187
  name: "Form:Form",
5913
6188
  // editableTags: ['builder-form-error']
5914
6189
  defaults: {
@@ -6142,7 +6417,7 @@ var componentInfo12 = {
6142
6417
  };
6143
6418
 
6144
6419
  // src/blocks/form/form/form.tsx
6145
- import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
6420
+ import { Show as Show10, For as For7, createSignal as createSignal13 } from "solid-js";
6146
6421
  import { css as css4 } from "solid-styled-components";
6147
6422
 
6148
6423
  // src/functions/get-env.ts
@@ -6160,9 +6435,9 @@ var get = (obj, path, defaultValue) => {
6160
6435
 
6161
6436
  // src/blocks/form/form/form.tsx
6162
6437
  function FormComponent(props) {
6163
- const [formState, setFormState] = createSignal12("unsubmitted");
6164
- const [responseData, setResponseData] = createSignal12(null);
6165
- const [formErrorMessage, setFormErrorMessage] = createSignal12("");
6438
+ const [formState, setFormState] = createSignal13("unsubmitted");
6439
+ const [responseData, setResponseData] = createSignal13(null);
6440
+ const [formErrorMessage, setFormErrorMessage] = createSignal13("");
6166
6441
  function mergeNewRootState(newData) {
6167
6442
  const combinedState = {
6168
6443
  ...props.builderContext.rootState,
@@ -6358,7 +6633,7 @@ function FormComponent(props) {
6358
6633
  {...{}}
6359
6634
  {...props.attributes}
6360
6635
  >
6361
- <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
6636
+ <Show10 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
6362
6637
  const idx = _index();
6363
6638
  return <Block_default
6364
6639
  key={`form-block-${idx}`}
@@ -6367,35 +6642,35 @@ function FormComponent(props) {
6367
6642
  registeredComponents={props.builderComponents}
6368
6643
  linkComponent={props.builderLinkComponent}
6369
6644
  />;
6370
- }}</For6></Show9>
6371
- <Show9 when={submissionState() === "error"}><Blocks_default
6645
+ }}</For7></Show10>
6646
+ <Show10 when={submissionState() === "error"}><Blocks_default
6372
6647
  path="errorMessage"
6373
6648
  blocks={props.errorMessage}
6374
6649
  context={props.builderContext}
6375
- /></Show9>
6376
- <Show9 when={submissionState() === "sending"}><Blocks_default
6650
+ /></Show10>
6651
+ <Show10 when={submissionState() === "sending"}><Blocks_default
6377
6652
  path="sendingMessage"
6378
6653
  blocks={props.sendingMessage}
6379
6654
  context={props.builderContext}
6380
- /></Show9>
6381
- <Show9 when={submissionState() === "error" && responseData()}><pre
6655
+ /></Show10>
6656
+ <Show10 when={submissionState() === "error" && responseData()}><pre
6382
6657
  class={"builder-form-error-text " + css4({
6383
6658
  padding: "10px",
6384
6659
  color: "red",
6385
6660
  textAlign: "center"
6386
6661
  })}
6387
- >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
6388
- <Show9 when={submissionState() === "success"}><Blocks_default
6662
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show10>
6663
+ <Show10 when={submissionState() === "success"}><Blocks_default
6389
6664
  path="successMessage"
6390
6665
  blocks={props.successMessage}
6391
6666
  context={props.builderContext}
6392
- /></Show9>
6667
+ /></Show10>
6393
6668
  </form>;
6394
6669
  }
6395
6670
  var form_default = FormComponent;
6396
6671
 
6397
6672
  // src/blocks/form/input/component-info.ts
6398
- var componentInfo13 = {
6673
+ var componentInfo14 = {
6399
6674
  name: "Form:Input",
6400
6675
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
6401
6676
  inputs: [
@@ -6465,7 +6740,7 @@ function FormInputComponent(props) {
6465
6740
  var input_default = FormInputComponent;
6466
6741
 
6467
6742
  // src/blocks/form/select/component-info.ts
6468
- var componentInfo14 = {
6743
+ var componentInfo15 = {
6469
6744
  name: "Form:Select",
6470
6745
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
6471
6746
  defaultStyles: {
@@ -6510,7 +6785,7 @@ var componentInfo14 = {
6510
6785
  };
6511
6786
 
6512
6787
  // src/blocks/form/select/select.tsx
6513
- import { For as For7 } from "solid-js";
6788
+ import { For as For8 } from "solid-js";
6514
6789
  function SelectComponent(props) {
6515
6790
  return <select
6516
6791
  {...{}}
@@ -6519,15 +6794,15 @@ function SelectComponent(props) {
6519
6794
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
6520
6795
  defaultValue={props.defaultValue}
6521
6796
  name={props.name}
6522
- ><For7 each={props.options}>{(option, _index) => {
6797
+ ><For8 each={props.options}>{(option, _index) => {
6523
6798
  const index = _index();
6524
6799
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
6525
- }}</For7></select>;
6800
+ }}</For8></select>;
6526
6801
  }
6527
6802
  var select_default = SelectComponent;
6528
6803
 
6529
6804
  // src/blocks/form/submit-button/component-info.ts
6530
- var componentInfo15 = {
6805
+ var componentInfo16 = {
6531
6806
  name: "Form:SubmitButton",
6532
6807
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
6533
6808
  defaultStyles: {
@@ -6561,7 +6836,7 @@ function SubmitButton(props) {
6561
6836
  var submit_button_default = SubmitButton;
6562
6837
 
6563
6838
  // src/blocks/img/component-info.ts
6564
- var componentInfo16 = {
6839
+ var componentInfo17 = {
6565
6840
  // friendlyName?
6566
6841
  name: "Raw:Img",
6567
6842
  hideFromInsertMenu: true,
@@ -6594,7 +6869,7 @@ function ImgComponent(props) {
6594
6869
  var img_default = ImgComponent;
6595
6870
 
6596
6871
  // src/blocks/video/component-info.ts
6597
- var componentInfo17 = {
6872
+ var componentInfo18 = {
6598
6873
  name: "Video",
6599
6874
  canHaveChildren: true,
6600
6875
  defaultStyles: {
@@ -6678,9 +6953,9 @@ var componentInfo17 = {
6678
6953
  };
6679
6954
 
6680
6955
  // src/blocks/video/video.tsx
6681
- import { Show as Show10, createMemo as createMemo13 } from "solid-js";
6956
+ import { Show as Show11, createMemo as createMemo14 } from "solid-js";
6682
6957
  function Video(props) {
6683
- const videoProps = createMemo13(() => {
6958
+ const videoProps = createMemo14(() => {
6684
6959
  return {
6685
6960
  ...props.autoPlay === true ? {
6686
6961
  autoPlay: true
@@ -6699,7 +6974,7 @@ function Video(props) {
6699
6974
  } : {}
6700
6975
  };
6701
6976
  });
6702
- const spreadProps = createMemo13(() => {
6977
+ const spreadProps = createMemo14(() => {
6703
6978
  return {
6704
6979
  ...videoProps()
6705
6980
  };
@@ -6729,8 +7004,8 @@ function Video(props) {
6729
7004
  }}
6730
7005
  src={props.video || "no-src"}
6731
7006
  poster={props.posterImage}
6732
- ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
6733
- <Show10
7007
+ ><Show11 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show11></video>
7008
+ <Show11
6734
7009
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
6735
7010
  ><div
6736
7011
  style={{
@@ -6739,15 +7014,15 @@ function Video(props) {
6739
7014
  "pointer-events": "none",
6740
7015
  "font-size": "0px"
6741
7016
  }}
6742
- /></Show10>
6743
- <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
7017
+ /></Show11>
7018
+ <Show11 when={props.builderBlock?.children?.length && props.fitContent}><div
6744
7019
  style={{
6745
7020
  display: "flex",
6746
7021
  "flex-direction": "column",
6747
7022
  "align-items": "stretch"
6748
7023
  }}
6749
- >{props.children}</div></Show10>
6750
- <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
7024
+ >{props.children}</div></Show11>
7025
+ <Show11 when={props.builderBlock?.children?.length && !props.fitContent}><div
6751
7026
  style={{
6752
7027
  "pointer-events": "none",
6753
7028
  display: "flex",
@@ -6759,7 +7034,7 @@ function Video(props) {
6759
7034
  width: "100%",
6760
7035
  height: "100%"
6761
7036
  }}
6762
- >{props.children}</div></Show10>
7037
+ >{props.children}</div></Show11>
6763
7038
  </div>;
6764
7039
  }
6765
7040
  var video_default = Video;
@@ -6767,28 +7042,28 @@ var video_default = Video;
6767
7042
  // src/constants/extra-components.ts
6768
7043
  var getExtraComponents = () => [{
6769
7044
  component: custom_code_default,
6770
- ...componentInfo10
7045
+ ...componentInfo11
6771
7046
  }, {
6772
7047
  component: embed_default,
6773
- ...componentInfo11
7048
+ ...componentInfo12
6774
7049
  }, ...TARGET === "rsc" ? [] : [{
6775
7050
  component: form_default,
6776
- ...componentInfo12
7051
+ ...componentInfo13
6777
7052
  }, {
6778
7053
  component: input_default,
6779
- ...componentInfo13
7054
+ ...componentInfo14
6780
7055
  }, {
6781
7056
  component: submit_button_default,
6782
- ...componentInfo15
7057
+ ...componentInfo16
6783
7058
  }, {
6784
7059
  component: select_default,
6785
- ...componentInfo14
7060
+ ...componentInfo15
6786
7061
  }], {
6787
7062
  component: img_default,
6788
- ...componentInfo16
7063
+ ...componentInfo17
6789
7064
  }, {
6790
7065
  component: video_default,
6791
- ...componentInfo17
7066
+ ...componentInfo18
6792
7067
  }];
6793
7068
 
6794
7069
  // src/constants/builder-registered-components.ts
@@ -6819,6 +7094,9 @@ var getDefaultRegisteredComponents = () => [{
6819
7094
  }, ...TARGET === "rsc" ? [] : [{
6820
7095
  component: tabs_default,
6821
7096
  ...componentInfo8
7097
+ }, {
7098
+ component: accordion_default,
7099
+ ...componentInfo10
6822
7100
  }], ...getExtraComponents()];
6823
7101
 
6824
7102
  // src/functions/register-component.ts
@@ -6897,12 +7175,12 @@ var Inlined_script_default = InlinedScript;
6897
7175
 
6898
7176
  // src/components/content/components/enable-editor.tsx
6899
7177
  import {
6900
- Show as Show11,
7178
+ Show as Show12,
6901
7179
  onMount as onMount3,
6902
7180
  on as on2,
6903
7181
  createEffect as createEffect2,
6904
- createMemo as createMemo14,
6905
- createSignal as createSignal14
7182
+ createMemo as createMemo15,
7183
+ createSignal as createSignal15
6906
7184
  } from "solid-js";
6907
7185
  import { Dynamic as Dynamic5 } from "solid-js/web";
6908
7186
 
@@ -6953,6 +7231,18 @@ function flatten(object, path = null, separator = ".") {
6953
7231
  };
6954
7232
  }, {});
6955
7233
  }
7234
+ function flattenMongoQuery(obj, _current, _res = {}) {
7235
+ for (const key in obj) {
7236
+ const value = obj[key];
7237
+ const newKey = _current ? _current + "." + key : key;
7238
+ if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$"))) {
7239
+ flattenMongoQuery(value, newKey, _res);
7240
+ } else {
7241
+ _res[newKey] = value;
7242
+ }
7243
+ }
7244
+ return _res;
7245
+ }
6956
7246
 
6957
7247
  // src/types/api-version.ts
6958
7248
  var DEFAULT_API_VERSION = "v3";
@@ -7054,7 +7344,7 @@ var generateContentUrl = (options) => {
7054
7344
  url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
7055
7345
  }
7056
7346
  if (query) {
7057
- const flattened2 = flatten({
7347
+ const flattened2 = flattenMongoQuery({
7058
7348
  query
7059
7349
  });
7060
7350
  for (const key in flattened2) {
@@ -7385,7 +7675,7 @@ function isFromTrustedHost(trustedHosts, e) {
7385
7675
  }
7386
7676
 
7387
7677
  // src/constants/sdk-version.ts
7388
- var SDK_VERSION = "1.0.26";
7678
+ var SDK_VERSION = "1.0.28";
7389
7679
 
7390
7680
  // src/functions/register.ts
7391
7681
  var registry = {};
@@ -7662,12 +7952,12 @@ var getWrapperClassName = (variationId) => {
7662
7952
 
7663
7953
  // src/components/content/components/enable-editor.tsx
7664
7954
  function EnableEditor(props) {
7665
- const [ContentWrapper, setContentWrapper] = createSignal14(
7955
+ const [ContentWrapper, setContentWrapper] = createSignal15(
7666
7956
  props.contentWrapper || "div"
7667
7957
  );
7668
- const [httpReqsData, setHttpReqsData] = createSignal14({});
7669
- const [httpReqsPending, setHttpReqsPending] = createSignal14({});
7670
- const [clicked, setClicked] = createSignal14(false);
7958
+ const [httpReqsData, setHttpReqsData] = createSignal15({});
7959
+ const [httpReqsPending, setHttpReqsPending] = createSignal15({});
7960
+ const [clicked, setClicked] = createSignal15(false);
7671
7961
  function mergeNewRootState(newData) {
7672
7962
  const combinedState = {
7673
7963
  ...props.builderContextSignal.rootState,
@@ -7701,7 +7991,7 @@ function EnableEditor(props) {
7701
7991
  content: newContentValue
7702
7992
  }));
7703
7993
  }
7704
- const showContentProps = createMemo14(() => {
7994
+ const showContentProps = createMemo15(() => {
7705
7995
  return props.showContent ? {} : {
7706
7996
  hidden: true,
7707
7997
  "aria-hidden": true
@@ -7884,21 +8174,21 @@ function EnableEditor(props) {
7884
8174
  onMount3(() => {
7885
8175
  if (!props.apiKey) {
7886
8176
  logger.error(
7887
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
8177
+ "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
7888
8178
  );
7889
8179
  }
7890
8180
  evaluateJsCode();
7891
8181
  runHttpRequests();
7892
8182
  emitStateUpdate();
7893
8183
  });
7894
- const onUpdateFn_0_props_content = createMemo14(() => props.content);
8184
+ const onUpdateFn_0_props_content = createMemo15(() => props.content);
7895
8185
  function onUpdateFn_0() {
7896
8186
  if (props.content) {
7897
8187
  mergeNewContent(props.content);
7898
8188
  }
7899
8189
  }
7900
8190
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
7901
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
8191
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo15(() => props.builderContextSignal.content?.data?.jsCode);
7902
8192
  function onUpdateFn_1() {
7903
8193
  evaluateJsCode();
7904
8194
  }
@@ -7908,7 +8198,7 @@ function EnableEditor(props) {
7908
8198
  onUpdateFn_1
7909
8199
  )
7910
8200
  );
7911
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
8201
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo15(() => props.builderContextSignal.content?.data?.httpRequests);
7912
8202
  function onUpdateFn_2() {
7913
8203
  runHttpRequests();
7914
8204
  }
@@ -7920,7 +8210,7 @@ function EnableEditor(props) {
7920
8210
  onUpdateFn_2
7921
8211
  )
7922
8212
  );
7923
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
8213
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo15(
7924
8214
  () => props.builderContextSignal.rootState
7925
8215
  );
7926
8216
  function onUpdateFn_3() {
@@ -7932,14 +8222,14 @@ function EnableEditor(props) {
7932
8222
  onUpdateFn_3
7933
8223
  )
7934
8224
  );
7935
- const onUpdateFn_4_props_data = createMemo14(() => props.data);
8225
+ const onUpdateFn_4_props_data = createMemo15(() => props.data);
7936
8226
  function onUpdateFn_4() {
7937
8227
  if (props.data) {
7938
8228
  mergeNewRootState(props.data);
7939
8229
  }
7940
8230
  }
7941
8231
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
7942
- const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
8232
+ const onUpdateFn_5_props_locale = createMemo15(() => props.locale);
7943
8233
  function onUpdateFn_5() {
7944
8234
  if (props.locale) {
7945
8235
  mergeNewRootState({
@@ -7948,7 +8238,7 @@ function EnableEditor(props) {
7948
8238
  }
7949
8239
  }
7950
8240
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
7951
- return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
8241
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show12 when={props.builderContextSignal.content}><Dynamic5
7952
8242
  class={getWrapperClassName(
7953
8243
  props.content?.testVariationId || props.content?.id
7954
8244
  )}
@@ -7961,14 +8251,14 @@ function EnableEditor(props) {
7961
8251
  {...showContentProps()}
7962
8252
  {...props.contentWrapperProps}
7963
8253
  component={ContentWrapper()}
7964
- >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
8254
+ >{props.children}</Dynamic5></Show12></builder_context_default.Provider>;
7965
8255
  }
7966
8256
  var Enable_editor_default = EnableEditor;
7967
8257
 
7968
8258
  // src/components/content/components/styles.tsx
7969
- import { createSignal as createSignal15 } from "solid-js";
8259
+ import { createSignal as createSignal16 } from "solid-js";
7970
8260
  function ContentStyles(props) {
7971
- const [injectedStyles, setInjectedStyles] = createSignal15(
8261
+ const [injectedStyles, setInjectedStyles] = createSignal16(
7972
8262
  `
7973
8263
  ${getCss({
7974
8264
  cssCode: props.cssCode,
@@ -8025,7 +8315,7 @@ var getContentInitialValue = ({
8025
8315
 
8026
8316
  // src/components/content/content.tsx
8027
8317
  function ContentComponent(props) {
8028
- const [scriptStr, setScriptStr] = createSignal16(
8318
+ const [scriptStr, setScriptStr] = createSignal17(
8029
8319
  getUpdateVariantVisibilityScript({
8030
8320
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
8031
8321
  variationId: props.content?.testVariationId,
@@ -8033,7 +8323,7 @@ function ContentComponent(props) {
8033
8323
  contentId: props.content?.id
8034
8324
  })
8035
8325
  );
8036
- const [registeredComponents, setRegisteredComponents] = createSignal16(
8326
+ const [registeredComponents, setRegisteredComponents] = createSignal17(
8037
8327
  [
8038
8328
  ...getDefaultRegisteredComponents(),
8039
8329
  ...props.customComponents || []
@@ -8048,7 +8338,7 @@ function ContentComponent(props) {
8048
8338
  {}
8049
8339
  )
8050
8340
  );
8051
- const [builderContextSignal, setBuilderContextSignal] = createSignal16({
8341
+ const [builderContextSignal, setBuilderContextSignal] = createSignal17({
8052
8342
  content: getContentInitialValue({
8053
8343
  content: props.content,
8054
8344
  data: props.data
@@ -8106,16 +8396,16 @@ function ContentComponent(props) {
8106
8396
  setBuilderContextSignal
8107
8397
  }}
8108
8398
  >
8109
- <Show12 when={props.isSsrAbTest}><Inlined_script_default
8399
+ <Show13 when={props.isSsrAbTest}><Inlined_script_default
8110
8400
  id="builderio-variant-visibility"
8111
8401
  scriptStr={scriptStr()}
8112
- /></Show12>
8113
- <Show12 when={TARGET !== "reactNative"}><Styles_default
8402
+ /></Show13>
8403
+ <Show13 when={TARGET !== "reactNative"}><Styles_default
8114
8404
  isNestedRender={props.isNestedRender}
8115
8405
  contentId={builderContextSignal().content?.id}
8116
8406
  cssCode={builderContextSignal().content?.data?.cssCode}
8117
8407
  customFonts={builderContextSignal().content?.data?.customFonts}
8118
- /></Show12>
8408
+ /></Show13>
8119
8409
  <Blocks_default
8120
8410
  blocks={builderContextSignal().content?.data?.blocks}
8121
8411
  context={builderContextSignal()}
@@ -8128,13 +8418,13 @@ var Content_default = ContentComponent;
8128
8418
 
8129
8419
  // src/components/content-variants/content-variants.tsx
8130
8420
  function ContentVariants(props) {
8131
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
8421
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
8132
8422
  checkShouldRenderVariants({
8133
8423
  canTrack: getDefaultCanTrack(props.canTrack),
8134
8424
  content: props.content
8135
8425
  })
8136
8426
  );
8137
- const updateCookieAndStylesScriptStr = createMemo17(() => {
8427
+ const updateCookieAndStylesScriptStr = createMemo18(() => {
8138
8428
  return getUpdateCookieAndStylesScript(
8139
8429
  getVariants(props.content).map((value) => ({
8140
8430
  id: value.testVariationId,
@@ -8143,10 +8433,10 @@ function ContentVariants(props) {
8143
8433
  props.content?.id || ""
8144
8434
  );
8145
8435
  });
8146
- const hideVariantsStyleString = createMemo17(() => {
8436
+ const hideVariantsStyleString = createMemo18(() => {
8147
8437
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
8148
8438
  });
8149
- const defaultContent = createMemo17(() => {
8439
+ const defaultContent = createMemo18(() => {
8150
8440
  return shouldRenderVariants() ? {
8151
8441
  ...props.content,
8152
8442
  testVariationId: props.content?.id
@@ -8159,11 +8449,11 @@ function ContentVariants(props) {
8159
8449
  setShouldRenderVariants(false);
8160
8450
  });
8161
8451
  return <>
8162
- <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
8452
+ <Show14 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
8163
8453
  id="builderio-init-variants-fns"
8164
8454
  scriptStr={getInitVariantsFnsScriptString()}
8165
- /></Show13>
8166
- <Show13 when={shouldRenderVariants()}>
8455
+ /></Show14>
8456
+ <Show14 when={shouldRenderVariants()}>
8167
8457
  <Inlined_styles_default
8168
8458
  id="builderio-variants"
8169
8459
  styles={hideVariantsStyleString()}
@@ -8172,7 +8462,7 @@ function ContentVariants(props) {
8172
8462
  id="builderio-variants-visibility"
8173
8463
  scriptStr={updateCookieAndStylesScriptStr()}
8174
8464
  />
8175
- <For8 each={getVariants(props.content)}>{(variant, _index) => {
8465
+ <For9 each={getVariants(props.content)}>{(variant, _index) => {
8176
8466
  const index = _index();
8177
8467
  return <Content_default
8178
8468
  isNestedRender={props.isNestedRender}
@@ -8196,8 +8486,8 @@ function ContentVariants(props) {
8196
8486
  contentWrapperProps={props.contentWrapperProps}
8197
8487
  trustedHosts={props.trustedHosts}
8198
8488
  />;
8199
- }}</For8>
8200
- </Show13>
8489
+ }}</For9>
8490
+ </Show14>
8201
8491
  <Content_default
8202
8492
  isNestedRender={props.isNestedRender}
8203
8493
  {...{}}
@@ -8250,14 +8540,14 @@ var fetchSymbolContent = async ({
8250
8540
 
8251
8541
  // src/blocks/symbol/symbol.tsx
8252
8542
  function Symbol2(props) {
8253
- const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
8254
- const blocksWrapper = createMemo18(() => {
8543
+ const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
8544
+ const blocksWrapper = createMemo19(() => {
8255
8545
  return "div";
8256
8546
  });
8257
- const contentWrapper = createMemo18(() => {
8547
+ const contentWrapper = createMemo19(() => {
8258
8548
  return "div";
8259
8549
  });
8260
- const className = createMemo18(() => {
8550
+ const className = createMemo19(() => {
8261
8551
  return [
8262
8552
  ...[props.attributes[getClassPropName()]],
8263
8553
  "builder-symbol",
@@ -8279,7 +8569,7 @@ function Symbol2(props) {
8279
8569
  }
8280
8570
  onMount5(() => {
8281
8571
  });
8282
- const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
8572
+ const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
8283
8573
  function onUpdateFn_0() {
8284
8574
  setContent();
8285
8575
  }