@antv/dumi-theme-antv 0.3.18 → 0.3.20-beta.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 +1 -1
- package/dist/builtins/Playground/index.js +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/layouts/entry/API.d.ts +1 -1
- package/dist/layouts/entry/Index.js +4 -4
- package/dist/layouts/entry/Manual.d.ts +1 -1
- package/dist/locales/en.json +2 -1
- package/dist/locales/zh.json +2 -1
- package/dist/pages/Example/index.js +12 -4
- package/dist/pages/Examples/components/Accouncement/index.js +1 -1
- package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +1 -1
- package/dist/pages/Examples/components/ExampleTopicMenu/index.js +1 -1
- package/dist/pages/Examples/components/GalleryPageContent/index.js +3 -3
- package/dist/pages/Examples/index.js +1 -1
- package/dist/plugin/index.js +6 -7
- package/dist/slots/Banner/index.d.ts +1 -1
- package/dist/slots/Banner/index.js +4 -4
- package/dist/slots/Cases/index.js +2 -2
- package/dist/slots/CodeEditor/Toolbar.d.ts +1 -1
- package/dist/slots/CodeEditor/Toolbar.js +7 -7
- package/dist/slots/CodeEditor/index.d.ts +1 -1
- package/dist/slots/CodeEditor/index.js +4 -4
- package/dist/slots/CodeEditor/utils.js +3 -3
- package/dist/slots/CodePreview/CodeHeader.d.ts +1 -1
- package/dist/slots/CodePreview/index.d.ts +1 -1
- package/dist/slots/CodeRunner/index.d.ts +2 -2
- package/dist/slots/CodeRunner/index.js +25 -21
- package/dist/slots/CodeRunner/utils.js +3 -3
- package/dist/slots/Companies/index.d.ts +1 -1
- package/dist/slots/ContentTable/index.d.ts +1 -1
- package/dist/slots/Detail/index.d.ts +2 -2
- package/dist/slots/Detail/index.js +4 -4
- package/dist/slots/ExampleSider/index.js +4 -4
- package/dist/slots/Footer/index.js +13 -8
- package/dist/slots/Footer/index.module.less +13 -2
- package/dist/slots/Header/Navs.d.ts +3 -3
- package/dist/slots/Header/Navs.js +4 -2
- package/dist/slots/Header/Products/getProducts.d.ts +2 -2
- package/dist/slots/Header/Products/getProducts.js +3 -3
- package/dist/slots/Header/Products/index.js +4 -4
- package/dist/slots/Header/Search/SearchResult.d.ts +2 -2
- package/dist/slots/Header/Search/SearchResult.js +13 -2
- package/dist/slots/Header/Search/SearchResult.module.less +10 -0
- package/dist/slots/Header/Search/index.js +9 -4
- package/dist/slots/Header/index.d.ts +1 -1
- package/dist/slots/Header/index.js +82 -36
- package/dist/slots/Header/index.module.less +71 -8
- package/dist/slots/ManualContent/Preview.d.ts +1 -1
- package/dist/slots/ManualContent/Preview.js +6 -6
- package/dist/slots/ManualContent/index.d.ts +1 -1
- package/dist/slots/ManualContent/index.js +9 -9
- package/dist/slots/hooks.js +2 -2
- package/dist/slots/utils.js +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
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; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IC } from '../../types';
|
|
3
3
|
import { NewsProps } from './News';
|
|
4
|
-
|
|
4
|
+
type DetailButtonProps = {
|
|
5
5
|
text: IC;
|
|
6
6
|
link: string;
|
|
7
7
|
style?: React.CSSProperties;
|
|
8
8
|
type?: string;
|
|
9
9
|
shape?: 'round' | 'square';
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type DetailProps = {
|
|
12
12
|
className?: string;
|
|
13
13
|
style?: React.CSSProperties;
|
|
14
14
|
title: IC;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
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); }
|
|
3
|
-
function ownKeys(
|
|
4
|
-
function _objectSpread(
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
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; }
|
|
6
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
7
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -9,7 +9,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
9
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
11
|
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; }
|
|
12
|
-
function _iterableToArrayLimit(
|
|
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 React, { useState, useEffect } from 'react';
|
|
15
15
|
import cx from 'classnames';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
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; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -8,7 +8,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
8
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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
|
-
function _iterableToArrayLimit(
|
|
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 React, { useEffect, useRef, useState } from 'react';
|
|
14
14
|
import { Input, Menu, Tooltip } from 'antd';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
var _excluded = ["columns", "bottom", "
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["columns", "bottom", "language", "isDynamicFooter", "rootDomain", "className"];
|
|
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
|
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; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
@@ -9,9 +9,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { default as RCFooter } from 'rc-footer';
|
|
11
11
|
import { GithubOutlined, WeiboOutlined, ZhihuOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
|
12
|
+
import cx from 'classnames';
|
|
12
13
|
import { omit } from 'lodash-es';
|
|
13
14
|
import classnames from 'classnames';
|
|
14
|
-
import { useLocale, FormattedMessage } from 'dumi';
|
|
15
|
+
import { useLocale, FormattedMessage, useSiteData } from 'dumi';
|
|
15
16
|
import 'rc-footer/assets/index.less';
|
|
16
17
|
import styles from "./index.module.less";
|
|
17
18
|
/**
|
|
@@ -21,16 +22,20 @@ import styles from "./index.module.less";
|
|
|
21
22
|
export var Footer = function Footer(props) {
|
|
22
23
|
var columns = props.columns,
|
|
23
24
|
bottom = props.bottom,
|
|
24
|
-
_props$theme = props.theme,
|
|
25
|
-
theme = _props$theme === void 0 ? 'dark' : _props$theme,
|
|
26
25
|
language = props.language,
|
|
27
26
|
isDynamicFooter = props.isDynamicFooter,
|
|
28
27
|
_props$rootDomain = props.rootDomain,
|
|
29
28
|
rootDomain = _props$rootDomain === void 0 ? '' : _props$rootDomain,
|
|
30
29
|
className = props.className,
|
|
31
30
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
31
|
+
var _useSiteData = useSiteData(),
|
|
32
|
+
themeConfig = _useSiteData.themeConfig;
|
|
32
33
|
var locale = useLocale();
|
|
33
34
|
var lang = locale.id;
|
|
35
|
+
var _themeConfig$footerTh = themeConfig.footerTheme,
|
|
36
|
+
footerTheme = _themeConfig$footerTh === void 0 ? 'dark' : _themeConfig$footerTh;
|
|
37
|
+
var _restProps$theme = restProps.theme,
|
|
38
|
+
theme = _restProps$theme === void 0 ? footerTheme : _restProps$theme;
|
|
34
39
|
var getColumns = function getColumns() {
|
|
35
40
|
// 如果外部没有传入 columns,则默认展示 antv footer
|
|
36
41
|
var col1 = {
|
|
@@ -177,8 +182,8 @@ export var Footer = function Footer(props) {
|
|
|
177
182
|
columns: columns || getColumns(),
|
|
178
183
|
className: classnames(styles.footer, className, _defineProperty({}, styles.withMenu, isDynamicFooter)),
|
|
179
184
|
bottom: bottom || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
180
|
-
className: styles.bottom
|
|
181
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
185
|
+
className: cx(styles.bottom, _defineProperty({}, styles.light, theme === 'light'))
|
|
186
|
+
}, theme === 'light' ? '© Copyright 2022 Ant Group Co., Ltd..备案号:京ICP备15032932号-38' : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
182
187
|
href: "https://weibo.com/antv2017",
|
|
183
188
|
target: "_blank",
|
|
184
189
|
rel: "noopener noreferrer"
|
|
@@ -196,6 +201,6 @@ export var Footer = function Footer(props) {
|
|
|
196
201
|
id: "\u5173\u4E8E\u6211\u4EEC"
|
|
197
202
|
}))), /*#__PURE__*/React.createElement("div", null, "\xA9 ", new Date().getFullYear(), " Made with \u2764 by", ' ', /*#__PURE__*/React.createElement("a", {
|
|
198
203
|
href: "https://xtech.antfin.com/"
|
|
199
|
-
}, "AntV"))))
|
|
204
|
+
}, "AntV")))))
|
|
200
205
|
}, omit(restProps, ['githubUrl'])));
|
|
201
206
|
};
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
.container1440;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
:global(.rc-footer-bottom-container) {
|
|
13
|
+
border-top: 4px solid #F0F2FF;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
.description {
|
|
13
17
|
opacity: 0.6;
|
|
14
18
|
font-weight: normal;
|
|
@@ -49,14 +53,21 @@
|
|
|
49
53
|
|
|
50
54
|
.bottom {
|
|
51
55
|
display: flex;
|
|
52
|
-
justify-content:
|
|
56
|
+
justify-content: center;
|
|
53
57
|
font-size: 14px;
|
|
54
|
-
|
|
58
|
+
|
|
55
59
|
:global(.anticon),
|
|
56
60
|
a {
|
|
57
61
|
margin-right: 8px;
|
|
58
62
|
color: rgba(255, 255, 255, 0.6);
|
|
59
63
|
}
|
|
64
|
+
|
|
65
|
+
&.light {
|
|
66
|
+
:global(.anticon),
|
|
67
|
+
a {
|
|
68
|
+
color: #424E66;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
60
71
|
}
|
|
61
72
|
}
|
|
62
73
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type dropdownItem = {
|
|
3
3
|
name: {
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
};
|
|
6
6
|
url: string;
|
|
7
7
|
target?: '_blank';
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type INav = {
|
|
10
10
|
slug?: string;
|
|
11
11
|
order: number;
|
|
12
12
|
title: {
|
|
@@ -16,7 +16,7 @@ export declare type INav = {
|
|
|
16
16
|
notPage?: boolean;
|
|
17
17
|
dropdownItems?: dropdownItem[];
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type NavProps = {
|
|
20
20
|
navs: INav[];
|
|
21
21
|
path: string;
|
|
22
22
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
4
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -23,10 +23,12 @@ export var Navs = function Navs(_ref) {
|
|
|
23
23
|
var className = '';
|
|
24
24
|
if (nav.slug) {
|
|
25
25
|
href = nav.slug.startsWith('http') ? nav.slug : "/".concat(nav.slug);
|
|
26
|
+
|
|
27
|
+
// 去除 docs 防止新页面 404 和 本页重新刷新。
|
|
28
|
+
href = href.replace(/^\/docs(?=\/)/, '');
|
|
26
29
|
if (locale.id == 'en' && !href.startsWith('http')) {
|
|
27
30
|
href = "/en".concat(href);
|
|
28
31
|
}
|
|
29
|
-
// 去除 docs 防止二次点击相同 nav 跳转出现04
|
|
30
32
|
className = cx('header-menu-item-active', _defineProperty({}, styles.activeItem, getNavCategory(path) === getNavCategory(href)));
|
|
31
33
|
}
|
|
32
34
|
return size(nav.dropdownItems) ? /*#__PURE__*/React.createElement("li", {
|
|
@@ -13,13 +13,13 @@ export interface ProductItem {
|
|
|
13
13
|
openExternal?: boolean;
|
|
14
14
|
}>;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type ValuesOf<T extends any[]> = T[number];
|
|
17
17
|
declare const CATEGORY_TYPE: ["basic", "extension", "mobile", "ecology"];
|
|
18
18
|
export declare const CATEGORIES: Array<{
|
|
19
19
|
type: typeof CATEGORY_TYPE[number];
|
|
20
20
|
name: string;
|
|
21
21
|
}>;
|
|
22
|
-
export
|
|
22
|
+
export type ProductType = {
|
|
23
23
|
links: {
|
|
24
24
|
/** 产品首页 */
|
|
25
25
|
readonly home?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
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; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
4
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -6,7 +6,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
6
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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
|
-
function _iterableToArrayLimit(
|
|
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
11
|
import React from 'react';
|
|
12
12
|
import cx from 'classnames';
|
|
@@ -50,13 +50,13 @@ export var Products = function Products(_ref) {
|
|
|
50
50
|
})), /*#__PURE__*/React.createElement("ul", null, products.filter(function (item) {
|
|
51
51
|
return item.category === type;
|
|
52
52
|
}).map(function (product) {
|
|
53
|
-
var _product$links
|
|
53
|
+
var _product$links;
|
|
54
54
|
return /*#__PURE__*/React.createElement(Product, {
|
|
55
55
|
key: product.title,
|
|
56
56
|
name: product.title,
|
|
57
57
|
slogan: product.slogan || '',
|
|
58
58
|
description: product.description,
|
|
59
|
-
url: (_product$links = product.links) === null || _product$links === void 0
|
|
59
|
+
url: (_product$links = product.links) === null || _product$links === void 0 || (_product$links = _product$links.home) === null || _product$links === void 0 ? void 0 : _product$links.url,
|
|
60
60
|
icon: product.icon,
|
|
61
61
|
links: product.links,
|
|
62
62
|
language: language || locale.id
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useIntl } from 'dumi';
|
|
3
|
+
import { InboxOutlined } from '@ant-design/icons';
|
|
2
4
|
import styles from "./SearchResult.module.less";
|
|
3
5
|
var getHighlightInfo = function getHighlightInfo(textSegments) {
|
|
4
6
|
return /*#__PURE__*/React.createElement(React.Fragment, null, textSegments.map(function (segment) {
|
|
@@ -14,9 +16,10 @@ var getHighlightInfo = function getHighlightInfo(textSegments) {
|
|
|
14
16
|
*/
|
|
15
17
|
export var SearchResult = function SearchResult(_ref) {
|
|
16
18
|
var results = _ref.results;
|
|
19
|
+
var intl = useIntl();
|
|
17
20
|
return /*#__PURE__*/React.createElement("div", {
|
|
18
21
|
className: styles.searchResult
|
|
19
|
-
}, results.map(function (r) {
|
|
22
|
+
}, results !== null && results !== void 0 && results.length ? results.map(function (r) {
|
|
20
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
21
24
|
className: styles.item
|
|
22
25
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -31,5 +34,13 @@ export var SearchResult = function SearchResult(_ref) {
|
|
|
31
34
|
}, getHighlightInfo(r.tilte)), /*#__PURE__*/React.createElement("div", {
|
|
32
35
|
className: styles.description
|
|
33
36
|
}, getHighlightInfo(r.description))));
|
|
34
|
-
})
|
|
37
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: styles.empty
|
|
39
|
+
}, /*#__PURE__*/React.createElement(InboxOutlined, {
|
|
40
|
+
style: {
|
|
41
|
+
fontSize: 20
|
|
42
|
+
}
|
|
43
|
+
}), /*#__PURE__*/React.createElement("div", null, intl.formatMessage({
|
|
44
|
+
id: '没有找到查询结果'
|
|
45
|
+
}))));
|
|
35
46
|
};
|
|
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
2
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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
|
-
function _iterableToArrayLimit(
|
|
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
7
|
import React, { useEffect, useState, useMemo } from 'react';
|
|
8
8
|
import { Popover } from 'antd';
|
|
@@ -17,13 +17,18 @@ export var Search = function Search() {
|
|
|
17
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18
18
|
open = _useState2[0],
|
|
19
19
|
setOpen = _useState2[1];
|
|
20
|
+
// useSiteSearch 错误 keywords 为空时 loading 为 true
|
|
20
21
|
var _useSiteSearch = useSiteSearch(),
|
|
21
22
|
keywords = _useSiteSearch.keywords,
|
|
22
23
|
setKeywords = _useSiteSearch.setKeywords,
|
|
23
|
-
result = _useSiteSearch.result
|
|
24
|
+
result = _useSiteSearch.result,
|
|
25
|
+
loading = _useSiteSearch.loading;
|
|
24
26
|
useEffect(function () {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
// keywords 为空 或 loading 为 false 查找结束, 进行开关
|
|
28
|
+
if (!keywords || !loading) {
|
|
29
|
+
setOpen(!!keywords);
|
|
30
|
+
}
|
|
31
|
+
}, [keywords, loading]);
|
|
27
32
|
useEffect(function () {
|
|
28
33
|
var close = function close(e) {
|
|
29
34
|
var _e$target;
|