@builder.io/sdk-solid 1.0.23 → 1.0.25

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
@@ -54,14 +54,15 @@ var getClassPropName = () => {
54
54
  case "vue":
55
55
  case "solid":
56
56
  case "qwik":
57
+ case "angular":
57
58
  return "class";
58
59
  }
59
60
  };
60
61
 
61
62
  // src/blocks/button/button.tsx
62
63
  function Button(props) {
63
- return <Dynamic_renderer_default
64
- attributes={{
64
+ function attrs() {
65
+ return {
65
66
  ...props.attributes,
66
67
  [getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
67
68
  ...props.link ? {
@@ -71,7 +72,10 @@ function Button(props) {
71
72
  } : {
72
73
  role: "button"
73
74
  }
74
- }}
75
+ };
76
+ }
77
+ return <Dynamic_renderer_default
78
+ attributes={attrs()}
75
79
  TagName={props.link ? props.builderLinkComponent || "a" : "button"}
76
80
  actionAttributes={{}}
77
81
  >{props.text}</Dynamic_renderer_default>;
@@ -79,7 +83,7 @@ function Button(props) {
79
83
  var button_default = Button;
80
84
 
81
85
  // src/blocks/columns/columns.tsx
82
- import { Show as Show6, For as For4, createSignal as createSignal6, createMemo as createMemo6 } from "solid-js";
86
+ import { Show as Show6, For as For4, createSignal as createSignal7 } from "solid-js";
83
87
  import { css as css2 } from "solid-styled-components";
84
88
 
85
89
  // src/components/blocks/blocks.tsx
@@ -107,7 +111,7 @@ import { createContext as createContext2 } from "solid-js";
107
111
  var components_context_default = createContext2({ registeredComponents: {} });
108
112
 
109
113
  // src/components/block/block.tsx
110
- import { Show as Show4, For as For2, onMount, createMemo as createMemo4 } from "solid-js";
114
+ import { Show as Show4, For as For2, onMount, createMemo as createMemo5 } from "solid-js";
111
115
 
112
116
  // src/functions/get-block-component-options.ts
113
117
  function getBlockComponentOptions(block) {
@@ -3852,6 +3856,7 @@ function mapStyleObjToStrIfNeeded(style) {
3852
3856
  case "svelte":
3853
3857
  case "vue":
3854
3858
  case "solid":
3859
+ case "angular":
3855
3860
  return convertStyleMapToCSSArray(style).join(" ");
3856
3861
  case "qwik":
3857
3862
  case "reactNative":
@@ -3927,6 +3932,12 @@ var getRepeatItemData = ({
3927
3932
  }));
3928
3933
  return repeatArray;
3929
3934
  };
3935
+ var shouldPassLinkComponent = (block) => {
3936
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
3937
+ };
3938
+ var shouldPassRegisteredComponents = (block) => {
3939
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
3940
+ };
3930
3941
 
3931
3942
  // src/components/block/components/block-styles.tsx
3932
3943
  import { Show as Show2, createMemo } from "solid-js";
@@ -4170,15 +4181,15 @@ function BlockWrapper(props) {
4170
4181
  var Block_wrapper_default = BlockWrapper;
4171
4182
 
4172
4183
  // src/components/block/components/component-ref/component-ref.tsx
4173
- import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
4184
+ import { Show as Show3, For, createSignal as createSignal3 } from "solid-js";
4174
4185
  import { Dynamic as Dynamic3 } from "solid-js/web";
4175
4186
 
4176
4187
  // src/components/block/components/interactive-element.tsx
4188
+ import { createMemo as createMemo2 } from "solid-js";
4177
4189
  import { Dynamic as Dynamic2 } from "solid-js/web";
4178
4190
  function InteractiveElement(props) {
4179
- return <Dynamic2
4180
- {...props.wrapperProps}
4181
- attributes={props.includeBlockProps ? {
4191
+ const attributes = createMemo2(() => {
4192
+ return props.includeBlockProps ? {
4182
4193
  ...getBlockProperties({
4183
4194
  block: props.block,
4184
4195
  context: props.context
@@ -4190,7 +4201,11 @@ function InteractiveElement(props) {
4190
4201
  localState: props.context.localState,
4191
4202
  context: props.context.context
4192
4203
  })
4193
- } : {}}
4204
+ } : {};
4205
+ });
4206
+ return <Dynamic2
4207
+ {...props.wrapperProps}
4208
+ attributes={attributes()}
4194
4209
  component={props.Wrapper}
4195
4210
  >{props.children}</Dynamic2>;
4196
4211
  }
@@ -4231,7 +4246,7 @@ var getWrapperProps = ({
4231
4246
 
4232
4247
  // src/components/block/components/component-ref/component-ref.tsx
4233
4248
  function ComponentRef(props) {
4234
- const [Wrapper, setWrapper] = createSignal2(
4249
+ const [Wrapper, setWrapper] = createSignal3(
4235
4250
  props.isInteractive ? interactive_element_default : props.componentRef
4236
4251
  );
4237
4252
  return <Show3 when={props.componentRef}><Dynamic3
@@ -4260,9 +4275,9 @@ function ComponentRef(props) {
4260
4275
  var Component_ref_default = ComponentRef;
4261
4276
 
4262
4277
  // src/components/block/components/repeated-block.tsx
4263
- import { createSignal as createSignal3 } from "solid-js";
4278
+ import { createSignal as createSignal4 } from "solid-js";
4264
4279
  function RepeatedBlock(props) {
4265
- const [store, setStore] = createSignal3(props.repeatContext);
4280
+ const [store, setStore] = createSignal4(props.repeatContext);
4266
4281
  return <builder_context_default.Provider value={store()}><Block_default
4267
4282
  block={props.block}
4268
4283
  context={store()}
@@ -4274,20 +4289,20 @@ var Repeated_block_default = RepeatedBlock;
4274
4289
 
4275
4290
  // src/components/block/block.tsx
4276
4291
  function Block(props) {
4277
- const blockComponent = createMemo4(() => {
4292
+ const blockComponent = createMemo5(() => {
4278
4293
  return getComponent({
4279
4294
  block: props.block,
4280
4295
  context: props.context,
4281
4296
  registeredComponents: props.registeredComponents
4282
4297
  });
4283
4298
  });
4284
- const repeatItem = createMemo4(() => {
4299
+ const repeatItem = createMemo5(() => {
4285
4300
  return getRepeatItemData({
4286
4301
  block: props.block,
4287
4302
  context: props.context
4288
4303
  });
4289
4304
  });
4290
- const processedBlock = createMemo4(() => {
4305
+ const processedBlock = createMemo5(() => {
4291
4306
  return props.block.repeat?.collection ? props.block : getProcessedBlock({
4292
4307
  block: props.block,
4293
4308
  localState: props.context.localState,
@@ -4297,14 +4312,14 @@ function Block(props) {
4297
4312
  shouldEvaluateBindings: true
4298
4313
  });
4299
4314
  });
4300
- const Tag = createMemo4(() => {
4315
+ const Tag = createMemo5(() => {
4301
4316
  const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
4302
4317
  if (shouldUseLink) {
4303
4318
  return props.linkComponent || "a";
4304
4319
  }
4305
4320
  return props.block.tagName || "div";
4306
4321
  });
4307
- const canShowBlock = createMemo4(() => {
4322
+ const canShowBlock = createMemo5(() => {
4308
4323
  if (props.block.repeat?.collection) {
4309
4324
  if (repeatItem()?.length)
4310
4325
  return true;
@@ -4314,21 +4329,21 @@ function Block(props) {
4314
4329
  const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
4315
4330
  return shouldShow && !shouldHide;
4316
4331
  });
4317
- const childrenWithoutParentComponent = createMemo4(() => {
4332
+ const childrenWithoutParentComponent = createMemo5(() => {
4318
4333
  const shouldRenderChildrenOutsideRef = !blockComponent()?.component && !repeatItem();
4319
4334
  return shouldRenderChildrenOutsideRef ? processedBlock().children ?? [] : [];
4320
4335
  });
4321
- const componentRefProps = createMemo4(() => {
4336
+ const componentRefProps = createMemo5(() => {
4322
4337
  return {
4323
4338
  blockChildren: processedBlock().children ?? [],
4324
4339
  componentRef: blockComponent()?.component,
4325
4340
  componentOptions: {
4326
4341
  ...getBlockComponentOptions(processedBlock()),
4327
4342
  builderContext: props.context,
4328
- ...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
4343
+ ...shouldPassLinkComponent(blockComponent()) ? {
4329
4344
  builderLinkComponent: props.linkComponent
4330
4345
  } : {},
4331
- ...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
4346
+ ...shouldPassRegisteredComponents(blockComponent()) ? {
4332
4347
  builderComponents: props.registeredComponents
4333
4348
  } : {}
4334
4349
  },
@@ -4412,11 +4427,11 @@ function Block(props) {
4412
4427
  var Block_default = Block;
4413
4428
 
4414
4429
  // src/components/blocks/blocks-wrapper.tsx
4415
- import { createMemo as createMemo5 } from "solid-js";
4430
+ import { createMemo as createMemo6 } from "solid-js";
4416
4431
  import { Dynamic as Dynamic4 } from "solid-js/web";
4417
4432
  import { css } from "solid-styled-components";
4418
4433
  function BlocksWrapper(props) {
4419
- const className = createMemo5(() => {
4434
+ const className = createMemo6(() => {
4420
4435
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
4421
4436
  });
4422
4437
  function onClick() {
@@ -4490,16 +4505,24 @@ function Blocks(props) {
4490
4505
  }
4491
4506
  var Blocks_default = Blocks;
4492
4507
 
4508
+ // src/blocks/columns/helpers.ts
4509
+ var getColumnsClass = (id2) => {
4510
+ return `builder-columns ${id2}-breakpoints`;
4511
+ };
4512
+
4493
4513
  // src/blocks/columns/columns.tsx
4494
4514
  function Columns(props) {
4495
- const [gutterSize, setGutterSize] = createSignal6(
4515
+ const [gutterSize, setGutterSize] = createSignal7(
4496
4516
  typeof props.space === "number" ? props.space || 0 : 20
4497
4517
  );
4498
- const [cols, setCols] = createSignal6(props.columns || []);
4499
- const [stackAt, setStackAt] = createSignal6(props.stackColumnsAt || "tablet");
4500
- const [flexDir, setFlexDir] = createSignal6(
4518
+ const [cols, setCols] = createSignal7(props.columns || []);
4519
+ const [stackAt, setStackAt] = createSignal7(props.stackColumnsAt || "tablet");
4520
+ const [flexDir, setFlexDir] = createSignal7(
4501
4521
  props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column"
4502
4522
  );
4523
+ function getTagName(column) {
4524
+ return column.link ? props.builderLinkComponent || "a" : "div";
4525
+ }
4503
4526
  function getWidth(index) {
4504
4527
  return cols()[index]?.width || 100 / cols().length;
4505
4528
  }
@@ -4519,7 +4542,7 @@ function Columns(props) {
4519
4542
  }) {
4520
4543
  return stackAt() === "never" ? desktopStyle : stackedStyle;
4521
4544
  }
4522
- const columnsCssVars = createMemo6(() => {
4545
+ function columnsCssVars() {
4523
4546
  return {
4524
4547
  "--flex-dir": flexDir(),
4525
4548
  "--flex-dir-tablet": getTabletStyle({
@@ -4527,7 +4550,7 @@ function Columns(props) {
4527
4550
  desktopStyle: "row"
4528
4551
  })
4529
4552
  };
4530
- });
4553
+ }
4531
4554
  function columnCssVars(index) {
4532
4555
  const gutter = index === 0 ? 0 : gutterSize();
4533
4556
  const width = getColumnCssWidth(index);
@@ -4568,7 +4591,7 @@ function Columns(props) {
4568
4591
  );
4569
4592
  return breakpointSizes[size].max;
4570
4593
  }
4571
- const columnsStyles = createMemo6(() => {
4594
+ function columnsStyles() {
4572
4595
  return `
4573
4596
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
4574
4597
  .${props.builderBlock.id}-breakpoints {
@@ -4594,9 +4617,19 @@ function Columns(props) {
4594
4617
  }
4595
4618
  },
4596
4619
  `;
4597
- });
4620
+ }
4621
+ function getAttributes(column, index) {
4622
+ return {
4623
+ ...{},
4624
+ ...column.link ? {
4625
+ href: column.link
4626
+ } : {},
4627
+ [getClassPropName()]: "builder-column",
4628
+ style: mapStyleObjToStrIfNeeded(columnCssVars(index))
4629
+ };
4630
+ }
4598
4631
  return <div
4599
- class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
4632
+ class={getColumnsClass(props.builderBlock?.id) + " " + css2({
4600
4633
  display: "flex",
4601
4634
  lineHeight: "normal"
4602
4635
  })}
@@ -4611,16 +4644,9 @@ function Columns(props) {
4611
4644
  const index = _index();
4612
4645
  return <Dynamic_renderer_default
4613
4646
  key={index}
4614
- TagName={column.link ? props.builderLinkComponent || "a" : "div"}
4647
+ TagName={getTagName(column)}
4615
4648
  actionAttributes={{}}
4616
- attributes={{
4617
- ...{},
4618
- ...column.link ? {
4619
- href: column.link
4620
- } : {},
4621
- [getClassPropName()]: "builder-column",
4622
- style: mapStyleObjToStrIfNeeded(columnCssVars(index))
4623
- }}
4649
+ attributes={getAttributes(column, index)}
4624
4650
  ><Blocks_default
4625
4651
  path={`component.options.columns.${index}.blocks`}
4626
4652
  parent={props.builderBlock.id}
@@ -4644,7 +4670,7 @@ function FragmentComponent(props) {
4644
4670
  var fragment_default = FragmentComponent;
4645
4671
 
4646
4672
  // src/blocks/image/image.tsx
4647
- import { Show as Show7, createMemo as createMemo7 } from "solid-js";
4673
+ import { Show as Show7, createMemo as createMemo8 } from "solid-js";
4648
4674
  import { css as css3 } from "solid-styled-components";
4649
4675
 
4650
4676
  // src/blocks/image/image.helpers.ts
@@ -4696,7 +4722,7 @@ function getSrcSet(url) {
4696
4722
 
4697
4723
  // src/blocks/image/image.tsx
4698
4724
  function Image(props) {
4699
- const srcSetToUse = createMemo7(() => {
4725
+ const srcSetToUse = createMemo8(() => {
4700
4726
  const imageToUse = props.image || props.src;
4701
4727
  const url = imageToUse;
4702
4728
  if (!url || // We can auto add srcset for cdn.builder.io and shopify
@@ -4714,14 +4740,14 @@ function Image(props) {
4714
4740
  }
4715
4741
  return getSrcSet(url);
4716
4742
  });
4717
- const webpSrcSet = createMemo7(() => {
4743
+ const webpSrcSet = createMemo8(() => {
4718
4744
  if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
4719
4745
  return srcSetToUse().replace(/\?/g, "?format=webp&");
4720
4746
  } else {
4721
4747
  return "";
4722
4748
  }
4723
4749
  });
4724
- const aspectRatioCss = createMemo7(() => {
4750
+ const aspectRatioCss = createMemo8(() => {
4725
4751
  const aspectRatioStyles = {
4726
4752
  position: "absolute",
4727
4753
  height: "100%",
@@ -4766,7 +4792,7 @@ function Image(props) {
4766
4792
  }}
4767
4793
  /></Show7>
4768
4794
  <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
4769
- <Show7 when={!props.fitContent && props.children}><div
4795
+ <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div
4770
4796
  class={css3({
4771
4797
  display: "flex",
4772
4798
  flexDirection: "column",
@@ -4804,10 +4830,10 @@ function SectionComponent(props) {
4804
4830
  var section_default = SectionComponent;
4805
4831
 
4806
4832
  // src/blocks/symbol/symbol.tsx
4807
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo16, createSignal as createSignal16 } from "solid-js";
4833
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
4808
4834
 
4809
4835
  // src/components/content-variants/content-variants.tsx
4810
- import { Show as Show12, For as For7, onMount as onMount4, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
4836
+ import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
4811
4837
 
4812
4838
  // src/helpers/url.ts
4813
4839
  var getTopLevelDomain = (host) => {
@@ -5001,7 +5027,7 @@ var handleABTesting = async ({
5001
5027
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
5002
5028
 
5003
5029
  // src/components/content/content.tsx
5004
- import { Show as Show11, createSignal as createSignal14 } from "solid-js";
5030
+ import { Show as Show12, createSignal as createSignal16 } from "solid-js";
5005
5031
 
5006
5032
  // src/blocks/button/component-info.ts
5007
5033
  var componentInfo = {
@@ -5503,8 +5529,203 @@ var componentInfo7 = {
5503
5529
  }]
5504
5530
  };
5505
5531
 
5506
- // src/blocks/text/component-info.ts
5532
+ // src/blocks/tabs/component-info.ts
5533
+ var defaultTab = {
5534
+ "@type": "@builder.io/sdk:Element",
5535
+ responsiveStyles: {
5536
+ large: {
5537
+ paddingLeft: "20px",
5538
+ paddingRight: "20px",
5539
+ paddingTop: "10px",
5540
+ paddingBottom: "10px",
5541
+ minWidth: "100px",
5542
+ textAlign: "center",
5543
+ display: "flex",
5544
+ flexDirection: "column",
5545
+ cursor: "pointer",
5546
+ userSelect: "none"
5547
+ }
5548
+ },
5549
+ component: {
5550
+ name: "Text",
5551
+ options: {
5552
+ text: "New tab"
5553
+ }
5554
+ }
5555
+ };
5556
+ var defaultElement = {
5557
+ "@type": "@builder.io/sdk:Element",
5558
+ responsiveStyles: {
5559
+ large: {
5560
+ height: "200px",
5561
+ display: "flex",
5562
+ marginTop: "20px",
5563
+ flexDirection: "column"
5564
+ }
5565
+ },
5566
+ component: {
5567
+ name: "Text",
5568
+ options: {
5569
+ text: "New tab content "
5570
+ }
5571
+ }
5572
+ };
5507
5573
  var componentInfo8 = {
5574
+ name: "Builder: Tabs",
5575
+ inputs: [{
5576
+ name: "tabs",
5577
+ type: "list",
5578
+ broadcast: true,
5579
+ subFields: [{
5580
+ name: "label",
5581
+ type: "uiBlocks",
5582
+ hideFromUI: true,
5583
+ defaultValue: [defaultTab]
5584
+ }, {
5585
+ name: "content",
5586
+ type: "uiBlocks",
5587
+ hideFromUI: true,
5588
+ defaultValue: [defaultElement]
5589
+ }],
5590
+ defaultValue: [{
5591
+ label: [{
5592
+ ...defaultTab,
5593
+ component: {
5594
+ name: "Text",
5595
+ options: {
5596
+ text: "Tab 1"
5597
+ }
5598
+ }
5599
+ }],
5600
+ content: [{
5601
+ ...defaultElement,
5602
+ component: {
5603
+ name: "Text",
5604
+ options: {
5605
+ text: "Tab 1 content"
5606
+ }
5607
+ }
5608
+ }]
5609
+ }, {
5610
+ label: [{
5611
+ ...defaultTab,
5612
+ component: {
5613
+ name: "Text",
5614
+ options: {
5615
+ text: "Tab 2"
5616
+ }
5617
+ }
5618
+ }],
5619
+ content: [{
5620
+ ...defaultElement,
5621
+ component: {
5622
+ name: "Text",
5623
+ options: {
5624
+ text: "Tab 2 content"
5625
+ }
5626
+ }
5627
+ }]
5628
+ }]
5629
+ }, {
5630
+ name: "activeTabStyle",
5631
+ type: "uiStyle",
5632
+ helperText: "CSS styles for the active tab",
5633
+ defaultValue: {
5634
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
5635
+ }
5636
+ }, {
5637
+ name: "defaultActiveTab",
5638
+ type: "number",
5639
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
5640
+ defaultValue: 1,
5641
+ advanced: true
5642
+ }, {
5643
+ name: "collapsible",
5644
+ type: "boolean",
5645
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
5646
+ defaultValue: false,
5647
+ advanced: true
5648
+ }, {
5649
+ name: "tabHeaderLayout",
5650
+ type: "enum",
5651
+ helperText: "Change the layout of the tab headers (uses justify-content)",
5652
+ defaultValue: "flex-start",
5653
+ enum: [{
5654
+ label: "Center",
5655
+ value: "center"
5656
+ }, {
5657
+ label: "Space between",
5658
+ value: "space-between"
5659
+ }, {
5660
+ label: "Space around",
5661
+ value: "space-around"
5662
+ }, {
5663
+ label: "Left",
5664
+ value: "flex-start"
5665
+ }, {
5666
+ label: "Right",
5667
+ value: "flex-end"
5668
+ }]
5669
+ }]
5670
+ };
5671
+
5672
+ // src/blocks/tabs/tabs.tsx
5673
+ import { Show as Show8, For as For5, createSignal as createSignal9 } from "solid-js";
5674
+ function Tabs(props) {
5675
+ const [activeTab, setActiveTab] = createSignal9(
5676
+ props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
5677
+ );
5678
+ function activeTabContent(active) {
5679
+ return props.tabs && props.tabs[active].content;
5680
+ }
5681
+ function getActiveTabStyle(index) {
5682
+ return activeTab() === index ? props.activeTabStyle : {};
5683
+ }
5684
+ return <div>
5685
+ <div
5686
+ class="builder-tabs-wrap"
5687
+ style={{
5688
+ display: "flex",
5689
+ "flex-direction": "row",
5690
+ "justify-content": props.tabHeaderLayout || "flex-start",
5691
+ overflow: "auto"
5692
+ }}
5693
+ ><For5 each={props.tabs}>{(tab, _index) => {
5694
+ const index = _index();
5695
+ return <span
5696
+ class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
5697
+ key={index}
5698
+ style={getActiveTabStyle(index)}
5699
+ onClick={(event) => {
5700
+ if (index === activeTab() && props.collapsible) {
5701
+ setActiveTab(-1);
5702
+ } else {
5703
+ setActiveTab(index);
5704
+ }
5705
+ }}
5706
+ ><Blocks_default
5707
+ parent={props.builderBlock.id}
5708
+ path={`component.options.tabs.${index}.label`}
5709
+ blocks={tab.label}
5710
+ context={props.builderContext}
5711
+ registeredComponents={props.builderComponents}
5712
+ linkComponent={props.builderLinkComponent}
5713
+ /></span>;
5714
+ }}</For5></div>
5715
+ <Show8 when={activeTabContent(activeTab())}><div><Blocks_default
5716
+ parent={props.builderBlock.id}
5717
+ path={`component.options.tabs.${activeTab()}.content`}
5718
+ blocks={activeTabContent(activeTab())}
5719
+ context={props.builderContext}
5720
+ registeredComponents={props.builderComponents}
5721
+ linkComponent={props.builderLinkComponent}
5722
+ /></div></Show8>
5723
+ </div>;
5724
+ }
5725
+ var tabs_default = Tabs;
5726
+
5727
+ // src/blocks/text/component-info.ts
5728
+ var componentInfo9 = {
5508
5729
  name: "Text",
5509
5730
  static: true,
5510
5731
  isRSC: true,
@@ -5537,7 +5758,7 @@ function Text(props) {
5537
5758
  var text_default = Text;
5538
5759
 
5539
5760
  // src/blocks/custom-code/component-info.ts
5540
- var componentInfo9 = {
5761
+ var componentInfo10 = {
5541
5762
  name: "Custom Code",
5542
5763
  static: true,
5543
5764
  requiredPermissions: ["editCode"],
@@ -5562,10 +5783,10 @@ var componentInfo9 = {
5562
5783
  };
5563
5784
 
5564
5785
  // src/blocks/custom-code/custom-code.tsx
5565
- import { onMount as onMount2, createSignal as createSignal8 } from "solid-js";
5786
+ import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
5566
5787
  function CustomCode(props) {
5567
- const [scriptsInserted, setScriptsInserted] = createSignal8([]);
5568
- const [scriptsRun, setScriptsRun] = createSignal8([]);
5788
+ const [scriptsInserted, setScriptsInserted] = createSignal10([]);
5789
+ const [scriptsRun, setScriptsRun] = createSignal10([]);
5569
5790
  let elementRef;
5570
5791
  onMount2(() => {
5571
5792
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -5609,7 +5830,7 @@ function CustomCode(props) {
5609
5830
  var custom_code_default = CustomCode;
5610
5831
 
5611
5832
  // src/blocks/embed/component-info.ts
5612
- var componentInfo10 = {
5833
+ var componentInfo11 = {
5613
5834
  name: "Embed",
5614
5835
  static: true,
5615
5836
  inputs: [{
@@ -5647,7 +5868,7 @@ var componentInfo10 = {
5647
5868
  };
5648
5869
 
5649
5870
  // src/blocks/embed/embed.tsx
5650
- import { on, createEffect, createMemo as createMemo9, createSignal as createSignal9 } from "solid-js";
5871
+ import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
5651
5872
 
5652
5873
  // src/blocks/embed/helpers.ts
5653
5874
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -5655,9 +5876,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
5655
5876
 
5656
5877
  // src/blocks/embed/embed.tsx
5657
5878
  function Embed(props) {
5658
- const [scriptsInserted, setScriptsInserted] = createSignal9([]);
5659
- const [scriptsRun, setScriptsRun] = createSignal9([]);
5660
- const [ranInitFn, setRanInitFn] = createSignal9(false);
5879
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
5880
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
5881
+ const [ranInitFn, setRanInitFn] = createSignal11(false);
5661
5882
  function findAndRunScripts() {
5662
5883
  if (!elem || !elem.getElementsByTagName)
5663
5884
  return;
@@ -5681,8 +5902,8 @@ function Embed(props) {
5681
5902
  }
5682
5903
  }
5683
5904
  let elem;
5684
- const onUpdateFn_0_elem = createMemo9(() => elem);
5685
- const onUpdateFn_0_ranInitFn__ = createMemo9(() => ranInitFn());
5905
+ const onUpdateFn_0_elem = createMemo11(() => elem);
5906
+ const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
5686
5907
  function onUpdateFn_0() {
5687
5908
  if (elem && !ranInitFn()) {
5688
5909
  setRanInitFn(true);
@@ -5697,7 +5918,7 @@ function Embed(props) {
5697
5918
  var embed_default = Embed;
5698
5919
 
5699
5920
  // src/blocks/form/form/component-info.ts
5700
- var componentInfo11 = {
5921
+ var componentInfo12 = {
5701
5922
  name: "Form:Form",
5702
5923
  // editableTags: ['builder-form-error']
5703
5924
  defaults: {
@@ -5931,7 +6152,7 @@ var componentInfo11 = {
5931
6152
  };
5932
6153
 
5933
6154
  // src/blocks/form/form/form.tsx
5934
- import { Show as Show8, For as For5, createSignal as createSignal10 } from "solid-js";
6155
+ import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
5935
6156
  import { css as css4 } from "solid-styled-components";
5936
6157
 
5937
6158
  // src/functions/get-env.ts
@@ -5949,9 +6170,9 @@ var get = (obj, path, defaultValue) => {
5949
6170
 
5950
6171
  // src/blocks/form/form/form.tsx
5951
6172
  function FormComponent(props) {
5952
- const [formState, setFormState] = createSignal10("unsubmitted");
5953
- const [responseData, setResponseData] = createSignal10(null);
5954
- const [formErrorMessage, setFormErrorMessage] = createSignal10("");
6173
+ const [formState, setFormState] = createSignal12("unsubmitted");
6174
+ const [responseData, setResponseData] = createSignal12(null);
6175
+ const [formErrorMessage, setFormErrorMessage] = createSignal12("");
5955
6176
  function mergeNewRootState(newData) {
5956
6177
  const combinedState = {
5957
6178
  ...props.builderContext.rootState,
@@ -6147,7 +6368,7 @@ function FormComponent(props) {
6147
6368
  {...{}}
6148
6369
  {...props.attributes}
6149
6370
  >
6150
- <Show8 when={props.builderBlock && props.builderBlock.children}><For5 each={props.builderBlock?.children}>{(block, _index) => {
6371
+ <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
6151
6372
  const idx = _index();
6152
6373
  return <Block_default
6153
6374
  key={`form-block-${idx}`}
@@ -6156,35 +6377,35 @@ function FormComponent(props) {
6156
6377
  registeredComponents={props.builderComponents}
6157
6378
  linkComponent={props.builderLinkComponent}
6158
6379
  />;
6159
- }}</For5></Show8>
6160
- <Show8 when={submissionState() === "error"}><Blocks_default
6380
+ }}</For6></Show9>
6381
+ <Show9 when={submissionState() === "error"}><Blocks_default
6161
6382
  path="errorMessage"
6162
6383
  blocks={props.errorMessage}
6163
6384
  context={props.builderContext}
6164
- /></Show8>
6165
- <Show8 when={submissionState() === "sending"}><Blocks_default
6385
+ /></Show9>
6386
+ <Show9 when={submissionState() === "sending"}><Blocks_default
6166
6387
  path="sendingMessage"
6167
6388
  blocks={props.sendingMessage}
6168
6389
  context={props.builderContext}
6169
- /></Show8>
6170
- <Show8 when={submissionState() === "error" && responseData()}><pre
6390
+ /></Show9>
6391
+ <Show9 when={submissionState() === "error" && responseData()}><pre
6171
6392
  class={"builder-form-error-text " + css4({
6172
6393
  padding: "10px",
6173
6394
  color: "red",
6174
6395
  textAlign: "center"
6175
6396
  })}
6176
- >{JSON.stringify(responseData(), null, 2)}</pre></Show8>
6177
- <Show8 when={submissionState() === "success"}><Blocks_default
6397
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
6398
+ <Show9 when={submissionState() === "success"}><Blocks_default
6178
6399
  path="successMessage"
6179
6400
  blocks={props.successMessage}
6180
6401
  context={props.builderContext}
6181
- /></Show8>
6402
+ /></Show9>
6182
6403
  </form>;
6183
6404
  }
6184
6405
  var form_default = FormComponent;
6185
6406
 
6186
6407
  // src/blocks/form/input/component-info.ts
6187
- var componentInfo12 = {
6408
+ var componentInfo13 = {
6188
6409
  name: "Form:Input",
6189
6410
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
6190
6411
  inputs: [
@@ -6254,7 +6475,7 @@ function FormInputComponent(props) {
6254
6475
  var input_default = FormInputComponent;
6255
6476
 
6256
6477
  // src/blocks/form/select/component-info.ts
6257
- var componentInfo13 = {
6478
+ var componentInfo14 = {
6258
6479
  name: "Form:Select",
6259
6480
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
6260
6481
  defaultStyles: {
@@ -6299,7 +6520,7 @@ var componentInfo13 = {
6299
6520
  };
6300
6521
 
6301
6522
  // src/blocks/form/select/select.tsx
6302
- import { For as For6 } from "solid-js";
6523
+ import { For as For7 } from "solid-js";
6303
6524
  function SelectComponent(props) {
6304
6525
  return <select
6305
6526
  {...{}}
@@ -6308,15 +6529,15 @@ function SelectComponent(props) {
6308
6529
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
6309
6530
  defaultValue={props.defaultValue}
6310
6531
  name={props.name}
6311
- ><For6 each={props.options}>{(option, _index) => {
6532
+ ><For7 each={props.options}>{(option, _index) => {
6312
6533
  const index = _index();
6313
6534
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
6314
- }}</For6></select>;
6535
+ }}</For7></select>;
6315
6536
  }
6316
6537
  var select_default = SelectComponent;
6317
6538
 
6318
6539
  // src/blocks/form/submit-button/component-info.ts
6319
- var componentInfo14 = {
6540
+ var componentInfo15 = {
6320
6541
  name: "Form:SubmitButton",
6321
6542
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
6322
6543
  defaultStyles: {
@@ -6350,7 +6571,7 @@ function SubmitButton(props) {
6350
6571
  var submit_button_default = SubmitButton;
6351
6572
 
6352
6573
  // src/blocks/img/component-info.ts
6353
- var componentInfo15 = {
6574
+ var componentInfo16 = {
6354
6575
  // friendlyName?
6355
6576
  name: "Raw:Img",
6356
6577
  hideFromInsertMenu: true,
@@ -6383,7 +6604,7 @@ function ImgComponent(props) {
6383
6604
  var img_default = ImgComponent;
6384
6605
 
6385
6606
  // src/blocks/video/component-info.ts
6386
- var componentInfo16 = {
6607
+ var componentInfo17 = {
6387
6608
  name: "Video",
6388
6609
  canHaveChildren: true,
6389
6610
  defaultStyles: {
@@ -6467,9 +6688,9 @@ var componentInfo16 = {
6467
6688
  };
6468
6689
 
6469
6690
  // src/blocks/video/video.tsx
6470
- import { Show as Show9, createMemo as createMemo11 } from "solid-js";
6691
+ import { Show as Show10, createMemo as createMemo13 } from "solid-js";
6471
6692
  function Video(props) {
6472
- const videoProps = createMemo11(() => {
6693
+ const videoProps = createMemo13(() => {
6473
6694
  return {
6474
6695
  ...props.autoPlay === true ? {
6475
6696
  autoPlay: true
@@ -6488,7 +6709,7 @@ function Video(props) {
6488
6709
  } : {}
6489
6710
  };
6490
6711
  });
6491
- const spreadProps = createMemo11(() => {
6712
+ const spreadProps = createMemo13(() => {
6492
6713
  return {
6493
6714
  ...videoProps()
6494
6715
  };
@@ -6518,8 +6739,8 @@ function Video(props) {
6518
6739
  }}
6519
6740
  src={props.video || "no-src"}
6520
6741
  poster={props.posterImage}
6521
- ><Show9 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show9></video>
6522
- <Show9
6742
+ ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
6743
+ <Show10
6523
6744
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
6524
6745
  ><div
6525
6746
  style={{
@@ -6528,15 +6749,15 @@ function Video(props) {
6528
6749
  "pointer-events": "none",
6529
6750
  "font-size": "0px"
6530
6751
  }}
6531
- /></Show9>
6532
- <Show9 when={props.builderBlock?.children?.length && props.fitContent}><div
6752
+ /></Show10>
6753
+ <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
6533
6754
  style={{
6534
6755
  display: "flex",
6535
6756
  "flex-direction": "column",
6536
6757
  "align-items": "stretch"
6537
6758
  }}
6538
- >{props.children}</div></Show9>
6539
- <Show9 when={props.builderBlock?.children?.length && !props.fitContent}><div
6759
+ >{props.children}</div></Show10>
6760
+ <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
6540
6761
  style={{
6541
6762
  "pointer-events": "none",
6542
6763
  display: "flex",
@@ -6548,7 +6769,7 @@ function Video(props) {
6548
6769
  width: "100%",
6549
6770
  height: "100%"
6550
6771
  }}
6551
- >{props.children}</div></Show9>
6772
+ >{props.children}</div></Show10>
6552
6773
  </div>;
6553
6774
  }
6554
6775
  var video_default = Video;
@@ -6556,28 +6777,28 @@ var video_default = Video;
6556
6777
  // src/constants/extra-components.ts
6557
6778
  var getExtraComponents = () => [{
6558
6779
  component: custom_code_default,
6559
- ...componentInfo9
6780
+ ...componentInfo10
6560
6781
  }, {
6561
6782
  component: embed_default,
6562
- ...componentInfo10
6783
+ ...componentInfo11
6563
6784
  }, ...TARGET === "rsc" ? [] : [{
6564
6785
  component: form_default,
6565
- ...componentInfo11
6786
+ ...componentInfo12
6566
6787
  }, {
6567
6788
  component: input_default,
6568
- ...componentInfo12
6789
+ ...componentInfo13
6569
6790
  }, {
6570
6791
  component: submit_button_default,
6571
- ...componentInfo14
6792
+ ...componentInfo15
6572
6793
  }, {
6573
6794
  component: select_default,
6574
- ...componentInfo13
6795
+ ...componentInfo14
6575
6796
  }], {
6576
6797
  component: img_default,
6577
- ...componentInfo15
6798
+ ...componentInfo16
6578
6799
  }, {
6579
6800
  component: video_default,
6580
- ...componentInfo16
6801
+ ...componentInfo17
6581
6802
  }];
6582
6803
 
6583
6804
  // src/constants/builder-registered-components.ts
@@ -6604,8 +6825,11 @@ var getDefaultRegisteredComponents = () => [{
6604
6825
  ...componentInfo7
6605
6826
  }, {
6606
6827
  component: text_default,
6828
+ ...componentInfo9
6829
+ }, ...TARGET === "rsc" ? [] : [{
6830
+ component: tabs_default,
6607
6831
  ...componentInfo8
6608
- }, ...getExtraComponents()];
6832
+ }], ...getExtraComponents()];
6609
6833
 
6610
6834
  // src/functions/register-component.ts
6611
6835
  var createRegisterComponentMessage = (info) => ({
@@ -6683,12 +6907,12 @@ var Inlined_script_default = InlinedScript;
6683
6907
 
6684
6908
  // src/components/content/components/enable-editor.tsx
6685
6909
  import {
6686
- Show as Show10,
6910
+ Show as Show11,
6687
6911
  onMount as onMount3,
6688
6912
  on as on2,
6689
6913
  createEffect as createEffect2,
6690
- createMemo as createMemo12,
6691
- createSignal as createSignal12
6914
+ createMemo as createMemo14,
6915
+ createSignal as createSignal14
6692
6916
  } from "solid-js";
6693
6917
  import { Dynamic as Dynamic5 } from "solid-js/web";
6694
6918
 
@@ -7176,7 +7400,7 @@ function isFromTrustedHost(trustedHosts, e) {
7176
7400
  }
7177
7401
 
7178
7402
  // src/constants/sdk-version.ts
7179
- var SDK_VERSION = "1.0.23";
7403
+ var SDK_VERSION = "1.0.25";
7180
7404
 
7181
7405
  // src/functions/register.ts
7182
7406
  var registry = {};
@@ -7373,14 +7597,93 @@ var subscribeToEditor = (model, callback, options) => {
7373
7597
  };
7374
7598
  };
7375
7599
 
7600
+ // src/components/content/components/styles.helpers.ts
7601
+ var getCssFromFont = (font) => {
7602
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
7603
+ const name = family.split(",")[0];
7604
+ const url = font.fileUrl ?? font?.files?.regular;
7605
+ let str = "";
7606
+ if (url && family && name) {
7607
+ str += `
7608
+ @font-face {
7609
+ font-family: "${family}";
7610
+ src: local("${name}"), url('${url}') format('woff2');
7611
+ font-display: fallback;
7612
+ font-weight: 400;
7613
+ }
7614
+ `.trim();
7615
+ }
7616
+ if (font.files) {
7617
+ for (const weight in font.files) {
7618
+ const isNumber = String(Number(weight)) === weight;
7619
+ if (!isNumber) {
7620
+ continue;
7621
+ }
7622
+ const weightUrl = font.files[weight];
7623
+ if (weightUrl && weightUrl !== url) {
7624
+ str += `
7625
+ @font-face {
7626
+ font-family: "${family}";
7627
+ src: url('${weightUrl}') format('woff2');
7628
+ font-display: fallback;
7629
+ font-weight: ${weight};
7630
+ }
7631
+ `.trim();
7632
+ }
7633
+ }
7634
+ }
7635
+ return str;
7636
+ };
7637
+ var getFontCss = ({
7638
+ customFonts
7639
+ }) => {
7640
+ return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
7641
+ };
7642
+ var getCss = ({
7643
+ cssCode,
7644
+ contentId
7645
+ }) => {
7646
+ if (!cssCode) {
7647
+ return "";
7648
+ }
7649
+ if (!contentId) {
7650
+ return cssCode;
7651
+ }
7652
+ return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
7653
+ };
7654
+ var DEFAULT_STYLES = `
7655
+ .builder-button {
7656
+ all: unset;
7657
+ }
7658
+
7659
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
7660
+ margin: 0;
7661
+ }
7662
+ .builder-text > p, .builder-text > .builder-paragraph {
7663
+ color: inherit;
7664
+ line-height: inherit;
7665
+ letter-spacing: inherit;
7666
+ font-weight: inherit;
7667
+ font-size: inherit;
7668
+ text-align: inherit;
7669
+ font-family: inherit;
7670
+ }
7671
+ `;
7672
+ var getDefaultStyles = (isNested) => {
7673
+ return !isNested ? DEFAULT_STYLES : "";
7674
+ };
7675
+ var getWrapperClassName = (variationId) => {
7676
+ return `variant-${variationId}`;
7677
+ };
7678
+
7376
7679
  // src/components/content/components/enable-editor.tsx
7377
7680
  function EnableEditor(props) {
7378
- const [ContentWrapper, setContentWrapper] = createSignal12(
7681
+ const [ContentWrapper, setContentWrapper] = createSignal14(
7379
7682
  props.contentWrapper || "div"
7380
7683
  );
7381
- const [httpReqsData, setHttpReqsData] = createSignal12({});
7382
- const [httpReqsPending, setHttpReqsPending] = createSignal12({});
7383
- const [clicked, setClicked] = createSignal12(false);
7684
+ const [httpReqsData, setHttpReqsData] = createSignal14({});
7685
+ const [httpReqsPending, setHttpReqsPending] = createSignal14({});
7686
+ const [clicked, setClicked] = createSignal14(false);
7384
7687
  function mergeNewRootState(newData) {
7385
7688
  const combinedState = {
7386
7689
  ...props.builderContextSignal.rootState,
@@ -7414,6 +7717,12 @@ function EnableEditor(props) {
7414
7717
  content: newContentValue
7415
7718
  }));
7416
7719
  }
7720
+ const showContentProps = createMemo14(() => {
7721
+ return props.showContent ? {} : {
7722
+ hidden: true,
7723
+ "aria-hidden": true
7724
+ };
7725
+ });
7417
7726
  function processMessage(event) {
7418
7727
  return createEditorListener({
7419
7728
  model: props.model,
@@ -7599,14 +7908,14 @@ function EnableEditor(props) {
7599
7908
  runHttpRequests();
7600
7909
  emitStateUpdate();
7601
7910
  });
7602
- const onUpdateFn_0_props_content = createMemo12(() => props.content);
7911
+ const onUpdateFn_0_props_content = createMemo14(() => props.content);
7603
7912
  function onUpdateFn_0() {
7604
7913
  if (props.content) {
7605
7914
  mergeNewContent(props.content);
7606
7915
  }
7607
7916
  }
7608
7917
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
7609
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
7918
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
7610
7919
  function onUpdateFn_1() {
7611
7920
  evaluateJsCode();
7612
7921
  }
@@ -7616,7 +7925,7 @@ function EnableEditor(props) {
7616
7925
  onUpdateFn_1
7617
7926
  )
7618
7927
  );
7619
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
7928
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
7620
7929
  function onUpdateFn_2() {
7621
7930
  runHttpRequests();
7622
7931
  }
@@ -7628,7 +7937,7 @@ function EnableEditor(props) {
7628
7937
  onUpdateFn_2
7629
7938
  )
7630
7939
  );
7631
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
7940
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
7632
7941
  () => props.builderContextSignal.rootState
7633
7942
  );
7634
7943
  function onUpdateFn_3() {
@@ -7640,14 +7949,14 @@ function EnableEditor(props) {
7640
7949
  onUpdateFn_3
7641
7950
  )
7642
7951
  );
7643
- const onUpdateFn_4_props_data = createMemo12(() => props.data);
7952
+ const onUpdateFn_4_props_data = createMemo14(() => props.data);
7644
7953
  function onUpdateFn_4() {
7645
7954
  if (props.data) {
7646
7955
  mergeNewRootState(props.data);
7647
7956
  }
7648
7957
  }
7649
7958
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
7650
- const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
7959
+ const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
7651
7960
  function onUpdateFn_5() {
7652
7961
  if (props.locale) {
7653
7962
  mergeNewRootState({
@@ -7656,106 +7965,27 @@ function EnableEditor(props) {
7656
7965
  }
7657
7966
  }
7658
7967
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
7659
- return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
7660
- class={`variant-${props.content?.testVariationId || props.content?.id}`}
7968
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
7969
+ class={getWrapperClassName(
7970
+ props.content?.testVariationId || props.content?.id
7971
+ )}
7661
7972
  {...{}}
7662
7973
  ref={elementRef}
7663
7974
  onClick={(event) => onClick(event)}
7664
7975
  builder-content-id={props.builderContextSignal.content?.id}
7665
7976
  builder-model={props.model}
7666
7977
  {...{}}
7667
- {...props.showContent ? {} : {
7668
- hidden: true,
7669
- "aria-hidden": true
7670
- }}
7978
+ {...showContentProps()}
7671
7979
  {...props.contentWrapperProps}
7672
7980
  component={ContentWrapper()}
7673
- >{props.children}</Dynamic5></Show10></builder_context_default.Provider>;
7981
+ >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
7674
7982
  }
7675
7983
  var Enable_editor_default = EnableEditor;
7676
7984
 
7677
7985
  // src/components/content/components/styles.tsx
7678
- import { createSignal as createSignal13 } from "solid-js";
7679
-
7680
- // src/components/content/components/styles.helpers.ts
7681
- var getCssFromFont = (font) => {
7682
- const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
7683
- const name = family.split(",")[0];
7684
- const url = font.fileUrl ?? font?.files?.regular;
7685
- let str = "";
7686
- if (url && family && name) {
7687
- str += `
7688
- @font-face {
7689
- font-family: "${family}";
7690
- src: local("${name}"), url('${url}') format('woff2');
7691
- font-display: fallback;
7692
- font-weight: 400;
7693
- }
7694
- `.trim();
7695
- }
7696
- if (font.files) {
7697
- for (const weight in font.files) {
7698
- const isNumber = String(Number(weight)) === weight;
7699
- if (!isNumber) {
7700
- continue;
7701
- }
7702
- const weightUrl = font.files[weight];
7703
- if (weightUrl && weightUrl !== url) {
7704
- str += `
7705
- @font-face {
7706
- font-family: "${family}";
7707
- src: url('${weightUrl}') format('woff2');
7708
- font-display: fallback;
7709
- font-weight: ${weight};
7710
- }
7711
- `.trim();
7712
- }
7713
- }
7714
- }
7715
- return str;
7716
- };
7717
- var getFontCss = ({
7718
- customFonts
7719
- }) => {
7720
- return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
7721
- };
7722
- var getCss = ({
7723
- cssCode,
7724
- contentId
7725
- }) => {
7726
- if (!cssCode) {
7727
- return "";
7728
- }
7729
- if (!contentId) {
7730
- return cssCode;
7731
- }
7732
- return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
7733
- };
7734
- var DEFAULT_STYLES = `
7735
- .builder-button {
7736
- all: unset;
7737
- }
7738
-
7739
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
7740
- margin: 0;
7741
- }
7742
- .builder-text > p, .builder-text > .builder-paragraph {
7743
- color: inherit;
7744
- line-height: inherit;
7745
- letter-spacing: inherit;
7746
- font-weight: inherit;
7747
- font-size: inherit;
7748
- text-align: inherit;
7749
- font-family: inherit;
7750
- }
7751
- `;
7752
- var getDefaultStyles = (isNested) => {
7753
- return !isNested ? DEFAULT_STYLES : "";
7754
- };
7755
-
7756
- // src/components/content/components/styles.tsx
7986
+ import { createSignal as createSignal15 } from "solid-js";
7757
7987
  function ContentStyles(props) {
7758
- const [injectedStyles, setInjectedStyles] = createSignal13(
7988
+ const [injectedStyles, setInjectedStyles] = createSignal15(
7759
7989
  `
7760
7990
  ${getCss({
7761
7991
  cssCode: props.cssCode,
@@ -7812,7 +8042,7 @@ var getContentInitialValue = ({
7812
8042
 
7813
8043
  // src/components/content/content.tsx
7814
8044
  function ContentComponent(props) {
7815
- const [scriptStr, setScriptStr] = createSignal14(
8045
+ const [scriptStr, setScriptStr] = createSignal16(
7816
8046
  getUpdateVariantVisibilityScript({
7817
8047
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
7818
8048
  variationId: props.content?.testVariationId,
@@ -7820,7 +8050,7 @@ function ContentComponent(props) {
7820
8050
  contentId: props.content?.id
7821
8051
  })
7822
8052
  );
7823
- const [registeredComponents, setRegisteredComponents] = createSignal14(
8053
+ const [registeredComponents, setRegisteredComponents] = createSignal16(
7824
8054
  [
7825
8055
  ...getDefaultRegisteredComponents(),
7826
8056
  ...props.customComponents || []
@@ -7835,7 +8065,7 @@ function ContentComponent(props) {
7835
8065
  {}
7836
8066
  )
7837
8067
  );
7838
- const [builderContextSignal, setBuilderContextSignal] = createSignal14({
8068
+ const [builderContextSignal, setBuilderContextSignal] = createSignal16({
7839
8069
  content: getContentInitialValue({
7840
8070
  content: props.content,
7841
8071
  data: props.data
@@ -7893,16 +8123,16 @@ function ContentComponent(props) {
7893
8123
  setBuilderContextSignal
7894
8124
  }}
7895
8125
  >
7896
- <Show11 when={props.isSsrAbTest}><Inlined_script_default
8126
+ <Show12 when={props.isSsrAbTest}><Inlined_script_default
7897
8127
  id="builderio-variant-visibility"
7898
8128
  scriptStr={scriptStr()}
7899
- /></Show11>
7900
- <Show11 when={TARGET !== "reactNative"}><Styles_default
8129
+ /></Show12>
8130
+ <Show12 when={TARGET !== "reactNative"}><Styles_default
7901
8131
  isNestedRender={props.isNestedRender}
7902
8132
  contentId={builderContextSignal().content?.id}
7903
8133
  cssCode={builderContextSignal().content?.data?.cssCode}
7904
8134
  customFonts={builderContextSignal().content?.data?.customFonts}
7905
- /></Show11>
8135
+ /></Show12>
7906
8136
  <Blocks_default
7907
8137
  blocks={builderContextSignal().content?.data?.blocks}
7908
8138
  context={builderContextSignal()}
@@ -7915,13 +8145,13 @@ var Content_default = ContentComponent;
7915
8145
 
7916
8146
  // src/components/content-variants/content-variants.tsx
7917
8147
  function ContentVariants(props) {
7918
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal15(
8148
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
7919
8149
  checkShouldRenderVariants({
7920
8150
  canTrack: getDefaultCanTrack(props.canTrack),
7921
8151
  content: props.content
7922
8152
  })
7923
8153
  );
7924
- const updateCookieAndStylesScriptStr = createMemo15(() => {
8154
+ const updateCookieAndStylesScriptStr = createMemo17(() => {
7925
8155
  return getUpdateCookieAndStylesScript(
7926
8156
  getVariants(props.content).map((value) => ({
7927
8157
  id: value.testVariationId,
@@ -7930,10 +8160,10 @@ function ContentVariants(props) {
7930
8160
  props.content?.id || ""
7931
8161
  );
7932
8162
  });
7933
- const hideVariantsStyleString = createMemo15(() => {
8163
+ const hideVariantsStyleString = createMemo17(() => {
7934
8164
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
7935
8165
  });
7936
- const defaultContent = createMemo15(() => {
8166
+ const defaultContent = createMemo17(() => {
7937
8167
  return shouldRenderVariants() ? {
7938
8168
  ...props.content,
7939
8169
  testVariationId: props.content?.id
@@ -7946,11 +8176,11 @@ function ContentVariants(props) {
7946
8176
  setShouldRenderVariants(false);
7947
8177
  });
7948
8178
  return <>
7949
- <Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
8179
+ <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
7950
8180
  id="builderio-init-variants-fns"
7951
8181
  scriptStr={getInitVariantsFnsScriptString()}
7952
- /></Show12>
7953
- <Show12 when={shouldRenderVariants()}>
8182
+ /></Show13>
8183
+ <Show13 when={shouldRenderVariants()}>
7954
8184
  <Inlined_styles_default
7955
8185
  id="builderio-variants"
7956
8186
  styles={hideVariantsStyleString()}
@@ -7959,7 +8189,7 @@ function ContentVariants(props) {
7959
8189
  id="builderio-variants-visibility"
7960
8190
  scriptStr={updateCookieAndStylesScriptStr()}
7961
8191
  />
7962
- <For7 each={getVariants(props.content)}>{(variant, _index) => {
8192
+ <For8 each={getVariants(props.content)}>{(variant, _index) => {
7963
8193
  const index = _index();
7964
8194
  return <Content_default
7965
8195
  isNestedRender={props.isNestedRender}
@@ -7983,8 +8213,8 @@ function ContentVariants(props) {
7983
8213
  contentWrapperProps={props.contentWrapperProps}
7984
8214
  trustedHosts={props.trustedHosts}
7985
8215
  />;
7986
- }}</For7>
7987
- </Show12>
8216
+ }}</For8>
8217
+ </Show13>
7988
8218
  <Content_default
7989
8219
  isNestedRender={props.isNestedRender}
7990
8220
  {...{}}
@@ -8037,8 +8267,14 @@ var fetchSymbolContent = async ({
8037
8267
 
8038
8268
  // src/blocks/symbol/symbol.tsx
8039
8269
  function Symbol2(props) {
8040
- const [contentToUse, setContentToUse] = createSignal16(props.symbol?.content);
8041
- const className = createMemo16(() => {
8270
+ const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
8271
+ const blocksWrapper = createMemo18(() => {
8272
+ return "div";
8273
+ });
8274
+ const contentWrapper = createMemo18(() => {
8275
+ return "div";
8276
+ });
8277
+ const className = createMemo18(() => {
8042
8278
  return [
8043
8279
  ...[props.attributes[getClassPropName()]],
8044
8280
  "builder-symbol",
@@ -8060,7 +8296,7 @@ function Symbol2(props) {
8060
8296
  }
8061
8297
  onMount5(() => {
8062
8298
  });
8063
- const onUpdateFn_0_props_symbol = createMemo16(() => props.symbol);
8299
+ const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
8064
8300
  function onUpdateFn_0() {
8065
8301
  setContent();
8066
8302
  }
@@ -8082,8 +8318,8 @@ function Symbol2(props) {
8082
8318
  model={props.symbol?.model}
8083
8319
  content={contentToUse()}
8084
8320
  linkComponent={props.builderLinkComponent}
8085
- blocksWrapper="div"
8086
- contentWrapper="div"
8321
+ blocksWrapper={blocksWrapper()}
8322
+ contentWrapper={contentWrapper()}
8087
8323
  /></div>;
8088
8324
  }
8089
8325
  var symbol_default = Symbol2;