dumi 2.1.11 → 2.1.13
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,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
import type { ILocale, INav, INavItem, IRouteMeta, IRoutesById, IUserNavValue } from './types';
|
|
3
3
|
export declare const useLocaleDocRoutes: () => IRoutesById;
|
|
4
4
|
/**
|
|
@@ -7,7 +7,7 @@ export declare const useLocaleDocRoutes: () => IRoutesById;
|
|
|
7
7
|
* @returns code string
|
|
8
8
|
*/
|
|
9
9
|
export declare const genReactRenderCode: (version: string) => string;
|
|
10
|
-
export declare const useIsomorphicLayoutEffect: typeof
|
|
10
|
+
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
11
11
|
/**
|
|
12
12
|
* common comparer for sidebar/nav items
|
|
13
13
|
*/
|
|
@@ -145,6 +145,19 @@ var derivative_default = (api) => {
|
|
|
145
145
|
api.registerPlugins([require.resolve("../../compiled/@umijs/plugins")]);
|
|
146
146
|
if (api.isPluginEnable("prepare"))
|
|
147
147
|
api.skipPlugins(["prepare"]);
|
|
148
|
+
if (api.isPluginEnable("routeProps")) {
|
|
149
|
+
api.skipPlugins(["routeProps"]);
|
|
150
|
+
api.onGenerateFiles({
|
|
151
|
+
stage: -Infinity,
|
|
152
|
+
fn() {
|
|
153
|
+
api.writeTmpFile({
|
|
154
|
+
noPluginDir: true,
|
|
155
|
+
path: "core/routeProps.js",
|
|
156
|
+
content: "export default {}"
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
148
161
|
};
|
|
149
162
|
// Annotate the CommonJS export names for ESM import in node:
|
|
150
163
|
0 && (module.exports = {
|
|
@@ -100,8 +100,6 @@ function rehypeDemo(opts) {
|
|
|
100
100
|
if (isFirstChild) {
|
|
101
101
|
node.data ?? (node.data = {});
|
|
102
102
|
node.data[DEMO_NODE_CONTAINER] = true;
|
|
103
|
-
if (!nextChild)
|
|
104
|
-
return SKIP;
|
|
105
103
|
while (nextChild) {
|
|
106
104
|
if (isElement(nextChild, "code") && tryMarkDemoNode(nextChild, opts) || isElement(nextChild, "br")) {
|
|
107
105
|
splitFrom += 1;
|
|
@@ -112,6 +110,8 @@ function rehypeDemo(opts) {
|
|
|
112
110
|
break;
|
|
113
111
|
}
|
|
114
112
|
}
|
|
113
|
+
if (!nextChild)
|
|
114
|
+
return SKIP;
|
|
115
115
|
}
|
|
116
116
|
const splitChildren = node.children.splice(splitFrom);
|
|
117
117
|
parent.children.splice(nodeIndex + 1, 0, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dumi",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.13",
|
|
4
4
|
"description": "📖 Documentation Generator of React Component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"generator",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"@swc/core": "^1.2.224",
|
|
81
81
|
"@types/hast": "^2.3.4",
|
|
82
82
|
"@types/mdast": "^3.0.10",
|
|
83
|
-
"@umijs/bundler-utils": "^4.0.
|
|
84
|
-
"@umijs/core": "^4.0.
|
|
83
|
+
"@umijs/bundler-utils": "^4.0.53",
|
|
84
|
+
"@umijs/core": "^4.0.53",
|
|
85
85
|
"animated-scroll-to": "^2.3.0",
|
|
86
86
|
"classnames": "2.3.2",
|
|
87
87
|
"codesandbox": "^2.2.3",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"remark-rehype": "^10.1.0",
|
|
123
123
|
"sass": "^1.55.0",
|
|
124
124
|
"sitemap": "^7.1.1",
|
|
125
|
-
"umi": "^4.0.
|
|
125
|
+
"umi": "^4.0.53",
|
|
126
126
|
"unified": "^10.1.2",
|
|
127
127
|
"unist-util-visit": "^4.1.0",
|
|
128
128
|
"unist-util-visit-parents": "^5.1.1",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"@types/pluralize": "^0.0.29",
|
|
142
142
|
"@types/react": "^18.0.16",
|
|
143
143
|
"@types/react-copy-to-clipboard": "^5.0.4",
|
|
144
|
-
"@umijs/lint": "^4.0.
|
|
144
|
+
"@umijs/lint": "^4.0.53",
|
|
145
145
|
"@umijs/plugins": "4.0.32",
|
|
146
146
|
"dumi-theme-mobile": "workspace:*",
|
|
147
147
|
"eslint": "^8.20.0",
|
|
@@ -10,14 +10,18 @@
|
|
|
10
10
|
display: inline-block;
|
|
11
11
|
font-family: Alibaba-PuHuiTi, 'Gill Sans', 'Gill Sans MT', Calibri,
|
|
12
12
|
'Trebuchet MS', sans-serif;
|
|
13
|
-
color:
|
|
13
|
+
color: lighten(desaturate(spin(@c-primary, -13), 10.5), 20);
|
|
14
14
|
font-size: 180px;
|
|
15
15
|
line-height: 1;
|
|
16
16
|
|
|
17
17
|
> span {
|
|
18
|
+
// generated via: https://nicothin.pro/lessColourFunctionCalculator/
|
|
19
|
+
@from: lighten(spin(@c-primary, -12.5), 24);
|
|
20
|
+
@to: lighten(@c-primary, 15.5);
|
|
21
|
+
|
|
18
22
|
color: transparent;
|
|
19
|
-
text-shadow: 0 10px 20px
|
|
20
|
-
background: linear-gradient(30deg,
|
|
23
|
+
text-shadow: 0 10px 20px fadeout(@c-primary, 85%);
|
|
24
|
+
background: linear-gradient(30deg, @from 30%, @to);
|
|
21
25
|
background-clip: text;
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -24,6 +24,11 @@ import { Mask } from "./Mask";
|
|
|
24
24
|
export { Input as SearchInput } from "./Input";
|
|
25
25
|
export { Mask as SearchMask } from "./Mask";
|
|
26
26
|
var isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(typeof navigator !== 'undefined' ? (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.platform : '');
|
|
27
|
+
/** Determine if the element that triggered the event is an input element */
|
|
28
|
+
|
|
29
|
+
var isInput = function isInput(target) {
|
|
30
|
+
return ['TEXTAREA', 'INPUT'].includes(target.tagName) || target.contentEditable === 'true';
|
|
31
|
+
};
|
|
27
32
|
|
|
28
33
|
var SearchBar = function SearchBar() {
|
|
29
34
|
var _useState = useState(false),
|
|
@@ -58,7 +63,7 @@ var SearchBar = function SearchBar() {
|
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
var handler = function handler(ev) {
|
|
61
|
-
if ((isAppleDevice ? ev.metaKey : ev.ctrlKey) && ev.key === 'k' || ev.key === '/') {
|
|
66
|
+
if ((isAppleDevice ? ev.metaKey : ev.ctrlKey) && ev.key === 'k' || ev.key === '/' && !isInput(ev.target)) {
|
|
62
67
|
ev.preventDefault();
|
|
63
68
|
|
|
64
69
|
if (inputRef.current) {
|