@antv/dumi-theme-antv 0.4.5 → 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.
@@ -88,12 +88,18 @@
88
88
  "标准版基础产品": "Standard basic products",
89
89
  "标准版扩展产品": "Standard extended products",
90
90
  "移动定制(F版)产品": "Mobile (F series) products",
91
- "感谢信赖":"WE ARE TRUSTED BY",
92
- "更多产品":"More Productions",
93
- "上一篇":"Previous",
94
- "下一篇":"Next",
91
+ "感谢信赖": "WE ARE TRUSTED BY",
92
+ "更多产品": "More Productions",
93
+ "上一篇": "Previous",
94
+ "下一篇": "Next",
95
95
  "演示代码报错,请检查": "演示代码报错,请检查",
96
- "阅读时间约":"Reading needs",
97
- "分钟":"minutes",
98
- "没有找到查询结果":"No query result found"
96
+ "阅读时间约": "Reading needs",
97
+ "分钟": "minutes",
98
+ "没有找到查询结果": "No query result found",
99
+ "企业级 UI 设计语言": "Enterprise UI design language",
100
+ "知识创作与分享工具": "Knowledge creation and Sharing tool",
101
+ "语雀": "Yuque",
102
+ "企业级 Node 开发框架": "Enterprise-class Node development framework",
103
+ "Sketch 工具集": "Sketch Tool set",
104
+ "蚂蚁体验科技": "Liven Experience technology"
99
105
  }
@@ -93,7 +93,13 @@
93
93
  "上一篇": "上一篇",
94
94
  "下一篇": "下一篇",
95
95
  "演示代码报错,请检查": "演示代码报错,请检查",
96
- "阅读时间约":"阅读时间约",
97
- "分钟":"分钟",
98
- "没有找到查询结果":"没有找到查询结果"
96
+ "阅读时间约": "阅读时间约",
97
+ "分钟": "分钟",
98
+ "没有找到查询结果": "没有找到查询结果",
99
+ "企业级 UI 设计语言": "企业级 UI 设计语言",
100
+ "知识创作与分享工具": "知识创作与分享工具",
101
+ "语雀": "语雀",
102
+ "企业级 Node 开发框架": "企业级 Node 开发框架",
103
+ "Sketch 工具集": "Sketch 工具集",
104
+ "蚂蚁体验科技": "蚂蚁体验科技"
99
105
  }
@@ -6,5 +6,7 @@ export interface NewsProps {
6
6
  title: IC;
7
7
  date: string;
8
8
  link: string;
9
+ subTitle?: string;
10
+ img?: string;
9
11
  }
10
12
  export declare const News: React.FC<NewsProps>;
@@ -9,6 +9,8 @@ export var News = function News(_ref) {
9
9
  type = _ref.type,
10
10
  title = _ref.title,
11
11
  date = _ref.date,
12
+ subTitle = _ref.subTitle,
13
+ img = _ref.img,
12
14
  _ref$link = _ref.link,
13
15
  link = _ref$link === void 0 ? '' : _ref$link;
14
16
  var lang = useLocale().id;
@@ -18,9 +20,14 @@ export var News = function News(_ref) {
18
20
  className: styles.content
19
21
  }, /*#__PURE__*/React.createElement("p", {
20
22
  className: styles.description
21
- }, ic(type), " \u2027 ", ic(title)), /*#__PURE__*/React.createElement("p", {
23
+ }, img && /*#__PURE__*/React.createElement("img", {
24
+ src: img,
25
+ alt: "message_title"
26
+ }), type ? "".concat(ic(type), " \u2027 ") : '', ic(title)), date && /*#__PURE__*/React.createElement("p", {
22
27
  className: styles.date
23
- }, date)));
28
+ }, date), subTitle && /*#__PURE__*/React.createElement("p", {
29
+ className: styles.subTitle
30
+ }, ic(subTitle))));
24
31
  if (link.startsWith('http')) {
25
32
  return /*#__PURE__*/React.createElement("a", {
26
33
  href: link,
@@ -32,14 +32,24 @@
32
32
  font-weight: 500;
33
33
  font-size: 20px;
34
34
  text-align: center;
35
+ position: relative;
36
+
37
+ >img {
38
+ width: 24px;
39
+ height: 24px;
40
+ position: relative;
41
+ top: -2px;
42
+ left: -4px;
43
+ }
35
44
  }
36
45
 
37
- .date {
46
+ .date,.subTitle {
38
47
  color: #424E66;
39
48
  bottom: 0;
40
49
  font-size: 1em;
41
50
  margin-top: 4px;
42
51
  margin-bottom: 0;
52
+ text-align: center;
43
53
  }
44
54
  }
45
55
  }
@@ -55,12 +65,17 @@
55
65
  width: 100%;
56
66
 
57
67
  &:nth-child(1) {
58
- animation: showAndHide0 6s infinite;
68
+ animation: showAndHide0 9s infinite;
59
69
  }
60
70
 
61
71
  &:nth-child(2) {
62
72
  top: 44px;
63
- animation: showAndHide1 6s infinite;
73
+ animation: showAndHide1 9s infinite;
74
+ }
75
+
76
+ &:nth-child(3) {
77
+ top: 44px;
78
+ animation: showAndHide2 9s infinite;
64
79
  }
65
80
  }
66
81
  }
@@ -79,18 +94,12 @@
79
94
  }
80
95
 
81
96
  33.3% {
82
- opacity: 1;
83
- top: 0px;
84
- z-index: 1;
85
- }
86
-
87
- 50% {
88
97
  opacity: 0;
89
- top: -30px;
98
+ top: 0px;
90
99
  z-index: 0;
91
100
  }
92
101
 
93
- 83.3% {
102
+ 66.6% {
94
103
  opacity: 0;
95
104
  top: 30px;
96
105
  z-index: 0;
@@ -103,7 +112,6 @@
103
112
  }
104
113
  }
105
114
 
106
- /* Standard syntax */
107
115
  @keyframes showAndHide1 {
108
116
  0% {
109
117
  opacity: 0;
@@ -112,18 +120,38 @@
112
120
  }
113
121
 
114
122
  33.3% {
123
+ opacity: 1;
124
+ top: 0px;
125
+ z-index: 1;
126
+ }
127
+
128
+ 66.6% {
129
+ opacity: 0;
130
+ top: 0px;
131
+ z-index: 0;
132
+ }
133
+
134
+ 100% {
115
135
  opacity: 0;
116
136
  top: 30px;
117
137
  z-index: 0;
118
138
  }
139
+ }
119
140
 
120
- 50% {
121
- opacity: 1;
122
- top: 0px;
123
- z-index: 1;
141
+ @keyframes showAndHide2 {
142
+ 0% {
143
+ opacity: 0;
144
+ top: 30px;
145
+ z-index: 0;
124
146
  }
125
147
 
126
- 83.3% {
148
+ 33.3% {
149
+ opacity: 0;
150
+ top: 30px;
151
+ z-index: 0;
152
+ }
153
+
154
+ 66.6% {
127
155
  opacity: 1;
128
156
  top: 0px;
129
157
  z-index: 1;
@@ -131,7 +159,8 @@
131
159
 
132
160
  100% {
133
161
  opacity: 0;
134
- top: -30px;
162
+ top: 0px;
135
163
  z-index: 0;
136
164
  }
137
165
  }
166
+
@@ -22,8 +22,6 @@ import { useLocale } from 'dumi/dist/client/theme-api';
22
22
  import { ic } from "../hooks";
23
23
  import { News } from "./News";
24
24
  import styles from "./index.module.less";
25
- var AssetsNewsURL = 'https://assets.antv.antgroup.com/antv/news.json';
26
-
27
25
  /**
28
26
  * Index.技术栈的描述区域!
29
27
  * 各自配置
@@ -49,7 +47,7 @@ export var Detail = function Detail(_ref) {
49
47
  setRemoteNews = _useState2[1];
50
48
  var lang = useLocale().id;
51
49
  useEffect(function () {
52
- fetch(AssetsNewsURL).then(function (res) {
50
+ fetch('https://site-data-pre.alipay.com/antv/banner-messages.json').then(function (res) {
53
51
  return res.json();
54
52
  }).then(function (data) {
55
53
  setRemoteNews(data);
@@ -107,7 +105,7 @@ export var Detail = function Detail(_ref) {
107
105
  repo: githubObj.name
108
106
  })))), /*#__PURE__*/React.createElement("div", {
109
107
  className: cx(styles.news, 'news')
110
- }, (news || remoteNews).slice(0, 2).map(function (n, i) {
108
+ }, (news || remoteNews).slice(0, 3).map(function (n, i) {
111
109
  return /*#__PURE__*/React.createElement(News, _extends({
112
110
  key: i,
113
111
  index: i
@@ -66,11 +66,17 @@
66
66
  font-family: AlibabaPuHuiTiR;
67
67
  font-size: 18px;
68
68
  color: #424E66;
69
+ max-height: 145px;
70
+ overflow: hidden;
71
+ text-overflow: ellipsis;
72
+ -webkit-line-clamp: 4;
73
+ display: -webkit-box;
74
+ -webkit-box-orient: vertical;
69
75
  }
70
76
 
71
77
  .buttons {
72
78
  display: flex;
73
- margin-top: 5.56%;
79
+ margin-top: max(3%, 40px);
74
80
 
75
81
  .buttonLink {
76
82
  display: flex;
@@ -83,7 +89,8 @@
83
89
  transition: all 0.3s;
84
90
  text-align: center;
85
91
  height: 54px;
86
- width: 166px;
92
+ min-width: 166px;
93
+ padding: 0 10px;
87
94
  box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.10);
88
95
  background-color: #691EFF;
89
96
  font-size: 18px;
@@ -194,10 +201,10 @@
194
201
  .news {
195
202
  width: 100%;
196
203
  display: flex;
197
- bottom: 40px;
204
+ bottom: 30px;
198
205
  position: absolute;
199
206
  z-index: 3;
200
- height: 108px;
207
+ height: 128px;
201
208
  box-sizing: border-box;
202
209
  padding: 0 4.5%;
203
210
  }
@@ -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: '企业级 UI 设计语言',
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: '企业级 Node 开发框架',
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: 'Sketch 工具集',
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, null)))) : /*#__PURE__*/React.createElement("li", {
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
- function fetchBanner() {
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
- searchOptions = _ref.searchOptions;
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
- fetchBanner().then(function (_ref2) {
94
- var id = _ref2.id,
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(banner.id, 'x');
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 _useState5 = useState(false),
115
- _useState6 = _slicedToArray(_useState5, 2),
116
- chinaMirrorHintVisible = _useState6[0],
117
- updateChinaMirrorHintVisible = _useState6[1];
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 _useState7 = useState(locale.id),
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
- lang = _useState8[0],
133
- setLang = _useState8[1];
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 _useState11 = useState(false),
162
- _useState12 = _slicedToArray(_useState11, 2),
163
- popupMenuVisible = _useState12[0],
164
- setPopupMenuVisible = _useState12[1];
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 (_ref3) {
216
- var url = _ref3.url,
217
- ecosystemName = _ref3.name;
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, null)))) : null, showChinaMirror && !isWide && /*#__PURE__*/React.createElement(Modal, {
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, null)), /*#__PURE__*/React.createElement("span", null, " \u7AD9\u70B9\u3002"))), /** 产品列表 */
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(_ref4) {
349
- var key = _ref4.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("div", {
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: 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(Affix, {
308
+ }, /*#__PURE__*/React.createElement("div", {
303
309
  className: styles.toc
304
310
  }, /*#__PURE__*/React.createElement(ContentTable, null))) : /*#__PURE__*/React.createElement("div", null)));
305
311
  };
@@ -76,7 +76,7 @@
76
76
  margin: 0.6em 0;
77
77
  }
78
78
 
79
- pre > code[class*='language-'] {
79
+ pre>code[class*='language-'] {
80
80
  line-height: 1.8;
81
81
  }
82
82
 
@@ -125,7 +125,7 @@
125
125
  padding: 0;
126
126
  }
127
127
 
128
- ul:not(:global(.ant-skeleton-paragraph)) > li {
128
+ ul:not(:global(.ant-skeleton-paragraph))>li {
129
129
  margin-left: 20px;
130
130
  padding-left: 4px;
131
131
  list-style-type: circle;
@@ -135,14 +135,14 @@
135
135
  }
136
136
  }
137
137
 
138
- ol > li {
138
+ ol>li {
139
139
  margin-left: 20px;
140
140
  padding-left: 4px;
141
141
  list-style-type: decimal;
142
142
  }
143
143
 
144
- ul > li > p,
145
- ol > li > p {
144
+ ul>li>p,
145
+ ol>li>p {
146
146
  margin: 0.2em 0;
147
147
  }
148
148
 
@@ -201,8 +201,8 @@
201
201
  margin: 0;
202
202
  }
203
203
 
204
- > br,
205
- > p > br {
204
+ >br,
205
+ >p>br {
206
206
  clear: both;
207
207
  }
208
208
 
@@ -228,14 +228,14 @@
228
228
  .contentReset() {
229
229
  min-height: 400px;
230
230
 
231
- > img,
232
- > p > img {
231
+ >img,
232
+ >p>img {
233
233
  max-width: 100%;
234
234
  margin: 0.5em 0;
235
235
  }
236
236
 
237
- > br,
238
- > p > br {
237
+ >br,
238
+ >p>br {
239
239
  clear: both;
240
240
  }
241
241
  }
@@ -274,6 +274,7 @@
274
274
  }
275
275
  }
276
276
  }
277
+
277
278
  .contentTitle {
278
279
  margin-top: 8px;
279
280
  margin-bottom: 20px;
@@ -282,6 +283,7 @@
282
283
  font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
283
284
  line-height: 38px;
284
285
  }
286
+
285
287
  .sider {
286
288
  width: 280px !important;
287
289
  height: inherit;
@@ -299,9 +301,27 @@
299
301
  }
300
302
 
301
303
  .affix {
302
- & > div {
304
+ &>div {
303
305
  height: 100%;
304
306
  }
307
+
308
+ .memuLabel {
309
+ display: flex;
310
+ align-items: center;
311
+
312
+ .tag {
313
+ position: absolute;
314
+ right: 20px;
315
+ background: #f9f0ff;
316
+ color: #873bf4;
317
+ border: 1px solid #873bf4;
318
+ border-radius: 8px;
319
+ height: 22px;
320
+ font-size: 12px !important;
321
+ padding: 0 8px;
322
+ line-height: 20px;
323
+ }
324
+ }
305
325
  }
306
326
 
307
327
  .menuIcon {
@@ -384,7 +404,7 @@
384
404
  transition: all 0.3s;
385
405
  margin: 12px;
386
406
 
387
- > div {
407
+ >div {
388
408
  border: 1px solid @border-color-split;
389
409
  border-radius: 6px;
390
410
  overflow: hidden;
@@ -403,7 +423,7 @@
403
423
  }
404
424
  }
405
425
 
406
- &:hover > div {
426
+ &:hover>div {
407
427
  transform: translateY(-4px);
408
428
  border-color: transparent;
409
429
  box-shadow: 0 6px 16px rgba(107, 147, 224, 0.14);
@@ -492,10 +512,11 @@
492
512
  padding-right: 32px;
493
513
  }
494
514
  }
515
+
495
516
  .tocSiderbar {
496
- display: none;
517
+ display: none;
497
518
  }
498
-
519
+
499
520
  .gallery {
500
521
  .galleryCard {
501
522
  width: 50%;
@@ -604,7 +625,7 @@
604
625
  color: #868484;
605
626
  background-color: #fff;
606
627
  box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
607
- 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
628
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
608
629
  transition: color 0.3s;
609
630
  width: 44px;
610
631
  height: 44px;
@@ -672,4 +693,4 @@
672
693
  transition: all .3s;
673
694
  background-color: #fff;
674
695
  font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
675
- }
696
+ }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@antv/dumi-theme-antv",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "AntV website theme based on dumi2.",
5
5
  "types": "dist/types.d.ts",
6
6
  "scripts": {
7
+ "start": "cd example && npm run start",
7
8
  "dev": "father dev",
8
- "dev:example-site": "cd example && npm run start",
9
9
  "build": "npm run prepare && father build",
10
10
  "prepare": "father link-dev-theme",
11
11
  "lint": "npm run lint:es && npm run lint:css",