@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.
- package/dist/builtins/Playground/index.d.ts +3 -6
- package/dist/builtins/Playground/index.js +27 -7
- package/dist/layouts/DocLayout.js +4 -5
- package/dist/layouts/entry/Index.js +21 -12
- package/dist/layouts/entry/Manual.js +6 -4
- package/dist/pages/404.js +7 -4
- package/dist/pages/Example/index.js +15 -4
- package/dist/pages/Example/utils.d.ts +1 -0
- package/dist/pages/Example/utils.js +9 -0
- package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +2 -1
- package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +10 -5
- package/dist/pages/Examples/components/GalleryPageContent/index.js +2 -1
- package/dist/pages/Examples/index.js +13 -4
- package/dist/pages/Examples/index.module.less +13 -0
- package/dist/pages/Examples/utils.d.ts +1 -0
- package/dist/pages/Examples/utils.js +3 -0
- package/dist/plugin/index.js +11 -0
- package/dist/slots/Article/index.d.ts +3 -0
- package/dist/slots/Article/index.js +11 -0
- package/dist/slots/Article/index.module.less +8 -0
- package/dist/slots/Banner/Notification.d.ts +10 -0
- package/dist/slots/Banner/Notification.js +43 -0
- package/dist/slots/Banner/Notification.module.less +120 -0
- package/dist/slots/Banner/index.d.ts +26 -0
- package/dist/slots/Banner/index.js +184 -0
- package/dist/slots/Banner/index.module.less +449 -0
- package/dist/slots/Cases/index.d.ts +1 -1
- package/dist/slots/Cases/index.js +13 -7
- package/dist/slots/Cases/index.module.less +2 -1
- package/dist/slots/CodeEditor/Toolbar.js +13 -6
- package/dist/slots/CodeEditor/index.d.ts +4 -0
- package/dist/slots/CodeEditor/index.js +43 -21
- package/dist/slots/CodeEditor/utils.js +1 -1
- package/dist/slots/CodePreview/CodeHeader.js +15 -14
- package/dist/slots/CodePreview/index.d.ts +8 -0
- package/dist/slots/CodePreview/index.js +15 -6
- package/dist/slots/CodePreview/index.module.less +11 -2
- package/dist/slots/CodeRunner/index.d.ts +2 -0
- package/dist/slots/CodeRunner/index.js +13 -5
- package/dist/slots/Companies/index.d.ts +1 -1
- package/dist/slots/{TOC.d.ts → ContentTable/index.d.ts} +2 -1
- package/dist/slots/{TOC.js → ContentTable/index.js} +2 -1
- package/dist/slots/ContentTable/index.module.less +11 -0
- package/dist/slots/Detail/News.js +3 -2
- package/dist/slots/Detail/index.js +3 -1
- package/dist/slots/ExampleSider/index.js +21 -20
- package/dist/slots/Features/index.js +5 -2
- package/dist/slots/Features/index.module.less +3 -3
- package/dist/slots/Footer/index.js +34 -14
- package/dist/slots/Header/LogoWhite.js +1 -2
- package/dist/slots/Header/Navs.d.ts +10 -1
- package/dist/slots/Header/Navs.js +36 -25
- package/dist/slots/Header/Products/NavigatorBanner.js +4 -3
- package/dist/slots/Header/Products/Product.js +7 -3
- package/dist/slots/Header/Products/getProducts.js +4 -2
- package/dist/slots/Header/Products/index.js +5 -3
- package/dist/slots/Header/Search.js +5 -3
- package/dist/slots/Header/index.d.ts +7 -2
- package/dist/slots/Header/index.js +128 -24
- package/dist/slots/ManualContent/NavigatorBanner.js +5 -3
- package/dist/slots/ManualContent/ReadingTime.js +6 -2
- package/dist/slots/ManualContent/index.js +36 -30
- package/dist/slots/ManualContent/index.module.less +52 -33
- package/dist/slots/ManualContent/utils.d.ts +15 -0
- package/dist/slots/ManualContent/utils.js +30 -1
- package/dist/slots/SEO.d.ts +10 -0
- package/dist/slots/SEO.js +59 -0
- package/dist/slots/_.less +1 -1
- package/dist/slots/hooks.d.ts +1 -1
- package/dist/slots/hooks.js +5 -8
- package/dist/slots/utils.js +6 -1
- 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("
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
},
|
|
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
|
|
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
|
|
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
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
if (locale.id == 'en' && !href.startsWith('http')) {
|
|
27
|
+
href = "/en".concat(href);
|
|
28
|
+
} // 去除 docs 防止二次点击相同nav跳转出现04
|
|
37
29
|
|
|
38
30
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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' ||
|
|
45
|
-
href:
|
|
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
|
-
},
|
|
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 {
|
|
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 :
|
|
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 :
|
|
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/
|
|
38
|
-
return fetch('https://
|
|
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
|
|
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,
|
|
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:
|
|
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
|
/** 展示版本切换 */
|