@yuntijs/ui 1.0.0-beta.9 → 1.0.0-beta.90
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/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/Actions.d.ts +10 -0
- package/es/ChatItem/components/Actions.js +23 -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 +25 -0
- package/es/ChatItem/style.js +39 -0
- package/es/ChatItem/type.d.ts +86 -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/JsonViewer/index.d.ts +21 -0
- package/es/JsonViewer/index.js +120 -0
- package/es/JsonViewer/style.d.ts +7 -0
- package/es/JsonViewer/style.js +19 -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 +23 -0
- package/es/Mentions/index.js +157 -0
- package/es/Mentions/plugins/OnBlurBlockPlugin.d.ts +7 -0
- package/es/Mentions/plugins/OnBlurBlockPlugin.js +35 -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/editable.d.ts +4 -0
- package/es/Mentions/plugins/editable.js +13 -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 +22 -0
- package/es/Mentions/plugins/mention-node/node.js +100 -0
- package/es/Mentions/plugins/mention-node/replacement.d.ts +5 -0
- package/es/Mentions/plugins/mention-node/replacement.js +43 -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 +10 -0
- package/es/Mentions/plugins/mention-picker/hooks.d.ts +5 -0
- package/es/Mentions/plugins/mention-picker/hooks.js +65 -0
- package/es/Mentions/plugins/mention-picker/index.d.ts +39 -0
- package/es/Mentions/plugins/mention-picker/index.js +137 -0
- package/es/Mentions/plugins/mention-picker/menu-item.d.ts +12 -0
- package/es/Mentions/plugins/mention-picker/menu-item.js +73 -0
- package/es/Mentions/plugins/mention-picker/menu.d.ts +10 -0
- package/es/Mentions/plugins/mention-picker/menu.js +31 -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 +31 -0
- package/es/Mentions/plugins/mention-picker/utils.js +66 -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 +12 -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 +39 -0
- package/es/MonacoEditor/base/index.js +238 -0
- package/es/MonacoEditor/base/monaco.d.ts +6 -0
- package/es/MonacoEditor/base/monaco.js +64 -0
- package/es/MonacoEditor/{style.d.ts → base/style.d.ts} +4 -1
- package/es/MonacoEditor/base/style.js +43 -0
- package/es/MonacoEditor/index.d.ts +5 -4
- package/es/MonacoEditor/index.js +26 -62
- 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/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 +9 -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 -3
- package/es/index.js +48 -3
- 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 +31 -9
- package/umd/index.min.css +2 -0
- package/umd/index.min.css.map +1 -0
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
- package/es/MonacoEditor/style.js +0 -24
package/es/App/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
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 { App as AntdApp } from 'antd';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { NotificationGlobalStyle } from "../notification";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
export var App = function App(props) {
|
|
12
|
+
var children = props.children,
|
|
13
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
14
|
+
return /*#__PURE__*/_jsxs(AntdApp, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
15
|
+
children: [/*#__PURE__*/_jsx(NotificationGlobalStyle, {}), children]
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
App.useApp = AntdApp.useApp;
|
|
19
|
+
export default App;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ButtonProps } from 'antd';
|
|
2
|
+
import type { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
3
|
+
import type { ItemType } from 'antd/es/menu/interface';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export type ButtonType = {
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
danger?: boolean;
|
|
10
|
+
ghost?: boolean;
|
|
11
|
+
block?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
loading?: boolean | {
|
|
14
|
+
delay?: number;
|
|
15
|
+
};
|
|
16
|
+
type?: ButtonProps['type'];
|
|
17
|
+
};
|
|
18
|
+
export type ButtonGroupItem = ButtonType | ItemType;
|
|
19
|
+
export interface ButtonGroupProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'onClick'> {
|
|
20
|
+
onClick?: (key: string, e: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement>) => void;
|
|
21
|
+
items?: ButtonGroupItem[];
|
|
22
|
+
size?: SizeType;
|
|
23
|
+
}
|
|
24
|
+
export declare const ButtonGroup: React.FC<ButtonGroupProps>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import _toArray from "@babel/runtime/helpers/esm/toArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["items", "onClick", "size"],
|
|
5
|
+
_excluded2 = ["key", "label"],
|
|
6
|
+
_excluded3 = ["key", "label"];
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
import { Button, Dropdown, Space } from 'antd';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export var ButtonGroup = function ButtonGroup(props) {
|
|
13
|
+
var _props$items = props.items,
|
|
14
|
+
items = _props$items === void 0 ? [] : _props$items,
|
|
15
|
+
_props$onClick = props.onClick,
|
|
16
|
+
_onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
|
|
17
|
+
size = props.size,
|
|
18
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
19
|
+
if (items.length <= 2) {
|
|
20
|
+
return /*#__PURE__*/_jsx(Space, _objectSpread(_objectSpread({
|
|
21
|
+
align: "end",
|
|
22
|
+
size: 12
|
|
23
|
+
}, otherProps), {}, {
|
|
24
|
+
children: items.map(function (_ref) {
|
|
25
|
+
var key = _ref.key,
|
|
26
|
+
label = _ref.label,
|
|
27
|
+
btnProps = _objectWithoutProperties(_ref, _excluded2);
|
|
28
|
+
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
29
|
+
onClick: function onClick(e) {
|
|
30
|
+
return _onClick(key, e);
|
|
31
|
+
},
|
|
32
|
+
size: size
|
|
33
|
+
}, btnProps), {}, {
|
|
34
|
+
children: label
|
|
35
|
+
}), key);
|
|
36
|
+
})
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
var _items = _toArray(items),
|
|
40
|
+
firstButton = _items[0],
|
|
41
|
+
menuItems = _items.slice(1);
|
|
42
|
+
var _ref2 = firstButton,
|
|
43
|
+
firstKey = _ref2.key,
|
|
44
|
+
firstLabel = _ref2.label,
|
|
45
|
+
btnProps = _objectWithoutProperties(_ref2, _excluded3);
|
|
46
|
+
return /*#__PURE__*/_jsx(Dropdown.Button, _objectSpread(_objectSpread(_objectSpread({
|
|
47
|
+
onClick: function onClick(e) {
|
|
48
|
+
return _onClick(firstKey, e);
|
|
49
|
+
}
|
|
50
|
+
}, btnProps), {}, {
|
|
51
|
+
menu: {
|
|
52
|
+
onClick: function onClick(_ref3) {
|
|
53
|
+
var key = _ref3.key,
|
|
54
|
+
domEvent = _ref3.domEvent;
|
|
55
|
+
return _onClick(key, domEvent);
|
|
56
|
+
},
|
|
57
|
+
items: menuItems
|
|
58
|
+
},
|
|
59
|
+
overlayStyle: {
|
|
60
|
+
minWidth: 100
|
|
61
|
+
},
|
|
62
|
+
size: size
|
|
63
|
+
}, otherProps), {}, {
|
|
64
|
+
children: firstLabel
|
|
65
|
+
}), firstKey);
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Card, type CardProps } from 'antd';
|
package/es/Card/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Card } from 'antd';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { MoreOutlined } from '@ant-design/icons';
|
|
2
|
+
import { Avatar, Dropdown, Flex } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Card } from "../../Card";
|
|
5
|
+
import { Typography } from "../../Typography";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
var Text = Typography.Text;
|
|
9
|
+
export var CardListItem = function CardListItem(_ref) {
|
|
10
|
+
var children = _ref.children;
|
|
11
|
+
return /*#__PURE__*/_jsx(Card
|
|
12
|
+
// hoverable
|
|
13
|
+
// bordered={false}
|
|
14
|
+
, {
|
|
15
|
+
extra: /*#__PURE__*/_jsx(Dropdown.Button, {
|
|
16
|
+
icon: /*#__PURE__*/_jsx(MoreOutlined, {}),
|
|
17
|
+
menu: {
|
|
18
|
+
items: [{
|
|
19
|
+
key: 'edit',
|
|
20
|
+
label: '编辑'
|
|
21
|
+
}]
|
|
22
|
+
},
|
|
23
|
+
size: "small",
|
|
24
|
+
type: "text"
|
|
25
|
+
}),
|
|
26
|
+
title: /*#__PURE__*/_jsxs(Flex, {
|
|
27
|
+
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
28
|
+
shape: "square",
|
|
29
|
+
size: 72
|
|
30
|
+
}), /*#__PURE__*/_jsxs(Flex, {
|
|
31
|
+
vertical: true,
|
|
32
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
33
|
+
strong: true,
|
|
34
|
+
children: "\u6211\u662F\u6807\u9898"
|
|
35
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
36
|
+
type: "secondary",
|
|
37
|
+
children: "\u6211\u662F\u63CF\u8FF0\u4FE1\u606F"
|
|
38
|
+
})]
|
|
39
|
+
})]
|
|
40
|
+
}),
|
|
41
|
+
children: children
|
|
42
|
+
});
|
|
43
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { List } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CardListItem } from "./Item";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
var data = [{
|
|
6
|
+
title: 'Title 1'
|
|
7
|
+
}, {
|
|
8
|
+
title: 'Title 2'
|
|
9
|
+
}, {
|
|
10
|
+
title: 'Title 3'
|
|
11
|
+
}, {
|
|
12
|
+
title: 'Title 4'
|
|
13
|
+
}, {
|
|
14
|
+
title: 'Title 5'
|
|
15
|
+
}, {
|
|
16
|
+
title: 'Title 6'
|
|
17
|
+
}];
|
|
18
|
+
export var CardList = function CardList() {
|
|
19
|
+
return /*#__PURE__*/_jsx(List, {
|
|
20
|
+
dataSource: data,
|
|
21
|
+
grid: {
|
|
22
|
+
column: 3,
|
|
23
|
+
gutter: 16,
|
|
24
|
+
xs: 1,
|
|
25
|
+
sm: 2,
|
|
26
|
+
md: 2,
|
|
27
|
+
lg: 3,
|
|
28
|
+
xl: 4,
|
|
29
|
+
xxl: 4
|
|
30
|
+
},
|
|
31
|
+
renderItem: function renderItem(item) {
|
|
32
|
+
return /*#__PURE__*/_jsx(List.Item, {
|
|
33
|
+
children: /*#__PURE__*/_jsx(CardListItem, {
|
|
34
|
+
children: "Card content"
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ChatInputAreaInnerProps, type DraggablePanelProps } from '@lobehub/ui';
|
|
2
|
+
import type { TextAreaRef } from 'antd/es/input/TextArea';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export interface ChatInputAreaProps extends Omit<ChatInputAreaInnerProps, 'classNames'> {
|
|
5
|
+
bottomAddons?: ReactNode;
|
|
6
|
+
classNames?: DraggablePanelProps['classNames'];
|
|
7
|
+
expand?: boolean;
|
|
8
|
+
heights?: {
|
|
9
|
+
headerHeight?: number;
|
|
10
|
+
inputHeight?: number;
|
|
11
|
+
maxHeight?: number;
|
|
12
|
+
minHeight?: number;
|
|
13
|
+
};
|
|
14
|
+
onSizeChange?: DraggablePanelProps['onSizeChange'];
|
|
15
|
+
setExpand?: (expand: boolean) => void;
|
|
16
|
+
topAddons?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<ChatInputAreaProps & import("react").RefAttributes<TextAreaRef>>>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
4
|
+
var _excluded = ["className", "style", "classNames", "expand", "setExpand", "bottomAddons", "topAddons", "onSizeChange", "heights", "onSend"];
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
import { ChatInputAreaInner, DraggablePanel } from '@lobehub/ui';
|
|
9
|
+
import { createStyles } from 'antd-style';
|
|
10
|
+
import { forwardRef, memo } from 'react';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
var useStyles = createStyles(function (_ref) {
|
|
14
|
+
var css = _ref.css;
|
|
15
|
+
return {
|
|
16
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n height: 100%;\n padding-block: 12px 16px;\n padding-inline: 0;\n "]))),
|
|
17
|
+
textarea: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-block: 0;\n padding-inline: 24px;\n line-height: 1.5;\n "]))),
|
|
18
|
+
textareaContainer: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n flex: 1;\n "])))
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
var ChatInputArea = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
22
|
+
var className = _ref2.className,
|
|
23
|
+
style = _ref2.style,
|
|
24
|
+
classNames = _ref2.classNames,
|
|
25
|
+
_ref2$expand = _ref2.expand,
|
|
26
|
+
expand = _ref2$expand === void 0 ? true : _ref2$expand,
|
|
27
|
+
setExpand = _ref2.setExpand,
|
|
28
|
+
bottomAddons = _ref2.bottomAddons,
|
|
29
|
+
topAddons = _ref2.topAddons,
|
|
30
|
+
onSizeChange = _ref2.onSizeChange,
|
|
31
|
+
heights = _ref2.heights,
|
|
32
|
+
_onSend = _ref2.onSend,
|
|
33
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
34
|
+
var _useStyles = useStyles(),
|
|
35
|
+
styles = _useStyles.styles;
|
|
36
|
+
return /*#__PURE__*/_jsx(DraggablePanel, {
|
|
37
|
+
className: className,
|
|
38
|
+
classNames: classNames,
|
|
39
|
+
fullscreen: expand,
|
|
40
|
+
headerHeight: heights === null || heights === void 0 ? void 0 : heights.headerHeight,
|
|
41
|
+
maxHeight: heights === null || heights === void 0 ? void 0 : heights.maxHeight,
|
|
42
|
+
minHeight: heights === null || heights === void 0 ? void 0 : heights.minHeight,
|
|
43
|
+
onSizeChange: onSizeChange,
|
|
44
|
+
placement: "bottom",
|
|
45
|
+
size: {
|
|
46
|
+
height: heights === null || heights === void 0 ? void 0 : heights.inputHeight,
|
|
47
|
+
width: '100%'
|
|
48
|
+
},
|
|
49
|
+
style: _objectSpread({
|
|
50
|
+
zIndex: 10
|
|
51
|
+
}, style),
|
|
52
|
+
children: /*#__PURE__*/_jsxs("section", {
|
|
53
|
+
className: styles.container,
|
|
54
|
+
style: {
|
|
55
|
+
minHeight: heights === null || heights === void 0 ? void 0 : heights.minHeight
|
|
56
|
+
},
|
|
57
|
+
children: [topAddons, /*#__PURE__*/_jsx("div", {
|
|
58
|
+
className: styles.textareaContainer,
|
|
59
|
+
children: /*#__PURE__*/_jsx(ChatInputAreaInner, _objectSpread({
|
|
60
|
+
className: styles.textarea,
|
|
61
|
+
onSend: function onSend() {
|
|
62
|
+
_onSend === null || _onSend === void 0 || _onSend();
|
|
63
|
+
setExpand === null || setExpand === void 0 || setExpand(false);
|
|
64
|
+
},
|
|
65
|
+
ref: ref,
|
|
66
|
+
type: 'pure'
|
|
67
|
+
}, rest))
|
|
68
|
+
}), bottomAddons]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
export default /*#__PURE__*/memo(ChatInputArea);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ChatInputArea, type ChatInputAreaProps } from './desktop/ChatInputArea';
|
|
2
|
+
export { ChatInputActionBar, type ChatInputActionBarProps } from '@lobehub/ui';
|
|
3
|
+
export { ChatInputAreaInner, type ChatInputAreaInnerProps } from '@lobehub/ui';
|
|
4
|
+
export { ChatSendButton, type ChatSendButtonProps } from '@lobehub/ui';
|
|
5
|
+
export { MobileChatInputArea, type MobileChatInputAreaProps } from '@lobehub/ui';
|
|
6
|
+
export { MobileChatSendButton, type MobileChatSendButtonProps } from '@lobehub/ui';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ChatInputArea } from "./desktop/ChatInputArea";
|
|
2
|
+
export { ChatInputActionBar } from '@lobehub/ui';
|
|
3
|
+
export { ChatInputAreaInner } from '@lobehub/ui';
|
|
4
|
+
export { ChatSendButton } from '@lobehub/ui';
|
|
5
|
+
export { MobileChatInputArea } from '@lobehub/ui';
|
|
6
|
+
export { MobileChatSendButton } from '@lobehub/ui';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChatItemProps } from '../type';
|
|
3
|
+
export interface ActionsProps {
|
|
4
|
+
actions: ChatItemProps['actions'];
|
|
5
|
+
editing?: boolean;
|
|
6
|
+
placement?: ChatItemProps['placement'];
|
|
7
|
+
type?: ChatItemProps['type'];
|
|
8
|
+
}
|
|
9
|
+
declare const Actions: import("react").NamedExoticComponent<ActionsProps>;
|
|
10
|
+
export default Actions;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import { Flexbox } from 'react-layout-kit';
|
|
3
|
+
import { useStyles } from "../style";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
var Actions = /*#__PURE__*/memo(function (_ref) {
|
|
6
|
+
var actions = _ref.actions,
|
|
7
|
+
placement = _ref.placement,
|
|
8
|
+
type = _ref.type,
|
|
9
|
+
editing = _ref.editing;
|
|
10
|
+
var _useStyles = useStyles({
|
|
11
|
+
editing: editing,
|
|
12
|
+
placement: placement,
|
|
13
|
+
type: type
|
|
14
|
+
}),
|
|
15
|
+
styles = _useStyles.styles;
|
|
16
|
+
return /*#__PURE__*/_jsx(Flexbox, {
|
|
17
|
+
align: 'flex-start',
|
|
18
|
+
className: styles.actions,
|
|
19
|
+
role: "menubar",
|
|
20
|
+
children: actions
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export default Actions;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { EditableMessageProps } from "../../EditableMessage";
|
|
3
|
+
import { ChatItemProps } from '../type';
|
|
4
|
+
export interface MessageContentProps {
|
|
5
|
+
editing?: ChatItemProps['editing'];
|
|
6
|
+
fontSize?: number;
|
|
7
|
+
message?: ReactNode;
|
|
8
|
+
messageExtra?: ChatItemProps['messageExtra'];
|
|
9
|
+
onChange?: ChatItemProps['onChange'];
|
|
10
|
+
onDoubleClick?: ChatItemProps['onDoubleClick'];
|
|
11
|
+
onEditingChange?: ChatItemProps['onEditingChange'];
|
|
12
|
+
placement?: ChatItemProps['placement'];
|
|
13
|
+
primary?: ChatItemProps['primary'];
|
|
14
|
+
renderMessage?: ChatItemProps['renderMessage'];
|
|
15
|
+
text?: ChatItemProps['text'];
|
|
16
|
+
type?: ChatItemProps['type'];
|
|
17
|
+
markdownProps?: EditableMessageProps['markdownProps'];
|
|
18
|
+
markdownClassname?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const MessageContent: import("react").NamedExoticComponent<MessageContentProps>;
|
|
21
|
+
export default MessageContent;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useResponsive } from 'antd-style';
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
|
4
|
+
import { EditableMessage } from "../../EditableMessage";
|
|
5
|
+
import { useStyles } from "../style";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
var MessageContent = /*#__PURE__*/memo(function (_ref) {
|
|
9
|
+
var editing = _ref.editing,
|
|
10
|
+
onChange = _ref.onChange,
|
|
11
|
+
onEditingChange = _ref.onEditingChange,
|
|
12
|
+
text = _ref.text,
|
|
13
|
+
message = _ref.message,
|
|
14
|
+
placement = _ref.placement,
|
|
15
|
+
messageExtra = _ref.messageExtra,
|
|
16
|
+
renderMessage = _ref.renderMessage,
|
|
17
|
+
type = _ref.type,
|
|
18
|
+
primary = _ref.primary,
|
|
19
|
+
onDoubleClick = _ref.onDoubleClick,
|
|
20
|
+
fontSize = _ref.fontSize,
|
|
21
|
+
markdownProps = _ref.markdownProps,
|
|
22
|
+
markdownClassname = _ref.markdownClassname;
|
|
23
|
+
var _useStyles = useStyles({
|
|
24
|
+
editing: editing,
|
|
25
|
+
placement: placement,
|
|
26
|
+
primary: primary,
|
|
27
|
+
type: type
|
|
28
|
+
}),
|
|
29
|
+
cx = _useStyles.cx,
|
|
30
|
+
styles = _useStyles.styles;
|
|
31
|
+
var _useResponsive = useResponsive(),
|
|
32
|
+
mobile = _useResponsive.mobile;
|
|
33
|
+
var content = /*#__PURE__*/_jsx(EditableMessage, {
|
|
34
|
+
classNames: {
|
|
35
|
+
input: styles.editingInput,
|
|
36
|
+
markdown: markdownClassname
|
|
37
|
+
},
|
|
38
|
+
editButtonSize: 'small',
|
|
39
|
+
editing: editing,
|
|
40
|
+
fontSize: fontSize,
|
|
41
|
+
fullFeaturedCodeBlock: true,
|
|
42
|
+
markdownProps: markdownProps,
|
|
43
|
+
onChange: onChange,
|
|
44
|
+
onEditingChange: onEditingChange,
|
|
45
|
+
openModal: mobile ? editing : undefined,
|
|
46
|
+
text: text,
|
|
47
|
+
value: message ? String(message).trim() : ''
|
|
48
|
+
});
|
|
49
|
+
var messageContent = renderMessage ? renderMessage(content) : content;
|
|
50
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
51
|
+
className: cx(styles.message, editing && styles.editingContainer),
|
|
52
|
+
onDoubleClick: onDoubleClick,
|
|
53
|
+
children: [messageContent, messageExtra && !editing ? /*#__PURE__*/_jsx("div", {
|
|
54
|
+
className: styles.messageExtra,
|
|
55
|
+
children: messageExtra
|
|
56
|
+
}) : null]
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
export default MessageContent;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["avatarAddon", "onAvatarClick", "avatarProps", "actions", "className", "primary", "loading", "message", "placement", "type", "avatar", "error", "showTitle", "time", "editing", "onChange", "onEditingChange", "messageExtra", "renderMessage", "text", "errorMessage", "onDoubleClick", "fontSize", "markdownProps", "markdownClassname", "isLatest"];
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
import Avatar from '@lobehub/ui/es/chat/ChatItem/components/Avatar';
|
|
9
|
+
import BorderSpacing from '@lobehub/ui/es/chat/ChatItem/components/BorderSpacing';
|
|
10
|
+
import ErrorContent from '@lobehub/ui/es/chat/ChatItem/components/ErrorContent';
|
|
11
|
+
import Title from '@lobehub/ui/es/chat/ChatItem/components/Title';
|
|
12
|
+
import { useResponsive } from 'antd-style';
|
|
13
|
+
import { memo } from 'react';
|
|
14
|
+
import { Flexbox } from 'react-layout-kit';
|
|
15
|
+
import Actions from "./components/Actions";
|
|
16
|
+
import MessageContent from "./components/MessageContent";
|
|
17
|
+
import { useStyles } from "./style";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
var MOBILE_AVATAR_SIZE = 32;
|
|
21
|
+
export var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
22
|
+
var avatarAddon = _ref.avatarAddon,
|
|
23
|
+
onAvatarClick = _ref.onAvatarClick,
|
|
24
|
+
avatarProps = _ref.avatarProps,
|
|
25
|
+
actions = _ref.actions,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
primary = _ref.primary,
|
|
28
|
+
loading = _ref.loading,
|
|
29
|
+
message = _ref.message,
|
|
30
|
+
_ref$placement = _ref.placement,
|
|
31
|
+
placement = _ref$placement === void 0 ? 'left' : _ref$placement,
|
|
32
|
+
_ref$type = _ref.type,
|
|
33
|
+
type = _ref$type === void 0 ? 'block' : _ref$type,
|
|
34
|
+
avatar = _ref.avatar,
|
|
35
|
+
error = _ref.error,
|
|
36
|
+
showTitle = _ref.showTitle,
|
|
37
|
+
time = _ref.time,
|
|
38
|
+
editing = _ref.editing,
|
|
39
|
+
onChange = _ref.onChange,
|
|
40
|
+
onEditingChange = _ref.onEditingChange,
|
|
41
|
+
messageExtra = _ref.messageExtra,
|
|
42
|
+
renderMessage = _ref.renderMessage,
|
|
43
|
+
text = _ref.text,
|
|
44
|
+
errorMessage = _ref.errorMessage,
|
|
45
|
+
onDoubleClick = _ref.onDoubleClick,
|
|
46
|
+
fontSize = _ref.fontSize,
|
|
47
|
+
markdownProps = _ref.markdownProps,
|
|
48
|
+
markdownClassname = _ref.markdownClassname,
|
|
49
|
+
isLatest = _ref.isLatest,
|
|
50
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
var _useResponsive = useResponsive(),
|
|
52
|
+
mobile = _useResponsive.mobile;
|
|
53
|
+
var _useStyles = useStyles({
|
|
54
|
+
editing: editing,
|
|
55
|
+
placement: placement,
|
|
56
|
+
primary: primary,
|
|
57
|
+
showTitle: showTitle,
|
|
58
|
+
time: time,
|
|
59
|
+
title: avatar.title,
|
|
60
|
+
type: type,
|
|
61
|
+
isLatest: isLatest
|
|
62
|
+
}),
|
|
63
|
+
cx = _useStyles.cx,
|
|
64
|
+
styles = _useStyles.styles;
|
|
65
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
66
|
+
className: cx(styles.container, className),
|
|
67
|
+
direction: placement === 'left' ? 'horizontal' : 'horizontal-reverse',
|
|
68
|
+
gap: mobile ? 6 : 12
|
|
69
|
+
}, rest), {}, {
|
|
70
|
+
children: [/*#__PURE__*/_jsx(Avatar, _objectSpread(_objectSpread({}, avatarProps), {}, {
|
|
71
|
+
addon: avatarAddon,
|
|
72
|
+
avatar: avatar,
|
|
73
|
+
loading: loading,
|
|
74
|
+
onClick: onAvatarClick,
|
|
75
|
+
placement: placement,
|
|
76
|
+
size: mobile ? MOBILE_AVATAR_SIZE : undefined
|
|
77
|
+
})), /*#__PURE__*/_jsxs(Flexbox, {
|
|
78
|
+
align: placement === 'left' ? 'flex-start' : 'flex-end',
|
|
79
|
+
className: styles.messageContainer,
|
|
80
|
+
children: [/*#__PURE__*/_jsx(Title, {
|
|
81
|
+
avatar: avatar,
|
|
82
|
+
placement: placement,
|
|
83
|
+
showTitle: showTitle,
|
|
84
|
+
time: time
|
|
85
|
+
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
86
|
+
align: placement === 'left' ? 'flex-start' : 'flex-end',
|
|
87
|
+
className: styles.messageContent,
|
|
88
|
+
direction: 'vertical',
|
|
89
|
+
gap: 8,
|
|
90
|
+
children: [error ? /*#__PURE__*/_jsx(ErrorContent, {
|
|
91
|
+
error: error,
|
|
92
|
+
message: errorMessage,
|
|
93
|
+
placement: placement
|
|
94
|
+
}) : /*#__PURE__*/_jsx(MessageContent, {
|
|
95
|
+
editing: editing,
|
|
96
|
+
fontSize: fontSize,
|
|
97
|
+
markdownClassname: markdownClassname,
|
|
98
|
+
markdownProps: markdownProps,
|
|
99
|
+
message: message,
|
|
100
|
+
messageExtra: messageExtra,
|
|
101
|
+
onChange: onChange,
|
|
102
|
+
onDoubleClick: onDoubleClick,
|
|
103
|
+
onEditingChange: onEditingChange,
|
|
104
|
+
placement: placement,
|
|
105
|
+
primary: primary,
|
|
106
|
+
renderMessage: renderMessage,
|
|
107
|
+
text: text,
|
|
108
|
+
type: type
|
|
109
|
+
}), /*#__PURE__*/_jsx(Actions, {
|
|
110
|
+
actions: actions,
|
|
111
|
+
editing: editing,
|
|
112
|
+
placement: placement,
|
|
113
|
+
type: type
|
|
114
|
+
})]
|
|
115
|
+
})]
|
|
116
|
+
}), mobile && type === 'block' && /*#__PURE__*/_jsx(BorderSpacing, {
|
|
117
|
+
borderSpacing: MOBILE_AVATAR_SIZE
|
|
118
|
+
})]
|
|
119
|
+
}));
|
|
120
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const useStyles: (props?: {
|
|
2
|
+
avatarSize?: number | undefined;
|
|
3
|
+
editing?: boolean | undefined;
|
|
4
|
+
placement?: "left" | "right" | undefined;
|
|
5
|
+
primary?: boolean | undefined;
|
|
6
|
+
showTitle?: boolean | undefined;
|
|
7
|
+
time?: number | undefined;
|
|
8
|
+
title?: string | undefined;
|
|
9
|
+
type?: "block" | "pure" | undefined;
|
|
10
|
+
isLatest?: boolean | undefined;
|
|
11
|
+
} | undefined) => import("antd-style").ReturnStyles<{
|
|
12
|
+
actions: string;
|
|
13
|
+
avatarContainer: import("antd-style").SerializedStyles;
|
|
14
|
+
avatarGroupContainer: import("antd-style").SerializedStyles;
|
|
15
|
+
container: string;
|
|
16
|
+
editingContainer: string;
|
|
17
|
+
editingInput: import("antd-style").SerializedStyles;
|
|
18
|
+
errorContainer: import("antd-style").SerializedStyles;
|
|
19
|
+
loading: import("antd-style").SerializedStyles;
|
|
20
|
+
message: string;
|
|
21
|
+
messageContainer: string;
|
|
22
|
+
messageContent: string;
|
|
23
|
+
messageExtra: string;
|
|
24
|
+
name: import("antd-style").SerializedStyles;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
|
|
3
|
+
/* eslint-disable no-nested-ternary */
|
|
4
|
+
import { createStyles } from 'antd-style';
|
|
5
|
+
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
6
|
+
var cx = _ref.cx,
|
|
7
|
+
css = _ref.css,
|
|
8
|
+
token = _ref.token,
|
|
9
|
+
isDarkMode = _ref.isDarkMode,
|
|
10
|
+
responsive = _ref.responsive;
|
|
11
|
+
var placement = _ref2.placement,
|
|
12
|
+
type = _ref2.type,
|
|
13
|
+
title = _ref2.title,
|
|
14
|
+
primary = _ref2.primary,
|
|
15
|
+
avatarSize = _ref2.avatarSize,
|
|
16
|
+
editing = _ref2.editing,
|
|
17
|
+
time = _ref2.time,
|
|
18
|
+
isLatest = _ref2.isLatest;
|
|
19
|
+
var blockStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-block: 8px;\n padding-inline: 12px;\n\n background-color: ", ";\n border-radius: ", "px;\n\n transition: background-color 100ms ", ";\n "])), primary ? isDarkMode ? token.colorFill : token.colorBgElevated : isDarkMode ? token.colorFillSecondary : token.colorBgContainer, token.borderRadiusLG, token.motionEaseOut);
|
|
20
|
+
var pureStylish = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-block-start: ", ";\n "])), title ? 0 : '6px');
|
|
21
|
+
var pureContainerStylish = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-block-end: -16px;\n transition: background-color 100ms ", ";\n "])), token.motionEaseOut);
|
|
22
|
+
var typeStylish = type === 'block' ? blockStylish : pureStylish;
|
|
23
|
+
var editingStylish = editing && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
24
|
+
return {
|
|
25
|
+
actions: cx(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex: none;\n align-self: ", ";\n justify-content: ", ";\n "])), placement === 'left' ? 'flex-start' : 'flex-end', placement === 'left' ? 'flex-end' : 'flex-start'), editing && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n pointer-events: none !important;\n opacity: 0 !important;\n "])))),
|
|
26
|
+
avatarContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
|
|
27
|
+
avatarGroupContainer: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), avatarSize),
|
|
28
|
+
container: cx(type === 'pure' && pureContainerStylish, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n max-width: 100vw;\n padding: 16px;\n\n time {\n display: inline-block;\n white-space: nowrap;\n }\n\n div[role='menubar'] {\n display: flex;\n }\n\n time,\n div[role='menubar'] {\n pointer-events: ", ";\n opacity: ", ";\n transition: opacity 200ms ", ";\n }\n\n &:hover {\n time,\n div[role='menubar'] {\n pointer-events: unset;\n opacity: 1;\n }\n }\n\n ", " {\n padding-block: ", ";\n padding-inline: 8px;\n }\n "])), isLatest ? 'unset' : 'none', isLatest ? 1 : 0, token.motionEaseOut, responsive.mobile, type === 'pure' ? '12px' : '6px')),
|
|
29
|
+
editingContainer: cx(editingStylish, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n padding-block: 8px 12px;\n padding-inline: 12px;\n border: 1px solid ", ";\n\n &:active,\n &:hover {\n border-color: ", ";\n }\n "])), token.colorBorderSecondary, token.colorBorder), type === 'pure' && css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n "])), token.colorFillQuaternary, token.borderRadius)),
|
|
30
|
+
editingInput: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n width: 100%;\n "]))),
|
|
31
|
+
errorContainer: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n width: 100%;\n "]))),
|
|
32
|
+
loading: css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n position: absolute;\n inset-block-end: 0;\n inset-inline: ", "\n ", ";\n\n width: 16px;\n height: 16px;\n\n color: ", ";\n\n background: ", ";\n border-radius: 50%;\n "])), placement === 'right' ? '-4px' : 'unset', placement === 'left' ? '-4px' : 'unset', token.colorBgLayout, token.colorPrimary),
|
|
33
|
+
message: cx(typeStylish, css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n max-width: 100%;\n\n ", " {\n width: 100%;\n }\n "])), responsive.mobile)),
|
|
34
|
+
messageContainer: cx(editingStylish, css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n max-width: 100%;\n margin-block-start: ", "px;\n\n ", " {\n overflow-x: auto;\n }\n "])), time ? -16 : 0, responsive.mobile)),
|
|
35
|
+
messageContent: cx(editingStylish, css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n max-width: 100%;\n\n ", " {\n flex-direction: column !important;\n }\n "])), responsive.mobile)),
|
|
36
|
+
messageExtra: cx('message-extra'),
|
|
37
|
+
name: css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n margin-block-end: 6px;\n\n font-size: 12px;\n line-height: 1;\n color: ", ";\n text-align: ", ";\n "])), token.colorTextDescription, placement === 'left' ? 'left' : 'right')
|
|
38
|
+
};
|
|
39
|
+
});
|