dumi 2.2.6 → 2.2.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/dist/client/theme-api/useNavData.js +2 -1
- package/dist/client/theme-api/useSidebarData.d.ts +2 -1
- package/dist/client/theme-api/useSidebarData.js +1 -1
- package/package.json +1 -1
- package/theme-default/builtins/API/index.js +2 -0
- package/theme-default/layouts/DocLayout/index.js +1 -1
- package/theme-default/slots/ColorSwitch/index.less +5 -4
- package/theme-default/slots/Toc/index.js +1 -1
|
@@ -16,6 +16,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
16
16
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
17
|
import { useFullSidebarData, useLocale, useSiteData } from 'dumi';
|
|
18
18
|
import { useState } from 'react';
|
|
19
|
+
import { getLocaleClearPath } from "./useSidebarData";
|
|
19
20
|
import { getLocaleNav, pickRouteSortMeta, useLocaleDocRoutes, useRouteDataComparer } from "./utils";
|
|
20
21
|
function genNavItem(meta, groups, activePath, link) {
|
|
21
22
|
return _objectSpread({
|
|
@@ -69,7 +70,7 @@ export var useNavData = function useNavData() {
|
|
|
69
70
|
var _ref6 = _slicedToArray(_ref5, 2),
|
|
70
71
|
link = _ref6[0],
|
|
71
72
|
groups = _ref6[1];
|
|
72
|
-
var _ref7 = link.match(/^(\/[^/]+)([^]+)?$/),
|
|
73
|
+
var _ref7 = "/".concat(getLocaleClearPath(link.replace(/^\//, ''), locale)).match(/^(\/[^/]+)([^]+)?$/),
|
|
73
74
|
_ref8 = _slicedToArray(_ref7, 3),
|
|
74
75
|
parentPath = _ref8[1],
|
|
75
76
|
restPath = _ref8[2];
|
|
@@ -19,7 +19,7 @@ import { useLocale, useLocation, useRouteMeta, useSiteData } from 'dumi';
|
|
|
19
19
|
import { useState } from 'react';
|
|
20
20
|
import { pickRouteSortMeta, useLocaleDocRoutes, useRouteDataComparer } from "./utils";
|
|
21
21
|
var DEFAULT_GROUP_STUB_TITLE = '$default-group-title';
|
|
22
|
-
var getLocaleClearPath = function getLocaleClearPath(routePath, locale) {
|
|
22
|
+
export var getLocaleClearPath = function getLocaleClearPath(routePath, locale) {
|
|
23
23
|
return 'base' in locale ? routePath.replace(locale.base.slice(1), '').replace(/^\//, '') : routePath;
|
|
24
24
|
};
|
|
25
25
|
|
package/package.json
CHANGED
|
@@ -69,6 +69,8 @@ var HANDLERS = {
|
|
|
69
69
|
function: function _function(_ref3) {
|
|
70
70
|
var _this2 = this;
|
|
71
71
|
var signature = _ref3.signature;
|
|
72
|
+
// handle Function type without signature
|
|
73
|
+
if (!signature) return 'Function';
|
|
72
74
|
var signatures = 'oneOf' in signature ? signature.oneOf : [signature];
|
|
73
75
|
return signatures.map(function (signature) {
|
|
74
76
|
return "".concat(signature.isAsync ? 'async ' : '', "(").concat(signature.arguments.map(function (arg) {
|
|
@@ -4,11 +4,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
5
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import ContentFooter from "../../slots/ContentFooter";
|
|
8
7
|
import { ReactComponent as IconSidebar } from '@ant-design/icons-svg/inline-svg/outlined/align-left.svg';
|
|
9
8
|
import animateScrollTo from 'animated-scroll-to';
|
|
10
9
|
import { Helmet, useIntl, useLocation, useOutlet, useRouteMeta, useSidebarData, useSiteData } from 'dumi';
|
|
11
10
|
import Content from 'dumi/theme/slots/Content';
|
|
11
|
+
import ContentFooter from 'dumi/theme/slots/ContentFooter';
|
|
12
12
|
import Features from 'dumi/theme/slots/Features';
|
|
13
13
|
import Footer from 'dumi/theme/slots/Footer';
|
|
14
14
|
import Header from 'dumi/theme/slots/Header';
|
|
@@ -46,7 +46,7 @@ var Toc = function Toc() {
|
|
|
46
46
|
});
|
|
47
47
|
setSectionRefs(refs);
|
|
48
48
|
}
|
|
49
|
-
}, [pathname, search, loading]);
|
|
49
|
+
}, [pathname, search, loading, memoToc]);
|
|
50
50
|
return sectionRefs.length ? /*#__PURE__*/React.createElement(ScrollSpy, {
|
|
51
51
|
sectionRefs: sectionRefs
|
|
52
52
|
}, function (_ref3) {
|