@antv/dumi-theme-antv 0.3.0-beta.2 → 0.3.0-beta.22

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.
Files changed (89) hide show
  1. package/dist/builtins/Playground/index.d.ts +3 -6
  2. package/dist/builtins/Playground/index.js +27 -7
  3. package/dist/context.d.ts +2 -1
  4. package/dist/layouts/DocLayout.js +25 -16
  5. package/dist/layouts/entry/Index.js +21 -12
  6. package/dist/layouts/entry/Manual.js +6 -4
  7. package/dist/pages/404.js +7 -4
  8. package/dist/pages/Example/index.js +31 -55
  9. package/dist/pages/Example/index.module.less +50 -8
  10. package/dist/pages/Example/utils.d.ts +1 -0
  11. package/dist/pages/Example/utils.js +9 -0
  12. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +6 -1
  13. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +11 -6
  14. package/dist/pages/Examples/index.js +24 -4
  15. package/dist/pages/Examples/index.module.less +15 -0
  16. package/dist/pages/Examples/types.d.ts +7 -6
  17. package/dist/plugin/examples.d.ts +14 -5
  18. package/dist/plugin/examples.js +17 -3
  19. package/dist/plugin/index.js +31 -8
  20. package/dist/plugin/utils.js +3 -2
  21. package/dist/slots/Article/index.d.ts +3 -0
  22. package/dist/slots/Article/index.js +11 -0
  23. package/dist/slots/Article/index.module.less +8 -0
  24. package/dist/slots/Banner/Notification.d.ts +10 -0
  25. package/dist/slots/Banner/Notification.js +43 -0
  26. package/dist/slots/Banner/Notification.module.less +120 -0
  27. package/dist/slots/Banner/index.d.ts +26 -0
  28. package/dist/slots/Banner/index.js +184 -0
  29. package/dist/slots/Banner/index.module.less +449 -0
  30. package/dist/slots/Cases/index.d.ts +1 -0
  31. package/dist/slots/Cases/index.js +13 -7
  32. package/dist/slots/Cases/index.module.less +2 -1
  33. package/dist/slots/CodeEditor/Toolbar.js +17 -22
  34. package/dist/slots/CodeEditor/index.d.ts +4 -0
  35. package/dist/slots/CodeEditor/index.js +71 -23
  36. package/dist/slots/CodeEditor/utils.js +2 -2
  37. package/dist/slots/CodePreview/CodeHeader.js +15 -14
  38. package/dist/slots/CodePreview/index.d.ts +8 -0
  39. package/dist/slots/CodePreview/index.js +15 -6
  40. package/dist/slots/CodePreview/index.module.less +17 -7
  41. package/dist/slots/CodeRunner/index.d.ts +5 -2
  42. package/dist/slots/CodeRunner/index.js +19 -8
  43. package/dist/slots/CodeRunner/utils.d.ts +3 -2
  44. package/dist/slots/CodeRunner/utils.js +1 -1
  45. package/dist/slots/Companies/index.d.ts +1 -1
  46. package/dist/slots/{TOC.d.ts → ContentTable/index.d.ts} +2 -1
  47. package/dist/slots/{TOC.js → ContentTable/index.js} +2 -1
  48. package/dist/slots/ContentTable/index.module.less +11 -0
  49. package/dist/slots/Detail/News.d.ts +1 -0
  50. package/dist/slots/Detail/News.js +3 -2
  51. package/dist/slots/Detail/index.d.ts +1 -0
  52. package/dist/slots/Detail/index.js +4 -2
  53. package/dist/slots/ExampleSider/index.d.ts +4 -38
  54. package/dist/slots/ExampleSider/index.js +28 -49
  55. package/dist/slots/ExampleSider/index.module.less +1 -1
  56. package/dist/slots/Features/FeatureCard.d.ts +1 -0
  57. package/dist/slots/Features/index.js +7 -3
  58. package/dist/slots/Features/index.module.less +1 -1
  59. package/dist/slots/Footer/index.js +34 -14
  60. package/dist/slots/Header/LogoWhite.js +1 -2
  61. package/dist/slots/Header/Navs.d.ts +10 -1
  62. package/dist/slots/Header/Navs.js +36 -19
  63. package/dist/slots/Header/Products/NavigatorBanner.js +4 -3
  64. package/dist/slots/Header/Products/Product.js +7 -3
  65. package/dist/slots/Header/Products/index.js +5 -3
  66. package/dist/slots/Header/Search.js +5 -3
  67. package/dist/slots/Header/index.d.ts +7 -2
  68. package/dist/slots/Header/index.js +135 -30
  69. package/dist/slots/Loading/index.d.ts +6 -1
  70. package/dist/slots/Loading/index.js +24 -10
  71. package/dist/slots/Loading/index.module.less +276 -9
  72. package/dist/slots/ManualContent/NavigatorBanner.js +5 -3
  73. package/dist/slots/ManualContent/ReadingTime.js +6 -2
  74. package/dist/slots/ManualContent/index.js +143 -126
  75. package/dist/slots/ManualContent/index.module.less +52 -33
  76. package/dist/slots/ManualContent/utils.d.ts +18 -0
  77. package/dist/slots/ManualContent/utils.js +64 -0
  78. package/dist/slots/SEO.d.ts +10 -0
  79. package/dist/slots/SEO.js +59 -0
  80. package/dist/slots/_.less +1 -1
  81. package/dist/slots/hooks.d.ts +4 -4
  82. package/dist/slots/hooks.js +5 -8
  83. package/dist/slots/utils.d.ts +4 -19
  84. package/dist/slots/utils.js +82 -119
  85. package/dist/types.d.ts +83 -0
  86. package/dist/typings.d.ts +0 -116
  87. package/package.json +9 -5
  88. package/dist/slots/Loading.d.ts +0 -5
  89. package/dist/slots/Loading.js +0 -8
@@ -21,22 +21,27 @@ import React, { useState, useEffect } from 'react';
21
21
  import { useMedia } from 'react-use';
22
22
  import { useNavigate } from "react-router-dom";
23
23
  import cx from 'classnames';
24
- import { useSiteData, useLocale } from 'dumi';
25
- import { GithubOutlined, MenuOutlined, CaretDownFilled, DownOutlined, WechatOutlined, LikeOutlined, CheckOutlined } from '@ant-design/icons';
26
- import { Popover, Menu, Dropdown, Select } from 'antd';
27
- import { map, size } from 'lodash-es';
24
+ import { useSiteData, useLocale, FormattedMessage } from 'dumi';
25
+ import { GithubOutlined, MenuOutlined, CaretDownFilled, DownOutlined, WechatOutlined, LinkOutlined, CheckOutlined } from '@ant-design/icons';
26
+ import { Modal, Button, Popover, Menu, Dropdown, Select } from 'antd';
27
+ import { get, map, size } from 'lodash-es';
28
28
  import { Search } from "./Search";
29
29
  import { Products } from "./Products";
30
30
  import { Navs } from "./Navs";
31
31
  import { Logo } from "./Logo";
32
32
  import { LogoWhite } from "./LogoWhite";
33
33
  import { getLangUrl } from "./utils";
34
- import { useT } from "../hooks";
34
+ import { ic } from "../hooks";
35
35
  import styles from "./index.module.less";
36
36
 
37
+ function redirectChinaMirror(chinaMirrorOrigin) {
38
+ window.location.href = window.location.href.replace(window.location.origin, chinaMirrorOrigin);
39
+ }
37
40
  /**
38
41
  * 头部菜单
39
42
  */
43
+
44
+
40
45
  var HeaderComponent = function HeaderComponent(_ref) {
41
46
  var _cx, _cx4;
42
47
 
@@ -57,8 +62,6 @@ var HeaderComponent = function HeaderComponent(_ref) {
57
62
  showAntVProductsCard = _ref$showAntVProducts === void 0 ? true : _ref$showAntVProducts,
58
63
  _ref$showLanguageSwit = _ref.showLanguageSwitcher,
59
64
  showLanguageSwitcher = _ref$showLanguageSwit === void 0 ? true : _ref$showLanguageSwit,
60
- _ref$showChinaMirror = _ref.showChinaMirror,
61
- showChinaMirror = _ref$showChinaMirror === void 0 ? true : _ref$showChinaMirror,
62
65
  logo = _ref.logo,
63
66
  onLanguageChange = _ref.onLanguageChange,
64
67
  _ref$showWxQrcode = _ref.showWxQrcode,
@@ -76,22 +79,41 @@ var HeaderComponent = function HeaderComponent(_ref) {
76
79
  _ref$rootDomain = _ref.rootDomain,
77
80
  rootDomain = _ref$rootDomain === void 0 ? '' : _ref$rootDomain,
78
81
  versions = _ref.versions,
82
+ internalSite = _ref.internalSite,
79
83
  ecosystems = _ref.ecosystems,
80
84
  searchOptions = _ref.searchOptions;
81
85
  var isAntVHome = isAntVSite && isHomePage; // 是否为AntV官网首页
82
86
 
83
- var locale = useLocale();
84
- var nav = useNavigate();
87
+ var showChinaMirror = !!internalSite;
88
+ var chinaMirrorUrl = get(internalSite, 'url');
85
89
 
86
- var _useState = useState(locale.id),
90
+ var _useState = useState(false),
87
91
  _useState2 = _slicedToArray(_useState, 2),
88
- lang = _useState2[0],
89
- setLang = _useState2[1];
92
+ chinaMirrorHintVisible = _useState2[0],
93
+ updateChinaMirrorHintVisible = _useState2[1];
90
94
 
91
- var _useState3 = useState(false),
95
+ useEffect(function () {
96
+ var timeout = setTimeout(function () {
97
+ if (showChinaMirror && lang === 'zh' && !localStorage.getItem('china-mirror-no-more-hint') && window.location.host.includes('antv.vision')) {
98
+ updateChinaMirrorHintVisible(true);
99
+ }
100
+ }, 5000);
101
+ return function () {
102
+ clearTimeout(timeout);
103
+ };
104
+ });
105
+ var locale = useLocale();
106
+ var nav = useNavigate();
107
+
108
+ var _useState3 = useState(locale.id),
92
109
  _useState4 = _slicedToArray(_useState3, 2),
93
- productMenuVisible = _useState4[0],
94
- setProductMenuVisible = _useState4[1];
110
+ lang = _useState4[0],
111
+ setLang = _useState4[1];
112
+
113
+ var _useState5 = useState(false),
114
+ _useState6 = _slicedToArray(_useState5, 2),
115
+ productMenuVisible = _useState6[0],
116
+ setProductMenuVisible = _useState6[1];
95
117
 
96
118
  var productMenuHovering = false;
97
119
 
@@ -121,10 +143,10 @@ var HeaderComponent = function HeaderComponent(_ref) {
121
143
  setProductMenuVisible(!productMenuVisible);
122
144
  };
123
145
 
124
- var _useState5 = useState(false),
125
- _useState6 = _slicedToArray(_useState5, 2),
126
- popupMenuVisible = _useState6[0],
127
- setPopupMenuVisible = _useState6[1];
146
+ var _useState7 = useState(false),
147
+ _useState8 = _slicedToArray(_useState7, 2),
148
+ popupMenuVisible = _useState8[0],
149
+ setPopupMenuVisible = _useState8[1];
128
150
 
129
151
  var onTogglePopupMenuVisible = function onTogglePopupMenuVisible() {
130
152
  setPopupMenuVisible(!popupMenuVisible);
@@ -173,12 +195,12 @@ var HeaderComponent = function HeaderComponent(_ref) {
173
195
  className: cx(styles.menu, (_cx = {}, _defineProperty(_cx, styles.popup, !isWide), _defineProperty(_cx, styles.popupHidden, !popupMenuVisible), _cx))
174
196
  },
175
197
  /** 最左侧的菜单,一般是 教程、API、示例,或者其他自定义,有配置文件中的 `navs` 决定 */
176
- size(navs) && /*#__PURE__*/React.createElement(Navs, {
198
+ size(navs) ? /*#__PURE__*/React.createElement(Navs, {
177
199
  navs: navs,
178
200
  path: window.location.pathname
179
- }),
201
+ }) : null,
180
202
  /** 生态产品 */
181
- size(ecosystems) && /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Dropdown, {
203
+ size(ecosystems) ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Dropdown, {
182
204
  className: styles.ecoSystems,
183
205
  overlay: /*#__PURE__*/React.createElement(Menu, null, map(ecosystems, function (_ref2) {
184
206
  var url = _ref2.url,
@@ -189,15 +211,91 @@ var HeaderComponent = function HeaderComponent(_ref) {
189
211
  target: "_blank",
190
212
  rel: "noreferrer",
191
213
  href: url
192
- }, ecosystemName === null || ecosystemName === void 0 ? void 0 : ecosystemName[lang], " ", /*#__PURE__*/React.createElement(LikeOutlined, null)));
214
+ }, ecosystemName === null || ecosystemName === void 0 ? void 0 : ecosystemName[lang], " ", /*#__PURE__*/React.createElement(LinkOutlined, null)));
193
215
  }))
194
- }, /*#__PURE__*/React.createElement("span", null, useT('周边生态'), /*#__PURE__*/React.createElement(DownOutlined, {
216
+ }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
217
+ id: "\u5468\u8FB9\u751F\u6001"
218
+ }), /*#__PURE__*/React.createElement(DownOutlined, {
195
219
  style: {
196
220
  marginLeft: '6px'
197
221
  }
198
- })))),
222
+ })))) : null, showChinaMirror && isWide ? /*#__PURE__*/React.createElement(Popover, {
223
+ title: null,
224
+ content: /*#__PURE__*/React.createElement("div", {
225
+ style: {
226
+ width: 300
227
+ }
228
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
229
+ role: "img",
230
+ "aria-labelledby": "\u4E2D\u56FD",
231
+ style: {
232
+ marginRight: '8px'
233
+ }
234
+ }, "\uD83C\uDDE8\uD83C\uDDF3"), "AntV \u7CFB\u5217\u7F51\u7AD9\u90E8\u7F72\u5728 gh-pages \u4E0A\uFF0C\u82E5\u8BBF\u95EE\u901F\u5EA6\u4E0D\u4F73\uFF0C\u53EF\u4EE5\u524D\u5F80\u56FD\u5185\u955C\u50CF\u7AD9\u70B9\u3002"), /*#__PURE__*/React.createElement("div", {
235
+ style: {
236
+ marginTop: 16,
237
+ textAlign: 'right'
238
+ }
239
+ }, /*#__PURE__*/React.createElement(Button, {
240
+ onClick: function onClick() {
241
+ return updateChinaMirrorHintVisible(false);
242
+ },
243
+ size: "small",
244
+ style: {
245
+ marginRight: 8
246
+ }
247
+ }, "\u6682\u65F6\u5173\u95ED"), /*#__PURE__*/React.createElement(Button, {
248
+ type: "primary",
249
+ size: "small",
250
+ onClick: function onClick() {
251
+ localStorage.setItem('china-mirror-no-more-hint', Date.now().toString());
252
+ updateChinaMirrorHintVisible(false);
253
+ }
254
+ }, "\u4E0D\u518D\u63D0\u9192"))),
255
+ visible: chinaMirrorHintVisible,
256
+ placement: "bottomRight",
257
+ align: {
258
+ offset: [-12, -16]
259
+ }
260
+ }, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
261
+ href: chinaMirrorUrl,
262
+ onClick: function onClick(e) {
263
+ e.preventDefault();
264
+ redirectChinaMirror(chinaMirrorUrl);
265
+ }
266
+ }, ic(get(internalSite, 'name')), !isAntVHome && /*#__PURE__*/React.createElement(LinkOutlined, null)))) : null, showChinaMirror && !isWide && /*#__PURE__*/React.createElement(Modal, {
267
+ visible: chinaMirrorHintVisible,
268
+ cancelText: "\u4E0D\u518D\u63D0\u9192",
269
+ okText: "\u7ACB\u5373\u524D\u5F80",
270
+ onCancel: function onCancel() {
271
+ updateChinaMirrorHintVisible(false);
272
+ },
273
+ onOk: function onOk() {
274
+ return redirectChinaMirror(chinaMirrorUrl);
275
+ },
276
+ cancelButtonProps: {
277
+ onClick: function onClick() {
278
+ localStorage.setItem('china-mirror-no-more-hint', Date.now().toString());
279
+ updateChinaMirrorHintVisible(false);
280
+ }
281
+ }
282
+ }, /*#__PURE__*/React.createElement("div", {
283
+ className: styles.modalContent
284
+ }, /*#__PURE__*/React.createElement("span", {
285
+ role: "img",
286
+ "aria-labelledby": "\u4E2D\u56FD"
287
+ }, "\uD83C\uDDE8\uD83C\uDDF3"), "AntV \u7CFB\u5217\u7F51\u7AD9\u90E8\u7F72\u5728 gh-pages \u4E0A\uFF0C\u82E5\u8BBF\u95EE\u901F\u5EA6\u4E0D\u4F73\uFF0C\u53EF\u4EE5\u524D\u5F80", /*#__PURE__*/React.createElement("a", {
288
+ href: chinaMirrorUrl,
289
+ onClick: function onClick(e) {
290
+ e.preventDefault();
291
+ window.location.href = chinaMirrorUrl;
292
+ },
293
+ className: styles.remindHref
294
+ }, ic(get(internalSite, 'name')), /*#__PURE__*/React.createElement(LinkOutlined, null)), /*#__PURE__*/React.createElement("span", null, " \u7AD9\u70B9\u3002"))),
199
295
  /** 产品列表 */
200
- showAntVProductsCard && /*#__PURE__*/React.createElement("li", productItemProps, /*#__PURE__*/React.createElement("a", null, useT('所有产品'), !isAntVHome ? /*#__PURE__*/React.createElement("img", {
296
+ showAntVProductsCard && /*#__PURE__*/React.createElement("li", productItemProps, /*#__PURE__*/React.createElement("a", null, /*#__PURE__*/React.createElement(FormattedMessage, {
297
+ id: "\u6240\u6709\u4EA7\u54C1"
298
+ }), !isAntVHome ? /*#__PURE__*/React.createElement("img", {
201
299
  src: "https://gw.alipayobjects.com/zos/antfincdn/FLrTNDvlna/antv.png",
202
300
  alt: "antv logo arrow",
203
301
  className: cx(styles.arrow, _defineProperty({}, styles.open, productMenuVisible))
@@ -312,7 +410,8 @@ var HeaderComponent = function HeaderComponent(_ref) {
312
410
  className: styles.githubCorner
313
411
  }, /*#__PURE__*/React.createElement("a", {
314
412
  href: githubUrl,
315
- target: "_blank"
413
+ target: "_blank",
414
+ rel: "noreferrer"
316
415
  }, /*#__PURE__*/React.createElement(GithubOutlined, null))));
317
416
  return /*#__PURE__*/React.createElement("header", {
318
417
  className: cx(styles.header, (_cx4 = {}, _defineProperty(_cx4, styles.transparent, !!transparent && !productMenuVisible), _defineProperty(_cx4, styles.isHomePage, !!isHomePage && !isAntVHome), _defineProperty(_cx4, styles.lightTheme, !!isAntVHome && !productMenuVisible && isWide), _defineProperty(_cx4, styles.fixed, popupMenuVisible), _cx4))
@@ -321,8 +420,8 @@ var HeaderComponent = function HeaderComponent(_ref) {
321
420
  }, /*#__PURE__*/React.createElement("div", {
322
421
  className: styles.left
323
422
  }, /*#__PURE__*/React.createElement("h1", null, /*#__PURE__*/React.createElement("a", {
324
- href: siteUrl
325
- }, img)), subTitle && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
423
+ href: siteUrl[lang] ? siteUrl[lang] : siteUrl
424
+ }, img)), !isAntVHome && subTitle && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
326
425
  className: styles.divider
327
426
  }), /*#__PURE__*/React.createElement("h2", {
328
427
  className: styles.subProduceName
@@ -342,6 +441,7 @@ export var Header = function Header(props) {
342
441
  githubUrl = themeConfig.githubUrl,
343
442
  isAntVSite = themeConfig.isAntVSite,
344
443
  subTitleHref = themeConfig.subTitleHref,
444
+ internalSite = themeConfig.internalSite,
345
445
  showSearch = themeConfig.showSearch,
346
446
  showGithubCorner = themeConfig.showGithubCorner,
347
447
  showGithubStars = themeConfig.showGithubStars,
@@ -356,12 +456,16 @@ export var Header = function Header(props) {
356
456
  var searchOptions = {
357
457
  docsearchOptions: docsearchOptions
358
458
  };
459
+ var locale = useLocale();
460
+ var path = window.location.pathname;
461
+ var isHomePage = path === '/' || path === "/".concat(locale.id) || path === "/".concat(locale.id, "/");
359
462
  var headerProps = {
360
463
  subTitle: title,
361
464
  subTitleHref: subTitleHref,
362
465
  githubUrl: githubUrl,
363
466
  isAntVSite: isAntVSite,
364
467
  siteUrl: siteUrl,
468
+ internalSite: internalSite,
365
469
  showSearch: showSearch,
366
470
  showGithubCorner: showGithubCorner,
367
471
  showGithubStars: showGithubStars,
@@ -373,7 +477,8 @@ export var Header = function Header(props) {
373
477
  ecosystems: ecosystems,
374
478
  navs: navs,
375
479
  searchOptions: searchOptions,
376
- isHomePage: true
480
+ isHomePage: isHomePage,
481
+ transparent: isHomePage && isAntVSite
377
482
  };
378
483
  return /*#__PURE__*/React.createElement(HeaderComponent, Object.assign({}, headerProps, props));
379
484
  };
@@ -1,2 +1,7 @@
1
1
  import React from 'react';
2
- export declare const Loading: React.FC;
2
+ /**
3
+ * Loading
4
+ */
5
+ declare const Loading: React.FC;
6
+ declare const PageLoading: React.FC;
7
+ export { Loading, PageLoading };
@@ -1,17 +1,21 @@
1
1
  import React from 'react';
2
- export var Loading = function Loading() {
2
+ import styles from "./index.module.less";
3
+ /**
4
+ * Loading
5
+ */
6
+
7
+ var Loading = function Loading() {
3
8
  return /*#__PURE__*/React.createElement("div", {
4
- style: {
5
- height: '100vh'
6
- }
7
- }, /*#__PURE__*/React.createElement("div", {
8
9
  style: {
9
10
  position: 'relative',
10
- height: '100%'
11
+ height: '100%',
12
+ width: '100%'
11
13
  }
12
14
  }, /*#__PURE__*/React.createElement("div", {
13
- className: "code-loading"
14
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
15
+ className: styles.loading
16
+ }, /*#__PURE__*/React.createElement("div", {
17
+ className: "container"
18
+ }, /*#__PURE__*/React.createElement("div", {
15
19
  className: "loader"
16
20
  }, /*#__PURE__*/React.createElement("svg", {
17
21
  viewBox: "0 0 80 80"
@@ -61,5 +65,15 @@ export var Loading = function Loading() {
61
65
  stroke: "url(#gradient)"
62
66
  }))), /*#__PURE__*/React.createElement("div", {
63
67
  className: "loading-text"
64
- }, /*#__PURE__*/React.createElement("p", null, "Loading..."))))));
65
- };
68
+ }, /*#__PURE__*/React.createElement("p", null, "Loading...")))));
69
+ };
70
+
71
+ var PageLoading = function PageLoading() {
72
+ return /*#__PURE__*/React.createElement("div", {
73
+ style: {
74
+ height: '100vh'
75
+ }
76
+ }, /*#__PURE__*/React.createElement(Loading, null));
77
+ };
78
+
79
+ export { Loading, PageLoading };
@@ -1,12 +1,279 @@
1
- @import '~antd/es/style/themes/default.less';
1
+ .loading {
2
+ position: absolute;
3
+ left: 0;
4
+ top: 0;
5
+ z-index: 9999;
6
+ width: 100%;
7
+ height: 100%;
8
+ background-color: #fff;
9
+ border: 1px solid #f0f0f0;
2
10
 
3
- .container {
4
- padding: 30vh 0 0;
5
- text-align: center;
11
+ :global {
12
+ .container {
13
+ display: inline-block;
14
+ position: absolute;
15
+ left: 50%;
16
+ top: 50%;
17
+ margin: -50px 0 0 -120px;
18
+ }
19
+ .loader {
20
+ --duration: 3s;
21
+ width: 44px;
22
+ height: 44px;
23
+ position: relative;
24
+ display: inline-block;
25
+ margin: 0 16px;
26
+ }
27
+
28
+ .loader:before {
29
+ content: ' ';
30
+ width: 6px;
31
+ height: 6px;
32
+ border-radius: 50%;
33
+ position: absolute;
34
+ display: block;
35
+ background: #ff700a;
36
+ top: 37px;
37
+ left: 19px;
38
+ -webkit-transform: translate(-18px, -18px);
39
+ transform: translate(-18px, -18px);
40
+ -webkit-animation: dotRect var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
41
+ animation: dotRect var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
42
+ }
43
+
44
+ .loader svg {
45
+ display: block;
46
+ width: 100%;
47
+ height: 100%;
48
+ }
49
+
50
+ .loader svg rect,
51
+ .loader svg polygon,
52
+ .loader svg circle {
53
+ fill: none;
54
+ stroke-width: 10px;
55
+ stroke-linejoin: round;
56
+ stroke-linecap: round;
57
+ }
58
+
59
+ .loader svg polygon {
60
+ stroke-dasharray: 145 76 145 76;
61
+ stroke-dashoffset: 0;
62
+ -webkit-animation: pathTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
63
+ animation: pathTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
64
+ }
65
+
66
+ .loader svg rect {
67
+ stroke-dasharray: 192 64 192 64;
68
+ stroke-dashoffset: 0;
69
+ -webkit-animation: pathRect 3s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
70
+ animation: pathRect 3s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
71
+ }
72
+
73
+ .loader svg circle {
74
+ stroke-dasharray: 150 50 150 50;
75
+ stroke-dashoffset: 75;
76
+ -webkit-animation: pathCircle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
77
+ animation: pathCircle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
78
+ }
79
+
80
+ .loader.triangle {
81
+ width: 48px;
82
+ }
83
+
84
+ .loader.triangle:before {
85
+ left: 21px;
86
+ -webkit-transform: translate(-10px, -18px);
87
+ transform: translate(-10px, -18px);
88
+ -webkit-animation: dotTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
89
+ animation: dotTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
90
+ }
91
+
92
+ .loading-text {
93
+ text-align: center;
94
+ height: 40px;
95
+ line-height: 40px;
96
+ font-size: 12px;
97
+ letter-spacing: 0.1em;
98
+ color: #666;
99
+ }
100
+ }
101
+ }
102
+
103
+ @-webkit-keyframes ~":global(pathTriangle)" {
104
+ 33% {
105
+ stroke-dashoffset: 74;
106
+ }
107
+
108
+ 66% {
109
+ stroke-dashoffset: 147;
110
+ }
111
+
112
+ 100% {
113
+ stroke-dashoffset: 221;
114
+ }
115
+ }
116
+
117
+ @keyframes ~":global(pathTriangle)" {
118
+ 33% {
119
+ stroke-dashoffset: 74;
120
+ }
121
+
122
+ 66% {
123
+ stroke-dashoffset: 147;
124
+ }
125
+
126
+ 100% {
127
+ stroke-dashoffset: 221;
128
+ }
129
+ }
130
+
131
+ @-webkit-keyframes ~":global(dotTriangle)" {
132
+ 33% {
133
+ -webkit-transform: translate(0, 0);
134
+ transform: translate(0, 0);
135
+ }
136
+
137
+ 66% {
138
+ -webkit-transform: translate(10px, -18px);
139
+ transform: translate(10px, -18px);
140
+ }
141
+
142
+ 100% {
143
+ -webkit-transform: translate(-10px, -18px);
144
+ transform: translate(-10px, -18px);
145
+ }
146
+ }
147
+
148
+ @keyframes ~":global(dotTriangle)" {
149
+ 33% {
150
+ -webkit-transform: translate(0, 0);
151
+ transform: translate(0, 0);
152
+ }
153
+
154
+ 66% {
155
+ -webkit-transform: translate(10px, -18px);
156
+ transform: translate(10px, -18px);
157
+ }
158
+
159
+ 100% {
160
+ -webkit-transform: translate(-10px, -18px);
161
+ transform: translate(-10px, -18px);
162
+ }
163
+ }
164
+
165
+ @-webkit-keyframes ~":global(pathRect)" {
166
+ 25% {
167
+ stroke-dashoffset: 64;
168
+ }
169
+
170
+ 50% {
171
+ stroke-dashoffset: 128;
172
+ }
173
+
174
+ 75% {
175
+ stroke-dashoffset: 192;
176
+ }
177
+
178
+ 100% {
179
+ stroke-dashoffset: 256;
180
+ }
181
+ }
182
+
183
+ @keyframes ~":global(pathRect)" {
184
+ 25% {
185
+ stroke-dashoffset: 64;
186
+ }
187
+
188
+ 50% {
189
+ stroke-dashoffset: 128;
190
+ }
191
+
192
+ 75% {
193
+ stroke-dashoffset: 192;
194
+ }
195
+
196
+ 100% {
197
+ stroke-dashoffset: 256;
198
+ }
199
+ }
200
+
201
+ @-webkit-keyframes ~":global(dotRect)" {
202
+ 25% {
203
+ -webkit-transform: translate(0, 0);
204
+ transform: translate(0, 0);
205
+ }
206
+
207
+ 50% {
208
+ -webkit-transform: translate(18px, -18px);
209
+ transform: translate(18px, -18px);
210
+ }
211
+
212
+ 75% {
213
+ -webkit-transform: translate(0, -36px);
214
+ transform: translate(0, -36px);
215
+ }
216
+
217
+ 100% {
218
+ -webkit-transform: translate(-18px, -18px);
219
+ transform: translate(-18px, -18px);
220
+ }
221
+ }
222
+
223
+ @keyframes ~":global(dotRect)" {
224
+ 25% {
225
+ -webkit-transform: translate(0, 0);
226
+ transform: translate(0, 0);
227
+ }
228
+
229
+ 50% {
230
+ -webkit-transform: translate(18px, -18px);
231
+ transform: translate(18px, -18px);
232
+ }
233
+
234
+ 75% {
235
+ -webkit-transform: translate(0, -36px);
236
+ transform: translate(0, -36px);
237
+ }
238
+
239
+ 100% {
240
+ -webkit-transform: translate(-18px, -18px);
241
+ transform: translate(-18px, -18px);
242
+ }
243
+ }
244
+
245
+ @-webkit-keyframes ~":global(pathCircle)" {
246
+ 25% {
247
+ stroke-dashoffset: 125;
248
+ }
249
+
250
+ 50% {
251
+ stroke-dashoffset: 175;
252
+ }
253
+
254
+ 75% {
255
+ stroke-dashoffset: 225;
256
+ }
257
+
258
+ 100% {
259
+ stroke-dashoffset: 275;
260
+ }
261
+ }
262
+
263
+ @keyframes ~":global(pathCircle)" {
264
+ 25% {
265
+ stroke-dashoffset: 125;
266
+ }
267
+
268
+ 50% {
269
+ stroke-dashoffset: 175;
270
+ }
271
+
272
+ 75% {
273
+ stroke-dashoffset: 225;
274
+ }
6
275
 
7
- .loading {
8
- font-size: 36px;
9
- color: @primary-color;
10
- text-align: center;
276
+ 100% {
277
+ stroke-dashoffset: 275;
11
278
  }
12
- }
279
+ }
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
- import { history } from 'dumi';
3
+ import { history, FormattedMessage } from 'dumi';
4
4
  import styles from "./NavigatorBanner.module.less";
5
- import { useScrollToTop, useT } from "../hooks";
5
+ import { useScrollToTop } from "../hooks";
6
6
  export var NavigatorBanner = function NavigatorBanner(_ref) {
7
7
  var post = _ref.post,
8
8
  type = _ref.type;
@@ -30,7 +30,9 @@ export var NavigatorBanner = function NavigatorBanner(_ref) {
30
30
  onClick: go
31
31
  }, /*#__PURE__*/React.createElement("div", {
32
32
  className: styles.label
33
- }, useT(type === 'prev' ? '上一篇' : '下一篇')), /*#__PURE__*/React.createElement("div", {
33
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
34
+ id: type === 'prev' ? '上一篇' : '下一篇'
35
+ })), /*#__PURE__*/React.createElement("div", {
34
36
  className: styles.title
35
37
  }, title));
36
38
  };
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
2
  import { Tag } from 'antd';
3
- import { useT } from "../hooks";
3
+ import { FormattedMessage } from 'dumi';
4
4
 
5
5
  var ReadingTime = function ReadingTime(_ref) {
6
6
  var readingTime = _ref.readingTime;
7
- return /*#__PURE__*/React.createElement(Tag, null, "".concat(useT('阅读时间约'), " ").concat(Math.ceil(readingTime / 60000), " ").concat(useT('分钟')));
7
+ return /*#__PURE__*/React.createElement(Tag, null, /*#__PURE__*/React.createElement(FormattedMessage, {
8
+ id: "\u9605\u8BFB\u65F6\u95F4\u7EA6"
9
+ }), " ", Math.ceil(readingTime / 60000), " ", /*#__PURE__*/React.createElement(FormattedMessage, {
10
+ id: "\u5206\u949F"
11
+ }));
8
12
  };
9
13
 
10
14
  export default ReadingTime;