@lobehub/ui 1.126.0 → 1.127.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/README.md CHANGED
@@ -138,6 +138,23 @@ Contributions of all types are more than welcome, if you are interested in contr
138
138
 
139
139
  </div>
140
140
 
141
+ ## 🩷 Sponsor
142
+
143
+ Every bit counts and your one-time donation sparkles in our galaxy of support! You're a shooting star, making a swift and bright impact on our journey. Thank you for believing in us – your generosity guides us toward our mission, one brilliant flash at a time.
144
+
145
+ <a href="https://opencollective.com/lobehub" target="_blank">
146
+ <picture>
147
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/lobehub/.github/blob/main/static/sponsor-dark.png?raw=true">
148
+ <img src="https://github.com/lobehub/.github/blob/main/static/sponsor-light.png?raw=true">
149
+ </picture>
150
+ </a>
151
+
152
+ <div align="right">
153
+
154
+ [![][back-to-top]](#readme-top)
155
+
156
+ </div>
157
+
141
158
  ## 🔗 More Products
142
159
 
143
160
  - **[🤖 Lobe Chat][lobe-chat] :** An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application.
package/README.zh-CN.md CHANGED
@@ -138,6 +138,23 @@ $ bun start
138
138
 
139
139
  </div>
140
140
 
141
+ ## 🩷 感谢赞助
142
+
143
+ 每一分支持都珍贵无比,汇聚成我们支持的璀璨银河!你就像一颗划破夜空的流星,瞬间点亮我们前行的道路。感谢你对我们的信任 —— 你的支持笔就像星辰导航,一次又一次地为项目指明前进的光芒。
144
+
145
+ <a href="https://opencollective.com/lobehub" target="_blank">
146
+ <picture>
147
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/lobehub/.github/blob/main/static/sponsor-dark.png?raw=true">
148
+ <img src="https://github.com/lobehub/.github/blob/main/static/sponsor-light.png?raw=true">
149
+ </picture>
150
+ </a>
151
+
152
+ <div align="right">
153
+
154
+ [![][back-to-top]](#readme-top)
155
+
156
+ </div>
157
+
141
158
  ## 🔗 更多产品
142
159
 
143
160
  - **[🤖 Lobe Chat][lobe-chat] :** 一个开源、可扩展(函数调用)、高性能的聊天机器人框架。支持一键免费部署私有 ChatGPT/LLM 网页应用程序。
@@ -3,12 +3,16 @@ import { ReactNode } from 'react';
3
3
  export interface ImageProps extends AntImageProps {
4
4
  actions?: ReactNode;
5
5
  alwaysShowActions?: boolean;
6
+ classNames?: {
7
+ image?: string;
8
+ wrapper?: string;
9
+ };
6
10
  isLoading?: boolean;
7
11
  minSize?: number | string;
8
12
  objectFit?: 'cover' | 'contain';
9
13
  preview?: AntImageProps['preview'] & {
10
14
  toolbarAddon?: ReactNode;
11
- } & any;
15
+ };
12
16
  size?: number | string;
13
17
  toolbarAddon?: ReactNode;
14
18
  }
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"];
3
+ var _excluded = ["wrapperClassName", "style", "preview", "isLoading", "minSize", "size", "actions", "alwaysShowActions", "objectFit", "classNames"];
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';
@@ -9,15 +9,14 @@ import { Eye } from 'lucide-react';
9
9
  import { memo } from 'react';
10
10
  import { Flexbox } from 'react-layout-kit';
11
11
  import Icon from "../Icon";
12
- import usePreview from "./usePreview";
13
12
  import { useStyles } from "./style";
13
+ import usePreview from "./usePreview";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
16
  var Image = /*#__PURE__*/memo(function (_ref) {
17
17
  var wrapperClassName = _ref.wrapperClassName,
18
18
  style = _ref.style,
19
- _ref$preview = _ref.preview,
20
- preview = _ref$preview === void 0 ? {} : _ref$preview,
19
+ preview = _ref.preview,
21
20
  isLoading = _ref.isLoading,
22
21
  _ref$minSize = _ref.minSize,
23
22
  minSize = _ref$minSize === void 0 ? 64 : _ref$minSize,
@@ -27,6 +26,8 @@ var Image = /*#__PURE__*/memo(function (_ref) {
27
26
  alwaysShowActions = _ref.alwaysShowActions,
28
27
  _ref$objectFit = _ref.objectFit,
29
28
  objectFit = _ref$objectFit === void 0 ? 'cover' : _ref$objectFit,
29
+ _ref$classNames = _ref.classNames,
30
+ classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
30
31
  rest = _objectWithoutProperties(_ref, _excluded);
31
32
  var _useResponsive = useResponsive(),
32
33
  mobile = _useResponsive.mobile;
@@ -59,15 +60,16 @@ var Image = /*#__PURE__*/memo(function (_ref) {
59
60
  className: styles.actions,
60
61
  children: actions
61
62
  }), /*#__PURE__*/_jsx(AntImage, _objectSpread({
63
+ className: classNames.image,
62
64
  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',
63
65
  loading: 'lazy',
64
- preview: _objectSpread({
66
+ preview: preview === false ? false : _objectSpread({
65
67
  mask: mobile ? false : actions ? /*#__PURE__*/_jsx("div", {}) : /*#__PURE__*/_jsx(Icon, {
66
68
  icon: Eye,
67
69
  size: 'normal'
68
70
  })
69
71
  }, mergePreivew),
70
- wrapperClassName: styles.image
72
+ wrapperClassName: cx(styles.image, classNames.wrapper)
71
73
  }, rest))]
72
74
  });
73
75
  });
@@ -1,3 +1,4 @@
1
+ import { CollapseProps, DividerProps, ImageProps, TypographyProps } from 'antd';
1
2
  import { CSSProperties } from 'react';
2
3
  export interface MarkdownProps {
3
4
  /**
@@ -8,6 +9,13 @@ export interface MarkdownProps {
8
9
  * @description The class name for the Markdown component
9
10
  */
10
11
  className?: string;
12
+ componentProps?: {
13
+ a?: TypographyProps['Link'] & HTMLAnchorElement;
14
+ details?: CollapseProps;
15
+ hr?: DividerProps;
16
+ img?: ImageProps;
17
+ pre?: any;
18
+ };
11
19
  enableImageGallery?: boolean;
12
20
  fullFeaturedCodeBlock?: boolean;
13
21
  onDoubleClick?: () => void;
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
- var _excluded = ["children", "className", "style", "fullFeaturedCodeBlock", "onDoubleClick", "enableImageGallery"];
3
+ var _excluded = ["children", "className", "style", "fullFeaturedCodeBlock", "onDoubleClick", "enableImageGallery", "componentProps"];
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 { Collapse, Divider, Typography } from 'antd';
@@ -16,21 +16,21 @@ import { CodeFullFeatured, CodeLite } from "./CodeBlock";
16
16
  import { useStyles } from "./style";
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  var MemoAlink = /*#__PURE__*/memo(function (props) {
19
- return /*#__PURE__*/_jsx(Typography.Link, _objectSpread(_objectSpread({}, props), {}, {
19
+ return /*#__PURE__*/_jsx(Typography.Link, _objectSpread({
20
20
  rel: "noopener noreferrer",
21
21
  target: "_blank"
22
- }));
22
+ }, props));
23
23
  });
24
24
  var MemoDetails = /*#__PURE__*/memo(function (props) {
25
25
  return /*#__PURE__*/_jsx(Collapse, _objectSpread({}, props));
26
26
  });
27
- var MemoHr = /*#__PURE__*/memo(function () {
28
- return /*#__PURE__*/_jsx(Divider, {
29
- style: {
27
+ var MemoHr = /*#__PURE__*/memo(function (props) {
28
+ return /*#__PURE__*/_jsx(Divider, _objectSpread(_objectSpread({}, props), {}, {
29
+ style: _objectSpread({
30
30
  marginBottom: '1em',
31
31
  marginTop: 0
32
- }
33
- });
32
+ }, props === null || props === void 0 ? void 0 : props.style)
33
+ }));
34
34
  });
35
35
  var MemoImage = /*#__PURE__*/memo(function (props) {
36
36
  return /*#__PURE__*/_jsx(Image, _objectSpread({}, props));
@@ -43,15 +43,26 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
43
43
  onDoubleClick = _ref.onDoubleClick,
44
44
  _ref$enableImageGalle = _ref.enableImageGallery,
45
45
  enableImageGallery = _ref$enableImageGalle === void 0 ? true : _ref$enableImageGalle,
46
+ componentProps = _ref.componentProps,
46
47
  rest = _objectWithoutProperties(_ref, _excluded);
47
48
  var _useStyles = useStyles(),
48
49
  styles = _useStyles.styles;
49
50
  var components = {
50
- a: MemoAlink,
51
- details: MemoDetails,
52
- hr: MemoHr,
53
- img: enableImageGallery ? MemoImage : undefined,
54
- pre: fullFeaturedCodeBlock ? CodeFullFeatured : CodeLite
51
+ a: function a(props) {
52
+ return /*#__PURE__*/_jsx(MemoAlink, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.a));
53
+ },
54
+ details: function details(props) {
55
+ return /*#__PURE__*/_jsx(MemoDetails, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.details));
56
+ },
57
+ hr: function hr(props) {
58
+ return /*#__PURE__*/_jsx(MemoHr, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.hr));
59
+ },
60
+ img: enableImageGallery ? function (props) {
61
+ return /*#__PURE__*/_jsx(MemoImage, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.img));
62
+ } : undefined,
63
+ pre: function pre(props) {
64
+ return fullFeaturedCodeBlock ? /*#__PURE__*/_jsx(CodeFullFeatured, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.pre)) : /*#__PURE__*/_jsx(CodeLite, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.pre));
65
+ }
55
66
  };
56
67
  return /*#__PURE__*/_jsx(Typography, {
57
68
  className: className,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.126.0",
3
+ "version": "1.127.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",