dumi 2.1.8 → 2.1.9

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.
@@ -61,7 +61,9 @@ export var useFullSidebarData = function useFullSidebarData() {
61
61
  // en-US/a => /en-US/a
62
62
  // a/b => /a
63
63
  // en-US/a/b => /en-US/a
64
- var parentPath = "/".concat(route.path.replace(/\/[^/]+$/, ''));
64
+ var parentPath = "/".concat(route.path.replace(clearPath, function (s) {
65
+ return s.replace(/\/[^/]+$/, '');
66
+ }));
65
67
 
66
68
  var _pickRouteSortMeta = pickRouteSortMeta({
67
69
  order: 0
@@ -83,6 +83,16 @@ var parser_default = (api) => {
83
83
  api.service.atomParser.destroyWorker();
84
84
  }
85
85
  });
86
+ api.modifyTheme((memo) => {
87
+ const parserOffKey = "api.component.unavailable";
88
+ const parserOnKey = "api.component.loading";
89
+ Object.keys(memo.locales).forEach((locale) => {
90
+ if (memo.locales[locale][parserOnKey]) {
91
+ memo.locales[locale][parserOffKey] = memo.locales[locale][parserOnKey];
92
+ }
93
+ });
94
+ return memo;
95
+ });
86
96
  };
87
97
  // Annotate the CommonJS export names for ESM import in node:
88
98
  0 && (module.exports = {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dumi",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "📖 Documentation Generator of React Component",
5
5
  "keywords": [
6
6
  "generator",
@@ -52,7 +52,7 @@ var API = function API(props) {
52
52
  }) : /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
53
53
  colSpan: 4
54
54
  }, intl.formatMessage({
55
- id: "api.component.".concat(components ? 'not.found' : 'loading')
55
+ id: "api.component.".concat(components ? 'not.found' : 'unavailable')
56
56
  }, {
57
57
  id: id
58
58
  }))))));
@@ -24,6 +24,7 @@
24
24
  "api.component.type": "Type",
25
25
  "api.component.default": "Default",
26
26
  "api.component.required": "(required)",
27
+ "api.component.unavailable": "apiParser must be enabled to use auto-generated API",
27
28
  "api.component.loading": "Properties definition is resolving, wait a moment...",
28
29
  "api.component.not.found": "Properties definition not found for {id} component",
29
30
  "content.tabs.default": "Doc",
@@ -24,6 +24,7 @@
24
24
  "api.component.type": "类型",
25
25
  "api.component.default": "默认值",
26
26
  "api.component.required": "(必选)",
27
+ "api.component.unavailable": "必须启用 apiParser 才能使用自动 API 特性",
27
28
  "api.component.loading": "属性定义正在解析中,稍等片刻...",
28
29
  "api.component.not.found": "未找到 {id} 组件的属性定义",
29
30
  "content.tabs.default": "文档",