@antv/dumi-theme-antv 0.5.7-beta.3 → 0.5.7
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/hooks/useMenu.js +1 -14
- package/dist/locales/en.json +2 -27
- package/dist/locales/zh.json +3 -28
- package/dist/plugin/index.js +0 -4
- package/dist/slots/Footer/index.js +25 -6
- package/dist/slots/ManualContent/Main.js +42 -22
- package/dist/slots/_.less +6 -57
- package/package.json +15 -18
- package/dist/common/AvatarList.js +0 -123
- package/dist/model/feedback.js +0 -18
- package/dist/plugin/antVReactTechStack.js +0 -101
- package/dist/plugin/remarkFeedback.js +0 -52
- package/dist/slots/Feedback/ContributorAvatar.js +0 -42
- package/dist/slots/Feedback/Contributors.js +0 -45
- package/dist/slots/Feedback/EditButton.js +0 -37
- package/dist/slots/Feedback/PageFeedback.js +0 -11
- package/dist/slots/Feedback/PageFeedbackReasonForm.js +0 -163
- package/dist/slots/Feedback/PageFeedbackVoteButtons.js +0 -60
- package/dist/slots/Feedback/SectionFeedback.js +0 -97
- package/dist/slots/Feedback/SectionFeedbackCommentForm.js +0 -84
- package/dist/slots/Feedback/index.js +0 -20
- package/dist/slots/Feedback/service.js +0 -75
- package/dist/slots/ManualContent/PrevAndNext.js +0 -48
- package/dist/utils/github.js +0 -91
package/dist/hooks/useMenu.js
CHANGED
|
@@ -106,18 +106,5 @@ export var useMenu = function useMenu() {
|
|
|
106
106
|
var flattedMenuData = useMemo(function () {
|
|
107
107
|
return flattenMenu(menuData);
|
|
108
108
|
}, [menuData]);
|
|
109
|
-
|
|
110
|
-
// 如果当前路径不在菜单中,选中第一个有 link 的菜单项
|
|
111
|
-
if (!flattedMenuData.find(function (item) {
|
|
112
|
-
return item.link === selectedKey;
|
|
113
|
-
})) {
|
|
114
|
-
var firstValidMenuItem = flattedMenuData.find(function (item) {
|
|
115
|
-
return item.link;
|
|
116
|
-
});
|
|
117
|
-
if (firstValidMenuItem) {
|
|
118
|
-
navigate(firstValidMenuItem.link);
|
|
119
|
-
selectedKey = firstValidMenuItem.link;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return [menuData, selectedKey, flattedMenuData];
|
|
109
|
+
return [menuData, pathname, flattedMenuData];
|
|
123
110
|
};
|
package/dist/locales/en.json
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"yes": "Yes",
|
|
3
|
-
"no": "No",
|
|
4
2
|
"header.search.placeholder": "Type keywords...",
|
|
5
3
|
"header.color.mode.light": "Light Mode",
|
|
6
4
|
"header.color.mode.dark": "Dark Mode",
|
|
@@ -122,7 +120,6 @@
|
|
|
122
120
|
"在 StackBlitz 中打开": "Open in StackBlitz",
|
|
123
121
|
"HTML 代码": "Html Source Code",
|
|
124
122
|
"取消": "Cancel",
|
|
125
|
-
"提交": "Submit",
|
|
126
123
|
"关于我们": "About us",
|
|
127
124
|
"返回旧版": "Old site",
|
|
128
125
|
"查看详情": "More",
|
|
@@ -136,34 +133,12 @@
|
|
|
136
133
|
"体验科技专栏": "Ant Financial Experience Tech",
|
|
137
134
|
"帮助": "Help",
|
|
138
135
|
"蚂蚁体验科技大会": "Experience Tech Conference",
|
|
136
|
+
"WeaveFox 智能研发技术社区": "AI Developer Community",
|
|
139
137
|
"标准版基础产品": "Standard basic products",
|
|
140
138
|
"标准版扩展产品": "Standard extended products",
|
|
141
139
|
"移动定制(F版)产品": "Mobile (F series) products",
|
|
142
140
|
"感谢信赖": "WE ARE TRUSTED BY",
|
|
143
141
|
"更多产品": "More Productions",
|
|
144
|
-
"在 GitHub 上编辑此页": "Edit this page on GitHub",
|
|
145
|
-
"文档贡献者": "Contributors",
|
|
146
|
-
"这个页面对你有帮助吗?": "Was this page helpful?",
|
|
147
|
-
"如果遇到问题或发现某些功能无法正常工作,请通过": "If something is broken or if you need a reply to a problem you've encountered, please ",
|
|
148
|
-
"提交问题报告": "open an issue instead",
|
|
149
|
-
"来反馈。否则,团队将无法提供进一步的答复或获取更多信息。": ". Otherwise, the team won't be able to answer back or ask for more information.",
|
|
150
|
-
"你觉得我们可以如何改进此页面?(可选)": "How can we improve this page? (optional)",
|
|
151
|
-
"你认为这个页面有哪些做的好的地方?(可选)": "What did you like about this page? (optional)",
|
|
152
|
-
"你认为": "How can we improve",
|
|
153
|
-
"部分如何改进更好?": "section? ",
|
|
154
|
-
"谢谢你的反馈意见!": "Feedback Submitted",
|
|
155
|
-
"报错了,请稍后再试": "Error, please try again later",
|
|
156
|
-
"感谢你的支持!": "Thank you for your feedback!",
|
|
157
|
-
"如果问题持续,请前往 GitHub 提交 issue。": "Go head to GitHub issue if the problem persists.",
|
|
158
|
-
"你遇到的问题是什么?": "What kind of problem are you facing?",
|
|
159
|
-
"🚀 留下你的真实感受": "🚀 What is the reason for your feedback?",
|
|
160
|
-
"容易理解": "Easy to understand",
|
|
161
|
-
"解决了我的问题": "Resolved my problem",
|
|
162
|
-
"其它": "Other",
|
|
163
|
-
"缺少我需要的信息": "Missing the information I need",
|
|
164
|
-
"过于复杂/步骤太多": "Too complicated / Too many steps",
|
|
165
|
-
"内容更新不及时": "Out of date",
|
|
166
|
-
"示例/代码有问题": "Sample / code issue",
|
|
167
142
|
"上一篇": "Previous",
|
|
168
143
|
"下一篇": "Next",
|
|
169
144
|
"演示代码报错,请检查": "演示代码报错,请检查",
|
|
@@ -175,5 +150,5 @@
|
|
|
175
150
|
"语雀": "Yuque",
|
|
176
151
|
"企业级 Node 开发框架": "Enterprise-class Node development framework",
|
|
177
152
|
"Sketch 工具集": "Sketch Tool set",
|
|
178
|
-
"
|
|
153
|
+
"前端智能研发": "AI Coding Assistant"
|
|
179
154
|
}
|
package/dist/locales/zh.json
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"yes": "是",
|
|
3
|
-
"no": "否",
|
|
4
2
|
"header.search.placeholder": "输入关键字搜索...",
|
|
5
3
|
"header.color.mode.light": "亮色模式",
|
|
6
4
|
"header.color.mode.dark": "暗色模式",
|
|
@@ -42,7 +40,7 @@
|
|
|
42
40
|
"api.component.not.found": "未找到 {id} 组件的属性定义",
|
|
43
41
|
"content.tabs.default": "文档",
|
|
44
42
|
"content.footer.last.updated": "最后更新时间:",
|
|
45
|
-
"content.footer.actions.edit": "
|
|
43
|
+
"content.footer.actions.edit": "帮助改进此文档",
|
|
46
44
|
"content.footer.actions.previous": "上一篇",
|
|
47
45
|
"content.footer.actions.next": "下一篇",
|
|
48
46
|
"search.not.found": "未找到相关内容",
|
|
@@ -121,7 +119,6 @@
|
|
|
121
119
|
"在 StackBlitz 中打开": "在 StackBlitz 中打开",
|
|
122
120
|
"HTML 代码": "HTML 代码",
|
|
123
121
|
"取消": "取消",
|
|
124
|
-
"提交": "提交",
|
|
125
122
|
"关于我们": "关于我们",
|
|
126
123
|
"返回旧版": "返回旧版",
|
|
127
124
|
"查看详情": "查看详情",
|
|
@@ -135,34 +132,12 @@
|
|
|
135
132
|
"体验科技专栏": "体验科技专栏",
|
|
136
133
|
"帮助": "帮助",
|
|
137
134
|
"蚂蚁体验科技大会": "蚂蚁体验科技大会",
|
|
135
|
+
"WeaveFox 智能研发技术社区": "智能研发技术社区",
|
|
138
136
|
"标准版基础产品": "标准版基础产品",
|
|
139
137
|
"标准版扩展产品": "标准版扩展产品",
|
|
140
138
|
"移动定制(F版)产品": "移动定制(F版)产品",
|
|
141
139
|
"感谢信赖": "感谢信赖",
|
|
142
140
|
"更多产品": "更多产品",
|
|
143
|
-
"在 GitHub 上编辑此页": "在 GitHub 上编辑此页",
|
|
144
|
-
"文档贡献者": "文档贡献者",
|
|
145
|
-
"这个页面对你有帮助吗?": "这个页面对你有帮助吗?",
|
|
146
|
-
"如果遇到问题或发现某些功能无法正常工作,请通过": "如果遇到问题或发现某些功能无法正常工作,请通过",
|
|
147
|
-
"提交问题报告": "提交问题报告",
|
|
148
|
-
"来反馈。否则,团队将无法提供进一步的答复或获取更多信息。": "来反馈。否则,团队将无法提供进一步的答复或获取更多信息。",
|
|
149
|
-
"你觉得我们可以如何改进此页面?(可选)": "你觉得我们可以如何改进此页面?(可选)",
|
|
150
|
-
"你认为这个页面有哪些做的好的地方?(可选)": "你认为这个页面有哪些做的好的地方?(可选)",
|
|
151
|
-
"你认为": "你认为",
|
|
152
|
-
"部分如何改进更好?": "部分如何改进更好?",
|
|
153
|
-
"谢谢你的反馈意见!": "谢谢你的反馈意见!",
|
|
154
|
-
"报错了,请稍后再试": "报错了,请稍后再试",
|
|
155
|
-
"感谢你的支持!": "感谢你的支持!",
|
|
156
|
-
"如果问题持续,请前往 GitHub 提交 issue。": "如果问题持续,请前往 GitHub 提交 issue。",
|
|
157
|
-
"你遇到的问题是什么?": "你遇到的问题是什么?",
|
|
158
|
-
"🚀 留下你的真实感受": "🚀 留下你的真实感受",
|
|
159
|
-
"容易理解": "容易理解",
|
|
160
|
-
"解决了我的问题": "有效解决了我的问题",
|
|
161
|
-
"其它": "其它",
|
|
162
|
-
"缺少我需要的信息": "缺少我需要的信息",
|
|
163
|
-
"过于复杂/步骤太多": "过于复杂/步骤太多",
|
|
164
|
-
"内容更新不及时": "内容更新不及时",
|
|
165
|
-
"示例/代码有问题": "示例/代码有问题",
|
|
166
141
|
"上一篇": "上一篇",
|
|
167
142
|
"下一篇": "下一篇",
|
|
168
143
|
"演示代码报错,请检查": "演示代码报错,请检查",
|
|
@@ -174,5 +149,5 @@
|
|
|
174
149
|
"语雀": "语雀",
|
|
175
150
|
"企业级 Node 开发框架": "企业级 Node 开发框架",
|
|
176
151
|
"Sketch 工具集": "Sketch 工具集",
|
|
177
|
-
"
|
|
152
|
+
"前端智能研发": "前端智能研发"
|
|
178
153
|
}
|
package/dist/plugin/index.js
CHANGED
|
@@ -34,10 +34,8 @@ __export(plugin_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(plugin_exports);
|
|
35
35
|
var import_plugin_utils = require("dumi/plugin-utils");
|
|
36
36
|
var path = __toESM(require("path"));
|
|
37
|
-
var import_antVReactTechStack = require("./antVReactTechStack");
|
|
38
37
|
var import_examples = require("./examples");
|
|
39
38
|
var import_rehypeObservable = __toESM(require("./rehypeObservable"));
|
|
40
|
-
var import_remarkFeedback = __toESM(require("./remarkFeedback"));
|
|
41
39
|
var PAGES_DIR = (0, import_plugin_utils.winPath)(path.join(__dirname, "../pages"));
|
|
42
40
|
var MOCK_META = { frontmatter: { title: "mock-meta" }, texts: [], toc: [] };
|
|
43
41
|
var plugin_default = (api) => {
|
|
@@ -48,7 +46,6 @@ var plugin_default = (api) => {
|
|
|
48
46
|
memo.mfsu = false;
|
|
49
47
|
memo.jsMinifier = "terser";
|
|
50
48
|
memo.favicons = ["https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*7svFR6wkPMoAAAAAAAAAAAAADmJ7AQ/original"];
|
|
51
|
-
memo.extraRemarkPlugins = memo.themeConfig.feedback ? [import_remarkFeedback.default] : [];
|
|
52
49
|
memo.extraRehypePlugins = [import_rehypeObservable.default];
|
|
53
50
|
return memo;
|
|
54
51
|
});
|
|
@@ -138,5 +135,4 @@ export default function ThemeAntVContextWrapper() {
|
|
|
138
135
|
return routes;
|
|
139
136
|
});
|
|
140
137
|
api.addTmpGenerateWatcherPaths(() => [path.resolve(process.cwd(), "examples")]);
|
|
141
|
-
api.registerTechStack(() => new import_antVReactTechStack.AntVReactTechStack());
|
|
142
138
|
};
|
|
@@ -68,6 +68,13 @@ export var Footer = function Footer(props) {
|
|
|
68
68
|
}),
|
|
69
69
|
url: 'https://github.com/alibaba/hooks',
|
|
70
70
|
openExternal: true
|
|
71
|
+
}, {
|
|
72
|
+
title: 'WeaveFox',
|
|
73
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
74
|
+
id: "\u524D\u7AEF\u667A\u80FD\u7814\u53D1"
|
|
75
|
+
}),
|
|
76
|
+
url: 'https://github.com/weavefox',
|
|
77
|
+
openExternal: true
|
|
71
78
|
}]
|
|
72
79
|
};
|
|
73
80
|
var col2 = {
|
|
@@ -96,6 +103,17 @@ export var Footer = function Footer(props) {
|
|
|
96
103
|
}),
|
|
97
104
|
url: 'https://seeconf.antfin.com/',
|
|
98
105
|
openExternal: true
|
|
106
|
+
}, {
|
|
107
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
108
|
+
src: "https://mdn.alipayobjects.com/huamei_4qpv3u/afts/img/iH6wQKX4WCYAAAAAAAAAAAAAeocTAQFr/original",
|
|
109
|
+
alt: "weavefox"
|
|
110
|
+
}),
|
|
111
|
+
title: 'WeaveFox',
|
|
112
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
113
|
+
id: "WeaveFox \u667A\u80FD\u7814\u53D1\u6280\u672F\u793E\u533A"
|
|
114
|
+
}),
|
|
115
|
+
url: 'https://www.yuque.com/weavefox/blog',
|
|
116
|
+
openExternal: true
|
|
99
117
|
}]
|
|
100
118
|
};
|
|
101
119
|
var col3 = {
|
|
@@ -179,17 +197,18 @@ export var Footer = function Footer(props) {
|
|
|
179
197
|
}),
|
|
180
198
|
title: 'Galacean',
|
|
181
199
|
description: '互动图形解决方案',
|
|
182
|
-
url: 'https://galacean.antgroup.com
|
|
200
|
+
url: 'https://galacean.antgroup.com',
|
|
183
201
|
openExternal: true
|
|
184
202
|
}, {
|
|
185
203
|
icon: /*#__PURE__*/React.createElement("img", {
|
|
186
|
-
src: "https://
|
|
187
|
-
alt: "
|
|
204
|
+
src: "https://mdn.alipayobjects.com/huamei_4qpv3u/afts/img/iH6wQKX4WCYAAAAAAAAAAAAAeocTAQFr/original",
|
|
205
|
+
alt: "weavefox"
|
|
188
206
|
}),
|
|
189
|
-
title:
|
|
190
|
-
|
|
207
|
+
title: 'WeaveFox',
|
|
208
|
+
description: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
209
|
+
id: "\u524D\u7AEF\u667A\u80FD\u7814\u53D1"
|
|
191
210
|
}),
|
|
192
|
-
url: 'https://
|
|
211
|
+
url: 'https://weavefox.alipay.com',
|
|
193
212
|
openExternal: true
|
|
194
213
|
}]
|
|
195
214
|
};
|
|
@@ -1,9 +1,3 @@
|
|
|
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
|
-
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
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
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."); }
|
|
9
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); }
|
|
@@ -12,31 +6,51 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
12
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
7
|
import { VerticalAlignTopOutlined } from '@ant-design/icons';
|
|
14
8
|
import { BackTop, Layout } from 'antd';
|
|
15
|
-
import { useRouteMeta
|
|
16
|
-
import React from 'react';
|
|
9
|
+
import { useRouteMeta } from 'dumi';
|
|
10
|
+
import React, { useMemo } from 'react';
|
|
17
11
|
import { useMedia } from 'react-use';
|
|
18
12
|
import readingTime from 'reading-time';
|
|
19
13
|
import { useMenu } from "../../hooks/useMenu";
|
|
20
14
|
import { ContentTable } from "dumi/theme/slots/ContentTable";
|
|
21
|
-
import {
|
|
22
|
-
import styles from "./index.module.less";
|
|
23
|
-
import { PrevAndNext } from "./PrevAndNext";
|
|
15
|
+
import { NavigatorBanner } from "./NavigatorBanner";
|
|
24
16
|
import ReadingTime from "./ReadingTime";
|
|
17
|
+
import styles from "./index.module.less";
|
|
25
18
|
import { usePreview } from "./usePreview";
|
|
26
19
|
export var Main = function Main(_ref) {
|
|
27
20
|
var children = _ref.children;
|
|
28
21
|
var meta = useRouteMeta();
|
|
29
|
-
var _useSiteData = useSiteData(),
|
|
30
|
-
themeConfig = _useSiteData.themeConfig;
|
|
31
|
-
var feedback = themeConfig.feedback;
|
|
32
22
|
var text = meta.texts.reduce(function (prev, next) {
|
|
33
23
|
return prev + next.value;
|
|
34
24
|
}, '');
|
|
35
25
|
var _readingTime = readingTime(text),
|
|
36
26
|
time = _readingTime.time;
|
|
37
27
|
var _useMenu = useMenu(),
|
|
38
|
-
_useMenu2 = _slicedToArray(_useMenu,
|
|
39
|
-
selectedKey = _useMenu2[1]
|
|
28
|
+
_useMenu2 = _slicedToArray(_useMenu, 3),
|
|
29
|
+
selectedKey = _useMenu2[1],
|
|
30
|
+
flattenMenuItems = _useMenu2[2];
|
|
31
|
+
var _useMemo = useMemo(function () {
|
|
32
|
+
if (!flattenMenuItems) {
|
|
33
|
+
return [undefined, undefined];
|
|
34
|
+
}
|
|
35
|
+
var activeMenuItemIndex = -1;
|
|
36
|
+
flattenMenuItems.forEach(function (menuItem, i) {
|
|
37
|
+
if (menuItem && menuItem.key === selectedKey) {
|
|
38
|
+
activeMenuItemIndex = i;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var prevItem = flattenMenuItems[activeMenuItemIndex - 1];
|
|
42
|
+
var nextItem = flattenMenuItems[activeMenuItemIndex + 1];
|
|
43
|
+
return [prevItem ? {
|
|
44
|
+
slug: prevItem.link,
|
|
45
|
+
title: prevItem.title
|
|
46
|
+
} : undefined, nextItem ? {
|
|
47
|
+
slug: nextItem.link,
|
|
48
|
+
title: nextItem.title
|
|
49
|
+
} : undefined];
|
|
50
|
+
}, [flattenMenuItems, selectedKey]),
|
|
51
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
52
|
+
prev = _useMemo2[0],
|
|
53
|
+
next = _useMemo2[1];
|
|
40
54
|
var is991Wide = useMedia('(min-width: 991.99px)', true);
|
|
41
55
|
var showToc = is991Wide && meta.frontmatter.showToc !== false;
|
|
42
56
|
usePreview({}, selectedKey);
|
|
@@ -53,15 +67,21 @@ export var Main = function Main(_ref) {
|
|
|
53
67
|
className: styles.readtime
|
|
54
68
|
})), /*#__PURE__*/React.createElement("div", {
|
|
55
69
|
className: styles.markdown
|
|
56
|
-
}, children), /*#__PURE__*/React.createElement(
|
|
57
|
-
|
|
70
|
+
}, children), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: styles.preandnext
|
|
72
|
+
}, /*#__PURE__*/React.createElement(NavigatorBanner, {
|
|
73
|
+
type: "prev",
|
|
74
|
+
post: prev
|
|
75
|
+
}), /*#__PURE__*/React.createElement(NavigatorBanner, {
|
|
76
|
+
type: "next",
|
|
77
|
+
post: next
|
|
78
|
+
}), /*#__PURE__*/React.createElement(BackTop, {
|
|
79
|
+
style: {
|
|
58
80
|
right: 32
|
|
59
|
-
}
|
|
60
|
-
bottom: 100
|
|
61
|
-
})
|
|
81
|
+
}
|
|
62
82
|
}, /*#__PURE__*/React.createElement("div", {
|
|
63
83
|
className: styles.backTop
|
|
64
|
-
}, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null)))), showToc && /*#__PURE__*/React.createElement(Layout.Sider, {
|
|
84
|
+
}, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null))))))), showToc && /*#__PURE__*/React.createElement(Layout.Sider, {
|
|
65
85
|
theme: "light",
|
|
66
86
|
width: 260
|
|
67
87
|
}, /*#__PURE__*/React.createElement("div", {
|
package/dist/slots/_.less
CHANGED
|
@@ -2,62 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
@primary-color: #873bf4;
|
|
4
4
|
|
|
5
|
-
.ant-btn,
|
|
6
|
-
.ant-input,
|
|
7
|
-
.ant-notification-notice,
|
|
8
|
-
.ant-select-selector {
|
|
9
|
-
border-radius: 8px !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// 段落反馈
|
|
13
|
-
.comment-link {
|
|
14
|
-
float: right;
|
|
15
|
-
color: #6d7c92;
|
|
16
|
-
transform: scale(0.9);
|
|
17
|
-
transition: background 0.3s, color 0.3s;
|
|
18
|
-
|
|
19
|
-
&:hover {
|
|
20
|
-
color: #873bf4;
|
|
21
|
-
background-color: #f8f1ff;
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
h1,
|
|
27
|
-
h2,
|
|
28
|
-
h3,
|
|
29
|
-
h4,
|
|
30
|
-
h5,
|
|
31
|
-
h6 {
|
|
32
|
-
> a[aria-hidden]:first-child {
|
|
33
|
-
float: left;
|
|
34
|
-
width: 20px;
|
|
35
|
-
font-size: 0;
|
|
36
|
-
line-height: inherit;
|
|
37
|
-
text-align: right;
|
|
38
|
-
padding-inline-end: 6px;
|
|
39
|
-
margin-inline-start: -20px;
|
|
40
|
-
|
|
41
|
-
&:hover {
|
|
42
|
-
border: 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
> .icon-link::before {
|
|
46
|
-
font-size: 20px;
|
|
47
|
-
content: '#';
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&:not(:hover) > a[aria-hidden]:first-child > .icon-link {
|
|
52
|
-
visibility: hidden;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
5
|
.container1440() {
|
|
57
6
|
width: 1440px;
|
|
58
7
|
max-width: calc(100% - 80px);
|
|
59
|
-
margin-right: auto;
|
|
60
8
|
margin-left: auto;
|
|
9
|
+
margin-right: auto;
|
|
61
10
|
|
|
62
11
|
@media only screen and (max-width: 931.99px) {
|
|
63
12
|
& {
|
|
@@ -81,23 +30,23 @@ h6 {
|
|
|
81
30
|
}
|
|
82
31
|
|
|
83
32
|
.Resizer {
|
|
33
|
+
background: #000;
|
|
34
|
+
opacity: 0.1;
|
|
84
35
|
z-index: 1;
|
|
85
36
|
box-sizing: border-box;
|
|
86
|
-
background: #000;
|
|
87
37
|
background-clip: padding-box;
|
|
88
|
-
opacity: 0.1;
|
|
89
38
|
|
|
90
39
|
&:hover {
|
|
91
40
|
transition: all 2s ease;
|
|
92
41
|
}
|
|
93
42
|
|
|
94
43
|
&.horizontal {
|
|
95
|
-
width: 100%;
|
|
96
44
|
height: 11px;
|
|
97
45
|
margin: -5px 0;
|
|
98
46
|
border-top: 5px solid rgba(255, 255, 255, 0);
|
|
99
47
|
border-bottom: 5px solid rgba(255, 255, 255, 0);
|
|
100
48
|
cursor: row-resize;
|
|
49
|
+
width: 100%;
|
|
101
50
|
|
|
102
51
|
&:hover {
|
|
103
52
|
border-top: 5px solid rgba(0, 0, 0, 0.5);
|
|
@@ -108,8 +57,8 @@ h6 {
|
|
|
108
57
|
&.vertical {
|
|
109
58
|
width: 11px;
|
|
110
59
|
margin: 0 -5px;
|
|
111
|
-
border-right: 5px solid rgba(255, 255, 255, 0);
|
|
112
60
|
border-left: 5px solid rgba(255, 255, 255, 0);
|
|
61
|
+
border-right: 5px solid rgba(255, 255, 255, 0);
|
|
113
62
|
cursor: col-resize;
|
|
114
63
|
|
|
115
64
|
Pane2 {
|
|
@@ -117,8 +66,8 @@ h6 {
|
|
|
117
66
|
}
|
|
118
67
|
|
|
119
68
|
&:hover {
|
|
120
|
-
border-right: 5px solid rgba(0, 0, 0, 0.5);
|
|
121
69
|
border-left: 5px solid rgba(0, 0, 0, 0.5);
|
|
70
|
+
border-right: 5px solid rgba(0, 0, 0, 0.5);
|
|
122
71
|
}
|
|
123
72
|
}
|
|
124
73
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/dumi-theme-antv",
|
|
3
|
-
"version": "0.5.7
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "AntV website theme based on dumi2.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dumi",
|
|
@@ -20,6 +20,17 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "npm run prepare && father build",
|
|
25
|
+
"dev": "father dev",
|
|
26
|
+
"fix": "prettier ./src --write",
|
|
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
|
+
"start": "cd example && npm run dev"
|
|
33
|
+
},
|
|
23
34
|
"commitlint": {
|
|
24
35
|
"extends": [
|
|
25
36
|
"@commitlint/config-conventional"
|
|
@@ -49,7 +60,6 @@
|
|
|
49
60
|
"@docsearch/css": "^3.8.0",
|
|
50
61
|
"@docsearch/react": "^3.8.0",
|
|
51
62
|
"@monaco-editor/react": "^4.6.0",
|
|
52
|
-
"@petercatai/assistant": "^2.0.17",
|
|
53
63
|
"@stackblitz/sdk": "^1.11.0",
|
|
54
64
|
"antd": "^4.24.16",
|
|
55
65
|
"classnames": "^2.5.1",
|
|
@@ -57,12 +67,12 @@
|
|
|
57
67
|
"d3-dsv": "^3.0.1",
|
|
58
68
|
"docsearch.js": "^2.6.3",
|
|
59
69
|
"front-matter": "^4.0.2",
|
|
70
|
+
"@petercatai/assistant": "^2.0.17",
|
|
60
71
|
"fs-extra": "^10.1.0",
|
|
61
72
|
"glob": "^8.1.0",
|
|
62
73
|
"hast": "^1.0.0",
|
|
63
74
|
"indent-string": "^5.0.0",
|
|
64
75
|
"insert-css": "^2.0.0",
|
|
65
|
-
"leancloud-storage": "^4.15.2",
|
|
66
76
|
"lodash-es": "^4.17.21",
|
|
67
77
|
"monaco-editor": "^0.25.2",
|
|
68
78
|
"nprogress": "^0.2.0",
|
|
@@ -86,9 +96,6 @@
|
|
|
86
96
|
"semver": "^7.6.3",
|
|
87
97
|
"size-sensor": "^1.0.2",
|
|
88
98
|
"slick-carousel": "^1.8.1",
|
|
89
|
-
"styled-components": "^6.1.14",
|
|
90
|
-
"swr": "^2.2.5",
|
|
91
|
-
"sylvanas": "^0.6.1",
|
|
92
99
|
"unified": "^10.1.2",
|
|
93
100
|
"unist-util-visit": "^4.1.2",
|
|
94
101
|
"uri-parse": "^1.0.0",
|
|
@@ -109,7 +116,6 @@
|
|
|
109
116
|
"@types/react": "^18.3.12",
|
|
110
117
|
"@types/react-router-dom": "^5.3.3",
|
|
111
118
|
"@types/react-slick": "^0.23.13",
|
|
112
|
-
"@types/styled-components": "^5.1.34",
|
|
113
119
|
"@umijs/lint": "^4.3.34",
|
|
114
120
|
"dumi": "^2.4.13",
|
|
115
121
|
"eslint": "^8.57.1",
|
|
@@ -134,14 +140,5 @@
|
|
|
134
140
|
"authors": [
|
|
135
141
|
"dumi",
|
|
136
142
|
"antv"
|
|
137
|
-
]
|
|
138
|
-
|
|
139
|
-
"build": "npm run prepare && father build",
|
|
140
|
-
"dev": "father dev",
|
|
141
|
-
"fix": "prettier ./src --write",
|
|
142
|
-
"lint": "npm run lint:es && npm run lint:css",
|
|
143
|
-
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
144
|
-
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
145
|
-
"start": "cd example && npm run dev"
|
|
146
|
-
}
|
|
147
|
-
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
@@ -1,123 +0,0 @@
|
|
|
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
|
-
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
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
|
-
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); } }
|
|
9
|
-
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); }); }; }
|
|
10
|
-
/**
|
|
11
|
-
* Github Contributors Avatar List
|
|
12
|
-
*/
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import useSWR from 'swr';
|
|
15
|
-
// 获取头像列表
|
|
16
|
-
var getAvatarList = /*#__PURE__*/function () {
|
|
17
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
18
|
-
var fileName, repo, owner, branch, url, data;
|
|
19
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
20
|
-
while (1) switch (_context.prev = _context.next) {
|
|
21
|
-
case 0:
|
|
22
|
-
fileName = _ref.fileName, repo = _ref.repo, owner = _ref.owner, branch = _ref.branch;
|
|
23
|
-
url = "https://proapi.azurewebsites.net/doc/getAvatarList?filename=".concat(fileName, "&owner=").concat(owner, "&repo=").concat(repo, "&branch=").concat(branch);
|
|
24
|
-
_context.next = 4;
|
|
25
|
-
return fetch(url, {
|
|
26
|
-
mode: 'cors'
|
|
27
|
-
}).then(function (res) {
|
|
28
|
-
return res.json();
|
|
29
|
-
}).catch(function (e) {
|
|
30
|
-
return console.log(e);
|
|
31
|
-
});
|
|
32
|
-
case 4:
|
|
33
|
-
data = _context.sent;
|
|
34
|
-
if (data) {
|
|
35
|
-
_context.next = 7;
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
return _context.abrupt("return", []);
|
|
39
|
-
case 7:
|
|
40
|
-
return _context.abrupt("return", data);
|
|
41
|
-
case 8:
|
|
42
|
-
case "end":
|
|
43
|
-
return _context.stop();
|
|
44
|
-
}
|
|
45
|
-
}, _callee);
|
|
46
|
-
}));
|
|
47
|
-
return function getAvatarList(_x) {
|
|
48
|
-
return _ref2.apply(this, arguments);
|
|
49
|
-
};
|
|
50
|
-
}();
|
|
51
|
-
var AvatarList = function AvatarList(_ref3) {
|
|
52
|
-
var className = _ref3.className,
|
|
53
|
-
renderItem = _ref3.renderItem,
|
|
54
|
-
repo = _ref3.repo,
|
|
55
|
-
owner = _ref3.owner,
|
|
56
|
-
style = _ref3.style,
|
|
57
|
-
fileName = _ref3.fileName,
|
|
58
|
-
_ref3$filter = _ref3.filter,
|
|
59
|
-
filter = _ref3$filter === void 0 ? function () {
|
|
60
|
-
return true;
|
|
61
|
-
} : _ref3$filter,
|
|
62
|
-
emptyRender = _ref3.emptyRender,
|
|
63
|
-
_ref3$branch = _ref3.branch,
|
|
64
|
-
branch = _ref3$branch === void 0 ? 'master' : _ref3$branch;
|
|
65
|
-
var _useSWR = useSWR("/doc/getAvatarList?filename=".concat(fileName, "&owner=").concat(owner, "&repo=").concat(repo, "&branch=").concat(branch), function () {
|
|
66
|
-
return getAvatarList({
|
|
67
|
-
owner: owner,
|
|
68
|
-
repo: repo,
|
|
69
|
-
fileName: fileName,
|
|
70
|
-
branch: branch
|
|
71
|
-
});
|
|
72
|
-
}),
|
|
73
|
-
data = _useSWR.data,
|
|
74
|
-
isLoading = _useSWR.isLoading;
|
|
75
|
-
if (isLoading) {
|
|
76
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
77
|
-
className: className,
|
|
78
|
-
style: _objectSpread({
|
|
79
|
-
display: 'flex',
|
|
80
|
-
listStyle: 'none',
|
|
81
|
-
margin: 0,
|
|
82
|
-
padding: 0
|
|
83
|
-
}, style)
|
|
84
|
-
}, renderItem && renderItem({}, true) || /*#__PURE__*/React.createElement("span", null, "loading"));
|
|
85
|
-
}
|
|
86
|
-
var displayList = (data === null || data === void 0 ? void 0 : data.filter(filter)) || [];
|
|
87
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("ul", {
|
|
88
|
-
className: className,
|
|
89
|
-
style: _objectSpread({
|
|
90
|
-
display: 'flex',
|
|
91
|
-
boxSizing: 'border-box',
|
|
92
|
-
listStyle: 'none',
|
|
93
|
-
margin: 0,
|
|
94
|
-
padding: 0,
|
|
95
|
-
flexFlow: 'wrap'
|
|
96
|
-
}, style)
|
|
97
|
-
}, displayList.map(function (item) {
|
|
98
|
-
if (renderItem) {
|
|
99
|
-
return renderItem(item, isLoading);
|
|
100
|
-
}
|
|
101
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
102
|
-
key: item.username,
|
|
103
|
-
style: {
|
|
104
|
-
marginRight: 8,
|
|
105
|
-
borderRadius: 20,
|
|
106
|
-
boxSizing: 'border-box',
|
|
107
|
-
overflow: 'hidden',
|
|
108
|
-
border: '1px solid #ddd',
|
|
109
|
-
display: 'flex'
|
|
110
|
-
}
|
|
111
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
112
|
-
href: "https://github.com/".concat(item.username),
|
|
113
|
-
style: {
|
|
114
|
-
display: 'flex'
|
|
115
|
-
}
|
|
116
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
117
|
-
width: 40,
|
|
118
|
-
src: item.url,
|
|
119
|
-
alt: item.username
|
|
120
|
-
})));
|
|
121
|
-
}), displayList.length === 0 && emptyRender && emptyRender(fileName, owner, repo, branch)));
|
|
122
|
-
};
|
|
123
|
-
export default AvatarList;
|