@blocklet/meta 1.8.6 → 1.8.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.
- package/lib/parse-navigation.js +8 -0
- package/lib/schema.js +1 -0
- package/lib/util.js +1 -2
- package/package.json +16 -16
package/lib/parse-navigation.js
CHANGED
|
@@ -36,6 +36,10 @@ const doParseNavigation = (navigation, blocklet, prefix = '/', _level = 1) => {
|
|
|
36
36
|
item.link = '';
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
if (nav.role) {
|
|
40
|
+
item.role = nav.role;
|
|
41
|
+
}
|
|
42
|
+
|
|
39
43
|
if (nav.items?.length) {
|
|
40
44
|
const list = doParseNavigation(nav.items, blocklet, prefix, _level + 1);
|
|
41
45
|
if (list.length) {
|
|
@@ -70,6 +74,10 @@ const doParseNavigation = (navigation, blocklet, prefix = '/', _level = 1) => {
|
|
|
70
74
|
item.icon = nav.icon;
|
|
71
75
|
}
|
|
72
76
|
|
|
77
|
+
if (nav.role) {
|
|
78
|
+
item.role = nav.role;
|
|
79
|
+
}
|
|
80
|
+
|
|
73
81
|
const childNavigation = get(child, 'meta.navigation', []);
|
|
74
82
|
if (!childNavigation.length) {
|
|
75
83
|
// child does not declares menu
|
package/lib/schema.js
CHANGED
|
@@ -240,6 +240,7 @@ const navigationItemSchema = Joi.object({
|
|
|
240
240
|
link: Joi.string().min(1),
|
|
241
241
|
child: Joi.string().min(1), // child name or child did
|
|
242
242
|
section: Joi.array().items(Joi.string().min(1)).single(),
|
|
243
|
+
role: Joi.array().items(Joi.string().min(1)).single(),
|
|
243
244
|
icon: Joi.string().min(1),
|
|
244
245
|
});
|
|
245
246
|
|
package/lib/util.js
CHANGED
|
@@ -129,7 +129,7 @@ const forEachBlocklet = (
|
|
|
129
129
|
|
|
130
130
|
// parallel
|
|
131
131
|
const tasks = inputTasks || [];
|
|
132
|
-
tasks.push(cb(blocklet, { parent: _parent, root, level: _level, ancestors: _ancestors }));
|
|
132
|
+
tasks.push(cb(blocklet, { parent: _parent, root, level: _level, ancestors: _ancestors, id }));
|
|
133
133
|
if (blocklet.children) {
|
|
134
134
|
for (const child of blocklet.children) {
|
|
135
135
|
forEachBlocklet(child, cb, {
|
|
@@ -139,7 +139,6 @@ const forEachBlocklet = (
|
|
|
139
139
|
_level: _level + 1,
|
|
140
140
|
_tasks: tasks,
|
|
141
141
|
_ancestors: newAncestors,
|
|
142
|
-
id,
|
|
143
142
|
});
|
|
144
143
|
}
|
|
145
144
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.7",
|
|
7
7
|
"description": "Library to parse/validate/fix blocklet meta",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,20 +18,20 @@
|
|
|
18
18
|
"author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@abtnode/constant": "1.8.
|
|
22
|
-
"@abtnode/util": "1.8.
|
|
23
|
-
"@arcblock/did": "1.17.
|
|
24
|
-
"@arcblock/did-ext": "1.17.
|
|
25
|
-
"@arcblock/did-util": "1.17.
|
|
26
|
-
"@arcblock/jwt": "1.17.
|
|
27
|
-
"@ocap/asset": "1.17.
|
|
28
|
-
"@ocap/mcrypto": "1.17.
|
|
29
|
-
"@ocap/util": "1.17.
|
|
30
|
-
"@ocap/wallet": "1.17.
|
|
21
|
+
"@abtnode/constant": "1.8.7",
|
|
22
|
+
"@abtnode/util": "1.8.7",
|
|
23
|
+
"@arcblock/did": "1.17.10",
|
|
24
|
+
"@arcblock/did-ext": "1.17.10",
|
|
25
|
+
"@arcblock/did-util": "1.17.10",
|
|
26
|
+
"@arcblock/jwt": "1.17.10",
|
|
27
|
+
"@ocap/asset": "1.17.10",
|
|
28
|
+
"@ocap/mcrypto": "1.17.10",
|
|
29
|
+
"@ocap/util": "1.17.10",
|
|
30
|
+
"@ocap/wallet": "1.17.10",
|
|
31
31
|
"ajv": "^8.11.0",
|
|
32
32
|
"cjk-length": "^1.0.0",
|
|
33
|
-
"debug": "^4.3.
|
|
34
|
-
"fs-extra": "^10.0
|
|
33
|
+
"debug": "^4.3.4",
|
|
34
|
+
"fs-extra": "^10.1.0",
|
|
35
35
|
"hosted-git-info": "3.0.8",
|
|
36
36
|
"is-glob": "^4.0.3",
|
|
37
37
|
"joi": "^17.6.0",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"js-yaml": "^4.1.0",
|
|
40
40
|
"json-stable-stringify": "^1.0.1",
|
|
41
41
|
"lodash": "^4.17.21",
|
|
42
|
-
"slugify": "^1.
|
|
42
|
+
"slugify": "^1.6.5",
|
|
43
43
|
"url-join": "^4.0.1",
|
|
44
44
|
"validate-npm-package-name": "^3.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"jest": "^27.
|
|
47
|
+
"jest": "^27.5.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9807ea28b3ae634f5806c875774ac3b7e38502a1"
|
|
50
50
|
}
|