@lobehub/ui 1.26.0 → 1.26.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 +1 -1
- package/es/ActionIcon/index.js +30 -18
- package/es/Avatar/index.js +11 -11
- package/es/Chat/store/initialState.d.ts +3 -3
- package/es/Chat/store/initialState.js +4 -4
- package/es/Chat/store/messageReducer.js +71 -49
- package/es/Chat/store/selectors.d.ts +3 -3
- package/es/Chat/store/selectors.js +3 -3
- package/es/Chat/store/store.d.ts +1 -1
- package/es/Chat/store/store.js +110 -110
- package/es/Chat/types.d.ts +1 -1
- package/es/Chat/utils/fetch.d.ts +1 -1
- package/es/Chat/utils/fetch.js +4 -4
- package/es/ChatInputArea/index.js +2 -1
- package/es/ChatInputArea/style.d.ts +3 -3
- package/es/ChatInputArea/style.js +5 -5
- package/es/ChatItem/index.js +12 -10
- package/es/ChatItem/style.d.ts +3 -3
- package/es/ChatItem/style.js +7 -7
- package/es/ChatList/ActionsBar.d.ts +1 -1
- package/es/ChatList/ActionsBar.js +12 -11
- package/es/ChatList/index.d.ts +1 -1
- package/es/ChatList/index.js +1 -1
- package/es/ColorScales/ScaleRow.js +20 -14
- package/es/ColorScales/index.js +6 -4
- package/es/ColorScales/style.d.ts +2 -2
- package/es/ColorScales/style.js +7 -7
- package/es/ContextMenu/MenuItem/index.js +14 -14
- package/es/ContextMenu/MenuItem/style.d.ts +2 -2
- package/es/ContextMenu/MenuItem/style.js +5 -5
- package/es/ContextMenu/index.js +42 -42
- package/es/ContextMenu/style.d.ts +1 -1
- package/es/ContextMenu/style.js +2 -2
- package/es/Conversation/App.js +2 -2
- package/es/Conversation/ChatList/MessageItem/Content.js +15 -15
- package/es/Conversation/ChatList/MessageItem/Toolbar.js +3 -3
- package/es/Conversation/ChatList/MessageItem/index.js +14 -14
- package/es/Conversation/ChatList/index.js +5 -5
- package/es/Conversation/InputArea/ActionBar.d.ts +2 -2
- package/es/Conversation/InputArea/ActionBar.js +2 -2
- package/es/Conversation/InputArea/index.d.ts +2 -2
- package/es/Conversation/InputArea/index.js +10 -12
- package/es/Conversation/StoreUpdater.js +1 -1
- package/es/Conversation/index.js +2 -2
- package/es/CopyButton/index.d.ts +4 -2
- package/es/CopyButton/index.js +4 -3
- package/es/DraggablePanel/index.d.ts +2 -2
- package/es/DraggablePanel/index.js +50 -42
- package/es/DraggablePanel/style.d.ts +9 -9
- package/es/DraggablePanel/style.js +17 -17
- package/es/DraggablePanel/utils.js +12 -4
- package/es/EditableMessage/index.js +4 -4
- package/es/EditableMessageList/index.js +20 -19
- package/es/EditableText/index.js +1 -1
- package/es/Features/Item.js +5 -5
- package/es/Features/Item.style.d.ts +2 -2
- package/es/Features/Item.style.js +4 -4
- package/es/Features/index.js +3 -3
- package/es/Features/style.js +2 -2
- package/es/FontLoader/index.d.ts +6 -0
- package/es/FontLoader/index.js +16 -0
- package/es/Footer/index.js +2 -2
- package/es/GradientButton/style.d.ts +1 -1
- package/es/GradientButton/style.js +2 -2
- package/es/Header/index.js +2 -2
- package/es/Header/style.d.ts +1 -1
- package/es/Header/style.js +2 -2
- package/es/Hero/style.d.ts +3 -3
- package/es/Hero/style.js +14 -13
- package/es/Highlighter/SyntaxHighlighter/Prism.js +7 -7
- package/es/Highlighter/SyntaxHighlighter/index.js +1 -1
- package/es/Highlighter/SyntaxHighlighter/style.d.ts +2 -2
- package/es/Highlighter/SyntaxHighlighter/style.js +2 -2
- package/es/Highlighter/index.d.ts +1 -2
- package/es/Highlighter/index.js +4 -3
- package/es/Highlighter/style.d.ts +1 -1
- package/es/Highlighter/style.js +2 -2
- package/es/Highlighter/theme.js +22 -22
- package/es/Icon/index.js +24 -16
- package/es/Input/index.js +4 -4
- package/es/Layout/index.js +1 -1
- package/es/Layout/style.d.ts +5 -5
- package/es/Layout/style.js +7 -7
- package/es/List/ListItem/index.d.ts +1 -1
- package/es/List/ListItem/index.js +21 -42
- package/es/List/ListItem/style.d.ts +9 -0
- package/es/List/ListItem/style.js +21 -0
- package/es/List/index.d.ts +1 -1
- package/es/Logo/index.d.ts +2 -2
- package/es/Logo/index.js +48 -38
- package/es/Logo/style.d.ts +1 -1
- package/es/Logo/style.js +2 -2
- package/es/Markdown/CodeBlock.d.ts +1 -1
- package/es/Markdown/CodeBlock.js +7 -7
- package/es/Markdown/index.js +3 -3
- package/es/Markdown/style.d.ts +1 -1
- package/es/Markdown/style.js +2 -2
- package/es/MessageInput/index.d.ts +1 -1
- package/es/MessageInput/index.js +5 -5
- package/es/MessageModal/index.js +8 -6
- package/es/MessageModal/style.d.ts +1 -1
- package/es/MessageModal/style.js +2 -2
- package/es/SearchBar/index.d.ts +1 -1
- package/es/SearchBar/index.js +13 -11
- package/es/SearchBar/style.d.ts +2 -2
- package/es/SearchBar/style.js +3 -3
- package/es/Snippet/index.js +5 -3
- package/es/Spotlight/index.js +13 -13
- package/es/Spotlight/style.js +1 -1
- package/es/StroyBook/index.d.ts +1 -2
- package/es/StroyBook/index.js +3 -3
- package/es/StroyBook/style.d.ts +1 -1
- package/es/StroyBook/style.js +2 -2
- package/es/Swatches/index.d.ts +1 -1
- package/es/Swatches/index.js +9 -9
- package/es/ThemeProvider/index.d.ts +2 -2
- package/es/ThemeProvider/index.js +3 -4
- package/es/ThemeSwitch/index.js +8 -8
- package/es/Toc/TocMobile.d.ts +4 -4
- package/es/Toc/TocMobile.js +15 -15
- package/es/Toc/style.d.ts +2 -2
- package/es/Toc/style.js +3 -3
- package/es/TokenTag/style.js +12 -7
- package/es/components/ControlInput.d.ts +1 -1
- package/es/components/ControlInput.js +7 -6
- package/es/hooks/useHighlight.js +14 -14
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/styles/algorithms/generateColorPalette.js +10 -10
- package/es/styles/algorithms/generateCustomStylish.js +5 -5
- package/es/styles/algorithms/generateCustomToken.js +42 -17
- package/es/styles/algorithms/generateTheme.js +4 -4
- package/es/styles/colors.js +65 -65
- package/es/styles/theme/base.js +2 -2
- package/es/styles/theme/dark.js +16 -16
- package/es/styles/theme/light.js +16 -16
- package/es/types/llm.d.ts +1 -1
- package/package.json +3 -3
|
@@ -4,9 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
import { App } from 'antd';
|
|
5
5
|
import { ThemeProvider as AntdThemeProvider, StyleProvider, setupStyled } from 'antd-style';
|
|
6
6
|
import { memo } from 'react';
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
import ReactFontLoader from 'react-font-loader';
|
|
9
7
|
import { ThemeContext } from 'styled-components';
|
|
8
|
+
import FontLoader from "../FontLoader";
|
|
10
9
|
import { lobeCustomStylish, lobeCustomToken, lobeTheme } from "../styles";
|
|
11
10
|
import GlobalStyle from "./GlobalStyle";
|
|
12
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -36,9 +35,9 @@ var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
|
|
|
36
35
|
},
|
|
37
36
|
theme: lobeTheme,
|
|
38
37
|
themeMode: themeMode,
|
|
39
|
-
children: [/*#__PURE__*/_jsx(
|
|
38
|
+
children: [/*#__PURE__*/_jsx(FontLoader, {
|
|
40
39
|
url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css"
|
|
41
|
-
}), /*#__PURE__*/_jsx(
|
|
40
|
+
}), /*#__PURE__*/_jsx(FontLoader, {
|
|
42
41
|
url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans_sc.css"
|
|
43
42
|
}), /*#__PURE__*/_jsx(GlobalStyle, {}), /*#__PURE__*/_jsx(App, {
|
|
44
43
|
style: {
|
package/es/ThemeSwitch/index.js
CHANGED
|
@@ -10,30 +10,30 @@ import { memo } from 'react';
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
var icons = {
|
|
12
12
|
auto: Monitor,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
dark: Moon,
|
|
14
|
+
light: Sun
|
|
15
15
|
};
|
|
16
16
|
var items = [{
|
|
17
|
-
label: 'System',
|
|
18
17
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
19
18
|
icon: icons.auto,
|
|
20
19
|
size: "small"
|
|
21
20
|
}),
|
|
22
|
-
key: 'auto'
|
|
21
|
+
key: 'auto',
|
|
22
|
+
label: 'System'
|
|
23
23
|
}, {
|
|
24
|
-
label: 'Light',
|
|
25
24
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
26
25
|
icon: icons.light,
|
|
27
26
|
size: "small"
|
|
28
27
|
}),
|
|
29
|
-
key: 'light'
|
|
28
|
+
key: 'light',
|
|
29
|
+
label: 'Light'
|
|
30
30
|
}, {
|
|
31
|
-
label: 'Dark',
|
|
32
31
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
33
32
|
icon: icons.dark,
|
|
34
33
|
size: "small"
|
|
35
34
|
}),
|
|
36
|
-
key: 'dark'
|
|
35
|
+
key: 'dark',
|
|
36
|
+
label: 'Dark'
|
|
37
37
|
}];
|
|
38
38
|
var ThemeSwitch = /*#__PURE__*/memo(function (_ref) {
|
|
39
39
|
var _ref$size = _ref.size,
|
package/es/Toc/TocMobile.d.ts
CHANGED
|
@@ -14,14 +14,14 @@ export interface TocMobileProps {
|
|
|
14
14
|
tocWidth?: number;
|
|
15
15
|
}
|
|
16
16
|
export declare const mapItems: (items: AnchorItem[]) => {
|
|
17
|
-
href: string;
|
|
18
|
-
title: string;
|
|
19
|
-
key: string;
|
|
20
17
|
children: {
|
|
21
18
|
href: string;
|
|
22
|
-
title: string;
|
|
23
19
|
key: string;
|
|
20
|
+
title: string;
|
|
24
21
|
}[] | undefined;
|
|
22
|
+
href: string;
|
|
23
|
+
key: string;
|
|
24
|
+
title: string;
|
|
25
25
|
}[];
|
|
26
26
|
declare const TocMobile: import("react").NamedExoticComponent<TocMobileProps>;
|
|
27
27
|
export default TocMobile;
|
package/es/Toc/TocMobile.js
CHANGED
|
@@ -10,16 +10,16 @@ export var mapItems = function mapItems(items) {
|
|
|
10
10
|
return items.map(function (item) {
|
|
11
11
|
var _item$children;
|
|
12
12
|
return {
|
|
13
|
-
href: "#".concat(item.id),
|
|
14
|
-
title: item.title,
|
|
15
|
-
key: item.id,
|
|
16
13
|
children: (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.map(function (child) {
|
|
17
14
|
return {
|
|
18
15
|
href: "#".concat(child.id),
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
key: child.id,
|
|
17
|
+
title: child === null || child === void 0 ? void 0 : child.title
|
|
21
18
|
};
|
|
22
|
-
})
|
|
19
|
+
}),
|
|
20
|
+
href: "#".concat(item.id),
|
|
21
|
+
key: item.id,
|
|
22
|
+
title: item.title
|
|
23
23
|
};
|
|
24
24
|
});
|
|
25
25
|
};
|
|
@@ -33,8 +33,8 @@ var TocMobile = /*#__PURE__*/memo(function (_ref) {
|
|
|
33
33
|
_ref$tocWidth = _ref.tocWidth,
|
|
34
34
|
tocWidth = _ref$tocWidth === void 0 ? 176 : _ref$tocWidth;
|
|
35
35
|
var _useControlledState = useControlledState('', {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
onChange: onChange,
|
|
37
|
+
value: activeKey
|
|
38
38
|
}),
|
|
39
39
|
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
40
40
|
activeLink = _useControlledState2[0],
|
|
@@ -64,18 +64,18 @@ var TocMobile = /*#__PURE__*/memo(function (_ref) {
|
|
|
64
64
|
return isActive ? /*#__PURE__*/_jsx(ActionIcon, {
|
|
65
65
|
icon: PanelTopClose,
|
|
66
66
|
size: {
|
|
67
|
-
fontSize: 16,
|
|
68
|
-
strokeWidth: 1,
|
|
69
67
|
blockSize: 24,
|
|
70
|
-
borderRadius: 3
|
|
68
|
+
borderRadius: 3,
|
|
69
|
+
fontSize: 16,
|
|
70
|
+
strokeWidth: 1
|
|
71
71
|
}
|
|
72
72
|
}) : /*#__PURE__*/_jsx(ActionIcon, {
|
|
73
73
|
icon: PanelTopOpen,
|
|
74
74
|
size: {
|
|
75
|
-
fontSize: 16,
|
|
76
|
-
strokeWidth: 1,
|
|
77
75
|
blockSize: 24,
|
|
78
|
-
borderRadius: 3
|
|
76
|
+
borderRadius: 3,
|
|
77
|
+
fontSize: 16,
|
|
78
|
+
strokeWidth: 1
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
},
|
|
@@ -83,7 +83,7 @@ var TocMobile = /*#__PURE__*/memo(function (_ref) {
|
|
|
83
83
|
ghost: true,
|
|
84
84
|
children: /*#__PURE__*/_jsx(Collapse.Panel, {
|
|
85
85
|
forceRender: true,
|
|
86
|
-
header:
|
|
86
|
+
header: activeAnchor ? activeAnchor.title : 'TOC',
|
|
87
87
|
children: /*#__PURE__*/_jsx(ConfigProvider, {
|
|
88
88
|
theme: {
|
|
89
89
|
token: {
|
package/es/Toc/style.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export declare const useStyles: (props?: {
|
|
|
2
2
|
headerHeight: number;
|
|
3
3
|
tocWidth: number;
|
|
4
4
|
} | undefined) => import("antd-style").ReturnStyles<{
|
|
5
|
+
anchor: string;
|
|
5
6
|
container: import("antd-style").SerializedStyles;
|
|
6
|
-
mobileCtn: import("antd-style").SerializedStyles;
|
|
7
7
|
expand: string;
|
|
8
|
-
|
|
8
|
+
mobileCtn: import("antd-style").SerializedStyles;
|
|
9
9
|
}>;
|
package/es/Toc/style.js
CHANGED
|
@@ -12,9 +12,9 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
12
12
|
headerHeight = _ref2.headerHeight;
|
|
13
13
|
var fixHeight = 36;
|
|
14
14
|
return {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
anchor: cx(stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-x: hidden;\n overflow-y: auto;\n max-height: 60vh !important;\n "])))),
|
|
16
|
+
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: sticky;\n top: ", "px;\n\n overscroll-behavior: contain;\n grid-area: toc;\n\n width: ", "px;\n margin-inline-end: 24px;\n\n border-radius: 3px;\n\n -webkit-overflow-scrolling: touch;\n\n ", " {\n position: relative;\n left: 0;\n width: 100%;\n margin-top: 0;\n }\n\n > h4 {\n margin: 0 0 8px;\n font-size: 12px;\n line-height: 1;\n color: ", ";\n }\n "])), headerHeight + 64, tocWidth, responsive.mobile, token.colorTextDescription),
|
|
17
17
|
expand: cx(stylish.blur, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n\n background-color: ", ";\n border-bottom: 1px solid ", ";\n border-radius: 0;\n box-shadow: ", ";\n\n .ant-collapse-content {\n overflow: auto;\n }\n\n .ant-collapse-header {\n z-index: 10;\n padding: 8px 16px !important;\n\n &[aria-expanded='true'] {\n box-shadow: ", ";\n }\n }\n "])), rgba(token.colorBgLayout, 0.5), token.colorSplit, token.boxShadowSecondary, token.boxShadowSecondary)),
|
|
18
|
-
|
|
18
|
+
mobileCtn: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n height: ", "px;\n\n .ant-collapse-expand-icon {\n color: ", ";\n }\n "])), fixHeight, token.colorTextQuaternary)
|
|
19
19
|
};
|
|
20
20
|
});
|
package/es/TokenTag/style.js
CHANGED
|
@@ -10,15 +10,20 @@ export var useStyles = createStyles(function (_ref, type) {
|
|
|
10
10
|
var percentStyle;
|
|
11
11
|
switch (type) {
|
|
12
12
|
case 'normal':
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
{
|
|
14
|
+
percentStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorSuccessText);
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
15
17
|
case 'low':
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
{
|
|
19
|
+
percentStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorWarningText);
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
18
22
|
case 'overload':
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
{
|
|
24
|
+
percentStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorErrorText);
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
return {
|
|
24
29
|
container: cx(percentStyle, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: flex;\n gap: 4px;\n align-items: center;\n\n height: ", "px;\n padding: 0 ", "px 0 ", "px;\n\n background: ", ";\n border-radius: ", "px;\n "])), HEIGHT, HEIGHT - ICON_SIZE, (HEIGHT - ICON_SIZE) / 2, token.colorFillSecondary, HEIGHT / 2)),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { InputProps } from "../
|
|
2
|
+
import { InputProps } from "../Input";
|
|
3
3
|
export interface ControlInputProps extends Omit<InputProps, 'onChange' | 'value' | 'onAbort'> {
|
|
4
4
|
onChange?: (value: string) => void;
|
|
5
5
|
onChangeEnd?: (value: string) => void;
|
|
@@ -7,7 +7,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
import { ConfigProvider, Space } from 'antd';
|
|
8
8
|
import { RotateCcw, Save } from 'lucide-react';
|
|
9
9
|
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
10
|
-
import
|
|
10
|
+
import ActionIcon from "../ActionIcon";
|
|
11
|
+
import { Input } from "../Input";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
export var ControlInput = /*#__PURE__*/memo(function (_ref) {
|
|
@@ -15,23 +16,23 @@ export var ControlInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
15
16
|
onChange = _ref.onChange,
|
|
16
17
|
onValueChanging = _ref.onValueChanging,
|
|
17
18
|
onChangeEnd = _ref.onChangeEnd,
|
|
18
|
-
|
|
19
|
+
properties = _objectWithoutProperties(_ref, _excluded);
|
|
19
20
|
var _useState = useState(value || ''),
|
|
20
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
22
|
input = _useState2[0],
|
|
22
23
|
setInput = _useState2[1];
|
|
23
|
-
var
|
|
24
|
+
var inputReference = useRef();
|
|
24
25
|
var isChineseInput = useRef(false);
|
|
25
26
|
var isFocusing = useRef(false);
|
|
26
27
|
var updateValue = useCallback(function () {
|
|
27
28
|
onChange === null || onChange === void 0 ? void 0 : onChange(input);
|
|
28
29
|
}, [input]);
|
|
29
30
|
useEffect(function () {
|
|
30
|
-
if (
|
|
31
|
+
if (value !== undefined) setInput(value);
|
|
31
32
|
}, [value]);
|
|
32
33
|
return /*#__PURE__*/_jsx(Input, _objectSpread(_objectSpread({
|
|
33
|
-
ref:
|
|
34
|
-
},
|
|
34
|
+
ref: inputReference
|
|
35
|
+
}, properties), {}, {
|
|
35
36
|
onBlur: function onBlur() {
|
|
36
37
|
isFocusing.current = false;
|
|
37
38
|
onChangeEnd === null || onChangeEnd === void 0 ? void 0 : onChangeEnd(input);
|
package/es/hooks/useHighlight.js
CHANGED
|
@@ -11,6 +11,19 @@ export var languageMap = ['javascript', 'js', 'jsx', 'json', 'markdown', 'md', '
|
|
|
11
11
|
|
|
12
12
|
export var useHighlight = create(function (set, get) {
|
|
13
13
|
return {
|
|
14
|
+
codeToHtml: function codeToHtml(text, language, isDarkMode) {
|
|
15
|
+
var _get = get(),
|
|
16
|
+
highlighter = _get.highlighter;
|
|
17
|
+
if (!highlighter) return '';
|
|
18
|
+
try {
|
|
19
|
+
return highlighter === null || highlighter === void 0 ? void 0 : highlighter.codeToHtml(text, {
|
|
20
|
+
lang: language,
|
|
21
|
+
theme: isDarkMode ? 'dark' : 'light'
|
|
22
|
+
});
|
|
23
|
+
} catch (_unused) {
|
|
24
|
+
return text;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
14
27
|
highlighter: undefined,
|
|
15
28
|
initHighlighter: function () {
|
|
16
29
|
var _initHighlighter = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -42,19 +55,6 @@ export var useHighlight = create(function (set, get) {
|
|
|
42
55
|
return _initHighlighter.apply(this, arguments);
|
|
43
56
|
}
|
|
44
57
|
return initHighlighter;
|
|
45
|
-
}()
|
|
46
|
-
codeToHtml: function codeToHtml(text, language, isDarkMode) {
|
|
47
|
-
var _get = get(),
|
|
48
|
-
highlighter = _get.highlighter;
|
|
49
|
-
if (!highlighter) return '';
|
|
50
|
-
try {
|
|
51
|
-
return highlighter === null || highlighter === void 0 ? void 0 : highlighter.codeToHtml(text, {
|
|
52
|
-
lang: language,
|
|
53
|
-
theme: isDarkMode ? 'dark' : 'light'
|
|
54
|
-
});
|
|
55
|
-
} catch (e) {
|
|
56
|
-
return text;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
58
|
+
}()
|
|
59
59
|
};
|
|
60
60
|
});
|
package/es/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { default as EditableMessage, type EditableMessageProps } from './Editabl
|
|
|
14
14
|
export { default as EditableMessageList, type EditableMessageListProps, } from './EditableMessageList';
|
|
15
15
|
export { default as EditableText, type EditableTextProps } from './EditableText';
|
|
16
16
|
export { type FeatureItem, default as Features, type FeaturesProps } from './Features';
|
|
17
|
+
export { default as FontLoader, type FontLoaderProps } from './FontLoader';
|
|
17
18
|
export { default as Footer, type FooterProps } from './Footer';
|
|
18
19
|
export { default as GradientButton, type GradientButtonProps } from './GradientButton';
|
|
19
20
|
export { default as Header, type HeaderProps } from './Header';
|
package/es/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export { default as EditableMessage } from "./EditableMessage";
|
|
|
13
13
|
export { default as EditableMessageList } from "./EditableMessageList";
|
|
14
14
|
export { default as EditableText } from "./EditableText";
|
|
15
15
|
export { default as Features } from "./Features";
|
|
16
|
+
export { default as FontLoader } from "./FontLoader";
|
|
16
17
|
export { default as Footer } from "./Footer";
|
|
17
18
|
export { default as GradientButton } from "./GradientButton";
|
|
18
19
|
export { default as Header } from "./Header";
|
|
@@ -12,20 +12,20 @@ export var generateColorNeutralPalette = function generateColorNeutralPalette(_r
|
|
|
12
12
|
var scale = _ref3.scale,
|
|
13
13
|
appearance = _ref3.appearance;
|
|
14
14
|
return {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
colorBgContainer: appearance === 'dark' ? scale[appearance][1] : scale[appearance][0],
|
|
16
|
+
colorBgElevated: appearance === 'dark' ? scale[appearance][2] : scale[appearance][0],
|
|
17
|
+
colorBgLayout: appearance === 'dark' ? scale[appearance][0] : scale[appearance][1],
|
|
18
|
+
colorBgMask: scale.lightA[8],
|
|
19
|
+
colorBgSpotlight: scale[appearance][5],
|
|
19
20
|
colorBorder: scale[appearance][4],
|
|
20
21
|
colorBorderSecondary: scale[appearance][3],
|
|
21
22
|
colorFill: scale["".concat(appearance, "A")][3],
|
|
23
|
+
colorFillQuaternary: scale["".concat(appearance, "A")][0],
|
|
22
24
|
colorFillSecondary: scale["".concat(appearance, "A")][2],
|
|
23
25
|
colorFillTertiary: scale["".concat(appearance, "A")][1],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
colorBgSpotlight: scale[appearance][5],
|
|
29
|
-
colorBgMask: scale.lightA[8]
|
|
26
|
+
colorText: scale[appearance][12],
|
|
27
|
+
colorTextQuaternary: scale[appearance][6],
|
|
28
|
+
colorTextSecondary: scale[appearance][10],
|
|
29
|
+
colorTextTertiary: scale[appearance][8]
|
|
30
30
|
};
|
|
31
31
|
};
|
|
@@ -8,10 +8,10 @@ export var generateCustomStylish = function generateCustomStylish(_ref) {
|
|
|
8
8
|
var gradient = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n "])));
|
|
9
9
|
return {
|
|
10
10
|
blur: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
bottomScrollbar: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n background-color: ", ";\n border-radius: 4px;\n transition: background-color 500ms ", ";\n }\n\n &-corner {\n display: none;\n width: 0;\n height: 0;\n }\n }\n "])), token.colorFill, token.motionEaseOut),
|
|
12
|
+
gradientAnimation: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-image: linear-gradient(\n -45deg,\n ", ",\n ", ",\n ", ",\n ", "\n );\n background-size: 400% 400%;\n border-radius: inherit;\n animation: 5s ", " 5s ease infinite;\n "])), token.gold, token.magenta, token.geekblue, token.cyan, gradient),
|
|
13
|
+
markdown: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin-block-start: 0;\n margin-block-end: 0;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n\n + * {\n margin-block-end: 0.5em;\n }\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n\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: none;\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: 0;\n margin-inline-end: 0;\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\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n li {\n line-height: 1.8;\n\n &::marker {\n color: ", ";\n }\n }\n\n details {\n margin-bottom: 1em;\n padding: 12px 16px;\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition: all 400ms ", ";\n }\n\n details[open] {\n summary {\n padding-bottom: 12px;\n border-bottom: 1px solid ", ";\n }\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, isDarkMode ? token.cyan9A : token.cyan10A, token.colorFillTertiary, token.colorBorderSecondary, token.borderRadiusLG, token.motionEaseOut, token.colorBorder),
|
|
14
|
+
noScrollbar: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n "]))),
|
|
15
|
+
resetLinkColor: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorText)
|
|
16
16
|
};
|
|
17
17
|
};
|
|
@@ -2,6 +2,9 @@ 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
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
8
|
import { camelCase } from 'lodash-es';
|
|
6
9
|
import { colorScales } from "../colors";
|
|
7
10
|
var generateColorPalette = function generateColorPalette(_ref) {
|
|
@@ -16,18 +19,40 @@ var generateCustomColorPalette = function generateCustomColorPalette(_ref3) {
|
|
|
16
19
|
scale = _ref3.scale,
|
|
17
20
|
appearance = _ref3.appearance;
|
|
18
21
|
var colorStepPalette = {};
|
|
19
|
-
scale[appearance].
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
var _iterator = _createForOfIteratorHelper(scale[appearance].entries()),
|
|
23
|
+
_step;
|
|
24
|
+
try {
|
|
25
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
26
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
27
|
+
index = _step$value[0],
|
|
28
|
+
color = _step$value[1];
|
|
29
|
+
if (index === 0 || index === 12) continue;
|
|
30
|
+
colorStepPalette["".concat(name).concat(index)] = color;
|
|
31
|
+
}
|
|
32
|
+
} catch (err) {
|
|
33
|
+
_iterator.e(err);
|
|
34
|
+
} finally {
|
|
35
|
+
_iterator.f();
|
|
36
|
+
}
|
|
37
|
+
var _iterator2 = _createForOfIteratorHelper(scale["".concat(appearance, "A")].entries()),
|
|
38
|
+
_step2;
|
|
39
|
+
try {
|
|
40
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
41
|
+
var _step2$value = _slicedToArray(_step2.value, 2),
|
|
42
|
+
_index = _step2$value[0],
|
|
43
|
+
_color = _step2$value[1];
|
|
44
|
+
if (_index === 0 || _index === 12) continue;
|
|
45
|
+
colorStepPalette["".concat(name).concat(_index, "A")] = _color;
|
|
46
|
+
}
|
|
47
|
+
} catch (err) {
|
|
48
|
+
_iterator2.e(err);
|
|
49
|
+
} finally {
|
|
50
|
+
_iterator2.f();
|
|
51
|
+
}
|
|
27
52
|
return _objectSpread(_objectSpread({}, colorStepPalette), generateColorPalette({
|
|
53
|
+
appearance: appearance,
|
|
28
54
|
name: name,
|
|
29
|
-
scale: scale
|
|
30
|
-
appearance: appearance
|
|
55
|
+
scale: scale
|
|
31
56
|
}));
|
|
32
57
|
};
|
|
33
58
|
|
|
@@ -35,15 +60,15 @@ var generateCustomColorPalette = function generateCustomColorPalette(_ref3) {
|
|
|
35
60
|
export var generateCustomToken = function generateCustomToken(_ref4) {
|
|
36
61
|
var isDarkMode = _ref4.isDarkMode;
|
|
37
62
|
var colorCustomToken = {};
|
|
38
|
-
Object.entries(colorScales).
|
|
39
|
-
var
|
|
40
|
-
type =
|
|
41
|
-
scale =
|
|
63
|
+
for (var _i = 0, _Object$entries = Object.entries(colorScales); _i < _Object$entries.length; _i++) {
|
|
64
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
65
|
+
type = _Object$entries$_i[0],
|
|
66
|
+
scale = _Object$entries$_i[1];
|
|
42
67
|
colorCustomToken = _objectSpread(_objectSpread({}, colorCustomToken), generateCustomColorPalette({
|
|
68
|
+
appearance: isDarkMode ? 'dark' : 'light',
|
|
43
69
|
name: camelCase(type),
|
|
44
|
-
scale: scale
|
|
45
|
-
appearance: isDarkMode ? 'dark' : 'light'
|
|
70
|
+
scale: scale
|
|
46
71
|
}));
|
|
47
|
-
}
|
|
72
|
+
}
|
|
48
73
|
return colorCustomToken;
|
|
49
74
|
};
|
|
@@ -4,16 +4,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
import darkBaseToken from "../theme/dark";
|
|
5
5
|
import lightBaseToken from "../theme/light";
|
|
6
6
|
export var lightTheme = {
|
|
7
|
-
token: lightBaseToken,
|
|
8
7
|
algorithm: function algorithm(seedToken, mapToken) {
|
|
9
8
|
return _objectSpread(_objectSpread({}, mapToken), lightBaseToken);
|
|
10
|
-
}
|
|
9
|
+
},
|
|
10
|
+
token: lightBaseToken
|
|
11
11
|
};
|
|
12
12
|
export var darkTheme = {
|
|
13
|
-
token: darkBaseToken,
|
|
14
13
|
algorithm: function algorithm(seedToken, mapToken) {
|
|
15
14
|
return _objectSpread(_objectSpread({}, mapToken), darkBaseToken);
|
|
16
|
-
}
|
|
15
|
+
},
|
|
16
|
+
token: darkBaseToken
|
|
17
17
|
};
|
|
18
18
|
export var generateTheme = function generateTheme(appearance) {
|
|
19
19
|
return appearance === 'dark' ? darkTheme : lightTheme;
|