@lobehub/ui 1.17.0 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -6
- package/es/ColorScales/index.js +1 -1
- package/es/ContextMenu/index.js +1 -3
- package/es/Conversation/ChatList/MessageItem/Content.js +2 -1
- package/es/Conversation/ChatList/index.js +1 -1
- package/es/SearchBar/index.js +1 -1
- package/es/ThemeProvider/index.d.ts +13 -0
- package/es/ThemeProvider/index.js +19 -4
- package/es/index.d.ts +5 -5
- package/es/index.js +2 -2
- package/es/styles/algorithms/generateCustomStylish.js +3 -11
- package/es/styles/algorithms/generateCustomToken.js +2 -18
- package/es/types/customStylish.d.ts +0 -10
- package/es/types/customToken.d.ts +1 -12
- package/package.json +21 -10
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<a name="readme-top"></a>
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
<img width="160" src="https://raw.githubusercontent.com/lobehub/.github/main/profile/Logo.webp">
|
|
6
6
|
|
|
7
7
|
<h1>Lobe UI</h1>
|
|
@@ -15,8 +15,7 @@ Lobe UI is an open-source UI component library for building _AIGC_ web apps
|
|
|
15
15
|
[![release][release-shield]][release-url]
|
|
16
16
|
[![releaseDate][release-date-shield]][release-date-url]
|
|
17
17
|
[![ciTest][ci-test-shield]][ci-test-url]
|
|
18
|
-
[![ciRelease][ci-release-shield]][ci-release-url]
|
|
19
|
-
<br/>
|
|
18
|
+
[![ciRelease][ci-release-shield]][ci-release-url] <br/>
|
|
20
19
|
[![contributors][contributors-shield]][contributors-url]
|
|
21
20
|
[![forks][forks-shield]][forks-url]
|
|
22
21
|
[![stargazers][stargazers-shield]][stargazers-url]
|
|
@@ -26,6 +25,25 @@ Lobe UI is an open-source UI component library for building _AIGC_ web apps
|
|
|
26
25
|
|
|
27
26
|
</div>
|
|
28
27
|
|
|
28
|
+
<details>
|
|
29
|
+
<summary><kbd>Table of contents</kbd></summary>
|
|
30
|
+
|
|
31
|
+
#### TOC
|
|
32
|
+
|
|
33
|
+
- [📦 Installation](#-installation)
|
|
34
|
+
|
|
35
|
+
- [🤯 Usage](#-usage)
|
|
36
|
+
|
|
37
|
+
- [Compile with NextJS](#compile-with-nextjs)
|
|
38
|
+
|
|
39
|
+
- [⌨️ Local Development](#️-local-development)
|
|
40
|
+
|
|
41
|
+
- [🤝 Contributing](#-contributing)
|
|
42
|
+
|
|
43
|
+
####
|
|
44
|
+
|
|
45
|
+
</details>
|
|
46
|
+
|
|
29
47
|
## 📦 Installation
|
|
30
48
|
|
|
31
49
|
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
|
|
@@ -36,7 +54,13 @@ To install Lobe UI, run the following command:
|
|
|
36
54
|
pnpm add @lobehub/ui
|
|
37
55
|
```
|
|
38
56
|
|
|
39
|
-
|
|
57
|
+
<div align="right">
|
|
58
|
+
|
|
59
|
+
[![][back-to-top]](#readme-top)
|
|
60
|
+
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
## 🤯 Usage
|
|
40
64
|
|
|
41
65
|
### Compile with NextJS
|
|
42
66
|
|
|
@@ -115,7 +139,6 @@ This project is [MIT](./LICENSE) licensed.
|
|
|
115
139
|
<!-- LINK GROUP -->
|
|
116
140
|
|
|
117
141
|
[profile-url]: https://github.com/lobehub
|
|
118
|
-
[issues-url]: https://github.com/lobehub/lobe-ui/issues/new/choose
|
|
119
142
|
[gitpod-url]: https://gitpod.io/#https://github.com/lobehub/lobe-ui
|
|
120
143
|
|
|
121
144
|
<!-- SHIELD LINK GROUP -->
|
|
@@ -160,4 +183,4 @@ This project is [MIT](./LICENSE) licensed.
|
|
|
160
183
|
<!-- issues -->
|
|
161
184
|
|
|
162
185
|
[issues-shield]: https://img.shields.io/github/issues/lobehub/lobe-ui.svg?style=flat
|
|
163
|
-
[issues-url]: https://
|
|
186
|
+
[issues-url]: https://github.com/lobehub/lobe-ui/issues/new/choose
|
package/es/ColorScales/index.js
CHANGED
package/es/ContextMenu/index.js
CHANGED
|
@@ -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
|
-
}) :
|
|
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' :
|
|
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,
|
package/es/SearchBar/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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:
|
|
21
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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,19 +1,11 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2
|
|
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
|
-
|
|
10
|
-
|
|
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
|
};
|
|
@@ -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
|
-
|
|
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.
|
|
3
|
+
"version": "1.18.2",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building chatbot web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -18,13 +18,12 @@
|
|
|
18
18
|
"url": "https://github.com/lobehub/lobe-ui.git"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
|
-
"author": "LobeHub",
|
|
21
|
+
"author": "LobeHub <i@lobehub.com>",
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"main": "es/index.js",
|
|
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": {
|
|
@@ -38,31 +37,36 @@
|
|
|
38
37
|
"docs:build": "npm run build:theme && dumi build",
|
|
39
38
|
"doctor": "father doctor",
|
|
40
39
|
"lint": "eslint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
40
|
+
"lint:md": "remark . --quiet --frail --output",
|
|
41
|
+
"lint:style": "stylelint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
41
42
|
"prepare": "husky install && npm run setup",
|
|
42
43
|
"prepublishOnly": "father doctor && npm run build",
|
|
43
44
|
"prettier": "prettier -c --write \"**/**\"",
|
|
44
45
|
"release": "semantic-release",
|
|
45
46
|
"setup": "dumi setup",
|
|
46
47
|
"start": "dumi dev",
|
|
47
|
-
"stylelint": "stylelint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
48
48
|
"test": "vitest --passWithNoTests",
|
|
49
49
|
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
50
50
|
"test:update": "vitest -u",
|
|
51
51
|
"type-check": "tsc -p tsconfig-check.json"
|
|
52
52
|
},
|
|
53
53
|
"lint-staged": {
|
|
54
|
-
"*.
|
|
54
|
+
"*.md": [
|
|
55
|
+
"remark --quiet --output --",
|
|
56
|
+
"prettier --write --no-error-on-unmatched-pattern"
|
|
57
|
+
],
|
|
58
|
+
"*.json": [
|
|
55
59
|
"prettier --write --no-error-on-unmatched-pattern"
|
|
56
60
|
],
|
|
57
61
|
"*.{js,jsx}": [
|
|
58
|
-
"
|
|
62
|
+
"prettier --write",
|
|
59
63
|
"stylelint --fix",
|
|
60
|
-
"
|
|
64
|
+
"eslint --fix"
|
|
61
65
|
],
|
|
62
66
|
"*.{ts,tsx}": [
|
|
63
|
-
"
|
|
67
|
+
"prettier --parser=typescript --write",
|
|
64
68
|
"stylelint --fix",
|
|
65
|
-
"
|
|
69
|
+
"eslint --fix"
|
|
66
70
|
]
|
|
67
71
|
},
|
|
68
72
|
"dependencies": {
|
|
@@ -71,7 +75,6 @@
|
|
|
71
75
|
"@dqbd/tiktoken": "^1",
|
|
72
76
|
"@floating-ui/react": "^0",
|
|
73
77
|
"ahooks": "^3",
|
|
74
|
-
"antd-style": "^3",
|
|
75
78
|
"chroma-js": "^2",
|
|
76
79
|
"copy-to-clipboard": "^3",
|
|
77
80
|
"dayjs": "^1",
|
|
@@ -108,6 +111,7 @@
|
|
|
108
111
|
"@umijs/lint": "^4",
|
|
109
112
|
"@vitest/coverage-c8": "latest",
|
|
110
113
|
"antd": "^5",
|
|
114
|
+
"antd-style": "^3",
|
|
111
115
|
"commitlint": "^17",
|
|
112
116
|
"commitlint-config-gitmoji": "^2",
|
|
113
117
|
"concurrently": "^8",
|
|
@@ -131,6 +135,12 @@
|
|
|
131
135
|
"prettier-plugin-packagejson": "^2",
|
|
132
136
|
"react": "^18",
|
|
133
137
|
"react-dom": "^18",
|
|
138
|
+
"remark": "^14",
|
|
139
|
+
"remark-cli": "^11",
|
|
140
|
+
"remark-lint": "^9",
|
|
141
|
+
"remark-lint-list-item-indent": "^3",
|
|
142
|
+
"remark-preset-lint-recommended": "^6",
|
|
143
|
+
"remark-toc": "^8",
|
|
134
144
|
"semantic-release": "^21",
|
|
135
145
|
"semantic-release-config-gitmoji": "^1",
|
|
136
146
|
"stylelint": "^15",
|
|
@@ -142,6 +152,7 @@
|
|
|
142
152
|
},
|
|
143
153
|
"peerDependencies": {
|
|
144
154
|
"antd": ">=5",
|
|
155
|
+
"antd-style": ">=3",
|
|
145
156
|
"react": ">=18",
|
|
146
157
|
"react-dom": ">=18"
|
|
147
158
|
},
|