@antv/dumi-theme-antv 0.5.4-beta.1 → 0.5.4-beta.2
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/README.md +6 -2
- package/dist/hooks/useMenu.js +1 -3
- package/dist/pages/404.js +1 -1
- package/dist/pages/Examples/components/Accouncement/index.js +3 -3
- package/dist/pages/Examples/components/Article/index.js +1 -1
- package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +3 -3
- package/dist/pages/Examples/components/ExampleTopicMenu/index.js +3 -3
- package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +3 -4
- package/dist/pages/Examples/components/GalleryPageContent/index.js +3 -3
- package/dist/pages/Examples/index.js +9 -10
- package/dist/pages/Examples/index.module.less +1 -2
- package/dist/plugin/examples.js +1 -5
- package/dist/plugin/index.js +3 -9
- package/dist/slots/404.js +2 -2
- package/dist/slots/API/index.js +2 -2
- package/dist/slots/API/index.module.less +20 -14
- package/dist/slots/Article/index.js +1 -1
- package/dist/slots/Banner/Notification.js +1 -1
- package/dist/slots/Banner/index.js +4 -4
- package/dist/slots/Banner/index.module.less +2 -4
- package/dist/slots/Cases/index.js +4 -5
- package/dist/slots/Cases/index.module.less +1 -1
- package/dist/slots/CodeEditor/Toolbar.module.less +5 -4
- package/dist/slots/CodeEditor/index.module.less +1 -1
- package/dist/slots/CodePreview/CodeHeader.js +1 -1
- package/dist/slots/CodePreview/index.js +1 -1
- package/dist/slots/CodePreview/index.module.less +5 -4
- package/dist/slots/CodeRunner/index.js +4 -4
- package/dist/slots/Companies/index.js +2 -2
- package/dist/slots/Companies/index.module.less +1 -1
- package/dist/slots/ContentTable/index.module.less +5 -5
- package/dist/slots/Detail/News.js +1 -1
- package/dist/slots/Detail/News.module.less +10 -10
- package/dist/slots/Detail/index.js +2 -2
- package/dist/slots/Detail/index.module.less +16 -16
- package/dist/slots/ExampleSider/index.js +6 -6
- package/dist/slots/Features/FeatureCard.js +1 -1
- package/dist/slots/Features/FeatureCard.module.less +3 -3
- package/dist/slots/Features/index.js +3 -3
- package/dist/slots/Features/index.module.less +4 -4
- package/dist/slots/Footer/index.js +8 -9
- package/dist/slots/Footer/index.module.less +5 -5
- package/dist/slots/Header/Navs.js +5 -5
- package/dist/slots/Header/Products/NavigatorBanner.js +2 -2
- package/dist/slots/Header/Products/NavigatorBanner.module.less +1 -1
- package/dist/slots/Header/Products/Product.module.less +4 -4
- package/dist/slots/Header/Products/index.js +4 -4
- package/dist/slots/Header/Search/SearchResult.js +3 -3
- package/dist/slots/Header/Search/SearchResult.module.less +1 -1
- package/dist/slots/Header/Search/helper.js +18 -5
- package/dist/slots/Header/Search/index.js +10 -4
- package/dist/slots/Header/index.js +9 -9
- package/dist/slots/Header/index.module.less +10 -12
- package/dist/slots/Header/utils.js +3 -3
- package/dist/slots/Loading/index.module.less +9 -9
- package/dist/slots/ManualContent/NavigatorBanner.js +3 -3
- package/dist/slots/ManualContent/NavigatorBanner.module.less +1 -1
- package/dist/slots/ManualContent/Preview.module.less +1 -3
- package/dist/slots/ManualContent/ReadingTime.js +2 -2
- package/dist/slots/ManualContent/index.module.less +5 -34
- package/dist/slots/ManualContent/utils.js +9 -9
- package/dist/slots/_.less +1 -2
- package/dist/slots/global.js +1 -1
- package/dist/slots/hooks.js +3 -3
- package/dist/typings.d.ts +5 -5
- package/package.json +4 -1
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
font-family: AlibabaPuHuiTiRHeavy;
|
|
52
52
|
|
|
53
53
|
.engine {
|
|
54
|
-
color: #
|
|
54
|
+
color: #691eff;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
max-width: 700px;
|
|
66
66
|
font-family: AlibabaPuHuiTiR;
|
|
67
67
|
font-size: 18px;
|
|
68
|
-
color: #
|
|
68
|
+
color: #424e66;
|
|
69
69
|
max-height: 145px;
|
|
70
70
|
overflow: hidden;
|
|
71
71
|
text-overflow: ellipsis;
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
height: 54px;
|
|
92
92
|
min-width: 166px;
|
|
93
93
|
padding: 0 10px;
|
|
94
|
-
box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.
|
|
95
|
-
background-color: #
|
|
94
|
+
box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.1);
|
|
95
|
+
background-color: #691eff;
|
|
96
96
|
font-size: 18px;
|
|
97
97
|
cursor: pointer;
|
|
98
98
|
box-shadow: 0 8px 28px 0 #f2f2f2;
|
|
99
99
|
margin-right: 20px;
|
|
100
|
-
color: #
|
|
100
|
+
color: #ffffff;
|
|
101
101
|
overflow: hidden;
|
|
102
102
|
|
|
103
103
|
.icon {
|
|
@@ -113,9 +113,9 @@
|
|
|
113
113
|
|
|
114
114
|
&.primary {
|
|
115
115
|
color: #fff;
|
|
116
|
-
background-color: #
|
|
116
|
+
background-color: #ffffff;
|
|
117
117
|
color: #000;
|
|
118
|
-
border: 1px solid #
|
|
118
|
+
border: 1px solid #e8e8e8;
|
|
119
119
|
|
|
120
120
|
.icon {
|
|
121
121
|
position: relative;
|
|
@@ -123,11 +123,11 @@
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
&:hover {
|
|
126
|
-
color: #
|
|
126
|
+
color: #691eff;
|
|
127
127
|
|
|
128
128
|
.icon {
|
|
129
129
|
left: -80px;
|
|
130
|
-
filter: drop-shadow(#
|
|
130
|
+
filter: drop-shadow(#691eff 80px 0);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -142,8 +142,8 @@
|
|
|
142
142
|
height: 54px;
|
|
143
143
|
cursor: pointer;
|
|
144
144
|
box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.05);
|
|
145
|
-
background-color: #
|
|
146
|
-
border: 1px solid #
|
|
145
|
+
background-color: #ffffff;
|
|
146
|
+
border: 1px solid #e8e8e8;
|
|
147
147
|
justify-content: center;
|
|
148
148
|
align-items: center;
|
|
149
149
|
border-radius: 12px;
|
|
@@ -152,13 +152,13 @@
|
|
|
152
152
|
|
|
153
153
|
&:hover {
|
|
154
154
|
.gh-btn {
|
|
155
|
-
|
|
156
|
-
filter: drop-shadow(#
|
|
155
|
+
> .gh-ico {
|
|
156
|
+
filter: drop-shadow(#691eff 80px 0);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
.gh-count {
|
|
161
|
-
color: #
|
|
161
|
+
color: #691eff;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
background-repeat: no-repeat;
|
|
174
174
|
position: relative;
|
|
175
175
|
left: -80px;
|
|
176
|
-
filter: drop-shadow(#
|
|
176
|
+
filter: drop-shadow(#1d2129 80px 0);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
.gh-text {
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
position: relative;
|
|
189
189
|
font-size: 18px;
|
|
190
190
|
margin-left: -8px;
|
|
191
|
-
color: #
|
|
191
|
+
color: #1d2129;
|
|
192
192
|
letter-spacing: 0;
|
|
193
193
|
font-family: AlibabaSans102-Medium;
|
|
194
194
|
}
|
|
@@ -10,12 +10,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
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
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
14
|
-
import { Input, Menu, Tooltip } from 'antd';
|
|
15
|
-
import { useLocale, FormattedMessage, useIntl } from 'dumi';
|
|
16
|
-
import { cloneDeep } from 'lodash-es';
|
|
17
13
|
import { createFromIconfontCN, SearchOutlined, VerticalAlignTopOutlined } from '@ant-design/icons';
|
|
14
|
+
import { Input, Menu, Tooltip } from 'antd';
|
|
18
15
|
import classNames from 'classnames';
|
|
16
|
+
import { FormattedMessage, useIntl, useLocale } from 'dumi';
|
|
17
|
+
import { cloneDeep } from 'lodash-es';
|
|
18
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
19
19
|
import { filterTreeNode } from "../utils";
|
|
20
20
|
import styles from "./index.module.less";
|
|
21
21
|
|
|
@@ -55,8 +55,8 @@ export var ExampleSider = function ExampleSider(props) {
|
|
|
55
55
|
id: 'FAKE_ID',
|
|
56
56
|
childrenKey: 'exampleTopics',
|
|
57
57
|
title: {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
zh: 'FAKE_TITLE',
|
|
59
|
+
en: 'FAKE_TITLE'
|
|
60
60
|
},
|
|
61
61
|
exampleTopics: cloneDeep(exampleTopics)
|
|
62
62
|
}, searchValue, locale.id);
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
color: #000;
|
|
21
21
|
margin-top: 28px;
|
|
22
22
|
margin-bottom: 11px;
|
|
23
|
-
font-family:
|
|
24
|
-
color: #
|
|
23
|
+
font-family: AlibabaPuHuiTiM;
|
|
24
|
+
color: #1d2129;
|
|
25
25
|
text-align: center;
|
|
26
26
|
line-height: 32px;
|
|
27
27
|
}
|
|
@@ -64,4 +64,4 @@
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
}
|
|
67
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Row, Col } from 'antd';
|
|
1
|
+
import { Col, Row } from 'antd';
|
|
3
2
|
import cx from 'classnames';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ic } from "../hooks";
|
|
4
5
|
import FeatureCard from "./FeatureCard";
|
|
5
6
|
import styles from "./index.module.less";
|
|
6
|
-
import { ic } from "../hooks";
|
|
7
7
|
export var Features = function Features(_ref) {
|
|
8
8
|
var title = _ref.title,
|
|
9
9
|
_ref$features = _ref.features,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
font-family: AlibabaPuHuiTiB;
|
|
27
27
|
font-size: 40px;
|
|
28
28
|
text-align: center;
|
|
29
|
-
color: #
|
|
29
|
+
color: #1d2129;
|
|
30
30
|
height: min-content;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
|
|
47
47
|
.cardWrapper {
|
|
48
48
|
margin: 48px 0 30px 0;
|
|
49
|
-
background-color: #
|
|
50
|
-
border: 1px solid #
|
|
49
|
+
background-color: #ffffff;
|
|
50
|
+
border: 1px solid #e5e8ef;
|
|
51
51
|
box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.03);
|
|
52
52
|
border-radius: 16px;
|
|
53
53
|
overflow: hidden;
|
|
@@ -91,4 +91,4 @@
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
}
|
|
94
|
+
}
|
|
@@ -6,13 +6,12 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
8
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
|
-
import
|
|
10
|
-
import { default as
|
|
11
|
-
import {
|
|
12
|
-
import cx from 'classnames';
|
|
9
|
+
import { GithubOutlined, QuestionCircleOutlined, WeiboOutlined, ZhihuOutlined } from '@ant-design/icons';
|
|
10
|
+
import { default as classnames, default as cx } from 'classnames';
|
|
11
|
+
import { FormattedMessage, useLocale, useSiteData } from 'dumi';
|
|
13
12
|
import { omit } from 'lodash-es';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
13
|
+
import { default as RCFooter } from 'rc-footer';
|
|
14
|
+
import React from 'react';
|
|
16
15
|
import 'rc-footer/assets/index.less';
|
|
17
16
|
import styles from "./index.module.less";
|
|
18
17
|
/**
|
|
@@ -178,8 +177,8 @@ export var Footer = function Footer(props) {
|
|
|
178
177
|
height: 16,
|
|
179
178
|
alt: "Galacean"
|
|
180
179
|
}),
|
|
181
|
-
title:
|
|
182
|
-
description:
|
|
180
|
+
title: 'Galacean',
|
|
181
|
+
description: '互动图形解决方案',
|
|
183
182
|
url: 'https://galacean.antgroup.com/',
|
|
184
183
|
openExternal: true
|
|
185
184
|
}, {
|
|
@@ -219,7 +218,7 @@ export var Footer = function Footer(props) {
|
|
|
219
218
|
href: "".concat(rootDomain, "/").concat(lang, "/about")
|
|
220
219
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
221
220
|
id: "\u5173\u4E8E\u6211\u4EEC"
|
|
222
|
-
}))), /*#__PURE__*/React.createElement("div", null, "\xA9 ", new Date().getFullYear(), " Made with \u2764 by",
|
|
221
|
+
}))), /*#__PURE__*/React.createElement("div", null, "\xA9 ", new Date().getFullYear(), " Made with \u2764 by ", /*#__PURE__*/React.createElement("a", {
|
|
223
222
|
href: "https://xtech.antfin.com/"
|
|
224
223
|
}, "AntV")))))
|
|
225
224
|
}, omit(restProps, ['githubUrl'])));
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
:global(.rc-footer-bottom-container) {
|
|
13
|
-
border-top: 4px solid #
|
|
13
|
+
border-top: 4px solid #f0f2ff;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
&.light {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
>a:hover {
|
|
25
|
-
color: #
|
|
24
|
+
> a:hover {
|
|
25
|
+
color: #691eff;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
&.light {
|
|
80
80
|
:global(.anticon),
|
|
81
81
|
a {
|
|
82
|
-
color: #
|
|
82
|
+
color: #424e66;
|
|
83
83
|
|
|
84
84
|
&:hover {
|
|
85
|
-
color: #
|
|
85
|
+
color: #691eff;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -2,14 +2,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
-
import
|
|
5
|
+
import { DownOutlined, LinkOutlined } from '@ant-design/icons';
|
|
6
|
+
import { Dropdown, Menu } from 'antd';
|
|
6
7
|
import cx from 'classnames';
|
|
7
|
-
import { size } from 'lodash-es';
|
|
8
8
|
import { Link, useLocale } from 'dumi';
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import { getNavCategory } from "./utils";
|
|
9
|
+
import { size } from 'lodash-es';
|
|
10
|
+
import React from 'react';
|
|
12
11
|
import styles from "./index.module.less";
|
|
12
|
+
import { getNavCategory } from "./utils";
|
|
13
13
|
/**
|
|
14
14
|
* Header 中的导航菜单
|
|
15
15
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import classNames from 'classnames';
|
|
3
|
-
import {
|
|
2
|
+
import { FormattedMessage, Link } from 'dumi';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import styles from "./NavigatorBanner.module.less";
|
|
5
5
|
var NavigatorBanner = function NavigatorBanner(_ref) {
|
|
6
6
|
var post = _ref.post,
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
height: auto !important;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
&.show
|
|
35
|
+
&.show + .mask {
|
|
36
36
|
opacity: 1;
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
top: 102px;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
&.bannerVisible
|
|
44
|
+
&.bannerVisible + .mask {
|
|
45
45
|
top: 102px;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.productLinks {
|
|
111
|
-
>a {
|
|
111
|
+
> a {
|
|
112
112
|
margin-right: 12px;
|
|
113
113
|
font-size: 12px;
|
|
114
114
|
line-height: 20px;
|
|
@@ -154,4 +154,4 @@
|
|
|
154
154
|
padding-right: 0;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
}
|
|
157
|
+
}
|
|
@@ -8,13 +8,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
9
|
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; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import React from 'react';
|
|
12
11
|
import cx from 'classnames';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import { CATEGORIES, getNewProducts } from "./getProducts";
|
|
12
|
+
import { FormattedMessage, useLocale } from 'dumi';
|
|
13
|
+
import React from 'react';
|
|
16
14
|
import { useChinaMirrorHost } from "../../hooks";
|
|
15
|
+
import Product from "./Product";
|
|
17
16
|
import styles from "./Product.module.less";
|
|
17
|
+
import { CATEGORIES, getNewProducts } from "./getProducts";
|
|
18
18
|
export var Products = function Products(_ref) {
|
|
19
19
|
var show = _ref.show,
|
|
20
20
|
language = _ref.language,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useIntl } from 'dumi';
|
|
3
1
|
import { InboxOutlined } from '@ant-design/icons';
|
|
2
|
+
import { useIntl } from 'dumi';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import styles from "./SearchResult.module.less";
|
|
5
5
|
var getHighlightInfo = function getHighlightInfo(textSegments) {
|
|
6
6
|
return /*#__PURE__*/React.createElement(React.Fragment, null, textSegments.map(function (segment) {
|
|
@@ -31,7 +31,7 @@ export var SearchResult = function SearchResult(_ref) {
|
|
|
31
31
|
href: r.link
|
|
32
32
|
}, /*#__PURE__*/React.createElement("div", {
|
|
33
33
|
className: styles.title
|
|
34
|
-
}, getHighlightInfo(r.
|
|
34
|
+
}, getHighlightInfo(r.title)), /*#__PURE__*/React.createElement("div", {
|
|
35
35
|
className: styles.description
|
|
36
36
|
}, getHighlightInfo(r.description))));
|
|
37
37
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* dumi 搜索结果转页面 UI 的数据结构,默认取 30 条
|
|
3
3
|
* @param dumiResult
|
|
4
4
|
* @param limit
|
|
5
|
-
* @returns
|
|
5
|
+
* @returns
|
|
6
6
|
*/
|
|
7
7
|
export function getSearchResults(dumiResults) {
|
|
8
8
|
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30;
|
|
9
|
-
var
|
|
9
|
+
var sort = arguments.length > 2 ? arguments[2] : undefined;
|
|
10
|
+
var flattenHints = dumiResults.flatMap(function (r) {
|
|
10
11
|
return r.hints;
|
|
11
|
-
}).
|
|
12
|
-
return hints.slice(0, limit).map(function (_ref) {
|
|
12
|
+
}).map(function (_ref) {
|
|
13
13
|
var _ref$pageTitle = _ref.pageTitle,
|
|
14
14
|
pageTitle = _ref$pageTitle === void 0 ? '' : _ref$pageTitle,
|
|
15
15
|
highlightTitleTexts = _ref.highlightTitleTexts,
|
|
@@ -18,8 +18,21 @@ export function getSearchResults(dumiResults) {
|
|
|
18
18
|
return {
|
|
19
19
|
link: link,
|
|
20
20
|
subject: pageTitle,
|
|
21
|
-
|
|
21
|
+
title: highlightTitleTexts,
|
|
22
22
|
description: highlightTexts
|
|
23
23
|
};
|
|
24
24
|
});
|
|
25
|
+
var sorted = sort ? flattenHints.sort(function (a, b) {
|
|
26
|
+
var isMatch = function isMatch(a) {
|
|
27
|
+
return sort.some(function (pattern) {
|
|
28
|
+
return pattern.startsWith('!') ? !a.link.includes(pattern.slice(1)) : a.link.includes(pattern);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
var linkA = isMatch(a);
|
|
32
|
+
var linkB = isMatch(b);
|
|
33
|
+
if (linkA && !linkB) return -1;
|
|
34
|
+
if (!linkA && linkB) return 1;
|
|
35
|
+
return 0;
|
|
36
|
+
}) : flattenHints;
|
|
37
|
+
return sorted.slice(0, limit);
|
|
25
38
|
}
|
|
@@ -4,10 +4,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
5
|
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; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useEffect, useState, useMemo } from 'react';
|
|
8
|
-
import { Popover } from 'antd';
|
|
9
|
-
import { useIntl, useSiteSearch } from 'dumi';
|
|
10
7
|
import { SearchOutlined } from '@ant-design/icons';
|
|
8
|
+
import { Popover } from 'antd';
|
|
9
|
+
import { useIntl, useSiteData, useSiteSearch } from 'dumi';
|
|
10
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
11
11
|
import { SearchResult } from "./SearchResult";
|
|
12
12
|
import { getSearchResults } from "./helper";
|
|
13
13
|
import styles from "./index.module.less";
|
|
@@ -17,6 +17,12 @@ export var Search = function Search() {
|
|
|
17
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18
18
|
open = _useState2[0],
|
|
19
19
|
setOpen = _useState2[1];
|
|
20
|
+
var _useSiteData = useSiteData(),
|
|
21
|
+
themeConfig = _useSiteData.themeConfig;
|
|
22
|
+
var _themeConfig$docsearc = themeConfig.docsearchOptions,
|
|
23
|
+
_themeConfig$docsearc2 = _themeConfig$docsearc === void 0 ? {} : _themeConfig$docsearc,
|
|
24
|
+
sort = _themeConfig$docsearc2.sort;
|
|
25
|
+
|
|
20
26
|
// useSiteSearch 错误 keywords 为空时 loading 为 true
|
|
21
27
|
var _useSiteSearch = useSiteSearch(),
|
|
22
28
|
keywords = _useSiteSearch.keywords,
|
|
@@ -45,7 +51,7 @@ export var Search = function Search() {
|
|
|
45
51
|
};
|
|
46
52
|
}, []);
|
|
47
53
|
var searchResults = useMemo(function () {
|
|
48
|
-
return getSearchResults(result);
|
|
54
|
+
return getSearchResults(result, 30, sort);
|
|
49
55
|
}, [result]);
|
|
50
56
|
return /*#__PURE__*/React.createElement(Popover, {
|
|
51
57
|
open: open,
|
|
@@ -11,19 +11,19 @@ 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
|
|
15
|
-
import {
|
|
16
|
-
import { useNavigate } from "react-router-dom";
|
|
14
|
+
import { CaretDownFilled, CheckOutlined, DownOutlined, GithubOutlined, LinkOutlined, MenuOutlined, WechatOutlined } from '@ant-design/icons';
|
|
15
|
+
import { Alert, Button, Dropdown, Menu, Modal, Popover, Select } from 'antd';
|
|
17
16
|
import cx from 'classnames';
|
|
18
|
-
import {
|
|
19
|
-
import { GithubOutlined, MenuOutlined, CaretDownFilled, DownOutlined, WechatOutlined, LinkOutlined, CheckOutlined } from '@ant-design/icons';
|
|
20
|
-
import { Alert, Modal, Button, Popover, Menu, Dropdown, Select } from 'antd';
|
|
17
|
+
import { FormattedMessage, useLocale, useSiteData } from 'dumi';
|
|
21
18
|
import { get, map, size } from 'lodash-es';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
19
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
20
|
+
import { useNavigate } from 'react-router-dom';
|
|
21
|
+
import { useMedia } from 'react-use';
|
|
22
|
+
import { ic } from "../hooks";
|
|
24
23
|
import { Navs } from "./Navs";
|
|
24
|
+
import { Products } from "./Products";
|
|
25
|
+
import { Search } from "./Search";
|
|
25
26
|
import { findVersion, getLangUrl } from "./utils";
|
|
26
|
-
import { ic } from "../hooks";
|
|
27
27
|
import styles from "./index.module.less";
|
|
28
28
|
function redirectChinaMirror(chinaMirrorOrigin) {
|
|
29
29
|
window.location.href = window.location.href.replace(window.location.origin, chinaMirrorOrigin);
|
|
@@ -46,15 +46,14 @@
|
|
|
46
46
|
margin-bottom: -@nav-height;
|
|
47
47
|
|
|
48
48
|
nav {
|
|
49
|
-
|
|
50
49
|
a,
|
|
51
50
|
span,
|
|
52
51
|
.versions {
|
|
53
|
-
color: #
|
|
52
|
+
color: #424e66 !important;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
.translation {
|
|
57
|
-
fill: #
|
|
56
|
+
fill: #424e66 !important;
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
}
|
|
@@ -65,17 +64,16 @@
|
|
|
65
64
|
.container {
|
|
66
65
|
max-width: 100%;
|
|
67
66
|
padding: 0 20px;
|
|
68
|
-
border-bottom: 1px solid rgba(0,0,0,0.
|
|
67
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
.nav {
|
|
72
71
|
.menu {
|
|
73
|
-
|
|
74
|
-
>li {
|
|
72
|
+
> li {
|
|
75
73
|
margin-right: 8px;
|
|
76
74
|
font-size: 16px;
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
> :first-child {
|
|
79
77
|
display: flex;
|
|
80
78
|
display: inline-flex;
|
|
81
79
|
justify-content: center;
|
|
@@ -84,17 +82,17 @@
|
|
|
84
82
|
height: 32px;
|
|
85
83
|
line-height: 32px;
|
|
86
84
|
border-radius: 6px;
|
|
87
|
-
color: #
|
|
85
|
+
color: #424e66;
|
|
88
86
|
|
|
89
87
|
&:hover {
|
|
90
88
|
background: #fff;
|
|
91
|
-
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.
|
|
89
|
+
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
.navIcon {
|
|
97
|
-
|
|
95
|
+
> :first-child {
|
|
98
96
|
display: inline-flex;
|
|
99
97
|
justify-content: center;
|
|
100
98
|
align-items: center;
|
|
@@ -262,7 +260,7 @@
|
|
|
262
260
|
clear: both;
|
|
263
261
|
}
|
|
264
262
|
|
|
265
|
-
>span {
|
|
263
|
+
> span {
|
|
266
264
|
float: left;
|
|
267
265
|
height: 28px;
|
|
268
266
|
transition: all 0.3s;
|
|
@@ -355,7 +353,7 @@
|
|
|
355
353
|
height: 0;
|
|
356
354
|
|
|
357
355
|
// hide mask
|
|
358
|
-
+div {
|
|
356
|
+
+ div {
|
|
359
357
|
display: none;
|
|
360
358
|
}
|
|
361
359
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import URI from 'uri-parse';
|
|
2
1
|
import semver from 'semver';
|
|
2
|
+
import URI from 'uri-parse';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
* parse url like this
|
|
@@ -28,9 +28,9 @@ export function getLangUrl(url, lang) {
|
|
|
28
28
|
/**
|
|
29
29
|
* /en/api/xxx -> api
|
|
30
30
|
* /api/xxx -> api
|
|
31
|
-
* /docs/api/xxx -> api
|
|
31
|
+
* /docs/api/xxx -> api
|
|
32
32
|
* api/xxx -> api
|
|
33
|
-
* @param url
|
|
33
|
+
* @param url
|
|
34
34
|
*/
|
|
35
35
|
export function getNavCategory(url) {
|
|
36
36
|
return (url || '').split('/').find(function (d) {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
display: inline-block;
|
|
25
25
|
margin: 0 16px;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
.loader:before {
|
|
29
29
|
content: ' ';
|
|
30
30
|
width: 6px;
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
-webkit-animation: dotRect var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
41
41
|
animation: dotRect var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
.loader svg {
|
|
45
45
|
display: block;
|
|
46
46
|
width: 100%;
|
|
47
47
|
height: 100%;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
.loader svg rect,
|
|
51
51
|
.loader svg polygon,
|
|
52
52
|
.loader svg circle {
|
|
@@ -55,32 +55,32 @@
|
|
|
55
55
|
stroke-linejoin: round;
|
|
56
56
|
stroke-linecap: round;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
.loader svg polygon {
|
|
60
60
|
stroke-dasharray: 145 76 145 76;
|
|
61
61
|
stroke-dashoffset: 0;
|
|
62
62
|
-webkit-animation: pathTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
63
63
|
animation: pathTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
.loader svg rect {
|
|
67
67
|
stroke-dasharray: 192 64 192 64;
|
|
68
68
|
stroke-dashoffset: 0;
|
|
69
69
|
-webkit-animation: pathRect 3s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
70
70
|
animation: pathRect 3s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
.loader svg circle {
|
|
74
74
|
stroke-dasharray: 150 50 150 50;
|
|
75
75
|
stroke-dashoffset: 75;
|
|
76
76
|
-webkit-animation: pathCircle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
77
77
|
animation: pathCircle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
.loader.triangle {
|
|
81
81
|
width: 48px;
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
.loader.triangle:before {
|
|
85
85
|
left: 21px;
|
|
86
86
|
-webkit-transform: translate(-10px, -18px);
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
-webkit-animation: dotTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
89
89
|
animation: dotTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
.loading-text {
|
|
93
93
|
text-align: center;
|
|
94
94
|
height: 40px;
|