@antv/dumi-theme-antv 0.5.4-beta.1 → 0.5.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.
Files changed (66) hide show
  1. package/README.md +6 -2
  2. package/dist/hooks/useMenu.js +1 -3
  3. package/dist/pages/404.js +1 -1
  4. package/dist/pages/Examples/components/Accouncement/index.js +3 -3
  5. package/dist/pages/Examples/components/Article/index.js +1 -1
  6. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +3 -3
  7. package/dist/pages/Examples/components/ExampleTopicMenu/index.js +3 -3
  8. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +3 -4
  9. package/dist/pages/Examples/components/GalleryPageContent/index.js +3 -3
  10. package/dist/pages/Examples/index.js +9 -10
  11. package/dist/pages/Examples/index.module.less +1 -2
  12. package/dist/plugin/examples.js +1 -5
  13. package/dist/plugin/index.js +3 -9
  14. package/dist/slots/404.js +2 -2
  15. package/dist/slots/API/index.js +2 -2
  16. package/dist/slots/API/index.module.less +20 -14
  17. package/dist/slots/Article/index.js +1 -1
  18. package/dist/slots/Banner/Notification.js +1 -1
  19. package/dist/slots/Banner/index.js +4 -4
  20. package/dist/slots/Banner/index.module.less +2 -4
  21. package/dist/slots/Cases/index.js +4 -5
  22. package/dist/slots/Cases/index.module.less +1 -1
  23. package/dist/slots/CodeEditor/Toolbar.module.less +5 -4
  24. package/dist/slots/CodeEditor/index.module.less +1 -1
  25. package/dist/slots/CodePreview/CodeHeader.js +1 -1
  26. package/dist/slots/CodePreview/index.js +1 -1
  27. package/dist/slots/CodePreview/index.module.less +5 -4
  28. package/dist/slots/CodeRunner/index.js +4 -4
  29. package/dist/slots/Companies/index.js +2 -2
  30. package/dist/slots/Companies/index.module.less +1 -1
  31. package/dist/slots/ContentTable/index.module.less +5 -5
  32. package/dist/slots/Detail/News.js +1 -1
  33. package/dist/slots/Detail/News.module.less +10 -10
  34. package/dist/slots/Detail/index.js +2 -2
  35. package/dist/slots/Detail/index.module.less +16 -16
  36. package/dist/slots/ExampleSider/index.js +6 -6
  37. package/dist/slots/Features/FeatureCard.js +1 -1
  38. package/dist/slots/Features/FeatureCard.module.less +3 -3
  39. package/dist/slots/Features/index.js +3 -3
  40. package/dist/slots/Features/index.module.less +4 -4
  41. package/dist/slots/Footer/index.js +8 -9
  42. package/dist/slots/Footer/index.module.less +5 -5
  43. package/dist/slots/Header/Navs.js +5 -5
  44. package/dist/slots/Header/Products/NavigatorBanner.js +2 -2
  45. package/dist/slots/Header/Products/NavigatorBanner.module.less +1 -1
  46. package/dist/slots/Header/Products/Product.module.less +4 -4
  47. package/dist/slots/Header/Products/index.js +4 -4
  48. package/dist/slots/Header/Search/SearchResult.js +3 -3
  49. package/dist/slots/Header/Search/SearchResult.module.less +1 -1
  50. package/dist/slots/Header/Search/helper.js +18 -5
  51. package/dist/slots/Header/Search/index.js +10 -4
  52. package/dist/slots/Header/index.js +9 -9
  53. package/dist/slots/Header/index.module.less +10 -12
  54. package/dist/slots/Header/utils.js +3 -3
  55. package/dist/slots/Loading/index.module.less +9 -9
  56. package/dist/slots/ManualContent/NavigatorBanner.js +3 -3
  57. package/dist/slots/ManualContent/NavigatorBanner.module.less +1 -1
  58. package/dist/slots/ManualContent/Preview.module.less +1 -3
  59. package/dist/slots/ManualContent/ReadingTime.js +2 -2
  60. package/dist/slots/ManualContent/index.module.less +5 -34
  61. package/dist/slots/ManualContent/utils.js +9 -9
  62. package/dist/slots/_.less +1 -2
  63. package/dist/slots/global.js +1 -1
  64. package/dist/slots/hooks.js +3 -3
  65. package/dist/typings.d.ts +5 -5
  66. package/package.json +5 -3
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
1
  import classNames from 'classnames';
3
- import { history, FormattedMessage } from 'dumi';
4
- import styles from "./NavigatorBanner.module.less";
2
+ import { FormattedMessage, history } from 'dumi';
3
+ import React from 'react';
5
4
  import { useScrollToTop } from "../hooks";
5
+ import styles from "./NavigatorBanner.module.less";
6
6
  export var NavigatorBanner = function NavigatorBanner(_ref) {
7
7
  var post = _ref.post,
8
8
  type = _ref.type;
@@ -36,4 +36,4 @@
36
36
  &.next {
37
37
  text-align: right;
38
38
  }
39
- }
39
+ }
@@ -7,7 +7,7 @@
7
7
  position: absolute;
8
8
  list-style: none;
9
9
  padding: 0;
10
- margin: 0;
10
+ margin: 0;
11
11
  margin-left: -@tool-width;
12
12
  left: 0;
13
13
  top: 0;
@@ -57,6 +57,4 @@
57
57
  border-left: 3px solid #ff0000;
58
58
  padding-left: 12px;
59
59
  }
60
-
61
60
  }
62
-
@@ -1,11 +1,11 @@
1
- import React from 'react';
2
1
  import { Tag } from 'antd';
3
2
  import { FormattedMessage } from 'dumi';
3
+ import React from 'react';
4
4
  var ReadingTime = function ReadingTime(_ref) {
5
5
  var readingTime = _ref.readingTime;
6
6
  return /*#__PURE__*/React.createElement(Tag, null, /*#__PURE__*/React.createElement(FormattedMessage, {
7
7
  id: "\u9605\u8BFB\u65F6\u95F4\u7EA6"
8
- }), " ", Math.ceil(readingTime / 60000), " ", /*#__PURE__*/React.createElement(FormattedMessage, {
8
+ }), " ", Math.ceil(readingTime / 60000), " ", /*#__PURE__*/React.createElement(FormattedMessage, {
9
9
  id: "\u5206\u949F"
10
10
  }));
11
11
  };
@@ -283,21 +283,8 @@
283
283
  margin-bottom: 20px;
284
284
  font-weight: 500;
285
285
  font-size: 30px;
286
- font-family:
287
- Avenir,
288
- -apple-system,
289
- BlinkMacSystemFont,
290
- Segoe UI,
291
- PingFang SC,
292
- Hiragino Sans GB,
293
- Microsoft YaHei,
294
- Helvetica Neue,
295
- Helvetica,
296
- Arial,
297
- sans-serif,
298
- Apple Color Emoji,
299
- Segoe UI Emoji,
300
- Segoe UI Symbol;
286
+ font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei,
287
+ Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
301
288
  line-height: 38px;
302
289
  }
303
290
 
@@ -641,10 +628,7 @@
641
628
  transition: color 0.3s;
642
629
  color: #868484;
643
630
  background-color: #fff;
644
- box-shadow:
645
- 0 3px 6px -4px rgba(0, 0, 0, 0.12),
646
- 0 6px 16px 0 rgba(0, 0, 0, 0.08),
647
- 0 9px 28px 8px rgba(0, 0, 0, 0.05);
631
+ box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
648
632
  transition: color 0.3s;
649
633
  width: 44px;
650
634
  height: 44px;
@@ -712,19 +696,6 @@
712
696
  opacity: 1;
713
697
  transition: all 0.3s;
714
698
  background-color: #fff;
715
- font-family:
716
- Avenir,
717
- -apple-system,
718
- BlinkMacSystemFont,
719
- Segoe UI,
720
- PingFang SC,
721
- Hiragino Sans GB,
722
- Microsoft YaHei,
723
- Helvetica Neue,
724
- Helvetica,
725
- Arial,
726
- sans-serif,
727
- Apple Color Emoji,
728
- Segoe UI Emoji,
729
- Segoe UI Symbol;
699
+ font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei,
700
+ Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
730
701
  }
@@ -1,11 +1,11 @@
1
- import { isEmpty } from "lodash-es";
1
+ import { isEmpty } from 'lodash-es';
2
2
  export function getOpenKeys() {
3
- var pathname = window.location.pathname.replace("/docs/", "/").replace("/zh/", "/");
4
- var pathArr = pathname.split("/");
3
+ var pathname = window.location.pathname.replace('/docs/', '/').replace('/zh/', '/');
4
+ var pathArr = pathname.split('/');
5
5
  var openKeys = [];
6
6
  for (var i = pathArr.length; i > 0; i--) {
7
7
  var tem = pathArr.slice(0, i);
8
- openKeys.push(tem.join("/"));
8
+ openKeys.push(tem.join('/'));
9
9
  }
10
10
  return openKeys;
11
11
  }
@@ -17,11 +17,11 @@ export function getOpenKeys() {
17
17
  export function getBaseRoute() {
18
18
  var matchRoute = window.location.pathname;
19
19
  // 兼容 zh
20
- matchRoute = matchRoute.replace("/zh/", "/");
20
+ matchRoute = matchRoute.replace('/zh/', '/');
21
21
  // 兼容带有docs的route
22
- matchRoute = matchRoute.replace("/docs", "");
22
+ matchRoute = matchRoute.replace('/docs', '');
23
23
  // 查找 baseRoute
24
- var reg = window.location.pathname.startsWith("/en") ? /(\/[A-z]*\/?\/[A-z]*)\/?/ : /(\/[A-z]*)\/?/;
24
+ var reg = window.location.pathname.startsWith('/en') ? /(\/[A-z]*\/?\/[A-z]*)\/?/ : /(\/[A-z]*)\/?/;
25
25
  var mainRoute = matchRoute.match(reg);
26
26
  return mainRoute[1];
27
27
  }
@@ -50,8 +50,8 @@ export function getIndexRoute(menuData) {
50
50
  */
51
51
  export function getNavigateUrl(pathname, first, siderbarMenu) {
52
52
  // 兜底 如果 nav 指定有误则自动重定向到 indexDocRoute
53
- if (pathname.includes("/docs/") || pathname.includes("/zh/")) {
54
- return pathname.replace("/docs/", "/").replace("/zh/", "/");
53
+ if (pathname.includes('/docs/') || pathname.includes('/zh/')) {
54
+ return pathname.replace('/docs/', '/').replace('/zh/', '/');
55
55
  }
56
56
  if (siderbarMenu.every(function (item) {
57
57
  var itemLowerCase = "".concat(item).toLowerCase();
package/dist/slots/_.less CHANGED
@@ -1,4 +1,4 @@
1
- @import "~antd/dist/antd.less";
1
+ @import '~antd/dist/antd.less';
2
2
 
3
3
  @primary-color: #873bf4;
4
4
 
@@ -24,7 +24,6 @@
24
24
  // 非常关键,用于 react-split-pane 的样式,如果没有,会没有办法鼠标拖拽
25
25
  // 参考:https://codesandbox.io/s/mow7x4zyqx
26
26
  :global {
27
-
28
27
  .Pane1,
29
28
  .Pane2 {
30
29
  overflow: auto;
@@ -1,5 +1,5 @@
1
- import * as _ from 'lodash-es';
2
1
  import insertCss from 'insert-css';
2
+ import * as _ from 'lodash-es';
3
3
 
4
4
  // 挂载一些全局变量
5
5
  if (window) {
@@ -5,9 +5,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
5
5
  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; }
6
6
  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; } }
7
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
- import { useEffect, useState } from 'react';
9
- import { get } from 'lodash-es';
10
8
  import { useLocale } from 'dumi';
9
+ import { get } from 'lodash-es';
10
+ import { useEffect, useState } from 'react';
11
11
  export var useChinaMirrorHost = function useChinaMirrorHost() {
12
12
  var _useState = useState(false),
13
13
  _useState2 = _slicedToArray(_useState, 2),
@@ -78,7 +78,7 @@ export var usePrevAndNext = function usePrevAndNext() {
78
78
  /**
79
79
  * i18n .umirc config
80
80
  * 如果是 object,则取 locale,否则直接用
81
- * @param v
81
+ * @param v
82
82
  */
83
83
  export function ic(v) {
84
84
  var locale = useLocale();
package/dist/typings.d.ts CHANGED
@@ -1,24 +1,24 @@
1
- declare module '\*.jpg' {
1
+ declare module '*.jpg' {
2
2
  const content: string;
3
3
  export default content;
4
4
  }
5
5
 
6
- declare module '\*.png' {
6
+ declare module '*.png' {
7
7
  const content: string;
8
8
  export default content;
9
9
  }
10
10
 
11
- declare module '\*.json' {
11
+ declare module '*.json' {
12
12
  const content: string;
13
13
  export default content;
14
14
  }
15
15
 
16
- declare module '\*.less' {
16
+ declare module '*.less' {
17
17
  const content: any;
18
18
  export default content;
19
19
  }
20
20
 
21
- declare module '\*.svg' {
21
+ declare module '*.svg' {
22
22
  const content: any;
23
23
  export default content;
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/dumi-theme-antv",
3
- "version": "0.5.4-beta.1",
3
+ "version": "0.5.4",
4
4
  "description": "AntV website theme based on dumi2.",
5
5
  "keywords": [
6
6
  "dumi",
@@ -110,6 +110,8 @@
110
110
  "father": "^4.5.1",
111
111
  "father-plugin-dumi-theme": "1.0.0-rc.1",
112
112
  "husky": "^8.0.3",
113
+ "less": "^4.2.1",
114
+ "less-loader": "^12.2.0",
113
115
  "lint-staged": "^13.3.0",
114
116
  "prettier-plugin-organize-imports": "^3.2.4",
115
117
  "prettier-plugin-packagejson": "^2.5.3",
@@ -121,8 +123,7 @@
121
123
  "react-dom": ">=16.9.0"
122
124
  },
123
125
  "publishConfig": {
124
- "access": "public",
125
- "tag": "beta"
126
+ "access": "public"
126
127
  },
127
128
  "authors": [
128
129
  "dumi",
@@ -131,6 +132,7 @@
131
132
  "scripts": {
132
133
  "build": "npm run prepare && father build",
133
134
  "dev": "father dev",
135
+ "fix": "prettier ./src --write",
134
136
  "lint": "npm run lint:es && npm run lint:css",
135
137
  "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
136
138
  "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",