@antv/dumi-theme-antv 0.6.3 → 0.6.4-alpha.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/ClientOnly.js +21 -0
- package/dist/common/{SEO.js → CommonHelmet.js} +12 -6
- package/dist/common/InViewSuspense.js +29 -0
- package/dist/hooks/useLocale.js +11 -0
- package/dist/hooks/useMenu.js +35 -23
- package/dist/layouts/DocLayout.js +15 -11
- package/dist/layouts/IndexLayout/index.js +16 -0
- package/dist/layouts/{entry/Manual.js → ManualLayout/index.js} +6 -6
- package/dist/pages/404.js +5 -4
- package/dist/pages/Example/index.js +72 -53
- package/dist/pages/Examples/components/ExampleTopicMenu/index.js +3 -2
- package/dist/pages/Examples/index.js +28 -32
- package/dist/{slots → pages/Index/components}/Cases/index.js +1 -1
- package/dist/{slots → pages/Index/components}/Detail/News.js +1 -1
- package/dist/{slots → pages/Index/components}/Detail/index.js +1 -1
- package/dist/{slots → pages/Index/components}/Features/FeatureCard.js +1 -1
- package/dist/{slots → pages/Index/components}/Features/index.js +1 -1
- package/dist/pages/Index/components/_.less +119 -0
- package/dist/{layouts/entry/Index.js → pages/Index/index.js} +17 -21
- package/dist/plugin/index.js +52 -43
- package/dist/slots/CodeEditor/index.js +4 -3
- package/dist/slots/CodePreview/CodeHeader.js +3 -2
- package/dist/slots/CodePreview/index.js +3 -2
- package/dist/slots/CodeRunner/index.js +34 -29
- package/dist/slots/ExampleSider/index.js +3 -2
- package/dist/slots/Feedback/Contributors.js +3 -2
- package/dist/slots/Feedback/EditButton.js +3 -2
- package/dist/slots/Feedback/PageFeedback.js +4 -3
- package/dist/slots/Feedback/SectionFeedback.js +3 -2
- package/dist/slots/Feedback/index.js +12 -10
- package/dist/slots/Footer/index.js +3 -2
- package/dist/slots/Header/Search/index.js +1 -1
- package/dist/slots/Header/index.js +17 -12
- package/dist/slots/ManualContent/Main.js +16 -17
- package/dist/slots/ManualContent/NavigatorBanner.js +4 -2
- package/dist/slots/ManualContent/ObPreview.js +17 -0
- package/dist/slots/ManualContent/index.js +3 -4
- package/dist/slots/ManualContent/usePreview.js +6 -1
- package/dist/slots/ManualContent/utils.js +3 -13
- package/dist/slots/global.js +4 -4
- package/dist/slots/hooks.js +0 -25
- package/dist/slots/utils.js +0 -7
- package/dist/utils/env.js +10 -0
- package/dist/utils/location.js +6 -0
- package/package.json +5 -4
- package/dist/layouts/entry/API.js +0 -12
- package/dist/pages/Example/utils.js +0 -9
- package/dist/slots/Article/index.js +0 -9
- package/dist/slots/Article/index.module.less +0 -8
- package/dist/slots/CodePreview/CodeHeader.module.less +0 -0
- package/dist/slots/Header/Products/NavigatorBanner.js +0 -29
- package/dist/slots/Header/Products/NavigatorBanner.module.less +0 -39
- /package/dist/{slots → pages/Index/components}/Cases/index.module.less +0 -0
- /package/dist/{slots → pages/Index/components}/Companies/index.js +0 -0
- /package/dist/{slots → pages/Index/components}/Companies/index.module.less +0 -0
- /package/dist/{slots → pages/Index/components}/Detail/News.module.less +0 -0
- /package/dist/{slots → pages/Index/components}/Detail/index.module.less +0 -0
- /package/dist/{slots → pages/Index/components}/Features/FeatureCard.module.less +0 -0
- /package/dist/{slots → pages/Index/components}/Features/index.module.less +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Link, useLocale } from 'dumi';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ic } from "
|
|
3
|
+
import { ic } from "../../../../slots/hooks";
|
|
4
4
|
import styles from "./News.module.less";
|
|
5
5
|
var numberImages = ['https://gw.alipayobjects.com/zos/antfincdn/IqREAm36K7/1.png', 'https://gw.alipayobjects.com/zos/antfincdn/3fG1Iqjfnz/2.png'];
|
|
6
6
|
export var News = function News(_ref) {
|
|
@@ -19,8 +19,8 @@ import { useLocale } from 'dumi/dist/client/theme-api';
|
|
|
19
19
|
import gh from 'parse-github-url';
|
|
20
20
|
import React, { useEffect, useState } from 'react';
|
|
21
21
|
import GitHubButton from 'react-github-button';
|
|
22
|
-
import { ic } from "../hooks";
|
|
23
22
|
import { News } from "./News";
|
|
23
|
+
import { ic } from "../../../../slots/hooks";
|
|
24
24
|
import styles from "./index.module.less";
|
|
25
25
|
/**
|
|
26
26
|
* Index.技术栈的描述区域!
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Col, Row } from 'antd';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { ic } from "
|
|
4
|
+
import { ic } from "../../../../slots/hooks";
|
|
5
5
|
import FeatureCard from "./FeatureCard";
|
|
6
6
|
import styles from "./index.module.less";
|
|
7
7
|
export var Features = function Features(_ref) {
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
@import '~antd/dist/antd.less';
|
|
2
|
+
|
|
3
|
+
@primary-color: #873bf4;
|
|
4
|
+
|
|
5
|
+
.ant-btn,
|
|
6
|
+
.ant-input,
|
|
7
|
+
.ant-notification-notice,
|
|
8
|
+
.ant-select-selector {
|
|
9
|
+
border-radius: 8px !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
h1,
|
|
13
|
+
h2,
|
|
14
|
+
h3,
|
|
15
|
+
h4,
|
|
16
|
+
h5,
|
|
17
|
+
h6 {
|
|
18
|
+
> a[aria-hidden]:first-child {
|
|
19
|
+
float: left;
|
|
20
|
+
width: 20px;
|
|
21
|
+
font-size: 0;
|
|
22
|
+
line-height: inherit;
|
|
23
|
+
text-align: right;
|
|
24
|
+
padding-inline-end: 6px;
|
|
25
|
+
margin-inline-start: -20px;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
border: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
> .icon-link::before {
|
|
32
|
+
font-size: 20px;
|
|
33
|
+
content: '#';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:not(:hover) > a[aria-hidden]:first-child > .icon-link {
|
|
38
|
+
visibility: hidden;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.container1440() {
|
|
43
|
+
width: 1440px;
|
|
44
|
+
max-width: calc(100% - 80px);
|
|
45
|
+
margin-right: auto;
|
|
46
|
+
margin-left: auto;
|
|
47
|
+
|
|
48
|
+
@media only screen and (max-width: 931.99px) {
|
|
49
|
+
& {
|
|
50
|
+
max-width: calc(100% - 80px);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media only screen and (max-width: 767.99px) {
|
|
55
|
+
& {
|
|
56
|
+
max-width: calc(100% - 32px);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 非常关键,用于 react-split-pane 的样式,如果没有,会没有办法鼠标拖拽
|
|
62
|
+
// 参考:https://codesandbox.io/s/mow7x4zyqx
|
|
63
|
+
:global {
|
|
64
|
+
.Pane1,
|
|
65
|
+
.Pane2 {
|
|
66
|
+
overflow: auto;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.Resizer {
|
|
70
|
+
z-index: 1;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
background: #000;
|
|
73
|
+
background-clip: padding-box;
|
|
74
|
+
opacity: 0.1;
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
transition: all 2s ease;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.horizontal {
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 11px;
|
|
83
|
+
margin: -5px 0;
|
|
84
|
+
border-top: 5px solid rgba(255, 255, 255, 0);
|
|
85
|
+
border-bottom: 5px solid rgba(255, 255, 255, 0);
|
|
86
|
+
cursor: row-resize;
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
border-top: 5px solid rgba(0, 0, 0, 0.5);
|
|
90
|
+
border-bottom: 5px solid rgba(0, 0, 0, 0.5);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.vertical {
|
|
95
|
+
width: 11px;
|
|
96
|
+
margin: 0 -5px;
|
|
97
|
+
border-right: 5px solid rgba(255, 255, 255, 0);
|
|
98
|
+
border-left: 5px solid rgba(255, 255, 255, 0);
|
|
99
|
+
cursor: col-resize;
|
|
100
|
+
|
|
101
|
+
Pane2 {
|
|
102
|
+
border-left: 1px solid #e6e6e6;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:hover {
|
|
106
|
+
border-right: 5px solid rgba(0, 0, 0, 0.5);
|
|
107
|
+
border-left: 5px solid rgba(0, 0, 0, 0.5);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&.disabled {
|
|
112
|
+
cursor: not-allowed;
|
|
113
|
+
|
|
114
|
+
&:hover {
|
|
115
|
+
border-color: transparent;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -4,23 +4,16 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
|
-
import {
|
|
7
|
+
import { useIntl, useSiteData } from 'dumi';
|
|
8
8
|
import { get, isArray, size } from 'lodash-es';
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Index 路由下的入口
|
|
20
|
-
* - 获取数据
|
|
21
|
-
* - 组合 slots 下的木偶组件
|
|
22
|
-
*/
|
|
23
|
-
export var Index = function Index() {
|
|
10
|
+
import CommonHelmet from "../../common/CommonHelmet";
|
|
11
|
+
import { ic } from "../../slots/hooks";
|
|
12
|
+
import { Cases } from "./components/Cases";
|
|
13
|
+
import { Companies } from "./components/Companies";
|
|
14
|
+
import { Detail } from "./components/Detail";
|
|
15
|
+
import { Features } from "./components/Features";
|
|
16
|
+
var Index = function Index() {
|
|
24
17
|
var _useSiteData = useSiteData(),
|
|
25
18
|
themeConfig = _useSiteData.themeConfig;
|
|
26
19
|
var title = themeConfig.title,
|
|
@@ -35,6 +28,8 @@ export var Index = function Index() {
|
|
|
35
28
|
className = themeConfig.className,
|
|
36
29
|
style = themeConfig.style,
|
|
37
30
|
id = themeConfig.id;
|
|
31
|
+
var _useIntl = useIntl(),
|
|
32
|
+
formatMessage = _useIntl.formatMessage;
|
|
38
33
|
var detailProps = _objectSpread({
|
|
39
34
|
githubUrl: githubUrl,
|
|
40
35
|
showGithubStars: showGithubStars,
|
|
@@ -52,13 +47,14 @@ export var Index = function Index() {
|
|
|
52
47
|
style: style,
|
|
53
48
|
className: className
|
|
54
49
|
};
|
|
55
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
56
|
-
title: title,
|
|
50
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CommonHelmet, {
|
|
51
|
+
title: ic(title),
|
|
57
52
|
titleSuffix: "AntV"
|
|
58
|
-
}),
|
|
59
|
-
title:
|
|
53
|
+
}), size(detail) ? /*#__PURE__*/React.createElement(Detail, detailProps) : null, size(featuresProps.features) ? /*#__PURE__*/React.createElement(Features, featuresProps) : null, size(cases) ? /*#__PURE__*/React.createElement(Cases, casesProps) : null, size(companies) ? /*#__PURE__*/React.createElement(Companies, {
|
|
54
|
+
title: formatMessage({
|
|
60
55
|
id: isAntVSite ? '2000+ 公司正在使用' : '感谢信赖'
|
|
61
56
|
}),
|
|
62
57
|
companies: companies
|
|
63
|
-
}) : null
|
|
64
|
-
};
|
|
58
|
+
}) : null);
|
|
59
|
+
};
|
|
60
|
+
export default Index;
|
package/dist/plugin/index.js
CHANGED
|
@@ -61,42 +61,6 @@ var plugin_default = (api) => {
|
|
|
61
61
|
memo.extraRehypePlugins = [import_rehypeObservable.default];
|
|
62
62
|
return memo;
|
|
63
63
|
});
|
|
64
|
-
const pages = [
|
|
65
|
-
{
|
|
66
|
-
id: "dumi-theme-antv-homepage",
|
|
67
|
-
absPath: "/"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: "dumi-theme-antv-en-homepage",
|
|
71
|
-
absPath: "/en/"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: "dumi-theme-antv-zh-homepage",
|
|
75
|
-
absPath: "/zh/"
|
|
76
|
-
},
|
|
77
|
-
// Examples gallery page.
|
|
78
|
-
{
|
|
79
|
-
id: "dumi-theme-antv-example-list-zh",
|
|
80
|
-
absPath: "/examples",
|
|
81
|
-
file: `${PAGES_DIR}/Examples`
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: "dumi-theme-antv-example-list-lang",
|
|
85
|
-
absPath: "/:language/examples",
|
|
86
|
-
file: `${PAGES_DIR}/Examples`
|
|
87
|
-
},
|
|
88
|
-
// single example preview page.
|
|
89
|
-
{
|
|
90
|
-
id: "dumi-theme-antv-single-example-zh",
|
|
91
|
-
absPath: "/examples/:topic/:example",
|
|
92
|
-
file: `${PAGES_DIR}/Example`
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
id: "dumi-theme-antv-single-example-lang",
|
|
96
|
-
absPath: "/:language/examples/:topic/:example",
|
|
97
|
-
file: `${PAGES_DIR}/Example`
|
|
98
|
-
}
|
|
99
|
-
];
|
|
100
64
|
api.modifyConfig((memo) => {
|
|
101
65
|
memo.extraRemarkPlugins = memo.themeConfig.feedback ? [import_remarkFeedback.default] : [];
|
|
102
66
|
return memo;
|
|
@@ -136,18 +100,63 @@ export default function ThemeAntVContextWrapper() {
|
|
|
136
100
|
file: `${api.paths.absTmpPath}/theme-antv/ContextWrapper.tsx`
|
|
137
101
|
}));
|
|
138
102
|
api.modifyRoutes((routes) => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
id:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
file:
|
|
103
|
+
const extraRoutesList = [
|
|
104
|
+
{
|
|
105
|
+
id: "dumi-theme-antv-homepage",
|
|
106
|
+
absPath: "/",
|
|
107
|
+
path: "",
|
|
108
|
+
file: `${PAGES_DIR}/Index`
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "dumi-theme-antv-homepage-en",
|
|
112
|
+
absPath: "/en/",
|
|
113
|
+
path: "en",
|
|
114
|
+
file: `${PAGES_DIR}/Index`
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "dumi-theme-antv-homepage-zh",
|
|
118
|
+
absPath: "/zh/",
|
|
119
|
+
path: "zh",
|
|
120
|
+
file: `${PAGES_DIR}/Index`
|
|
121
|
+
},
|
|
122
|
+
// Examples gallery page.
|
|
123
|
+
{
|
|
124
|
+
id: "dumi-theme-antv-example-list-zh",
|
|
125
|
+
absPath: "/examples",
|
|
126
|
+
path: "examples",
|
|
127
|
+
file: `${PAGES_DIR}/Examples`
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "dumi-theme-antv-example-list-lang",
|
|
131
|
+
absPath: "/:language/examples",
|
|
132
|
+
path: ":language/examples",
|
|
133
|
+
file: `${PAGES_DIR}/Examples`
|
|
134
|
+
},
|
|
135
|
+
// single example preview page.
|
|
136
|
+
{
|
|
137
|
+
id: "dumi-theme-antv-single-example-zh",
|
|
138
|
+
absPath: "/examples/:topic/:example",
|
|
139
|
+
path: "examples/:topic/:example",
|
|
140
|
+
file: `${PAGES_DIR}/Example`
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "dumi-theme-antv-single-example-lang",
|
|
144
|
+
absPath: "/:language/examples/:topic/:example",
|
|
145
|
+
path: ":language/examples/:topic/:example",
|
|
146
|
+
file: `${PAGES_DIR}/Example`
|
|
147
|
+
}
|
|
148
|
+
];
|
|
149
|
+
extraRoutesList.forEach((itemRoute) => {
|
|
150
|
+
routes[itemRoute.id] = {
|
|
151
|
+
id: itemRoute.id,
|
|
152
|
+
path: itemRoute.path,
|
|
153
|
+
absPath: itemRoute.absPath,
|
|
154
|
+
file: itemRoute.file,
|
|
145
155
|
parentId: "DocLayout",
|
|
146
156
|
meta: MOCK_META
|
|
147
157
|
};
|
|
148
158
|
});
|
|
149
159
|
routes["404"].file = `${PAGES_DIR}/404`;
|
|
150
|
-
routes["404"].meta = MOCK_META;
|
|
151
160
|
return routes;
|
|
152
161
|
});
|
|
153
162
|
api.addTmpGenerateWatcherPaths(() => [path.resolve(process.cwd(), "examples")]);
|
|
@@ -22,8 +22,8 @@ import parserBabel from 'prettier/parser-babel';
|
|
|
22
22
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
23
23
|
import { bind, clear } from 'size-sensor';
|
|
24
24
|
import Loading from "dumi/theme/slots/Loading";
|
|
25
|
-
import { EDITOR_TABS, Toolbar } from "./Toolbar";
|
|
26
25
|
import styles from "./index.module.less";
|
|
26
|
+
import { EDITOR_TABS, Toolbar } from "./Toolbar";
|
|
27
27
|
import { compile, execute, replaceInsertCss } from "./utils";
|
|
28
28
|
loader.config({
|
|
29
29
|
'vs/nls': {
|
|
@@ -38,7 +38,7 @@ loader.config({
|
|
|
38
38
|
/**
|
|
39
39
|
* 代码编辑器
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
var CodeEditor = function CodeEditor(_ref) {
|
|
42
42
|
var _ref$title = _ref.title,
|
|
43
43
|
title = _ref$title === void 0 ? '' : _ref$title,
|
|
44
44
|
source = _ref.source,
|
|
@@ -432,4 +432,5 @@ export var CodeEditor = function CodeEditor(_ref) {
|
|
|
432
432
|
}
|
|
433
433
|
}));
|
|
434
434
|
}));
|
|
435
|
-
};
|
|
435
|
+
};
|
|
436
|
+
export default CodeEditor;
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* 组件的 header
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
var CodeHeader = function CodeHeader(_ref) {
|
|
7
7
|
var title = _ref.title,
|
|
8
8
|
relativePath = _ref.relativePath,
|
|
9
9
|
githubUrl = _ref.githubUrl;
|
|
@@ -30,4 +30,5 @@ export var CodeHeader = function CodeHeader(_ref) {
|
|
|
30
30
|
})
|
|
31
31
|
})
|
|
32
32
|
});
|
|
33
|
-
};
|
|
33
|
+
};
|
|
34
|
+
export default CodeHeader;
|
|
@@ -11,7 +11,7 @@ function getErrorMessage(e) {
|
|
|
11
11
|
* 1. 一些 header 菜单
|
|
12
12
|
* 2. 错误预览
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
var CodePreview = function CodePreview(_ref) {
|
|
15
15
|
var isPlayground = _ref.isPlayground,
|
|
16
16
|
exampleId = _ref.exampleId,
|
|
17
17
|
header = _ref.header,
|
|
@@ -33,4 +33,5 @@ export var CodePreview = function CodePreview(_ref) {
|
|
|
33
33
|
}),
|
|
34
34
|
subTitle: /*#__PURE__*/React.createElement("pre", null, getErrorMessage(error))
|
|
35
35
|
}) : null));
|
|
36
|
-
};
|
|
36
|
+
};
|
|
37
|
+
export default CodePreview;
|
|
@@ -8,16 +8,22 @@ import { useLocale, useSiteData } from 'dumi';
|
|
|
8
8
|
import { noop } from 'lodash-es';
|
|
9
9
|
import React, { useState } from 'react';
|
|
10
10
|
import SplitPane from 'react-split-pane';
|
|
11
|
+
import ClientOnly from "../../common/ClientOnly";
|
|
12
|
+
import InViewSuspense from "../../common/InViewSuspense";
|
|
11
13
|
import { NotFound } from "dumi/theme/slots/404";
|
|
12
|
-
import
|
|
13
|
-
import { CodePreview } from "dumi/theme/slots/CodePreview";
|
|
14
|
-
import { CodeHeader } from "../CodePreview/CodeHeader";
|
|
14
|
+
import CodeHeader from "../CodePreview/CodeHeader";
|
|
15
15
|
import { ic } from "../hooks";
|
|
16
16
|
import { getDemoInfo } from "./utils";
|
|
17
|
+
var CodeEditor = /*#__PURE__*/React.lazy(function () {
|
|
18
|
+
return import("dumi/theme/slots/CodeEditor");
|
|
19
|
+
});
|
|
20
|
+
var CodePreview = /*#__PURE__*/React.lazy(function () {
|
|
21
|
+
return import("dumi/theme/slots/CodePreview");
|
|
22
|
+
});
|
|
17
23
|
/**
|
|
18
24
|
* 代码编辑器 + 代码预览区域
|
|
19
25
|
*/
|
|
20
|
-
|
|
26
|
+
var CodeRunner = function CodeRunner(_ref) {
|
|
21
27
|
var exampleTopics = _ref.exampleTopics,
|
|
22
28
|
topic = _ref.topic,
|
|
23
29
|
example = _ref.example,
|
|
@@ -53,28 +59,27 @@ export var CodeRunner = function CodeRunner(_ref) {
|
|
|
53
59
|
githubUrl: githubUrl
|
|
54
60
|
});
|
|
55
61
|
var exampleId = "".concat(topic, "_").concat(example, "_").concat(demo);
|
|
56
|
-
return (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
62
|
+
return /*#__PURE__*/React.createElement(InViewSuspense, {
|
|
63
|
+
fallback: null
|
|
64
|
+
}, /*#__PURE__*/React.createElement(SplitPane, {
|
|
65
|
+
split: "vertical",
|
|
66
|
+
defaultSize: "".concat((1 - size) * 100, "%"),
|
|
67
|
+
minSize: 100
|
|
68
|
+
}, /*#__PURE__*/React.createElement(CodePreview, {
|
|
69
|
+
exampleId: exampleId,
|
|
70
|
+
error: error,
|
|
71
|
+
header: header,
|
|
72
|
+
isPlayground: isPlayground
|
|
73
|
+
}), /*#__PURE__*/React.createElement(ClientOnly, null, /*#__PURE__*/React.createElement(CodeEditor, {
|
|
74
|
+
exampleId: exampleId,
|
|
75
|
+
source: source,
|
|
76
|
+
relativePath: relativePath,
|
|
77
|
+
replaceId: replaceId,
|
|
78
|
+
onError: setError,
|
|
79
|
+
onFullscreen: setFullscreen,
|
|
80
|
+
onDestroy: noop,
|
|
81
|
+
onReady: noop,
|
|
82
|
+
playground: playground
|
|
83
|
+
}))));
|
|
84
|
+
};
|
|
85
|
+
export default CodeRunner;
|
|
@@ -26,7 +26,7 @@ var MenuIcon = createFromIconfontCN({
|
|
|
26
26
|
/**
|
|
27
27
|
* DEMO 预览页面的菜单
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
var ExampleSider = function ExampleSider(props) {
|
|
30
30
|
var currentDemo = props.currentDemo,
|
|
31
31
|
onDemoClicked = props.onDemoClicked,
|
|
32
32
|
exampleTopics = props.exampleTopics;
|
|
@@ -187,4 +187,5 @@ export var ExampleSider = function ExampleSider(props) {
|
|
|
187
187
|
setOpenKeys(keys);
|
|
188
188
|
}
|
|
189
189
|
}, renderSubMenu()));
|
|
190
|
-
};
|
|
190
|
+
};
|
|
191
|
+
export default ExampleSider;
|
|
@@ -9,7 +9,7 @@ var StyledContributorsWrapper = styled.div.withConfig({
|
|
|
9
9
|
displayName: "StyledContributorsWrapper",
|
|
10
10
|
componentId: "dumi-theme-antv-c7ef__sc-11d631u-0"
|
|
11
11
|
})(["margin-top:80px;.title{margin-bottom:14px;color:#bfbfbf;}.list{display:flex;flex-wrap:wrap;clear:both;li{height:24px;transition:all 0.3s;margin-inline-end:-8px;}&:hover{li{margin-inline-end:0;}}}"]);
|
|
12
|
-
|
|
12
|
+
var Contributors = function Contributors() {
|
|
13
13
|
var _useIntl = useIntl(),
|
|
14
14
|
formatMessage = _useIntl.formatMessage;
|
|
15
15
|
var _useSiteData$themeCon = useSiteData().themeConfig.sitePackagePath,
|
|
@@ -42,4 +42,5 @@ export var Contributors = function Contributors() {
|
|
|
42
42
|
},
|
|
43
43
|
branch: defaultBranch
|
|
44
44
|
}));
|
|
45
|
-
};
|
|
45
|
+
};
|
|
46
|
+
export default Contributors;
|
|
@@ -2,7 +2,7 @@ import { FormOutlined } from '@ant-design/icons';
|
|
|
2
2
|
import { useIntl, useRouteMeta, useSiteData } from 'dumi';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useGithubRepo } from "../../utils/github";
|
|
5
|
-
|
|
5
|
+
var EditButton = function EditButton() {
|
|
6
6
|
var meta = useRouteMeta();
|
|
7
7
|
var _useIntl = useIntl(),
|
|
8
8
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -33,4 +33,5 @@ export var EditButton = function EditButton() {
|
|
|
33
33
|
}, formatMessage({
|
|
34
34
|
id: '在 GitHub 上编辑此页'
|
|
35
35
|
})));
|
|
36
|
-
};
|
|
36
|
+
};
|
|
37
|
+
export default EditButton;
|
|
@@ -5,7 +5,8 @@ import { PageFeedbackVoteButtons } from "./PageFeedbackVoteButtons";
|
|
|
5
5
|
var StyledWrapper = styled.div.withConfig({
|
|
6
6
|
displayName: "StyledWrapper",
|
|
7
7
|
componentId: "dumi-theme-antv-c7ef__sc-1vamzhw-0"
|
|
8
|
-
})(["margin:2px 4px 8px 4px;box-shadow:0 2px 6px 0 rgba(0,0,0
|
|
9
|
-
|
|
8
|
+
})(["margin:2px 4px 8px 4px;box-shadow:0 2px 6px 0 rgba(0,0,0,0.08);border-radius:8px;padding:10px 12px;width:fit-content;background-color:#fff;font-size:14px;"]);
|
|
9
|
+
var PageFeedback = function PageFeedback() {
|
|
10
10
|
return /*#__PURE__*/React.createElement(StyledWrapper, null, /*#__PURE__*/React.createElement(PageFeedbackVoteButtons, null), /*#__PURE__*/React.createElement(PageFeedbackReasonForm, null));
|
|
11
|
-
};
|
|
11
|
+
};
|
|
12
|
+
export default PageFeedback;
|
|
@@ -14,7 +14,7 @@ var StyledWrapper = styled.div.withConfig({
|
|
|
14
14
|
displayName: "StyledWrapper",
|
|
15
15
|
componentId: "dumi-theme-antv-c7ef__sc-vcamqv-0"
|
|
16
16
|
})(["background-color:#fff;border-radius:12px;box-shadow:0 0.5rem 1.2rem #f0f1f2;transition:height 0.3s ease-in-out;width:262px;position:fixed;z-index:1001;padding:10px 18px;border-radius:8px;transition:top 0.3s ease-in-out,right 0.3s ease-in-out;"]);
|
|
17
|
-
|
|
17
|
+
var SectionFeedback = function SectionFeedback() {
|
|
18
18
|
var feedbackState = useSnapshot(feedbackStore);
|
|
19
19
|
var location = useLocation();
|
|
20
20
|
useEffect(function () {
|
|
@@ -94,4 +94,5 @@ var findClosetElement = function findClosetElement(e, elements) {
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
return closestElement;
|
|
97
|
-
};
|
|
97
|
+
};
|
|
98
|
+
export default SectionFeedback;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { useSiteData } from 'dumi';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import React, { lazy } from 'react';
|
|
3
|
+
import InViewSuspense from "../../common/InViewSuspense";
|
|
4
|
+
var EditButton = /*#__PURE__*/lazy(function () {
|
|
5
|
+
return import("./EditButton");
|
|
6
|
+
});
|
|
7
|
+
var Contributors = /*#__PURE__*/lazy(function () {
|
|
8
|
+
return import("./Contributors");
|
|
9
|
+
});
|
|
10
|
+
var SectionFeedback = /*#__PURE__*/lazy(function () {
|
|
11
|
+
return import("./SectionFeedback");
|
|
12
|
+
});
|
|
11
13
|
export var Feedback = function Feedback() {
|
|
12
14
|
var _useSiteData = useSiteData(),
|
|
13
15
|
themeConfig = _useSiteData.themeConfig;
|
|
@@ -15,5 +17,5 @@ export var Feedback = function Feedback() {
|
|
|
15
17
|
if (!feedback) {
|
|
16
18
|
return null;
|
|
17
19
|
}
|
|
18
|
-
return /*#__PURE__*/React.createElement(
|
|
20
|
+
return /*#__PURE__*/React.createElement(InViewSuspense, null, /*#__PURE__*/React.createElement(EditButton, null), /*#__PURE__*/React.createElement(Contributors, null), /*#__PURE__*/React.createElement(SectionFeedback, null));
|
|
19
21
|
};
|
|
@@ -18,7 +18,7 @@ import styles from "./index.module.less";
|
|
|
18
18
|
* 底部菜单
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
var Footer = function Footer(props) {
|
|
22
22
|
var columns = props.columns,
|
|
23
23
|
bottom = props.bottom,
|
|
24
24
|
language = props.language,
|
|
@@ -222,4 +222,5 @@ export var Footer = function Footer(props) {
|
|
|
222
222
|
href: "https://xtech.antfin.com/"
|
|
223
223
|
}, "AntV")))))
|
|
224
224
|
}, omit(restProps, ['githubUrl'])));
|
|
225
|
-
};
|
|
225
|
+
};
|
|
226
|
+
export default Footer;
|
|
@@ -8,9 +8,9 @@ import { SearchOutlined } from '@ant-design/icons';
|
|
|
8
8
|
import { Popover } from 'antd';
|
|
9
9
|
import { useIntl, useSiteData, useSiteSearch } from 'dumi';
|
|
10
10
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
11
|
-
import { SearchResult } from "./SearchResult";
|
|
12
11
|
import { getSearchResults } from "./helper";
|
|
13
12
|
import styles from "./index.module.less";
|
|
13
|
+
import { SearchResult } from "./SearchResult";
|
|
14
14
|
export var Search = function Search() {
|
|
15
15
|
var intl = useIntl();
|
|
16
16
|
var _useState = useState(false),
|