@antv/dumi-theme-antv 0.3.0-beta.8 → 0.3.0

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 (72) hide show
  1. package/dist/builtins/Playground/index.d.ts +3 -6
  2. package/dist/builtins/Playground/index.js +27 -7
  3. package/dist/layouts/DocLayout.js +4 -5
  4. package/dist/layouts/entry/Index.js +21 -12
  5. package/dist/layouts/entry/Manual.js +6 -4
  6. package/dist/pages/404.js +7 -4
  7. package/dist/pages/Example/index.js +15 -4
  8. package/dist/pages/Example/utils.d.ts +1 -0
  9. package/dist/pages/Example/utils.js +9 -0
  10. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +2 -1
  11. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +10 -5
  12. package/dist/pages/Examples/components/GalleryPageContent/index.js +2 -1
  13. package/dist/pages/Examples/index.js +13 -4
  14. package/dist/pages/Examples/index.module.less +13 -0
  15. package/dist/pages/Examples/utils.d.ts +1 -0
  16. package/dist/pages/Examples/utils.js +3 -0
  17. package/dist/plugin/index.js +11 -0
  18. package/dist/slots/Article/index.d.ts +3 -0
  19. package/dist/slots/Article/index.js +11 -0
  20. package/dist/slots/Article/index.module.less +8 -0
  21. package/dist/slots/Banner/Notification.d.ts +10 -0
  22. package/dist/slots/Banner/Notification.js +43 -0
  23. package/dist/slots/Banner/Notification.module.less +120 -0
  24. package/dist/slots/Banner/index.d.ts +26 -0
  25. package/dist/slots/Banner/index.js +184 -0
  26. package/dist/slots/Banner/index.module.less +449 -0
  27. package/dist/slots/Cases/index.d.ts +1 -1
  28. package/dist/slots/Cases/index.js +13 -7
  29. package/dist/slots/Cases/index.module.less +2 -1
  30. package/dist/slots/CodeEditor/Toolbar.js +13 -6
  31. package/dist/slots/CodeEditor/index.d.ts +4 -0
  32. package/dist/slots/CodeEditor/index.js +43 -21
  33. package/dist/slots/CodeEditor/utils.js +1 -1
  34. package/dist/slots/CodePreview/CodeHeader.js +15 -14
  35. package/dist/slots/CodePreview/index.d.ts +8 -0
  36. package/dist/slots/CodePreview/index.js +15 -6
  37. package/dist/slots/CodePreview/index.module.less +11 -2
  38. package/dist/slots/CodeRunner/index.d.ts +2 -0
  39. package/dist/slots/CodeRunner/index.js +13 -5
  40. package/dist/slots/Companies/index.d.ts +1 -1
  41. package/dist/slots/{TOC.d.ts → ContentTable/index.d.ts} +2 -1
  42. package/dist/slots/{TOC.js → ContentTable/index.js} +2 -1
  43. package/dist/slots/ContentTable/index.module.less +11 -0
  44. package/dist/slots/Detail/News.js +3 -2
  45. package/dist/slots/Detail/index.js +3 -1
  46. package/dist/slots/ExampleSider/index.js +21 -20
  47. package/dist/slots/Features/index.js +5 -2
  48. package/dist/slots/Features/index.module.less +3 -3
  49. package/dist/slots/Footer/index.js +34 -14
  50. package/dist/slots/Header/LogoWhite.js +1 -2
  51. package/dist/slots/Header/Navs.d.ts +10 -1
  52. package/dist/slots/Header/Navs.js +36 -25
  53. package/dist/slots/Header/Products/NavigatorBanner.js +4 -3
  54. package/dist/slots/Header/Products/Product.js +7 -3
  55. package/dist/slots/Header/Products/getProducts.js +4 -2
  56. package/dist/slots/Header/Products/index.js +5 -3
  57. package/dist/slots/Header/Search.js +5 -3
  58. package/dist/slots/Header/index.d.ts +7 -2
  59. package/dist/slots/Header/index.js +128 -24
  60. package/dist/slots/ManualContent/NavigatorBanner.js +5 -3
  61. package/dist/slots/ManualContent/ReadingTime.js +6 -2
  62. package/dist/slots/ManualContent/index.js +36 -30
  63. package/dist/slots/ManualContent/index.module.less +52 -33
  64. package/dist/slots/ManualContent/utils.d.ts +15 -0
  65. package/dist/slots/ManualContent/utils.js +30 -1
  66. package/dist/slots/SEO.d.ts +10 -0
  67. package/dist/slots/SEO.js +59 -0
  68. package/dist/slots/_.less +1 -1
  69. package/dist/slots/hooks.d.ts +1 -1
  70. package/dist/slots/hooks.js +5 -8
  71. package/dist/slots/utils.js +6 -1
  72. package/package.json +5 -2
@@ -68,7 +68,7 @@ export var Features = function Features(_ref) {
68
68
  }) : /*#__PURE__*/React.createElement("div", {
69
69
  className: cx(styles.lefttopWithoutTitle, styles.lefttop)
70
70
  }), /*#__PURE__*/React.createElement("div", {
71
- className: cx(styles.rightbottomWithoutTitle, styles.rightbottom)
71
+ className: title ? styles.rightbottom : cx(styles.rightbottomWithoutTitle, styles.rightbottom)
72
72
  }, /*#__PURE__*/React.createElement("div", {
73
73
  className: cx(styles.slicerbar, styles.slicerbarv, styles.slicerbarv1)
74
74
  }), /*#__PURE__*/React.createElement("div", {
@@ -85,7 +85,10 @@ export var Features = function Features(_ref) {
85
85
  className: styles.content
86
86
  }, /*#__PURE__*/React.createElement("div", {
87
87
  key: "content"
88
- }, /*#__PURE__*/React.createElement("div", {
88
+ }, /*#__PURE__*/React.createElement("p", {
89
+ key: "title",
90
+ className: styles.title
91
+ }, title ? title : ''), /*#__PURE__*/React.createElement("div", {
89
92
  key: "block",
90
93
  className: styles.cardsContainer
91
94
  }, /*#__PURE__*/React.createElement(Row, {
@@ -23,7 +23,7 @@
23
23
  font-size: 2.8em;
24
24
  padding-left: 4.06%;
25
25
  font-weight: 500;
26
- margin: 48px 0 0 0;
26
+ margin: 17px 0 0 0;
27
27
  position: relative;
28
28
  height: min-content;
29
29
  color: #fff;
@@ -58,7 +58,7 @@
58
58
  position: absolute;
59
59
  width: 95.83%;
60
60
  left: 4.17%;
61
- top: 144px;
61
+ top: 88px;
62
62
  background: #fff;
63
63
  height: 65%;
64
64
  box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.1);
@@ -197,4 +197,4 @@
197
197
  display: block;
198
198
  z-index: 2;
199
199
  }
200
- }
200
+ }
@@ -1,4 +1,4 @@
1
- var _excluded = ["columns", "bottom", "theme", "language", "isDynamicFooter", "rootDomain"];
1
+ var _excluded = ["columns", "bottom", "theme", "language", "isDynamicFooter", "rootDomain", "className"];
2
2
 
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
@@ -13,8 +13,7 @@ import { default as RCFooter } from 'rc-footer';
13
13
  import { GithubOutlined, WeiboOutlined, ZhihuOutlined, QuestionCircleOutlined } from '@ant-design/icons';
14
14
  import { omit } from 'lodash-es';
15
15
  import classnames from 'classnames';
16
- import { useLocale } from 'dumi';
17
- import { useT } from "../hooks";
16
+ import { useLocale, FormattedMessage } from 'dumi';
18
17
  import 'rc-footer/assets/index.less';
19
18
  import styles from "./index.module.less";
20
19
 
@@ -31,6 +30,7 @@ export var Footer = function Footer(props) {
31
30
  isDynamicFooter = props.isDynamicFooter,
32
31
  _props$rootDomain = props.rootDomain,
33
32
  rootDomain = _props$rootDomain === void 0 ? '' : _props$rootDomain,
33
+ className = props.className,
34
34
  restProps = _objectWithoutProperties(props, _excluded);
35
35
 
36
36
  var locale = useLocale();
@@ -50,33 +50,45 @@ export var Footer = function Footer(props) {
50
50
  openExternal: true
51
51
  }, {
52
52
  title: 'Umi',
53
- description: useT('React 应用开发框架'),
53
+ description: /*#__PURE__*/React.createElement(FormattedMessage, {
54
+ id: "React \u5E94\u7528\u5F00\u53D1\u6846\u67B6"
55
+ }),
54
56
  url: 'https://umijs.org',
55
57
  openExternal: true
56
58
  }, {
57
59
  title: 'Dumi',
58
- description: useT('组件/文档研发工具'),
60
+ description: /*#__PURE__*/React.createElement(FormattedMessage, {
61
+ id: "\u7EC4\u4EF6/\u6587\u6863\u7814\u53D1\u5DE5\u5177"
62
+ }),
59
63
  url: 'https://d.umijs.org',
60
64
  openExternal: true
61
65
  }, {
62
66
  title: 'ahooks',
63
- description: useT('React Hooks 库'),
67
+ description: /*#__PURE__*/React.createElement(FormattedMessage, {
68
+ id: "React Hooks \u5E93"
69
+ }),
64
70
  url: 'https://github.com/alibaba/hooks',
65
71
  openExternal: true
66
72
  }, {
67
- title: useT('国内镜像'),
73
+ title: /*#__PURE__*/React.createElement(FormattedMessage, {
74
+ id: "\u56FD\u5185\u955C\u50CF"
75
+ }),
68
76
  url: 'https://antv.antgroup.com/'
69
77
  }]
70
78
  };
71
79
  var col2 = {
72
- title: useT('社区'),
80
+ title: /*#__PURE__*/React.createElement(FormattedMessage, {
81
+ id: "\u793E\u533A"
82
+ }),
73
83
  items: [{
74
84
  icon: /*#__PURE__*/React.createElement(ZhihuOutlined, {
75
85
  style: {
76
86
  color: '#0084ff'
77
87
  }
78
88
  }),
79
- title: useT('体验科技专栏'),
89
+ title: /*#__PURE__*/React.createElement(FormattedMessage, {
90
+ id: "\u4F53\u9A8C\u79D1\u6280\u4E13\u680F"
91
+ }),
80
92
  url: 'http://zhuanlan.zhihu.com/xtech',
81
93
  openExternal: true
82
94
  }, {
@@ -85,13 +97,17 @@ export var Footer = function Footer(props) {
85
97
  alt: "seeconf"
86
98
  }),
87
99
  title: 'SEE Conf',
88
- description: useT('蚂蚁体验科技大会'),
100
+ description: /*#__PURE__*/React.createElement(FormattedMessage, {
101
+ id: "\u8682\u8681\u4F53\u9A8C\u79D1\u6280\u5927\u4F1A"
102
+ }),
89
103
  url: 'https://seeconf.antfin.com/',
90
104
  openExternal: true
91
105
  }]
92
106
  };
93
107
  var col3 = {
94
- title: useT('帮助'),
108
+ title: /*#__PURE__*/React.createElement(FormattedMessage, {
109
+ id: "\u5E2E\u52A9"
110
+ }),
95
111
  items: [{
96
112
  icon: /*#__PURE__*/React.createElement(GithubOutlined, null),
97
113
  title: 'GitHub',
@@ -99,7 +115,9 @@ export var Footer = function Footer(props) {
99
115
  openExternal: true
100
116
  }, {
101
117
  icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null),
102
- title: useT('StackOverflow'),
118
+ title: /*#__PURE__*/React.createElement(FormattedMessage, {
119
+ id: "StackOverflow"
120
+ }),
103
121
  url: 'http://stackoverflow.com/questions/tagged/antv',
104
122
  openExternal: true
105
123
  }]
@@ -163,7 +181,7 @@ export var Footer = function Footer(props) {
163
181
  maxColumnsPerRow: 5,
164
182
  theme: theme,
165
183
  columns: columns || getColumns(),
166
- className: classnames(styles.footer, _defineProperty({}, styles.withMenu, isDynamicFooter)),
184
+ className: classnames(styles.footer, className, _defineProperty({}, styles.withMenu, isDynamicFooter)),
167
185
  bottom: bottom || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
168
186
  className: styles.bottom
169
187
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
@@ -180,7 +198,9 @@ export var Footer = function Footer(props) {
180
198
  rel: "noopener noreferrer"
181
199
  }, /*#__PURE__*/React.createElement(GithubOutlined, null)), /*#__PURE__*/React.createElement("a", {
182
200
  href: "".concat(rootDomain, "/").concat(lang, "/about")
183
- }, useT('关于我们'))), /*#__PURE__*/React.createElement("div", null, "\xA9 ", new Date().getFullYear(), " Made with \u2764 by", ' ', /*#__PURE__*/React.createElement("a", {
201
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
202
+ id: "\u5173\u4E8E\u6211\u4EEC"
203
+ }))), /*#__PURE__*/React.createElement("div", null, "\xA9 ", new Date().getFullYear(), " Made with \u2764 by", ' ', /*#__PURE__*/React.createElement("a", {
184
204
  href: "https://xtech.antfin.com/"
185
205
  }, "AntV"))))
186
206
  }, omit(restProps, ['githubUrl'])));
@@ -6,8 +6,7 @@ import React from 'react';
6
6
  export var LogoWhite = function LogoWhite(_ref) {
7
7
  var style = _ref.style;
8
8
  return /*#__PURE__*/React.createElement("svg", {
9
- viewBox: "0 0 94 28",
10
- style: style,
9
+ viewBox: "0 0 3313 1024",
11
10
  version: "1.1",
12
11
  xmlns: "http://www.w3.org/2000/svg",
13
12
  width: "94",
@@ -1,11 +1,19 @@
1
1
  import React from 'react';
2
+ declare type dropdownItem = {
3
+ name: {
4
+ [key: string]: string;
5
+ };
6
+ url: string;
7
+ };
2
8
  export declare type INav = {
3
- slug: string;
9
+ slug?: string;
4
10
  order: number;
5
11
  title: {
6
12
  [key: string]: string;
7
13
  };
8
14
  target?: '_blank';
15
+ notPage?: boolean;
16
+ dropdownItems?: dropdownItem[];
9
17
  };
10
18
  export declare type NavProps = {
11
19
  navs: INav[];
@@ -15,3 +23,4 @@ export declare type NavProps = {
15
23
  * Header 中的导航菜单
16
24
  */
17
25
  export declare const Navs: React.FC<NavProps>;
26
+ export {};
@@ -2,47 +2,58 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
2
2
 
3
3
  import React from 'react';
4
4
  import cx from 'classnames';
5
- import { isEqual } from 'lodash-es';
6
- import { LinkOutlined } from '@ant-design/icons';
5
+ import { isEqual, size } from 'lodash-es';
7
6
  import { Link, useLocale } from 'dumi';
7
+ import { Dropdown, Menu } from 'antd';
8
+ import { DownOutlined, LinkOutlined } from '@ant-design/icons';
8
9
  import styles from "./index.module.less";
9
10
 
10
- var getDocument = function getDocument(navs) {
11
- var slug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
12
- return navs.find(function (doc) {
13
- return doc.slug === slug;
14
- }) || {
15
- title: {}
16
- };
17
- };
18
11
  /**
19
12
  * Header 中的导航菜单
20
13
  */
21
-
22
-
23
14
  export var Navs = function Navs(_ref) {
24
15
  var navs = _ref.navs,
25
16
  path = _ref.path;
26
17
  var locale = useLocale();
27
18
  return /*#__PURE__*/React.createElement(React.Fragment, null, navs.map(function (nav) {
28
- var href = nav.slug.startsWith('http') ? nav.slug : "/".concat(nav.slug);
29
- var isAnotherSite = nav.slug.startsWith('http');
30
- var anotherSite = isAnotherSite ? href : '';
31
- var title = getDocument(navs, nav.slug).title[locale.id];
32
- href = nav.slug.startsWith('/') ? nav.slug : "/".concat(nav.slug);
19
+ var title = nav.title[locale.id];
20
+ var href = '';
21
+ var className = '';
22
+
23
+ if (nav.slug) {
24
+ href = nav.slug.startsWith('http') ? nav.slug : "/".concat(nav.slug);
33
25
 
34
- if (locale.id == 'en') {
35
- href = "/en".concat(href);
36
- } // 去除 docs 防止二次点击相同nav跳转出现04
26
+ if (locale.id == 'en' && !href.startsWith('http')) {
27
+ href = "/en".concat(href);
28
+ } // 去除 docs 防止二次点击相同nav跳转出现04
37
29
 
38
30
 
39
- href = href.replace('/docs/', '/');
40
- var className = cx('header-menu-item-active', _defineProperty({}, styles.activeItem, path.startsWith(href) || isEqual(path.split('/').slice(0, 4), href.split('/').slice(0, 4))));
41
- return /*#__PURE__*/React.createElement("li", {
31
+ href = href.replace('/docs/', '/');
32
+ className = cx('header-menu-item-active', _defineProperty({}, styles.activeItem, path.startsWith(href) || isEqual(path.split('/').slice(0, 4), href.split('/').slice(0, 4))));
33
+ }
34
+
35
+ return size(nav.dropdownItems) ? /*#__PURE__*/React.createElement("li", {
36
+ key: title,
37
+ className: className
38
+ }, /*#__PURE__*/React.createElement(Dropdown, {
39
+ className: styles.ecoSystems,
40
+ placement: "bottom",
41
+ overlay: /*#__PURE__*/React.createElement(Menu, null, nav.dropdownItems.map(function (_ref2) {
42
+ var name = _ref2.name,
43
+ url = _ref2.url;
44
+ return /*#__PURE__*/React.createElement(Menu.Item, {
45
+ key: url
46
+ }, /*#__PURE__*/React.createElement("a", {
47
+ target: "_blank",
48
+ rel: "noreferrer",
49
+ href: url
50
+ }, name[locale.id], " ", /*#__PURE__*/React.createElement(LinkOutlined, null)));
51
+ }))
52
+ }, /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(DownOutlined, null)))) : /*#__PURE__*/React.createElement("li", {
42
53
  key: title,
43
54
  className: className
44
- }, nav.target === '_blank' || isAnotherSite ? /*#__PURE__*/React.createElement("a", {
45
- href: anotherSite,
55
+ }, nav.target === '_blank' || href.startsWith('http') ? /*#__PURE__*/React.createElement("a", {
56
+ href: href,
46
57
  target: "_blank",
47
58
  rel: "noreferrer"
48
59
  }, title, /*#__PURE__*/React.createElement(LinkOutlined, null)) : /*#__PURE__*/React.createElement(Link, {
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
- import { Link } from 'dumi';
3
+ import { Link, FormattedMessage } from 'dumi';
4
4
  import styles from "./NavigatorBanner.module.less";
5
- import { useT } from "../../hooks";
6
5
 
7
6
  var NavigatorBanner = function NavigatorBanner(_ref) {
8
7
  var post = _ref.post,
@@ -26,7 +25,9 @@ var NavigatorBanner = function NavigatorBanner(_ref) {
26
25
  className: classNames(styles.button, styles[type])
27
26
  }, /*#__PURE__*/React.createElement("div", {
28
27
  className: styles.label
29
- }, useT(type === 'prev' ? '上一篇' : '下一篇')), /*#__PURE__*/React.createElement("div", {
28
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
29
+ id: type === 'prev' ? '上一篇' : '下一篇'
30
+ })), /*#__PURE__*/React.createElement("div", {
30
31
  className: styles.title
31
32
  }, title));
32
33
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useT } from "../../hooks";
2
+ import { FormattedMessage } from 'dumi';
3
3
  import styles from "./Product.module.less";
4
4
 
5
5
  var getTarget = function getTarget(url) {
@@ -46,11 +46,15 @@ var Product = function Product(_ref) {
46
46
  href: links.home.url,
47
47
  target: getTarget(links.home.url || ''),
48
48
  key: links.home.url
49
- }, (_links$home$title = links.home.title) !== null && _links$home$title !== void 0 ? _links$home$title : useT('产品首页')), links.example && /*#__PURE__*/React.createElement("a", {
49
+ }, (_links$home$title = links.home.title) !== null && _links$home$title !== void 0 ? _links$home$title : /*#__PURE__*/React.createElement(FormattedMessage, {
50
+ id: "\u4EA7\u54C1\u9996\u9875"
51
+ })), links.example && /*#__PURE__*/React.createElement("a", {
50
52
  href: links.example.url,
51
53
  target: getTarget(links.example.url || ''),
52
54
  key: links.example.url
53
- }, (_links$example$title = links.example.title) !== null && _links$example$title !== void 0 ? _links$example$title : useT('图表示例')))));
55
+ }, (_links$example$title = links.example.title) !== null && _links$example$title !== void 0 ? _links$example$title : /*#__PURE__*/React.createElement(FormattedMessage, {
56
+ id: "\u56FE\u8868\u793A\u4F8B"
57
+ })))));
54
58
  };
55
59
 
56
60
  export default Product;
@@ -34,8 +34,10 @@ export var CATEGORIES = [{
34
34
  export function getNewProducts(_ref) {
35
35
  var language = _ref.language,
36
36
  isChinaMirrorHost = _ref.isChinaMirrorHost;
37
- // 如需要修改产品信息,请到 https://yuyan.antfin-inc.com/datavprod/antv-site-datas/schemas/site-products-h5data/console 修改区块内容
38
- return fetch('https://render.alipay.com/p/h5data/antv-site-datas_site-products-h5data.json').then(function (res) {
37
+ // 如需要修改产品信息,请到 https://yuyan.antfin-inc.com/antv/site-data/sprints 修改区块内容
38
+ return fetch('https://assets.antv.antgroup.com/antv/products.json' // 生产环境
39
+ // 'https://site-data-pre.alipay.com/antv/products.json', // 预发测试
40
+ ).then(function (res) {
39
41
  return res.json();
40
42
  }).then(function (products) {
41
43
  return products.filter(function (d) {
@@ -14,11 +14,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
 
15
15
  import React from 'react';
16
16
  import cx from 'classnames';
17
+ import { useLocale, FormattedMessage } from 'dumi';
17
18
  import Product from "./Product";
18
19
  import { CATEGORIES, getNewProducts } from "./getProducts";
19
- import { useChinaMirrorHost, useT } from "../../hooks";
20
+ import { useChinaMirrorHost } from "../../hooks";
20
21
  import styles from "./Product.module.less";
21
- import { useLocale } from 'dumi';
22
22
  export var Products = function Products(_ref) {
23
23
  var show = _ref.show,
24
24
  language = _ref.language,
@@ -52,7 +52,9 @@ export var Products = function Products(_ref) {
52
52
  type = _ref2.type;
53
53
  return /*#__PURE__*/React.createElement(React.Fragment, {
54
54
  key: idx
55
- }, /*#__PURE__*/React.createElement("h3", null, useT(name)), /*#__PURE__*/React.createElement("ul", null, products.filter(function (item) {
55
+ }, /*#__PURE__*/React.createElement("h3", null, /*#__PURE__*/React.createElement(FormattedMessage, {
56
+ id: name
57
+ })), /*#__PURE__*/React.createElement("ul", null, products.filter(function (item) {
56
58
  return item.category === type;
57
59
  }).map(function (product) {
58
60
  var _product$links, _product$links$home;
@@ -1,8 +1,7 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { SearchOutlined } from '@ant-design/icons';
3
3
  import { DocSearch } from '@docsearch/react';
4
- import { useLocale } from 'dumi';
5
- import { useT } from "../hooks";
4
+ import { useLocale, useIntl } from 'dumi';
6
5
  import '@docsearch/css';
7
6
  import styles from "./Search.module.less";
8
7
  import 'docsearch.js/dist/cdn/docsearch.min.css';
@@ -49,6 +48,7 @@ function initDocSearchV2(_ref) {
49
48
  export var Search = function Search(_ref3) {
50
49
  var docsearchOptions = _ref3.docsearchOptions;
51
50
  var locale = useLocale();
51
+ var intl = useIntl();
52
52
 
53
53
  var _ref4 = docsearchOptions || {},
54
54
  _ref4$apiKey = _ref4.apiKey,
@@ -85,6 +85,8 @@ export var Search = function Search(_ref3) {
85
85
  }), /*#__PURE__*/React.createElement("input", {
86
86
  className: styles.input,
87
87
  id: "search",
88
- placeholder: useT('搜索…')
88
+ placeholder: intl.formatMessage({
89
+ id: '搜索…'
90
+ })
89
91
  })));
90
92
  };
@@ -16,6 +16,13 @@ export declare type HeaderProps = {
16
16
  showGithubStar?: boolean;
17
17
  /** 是否显示切换语言选项 */
18
18
  showLanguageSwitcher?: boolean;
19
+ /**
20
+ * 国内镜像相关的信息
21
+ */
22
+ internalSite?: {
23
+ url: string;
24
+ name: object;
25
+ };
19
26
  /** 切换语言的回调 */
20
27
  onLanguageChange?: (language: string) => void;
21
28
  /** 是否二维码 */
@@ -40,8 +47,6 @@ export declare type HeaderProps = {
40
47
  isAntVSite?: boolean;
41
48
  /** AntV root 域名,直接用主题的可不传 */
42
49
  rootDomain?: string;
43
- /** 是否展示国内镜像链接 */
44
- showChinaMirror?: boolean;
45
50
  /** 是否显示 AntV 产品卡片 */
46
51
  showAntVProductsCard?: boolean;
47
52
  /** 展示版本切换 */