@aiot-toolkit/aiotpack 2.0.6-beta.5 → 2.0.6-beta.7

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.
@@ -12,6 +12,7 @@ var parse5 = _interopRequireWildcard(require("aiot-parse5"));
12
12
  var _fsExtra = _interopRequireDefault(require("fs-extra"));
13
13
  var _path = _interopRequireDefault(require("path"));
14
14
  var _QuickAppDocHelp = require("@aiot-toolkit/shared-utils/lib/utils/QuickAppDocHelp");
15
+ var _StyleUtil = _interopRequireDefault(require("@aiot-toolkit/parser/lib/ux/utils/StyleUtil"));
15
16
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -334,7 +335,19 @@ class UxLoaderUtils {
334
335
  return result;
335
336
  }
336
337
  static wrapStyle(styleNodes, file, compilerOption) {
337
- const code = JSON.stringify(styleNodes);
338
+ // 排序,媒体查询放到最后
339
+ const sortedNodes = [...styleNodes];
340
+ sortedNodes.sort((a, b) => {
341
+ const conditionA = _StyleUtil.default.isConditionStyleItem(a[0]);
342
+ const conditionB = _StyleUtil.default.isConditionStyleItem(b[0]);
343
+ if (conditionA && !conditionB) {
344
+ return 1;
345
+ } else if (!conditionA && conditionB) {
346
+ return -1;
347
+ }
348
+ return 0;
349
+ });
350
+ const code = JSON.stringify(sortedNodes);
338
351
  if (compilerOption.enableProtobuf) {
339
352
  if (styleNodes?.length) {
340
353
  const result = BinaryPlugin.addStyle(file.path, file.path, code);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiot-toolkit/aiotpack",
3
- "version": "2.0.6-beta.5",
3
+ "version": "2.0.6-beta.7",
4
4
  "description": "The process tool for packaging aiot projects.",
5
5
  "keywords": [
6
6
  "aiotpack"
@@ -19,14 +19,14 @@
19
19
  "test": "node ./__tests__/aiotpack.test.js"
20
20
  },
21
21
  "dependencies": {
22
- "@aiot-toolkit/generator": "2.0.6-beta.5",
23
- "@aiot-toolkit/parser": "2.0.6-beta.5",
24
- "@aiot-toolkit/shared-utils": "2.0.6-beta.5",
22
+ "@aiot-toolkit/generator": "2.0.6-beta.7",
23
+ "@aiot-toolkit/parser": "2.0.6-beta.7",
24
+ "@aiot-toolkit/shared-utils": "2.0.6-beta.7",
25
25
  "@hap-toolkit/aaptjs": "^2.0.0",
26
26
  "@rspack/core": "^1.3.9",
27
27
  "aiot-parse5": "^1.0.2",
28
28
  "babel-loader": "^9.1.3",
29
- "file-lane": "2.0.6-beta.5",
29
+ "file-lane": "2.0.6-beta.7",
30
30
  "file-loader": "^6.2.0",
31
31
  "fs-extra": "^11.2.0",
32
32
  "jsrsasign": "^11.1.0",
@@ -42,5 +42,5 @@
42
42
  "@types/jsrsasign": "^10.5.12",
43
43
  "@types/webpack-sources": "^3.2.3"
44
44
  },
45
- "gitHead": "d40eba7eacc8334bce1e952c39365513a171719e"
45
+ "gitHead": "f82d6f9e300b9e8b9c10a5f76d1747d978ab75fb"
46
46
  }