@yuntijs/ui 1.0.0-beta.8 → 1.0.0-beta.80
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/es/Alert/index.d.ts +13 -0
- package/es/Alert/index.js +25 -0
- package/es/Alert/style.d.ts +4 -0
- package/es/Alert/style.js +13 -0
- package/es/App/index.d.ts +7 -0
- package/es/App/index.js +19 -0
- package/es/ButtonGroup/index.d.ts +24 -0
- package/es/ButtonGroup/index.js +66 -0
- package/es/Card/index.d.ts +1 -0
- package/es/Card/index.js +1 -0
- package/es/CardList/Item/index.d.ts +4 -0
- package/es/CardList/Item/index.js +43 -0
- package/es/CardList/Item/style.d.ts +0 -0
- package/es/CardList/Item/style.js +0 -0
- package/es/CardList/index.d.ts +2 -0
- package/es/CardList/index.js +39 -0
- package/es/ChatInputArea/desktop/ChatInputArea.d.ts +19 -0
- package/es/ChatInputArea/desktop/ChatInputArea.js +72 -0
- package/es/ChatInputArea/index.d.ts +6 -0
- package/es/ChatInputArea/index.js +6 -0
- package/es/ChatItem/components/MessageContent.d.ts +21 -0
- package/es/ChatItem/components/MessageContent.js +59 -0
- package/es/ChatItem/index.d.ts +4 -0
- package/es/ChatItem/index.js +120 -0
- package/es/ChatItem/style.d.ts +24 -0
- package/es/ChatItem/style.js +38 -0
- package/es/ChatItem/type.d.ts +82 -0
- package/es/ChatItem/type.js +1 -0
- package/es/CollapseGroup/index.d.ts +4 -0
- package/es/CollapseGroup/index.js +23 -0
- package/es/CollapseGroup/style.d.ts +3 -0
- package/es/CollapseGroup/style.js +11 -0
- package/es/ConfigProvider/index.d.ts +3 -0
- package/es/ConfigProvider/index.js +17 -11
- package/es/Descriptions/index.d.ts +14 -0
- package/es/Descriptions/index.js +31 -0
- package/es/Descriptions/style.d.ts +4 -0
- package/es/Descriptions/style.js +24 -0
- package/es/Divider/index.d.ts +38 -0
- package/es/Divider/index.js +66 -0
- package/es/Divider/style.d.ts +3 -0
- package/es/Divider/style.js +12 -0
- package/es/DragPanel/index.d.ts +10 -0
- package/es/DragPanel/index.js +97 -0
- package/es/DragPanel/style.d.ts +7 -0
- package/es/DragPanel/style.js +15 -0
- package/es/Drawer/index.d.ts +13 -0
- package/es/Drawer/index.js +20 -0
- package/es/Drawer/style.d.ts +4 -0
- package/es/Drawer/style.js +16 -0
- package/es/Dropdown/index.d.ts +14 -0
- package/es/Dropdown/index.js +59 -0
- package/es/Dropdown/style.d.ts +7 -0
- package/es/Dropdown/style.js +13 -0
- package/es/EditableMessage/index.d.ts +75 -0
- package/es/EditableMessage/index.js +99 -0
- package/es/Form/collapse-list/index.d.ts +40 -0
- package/es/Form/collapse-list/index.js +209 -0
- package/es/Form/collapse-list/style.d.ts +5 -0
- package/es/Form/collapse-list/style.js +13 -0
- package/es/Form/index.d.ts +8 -0
- package/es/Form/index.js +5 -0
- package/es/FormHelper/autoFocus.d.ts +10 -0
- package/es/FormHelper/autoFocus.js +38 -0
- package/es/FormHelper/index.d.ts +13 -0
- package/es/FormHelper/index.js +41 -0
- package/es/Highlighter/FullFeatured.d.ts +18 -0
- package/es/Highlighter/FullFeatured.js +102 -0
- package/es/Highlighter/SyntaxHighlighter/index.d.ts +7 -0
- package/es/Highlighter/SyntaxHighlighter/index.js +51 -0
- package/es/Highlighter/SyntaxHighlighter/style.d.ts +5 -0
- package/es/Highlighter/SyntaxHighlighter/style.js +16 -0
- package/es/Highlighter/index.d.ts +50 -0
- package/es/Highlighter/index.js +77 -0
- package/es/Highlighter/style.d.ts +9 -0
- package/es/Highlighter/style.js +23 -0
- package/es/Highlighter/theme.d.ts +1 -0
- package/es/Highlighter/theme.js +1661 -0
- package/es/LogViewer/index.d.ts +10 -0
- package/es/LogViewer/index.js +141 -0
- package/es/LogViewer/style.d.ts +6 -0
- package/es/LogViewer/style.js +16 -0
- package/es/LogViewer/types.d.ts +235 -0
- package/es/LogViewer/types.js +1 -0
- package/es/Mentions/constants.d.ts +6 -0
- package/es/Mentions/constants.js +28 -0
- package/es/Mentions/hooks.d.ts +20 -0
- package/es/Mentions/hooks.js +133 -0
- package/es/Mentions/index.d.ts +19 -0
- package/es/Mentions/index.js +136 -0
- package/es/Mentions/plugins/custom-text/node.d.ts +11 -0
- package/es/Mentions/plugins/custom-text/node.js +72 -0
- package/es/Mentions/plugins/mention-node/component.d.ts +6 -0
- package/es/Mentions/plugins/mention-node/component.js +64 -0
- package/es/Mentions/plugins/mention-node/index.d.ts +9 -0
- package/es/Mentions/plugins/mention-node/index.js +32 -0
- package/es/Mentions/plugins/mention-node/node.d.ts +23 -0
- package/es/Mentions/plugins/mention-node/node.js +97 -0
- package/es/Mentions/plugins/mention-node/replacement.d.ts +5 -0
- package/es/Mentions/plugins/mention-node/replacement.js +42 -0
- package/es/Mentions/plugins/mention-node/style.d.ts +8 -0
- package/es/Mentions/plugins/mention-node/style.js +47 -0
- package/es/Mentions/plugins/mention-node/utils.d.ts +4 -0
- package/es/Mentions/plugins/mention-node/utils.js +5 -0
- package/es/Mentions/plugins/mention-picker/hooks.d.ts +5 -0
- package/es/Mentions/plugins/mention-picker/hooks.js +39 -0
- package/es/Mentions/plugins/mention-picker/index.d.ts +36 -0
- package/es/Mentions/plugins/mention-picker/index.js +87 -0
- package/es/Mentions/plugins/mention-picker/menu-item.d.ts +11 -0
- package/es/Mentions/plugins/mention-picker/menu-item.js +71 -0
- package/es/Mentions/plugins/mention-picker/menu.d.ts +9 -0
- package/es/Mentions/plugins/mention-picker/menu.js +30 -0
- package/es/Mentions/plugins/mention-picker/style.d.ts +11 -0
- package/es/Mentions/plugins/mention-picker/style.js +19 -0
- package/es/Mentions/plugins/mention-picker/utils.d.ts +22 -0
- package/es/Mentions/plugins/mention-picker/utils.js +39 -0
- package/es/Mentions/plugins/on-blur-or-focus-block.d.ts +7 -0
- package/es/Mentions/plugins/on-blur-or-focus-block.js +36 -0
- package/es/Mentions/provider.d.ts +12 -0
- package/es/Mentions/provider.js +15 -0
- package/es/Mentions/style.d.ts +11 -0
- package/es/Mentions/style.js +22 -0
- package/es/Mentions/types.d.ts +17 -0
- package/es/Mentions/types.js +1 -0
- package/es/Mentions/utils.d.ts +9 -0
- package/es/Mentions/utils.js +95 -0
- package/es/Modal/index.d.ts +19 -0
- package/es/Modal/index.js +36 -0
- package/es/Modal/style.d.ts +4 -0
- package/es/Modal/style.js +17 -0
- package/es/MonacoEditor/base/controller.d.ts +17 -0
- package/es/MonacoEditor/base/controller.js +49 -0
- package/es/MonacoEditor/base/helper.d.ts +65 -0
- package/es/MonacoEditor/base/helper.js +324 -0
- package/es/MonacoEditor/base/index.d.ts +35 -0
- package/es/MonacoEditor/base/index.js +236 -0
- package/es/MonacoEditor/base/monaco.d.ts +6 -0
- package/es/MonacoEditor/base/monaco.js +64 -0
- package/es/MonacoEditor/base/style.d.ts +12 -0
- package/es/MonacoEditor/base/style.js +26 -0
- package/es/MonacoEditor/index.d.ts +2 -4
- package/es/MonacoEditor/index.js +26 -62
- package/es/MonacoEditor/style.js +3 -2
- package/es/Page/Breadcrumb/index.d.ts +9 -0
- package/es/Page/Breadcrumb/index.js +56 -0
- package/es/Page/Content/index.d.ts +4 -0
- package/es/Page/Content/index.js +59 -0
- package/es/Page/Content/style.d.ts +3 -0
- package/es/Page/Content/style.js +12 -0
- package/es/Page/Footer/index.d.ts +2 -0
- package/es/Page/Footer/index.js +6 -0
- package/es/Page/Header/Icon.d.ts +17 -0
- package/es/Page/Header/Icon.js +42 -0
- package/es/Page/Header/index.d.ts +43 -0
- package/es/Page/Header/index.js +202 -0
- package/es/Page/Header/style.d.ts +12 -0
- package/es/Page/Header/style.js +21 -0
- package/es/Page/Page.d.ts +9 -0
- package/es/Page/Page.js +49 -0
- package/es/Page/PageContext.d.ts +15 -0
- package/es/Page/PageContext.js +21 -0
- package/es/Page/Title/index.d.ts +5 -0
- package/es/Page/Title/index.js +18 -0
- package/es/Page/Title/style.d.ts +3 -0
- package/es/Page/Title/style.js +10 -0
- package/es/Page/index.d.ts +18 -0
- package/es/Page/index.js +15 -0
- package/es/Page/style.d.ts +3 -0
- package/es/Page/style.js +10 -0
- package/es/ProCard/Card/index.d.ts +6 -0
- package/es/ProCard/Card/index.js +25 -0
- package/es/ProCard/Card/style.d.ts +7 -0
- package/es/ProCard/Card/style.js +15 -0
- package/es/ProCard/Content/index.d.ts +4 -0
- package/es/ProCard/Content/index.js +24 -0
- package/es/ProCard/Content/style.d.ts +3 -0
- package/es/ProCard/Content/style.js +10 -0
- package/es/ProCard/Descriptions/index.d.ts +4 -0
- package/es/ProCard/Descriptions/index.js +28 -0
- package/es/ProCard/Descriptions/style.d.ts +3 -0
- package/es/ProCard/Descriptions/style.js +12 -0
- package/es/ProCard/Header/index.d.ts +15 -0
- package/es/ProCard/Header/index.js +86 -0
- package/es/ProCard/Header/style.d.ts +12 -0
- package/es/ProCard/Header/style.js +21 -0
- package/es/ProCard/index.d.ts +13 -0
- package/es/ProCard/index.js +8 -0
- package/es/Radio/index.d.ts +36 -0
- package/es/Radio/index.js +26 -0
- package/es/Radio/style.d.ts +4 -0
- package/es/Radio/style.js +66 -0
- package/es/SelectCard/index.d.ts +33 -0
- package/es/SelectCard/index.js +132 -0
- package/es/SelectCard/style.d.ts +10 -0
- package/es/SelectCard/style.js +42 -0
- package/es/SliderInput/index.js +2 -2
- package/es/Status/index.d.ts +7 -0
- package/es/Status/index.js +39 -0
- package/es/Status/style.d.ts +4 -0
- package/es/Status/style.js +14 -0
- package/es/Table/collapse/index.d.ts +8 -0
- package/es/Table/collapse/index.js +39 -0
- package/es/Table/collapse/style.d.ts +3 -0
- package/es/Table/collapse/style.js +11 -0
- package/es/Table/index.d.ts +20 -0
- package/es/Table/index.js +56 -0
- package/es/Typography/index.d.ts +32 -0
- package/es/Typography/index.js +77 -0
- package/es/WaveformIcon/index.d.ts +9 -0
- package/es/WaveformIcon/index.js +51 -0
- package/es/hooks/languageMap.d.ts +1 -0
- package/es/hooks/languageMap.js +1 -0
- package/es/hooks/useHighlight.d.ts +5 -0
- package/es/hooks/useHighlight.js +78 -0
- package/es/index.d.ts +38 -1
- package/es/index.js +52 -1
- package/es/notification/index.d.ts +24 -0
- package/es/notification/index.js +237 -0
- package/es/notification/style.d.ts +2 -0
- package/es/notification/style.js +28 -0
- package/es/styles/colors/colors.d.ts +39 -0
- package/es/styles/colors/colors.js +86 -0
- package/es/styles/colors/generateColorPalette.d.ts +11 -0
- package/es/styles/colors/generateColorPalette.js +31 -0
- package/es/styles/colors/neutralColors.d.ts +9 -0
- package/es/styles/colors/neutralColors.js +32 -0
- package/es/styles/index.d.ts +4 -0
- package/es/styles/index.js +4 -0
- package/es/useSpeechSynthes/const/polyfill.d.ts +3 -0
- package/es/useSpeechSynthes/const/polyfill.js +21 -0
- package/es/useSpeechSynthes/index.d.ts +13 -0
- package/es/useSpeechSynthes/index.js +69 -0
- package/es/utils/constants.d.ts +1 -0
- package/es/utils/constants.js +1 -0
- package/es/utils/tools.d.ts +1 -0
- package/es/utils/tools.js +1 -0
- package/package.json +30 -9
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var getNumberBySize = function getNumberBySize(size) {
|
|
5
|
+
switch (size) {
|
|
6
|
+
case 'small':
|
|
7
|
+
{
|
|
8
|
+
return {
|
|
9
|
+
cardWidth: 144,
|
|
10
|
+
imgHeight: 32
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
case 'large':
|
|
14
|
+
{
|
|
15
|
+
return {
|
|
16
|
+
cardWidth: 200,
|
|
17
|
+
imgHeight: 64
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
default:
|
|
21
|
+
{
|
|
22
|
+
return {
|
|
23
|
+
cardWidth: 168,
|
|
24
|
+
imgHeight: 40
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
30
|
+
var css = _ref.css,
|
|
31
|
+
token = _ref.token,
|
|
32
|
+
prefixCls = _ref.prefixCls;
|
|
33
|
+
var disabled = _ref2.disabled,
|
|
34
|
+
size = _ref2.size;
|
|
35
|
+
var _getNumberBySize = getNumberBySize(size),
|
|
36
|
+
cardWidth = _getNumberBySize.cardWidth;
|
|
37
|
+
return {
|
|
38
|
+
option: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n\n cursor: ", ";\n\n padding: ", "px;\n\n transition: all ", ";\n\n width: ", "px;\n min-height: 108px;\n\n ", "\n\n ", "\n\n div.", "-typography {\n margin-bottom: 0;\n }\n "])), token.colorBorder, token.borderRadius, disabled ? 'not-allowed' : 'pointer', token.padding, token.motionDurationFast, cardWidth, disabled && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n .", "-typography {\n color: ", ";\n &.", "-typography-secondary {\n color: ", ";\n }\n }\n "])), token.colorBgContainerDisabled, prefixCls, token.colorTextDisabled, prefixCls, token.colorTextDisabled), !disabled && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &:hover {\n border-color: ", ";\n }\n "])), token.colorPrimaryBorderHover), prefixCls),
|
|
39
|
+
optionSelected: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-color: ", ";\n &:hover {\n border-color: ", ";\n }\n "])), token.colorPrimary, token.colorPrimaryActive),
|
|
40
|
+
check: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", "px;\n bottom: ", "px;\n color: ", ";\n "])), token.marginXS, token.marginXS, token.colorPrimary)
|
|
41
|
+
};
|
|
42
|
+
});
|
package/es/SliderInput/index.js
CHANGED
|
@@ -55,7 +55,7 @@ export var SliderInput = function SliderInput(_ref) {
|
|
|
55
55
|
min: min,
|
|
56
56
|
onChange: onNumberChange,
|
|
57
57
|
step: step,
|
|
58
|
-
value: value
|
|
58
|
+
value: value !== null && value !== void 0 ? value : number
|
|
59
59
|
}))
|
|
60
60
|
})), /*#__PURE__*/_jsx(Col, _objectSpread(_objectSpread({}, inputCol), {}, {
|
|
61
61
|
children: /*#__PURE__*/_jsx(InputNumber, _objectSpread(_objectSpread({}, inputProps), {}, {
|
|
@@ -67,7 +67,7 @@ export var SliderInput = function SliderInput(_ref) {
|
|
|
67
67
|
onChange: onNumberChange,
|
|
68
68
|
placeholder: placeholder,
|
|
69
69
|
step: step,
|
|
70
|
-
value: value
|
|
70
|
+
value: value !== null && value !== void 0 ? value : number
|
|
71
71
|
}))
|
|
72
72
|
}))]
|
|
73
73
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BadgeProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface StatusProps extends Pick<BadgeProps, 'className' | 'color' | 'status' | 'style' | 'text'> {
|
|
4
|
+
tooltip?: React.ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Status: React.FC<StatusProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["tooltip", "className", "status", "text", "color"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
import { Icon } from '@lobehub/ui';
|
|
7
|
+
import { Badge, Space, Tooltip } from 'antd';
|
|
8
|
+
import { Info } from 'lucide-react';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { useStyles } from "./style";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export var Status = function Status(_ref) {
|
|
14
|
+
var tooltip = _ref.tooltip,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
status = _ref.status,
|
|
17
|
+
text = _ref.text,
|
|
18
|
+
color = _ref.color,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
var _useStyles = useStyles(),
|
|
21
|
+
cx = _useStyles.cx,
|
|
22
|
+
styles = _useStyles.styles;
|
|
23
|
+
return /*#__PURE__*/_jsxs(Space, _objectSpread(_objectSpread({
|
|
24
|
+
className: cx(styles.root, className),
|
|
25
|
+
size: "small"
|
|
26
|
+
}, props), {}, {
|
|
27
|
+
children: [/*#__PURE__*/_jsx(Badge, {
|
|
28
|
+
status: status,
|
|
29
|
+
text: text,
|
|
30
|
+
color: color
|
|
31
|
+
}), tooltip && /*#__PURE__*/_jsx(Tooltip, {
|
|
32
|
+
className: styles.tooltip,
|
|
33
|
+
title: tooltip,
|
|
34
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
35
|
+
icon: Info
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token,
|
|
7
|
+
prefixCls = _ref.prefixCls;
|
|
8
|
+
return {
|
|
9
|
+
root: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-badge.", "-badge-status {\n .", "-badge-status-dot {\n width: 8px;\n height: 8px;\n }\n }\n "])), prefixCls, prefixCls, prefixCls),
|
|
10
|
+
tooltip: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.anticon {\n cursor: help;\n color: ", ";\n }\n "])), token.colorTextTertiary)
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
hashPriority: 'low'
|
|
14
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TableProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CollapseGroupProps } from '../../CollapseGroup';
|
|
4
|
+
export interface CollapseTableProps extends Omit<TableProps, 'title'>, Pick<CollapseGroupProps, 'icon' | 'title' | 'variant' | 'defaultActive' | 'extra'> {
|
|
5
|
+
rootStyle?: React.CSSProperties;
|
|
6
|
+
rootClassName?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CollapseTable: React.FC<CollapseTableProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["rootStyle", "rootClassName", "icon", "title", "variant", "defaultActive", "extra", "className"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
import { Table } from 'antd';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { CollapseGroup } from "../../CollapseGroup";
|
|
9
|
+
import { useStyles } from "./style";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export var CollapseTable = function CollapseTable(_ref) {
|
|
12
|
+
var rootStyle = _ref.rootStyle,
|
|
13
|
+
rootClassName = _ref.rootClassName,
|
|
14
|
+
icon = _ref.icon,
|
|
15
|
+
title = _ref.title,
|
|
16
|
+
variant = _ref.variant,
|
|
17
|
+
defaultActive = _ref.defaultActive,
|
|
18
|
+
extra = _ref.extra,
|
|
19
|
+
className = _ref.className,
|
|
20
|
+
tableProps = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var _useStyles = useStyles(),
|
|
22
|
+
cx = _useStyles.cx,
|
|
23
|
+
styles = _useStyles.styles;
|
|
24
|
+
return /*#__PURE__*/_jsx(CollapseGroup, {
|
|
25
|
+
className: rootClassName,
|
|
26
|
+
style: rootStyle,
|
|
27
|
+
icon: icon,
|
|
28
|
+
title: title,
|
|
29
|
+
variant: variant,
|
|
30
|
+
defaultActive: defaultActive,
|
|
31
|
+
extra: extra,
|
|
32
|
+
children: /*#__PURE__*/_jsx(Table, _objectSpread({
|
|
33
|
+
className: cx(styles.table, className),
|
|
34
|
+
pagination: false,
|
|
35
|
+
rowHoverable: false,
|
|
36
|
+
size: "small"
|
|
37
|
+
}, tableProps))
|
|
38
|
+
});
|
|
39
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token,
|
|
7
|
+
prefixCls = _ref.prefixCls;
|
|
8
|
+
return {
|
|
9
|
+
table: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-table {\n &-thead {\n & > tr > th {\n font-weight: normal;\n color: ", ";\n background-color: unset;\n &::before {\n display: none;\n }\n }\n }\n &-tbody {\n & > tr:last-child {\n & > td {\n border-bottom-color: transparent;\n }\n }\n }\n &-cell {\n vertical-align: top;\n }\n }\n "])), prefixCls, token.colorTextTertiary)
|
|
10
|
+
};
|
|
11
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Table as AntdTable, TableProps } from 'antd';
|
|
2
|
+
import { AnyObject } from 'antd/es/_util/type';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { CollapseTable } from './collapse';
|
|
5
|
+
export * from './collapse';
|
|
6
|
+
export { type TableColumnGroupType, type TableColumnProps, type TableColumnsType, type TableColumnType, type TablePaginationConfig, type TableProps, } from 'antd';
|
|
7
|
+
type YuntiTable = <RecordType extends AnyObject = AnyObject>(props: TableProps<RecordType>) => React.ReactElement;
|
|
8
|
+
export declare const Table: YuntiTable & {
|
|
9
|
+
displayName?: typeof AntdTable.displayName;
|
|
10
|
+
SELECTION_COLUMN: typeof AntdTable.SELECTION_COLUMN;
|
|
11
|
+
EXPAND_COLUMN: typeof AntdTable.EXPAND_COLUMN;
|
|
12
|
+
SELECTION_ALL: typeof AntdTable.SELECTION_ALL;
|
|
13
|
+
SELECTION_INVERT: typeof AntdTable.SELECTION_INVERT;
|
|
14
|
+
SELECTION_NONE: typeof AntdTable.SELECTION_NONE;
|
|
15
|
+
Column: typeof AntdTable.Column;
|
|
16
|
+
ColumnGroup: typeof AntdTable.ColumnGroup;
|
|
17
|
+
Summary: typeof AntdTable.Summary;
|
|
18
|
+
Collapse: typeof CollapseTable;
|
|
19
|
+
};
|
|
20
|
+
export default Table;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["columns"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
import { Table as AntdTable, Tooltip } from 'antd';
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
|
+
import { CollapseTable } from "./collapse";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export * from "./collapse";
|
|
11
|
+
export var Table = function Table(props) {
|
|
12
|
+
var columns = props.columns,
|
|
13
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
14
|
+
var formatColumns = useMemo(function () {
|
|
15
|
+
return columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
16
|
+
if (item.render) {
|
|
17
|
+
return item;
|
|
18
|
+
}
|
|
19
|
+
if (item.ellipsis && item.ellipsis !== true && item.ellipsis.showTitle || item.ellipsis === true) {
|
|
20
|
+
var tooltipProps = item.ellipsis === true ? {} : item.ellipsis;
|
|
21
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
22
|
+
ellipsis: {
|
|
23
|
+
showTitle: false
|
|
24
|
+
},
|
|
25
|
+
render: function render(text) {
|
|
26
|
+
return text || text === 0 ? /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
27
|
+
placement: "topLeft",
|
|
28
|
+
title: text,
|
|
29
|
+
children: text
|
|
30
|
+
})) : '-';
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (!item.render) {
|
|
35
|
+
item.render = function (text) {
|
|
36
|
+
return text !== null && text !== void 0 ? text : '-';
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return item;
|
|
40
|
+
});
|
|
41
|
+
}, [columns]);
|
|
42
|
+
return /*#__PURE__*/_jsx(AntdTable, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
43
|
+
columns: formatColumns
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
Table.displayName = 'Table';
|
|
47
|
+
Table.SELECTION_COLUMN = AntdTable.SELECTION_COLUMN;
|
|
48
|
+
Table.EXPAND_COLUMN = AntdTable.EXPAND_COLUMN;
|
|
49
|
+
Table.SELECTION_ALL = AntdTable.SELECTION_ALL;
|
|
50
|
+
Table.SELECTION_INVERT = AntdTable.SELECTION_INVERT;
|
|
51
|
+
Table.SELECTION_NONE = AntdTable.SELECTION_NONE;
|
|
52
|
+
Table.Column = AntdTable.Column;
|
|
53
|
+
Table.ColumnGroup = AntdTable.ColumnGroup;
|
|
54
|
+
Table.Summary = AntdTable.Summary;
|
|
55
|
+
Table.Collapse = CollapseTable;
|
|
56
|
+
export default Table;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Typography as AntdTypography } from 'antd';
|
|
2
|
+
import type { TextProps } from 'antd/es/typography/Text';
|
|
3
|
+
import type { TooltipPropsWithTitle } from 'antd/lib/tooltip';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export declare const Typography: TypographyProps;
|
|
6
|
+
interface TimeProps extends TextProps {
|
|
7
|
+
/**
|
|
8
|
+
* @description Set display time
|
|
9
|
+
* @default '-'
|
|
10
|
+
*/
|
|
11
|
+
time: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description Formatted display time
|
|
14
|
+
* @default 'YYYY-MM-DD HH:mm:ss'
|
|
15
|
+
*/
|
|
16
|
+
format?: string;
|
|
17
|
+
/**
|
|
18
|
+
* @description Display relative time
|
|
19
|
+
* @default 'true'
|
|
20
|
+
*/
|
|
21
|
+
relativeTime?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* @description Mouse above to show time
|
|
24
|
+
* @default '{title: "YYYY-MM-DD HH:mm:ss"}'
|
|
25
|
+
*/
|
|
26
|
+
tooltip?: TooltipPropsWithTitle;
|
|
27
|
+
}
|
|
28
|
+
declare const Time: React.FC<TimeProps>;
|
|
29
|
+
export type TypographyProps = typeof AntdTypography & {
|
|
30
|
+
Time: typeof Time;
|
|
31
|
+
};
|
|
32
|
+
export default Typography;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["time", "format", "relativeTime", "tooltip"];
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
import { Typography as AntdTypography, Tooltip } from 'antd';
|
|
8
|
+
import dayjs from 'dayjs';
|
|
9
|
+
import dayjsRelativeTime from 'dayjs/plugin/relativeTime';
|
|
10
|
+
import { set } from 'lodash-es';
|
|
11
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
dayjs.extend(dayjsRelativeTime);
|
|
14
|
+
export var Typography = AntdTypography;
|
|
15
|
+
var getFromNow = function getFromNow(t) {
|
|
16
|
+
return dayjs(t ? new Date(t) : new Date()).fromNow();
|
|
17
|
+
};
|
|
18
|
+
var Time = function Time(props) {
|
|
19
|
+
var _tooltip$title;
|
|
20
|
+
var time = props.time,
|
|
21
|
+
format = props.format,
|
|
22
|
+
_props$relativeTime = props.relativeTime,
|
|
23
|
+
relativeTime = _props$relativeTime === void 0 ? true : _props$relativeTime,
|
|
24
|
+
tooltip = props.tooltip,
|
|
25
|
+
textProps = _objectWithoutProperties(props, _excluded);
|
|
26
|
+
var _useState = useState(getFromNow(time)),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
showTime = _useState2[0],
|
|
29
|
+
setShowTime = _useState2[1];
|
|
30
|
+
|
|
31
|
+
// The relative time within the last hour is updated automatically
|
|
32
|
+
var setTimeInterval = useCallback(function (currentTime) {
|
|
33
|
+
var now = dayjs();
|
|
34
|
+
var timeMoment = dayjs(currentTime);
|
|
35
|
+
var diff = now.diff(timeMoment);
|
|
36
|
+
if (diff > 0 && diff < 60 * 60 * 1000) {
|
|
37
|
+
return setInterval(function () {
|
|
38
|
+
setShowTime(getFromNow(currentTime));
|
|
39
|
+
}, 60 * 1000);
|
|
40
|
+
}
|
|
41
|
+
}, []);
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
var timeout;
|
|
44
|
+
if (relativeTime) {
|
|
45
|
+
timeout = setTimeInterval(new Date(time));
|
|
46
|
+
}
|
|
47
|
+
return function () {
|
|
48
|
+
if (timeout) {
|
|
49
|
+
clearInterval(timeout);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}, [relativeTime, setTimeInterval, time]);
|
|
53
|
+
useEffect(function () {
|
|
54
|
+
if (!relativeTime) return;
|
|
55
|
+
var nextFromNow = getFromNow(time);
|
|
56
|
+
if (nextFromNow !== showTime) {
|
|
57
|
+
setShowTime(nextFromNow);
|
|
58
|
+
setTimeInterval(new Date(time));
|
|
59
|
+
}
|
|
60
|
+
}, [time, relativeTime, showTime, setTimeInterval]);
|
|
61
|
+
var fmtTime = dayjs(time).format(format || 'YYYY-MM-DD HH:mm:ss');
|
|
62
|
+
var currentTime = relativeTime ? showTime : fmtTime;
|
|
63
|
+
var tooltipTitle = (_tooltip$title = tooltip === null || tooltip === void 0 ? void 0 : tooltip.title) !== null && _tooltip$title !== void 0 ? _tooltip$title : relativeTime ? fmtTime : undefined;
|
|
64
|
+
|
|
65
|
+
// Avoid duplicate tooltips
|
|
66
|
+
if (tooltipTitle) {
|
|
67
|
+
set(textProps, 'ellipsis.tooltip.title', undefined);
|
|
68
|
+
}
|
|
69
|
+
return /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltip || {}), {}, {
|
|
70
|
+
title: tooltipTitle,
|
|
71
|
+
children: /*#__PURE__*/_jsx(Typography.Text, _objectSpread(_objectSpread({}, textProps), {}, {
|
|
72
|
+
children: currentTime
|
|
73
|
+
}))
|
|
74
|
+
}));
|
|
75
|
+
};
|
|
76
|
+
Typography.Time = Time;
|
|
77
|
+
export default Typography;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
3
|
+
import { createStyles, keyframes } from 'antd-style';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
var useStyles = createStyles(function (_ref, props) {
|
|
8
|
+
var css = _ref.css;
|
|
9
|
+
var dance1 = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: scaleY(0.4)\n }\n 50% {\n transform: scaleY(0.2)\n }\n 100% {\n transform: scaleY(0.5)\n }\n "])));
|
|
10
|
+
var dance2 = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n transform: scaleY(0.7)\n }\n 50% {\n transform: scaleY(0.4)\n }\n 100% {\n transform: scaleY(0.7)\n }\n "])));
|
|
11
|
+
var dance3 = keyframes(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n 0% {\n transform: scaleY(0.9)\n }\n 50% {\n transform: scaleY(0.7)\n }\n 100% {\n transform: scaleY(0.9)\n }\n "])));
|
|
12
|
+
return {
|
|
13
|
+
box: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n align-items: center;\n justify-content: space-evenly;\n\n width: ", "px;\n height: ", "px;\n\n background-color: ", ";\n "])), props.width || 34, props.height || 22, props.bgColor || 'transparent'),
|
|
14
|
+
line: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: inline-block;\n\n width: 3px;\n height: 90%;\n\n background-color: ", ";\n border: none;\n border-radius: 30%;\n "])), props.lineColor || '#000'),
|
|
15
|
+
animate1: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n animation: ", " 500ms ease-in infinite alternate;\n "])), dance1),
|
|
16
|
+
animate2: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n animation: ", " 500ms ease-out infinite alternate;\n "])), dance2),
|
|
17
|
+
animate3: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n animation: ", " 500ms ease-in infinite alternate;\n "])), dance3)
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
export var WaveformIcon = function WaveformIcon(_ref2) {
|
|
21
|
+
var height = _ref2.height,
|
|
22
|
+
width = _ref2.width,
|
|
23
|
+
lineColor = _ref2.lineColor,
|
|
24
|
+
bgColor = _ref2.bgColor;
|
|
25
|
+
var _useStyles = useStyles({
|
|
26
|
+
height: height,
|
|
27
|
+
width: width,
|
|
28
|
+
lineColor: lineColor,
|
|
29
|
+
bgColor: bgColor
|
|
30
|
+
}),
|
|
31
|
+
styles = _useStyles.styles,
|
|
32
|
+
cx = _useStyles.cx;
|
|
33
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
34
|
+
className: styles.box,
|
|
35
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
36
|
+
className: cx(styles.line, styles.animate1)
|
|
37
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
38
|
+
className: cx(styles.line, styles.animate2)
|
|
39
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
40
|
+
className: cx(styles.line, styles.animate3)
|
|
41
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
42
|
+
className: cx(styles.line, styles.animate2)
|
|
43
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
44
|
+
className: cx(styles.line, styles.animate1)
|
|
45
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
46
|
+
className: cx(styles.line, styles.animate2)
|
|
47
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
48
|
+
className: cx(styles.line, styles.animate1)
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const languageMap: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var languageMap = ['abap', 'actionscript-3', 'ada', 'apache', 'apex', 'apl', 'applescript', 'ara', 'asm', 'astro', 'awk', 'ballerina', 'bat', 'beancount', 'berry', 'bibtex', 'bicep', 'blade', 'c', 'cadence', 'clarity', 'clojure', 'cmake', 'cobol', 'codeql', 'coffee', 'cpp', 'crystal', 'csharp', 'css', 'cue', 'cypher', 'd', 'dart', 'dax', 'diff', 'docker', 'dream-maker', 'elixir', 'elm', 'erb', 'erlang', 'fish', 'fsharp', 'gdresource', 'gdscript', 'gdshader', 'gherkin', 'git-commit', 'git-rebase', 'glimmer-js', 'glimmer-ts', 'glsl', 'gnuplot', 'go', 'graphql', 'groovy', 'hack', 'haml', 'handlebars', 'haskell', 'hcl', 'hjson', 'hlsl', 'html', 'http', 'imba', 'ini', 'java', 'javascript', 'jinja-html', 'jison', 'json', 'json5', 'jsonc', 'jsonl', 'jsonnet', 'jssm', 'jsx', 'julia', 'kotlin', 'kusto', 'latex', 'less', 'liquid', 'lisp', 'logo', 'lua', 'make', 'markdown', 'marko', 'matlab', 'mdc', 'mdx', 'mermaid', 'mojo', 'narrat', 'nextflow', 'nginx', 'nim', 'nix', 'objective-c', 'objective-cpp', 'ocaml', 'pascal', 'perl', 'php', 'plsql', 'postcss', 'powerquery', 'powershell', 'prisma', 'prolog', 'proto', 'pug', 'puppet', 'purescript', 'python', 'r', 'raku', 'razor', 'reg', 'rel', 'riscv', 'rst', 'ruby', 'rust', 'sas', 'sass', 'scala', 'scheme', 'scss', 'shaderlab', 'shellscript', 'shellsession', 'smalltalk', 'solidity', 'sparql', 'splunk', 'sql', 'ssh-config', 'stata', 'stylus', 'svelte', 'swift', 'system-verilog', 'tasl', 'tcl', 'tex', 'toml', 'tsx', 'turtle', 'twig', 'typescript', 'v', 'vb', 'verilog', 'vhdl', 'viml', 'vue', 'vue-html', 'vyper', 'wasm', 'wenyan', 'wgsl', 'wolfram', 'xml', 'xsl', 'yaml', 'zenscript', 'zig', 'bash', 'batch', 'be', 'c#', 'cdc', 'clj', 'cmd', 'console', 'cql', 'cs', 'dockerfile', 'erl', 'f#', 'fs', 'fsl', 'gjs', 'gts', 'hbs', 'hs', 'jade', 'js', 'kql', 'makefile', 'md', 'nar', 'nf', 'objc', 'perl6', 'properties', 'ps', 'ps1', 'py', 'ql', 'rb', 'rs', 'sh', 'shader', 'shell', 'spl', 'styl', 'ts', 'vim', 'vimscript', 'vy', 'yml', 'zsh', '文言'];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { transformerNotationDiff, transformerNotationErrorLevel, transformerNotationFocus, transformerNotationHighlight, transformerNotationWordHighlight } from '@shikijs/transformers';
|
|
4
|
+
import { createHighlighter } from 'shiki';
|
|
5
|
+
import useSWR from 'swr';
|
|
6
|
+
import { themeConfig } from "../Highlighter/theme";
|
|
7
|
+
import { languageMap } from "./languageMap";
|
|
8
|
+
export var FALLBACK_LANG = 'txt';
|
|
9
|
+
var FALLBACK_LANGS = [FALLBACK_LANG];
|
|
10
|
+
var cacheHighlighter;
|
|
11
|
+
var initHighlighter = /*#__PURE__*/function () {
|
|
12
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(lang) {
|
|
13
|
+
var highlighter, language;
|
|
14
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
15
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16
|
+
case 0:
|
|
17
|
+
highlighter = cacheHighlighter;
|
|
18
|
+
language = lang.toLowerCase();
|
|
19
|
+
if (!(highlighter && FALLBACK_LANGS.includes(language))) {
|
|
20
|
+
_context.next = 4;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
return _context.abrupt("return", highlighter);
|
|
24
|
+
case 4:
|
|
25
|
+
if (languageMap.includes(language) && !FALLBACK_LANGS.includes(language)) {
|
|
26
|
+
FALLBACK_LANGS.push(language);
|
|
27
|
+
}
|
|
28
|
+
_context.next = 7;
|
|
29
|
+
return createHighlighter({
|
|
30
|
+
langs: FALLBACK_LANGS,
|
|
31
|
+
themes: [themeConfig(true), themeConfig(false)]
|
|
32
|
+
});
|
|
33
|
+
case 7:
|
|
34
|
+
highlighter = _context.sent;
|
|
35
|
+
cacheHighlighter = highlighter;
|
|
36
|
+
return _context.abrupt("return", highlighter);
|
|
37
|
+
case 10:
|
|
38
|
+
case "end":
|
|
39
|
+
return _context.stop();
|
|
40
|
+
}
|
|
41
|
+
}, _callee);
|
|
42
|
+
}));
|
|
43
|
+
return function initHighlighter(_x) {
|
|
44
|
+
return _ref.apply(this, arguments);
|
|
45
|
+
};
|
|
46
|
+
}();
|
|
47
|
+
export var useHighlight = function useHighlight(text, lang, isDarkMode) {
|
|
48
|
+
return useSWR([lang === null || lang === void 0 ? void 0 : lang.toLowerCase(), isDarkMode ? 'dark' : 'light', text].join('-'), /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
49
|
+
var language, highlighter, html;
|
|
50
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
51
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
_context2.prev = 0;
|
|
54
|
+
language = lang.toLowerCase();
|
|
55
|
+
_context2.next = 4;
|
|
56
|
+
return initHighlighter(language);
|
|
57
|
+
case 4:
|
|
58
|
+
highlighter = _context2.sent;
|
|
59
|
+
html = highlighter === null || highlighter === void 0 ? void 0 : highlighter.codeToHtml(text, {
|
|
60
|
+
lang: languageMap.includes(language) ? language : FALLBACK_LANG,
|
|
61
|
+
theme: isDarkMode ? 'dark' : 'light',
|
|
62
|
+
transformers: [transformerNotationDiff(), transformerNotationHighlight(), transformerNotationWordHighlight(), transformerNotationFocus(), transformerNotationErrorLevel()]
|
|
63
|
+
});
|
|
64
|
+
return _context2.abrupt("return", html);
|
|
65
|
+
case 9:
|
|
66
|
+
_context2.prev = 9;
|
|
67
|
+
_context2.t0 = _context2["catch"](0);
|
|
68
|
+
return _context2.abrupt("return", '');
|
|
69
|
+
case 12:
|
|
70
|
+
case "end":
|
|
71
|
+
return _context2.stop();
|
|
72
|
+
}
|
|
73
|
+
}, _callee2, null, [[0, 9]]);
|
|
74
|
+
})), {
|
|
75
|
+
revalidateOnFocus: false
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export { languageMap } from "./languageMap";
|
package/es/index.d.ts
CHANGED
|
@@ -1,7 +1,44 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './ButtonGroup';
|
|
2
|
+
export * from './CollapseGroup';
|
|
2
3
|
export * from './ConfigProvider';
|
|
4
|
+
export * from './DragPanel';
|
|
3
5
|
export * from './Logo';
|
|
6
|
+
export * from './LogViewer';
|
|
7
|
+
export * from './Mentions';
|
|
4
8
|
export * from './MonacoEditor';
|
|
9
|
+
export * from './Page';
|
|
10
|
+
export * from './ProCard';
|
|
11
|
+
export * from './SelectCard';
|
|
5
12
|
export * from './SliderInput';
|
|
13
|
+
export * from './Status';
|
|
14
|
+
export * from './Alert';
|
|
15
|
+
export * from './App';
|
|
16
|
+
export * from './Breadcrumb';
|
|
17
|
+
export * from './Card';
|
|
18
|
+
export * from './Descriptions';
|
|
19
|
+
export * from './Divider';
|
|
20
|
+
export * from './Drawer';
|
|
21
|
+
export * from './Dropdown';
|
|
22
|
+
export * from './Form';
|
|
23
|
+
export * from './FormHelper';
|
|
24
|
+
export * from './Modal';
|
|
25
|
+
export * from './notification';
|
|
26
|
+
export * from './Radio';
|
|
27
|
+
export * from './Table';
|
|
6
28
|
export * from './Tree';
|
|
29
|
+
export * from './Typography';
|
|
30
|
+
export * from './ChatInputArea';
|
|
31
|
+
export * from './ChatItem';
|
|
32
|
+
export * from './EditableMessage';
|
|
33
|
+
export * from './Highlighter';
|
|
34
|
+
export * from './styles';
|
|
35
|
+
export * from './useSpeechSynthes';
|
|
36
|
+
export * from './WaveformIcon';
|
|
37
|
+
export { Affix, type AffixProps, Anchor, type AnchorProps, type MentionProps as AntdMentionProps, Mentions as AntdMentions, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, BackTop, type BackTopProps, Badge, // @todo composed type
|
|
38
|
+
type BadgeProps, Button, // @todo dependence unifiedLink. link type, hover primary color, back button
|
|
39
|
+
type ButtonProps, Calendar, type CalendarProps, Carousel, type CarouselProps, Cascader, type CascaderProps, Checkbox, type CheckboxProps, Col, Collapse, type CollapseProps, ColorPicker, type ColorPickerProps, type ColProps, // @todo center style
|
|
40
|
+
type CountdownProps, DatePicker, type DatePickerProps, Empty, type EmptyProps, Flex, type FlexProps, FloatButton, type GlobalToken, Grid, Image, type ImageProps, Input, InputNumber, type InputNumberProps, type InputProps, type InputRef, Layout, type LayoutProps, List, type ListProps, type MappingAlgorithm, Menu, type MenuItemProps, type MenuProps, type MenuRef, type MenuTheme, message, type MessageArgsProps, Pagination, type PaginationProps, Popconfirm, type PopconfirmProps, Popover, type PopoverProps, Progress, type ProgressProps, QRCode, type QRCodeProps, type QRPropsCanvas, type QRPropsSvg, Rate, type RateProps, type RefSelectProps, Result, type ResultProps, Row, type RowProps, Segmented, type SegmentedProps, Select, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderSingleProps, Space, type SpaceProps, Spin, type SpinProps, Statistic, type StatisticProps, type StepProps, Steps, type StepsProps, type SubMenuProps, Switch, type SwitchProps, type TabPaneProps, Tabs, type TabsProps, Tag, type TagProps, type TagType, theme, Timeline, type TimelineItemProps, type TimelineProps, TimePicker, type TimePickerProps, type TimeRangePickerProps, Tooltip, type TooltipProps, Tour, type TourProps, type TourStepProps, Transfer, type TransferProps, Tree, type TreeDataNode, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, Upload, type UploadFile, type UploadProps, version, Watermark, type WatermarkProps, } from 'antd';
|
|
41
|
+
export { Markdown, type MarkdownProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from '@lobehub/ui';
|
|
42
|
+
export { SpeechSynthesisTTS } from '@lobehub/tts';
|
|
43
|
+
export { AudioPlayer, useAudioPlayer, useSpeechRecognition } from '@lobehub/tts/react';
|
|
7
44
|
export { useResponsive, useTheme, useThemeMode } from 'antd-style';
|