@lobehub/ui 1.139.0 → 1.140.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.
@@ -6,6 +6,7 @@ var _excluded = ["className", "avatar", "title", "animation", "size", "shape", "
6
6
  import { Avatar as AntAvatar } from 'antd';
7
7
  import { forwardRef, isValidElement, useMemo } from 'react';
8
8
  import FluentEmoji from "../FluentEmoji";
9
+ import { EmojiType } from "../FluentEmoji/utils";
9
10
  import Img from "../Img";
10
11
  import { getEmoji } from "../utils/getEmojiByCharacter";
11
12
  import { useStyles } from "./style";
@@ -62,7 +63,7 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
62
63
  children: emoji ? /*#__PURE__*/_jsx(FluentEmoji, {
63
64
  emoji: emoji,
64
65
  size: size * 0.8,
65
- type: animation ? 'anim' : '3d',
66
+ type: animation ? EmojiType.Anim : EmojiType.ThreeD,
66
67
  unoptimized: unoptimized
67
68
  }) : text === null || text === void 0 ? void 0 : text.toUpperCase().slice(0, 2)
68
69
  }));
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { DivProps } from "../types";
3
+ import { EmojiType } from './utils';
3
4
  export interface FluentEmojiProps extends DivProps {
4
5
  /**
5
6
  * @description The emoji character to be rendered
@@ -14,7 +15,7 @@ export interface FluentEmojiProps extends DivProps {
14
15
  * @description The type of the FluentUI emoji set to be used
15
16
  * @default '3d'
16
17
  */
17
- type?: 'modern' | 'flat' | 'high-contrast' | 'anim' | '3d' | 'pure';
18
+ type?: EmojiType;
18
19
  unoptimized?: boolean;
19
20
  }
20
21
  declare const FluentEmoji: import("react").NamedExoticComponent<FluentEmojiProps>;
@@ -2,23 +2,21 @@
2
2
 
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
- import { kebabCase } from 'lodash-es';
6
5
  import { memo, useMemo, useState } from 'react';
7
- import { useCdnFn } from "../ConfigProvider";
6
+ import { Center } from 'react-layout-kit';
8
7
  import Img from "../Img";
9
- import { getEmojiNameByCharacter } from "../utils/getEmojiByCharacter";
10
8
  import { useStyles } from "./style";
9
+ import { EmojiType, genEmojiUrl } from "./utils";
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
11
  var FluentEmoji = /*#__PURE__*/memo(function (_ref) {
13
12
  var emoji = _ref.emoji,
14
13
  className = _ref.className,
15
14
  style = _ref.style,
16
15
  _ref$type = _ref.type,
17
- type = _ref$type === void 0 ? '3d' : _ref$type,
16
+ type = _ref$type === void 0 ? EmojiType.ThreeD : _ref$type,
18
17
  _ref$size = _ref.size,
19
18
  size = _ref$size === void 0 ? 40 : _ref$size,
20
19
  unoptimized = _ref.unoptimized;
21
- var genCdnUrl = useCdnFn();
22
20
  var _useState = useState(false),
23
21
  _useState2 = _slicedToArray(_useState, 2),
24
22
  loadingFail = _useState2[0],
@@ -27,64 +25,32 @@ var FluentEmoji = /*#__PURE__*/memo(function (_ref) {
27
25
  cx = _useStyles.cx,
28
26
  styles = _useStyles.styles;
29
27
  var emojiUrl = useMemo(function () {
30
- if (type === 'pure') return;
31
- var emojiName = getEmojiNameByCharacter(emoji);
32
- if (!emojiName) return;
33
- switch (type) {
34
- case 'modern':
35
- case 'flat':
36
- case 'high-contrast':
37
- {
38
- return genCdnUrl({
39
- path: "icons/".concat(type, "/").concat(kebabCase(emojiName), ".svg"),
40
- pkg: 'fluentui-emoji',
41
- version: '0.0.8'
42
- });
43
- }
44
- case 'anim':
45
- {
46
- return genCdnUrl({
47
- path: "assets/".concat(emojiName, ".webp"),
48
- pkg: '@lobehub/assets-emoji-anim',
49
- version: '1.0.0'
50
- });
51
- }
52
- case '3d':
53
- {
54
- return genCdnUrl({
55
- path: "assets/".concat(emojiName, ".webp"),
56
- pkg: '@lobehub/assets-emoji',
57
- version: '1.3.0'
58
- });
59
- }
60
- }
28
+ return genEmojiUrl(emoji, type);
61
29
  }, [type, emoji]);
62
- if (type === 'pure' || !emojiUrl || loadingFail) return /*#__PURE__*/_jsx("div", {
30
+ if (type === 'pure' || !emojiUrl || loadingFail) return /*#__PURE__*/_jsx(Center, {
63
31
  className: cx(styles.container, className),
32
+ flex: 'none',
33
+ height: size,
64
34
  style: _objectSpread({
65
- fontSize: size * 0.9,
66
- height: size,
67
- width: size
35
+ fontSize: size * 0.9
68
36
  }, style),
37
+ width: size,
69
38
  children: emoji
70
39
  });
71
- return /*#__PURE__*/_jsx("div", {
72
- className: cx(styles.container, className),
40
+ return /*#__PURE__*/_jsx(Img, {
41
+ alt: emoji,
42
+ className: className,
43
+ height: size,
44
+ loading: 'lazy',
45
+ onError: function onError() {
46
+ return setLoadingFail(true);
47
+ },
48
+ src: emojiUrl,
73
49
  style: _objectSpread({
74
- height: size,
75
- width: size
50
+ flex: 'none'
76
51
  }, style),
77
- children: /*#__PURE__*/_jsx(Img, {
78
- alt: emoji,
79
- height: size,
80
- loading: 'lazy',
81
- onError: function onError() {
82
- return setLoadingFail(true);
83
- },
84
- src: emojiUrl,
85
- unoptimized: unoptimized,
86
- width: size
87
- })
52
+ unoptimized: unoptimized,
53
+ width: size
88
54
  });
89
55
  });
90
56
  export default FluentEmoji;
@@ -4,6 +4,6 @@ import { createStyles } from 'antd-style';
4
4
  export var useStyles = createStyles(function (_ref) {
5
5
  var css = _ref.css;
6
6
  return {
7
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n line-height: 1;\n text-align: center;\n "])))
7
+ container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n line-height: 1;\n text-align: center;\n "])))
8
8
  };
9
9
  });
@@ -0,0 +1,9 @@
1
+ export declare enum EmojiType {
2
+ Anim = "anim",
3
+ Flat = "flat",
4
+ Modern = "modern",
5
+ Mono = "mono",
6
+ Pure = "pure",
7
+ ThreeD = "3d"
8
+ }
9
+ export declare const genEmojiUrl: (emoji: string, type: EmojiType) => string | null;
@@ -0,0 +1,26 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ export var EmojiType = /*#__PURE__*/function (EmojiType) {
3
+ EmojiType["Anim"] = "anim";
4
+ EmojiType["Flat"] = "flat";
5
+ EmojiType["Modern"] = "modern";
6
+ EmojiType["Mono"] = "mono";
7
+ EmojiType["Pure"] = "pure";
8
+ EmojiType["ThreeD"] = "3d";
9
+ return EmojiType;
10
+ }({});
11
+ function isFlagEmoji(emoji) {
12
+ var flagRegex = /(?:\uD83C[\uDDE6-\uDDFF]){2}/;
13
+ return flagRegex.test(emoji);
14
+ }
15
+ function emojiToUnicode(emoji) {
16
+ return _toConsumableArray(emoji).map(function (char) {
17
+ var _char$codePointAt;
18
+ return char === null || char === void 0 || (_char$codePointAt = char.codePointAt(0)) === null || _char$codePointAt === void 0 ? void 0 : _char$codePointAt.toString(16);
19
+ }).join('-');
20
+ }
21
+ export var genEmojiUrl = function genEmojiUrl(emoji, type) {
22
+ if (isFlagEmoji(emoji)) return "https://jsdelivr.lobehub-inc.cn/gh/RealityRipple/emoji/noto/".concat(emojiToUnicode(emoji), ".png");
23
+ if (type === EmojiType.Pure) return null;
24
+ var ext = [EmojiType.Anim, EmojiType.ThreeD].includes(type) ? 'webp' : 'svg';
25
+ return "https://jsdelivr.lobehub-inc.cn/gh/lobehub/fluent-emoji/packages/".concat(type, "/assets/").concat(emojiToUnicode(emoji), ".").concat(ext);
26
+ };
@@ -1,3 +1,6 @@
1
1
  /// <reference types="react" />
2
- declare const Divider: import("react").MemoExoticComponent<any>;
2
+ import { DivProps, SvgProps } from "../types";
3
+ declare const Divider: import("react").NamedExoticComponent<SvgProps & DivProps & {
4
+ size?: number | undefined;
5
+ }>;
3
6
  export default Divider;
@@ -1,16 +1,26 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["size", "style"];
3
4
  import { memo } from 'react';
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  var Divider = /*#__PURE__*/memo(function (_ref) {
6
- var rest = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
7
+ var _ref$size = _ref.size,
8
+ size = _ref$size === void 0 ? '1em' : _ref$size,
9
+ style = _ref.style,
10
+ rest = _objectWithoutProperties(_ref, _excluded);
7
11
  return /*#__PURE__*/_jsx("svg", _objectSpread(_objectSpread({
8
12
  fill: "none",
13
+ height: size,
9
14
  shapeRendering: "geometricPrecision",
10
15
  stroke: "currentColor",
11
16
  strokeLinecap: "round",
12
17
  strokeLinejoin: "round",
13
- viewBox: "0 0 24 24"
18
+ style: _objectSpread({
19
+ flex: 'none',
20
+ lineHeight: 1
21
+ }, style),
22
+ viewBox: "0 0 24 24",
23
+ width: size
14
24
  }, rest), {}, {
15
25
  children: /*#__PURE__*/_jsx("path", {
16
26
  d: "M16.88 3.549L7.12 20.451"
@@ -1,3 +1,6 @@
1
1
  /// <reference types="react" />
2
- declare const LogoText: import("react").MemoExoticComponent<any>;
2
+ import { DivProps, SvgProps } from "../types";
3
+ declare const LogoText: import("react").NamedExoticComponent<SvgProps & DivProps & {
4
+ size?: number | undefined;
5
+ }>;
3
6
  export default LogoText;
@@ -1,18 +1,31 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["size", "style"];
3
4
  import { memo } from 'react';
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
7
  var LogoText = /*#__PURE__*/memo(function (_ref) {
6
- var rest = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
7
- return /*#__PURE__*/_jsx("svg", _objectSpread(_objectSpread({
8
+ var _ref$size = _ref.size,
9
+ size = _ref$size === void 0 ? '1em' : _ref$size,
10
+ style = _ref.style,
11
+ rest = _objectWithoutProperties(_ref, _excluded);
12
+ return /*#__PURE__*/_jsxs("svg", _objectSpread(_objectSpread({
8
13
  fill: "currentColor",
9
14
  fillRule: "evenodd",
15
+ height: size,
16
+ style: _objectSpread({
17
+ flex: 'none',
18
+ lineHeight: 1,
19
+ width: 'fit-content'
20
+ }, style),
10
21
  viewBox: "0 0 940 320",
11
22
  xmlns: "http://www.w3.org/2000/svg"
12
23
  }, rest), {}, {
13
- children: /*#__PURE__*/_jsx("path", {
24
+ children: [/*#__PURE__*/_jsx("title", {
25
+ children: "LobeHub"
26
+ }), /*#__PURE__*/_jsx("path", {
14
27
  d: "M15 240.035V87.172h39.24V205.75h66.192v34.285H15zM183.731 242c-11.759 0-22.196-2.621-31.313-7.862-9.116-5.241-16.317-12.447-21.601-21.619-5.153-9.317-7.729-19.945-7.729-31.883 0-11.937 2.576-22.492 7.729-31.664 5.164-8.963 12.159-15.98 20.982-21.05l.619-.351c9.117-5.241 19.554-7.861 31.313-7.861s22.196 2.62 31.313 7.861c9.248 5.096 16.449 12.229 21.601 21.401 5.153 9.172 7.729 19.727 7.729 31.664 0 11.938-2.576 22.566-7.729 31.883-5.152 9.172-12.353 16.378-21.601 21.619-9.117 5.241-19.554 7.862-31.313 7.862zm0-32.975c4.36 0 8.191-1.092 11.494-3.275 3.436-2.184 6.144-5.387 8.126-9.609 1.982-4.367 2.973-9.536 2.973-15.505 0-5.968-.991-10.991-2.973-15.067-1.906-4.06-4.483-7.177-7.733-9.352l-.393-.257c-3.303-2.184-7.134-3.276-11.494-3.276-4.228 0-8.059 1.092-11.495 3.276-3.303 2.184-6.011 5.387-8.125 9.609-1.982 4.076-2.973 9.099-2.973 15.067 0 5.969.991 11.138 2.973 15.505 2.114 4.222 4.822 7.425 8.125 9.609 3.436 2.183 7.267 3.275 11.495 3.275zM295.508 78l-.001 54.042a34.071 34.071 0 016.541-5.781c6.474-4.367 14.269-6.551 23.385-6.551 9.777 0 18.629 2.475 26.557 7.424 7.872 4.835 14.105 11.684 18.7 20.546l.325.637c4.756 9.026 7.135 19.799 7.135 32.319 0 12.666-2.379 23.585-7.135 32.757-4.624 9.026-10.966 16.087-19.025 21.182-7.928 4.95-16.78 7.425-26.557 7.425-9.644 0-17.704-2.184-24.178-6.551-2.825-1.946-5.336-4.355-7.532-7.226l.001 11.812h-35.87V78h37.654zm21.998 74.684c-4.228 0-8.059 1.092-11.494 3.276-3.303 2.184-6.012 5.387-8.126 9.609-1.982 4.076-2.972 9.099-2.972 15.067 0 5.969.99 11.138 2.972 15.505 2.114 4.222 4.823 7.425 8.126 9.609 3.435 2.183 7.266 3.275 11.494 3.275s7.994-1.092 11.297-3.275c3.435-2.184 6.143-5.387 8.125-9.609 2.114-4.367 3.171-9.536 3.171-15.505 0-5.968-1.057-10.991-3.171-15.067-1.906-4.06-4.483-7.177-7.732-9.352l-.393-.257c-3.303-2.184-7.069-3.276-11.297-3.276zm105.335 38.653l.084.337a27.857 27.857 0 002.057 5.559c2.246 4.222 5.417 7.498 9.513 9.827 4.096 2.184 8.984 3.276 14.665 3.276 5.285 0 9.777-.801 13.477-2.403 3.579-1.632 7.1-4.025 10.564-7.182l.732-.679 19.818 22.711c-5.153 6.26-11.494 11.064-19.025 14.413-7.531 3.203-16.449 4.804-26.755 4.804-12.683 0-23.782-2.621-33.294-7.862-9.381-5.386-16.713-12.665-21.998-21.837-5.153-9.317-7.729-19.872-7.729-31.665 0-11.792 2.51-22.274 7.53-31.446 5.036-9.105 11.902-16.195 20.596-21.268l.61-.351c8.984-5.241 19.091-7.861 30.322-7.861 10.311 0 19.743 2.286 28.294 6.859l.64.347c8.72 4.659 15.656 11.574 20.809 20.746 5.153 9.172 7.729 20.309 7.729 33.411 0 1.294-.052 2.761-.156 4.4l-.042.623-.17 2.353c-.075 1.01-.151 1.973-.227 2.888h-78.044zm21.365-42.147c-4.492 0-8.456 1.092-11.891 3.276-3.303 2.184-5.879 5.314-7.729 9.39a26.04 26.04 0 00-1.117 2.79 30.164 30.164 0 00-1.121 4.499l-.058.354h43.96l-.015-.106c-.401-2.638-1.122-5.055-2.163-7.252l-.246-.503c-1.776-3.774-4.282-6.742-7.519-8.906l-.409-.266c-3.303-2.184-7.2-3.276-11.692-3.276zm111.695-62.018l-.001 57.432h53.51V87.172h39.24v152.863h-39.24v-59.617H555.9l.001 59.617h-39.24V87.172h39.24zM715.766 242c-8.72 0-16.581-1.893-23.583-5.678-6.87-3.785-12.287-9.681-16.251-17.688-3.832-8.153-5.747-18.417-5.747-30.791v-66.168h37.654v59.398c0 9.172 1.519 15.723 4.558 19.654 3.171 3.931 7.597 5.896 13.278 5.896 3.7 0 7.069-.946 10.108-2.839 3.038-1.892 5.483-4.877 7.332-8.953 1.85-4.222 2.775-9.609 2.775-16.16v-56.996h37.654v118.36h-35.871l.004-12.38c-2.642 3.197-5.682 5.868-9.12 8.012-7.002 4.222-14.599 6.333-22.791 6.333zM841.489 78l-.001 54.041a34.1 34.1 0 016.541-5.78c6.474-4.367 14.269-6.551 23.385-6.551 9.777 0 18.629 2.475 26.556 7.424 7.873 4.835 14.106 11.684 18.701 20.546l.325.637c4.756 9.026 7.134 19.799 7.134 32.319 0 12.666-2.378 23.585-7.134 32.757-4.624 9.026-10.966 16.087-19.026 21.182-7.927 4.95-16.779 7.425-26.556 7.425-9.645 0-17.704-2.184-24.178-6.551-2.825-1.946-5.336-4.354-7.531-7.224v11.81h-35.87V78h37.654zm21.998 74.684c-4.228 0-8.059 1.092-11.495 3.276-3.303 2.184-6.011 5.387-8.125 9.609-1.982 4.076-2.973 9.099-2.973 15.067 0 5.969.991 11.138 2.973 15.505 2.114 4.222 4.822 7.425 8.125 9.609 3.436 2.183 7.267 3.275 11.495 3.275 4.228 0 7.993-1.092 11.296-3.275 3.435-2.184 6.144-5.387 8.126-9.609 2.114-4.367 3.171-9.536 3.171-15.505 0-5.968-1.057-10.991-3.171-15.067-1.906-4.06-4.484-7.177-7.733-9.352l-.393-.257c-3.303-2.184-7.068-3.276-11.296-3.276z"
15
- })
28
+ })]
16
29
  }));
17
30
  });
18
31
  export default LogoText;
@@ -14,7 +14,7 @@ export interface LogoProps extends DivProps {
14
14
  * @description Type of the logo to be rendered
15
15
  * @default '3d'
16
16
  */
17
- type?: '3d' | 'flat' | 'high-contrast' | 'text' | 'combine';
17
+ type?: '3d' | 'flat' | 'mono' | 'text' | 'combine';
18
18
  }
19
19
  declare const Logo: import("react").NamedExoticComponent<LogoProps>;
20
20
  export default Logo;
package/es/Logo/index.js CHANGED
@@ -9,9 +9,8 @@ import { Flexbox } from 'react-layout-kit';
9
9
  import { useCdnFn } from "../ConfigProvider";
10
10
  import Img from "../Img";
11
11
  import Divider from "./Divider";
12
- import LogoHighContrast from "./LogoHighContrast";
13
12
  import LogoText from "./LogoText";
14
- import { LOGO_3D, LOGO_FLAT, useStyles } from "./style";
13
+ import { LOGO_3D, useStyles } from "./style";
15
14
  import { jsx as _jsx } from "react/jsx-runtime";
16
15
  import { Fragment as _Fragment } from "react/jsx-runtime";
17
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -33,9 +32,9 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
33
32
  case '3d':
34
33
  {
35
34
  logoComponent = /*#__PURE__*/_jsx(Img, _objectSpread({
36
- alt: "lobehub",
35
+ alt: "LobeHub",
37
36
  height: size,
38
- src: genCdnUrl(LOGO_3D),
37
+ src: 'https://hub-apac-1.lobeobjects.space/logo-3d.webp',
39
38
  style: style,
40
39
  width: size
41
40
  }, rest));
@@ -44,30 +43,31 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
44
43
  case 'flat':
45
44
  {
46
45
  logoComponent = /*#__PURE__*/_jsx(Img, {
47
- alt: "lobehub",
46
+ alt: "LobeHub",
48
47
  height: size,
49
- src: genCdnUrl(LOGO_FLAT),
48
+ src: 'https://hub-apac-1.lobeobjects.space/logo-flat.svg',
50
49
  style: style,
51
50
  width: size
52
51
  });
53
52
  break;
54
53
  }
55
- case 'high-contrast':
54
+ case 'mono':
56
55
  {
57
- logoComponent = /*#__PURE__*/_jsx(LogoHighContrast, _objectSpread({
56
+ logoComponent = /*#__PURE__*/_jsx(Img, {
57
+ alt: "LobeHub",
58
58
  height: size,
59
+ src: 'https://hub-apac-1.lobeobjects.space/logo-mono.svg',
59
60
  style: style,
60
61
  width: size
61
- }, rest));
62
+ });
62
63
  break;
63
64
  }
64
65
  case 'text':
65
66
  {
66
67
  logoComponent = /*#__PURE__*/_jsx(LogoText, _objectSpread({
67
68
  className: className,
68
- height: size,
69
- style: style,
70
- width: size * 2.9375
69
+ size: size,
70
+ style: style
71
71
  }, rest));
72
72
  break;
73
73
  }
@@ -75,18 +75,25 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
75
75
  {
76
76
  logoComponent = /*#__PURE__*/_jsxs(_Fragment, {
77
77
  children: [/*#__PURE__*/_jsx(Img, {
78
- alt: "lobehub",
78
+ alt: "LobeHub",
79
79
  height: size,
80
80
  src: genCdnUrl(LOGO_3D),
81
81
  width: size
82
82
  }), /*#__PURE__*/_jsx(LogoText, {
83
+ size: size,
83
84
  style: {
84
- height: size,
85
- marginLeft: Math.round(size / 4),
86
- width: 'auto'
85
+ marginLeft: Math.round(size / 4)
87
86
  }
88
87
  })]
89
88
  });
89
+ if (!extra) logoComponent = /*#__PURE__*/_jsx(Flexbox, {
90
+ align: 'center',
91
+ className: className,
92
+ flex: 'none',
93
+ horizontal: true,
94
+ style: style,
95
+ children: logoComponent
96
+ });
90
97
  break;
91
98
  }
92
99
  }
@@ -95,14 +102,14 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
95
102
  return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
96
103
  align: 'center',
97
104
  className: className,
105
+ flex: 'none',
98
106
  horizontal: true,
99
107
  style: style
100
108
  }, rest), {}, {
101
109
  children: [logoComponent, /*#__PURE__*/_jsx(Divider, {
110
+ size: extraSize,
102
111
  style: {
103
- color: theme.colorFill,
104
- height: extraSize,
105
- width: extraSize
112
+ color: theme.colorFill
106
113
  }
107
114
  }), /*#__PURE__*/_jsx("div", {
108
115
  className: styles.extraTitle,
@@ -49,13 +49,20 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
49
49
  marginMultiple: marginMultiple
50
50
  }),
51
51
  mdStyles = _useMarkdownStyles.styles;
52
+ var isChatMode = variant === 'chat';
52
53
  var components = useMemo(function () {
53
54
  return {
54
55
  a: function a(props) {
55
56
  return /*#__PURE__*/_jsx(Link, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.a));
56
57
  },
57
58
  img: enableImageGallery ? function (props) {
58
- return /*#__PURE__*/_jsx(Image, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.img));
59
+ var _componentProps$img, _componentProps$img2;
60
+ return /*#__PURE__*/_jsx(Image, _objectSpread(_objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.img), {}, {
61
+ style: isChatMode ? _objectSpread({
62
+ height: 'auto',
63
+ maxWidth: 640
64
+ }, componentProps === null || componentProps === void 0 || (_componentProps$img = componentProps.img) === null || _componentProps$img === void 0 ? void 0 : _componentProps$img.style) : componentProps === null || componentProps === void 0 || (_componentProps$img2 = componentProps.img) === null || _componentProps$img2 === void 0 ? void 0 : _componentProps$img2.style
65
+ }));
59
66
  } : undefined,
60
67
  pre: function pre(props) {
61
68
  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));
@@ -69,8 +76,8 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
69
76
  return [allowHtml && rehypeRaw, rehypeKatex].filter(Boolean);
70
77
  }, [allowHtml]);
71
78
  var remarkPlugins = useMemo(function () {
72
- return [remarkGfm, remarkMath, variant === 'chat' && remarkBreaks].filter(Boolean);
73
- }, [variant]);
79
+ return [remarkGfm, remarkMath, isChatMode && remarkBreaks].filter(Boolean);
80
+ }, [isChatMode]);
74
81
  return /*#__PURE__*/_jsx("article", {
75
82
  className: className,
76
83
  "data-code-type": "markdown",
@@ -81,7 +88,7 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
81
88
  children: /*#__PURE__*/_jsx(ImageGallery, {
82
89
  enable: enableImageGallery,
83
90
  children: /*#__PURE__*/_jsx(ReactMarkdown, _objectSpread(_objectSpread({
84
- className: cx(mdStyles.__root, mdStyles.a, mdStyles.blockquote, mdStyles.code, mdStyles.details, mdStyles.header, mdStyles.hr, mdStyles.img, mdStyles.kbd, mdStyles.list, mdStyles.p, mdStyles.pre, mdStyles.strong, mdStyles.table, mdStyles.video, variant === 'chat' && styles.chat),
91
+ className: cx(mdStyles.__root, mdStyles.a, mdStyles.blockquote, mdStyles.code, mdStyles.details, mdStyles.header, mdStyles.hr, mdStyles.img, mdStyles.kbd, mdStyles.list, mdStyles.p, mdStyles.pre, mdStyles.strong, mdStyles.table, mdStyles.video, isChatMode && styles.chat),
85
92
  components: components,
86
93
  rehypePlugins: rehypePlugins,
87
94
  remarkPlugins: remarkPlugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.139.0",
3
+ "version": "1.140.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const LogoHighContrast: import("react").MemoExoticComponent<any>;
3
- export default LogoHighContrast;
@@ -1,25 +0,0 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
3
- import { memo } from 'react';
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- var LogoHighContrast = /*#__PURE__*/memo(function (_ref) {
7
- var rest = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
8
- return /*#__PURE__*/_jsxs("svg", _objectSpread(_objectSpread({
9
- fill: "currentColor",
10
- fillRule: "evenodd",
11
- viewBox: "0 0 320 320"
12
- }, rest), {}, {
13
- children: [/*#__PURE__*/_jsx("path", {
14
- d: "M25.401 140.14c3.71-5.453 8.81-9.628 15.313-12.838A23.89 23.89 0 0055 132.015a23.91 23.91 0 0016.053-6.159 48.924 48.924 0 0010.603-.294 56.54 56.54 0 006.809 6.555c-8.655 1.087-18.202 2.821-29.05 5.494-11.996 2.956-17.707 7.005-20.785 11.53-3.227 4.743-4.63 11.518-4.63 22.374 0 70.838 55.45 121.5 126 121.5 70.564 0 125.889-49.642 126-120.286-.751-13.724-2.613-20.518-5.764-24.763-3.023-4.073-8.262-7.153-19.898-10.42-9.615-2.7-20.317-4.252-31.506-5.103a48.977 48.977 0 006.306-6.763c2.995-1.106 6.948-.684 12.998.332l.321.054c2.498.421 5.641.95 8.543.95 5.214 0 10.234-.927 14.879-2.626 8.925 3.124 16.138 7.213 21.205 14.041 6.227 8.389 8.147 19.524 8.905 33.656l.011.214v.214c0 80.552-63.518 136.5-142 136.5-78.567 0-142-57.028-142-137.5 0-11.644 1.368-22.506 7.401-31.375z"
15
- }), /*#__PURE__*/_jsx("path", {
16
- d: "M195.5 145.016a50.53 50.53 0 0018.014-3.295C238.551 143.519 255 146.556 255 150c0 4.335-26.066 8.026-62.517 9.413-.201-5.525-.323-10.211-.316-14.505 1.102.071 2.214.108 3.333.108zM125 145.016a58.278 58.278 0 01-19.063-3.182C81.773 143.646 66 146.628 66 150c0 4.295 25.591 7.958 61.52 9.374.238-5.823.186-10.311-.246-14.402a59.24 59.24 0 01-2.274.044zM122.87 228c9.79-4.353 16.63-14.277 16.63-25.823 0-15.562-12.424-28.177-27.75-28.177S84 186.615 84 202.177c0 10.646 5.815 19.913 14.396 24.705 2.902-.349 5.839-.554 8.729-.554 5.259 0 10.673.678 15.745 1.672zM236 202.177c0 10.646-5.815 19.913-14.396 24.705-2.902-.349-5.839-.554-8.729-.554-5.259 0-10.673.678-15.745 1.672-9.79-4.353-16.63-14.277-16.63-25.823 0-15.562 12.424-28.177 27.75-28.177S236 186.615 236 202.177zM127 248.787S133.923 245 160 245c26.077 0 33 3.787 33 3.787S189.769 278 160 278s-33-29.213-33-29.213z"
17
- }), /*#__PURE__*/_jsx("path", {
18
- clipRule: "evenodd",
19
- d: "M173 19.016c-6.188 0-10.711-2.238-15.68-4.697-6.295-3.114-13.305-6.583-25.32-6.303-20.261 0-30.93 9.751-40.896 18.86-1.54 1.408-3.064 2.8-4.604 4.14-1.958 1.702-11.5 7-16 9-19.683 8.748-34.5 21.5-34.5 40.5 0 3.789.584 7.447 1.672 10.895A23.93 23.93 0 0155 84.016c13.255 0 24 10.745 24 24 0 3.552-.772 6.925-2.157 9.959a40.472 40.472 0 008.042-1.174c8.866 12.225 23.528 20.215 40.115 20.215 3.041 0 6.018-.269 8.906-.783 1.675 7.287 2.007 14.011 1.594 23.782h49c-.359-9.741-.486-17.161-.085-24.451a42.76 42.76 0 0011.085 1.452c14.294 0 26.9-7.006 34.364-17.668 6.059-3.498 13.291-2.284 19.597-1.225 2.746.461 5.317.893 7.539.893 18.778 0 34-14.551 34-32.5 0-8.333-3.281-15.934-8.675-21.686-4.31 5.012-10.697 8.186-17.825 8.186-12.979 0-23.5-10.522-23.5-23.5 0-12.98-30.137-31.5-45-31.5-5.31 0-10.313.325-14.617.604-3.249.21-6.099.396-8.383.396zM234.307 82.5c1.181 3.012-2.694 4.293-4.517 1.62l-.021-.03-.032-.047-.031-.043c-7.483-10.536-20.012-17.444-34.206-17.444a42.498 42.498 0 00-16.163 3.166c-6.41 2.63-14.55 1.24-19.499-3.61-8.882-8.704-21.21-14.096-34.838-14.096-17.152 0-32.245 8.542-41 21.478-1.966 2.365-5.65 1.323-4.535-1.543.06-.155.12-.305.182-.451C86.968 54.2 104.516 42.016 125 42.016c13.628 0 25.956 5.392 34.838 14.097 4.949 4.85 13.089 6.24 19.499 3.609a42.498 42.498 0 0116.163-3.166c17.73 0 32.863 10.778 38.807 25.944z"
20
- }), /*#__PURE__*/_jsx("path", {
21
- d: "M83 20.516a9.5 9.5 0 11-19 0 9.5 9.5 0 0119 0zM264.5 65.016c8.56 0 15.5-6.94 15.5-15.5 0-8.56-6.94-15.5-15.5-15.5-8.56 0-15.5 6.94-15.5 15.5 0 8.56 6.94 15.5 15.5 15.5zM55 124.016c8.837 0 16-7.164 16-16 0-8.837-7.163-16-16-16s-16 7.163-16 16c0 8.836 7.163 16 16 16z"
22
- })]
23
- }));
24
- });
25
- export default LogoHighContrast;