@antv/dumi-theme-antv 0.3.18 → 0.3.19-beta.1
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/context.d.ts +1 -1
- package/dist/layouts/entry/API.d.ts +1 -1
- 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/slots/Banner/index.d.ts +1 -1
- package/dist/slots/CodeEditor/Toolbar.d.ts +1 -1
- package/dist/slots/CodeEditor/Toolbar.js +3 -3
- package/dist/slots/CodeEditor/index.d.ts +1 -1
- 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 +1 -1
- 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/Header/Navs.d.ts +3 -3
- package/dist/slots/Header/Navs.js +3 -1
- package/dist/slots/Header/Products/getProducts.d.ts +2 -2
- 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 +8 -3
- package/dist/slots/Header/index.d.ts +1 -1
- package/dist/slots/ManualContent/Preview.d.ts +1 -1
- package/dist/slots/ManualContent/index.d.ts +1 -1
- package/dist/slots/ManualContent/index.js +3 -1
- package/dist/types.d.ts +2 -2
- package/package.json +34 -32
package/dist/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ExampleTopic } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type IThemeAntVContext = {
|
|
4
4
|
exampleTopics?: ExampleTopic[];
|
|
5
5
|
};
|
|
6
6
|
export declare const ThemeAntVContext: import("react").Context<IThemeAntVContext>;
|
package/dist/locales/en.json
CHANGED
package/dist/locales/zh.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NotificationProps } from './Notification';
|
|
3
3
|
import 'video-react/dist/video-react.css';
|
|
4
|
-
|
|
4
|
+
type BannerButtonShape = 'round' | 'square';
|
|
5
5
|
interface BannerButton {
|
|
6
6
|
text: string;
|
|
7
7
|
link: string;
|
|
@@ -20,12 +20,12 @@ import { ping } from "../utils";
|
|
|
20
20
|
import { extractImportDeps, getCodeSandboxConfig, getRiddleConfig, getStackblitzConfig } from "./utils";
|
|
21
21
|
import styles from "./Toolbar.module.less";
|
|
22
22
|
var Paragraph = Typography.Paragraph;
|
|
23
|
-
export var EDITOR_TABS
|
|
24
|
-
(function (EDITOR_TABS) {
|
|
23
|
+
export var EDITOR_TABS = /*#__PURE__*/function (EDITOR_TABS) {
|
|
25
24
|
EDITOR_TABS["JAVASCRIPT"] = "JavaScript";
|
|
26
25
|
EDITOR_TABS["SPEC"] = "Spec";
|
|
27
26
|
EDITOR_TABS["DATA"] = "Data";
|
|
28
|
-
|
|
27
|
+
return EDITOR_TABS;
|
|
28
|
+
}({});
|
|
29
29
|
export var Toolbar = function Toolbar(_ref) {
|
|
30
30
|
var sourceCode = _ref.sourceCode,
|
|
31
31
|
fileExtension = _ref.fileExtension,
|
|
@@ -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,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
|
};
|
|
@@ -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,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
|
};
|
|
@@ -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;
|
|
@@ -79,7 +79,9 @@ export var ManualContent = function ManualContent(_ref) {
|
|
|
79
79
|
// 递归
|
|
80
80
|
rootList.forEach(function (item) {
|
|
81
81
|
var href = (!baseRoute.startsWith('/en') ? "/".concat(item.slug) : "/en/".concat(item.slug)).toLocaleLowerCase();
|
|
82
|
-
var
|
|
82
|
+
var hasPrefix = hrefId.startsWith('/en') || href.startsWith('/zh');
|
|
83
|
+
var splitCount = hasPrefix ? 3 : 2;
|
|
84
|
+
var id = href.split('/').splice(0, splitCount).join('/');
|
|
83
85
|
if (href.includes(baseRoute)) {
|
|
84
86
|
if (id === hrefId) {
|
|
85
87
|
list.push(_objectSpread(_objectSpread({}, item), {}, {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface IThemeConfig {
|
|
2
2
|
[key: string]: any;
|
|
3
3
|
}
|
|
4
|
-
export
|
|
4
|
+
export type Status = 'responded' | 'error' | 'timeout';
|
|
5
5
|
/**
|
|
6
6
|
* 配置文件中的国际化配置
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type IC = string | {
|
|
9
9
|
zh: string;
|
|
10
10
|
en: string;
|
|
11
11
|
};
|
package/package.json
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/dumi-theme-antv",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.19-beta.1",
|
|
4
4
|
"description": "AntV website theme based on dumi2.",
|
|
5
|
-
"types": "dist/types.d.ts",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "father dev",
|
|
8
|
-
"dev:example-site": "cd example && npm run start",
|
|
9
|
-
"build": "father build",
|
|
10
|
-
"prepare": "father link-dev-theme",
|
|
11
|
-
"lint": "npm run lint:es && npm run lint:css",
|
|
12
|
-
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
13
|
-
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
14
|
-
"prepublishOnly": "npm run build"
|
|
15
|
-
},
|
|
16
5
|
"keywords": [
|
|
17
6
|
"dumi",
|
|
18
7
|
"dumi-theme",
|
|
19
8
|
"dumi-theme-antv"
|
|
20
9
|
],
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"antv"
|
|
24
|
-
|
|
10
|
+
"homepage": "https://github.com/antvis/dumi-theme-antv#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/antvis/dumi-theme-antv/issues"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/antvis/dumi-theme-antv"
|
|
17
|
+
},
|
|
25
18
|
"license": "MIT",
|
|
19
|
+
"types": "dist/types.d.ts",
|
|
26
20
|
"files": [
|
|
27
21
|
"dist"
|
|
28
22
|
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "father build",
|
|
25
|
+
"dev": "father dev",
|
|
26
|
+
"dev:example-site": "cd example && npm run start",
|
|
27
|
+
"lint": "npm run lint:es && npm run lint:css",
|
|
28
|
+
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
29
|
+
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
30
|
+
"prepare": "father link-dev-theme",
|
|
31
|
+
"prepublishOnly": "npm run build"
|
|
32
|
+
},
|
|
29
33
|
"commitlint": {
|
|
30
34
|
"extends": [
|
|
31
35
|
"@commitlint/config-conventional"
|
|
@@ -48,9 +52,6 @@
|
|
|
48
52
|
"prettier --parser=typescript --write"
|
|
49
53
|
]
|
|
50
54
|
},
|
|
51
|
-
"publishConfig": {
|
|
52
|
-
"access": "public"
|
|
53
|
-
},
|
|
54
55
|
"dependencies": {
|
|
55
56
|
"@ant-design/icons": "^4.7.0",
|
|
56
57
|
"@babel/plugin-syntax-unicode-sets-regex": "^7.18.6",
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
"lodash-es": "^4.17.21",
|
|
74
75
|
"monaco-editor": "^0.25.0",
|
|
75
76
|
"parse-github-url": "^1.0.2",
|
|
77
|
+
"prettier": "^2.7.1",
|
|
76
78
|
"rc-drawer": "^4.0.0",
|
|
77
79
|
"rc-footer": "^0.6.6",
|
|
78
80
|
"react": "^18.2.0",
|
|
@@ -91,15 +93,10 @@
|
|
|
91
93
|
"unified": "^10.1.2",
|
|
92
94
|
"unist-util-visit": "^4.1.2",
|
|
93
95
|
"uri-parse": "^1.0.0",
|
|
94
|
-
"video-react": "^0.16.0"
|
|
95
|
-
"prettier": "^2.7.1"
|
|
96
|
-
},
|
|
97
|
-
"peerDependencies": {
|
|
98
|
-
"dumi": "^2.0.0",
|
|
99
|
-
"react": ">=16.9.0",
|
|
100
|
-
"react-dom": ">=16.9.0"
|
|
96
|
+
"video-react": "^0.16.0"
|
|
101
97
|
},
|
|
102
98
|
"devDependencies": {
|
|
99
|
+
"@antv/g2": "^4.2.10",
|
|
103
100
|
"@commitlint/cli": "^17.1.2",
|
|
104
101
|
"@commitlint/config-conventional": "^17.1.0",
|
|
105
102
|
"@types/classnames": "^2.3.1",
|
|
@@ -111,6 +108,7 @@
|
|
|
111
108
|
"@types/react-router-dom": "^5.3.3",
|
|
112
109
|
"@types/react-slick": "^0.23.10",
|
|
113
110
|
"@umijs/lint": "^4.0.0",
|
|
111
|
+
"d3-regression": "^1.3.10",
|
|
114
112
|
"dumi": "^2.0.0",
|
|
115
113
|
"eslint": "^8.23.0",
|
|
116
114
|
"father": "^4.1.0",
|
|
@@ -123,12 +121,16 @@
|
|
|
123
121
|
"react-dom": "^18.0.0",
|
|
124
122
|
"stylelint": "^14.9.1"
|
|
125
123
|
},
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
124
|
+
"peerDependencies": {
|
|
125
|
+
"dumi": "^2.0.0",
|
|
126
|
+
"react": ">=16.9.0",
|
|
127
|
+
"react-dom": ">=16.9.0"
|
|
129
128
|
},
|
|
130
|
-
"
|
|
131
|
-
"
|
|
129
|
+
"publishConfig": {
|
|
130
|
+
"access": "public"
|
|
132
131
|
},
|
|
133
|
-
"
|
|
132
|
+
"authors": [
|
|
133
|
+
"dumi",
|
|
134
|
+
"antv"
|
|
135
|
+
]
|
|
134
136
|
}
|