@builder.io/sdk-qwik 0.0.37 → 0.0.38

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.
@@ -50,7 +50,7 @@ const registerInsertMenu = ()=>{
50
50
  {
51
51
  name: 'Columns'
52
52
  },
53
- ...TARGET === 'reactNative' ? [] : [
53
+ ...[
54
54
  {
55
55
  name: 'Core:Section'
56
56
  },
@@ -270,15 +270,19 @@ function getProcessedBlock({ block , context , shouldEvaluateBindings , state }
270
270
 
271
271
  const camelToKebabCase = (string)=>string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
272
272
 
273
- const convertStyleMaptoCSS = (style)=>{
273
+ const checkIsDefined = (maybeT)=>maybeT !== null && maybeT !== undefined;
274
+
275
+ const convertStyleMapToCSSArray = (style)=>{
274
276
  const cssProps = Object.entries(style).map(([key, value])=>{
275
277
  if (typeof value === 'string') return `${camelToKebabCase(key)}: ${value};`;
278
+ else return undefined;
276
279
  });
277
- return cssProps.join('\n');
280
+ return cssProps.filter(checkIsDefined);
278
281
  };
282
+ const convertStyleMapToCSS = (style)=>convertStyleMapToCSSArray(style).join('\n');
279
283
  const createCssClass = ({ mediaQuery , className , styles })=>{
280
284
  const cssClass = `.${className} {
281
- ${convertStyleMaptoCSS(styles)}
285
+ ${convertStyleMapToCSS(styles)}
282
286
  }`;
283
287
  if (mediaQuery) return `${mediaQuery} {
284
288
  ${cssClass}
@@ -342,7 +346,7 @@ const css = function css(props, state) {
342
346
  };
343
347
  const BlockStyles = (props)=>{
344
348
  return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
345
- children: TARGET !== "reactNative" && css(props) ? /*#__PURE__*/ jsxRuntime.jsx(RenderInlinedStyles$1, {
349
+ children: css(props) ? /*#__PURE__*/ jsxRuntime.jsx(RenderInlinedStyles$1, {
346
350
  styles: css(props)
347
351
  }) : null
348
352
  });
@@ -391,10 +395,15 @@ function getBlockComponentOptions(block) {
391
395
  };
392
396
  }
393
397
 
398
+ function transformBlockProperties(properties) {
399
+ return properties;
400
+ }
401
+
394
402
  function getBlockProperties(block) {
395
- return {
403
+ const properties = {
396
404
  ...block.properties,
397
405
  'builder-id': block.id,
406
+ style: getStyleAttribute(block.style),
398
407
  class: [
399
408
  block.id,
400
409
  'builder-block',
@@ -402,6 +411,25 @@ function getBlockProperties(block) {
402
411
  block.properties?.class
403
412
  ].filter(Boolean).join(' ')
404
413
  };
414
+ return transformBlockProperties(properties);
415
+ }
416
+ /**
417
+ * Svelte does not support style attribute as an object so we need to flatten it.
418
+ *
419
+ * Additionally, Svelte, Vue and other frameworks use kebab-case styles, so we need to convert them.
420
+ */ function getStyleAttribute(style) {
421
+ if (!style) return undefined;
422
+ switch(TARGET){
423
+ case 'svelte':
424
+ case 'vue2':
425
+ case 'vue3':
426
+ case 'solid':
427
+ return convertStyleMapToCSSArray(style).join(' ');
428
+ case 'qwik':
429
+ case 'reactNative':
430
+ case 'react':
431
+ return style;
432
+ }
405
433
  }
406
434
 
407
435
  function getBlockTag(block) {
@@ -465,51 +493,6 @@ const RenderComponent = (props)=>{
465
493
  };
466
494
  const RenderComponent$1 = RenderComponent;
467
495
 
468
- // GENERATED BY MITOSIS
469
- const RenderComponentWithContext = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
470
- qwik.useContextProvider(BuilderContext, qwik.useStore({
471
- content: (()=>{
472
- return props.context.content;
473
- })(),
474
- state: (()=>{
475
- return props.context.state;
476
- })(),
477
- context: (()=>{
478
- return props.context.context;
479
- })(),
480
- apiKey: (()=>{
481
- return props.context.apiKey;
482
- })(),
483
- registeredComponents: (()=>{
484
- return props.context.registeredComponents;
485
- })(),
486
- inheritedStyles: (()=>{
487
- return props.context.inheritedStyles;
488
- })()
489
- }));
490
- return /*#__PURE__*/ jsxRuntime.jsx(RenderComponent$1, {
491
- get componentRef () {
492
- return props.componentRef;
493
- },
494
- get componentOptions () {
495
- return props.componentOptions;
496
- },
497
- get blockChildren () {
498
- return props.blockChildren;
499
- },
500
- get context () {
501
- return props.context;
502
- },
503
- [qwik._IMMUTABLE]: {
504
- componentRef: qwik._wrapSignal(props, "componentRef"),
505
- componentOptions: qwik._wrapSignal(props, "componentOptions"),
506
- blockChildren: qwik._wrapSignal(props, "blockChildren"),
507
- context: qwik._wrapSignal(props, "context")
508
- }
509
- });
510
- }, "RenderComponentWithContext_component_nXOUbUnjTAo"));
511
- const RenderComponentWithContext$1 = RenderComponentWithContext;
512
-
513
496
  // GENERATED BY MITOSIS
514
497
  /**
515
498
  * We can't make this a generic `ProvideContext` function because Vue 2 won't support root slots, e.g.
@@ -592,8 +575,9 @@ const actions = function actions(props, state) {
592
575
  });
593
576
  };
594
577
  const attributes = function attributes(props, state) {
578
+ const blockProperties = getBlockProperties(useBlock(props));
595
579
  return {
596
- ...getBlockProperties(useBlock(props)),
580
+ ...blockProperties,
597
581
  ...{}
598
582
  };
599
583
  };
@@ -614,7 +598,8 @@ const renderComponentProps = function renderComponentProps(props, state) {
614
598
  ...attributes(props),
615
599
  ...actions(props)
616
600
  }
617
- }
601
+ },
602
+ customBreakpoints: childrenContext(props)?.content?.meta?.breakpoints
618
603
  },
619
604
  context: childrenContext(props)
620
605
  };
@@ -678,8 +663,7 @@ const childrenContext = function childrenContext(props, state) {
678
663
  };
679
664
  };
680
665
  const renderComponentTag = function renderComponentTag(props, state) {
681
- if (TARGET === "reactNative") return RenderComponentWithContext$1;
682
- else return RenderComponent$1;
666
+ return RenderComponent$1;
683
667
  };
684
668
  const RenderBlock = (props)=>{
685
669
  const state = {};
@@ -736,7 +720,7 @@ const RenderBlock = (props)=>{
736
720
  const RenderBlock$1 = RenderBlock;
737
721
 
738
722
  // GENERATED BY MITOSIS
739
- const className = function className(props, state, builderContext) {
723
+ const className$1 = function className(props, state, builderContext) {
740
724
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
741
725
  };
742
726
  const onClick$1 = function onClick(props, state, builderContext) {
@@ -762,7 +746,7 @@ const RenderBlocks = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
762
746
  const builderContext = qwik.useContext(BuilderContext);
763
747
  const state = {};
764
748
  return /*#__PURE__*/ jsxRuntime.jsxs("div", {
765
- class: className(props) + " div-RenderBlocks",
749
+ class: className$1(props) + " div-RenderBlocks",
766
750
  get "builder-path" () {
767
751
  return props.path;
768
752
  },
@@ -853,54 +837,113 @@ const columnCssVars = function columnCssVars(props, state) {
853
837
  "--column-margin-left-tablet": maybeApplyForTablet(props, state, marginLeft)
854
838
  };
855
839
  };
840
+ const getWidthForBreakpointSize = function getWidthForBreakpointSize(props, state, size) {
841
+ const breakpointSizes = getSizesForBreakpoints(props.customBreakpoints || {});
842
+ return breakpointSizes[size].max;
843
+ };
844
+ const columnStyleObjects = function columnStyleObjects(props, state) {
845
+ return {
846
+ columns: {
847
+ small: {
848
+ flexDirection: "var(--flex-dir)",
849
+ alignItems: "stretch"
850
+ },
851
+ medium: {
852
+ flexDirection: "var(--flex-dir-tablet)",
853
+ alignItems: "stretch"
854
+ }
855
+ },
856
+ column: {
857
+ small: {
858
+ width: "var(--column-width) !important",
859
+ marginLeft: "var(--column-margin-left) !important"
860
+ },
861
+ medium: {
862
+ width: "var(--column-width-tablet) !important",
863
+ marginLeft: "var(--column-margin-left-tablet) !important"
864
+ }
865
+ }
866
+ };
867
+ };
868
+ const columnsStyles = function columnsStyles(props, state) {
869
+ return `
870
+ @media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
871
+ .${props.builderBlock.id}-breakpoints {
872
+ ${convertStyleMapToCSS(columnStyleObjects().columns.medium)}
873
+ }
874
+
875
+ .${props.builderBlock.id}-breakpoints > .builder-column {
876
+ ${convertStyleMapToCSS(columnStyleObjects().column.medium)}
877
+ }
878
+ }
879
+
880
+ @media (max-width: ${getWidthForBreakpointSize(props, state, "small")}px) {
881
+ .${props.builderBlock.id}-breakpoints {
882
+ ${convertStyleMapToCSS(columnStyleObjects().columns.small)}
883
+ }
884
+
885
+ .${props.builderBlock.id}-breakpoints > .builder-column {
886
+ ${convertStyleMapToCSS(columnStyleObjects().column.small)}
887
+ }
888
+ },
889
+ `;
890
+ };
891
+ const reactNativeColumnsStyles = function reactNativeColumnsStyles(props, state) {
892
+ return columnStyleObjects().columns.small;
893
+ };
894
+ const reactNativeColumnStyles = function reactNativeColumnStyles(props, state) {
895
+ return columnStyleObjects().column.small;
896
+ };
856
897
  const Columns = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
857
898
  qwik.useStylesScopedQrl(qwik.inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
858
899
  const state = {};
859
- return /*#__PURE__*/ jsxRuntime.jsx("div", {
860
- class: "builder-columns div-Columns",
861
- style: columnsCssVars(props, state),
862
- children: (props.columns || []).map(function(column, index) {
863
- return /*#__PURE__*/ jsxRuntime.jsx("div", {
864
- class: "builder-column div-Columns-2",
865
- style: {
866
- width: getColumnCssWidth(props, state, index),
867
- marginLeft: `${index === 0 ? 0 : getGutterSize(props)}px`,
868
- ...columnCssVars(props, state)
869
- },
870
- children: /*#__PURE__*/ jsxRuntime.jsx(RenderBlocks$1, {
871
- get blocks () {
872
- return column.blocks;
873
- },
874
- path: `component.options.columns.${index}.blocks`,
875
- get parent () {
876
- return props.builderBlock.id;
877
- },
878
- styleProp: {
879
- flexGrow: "1"
900
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
901
+ class: `builder-columns ${props.builderBlock.id}-breakpoints` + " div-Columns",
902
+ style: {
903
+ ...TARGET === "reactNative" ? reactNativeColumnsStyles() : {},
904
+ ...columnsCssVars(props, state)
905
+ },
906
+ children: [
907
+ TARGET !== "reactNative" ? /*#__PURE__*/ jsxRuntime.jsx(RenderInlinedStyles$1, {
908
+ styles: columnsStyles(props, state)
909
+ }) : null,
910
+ (props.columns || []).map(function(column, index) {
911
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
912
+ class: "builder-column div-Columns-2",
913
+ style: {
914
+ width: getColumnCssWidth(props, state, index),
915
+ marginLeft: `${index === 0 ? 0 : getGutterSize(props)}px`,
916
+ ...TARGET === "reactNative" ? reactNativeColumnStyles() : {},
917
+ ...columnCssVars(props, state)
880
918
  },
881
- [qwik._IMMUTABLE]: {
882
- blocks: qwik._wrapSignal(column, "blocks"),
883
- parent: qwik._wrapSignal(props.builderBlock, "id")
884
- }
885
- })
886
- }, index);
887
- })
919
+ children: /*#__PURE__*/ jsxRuntime.jsx(RenderBlocks$1, {
920
+ get blocks () {
921
+ return column.blocks;
922
+ },
923
+ path: `component.options.columns.${index}.blocks`,
924
+ get parent () {
925
+ return props.builderBlock.id;
926
+ },
927
+ styleProp: {
928
+ flexGrow: "1"
929
+ },
930
+ [qwik._IMMUTABLE]: {
931
+ blocks: qwik._wrapSignal(column, "blocks"),
932
+ parent: qwik._wrapSignal(props.builderBlock, "id")
933
+ }
934
+ })
935
+ }, index);
936
+ })
937
+ ]
888
938
  });
889
939
  }, "Columns_component_7yLj4bxdI6c"));
890
940
  const Columns$1 = Columns;
891
941
  const STYLES$2 = `.div-Columns {
892
942
  display: flex;
893
- align-items: stretch;
894
- line-height: normal; }@media (max-width: 991px) { .div-Columns {
895
- flex-direction: var(--flex-dir-tablet); } }@media (max-width: 639px) { .div-Columns {
896
- flex-direction: var(--flex-dir); } }.div-Columns-2 {
943
+ line-height: normal; }.div-Columns-2 {
897
944
  display: flex;
898
945
  flex-direction: column;
899
- align-items: stretch; }@media (max-width: 991px) { .div-Columns-2 {
900
- width: var(--column-width-tablet) !important;
901
- margin-left: var(--column-margin-left-tablet) !important; } }@media (max-width: 639px) { .div-Columns-2 {
902
- width: var(--column-width) !important;
903
- margin-left: var(--column-margin-left) !important; } }`;
946
+ align-items: stretch; }`;
904
947
 
905
948
  // Taken from (and modified) the shopify theme script repo
906
949
  // https://github.com/Shopify/theme-scripts/blob/bcfb471f2a57d439e2f964a1bb65b67708cc90c3/packages/theme-images/images.js#L59
@@ -1654,9 +1697,18 @@ const componentInfo$6 = {
1654
1697
  const SectionComponent = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
1655
1698
  return /*#__PURE__*/ jsxRuntime.jsx("section", {
1656
1699
  ...props.attributes,
1657
- style: (()=>{
1658
- props.maxWidth && typeof props.maxWidth === "number" ? props.maxWidth : undefined;
1659
- })(),
1700
+ style: {
1701
+ width: "100%",
1702
+ alignSelf: "stretch",
1703
+ flexGrow: "1",
1704
+ boxSizing: "border-box",
1705
+ maxWidth: `${props.maxWidth && typeof props.maxWidth === "number" ? props.maxWidth : 1200}px`,
1706
+ display: "flex",
1707
+ flexDirection: "column",
1708
+ alignItems: "stretch",
1709
+ marginLeft: "auto",
1710
+ marginRight: "auto"
1711
+ },
1660
1712
  children: /*#__PURE__*/ jsxRuntime.jsx(qwik.Slot, {})
1661
1713
  });
1662
1714
  }, "SectionComponent_component_ZWF9iD5WeLg"));
@@ -2279,8 +2331,6 @@ const setContentVariationCookie = ({ contentId , canTrack , value })=>setCookie
2279
2331
  canTrack
2280
2332
  });
2281
2333
 
2282
- const checkIsDefined = (maybeT)=>maybeT !== null && maybeT !== undefined;
2283
-
2284
2334
  const checkIsBuilderContentWithVariations = (item)=>checkIsDefined(item.id) && checkIsDefined(item.variations) && Object.keys(item.variations).length > 0;
2285
2335
  /**
2286
2336
  * Randomly assign a variation to this user and store it in cookies/storage
@@ -2617,6 +2667,11 @@ const useContent = function useContent(props, state, elementRef) {
2617
2667
  ...props.content?.data,
2618
2668
  ...props.data,
2619
2669
  ...state.overrideContent?.data
2670
+ },
2671
+ meta: {
2672
+ ...props.content?.meta,
2673
+ ...state.overrideContent?.meta,
2674
+ breakpoints: state.useBreakpoints || state.overrideContent?.meta?.breakpoints || props.content?.meta?.breakpoints
2620
2675
  }
2621
2676
  };
2622
2677
  return mergedContent;
@@ -2657,11 +2712,20 @@ const allRegisteredComponents = function allRegisteredComponents(props, state, e
2657
2712
  const processMessage = function processMessage(props, state, elementRef, event) {
2658
2713
  const { data } = event;
2659
2714
  if (data) switch(data.type){
2660
- case "builder.contentUpdate":
2715
+ case "builder.configureSdk":
2661
2716
  {
2662
2717
  const messageContent = data.data;
2663
- const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
2664
- const contentData = messageContent.data;
2718
+ const { breakpoints , contentId } = messageContent;
2719
+ if (!contentId || contentId !== useContent(props, state)?.id) return;
2720
+ state.useBreakpoints = breakpoints;
2721
+ state.forceReRenderCount = state.forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
2722
+ break;
2723
+ }
2724
+ case "builder.contentUpdate":
2725
+ {
2726
+ const messageContent1 = data.data;
2727
+ const key = messageContent1.key || messageContent1.alias || messageContent1.entry || messageContent1.modelName;
2728
+ const contentData = messageContent1.data;
2665
2729
  if (key === props.model) {
2666
2730
  state.overrideContent = contentData;
2667
2731
  state.forceReRenderCount = state.forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
@@ -2744,7 +2808,8 @@ const RenderContent = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
2744
2808
  forceReRenderCount: 0,
2745
2809
  overrideContent: null,
2746
2810
  overrideState: {},
2747
- update: 0
2811
+ update: 0,
2812
+ useBreakpoints: null
2748
2813
  });
2749
2814
  qwik.useContextProvider(BuilderContext, qwik.useStore({
2750
2815
  content: (()=>{
@@ -2890,13 +2955,22 @@ const RenderContent = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
2890
2955
  const RenderContent$1 = RenderContent;
2891
2956
 
2892
2957
  // GENERATED BY MITOSIS
2958
+ const className = function className(props, state, builderContext) {
2959
+ return [
2960
+ ...[
2961
+ props.attributes.class
2962
+ ],
2963
+ "builder-symbol",
2964
+ props.symbol?.inline ? "builder-inline-symbol" : undefined,
2965
+ props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : undefined
2966
+ ].filter(Boolean).join(" ");
2967
+ };
2893
2968
  const contentToUse = function contentToUse(props, state, builderContext) {
2894
2969
  return props.symbol?.content || state.fetchedContent;
2895
2970
  };
2896
2971
  const Symbol$1 = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
2897
2972
  const builderContext = qwik.useContext(BuilderContext);
2898
2973
  const state = qwik.useStore({
2899
- className: "builder-symbol",
2900
2974
  fetchedContent: null
2901
2975
  });
2902
2976
  qwik.useWatchQrl(qwik.inlinedQrl(({ track })=>{
@@ -2928,9 +3002,7 @@ const Symbol$1 = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
2928
3002
  ]));
2929
3003
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
2930
3004
  ...props.attributes,
2931
- get class () {
2932
- return state.className;
2933
- },
3005
+ class: className(props),
2934
3006
  children: /*#__PURE__*/ jsxRuntime.jsx(RenderContent$1, {
2935
3007
  get apiKey () {
2936
3008
  return builderContext.apiKey;
@@ -2950,10 +3022,7 @@ const Symbol$1 = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
2950
3022
  apiKey: qwik._wrapSignal(builderContext, "apiKey"),
2951
3023
  context: qwik._wrapSignal(builderContext, "context")
2952
3024
  }
2953
- }),
2954
- [qwik._IMMUTABLE]: {
2955
- class: qwik._wrapSignal(state, "className")
2956
- }
3025
+ })
2957
3026
  });
2958
3027
  }, "Symbol_component_WVvggdkUPdk"));
2959
3028
  const Symbol$2 = Symbol$1;
@@ -46,7 +46,7 @@ const registerInsertMenu = ()=>{
46
46
  {
47
47
  name: 'Columns'
48
48
  },
49
- ...TARGET === 'reactNative' ? [] : [
49
+ ...[
50
50
  {
51
51
  name: 'Core:Section'
52
52
  },
@@ -266,15 +266,19 @@ function getProcessedBlock({ block , context , shouldEvaluateBindings , state }
266
266
 
267
267
  const camelToKebabCase = (string)=>string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
268
268
 
269
- const convertStyleMaptoCSS = (style)=>{
269
+ const checkIsDefined = (maybeT)=>maybeT !== null && maybeT !== undefined;
270
+
271
+ const convertStyleMapToCSSArray = (style)=>{
270
272
  const cssProps = Object.entries(style).map(([key, value])=>{
271
273
  if (typeof value === 'string') return `${camelToKebabCase(key)}: ${value};`;
274
+ else return undefined;
272
275
  });
273
- return cssProps.join('\n');
276
+ return cssProps.filter(checkIsDefined);
274
277
  };
278
+ const convertStyleMapToCSS = (style)=>convertStyleMapToCSSArray(style).join('\n');
275
279
  const createCssClass = ({ mediaQuery , className , styles })=>{
276
280
  const cssClass = `.${className} {
277
- ${convertStyleMaptoCSS(styles)}
281
+ ${convertStyleMapToCSS(styles)}
278
282
  }`;
279
283
  if (mediaQuery) return `${mediaQuery} {
280
284
  ${cssClass}
@@ -338,7 +342,7 @@ const css = function css(props, state) {
338
342
  };
339
343
  const BlockStyles = (props)=>{
340
344
  return /*#__PURE__*/ jsx(Fragment$1, {
341
- children: TARGET !== "reactNative" && css(props) ? /*#__PURE__*/ jsx(RenderInlinedStyles$1, {
345
+ children: css(props) ? /*#__PURE__*/ jsx(RenderInlinedStyles$1, {
342
346
  styles: css(props)
343
347
  }) : null
344
348
  });
@@ -387,10 +391,15 @@ function getBlockComponentOptions(block) {
387
391
  };
388
392
  }
389
393
 
394
+ function transformBlockProperties(properties) {
395
+ return properties;
396
+ }
397
+
390
398
  function getBlockProperties(block) {
391
- return {
399
+ const properties = {
392
400
  ...block.properties,
393
401
  'builder-id': block.id,
402
+ style: getStyleAttribute(block.style),
394
403
  class: [
395
404
  block.id,
396
405
  'builder-block',
@@ -398,6 +407,25 @@ function getBlockProperties(block) {
398
407
  block.properties?.class
399
408
  ].filter(Boolean).join(' ')
400
409
  };
410
+ return transformBlockProperties(properties);
411
+ }
412
+ /**
413
+ * Svelte does not support style attribute as an object so we need to flatten it.
414
+ *
415
+ * Additionally, Svelte, Vue and other frameworks use kebab-case styles, so we need to convert them.
416
+ */ function getStyleAttribute(style) {
417
+ if (!style) return undefined;
418
+ switch(TARGET){
419
+ case 'svelte':
420
+ case 'vue2':
421
+ case 'vue3':
422
+ case 'solid':
423
+ return convertStyleMapToCSSArray(style).join(' ');
424
+ case 'qwik':
425
+ case 'reactNative':
426
+ case 'react':
427
+ return style;
428
+ }
401
429
  }
402
430
 
403
431
  function getBlockTag(block) {
@@ -461,51 +489,6 @@ const RenderComponent = (props)=>{
461
489
  };
462
490
  const RenderComponent$1 = RenderComponent;
463
491
 
464
- // GENERATED BY MITOSIS
465
- const RenderComponentWithContext = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
466
- useContextProvider(BuilderContext, useStore({
467
- content: (()=>{
468
- return props.context.content;
469
- })(),
470
- state: (()=>{
471
- return props.context.state;
472
- })(),
473
- context: (()=>{
474
- return props.context.context;
475
- })(),
476
- apiKey: (()=>{
477
- return props.context.apiKey;
478
- })(),
479
- registeredComponents: (()=>{
480
- return props.context.registeredComponents;
481
- })(),
482
- inheritedStyles: (()=>{
483
- return props.context.inheritedStyles;
484
- })()
485
- }));
486
- return /*#__PURE__*/ jsx(RenderComponent$1, {
487
- get componentRef () {
488
- return props.componentRef;
489
- },
490
- get componentOptions () {
491
- return props.componentOptions;
492
- },
493
- get blockChildren () {
494
- return props.blockChildren;
495
- },
496
- get context () {
497
- return props.context;
498
- },
499
- [_IMMUTABLE]: {
500
- componentRef: _wrapSignal(props, "componentRef"),
501
- componentOptions: _wrapSignal(props, "componentOptions"),
502
- blockChildren: _wrapSignal(props, "blockChildren"),
503
- context: _wrapSignal(props, "context")
504
- }
505
- });
506
- }, "RenderComponentWithContext_component_nXOUbUnjTAo"));
507
- const RenderComponentWithContext$1 = RenderComponentWithContext;
508
-
509
492
  // GENERATED BY MITOSIS
510
493
  /**
511
494
  * We can't make this a generic `ProvideContext` function because Vue 2 won't support root slots, e.g.
@@ -588,8 +571,9 @@ const actions = function actions(props, state) {
588
571
  });
589
572
  };
590
573
  const attributes = function attributes(props, state) {
574
+ const blockProperties = getBlockProperties(useBlock(props));
591
575
  return {
592
- ...getBlockProperties(useBlock(props)),
576
+ ...blockProperties,
593
577
  ...{}
594
578
  };
595
579
  };
@@ -610,7 +594,8 @@ const renderComponentProps = function renderComponentProps(props, state) {
610
594
  ...attributes(props),
611
595
  ...actions(props)
612
596
  }
613
- }
597
+ },
598
+ customBreakpoints: childrenContext(props)?.content?.meta?.breakpoints
614
599
  },
615
600
  context: childrenContext(props)
616
601
  };
@@ -674,8 +659,7 @@ const childrenContext = function childrenContext(props, state) {
674
659
  };
675
660
  };
676
661
  const renderComponentTag = function renderComponentTag(props, state) {
677
- if (TARGET === "reactNative") return RenderComponentWithContext$1;
678
- else return RenderComponent$1;
662
+ return RenderComponent$1;
679
663
  };
680
664
  const RenderBlock = (props)=>{
681
665
  const state = {};
@@ -732,7 +716,7 @@ const RenderBlock = (props)=>{
732
716
  const RenderBlock$1 = RenderBlock;
733
717
 
734
718
  // GENERATED BY MITOSIS
735
- const className = function className(props, state, builderContext) {
719
+ const className$1 = function className(props, state, builderContext) {
736
720
  return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
737
721
  };
738
722
  const onClick$1 = function onClick(props, state, builderContext) {
@@ -758,7 +742,7 @@ const RenderBlocks = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
758
742
  const builderContext = useContext(BuilderContext);
759
743
  const state = {};
760
744
  return /*#__PURE__*/ jsxs("div", {
761
- class: className(props) + " div-RenderBlocks",
745
+ class: className$1(props) + " div-RenderBlocks",
762
746
  get "builder-path" () {
763
747
  return props.path;
764
748
  },
@@ -849,54 +833,113 @@ const columnCssVars = function columnCssVars(props, state) {
849
833
  "--column-margin-left-tablet": maybeApplyForTablet(props, state, marginLeft)
850
834
  };
851
835
  };
836
+ const getWidthForBreakpointSize = function getWidthForBreakpointSize(props, state, size) {
837
+ const breakpointSizes = getSizesForBreakpoints(props.customBreakpoints || {});
838
+ return breakpointSizes[size].max;
839
+ };
840
+ const columnStyleObjects = function columnStyleObjects(props, state) {
841
+ return {
842
+ columns: {
843
+ small: {
844
+ flexDirection: "var(--flex-dir)",
845
+ alignItems: "stretch"
846
+ },
847
+ medium: {
848
+ flexDirection: "var(--flex-dir-tablet)",
849
+ alignItems: "stretch"
850
+ }
851
+ },
852
+ column: {
853
+ small: {
854
+ width: "var(--column-width) !important",
855
+ marginLeft: "var(--column-margin-left) !important"
856
+ },
857
+ medium: {
858
+ width: "var(--column-width-tablet) !important",
859
+ marginLeft: "var(--column-margin-left-tablet) !important"
860
+ }
861
+ }
862
+ };
863
+ };
864
+ const columnsStyles = function columnsStyles(props, state) {
865
+ return `
866
+ @media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
867
+ .${props.builderBlock.id}-breakpoints {
868
+ ${convertStyleMapToCSS(columnStyleObjects().columns.medium)}
869
+ }
870
+
871
+ .${props.builderBlock.id}-breakpoints > .builder-column {
872
+ ${convertStyleMapToCSS(columnStyleObjects().column.medium)}
873
+ }
874
+ }
875
+
876
+ @media (max-width: ${getWidthForBreakpointSize(props, state, "small")}px) {
877
+ .${props.builderBlock.id}-breakpoints {
878
+ ${convertStyleMapToCSS(columnStyleObjects().columns.small)}
879
+ }
880
+
881
+ .${props.builderBlock.id}-breakpoints > .builder-column {
882
+ ${convertStyleMapToCSS(columnStyleObjects().column.small)}
883
+ }
884
+ },
885
+ `;
886
+ };
887
+ const reactNativeColumnsStyles = function reactNativeColumnsStyles(props, state) {
888
+ return columnStyleObjects().columns.small;
889
+ };
890
+ const reactNativeColumnStyles = function reactNativeColumnStyles(props, state) {
891
+ return columnStyleObjects().column.small;
892
+ };
852
893
  const Columns = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
853
894
  useStylesScopedQrl(inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
854
895
  const state = {};
855
- return /*#__PURE__*/ jsx("div", {
856
- class: "builder-columns div-Columns",
857
- style: columnsCssVars(props, state),
858
- children: (props.columns || []).map(function(column, index) {
859
- return /*#__PURE__*/ jsx("div", {
860
- class: "builder-column div-Columns-2",
861
- style: {
862
- width: getColumnCssWidth(props, state, index),
863
- marginLeft: `${index === 0 ? 0 : getGutterSize(props)}px`,
864
- ...columnCssVars(props, state)
865
- },
866
- children: /*#__PURE__*/ jsx(RenderBlocks$1, {
867
- get blocks () {
868
- return column.blocks;
869
- },
870
- path: `component.options.columns.${index}.blocks`,
871
- get parent () {
872
- return props.builderBlock.id;
873
- },
874
- styleProp: {
875
- flexGrow: "1"
896
+ return /*#__PURE__*/ jsxs("div", {
897
+ class: `builder-columns ${props.builderBlock.id}-breakpoints` + " div-Columns",
898
+ style: {
899
+ ...TARGET === "reactNative" ? reactNativeColumnsStyles() : {},
900
+ ...columnsCssVars(props, state)
901
+ },
902
+ children: [
903
+ TARGET !== "reactNative" ? /*#__PURE__*/ jsx(RenderInlinedStyles$1, {
904
+ styles: columnsStyles(props, state)
905
+ }) : null,
906
+ (props.columns || []).map(function(column, index) {
907
+ return /*#__PURE__*/ jsx("div", {
908
+ class: "builder-column div-Columns-2",
909
+ style: {
910
+ width: getColumnCssWidth(props, state, index),
911
+ marginLeft: `${index === 0 ? 0 : getGutterSize(props)}px`,
912
+ ...TARGET === "reactNative" ? reactNativeColumnStyles() : {},
913
+ ...columnCssVars(props, state)
876
914
  },
877
- [_IMMUTABLE]: {
878
- blocks: _wrapSignal(column, "blocks"),
879
- parent: _wrapSignal(props.builderBlock, "id")
880
- }
881
- })
882
- }, index);
883
- })
915
+ children: /*#__PURE__*/ jsx(RenderBlocks$1, {
916
+ get blocks () {
917
+ return column.blocks;
918
+ },
919
+ path: `component.options.columns.${index}.blocks`,
920
+ get parent () {
921
+ return props.builderBlock.id;
922
+ },
923
+ styleProp: {
924
+ flexGrow: "1"
925
+ },
926
+ [_IMMUTABLE]: {
927
+ blocks: _wrapSignal(column, "blocks"),
928
+ parent: _wrapSignal(props.builderBlock, "id")
929
+ }
930
+ })
931
+ }, index);
932
+ })
933
+ ]
884
934
  });
885
935
  }, "Columns_component_7yLj4bxdI6c"));
886
936
  const Columns$1 = Columns;
887
937
  const STYLES$2 = `.div-Columns {
888
938
  display: flex;
889
- align-items: stretch;
890
- line-height: normal; }@media (max-width: 991px) { .div-Columns {
891
- flex-direction: var(--flex-dir-tablet); } }@media (max-width: 639px) { .div-Columns {
892
- flex-direction: var(--flex-dir); } }.div-Columns-2 {
939
+ line-height: normal; }.div-Columns-2 {
893
940
  display: flex;
894
941
  flex-direction: column;
895
- align-items: stretch; }@media (max-width: 991px) { .div-Columns-2 {
896
- width: var(--column-width-tablet) !important;
897
- margin-left: var(--column-margin-left-tablet) !important; } }@media (max-width: 639px) { .div-Columns-2 {
898
- width: var(--column-width) !important;
899
- margin-left: var(--column-margin-left) !important; } }`;
942
+ align-items: stretch; }`;
900
943
 
901
944
  // Taken from (and modified) the shopify theme script repo
902
945
  // https://github.com/Shopify/theme-scripts/blob/bcfb471f2a57d439e2f964a1bb65b67708cc90c3/packages/theme-images/images.js#L59
@@ -1650,9 +1693,18 @@ const componentInfo$6 = {
1650
1693
  const SectionComponent = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
1651
1694
  return /*#__PURE__*/ jsx("section", {
1652
1695
  ...props.attributes,
1653
- style: (()=>{
1654
- props.maxWidth && typeof props.maxWidth === "number" ? props.maxWidth : undefined;
1655
- })(),
1696
+ style: {
1697
+ width: "100%",
1698
+ alignSelf: "stretch",
1699
+ flexGrow: "1",
1700
+ boxSizing: "border-box",
1701
+ maxWidth: `${props.maxWidth && typeof props.maxWidth === "number" ? props.maxWidth : 1200}px`,
1702
+ display: "flex",
1703
+ flexDirection: "column",
1704
+ alignItems: "stretch",
1705
+ marginLeft: "auto",
1706
+ marginRight: "auto"
1707
+ },
1656
1708
  children: /*#__PURE__*/ jsx(Slot, {})
1657
1709
  });
1658
1710
  }, "SectionComponent_component_ZWF9iD5WeLg"));
@@ -2275,8 +2327,6 @@ const setContentVariationCookie = ({ contentId , canTrack , value })=>setCookie
2275
2327
  canTrack
2276
2328
  });
2277
2329
 
2278
- const checkIsDefined = (maybeT)=>maybeT !== null && maybeT !== undefined;
2279
-
2280
2330
  const checkIsBuilderContentWithVariations = (item)=>checkIsDefined(item.id) && checkIsDefined(item.variations) && Object.keys(item.variations).length > 0;
2281
2331
  /**
2282
2332
  * Randomly assign a variation to this user and store it in cookies/storage
@@ -2613,6 +2663,11 @@ const useContent = function useContent(props, state, elementRef) {
2613
2663
  ...props.content?.data,
2614
2664
  ...props.data,
2615
2665
  ...state.overrideContent?.data
2666
+ },
2667
+ meta: {
2668
+ ...props.content?.meta,
2669
+ ...state.overrideContent?.meta,
2670
+ breakpoints: state.useBreakpoints || state.overrideContent?.meta?.breakpoints || props.content?.meta?.breakpoints
2616
2671
  }
2617
2672
  };
2618
2673
  return mergedContent;
@@ -2653,11 +2708,20 @@ const allRegisteredComponents = function allRegisteredComponents(props, state, e
2653
2708
  const processMessage = function processMessage(props, state, elementRef, event) {
2654
2709
  const { data } = event;
2655
2710
  if (data) switch(data.type){
2656
- case "builder.contentUpdate":
2711
+ case "builder.configureSdk":
2657
2712
  {
2658
2713
  const messageContent = data.data;
2659
- const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
2660
- const contentData = messageContent.data;
2714
+ const { breakpoints , contentId } = messageContent;
2715
+ if (!contentId || contentId !== useContent(props, state)?.id) return;
2716
+ state.useBreakpoints = breakpoints;
2717
+ state.forceReRenderCount = state.forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
2718
+ break;
2719
+ }
2720
+ case "builder.contentUpdate":
2721
+ {
2722
+ const messageContent1 = data.data;
2723
+ const key = messageContent1.key || messageContent1.alias || messageContent1.entry || messageContent1.modelName;
2724
+ const contentData = messageContent1.data;
2661
2725
  if (key === props.model) {
2662
2726
  state.overrideContent = contentData;
2663
2727
  state.forceReRenderCount = state.forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
@@ -2740,7 +2804,8 @@ const RenderContent = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
2740
2804
  forceReRenderCount: 0,
2741
2805
  overrideContent: null,
2742
2806
  overrideState: {},
2743
- update: 0
2807
+ update: 0,
2808
+ useBreakpoints: null
2744
2809
  });
2745
2810
  useContextProvider(BuilderContext, useStore({
2746
2811
  content: (()=>{
@@ -2886,13 +2951,22 @@ const RenderContent = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
2886
2951
  const RenderContent$1 = RenderContent;
2887
2952
 
2888
2953
  // GENERATED BY MITOSIS
2954
+ const className = function className(props, state, builderContext) {
2955
+ return [
2956
+ ...[
2957
+ props.attributes.class
2958
+ ],
2959
+ "builder-symbol",
2960
+ props.symbol?.inline ? "builder-inline-symbol" : undefined,
2961
+ props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : undefined
2962
+ ].filter(Boolean).join(" ");
2963
+ };
2889
2964
  const contentToUse = function contentToUse(props, state, builderContext) {
2890
2965
  return props.symbol?.content || state.fetchedContent;
2891
2966
  };
2892
2967
  const Symbol$1 = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
2893
2968
  const builderContext = useContext(BuilderContext);
2894
2969
  const state = useStore({
2895
- className: "builder-symbol",
2896
2970
  fetchedContent: null
2897
2971
  });
2898
2972
  useWatchQrl(inlinedQrl(({ track })=>{
@@ -2924,9 +2998,7 @@ const Symbol$1 = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
2924
2998
  ]));
2925
2999
  return /*#__PURE__*/ jsx("div", {
2926
3000
  ...props.attributes,
2927
- get class () {
2928
- return state.className;
2929
- },
3001
+ class: className(props),
2930
3002
  children: /*#__PURE__*/ jsx(RenderContent$1, {
2931
3003
  get apiKey () {
2932
3004
  return builderContext.apiKey;
@@ -2946,10 +3018,7 @@ const Symbol$1 = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
2946
3018
  apiKey: _wrapSignal(builderContext, "apiKey"),
2947
3019
  context: _wrapSignal(builderContext, "context")
2948
3020
  }
2949
- }),
2950
- [_IMMUTABLE]: {
2951
- class: _wrapSignal(state, "className")
2952
- }
3021
+ })
2953
3022
  });
2954
3023
  }, "Symbol_component_WVvggdkUPdk"));
2955
3024
  const Symbol$2 = Symbol$1;
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "description": "Builder.io Qwik SDK",
5
5
  "type": "module",
6
6
  "main": "./lib/index.qwik.cjs",
7
7
  "module": "./lib/index.qwik.mjs",
8
8
  "qwik": "./lib/index.qwik.mjs",
9
9
  "types": "./types/index.d.ts",
10
+ "files": [
11
+ "README.md",
12
+ "package.json",
13
+ "types-hacks.d.ts",
14
+ "types",
15
+ "lib"
16
+ ],
10
17
  "exports": {
11
18
  ".": {
12
19
  "import": "./lib/index.qwik.mjs",
@@ -16,8 +23,8 @@
16
23
  "scripts": {
17
24
  "typecheck": "tsc --noEmit",
18
25
  "build": "tsc && vite build --mode lib",
19
- "release:patch": "yarn run build && npm version patch --no-git-tag-version && npm publish --access public",
20
- "release:dev": "yarn run build && npm version prerelease --no-git-tag-version && npm publish --tag latest --access public"
26
+ "release:patch": "yarn run build && yarn version patch && npm publish --access public",
27
+ "release:dev": "yarn run build && npm version prerelease && npm publish --tag latest --access public"
21
28
  },
22
29
  "devDependencies": {
23
30
  "@types/node": "latest",
@@ -25,6 +32,6 @@
25
32
  "vite": "^3.0.4"
26
33
  },
27
34
  "peerDependencies": {
28
- "@builder.io/qwik": ">=0.0.108"
35
+ "@builder.io/qwik": ">=0.13.3"
29
36
  }
30
37
  }
@@ -1,4 +1,6 @@
1
1
  import type { BuilderBlock } from "../../types/builder-block";
2
+ import type { SizeName } from "../../constants/device-sizes";
3
+ import type { Breakpoints } from "../../types/builder-content";
2
4
  declare type Column = {
3
5
  blocks: any;
4
6
  width?: number;
@@ -10,6 +12,7 @@ export interface ColumnProps {
10
12
  space?: number;
11
13
  stackColumnsAt?: StackColumnsAt;
12
14
  reverseColumnsWhenStacked?: boolean;
15
+ customBreakpoints?: Breakpoints;
13
16
  }
14
17
  export declare const getGutterSize: (props: any, state: any) => any;
15
18
  export declare const getColumns: (props: any, state: any) => any;
@@ -26,6 +29,38 @@ export declare const columnCssVars: (props: any, state: any) => {
26
29
  "--column-width-tablet": string | undefined;
27
30
  "--column-margin-left-tablet": string | undefined;
28
31
  };
32
+ export declare const getWidthForBreakpointSize: (props: any, state: any, size: SizeName) => number;
33
+ export declare const columnStyleObjects: (props: any, state: any) => {
34
+ columns: {
35
+ small: {
36
+ flexDirection: string;
37
+ alignItems: string;
38
+ };
39
+ medium: {
40
+ flexDirection: string;
41
+ alignItems: string;
42
+ };
43
+ };
44
+ column: {
45
+ small: {
46
+ width: string;
47
+ marginLeft: string;
48
+ };
49
+ medium: {
50
+ width: string;
51
+ marginLeft: string;
52
+ };
53
+ };
54
+ };
55
+ export declare const columnsStyles: (props: any, state: any) => string;
56
+ export declare const reactNativeColumnsStyles: (props: any, state: any) => {
57
+ flexDirection: string;
58
+ alignItems: string;
59
+ };
60
+ export declare const reactNativeColumnStyles: (props: any, state: any) => {
61
+ width: string;
62
+ marginLeft: string;
63
+ };
29
64
  export declare const Columns: import("@builder.io/qwik").Component<ColumnProps>;
30
65
  export default Columns;
31
- export declare const STYLES = ".div-Columns { \ndisplay: flex;\nalign-items: stretch;\nline-height: normal; }@media (max-width: 991px) { .div-Columns { \nflex-direction: var(--flex-dir-tablet); } }@media (max-width: 639px) { .div-Columns { \nflex-direction: var(--flex-dir); } }.div-Columns-2 { \ndisplay: flex;\nflex-direction: column;\nalign-items: stretch; }@media (max-width: 991px) { .div-Columns-2 { \nwidth: var(--column-width-tablet) !important;\nmargin-left: var(--column-margin-left-tablet) !important; } }@media (max-width: 639px) { .div-Columns-2 { \nwidth: var(--column-width) !important;\nmargin-left: var(--column-margin-left) !important; } }";
66
+ export declare const STYLES = ".div-Columns { \ndisplay: flex;\nline-height: normal; }.div-Columns-2 { \ndisplay: flex;\nflex-direction: column;\nalign-items: stretch; }";
@@ -16,6 +16,7 @@ export interface SymbolProps {
16
16
  attributes?: any;
17
17
  inheritState?: boolean;
18
18
  }
19
+ export declare const className: (props: any, state: any, builderContext: any) => string;
19
20
  export declare const contentToUse: (props: any, state: any, builderContext: any) => any;
20
21
  export declare const Symbol: import("@builder.io/qwik").Component<SymbolProps>;
21
22
  export default Symbol;
@@ -13,7 +13,7 @@ export declare const actions: (props: any, state: any) => {
13
13
  [index: string]: (event: Event) => any;
14
14
  };
15
15
  export declare const attributes: (props: any, state: any) => {
16
- style?: CSSStyleDeclaration | Record<string, string | undefined> | undefined;
16
+ style: string | Partial<CSSStyleDeclaration> | Record<string, string | undefined> | undefined;
17
17
  'builder-id': string | undefined;
18
18
  class: string;
19
19
  };
@@ -1,10 +1,12 @@
1
1
  import type { BuilderBlock } from "../../types/builder-block.js";
2
2
  import type { BuilderContextInterface } from "../../context/types.js";
3
+ import type { Breakpoints } from "../../types/builder-content.js";
3
4
  export interface RenderComponentProps {
4
5
  componentRef: any;
5
6
  componentOptions: any;
6
7
  blockChildren: BuilderBlock[];
7
8
  context: BuilderContextInterface;
9
+ customBreakpoints?: Breakpoints;
8
10
  }
9
11
  export declare const RenderComponent: (props: RenderComponentProps & {
10
12
  key?: any;
@@ -1,5 +1,6 @@
1
1
  import type { BuilderBlock } from '../types/builder-block.js';
2
2
  export declare function getBlockProperties(block: BuilderBlock): {
3
3
  'builder-id': string | undefined;
4
+ style: string | Partial<CSSStyleDeclaration> | undefined;
4
5
  class: string;
5
6
  };
@@ -1,6 +1,7 @@
1
1
  import type { BuilderContextInterface } from '../context/types.js';
2
2
  import type { BuilderBlock } from '../types/builder-block.js';
3
- export declare function getReactNativeBlockStyles({ block, context, }: {
3
+ export declare function getReactNativeBlockStyles({ block, context, blockStyles, }: {
4
4
  block: BuilderBlock;
5
5
  context: BuilderContextInterface;
6
+ blockStyles: any;
6
7
  }): CSSStyleDeclaration | Record<string, string | undefined>;
@@ -0,0 +1 @@
1
+ export declare function transformBlockProperties<T>(properties: T): T;
@@ -1,3 +1,5 @@
1
+ export declare const convertStyleMapToCSSArray: (style: Partial<CSSStyleDeclaration>) => string[];
2
+ export declare const convertStyleMapToCSS: (style: Partial<CSSStyleDeclaration>) => string;
1
3
  export declare const createCssClass: ({ mediaQuery, className, styles, }: {
2
4
  mediaQuery?: string | undefined;
3
5
  className: string;
@@ -53,5 +53,6 @@ export interface BuilderBlock {
53
53
  itemName?: string;
54
54
  } | null;
55
55
  animations?: any[];
56
+ style?: Partial<CSSStyleDeclaration>;
56
57
  }
57
58
  export {};
@@ -1,5 +1,10 @@
1
1
  import type { BuilderBlock } from './builder-block.js';
2
+ import type { Nullable } from './typescript.js';
2
3
  declare type Input = any;
4
+ export interface Breakpoints {
5
+ small: number;
6
+ medium: number;
7
+ }
3
8
  export interface BuilderContentVariation {
4
9
  data?: {
5
10
  title?: string;
@@ -19,10 +24,7 @@ export interface BuilderContentVariation {
19
24
  testRatio?: number;
20
25
  id?: string;
21
26
  meta?: {
22
- breakpoints?: {
23
- small: number;
24
- medium: number;
25
- };
27
+ breakpoints?: Nullable<Breakpoints>;
26
28
  [key: string]: any;
27
29
  };
28
30
  }
@@ -1,3 +1,3 @@
1
1
  declare type MitosisTargets = import('@builder.io/mitosis').Target;
2
- export declare type Target = Extract<MitosisTargets, 'vue3' | 'vue2' | 'reactNative' | 'svelte' | 'qwik'>;
2
+ export declare type Target = Extract<MitosisTargets, 'vue3' | 'vue2' | 'reactNative' | 'svelte' | 'qwik' | 'react' | 'solid'>;
3
3
  export {};