@lobehub/ui 1.16.0 → 1.16.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/es/ActionIcon/index.d.ts +15 -15
- package/es/ActionIcon/index.js +7 -5
- package/es/ActionIcon/style.d.ts +1 -1
- package/es/ActionIcon/style.js +5 -3
- package/es/Avatar/index.d.ts +9 -9
- package/es/Avatar/index.js +3 -3
- package/es/Chat/store/initialState.d.ts +12 -12
- package/es/Chat/store/messageReducer.d.ts +12 -12
- package/es/Chat/store/store.d.ts +12 -12
- package/es/Chat/store/store.js +11 -9
- package/es/Chat/types.d.ts +14 -14
- package/es/Chat/utils/fetch.d.ts +1 -1
- package/es/Chat/utils/fetch.js +3 -3
- package/es/ColorScales/ScaleRow.d.ts +1 -1
- package/es/ColorScales/ScaleRow.js +3 -3
- package/es/ColorScales/index.d.ts +1 -1
- package/es/ColorScales/index.js +8 -8
- package/es/ContextMenu/MenuItem/icons.js +23 -23
- package/es/ContextMenu/MenuItem/index.d.ts +4 -4
- package/es/ContextMenu/MenuItem/index.js +6 -5
- package/es/ContextMenu/index.d.ts +4 -4
- package/es/ContextMenu/index.js +11 -17
- package/es/ContextMenu/types/menuItem.d.ts +3 -3
- package/es/Conversation/App.d.ts +5 -5
- package/es/Conversation/App.js +5 -5
- package/es/Conversation/ChatList/MessageItem/Content.js +13 -13
- package/es/Conversation/ChatList/MessageItem/Toolbar.d.ts +3 -3
- package/es/Conversation/ChatList/MessageItem/Toolbar.js +20 -23
- package/es/Conversation/ChatList/MessageItem/index.js +15 -15
- package/es/Conversation/ChatList/index.d.ts +4 -4
- package/es/Conversation/ChatList/index.js +8 -6
- package/es/Conversation/InputArea/ActionBar.js +7 -7
- package/es/Conversation/InputArea/index.js +17 -17
- package/es/Conversation/StoreUpdater.d.ts +1 -1
- package/es/Conversation/index.js +4 -2
- package/es/CopyButton/index.d.ts +10 -10
- package/es/CopyButton/index.js +10 -8
- package/es/DraggablePanel/index.d.ts +45 -44
- package/es/DraggablePanel/index.js +11 -10
- package/es/EditableMessage/index.d.ts +23 -23
- package/es/EditableMessage/index.js +15 -15
- package/es/EditableMessageList/index.d.ts +5 -5
- package/es/EditableMessageList/index.js +16 -16
- package/es/EditableText/index.js +9 -9
- package/es/Highlighter/SyntaxHighlighter/Prism.d.ts +1 -1
- package/es/Highlighter/SyntaxHighlighter/Prism.js +4 -2
- package/es/Highlighter/SyntaxHighlighter/index.js +8 -8
- package/es/Highlighter/SyntaxHighlighter/style.d.ts +1 -1
- package/es/Highlighter/SyntaxHighlighter/style.js +3 -2
- package/es/Highlighter/index.d.ts +5 -5
- package/es/Highlighter/index.js +5 -5
- package/es/Icon/index.d.ts +6 -6
- package/es/Icon/index.js +3 -1
- package/es/Input/index.js +7 -5
- package/es/List/ListItem/index.d.ts +21 -21
- package/es/List/ListItem/index.js +13 -11
- package/es/List/ListItem/time.js +1 -1
- package/es/Logo/Divider.js +4 -2
- package/es/Logo/Logo3D.js +3 -1
- package/es/Logo/LogoFlat.js +46 -44
- package/es/Logo/LogoHighContrast.js +7 -5
- package/es/Logo/LogoText.js +6 -4
- package/es/Logo/index.d.ts +5 -5
- package/es/Logo/index.js +3 -1
- package/es/Markdown/Code.js +1 -1
- package/es/Markdown/CodeBlock.js +4 -4
- package/es/MessageInput/index.d.ts +10 -10
- package/es/MessageInput/index.js +12 -10
- package/es/MessageModal/index.d.ts +11 -11
- package/es/MessageModal/index.js +15 -15
- package/es/SearchBar/index.d.ts +5 -5
- package/es/SearchBar/index.js +19 -17
- package/es/SideNav/index.d.ts +5 -5
- package/es/SideNav/index.js +9 -7
- package/es/Snippet/index.d.ts +5 -5
- package/es/Snippet/index.js +5 -3
- package/es/StroyBook/index.d.ts +2 -2
- package/es/StroyBook/index.js +7 -5
- package/es/StroyBook/style.d.ts +1 -1
- package/es/Swatches/index.d.ts +4 -4
- package/es/Swatches/index.js +7 -7
- package/es/TabsNav/index.d.ts +6 -6
- package/es/TabsNav/index.js +3 -1
- package/es/ThemeProvider/GlobalStyle.js +5 -2
- package/es/ThemeProvider/index.d.ts +6 -6
- package/es/ThemeProvider/index.js +3 -3
- package/es/ThemeSwitch/index.d.ts +5 -5
- package/es/ThemeSwitch/index.js +11 -9
- package/es/Tooltip/index.js +5 -3
- package/es/components/ControlInput.d.ts +1 -1
- package/es/components/ControlInput.js +20 -18
- package/es/hooks/useHighlight.d.ts +8 -8
- package/es/hooks/useHighlight.js +4 -4
- package/es/styles/algorithms/generateColorPalette.d.ts +4 -4
- package/es/styles/algorithms/generateCustomStylish.d.ts +1 -1
- package/es/styles/algorithms/generateCustomStylish.js +1 -1
- package/es/styles/algorithms/generateCustomToken.d.ts +1 -1
- package/es/styles/algorithms/generateCustomToken.js +3 -2
- package/es/styles/algorithms/generateTheme.js +3 -1
- package/es/styles/colors.d.ts +13 -13
- package/es/styles/colors.js +1 -1
- package/es/styles/theme/dark.js +3 -1
- package/es/styles/theme/light.js +3 -1
- package/es/types/customStylish.d.ts +4 -4
- package/es/types/customToken.d.ts +5 -5
- package/es/types/global.d.ts +2 -0
- package/package.json +71 -68
package/es/ThemeSwitch/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["size", "themeMode", "onThemeSwitch"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
4
6
|
import { ActionIcon, Icon } from "./..";
|
|
5
7
|
import { Dropdown } from 'antd';
|
|
6
8
|
import { Monitor, Moon, Sun } from 'lucide-react';
|
|
@@ -14,22 +16,22 @@ var icons = {
|
|
|
14
16
|
var items = [{
|
|
15
17
|
label: 'System',
|
|
16
18
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
icon: icons.auto,
|
|
20
|
+
size: "small"
|
|
19
21
|
}),
|
|
20
22
|
key: 'auto'
|
|
21
23
|
}, {
|
|
22
24
|
label: 'Light',
|
|
23
25
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
icon: icons.light,
|
|
27
|
+
size: "small"
|
|
26
28
|
}),
|
|
27
29
|
key: 'light'
|
|
28
30
|
}, {
|
|
29
31
|
label: 'Dark',
|
|
30
32
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
icon: icons.dark,
|
|
34
|
+
size: "small"
|
|
33
35
|
}),
|
|
34
36
|
key: 'dark'
|
|
35
37
|
}];
|
|
@@ -50,8 +52,8 @@ var ThemeSwitch = /*#__PURE__*/memo(function (_ref) {
|
|
|
50
52
|
trigger: ['click']
|
|
51
53
|
}, props), {}, {
|
|
52
54
|
children: /*#__PURE__*/_jsx(ActionIcon, {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
icon: icons[themeMode],
|
|
56
|
+
size: size
|
|
55
57
|
})
|
|
56
58
|
}));
|
|
57
59
|
});
|
package/es/Tooltip/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["className", "arrow"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
4
6
|
import { Tooltip as AntdTooltip } from 'antd';
|
|
5
7
|
import { memo } from 'react';
|
|
6
8
|
import { useStyles } from "./style";
|
|
@@ -14,8 +16,8 @@ var Tooltip = /*#__PURE__*/memo(function (_ref) {
|
|
|
14
16
|
styles = _useStyles.styles,
|
|
15
17
|
cx = _useStyles.cx;
|
|
16
18
|
return /*#__PURE__*/_jsx(AntdTooltip, _objectSpread({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
arrow: arrow,
|
|
20
|
+
overlayClassName: cx(styles.tooltip, className)
|
|
19
21
|
}, props));
|
|
20
22
|
});
|
|
21
23
|
export default Tooltip;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { InputProps } from "../index";
|
|
3
3
|
export interface ControlInputProps extends Omit<InputProps, 'onChange' | 'value' | 'onAbort'> {
|
|
4
4
|
onChange?: (value: string) => void;
|
|
5
|
+
onChangeEnd?: (value: string) => void;
|
|
5
6
|
onValueChanging?: (value: string) => void;
|
|
6
7
|
value?: string;
|
|
7
|
-
onChangeEnd?: (value: string) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare const ControlInput: import("react").NamedExoticComponent<ControlInputProps>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["value", "onChange", "onValueChanging", "onChangeEnd"];
|
|
5
|
-
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
6
7
|
import { ConfigProvider, Space } from 'antd';
|
|
7
8
|
import { RotateCcw, Save } from 'lucide-react';
|
|
8
9
|
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
10
|
+
import { ActionIcon, Input } from "./..";
|
|
9
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
13
|
export var ControlInput = /*#__PURE__*/memo(function (_ref) {
|
|
@@ -30,16 +32,6 @@ export var ControlInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
30
32
|
return /*#__PURE__*/_jsx(Input, _objectSpread(_objectSpread({
|
|
31
33
|
ref: inputRef
|
|
32
34
|
}, props), {}, {
|
|
33
|
-
value: input,
|
|
34
|
-
onCompositionStart: function onCompositionStart() {
|
|
35
|
-
isChineseInput.current = true;
|
|
36
|
-
},
|
|
37
|
-
onCompositionEnd: function onCompositionEnd() {
|
|
38
|
-
isChineseInput.current = false;
|
|
39
|
-
},
|
|
40
|
-
onFocus: function onFocus() {
|
|
41
|
-
isFocusing.current = true;
|
|
42
|
-
},
|
|
43
35
|
onBlur: function onBlur() {
|
|
44
36
|
isFocusing.current = false;
|
|
45
37
|
onChangeEnd === null || onChangeEnd === void 0 ? void 0 : onChangeEnd(input);
|
|
@@ -48,6 +40,15 @@ export var ControlInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
48
40
|
setInput(e.target.value);
|
|
49
41
|
onValueChanging === null || onValueChanging === void 0 ? void 0 : onValueChanging(e.target.value);
|
|
50
42
|
},
|
|
43
|
+
onCompositionEnd: function onCompositionEnd() {
|
|
44
|
+
isChineseInput.current = false;
|
|
45
|
+
},
|
|
46
|
+
onCompositionStart: function onCompositionStart() {
|
|
47
|
+
isChineseInput.current = true;
|
|
48
|
+
},
|
|
49
|
+
onFocus: function onFocus() {
|
|
50
|
+
isFocusing.current = true;
|
|
51
|
+
},
|
|
51
52
|
onPressEnter: function onPressEnter(e) {
|
|
52
53
|
if (!e.shiftKey && !isChineseInput.current) {
|
|
53
54
|
e.preventDefault();
|
|
@@ -65,19 +66,20 @@ export var ControlInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
65
66
|
children: /*#__PURE__*/_jsxs(Space, {
|
|
66
67
|
size: 2,
|
|
67
68
|
children: [/*#__PURE__*/_jsx(ActionIcon, {
|
|
68
|
-
title: "Reset",
|
|
69
69
|
icon: RotateCcw,
|
|
70
|
-
size: "small",
|
|
71
70
|
onClick: function onClick() {
|
|
72
71
|
setInput(value);
|
|
73
|
-
}
|
|
72
|
+
},
|
|
73
|
+
size: "small",
|
|
74
|
+
title: "Reset"
|
|
74
75
|
}), /*#__PURE__*/_jsx(ActionIcon, {
|
|
75
|
-
title: "\u2705 Save",
|
|
76
76
|
icon: Save,
|
|
77
|
+
onClick: updateValue,
|
|
77
78
|
size: "small",
|
|
78
|
-
|
|
79
|
+
title: "\u2705 Save"
|
|
79
80
|
})]
|
|
80
81
|
})
|
|
81
|
-
})
|
|
82
|
+
}),
|
|
83
|
+
value: input
|
|
82
84
|
}));
|
|
83
85
|
});
|
|
@@ -4,6 +4,14 @@ export declare const languageMap: readonly ["javascript", "js", "jsx", "json", "
|
|
|
4
4
|
* @title 代码高亮的存储对象
|
|
5
5
|
*/
|
|
6
6
|
interface Store {
|
|
7
|
+
/**
|
|
8
|
+
* @title 将代码转化为 HTML 字符串
|
|
9
|
+
* @param text - 代码文本
|
|
10
|
+
* @param language - 代码语言
|
|
11
|
+
* @param isDarkMode - 是否为暗黑模式
|
|
12
|
+
* @returns HTML 字符串
|
|
13
|
+
*/
|
|
14
|
+
codeToHtml: (text: string, language: string, isDarkMode: boolean) => string;
|
|
7
15
|
/**
|
|
8
16
|
* @title 高亮器对象
|
|
9
17
|
*/
|
|
@@ -13,14 +21,6 @@ interface Store {
|
|
|
13
21
|
* @returns 初始化 Promise 对象
|
|
14
22
|
*/
|
|
15
23
|
initHighlighter: () => Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* @title 将代码转化为 HTML 字符串
|
|
18
|
-
* @param text - 代码文本
|
|
19
|
-
* @param language - 代码语言
|
|
20
|
-
* @param isDarkMode - 是否为暗黑模式
|
|
21
|
-
* @returns HTML 字符串
|
|
22
|
-
*/
|
|
23
|
-
codeToHtml: (text: string, language: string, isDarkMode: boolean) => string;
|
|
24
24
|
}
|
|
25
25
|
export declare const useHighlight: import("zustand").UseBoundStore<import("zustand").StoreApi<Store>>;
|
|
26
26
|
export {};
|
package/es/hooks/useHighlight.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
3
|
import { getHighlighter } from 'shiki-es';
|
|
5
4
|
import { create } from 'zustand';
|
|
5
|
+
import { themeConfig } from "../Highlighter/theme";
|
|
6
6
|
export var languageMap = ['javascript', 'js', 'jsx', 'json', 'markdown', 'md', 'less', 'css', 'typescript', 'ts', 'tsx', 'diff', 'bash'];
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -13,9 +13,9 @@ export var useHighlight = create(function (set, get) {
|
|
|
13
13
|
return {
|
|
14
14
|
highlighter: undefined,
|
|
15
15
|
initHighlighter: function () {
|
|
16
|
-
var _initHighlighter = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
16
|
+
var _initHighlighter = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
17
17
|
var highlighter;
|
|
18
|
-
return _regeneratorRuntime
|
|
18
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
19
19
|
while (1) switch (_context.prev = _context.next) {
|
|
20
20
|
case 0:
|
|
21
21
|
if (get().highlighter) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ColorScaleItem } from "../colors";
|
|
2
1
|
import { AliasToken } from 'antd/es/theme/interface';
|
|
2
|
+
import { ColorScaleItem } from "../colors";
|
|
3
3
|
export declare const generateColorPalette: ({ type, scale, appearance, }: {
|
|
4
|
-
type: 'Primary' | 'Success' | 'Warning' | 'Error' | 'Info' | string;
|
|
5
|
-
scale: ColorScaleItem;
|
|
6
4
|
appearance: 'light' | 'dark';
|
|
5
|
+
scale: ColorScaleItem;
|
|
6
|
+
type: 'Primary' | 'Success' | 'Warning' | 'Error' | 'Info' | string;
|
|
7
7
|
}) => Partial<AliasToken>;
|
|
8
8
|
export declare const generateColorNeutralPalette: ({ scale, appearance, }: {
|
|
9
|
-
scale: ColorScaleItem;
|
|
10
9
|
appearance: 'light' | 'dark';
|
|
10
|
+
scale: ColorScaleItem;
|
|
11
11
|
}) => Partial<AliasToken>;
|
|
@@ -13,7 +13,7 @@ export var generateCustomStylish = function generateCustomStylish(_ref) {
|
|
|
13
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
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
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: blur(
|
|
16
|
+
blur: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))),
|
|
17
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)
|
|
18
18
|
};
|
|
19
19
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
|
|
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
|
+
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
5
|
import { camelCase } from 'lodash';
|
|
6
|
+
import { colorScales } from "../colors";
|
|
6
7
|
var generateColorPalette = function generateColorPalette(_ref) {
|
|
7
8
|
var _ref2;
|
|
8
9
|
var name = _ref.name,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
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; }
|
|
2
4
|
import darkBaseToken from "../theme/dark";
|
|
3
5
|
import lightBaseToken from "../theme/light";
|
|
4
6
|
export var lightTheme = {
|
package/es/styles/colors.d.ts
CHANGED
|
@@ -14,26 +14,26 @@ declare type colorStep = [
|
|
|
14
14
|
string
|
|
15
15
|
];
|
|
16
16
|
export interface ColorScaleItem {
|
|
17
|
-
light: colorStep;
|
|
18
|
-
lightA: colorStep;
|
|
19
17
|
dark: colorStep;
|
|
20
18
|
darkA: colorStep;
|
|
19
|
+
light: colorStep;
|
|
20
|
+
lightA: colorStep;
|
|
21
21
|
}
|
|
22
22
|
export interface ColorScales {
|
|
23
|
-
red: ColorScaleItem;
|
|
24
|
-
volcano: ColorScaleItem;
|
|
25
|
-
orange: ColorScaleItem;
|
|
26
|
-
gold: ColorScaleItem;
|
|
27
|
-
yellow: ColorScaleItem;
|
|
28
|
-
lime: ColorScaleItem;
|
|
29
|
-
green: ColorScaleItem;
|
|
30
|
-
cyan: ColorScaleItem;
|
|
31
23
|
blue: ColorScaleItem;
|
|
24
|
+
bnw: ColorScaleItem;
|
|
25
|
+
cyan: ColorScaleItem;
|
|
32
26
|
geekblue: ColorScaleItem;
|
|
33
|
-
|
|
34
|
-
magenta: ColorScaleItem;
|
|
27
|
+
gold: ColorScaleItem;
|
|
35
28
|
gray: ColorScaleItem;
|
|
36
|
-
|
|
29
|
+
green: ColorScaleItem;
|
|
30
|
+
lime: ColorScaleItem;
|
|
31
|
+
magenta: ColorScaleItem;
|
|
32
|
+
orange: ColorScaleItem;
|
|
33
|
+
purple: ColorScaleItem;
|
|
34
|
+
red: ColorScaleItem;
|
|
35
|
+
volcano: ColorScaleItem;
|
|
36
|
+
yellow: ColorScaleItem;
|
|
37
37
|
}
|
|
38
38
|
export declare const colorScales: ColorScales;
|
|
39
39
|
export {};
|
package/es/styles/colors.js
CHANGED
|
@@ -75,7 +75,7 @@ export var colorScales = {
|
|
|
75
75
|
light: ['#ffffff', '#f8f8f8', '#eeeeee', '#e3e3e3', '#dddddd', '#cccccc', '#bbbbbb', '#aaaaaa', '#999999', '#888888', '#666666', '#333333', '#080808'],
|
|
76
76
|
lightA: ['rgba(0, 0, 0, 0.015)', 'rgba(0, 0, 0, 0.03)', 'rgba(0, 0, 0, 0.06)', 'rgba(0, 0, 0, 0.12)', 'rgba(0, 0, 0, 0.18)', 'rgba(0, 0, 0, 0.24)', 'rgba(0, 0, 0, 0.32)', 'rgba(0, 0, 0, 0.38)', 'rgba(0, 0, 0, 0.44)', 'rgba(0, 0, 0, 0.5)', 'rgba(0, 0, 0, 0.68)', 'rgba(0, 0, 0, 0.84)', 'rgba(0, 0, 0, 0.98)'],
|
|
77
77
|
dark: ['#000000', '#111111', '#222222', '#2d2d2d', '#333333', '#444444', '#555555', '#666666', '#6f6f6f', '#777777', '#aaaaaa', '#dddddd', '#ffffff'],
|
|
78
|
-
darkA: ['rgba(255, 255, 255, 0.02)', 'rgba(255, 255, 255, 0.
|
|
78
|
+
darkA: ['rgba(255, 255, 255, 0.02)', 'rgba(255, 255, 255, 0.06)', 'rgba(255, 255, 255, 0.10)', 'rgba(255, 255, 255, 0.16)', 'rgba(255, 255, 255, 0.24)', 'rgba(255, 255, 255, 0.28)', 'rgba(255, 255, 255, 0.32)', 'rgba(255, 255, 255, 0.38)', 'rgba(255, 255, 255, 0.44)', 'rgba(255, 255, 255, 0.5)', 'rgba(255, 255, 255, 0.66)', 'rgba(255, 255, 255, 0.84)', '#ffffff']
|
|
79
79
|
},
|
|
80
80
|
bnw: {
|
|
81
81
|
light: ['#ffffff', '#f5f5f5', '#eeeeee', '#cccccc', '#aaaaaa', '#888888', '#666666', '#444444', '#333333', '#222222', '#111111', '#111111', '#111111'],
|
package/es/styles/theme/dark.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
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; }
|
|
2
4
|
import { generateColorNeutralPalette, generateColorPalette } from "../algorithms/generateColorPalette";
|
|
3
5
|
import { colorScales } from "../colors";
|
|
4
6
|
import { baseToken } from "./base";
|
package/es/styles/theme/light.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
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; }
|
|
2
4
|
import { generateColorNeutralPalette, generateColorPalette } from "../algorithms/generateColorPalette";
|
|
3
5
|
import { colorScales } from "../colors";
|
|
4
6
|
import { baseToken } from "./base";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export interface LobeCustomStylish {
|
|
2
|
+
blur: string;
|
|
2
3
|
clickableText: string;
|
|
3
|
-
resetLinkColor: string;
|
|
4
4
|
|
|
5
|
+
heroBlurBall: string;
|
|
5
6
|
heroButtonGradient: string;
|
|
6
|
-
heroGradient: string;
|
|
7
7
|
|
|
8
|
+
heroGradient: string;
|
|
8
9
|
heroGradientFlow: string;
|
|
9
|
-
heroBlurBall: string;
|
|
10
10
|
|
|
11
11
|
iconGradientDefault: string;
|
|
12
|
-
blur: string;
|
|
13
12
|
markdown: string;
|
|
13
|
+
resetLinkColor: string;
|
|
14
14
|
}
|
|
@@ -46,14 +46,14 @@ export type ColorPalettesAlpha = {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export interface LobeCustomToken extends ColorToken, ColorPalettes, ColorPalettesAlpha {
|
|
49
|
-
headerHeight: number;
|
|
50
|
-
footerHeight: number;
|
|
51
|
-
sidebarWidth: number;
|
|
52
|
-
tocWidth: number;
|
|
53
|
-
contentMaxWidth: number;
|
|
54
49
|
colorSolid: string;
|
|
50
|
+
contentMaxWidth: number;
|
|
51
|
+
footerHeight: number;
|
|
55
52
|
gradientColor1: string;
|
|
56
53
|
gradientColor2: string;
|
|
57
54
|
gradientColor3: string;
|
|
58
55
|
gradientHeroBgG: string;
|
|
56
|
+
headerHeight: number;
|
|
57
|
+
sidebarWidth: number;
|
|
58
|
+
tocWidth: number;
|
|
59
59
|
}
|
package/es/types/global.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.2",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building chatbot web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"dev:theme": "npm run dev --prefix=packages/dumi-theme-lobehub",
|
|
38
38
|
"docs:build": "npm run build:theme && dumi build",
|
|
39
39
|
"doctor": "father doctor",
|
|
40
|
-
"lint": "eslint \"{src,
|
|
41
|
-
"lint:fix": "
|
|
40
|
+
"lint": "eslint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\"",
|
|
41
|
+
"lint:fix": "eslint \"{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,
|
|
48
|
+
"stylelint": "stylelint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
49
49
|
"test": "vitest --passWithNoTests",
|
|
50
50
|
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
51
51
|
"test:update": "vitest -u",
|
|
@@ -67,75 +67,78 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@ant-design/icons": "^5
|
|
71
|
-
"@babel/runtime": "^7
|
|
72
|
-
"@dqbd/tiktoken": "^1
|
|
73
|
-
"@floating-ui/react": "^0
|
|
74
|
-
"ahooks": "^3
|
|
75
|
-
"antd-style": "^3
|
|
76
|
-
"chroma-js": "^2
|
|
77
|
-
"copy-to-clipboard": "^3
|
|
78
|
-
"dayjs": "^1
|
|
79
|
-
"fast-deep-equal": "^3
|
|
80
|
-
"immer": "^10
|
|
81
|
-
"leva": "^0
|
|
82
|
-
"lodash": "^4
|
|
70
|
+
"@ant-design/icons": "^5",
|
|
71
|
+
"@babel/runtime": "^7",
|
|
72
|
+
"@dqbd/tiktoken": "^1",
|
|
73
|
+
"@floating-ui/react": "^0",
|
|
74
|
+
"ahooks": "^3",
|
|
75
|
+
"antd-style": "^3",
|
|
76
|
+
"chroma-js": "^2",
|
|
77
|
+
"copy-to-clipboard": "^3",
|
|
78
|
+
"dayjs": "^1",
|
|
79
|
+
"fast-deep-equal": "^3",
|
|
80
|
+
"immer": "^10",
|
|
81
|
+
"leva": "^0",
|
|
82
|
+
"lodash": "^4",
|
|
83
83
|
"lucide-react": "latest",
|
|
84
|
-
"pangu": "^4
|
|
85
|
-
"polished": "^4
|
|
86
|
-
"prism-react-renderer": "^2
|
|
87
|
-
"re-resizable": "^6
|
|
88
|
-
"react-font-loader": "^2
|
|
89
|
-
"react-layout-kit": "^1
|
|
90
|
-
"react-markdown": "^8
|
|
91
|
-
"react-rnd": "^10
|
|
92
|
-
"remark-gfm": "^3
|
|
93
|
-
"shiki-es": "^0
|
|
94
|
-
"styled-components": "
|
|
95
|
-
"ts-md5": "^1
|
|
96
|
-
"use-merge-value": "^1
|
|
97
|
-
"zustand": "^4
|
|
98
|
-
"zustand-utils": "^1
|
|
84
|
+
"pangu": "^4",
|
|
85
|
+
"polished": "^4",
|
|
86
|
+
"prism-react-renderer": "^2",
|
|
87
|
+
"re-resizable": "^6",
|
|
88
|
+
"react-font-loader": "^2",
|
|
89
|
+
"react-layout-kit": "^1",
|
|
90
|
+
"react-markdown": "^8",
|
|
91
|
+
"react-rnd": "^10",
|
|
92
|
+
"remark-gfm": "^3",
|
|
93
|
+
"shiki-es": "^0",
|
|
94
|
+
"styled-components": "beta",
|
|
95
|
+
"ts-md5": "^1",
|
|
96
|
+
"use-merge-value": "^1",
|
|
97
|
+
"zustand": "^4",
|
|
98
|
+
"zustand-utils": "^1"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@ant-design/colors": "^7
|
|
102
|
-
"@commitlint/cli": "^17
|
|
103
|
-
"@testing-library/react": "^14
|
|
104
|
-
"@types/chroma-js": "^2
|
|
105
|
-
"@types/lodash": "^4
|
|
106
|
-
"@types/pangu": "^4
|
|
107
|
-
"@types/react": "^18
|
|
108
|
-
"@types/react-dom": "^18
|
|
109
|
-
"@umijs/lint": "^4
|
|
101
|
+
"@ant-design/colors": "^7",
|
|
102
|
+
"@commitlint/cli": "^17",
|
|
103
|
+
"@testing-library/react": "^14",
|
|
104
|
+
"@types/chroma-js": "^2",
|
|
105
|
+
"@types/lodash": "^4",
|
|
106
|
+
"@types/pangu": "^4",
|
|
107
|
+
"@types/react": "^18",
|
|
108
|
+
"@types/react-dom": "^18",
|
|
109
|
+
"@umijs/lint": "^4",
|
|
110
110
|
"@vitest/coverage-c8": "latest",
|
|
111
|
-
"antd": "^5
|
|
112
|
-
"commitlint": "^17
|
|
113
|
-
"commitlint-config-gitmoji": "^2
|
|
114
|
-
"concurrently": "^8
|
|
115
|
-
"cross-env": "^7
|
|
116
|
-
"dumi": "^2
|
|
117
|
-
"dumi-assets-types": "^1
|
|
111
|
+
"antd": "^5",
|
|
112
|
+
"commitlint": "^17",
|
|
113
|
+
"commitlint-config-gitmoji": "^2",
|
|
114
|
+
"concurrently": "^8",
|
|
115
|
+
"cross-env": "^7",
|
|
116
|
+
"dumi": "^2",
|
|
117
|
+
"dumi-assets-types": "^1",
|
|
118
118
|
"dumi-theme-lobehub": "workspace:latest",
|
|
119
|
-
"eslint": "^8
|
|
120
|
-
"eslint-import-resolver-alias": "^1
|
|
121
|
-
"eslint-import-resolver-typescript": "^3
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"stylelint
|
|
138
|
-
"
|
|
119
|
+
"eslint": "^8",
|
|
120
|
+
"eslint-import-resolver-alias": "^1",
|
|
121
|
+
"eslint-import-resolver-typescript": "^3",
|
|
122
|
+
"eslint-plugin-import": "^2",
|
|
123
|
+
"eslint-plugin-simple-import-sort": "^10",
|
|
124
|
+
"eslint-plugin-typescript-sort-keys": "^2",
|
|
125
|
+
"father": "^4",
|
|
126
|
+
"husky": "^8",
|
|
127
|
+
"jsdom": "^22",
|
|
128
|
+
"lint-staged": "^13",
|
|
129
|
+
"postcss-styled-syntax": "^0",
|
|
130
|
+
"prettier": "^2",
|
|
131
|
+
"prettier-plugin-organize-imports": "^3",
|
|
132
|
+
"prettier-plugin-packagejson": "^2",
|
|
133
|
+
"react": "^18",
|
|
134
|
+
"react-dom": "^18",
|
|
135
|
+
"semantic-release": "^21",
|
|
136
|
+
"semantic-release-config-gitmoji": "^1",
|
|
137
|
+
"stylelint": "^15",
|
|
138
|
+
"stylelint-config-clean-order": "^5",
|
|
139
|
+
"stylelint-config-recommended": "^12",
|
|
140
|
+
"stylelint-order": "^6",
|
|
141
|
+
"typescript": "^5",
|
|
139
142
|
"vitest": "latest"
|
|
140
143
|
},
|
|
141
144
|
"peerDependencies": {
|