@yuntijs/ui 1.0.0-beta.85 → 1.0.0-beta.87
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.
|
@@ -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;
|
package/es/ChatItem/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
5
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
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
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
8
|
import Avatar from '@lobehub/ui/es/chat/ChatItem/components/Avatar';
|
|
10
9
|
import BorderSpacing from '@lobehub/ui/es/chat/ChatItem/components/BorderSpacing';
|
|
11
10
|
import ErrorContent from '@lobehub/ui/es/chat/ChatItem/components/ErrorContent';
|
|
@@ -13,6 +12,7 @@ import Title from '@lobehub/ui/es/chat/ChatItem/components/Title';
|
|
|
13
12
|
import { useResponsive } from 'antd-style';
|
|
14
13
|
import { memo } from 'react';
|
|
15
14
|
import { Flexbox } from 'react-layout-kit';
|
|
15
|
+
import Actions from "./components/Actions";
|
|
16
16
|
import MessageContent from "./components/MessageContent";
|
|
17
17
|
import { useStyles } from "./style";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -85,9 +85,7 @@ export var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
85
85
|
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
86
86
|
align: placement === 'left' ? 'flex-start' : 'flex-end',
|
|
87
87
|
className: styles.messageContent,
|
|
88
|
-
direction:
|
|
89
|
-
// eslint-disable-next-line no-nested-ternary
|
|
90
|
-
type === 'block' ? placement === 'left' ? 'horizontal' : 'horizontal-reverse' : 'vertical',
|
|
88
|
+
direction: 'vertical',
|
|
91
89
|
gap: 8,
|
|
92
90
|
children: [error ? /*#__PURE__*/_jsx(ErrorContent, {
|
|
93
91
|
error: error,
|
package/es/ChatItem/style.js
CHANGED
|
@@ -22,7 +22,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
22
22
|
var typeStylish = type === 'block' ? blockStylish : pureStylish;
|
|
23
23
|
var editingStylish = editing && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
24
24
|
return {
|
|
25
|
-
actions: cx(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex: none;\n align-self: ", ";\n justify-content: ", ";\n "])),
|
|
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
26
|
avatarContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
|
|
27
27
|
avatarGroupContainer: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), avatarSize),
|
|
28
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')),
|