@blocklet/meta 1.17.5-beta-20251211-104355-426d7eb6 → 1.17.5-beta-20251214-122206-29056e8c

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.
@@ -14,6 +14,7 @@ exports.joinLink = joinLink;
14
14
  exports.flattenNavigation = flattenNavigation;
15
15
  exports.splitNavigationBySection = splitNavigationBySection;
16
16
  const constant_1 = require("@abtnode/constant");
17
+ const constant_2 = require("@blocklet/constant");
17
18
  const unionWith_1 = __importDefault(require("lodash/unionWith"));
18
19
  const isEqual_1 = __importDefault(require("lodash/isEqual"));
19
20
  const pick_1 = __importDefault(require("lodash/pick"));
@@ -521,8 +522,9 @@ function cleanOrphanNavigation(list) {
521
522
  });
522
523
  }
523
524
  const sortRootNavigation = (navigation) => {
524
- const [root, other] = (0, partition_1.default)(navigation, (x) => x.id === '/team');
525
- return [...root, ...other];
525
+ const [system, rest] = (0, partition_1.default)(navigation, (x) => x.id === constant_2.NAV_GROUP_SYSTEM);
526
+ const [services, others] = (0, partition_1.default)(rest, (x) => x.id === constant_2.NAV_GROUP_SERVICES);
527
+ return [...system, ...services, ...others];
526
528
  };
527
529
  exports.sortRootNavigation = sortRootNavigation;
528
530
  // FIXME: Pillar, 这个函数是一个过渡方案, 用来清理 navigation 中的历史数据, 之后可以删除
@@ -530,7 +532,7 @@ const cleanOldNavigationHistory = (navigation) => {
530
532
  const [, other] = (0, partition_1.default)(navigation, (x) => {
531
533
  const title = typeof x.title === 'string' ? x.title : x.title?.en;
532
534
  // 这里找不到多余的可以用来判断的数据, 只好用 title 来判断
533
- return (x.id === '/team' && title === 'Access') || (x.id === '/dashboard' && title === 'Blocklet');
535
+ return x.id === constant_2.NAV_GROUP_TEAM || (x.id === '/dashboard' && title === 'Blocklet');
534
536
  });
535
537
  return other;
536
538
  };
@@ -545,6 +547,7 @@ function parseNavigation(blocklet = {}, options = {}) {
545
547
  });
546
548
  });
547
549
  const orgIsEnabled = (0, get_1.default)(blocklet, 'settings.org.enabled', false);
550
+ const internalGroupPaths = [constant_2.NAV_GROUP_TEAM, constant_2.NAV_GROUP_SYSTEM, constant_2.NAV_GROUP_SERVICES];
548
551
  // 移除存在 db 中的默认导航
549
552
  if (blocklet?.settings?.navigations) {
550
553
  if (!Array.isArray(blocklet.settings.navigations)) {
@@ -552,7 +555,8 @@ function parseNavigation(blocklet = {}, options = {}) {
552
555
  }
553
556
  else {
554
557
  blocklet.settings.navigations = [...blocklet.settings.navigations]
555
- .filter((item) => !(item?.parent === '/team' && item.from === 'team-tmpl'))
558
+ // 移除内置导航
559
+ .filter((item) => !(item.from === 'team-tmpl' && internalGroupPaths.includes(item?.parent)))
556
560
  .map((item) => {
557
561
  // 兼容历史数据,如果存储的没有 private 字段但是 blocklet.yml 有这个字段,则将 blocklet.yml 的 private 字段赋值给 blocklet.settings.navigations
558
562
  // private 字段不会被修改,只会在 blocklet.yml 中存在
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.17.5-beta-20251211-104355-426d7eb6",
6
+ "version": "1.17.5-beta-20251214-122206-29056e8c",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "homepage": "https://www.arcblock.io/docs/blocklet-spec",
9
9
  "main": "./lib/index.js",
@@ -24,19 +24,19 @@
24
24
  "author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@abtnode/constant": "1.17.5-beta-20251211-104355-426d7eb6",
28
- "@abtnode/db-cache": "1.17.5-beta-20251211-104355-426d7eb6",
29
- "@abtnode/docker-utils": "1.17.5-beta-20251211-104355-426d7eb6",
30
- "@arcblock/did": "^1.27.12",
31
- "@arcblock/did-ext": "^1.27.12",
32
- "@arcblock/did-util": "^1.27.12",
33
- "@arcblock/jwt": "^1.27.12",
34
- "@blocklet/constant": "1.17.5-beta-20251211-104355-426d7eb6",
35
- "@ocap/asset": "^1.27.12",
36
- "@ocap/mcrypto": "^1.27.12",
37
- "@ocap/types": "^1.27.12",
38
- "@ocap/util": "^1.27.12",
39
- "@ocap/wallet": "^1.27.12",
27
+ "@abtnode/constant": "1.17.5-beta-20251214-122206-29056e8c",
28
+ "@abtnode/db-cache": "1.17.5-beta-20251214-122206-29056e8c",
29
+ "@abtnode/docker-utils": "1.17.5-beta-20251214-122206-29056e8c",
30
+ "@arcblock/did": "^1.27.14",
31
+ "@arcblock/did-ext": "^1.27.14",
32
+ "@arcblock/did-util": "^1.27.14",
33
+ "@arcblock/jwt": "^1.27.14",
34
+ "@blocklet/constant": "1.17.5-beta-20251214-122206-29056e8c",
35
+ "@ocap/asset": "^1.27.14",
36
+ "@ocap/mcrypto": "^1.27.14",
37
+ "@ocap/types": "^1.27.14",
38
+ "@ocap/util": "^1.27.14",
39
+ "@ocap/wallet": "^1.27.14",
40
40
  "ajv": "^8.11.0",
41
41
  "axios": "^1.7.9",
42
42
  "cjk-length": "^1.0.0",
@@ -79,5 +79,5 @@
79
79
  "ts-node": "^10.9.1",
80
80
  "typescript": "^5.6.3"
81
81
  },
82
- "gitHead": "9ea2a8077a8edbf5021281e823719758eb9fe02c"
82
+ "gitHead": "6839aebc2fdccbfbe7448f1e38f90be300ee4051"
83
83
  }