@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/node/dev.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
1
+ import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
2
2
  import { createContext, useContext, Show, For, createSignal, createMemo, onMount, createEffect, on } from 'solid-js';
3
3
  import { css } from 'solid-styled-components';
4
4
  import { createRequire } from 'node:module';
@@ -69,25 +69,29 @@ var getClassPropName = () => {
69
69
  case "vue":
70
70
  case "solid":
71
71
  case "qwik":
72
+ case "angular":
72
73
  return "class";
73
74
  }
74
75
  };
75
76
 
76
77
  // src/blocks/button/button.tsx
77
78
  function Button(props) {
79
+ function attrs() {
80
+ return {
81
+ ...props.attributes,
82
+ [getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
83
+ ...props.link ? {
84
+ href: props.link,
85
+ target: props.openLinkInNewTab ? "_blank" : void 0,
86
+ role: "link"
87
+ } : {
88
+ role: "button"
89
+ }
90
+ };
91
+ }
78
92
  return createComponent(dynamic_renderer_default, {
79
93
  get attributes() {
80
- return {
81
- ...props.attributes,
82
- [getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
83
- ...props.link ? {
84
- href: props.link,
85
- target: props.openLinkInNewTab ? "_blank" : void 0,
86
- role: "link"
87
- } : {
88
- role: "button"
89
- }
90
- };
94
+ return attrs();
91
95
  },
92
96
  get TagName() {
93
97
  return props.link ? props.builderLinkComponent || "a" : "button";
@@ -373,16 +377,17 @@ function theFunction() {
373
377
  ${code}
374
378
  }
375
379
 
376
- let output = theFunction()
380
+ const output = theFunction()
377
381
 
378
382
  if (typeof output === 'object' && output !== null) {
379
- output = JSON.stringify(output.copySync ? output.copySync() : output);
383
+ return JSON.stringify(output.copySync ? output.copySync() : output);
384
+ } else {
385
+ return output;
380
386
  }
381
-
382
- output;
383
387
  `;
384
388
  };
385
389
  var IVM_INSTANCE = null;
390
+ var IVM_CONTEXT = null;
386
391
  var getIvm = () => {
387
392
  try {
388
393
  if (IVM_INSTANCE)
@@ -402,12 +407,26 @@ var getIvm = () => {
402
407
  Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
403
408
  `);
404
409
  };
405
- var getIsolateContext = () => {
410
+ function setIsolateContext(options = {
411
+ memoryLimit: 128
412
+ }) {
406
413
  const ivm = getIvm();
407
- const isolate = new ivm.Isolate({
408
- memoryLimit: 128
414
+ const isolate = new ivm.Isolate(options);
415
+ const context = isolate.createContextSync();
416
+ const jail = context.global;
417
+ jail.setSync("global", jail.derefInto());
418
+ jail.setSync("log", function(...logArgs) {
419
+ console.log(...logArgs);
409
420
  });
410
- return isolate.createContextSync();
421
+ jail.setSync(INJECTED_IVM_GLOBAL, ivm);
422
+ IVM_CONTEXT = context;
423
+ return context;
424
+ }
425
+ var getIsolateContext = () => {
426
+ if (IVM_CONTEXT)
427
+ return IVM_CONTEXT;
428
+ const context = setIsolateContext();
429
+ return context;
411
430
  };
412
431
  var runInNode = ({
413
432
  code,
@@ -431,10 +450,6 @@ var runInNode = ({
431
450
  });
432
451
  const isolateContext = getIsolateContext();
433
452
  const jail = isolateContext.global;
434
- jail.setSync("global", jail.derefInto());
435
- jail.setSync("log", function(...logArgs) {
436
- console.log(...logArgs);
437
- });
438
453
  jail.setSync(BUILDER_SET_STATE_NAME, function(key, value) {
439
454
  set(rootState, key, value);
440
455
  rootSetState?.(rootState);
@@ -449,12 +464,11 @@ var runInNode = ({
449
464
  ) : null;
450
465
  jail.setSync(getSyncValName(key), val);
451
466
  });
452
- jail.setSync(INJECTED_IVM_GLOBAL, ivm);
453
467
  const evalStr = processCode({
454
468
  code,
455
469
  args
456
470
  });
457
- const resultStr = isolateContext.evalSync(evalStr);
471
+ const resultStr = isolateContext.evalClosureSync(evalStr);
458
472
  try {
459
473
  const res = JSON.parse(resultStr);
460
474
  return res;
@@ -855,6 +869,7 @@ function mapStyleObjToStrIfNeeded(style) {
855
869
  case "svelte":
856
870
  case "vue":
857
871
  case "solid":
872
+ case "angular":
858
873
  return convertStyleMapToCSSArray(style).join(" ");
859
874
  case "qwik":
860
875
  case "reactNative":
@@ -930,6 +945,12 @@ var getRepeatItemData = ({
930
945
  }));
931
946
  return repeatArray;
932
947
  };
948
+ var shouldPassLinkComponent = (block) => {
949
+ return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
950
+ };
951
+ var shouldPassRegisteredComponents = (block) => {
952
+ return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
953
+ };
933
954
 
934
955
  // src/constants/device-sizes.ts
935
956
  var SIZES = {
@@ -1186,21 +1207,24 @@ function BlockWrapper(props) {
1186
1207
  }
1187
1208
  var block_wrapper_default = BlockWrapper;
1188
1209
  function InteractiveElement(props) {
1210
+ const attributes = createMemo(() => {
1211
+ return props.includeBlockProps ? {
1212
+ ...getBlockProperties({
1213
+ block: props.block,
1214
+ context: props.context
1215
+ }),
1216
+ ...getBlockActions({
1217
+ block: props.block,
1218
+ rootState: props.context.rootState,
1219
+ rootSetState: props.context.rootSetState,
1220
+ localState: props.context.localState,
1221
+ context: props.context.context
1222
+ })
1223
+ } : {};
1224
+ });
1189
1225
  return createComponent(Dynamic, mergeProps(() => props.wrapperProps, {
1190
1226
  get attributes() {
1191
- return memo(() => !!props.includeBlockProps)() ? {
1192
- ...getBlockProperties({
1193
- block: props.block,
1194
- context: props.context
1195
- }),
1196
- ...getBlockActions({
1197
- block: props.block,
1198
- rootState: props.context.rootState,
1199
- rootSetState: props.context.rootSetState,
1200
- localState: props.context.localState,
1201
- context: props.context.context
1202
- })
1203
- } : {};
1227
+ return attributes();
1204
1228
  },
1205
1229
  get component() {
1206
1230
  return props.Wrapper;
@@ -1375,10 +1399,10 @@ function Block(props) {
1375
1399
  componentOptions: {
1376
1400
  ...getBlockComponentOptions(processedBlock()),
1377
1401
  builderContext: props.context,
1378
- ...blockComponent()?.name === "Core:Button" || blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1402
+ ...shouldPassLinkComponent(blockComponent()) ? {
1379
1403
  builderLinkComponent: props.linkComponent
1380
1404
  } : {},
1381
- ...blockComponent()?.name === "Symbol" || blockComponent()?.name === "Columns" || blockComponent()?.name === "Form:Form" ? {
1405
+ ...shouldPassRegisteredComponents(blockComponent()) ? {
1382
1406
  builderComponents: props.registeredComponents
1383
1407
  } : {}
1384
1408
  },
@@ -1670,6 +1694,11 @@ function Blocks(props) {
1670
1694
  }
1671
1695
  var blocks_default = Blocks;
1672
1696
 
1697
+ // src/blocks/columns/helpers.ts
1698
+ var getColumnsClass = (id) => {
1699
+ return `builder-columns ${id}-breakpoints`;
1700
+ };
1701
+
1673
1702
  // src/blocks/columns/columns.tsx
1674
1703
  var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
1675
1704
  function Columns(props) {
@@ -1677,6 +1706,9 @@ function Columns(props) {
1677
1706
  const [cols, setCols] = createSignal(props.columns || []);
1678
1707
  const [stackAt, setStackAt] = createSignal(props.stackColumnsAt || "tablet");
1679
1708
  const [flexDir, setFlexDir] = createSignal(props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column");
1709
+ function getTagName(column) {
1710
+ return column.link ? props.builderLinkComponent || "a" : "div";
1711
+ }
1680
1712
  function getWidth(index) {
1681
1713
  return cols()[index]?.width || 100 / cols().length;
1682
1714
  }
@@ -1696,7 +1728,7 @@ function Columns(props) {
1696
1728
  }) {
1697
1729
  return stackAt() === "never" ? desktopStyle : stackedStyle;
1698
1730
  }
1699
- const columnsCssVars = createMemo(() => {
1731
+ function columnsCssVars() {
1700
1732
  return {
1701
1733
  "--flex-dir": flexDir(),
1702
1734
  "--flex-dir-tablet": getTabletStyle({
@@ -1704,7 +1736,7 @@ function Columns(props) {
1704
1736
  desktopStyle: "row"
1705
1737
  })
1706
1738
  };
1707
- });
1739
+ }
1708
1740
  function columnCssVars(index) {
1709
1741
  const gutter = index === 0 ? 0 : gutterSize();
1710
1742
  const width = getColumnCssWidth(index);
@@ -1743,7 +1775,7 @@ function Columns(props) {
1743
1775
  const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
1744
1776
  return breakpointSizes[size].max;
1745
1777
  }
1746
- const columnsStyles = createMemo(() => {
1778
+ function columnsStyles() {
1747
1779
  return `
1748
1780
  @media (max-width: ${getWidthForBreakpointSize("medium")}px) {
1749
1781
  .${props.builderBlock.id}-breakpoints {
@@ -1769,12 +1801,22 @@ function Columns(props) {
1769
1801
  }
1770
1802
  },
1771
1803
  `;
1772
- });
1804
+ }
1805
+ function getAttributes(column, index) {
1806
+ return {
1807
+ ...{},
1808
+ ...column.link ? {
1809
+ href: column.link
1810
+ } : {},
1811
+ [getClassPropName()]: "builder-column",
1812
+ style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1813
+ };
1814
+ }
1773
1815
  return (() => {
1774
1816
  const _el$ = _tmpl$2();
1775
1817
  spread(_el$, mergeProps({
1776
1818
  get ["class"]() {
1777
- return `builder-columns ${props.builderBlock.id}-breakpoints ` + css({
1819
+ return getColumnsClass(props.builderBlock?.id) + " " + css({
1778
1820
  display: "flex",
1779
1821
  lineHeight: "normal"
1780
1822
  });
@@ -1803,18 +1845,11 @@ function Columns(props) {
1803
1845
  return createComponent(dynamic_renderer_default, {
1804
1846
  key: index,
1805
1847
  get TagName() {
1806
- return column.link ? props.builderLinkComponent || "a" : "div";
1848
+ return getTagName(column);
1807
1849
  },
1808
1850
  actionAttributes: {},
1809
1851
  get attributes() {
1810
- return {
1811
- ...{},
1812
- ...column.link ? {
1813
- href: column.link
1814
- } : {},
1815
- [getClassPropName()]: "builder-column",
1816
- style: mapStyleObjToStrIfNeeded(columnCssVars(index))
1817
- };
1852
+ return getAttributes(column, index);
1818
1853
  },
1819
1854
  get children() {
1820
1855
  return createComponent(blocks_default, {
@@ -2013,7 +2048,7 @@ function Image(props) {
2013
2048
  }
2014
2049
  }), createComponent(Show, {
2015
2050
  get when() {
2016
- return !props.fitContent && props.children;
2051
+ return !props.fitContent && props.builderBlock?.children?.length;
2017
2052
  },
2018
2053
  get children() {
2019
2054
  const _el$5 = _tmpl$32();
@@ -2758,8 +2793,246 @@ var componentInfo7 = {
2758
2793
  }]
2759
2794
  };
2760
2795
 
2761
- // src/blocks/text/component-info.ts
2796
+ // src/blocks/tabs/component-info.ts
2797
+ var defaultTab = {
2798
+ "@type": "@builder.io/sdk:Element",
2799
+ responsiveStyles: {
2800
+ large: {
2801
+ paddingLeft: "20px",
2802
+ paddingRight: "20px",
2803
+ paddingTop: "10px",
2804
+ paddingBottom: "10px",
2805
+ minWidth: "100px",
2806
+ textAlign: "center",
2807
+ display: "flex",
2808
+ flexDirection: "column",
2809
+ cursor: "pointer",
2810
+ userSelect: "none"
2811
+ }
2812
+ },
2813
+ component: {
2814
+ name: "Text",
2815
+ options: {
2816
+ text: "New tab"
2817
+ }
2818
+ }
2819
+ };
2820
+ var defaultElement = {
2821
+ "@type": "@builder.io/sdk:Element",
2822
+ responsiveStyles: {
2823
+ large: {
2824
+ height: "200px",
2825
+ display: "flex",
2826
+ marginTop: "20px",
2827
+ flexDirection: "column"
2828
+ }
2829
+ },
2830
+ component: {
2831
+ name: "Text",
2832
+ options: {
2833
+ text: "New tab content "
2834
+ }
2835
+ }
2836
+ };
2762
2837
  var componentInfo8 = {
2838
+ name: "Builder: Tabs",
2839
+ inputs: [{
2840
+ name: "tabs",
2841
+ type: "list",
2842
+ broadcast: true,
2843
+ subFields: [{
2844
+ name: "label",
2845
+ type: "uiBlocks",
2846
+ hideFromUI: true,
2847
+ defaultValue: [defaultTab]
2848
+ }, {
2849
+ name: "content",
2850
+ type: "uiBlocks",
2851
+ hideFromUI: true,
2852
+ defaultValue: [defaultElement]
2853
+ }],
2854
+ defaultValue: [{
2855
+ label: [{
2856
+ ...defaultTab,
2857
+ component: {
2858
+ name: "Text",
2859
+ options: {
2860
+ text: "Tab 1"
2861
+ }
2862
+ }
2863
+ }],
2864
+ content: [{
2865
+ ...defaultElement,
2866
+ component: {
2867
+ name: "Text",
2868
+ options: {
2869
+ text: "Tab 1 content"
2870
+ }
2871
+ }
2872
+ }]
2873
+ }, {
2874
+ label: [{
2875
+ ...defaultTab,
2876
+ component: {
2877
+ name: "Text",
2878
+ options: {
2879
+ text: "Tab 2"
2880
+ }
2881
+ }
2882
+ }],
2883
+ content: [{
2884
+ ...defaultElement,
2885
+ component: {
2886
+ name: "Text",
2887
+ options: {
2888
+ text: "Tab 2 content"
2889
+ }
2890
+ }
2891
+ }]
2892
+ }]
2893
+ }, {
2894
+ name: "activeTabStyle",
2895
+ type: "uiStyle",
2896
+ helperText: "CSS styles for the active tab",
2897
+ defaultValue: {
2898
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
2899
+ }
2900
+ }, {
2901
+ name: "defaultActiveTab",
2902
+ type: "number",
2903
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
2904
+ defaultValue: 1,
2905
+ advanced: true
2906
+ }, {
2907
+ name: "collapsible",
2908
+ type: "boolean",
2909
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
2910
+ defaultValue: false,
2911
+ advanced: true
2912
+ }, {
2913
+ name: "tabHeaderLayout",
2914
+ type: "enum",
2915
+ helperText: "Change the layout of the tab headers (uses justify-content)",
2916
+ defaultValue: "flex-start",
2917
+ enum: [{
2918
+ label: "Center",
2919
+ value: "center"
2920
+ }, {
2921
+ label: "Space between",
2922
+ value: "space-between"
2923
+ }, {
2924
+ label: "Space around",
2925
+ value: "space-around"
2926
+ }, {
2927
+ label: "Left",
2928
+ value: "flex-start"
2929
+ }, {
2930
+ label: "Right",
2931
+ value: "flex-end"
2932
+ }]
2933
+ }]
2934
+ };
2935
+ var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
2936
+ var _tmpl$23 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
2937
+ var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
2938
+ function Tabs(props) {
2939
+ const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
2940
+ function activeTabContent(active) {
2941
+ return props.tabs && props.tabs[active].content;
2942
+ }
2943
+ function getActiveTabStyle(index) {
2944
+ return activeTab() === index ? props.activeTabStyle : {};
2945
+ }
2946
+ return (() => {
2947
+ const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
2948
+ _el$2.style.setProperty("display", "flex");
2949
+ _el$2.style.setProperty("flex-direction", "row");
2950
+ _el$2.style.setProperty("overflow", "auto");
2951
+ insert(_el$2, createComponent(For, {
2952
+ get each() {
2953
+ return props.tabs;
2954
+ },
2955
+ children: (tab, _index) => {
2956
+ const index = _index();
2957
+ return (() => {
2958
+ const _el$4 = _tmpl$33();
2959
+ _el$4.$$click = (event) => {
2960
+ if (index === activeTab() && props.collapsible) {
2961
+ setActiveTab(-1);
2962
+ } else {
2963
+ setActiveTab(index);
2964
+ }
2965
+ };
2966
+ setAttribute(_el$4, "key", index);
2967
+ insert(_el$4, createComponent(blocks_default, {
2968
+ get parent() {
2969
+ return props.builderBlock.id;
2970
+ },
2971
+ path: `component.options.tabs.${index}.label`,
2972
+ get blocks() {
2973
+ return tab.label;
2974
+ },
2975
+ get context() {
2976
+ return props.builderContext;
2977
+ },
2978
+ get registeredComponents() {
2979
+ return props.builderComponents;
2980
+ },
2981
+ get linkComponent() {
2982
+ return props.builderLinkComponent;
2983
+ }
2984
+ }));
2985
+ effect((_p$) => {
2986
+ const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = getActiveTabStyle(index);
2987
+ _v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
2988
+ _p$._v$2 = style(_el$4, _v$2, _p$._v$2);
2989
+ return _p$;
2990
+ }, {
2991
+ _v$: void 0,
2992
+ _v$2: void 0
2993
+ });
2994
+ return _el$4;
2995
+ })();
2996
+ }
2997
+ }));
2998
+ insert(_el$, createComponent(Show, {
2999
+ get when() {
3000
+ return activeTabContent(activeTab());
3001
+ },
3002
+ get children() {
3003
+ const _el$3 = _tmpl$7();
3004
+ insert(_el$3, createComponent(blocks_default, {
3005
+ get parent() {
3006
+ return props.builderBlock.id;
3007
+ },
3008
+ get path() {
3009
+ return `component.options.tabs.${activeTab()}.content`;
3010
+ },
3011
+ get blocks() {
3012
+ return activeTabContent(activeTab());
3013
+ },
3014
+ get context() {
3015
+ return props.builderContext;
3016
+ },
3017
+ get registeredComponents() {
3018
+ return props.builderComponents;
3019
+ },
3020
+ get linkComponent() {
3021
+ return props.builderLinkComponent;
3022
+ }
3023
+ }));
3024
+ return _el$3;
3025
+ }
3026
+ }), null);
3027
+ effect(() => (props.tabHeaderLayout || "flex-start") != null ? _el$2.style.setProperty("justify-content", props.tabHeaderLayout || "flex-start") : _el$2.style.removeProperty("justify-content"));
3028
+ return _el$;
3029
+ })();
3030
+ }
3031
+ var tabs_default = Tabs;
3032
+ delegateEvents(["click"]);
3033
+
3034
+ // src/blocks/text/component-info.ts
3035
+ var componentInfo9 = {
2763
3036
  name: "Text",
2764
3037
  static: true,
2765
3038
  isRSC: true,
@@ -2778,10 +3051,10 @@ var componentInfo8 = {
2778
3051
  textAlign: "center"
2779
3052
  }
2780
3053
  };
2781
- var _tmpl$7 = /* @__PURE__ */ template(`<div class=builder-text>`);
3054
+ var _tmpl$8 = /* @__PURE__ */ template(`<div class=builder-text>`);
2782
3055
  function Text(props) {
2783
3056
  return (() => {
2784
- const _el$ = _tmpl$7();
3057
+ const _el$ = _tmpl$8();
2785
3058
  _el$.style.setProperty("outline", "none");
2786
3059
  effect(() => _el$.innerHTML = props.text?.toString() || "");
2787
3060
  return _el$;
@@ -2790,7 +3063,7 @@ function Text(props) {
2790
3063
  var text_default = Text;
2791
3064
 
2792
3065
  // src/blocks/custom-code/component-info.ts
2793
- var componentInfo9 = {
3066
+ var componentInfo10 = {
2794
3067
  name: "Custom Code",
2795
3068
  static: true,
2796
3069
  requiredPermissions: ["editCode"],
@@ -2813,7 +3086,7 @@ var componentInfo9 = {
2813
3086
  advanced: true
2814
3087
  }]
2815
3088
  };
2816
- var _tmpl$8 = /* @__PURE__ */ template(`<div>`);
3089
+ var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
2817
3090
  function CustomCode(props) {
2818
3091
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
2819
3092
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -2848,7 +3121,7 @@ function CustomCode(props) {
2848
3121
  }
2849
3122
  });
2850
3123
  return (() => {
2851
- const _el$ = _tmpl$8();
3124
+ const _el$ = _tmpl$9();
2852
3125
  const _ref$ = elementRef;
2853
3126
  typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
2854
3127
  effect((_p$) => {
@@ -2866,7 +3139,7 @@ function CustomCode(props) {
2866
3139
  var custom_code_default = CustomCode;
2867
3140
 
2868
3141
  // src/blocks/embed/component-info.ts
2869
- var componentInfo10 = {
3142
+ var componentInfo11 = {
2870
3143
  name: "Embed",
2871
3144
  static: true,
2872
3145
  inputs: [{
@@ -2908,7 +3181,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
2908
3181
  var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
2909
3182
 
2910
3183
  // src/blocks/embed/embed.tsx
2911
- var _tmpl$9 = /* @__PURE__ */ template(`<div class=builder-embed>`);
3184
+ var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-embed>`);
2912
3185
  function Embed(props) {
2913
3186
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
2914
3187
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -2946,7 +3219,7 @@ function Embed(props) {
2946
3219
  }
2947
3220
  createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
2948
3221
  return (() => {
2949
- const _el$ = _tmpl$9();
3222
+ const _el$ = _tmpl$10();
2950
3223
  const _ref$ = elem;
2951
3224
  typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
2952
3225
  effect(() => _el$.innerHTML = props.content);
@@ -2956,7 +3229,7 @@ function Embed(props) {
2956
3229
  var embed_default = Embed;
2957
3230
 
2958
3231
  // src/blocks/form/form/component-info.ts
2959
- var componentInfo11 = {
3232
+ var componentInfo12 = {
2960
3233
  name: "Form:Form",
2961
3234
  // editableTags: ['builder-form-error']
2962
3235
  defaults: {
@@ -3203,8 +3476,8 @@ var get = (obj, path, defaultValue) => {
3203
3476
  };
3204
3477
 
3205
3478
  // src/blocks/form/form/form.tsx
3206
- var _tmpl$10 = /* @__PURE__ */ template(`<pre>`);
3207
- var _tmpl$23 = /* @__PURE__ */ template(`<form>`);
3479
+ var _tmpl$11 = /* @__PURE__ */ template(`<pre>`);
3480
+ var _tmpl$24 = /* @__PURE__ */ template(`<form>`);
3208
3481
  function FormComponent(props) {
3209
3482
  const [formState, setFormState] = createSignal("unsubmitted");
3210
3483
  const [responseData, setResponseData] = createSignal(null);
@@ -3390,7 +3663,7 @@ function FormComponent(props) {
3390
3663
  }
3391
3664
  let formRef;
3392
3665
  return (() => {
3393
- const _el$ = _tmpl$23();
3666
+ const _el$ = _tmpl$24();
3394
3667
  _el$.addEventListener("submit", (event) => onSubmit(event));
3395
3668
  const _ref$ = formRef;
3396
3669
  typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
@@ -3473,7 +3746,7 @@ function FormComponent(props) {
3473
3746
  return memo(() => submissionState() === "error")() && responseData();
3474
3747
  },
3475
3748
  get children() {
3476
- const _el$2 = _tmpl$10();
3749
+ const _el$2 = _tmpl$11();
3477
3750
  insert(_el$2, () => JSON.stringify(responseData(), null, 2));
3478
3751
  effect(() => className(_el$2, "builder-form-error-text " + css({
3479
3752
  padding: "10px",
@@ -3505,7 +3778,7 @@ function FormComponent(props) {
3505
3778
  var form_default = FormComponent;
3506
3779
 
3507
3780
  // src/blocks/form/input/component-info.ts
3508
- var componentInfo12 = {
3781
+ var componentInfo13 = {
3509
3782
  name: "Form:Input",
3510
3783
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3511
3784
  inputs: [
@@ -3557,10 +3830,10 @@ var componentInfo12 = {
3557
3830
  borderColor: "#ccc"
3558
3831
  }
3559
3832
  };
3560
- var _tmpl$11 = /* @__PURE__ */ template(`<input>`);
3833
+ var _tmpl$12 = /* @__PURE__ */ template(`<input>`);
3561
3834
  function FormInputComponent(props) {
3562
3835
  return (() => {
3563
- const _el$ = _tmpl$11();
3836
+ const _el$ = _tmpl$12();
3564
3837
  spread(_el$, mergeProps({}, () => props.attributes, {
3565
3838
  get key() {
3566
3839
  return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
@@ -3590,7 +3863,7 @@ function FormInputComponent(props) {
3590
3863
  var input_default = FormInputComponent;
3591
3864
 
3592
3865
  // src/blocks/form/select/component-info.ts
3593
- var componentInfo13 = {
3866
+ var componentInfo14 = {
3594
3867
  name: "Form:Select",
3595
3868
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3596
3869
  defaultStyles: {
@@ -3633,11 +3906,11 @@ var componentInfo13 = {
3633
3906
  static: true,
3634
3907
  noWrap: true
3635
3908
  };
3636
- var _tmpl$12 = /* @__PURE__ */ template(`<select>`);
3637
- var _tmpl$24 = /* @__PURE__ */ template(`<option>`);
3909
+ var _tmpl$13 = /* @__PURE__ */ template(`<select>`);
3910
+ var _tmpl$25 = /* @__PURE__ */ template(`<option>`);
3638
3911
  function SelectComponent(props) {
3639
3912
  return (() => {
3640
- const _el$ = _tmpl$12();
3913
+ const _el$ = _tmpl$13();
3641
3914
  spread(_el$, mergeProps({}, () => props.attributes, {
3642
3915
  get value() {
3643
3916
  return props.value;
@@ -3659,7 +3932,7 @@ function SelectComponent(props) {
3659
3932
  children: (option, _index) => {
3660
3933
  const index = _index();
3661
3934
  return (() => {
3662
- const _el$2 = _tmpl$24();
3935
+ const _el$2 = _tmpl$25();
3663
3936
  insert(_el$2, () => option.name || option.value);
3664
3937
  effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
3665
3938
  effect(() => _el$2.value = option.value);
@@ -3673,7 +3946,7 @@ function SelectComponent(props) {
3673
3946
  var select_default = SelectComponent;
3674
3947
 
3675
3948
  // src/blocks/form/submit-button/component-info.ts
3676
- var componentInfo14 = {
3949
+ var componentInfo15 = {
3677
3950
  name: "Form:SubmitButton",
3678
3951
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
3679
3952
  defaultStyles: {
@@ -3699,10 +3972,10 @@ var componentInfo14 = {
3699
3972
  // TODO: defaultChildren
3700
3973
  // canHaveChildren: true,
3701
3974
  };
3702
- var _tmpl$13 = /* @__PURE__ */ template(`<button type=submit>`);
3975
+ var _tmpl$14 = /* @__PURE__ */ template(`<button type=submit>`);
3703
3976
  function SubmitButton(props) {
3704
3977
  return (() => {
3705
- const _el$ = _tmpl$13();
3978
+ const _el$ = _tmpl$14();
3706
3979
  spread(_el$, mergeProps({}, () => props.attributes), false, true);
3707
3980
  insert(_el$, () => props.text);
3708
3981
  return _el$;
@@ -3711,7 +3984,7 @@ function SubmitButton(props) {
3711
3984
  var submit_button_default = SubmitButton;
3712
3985
 
3713
3986
  // src/blocks/img/component-info.ts
3714
- var componentInfo15 = {
3987
+ var componentInfo16 = {
3715
3988
  // friendlyName?
3716
3989
  name: "Raw:Img",
3717
3990
  hideFromInsertMenu: true,
@@ -3726,10 +3999,10 @@ var componentInfo15 = {
3726
3999
  noWrap: true,
3727
4000
  static: true
3728
4001
  };
3729
- var _tmpl$14 = /* @__PURE__ */ template(`<img>`);
4002
+ var _tmpl$15 = /* @__PURE__ */ template(`<img>`);
3730
4003
  function ImgComponent(props) {
3731
4004
  return (() => {
3732
- const _el$ = _tmpl$14();
4005
+ const _el$ = _tmpl$15();
3733
4006
  spread(_el$, mergeProps({
3734
4007
  get style() {
3735
4008
  return {
@@ -3753,7 +4026,7 @@ function ImgComponent(props) {
3753
4026
  var img_default = ImgComponent;
3754
4027
 
3755
4028
  // src/blocks/video/component-info.ts
3756
- var componentInfo16 = {
4029
+ var componentInfo17 = {
3757
4030
  name: "Video",
3758
4031
  canHaveChildren: true,
3759
4032
  defaultStyles: {
@@ -3835,9 +4108,9 @@ var componentInfo16 = {
3835
4108
  advanced: true
3836
4109
  }]
3837
4110
  };
3838
- var _tmpl$15 = /* @__PURE__ */ template(`<source type=video/mp4>`);
3839
- var _tmpl$25 = /* @__PURE__ */ template(`<div>`);
3840
- var _tmpl$33 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
4111
+ var _tmpl$16 = /* @__PURE__ */ template(`<source type=video/mp4>`);
4112
+ var _tmpl$26 = /* @__PURE__ */ template(`<div>`);
4113
+ var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
3841
4114
  function Video(props) {
3842
4115
  const videoProps = createMemo(() => {
3843
4116
  return {
@@ -3864,7 +4137,7 @@ function Video(props) {
3864
4137
  };
3865
4138
  });
3866
4139
  return (() => {
3867
- const _el$ = _tmpl$33(), _el$2 = _el$.firstChild;
4140
+ const _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
3868
4141
  _el$.style.setProperty("position", "relative");
3869
4142
  spread(_el$2, mergeProps(spreadProps, {
3870
4143
  get preload() {
@@ -3898,7 +4171,7 @@ function Video(props) {
3898
4171
  return !props.lazyLoad;
3899
4172
  },
3900
4173
  get children() {
3901
- const _el$3 = _tmpl$15();
4174
+ const _el$3 = _tmpl$16();
3902
4175
  effect(() => setAttribute(_el$3, "src", props.video));
3903
4176
  return _el$3;
3904
4177
  }
@@ -3908,7 +4181,7 @@ function Video(props) {
3908
4181
  return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
3909
4182
  },
3910
4183
  get children() {
3911
- const _el$4 = _tmpl$25();
4184
+ const _el$4 = _tmpl$26();
3912
4185
  _el$4.style.setProperty("width", "100%");
3913
4186
  _el$4.style.setProperty("pointer-events", "none");
3914
4187
  _el$4.style.setProperty("font-size", "0px");
@@ -3921,7 +4194,7 @@ function Video(props) {
3921
4194
  return props.builderBlock?.children?.length && props.fitContent;
3922
4195
  },
3923
4196
  get children() {
3924
- const _el$5 = _tmpl$25();
4197
+ const _el$5 = _tmpl$26();
3925
4198
  _el$5.style.setProperty("display", "flex");
3926
4199
  _el$5.style.setProperty("flex-direction", "column");
3927
4200
  _el$5.style.setProperty("align-items", "stretch");
@@ -3934,7 +4207,7 @@ function Video(props) {
3934
4207
  return props.builderBlock?.children?.length && !props.fitContent;
3935
4208
  },
3936
4209
  get children() {
3937
- const _el$6 = _tmpl$25();
4210
+ const _el$6 = _tmpl$26();
3938
4211
  _el$6.style.setProperty("pointer-events", "none");
3939
4212
  _el$6.style.setProperty("display", "flex");
3940
4213
  _el$6.style.setProperty("flex-direction", "column");
@@ -3956,28 +4229,28 @@ var video_default = Video;
3956
4229
  // src/constants/extra-components.ts
3957
4230
  var getExtraComponents = () => [{
3958
4231
  component: custom_code_default,
3959
- ...componentInfo9
4232
+ ...componentInfo10
3960
4233
  }, {
3961
4234
  component: embed_default,
3962
- ...componentInfo10
4235
+ ...componentInfo11
3963
4236
  }, ...TARGET === "rsc" ? [] : [{
3964
4237
  component: form_default,
3965
- ...componentInfo11
4238
+ ...componentInfo12
3966
4239
  }, {
3967
4240
  component: input_default,
3968
- ...componentInfo12
4241
+ ...componentInfo13
3969
4242
  }, {
3970
4243
  component: submit_button_default,
3971
- ...componentInfo14
4244
+ ...componentInfo15
3972
4245
  }, {
3973
4246
  component: select_default,
3974
- ...componentInfo13
4247
+ ...componentInfo14
3975
4248
  }], {
3976
4249
  component: img_default,
3977
- ...componentInfo15
4250
+ ...componentInfo16
3978
4251
  }, {
3979
4252
  component: video_default,
3980
- ...componentInfo16
4253
+ ...componentInfo17
3981
4254
  }];
3982
4255
 
3983
4256
  // src/constants/builder-registered-components.ts
@@ -4004,8 +4277,11 @@ var getDefaultRegisteredComponents = () => [{
4004
4277
  ...componentInfo7
4005
4278
  }, {
4006
4279
  component: text_default,
4280
+ ...componentInfo9
4281
+ }, ...TARGET === "rsc" ? [] : [{
4282
+ component: tabs_default,
4007
4283
  ...componentInfo8
4008
- }, ...getExtraComponents()];
4284
+ }], ...getExtraComponents()];
4009
4285
 
4010
4286
  // src/functions/register-component.ts
4011
4287
  var createRegisterComponentMessage = (info) => ({
@@ -4074,10 +4350,10 @@ var getUpdateVariantVisibilityScript = ({
4074
4350
  }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
4075
4351
  "${variationId}", "${contentId}", ${isHydrationTarget}
4076
4352
  )`;
4077
- var _tmpl$16 = /* @__PURE__ */ template(`<script>`);
4353
+ var _tmpl$17 = /* @__PURE__ */ template(`<script>`);
4078
4354
  function InlinedScript(props) {
4079
4355
  return (() => {
4080
- const _el$ = _tmpl$16();
4356
+ const _el$ = _tmpl$17();
4081
4357
  effect((_p$) => {
4082
4358
  const _v$ = props.scriptStr, _v$2 = props.id;
4083
4359
  _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
@@ -4576,7 +4852,7 @@ function isFromTrustedHost(trustedHosts, e) {
4576
4852
  }
4577
4853
 
4578
4854
  // src/constants/sdk-version.ts
4579
- var SDK_VERSION = "1.0.23";
4855
+ var SDK_VERSION = "1.0.25";
4580
4856
 
4581
4857
  // src/functions/register.ts
4582
4858
  var registry = {};
@@ -4773,6 +5049,85 @@ var subscribeToEditor = (model, callback, options) => {
4773
5049
  };
4774
5050
  };
4775
5051
 
5052
+ // src/components/content/components/styles.helpers.ts
5053
+ var getCssFromFont = (font) => {
5054
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
5055
+ const name = family.split(",")[0];
5056
+ const url = font.fileUrl ?? font?.files?.regular;
5057
+ let str = "";
5058
+ if (url && family && name) {
5059
+ str += `
5060
+ @font-face {
5061
+ font-family: "${family}";
5062
+ src: local("${name}"), url('${url}') format('woff2');
5063
+ font-display: fallback;
5064
+ font-weight: 400;
5065
+ }
5066
+ `.trim();
5067
+ }
5068
+ if (font.files) {
5069
+ for (const weight in font.files) {
5070
+ const isNumber = String(Number(weight)) === weight;
5071
+ if (!isNumber) {
5072
+ continue;
5073
+ }
5074
+ const weightUrl = font.files[weight];
5075
+ if (weightUrl && weightUrl !== url) {
5076
+ str += `
5077
+ @font-face {
5078
+ font-family: "${family}";
5079
+ src: url('${weightUrl}') format('woff2');
5080
+ font-display: fallback;
5081
+ font-weight: ${weight};
5082
+ }
5083
+ `.trim();
5084
+ }
5085
+ }
5086
+ }
5087
+ return str;
5088
+ };
5089
+ var getFontCss = ({
5090
+ customFonts
5091
+ }) => {
5092
+ return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
5093
+ };
5094
+ var getCss = ({
5095
+ cssCode,
5096
+ contentId
5097
+ }) => {
5098
+ if (!cssCode) {
5099
+ return "";
5100
+ }
5101
+ if (!contentId) {
5102
+ return cssCode;
5103
+ }
5104
+ return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
5105
+ };
5106
+ var DEFAULT_STYLES = `
5107
+ .builder-button {
5108
+ all: unset;
5109
+ }
5110
+
5111
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
5112
+ margin: 0;
5113
+ }
5114
+ .builder-text > p, .builder-text > .builder-paragraph {
5115
+ color: inherit;
5116
+ line-height: inherit;
5117
+ letter-spacing: inherit;
5118
+ font-weight: inherit;
5119
+ font-size: inherit;
5120
+ text-align: inherit;
5121
+ font-family: inherit;
5122
+ }
5123
+ `;
5124
+ var getDefaultStyles = (isNested) => {
5125
+ return !isNested ? DEFAULT_STYLES : "";
5126
+ };
5127
+ var getWrapperClassName = (variationId) => {
5128
+ return `variant-${variationId}`;
5129
+ };
5130
+
4776
5131
  // src/components/content/components/enable-editor.tsx
4777
5132
  function EnableEditor(props) {
4778
5133
  const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
@@ -4812,6 +5167,12 @@ function EnableEditor(props) {
4812
5167
  content: newContentValue
4813
5168
  }));
4814
5169
  }
5170
+ const showContentProps = createMemo(() => {
5171
+ return props.showContent ? {} : {
5172
+ hidden: true,
5173
+ "aria-hidden": true
5174
+ };
5175
+ });
4815
5176
  function processMessage(event) {
4816
5177
  return createEditorListener({
4817
5178
  model: props.model,
@@ -5031,7 +5392,7 @@ function EnableEditor(props) {
5031
5392
  get children() {
5032
5393
  return createComponent(Dynamic, mergeProps({
5033
5394
  get ["class"]() {
5034
- return `variant-${props.content?.testVariationId || props.content?.id}`;
5395
+ return getWrapperClassName(props.content?.testVariationId || props.content?.id);
5035
5396
  }
5036
5397
  }, {}, {
5037
5398
  ref(r$) {
@@ -5045,10 +5406,7 @@ function EnableEditor(props) {
5045
5406
  get ["builder-model"]() {
5046
5407
  return props.model;
5047
5408
  }
5048
- }, {}, () => props.showContent ? {} : {
5049
- hidden: true,
5050
- "aria-hidden": true
5051
- }, () => props.contentWrapperProps, {
5409
+ }, {}, showContentProps, () => props.contentWrapperProps, {
5052
5410
  get component() {
5053
5411
  return ContentWrapper();
5054
5412
  },
@@ -5062,84 +5420,6 @@ function EnableEditor(props) {
5062
5420
  });
5063
5421
  }
5064
5422
  var enable_editor_default = EnableEditor;
5065
-
5066
- // src/components/content/components/styles.helpers.ts
5067
- var getCssFromFont = (font) => {
5068
- const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
5069
- const name = family.split(",")[0];
5070
- const url = font.fileUrl ?? font?.files?.regular;
5071
- let str = "";
5072
- if (url && family && name) {
5073
- str += `
5074
- @font-face {
5075
- font-family: "${family}";
5076
- src: local("${name}"), url('${url}') format('woff2');
5077
- font-display: fallback;
5078
- font-weight: 400;
5079
- }
5080
- `.trim();
5081
- }
5082
- if (font.files) {
5083
- for (const weight in font.files) {
5084
- const isNumber = String(Number(weight)) === weight;
5085
- if (!isNumber) {
5086
- continue;
5087
- }
5088
- const weightUrl = font.files[weight];
5089
- if (weightUrl && weightUrl !== url) {
5090
- str += `
5091
- @font-face {
5092
- font-family: "${family}";
5093
- src: url('${weightUrl}') format('woff2');
5094
- font-display: fallback;
5095
- font-weight: ${weight};
5096
- }
5097
- `.trim();
5098
- }
5099
- }
5100
- }
5101
- return str;
5102
- };
5103
- var getFontCss = ({
5104
- customFonts
5105
- }) => {
5106
- return customFonts?.map((font) => getCssFromFont(font))?.join(" ") || "";
5107
- };
5108
- var getCss = ({
5109
- cssCode,
5110
- contentId
5111
- }) => {
5112
- if (!cssCode) {
5113
- return "";
5114
- }
5115
- if (!contentId) {
5116
- return cssCode;
5117
- }
5118
- return cssCode?.replace(/&/g, `div[builder-content-id="${contentId}"]`) || "";
5119
- };
5120
- var DEFAULT_STYLES = `
5121
- .builder-button {
5122
- all: unset;
5123
- }
5124
-
5125
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
5126
- margin: 0;
5127
- }
5128
- .builder-text > p, .builder-text > .builder-paragraph {
5129
- color: inherit;
5130
- line-height: inherit;
5131
- letter-spacing: inherit;
5132
- font-weight: inherit;
5133
- font-size: inherit;
5134
- text-align: inherit;
5135
- font-family: inherit;
5136
- }
5137
- `;
5138
- var getDefaultStyles = (isNested) => {
5139
- return !isNested ? DEFAULT_STYLES : "";
5140
- };
5141
-
5142
- // src/components/content/components/styles.tsx
5143
5423
  function ContentStyles(props) {
5144
5424
  const [injectedStyles, setInjectedStyles] = createSignal(`
5145
5425
  ${getCss({
@@ -5558,9 +5838,15 @@ var fetchSymbolContent = async ({
5558
5838
  };
5559
5839
 
5560
5840
  // src/blocks/symbol/symbol.tsx
5561
- var _tmpl$17 = /* @__PURE__ */ template(`<div>`);
5841
+ var _tmpl$18 = /* @__PURE__ */ template(`<div>`);
5562
5842
  function Symbol(props) {
5563
5843
  const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
5844
+ const blocksWrapper = createMemo(() => {
5845
+ return "div";
5846
+ });
5847
+ const contentWrapper = createMemo(() => {
5848
+ return "div";
5849
+ });
5564
5850
  const className = createMemo(() => {
5565
5851
  return [...[props.attributes[getClassPropName()]], "builder-symbol", props.symbol?.inline ? "builder-inline-symbol" : void 0, props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0].filter(Boolean).join(" ");
5566
5852
  });
@@ -5584,7 +5870,7 @@ function Symbol(props) {
5584
5870
  }
5585
5871
  createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
5586
5872
  return (() => {
5587
- const _el$ = _tmpl$17();
5873
+ const _el$ = _tmpl$18();
5588
5874
  spread(_el$, mergeProps({
5589
5875
  get ["class"]() {
5590
5876
  return className();
@@ -5623,8 +5909,12 @@ function Symbol(props) {
5623
5909
  get linkComponent() {
5624
5910
  return props.builderLinkComponent;
5625
5911
  },
5626
- blocksWrapper: "div",
5627
- contentWrapper: "div"
5912
+ get blocksWrapper() {
5913
+ return blocksWrapper();
5914
+ },
5915
+ get contentWrapper() {
5916
+ return contentWrapper();
5917
+ }
5628
5918
  }));
5629
5919
  return _el$;
5630
5920
  })();