@yuntijs/ui 1.0.0-beta.84 → 1.0.0-beta.86
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/ChatItem/index.js +6 -6
- package/es/ChatItem/style.d.ts +1 -0
- package/es/ChatItem/style.js +4 -3
- package/es/ChatItem/type.d.ts +4 -0
- package/package.json +1 -1
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
package/es/ChatItem/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
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"];
|
|
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
8
|
import Actions from '@lobehub/ui/es/chat/ChatItem/components/Actions';
|
|
@@ -10,11 +10,11 @@ import Avatar from '@lobehub/ui/es/chat/ChatItem/components/Avatar';
|
|
|
10
10
|
import BorderSpacing from '@lobehub/ui/es/chat/ChatItem/components/BorderSpacing';
|
|
11
11
|
import ErrorContent from '@lobehub/ui/es/chat/ChatItem/components/ErrorContent';
|
|
12
12
|
import Title from '@lobehub/ui/es/chat/ChatItem/components/Title';
|
|
13
|
-
import { useStyles } from '@lobehub/ui/es/chat/ChatItem/style';
|
|
14
13
|
import { useResponsive } from 'antd-style';
|
|
15
14
|
import { memo } from 'react';
|
|
16
15
|
import { Flexbox } from 'react-layout-kit';
|
|
17
16
|
import MessageContent from "./components/MessageContent";
|
|
17
|
+
import { useStyles } from "./style";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
var MOBILE_AVATAR_SIZE = 32;
|
|
@@ -46,6 +46,7 @@ export var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
46
46
|
fontSize = _ref.fontSize,
|
|
47
47
|
markdownProps = _ref.markdownProps,
|
|
48
48
|
markdownClassname = _ref.markdownClassname,
|
|
49
|
+
isLatest = _ref.isLatest,
|
|
49
50
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
51
|
var _useResponsive = useResponsive(),
|
|
51
52
|
mobile = _useResponsive.mobile;
|
|
@@ -56,7 +57,8 @@ export var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
56
57
|
showTitle: showTitle,
|
|
57
58
|
time: time,
|
|
58
59
|
title: avatar.title,
|
|
59
|
-
type: type
|
|
60
|
+
type: type,
|
|
61
|
+
isLatest: isLatest
|
|
60
62
|
}),
|
|
61
63
|
cx = _useStyles.cx,
|
|
62
64
|
styles = _useStyles.styles;
|
|
@@ -83,9 +85,7 @@ export var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
83
85
|
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
84
86
|
align: placement === 'left' ? 'flex-start' : 'flex-end',
|
|
85
87
|
className: styles.messageContent,
|
|
86
|
-
direction:
|
|
87
|
-
// eslint-disable-next-line no-nested-ternary
|
|
88
|
-
type === 'block' ? placement === 'left' ? 'horizontal' : 'horizontal-reverse' : 'vertical',
|
|
88
|
+
direction: 'vertical',
|
|
89
89
|
gap: 8,
|
|
90
90
|
children: [error ? /*#__PURE__*/_jsx(ErrorContent, {
|
|
91
91
|
error: error,
|
package/es/ChatItem/style.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const useStyles: (props?: {
|
|
|
7
7
|
time?: number | undefined;
|
|
8
8
|
title?: string | undefined;
|
|
9
9
|
type?: "block" | "pure" | undefined;
|
|
10
|
+
isLatest?: boolean | undefined;
|
|
10
11
|
} | undefined) => import("antd-style").ReturnStyles<{
|
|
11
12
|
actions: string;
|
|
12
13
|
avatarContainer: import("antd-style").SerializedStyles;
|
package/es/ChatItem/style.js
CHANGED
|
@@ -14,17 +14,18 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
14
14
|
primary = _ref2.primary,
|
|
15
15
|
avatarSize = _ref2.avatarSize,
|
|
16
16
|
editing = _ref2.editing,
|
|
17
|
-
time = _ref2.time
|
|
17
|
+
time = _ref2.time,
|
|
18
|
+
isLatest = _ref2.isLatest;
|
|
18
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);
|
|
19
20
|
var pureStylish = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-block-start: ", ";\n "])), title ? 0 : '6px');
|
|
20
21
|
var pureContainerStylish = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-block-end: -16px;\n transition: background-color 100ms ", ";\n "])), token.motionEaseOut);
|
|
21
22
|
var typeStylish = type === 'block' ? blockStylish : pureStylish;
|
|
22
23
|
var editingStylish = editing && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
23
24
|
return {
|
|
24
|
-
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 "])))),
|
|
25
26
|
avatarContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
|
|
26
27
|
avatarGroupContainer: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), avatarSize),
|
|
27
|
-
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:
|
|
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')),
|
|
28
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)),
|
|
29
30
|
editingInput: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n width: 100%;\n "]))),
|
|
30
31
|
errorContainer: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n width: 100%;\n "]))),
|
package/es/ChatItem/type.d.ts
CHANGED