@antv/dumi-theme-antv 0.7.3-beta.2 → 0.7.3-beta.4
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/builtins/Playground/index.module.less +0 -3
- package/dist/common/GlobalStyles.js +6 -0
- package/dist/common/styles/Antd.js +9 -0
- package/dist/common/styles/Common.js +9 -0
- package/dist/common/styles/index.js +2 -0
- package/dist/common/styles/theme.js +12 -0
- package/dist/common/styles/variables.less +14 -0
- package/dist/layouts/DocLayout.js +48 -21
- package/dist/pages/Example/index.module.less +1 -4
- package/dist/pages/Examples/index.js +4 -5
- package/dist/pages/Examples/index.module.less +10 -12
- package/dist/pages/Index/components/Cases/index.module.less +2 -2
- package/dist/pages/Index/components/Companies/index.js +5 -17
- package/dist/pages/Index/components/Companies/index.module.less +33 -6
- package/dist/pages/Index/components/Detail/News.module.less +1 -0
- package/dist/pages/Index/components/Detail/index.module.less +1 -25
- package/dist/pages/Index/components/Features/index.js +8 -16
- package/dist/pages/Index/components/Features/index.module.less +21 -23
- package/dist/pages/Index/components/_.less +3 -3
- package/dist/plugin/deadLinkChecker.js +35 -15
- package/dist/plugin/index.js +9 -10
- package/dist/plugin/remarkFeedback.js +1 -1
- package/dist/slots/Banner/index.module.less +11 -11
- package/dist/slots/CodeEditor/Toolbar.module.less +1 -1
- package/dist/slots/CodeEditor/index.js +5 -1
- package/dist/slots/CodePreview/CodeHeader.js +2 -1
- package/dist/slots/ExampleSider/index.module.less +4 -6
- package/dist/slots/Feedback/index.js +1 -2
- package/dist/slots/Footer/index.module.less +2 -3
- package/dist/slots/Header/Products/Product.module.less +1 -2
- package/dist/slots/Header/Search/helper.js +1 -0
- package/dist/slots/Header/Search/index.js +1 -3
- package/dist/slots/Header/index.js +28 -24
- package/dist/slots/Header/index.module.less +19 -19
- package/dist/slots/Loading/index.js +12 -4
- package/dist/slots/Loading/index.module.less +0 -1
- package/dist/slots/ManualContent/Main.js +3 -15
- package/dist/slots/ManualContent/index.module.less +11 -14
- package/dist/slots/hooks.js +3 -1
- package/dist/static/style.js +3 -0
- package/package.json +13 -4
package/dist/plugin/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(plugin_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(plugin_exports);
|
|
35
35
|
var import_chalk = __toESM(require("chalk"));
|
|
36
|
+
var import_critters_webpack_plugin = __toESM(require("critters-webpack-plugin"));
|
|
36
37
|
var import_plugin_utils = require("dumi/plugin-utils");
|
|
37
38
|
var path = __toESM(require("path"));
|
|
38
39
|
var import_antVReactTechStack = require("./antVReactTechStack");
|
|
@@ -45,18 +46,16 @@ var PAGES_DIR = (0, import_plugin_utils.winPath)(path.join(__dirname, "../pages"
|
|
|
45
46
|
var MOCK_META = { frontmatter: { title: "mock-meta" }, texts: [], toc: [] };
|
|
46
47
|
var plugin_default = (api) => {
|
|
47
48
|
api.describe({ key: `dumi-theme:${require("../../package.json").name}` });
|
|
49
|
+
api.chainWebpack((config) => {
|
|
50
|
+
config.plugin("critters").use(import_critters_webpack_plugin.default, [
|
|
51
|
+
{
|
|
52
|
+
preload: "js-lazy",
|
|
53
|
+
inlineThreshold: 10240
|
|
54
|
+
}
|
|
55
|
+
]);
|
|
56
|
+
});
|
|
48
57
|
api.modifyDefaultConfig((memo) => {
|
|
49
58
|
memo.resolve.codeBlockMode = "passive";
|
|
50
|
-
memo.chainWebpack = (memo2) => {
|
|
51
|
-
memo2.module.rule("less").test(/\.less$/).use("style-loader").loader("style-loader").before("css-loader").end().use("css-loader").loader("css-loader").options({
|
|
52
|
-
importLoaders: 1,
|
|
53
|
-
modules: { auto: true }
|
|
54
|
-
// 启用 CSS Modules(可选)
|
|
55
|
-
}).end().use("less-loader").loader("less-loader").options({
|
|
56
|
-
javascriptEnabled: true
|
|
57
|
-
});
|
|
58
|
-
return memo2;
|
|
59
|
-
};
|
|
60
59
|
memo.exportStatic = {};
|
|
61
60
|
memo.exportStatic.extraRoutePaths = (0, import_examples.getExamplePaths)();
|
|
62
61
|
memo.mfsu = false;
|
|
@@ -41,7 +41,7 @@ function remarkFeedback() {
|
|
|
41
41
|
return (tree) => {
|
|
42
42
|
visit(tree, "heading", (node) => {
|
|
43
43
|
const headingText = node.children.filter((child) => child.type === "text").map((child) => child.value).join(" ").split(" ").join("-");
|
|
44
|
-
const template = `<button title="Post a comment" data-feedback-hash=${headingText} type="button" class="ant-btn ant-btn-text ant-btn-icon-only button comment-link
|
|
44
|
+
const template = `<button title="Post a comment" data-feedback-hash=${headingText} type="button" class="ant-btn ant-btn-text ant-btn-icon-only button comment-link">${icon}</button>`;
|
|
45
45
|
const button = {
|
|
46
46
|
type: "html",
|
|
47
47
|
value: template
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import '../../../../common/styles/variables.less';
|
|
2
2
|
|
|
3
3
|
.wrapper {
|
|
4
4
|
min-height: 650px;
|
|
@@ -56,26 +56,26 @@
|
|
|
56
56
|
z-index: 10;
|
|
57
57
|
position: relative;
|
|
58
58
|
transition: all 0.3s;
|
|
59
|
-
border: 1px solid
|
|
60
|
-
color:
|
|
59
|
+
border: 1px solid var(--primary-color);
|
|
60
|
+
color: var(--primary-color);
|
|
61
61
|
background: transparent;
|
|
62
62
|
text-align: center;
|
|
63
63
|
font-size: 1.14em;
|
|
64
64
|
line-height: 40px;
|
|
65
65
|
|
|
66
66
|
&:hover {
|
|
67
|
-
color: tint(
|
|
68
|
-
border: 1px solid tint(
|
|
69
|
-
background-color: fade(
|
|
67
|
+
color: tint(var(--primary-color), 25%);
|
|
68
|
+
border: 1px solid tint(var(--primary-color), 25%);
|
|
69
|
+
background-color: fade(var(--primary-color), 3%);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
&.primary {
|
|
73
73
|
border: none;
|
|
74
74
|
outline: none;
|
|
75
75
|
color: #fff;
|
|
76
|
-
background: linear-gradient(60deg, fade(
|
|
76
|
+
background: linear-gradient(60deg, fade(var(--primary-color), 70%), shade(var(--primary-color), 20%));
|
|
77
77
|
opacity: 0.8;
|
|
78
|
-
box-shadow: 0 8px 10px fade(
|
|
78
|
+
box-shadow: 0 8px 10px fade(var(--primary-color), 20%);
|
|
79
79
|
|
|
80
80
|
&:hover {
|
|
81
81
|
opacity: 1;
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
width: 40px;
|
|
93
93
|
height: 40px;
|
|
94
94
|
background-size: contain;
|
|
95
|
-
border: 1px solid
|
|
95
|
+
border: 1px solid var(--primary-color);
|
|
96
96
|
border-radius: 20px;
|
|
97
97
|
transition: all 0.15s;
|
|
98
98
|
display: flex;
|
|
@@ -102,14 +102,14 @@
|
|
|
102
102
|
.videoButtonIcon {
|
|
103
103
|
margin-left: 12px;
|
|
104
104
|
font-size: 16px;
|
|
105
|
-
color:
|
|
105
|
+
color: var(--primary-color);
|
|
106
106
|
line-height: 44px;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.videoButtonText {
|
|
110
110
|
line-height: 40px;
|
|
111
111
|
margin-left: 10px;
|
|
112
|
-
color:
|
|
112
|
+
color: var(--primary-color);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
&:hover {
|
|
@@ -413,7 +413,11 @@ var CodeEditor = function CodeEditor(_ref) {
|
|
|
413
413
|
value: valueOf(tab),
|
|
414
414
|
defaultValue: defaultOf(tab),
|
|
415
415
|
path: "".concat(tab, "_").concat(relativePath || exampleId),
|
|
416
|
-
loading: /*#__PURE__*/React.createElement(Loading,
|
|
416
|
+
loading: /*#__PURE__*/React.createElement(Loading, {
|
|
417
|
+
style: {
|
|
418
|
+
height: 'calc(100vh - 128px)'
|
|
419
|
+
}
|
|
420
|
+
}),
|
|
417
421
|
options: {
|
|
418
422
|
readOnly: tab === EDITOR_TABS.DATA || tab === EDITOR_TABS.SPEC,
|
|
419
423
|
automaticLayout: true,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@import '~antd/es/style/themes/default.less';
|
|
2
|
-
|
|
3
1
|
.shadowWrapper {
|
|
4
2
|
position: relative;
|
|
5
3
|
margin-bottom: 12px;
|
|
@@ -60,7 +58,7 @@
|
|
|
60
58
|
}
|
|
61
59
|
|
|
62
60
|
&:hover {
|
|
63
|
-
border-color:
|
|
61
|
+
border-color: var(--primary-color);
|
|
64
62
|
|
|
65
63
|
&:before {
|
|
66
64
|
transition: all 0.3s;
|
|
@@ -70,7 +68,7 @@
|
|
|
70
68
|
bottom: -1px;
|
|
71
69
|
right: -1px;
|
|
72
70
|
left: -1px;
|
|
73
|
-
background-color: fade(
|
|
71
|
+
background-color: fade(#873bf4, 10%);
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
74
|
|
|
@@ -98,8 +96,8 @@
|
|
|
98
96
|
}
|
|
99
97
|
|
|
100
98
|
&.current::after {
|
|
101
|
-
background-color: fade(
|
|
102
|
-
border-color:
|
|
99
|
+
background-color: fade(#873bf4, 10%);
|
|
100
|
+
border-color: #873bf4;
|
|
103
101
|
}
|
|
104
102
|
}
|
|
105
103
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useSiteData } from 'dumi';
|
|
2
2
|
import React, { lazy } from 'react';
|
|
3
|
-
import InViewSuspense from "../../common/InViewSuspense";
|
|
4
3
|
var EditButton = /*#__PURE__*/lazy(function () {
|
|
5
4
|
return import("./EditButton");
|
|
6
5
|
});
|
|
@@ -17,5 +16,5 @@ export var Feedback = function Feedback() {
|
|
|
17
16
|
if (!feedback) {
|
|
18
17
|
return null;
|
|
19
18
|
}
|
|
20
|
-
return /*#__PURE__*/React.createElement(
|
|
19
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EditButton, null), /*#__PURE__*/React.createElement(Contributors, null), /*#__PURE__*/React.createElement(SectionFeedback, null));
|
|
21
20
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
@import '
|
|
2
|
-
@import '../_.less';
|
|
1
|
+
@import '../../common/styles/variables.less';
|
|
3
2
|
|
|
4
3
|
.footer {
|
|
5
|
-
font-family:
|
|
4
|
+
font-family: var(--font-family);
|
|
6
5
|
|
|
7
6
|
:global(.rc-footer-container),
|
|
8
7
|
:global(.rc-footer-bottom-container) {
|
|
@@ -56,9 +56,7 @@ export var Search = function Search() {
|
|
|
56
56
|
return /*#__PURE__*/React.createElement(Popover, {
|
|
57
57
|
open: open,
|
|
58
58
|
placement: "topLeft",
|
|
59
|
-
destroyTooltipOnHide:
|
|
60
|
-
keepParent: false
|
|
61
|
-
},
|
|
59
|
+
destroyTooltipOnHide: false,
|
|
62
60
|
content: /*#__PURE__*/React.createElement(SearchResult, {
|
|
63
61
|
results: searchResults
|
|
64
62
|
})
|
|
@@ -14,7 +14,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
14
14
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
import { CaretDownFilled, DownOutlined, GithubOutlined, LinkOutlined, MenuOutlined, WechatOutlined } from '@ant-design/icons';
|
|
17
|
-
import { Alert, Button, Dropdown, Menu, Modal, Popover
|
|
17
|
+
import { Alert, Button, Dropdown, Menu, Modal, Popover } from 'antd';
|
|
18
18
|
import cx from 'classnames';
|
|
19
19
|
import { FormattedMessage, Link, useLocale, useSiteData } from 'dumi';
|
|
20
20
|
import { get, map, size } from 'lodash-es';
|
|
@@ -311,24 +311,27 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
311
311
|
rootDomain: rootDomain,
|
|
312
312
|
language: defaultLanguage
|
|
313
313
|
})), /** 版本列表 */
|
|
314
|
-
versions && /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(
|
|
315
|
-
defaultValue: versions[findVersion(version, Object.keys(versions))],
|
|
314
|
+
versions && /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
316
315
|
className: styles.versions,
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
316
|
+
menu: {
|
|
317
|
+
items: Object.keys(versions).map(function (version) {
|
|
318
|
+
return {
|
|
319
|
+
label: /*#__PURE__*/React.createElement("a", {
|
|
320
|
+
target: "_blank",
|
|
321
|
+
rel: "noreferrer",
|
|
322
|
+
href: versions[version]
|
|
323
|
+
}, version),
|
|
324
|
+
key: version
|
|
325
|
+
};
|
|
326
|
+
}),
|
|
327
|
+
selectable: true,
|
|
328
|
+
defaultSelectedKeys: [findVersion(version, Object.keys(versions))]
|
|
321
329
|
}
|
|
322
|
-
}, Object.keys(versions).
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
326
|
-
key: url,
|
|
327
|
-
value: url
|
|
328
|
-
}, version);
|
|
330
|
+
}, /*#__PURE__*/React.createElement("span", null, findVersion(version, Object.keys(versions)), /*#__PURE__*/React.createElement(DownOutlined, {
|
|
331
|
+
style: {
|
|
332
|
+
marginLeft: '6px'
|
|
329
333
|
}
|
|
330
|
-
|
|
331
|
-
}))), /** 切换网站语言 */
|
|
334
|
+
})))), /** 切换网站语言 */
|
|
332
335
|
showLanguageSwitcher && /*#__PURE__*/React.createElement("li", {
|
|
333
336
|
className: cx(styles.navIcon, styles.languageSwitcher)
|
|
334
337
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
@@ -353,13 +356,14 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
353
356
|
alt: "wx-qrcode"
|
|
354
357
|
}),
|
|
355
358
|
title: "\u5FAE\u4FE1\u626B\u4E00\u626B\u5173\u6CE8",
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
359
|
+
styles: {
|
|
360
|
+
body: {
|
|
361
|
+
padding: 2
|
|
362
|
+
},
|
|
363
|
+
root: {
|
|
364
|
+
width: 128,
|
|
365
|
+
height: 128
|
|
366
|
+
}
|
|
363
367
|
}
|
|
364
368
|
}, /*#__PURE__*/React.createElement(WechatOutlined, null))), /** GitHub icon */
|
|
365
369
|
showGithubCorner && /*#__PURE__*/React.createElement("li", {
|
|
@@ -386,7 +390,7 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
386
390
|
showIcon: false,
|
|
387
391
|
onClose: onBannerClose
|
|
388
392
|
}), /*#__PURE__*/React.createElement("div", {
|
|
389
|
-
className: styles.container
|
|
393
|
+
className: cx(styles.container)
|
|
390
394
|
}, /*#__PURE__*/React.createElement("div", {
|
|
391
395
|
className: styles.left
|
|
392
396
|
}, /*#__PURE__*/React.createElement("h1", null, /*#__PURE__*/React.createElement("a", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import '../../common/styles/variables.less';
|
|
2
2
|
|
|
3
3
|
@nav-height: 64px;
|
|
4
4
|
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
padding: 0;
|
|
9
9
|
position: relative;
|
|
10
10
|
z-index: 200;
|
|
11
|
-
font-family: Avenir,
|
|
11
|
+
font-family: Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
|
|
12
|
+
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
12
13
|
transition: box-shadow 0.3s, background 0.3s;
|
|
13
14
|
|
|
14
15
|
&.transparent {
|
|
@@ -203,10 +204,10 @@
|
|
|
203
204
|
box-shadow: 0 2px 0 transparent inset;
|
|
204
205
|
|
|
205
206
|
&.activeItem {
|
|
206
|
-
box-shadow: 0 2px 0
|
|
207
|
+
box-shadow: 0 2px 0 var(--primary-color) inset;
|
|
207
208
|
|
|
208
209
|
a {
|
|
209
|
-
color:
|
|
210
|
+
color: var(--primary-color);
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
213
|
|
|
@@ -216,7 +217,7 @@
|
|
|
216
217
|
display: block;
|
|
217
218
|
|
|
218
219
|
&:hover {
|
|
219
|
-
color:
|
|
220
|
+
color: var(--primary-color);
|
|
220
221
|
}
|
|
221
222
|
}
|
|
222
223
|
|
|
@@ -235,7 +236,7 @@
|
|
|
235
236
|
|
|
236
237
|
&:hover {
|
|
237
238
|
& {
|
|
238
|
-
color:
|
|
239
|
+
color: var(--primary-color);
|
|
239
240
|
}
|
|
240
241
|
|
|
241
242
|
svg {
|
|
@@ -281,27 +282,26 @@
|
|
|
281
282
|
}
|
|
282
283
|
|
|
283
284
|
&:hover {
|
|
284
|
-
fill:
|
|
285
|
+
fill: var(--primary-color);
|
|
285
286
|
}
|
|
286
287
|
}
|
|
287
288
|
|
|
288
289
|
.versions {
|
|
289
|
-
|
|
290
|
-
margin-right: -16px;
|
|
290
|
+
cursor: pointer;
|
|
291
291
|
transition: all 0.3s;
|
|
292
292
|
|
|
293
|
-
|
|
294
|
-
.
|
|
295
|
-
transition: all 0.3s;
|
|
296
|
-
font-size: 10px;
|
|
297
|
-
}
|
|
293
|
+
svg {
|
|
294
|
+
opacity: 0.3;
|
|
298
295
|
}
|
|
299
296
|
|
|
300
297
|
&:hover {
|
|
301
|
-
|
|
298
|
+
& {
|
|
299
|
+
color: var(--primary-color);
|
|
300
|
+
}
|
|
302
301
|
|
|
303
|
-
|
|
304
|
-
color:
|
|
302
|
+
svg {
|
|
303
|
+
color: #697b8c;
|
|
304
|
+
opacity: 0.5;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
}
|
|
@@ -339,10 +339,10 @@
|
|
|
339
339
|
|
|
340
340
|
&.activeItem {
|
|
341
341
|
box-shadow: none;
|
|
342
|
-
background: tint(
|
|
342
|
+
background: tint(#873bf4, 90%);
|
|
343
343
|
|
|
344
344
|
a {
|
|
345
|
-
color:
|
|
345
|
+
color: var(--primary-color);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
7
|
import React from 'react';
|
|
2
8
|
import styles from "./index.module.less";
|
|
3
9
|
|
|
4
10
|
/**
|
|
5
11
|
* Loading
|
|
6
12
|
*/
|
|
7
|
-
var Loading = function Loading() {
|
|
13
|
+
var Loading = function Loading(_ref) {
|
|
14
|
+
var style = _ref.style;
|
|
8
15
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
style: {
|
|
16
|
+
style: _objectSpread({
|
|
10
17
|
position: 'relative',
|
|
11
18
|
height: '100%',
|
|
12
|
-
width: '100%'
|
|
13
|
-
|
|
19
|
+
width: '100%',
|
|
20
|
+
minHeight: '200px'
|
|
21
|
+
}, style)
|
|
14
22
|
}, /*#__PURE__*/React.createElement("div", {
|
|
15
23
|
className: styles.loading
|
|
16
24
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { VerticalAlignTopOutlined } from '@ant-design/icons';
|
|
2
|
-
import {
|
|
2
|
+
import { FloatButton, Layout } from 'antd';
|
|
3
3
|
import { useRouteMeta } from 'dumi';
|
|
4
4
|
import React, { lazy } from 'react';
|
|
5
5
|
import { useMedia } from 'react-use';
|
|
6
|
-
import readingTime from 'reading-time';
|
|
7
6
|
import ClientOnly from "../../common/ClientOnly";
|
|
8
7
|
import InViewSuspense from "../../common/InViewSuspense";
|
|
9
8
|
import { ContentTable } from "dumi/theme/slots/ContentTable";
|
|
10
9
|
import { Feedback } from "dumi/theme/slots/Feedback";
|
|
11
10
|
import styles from "./index.module.less";
|
|
12
11
|
import { PrevAndNext } from "./PrevAndNext";
|
|
13
|
-
import ReadingTime from "./ReadingTime";
|
|
14
12
|
var PageFeedback = /*#__PURE__*/lazy(function () {
|
|
15
13
|
return import("../Feedback/PageFeedback");
|
|
16
14
|
});
|
|
@@ -20,11 +18,6 @@ var ObPreview = /*#__PURE__*/lazy(function () {
|
|
|
20
18
|
export var Main = function Main(_ref) {
|
|
21
19
|
var children = _ref.children;
|
|
22
20
|
var meta = useRouteMeta();
|
|
23
|
-
var text = meta.texts.reduce(function (prev, next) {
|
|
24
|
-
return prev + next.value;
|
|
25
|
-
}, '');
|
|
26
|
-
var _readingTime = readingTime(text),
|
|
27
|
-
time = _readingTime.time;
|
|
28
21
|
var is991Wide = useMedia('(min-width: 991.99px)', true);
|
|
29
22
|
var showToc = is991Wide && meta.frontmatter.showToc !== false;
|
|
30
23
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ClientOnly, null, /*#__PURE__*/React.createElement(ObPreview, null)), /*#__PURE__*/React.createElement(Layout.Content, {
|
|
@@ -34,17 +27,12 @@ export var Main = function Main(_ref) {
|
|
|
34
27
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
35
28
|
className: styles.contentTitle
|
|
36
29
|
}, meta.frontmatter.title), /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
className: styles.readtimeContainer
|
|
38
|
-
}, /*#__PURE__*/React.createElement(ReadingTime, {
|
|
39
|
-
readingTime: time,
|
|
40
|
-
className: styles.readtime
|
|
41
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
42
30
|
className: styles.markdown
|
|
43
|
-
}, children), /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
}, children), /*#__PURE__*/React.createElement(ClientOnly, null, /*#__PURE__*/React.createElement("div", {
|
|
44
32
|
style: {
|
|
45
33
|
marginTop: '40px'
|
|
46
34
|
}
|
|
47
|
-
}, /*#__PURE__*/React.createElement(Feedback, null)), /*#__PURE__*/React.createElement(PrevAndNext, null)), /*#__PURE__*/React.createElement(BackTop, {
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Feedback, null))), /*#__PURE__*/React.createElement(PrevAndNext, null)), /*#__PURE__*/React.createElement(FloatButton.BackTop, {
|
|
48
36
|
style: {
|
|
49
37
|
right: 24
|
|
50
38
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
@import '~antd/es/style/themes/default.less';
|
|
2
|
-
@import '../_.less';
|
|
3
|
-
|
|
4
1
|
// 参考 yuque 右侧 tabOfContent 宽度
|
|
5
2
|
@toc-width: 260px;
|
|
6
3
|
|
|
@@ -22,7 +19,7 @@
|
|
|
22
19
|
margin-bottom: 20px;
|
|
23
20
|
font-weight: 500;
|
|
24
21
|
font-size: 30px;
|
|
25
|
-
font-family: Avenir,
|
|
22
|
+
font-family: Avenir, var(--font-family), sans-serif;
|
|
26
23
|
line-height: 38px;
|
|
27
24
|
}
|
|
28
25
|
|
|
@@ -43,7 +40,7 @@
|
|
|
43
40
|
clear: both;
|
|
44
41
|
margin: 1em 0 0.3em;
|
|
45
42
|
font-weight: 500;
|
|
46
|
-
font-family: Avenir,
|
|
43
|
+
font-family: Avenir, var(--font-family), sans-serif;
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
h3 {
|
|
@@ -51,7 +48,7 @@
|
|
|
51
48
|
margin-bottom: 4px;
|
|
52
49
|
font-weight: 600;
|
|
53
50
|
line-height: 30px;
|
|
54
|
-
border-bottom: 1px solid
|
|
51
|
+
border-bottom: 1px solid var(--border-color-split);
|
|
55
52
|
}
|
|
56
53
|
|
|
57
54
|
h4 {
|
|
@@ -72,7 +69,7 @@
|
|
|
72
69
|
clear: both;
|
|
73
70
|
height: 1px;
|
|
74
71
|
margin: 56px 0;
|
|
75
|
-
background:
|
|
72
|
+
background: var(--border-color-split);
|
|
76
73
|
border: 0;
|
|
77
74
|
}
|
|
78
75
|
|
|
@@ -164,7 +161,7 @@
|
|
|
164
161
|
width: 100%;
|
|
165
162
|
margin: 24px 0;
|
|
166
163
|
empty-cells: show;
|
|
167
|
-
border: 1px solid
|
|
164
|
+
border: 1px solid var(--border-color-split);
|
|
168
165
|
border-collapse: collapse;
|
|
169
166
|
border-spacing: 0;
|
|
170
167
|
|
|
@@ -183,7 +180,7 @@
|
|
|
183
180
|
table td {
|
|
184
181
|
padding: 4px 12px;
|
|
185
182
|
text-align: left;
|
|
186
|
-
border: 1px solid
|
|
183
|
+
border: 1px solid var(--border-color-split);
|
|
187
184
|
line-height: 24px;
|
|
188
185
|
}
|
|
189
186
|
|
|
@@ -201,9 +198,9 @@
|
|
|
201
198
|
blockquote {
|
|
202
199
|
margin: 0.5em 0;
|
|
203
200
|
padding-left: 0.8em;
|
|
204
|
-
color:
|
|
201
|
+
color: var(--text-color-secondary);
|
|
205
202
|
font-size: 90%;
|
|
206
|
-
border-left: 4px solid
|
|
203
|
+
border-left: 4px solid var(--border-color-split);
|
|
207
204
|
}
|
|
208
205
|
|
|
209
206
|
blockquote p {
|
|
@@ -273,7 +270,7 @@
|
|
|
273
270
|
white-space: nowrap;
|
|
274
271
|
|
|
275
272
|
a {
|
|
276
|
-
color:
|
|
273
|
+
color: var(--text-color);
|
|
277
274
|
}
|
|
278
275
|
}
|
|
279
276
|
}
|
|
@@ -409,7 +406,7 @@
|
|
|
409
406
|
margin: 12px;
|
|
410
407
|
|
|
411
408
|
> div {
|
|
412
|
-
border: 1px solid
|
|
409
|
+
border: 1px solid var(--border-color-split);
|
|
413
410
|
border-radius: 6px;
|
|
414
411
|
overflow: hidden;
|
|
415
412
|
height: calc(100vw / 9 - 20px);
|
|
@@ -600,7 +597,7 @@
|
|
|
600
597
|
:global(.ant-anchor-ink-ball) {
|
|
601
598
|
width: 2px;
|
|
602
599
|
height: 24px;
|
|
603
|
-
background-color:
|
|
600
|
+
background-color: var(--primary-color);
|
|
604
601
|
border: none;
|
|
605
602
|
border-radius: 0;
|
|
606
603
|
transform: translateX(-50%) translateY(-8px);
|
package/dist/slots/hooks.js
CHANGED
|
@@ -21,7 +21,9 @@ export var useChinaMirrorHost = function useChinaMirrorHost() {
|
|
|
21
21
|
return [isChinaMirrorHost];
|
|
22
22
|
};
|
|
23
23
|
export var useScrollToTop = function useScrollToTop() {
|
|
24
|
-
|
|
24
|
+
if (typeof document !== 'undefined') {
|
|
25
|
+
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
26
|
+
}
|
|
25
27
|
};
|
|
26
28
|
export var useLogoLink = function useLogoLink(_ref) {
|
|
27
29
|
var _ref$link = _ref.link,
|