@builder.io/mitosis 0.5.36 → 0.5.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.
@@ -68,9 +68,13 @@ const componentMappers = {
68
68
  }),
69
69
  Columns(node, options) {
70
70
  const block = (0, exports.blockToBuilder)(node, options, { skipMapper: true });
71
- const columns = block.children.map((item) => ({
72
- blocks: item.children,
73
- }));
71
+ const columns = block.children.map((item) => {
72
+ var _a, _b;
73
+ return ({
74
+ blocks: item.children,
75
+ width: (_b = (_a = item.component) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.width,
76
+ });
77
+ });
74
78
  block.component.options.columns = columns;
75
79
  block.children = [];
76
80
  return block;
@@ -405,15 +409,34 @@ const mapBoundStyles = (bindings) => {
405
409
  }
406
410
  }
407
411
  else {
408
- bindings[`style.${key}`] = {
409
- code: parsed[key],
410
- bindingType: 'expression',
411
- type: 'single',
412
- };
412
+ if (isGlobalStyle(key)) {
413
+ console.warn(`The following bound styles are not supported by Builder JSON and have been removed:
414
+ "${key}": ${parsed[key]}
415
+ `);
416
+ }
417
+ else {
418
+ bindings[`style.${key}`] = {
419
+ code: parsed[key],
420
+ bindingType: 'expression',
421
+ type: 'single',
422
+ };
423
+ }
413
424
  }
414
425
  }
415
426
  delete bindings['style'];
416
427
  };
428
+ function isGlobalStyle(key) {
429
+ // These are mapped to their respective responsiveStyle and support bindings
430
+ if (/max-width: (.*?)px/gm.exec(key)) {
431
+ return false;
432
+ }
433
+ return (
434
+ // pseudo class
435
+ key.startsWith('&:') ||
436
+ key.startsWith(':') ||
437
+ // @ rules
438
+ key.startsWith('@'));
439
+ }
417
440
  const blockToBuilder = (json, options = {}, _internalOptions = {}) => {
418
441
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
419
442
  const mapper = !_internalOptions.skipMapper && componentMappers[json.name];
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "name": "Builder.io",
23
23
  "url": "https://www.builder.io"
24
24
  },
25
- "version": "0.5.36",
25
+ "version": "0.5.38",
26
26
  "homepage": "https://github.com/BuilderIO/mitosis",
27
27
  "main": "./dist/src/index.js",
28
28
  "exports": {