@webstudio-is/css-engine 0.49.0 → 0.50.0

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.
@@ -116,6 +116,9 @@ class MediaRule {
116
116
  this.options = options;
117
117
  __privateSet(this, _mediaType, options.mediaType ?? "all");
118
118
  }
119
+ // Sort media rules by minWidth.
120
+ // Needed to ensure that more specific media rules are inserted after less specific ones.
121
+ // So that they get a higher specificity.
119
122
  static sort(mediaRules) {
120
123
  return Array.from(mediaRules).sort((ruleA, ruleB) => {
121
124
  return (ruleA.options.minWidth ?? -Number.MAX_SAFE_INTEGER) - (ruleB.options.minWidth ?? -Number.MAX_SAFE_INTEGER);
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
package/lib/core/rules.js CHANGED
@@ -90,6 +90,9 @@ class MediaRule {
90
90
  this.options = options;
91
91
  __privateSet(this, _mediaType, options.mediaType ?? "all");
92
92
  }
93
+ // Sort media rules by minWidth.
94
+ // Needed to ensure that more specific media rules are inserted after less specific ones.
95
+ // So that they get a higher specificity.
93
96
  static sort(mediaRules) {
94
97
  return Array.from(mediaRules).sort((ruleA, ruleB) => {
95
98
  return (ruleA.options.minWidth ?? -Number.MAX_SAFE_INTEGER) - (ruleB.options.minWidth ?? -Number.MAX_SAFE_INTEGER);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/css-engine",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "CSS Renderer for Webstudio",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -9,7 +9,7 @@
9
9
  "hyphenate-style-name": "^1.0.4",
10
10
  "react": "^17.0.2",
11
11
  "react-dom": "^17.0.2",
12
- "@webstudio-is/fonts": "^0.49.0"
12
+ "@webstudio-is/fonts": "^0.50.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@jest/globals": "^29.3.1",
@@ -19,7 +19,7 @@
19
19
  "@types/react-dom": "^17.0.9",
20
20
  "jest": "^29.3.1",
21
21
  "typescript": "4.9.5",
22
- "@webstudio-is/css-data": "^0.49.0",
22
+ "@webstudio-is/css-data": "^0.50.0",
23
23
  "@webstudio-is/jest-config": "^1.0.2",
24
24
  "@webstudio-is/scripts": "^0.0.0",
25
25
  "@webstudio-is/storybook-config": "^0.0.0",