@antv/dumi-theme-antv 0.4.4 → 0.4.6
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/layouts/DocLayout.d.ts +1 -2
- package/dist/layouts/entry/Index.js +4 -3
- package/dist/locales/en.json +13 -7
- package/dist/locales/zh.json +9 -3
- package/dist/slots/Cases/index.module.less +3 -1
- package/dist/slots/Companies/index.js +0 -3
- package/dist/slots/Companies/index.module.less +2 -16
- package/dist/slots/Detail/News.d.ts +2 -0
- package/dist/slots/Detail/News.js +10 -7
- package/dist/slots/Detail/News.module.less +75 -29
- package/dist/slots/Detail/index.js +2 -4
- package/dist/slots/Detail/index.module.less +28 -19
- package/dist/slots/Features/FeatureCard.module.less +16 -7
- package/dist/slots/Features/index.js +1 -52
- package/dist/slots/Features/index.module.less +30 -136
- package/dist/slots/Footer/index.js +21 -7
- package/dist/slots/Header/Navs.js +5 -1
- package/dist/slots/Header/index.d.ts +9 -0
- package/dist/slots/Header/index.js +66 -63
- package/dist/slots/Header/index.module.less +17 -0
- package/dist/slots/ManualContent/index.js +8 -2
- package/dist/slots/ManualContent/index.module.less +39 -18
- package/package.json +2 -2
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
margin: auto;
|
|
6
6
|
position: relative;
|
|
7
7
|
flex-direction: column;
|
|
8
|
-
padding:
|
|
9
|
-
|
|
8
|
+
padding-top: 120px;
|
|
9
|
+
top: -90px;
|
|
10
|
+
background: #fff;
|
|
10
11
|
height: auto;
|
|
11
12
|
overflow-x: hidden;
|
|
12
13
|
|
|
@@ -14,65 +15,24 @@
|
|
|
14
15
|
width: 95.8%;
|
|
15
16
|
height: 100%;
|
|
16
17
|
margin-left: 4.2%;
|
|
17
|
-
margin-bottom: 5%;
|
|
18
18
|
position: relative;
|
|
19
19
|
.container1440;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.title {
|
|
23
|
-
font-size: 2.8em;
|
|
24
|
-
padding-left: 4.06%;
|
|
25
23
|
font-weight: 500;
|
|
26
24
|
margin: 17px 0 0 0;
|
|
27
25
|
position: relative;
|
|
26
|
+
font-family: AlibabaPuHuiTiB;
|
|
27
|
+
font-size: 40px;
|
|
28
|
+
text-align: center;
|
|
29
|
+
color: #1D2129;
|
|
28
30
|
height: min-content;
|
|
29
|
-
color: #fff;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.slicerbarv {
|
|
33
|
-
display: none;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.slicerbarv2 {
|
|
37
|
-
display: none;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.lefttop {
|
|
41
|
-
background: linear-gradient(130deg,
|
|
42
|
-
fade(@primary-color, 70%),
|
|
43
|
-
shade(@primary-color, 20%));
|
|
44
|
-
width: 100%;
|
|
45
|
-
top: 0;
|
|
46
|
-
position: absolute;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.lefttopWithTitle {
|
|
50
|
-
height: 60%;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.lefttopWithoutTitle {
|
|
54
|
-
height: 75%;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.rightbottom {
|
|
58
|
-
position: absolute;
|
|
59
|
-
width: 95.83%;
|
|
60
|
-
left: 4.17%;
|
|
61
|
-
top: 88px;
|
|
62
|
-
background: #fff;
|
|
63
|
-
height: 65%;
|
|
64
|
-
box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.rightbottomWithoutTitle {
|
|
68
|
-
top: 48px;
|
|
69
|
-
height: 75%;
|
|
70
31
|
}
|
|
71
32
|
|
|
72
33
|
.cardsContainer {
|
|
73
34
|
width: 100%;
|
|
74
35
|
height: 65%;
|
|
75
|
-
margin-top: 48px;
|
|
76
36
|
position: relative;
|
|
77
37
|
|
|
78
38
|
.cards {
|
|
@@ -81,120 +41,54 @@
|
|
|
81
41
|
position: relative;
|
|
82
42
|
width: -webkit-fill-available;
|
|
83
43
|
flex-wrap: wrap;
|
|
84
|
-
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
padding: 0 4.5%;
|
|
85
46
|
|
|
86
47
|
.cardWrapper {
|
|
87
|
-
margin:
|
|
88
|
-
|
|
48
|
+
margin: 48px 0 30px 0;
|
|
49
|
+
background-color: #FFFFFF;
|
|
50
|
+
border: 1px solid #E5E8EF;
|
|
51
|
+
box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.03);
|
|
52
|
+
border-radius: 16px;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
margin-right: 29px;
|
|
55
|
+
flex: 1;
|
|
89
56
|
|
|
90
57
|
&:last-child {
|
|
91
|
-
|
|
58
|
+
margin-right: 0;
|
|
92
59
|
}
|
|
93
60
|
}
|
|
94
61
|
}
|
|
95
62
|
}
|
|
96
63
|
}
|
|
97
64
|
|
|
98
|
-
|
|
99
|
-
position: absolute;
|
|
100
|
-
width: 3px;
|
|
101
|
-
height: 3px;
|
|
102
|
-
border-radius: 50%;
|
|
103
|
-
background: #d8d8d8;
|
|
104
|
-
display: none;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
@media (max-width: 768px) {
|
|
65
|
+
@media (max-width: 900px) {
|
|
108
66
|
.wrapper {
|
|
109
67
|
width: 100%;
|
|
110
68
|
|
|
111
|
-
.lefttop {
|
|
112
|
-
left: 0px;
|
|
113
|
-
height: 100%;
|
|
114
|
-
width: 100%;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.rightbottom {
|
|
118
|
-
height: 79.5%;
|
|
119
|
-
margin-top: 48px;
|
|
120
|
-
|
|
121
|
-
.slicerbarv {
|
|
122
|
-
position: absolute;
|
|
123
|
-
background-color: #f2f4f5;
|
|
124
|
-
width: 1px;
|
|
125
|
-
height: 100%;
|
|
126
|
-
margin-left: 3%;
|
|
127
|
-
display: block;
|
|
128
|
-
z-index: 1;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.slicerbarv2 {
|
|
132
|
-
margin-left: 92.2%; // 1 - (0.96 * 0.04 + 0.04)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.slicerbarh {
|
|
136
|
-
position: absolute;
|
|
137
|
-
background-color: #f2f4f5;
|
|
138
|
-
width: 100%;
|
|
139
|
-
height: 1px;
|
|
140
|
-
display: block;
|
|
141
|
-
margin-top: 45px;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.slicerbarh2 {
|
|
145
|
-
margin-top: 395px;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.slicerbarh3 {
|
|
149
|
-
margin-top: 745px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.slicerbarh4 {
|
|
153
|
-
margin-top: 1095px;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.rightbottomWithoutTitle {
|
|
158
|
-
top: 48px;
|
|
159
|
-
height: 86.5%;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.lefttopWithTitle {
|
|
163
|
-
height: 95.73%;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.lefttopWithoutTitle {
|
|
167
|
-
height: 95.73%;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
69
|
.content {
|
|
70
|
+
width: 91.46%;
|
|
71
|
+
|
|
171
72
|
.title {
|
|
172
73
|
font-size: 2.143rem;
|
|
173
|
-
margin: 80px 0 60px 0;
|
|
174
74
|
}
|
|
175
75
|
|
|
176
76
|
.cardsContainer {
|
|
177
|
-
margin-bottom: 70px;
|
|
178
|
-
|
|
179
77
|
.cards {
|
|
180
|
-
margin-top:
|
|
181
|
-
margin-left: 3.34%;
|
|
182
|
-
padding-top: 45px;
|
|
183
|
-
padding-bottom: 45px;
|
|
78
|
+
margin-top: 48px;
|
|
184
79
|
|
|
185
80
|
.cardWrapper {
|
|
186
|
-
|
|
81
|
+
flex: none;
|
|
82
|
+
margin: 0 0 28px 0;
|
|
187
83
|
width: 100%;
|
|
188
|
-
|
|
189
|
-
|
|
84
|
+
max-width: 100%;
|
|
85
|
+
|
|
86
|
+
&:last-child {
|
|
87
|
+
margin: 0 0 30px 0;
|
|
88
|
+
}
|
|
190
89
|
}
|
|
191
90
|
}
|
|
192
91
|
}
|
|
193
92
|
}
|
|
194
93
|
}
|
|
195
|
-
|
|
196
|
-
.dot {
|
|
197
|
-
display: block;
|
|
198
|
-
z-index: 2;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
94
|
+
}
|
|
@@ -123,7 +123,9 @@ export var Footer = function Footer(props) {
|
|
|
123
123
|
src: "https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg",
|
|
124
124
|
alt: "more products"
|
|
125
125
|
}),
|
|
126
|
-
title:
|
|
126
|
+
title: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
127
|
+
id: "\u66F4\u591A\u4EA7\u54C1"
|
|
128
|
+
}),
|
|
127
129
|
items: [{
|
|
128
130
|
icon: /*#__PURE__*/React.createElement("img", {
|
|
129
131
|
src: "https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg",
|
|
@@ -131,16 +133,22 @@ export var Footer = function Footer(props) {
|
|
|
131
133
|
}),
|
|
132
134
|
title: 'Ant Design',
|
|
133
135
|
url: 'https://ant.design',
|
|
134
|
-
description:
|
|
136
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
137
|
+
id: "\u4F01\u4E1A\u7EA7 UI \u8BBE\u8BA1\u8BED\u8A00"
|
|
138
|
+
}),
|
|
135
139
|
openExternal: true
|
|
136
140
|
}, {
|
|
137
141
|
icon: /*#__PURE__*/React.createElement("img", {
|
|
138
142
|
src: "https://gw.alipayobjects.com/zos/rmsportal/XuVpGqBFxXplzvLjJBZB.svg",
|
|
139
143
|
alt: "yuque"
|
|
140
144
|
}),
|
|
141
|
-
title:
|
|
145
|
+
title: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
146
|
+
id: "\u8BED\u96C0"
|
|
147
|
+
}),
|
|
142
148
|
url: 'https://yuque.com',
|
|
143
|
-
description:
|
|
149
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
150
|
+
id: "\u77E5\u8BC6\u521B\u4F5C\u4E0E\u5206\u4EAB\u5DE5\u5177"
|
|
151
|
+
}),
|
|
144
152
|
openExternal: true
|
|
145
153
|
}, {
|
|
146
154
|
icon: /*#__PURE__*/React.createElement("img", {
|
|
@@ -149,7 +157,9 @@ export var Footer = function Footer(props) {
|
|
|
149
157
|
}),
|
|
150
158
|
title: 'Egg',
|
|
151
159
|
url: 'https://eggjs.org',
|
|
152
|
-
description:
|
|
160
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
161
|
+
id: "\u4F01\u4E1A\u7EA7 Node \u5F00\u53D1\u6846\u67B6"
|
|
162
|
+
}),
|
|
153
163
|
openExternal: true
|
|
154
164
|
}, {
|
|
155
165
|
icon: /*#__PURE__*/React.createElement("img", {
|
|
@@ -157,7 +167,9 @@ export var Footer = function Footer(props) {
|
|
|
157
167
|
alt: "kitchen"
|
|
158
168
|
}),
|
|
159
169
|
title: 'Kitchen',
|
|
160
|
-
description:
|
|
170
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
171
|
+
id: "Sketch \u5DE5\u5177\u96C6"
|
|
172
|
+
}),
|
|
161
173
|
url: 'https://kitchen.alipay.com',
|
|
162
174
|
openExternal: true
|
|
163
175
|
}, {
|
|
@@ -165,7 +177,9 @@ export var Footer = function Footer(props) {
|
|
|
165
177
|
src: "https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg",
|
|
166
178
|
alt: "xtech"
|
|
167
179
|
}),
|
|
168
|
-
title:
|
|
180
|
+
title: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
181
|
+
id: "\u8682\u8681\u4F53\u9A8C\u79D1\u6280"
|
|
182
|
+
}),
|
|
169
183
|
url: 'https://xtech.antfin.com/',
|
|
170
184
|
openExternal: true
|
|
171
185
|
}]
|
|
@@ -52,7 +52,11 @@ export var Navs = function Navs(_ref) {
|
|
|
52
52
|
to: url
|
|
53
53
|
}, displayName));
|
|
54
54
|
}))
|
|
55
|
-
}, /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(DownOutlined,
|
|
55
|
+
}, /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(DownOutlined, {
|
|
56
|
+
style: {
|
|
57
|
+
marginLeft: '6px'
|
|
58
|
+
}
|
|
59
|
+
})))) : /*#__PURE__*/React.createElement("li", {
|
|
56
60
|
key: title,
|
|
57
61
|
className: className
|
|
58
62
|
}, nav.target === '_blank' || href.startsWith('http') ? /*#__PURE__*/React.createElement("a", {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { INav } from './Navs';
|
|
3
|
+
import type { IC } from '../../types';
|
|
3
4
|
export type HeaderProps = {
|
|
4
5
|
pathPrefix?: string;
|
|
5
6
|
/** 子标题 */
|
|
@@ -71,5 +72,13 @@ export type HeaderProps = {
|
|
|
71
72
|
appId: string;
|
|
72
73
|
};
|
|
73
74
|
};
|
|
75
|
+
announcement?: {
|
|
76
|
+
title: IC;
|
|
77
|
+
icon: string;
|
|
78
|
+
link: {
|
|
79
|
+
url: string;
|
|
80
|
+
text: IC;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
74
83
|
};
|
|
75
84
|
export declare const Header: React.FC<Partial<HeaderProps>>;
|
|
@@ -11,13 +11,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
11
|
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
// import { navigate } from 'gatsby';
|
|
14
|
-
import React, { useState, useEffect } from 'react';
|
|
14
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
15
15
|
import { useMedia } from 'react-use';
|
|
16
16
|
import { useNavigate } from "react-router-dom";
|
|
17
17
|
import cx from 'classnames';
|
|
18
18
|
import { useSiteData, useLocale, FormattedMessage } from 'dumi';
|
|
19
19
|
import { GithubOutlined, MenuOutlined, CaretDownFilled, DownOutlined, WechatOutlined, LinkOutlined, CheckOutlined } from '@ant-design/icons';
|
|
20
|
-
import { Modal, Button, Popover, Menu, Dropdown, Select } from 'antd';
|
|
20
|
+
import { Alert, Modal, Button, Popover, Menu, Dropdown, Select } from 'antd';
|
|
21
21
|
import { get, map, size } from 'lodash-es';
|
|
22
22
|
import { Search } from "./Search";
|
|
23
23
|
import { Products } from "./Products";
|
|
@@ -28,13 +28,7 @@ import styles from "./index.module.less";
|
|
|
28
28
|
function redirectChinaMirror(chinaMirrorOrigin) {
|
|
29
29
|
window.location.href = window.location.href.replace(window.location.origin, chinaMirrorOrigin);
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
return fetch('https://assets.antv.antgroup.com/antv/banner.json' // 生产环境
|
|
33
|
-
// 'https://site-data-pre.alipay.com/antv/banner.json', // 预发测试
|
|
34
|
-
).then(function (res) {
|
|
35
|
-
return res.json();
|
|
36
|
-
});
|
|
37
|
-
}
|
|
31
|
+
var ANNOUNCEMENT_LOCALSTORAGE_ID = 'ANNOUNCEMENT_LOCALSTORAGE_ID';
|
|
38
32
|
|
|
39
33
|
/**
|
|
40
34
|
* 头部菜单
|
|
@@ -43,15 +37,10 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
43
37
|
var _cx, _cx4;
|
|
44
38
|
var _ref$subTitle = _ref.subTitle,
|
|
45
39
|
subTitle = _ref$subTitle === void 0 ? '' : _ref$subTitle,
|
|
46
|
-
subTitleHref = _ref.subTitleHref,
|
|
47
|
-
_ref$pathPrefix = _ref.pathPrefix,
|
|
48
|
-
pathPrefix = _ref$pathPrefix === void 0 ? '' : _ref$pathPrefix,
|
|
49
40
|
_ref$navs = _ref.navs,
|
|
50
41
|
navs = _ref$navs === void 0 ? [] : _ref$navs,
|
|
51
42
|
_ref$showSearch = _ref.showSearch,
|
|
52
43
|
showSearch = _ref$showSearch === void 0 ? true : _ref$showSearch,
|
|
53
|
-
_ref$showGithubStar = _ref.showGithubStar,
|
|
54
|
-
showGithubStar = _ref$showGithubStar === void 0 ? false : _ref$showGithubStar,
|
|
55
44
|
_ref$showGithubCorner = _ref.showGithubCorner,
|
|
56
45
|
showGithubCorner = _ref$showGithubCorner === void 0 ? true : _ref$showGithubCorner,
|
|
57
46
|
_ref$showAntVProducts = _ref.showAntVProductsCard,
|
|
@@ -66,8 +55,6 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
66
55
|
_ref$githubUrl = _ref.githubUrl,
|
|
67
56
|
githubUrl = _ref$githubUrl === void 0 ? 'https://github.com/antvis' : _ref$githubUrl,
|
|
68
57
|
defaultLanguage = _ref.defaultLanguage,
|
|
69
|
-
_ref$Link = _ref.Link,
|
|
70
|
-
Link = _ref$Link === void 0 ? 'a' : _ref$Link,
|
|
71
58
|
transparent = _ref.transparent,
|
|
72
59
|
isHomePage = _ref.isHomePage,
|
|
73
60
|
_ref$isAntVSite = _ref.isAntVSite,
|
|
@@ -78,43 +65,26 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
78
65
|
versions = _ref.versions,
|
|
79
66
|
internalSite = _ref.internalSite,
|
|
80
67
|
ecosystems = _ref.ecosystems,
|
|
81
|
-
|
|
68
|
+
announcement = _ref.announcement;
|
|
82
69
|
var isAntVHome = isAntVSite && isHomePage; // 是否为AntV官网首页
|
|
83
70
|
|
|
84
71
|
var _useState = useState(false),
|
|
85
72
|
_useState2 = _slicedToArray(_useState, 2),
|
|
86
73
|
bannerVisible = _useState2[0],
|
|
87
74
|
setBannerVisible = _useState2[1];
|
|
88
|
-
var _useState3 = useState(null),
|
|
89
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
90
|
-
banner = _useState4[0],
|
|
91
|
-
setBanner = _useState4[1];
|
|
92
75
|
useEffect(function () {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
html = _ref2.html;
|
|
96
|
-
if (id && html) {
|
|
97
|
-
setBanner({
|
|
98
|
-
id: id,
|
|
99
|
-
html: html
|
|
100
|
-
});
|
|
101
|
-
setBannerVisible(localStorage.getItem(id) !== 'x');
|
|
102
|
-
}
|
|
103
|
-
}).catch(function () {
|
|
104
|
-
setBanner(null);
|
|
105
|
-
setBannerVisible(false);
|
|
106
|
-
});
|
|
107
|
-
}, []);
|
|
76
|
+
setBannerVisible(localStorage.getItem(ANNOUNCEMENT_LOCALSTORAGE_ID) !== 'true');
|
|
77
|
+
}, [announcement]);
|
|
108
78
|
function onBannerClose() {
|
|
109
|
-
localStorage.setItem(
|
|
79
|
+
localStorage.setItem(ANNOUNCEMENT_LOCALSTORAGE_ID, 'true');
|
|
110
80
|
setBannerVisible(false);
|
|
111
81
|
}
|
|
112
82
|
var showChinaMirror = !!internalSite;
|
|
113
83
|
var chinaMirrorUrl = get(internalSite, 'url');
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
chinaMirrorHintVisible =
|
|
117
|
-
updateChinaMirrorHintVisible =
|
|
84
|
+
var _useState3 = useState(false),
|
|
85
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
86
|
+
chinaMirrorHintVisible = _useState4[0],
|
|
87
|
+
updateChinaMirrorHintVisible = _useState4[1];
|
|
118
88
|
useEffect(function () {
|
|
119
89
|
var timeout = setTimeout(function () {
|
|
120
90
|
if (showChinaMirror && lang === 'zh' && !localStorage.getItem('china-mirror-no-more-hint') && window.location.host.includes('antv.vision')) {
|
|
@@ -127,14 +97,14 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
127
97
|
});
|
|
128
98
|
var locale = useLocale();
|
|
129
99
|
var nav = useNavigate();
|
|
130
|
-
var
|
|
100
|
+
var _useState5 = useState(locale.id),
|
|
101
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
102
|
+
lang = _useState6[0],
|
|
103
|
+
setLang = _useState6[1];
|
|
104
|
+
var _useState7 = useState(false),
|
|
131
105
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var _useState9 = useState(false),
|
|
135
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
136
|
-
productMenuVisible = _useState10[0],
|
|
137
|
-
setProductMenuVisible = _useState10[1];
|
|
106
|
+
productMenuVisible = _useState8[0],
|
|
107
|
+
setProductMenuVisible = _useState8[1];
|
|
138
108
|
var productMenuHovering = false;
|
|
139
109
|
var onProductMouseEnter = function onProductMouseEnter(e) {
|
|
140
110
|
productMenuHovering = true;
|
|
@@ -158,10 +128,10 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
158
128
|
var onToggleProductMenuVisible = function onToggleProductMenuVisible() {
|
|
159
129
|
setProductMenuVisible(!productMenuVisible);
|
|
160
130
|
};
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
popupMenuVisible =
|
|
164
|
-
setPopupMenuVisible =
|
|
131
|
+
var _useState9 = useState(false),
|
|
132
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
133
|
+
popupMenuVisible = _useState10[0],
|
|
134
|
+
setPopupMenuVisible = _useState10[1];
|
|
165
135
|
var onTogglePopupMenuVisible = function onTogglePopupMenuVisible() {
|
|
166
136
|
setPopupMenuVisible(!popupMenuVisible);
|
|
167
137
|
};
|
|
@@ -212,9 +182,9 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
212
182
|
}) : null, /** 生态产品 */
|
|
213
183
|
size(ecosystems) ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
214
184
|
className: styles.ecoSystems,
|
|
215
|
-
overlay: /*#__PURE__*/React.createElement(Menu, null, map(ecosystems, function (
|
|
216
|
-
var url =
|
|
217
|
-
ecosystemName =
|
|
185
|
+
overlay: /*#__PURE__*/React.createElement(Menu, null, map(ecosystems, function (_ref2) {
|
|
186
|
+
var url = _ref2.url,
|
|
187
|
+
ecosystemName = _ref2.name;
|
|
218
188
|
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
219
189
|
key: ecosystemName === null || ecosystemName === void 0 ? void 0 : ecosystemName[lang]
|
|
220
190
|
}, /*#__PURE__*/React.createElement("a", {
|
|
@@ -273,7 +243,11 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
273
243
|
e.preventDefault();
|
|
274
244
|
redirectChinaMirror(chinaMirrorUrl);
|
|
275
245
|
}
|
|
276
|
-
}, ic(get(internalSite, 'name')), !isAntVHome && /*#__PURE__*/React.createElement(LinkOutlined,
|
|
246
|
+
}, ic(get(internalSite, 'name')), !isAntVHome && /*#__PURE__*/React.createElement(LinkOutlined, {
|
|
247
|
+
style: {
|
|
248
|
+
marginLeft: '6px'
|
|
249
|
+
}
|
|
250
|
+
})))) : null, showChinaMirror && !isWide && /*#__PURE__*/React.createElement(Modal, {
|
|
277
251
|
visible: chinaMirrorHintVisible,
|
|
278
252
|
cancelText: "\u4E0D\u518D\u63D0\u9192",
|
|
279
253
|
okText: "\u7ACB\u5373\u524D\u5F80",
|
|
@@ -301,13 +275,20 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
301
275
|
window.location.href = chinaMirrorUrl;
|
|
302
276
|
},
|
|
303
277
|
className: styles.remindHref
|
|
304
|
-
}, ic(get(internalSite, 'name')), /*#__PURE__*/React.createElement(LinkOutlined,
|
|
278
|
+
}, ic(get(internalSite, 'name')), /*#__PURE__*/React.createElement(LinkOutlined, {
|
|
279
|
+
style: {
|
|
280
|
+
marginLeft: '6px'
|
|
281
|
+
}
|
|
282
|
+
})), /*#__PURE__*/React.createElement("span", null, " \u7AD9\u70B9\u3002"))), /** 产品列表 */
|
|
305
283
|
showAntVProductsCard && /*#__PURE__*/React.createElement("li", productItemProps, /*#__PURE__*/React.createElement("a", null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
306
284
|
id: "\u6240\u6709\u4EA7\u54C1"
|
|
307
285
|
}), !isAntVHome ? /*#__PURE__*/React.createElement("img", {
|
|
308
286
|
src: "https://gw.alipayobjects.com/zos/antfincdn/FLrTNDvlna/antv.png",
|
|
309
287
|
alt: "antv logo arrow",
|
|
310
|
-
className: cx(styles.arrow, _defineProperty({}, styles.open, productMenuVisible))
|
|
288
|
+
className: cx(styles.arrow, _defineProperty({}, styles.open, productMenuVisible)),
|
|
289
|
+
style: {
|
|
290
|
+
marginLeft: '6px'
|
|
291
|
+
}
|
|
311
292
|
}) : /*#__PURE__*/React.createElement(CaretDownFilled, {
|
|
312
293
|
style: {
|
|
313
294
|
top: '1px',
|
|
@@ -345,8 +326,8 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
345
326
|
overlay: /*#__PURE__*/React.createElement(Menu, {
|
|
346
327
|
defaultSelectedKeys: [lang],
|
|
347
328
|
selectable: true,
|
|
348
|
-
onSelect: function onSelect(
|
|
349
|
-
var key =
|
|
329
|
+
onSelect: function onSelect(_ref3) {
|
|
330
|
+
var key = _ref3.key;
|
|
350
331
|
if (key === lang) {
|
|
351
332
|
return;
|
|
352
333
|
}
|
|
@@ -414,9 +395,29 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
414
395
|
target: "_blank",
|
|
415
396
|
rel: "noreferrer"
|
|
416
397
|
}, /*#__PURE__*/React.createElement(GithubOutlined, null))));
|
|
398
|
+
var announcementTitle = useMemo(function () {
|
|
399
|
+
return get(announcement, ['title', lang]);
|
|
400
|
+
}, [announcement, lang]);
|
|
401
|
+
var announcementLinkTitle = useMemo(function () {
|
|
402
|
+
return get(announcement, ['link', 'text', lang]);
|
|
403
|
+
}, [announcement, lang]);
|
|
417
404
|
return /*#__PURE__*/React.createElement("header", {
|
|
418
405
|
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.isAntVHome, !!isAntVHome), _defineProperty(_cx4, styles.fixed, popupMenuVisible), _cx4))
|
|
419
|
-
}, /*#__PURE__*/React.createElement(
|
|
406
|
+
}, bannerVisible && announcementTitle && /*#__PURE__*/React.createElement(Alert, {
|
|
407
|
+
className: styles.banner,
|
|
408
|
+
message: /*#__PURE__*/React.createElement("div", {
|
|
409
|
+
className: styles.topAlert
|
|
410
|
+
}, announcement.icon && /*#__PURE__*/React.createElement("img", {
|
|
411
|
+
src: announcement.icon
|
|
412
|
+
}), /*#__PURE__*/React.createElement("div", null, announcementTitle), announcementLinkTitle && /*#__PURE__*/React.createElement("a", {
|
|
413
|
+
href: announcement.link.url
|
|
414
|
+
}, announcementLinkTitle)),
|
|
415
|
+
type: "info",
|
|
416
|
+
banner: true,
|
|
417
|
+
closable: true,
|
|
418
|
+
showIcon: false,
|
|
419
|
+
onClose: onBannerClose
|
|
420
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
420
421
|
className: styles.container
|
|
421
422
|
}, /*#__PURE__*/React.createElement("div", {
|
|
422
423
|
className: styles.left
|
|
@@ -452,7 +453,8 @@ export var Header = function Header(props) {
|
|
|
452
453
|
versions = themeConfig.versions,
|
|
453
454
|
ecosystems = themeConfig.ecosystems,
|
|
454
455
|
navs = themeConfig.navs,
|
|
455
|
-
docsearchOptions = themeConfig.docsearchOptions
|
|
456
|
+
docsearchOptions = themeConfig.docsearchOptions,
|
|
457
|
+
announcement = themeConfig.announcement;
|
|
456
458
|
var searchOptions = {
|
|
457
459
|
docsearchOptions: docsearchOptions
|
|
458
460
|
};
|
|
@@ -479,7 +481,8 @@ export var Header = function Header(props) {
|
|
|
479
481
|
navs: navs,
|
|
480
482
|
searchOptions: searchOptions,
|
|
481
483
|
isHomePage: isHomePage,
|
|
482
|
-
transparent: isHomePage && isAntVSite
|
|
484
|
+
transparent: isHomePage && isAntVSite,
|
|
485
|
+
announcement: announcement
|
|
483
486
|
};
|
|
484
487
|
return /*#__PURE__*/React.createElement(HeaderComponent, Object.assign({}, headerProps, props));
|
|
485
488
|
};
|
|
@@ -382,6 +382,23 @@
|
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
+
|
|
386
|
+
.topAlert {
|
|
387
|
+
display: flex;
|
|
388
|
+
height: 22px;
|
|
389
|
+
justify-content: center;
|
|
390
|
+
align-items: center;
|
|
391
|
+
|
|
392
|
+
> img {
|
|
393
|
+
width: 16px;
|
|
394
|
+
height: 16px;
|
|
395
|
+
margin-right: 8px;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
> a {
|
|
399
|
+
margin-left: 8px;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
385
402
|
}
|
|
386
403
|
|
|
387
404
|
.remindHref {
|
|
@@ -12,6 +12,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12
12
|
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; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
import { MenuFoldOutlined, MenuUnfoldOutlined, VerticalAlignTopOutlined } from '@ant-design/icons';
|
|
15
|
+
import { get } from 'lodash';
|
|
15
16
|
import { Affix, BackTop, Layout, Menu } from 'antd';
|
|
16
17
|
import { useFullSidebarData, useLocale, useRouteMeta, useSiteData } from 'dumi';
|
|
17
18
|
import Drawer from 'rc-drawer';
|
|
@@ -100,8 +101,13 @@ export var ManualContent = function ManualContent(_ref) {
|
|
|
100
101
|
funllSidebarData[item.key] && ((_funllSidebarData$ite = funllSidebarData[item.key][0].children) === null || _funllSidebarData$ite === void 0 ? void 0 : _funllSidebarData$ite.forEach(function (itemChild) {
|
|
101
102
|
var label = itemChild.title;
|
|
102
103
|
var key = itemChild.link;
|
|
104
|
+
var tag = get(itemChild, ['frontmatter', 'tag']);
|
|
103
105
|
item.children.push(_objectSpread(_objectSpread({}, itemChild), {}, {
|
|
104
|
-
label:
|
|
106
|
+
label: tag ? /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
className: styles.memuLabel
|
|
108
|
+
}, label, /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
className: styles.tag
|
|
110
|
+
}, tag)) : label,
|
|
105
111
|
key: key
|
|
106
112
|
}));
|
|
107
113
|
}));
|
|
@@ -299,7 +305,7 @@ export var ManualContent = function ManualContent(_ref) {
|
|
|
299
305
|
}, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null))))))), is991Wide ? /*#__PURE__*/React.createElement(Layout.Sider, {
|
|
300
306
|
theme: "light",
|
|
301
307
|
width: 260
|
|
302
|
-
}, /*#__PURE__*/React.createElement(
|
|
308
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
303
309
|
className: styles.toc
|
|
304
310
|
}, /*#__PURE__*/React.createElement(ContentTable, null))) : /*#__PURE__*/React.createElement("div", null)));
|
|
305
311
|
};
|