@blocklet/meta 1.16.23-beta-c9c4e08e → 1.16.23-beta-ed83c878

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.
@@ -1,4 +1,5 @@
1
1
  import { checkLink } from './url-path-friendly';
2
+ type SectionType = 'header' | 'footer' | 'bottom' | 'social' | 'dashboard' | 'sessionManager' | 'userCenter';
2
3
  interface DeepWalkCallbackOptions {
3
4
  index: number;
4
5
  level: number;
@@ -29,14 +30,14 @@ declare function deepWalk(tree: TreeNode<'children'>, cb: DeepWalkCallback, { ke
29
30
  }): void;
30
31
  /**
31
32
  * 判断一个传入值是否属于一个 section
32
- * @param {string | array} sections 需要判断的对象
33
- * @param {string} section 目标 section
33
+ * @param {SectionType | SectionType[]} sections 需要判断的对象
34
+ * @param {SectionType} section 目标 section
34
35
  */
35
- declare function isMatchSection(sections: string[] | string, section: string): boolean;
36
+ declare function isMatchSection(sections: SectionType[] | SectionType, section: SectionType): boolean;
36
37
  interface NavigationItem {
37
38
  id: string;
38
39
  role?: string;
39
- section?: string;
40
+ section?: SectionType;
40
41
  title?: string;
41
42
  link?: string;
42
43
  items?: NavigationItem[];
@@ -43,8 +43,8 @@ function deepWalk(tree, cb = () => { }, { key = 'children', order = 'first' } =
43
43
  exports.deepWalk = deepWalk;
44
44
  /**
45
45
  * 判断一个传入值是否属于一个 section
46
- * @param {string | array} sections 需要判断的对象
47
- * @param {string} section 目标 section
46
+ * @param {SectionType | SectionType[]} sections 需要判断的对象
47
+ * @param {SectionType} section 目标 section
48
48
  */
49
49
  function isMatchSection(sections, section) {
50
50
  if (section === DEFAULT_SECTION && (0, isNil_1.default)(sections)) {
@@ -347,7 +347,7 @@ function compactNavigation(navigation, depth = 2) {
347
347
  /**
348
348
  * 返回指定的导航中的子菜单(属于指定 section)
349
349
  * @param {object} navigationItem 指定的某一个导航数据
350
- * @param {string} section 指定的 section 区域
350
+ * @param {SectionType} section 指定的 section 区域
351
351
  * @returns
352
352
  */
353
353
  function getNavigationListBySection(navigationItem, section) {
@@ -495,9 +495,9 @@ function parseNavigation(blocklet = {}, options = {}) {
495
495
  const compactedNavigation = compactNavigation(beforeProcess(builtinNavigation));
496
496
  const patchedNavigation = patchBuiltinNavigation(compactedNavigation);
497
497
  const splitNavigation = splitNavigationBySection(patchedNavigation);
498
- // 将 footer-social, footer-bottom, sessionManager 的二级菜单提升为一级菜单
498
+ // 将 footer-social, footer-bottom, sessionManager, userCenter 的二级菜单提升为一级菜单
499
499
  const levelUpNavigation = splitNavigation.reduce((all, cur) => {
500
- const shouldLevelUp = ['bottom', 'social', 'sessionManager'].includes(cur.section);
500
+ const shouldLevelUp = ['bottom', 'social', 'sessionManager', 'userCenter'].includes(cur.section);
501
501
  let isRoot = false;
502
502
  // 在更新为容器模式后,最终生成的 navigation 会将 '/' 的子菜单提升为一级菜单
503
503
  // 同时兼容非容器模式(root-blocklet 不会出现在 components 中)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.23-beta-c9c4e08e",
6
+ "version": "1.16.23-beta-ed83c878",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "main": "./lib/index.js",
9
9
  "typings": "./lib/index.d.ts",
@@ -25,12 +25,12 @@
25
25
  "author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@abtnode/constant": "1.16.23-beta-c9c4e08e",
28
+ "@abtnode/constant": "1.16.23-beta-ed83c878",
29
29
  "@arcblock/did": "1.18.110",
30
30
  "@arcblock/did-ext": "1.18.110",
31
31
  "@arcblock/did-util": "1.18.110",
32
32
  "@arcblock/jwt": "1.18.110",
33
- "@blocklet/constant": "1.16.23-beta-c9c4e08e",
33
+ "@blocklet/constant": "1.16.23-beta-ed83c878",
34
34
  "@ocap/asset": "1.18.110",
35
35
  "@ocap/mcrypto": "1.18.110",
36
36
  "@ocap/types": "1.18.110",
@@ -79,5 +79,5 @@
79
79
  "ts-node": "^10.9.1",
80
80
  "typescript": "^5.0.4"
81
81
  },
82
- "gitHead": "f2db6cfe9a6a64fc9921bfbbe2878dd343004703"
82
+ "gitHead": "09abd3c4a7c8c57a5c45f721f37362208dad8823"
83
83
  }