@builder.io/mitosis 0.5.36 → 0.5.37

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.
@@ -405,15 +405,34 @@ const mapBoundStyles = (bindings) => {
405
405
  }
406
406
  }
407
407
  else {
408
- bindings[`style.${key}`] = {
409
- code: parsed[key],
410
- bindingType: 'expression',
411
- type: 'single',
412
- };
408
+ if (isGlobalStyle(key)) {
409
+ console.warn(`The following bound styles are not supported by Builder JSON and have been removed:
410
+ "${key}": ${parsed[key]}
411
+ `);
412
+ }
413
+ else {
414
+ bindings[`style.${key}`] = {
415
+ code: parsed[key],
416
+ bindingType: 'expression',
417
+ type: 'single',
418
+ };
419
+ }
413
420
  }
414
421
  }
415
422
  delete bindings['style'];
416
423
  };
424
+ function isGlobalStyle(key) {
425
+ // These are mapped to their respective responsiveStyle and support bindings
426
+ if (/max-width: (.*?)px/gm.exec(key)) {
427
+ return false;
428
+ }
429
+ return (
430
+ // pseudo class
431
+ key.startsWith('&:') ||
432
+ key.startsWith(':') ||
433
+ // @ rules
434
+ key.startsWith('@'));
435
+ }
417
436
  const blockToBuilder = (json, options = {}, _internalOptions = {}) => {
418
437
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
419
438
  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.37",
26
26
  "homepage": "https://github.com/BuilderIO/mitosis",
27
27
  "main": "./dist/src/index.js",
28
28
  "exports": {