@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.
@@ -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) {
@@ -3849,6 +3853,7 @@ function mapStyleObjToStrIfNeeded(style) {
3849
3853
  case "svelte":
3850
3854
  case "vue":
3851
3855
  case "solid":
3856
+ case "angular":
3852
3857
  return convertStyleMapToCSSArray(style).join(" ");
3853
3858
  case "qwik":
3854
3859
  case "reactNative":
@@ -3921,6 +3926,12 @@ var getRepeatItemData = ({
3921
3926
  }));
3922
3927
  return repeatArray;
3923
3928
  };
3929
+ var shouldPassLinkComponent = (block) => {
3930
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
3931
+ };
3932
+ var shouldPassRegisteredComponents = (block) => {
3933
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
3934
+ };
3924
3935
 
3925
3936
  // src/components/block/components/block-styles.tsx
3926
3937
  import { Show as Show2, createMemo } from "solid-js";
@@ -4164,15 +4175,15 @@ function BlockWrapper(props) {
4164
4175
  var Block_wrapper_default = BlockWrapper;
4165
4176
 
4166
4177
  // src/components/block/components/component-ref/component-ref.tsx
4167
- import { Show as Show3, For, createSignal as createSignal2 } from "solid-js";
4178
+ import { Show as Show3, For, createSignal as createSignal3 } from "solid-js";
4168
4179
  import { Dynamic as Dynamic3 } from "solid-js/web";
4169
4180
 
4170
4181
  // src/components/block/components/interactive-element.tsx
4182
+ import { createMemo as createMemo2 } from "solid-js";
4171
4183
  import { Dynamic as Dynamic2 } from "solid-js/web";
4172
4184
  function InteractiveElement(props) {
4173
- return <Dynamic2
4174
- {...props.wrapperProps}
4175
- attributes={props.includeBlockProps ? {
4185
+ const attributes = createMemo2(() => {
4186
+ return props.includeBlockProps ? {
4176
4187
  ...getBlockProperties({
4177
4188
  block: props.block,
4178
4189
  context: props.context
@@ -4184,7 +4195,11 @@ function InteractiveElement(props) {
4184
4195
  localState: props.context.localState,
4185
4196
  context: props.context.context
4186
4197
  })
4187
- } : {}}
4198
+ } : {};
4199
+ });
4200
+ return <Dynamic2
4201
+ {...props.wrapperProps}
4202
+ attributes={attributes()}
4188
4203
  component={props.Wrapper}
4189
4204
  >{props.children}</Dynamic2>;
4190
4205
  }
@@ -4225,7 +4240,7 @@ var getWrapperProps = ({
4225
4240
 
4226
4241
  // src/components/block/components/component-ref/component-ref.tsx
4227
4242
  function ComponentRef(props) {
4228
- const [Wrapper, setWrapper] = createSignal2(
4243
+ const [Wrapper, setWrapper] = createSignal3(
4229
4244
  props.isInteractive ? interactive_element_default : props.componentRef
4230
4245
  );
4231
4246
  return <Show3 when={props.componentRef}><Dynamic3
@@ -4254,9 +4269,9 @@ function ComponentRef(props) {
4254
4269
  var Component_ref_default = ComponentRef;
4255
4270
 
4256
4271
  // src/components/block/components/repeated-block.tsx
4257
- import { createSignal as createSignal3 } from "solid-js";
4272
+ import { createSignal as createSignal4 } from "solid-js";
4258
4273
  function RepeatedBlock(props) {
4259
- const [store, setStore] = createSignal3(props.repeatContext);
4274
+ const [store, setStore] = createSignal4(props.repeatContext);
4260
4275
  return <builder_context_default.Provider value={store()}><Block_default
4261
4276
  block={props.block}
4262
4277
  context={store()}
@@ -4268,20 +4283,20 @@ var Repeated_block_default = RepeatedBlock;
4268
4283
 
4269
4284
  // src/components/block/block.tsx
4270
4285
  function Block(props) {
4271
- const blockComponent = createMemo4(() => {
4286
+ const blockComponent = createMemo5(() => {
4272
4287
  return getComponent({
4273
4288
  block: props.block,
4274
4289
  context: props.context,
4275
4290
  registeredComponents: props.registeredComponents
4276
4291
  });
4277
4292
  });
4278
- const repeatItem = createMemo4(() => {
4293
+ const repeatItem = createMemo5(() => {
4279
4294
  return getRepeatItemData({
4280
4295
  block: props.block,
4281
4296
  context: props.context
4282
4297
  });
4283
4298
  });
4284
- const processedBlock = createMemo4(() => {
4299
+ const processedBlock = createMemo5(() => {
4285
4300
  return props.block.repeat?.collection ? props.block : getProcessedBlock({
4286
4301
  block: props.block,
4287
4302
  localState: props.context.localState,
@@ -4291,14 +4306,14 @@ function Block(props) {
4291
4306
  shouldEvaluateBindings: true
4292
4307
  });
4293
4308
  });
4294
- const Tag = createMemo4(() => {
4309
+ const Tag = createMemo5(() => {
4295
4310
  const shouldUseLink = props.block.tagName === "a" || processedBlock().properties?.href || processedBlock().href;
4296
4311
  if (shouldUseLink) {
4297
4312
  return props.linkComponent || "a";
4298
4313
  }
4299
4314
  return props.block.tagName || "div";
4300
4315
  });
4301
- const canShowBlock = createMemo4(() => {
4316
+ const canShowBlock = createMemo5(() => {
4302
4317
  if (props.block.repeat?.collection) {
4303
4318
  if (repeatItem()?.length)
4304
4319
  return true;
@@ -4308,21 +4323,21 @@ function Block(props) {
4308
4323
  const shouldShow = "show" in processedBlock() ? processedBlock().show : true;
4309
4324
  return shouldShow && !shouldHide;
4310
4325
  });
4311
- const childrenWithoutParentComponent = createMemo4(() => {
4326
+ const childrenWithoutParentComponent = createMemo5(() => {
4312
4327
  const shouldRenderChildrenOutsideRef = !blockComponent()?.component && !repeatItem();
4313
4328
  return shouldRenderChildrenOutsideRef ? processedBlock().children ?? [] : [];
4314
4329
  });
4315
- const componentRefProps = createMemo4(() => {
4330
+ const componentRefProps = createMemo5(() => {
4316
4331
  return {
4317
4332
  blockChildren: processedBlock().children ?? [],
4318
4333
  componentRef: blockComponent()?.component,
4319
4334
  componentOptions: {
4320
4335
  ...getBlockComponentOptions(processedBlock()),
4321
4336
  builderContext: props.context,
4322
- ...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
4337
+ ...shouldPassLinkComponent(blockComponent()) ? {
4323
4338
  builderLinkComponent: props.linkComponent
4324
4339
  } : {},
4325
- ...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
4340
+ ...shouldPassRegisteredComponents(blockComponent()) ? {
4326
4341
  builderComponents: props.registeredComponents
4327
4342
  } : {}
4328
4343
  },
@@ -4406,11 +4421,11 @@ function Block(props) {
4406
4421
  var Block_default = Block;
4407
4422
 
4408
4423
  // src/components/blocks/blocks-wrapper.tsx
4409
- import { createMemo as createMemo5 } from "solid-js";
4424
+ import { createMemo as createMemo6 } from "solid-js";
4410
4425
  import { Dynamic as Dynamic4 } from "solid-js/web";
4411
4426
  import { css } from "solid-styled-components";
4412
4427
  function BlocksWrapper(props) {
4413
- const className = createMemo5(() => {
4428
+ const className = createMemo6(() => {
4414
4429
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
4415
4430
  });
4416
4431
  function onClick() {
@@ -4484,16 +4499,24 @@ function Blocks(props) {
4484
4499
  }
4485
4500
  var Blocks_default = Blocks;
4486
4501
 
4502
+ // src/blocks/columns/helpers.ts
4503
+ var getColumnsClass = (id2) => {
4504
+ return `builder-columns ${id2}-breakpoints`;
4505
+ };
4506
+
4487
4507
  // src/blocks/columns/columns.tsx
4488
4508
  function Columns(props) {
4489
- const [gutterSize, setGutterSize] = createSignal6(
4509
+ const [gutterSize, setGutterSize] = createSignal7(
4490
4510
  typeof props.space === "number" ? props.space || 0 : 20
4491
4511
  );
4492
- const [cols, setCols] = createSignal6(props.columns || []);
4493
- const [stackAt, setStackAt] = createSignal6(props.stackColumnsAt || "tablet");
4494
- const [flexDir, setFlexDir] = createSignal6(
4512
+ const [cols, setCols] = createSignal7(props.columns || []);
4513
+ const [stackAt, setStackAt] = createSignal7(props.stackColumnsAt || "tablet");
4514
+ const [flexDir, setFlexDir] = createSignal7(
4495
4515
  props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column"
4496
4516
  );
4517
+ function getTagName(column) {
4518
+ return column.link ? props.builderLinkComponent || "a" : "div";
4519
+ }
4497
4520
  function getWidth(index) {
4498
4521
  return cols()[index]?.width || 100 / cols().length;
4499
4522
  }
@@ -4513,7 +4536,7 @@ function Columns(props) {
4513
4536
  }) {
4514
4537
  return stackAt() === "never" ? desktopStyle : stackedStyle;
4515
4538
  }
4516
- const columnsCssVars = createMemo6(() => {
4539
+ function columnsCssVars() {
4517
4540
  return {
4518
4541
  "--flex-dir": flexDir(),
4519
4542
  "--flex-dir-tablet": getTabletStyle({
@@ -4521,7 +4544,7 @@ function Columns(props) {
4521
4544
  desktopStyle: "row"
4522
4545
  })
4523
4546
  };
4524
- });
4547
+ }
4525
4548
  function columnCssVars(index) {
4526
4549
  const gutter = index === 0 ? 0 : gutterSize();
4527
4550
  const width = getColumnCssWidth(index);
@@ -4562,7 +4585,7 @@ function Columns(props) {
4562
4585
  );
4563
4586
  return breakpointSizes[size].max;
4564
4587
  }
4565
- const columnsStyles = createMemo6(() => {
4588
+ function columnsStyles() {
4566
4589
  return `
4567
4590
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
4568
4591
  .${props.builderBlock.id}-breakpoints {
@@ -4588,9 +4611,19 @@ function Columns(props) {
4588
4611
  }
4589
4612
  },
4590
4613
  `;
4591
- });
4614
+ }
4615
+ function getAttributes(column, index) {
4616
+ return {
4617
+ ...{},
4618
+ ...column.link ? {
4619
+ href: column.link
4620
+ } : {},
4621
+ [getClassPropName()]: "builder-column",
4622
+ style: mapStyleObjToStrIfNeeded(columnCssVars(index))
4623
+ };
4624
+ }
4592
4625
  return <div
4593
- class={`builder-columns ${props.builderBlock.id}-breakpoints ` + css2({
4626
+ class={getColumnsClass(props.builderBlock?.id) + " " + css2({
4594
4627
  display: "flex",
4595
4628
  lineHeight: "normal"
4596
4629
  })}
@@ -4605,16 +4638,9 @@ function Columns(props) {
4605
4638
  const index = _index();
4606
4639
  return <Dynamic_renderer_default
4607
4640
  key={index}
4608
- TagName={column.link ? props.builderLinkComponent || "a" : "div"}
4641
+ TagName={getTagName(column)}
4609
4642
  actionAttributes={{}}
4610
- attributes={{
4611
- ...{},
4612
- ...column.link ? {
4613
- href: column.link
4614
- } : {},
4615
- [getClassPropName()]: "builder-column",
4616
- style: mapStyleObjToStrIfNeeded(columnCssVars(index))
4617
- }}
4643
+ attributes={getAttributes(column, index)}
4618
4644
  ><Blocks_default
4619
4645
  path={`component.options.columns.${index}.blocks`}
4620
4646
  parent={props.builderBlock.id}
@@ -4638,7 +4664,7 @@ function FragmentComponent(props) {
4638
4664
  var fragment_default = FragmentComponent;
4639
4665
 
4640
4666
  // src/blocks/image/image.tsx
4641
- import { Show as Show7, createMemo as createMemo7 } from "solid-js";
4667
+ import { Show as Show7, createMemo as createMemo8 } from "solid-js";
4642
4668
  import { css as css3 } from "solid-styled-components";
4643
4669
 
4644
4670
  // src/blocks/image/image.helpers.ts
@@ -4690,7 +4716,7 @@ function getSrcSet(url) {
4690
4716
 
4691
4717
  // src/blocks/image/image.tsx
4692
4718
  function Image(props) {
4693
- const srcSetToUse = createMemo7(() => {
4719
+ const srcSetToUse = createMemo8(() => {
4694
4720
  const imageToUse = props.image || props.src;
4695
4721
  const url = imageToUse;
4696
4722
  if (!url || // We can auto add srcset for cdn.builder.io and shopify
@@ -4707,14 +4733,14 @@ function Image(props) {
4707
4733
  }
4708
4734
  return getSrcSet(url);
4709
4735
  });
4710
- const webpSrcSet = createMemo7(() => {
4736
+ const webpSrcSet = createMemo8(() => {
4711
4737
  if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
4712
4738
  return srcSetToUse().replace(/\?/g, "?format=webp&");
4713
4739
  } else {
4714
4740
  return "";
4715
4741
  }
4716
4742
  });
4717
- const aspectRatioCss = createMemo7(() => {
4743
+ const aspectRatioCss = createMemo8(() => {
4718
4744
  const aspectRatioStyles = {
4719
4745
  position: "absolute",
4720
4746
  height: "100%",
@@ -4759,7 +4785,7 @@ function Image(props) {
4759
4785
  }}
4760
4786
  /></Show7>
4761
4787
  <Show7 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show7>
4762
- <Show7 when={!props.fitContent && props.children}><div
4788
+ <Show7 when={!props.fitContent && props.builderBlock?.children?.length}><div
4763
4789
  class={css3({
4764
4790
  display: "flex",
4765
4791
  flexDirection: "column",
@@ -4797,10 +4823,10 @@ function SectionComponent(props) {
4797
4823
  var section_default = SectionComponent;
4798
4824
 
4799
4825
  // src/blocks/symbol/symbol.tsx
4800
- import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo16, createSignal as createSignal16 } from "solid-js";
4826
+ import { onMount as onMount5, on as on3, createEffect as createEffect3, createMemo as createMemo18, createSignal as createSignal18 } from "solid-js";
4801
4827
 
4802
4828
  // src/components/content-variants/content-variants.tsx
4803
- import { Show as Show12, For as For7, onMount as onMount4, createSignal as createSignal15, createMemo as createMemo15 } from "solid-js";
4829
+ import { Show as Show13, For as For8, onMount as onMount4, createSignal as createSignal17, createMemo as createMemo17 } from "solid-js";
4804
4830
 
4805
4831
  // src/helpers/url.ts
4806
4832
  var getTopLevelDomain = (host) => {
@@ -4994,7 +5020,7 @@ var handleABTesting = async ({
4994
5020
  var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
4995
5021
 
4996
5022
  // src/components/content/content.tsx
4997
- import { Show as Show11, createSignal as createSignal14 } from "solid-js";
5023
+ import { Show as Show12, createSignal as createSignal16 } from "solid-js";
4998
5024
 
4999
5025
  // src/blocks/button/component-info.ts
5000
5026
  var componentInfo = {
@@ -5495,8 +5521,203 @@ var componentInfo7 = {
5495
5521
  }]
5496
5522
  };
5497
5523
 
5498
- // src/blocks/text/component-info.ts
5524
+ // src/blocks/tabs/component-info.ts
5525
+ var defaultTab = {
5526
+ "@type": "@builder.io/sdk:Element",
5527
+ responsiveStyles: {
5528
+ large: {
5529
+ paddingLeft: "20px",
5530
+ paddingRight: "20px",
5531
+ paddingTop: "10px",
5532
+ paddingBottom: "10px",
5533
+ minWidth: "100px",
5534
+ textAlign: "center",
5535
+ display: "flex",
5536
+ flexDirection: "column",
5537
+ cursor: "pointer",
5538
+ userSelect: "none"
5539
+ }
5540
+ },
5541
+ component: {
5542
+ name: "Text",
5543
+ options: {
5544
+ text: "New tab"
5545
+ }
5546
+ }
5547
+ };
5548
+ var defaultElement = {
5549
+ "@type": "@builder.io/sdk:Element",
5550
+ responsiveStyles: {
5551
+ large: {
5552
+ height: "200px",
5553
+ display: "flex",
5554
+ marginTop: "20px",
5555
+ flexDirection: "column"
5556
+ }
5557
+ },
5558
+ component: {
5559
+ name: "Text",
5560
+ options: {
5561
+ text: "New tab content "
5562
+ }
5563
+ }
5564
+ };
5499
5565
  var componentInfo8 = {
5566
+ name: "Builder: Tabs",
5567
+ inputs: [{
5568
+ name: "tabs",
5569
+ type: "list",
5570
+ broadcast: true,
5571
+ subFields: [{
5572
+ name: "label",
5573
+ type: "uiBlocks",
5574
+ hideFromUI: true,
5575
+ defaultValue: [defaultTab]
5576
+ }, {
5577
+ name: "content",
5578
+ type: "uiBlocks",
5579
+ hideFromUI: true,
5580
+ defaultValue: [defaultElement]
5581
+ }],
5582
+ defaultValue: [{
5583
+ label: [{
5584
+ ...defaultTab,
5585
+ component: {
5586
+ name: "Text",
5587
+ options: {
5588
+ text: "Tab 1"
5589
+ }
5590
+ }
5591
+ }],
5592
+ content: [{
5593
+ ...defaultElement,
5594
+ component: {
5595
+ name: "Text",
5596
+ options: {
5597
+ text: "Tab 1 content"
5598
+ }
5599
+ }
5600
+ }]
5601
+ }, {
5602
+ label: [{
5603
+ ...defaultTab,
5604
+ component: {
5605
+ name: "Text",
5606
+ options: {
5607
+ text: "Tab 2"
5608
+ }
5609
+ }
5610
+ }],
5611
+ content: [{
5612
+ ...defaultElement,
5613
+ component: {
5614
+ name: "Text",
5615
+ options: {
5616
+ text: "Tab 2 content"
5617
+ }
5618
+ }
5619
+ }]
5620
+ }]
5621
+ }, {
5622
+ name: "activeTabStyle",
5623
+ type: "uiStyle",
5624
+ helperText: "CSS styles for the active tab",
5625
+ defaultValue: {
5626
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
5627
+ }
5628
+ }, {
5629
+ name: "defaultActiveTab",
5630
+ type: "number",
5631
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
5632
+ defaultValue: 1,
5633
+ advanced: true
5634
+ }, {
5635
+ name: "collapsible",
5636
+ type: "boolean",
5637
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
5638
+ defaultValue: false,
5639
+ advanced: true
5640
+ }, {
5641
+ name: "tabHeaderLayout",
5642
+ type: "enum",
5643
+ helperText: "Change the layout of the tab headers (uses justify-content)",
5644
+ defaultValue: "flex-start",
5645
+ enum: [{
5646
+ label: "Center",
5647
+ value: "center"
5648
+ }, {
5649
+ label: "Space between",
5650
+ value: "space-between"
5651
+ }, {
5652
+ label: "Space around",
5653
+ value: "space-around"
5654
+ }, {
5655
+ label: "Left",
5656
+ value: "flex-start"
5657
+ }, {
5658
+ label: "Right",
5659
+ value: "flex-end"
5660
+ }]
5661
+ }]
5662
+ };
5663
+
5664
+ // src/blocks/tabs/tabs.tsx
5665
+ import { Show as Show8, For as For5, createSignal as createSignal9 } from "solid-js";
5666
+ function Tabs(props) {
5667
+ const [activeTab, setActiveTab] = createSignal9(
5668
+ props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
5669
+ );
5670
+ function activeTabContent(active) {
5671
+ return props.tabs && props.tabs[active].content;
5672
+ }
5673
+ function getActiveTabStyle(index) {
5674
+ return activeTab() === index ? props.activeTabStyle : {};
5675
+ }
5676
+ return <div>
5677
+ <div
5678
+ class="builder-tabs-wrap"
5679
+ style={{
5680
+ display: "flex",
5681
+ "flex-direction": "row",
5682
+ "justify-content": props.tabHeaderLayout || "flex-start",
5683
+ overflow: "auto"
5684
+ }}
5685
+ ><For5 each={props.tabs}>{(tab, _index) => {
5686
+ const index = _index();
5687
+ return <span
5688
+ class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
5689
+ key={index}
5690
+ style={getActiveTabStyle(index)}
5691
+ onClick={(event) => {
5692
+ if (index === activeTab() && props.collapsible) {
5693
+ setActiveTab(-1);
5694
+ } else {
5695
+ setActiveTab(index);
5696
+ }
5697
+ }}
5698
+ ><Blocks_default
5699
+ parent={props.builderBlock.id}
5700
+ path={`component.options.tabs.${index}.label`}
5701
+ blocks={tab.label}
5702
+ context={props.builderContext}
5703
+ registeredComponents={props.builderComponents}
5704
+ linkComponent={props.builderLinkComponent}
5705
+ /></span>;
5706
+ }}</For5></div>
5707
+ <Show8 when={activeTabContent(activeTab())}><div><Blocks_default
5708
+ parent={props.builderBlock.id}
5709
+ path={`component.options.tabs.${activeTab()}.content`}
5710
+ blocks={activeTabContent(activeTab())}
5711
+ context={props.builderContext}
5712
+ registeredComponents={props.builderComponents}
5713
+ linkComponent={props.builderLinkComponent}
5714
+ /></div></Show8>
5715
+ </div>;
5716
+ }
5717
+ var tabs_default = Tabs;
5718
+
5719
+ // src/blocks/text/component-info.ts
5720
+ var componentInfo9 = {
5500
5721
  name: "Text",
5501
5722
  static: true,
5502
5723
  isRSC: true,
@@ -5529,7 +5750,7 @@ function Text(props) {
5529
5750
  var text_default = Text;
5530
5751
 
5531
5752
  // src/blocks/custom-code/component-info.ts
5532
- var componentInfo9 = {
5753
+ var componentInfo10 = {
5533
5754
  name: "Custom Code",
5534
5755
  static: true,
5535
5756
  requiredPermissions: ["editCode"],
@@ -5554,10 +5775,10 @@ var componentInfo9 = {
5554
5775
  };
5555
5776
 
5556
5777
  // src/blocks/custom-code/custom-code.tsx
5557
- import { onMount as onMount2, createSignal as createSignal8 } from "solid-js";
5778
+ import { onMount as onMount2, createSignal as createSignal10 } from "solid-js";
5558
5779
  function CustomCode(props) {
5559
- const [scriptsInserted, setScriptsInserted] = createSignal8([]);
5560
- const [scriptsRun, setScriptsRun] = createSignal8([]);
5780
+ const [scriptsInserted, setScriptsInserted] = createSignal10([]);
5781
+ const [scriptsRun, setScriptsRun] = createSignal10([]);
5561
5782
  let elementRef;
5562
5783
  onMount2(() => {
5563
5784
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -5600,7 +5821,7 @@ function CustomCode(props) {
5600
5821
  var custom_code_default = CustomCode;
5601
5822
 
5602
5823
  // src/blocks/embed/component-info.ts
5603
- var componentInfo10 = {
5824
+ var componentInfo11 = {
5604
5825
  name: "Embed",
5605
5826
  static: true,
5606
5827
  inputs: [{
@@ -5638,7 +5859,7 @@ var componentInfo10 = {
5638
5859
  };
5639
5860
 
5640
5861
  // src/blocks/embed/embed.tsx
5641
- import { on, createEffect, createMemo as createMemo9, createSignal as createSignal9 } from "solid-js";
5862
+ import { on, createEffect, createMemo as createMemo11, createSignal as createSignal11 } from "solid-js";
5642
5863
 
5643
5864
  // src/blocks/embed/helpers.ts
5644
5865
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -5646,9 +5867,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
5646
5867
 
5647
5868
  // src/blocks/embed/embed.tsx
5648
5869
  function Embed(props) {
5649
- const [scriptsInserted, setScriptsInserted] = createSignal9([]);
5650
- const [scriptsRun, setScriptsRun] = createSignal9([]);
5651
- const [ranInitFn, setRanInitFn] = createSignal9(false);
5870
+ const [scriptsInserted, setScriptsInserted] = createSignal11([]);
5871
+ const [scriptsRun, setScriptsRun] = createSignal11([]);
5872
+ const [ranInitFn, setRanInitFn] = createSignal11(false);
5652
5873
  function findAndRunScripts() {
5653
5874
  if (!elem || !elem.getElementsByTagName)
5654
5875
  return;
@@ -5671,8 +5892,8 @@ function Embed(props) {
5671
5892
  }
5672
5893
  }
5673
5894
  let elem;
5674
- const onUpdateFn_0_elem = createMemo9(() => elem);
5675
- const onUpdateFn_0_ranInitFn__ = createMemo9(() => ranInitFn());
5895
+ const onUpdateFn_0_elem = createMemo11(() => elem);
5896
+ const onUpdateFn_0_ranInitFn__ = createMemo11(() => ranInitFn());
5676
5897
  function onUpdateFn_0() {
5677
5898
  if (elem && !ranInitFn()) {
5678
5899
  setRanInitFn(true);
@@ -5687,7 +5908,7 @@ function Embed(props) {
5687
5908
  var embed_default = Embed;
5688
5909
 
5689
5910
  // src/blocks/form/form/component-info.ts
5690
- var componentInfo11 = {
5911
+ var componentInfo12 = {
5691
5912
  name: "Form:Form",
5692
5913
  // editableTags: ['builder-form-error']
5693
5914
  defaults: {
@@ -5921,7 +6142,7 @@ var componentInfo11 = {
5921
6142
  };
5922
6143
 
5923
6144
  // src/blocks/form/form/form.tsx
5924
- import { Show as Show8, For as For5, createSignal as createSignal10 } from "solid-js";
6145
+ import { Show as Show9, For as For6, createSignal as createSignal12 } from "solid-js";
5925
6146
  import { css as css4 } from "solid-styled-components";
5926
6147
 
5927
6148
  // src/functions/get-env.ts
@@ -5939,9 +6160,9 @@ var get = (obj, path, defaultValue) => {
5939
6160
 
5940
6161
  // src/blocks/form/form/form.tsx
5941
6162
  function FormComponent(props) {
5942
- const [formState, setFormState] = createSignal10("unsubmitted");
5943
- const [responseData, setResponseData] = createSignal10(null);
5944
- const [formErrorMessage, setFormErrorMessage] = createSignal10("");
6163
+ const [formState, setFormState] = createSignal12("unsubmitted");
6164
+ const [responseData, setResponseData] = createSignal12(null);
6165
+ const [formErrorMessage, setFormErrorMessage] = createSignal12("");
5945
6166
  function mergeNewRootState(newData) {
5946
6167
  const combinedState = {
5947
6168
  ...props.builderContext.rootState,
@@ -6137,7 +6358,7 @@ function FormComponent(props) {
6137
6358
  {...{}}
6138
6359
  {...props.attributes}
6139
6360
  >
6140
- <Show8 when={props.builderBlock && props.builderBlock.children}><For5 each={props.builderBlock?.children}>{(block, _index) => {
6361
+ <Show9 when={props.builderBlock && props.builderBlock.children}><For6 each={props.builderBlock?.children}>{(block, _index) => {
6141
6362
  const idx = _index();
6142
6363
  return <Block_default
6143
6364
  key={`form-block-${idx}`}
@@ -6146,35 +6367,35 @@ function FormComponent(props) {
6146
6367
  registeredComponents={props.builderComponents}
6147
6368
  linkComponent={props.builderLinkComponent}
6148
6369
  />;
6149
- }}</For5></Show8>
6150
- <Show8 when={submissionState() === "error"}><Blocks_default
6370
+ }}</For6></Show9>
6371
+ <Show9 when={submissionState() === "error"}><Blocks_default
6151
6372
  path="errorMessage"
6152
6373
  blocks={props.errorMessage}
6153
6374
  context={props.builderContext}
6154
- /></Show8>
6155
- <Show8 when={submissionState() === "sending"}><Blocks_default
6375
+ /></Show9>
6376
+ <Show9 when={submissionState() === "sending"}><Blocks_default
6156
6377
  path="sendingMessage"
6157
6378
  blocks={props.sendingMessage}
6158
6379
  context={props.builderContext}
6159
- /></Show8>
6160
- <Show8 when={submissionState() === "error" && responseData()}><pre
6380
+ /></Show9>
6381
+ <Show9 when={submissionState() === "error" && responseData()}><pre
6161
6382
  class={"builder-form-error-text " + css4({
6162
6383
  padding: "10px",
6163
6384
  color: "red",
6164
6385
  textAlign: "center"
6165
6386
  })}
6166
- >{JSON.stringify(responseData(), null, 2)}</pre></Show8>
6167
- <Show8 when={submissionState() === "success"}><Blocks_default
6387
+ >{JSON.stringify(responseData(), null, 2)}</pre></Show9>
6388
+ <Show9 when={submissionState() === "success"}><Blocks_default
6168
6389
  path="successMessage"
6169
6390
  blocks={props.successMessage}
6170
6391
  context={props.builderContext}
6171
- /></Show8>
6392
+ /></Show9>
6172
6393
  </form>;
6173
6394
  }
6174
6395
  var form_default = FormComponent;
6175
6396
 
6176
6397
  // src/blocks/form/input/component-info.ts
6177
- var componentInfo12 = {
6398
+ var componentInfo13 = {
6178
6399
  name: "Form:Input",
6179
6400
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
6180
6401
  inputs: [
@@ -6244,7 +6465,7 @@ function FormInputComponent(props) {
6244
6465
  var input_default = FormInputComponent;
6245
6466
 
6246
6467
  // src/blocks/form/select/component-info.ts
6247
- var componentInfo13 = {
6468
+ var componentInfo14 = {
6248
6469
  name: "Form:Select",
6249
6470
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
6250
6471
  defaultStyles: {
@@ -6289,7 +6510,7 @@ var componentInfo13 = {
6289
6510
  };
6290
6511
 
6291
6512
  // src/blocks/form/select/select.tsx
6292
- import { For as For6 } from "solid-js";
6513
+ import { For as For7 } from "solid-js";
6293
6514
  function SelectComponent(props) {
6294
6515
  return <select
6295
6516
  {...{}}
@@ -6298,15 +6519,15 @@ function SelectComponent(props) {
6298
6519
  key={isEditing() && props.defaultValue ? props.defaultValue : "default-key"}
6299
6520
  defaultValue={props.defaultValue}
6300
6521
  name={props.name}
6301
- ><For6 each={props.options}>{(option, _index) => {
6522
+ ><For7 each={props.options}>{(option, _index) => {
6302
6523
  const index = _index();
6303
6524
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
6304
- }}</For6></select>;
6525
+ }}</For7></select>;
6305
6526
  }
6306
6527
  var select_default = SelectComponent;
6307
6528
 
6308
6529
  // src/blocks/form/submit-button/component-info.ts
6309
- var componentInfo14 = {
6530
+ var componentInfo15 = {
6310
6531
  name: "Form:SubmitButton",
6311
6532
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
6312
6533
  defaultStyles: {
@@ -6340,7 +6561,7 @@ function SubmitButton(props) {
6340
6561
  var submit_button_default = SubmitButton;
6341
6562
 
6342
6563
  // src/blocks/img/component-info.ts
6343
- var componentInfo15 = {
6564
+ var componentInfo16 = {
6344
6565
  // friendlyName?
6345
6566
  name: "Raw:Img",
6346
6567
  hideFromInsertMenu: true,
@@ -6373,7 +6594,7 @@ function ImgComponent(props) {
6373
6594
  var img_default = ImgComponent;
6374
6595
 
6375
6596
  // src/blocks/video/component-info.ts
6376
- var componentInfo16 = {
6597
+ var componentInfo17 = {
6377
6598
  name: "Video",
6378
6599
  canHaveChildren: true,
6379
6600
  defaultStyles: {
@@ -6457,9 +6678,9 @@ var componentInfo16 = {
6457
6678
  };
6458
6679
 
6459
6680
  // src/blocks/video/video.tsx
6460
- import { Show as Show9, createMemo as createMemo11 } from "solid-js";
6681
+ import { Show as Show10, createMemo as createMemo13 } from "solid-js";
6461
6682
  function Video(props) {
6462
- const videoProps = createMemo11(() => {
6683
+ const videoProps = createMemo13(() => {
6463
6684
  return {
6464
6685
  ...props.autoPlay === true ? {
6465
6686
  autoPlay: true
@@ -6478,7 +6699,7 @@ function Video(props) {
6478
6699
  } : {}
6479
6700
  };
6480
6701
  });
6481
- const spreadProps = createMemo11(() => {
6702
+ const spreadProps = createMemo13(() => {
6482
6703
  return {
6483
6704
  ...videoProps()
6484
6705
  };
@@ -6508,8 +6729,8 @@ function Video(props) {
6508
6729
  }}
6509
6730
  src={props.video || "no-src"}
6510
6731
  poster={props.posterImage}
6511
- ><Show9 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show9></video>
6512
- <Show9
6732
+ ><Show10 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show10></video>
6733
+ <Show10
6513
6734
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
6514
6735
  ><div
6515
6736
  style={{
@@ -6518,15 +6739,15 @@ function Video(props) {
6518
6739
  "pointer-events": "none",
6519
6740
  "font-size": "0px"
6520
6741
  }}
6521
- /></Show9>
6522
- <Show9 when={props.builderBlock?.children?.length && props.fitContent}><div
6742
+ /></Show10>
6743
+ <Show10 when={props.builderBlock?.children?.length && props.fitContent}><div
6523
6744
  style={{
6524
6745
  display: "flex",
6525
6746
  "flex-direction": "column",
6526
6747
  "align-items": "stretch"
6527
6748
  }}
6528
- >{props.children}</div></Show9>
6529
- <Show9 when={props.builderBlock?.children?.length && !props.fitContent}><div
6749
+ >{props.children}</div></Show10>
6750
+ <Show10 when={props.builderBlock?.children?.length && !props.fitContent}><div
6530
6751
  style={{
6531
6752
  "pointer-events": "none",
6532
6753
  display: "flex",
@@ -6538,7 +6759,7 @@ function Video(props) {
6538
6759
  width: "100%",
6539
6760
  height: "100%"
6540
6761
  }}
6541
- >{props.children}</div></Show9>
6762
+ >{props.children}</div></Show10>
6542
6763
  </div>;
6543
6764
  }
6544
6765
  var video_default = Video;
@@ -6546,28 +6767,28 @@ var video_default = Video;
6546
6767
  // src/constants/extra-components.ts
6547
6768
  var getExtraComponents = () => [{
6548
6769
  component: custom_code_default,
6549
- ...componentInfo9
6770
+ ...componentInfo10
6550
6771
  }, {
6551
6772
  component: embed_default,
6552
- ...componentInfo10
6773
+ ...componentInfo11
6553
6774
  }, ...TARGET === "rsc" ? [] : [{
6554
6775
  component: form_default,
6555
- ...componentInfo11
6776
+ ...componentInfo12
6556
6777
  }, {
6557
6778
  component: input_default,
6558
- ...componentInfo12
6779
+ ...componentInfo13
6559
6780
  }, {
6560
6781
  component: submit_button_default,
6561
- ...componentInfo14
6782
+ ...componentInfo15
6562
6783
  }, {
6563
6784
  component: select_default,
6564
- ...componentInfo13
6785
+ ...componentInfo14
6565
6786
  }], {
6566
6787
  component: img_default,
6567
- ...componentInfo15
6788
+ ...componentInfo16
6568
6789
  }, {
6569
6790
  component: video_default,
6570
- ...componentInfo16
6791
+ ...componentInfo17
6571
6792
  }];
6572
6793
 
6573
6794
  // src/constants/builder-registered-components.ts
@@ -6594,8 +6815,11 @@ var getDefaultRegisteredComponents = () => [{
6594
6815
  ...componentInfo7
6595
6816
  }, {
6596
6817
  component: text_default,
6818
+ ...componentInfo9
6819
+ }, ...TARGET === "rsc" ? [] : [{
6820
+ component: tabs_default,
6597
6821
  ...componentInfo8
6598
- }, ...getExtraComponents()];
6822
+ }], ...getExtraComponents()];
6599
6823
 
6600
6824
  // src/functions/register-component.ts
6601
6825
  var createRegisterComponentMessage = (info) => ({
@@ -6673,12 +6897,12 @@ var Inlined_script_default = InlinedScript;
6673
6897
 
6674
6898
  // src/components/content/components/enable-editor.tsx
6675
6899
  import {
6676
- Show as Show10,
6900
+ Show as Show11,
6677
6901
  onMount as onMount3,
6678
6902
  on as on2,
6679
6903
  createEffect as createEffect2,
6680
- createMemo as createMemo12,
6681
- createSignal as createSignal12
6904
+ createMemo as createMemo14,
6905
+ createSignal as createSignal14
6682
6906
  } from "solid-js";
6683
6907
  import { Dynamic as Dynamic5 } from "solid-js/web";
6684
6908
 
@@ -7161,7 +7385,7 @@ function isFromTrustedHost(trustedHosts, e) {
7161
7385
  }
7162
7386
 
7163
7387
  // src/constants/sdk-version.ts
7164
- var SDK_VERSION = "1.0.23";
7388
+ var SDK_VERSION = "1.0.25";
7165
7389
 
7166
7390
  // src/functions/register.ts
7167
7391
  var registry = {};
@@ -7357,14 +7581,93 @@ var subscribeToEditor = (model, callback, options) => {
7357
7581
  };
7358
7582
  };
7359
7583
 
7584
+ // src/components/content/components/styles.helpers.ts
7585
+ var getCssFromFont = (font) => {
7586
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
7587
+ const name = family.split(",")[0];
7588
+ const url = font.fileUrl ?? font?.files?.regular;
7589
+ let str = "";
7590
+ if (url && family && name) {
7591
+ str += `
7592
+ @font-face {
7593
+ font-family: "${family}";
7594
+ src: local("${name}"), url('${url}') format('woff2');
7595
+ font-display: fallback;
7596
+ font-weight: 400;
7597
+ }
7598
+ `.trim();
7599
+ }
7600
+ if (font.files) {
7601
+ for (const weight in font.files) {
7602
+ const isNumber = String(Number(weight)) === weight;
7603
+ if (!isNumber) {
7604
+ continue;
7605
+ }
7606
+ const weightUrl = font.files[weight];
7607
+ if (weightUrl && weightUrl !== url) {
7608
+ str += `
7609
+ @font-face {
7610
+ font-family: "${family}";
7611
+ src: url('${weightUrl}') format('woff2');
7612
+ font-display: fallback;
7613
+ font-weight: ${weight};
7614
+ }
7615
+ `.trim();
7616
+ }
7617
+ }
7618
+ }
7619
+ return str;
7620
+ };
7621
+ var getFontCss = ({
7622
+ customFonts
7623
+ }) => {
7624
+ return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
7625
+ };
7626
+ var getCss = ({
7627
+ cssCode,
7628
+ contentId
7629
+ }) => {
7630
+ if (!cssCode) {
7631
+ return "";
7632
+ }
7633
+ if (!contentId) {
7634
+ return cssCode;
7635
+ }
7636
+ return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
7637
+ };
7638
+ var DEFAULT_STYLES = `
7639
+ .builder-button {
7640
+ all: unset;
7641
+ }
7642
+
7643
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
7644
+ margin: 0;
7645
+ }
7646
+ .builder-text > p, .builder-text > .builder-paragraph {
7647
+ color: inherit;
7648
+ line-height: inherit;
7649
+ letter-spacing: inherit;
7650
+ font-weight: inherit;
7651
+ font-size: inherit;
7652
+ text-align: inherit;
7653
+ font-family: inherit;
7654
+ }
7655
+ `;
7656
+ var getDefaultStyles = (isNested) => {
7657
+ return !isNested ? DEFAULT_STYLES : "";
7658
+ };
7659
+ var getWrapperClassName = (variationId) => {
7660
+ return `variant-${variationId}`;
7661
+ };
7662
+
7360
7663
  // src/components/content/components/enable-editor.tsx
7361
7664
  function EnableEditor(props) {
7362
- const [ContentWrapper, setContentWrapper] = createSignal12(
7665
+ const [ContentWrapper, setContentWrapper] = createSignal14(
7363
7666
  props.contentWrapper || "div"
7364
7667
  );
7365
- const [httpReqsData, setHttpReqsData] = createSignal12({});
7366
- const [httpReqsPending, setHttpReqsPending] = createSignal12({});
7367
- const [clicked, setClicked] = createSignal12(false);
7668
+ const [httpReqsData, setHttpReqsData] = createSignal14({});
7669
+ const [httpReqsPending, setHttpReqsPending] = createSignal14({});
7670
+ const [clicked, setClicked] = createSignal14(false);
7368
7671
  function mergeNewRootState(newData) {
7369
7672
  const combinedState = {
7370
7673
  ...props.builderContextSignal.rootState,
@@ -7398,6 +7701,12 @@ function EnableEditor(props) {
7398
7701
  content: newContentValue
7399
7702
  }));
7400
7703
  }
7704
+ const showContentProps = createMemo14(() => {
7705
+ return props.showContent ? {} : {
7706
+ hidden: true,
7707
+ "aria-hidden": true
7708
+ };
7709
+ });
7401
7710
  function processMessage(event) {
7402
7711
  return createEditorListener({
7403
7712
  model: props.model,
@@ -7582,14 +7891,14 @@ function EnableEditor(props) {
7582
7891
  runHttpRequests();
7583
7892
  emitStateUpdate();
7584
7893
  });
7585
- const onUpdateFn_0_props_content = createMemo12(() => props.content);
7894
+ const onUpdateFn_0_props_content = createMemo14(() => props.content);
7586
7895
  function onUpdateFn_0() {
7587
7896
  if (props.content) {
7588
7897
  mergeNewContent(props.content);
7589
7898
  }
7590
7899
  }
7591
7900
  createEffect2(on2(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
7592
- const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo12(() => props.builderContextSignal.content?.data?.jsCode);
7901
+ const onUpdateFn_1_props_builderContextSignal_content__data__jsCode = createMemo14(() => props.builderContextSignal.content?.data?.jsCode);
7593
7902
  function onUpdateFn_1() {
7594
7903
  evaluateJsCode();
7595
7904
  }
@@ -7599,7 +7908,7 @@ function EnableEditor(props) {
7599
7908
  onUpdateFn_1
7600
7909
  )
7601
7910
  );
7602
- const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo12(() => props.builderContextSignal.content?.data?.httpRequests);
7911
+ const onUpdateFn_2_props_builderContextSignal_content__data__httpRequests = createMemo14(() => props.builderContextSignal.content?.data?.httpRequests);
7603
7912
  function onUpdateFn_2() {
7604
7913
  runHttpRequests();
7605
7914
  }
@@ -7611,7 +7920,7 @@ function EnableEditor(props) {
7611
7920
  onUpdateFn_2
7612
7921
  )
7613
7922
  );
7614
- const onUpdateFn_3_props_builderContextSignal_rootState = createMemo12(
7923
+ const onUpdateFn_3_props_builderContextSignal_rootState = createMemo14(
7615
7924
  () => props.builderContextSignal.rootState
7616
7925
  );
7617
7926
  function onUpdateFn_3() {
@@ -7623,14 +7932,14 @@ function EnableEditor(props) {
7623
7932
  onUpdateFn_3
7624
7933
  )
7625
7934
  );
7626
- const onUpdateFn_4_props_data = createMemo12(() => props.data);
7935
+ const onUpdateFn_4_props_data = createMemo14(() => props.data);
7627
7936
  function onUpdateFn_4() {
7628
7937
  if (props.data) {
7629
7938
  mergeNewRootState(props.data);
7630
7939
  }
7631
7940
  }
7632
7941
  createEffect2(on2(() => [onUpdateFn_4_props_data()], onUpdateFn_4));
7633
- const onUpdateFn_5_props_locale = createMemo12(() => props.locale);
7942
+ const onUpdateFn_5_props_locale = createMemo14(() => props.locale);
7634
7943
  function onUpdateFn_5() {
7635
7944
  if (props.locale) {
7636
7945
  mergeNewRootState({
@@ -7639,106 +7948,27 @@ function EnableEditor(props) {
7639
7948
  }
7640
7949
  }
7641
7950
  createEffect2(on2(() => [onUpdateFn_5_props_locale()], onUpdateFn_5));
7642
- return <builder_context_default.Provider value={props.builderContextSignal}><Show10 when={props.builderContextSignal.content}><Dynamic5
7643
- class={`variant-${props.content?.testVariationId || props.content?.id}`}
7951
+ return <builder_context_default.Provider value={props.builderContextSignal}><Show11 when={props.builderContextSignal.content}><Dynamic5
7952
+ class={getWrapperClassName(
7953
+ props.content?.testVariationId || props.content?.id
7954
+ )}
7644
7955
  {...{}}
7645
7956
  ref={elementRef}
7646
7957
  onClick={(event) => onClick(event)}
7647
7958
  builder-content-id={props.builderContextSignal.content?.id}
7648
7959
  builder-model={props.model}
7649
7960
  {...{}}
7650
- {...props.showContent ? {} : {
7651
- hidden: true,
7652
- "aria-hidden": true
7653
- }}
7961
+ {...showContentProps()}
7654
7962
  {...props.contentWrapperProps}
7655
7963
  component={ContentWrapper()}
7656
- >{props.children}</Dynamic5></Show10></builder_context_default.Provider>;
7964
+ >{props.children}</Dynamic5></Show11></builder_context_default.Provider>;
7657
7965
  }
7658
7966
  var Enable_editor_default = EnableEditor;
7659
7967
 
7660
7968
  // src/components/content/components/styles.tsx
7661
- import { createSignal as createSignal13 } from "solid-js";
7662
-
7663
- // src/components/content/components/styles.helpers.ts
7664
- var getCssFromFont = (font) => {
7665
- const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
7666
- const name = family.split(",")[0];
7667
- const url = font.fileUrl ?? font?.files?.regular;
7668
- let str = "";
7669
- if (url && family && name) {
7670
- str += `
7671
- @font-face {
7672
- font-family: "${family}";
7673
- src: local("${name}"), url('${url}') format('woff2');
7674
- font-display: fallback;
7675
- font-weight: 400;
7676
- }
7677
- `.trim();
7678
- }
7679
- if (font.files) {
7680
- for (const weight in font.files) {
7681
- const isNumber = String(Number(weight)) === weight;
7682
- if (!isNumber) {
7683
- continue;
7684
- }
7685
- const weightUrl = font.files[weight];
7686
- if (weightUrl && weightUrl !== url) {
7687
- str += `
7688
- @font-face {
7689
- font-family: "${family}";
7690
- src: url('${weightUrl}') format('woff2');
7691
- font-display: fallback;
7692
- font-weight: ${weight};
7693
- }
7694
- `.trim();
7695
- }
7696
- }
7697
- }
7698
- return str;
7699
- };
7700
- var getFontCss = ({
7701
- customFonts
7702
- }) => {
7703
- return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
7704
- };
7705
- var getCss = ({
7706
- cssCode,
7707
- contentId
7708
- }) => {
7709
- if (!cssCode) {
7710
- return "";
7711
- }
7712
- if (!contentId) {
7713
- return cssCode;
7714
- }
7715
- return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
7716
- };
7717
- var DEFAULT_STYLES = `
7718
- .builder-button {
7719
- all: unset;
7720
- }
7721
-
7722
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
7723
- margin: 0;
7724
- }
7725
- .builder-text > p, .builder-text > .builder-paragraph {
7726
- color: inherit;
7727
- line-height: inherit;
7728
- letter-spacing: inherit;
7729
- font-weight: inherit;
7730
- font-size: inherit;
7731
- text-align: inherit;
7732
- font-family: inherit;
7733
- }
7734
- `;
7735
- var getDefaultStyles = (isNested) => {
7736
- return !isNested ? DEFAULT_STYLES : "";
7737
- };
7738
-
7739
- // src/components/content/components/styles.tsx
7969
+ import { createSignal as createSignal15 } from "solid-js";
7740
7970
  function ContentStyles(props) {
7741
- const [injectedStyles, setInjectedStyles] = createSignal13(
7971
+ const [injectedStyles, setInjectedStyles] = createSignal15(
7742
7972
  `
7743
7973
  ${getCss({
7744
7974
  cssCode: props.cssCode,
@@ -7795,7 +8025,7 @@ var getContentInitialValue = ({
7795
8025
 
7796
8026
  // src/components/content/content.tsx
7797
8027
  function ContentComponent(props) {
7798
- const [scriptStr, setScriptStr] = createSignal14(
8028
+ const [scriptStr, setScriptStr] = createSignal16(
7799
8029
  getUpdateVariantVisibilityScript({
7800
8030
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
7801
8031
  variationId: props.content?.testVariationId,
@@ -7803,7 +8033,7 @@ function ContentComponent(props) {
7803
8033
  contentId: props.content?.id
7804
8034
  })
7805
8035
  );
7806
- const [registeredComponents, setRegisteredComponents] = createSignal14(
8036
+ const [registeredComponents, setRegisteredComponents] = createSignal16(
7807
8037
  [
7808
8038
  ...getDefaultRegisteredComponents(),
7809
8039
  ...props.customComponents || []
@@ -7818,7 +8048,7 @@ function ContentComponent(props) {
7818
8048
  {}
7819
8049
  )
7820
8050
  );
7821
- const [builderContextSignal, setBuilderContextSignal] = createSignal14({
8051
+ const [builderContextSignal, setBuilderContextSignal] = createSignal16({
7822
8052
  content: getContentInitialValue({
7823
8053
  content: props.content,
7824
8054
  data: props.data
@@ -7876,16 +8106,16 @@ function ContentComponent(props) {
7876
8106
  setBuilderContextSignal
7877
8107
  }}
7878
8108
  >
7879
- <Show11 when={props.isSsrAbTest}><Inlined_script_default
8109
+ <Show12 when={props.isSsrAbTest}><Inlined_script_default
7880
8110
  id="builderio-variant-visibility"
7881
8111
  scriptStr={scriptStr()}
7882
- /></Show11>
7883
- <Show11 when={TARGET !== "reactNative"}><Styles_default
8112
+ /></Show12>
8113
+ <Show12 when={TARGET !== "reactNative"}><Styles_default
7884
8114
  isNestedRender={props.isNestedRender}
7885
8115
  contentId={builderContextSignal().content?.id}
7886
8116
  cssCode={builderContextSignal().content?.data?.cssCode}
7887
8117
  customFonts={builderContextSignal().content?.data?.customFonts}
7888
- /></Show11>
8118
+ /></Show12>
7889
8119
  <Blocks_default
7890
8120
  blocks={builderContextSignal().content?.data?.blocks}
7891
8121
  context={builderContextSignal()}
@@ -7898,13 +8128,13 @@ var Content_default = ContentComponent;
7898
8128
 
7899
8129
  // src/components/content-variants/content-variants.tsx
7900
8130
  function ContentVariants(props) {
7901
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal15(
8131
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal17(
7902
8132
  checkShouldRenderVariants({
7903
8133
  canTrack: getDefaultCanTrack(props.canTrack),
7904
8134
  content: props.content
7905
8135
  })
7906
8136
  );
7907
- const updateCookieAndStylesScriptStr = createMemo15(() => {
8137
+ const updateCookieAndStylesScriptStr = createMemo17(() => {
7908
8138
  return getUpdateCookieAndStylesScript(
7909
8139
  getVariants(props.content).map((value) => ({
7910
8140
  id: value.testVariationId,
@@ -7913,10 +8143,10 @@ function ContentVariants(props) {
7913
8143
  props.content?.id || ""
7914
8144
  );
7915
8145
  });
7916
- const hideVariantsStyleString = createMemo15(() => {
8146
+ const hideVariantsStyleString = createMemo17(() => {
7917
8147
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
7918
8148
  });
7919
- const defaultContent = createMemo15(() => {
8149
+ const defaultContent = createMemo17(() => {
7920
8150
  return shouldRenderVariants() ? {
7921
8151
  ...props.content,
7922
8152
  testVariationId: props.content?.id
@@ -7929,11 +8159,11 @@ function ContentVariants(props) {
7929
8159
  setShouldRenderVariants(false);
7930
8160
  });
7931
8161
  return <>
7932
- <Show12 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
8162
+ <Show13 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
7933
8163
  id="builderio-init-variants-fns"
7934
8164
  scriptStr={getInitVariantsFnsScriptString()}
7935
- /></Show12>
7936
- <Show12 when={shouldRenderVariants()}>
8165
+ /></Show13>
8166
+ <Show13 when={shouldRenderVariants()}>
7937
8167
  <Inlined_styles_default
7938
8168
  id="builderio-variants"
7939
8169
  styles={hideVariantsStyleString()}
@@ -7942,7 +8172,7 @@ function ContentVariants(props) {
7942
8172
  id="builderio-variants-visibility"
7943
8173
  scriptStr={updateCookieAndStylesScriptStr()}
7944
8174
  />
7945
- <For7 each={getVariants(props.content)}>{(variant, _index) => {
8175
+ <For8 each={getVariants(props.content)}>{(variant, _index) => {
7946
8176
  const index = _index();
7947
8177
  return <Content_default
7948
8178
  isNestedRender={props.isNestedRender}
@@ -7966,8 +8196,8 @@ function ContentVariants(props) {
7966
8196
  contentWrapperProps={props.contentWrapperProps}
7967
8197
  trustedHosts={props.trustedHosts}
7968
8198
  />;
7969
- }}</For7>
7970
- </Show12>
8199
+ }}</For8>
8200
+ </Show13>
7971
8201
  <Content_default
7972
8202
  isNestedRender={props.isNestedRender}
7973
8203
  {...{}}
@@ -8020,8 +8250,14 @@ var fetchSymbolContent = async ({
8020
8250
 
8021
8251
  // src/blocks/symbol/symbol.tsx
8022
8252
  function Symbol2(props) {
8023
- const [contentToUse, setContentToUse] = createSignal16(props.symbol?.content);
8024
- const className = createMemo16(() => {
8253
+ const [contentToUse, setContentToUse] = createSignal18(props.symbol?.content);
8254
+ const blocksWrapper = createMemo18(() => {
8255
+ return "div";
8256
+ });
8257
+ const contentWrapper = createMemo18(() => {
8258
+ return "div";
8259
+ });
8260
+ const className = createMemo18(() => {
8025
8261
  return [
8026
8262
  ...[props.attributes[getClassPropName()]],
8027
8263
  "builder-symbol",
@@ -8043,7 +8279,7 @@ function Symbol2(props) {
8043
8279
  }
8044
8280
  onMount5(() => {
8045
8281
  });
8046
- const onUpdateFn_0_props_symbol = createMemo16(() => props.symbol);
8282
+ const onUpdateFn_0_props_symbol = createMemo18(() => props.symbol);
8047
8283
  function onUpdateFn_0() {
8048
8284
  setContent();
8049
8285
  }
@@ -8065,8 +8301,8 @@ function Symbol2(props) {
8065
8301
  model={props.symbol?.model}
8066
8302
  content={contentToUse()}
8067
8303
  linkComponent={props.builderLinkComponent}
8068
- blocksWrapper="div"
8069
- contentWrapper="div"
8304
+ blocksWrapper={blocksWrapper()}
8305
+ contentWrapper={contentWrapper()}
8070
8306
  /></div>;
8071
8307
  }
8072
8308
  var symbol_default = Symbol2;