@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,13 @@
|
|
|
1
|
+
import { Alert as AntdAlert, type AlertProps as AntdAlertProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface CustomAlertProps {
|
|
4
|
+
/** border type of Alert */
|
|
5
|
+
bordered?: 'dashed' | 'solid' | 'none';
|
|
6
|
+
}
|
|
7
|
+
export interface AlertProps extends AntdAlertProps, CustomAlertProps {
|
|
8
|
+
}
|
|
9
|
+
type ComposedAlertProps = React.FC<AlertProps> & {
|
|
10
|
+
ErrorBoundary: typeof AntdAlert.ErrorBoundary;
|
|
11
|
+
};
|
|
12
|
+
export declare const Alert: ComposedAlertProps;
|
|
13
|
+
export default Alert;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["bordered", "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 { Alert as AntdAlert } from 'antd';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { useStyles } from "./style";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export var Alert = function Alert(props) {
|
|
11
|
+
var _props$bordered = props.bordered,
|
|
12
|
+
bordered = _props$bordered === void 0 ? 'dashed' : _props$bordered,
|
|
13
|
+
className = props.className,
|
|
14
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
15
|
+
var _useStyles = useStyles({
|
|
16
|
+
bordered: bordered
|
|
17
|
+
}),
|
|
18
|
+
styles = _useStyles.styles,
|
|
19
|
+
cx = _useStyles.cx;
|
|
20
|
+
return /*#__PURE__*/_jsx(AntdAlert, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
21
|
+
className: cx(styles.custom, className)
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
Alert.ErrorBoundary = AntdAlert.ErrorBoundary;
|
|
25
|
+
export default Alert;
|
|
@@ -0,0 +1,13 @@
|
|
|
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, _ref2) {
|
|
5
|
+
var css = _ref.css;
|
|
6
|
+
var _ref2$bordered = _ref2.bordered,
|
|
7
|
+
bordered = _ref2$bordered === void 0 ? 'dashed' : _ref2$bordered;
|
|
8
|
+
return {
|
|
9
|
+
custom: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-style: ", " !important;\n "])), bordered)
|
|
10
|
+
};
|
|
11
|
+
}, {
|
|
12
|
+
hashPriority: 'low'
|
|
13
|
+
});
|
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 { 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,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"];
|
|
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 Actions from '@lobehub/ui/es/chat/ChatItem/components/Actions';
|
|
9
|
+
import Avatar from '@lobehub/ui/es/chat/ChatItem/components/Avatar';
|
|
10
|
+
import BorderSpacing from '@lobehub/ui/es/chat/ChatItem/components/BorderSpacing';
|
|
11
|
+
import ErrorContent from '@lobehub/ui/es/chat/ChatItem/components/ErrorContent';
|
|
12
|
+
import Title from '@lobehub/ui/es/chat/ChatItem/components/Title';
|
|
13
|
+
import { useStyles } from '@lobehub/ui/es/chat/ChatItem/style';
|
|
14
|
+
import { useResponsive } from 'antd-style';
|
|
15
|
+
import { memo } from 'react';
|
|
16
|
+
import { Flexbox } from 'react-layout-kit';
|
|
17
|
+
import MessageContent from "./components/MessageContent";
|
|
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
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
var _useResponsive = useResponsive(),
|
|
51
|
+
mobile = _useResponsive.mobile;
|
|
52
|
+
var _useStyles = useStyles({
|
|
53
|
+
editing: editing,
|
|
54
|
+
placement: placement,
|
|
55
|
+
primary: primary,
|
|
56
|
+
showTitle: showTitle,
|
|
57
|
+
time: time,
|
|
58
|
+
title: avatar.title,
|
|
59
|
+
type: type
|
|
60
|
+
}),
|
|
61
|
+
cx = _useStyles.cx,
|
|
62
|
+
styles = _useStyles.styles;
|
|
63
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
64
|
+
className: cx(styles.container, className),
|
|
65
|
+
direction: placement === 'left' ? 'horizontal' : 'horizontal-reverse',
|
|
66
|
+
gap: mobile ? 6 : 12
|
|
67
|
+
}, rest), {}, {
|
|
68
|
+
children: [/*#__PURE__*/_jsx(Avatar, _objectSpread(_objectSpread({}, avatarProps), {}, {
|
|
69
|
+
addon: avatarAddon,
|
|
70
|
+
avatar: avatar,
|
|
71
|
+
loading: loading,
|
|
72
|
+
onClick: onAvatarClick,
|
|
73
|
+
placement: placement,
|
|
74
|
+
size: mobile ? MOBILE_AVATAR_SIZE : undefined
|
|
75
|
+
})), /*#__PURE__*/_jsxs(Flexbox, {
|
|
76
|
+
align: placement === 'left' ? 'flex-start' : 'flex-end',
|
|
77
|
+
className: styles.messageContainer,
|
|
78
|
+
children: [/*#__PURE__*/_jsx(Title, {
|
|
79
|
+
avatar: avatar,
|
|
80
|
+
placement: placement,
|
|
81
|
+
showTitle: showTitle,
|
|
82
|
+
time: time
|
|
83
|
+
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
84
|
+
align: placement === 'left' ? 'flex-start' : 'flex-end',
|
|
85
|
+
className: styles.messageContent,
|
|
86
|
+
direction:
|
|
87
|
+
// eslint-disable-next-line no-nested-ternary
|
|
88
|
+
type === 'block' ? placement === 'left' ? 'horizontal' : 'horizontal-reverse' : '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,24 @@
|
|
|
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
|
+
} | undefined) => import("antd-style").ReturnStyles<{
|
|
11
|
+
actions: string;
|
|
12
|
+
avatarContainer: import("antd-style").SerializedStyles;
|
|
13
|
+
avatarGroupContainer: import("antd-style").SerializedStyles;
|
|
14
|
+
container: string;
|
|
15
|
+
editingContainer: string;
|
|
16
|
+
editingInput: import("antd-style").SerializedStyles;
|
|
17
|
+
errorContainer: import("antd-style").SerializedStyles;
|
|
18
|
+
loading: import("antd-style").SerializedStyles;
|
|
19
|
+
message: string;
|
|
20
|
+
messageContainer: string;
|
|
21
|
+
messageContent: string;
|
|
22
|
+
messageExtra: string;
|
|
23
|
+
name: import("antd-style").SerializedStyles;
|
|
24
|
+
}>;
|