@lobehub/ui 1.128.1 → 1.128.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.
Files changed (2) hide show
  1. package/es/Image/index.js +15 -10
  2. package/package.json +1 -1
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", "alwaysShowActions", "objectFit", "classNames"];
3
+ var _excluded = ["wrapperClassName", "style", "preview", "isLoading", "minSize", "size", "actions", "alwaysShowActions", "objectFit", "classNames", "onClick"];
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';
@@ -28,6 +28,7 @@ var Image = /*#__PURE__*/memo(function (_ref) {
28
28
  objectFit = _ref$objectFit === void 0 ? 'cover' : _ref$objectFit,
29
29
  _ref$classNames = _ref.classNames,
30
30
  classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
31
+ onClick = _ref.onClick,
31
32
  rest = _objectWithoutProperties(_ref, _excluded);
32
33
  var _useResponsive = useResponsive(),
33
34
  mobile = _useResponsive.mobile;
@@ -43,15 +44,18 @@ var Image = /*#__PURE__*/memo(function (_ref) {
43
44
  cx = _useStyles.cx,
44
45
  theme = _useStyles.theme;
45
46
  var mergePreivew = usePreview(preview);
46
- if (isLoading) return /*#__PURE__*/_jsx(Skeleton.Avatar, {
47
- active: true,
48
- style: {
49
- borderRadius: theme.borderRadius,
50
- height: size,
51
- minHeight: minSize,
52
- minWidth: minSize,
53
- width: size
54
- }
47
+ if (isLoading) return /*#__PURE__*/_jsx("div", {
48
+ onClick: onClick,
49
+ children: /*#__PURE__*/_jsx(Skeleton.Avatar, {
50
+ active: true,
51
+ style: {
52
+ borderRadius: theme.borderRadius,
53
+ height: size,
54
+ minHeight: minSize,
55
+ minWidth: minSize,
56
+ width: size
57
+ }
58
+ })
55
59
  });
56
60
  return /*#__PURE__*/_jsxs(Flexbox, {
57
61
  className: cx(styles.imageWrapper, wrapperClassName),
@@ -63,6 +67,7 @@ var Image = /*#__PURE__*/memo(function (_ref) {
63
67
  className: classNames.image,
64
68
  fallback: isDarkMode ? 'https://gw.alipayobjects.com/zos/kitchen/nhzBb%24r0Cm/image_off_dark.webp' : 'https://gw.alipayobjects.com/zos/kitchen/QAvkgt30Ys/image_off_light.webp',
65
69
  loading: 'lazy',
70
+ onClick: onClick,
66
71
  preview: preview === false ? false : _objectSpread({
67
72
  mask: mobile ? false : actions ? /*#__PURE__*/_jsx("div", {}) : /*#__PURE__*/_jsx(Icon, {
68
73
  icon: Eye,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.128.1",
3
+ "version": "1.128.2",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",