@antv/dumi-theme-antv 0.5.3 → 0.5.4-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.js +1 -1
- package/dist/common/Link.js +78 -0
- package/dist/common/SEO.js +61 -0
- package/dist/hooks/useMenu.js +122 -0
- package/dist/layouts/DocLayout.js +6 -7
- package/dist/layouts/entry/API.js +1 -0
- package/dist/layouts/entry/Index.js +12 -25
- package/dist/layouts/entry/Manual.js +7 -5
- package/dist/pages/404.js +4 -5
- package/dist/pages/Example/index.js +6 -7
- package/dist/pages/Examples/index.js +6 -5
- package/dist/plugin/rehypeObservable.js +6 -3
- package/dist/slots/CodeEditor/index.js +1 -1
- package/dist/slots/CodeRunner/index.js +3 -3
- package/dist/slots/ManualContent/Main.js +90 -0
- package/dist/slots/ManualContent/Sidebar.js +77 -0
- package/dist/slots/ManualContent/index.js +8 -305
- package/dist/slots/ManualContent/index.module.less +63 -29
- package/dist/slots/ManualContent/utils.js +19 -15
- package/dist/slots/utils.js +7 -0
- package/dist/utils/menu.js +46 -0
- package/package.json +47 -43
- package/dist/builtins/Playground/index.d.ts +0 -21
- package/dist/context.d.ts +0 -6
- package/dist/layouts/DocLayout.d.ts +0 -7
- package/dist/layouts/entry/API.d.ts +0 -10
- package/dist/layouts/entry/Index.d.ts +0 -6
- package/dist/layouts/entry/Manual.d.ts +0 -8
- package/dist/model/index.d.ts +0 -5
- package/dist/pages/404.d.ts +0 -5
- package/dist/pages/Example/components/CollapsedIcon/index.d.ts +0 -8
- package/dist/pages/Example/index.d.ts +0 -6
- package/dist/pages/Example/utils.d.ts +0 -1
- package/dist/pages/Examples/components/Accouncement/index.d.ts +0 -6
- package/dist/pages/Examples/components/Article/index.d.ts +0 -2
- package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +0 -10
- package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +0 -9
- package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +0 -10
- package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +0 -10
- package/dist/pages/Examples/index.d.ts +0 -7
- package/dist/pages/Examples/types.d.ts +0 -34
- package/dist/pages/Examples/utils.d.ts +0 -1
- package/dist/plugin/api.d.ts +0 -7
- package/dist/plugin/examples.d.ts +0 -21
- package/dist/plugin/index.d.ts +0 -3
- package/dist/plugin/rehypeObservable.d.ts +0 -1
- package/dist/slots/404.d.ts +0 -1
- package/dist/slots/API/index.d.ts +0 -14
- package/dist/slots/Article/index.d.ts +0 -3
- package/dist/slots/Banner/Notification.d.ts +0 -10
- package/dist/slots/Banner/index.d.ts +0 -26
- package/dist/slots/Cases/index.d.ts +0 -19
- package/dist/slots/CodeEditor/Toolbar.d.ts +0 -72
- package/dist/slots/CodeEditor/index.d.ts +0 -62
- package/dist/slots/CodeEditor/utils.d.ts +0 -42
- package/dist/slots/CodePreview/CodeHeader.d.ts +0 -19
- package/dist/slots/CodePreview/index.d.ts +0 -25
- package/dist/slots/CodeRunner/index.d.ts +0 -17
- package/dist/slots/CodeRunner/utils.d.ts +0 -11
- package/dist/slots/Companies/index.d.ts +0 -13
- package/dist/slots/ContentTable/index.d.ts +0 -6
- package/dist/slots/Detail/News.d.ts +0 -12
- package/dist/slots/Detail/index.d.ts +0 -30
- package/dist/slots/ExampleSider/index.d.ts +0 -21
- package/dist/slots/Features/FeatureCard.d.ts +0 -9
- package/dist/slots/Features/index.d.ts +0 -15
- package/dist/slots/Footer/index.d.ts +0 -18
- package/dist/slots/Header/Navs.d.ts +0 -27
- package/dist/slots/Header/Products/NavigatorBanner.d.ts +0 -10
- package/dist/slots/Header/Products/Product.d.ts +0 -14
- package/dist/slots/Header/Products/getProducts.d.ts +0 -48
- package/dist/slots/Header/Products/index.d.ts +0 -10
- package/dist/slots/Header/Search/SearchResult.d.ts +0 -21
- package/dist/slots/Header/Search/helper.d.ts +0 -8
- package/dist/slots/Header/Search/index.d.ts +0 -1
- package/dist/slots/Header/index.d.ts +0 -84
- package/dist/slots/Header/utils.d.ts +0 -10
- package/dist/slots/Loading/index.d.ts +0 -5
- package/dist/slots/ManualContent/NavigatorBanner.d.ts +0 -9
- package/dist/slots/ManualContent/Preview.d.ts +0 -7
- package/dist/slots/ManualContent/ReadingTime.d.ts +0 -3
- package/dist/slots/ManualContent/index.d.ts +0 -9
- package/dist/slots/ManualContent/usePreview.d.ts +0 -1
- package/dist/slots/ManualContent/utils.d.ts +0 -19
- package/dist/slots/SEO.d.ts +0 -10
- package/dist/slots/SEO.js +0 -57
- package/dist/slots/global.d.ts +0 -1
- package/dist/slots/hooks.d.ts +0 -16
- package/dist/slots/utils.d.ts +0 -5
- package/dist/types.d.ts +0 -86
package/dist/slots/utils.js
CHANGED
|
@@ -9,6 +9,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
10
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
11
|
import { icWithLocale } from "./hooks";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 统一去掉中英文前缀
|
|
15
|
+
*/
|
|
16
|
+
export function getCurrentPathname() {
|
|
17
|
+
return window.location.pathname.replace('/zh/', '/').replace('/en/', '/');
|
|
18
|
+
}
|
|
12
19
|
export function ping() {
|
|
13
20
|
return _ping.apply(this, arguments);
|
|
14
21
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
|
+
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); }
|
|
7
|
+
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; }
|
|
8
|
+
export var getAncestorMenuItems = function getAncestorMenuItems(items, key) {
|
|
9
|
+
if (!items) return [];
|
|
10
|
+
var findAncestors = function findAncestors(items, key) {
|
|
11
|
+
var ancestors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
12
|
+
var _iterator = _createForOfIteratorHelper(items),
|
|
13
|
+
_step;
|
|
14
|
+
try {
|
|
15
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
16
|
+
var item = _step.value;
|
|
17
|
+
if (item.key === key) return ancestors;
|
|
18
|
+
if (item.children) {
|
|
19
|
+
var result = findAncestors(item.children, key, [].concat(_toConsumableArray(ancestors), [item]));
|
|
20
|
+
if (result) return result;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
} catch (err) {
|
|
24
|
+
_iterator.e(err);
|
|
25
|
+
} finally {
|
|
26
|
+
_iterator.f();
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
};
|
|
30
|
+
return findAncestors(items, key) || [];
|
|
31
|
+
};
|
|
32
|
+
export var flattenMenu = function flattenMenu(menuItems) {
|
|
33
|
+
if (Array.isArray(menuItems)) {
|
|
34
|
+
return menuItems.reduce(function (acc, item) {
|
|
35
|
+
if (!item) {
|
|
36
|
+
return acc;
|
|
37
|
+
}
|
|
38
|
+
if ('children' in item && item.children) {
|
|
39
|
+
var _flattenMenu;
|
|
40
|
+
return acc.concat((_flattenMenu = flattenMenu(item.children)) !== null && _flattenMenu !== void 0 ? _flattenMenu : []);
|
|
41
|
+
}
|
|
42
|
+
return acc.concat(item);
|
|
43
|
+
}, []);
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/dumi-theme-antv",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4-beta.1",
|
|
4
4
|
"description": "AntV website theme based on dumi2.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dumi",
|
|
@@ -43,74 +43,77 @@
|
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@ant-design/icons": "^4.
|
|
46
|
+
"@ant-design/icons": "^4.8.3",
|
|
47
47
|
"@babel/plugin-syntax-unicode-sets-regex": "^7.18.6",
|
|
48
|
-
"@babel/standalone": "^7.
|
|
49
|
-
"@docsearch/css": "^3.
|
|
50
|
-
"@docsearch/react": "^3.
|
|
51
|
-
"@monaco-editor/react": "^4.
|
|
52
|
-
"@stackblitz/sdk": "^1.
|
|
53
|
-
"antd": "^4.
|
|
54
|
-
"classnames": "^2.
|
|
48
|
+
"@babel/standalone": "^7.26.2",
|
|
49
|
+
"@docsearch/css": "^3.8.0",
|
|
50
|
+
"@docsearch/react": "^3.8.0",
|
|
51
|
+
"@monaco-editor/react": "^4.6.0",
|
|
52
|
+
"@stackblitz/sdk": "^1.11.0",
|
|
53
|
+
"antd": "^4.24.16",
|
|
54
|
+
"classnames": "^2.5.1",
|
|
55
55
|
"codesandbox": "^2.2.3",
|
|
56
56
|
"d3-dsv": "^3.0.1",
|
|
57
57
|
"docsearch.js": "^2.6.3",
|
|
58
58
|
"front-matter": "^4.0.2",
|
|
59
59
|
"fs-extra": "^10.1.0",
|
|
60
|
-
"glob": "^8.0
|
|
60
|
+
"glob": "^8.1.0",
|
|
61
61
|
"hast": "^1.0.0",
|
|
62
62
|
"indent-string": "^5.0.0",
|
|
63
63
|
"insert-css": "^2.0.0",
|
|
64
64
|
"lodash-es": "^4.17.21",
|
|
65
|
-
"monaco-editor": "^0.25.
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"rc-
|
|
70
|
-
"
|
|
71
|
-
"react
|
|
65
|
+
"monaco-editor": "^0.25.2",
|
|
66
|
+
"nprogress": "^0.2.0",
|
|
67
|
+
"parse-github-url": "^1.0.3",
|
|
68
|
+
"prettier": "^2.8.8",
|
|
69
|
+
"rc-drawer": "^4.4.3",
|
|
70
|
+
"rc-footer": "^0.6.8",
|
|
71
|
+
"react": "^18.3.1",
|
|
72
|
+
"react-dom": "^18.3.1",
|
|
72
73
|
"react-error-boundary": "^3.1.4",
|
|
73
74
|
"react-github-button": "^0.1.11",
|
|
74
75
|
"react-helmet": "^6.1.0",
|
|
75
76
|
"react-markdown": "^9.0.1",
|
|
76
|
-
"react-router-dom": "^6.
|
|
77
|
+
"react-router-dom": "^6.28.0",
|
|
77
78
|
"react-slick": "^0.29.0",
|
|
78
79
|
"react-split-pane": "^0.1.92",
|
|
79
|
-
"react-use": "^17.
|
|
80
|
+
"react-use": "^17.5.1",
|
|
80
81
|
"reading-time": "^1.5.0",
|
|
81
82
|
"rehype-raw": "^7.0.0",
|
|
82
83
|
"remark-gfm": "^4.0.0",
|
|
83
|
-
"semver": "^7.3
|
|
84
|
-
"size-sensor": "^1.0.
|
|
84
|
+
"semver": "^7.6.3",
|
|
85
|
+
"size-sensor": "^1.0.2",
|
|
85
86
|
"slick-carousel": "^1.8.1",
|
|
86
87
|
"unified": "^10.1.2",
|
|
87
88
|
"unist-util-visit": "^4.1.2",
|
|
88
89
|
"uri-parse": "^1.0.0",
|
|
89
|
-
"valtio": "^1.
|
|
90
|
+
"valtio": "^1.13.2",
|
|
90
91
|
"video-react": "^0.16.0"
|
|
91
92
|
},
|
|
92
93
|
"devDependencies": {
|
|
93
|
-
"@commitlint/cli": "^17.1
|
|
94
|
-
"@commitlint/config-conventional": "^17.1
|
|
95
|
-
"@types/
|
|
94
|
+
"@commitlint/cli": "^17.8.1",
|
|
95
|
+
"@commitlint/config-conventional": "^17.8.1",
|
|
96
|
+
"@types/antd": "^1.0.4",
|
|
97
|
+
"@types/classnames": "^2.3.4",
|
|
96
98
|
"@types/fs-extra": "^9.0.13",
|
|
97
|
-
"@types/glob": "^8.
|
|
98
|
-
"@types/hast": "^2.3.
|
|
99
|
-
"@types/lodash-es": "^4.17.
|
|
100
|
-
"@types/node": "^18.
|
|
101
|
-
"@types/
|
|
99
|
+
"@types/glob": "^8.1.0",
|
|
100
|
+
"@types/hast": "^2.3.10",
|
|
101
|
+
"@types/lodash-es": "^4.17.12",
|
|
102
|
+
"@types/node": "^18.19.64",
|
|
103
|
+
"@types/nprogress": "^0.2.3",
|
|
104
|
+
"@types/react": "^18.3.12",
|
|
102
105
|
"@types/react-router-dom": "^5.3.3",
|
|
103
|
-
"@types/react-slick": "^0.23.
|
|
104
|
-
"@umijs/lint": "^4.
|
|
105
|
-
"dumi": "^2.
|
|
106
|
-
"eslint": "^8.
|
|
107
|
-
"father": "^4.1
|
|
108
|
-
"father-plugin-dumi-theme": "
|
|
109
|
-
"husky": "^8.0.
|
|
110
|
-
"lint-staged": "^13.0
|
|
111
|
-
"prettier-plugin-organize-imports": "^3.
|
|
112
|
-
"prettier-plugin-packagejson": "^2.
|
|
113
|
-
"stylelint": "^14.
|
|
106
|
+
"@types/react-slick": "^0.23.13",
|
|
107
|
+
"@umijs/lint": "^4.3.34",
|
|
108
|
+
"dumi": "^2.4.13",
|
|
109
|
+
"eslint": "^8.57.1",
|
|
110
|
+
"father": "^4.5.1",
|
|
111
|
+
"father-plugin-dumi-theme": "1.0.0-rc.1",
|
|
112
|
+
"husky": "^8.0.3",
|
|
113
|
+
"lint-staged": "^13.3.0",
|
|
114
|
+
"prettier-plugin-organize-imports": "^3.2.4",
|
|
115
|
+
"prettier-plugin-packagejson": "^2.5.3",
|
|
116
|
+
"stylelint": "^14.16.1"
|
|
114
117
|
},
|
|
115
118
|
"peerDependencies": {
|
|
116
119
|
"dumi": "^2.0.0",
|
|
@@ -118,7 +121,8 @@
|
|
|
118
121
|
"react-dom": ">=16.9.0"
|
|
119
122
|
},
|
|
120
123
|
"publishConfig": {
|
|
121
|
-
"access": "public"
|
|
124
|
+
"access": "public",
|
|
125
|
+
"tag": "beta"
|
|
122
126
|
},
|
|
123
127
|
"authors": [
|
|
124
128
|
"dumi",
|
|
@@ -130,6 +134,6 @@
|
|
|
130
134
|
"lint": "npm run lint:es && npm run lint:css",
|
|
131
135
|
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
132
136
|
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
133
|
-
"start": "cd example && npm run
|
|
137
|
+
"start": "cd example && npm run dev"
|
|
134
138
|
}
|
|
135
139
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type PlaygroundProps = {
|
|
3
|
-
/**
|
|
4
|
-
* 代码示例的地址
|
|
5
|
-
*/
|
|
6
|
-
path: string;
|
|
7
|
-
/**
|
|
8
|
-
* 渲染容器的 id,默认为 container
|
|
9
|
-
*/
|
|
10
|
-
rid?: string;
|
|
11
|
-
/**
|
|
12
|
-
* 预览区、代码区的宽度占比,默认为 0.38
|
|
13
|
-
*/
|
|
14
|
-
ratio?: number;
|
|
15
|
-
/**
|
|
16
|
-
* 容器的高度,默认为 400px
|
|
17
|
-
*/
|
|
18
|
-
height?: number;
|
|
19
|
-
};
|
|
20
|
-
declare const _default: React.FC<PlaygroundProps>;
|
|
21
|
-
export default _default;
|
package/dist/context.d.ts
DELETED
package/dist/model/index.d.ts
DELETED
package/dist/pages/404.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getCurrentTitle(exampleTopics: any, topic: any, example: any): any;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LeftMenuProps } from '../../../../types';
|
|
3
|
-
/**
|
|
4
|
-
* LeftMenu
|
|
5
|
-
*
|
|
6
|
-
* @param {LeftMenuProps} props 相关参数,详见类型定义
|
|
7
|
-
* @returns {React.FC} React.FC
|
|
8
|
-
* @author YuZhanglong <loveyzl1123@gmail.com>
|
|
9
|
-
*/
|
|
10
|
-
export declare const LeftMenu: React.FC<LeftMenuProps>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DemoCardProps } from '../../../types';
|
|
3
|
-
/**
|
|
4
|
-
* DEMO 的卡片预览
|
|
5
|
-
*
|
|
6
|
-
* @param {DemoCardProps} props 相关参数,详见类型定义
|
|
7
|
-
* @returns {React.FC} React.FC
|
|
8
|
-
* @author YuZhanglong <loveyzl1123@gmail.com>
|
|
9
|
-
*/
|
|
10
|
-
export declare const DemoCard: React.FC<DemoCardProps>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { GalleryPageContentProps } from '../../types';
|
|
3
|
-
/**
|
|
4
|
-
* Examples 首页内容预览组件
|
|
5
|
-
*
|
|
6
|
-
* @param {GalleryPageContentProps} props 相关参数,详见类型定义
|
|
7
|
-
* @returns {React.FC} React.FC
|
|
8
|
-
* @author YuZhanglong <loveyzl1123@gmail.com>
|
|
9
|
-
*/
|
|
10
|
-
export declare const GalleryPageContent: React.FC<GalleryPageContentProps>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ExampleTopic, Example, Demo } from '../../types';
|
|
3
|
-
export interface AnnouncementProps {
|
|
4
|
-
message: React.ReactNode;
|
|
5
|
-
localStorageId: string;
|
|
6
|
-
bannerId: string;
|
|
7
|
-
style?: React.CSSProperties;
|
|
8
|
-
}
|
|
9
|
-
export interface GalleryPageContentProps {
|
|
10
|
-
/**
|
|
11
|
-
* 案例主题列表
|
|
12
|
-
*/
|
|
13
|
-
exampleTopics: ExampleTopic[];
|
|
14
|
-
}
|
|
15
|
-
export interface LeftMenuProps {
|
|
16
|
-
/**
|
|
17
|
-
* 案例主题列表
|
|
18
|
-
*/
|
|
19
|
-
exampleTopics: ExampleTopic[];
|
|
20
|
-
}
|
|
21
|
-
export interface ExampleWithTopic extends Example {
|
|
22
|
-
targetTopic: ExampleTopic;
|
|
23
|
-
}
|
|
24
|
-
export interface DemoCardProps {
|
|
25
|
-
demo: Demo;
|
|
26
|
-
topicId: string;
|
|
27
|
-
exampleId: string;
|
|
28
|
-
}
|
|
29
|
-
export interface LeftMenuProps {
|
|
30
|
-
/**
|
|
31
|
-
* 案例主题列表
|
|
32
|
-
*/
|
|
33
|
-
exampleTopics: ExampleTopic[];
|
|
34
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getCategoryId(topicId: any, exampleId: any): string;
|
package/dist/plugin/api.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Example, ExampleTopic } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* 获取案例页面的所有主题
|
|
4
|
-
*
|
|
5
|
-
* @returns {ExampleTopic[]} 案例主题列表
|
|
6
|
-
* @author YuZhanglong <loveyzl1123@gmail.com>
|
|
7
|
-
*/
|
|
8
|
-
export declare const getExamplesPageTopics: (exampleTopics: ExampleTopic[], showAPIDoc: boolean) => {
|
|
9
|
-
id: string;
|
|
10
|
-
title: {
|
|
11
|
-
zh: string;
|
|
12
|
-
en: string;
|
|
13
|
-
};
|
|
14
|
-
icon: string;
|
|
15
|
-
examples: Example[];
|
|
16
|
-
childrenKey: string;
|
|
17
|
-
}[];
|
|
18
|
-
/**
|
|
19
|
-
* 根据目录结构返回,所有的 example 页面,用于 buiild static
|
|
20
|
-
*/
|
|
21
|
-
export declare function getExamplePaths(): string[];
|
package/dist/plugin/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function rehypeObservable(): (tree: any) => Promise<void>;
|
package/dist/slots/404.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const NotFound: () => JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ExampleTopic } from '../../types';
|
|
2
|
-
declare type APIProps = {
|
|
3
|
-
isPlayground?: boolean;
|
|
4
|
-
topic: string;
|
|
5
|
-
example: string;
|
|
6
|
-
demo: string;
|
|
7
|
-
exampleTopics: ExampleTopic[];
|
|
8
|
-
language?: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* API 预览
|
|
12
|
-
*/
|
|
13
|
-
export declare const API: ({ exampleTopics, topic, example, demo, language, }: APIProps) => JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { NotificationProps } from './Notification';
|
|
3
|
-
import 'video-react/dist/video-react.css';
|
|
4
|
-
declare type BannerButtonShape = 'round' | 'square';
|
|
5
|
-
interface BannerButton {
|
|
6
|
-
text: string;
|
|
7
|
-
link: string;
|
|
8
|
-
style?: React.CSSProperties;
|
|
9
|
-
type?: string;
|
|
10
|
-
shape?: BannerButtonShape;
|
|
11
|
-
}
|
|
12
|
-
interface BannerProps {
|
|
13
|
-
coverImage?: React.ReactNode;
|
|
14
|
-
title: string;
|
|
15
|
-
description: string;
|
|
16
|
-
notifications?: NotificationProps[];
|
|
17
|
-
style?: React.CSSProperties;
|
|
18
|
-
className?: string;
|
|
19
|
-
video?: string;
|
|
20
|
-
showGithubStars?: boolean;
|
|
21
|
-
buttons?: BannerButton[];
|
|
22
|
-
onCloseVideo?: () => void;
|
|
23
|
-
onPlayVideo?: () => void;
|
|
24
|
-
}
|
|
25
|
-
declare const Banner: React.FC<BannerProps>;
|
|
26
|
-
export default Banner;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IC } from '../../types';
|
|
3
|
-
import 'slick-carousel/slick/slick.css';
|
|
4
|
-
import 'slick-carousel/slick/slick-theme.css';
|
|
5
|
-
interface Case {
|
|
6
|
-
logo?: string;
|
|
7
|
-
isAppLogo?: boolean;
|
|
8
|
-
title: IC;
|
|
9
|
-
description: IC;
|
|
10
|
-
link?: string;
|
|
11
|
-
image: string;
|
|
12
|
-
}
|
|
13
|
-
interface CasesProps {
|
|
14
|
-
cases: Case[];
|
|
15
|
-
style?: React.CSSProperties;
|
|
16
|
-
className?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare const Cases: React.FC<CasesProps>;
|
|
19
|
-
export {};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
export declare enum EDITOR_TABS {
|
|
3
|
-
JAVASCRIPT = "JavaScript",
|
|
4
|
-
SPEC = "Spec",
|
|
5
|
-
DATA = "Data"
|
|
6
|
-
}
|
|
7
|
-
declare type ToolbarProps = {
|
|
8
|
-
/**
|
|
9
|
-
* 源码文件,用于传入到三方代码平台
|
|
10
|
-
*/
|
|
11
|
-
sourceCode: string;
|
|
12
|
-
/**
|
|
13
|
-
* 生成代码文件名后缀,用于传入到三方代码平台
|
|
14
|
-
*/
|
|
15
|
-
fileExtension: string;
|
|
16
|
-
/**
|
|
17
|
-
* 项目标题,用于传入到三方代码平台
|
|
18
|
-
*/
|
|
19
|
-
title: {
|
|
20
|
-
zh?: string;
|
|
21
|
-
en?: string;
|
|
22
|
-
} | string;
|
|
23
|
-
location?: Location;
|
|
24
|
-
/**
|
|
25
|
-
* playground 的一些配置项
|
|
26
|
-
*/
|
|
27
|
-
playground: {
|
|
28
|
-
container?: string;
|
|
29
|
-
playgroundDidMount?: string;
|
|
30
|
-
playgroundWillUnmount?: string;
|
|
31
|
-
dependencies?: {
|
|
32
|
-
[key: string]: string;
|
|
33
|
-
};
|
|
34
|
-
devDependencies?: {
|
|
35
|
-
[key: string]: string;
|
|
36
|
-
};
|
|
37
|
-
htmlCodeTemplate?: string;
|
|
38
|
-
json?: {
|
|
39
|
-
[key: string]: any;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* 全屏状态,用于显示不同的 icon
|
|
44
|
-
*/
|
|
45
|
-
isFullScreen?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Tabs 数据
|
|
48
|
-
*/
|
|
49
|
-
editorTabs: EDITOR_TABS[];
|
|
50
|
-
/**
|
|
51
|
-
* 当前编辑哪个 tab
|
|
52
|
-
*/
|
|
53
|
-
currentEditorTab: EDITOR_TABS;
|
|
54
|
-
/**
|
|
55
|
-
* 切换 tab
|
|
56
|
-
*/
|
|
57
|
-
onEditorTabChange: (tab: EDITOR_TABS) => void;
|
|
58
|
-
/**
|
|
59
|
-
* 进入/退出全屏
|
|
60
|
-
*/
|
|
61
|
-
onToggleFullscreen?: null | (() => void);
|
|
62
|
-
/**
|
|
63
|
-
* 执行代码
|
|
64
|
-
*/
|
|
65
|
-
onExecuteCode: () => void;
|
|
66
|
-
/**
|
|
67
|
-
* Tab 的附加内容
|
|
68
|
-
*/
|
|
69
|
-
slots: Record<string, ReactElement>;
|
|
70
|
-
};
|
|
71
|
-
export declare const Toolbar: React.FC<ToolbarProps>;
|
|
72
|
-
export {};
|