@lobehub/ui 1.16.2 → 1.18.1

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
@@ -115,7 +115,6 @@ This project is [MIT](./LICENSE) licensed.
115
115
  <!-- LINK GROUP -->
116
116
 
117
117
  [profile-url]: https://github.com/lobehub
118
- [issues-url]: https://github.com/lobehub/lobe-ui/issues/new/choose
119
118
  [gitpod-url]: https://gitpod.io/#https://github.com/lobehub/lobe-ui
120
119
 
121
120
  <!-- SHIELD LINK GROUP -->
@@ -160,4 +159,4 @@ This project is [MIT](./LICENSE) licensed.
160
159
  <!-- issues -->
161
160
 
162
161
  [issues-shield]: https://img.shields.io/github/issues/lobehub/lobe-ui.svg?style=flat
163
- [issues-url]: https://img.shields.io/github/issues/lobehub/lobe-ui.svg?style=flat
162
+ [issues-url]: https://github.com/lobehub/lobe-ui/issues/new/choose
@@ -6,6 +6,6 @@ export var useStyles = createStyles(function (_ref) {
6
6
  token = _ref.token;
7
7
  return {
8
8
  container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n > * {\n cursor: pointer;\n }\n "]))),
9
- border: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorBorder)
9
+ border: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorSplit)
10
10
  };
11
11
  });
@@ -39,7 +39,7 @@ var ColorScales = /*#__PURE__*/memo(function (_ref) {
39
39
  children: index
40
40
  })
41
41
  })
42
- }, 'num' + index);
42
+ }, "num".concat(index));
43
43
  })]
44
44
  }, "scale-title"), /*#__PURE__*/_jsx(ScaleRow, {
45
45
  name: name,
@@ -51,7 +51,6 @@ var MenuComponent = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
51
51
  whileElementsMounted: autoUpdate
52
52
  }),
53
53
  refs = _useFloating.refs,
54
- floatingStyles = _useFloating.floatingStyles,
55
54
  context = _useFloating.context;
56
55
  var hover = useHover(context, {
57
56
  enabled: isNested && allowHover,
@@ -238,8 +237,7 @@ var MenuComponent = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
238
237
  returnFocus: !isNested,
239
238
  children: /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
240
239
  className: styles.container,
241
- ref: refs.setFloating,
242
- style: floatingStyles
240
+ ref: refs.setFloating
243
241
  }, getFloatingProps()), {}, {
244
242
  children: items === null || items === void 0 ? void 0 : items.map(renderMenuItem)
245
243
  }))
@@ -39,6 +39,7 @@ var Content = /*#__PURE__*/memo(function (_ref) {
39
39
  index: index
40
40
  });
41
41
  handleMessageEditing(null);
42
+
42
43
  // 如果是用户的消息,那么重新生成下一条消息
43
44
  if (isUser) {
44
45
  resendMessage(index + 1);
@@ -67,7 +68,7 @@ var Content = /*#__PURE__*/memo(function (_ref) {
67
68
  return /*#__PURE__*/_jsxs(_Fragment, {
68
69
  children: [!loading ? /*#__PURE__*/_jsx(Markdown, {
69
70
  children: content
70
- }) : !!error ? null : /*#__PURE__*/_jsx("div", {
71
+ }) : error ? null : /*#__PURE__*/_jsx("div", {
71
72
  children: /*#__PURE__*/_jsx(LoadingOutlined, {
72
73
  spin: true,
73
74
  style: {
@@ -40,7 +40,7 @@ var ChatList = /*#__PURE__*/memo(function (_ref2) {
40
40
  children: [messages
41
41
  // 根据情况确认是否包含系统
42
42
  .filter(function (s) {
43
- return !includeSystem ? s.role !== 'system' : !!s;
43
+ return !includeSystem ? s.role !== 'system' : Boolean(s);
44
44
  }).map(function (item, index) {
45
45
  return /*#__PURE__*/_jsx(MessageItem, _objectSpread({
46
46
  index: index,
@@ -39,6 +39,7 @@ export interface DraggablePanelProps extends DivProps {
39
39
  * @type CSSProperties
40
40
  */
41
41
  hanlderStyle?: React.CSSProperties;
42
+ maxWidth?: number;
42
43
  /**
43
44
  * @description The minimum height of the panel
44
45
  */
@@ -28,6 +28,7 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
28
28
  customizeDefaultSize = _ref.defaultSize,
29
29
  minWidth = _ref.minWidth,
30
30
  minHeight = _ref.minHeight,
31
+ maxWidth = _ref.maxWidth,
31
32
  onSizeChange = _ref.onSizeChange,
32
33
  onSizeDragging = _ref.onSizeDragging,
33
34
  _ref$expandable = _ref.expandable,
@@ -95,6 +96,7 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
95
96
  var sizeProps = isExpand ? {
96
97
  minWidth: typeof minWidth === 'number' ? Math.max(minWidth, 0) : 280,
97
98
  minHeight: typeof minHeight === 'number' ? Math.max(minHeight, 0) : undefined,
99
+ maxWidth: typeof maxWidth === 'number' ? Math.max(maxWidth, 0) : undefined,
98
100
  defaultSize: defaultSize,
99
101
  size: size
100
102
  } : isVertical ? {
@@ -59,7 +59,7 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
59
59
  },
60
60
  onChange: function onChange(e) {
61
61
  setInputValue(e.target.value);
62
- setShowTag(e.target.value ? false : true);
62
+ setShowTag(!e.target.value);
63
63
  if (_onChange) _onChange(e);
64
64
  },
65
65
  onFocus: function onFocus() {
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { extractStaticStyle, type ThemeMode } from 'antd-style';
3
+ import type { CustomStylishParams, CustomTokenParams } from 'antd-style/lib/types/function';
3
4
  export interface ThemeProviderProps {
4
5
  /**
5
6
  * @description Cache for the extracted static styles
@@ -9,6 +10,18 @@ export interface ThemeProviderProps {
9
10
  * @description The children of the ThemeProvider component
10
11
  */
11
12
  children: React.ReactNode;
13
+ /**
14
+ * @description Custom stylish
15
+ */
16
+ customStylish?: (theme: CustomStylishParams) => {
17
+ [key: string]: any;
18
+ };
19
+ /**
20
+ * @description Custom extra token
21
+ */
22
+ customToken?: (theme: CustomTokenParams) => {
23
+ [key: string]: any;
24
+ };
12
25
  /**
13
26
  * @description Whether to inline the styles on server-side rendering or not
14
27
  */
@@ -1,5 +1,8 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1
4
  import { App } from 'antd';
2
- import { ThemeProvider as AntdThemeProvider, StyleProvider, setupStyled } from 'antd-style';
5
+ import { setupStyled, StyleProvider, ThemeProvider as AntdThemeProvider } from 'antd-style';
3
6
  import { memo } from 'react';
4
7
  // @ts-ignore
5
8
  import ReactFontLoader from 'react-font-loader';
@@ -10,15 +13,27 @@ import { jsx as _jsx } from "react/jsx-runtime";
10
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
14
  var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
12
15
  var children = _ref.children,
13
- themeMode = _ref.themeMode;
16
+ themeMode = _ref.themeMode,
17
+ _ref$customStylish = _ref.customStylish,
18
+ _customStylish = _ref$customStylish === void 0 ? function () {
19
+ return {};
20
+ } : _ref$customStylish,
21
+ _ref$customToken = _ref.customToken,
22
+ _customToken = _ref$customToken === void 0 ? function () {
23
+ return {};
24
+ } : _ref$customToken;
14
25
  setupStyled({
15
26
  ThemeContext: ThemeContext
16
27
  });
17
28
  return /*#__PURE__*/_jsx(StyleProvider, {
18
29
  speedy: process.env.NODE_ENV === 'production',
19
30
  children: /*#__PURE__*/_jsxs(AntdThemeProvider, {
20
- customStylish: lobeCustomStylish,
21
- customToken: lobeCustomToken,
31
+ customStylish: function customStylish(theme) {
32
+ return _objectSpread(_objectSpread({}, lobeCustomStylish(theme)), _customStylish(theme));
33
+ },
34
+ customToken: function customToken(theme) {
35
+ return _objectSpread(_objectSpread({}, lobeCustomToken(theme)), _customToken(theme));
36
+ },
22
37
  theme: lobeTheme,
23
38
  themeMode: themeMode,
24
39
  children: [/*#__PURE__*/_jsx(ReactFontLoader, {
package/es/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { default as ActionIcon, type ActionIconProps, type ActionIconSize } from './ActionIcon';
2
2
  export { default as Avatar, type AvatarProps } from './Avatar';
3
- export type { ChatMessage } from './Chat';
3
+ export type { ChatMessage, MessageRoleType } from './Chat';
4
4
  export { default as ColorScales, type ColorScalesProps } from './ColorScales';
5
5
  export { default as ContextMenu, type ContextMenuProps } from './ContextMenu';
6
6
  export { default as Conversation, type ConversationProps } from './Conversation';
@@ -9,9 +9,9 @@ export { default as DraggablePanel, type DraggablePanelProps } from './Draggable
9
9
  export { default as EditableMessage, type EditableMessageProps } from './EditableMessage';
10
10
  export { default as EditableMessageList, type EditableMessageListProps, } from './EditableMessageList';
11
11
  export { default as EditableText, type EditableTextProps } from './EditableText';
12
- export { default as Highlighter, SyntaxHighlighter, type HighlighterProps, type SyntaxHighlighterProps, } from './Highlighter';
12
+ export { default as Highlighter, type HighlighterProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from './Highlighter';
13
13
  export { default as Icon, type IconProps, type IconSize } from './Icon';
14
- export { Input, TextArea, type InputProps, type TextAreaProps } from './Input';
14
+ export { Input, type InputProps, TextArea, type TextAreaProps } from './Input';
15
15
  export { default as List } from './List';
16
16
  export { default as Logo, type LogoProps } from './Logo';
17
17
  export { default as Markdown, type MarkdownProps } from './Markdown';
@@ -20,10 +20,10 @@ export { default as MessageModal, type MessageModalProps } from './MessageModal'
20
20
  export { default as SearchBar, type SearchBarProps } from './SearchBar';
21
21
  export { default as SideNav, type SideNavProps } from './SideNav';
22
22
  export { default as Snippet, type SnippetProps } from './Snippet';
23
- export { default as StroyBook, useControls, useCreateStore, type StroyBookProps, } from './StroyBook';
23
+ export { default as StroyBook, type StroyBookProps, useControls, useCreateStore, } from './StroyBook';
24
+ export { colorScales as colors } from './styles/colors';
24
25
  export { default as Swatches, type SwatchesProps } from './Swatches';
25
26
  export { default as TabsNav, type TabsNavProps } from './TabsNav';
26
27
  export { default as ThemeProvider } from './ThemeProvider';
27
28
  export { default as ThemeSwitch, type ThemeSwitchProps } from './ThemeSwitch';
28
29
  export { default as Tooltip, type TooltipProps } from './Tooltip';
29
- export { colorScales as colors } from './styles/colors';
package/es/index.js CHANGED
@@ -20,9 +20,9 @@ export { default as SearchBar } from "./SearchBar";
20
20
  export { default as SideNav } from "./SideNav";
21
21
  export { default as Snippet } from "./Snippet";
22
22
  export { default as StroyBook, useControls, useCreateStore } from "./StroyBook";
23
+ export { colorScales as colors } from "./styles/colors";
23
24
  export { default as Swatches } from "./Swatches";
24
25
  export { default as TabsNav } from "./TabsNav";
25
26
  export { default as ThemeProvider } from "./ThemeProvider";
26
27
  export { default as ThemeSwitch } from "./ThemeSwitch";
27
- export { default as Tooltip } from "./Tooltip";
28
- export { colorScales as colors } from "./styles/colors";
28
+ export { default as Tooltip } from "./Tooltip";
@@ -1,5 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import { capitalize } from 'lodash';
2
+ import { capitalize } from 'lodash-es';
3
3
  export var generateColorPalette = function generateColorPalette(_ref) {
4
4
  var _ref2;
5
5
  var type = _ref.type,
@@ -1,19 +1,11 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
3
- import { rgba } from 'polished';
2
+ var _templateObject, _templateObject2;
4
3
  export var generateCustomStylish = function generateCustomStylish(_ref) {
5
4
  var css = _ref.css,
6
5
  token = _ref.token,
7
6
  isDarkMode = _ref.isDarkMode;
8
7
  return {
9
- clickableText: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorText),
10
- resetLinkColor: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: inherit;\n\n &:hover,\n &:active {\n color: inherit;\n }\n "]))),
11
- heroButtonGradient: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: linear-gradient(90deg, ", " 0%, ", " 100%);\n "])), token.gradientColor1, token.gradientColor2),
12
- heroGradient: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-image: ", ";\n background-size: 300% 300%;\n "])), token.gradientHeroBgG),
13
- heroGradientFlow: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n animation: flow 5s ease infinite;\n\n @keyframes flow {\n 0% {\n background-position: 0 0;\n }\n\n 50% {\n background-position: 100% 100%;\n }\n\n 100% {\n background-position: 0 0;\n }\n }\n "]))),
14
- heroBlurBall: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n will-change: transform;\n\n background: linear-gradient(\n 135deg,\n ", " 0%,\n ", " 30%,\n ", " 70%,\n ", " 100%\n );\n background-size: 200% 200%;\n filter: blur(69px);\n\n animation: glow 10s ease infinite;\n\n @keyframes glow {\n 0% {\n background-position: 0 -100%;\n }\n\n 50% {\n background-position: 200% 50%;\n }\n\n 100% {\n background-position: 0 -100%;\n }\n }\n "])), token.gradientColor3, token.gradientColor1, token.red, token.cyan),
15
- iconGradientDefault: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background-image: radial-gradient(\n 100% 100% at 50% 0,\n ", " 0,\n ", " 100%\n );\n "])), rgba(token.colorSolid, 0.2), rgba(token.colorSolid, 0.1)),
16
- blur: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))),
17
- markdown: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre {\n border-radius: ", "px;\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n ul li {\n line-height: 1.8;\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan1A : token.cyan3A, isDarkMode ? token.cyan1A : token.cyan4A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius)
8
+ blur: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))),
9
+ markdown: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre {\n border-radius: ", "px;\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n ul li {\n line-height: 1.8;\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan1A : token.cyan3A, isDarkMode ? token.cyan1A : token.cyan4A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius)
18
10
  };
19
11
  };
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
- import { camelCase } from 'lodash';
5
+ import { camelCase } from 'lodash-es';
6
6
  import { colorScales } from "../colors";
7
7
  var generateColorPalette = function generateColorPalette(_ref) {
8
8
  var _ref2;
@@ -33,8 +33,7 @@ var generateCustomColorPalette = function generateCustomColorPalette(_ref3) {
33
33
 
34
34
  // @ts-ignore
35
35
  export var generateCustomToken = function generateCustomToken(_ref4) {
36
- var isDarkMode = _ref4.isDarkMode,
37
- token = _ref4.token;
36
+ var isDarkMode = _ref4.isDarkMode;
38
37
  var colorCustomToken = {};
39
38
  Object.entries(colorScales).forEach(function (_ref5) {
40
39
  var _ref6 = _slicedToArray(_ref5, 2),
@@ -46,20 +45,5 @@ export var generateCustomToken = function generateCustomToken(_ref4) {
46
45
  appearance: isDarkMode ? 'dark' : 'light'
47
46
  }));
48
47
  });
49
- var gradientColor1 = colorScales.blue.darkA[8];
50
- var gradientColor2 = isDarkMode ? colorScales.magenta.darkA[8] : colorScales.cyan.darkA[8];
51
- var gradientColor3 = colorScales.purple.darkA[8];
52
- var colorSolid = isDarkMode ? '#fff' : '#000';
53
- return _objectSpread(_objectSpread(_objectSpread({}, token), colorCustomToken), {}, {
54
- headerHeight: 64,
55
- footerHeight: 300,
56
- sidebarWidth: 240,
57
- tocWidth: 176,
58
- contentMaxWidth: 1152,
59
- colorSolid: colorSolid,
60
- gradientColor1: gradientColor1,
61
- gradientColor2: gradientColor2,
62
- gradientColor3: gradientColor3,
63
- gradientHeroBgG: "radial-gradient(at 80% 20%, ".concat(gradientColor1, " 0%, ").concat(gradientColor2, " 80%, ").concat(gradientColor3, " 130%)")
64
- });
48
+ return colorCustomToken;
65
49
  };
@@ -1,14 +1,4 @@
1
1
  export interface LobeCustomStylish {
2
2
  blur: string;
3
- clickableText: string;
4
-
5
- heroBlurBall: string;
6
- heroButtonGradient: string;
7
-
8
- heroGradient: string;
9
- heroGradientFlow: string;
10
-
11
- iconGradientDefault: string;
12
3
  markdown: string;
13
- resetLinkColor: string;
14
4
  }
@@ -45,15 +45,4 @@ export type ColorPalettesAlpha = {
45
45
  [key in `${keyof PresetColorType}${ColorPaletteKeyIndex}A`]: string;
46
46
  };
47
47
 
48
- export interface LobeCustomToken extends ColorToken, ColorPalettes, ColorPalettesAlpha {
49
- colorSolid: string;
50
- contentMaxWidth: number;
51
- footerHeight: number;
52
- gradientColor1: string;
53
- gradientColor2: string;
54
- gradientColor3: string;
55
- gradientHeroBgG: string;
56
- headerHeight: number;
57
- sidebarWidth: number;
58
- tocWidth: number;
59
- }
48
+ export interface LobeCustomToken extends ColorToken, ColorPalettes, ColorPalettesAlpha {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.16.2",
3
+ "version": "1.18.1",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -24,7 +24,6 @@
24
24
  "module": "es/index.js",
25
25
  "types": "es/index.d.ts",
26
26
  "files": [
27
- "lib",
28
27
  "es"
29
28
  ],
30
29
  "scripts": {
@@ -37,33 +36,35 @@
37
36
  "dev:theme": "npm run dev --prefix=packages/dumi-theme-lobehub",
38
37
  "docs:build": "npm run build:theme && dumi build",
39
38
  "doctor": "father doctor",
40
- "lint": "eslint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\"",
41
- "lint:fix": "eslint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
39
+ "lint": "eslint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
40
+ "lint:md": "remark . -f -q",
41
+ "lint:style": "stylelint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
42
42
  "prepare": "husky install && npm run setup",
43
43
  "prepublishOnly": "father doctor && npm run build",
44
44
  "prettier": "prettier -c --write \"**/**\"",
45
45
  "release": "semantic-release",
46
46
  "setup": "dumi setup",
47
47
  "start": "dumi dev",
48
- "stylelint": "stylelint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
49
48
  "test": "vitest --passWithNoTests",
50
49
  "test:coverage": "vitest run --coverage --passWithNoTests",
51
50
  "test:update": "vitest -u",
52
51
  "type-check": "tsc -p tsconfig-check.json"
53
52
  },
54
53
  "lint-staged": {
55
- "*.{md,json}": [
54
+ "*.md": [
55
+ "remark -f -q",
56
+ "prettier --write --no-error-on-unmatched-pattern"
57
+ ],
58
+ "*.json": [
56
59
  "prettier --write --no-error-on-unmatched-pattern"
57
60
  ],
58
61
  "*.{js,jsx}": [
59
- "eslint --fix",
60
- "stylelint --fix",
61
- "prettier --write"
62
+ "prettier --write",
63
+ "eslint --fix"
62
64
  ],
63
65
  "*.{ts,tsx}": [
64
- "eslint --fix",
65
- "stylelint --fix",
66
- "prettier --parser=typescript --write"
66
+ "prettier --parser=typescript --write",
67
+ "eslint --fix"
67
68
  ]
68
69
  },
69
70
  "dependencies": {
@@ -72,14 +73,13 @@
72
73
  "@dqbd/tiktoken": "^1",
73
74
  "@floating-ui/react": "^0",
74
75
  "ahooks": "^3",
75
- "antd-style": "^3",
76
76
  "chroma-js": "^2",
77
77
  "copy-to-clipboard": "^3",
78
78
  "dayjs": "^1",
79
79
  "fast-deep-equal": "^3",
80
80
  "immer": "^10",
81
81
  "leva": "^0",
82
- "lodash": "^4",
82
+ "lodash-es": "^4",
83
83
  "lucide-react": "latest",
84
84
  "pangu": "^4",
85
85
  "polished": "^4",
@@ -102,13 +102,14 @@
102
102
  "@commitlint/cli": "^17",
103
103
  "@testing-library/react": "^14",
104
104
  "@types/chroma-js": "^2",
105
- "@types/lodash": "^4",
105
+ "@types/lodash-es": "^4",
106
106
  "@types/pangu": "^4",
107
107
  "@types/react": "^18",
108
108
  "@types/react-dom": "^18",
109
109
  "@umijs/lint": "^4",
110
110
  "@vitest/coverage-c8": "latest",
111
111
  "antd": "^5",
112
+ "antd-style": "^3",
112
113
  "commitlint": "^17",
113
114
  "commitlint-config-gitmoji": "^2",
114
115
  "concurrently": "^8",
@@ -132,6 +133,11 @@
132
133
  "prettier-plugin-packagejson": "^2",
133
134
  "react": "^18",
134
135
  "react-dom": "^18",
136
+ "remark": "^14",
137
+ "remark-cli": "^11",
138
+ "remark-lint": "^9",
139
+ "remark-lint-list-item-indent": "^3",
140
+ "remark-preset-lint-recommended": "^6",
135
141
  "semantic-release": "^21",
136
142
  "semantic-release-config-gitmoji": "^1",
137
143
  "stylelint": "^15",
@@ -143,6 +149,7 @@
143
149
  },
144
150
  "peerDependencies": {
145
151
  "antd": ">=5",
152
+ "antd-style": ">=3",
146
153
  "react": ">=18",
147
154
  "react-dom": ">=18"
148
155
  },