@lobehub/ui 1.115.3 → 1.116.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.
@@ -0,0 +1,5 @@
1
+ import { ActionIconSize } from "./index";
2
+ export declare const calcSize: (size?: ActionIconSize) => {
3
+ blockSize: number;
4
+ borderRadius: number;
5
+ };
@@ -0,0 +1,40 @@
1
+ export var calcSize = function calcSize(size) {
2
+ var blockSize;
3
+ var borderRadius;
4
+ switch (size) {
5
+ case 'large':
6
+ {
7
+ blockSize = 44;
8
+ borderRadius = 8;
9
+ break;
10
+ }
11
+ case 'normal':
12
+ {
13
+ blockSize = 36;
14
+ borderRadius = 5;
15
+ break;
16
+ }
17
+ case 'small':
18
+ {
19
+ blockSize = 24;
20
+ borderRadius = 5;
21
+ break;
22
+ }
23
+ case 'site':
24
+ {
25
+ blockSize = 34;
26
+ borderRadius = 5;
27
+ break;
28
+ }
29
+ default:
30
+ {
31
+ blockSize = (size === null || size === void 0 ? void 0 : size.blockSize) || 36;
32
+ borderRadius = (size === null || size === void 0 ? void 0 : size.borderRadius) || 5;
33
+ break;
34
+ }
35
+ }
36
+ return {
37
+ blockSize: blockSize,
38
+ borderRadius: borderRadius
39
+ };
40
+ };
@@ -1,14 +1,13 @@
1
1
  /// <reference types="react" />
2
- import { type IconProps } from "../Icon";
3
- import { type TooltipProps } from "../Tooltip";
4
- import { DivProps } from "../types";
5
- export type ActionIconSize = 'large' | 'normal' | 'small' | 'site' | {
2
+ import { type IconProps, type IconSizeConfig, type IconSizeType } from "../Icon";
3
+ import type { TooltipProps } from "../Tooltip";
4
+ interface ActionIconSizeConfig extends IconSizeConfig {
6
5
  blockSize?: number;
7
6
  borderRadius?: number;
8
- fontSize?: number;
9
- strokeWidth?: number;
10
- };
11
- export interface ActionIconProps extends DivProps {
7
+ }
8
+ type ActionIconSizeType = 'site' | IconSizeType;
9
+ export type ActionIconSize = ActionIconSizeType | ActionIconSizeConfig;
10
+ export interface ActionIconProps extends Omit<IconProps, 'size' | 'icon'> {
12
11
  /**
13
12
  * @description Whether the icon is active or not
14
13
  * @default false
@@ -19,17 +18,11 @@ export interface ActionIconProps extends DivProps {
19
18
  * @default false
20
19
  */
21
20
  arrow?: boolean;
22
- color?: IconProps['color'];
23
- fill?: IconProps['fill'];
24
21
  /**
25
22
  * @description Glass blur style
26
23
  * @default 'false'
27
24
  */
28
25
  glass?: boolean;
29
- /**
30
- * @description The icon element to be rendered
31
- * @type LucideIcon
32
- */
33
26
  icon?: IconProps['icon'];
34
27
  /**
35
28
  * @description Set the loading status of ActionIcon
@@ -1,57 +1,21 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["color", "fill", "className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow", "spotlight", "onClick", "children", "loading", "tooltipDelay"];
3
+ var _excluded = ["color", "fill", "className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow", "spotlight", "onClick", "children", "loading", "tooltipDelay", "fillOpacity", "fillRule", "focusable"];
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 { Loader2 } from 'lucide-react';
7
- import { forwardRef, useMemo } from 'react';
7
+ import { Suspense, forwardRef, lazy, useMemo } from 'react';
8
8
  import Icon from "../Icon";
9
- import Spotlight from "../Spotlight";
10
- import Tooltip from "../Tooltip";
9
+ import { calcSize } from "./calcSize";
11
10
  import { useStyles } from "./style";
12
11
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { Fragment as _Fragment } from "react/jsx-runtime";
14
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
- var calcSize = function calcSize(size) {
16
- var blockSize;
17
- var borderRadius;
18
- switch (size) {
19
- case 'large':
20
- {
21
- blockSize = 44;
22
- borderRadius = 8;
23
- break;
24
- }
25
- case 'normal':
26
- {
27
- blockSize = 36;
28
- borderRadius = 5;
29
- break;
30
- }
31
- case 'small':
32
- {
33
- blockSize = 24;
34
- borderRadius = 5;
35
- break;
36
- }
37
- case 'site':
38
- {
39
- blockSize = 34;
40
- borderRadius = 5;
41
- break;
42
- }
43
- default:
44
- {
45
- blockSize = (size === null || size === void 0 ? void 0 : size.blockSize) || 36;
46
- borderRadius = (size === null || size === void 0 ? void 0 : size.borderRadius) || 5;
47
- break;
48
- }
49
- }
50
- return {
51
- blockSize: blockSize,
52
- borderRadius: borderRadius
53
- };
54
- };
13
+ var Tooltip = /*#__PURE__*/lazy(function () {
14
+ return import("../Tooltip");
15
+ });
16
+ var Spotlight = /*#__PURE__*/lazy(function () {
17
+ return import("../Spotlight");
18
+ });
55
19
  var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
56
20
  var color = _ref.color,
57
21
  fill = _ref.fill,
@@ -72,6 +36,9 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
72
36
  loading = _ref.loading,
73
37
  _ref$tooltipDelay = _ref.tooltipDelay,
74
38
  tooltipDelay = _ref$tooltipDelay === void 0 ? 0.5 : _ref$tooltipDelay,
39
+ fillOpacity = _ref.fillOpacity,
40
+ fillRule = _ref.fillRule,
41
+ focusable = _ref.focusable,
75
42
  rest = _objectWithoutProperties(_ref, _excluded);
76
43
  var _useStyles = useStyles({
77
44
  active: Boolean(active),
@@ -84,21 +51,23 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
84
51
  }, [size]),
85
52
  blockSize = _useMemo.blockSize,
86
53
  borderRadius = _useMemo.borderRadius;
87
- var content = /*#__PURE__*/_jsxs(_Fragment, {
88
- children: [icon && /*#__PURE__*/_jsx(Icon, {
89
- className: styles.icon,
90
- color: color,
91
- fill: fill,
92
- icon: icon,
93
- size: size === 'site' ? 'normal' : size
94
- }), children]
95
- });
96
- var spin = /*#__PURE__*/_jsx(Icon, {
54
+ var iconProps = {
97
55
  color: color,
98
- icon: Loader2,
99
- size: size === 'site' ? 'normal' : size,
56
+ fill: fill,
57
+ fillOpacity: fillOpacity,
58
+ fillRule: fillRule,
59
+ focusable: focusable,
60
+ size: size === 'site' ? 'normal' : size
61
+ };
62
+ var content = icon && /*#__PURE__*/_jsx(Icon, _objectSpread({
63
+ className: styles.icon,
64
+ icon: icon
65
+ }, iconProps));
66
+ var spin = /*#__PURE__*/_jsx(Icon, _objectSpread(_objectSpread({
67
+ icon: Loader2
68
+ }, iconProps), {}, {
100
69
  spin: true
101
- });
70
+ }));
102
71
  var actionIconBlock = /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
103
72
  className: cx(styles.block, className),
104
73
  onClick: loading ? undefined : onClick,
@@ -109,18 +78,24 @@ var ActionIcon = /*#__PURE__*/forwardRef(function (_ref, ref) {
109
78
  width: blockSize
110
79
  }, style)
111
80
  }, rest), {}, {
112
- children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), loading ? spin : content]
81
+ children: [/*#__PURE__*/_jsx(Suspense, {
82
+ fallback: null,
83
+ children: spotlight && /*#__PURE__*/_jsx(Spotlight, {})
84
+ }), loading ? spin : content, children]
113
85
  }));
114
86
  if (!title) return actionIconBlock;
115
- return /*#__PURE__*/_jsx(Tooltip, {
116
- arrow: arrow,
117
- mouseEnterDelay: tooltipDelay,
118
- overlayStyle: {
119
- pointerEvents: 'none'
120
- },
121
- placement: placement,
122
- title: title,
123
- children: actionIconBlock
87
+ return /*#__PURE__*/_jsx(Suspense, {
88
+ fallback: actionIconBlock,
89
+ children: /*#__PURE__*/_jsx(Tooltip, {
90
+ arrow: arrow,
91
+ mouseEnterDelay: tooltipDelay,
92
+ overlayStyle: {
93
+ pointerEvents: 'none'
94
+ },
95
+ placement: placement,
96
+ title: title,
97
+ children: actionIconBlock
98
+ })
124
99
  });
125
100
  });
126
101
  export default ActionIcon;
@@ -16,9 +16,9 @@ var ErrorContent = /*#__PURE__*/memo(function (_ref) {
16
16
  }),
17
17
  styles = _useStyles.styles;
18
18
  return /*#__PURE__*/_jsxs(Flexbox, {
19
+ className: styles.errorContent,
19
20
  gap: 8,
20
21
  children: [/*#__PURE__*/_jsx(Alert, _objectSpread({
21
- className: styles.alert,
22
22
  showIcon: true,
23
23
  type: 'error'
24
24
  }, error)), message]
@@ -4,17 +4,21 @@ var _excluded = ["avatarAddon", "onAvatarClick", "actions", "className", "primar
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 { useResponsive } from 'antd-style';
7
- import { memo } from 'react';
7
+ import { Suspense, lazy, memo } from 'react';
8
8
  import { Flexbox } from 'react-layout-kit';
9
- import Actions from "./components/Actions";
10
9
  import Avatar from "./components/Avatar";
11
10
  import BorderSpacing from "./components/BorderSpacing";
12
- import ErrorContent from "./components/ErrorContent";
13
11
  import MessageContent from "./components/MessageContent";
14
12
  import Title from "./components/Title";
15
13
  import { useStyles } from "./style";
16
14
  import { jsx as _jsx } from "react/jsx-runtime";
17
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ var Actions = /*#__PURE__*/lazy(function () {
17
+ return import("./components/Actions");
18
+ });
19
+ var ErrorContent = /*#__PURE__*/lazy(function () {
20
+ return import("./components/ErrorContent");
21
+ });
18
22
  var MOBILE_AVATAR_SIZE = 32;
19
23
  var ChatItem = /*#__PURE__*/memo(function (_ref) {
20
24
  var avatarAddon = _ref.avatarAddon,
@@ -78,10 +82,13 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
78
82
  className: styles.messageContent,
79
83
  direction: type === 'block' ? placement === 'left' ? 'horizontal' : 'horizontal-reverse' : 'vertical',
80
84
  gap: 8,
81
- children: [error ? /*#__PURE__*/_jsx(ErrorContent, {
82
- error: error,
83
- message: errorMessage,
84
- placement: placement
85
+ children: [error ? /*#__PURE__*/_jsx(Suspense, {
86
+ fallback: null,
87
+ children: /*#__PURE__*/_jsx(ErrorContent, {
88
+ error: error,
89
+ message: errorMessage,
90
+ placement: placement
91
+ })
85
92
  }) : /*#__PURE__*/_jsx(MessageContent, {
86
93
  editing: editing,
87
94
  message: message,
@@ -94,11 +101,14 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
94
101
  renderMessage: renderMessage,
95
102
  text: text,
96
103
  type: type
97
- }), /*#__PURE__*/_jsx(Actions, {
98
- actions: actions,
99
- editing: editing,
100
- placement: placement,
101
- type: type
104
+ }), /*#__PURE__*/_jsx(Suspense, {
105
+ fallback: null,
106
+ children: /*#__PURE__*/_jsx(Actions, {
107
+ actions: actions,
108
+ editing: editing,
109
+ placement: placement,
110
+ type: type
111
+ })
102
112
  })]
103
113
  })]
104
114
  }), mobile && type === 'block' && /*#__PURE__*/_jsx(BorderSpacing, {
@@ -8,12 +8,12 @@ export declare const useStyles: (props?: {
8
8
  type?: "block" | "pure" | undefined;
9
9
  } | undefined) => import("antd-style").ReturnStyles<{
10
10
  actions: string;
11
- alert: import("antd-style").SerializedStyles;
12
11
  avatarContainer: import("antd-style").SerializedStyles;
13
12
  avatarGroupContainer: import("antd-style").SerializedStyles;
14
13
  container: string;
15
14
  editingContainer: string;
16
15
  editingInput: import("antd-style").SerializedStyles;
16
+ errorContent: import("antd-style").SerializedStyles;
17
17
  loading: import("antd-style").SerializedStyles;
18
18
  message: string;
19
19
  messageContainer: string;
@@ -21,16 +21,16 @@ export var useStyles = createStyles(function (_ref, _ref2) {
21
21
  var editingStylish = editing && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
22
22
  return {
23
23
  actions: cx(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n align-self: ", ";\n justify-content: ", ";\n "])), type === 'block' ? 'flex-end' : placement === 'left' ? 'flex-start' : 'flex-end', placement === 'left' ? 'flex-end' : 'flex-start'), editing && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n pointer-events: none !important;\n opacity: 0 !important;\n "])))),
24
- alert: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral([""]))),
25
- avatarContainer: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
26
- avatarGroupContainer: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), avatarSize),
27
- container: cx(type === 'pure' && pureContainerStylish, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n max-width: 100vw;\n padding: 12px 16px;\n\n time {\n display: inline-block;\n white-space: nowrap;\n }\n\n div[role='menubar'] {\n display: flex;\n }\n\n time,\n div[role='menubar'] {\n pointer-events: none;\n opacity: 0;\n transition: opacity 200ms ", ";\n }\n\n &:hover {\n time,\n div[role='menubar'] {\n pointer-events: unset;\n opacity: 1;\n }\n }\n\n ", " {\n padding: 4px 8px;\n }\n "])), token.motionEaseOut, responsive.mobile)),
28
- editingContainer: cx(editingStylish, css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n padding: 8px 12px 12px;\n border: 1px solid ", ";\n\n &:active,\n &:hover {\n border-color: ", ";\n }\n "])), token.colorBorderSecondary, token.colorBorder), type === 'pure' && css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n "])), token.colorFillQuaternary, token.borderRadius)),
29
- editingInput: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n width: 100%;\n "]))),
24
+ avatarContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
25
+ avatarGroupContainer: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), avatarSize),
26
+ container: cx(type === 'pure' && pureContainerStylish, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n max-width: 100vw;\n padding: 12px 16px;\n\n time {\n display: inline-block;\n white-space: nowrap;\n }\n\n div[role='menubar'] {\n display: flex;\n }\n\n time,\n div[role='menubar'] {\n pointer-events: none;\n opacity: 0;\n transition: opacity 200ms ", ";\n }\n\n &:hover {\n time,\n div[role='menubar'] {\n pointer-events: unset;\n opacity: 1;\n }\n }\n\n ", " {\n padding: 4px 8px;\n }\n "])), token.motionEaseOut, responsive.mobile)),
27
+ editingContainer: cx(editingStylish, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n padding: 8px 12px 12px;\n border: 1px solid ", ";\n\n &:active,\n &:hover {\n border-color: ", ";\n }\n "])), token.colorBorderSecondary, token.colorBorder), type === 'pure' && css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n "])), token.colorFillQuaternary, token.borderRadius)),
28
+ editingInput: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n width: 100%;\n "]))),
29
+ errorContent: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n ", " {\n width: 100%;\n }\n "])), responsive.mobile),
30
30
  loading: css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", ";\n bottom: 0;\n left: ", ";\n\n width: 16px;\n height: 16px;\n\n color: ", ";\n\n background: ", ";\n border-radius: 50%;\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', token.colorBgLayout, token.colorPrimary),
31
31
  message: cx(typeStylish, css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n position: relative;\n "])))),
32
- messageContainer: cx(editingStylish, css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n position: relative;\n "])))),
33
- messageContent: cx(editingStylish, css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n position: relative;\n overflow-x: hidden;\n\n ", " {\n flex-direction: column !important;\n }\n "])), responsive.mobile)),
32
+ messageContainer: cx(editingStylish, css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n position: relative;\n\n ", " {\n max-width: 100%;\n }\n "])), responsive.mobile)),
33
+ messageContent: cx(editingStylish, css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n position: relative;\n overflow-x: hidden;\n\n ", " {\n flex-direction: column !important;\n width: 100%;\n }\n "])), responsive.mobile)),
34
34
  messageExtra: cx('message-extra'),
35
35
  name: css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n position: ", ";\n top: ", ";\n right: ", ";\n left: ", ";\n\n margin-bottom: 6px;\n\n font-size: 12px;\n line-height: 1;\n color: ", ";\n text-align: ", ";\n "])), showTitle ? 'relative' : 'absolute', showTitle ? 'unset' : '-16px', placement === 'right' ? '0' : 'unset', placement === 'left' ? '0' : 'unset', token.colorTextDescription, placement === 'left' ? 'left' : 'right')
36
36
  };
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from 'react';
2
- import { type MessageInputProps } from "../MessageInput";
3
- import { type MessageModalProps } from "../MessageModal";
2
+ import type { MessageInputProps } from "../MessageInput";
3
+ import type { MessageModalProps } from "../MessageModal";
4
4
  export interface EditableMessageProps {
5
5
  /**
6
6
  * @title The class name for the Markdown and MessageInput component
@@ -3,14 +3,18 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  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; }
4
4
  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; }
5
5
  import { createStyles } from 'antd-style';
6
- import { memo } from 'react';
6
+ import { Suspense, lazy, memo } from 'react';
7
7
  import useControlledState from 'use-merge-value';
8
8
  import Markdown from "../Markdown";
9
- import MessageInput from "../MessageInput";
10
- import MessageModal from "../MessageModal";
11
9
  import { jsx as _jsx } from "react/jsx-runtime";
12
10
  import { Fragment as _Fragment } from "react/jsx-runtime";
13
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ var MessageInput = /*#__PURE__*/lazy(function () {
13
+ return import("../MessageInput");
14
+ });
15
+ var MessageModal = /*#__PURE__*/lazy(function () {
16
+ return import("../MessageModal");
17
+ });
14
18
  var useStyles = createStyles(function (_ref) {
15
19
  var stylish = _ref.stylish;
16
20
  return {
@@ -55,26 +59,29 @@ var EditableMessage = /*#__PURE__*/memo(function (_ref2) {
55
59
  expand = _useControlledState4[0],
56
60
  setExpand = _useControlledState4[1];
57
61
  var isAutoSize = height === 'auto';
58
- var input = /*#__PURE__*/_jsx(MessageInput, {
59
- className: classNames === null || classNames === void 0 ? void 0 : classNames.input,
60
- classNames: {
61
- textarea: classNames === null || classNames === void 0 ? void 0 : classNames.textarea
62
- },
63
- defaultValue: value,
64
- editButtonSize: editButtonSize,
65
- height: height,
66
- onCancel: function onCancel() {
67
- return setTyping(false);
68
- },
69
- onConfirm: function onConfirm(text) {
70
- _onChange === null || _onChange === void 0 || _onChange(text);
71
- setTyping(false);
72
- },
73
- placeholder: placeholder,
74
- style: stylesProps === null || stylesProps === void 0 ? void 0 : stylesProps.input,
75
- text: text,
76
- textareaClassname: classNames === null || classNames === void 0 ? void 0 : classNames.input,
77
- type: inputType
62
+ var input = /*#__PURE__*/_jsx(Suspense, {
63
+ fallback: null,
64
+ children: /*#__PURE__*/_jsx(MessageInput, {
65
+ className: classNames === null || classNames === void 0 ? void 0 : classNames.input,
66
+ classNames: {
67
+ textarea: classNames === null || classNames === void 0 ? void 0 : classNames.textarea
68
+ },
69
+ defaultValue: value,
70
+ editButtonSize: editButtonSize,
71
+ height: height,
72
+ onCancel: function onCancel() {
73
+ return setTyping(false);
74
+ },
75
+ onConfirm: function onConfirm(text) {
76
+ _onChange === null || _onChange === void 0 || _onChange(text);
77
+ setTyping(false);
78
+ },
79
+ placeholder: placeholder,
80
+ style: stylesProps === null || stylesProps === void 0 ? void 0 : stylesProps.input,
81
+ text: text,
82
+ textareaClassname: classNames === null || classNames === void 0 ? void 0 : classNames.input,
83
+ type: inputType
84
+ })
78
85
  });
79
86
  if (!value && showEditWhenEmpty) return input;
80
87
  return /*#__PURE__*/_jsxs(_Fragment, {
@@ -87,23 +94,26 @@ var EditableMessage = /*#__PURE__*/memo(function (_ref2) {
87
94
  overflowY: 'auto'
88
95
  }, stylesProps === null || stylesProps === void 0 ? void 0 : stylesProps.markdown),
89
96
  children: value || placeholder
90
- }), /*#__PURE__*/_jsx(MessageModal, {
91
- editing: isEdit,
92
- extra: model === null || model === void 0 ? void 0 : model.extra,
93
- footer: model === null || model === void 0 ? void 0 : model.footer,
94
- height: height,
95
- onChange: function onChange(text) {
96
- return _onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
97
- },
98
- onEditingChange: setTyping,
99
- onOpenChange: function onOpenChange(e) {
100
- setExpand(e);
101
- setTyping(false);
102
- },
103
- open: expand,
104
- placeholder: placeholder,
105
- text: text,
106
- value: value
97
+ }), /*#__PURE__*/_jsx(Suspense, {
98
+ fallback: null,
99
+ children: /*#__PURE__*/_jsx(MessageModal, {
100
+ editing: isEdit,
101
+ extra: model === null || model === void 0 ? void 0 : model.extra,
102
+ footer: model === null || model === void 0 ? void 0 : model.footer,
103
+ height: height,
104
+ onChange: function onChange(text) {
105
+ return _onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
106
+ },
107
+ onEditingChange: setTyping,
108
+ onOpenChange: function onOpenChange(e) {
109
+ setExpand(e);
110
+ setTyping(false);
111
+ },
112
+ open: expand,
113
+ placeholder: placeholder,
114
+ text: text,
115
+ value: value
116
+ })
107
117
  })]
108
118
  });
109
119
  });
@@ -1,32 +1,53 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import data from '@emoji-mart/data';
5
- import Picker from '@emoji-mart/react';
5
+ import DEFAULT_I18N from '@emoji-mart/data/i18n/en.json';
6
6
  import { Avatar } from "./..";
7
7
  import { Popover } from 'antd';
8
- import { memo } from 'react';
8
+ import { Suspense, lazy, memo } from 'react';
9
9
  import useSWR from 'swr';
10
10
  import useMergeState from 'use-merge-value';
11
11
  import { useStyles } from "./style";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ var Picker = /*#__PURE__*/lazy(function () {
14
+ return import('@emoji-mart/react');
15
+ });
16
+ var DEFAULT_EMOJI = '🤖';
17
+ var DEFAULT_LOCALE = 'en-US';
18
+ var DEFAULT_BACKGROUND_COLOR = 'rgba(0,0,0,0)';
19
+ var formatLocale = function formatLocale(locale) {
20
+ return locale.split('-')[0];
21
+ };
13
22
  var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
14
23
  var value = _ref.value,
15
24
  _ref$defaultAvatar = _ref.defaultAvatar,
16
- defaultAvatar = _ref$defaultAvatar === void 0 ? '🤖' : _ref$defaultAvatar,
25
+ defaultAvatar = _ref$defaultAvatar === void 0 ? DEFAULT_EMOJI : _ref$defaultAvatar,
17
26
  _ref$backgroundColor = _ref.backgroundColor,
18
- backgroundColor = _ref$backgroundColor === void 0 ? 'rgba(0,0,0,0)' : _ref$backgroundColor,
27
+ backgroundColor = _ref$backgroundColor === void 0 ? DEFAULT_BACKGROUND_COLOR : _ref$backgroundColor,
19
28
  onChange = _ref.onChange,
20
29
  _ref$locale = _ref.locale,
21
- locale = _ref$locale === void 0 ? 'en-US' : _ref$locale;
22
- var _useStyles = useStyles(),
23
- styles = _useStyles.styles;
24
- var _useSWR = useSWR(locale, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
30
+ locale = _ref$locale === void 0 ? DEFAULT_LOCALE : _ref$locale;
31
+ var _useMergeState = useMergeState(locale, {
32
+ defaultValue: locale
33
+ }),
34
+ _useMergeState2 = _slicedToArray(_useMergeState, 2),
35
+ emojiLocale = _useMergeState2[0],
36
+ setEmojiLocale = _useMergeState2[1];
37
+ var _useMergeState3 = useMergeState('🤖', {
38
+ defaultValue: defaultAvatar,
39
+ onChange: onChange,
40
+ value: value
41
+ }),
42
+ _useMergeState4 = _slicedToArray(_useMergeState3, 2),
43
+ ava = _useMergeState4[0],
44
+ setAva = _useMergeState4[1];
45
+ var _useSWR = useSWR(emojiLocale === DEFAULT_LOCALE ? null : emojiLocale, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
25
46
  return _regeneratorRuntime.wrap(function _callee$(_context) {
26
47
  while (1) switch (_context.prev = _context.next) {
27
48
  case 0:
28
49
  _context.next = 2;
29
- return import("@emoji-mart/data/i18n/".concat(locale.split('-')[0], ".json"));
50
+ return import("@emoji-mart/data/i18n/".concat(formatLocale(emojiLocale), ".json"));
30
51
  case 2:
31
52
  return _context.abrupt("return", _context.sent);
32
53
  case 3:
@@ -34,28 +55,32 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
34
55
  return _context.stop();
35
56
  }
36
57
  }, _callee);
37
- }))),
38
- i18n = _useSWR.data;
39
- var _useMergeState = useMergeState('🤖', {
40
- defaultValue: defaultAvatar,
41
- onChange: onChange,
42
- value: value
58
+ })), {
59
+ onError: function onError() {
60
+ return setEmojiLocale(DEFAULT_LOCALE);
61
+ },
62
+ onErrorRetry: function onErrorRetry() {
63
+ return setEmojiLocale(DEFAULT_LOCALE);
64
+ }
43
65
  }),
44
- _useMergeState2 = _slicedToArray(_useMergeState, 2),
45
- ava = _useMergeState2[0],
46
- setAva = _useMergeState2[1];
66
+ i18n = _useSWR.data;
67
+ var _useStyles = useStyles(),
68
+ styles = _useStyles.styles;
47
69
  return /*#__PURE__*/_jsx(Popover, {
48
70
  content: /*#__PURE__*/_jsx("div", {
49
71
  className: styles.picker,
50
- children: /*#__PURE__*/_jsx(Picker, {
51
- data: data,
52
- i18n: i18n,
53
- locale: locale.split('-')[0],
54
- onEmojiSelect: function onEmojiSelect(e) {
55
- return setAva(e.native);
56
- },
57
- skinTonePosition: 'none',
58
- theme: 'auto'
72
+ children: /*#__PURE__*/_jsx(Suspense, {
73
+ fallback: null,
74
+ children: /*#__PURE__*/_jsx(Picker, {
75
+ data: data,
76
+ i18n: i18n || DEFAULT_I18N,
77
+ locale: formatLocale(emojiLocale) || DEFAULT_LOCALE,
78
+ onEmojiSelect: function onEmojiSelect(e) {
79
+ return setAva(e.native);
80
+ },
81
+ skinTonePosition: 'none',
82
+ theme: 'auto'
83
+ })
59
84
  })
60
85
  }),
61
86
  placement: 'left',
@@ -1,5 +1,5 @@
1
1
  import { type GiscusProps as GiscusComponentProps } from '@giscus/react';
2
- import { CSSProperties } from 'react';
2
+ import { type CSSProperties } from 'react';
3
3
  export interface GiscusProps extends GiscusComponentProps {
4
4
  className?: string;
5
5
  style?: CSSProperties;
@@ -3,15 +3,17 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  var _excluded = ["fullFeatured", "copyButtonSize", "children", "language", "className", "style", "copyable", "showLanguage", "type", "spotlight"];
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
- import { memo } from 'react';
6
+ import { Suspense, lazy, memo } from 'react';
7
7
  import CopyButton from "../CopyButton";
8
- import Spotlight from "../Spotlight";
9
8
  import Tag from "../Tag";
10
9
  import FullFeatured from "./FullFeatured";
11
10
  import SyntaxHighlighter from "./SyntaxHighlighter";
12
11
  import { useStyles } from "./style";
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ var Spotlight = /*#__PURE__*/lazy(function () {
15
+ return import("../Spotlight");
16
+ });
15
17
  export var Highlighter = /*#__PURE__*/memo(function (_ref) {
16
18
  var fullFeatured = _ref.fullFeatured,
17
19
  _ref$copyButtonSize = _ref.copyButtonSize,
@@ -44,8 +46,11 @@ export var Highlighter = /*#__PURE__*/memo(function (_ref) {
44
46
  "data-code-type": "highlighter",
45
47
  style: style
46
48
  }, rest), {}, {
47
- children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {
48
- size: 240
49
+ children: [/*#__PURE__*/_jsx(Suspense, {
50
+ fallback: null,
51
+ children: spotlight && /*#__PURE__*/_jsx(Spotlight, {
52
+ size: 240
53
+ })
49
54
  }), copyable && /*#__PURE__*/_jsx(CopyButton, {
50
55
  className: styles.button,
51
56
  content: children,
@@ -0,0 +1,5 @@
1
+ import { IconSize } from "./index";
2
+ export declare const calcSize: (size?: IconSize) => {
3
+ fontSize: string | number;
4
+ strokeWidth: string | number;
5
+ };
@@ -0,0 +1,39 @@
1
+ export var calcSize = function calcSize(size) {
2
+ var fontSize;
3
+ var strokeWidth;
4
+ switch (size) {
5
+ case 'large':
6
+ {
7
+ fontSize = 24;
8
+ strokeWidth = 2;
9
+ break;
10
+ }
11
+ case 'normal':
12
+ {
13
+ fontSize = 20;
14
+ strokeWidth = 2;
15
+ break;
16
+ }
17
+ case 'small':
18
+ {
19
+ fontSize = 14;
20
+ strokeWidth = 1.5;
21
+ break;
22
+ }
23
+ default:
24
+ {
25
+ if (size) {
26
+ fontSize = (size === null || size === void 0 ? void 0 : size.fontSize) || 24;
27
+ strokeWidth = (size === null || size === void 0 ? void 0 : size.strokeWidth) || 2;
28
+ } else {
29
+ fontSize = '1em';
30
+ strokeWidth = 2;
31
+ }
32
+ break;
33
+ }
34
+ }
35
+ return {
36
+ fontSize: fontSize,
37
+ strokeWidth: strokeWidth
38
+ };
39
+ };
@@ -1,13 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { LucideIcon } from 'lucide-react';
2
+ import { LucideIcon, LucideProps } from 'lucide-react';
3
3
  import { DivProps } from "../types";
4
- export type IconSize = 'large' | 'normal' | 'small' | {
4
+ export interface IconSizeConfig extends Pick<LucideProps, 'strokeWidth' | 'absoluteStrokeWidth'> {
5
5
  fontSize?: number;
6
- strokeWidth?: number;
7
- };
8
- export interface IconProps extends DivProps {
9
- color?: string;
10
- fill?: string;
6
+ }
7
+ export type IconSizeType = 'large' | 'normal' | 'small';
8
+ export type IconSize = IconSizeType | IconSizeConfig;
9
+ export interface IconProps extends DivProps, Pick<LucideProps, 'fill' | 'fillRule' | 'fillOpacity' | 'color' | 'focusable'> {
11
10
  /**
12
11
  * @description The icon element to be rendered
13
12
  * @type LucideIcon
@@ -24,5 +23,5 @@ export interface IconProps extends DivProps {
24
23
  */
25
24
  spin?: boolean;
26
25
  }
27
- declare const Icon: import("react").NamedExoticComponent<IconProps>;
26
+ declare const Icon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<SVGSVGElement>>;
28
27
  export default Icon;
package/es/Icon/index.js CHANGED
@@ -1,57 +1,24 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["icon", "size", "color", "fill", "className", "spin"];
3
+ var _excluded = ["icon", "size", "color", "fill", "className", "focusable", "spin", "fillRule", "fillOpacity"],
4
+ _excluded2 = ["fontSize"];
4
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; }
5
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; }
6
- import { memo, useMemo } from 'react';
7
+ import { forwardRef, useMemo } from 'react';
8
+ import { calcSize } from "./calcSize";
7
9
  import { useStyles } from "./style";
8
10
  import { jsx as _jsx } from "react/jsx-runtime";
9
- var calcSize = function calcSize(size) {
10
- var fontSize;
11
- var strokeWidth;
12
- switch (size) {
13
- case 'large':
14
- {
15
- fontSize = 24;
16
- strokeWidth = 2;
17
- break;
18
- }
19
- case 'normal':
20
- {
21
- fontSize = 20;
22
- strokeWidth = 2;
23
- break;
24
- }
25
- case 'small':
26
- {
27
- fontSize = 14;
28
- strokeWidth = 1.5;
29
- break;
30
- }
31
- default:
32
- {
33
- if (size) {
34
- fontSize = (size === null || size === void 0 ? void 0 : size.fontSize) || 24;
35
- strokeWidth = (size === null || size === void 0 ? void 0 : size.strokeWidth) || 2;
36
- } else {
37
- fontSize = '1em';
38
- strokeWidth = 2;
39
- }
40
- break;
41
- }
42
- }
43
- return {
44
- fontSize: fontSize,
45
- strokeWidth: strokeWidth
46
- };
47
- };
48
- var Icon = /*#__PURE__*/memo(function (_ref) {
11
+ var Icon = /*#__PURE__*/forwardRef(function (_ref, ref) {
49
12
  var icon = _ref.icon,
50
13
  size = _ref.size,
51
14
  color = _ref.color,
52
- fill = _ref.fill,
15
+ _ref$fill = _ref.fill,
16
+ fill = _ref$fill === void 0 ? 'transparent' : _ref$fill,
53
17
  className = _ref.className,
18
+ focusable = _ref.focusable,
54
19
  spin = _ref.spin,
20
+ fillRule = _ref.fillRule,
21
+ fillOpacity = _ref.fillOpacity,
55
22
  rest = _objectWithoutProperties(_ref, _excluded);
56
23
  var _useStyles = useStyles(),
57
24
  styles = _useStyles.styles,
@@ -61,20 +28,22 @@ var Icon = /*#__PURE__*/memo(function (_ref) {
61
28
  return calcSize(size);
62
29
  }, [size]),
63
30
  fontSize = _useMemo.fontSize,
64
- strokeWidth = _useMemo.strokeWidth;
31
+ restSize = _objectWithoutProperties(_useMemo, _excluded2);
65
32
  return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
66
33
  className: cx('anticon', spin && styles.spin, className),
67
34
  role: "img"
68
35
  }, rest), {}, {
69
- children: /*#__PURE__*/_jsx(SvgIcon, {
36
+ children: /*#__PURE__*/_jsx(SvgIcon, _objectSpread({
70
37
  color: color,
71
- fill: fill !== null && fill !== void 0 ? fill : 'transparent',
72
- focusable: false,
38
+ fill: fill,
39
+ fillOpacity: fillOpacity,
40
+ fillRule: fillRule,
41
+ focusable: focusable,
73
42
  height: fontSize,
43
+ ref: ref,
74
44
  size: fontSize,
75
- strokeWidth: strokeWidth,
76
45
  width: fontSize
77
- })
46
+ }, restSize))
78
47
  }));
79
48
  });
80
49
  export default Icon;
@@ -5,15 +5,17 @@ var _excluded = ["defaultValue", "spotlight", "className", "value", "onInputChan
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
  import { Search } from 'lucide-react';
8
- import { memo, useEffect, useRef, useState } from 'react';
8
+ import { Suspense, lazy, memo, useEffect, useRef, useState } from 'react';
9
9
  import useControlledState from 'use-merge-value';
10
10
  import Icon from "../Icon";
11
11
  import { Input } from "../Input";
12
- import Spotlight from "../Spotlight";
13
12
  import Tag from "../Tag";
14
13
  import { useStyles } from "./style";
15
14
  import { jsx as _jsx } from "react/jsx-runtime";
16
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ var Spotlight = /*#__PURE__*/lazy(function () {
17
+ return import("../Spotlight");
18
+ });
17
19
  var SearchBar = /*#__PURE__*/memo(function (_ref) {
18
20
  var defaultValue = _ref.defaultValue,
19
21
  spotlight = _ref.spotlight,
@@ -66,7 +68,10 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
66
68
  }, []);
67
69
  return /*#__PURE__*/_jsxs("div", {
68
70
  className: cx(styles.search, className),
69
- children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), /*#__PURE__*/_jsx(Input, _objectSpread({
71
+ children: [/*#__PURE__*/_jsx(Suspense, {
72
+ fallback: null,
73
+ children: spotlight && /*#__PURE__*/_jsx(Spotlight, {})
74
+ }), /*#__PURE__*/_jsx(Input, _objectSpread({
70
75
  allowClear: true,
71
76
  className: styles.input,
72
77
  onBlur: function onBlur() {
@@ -3,13 +3,15 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  var _excluded = ["symbol", "language", "children", "copyable", "type", "spotlight", "className"];
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
- import { memo } from 'react';
6
+ import { Suspense, lazy, memo } from 'react';
7
7
  import CopyButton from "../CopyButton";
8
8
  import SyntaxHighlighter from "../Highlighter/SyntaxHighlighter";
9
- import Spotlight from "../Spotlight";
10
9
  import { useStyles } from "./style";
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ var Spotlight = /*#__PURE__*/lazy(function () {
13
+ return import("../Spotlight");
14
+ });
13
15
  var Snippet = /*#__PURE__*/memo(function (_ref) {
14
16
  var symbol = _ref.symbol,
15
17
  _ref$language = _ref.language,
@@ -28,7 +30,10 @@ var Snippet = /*#__PURE__*/memo(function (_ref) {
28
30
  return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
29
31
  className: cx(styles.container, className)
30
32
  }, rest), {}, {
31
- children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), /*#__PURE__*/_jsx(SyntaxHighlighter, {
33
+ children: [/*#__PURE__*/_jsx(Suspense, {
34
+ fallback: null,
35
+ children: spotlight && /*#__PURE__*/_jsx(Spotlight, {})
36
+ }), /*#__PURE__*/_jsx(SyntaxHighlighter, {
32
37
  language: language,
33
38
  children: [symbol, children].filter(Boolean).join(' ')
34
39
  }), copyable && /*#__PURE__*/_jsx(CopyButton, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.115.3",
3
+ "version": "1.116.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",