@lobehub/ui 1.120.0 → 1.120.2

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.
@@ -38,7 +38,7 @@ var MessageContent = /*#__PURE__*/memo(function (_ref) {
38
38
  onEditingChange: onEditingChange,
39
39
  openModal: mobile ? editing : undefined,
40
40
  text: text,
41
- value: String(message || '...')
41
+ value: message ? String(message).trim() : ''
42
42
  });
43
43
  var messageContent = renderMessage ? renderMessage(content) : content;
44
44
  return /*#__PURE__*/_jsxs(Flexbox, {
@@ -2,9 +2,11 @@ import { type ImageProps as AntImageProps } from 'antd';
2
2
  import { ReactNode } from 'react';
3
3
  export interface ImageProps extends AntImageProps {
4
4
  actions?: ReactNode;
5
+ alwaysShowActions?: boolean;
5
6
  isLoading?: boolean;
6
- minSize?: number;
7
- size?: number;
7
+ minSize?: number | string;
8
+ objectFit?: 'cover' | 'contain';
9
+ size?: number | string;
8
10
  }
9
11
  declare const Image: import("react").NamedExoticComponent<ImageProps>;
10
12
  export default Image;
package/es/Image/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["wrapperClassName", "style", "preview", "isLoading", "minSize", "size", "actions"];
3
+ var _excluded = ["wrapperClassName", "style", "preview", "isLoading", "minSize", "size", "actions", "alwaysShowActions", "objectFit"];
4
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
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
6
  import { Image as AntImage, Skeleton } from 'antd';
@@ -23,9 +23,14 @@ var Image = /*#__PURE__*/memo(function (_ref) {
23
23
  _ref$size = _ref.size,
24
24
  size = _ref$size === void 0 ? '100%' : _ref$size,
25
25
  actions = _ref.actions,
26
+ alwaysShowActions = _ref.alwaysShowActions,
27
+ _ref$objectFit = _ref.objectFit,
28
+ objectFit = _ref$objectFit === void 0 ? 'cover' : _ref$objectFit,
26
29
  rest = _objectWithoutProperties(_ref, _excluded);
27
30
  var _useStyles = useStyles({
31
+ alwaysShowActions: alwaysShowActions,
28
32
  minSize: minSize,
33
+ objectFit: objectFit,
29
34
  size: size
30
35
  }),
31
36
  styles = _useStyles.styles,
@@ -1,5 +1,7 @@
1
1
  export declare const useStyles: (props?: {
2
+ alwaysShowActions?: boolean | undefined;
2
3
  minSize?: string | number | undefined;
4
+ objectFit?: string | undefined;
3
5
  size?: string | number | undefined;
4
6
  } | undefined) => import("antd-style").ReturnStyles<{
5
7
  actions: string;
package/es/Image/style.js CHANGED
@@ -10,13 +10,15 @@ export var useStyles = createStyles(function (_ref) {
10
10
  isDarkMode = _ref.isDarkMode;
11
11
  var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
12
12
  minSize = _ref2.minSize,
13
- size = _ref2.size;
13
+ size = _ref2.size,
14
+ alwaysShowActions = _ref2.alwaysShowActions,
15
+ objectFit = _ref2.objectFit;
14
16
  var SIZE = typeof size === 'number' ? "".concat(size, "px") : size;
15
17
  var MIN_SIZE = typeof minSize === 'number' ? "".concat(minSize, "px") : minSize;
16
- var actions = cx(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: absolute;\n z-index: 1;\n top: 0;\n right: 0;\n\n opacity: 0;\n "]))));
18
+ var actions = cx(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: absolute;\n z-index: 1;\n top: 0;\n right: 0;\n\n opacity: ", ";\n "])), alwaysShowActions ? 1 : 0));
17
19
  return {
18
20
  actions: actions,
19
- image: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n\n img {\n width: ", " !important;\n min-width: ", " !important;\n height: ", " !important;\n min-height: ", " !important;\n\n object-fit: contain;\n }\n "])), SIZE, MIN_SIZE, SIZE, MIN_SIZE),
21
+ image: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n\n img {\n width: ", " !important;\n min-width: ", " !important;\n height: ", " !important;\n min-height: ", " !important;\n\n object-fit: ", ";\n }\n "])), SIZE, MIN_SIZE, SIZE, MIN_SIZE, objectFit || 'cover'),
20
22
  imageOff: isDarkMode ? 'https://gw.alipayobjects.com/zos/kitchen/BpCkC%26aex5/image_off_dark.webp' : 'https://gw.alipayobjects.com/zos/kitchen/AYB4XBJBSA/image_off_light.webp',
21
23
  imageWrapper: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n\n overflow: hidden;\n\n width: ", ";\n min-width: ", ";\n height: ", ";\n min-height: ", ";\n margin-block: 0 1em;\n\n background: ", ";\n border-radius: ", "px;\n box-shadow: 0 0 0 1px ", ";\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n "])), SIZE, MIN_SIZE, SIZE, MIN_SIZE, rgba(token.colorBgLayout, 0.25), token.borderRadius, token.colorFillTertiary, actions),
22
24
  toolbar: cx(stylish.blur, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 4px;\n background: ", ";\n border-radius: ", "px;\n "])), rgba(token.colorBgMask, 0.1), token.borderRadiusLG))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.120.0",
3
+ "version": "1.120.2",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",