x-star-design 0.0.16 → 0.0.18
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/ali-player/index.d.ts +26 -0
- package/dist/ali-player/index.js +86 -0
- package/dist/assets/contact-button/wechatCode.jpg +0 -0
- package/dist/assets/contact-button/xcQrCode.png +0 -0
- package/dist/code-detail-modal/define.d.ts +13 -0
- package/dist/code-detail-modal/define.js +1 -0
- package/dist/code-detail-modal/index.d.ts +10 -0
- package/dist/code-detail-modal/index.js +126 -0
- package/dist/contact-button/index.d.ts +3 -0
- package/dist/contact-button/index.js +39 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/locales/en_US.d.ts +19 -0
- package/dist/locales/en_US.js +19 -0
- package/dist/locales/index.d.ts +78 -2
- package/dist/locales/zh_CN.d.ts +19 -0
- package/dist/locales/zh_CN.js +19 -0
- package/dist/styles/index.css +26 -0
- package/dist/types/svg.d.ts +6 -0
- package/package.json +2 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Aliplayer 配置
|
|
4
|
+
*/
|
|
5
|
+
export interface AliplayerConfig {
|
|
6
|
+
vid: string;
|
|
7
|
+
playauth: string;
|
|
8
|
+
autoplay: boolean;
|
|
9
|
+
language: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Aliplayer 实例
|
|
13
|
+
*/
|
|
14
|
+
export interface AliplayerInstance {
|
|
15
|
+
seek: (time: number) => void;
|
|
16
|
+
getCurrentTime: () => number;
|
|
17
|
+
setPlayerSize: (width: string, height: string) => void;
|
|
18
|
+
dispose: () => void;
|
|
19
|
+
on: (event: string, handler: () => void) => void;
|
|
20
|
+
}
|
|
21
|
+
interface AliplayerProps {
|
|
22
|
+
config: AliplayerConfig;
|
|
23
|
+
onCreate?: (player: AliplayerInstance) => void;
|
|
24
|
+
}
|
|
25
|
+
declare const Aliplayer: ({ config, onCreate }: AliplayerProps) => React.JSX.Element;
|
|
26
|
+
export default Aliplayer;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { useMemoizedFn, useSize, useUnmount } from 'ahooks';
|
|
3
|
+
import React, { useEffect, useMemo, useRef } from 'react';
|
|
4
|
+
import { randomString } from 'x-star-utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Aliplayer 配置
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Aliplayer 实例
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var Aliplayer = function Aliplayer(_ref) {
|
|
15
|
+
var config = _ref.config,
|
|
16
|
+
onCreate = _ref.onCreate;
|
|
17
|
+
var id = useMemo(function () {
|
|
18
|
+
return "aliplayer-".concat(randomString(8));
|
|
19
|
+
}, []);
|
|
20
|
+
var wrapper = useRef(null);
|
|
21
|
+
var player = useRef();
|
|
22
|
+
var size = useSize(wrapper);
|
|
23
|
+
var importAliPlayer = function importAliPlayer() {
|
|
24
|
+
var link = window.document.createElement('link');
|
|
25
|
+
link.rel = 'stylesheet';
|
|
26
|
+
link.href = 'https://g.alicdn.com/de/prismplayer/2.11.0/skins/default/aliplayer-min.css';
|
|
27
|
+
var scirpt = window.document.createElement('script');
|
|
28
|
+
scirpt.type = 'text/javascript';
|
|
29
|
+
scirpt.src = 'https://g.alicdn.com/de/prismplayer/2.11.0/aliplayer-h5-min.js';
|
|
30
|
+
var head = window.document.querySelector('head');
|
|
31
|
+
head === null || head === void 0 ? void 0 : head.append(link);
|
|
32
|
+
head === null || head === void 0 ? void 0 : head.append(scirpt);
|
|
33
|
+
};
|
|
34
|
+
if (!window.Aliplayer) {
|
|
35
|
+
importAliPlayer();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 根据宽度调整高度,比例为 16:9
|
|
39
|
+
*/
|
|
40
|
+
var resize = useMemoizedFn(function () {
|
|
41
|
+
return player.current && size && player.current.setPlayerSize("".concat(size.width, "px"), "".concat(size.width / 16 * 9, "px"));
|
|
42
|
+
});
|
|
43
|
+
useEffect(resize, [size, resize]);
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
if (!(config !== null && config !== void 0 && config.playauth && config !== null && config !== void 0 && config.vid)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (player.current) player.current.dispose();
|
|
49
|
+
var create = function create() {
|
|
50
|
+
var run = function run(retry) {
|
|
51
|
+
var Aliplayer = window.Aliplayer;
|
|
52
|
+
if (Aliplayer) {
|
|
53
|
+
// 创建 Aliplayer 实例
|
|
54
|
+
player.current = new Aliplayer(_objectSpread(_objectSpread({}, config), {}, {
|
|
55
|
+
id: id
|
|
56
|
+
}), function (player) {
|
|
57
|
+
return onCreate === null || onCreate === void 0 ? void 0 : onCreate(player);
|
|
58
|
+
});
|
|
59
|
+
resize();
|
|
60
|
+
} else if (retry > 0) {
|
|
61
|
+
// 轮询获取 Aliplayer 类
|
|
62
|
+
window.setTimeout(function () {
|
|
63
|
+
return run(retry - 1);
|
|
64
|
+
}, 100);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
window.setTimeout(function () {
|
|
68
|
+
return run(100);
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
create();
|
|
72
|
+
}, [config === null || config === void 0 ? void 0 : config.vid, config === null || config === void 0 ? void 0 : config.playauth, id, resize, onCreate]);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 组件卸载时销毁 Aliplayer
|
|
76
|
+
*/
|
|
77
|
+
useUnmount(function () {
|
|
78
|
+
return player.current && player.current.dispose();
|
|
79
|
+
});
|
|
80
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
ref: wrapper
|
|
82
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
id: id
|
|
84
|
+
}));
|
|
85
|
+
};
|
|
86
|
+
export default Aliplayer;
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LangId } from '../code-mirror-wrapper/define';
|
|
2
|
+
export interface CodeDetail {
|
|
3
|
+
problemNameZh: string;
|
|
4
|
+
problemNameEn: string;
|
|
5
|
+
detail: string;
|
|
6
|
+
language: LangId;
|
|
7
|
+
status: string;
|
|
8
|
+
source: string;
|
|
9
|
+
score: number;
|
|
10
|
+
memory: number;
|
|
11
|
+
submissionTime: number;
|
|
12
|
+
link?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModalProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CodeDetail } from './define';
|
|
4
|
+
interface CodeDetailModalProps extends ModalProps {
|
|
5
|
+
codeData: CodeDetail;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const CodeDetailModal: React.FC<CodeDetailModalProps>;
|
|
10
|
+
export default CodeDetailModal;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["codeData", "open", "onCancel"];
|
|
5
|
+
import { DownloadOutlined } from '@ant-design/icons';
|
|
6
|
+
import { Button, Modal, Table } from 'antd';
|
|
7
|
+
import dayjs from 'dayjs';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import { getTransResult } from 'x-star-utils';
|
|
10
|
+
import CodeMirrorWrapper from "../code-mirror-wrapper";
|
|
11
|
+
import { Theme } from "../code-mirror-wrapper/define";
|
|
12
|
+
import ConfigProviderWrapper from "../config-provider-wrapper";
|
|
13
|
+
import { useLocale } from "../locales";
|
|
14
|
+
import SubmissionStatus from "../submission-status";
|
|
15
|
+
import { prefix } from "../utils/global";
|
|
16
|
+
var CodeDetailModal = function CodeDetailModal(_ref) {
|
|
17
|
+
var codeData = _ref.codeData,
|
|
18
|
+
open = _ref.open,
|
|
19
|
+
onCancel = _ref.onCancel,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var _useLocale = useLocale('CodeDetailModal'),
|
|
22
|
+
t = _useLocale.format,
|
|
23
|
+
locale = _useLocale.locale;
|
|
24
|
+
var lang = locale === 'zh_CN' ? 'zh' : 'en';
|
|
25
|
+
var _useState = useState(false),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
showCode = _useState2[0],
|
|
28
|
+
setShowCode = _useState2[1];
|
|
29
|
+
var columns = [{
|
|
30
|
+
key: 'problemNameZh',
|
|
31
|
+
align: 'center',
|
|
32
|
+
title: t('Problem'),
|
|
33
|
+
dataIndex: 'problemNameZh',
|
|
34
|
+
render: function render(_, record) {
|
|
35
|
+
return getTransResult(lang, record === null || record === void 0 ? void 0 : record.problemNameZh, record === null || record === void 0 ? void 0 : record.problemNameEn);
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
key: 'language',
|
|
39
|
+
align: 'center',
|
|
40
|
+
title: t('Language'),
|
|
41
|
+
dataIndex: 'language'
|
|
42
|
+
}, {
|
|
43
|
+
key: 'status',
|
|
44
|
+
align: 'center',
|
|
45
|
+
title: t('Status'),
|
|
46
|
+
dataIndex: 'status',
|
|
47
|
+
render: function render(status) {
|
|
48
|
+
return /*#__PURE__*/React.createElement(SubmissionStatus, {
|
|
49
|
+
status: status
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
key: 'score',
|
|
54
|
+
align: 'center',
|
|
55
|
+
title: t('Score'),
|
|
56
|
+
dataIndex: 'score',
|
|
57
|
+
render: function render(score) {
|
|
58
|
+
return score ? /*#__PURE__*/React.createElement("span", null, score) : '-';
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: 'memory',
|
|
62
|
+
align: 'center',
|
|
63
|
+
title: t('Memory'),
|
|
64
|
+
dataIndex: 'memory',
|
|
65
|
+
render: function render(memory) {
|
|
66
|
+
return "".concat(memory, "KB");
|
|
67
|
+
}
|
|
68
|
+
}, (codeData === null || codeData === void 0 ? void 0 : codeData.language) === 'plain' // 'plain' language
|
|
69
|
+
? {
|
|
70
|
+
key: 'download',
|
|
71
|
+
align: 'center',
|
|
72
|
+
title: t('File'),
|
|
73
|
+
dataIndex: 'link',
|
|
74
|
+
render: function render(v) {
|
|
75
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
76
|
+
href: v
|
|
77
|
+
}, /*#__PURE__*/React.createElement(DownloadOutlined, null));
|
|
78
|
+
}
|
|
79
|
+
} : {
|
|
80
|
+
key: 'code',
|
|
81
|
+
align: 'center',
|
|
82
|
+
title: t('Code'),
|
|
83
|
+
render: function render() {
|
|
84
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
85
|
+
rel: "noreferrer",
|
|
86
|
+
onClick: function onClick() {
|
|
87
|
+
return setShowCode(!showCode);
|
|
88
|
+
}
|
|
89
|
+
}, showCode ? t('Show') : t('Hide'));
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: 'submissionTime',
|
|
93
|
+
align: 'center',
|
|
94
|
+
title: t('Submission_Time'),
|
|
95
|
+
dataIndex: 'submissionTime',
|
|
96
|
+
render: function render(v) {
|
|
97
|
+
return v ? /*#__PURE__*/React.createElement("span", null, dayjs.unix(v).format('YYYY-MM-DD HH:mm:ss (UTCZ)')) : '-';
|
|
98
|
+
}
|
|
99
|
+
}];
|
|
100
|
+
return /*#__PURE__*/React.createElement(ConfigProviderWrapper, null, /*#__PURE__*/React.createElement(Modal, _extends({
|
|
101
|
+
title: t('Code_Detail'),
|
|
102
|
+
afterClose: function afterClose() {
|
|
103
|
+
return setShowCode(false);
|
|
104
|
+
},
|
|
105
|
+
open: open,
|
|
106
|
+
onCancel: onCancel,
|
|
107
|
+
width: '60%',
|
|
108
|
+
footer: null
|
|
109
|
+
}, props), /*#__PURE__*/React.createElement(Table, {
|
|
110
|
+
pagination: false,
|
|
111
|
+
columns: columns,
|
|
112
|
+
dataSource: [codeData],
|
|
113
|
+
rowKey: 'problemNameZh'
|
|
114
|
+
}), showCode ? (codeData === null || codeData === void 0 ? void 0 : codeData.language) === 'plain' ? /*#__PURE__*/React.createElement(Button, {
|
|
115
|
+
type: "link",
|
|
116
|
+
icon: /*#__PURE__*/React.createElement(DownloadOutlined, null),
|
|
117
|
+
href: codeData === null || codeData === void 0 ? void 0 : codeData.link
|
|
118
|
+
}, t('Download_File')) : /*#__PURE__*/React.createElement(CodeMirrorWrapper, {
|
|
119
|
+
lang: codeData === null || codeData === void 0 ? void 0 : codeData.language,
|
|
120
|
+
theme: Theme.LIGHT,
|
|
121
|
+
value: codeData === null || codeData === void 0 ? void 0 : codeData.source
|
|
122
|
+
}) : /*#__PURE__*/React.createElement("pre", {
|
|
123
|
+
className: "".concat(prefix, "codeCompileResult")
|
|
124
|
+
}, /*#__PURE__*/React.createElement("code", null, codeData.detail))));
|
|
125
|
+
};
|
|
126
|
+
export default CodeDetailModal;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { QrcodeOutlined } from '@ant-design/icons';
|
|
2
|
+
import { Card, Popover, Space } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { getTransResult } from 'x-star-utils';
|
|
5
|
+
import wechatCode from "../assets/contact-button/wechatCode.jpg";
|
|
6
|
+
import xcQrCode from "../assets/contact-button/xcQrCode.png";
|
|
7
|
+
import ConfigProviderWrapper from "../config-provider-wrapper";
|
|
8
|
+
import { useLocale } from "../locales";
|
|
9
|
+
import { prefix } from "../utils/global";
|
|
10
|
+
var ContactButton = function ContactButton() {
|
|
11
|
+
var _useLocale = useLocale('ContactButton'),
|
|
12
|
+
t = _useLocale.format,
|
|
13
|
+
locale = _useLocale.locale;
|
|
14
|
+
var lang = locale === 'zh_CN' ? 'zh' : 'en';
|
|
15
|
+
return /*#__PURE__*/React.createElement(ConfigProviderWrapper, null, /*#__PURE__*/React.createElement(Popover, {
|
|
16
|
+
placement: "topLeft",
|
|
17
|
+
content: /*#__PURE__*/React.createElement(Space, {
|
|
18
|
+
direction: "vertical",
|
|
19
|
+
align: "center"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
21
|
+
alt: "",
|
|
22
|
+
style: {
|
|
23
|
+
height: 100
|
|
24
|
+
},
|
|
25
|
+
src: getTransResult(lang, wechatCode, xcQrCode)
|
|
26
|
+
}), t('CONTACT_TIP'), t('CONTACT_TELEPHONE'))
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
28
|
+
className: "".concat(prefix, "contactButtonCard")
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
30
|
+
direction: "vertical",
|
|
31
|
+
align: "center"
|
|
32
|
+
}, /*#__PURE__*/React.createElement(QrcodeOutlined, {
|
|
33
|
+
style: {
|
|
34
|
+
fontSize: 30,
|
|
35
|
+
color: '#1677ff'
|
|
36
|
+
}
|
|
37
|
+
}), t('CONTACT_US')))));
|
|
38
|
+
};
|
|
39
|
+
export default ContactButton;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
export { default as AcAnimation } from './ac-animation';
|
|
2
|
+
export { default as Aliplayer } from './ali-player';
|
|
3
|
+
export type { AliplayerConfig, AliplayerInstance } from './ali-player';
|
|
4
|
+
export { default as CodeDetailModal } from './code-detail-modal';
|
|
2
5
|
export { default as CodeMirrorWrapper } from './code-mirror-wrapper';
|
|
3
6
|
export { LangId, Language, Theme } from './code-mirror-wrapper/define';
|
|
7
|
+
export { default as ContactButton } from './contact-button';
|
|
4
8
|
export { default as DraggableLayout } from './draggable-layout';
|
|
5
9
|
export { default as ErrorBoundary } from './error-boundary';
|
|
6
10
|
export type { FallbackProps } from './error-boundary';
|
|
11
|
+
export { default as InputNumbers } from './input-numbers';
|
|
7
12
|
export { default as LoadingMask } from './loading-mask';
|
|
8
13
|
export { LocaleProvider } from './locales';
|
|
9
14
|
export { default as PaneTitle } from './pane-title';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export { default as AcAnimation } from "./ac-animation";
|
|
2
|
+
export { default as Aliplayer } from "./ali-player";
|
|
3
|
+
export { default as CodeDetailModal } from "./code-detail-modal";
|
|
2
4
|
export { default as CodeMirrorWrapper } from "./code-mirror-wrapper";
|
|
3
5
|
export { LangId, Language, Theme } from "./code-mirror-wrapper/define";
|
|
6
|
+
export { default as ContactButton } from "./contact-button";
|
|
4
7
|
export { default as DraggableLayout } from "./draggable-layout";
|
|
5
8
|
export { default as ErrorBoundary } from "./error-boundary";
|
|
9
|
+
export { default as InputNumbers } from "./input-numbers";
|
|
6
10
|
export { default as LoadingMask } from "./loading-mask";
|
|
7
11
|
export { LocaleProvider } from "./locales";
|
|
8
12
|
export { default as PaneTitle } from "./pane-title";
|
package/dist/locales/en_US.d.ts
CHANGED
|
@@ -32,5 +32,24 @@ declare const _default: {
|
|
|
32
32
|
readonly SCORE: "Score";
|
|
33
33
|
readonly BATCH_ADD: "Batch Add";
|
|
34
34
|
};
|
|
35
|
+
readonly CodeDetailModal: {
|
|
36
|
+
readonly Problem: "Problem";
|
|
37
|
+
readonly Language: "Language";
|
|
38
|
+
readonly Status: "Status";
|
|
39
|
+
readonly Score: "Score";
|
|
40
|
+
readonly Memory: "Memory";
|
|
41
|
+
readonly Code: "Code";
|
|
42
|
+
readonly Show: "Show";
|
|
43
|
+
readonly Hide: "Hide";
|
|
44
|
+
readonly Submission_Time: "Submission Time";
|
|
45
|
+
readonly Code_Detail: "Code Detail";
|
|
46
|
+
readonly Download_File: "Download File";
|
|
47
|
+
readonly File: "File";
|
|
48
|
+
};
|
|
49
|
+
readonly ContactButton: {
|
|
50
|
+
readonly CONTACT_TELEPHONE: "Telephone: +1-510-760-1098";
|
|
51
|
+
readonly CONTACT_TIP: "Please Scan The QR Code";
|
|
52
|
+
readonly CONTACT_US: "Contact Us";
|
|
53
|
+
};
|
|
35
54
|
};
|
|
36
55
|
export default _default;
|
package/dist/locales/en_US.js
CHANGED
|
@@ -31,5 +31,24 @@ export default {
|
|
|
31
31
|
TIME: 'Time',
|
|
32
32
|
SCORE: 'Score',
|
|
33
33
|
BATCH_ADD: 'Batch Add'
|
|
34
|
+
},
|
|
35
|
+
CodeDetailModal: {
|
|
36
|
+
Problem: 'Problem',
|
|
37
|
+
Language: 'Language',
|
|
38
|
+
Status: 'Status',
|
|
39
|
+
Score: 'Score',
|
|
40
|
+
Memory: 'Memory',
|
|
41
|
+
Code: 'Code',
|
|
42
|
+
Show: 'Show',
|
|
43
|
+
Hide: 'Hide',
|
|
44
|
+
Submission_Time: 'Submission Time',
|
|
45
|
+
Code_Detail: 'Code Detail',
|
|
46
|
+
Download_File: 'Download File',
|
|
47
|
+
File: 'File'
|
|
48
|
+
},
|
|
49
|
+
ContactButton: {
|
|
50
|
+
CONTACT_TELEPHONE: 'Telephone: +1-510-760-1098',
|
|
51
|
+
CONTACT_TIP: 'Please Scan The QR Code',
|
|
52
|
+
CONTACT_US: 'Contact Us'
|
|
34
53
|
}
|
|
35
54
|
};
|
package/dist/locales/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface LocaleProviderProps {
|
|
|
7
7
|
}
|
|
8
8
|
export declare const LocaleProvider: ({ children, locale, }: LocaleProviderProps) => React.JSX.Element;
|
|
9
9
|
type MessageMap = typeof zh_CN | typeof en_US;
|
|
10
|
-
export declare const useLocale: <T extends "VisualDataConfig">(slice: T) => {
|
|
10
|
+
export declare const useLocale: <T extends "VisualDataConfig" | "CodeDetailModal" | "ContactButton">(slice: T) => {
|
|
11
11
|
locale: string;
|
|
12
12
|
format: <U extends keyof MessageMap[T]>(key: U) => ({
|
|
13
13
|
readonly VisualDataConfig: {
|
|
@@ -43,6 +43,25 @@ export declare const useLocale: <T extends "VisualDataConfig">(slice: T) => {
|
|
|
43
43
|
readonly SCORE: "得分";
|
|
44
44
|
readonly BATCH_ADD: "批量添加";
|
|
45
45
|
};
|
|
46
|
+
readonly CodeDetailModal: {
|
|
47
|
+
readonly Problem: "题目";
|
|
48
|
+
readonly Language: "语言";
|
|
49
|
+
readonly Status: "状态";
|
|
50
|
+
readonly Score: "得分";
|
|
51
|
+
readonly Memory: "大小";
|
|
52
|
+
readonly Code: "代码";
|
|
53
|
+
readonly Show: "显示";
|
|
54
|
+
readonly Hide: "隐藏";
|
|
55
|
+
readonly Submission_Time: "提交时间";
|
|
56
|
+
readonly Code_Detail: "代码详情";
|
|
57
|
+
readonly Download_File: "下载文件";
|
|
58
|
+
readonly File: "文件";
|
|
59
|
+
};
|
|
60
|
+
readonly ContactButton: {
|
|
61
|
+
readonly CONTACT_TELEPHONE: "电话:17367064678";
|
|
62
|
+
readonly CONTACT_TIP: "微信扫码,直接咨询";
|
|
63
|
+
readonly CONTACT_US: "联系我们";
|
|
64
|
+
};
|
|
46
65
|
} | {
|
|
47
66
|
readonly VisualDataConfig: {
|
|
48
67
|
readonly Time_MS: "Time Limit(MS)";
|
|
@@ -77,9 +96,28 @@ export declare const useLocale: <T extends "VisualDataConfig">(slice: T) => {
|
|
|
77
96
|
readonly SCORE: "Score";
|
|
78
97
|
readonly BATCH_ADD: "Batch Add";
|
|
79
98
|
};
|
|
99
|
+
readonly CodeDetailModal: {
|
|
100
|
+
readonly Problem: "Problem";
|
|
101
|
+
readonly Language: "Language";
|
|
102
|
+
readonly Status: "Status";
|
|
103
|
+
readonly Score: "Score";
|
|
104
|
+
readonly Memory: "Memory";
|
|
105
|
+
readonly Code: "Code";
|
|
106
|
+
readonly Show: "Show";
|
|
107
|
+
readonly Hide: "Hide";
|
|
108
|
+
readonly Submission_Time: "Submission Time";
|
|
109
|
+
readonly Code_Detail: "Code Detail";
|
|
110
|
+
readonly Download_File: "Download File";
|
|
111
|
+
readonly File: "File";
|
|
112
|
+
};
|
|
113
|
+
readonly ContactButton: {
|
|
114
|
+
readonly CONTACT_TELEPHONE: "Telephone: +1-510-760-1098";
|
|
115
|
+
readonly CONTACT_TIP: "Please Scan The QR Code";
|
|
116
|
+
readonly CONTACT_US: "Contact Us";
|
|
117
|
+
};
|
|
80
118
|
})[T][U];
|
|
81
119
|
};
|
|
82
|
-
export declare const getFormat: <T extends "VisualDataConfig">(locale: string | undefined, slice: T) => <U extends keyof MessageMap[T]>(key: U) => ({
|
|
120
|
+
export declare const getFormat: <T extends "VisualDataConfig" | "CodeDetailModal" | "ContactButton">(locale: string | undefined, slice: T) => <U extends keyof MessageMap[T]>(key: U) => ({
|
|
83
121
|
readonly VisualDataConfig: {
|
|
84
122
|
readonly Time_MS: "时间限制(MS)";
|
|
85
123
|
readonly Space_MS: "空间限制(KB)";
|
|
@@ -113,6 +151,25 @@ export declare const getFormat: <T extends "VisualDataConfig">(locale: string |
|
|
|
113
151
|
readonly SCORE: "得分";
|
|
114
152
|
readonly BATCH_ADD: "批量添加";
|
|
115
153
|
};
|
|
154
|
+
readonly CodeDetailModal: {
|
|
155
|
+
readonly Problem: "题目";
|
|
156
|
+
readonly Language: "语言";
|
|
157
|
+
readonly Status: "状态";
|
|
158
|
+
readonly Score: "得分";
|
|
159
|
+
readonly Memory: "大小";
|
|
160
|
+
readonly Code: "代码";
|
|
161
|
+
readonly Show: "显示";
|
|
162
|
+
readonly Hide: "隐藏";
|
|
163
|
+
readonly Submission_Time: "提交时间";
|
|
164
|
+
readonly Code_Detail: "代码详情";
|
|
165
|
+
readonly Download_File: "下载文件";
|
|
166
|
+
readonly File: "文件";
|
|
167
|
+
};
|
|
168
|
+
readonly ContactButton: {
|
|
169
|
+
readonly CONTACT_TELEPHONE: "电话:17367064678";
|
|
170
|
+
readonly CONTACT_TIP: "微信扫码,直接咨询";
|
|
171
|
+
readonly CONTACT_US: "联系我们";
|
|
172
|
+
};
|
|
116
173
|
} | {
|
|
117
174
|
readonly VisualDataConfig: {
|
|
118
175
|
readonly Time_MS: "Time Limit(MS)";
|
|
@@ -147,5 +204,24 @@ export declare const getFormat: <T extends "VisualDataConfig">(locale: string |
|
|
|
147
204
|
readonly SCORE: "Score";
|
|
148
205
|
readonly BATCH_ADD: "Batch Add";
|
|
149
206
|
};
|
|
207
|
+
readonly CodeDetailModal: {
|
|
208
|
+
readonly Problem: "Problem";
|
|
209
|
+
readonly Language: "Language";
|
|
210
|
+
readonly Status: "Status";
|
|
211
|
+
readonly Score: "Score";
|
|
212
|
+
readonly Memory: "Memory";
|
|
213
|
+
readonly Code: "Code";
|
|
214
|
+
readonly Show: "Show";
|
|
215
|
+
readonly Hide: "Hide";
|
|
216
|
+
readonly Submission_Time: "Submission Time";
|
|
217
|
+
readonly Code_Detail: "Code Detail";
|
|
218
|
+
readonly Download_File: "Download File";
|
|
219
|
+
readonly File: "File";
|
|
220
|
+
};
|
|
221
|
+
readonly ContactButton: {
|
|
222
|
+
readonly CONTACT_TELEPHONE: "Telephone: +1-510-760-1098";
|
|
223
|
+
readonly CONTACT_TIP: "Please Scan The QR Code";
|
|
224
|
+
readonly CONTACT_US: "Contact Us";
|
|
225
|
+
};
|
|
150
226
|
})[T][U];
|
|
151
227
|
export {};
|
package/dist/locales/zh_CN.d.ts
CHANGED
|
@@ -32,5 +32,24 @@ declare const _default: {
|
|
|
32
32
|
readonly SCORE: "得分";
|
|
33
33
|
readonly BATCH_ADD: "批量添加";
|
|
34
34
|
};
|
|
35
|
+
readonly CodeDetailModal: {
|
|
36
|
+
readonly Problem: "题目";
|
|
37
|
+
readonly Language: "语言";
|
|
38
|
+
readonly Status: "状态";
|
|
39
|
+
readonly Score: "得分";
|
|
40
|
+
readonly Memory: "大小";
|
|
41
|
+
readonly Code: "代码";
|
|
42
|
+
readonly Show: "显示";
|
|
43
|
+
readonly Hide: "隐藏";
|
|
44
|
+
readonly Submission_Time: "提交时间";
|
|
45
|
+
readonly Code_Detail: "代码详情";
|
|
46
|
+
readonly Download_File: "下载文件";
|
|
47
|
+
readonly File: "文件";
|
|
48
|
+
};
|
|
49
|
+
readonly ContactButton: {
|
|
50
|
+
readonly CONTACT_TELEPHONE: "电话:17367064678";
|
|
51
|
+
readonly CONTACT_TIP: "微信扫码,直接咨询";
|
|
52
|
+
readonly CONTACT_US: "联系我们";
|
|
53
|
+
};
|
|
35
54
|
};
|
|
36
55
|
export default _default;
|
package/dist/locales/zh_CN.js
CHANGED
|
@@ -31,5 +31,24 @@ export default {
|
|
|
31
31
|
TIME: '时间',
|
|
32
32
|
SCORE: '得分',
|
|
33
33
|
BATCH_ADD: '批量添加'
|
|
34
|
+
},
|
|
35
|
+
CodeDetailModal: {
|
|
36
|
+
Problem: '题目',
|
|
37
|
+
Language: '语言',
|
|
38
|
+
Status: '状态',
|
|
39
|
+
Score: '得分',
|
|
40
|
+
Memory: '大小',
|
|
41
|
+
Code: '代码',
|
|
42
|
+
Show: '显示',
|
|
43
|
+
Hide: '隐藏',
|
|
44
|
+
Submission_Time: '提交时间',
|
|
45
|
+
Code_Detail: '代码详情',
|
|
46
|
+
Download_File: '下载文件',
|
|
47
|
+
File: '文件'
|
|
48
|
+
},
|
|
49
|
+
ContactButton: {
|
|
50
|
+
CONTACT_TELEPHONE: '电话:17367064678',
|
|
51
|
+
CONTACT_TIP: '微信扫码,直接咨询',
|
|
52
|
+
CONTACT_US: '联系我们'
|
|
34
53
|
}
|
|
35
54
|
};
|
package/dist/styles/index.css
CHANGED
|
@@ -409,3 +409,29 @@
|
|
|
409
409
|
.x-star-design-form .x-star-design-formList {
|
|
410
410
|
width: 100%;
|
|
411
411
|
}
|
|
412
|
+
|
|
413
|
+
.x-star-design-codeCompileResult {
|
|
414
|
+
padding: 10px 20px;
|
|
415
|
+
background-color: #fafafa;
|
|
416
|
+
border: 1px solid #e3e3e3;
|
|
417
|
+
border-radius: 3px;
|
|
418
|
+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
|
419
|
+
min-height: 100%;
|
|
420
|
+
overflow: auto;
|
|
421
|
+
margin-top: 1%;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.x-star-design-contactButtonCard {
|
|
425
|
+
position: fixed !important;
|
|
426
|
+
right: 3rem;
|
|
427
|
+
top: 70%;
|
|
428
|
+
display: flex;
|
|
429
|
+
flex-direction: column;
|
|
430
|
+
cursor: pointer !important;
|
|
431
|
+
z-index: 999;
|
|
432
|
+
border: 3px dashed orange !important;
|
|
433
|
+
}
|
|
434
|
+
.x-star-design-contactButtonCard .ant-card-body,
|
|
435
|
+
.x-star-design-contactButtonCard .x-star-design-card-body {
|
|
436
|
+
padding: 5px;
|
|
437
|
+
}
|
package/dist/types/svg.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-star-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "A react component library developed by turingstar",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"@uiw/react-codemirror": "^4.21.9",
|
|
59
59
|
"ahooks": "^3.7.8",
|
|
60
60
|
"classnames": "^2.3.2",
|
|
61
|
+
"dayjs": "^1.11.10",
|
|
61
62
|
"randomcolor": "^0.6.2",
|
|
62
63
|
"rc-resize-observer": "^1.3.1",
|
|
63
64
|
"react-sortable-hoc": "^2.0.0",
|