@lobehub/ui 2.10.2 → 2.11.0
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/Markdown/Markdown.js
CHANGED
|
@@ -26,7 +26,8 @@ import { useStyles } from "./style";
|
|
|
26
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
27
|
var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
28
28
|
var ref = _ref.ref,
|
|
29
|
-
children = _ref.children,
|
|
29
|
+
_ref$children = _ref.children,
|
|
30
|
+
children = _ref$children === void 0 ? '' : _ref$children,
|
|
30
31
|
className = _ref.className,
|
|
31
32
|
style = _ref.style,
|
|
32
33
|
fullFeaturedCodeBlock = _ref.fullFeaturedCodeBlock,
|
|
@@ -161,7 +162,7 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
161
162
|
variant: variant
|
|
162
163
|
},
|
|
163
164
|
children: customRender ? customRender(defaultDOM, {
|
|
164
|
-
text: children
|
|
165
|
+
text: children
|
|
165
166
|
}) : defaultDOM
|
|
166
167
|
})
|
|
167
168
|
}))
|
package/es/Tag/Tag.js
CHANGED
|
@@ -57,23 +57,24 @@ var Tag = /*#__PURE__*/memo(function (_ref) {
|
|
|
57
57
|
var textColor = theme.colorTextSecondary;
|
|
58
58
|
var backgroundColor;
|
|
59
59
|
var borderColor;
|
|
60
|
+
var isBorderless = variant === 'borderless';
|
|
60
61
|
var isFilled = variant === 'filled';
|
|
61
62
|
var isPresetColor = color && presetColors.includes(color);
|
|
62
63
|
var isPresetSystemColors = color && presetSystemColors.has(color);
|
|
63
64
|
var isHexColor = color && color.startsWith('#');
|
|
64
65
|
if (isPresetColor) {
|
|
65
66
|
textColor = colorsPreset(theme, color);
|
|
66
|
-
backgroundColor = colorsPreset(theme, color, 'fillTertiary');
|
|
67
|
+
backgroundColor = isBorderless ? 'transparent' : colorsPreset(theme, color, 'fillTertiary');
|
|
67
68
|
borderColor = colorsPreset(theme, color, isFilled ? 'fillQuaternary' : 'fillTertiary');
|
|
68
69
|
}
|
|
69
70
|
if (isPresetSystemColors) {
|
|
70
71
|
textColor = colorsPresetSystem(theme, color);
|
|
71
|
-
backgroundColor = colorsPresetSystem(theme, color, 'fillTertiary');
|
|
72
|
+
backgroundColor = isBorderless ? 'transparent' : colorsPresetSystem(theme, color, 'fillTertiary');
|
|
72
73
|
borderColor = colorsPresetSystem(theme, color, isFilled ? 'fillQuaternary' : 'fillTertiary');
|
|
73
74
|
}
|
|
74
75
|
if (isHexColor) {
|
|
75
76
|
textColor = theme.colorBgLayout;
|
|
76
|
-
backgroundColor = color;
|
|
77
|
+
backgroundColor = isBorderless ? 'transparent' : color;
|
|
77
78
|
}
|
|
78
79
|
return {
|
|
79
80
|
backgroundColor: backgroundColor,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var _excluded = ["avatarAddon", "onAvatarClick", "avatarProps", "actions", "className", "primary", "loading", "message", "placeholderMessage", "placement", "variant", "avatar", "error", "showTitle", "time", "editing", "onChange", "onEditingChange", "messageExtra", "renderMessage", "text", "errorMessage", "onDoubleClick", "fontSize", "aboveMessage", "belowMessage", "markdownProps", "actionsWrapWidth", "showAvatar"];
|
|
4
|
+
var _excluded = ["avatarAddon", "onAvatarClick", "avatarProps", "actions", "className", "primary", "loading", "message", "placeholderMessage", "placement", "variant", "avatar", "error", "showTitle", "time", "editing", "onChange", "onEditingChange", "messageExtra", "renderMessage", "text", "errorMessage", "onDoubleClick", "fontSize", "aboveMessage", "belowMessage", "markdownProps", "actionsWrapWidth", "showAvatar", "titleAddon"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -64,6 +64,7 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
64
64
|
actionsWrapWidth = _ref$actionsWrapWidth === void 0 ? 54 : _ref$actionsWrapWidth,
|
|
65
65
|
_ref$showAvatar = _ref.showAvatar,
|
|
66
66
|
showAvatar = _ref$showAvatar === void 0 ? true : _ref$showAvatar,
|
|
67
|
+
titleAddon = _ref.titleAddon,
|
|
67
68
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
68
69
|
var _useResponsive = useResponsive(),
|
|
69
70
|
mobile = _useResponsive.mobile;
|
|
@@ -134,7 +135,8 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
134
135
|
avatar: avatar,
|
|
135
136
|
placement: placement,
|
|
136
137
|
showTitle: showTitle,
|
|
137
|
-
time: time
|
|
138
|
+
time: time,
|
|
139
|
+
titleAddon: titleAddon
|
|
138
140
|
}), aboveMessage, /*#__PURE__*/_jsxs(Flexbox, {
|
|
139
141
|
align: placement === 'left' ? 'flex-start' : 'flex-end',
|
|
140
142
|
className: styles.messageContent,
|
|
@@ -5,6 +5,7 @@ export interface TitleProps {
|
|
|
5
5
|
placement?: ChatItemProps['placement'];
|
|
6
6
|
showTitle?: ChatItemProps['showTitle'];
|
|
7
7
|
time?: ChatItemProps['time'];
|
|
8
|
+
titleAddon?: ChatItemProps['titleAddon'];
|
|
8
9
|
}
|
|
9
10
|
declare const Title: import("react").NamedExoticComponent<TitleProps>;
|
|
10
11
|
export default Title;
|
|
@@ -8,7 +8,8 @@ var Title = /*#__PURE__*/memo(function (_ref) {
|
|
|
8
8
|
var showTitle = _ref.showTitle,
|
|
9
9
|
placement = _ref.placement,
|
|
10
10
|
time = _ref.time,
|
|
11
|
-
avatar = _ref.avatar
|
|
11
|
+
avatar = _ref.avatar,
|
|
12
|
+
titleAddon = _ref.titleAddon;
|
|
12
13
|
var _useStyles = useStyles({
|
|
13
14
|
placement: placement,
|
|
14
15
|
showTitle: showTitle,
|
|
@@ -19,7 +20,7 @@ var Title = /*#__PURE__*/memo(function (_ref) {
|
|
|
19
20
|
className: styles.name,
|
|
20
21
|
direction: placement === 'left' ? 'horizontal' : 'horizontal-reverse',
|
|
21
22
|
gap: 4,
|
|
22
|
-
children: [showTitle ? avatar.title || 'untitled' : undefined, time && /*#__PURE__*/_jsx("time", {
|
|
23
|
+
children: [showTitle ? avatar.title || 'untitled' : undefined, showTitle ? titleAddon : undefined, time && /*#__PURE__*/_jsx("time", {
|
|
23
24
|
children: formatTime(time)
|
|
24
25
|
})]
|
|
25
26
|
});
|