@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/MessageInput/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
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
|
+
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
5
|
import { Button } from 'antd';
|
|
5
6
|
import { cx } from 'antd-style';
|
|
6
7
|
import { memo, useState } from 'react';
|
|
7
8
|
import { Flexbox } from 'react-layout-kit';
|
|
9
|
+
import { TextArea } from "./..";
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* @title MessageInputProps
|
|
@@ -29,16 +31,16 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
29
31
|
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
30
32
|
gap: 8,
|
|
31
33
|
children: [/*#__PURE__*/_jsx(TextArea, {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
className: cx('nowheel', className),
|
|
35
|
+
onChange: function onChange(e) {
|
|
36
|
+
setRole(e.target.value);
|
|
37
|
+
},
|
|
34
38
|
placeholder: '例如:你是一名擅长翻译的翻译官,请将用户所输入的英文都翻译为中文。',
|
|
35
39
|
style: {
|
|
36
40
|
height: height !== null && height !== void 0 ? height : 200
|
|
37
41
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
className: cx('nowheel', className)
|
|
42
|
+
type: type,
|
|
43
|
+
value: tempSystemRole
|
|
42
44
|
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
43
45
|
direction: 'horizontal-reverse',
|
|
44
46
|
gap: 8,
|
|
@@ -46,14 +48,14 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
46
48
|
return /*#__PURE__*/_jsx(Button, _objectSpread({}, buttonProps), index);
|
|
47
49
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
48
50
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
49
|
-
type: "primary",
|
|
50
51
|
onClick: function onClick() {
|
|
51
52
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(tempSystemRole);
|
|
52
53
|
},
|
|
54
|
+
type: "primary",
|
|
53
55
|
children: "Confirm"
|
|
54
56
|
}), /*#__PURE__*/_jsx(Button, {
|
|
55
|
-
type: "text",
|
|
56
57
|
onClick: onCancel,
|
|
58
|
+
type: "text",
|
|
57
59
|
children: "Cancel"
|
|
58
60
|
})]
|
|
59
61
|
})
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface MessageModalProps {
|
|
3
|
-
/**
|
|
4
|
-
* @description Whether the modal is open or not
|
|
5
|
-
* @default false
|
|
6
|
-
*/
|
|
7
|
-
open?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* @description Callback fired when open state is changed
|
|
10
|
-
*/
|
|
11
|
-
onOpenChange?: (open: boolean) => void;
|
|
12
3
|
/**
|
|
13
4
|
* @description Whether the message is being edited or not
|
|
14
5
|
* @default false
|
|
15
6
|
*/
|
|
16
7
|
editing?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @description Callback fired when message content is changed
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (text: string) => void;
|
|
17
12
|
/**
|
|
18
13
|
* @description Callback fired when editing state is changed
|
|
19
14
|
*/
|
|
20
15
|
onEditingChange?: (editing: boolean) => void;
|
|
21
16
|
/**
|
|
22
|
-
* @description Callback fired when
|
|
17
|
+
* @description Callback fired when open state is changed
|
|
23
18
|
*/
|
|
24
|
-
|
|
19
|
+
onOpenChange?: (open: boolean) => void;
|
|
20
|
+
/**
|
|
21
|
+
* @description Whether the modal is open or not
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
open?: boolean;
|
|
25
25
|
/**
|
|
26
26
|
* @description The value of the message content
|
|
27
27
|
*/
|
package/es/MessageModal/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import Markdown from "../Markdown";
|
|
3
|
-
import MessageInput from "../MessageInput";
|
|
4
2
|
import { AimOutlined } from '@ant-design/icons';
|
|
5
3
|
import { Modal } from 'antd';
|
|
6
4
|
import { memo } from 'react';
|
|
7
5
|
import { Flexbox } from 'react-layout-kit';
|
|
8
6
|
import useControlledState from 'use-merge-value';
|
|
7
|
+
import Markdown from "../Markdown";
|
|
8
|
+
import MessageInput from "../MessageInput";
|
|
9
9
|
import { useStyles } from "./style";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -33,34 +33,34 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
33
33
|
expand = _useControlledState4[0],
|
|
34
34
|
setExpand = _useControlledState4[1];
|
|
35
35
|
return /*#__PURE__*/_jsx(Modal, {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
cancelText: '关闭',
|
|
37
|
+
className: styles.modal,
|
|
38
|
+
footer: isEdit ? null : undefined,
|
|
39
|
+
okText: '编辑',
|
|
38
40
|
onCancel: function onCancel() {
|
|
39
41
|
return setExpand(false);
|
|
40
42
|
},
|
|
41
|
-
okText: '编辑',
|
|
42
43
|
onOk: function onOk() {
|
|
43
44
|
setTyping(true);
|
|
44
45
|
},
|
|
45
|
-
|
|
46
|
-
cancelText: '关闭',
|
|
46
|
+
open: expand,
|
|
47
47
|
title: /*#__PURE__*/_jsxs(Flexbox, {
|
|
48
|
-
horizontal: true,
|
|
49
48
|
align: 'center',
|
|
50
49
|
gap: 4,
|
|
50
|
+
horizontal: true,
|
|
51
51
|
children: [/*#__PURE__*/_jsx(AimOutlined, {}), "\u63D0\u793A\u8BCD"]
|
|
52
52
|
}),
|
|
53
|
-
|
|
53
|
+
width: 800,
|
|
54
54
|
children: isEdit ? /*#__PURE__*/_jsx(MessageInput, {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(text);
|
|
58
|
-
},
|
|
55
|
+
defaultValue: value,
|
|
56
|
+
height: 400,
|
|
59
57
|
onCancel: function onCancel() {
|
|
60
58
|
return setTyping(false);
|
|
61
59
|
},
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
onConfirm: function onConfirm(text) {
|
|
61
|
+
setTyping(false);
|
|
62
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(text);
|
|
63
|
+
}
|
|
64
64
|
}) : /*#__PURE__*/_jsx(Markdown, {
|
|
65
65
|
className: styles.body,
|
|
66
66
|
children: value
|
package/es/SearchBar/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputProps } from "../index";
|
|
3
3
|
export interface SearchBarProps extends InputProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description The shortcut key to focus on the input. Only works if `enableShortKey` is true
|
|
6
|
-
* @default 'f'
|
|
7
|
-
*/
|
|
8
|
-
shortKey?: string;
|
|
9
4
|
/**
|
|
10
5
|
* @description Whether to enable the shortcut key to focus on the input
|
|
11
6
|
* @default false
|
|
12
7
|
*/
|
|
13
8
|
enableShortKey?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @description The shortcut key to focus on the input. Only works if `enableShortKey` is true
|
|
11
|
+
* @default 'f'
|
|
12
|
+
*/
|
|
13
|
+
shortKey?: string;
|
|
14
14
|
}
|
|
15
15
|
declare const SearchBar: import("react").NamedExoticComponent<SearchBarProps>;
|
|
16
16
|
export default SearchBar;
|
package/es/SearchBar/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
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 = ["className", "value", "onChange", "placeholder", "enableShortKey", "shortKey"];
|
|
5
5
|
var _navigator;
|
|
6
|
-
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
7
8
|
import { Tag } from 'antd';
|
|
8
9
|
import { Search } from 'lucide-react';
|
|
9
10
|
import { memo, useEffect, useRef, useState } from 'react';
|
|
11
|
+
import { Icon, Input } from "./..";
|
|
10
12
|
import { useStyles } from "./style";
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -50,19 +52,11 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
50
52
|
return /*#__PURE__*/_jsxs("div", {
|
|
51
53
|
className: styles.search,
|
|
52
54
|
children: [/*#__PURE__*/_jsx(Input, _objectSpread({
|
|
53
|
-
ref: inputRef,
|
|
54
|
-
className: cx(styles.input, className),
|
|
55
|
-
prefix: /*#__PURE__*/_jsx(Icon, {
|
|
56
|
-
className: styles.icon,
|
|
57
|
-
icon: Search,
|
|
58
|
-
size: "small",
|
|
59
|
-
style: {
|
|
60
|
-
marginRight: 4
|
|
61
|
-
}
|
|
62
|
-
}),
|
|
63
55
|
allowClear: true,
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
className: cx(styles.input, className),
|
|
57
|
+
onBlur: function onBlur() {
|
|
58
|
+
return setShowTag(true);
|
|
59
|
+
},
|
|
66
60
|
onChange: function onChange(e) {
|
|
67
61
|
setInputValue(e.target.value);
|
|
68
62
|
setShowTag(e.target.value ? false : true);
|
|
@@ -71,9 +65,17 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
71
65
|
onFocus: function onFocus() {
|
|
72
66
|
return setShowTag(false);
|
|
73
67
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Type keywords...',
|
|
69
|
+
prefix: /*#__PURE__*/_jsx(Icon, {
|
|
70
|
+
className: styles.icon,
|
|
71
|
+
icon: Search,
|
|
72
|
+
size: "small",
|
|
73
|
+
style: {
|
|
74
|
+
marginRight: 4
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
ref: inputRef,
|
|
78
|
+
value: value
|
|
77
79
|
}, props)), enableShortKey && showTag && !inputValue && /*#__PURE__*/_jsxs(Tag, {
|
|
78
80
|
className: styles.tag,
|
|
79
81
|
children: [symbol, " ", shortKey.toUpperCase()]
|
package/es/SideNav/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { DivProps } from "../types";
|
|
2
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { DivProps } from "../types";
|
|
3
3
|
export interface SideNavProps extends DivProps {
|
|
4
4
|
/**
|
|
5
5
|
* @description Avatar to be displayed at the top of the sidenav
|
|
6
6
|
*/
|
|
7
7
|
avatar?: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* @description Actions to be displayed below the avatar
|
|
10
|
-
*/
|
|
11
|
-
topActions?: ReactNode;
|
|
12
8
|
/**
|
|
13
9
|
* @description Actions to be displayed at the bottom of the sidenav
|
|
14
10
|
*/
|
|
15
11
|
bottomActions: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* @description Actions to be displayed below the avatar
|
|
14
|
+
*/
|
|
15
|
+
topActions?: ReactNode;
|
|
16
16
|
}
|
|
17
17
|
declare const SideNav: import("react").NamedExoticComponent<SideNavProps>;
|
|
18
18
|
export default SideNav;
|
package/es/SideNav/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", "avatar", "topActions", "bottomActions"];
|
|
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 { Space } from 'antd';
|
|
5
7
|
import { memo } from 'react';
|
|
6
8
|
import { useStyles } from "./style";
|
|
@@ -19,19 +21,19 @@ var SideNav = /*#__PURE__*/memo(function (_ref) {
|
|
|
19
21
|
className: cx(styles, className)
|
|
20
22
|
}, props), {}, {
|
|
21
23
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
22
|
-
size: 16,
|
|
23
|
-
direction: "vertical",
|
|
24
24
|
align: "center",
|
|
25
|
+
direction: "vertical",
|
|
26
|
+
size: 16,
|
|
25
27
|
children: [avatar, /*#__PURE__*/_jsx(Space, {
|
|
26
|
-
size: 8,
|
|
27
|
-
direction: "vertical",
|
|
28
28
|
align: "center",
|
|
29
|
+
direction: "vertical",
|
|
30
|
+
size: 8,
|
|
29
31
|
children: topActions
|
|
30
32
|
})]
|
|
31
33
|
}), /*#__PURE__*/_jsx(Space, {
|
|
32
|
-
size: 4,
|
|
33
|
-
direction: "vertical",
|
|
34
34
|
align: "center",
|
|
35
|
+
direction: "vertical",
|
|
36
|
+
size: 4,
|
|
35
37
|
children: bottomActions
|
|
36
38
|
})]
|
|
37
39
|
}));
|
package/es/Snippet/index.d.ts
CHANGED
|
@@ -6,19 +6,19 @@ export interface SnippetProps extends DivProps {
|
|
|
6
6
|
*/
|
|
7
7
|
children: string;
|
|
8
8
|
/**
|
|
9
|
-
* @description
|
|
9
|
+
* @description Whether the Snippet component is copyable or not
|
|
10
|
+
* @default true
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
copyable?: boolean;
|
|
12
13
|
/**
|
|
13
14
|
* @description The language of the content inside the Snippet component
|
|
14
15
|
* @default 'tsx'
|
|
15
16
|
*/
|
|
16
17
|
language?: string;
|
|
17
18
|
/**
|
|
18
|
-
* @description
|
|
19
|
-
* @default true
|
|
19
|
+
* @description The symbol to be displayed before the content inside the Snippet component
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
symbol?: string;
|
|
22
22
|
/**
|
|
23
23
|
* @description The type of the Snippet component
|
|
24
24
|
* @default 'ghost'
|
package/es/Snippet/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 = ["symbol", "language", "children", "copyable", "type"];
|
|
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 { memo } from 'react';
|
|
5
7
|
import CopyButton from "../CopyButton";
|
|
6
8
|
import { SyntaxHighlighter } from "../Highlighter";
|
|
@@ -26,11 +28,11 @@ var Snippet = /*#__PURE__*/memo(function (_ref) {
|
|
|
26
28
|
language: language,
|
|
27
29
|
children: [symbol, children].filter(Boolean).join(' ')
|
|
28
30
|
}), copyable && /*#__PURE__*/_jsx(CopyButton, {
|
|
31
|
+
content: children,
|
|
29
32
|
size: {
|
|
30
33
|
fontSize: 14,
|
|
31
34
|
blockSize: 24
|
|
32
|
-
}
|
|
33
|
-
content: children
|
|
35
|
+
}
|
|
34
36
|
})]
|
|
35
37
|
}));
|
|
36
38
|
});
|
package/es/StroyBook/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DivProps } from "../types";
|
|
3
2
|
import { useControls, useCreateStore } from 'leva';
|
|
4
|
-
|
|
3
|
+
import { DivProps } from "../types";
|
|
4
|
+
export { useControls, useCreateStore };
|
|
5
5
|
export interface StroyBookProps extends DivProps {
|
|
6
6
|
/**
|
|
7
7
|
* @description The Leva store instance to be used by the component
|
package/es/StroyBook/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 = ["levaStore", "noPadding", "className", "children"];
|
|
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 { useResponsive } from 'antd-style';
|
|
5
7
|
import { LevaPanel, useControls, useCreateStore } from 'leva';
|
|
6
8
|
import { memo } from 'react';
|
|
@@ -8,7 +10,7 @@ import DraggablePanel from "../DraggablePanel";
|
|
|
8
10
|
import { useStyles } from "./style";
|
|
9
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
export {
|
|
13
|
+
export { useControls, useCreateStore };
|
|
12
14
|
export var StroyBook = /*#__PURE__*/memo(function (_ref) {
|
|
13
15
|
var levaStore = _ref.levaStore,
|
|
14
16
|
noPadding = _ref.noPadding,
|
|
@@ -31,15 +33,15 @@ export var StroyBook = /*#__PURE__*/memo(function (_ref) {
|
|
|
31
33
|
children: children
|
|
32
34
|
}), /*#__PURE__*/_jsx(DraggablePanel, {
|
|
33
35
|
className: styles.right,
|
|
34
|
-
placement: mobile ? 'bottom' : 'right',
|
|
35
36
|
minWidth: 280,
|
|
37
|
+
placement: mobile ? 'bottom' : 'right',
|
|
36
38
|
children: /*#__PURE__*/_jsxs("div", {
|
|
37
39
|
className: styles.leva,
|
|
38
40
|
children: [/*#__PURE__*/_jsx(LevaPanel, {
|
|
39
41
|
fill: true,
|
|
42
|
+
flat: true,
|
|
40
43
|
store: levaStore,
|
|
41
|
-
titleBar: false
|
|
42
|
-
flat: true
|
|
44
|
+
titleBar: false
|
|
43
45
|
}), ' ']
|
|
44
46
|
})
|
|
45
47
|
})]
|
package/es/StroyBook/style.d.ts
CHANGED
package/es/Swatches/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface SwatchesProps {
|
|
3
|
-
/**
|
|
4
|
-
* @description An array of colors to be displayed as swatches
|
|
5
|
-
*/
|
|
6
|
-
colors: string[];
|
|
7
3
|
/**
|
|
8
4
|
* @description The currently active color
|
|
9
5
|
* @default undefined
|
|
10
6
|
*/
|
|
11
7
|
activeColor?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description An array of colors to be displayed as swatches
|
|
10
|
+
*/
|
|
11
|
+
colors: string[];
|
|
12
12
|
/**
|
|
13
13
|
* @description A function to be called when a swatch is selected
|
|
14
14
|
* @default undefined
|
package/es/Swatches/index.js
CHANGED
|
@@ -9,9 +9,12 @@ var Swatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
9
9
|
onSelect = _ref.onSelect;
|
|
10
10
|
var theme = useTheme();
|
|
11
11
|
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
12
|
-
horizontal: true,
|
|
13
12
|
gap: 8,
|
|
13
|
+
horizontal: true,
|
|
14
14
|
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
15
|
+
onClick: function onClick() {
|
|
16
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(null);
|
|
17
|
+
},
|
|
15
18
|
style: {
|
|
16
19
|
width: 24,
|
|
17
20
|
height: 24,
|
|
@@ -19,13 +22,13 @@ var Swatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
19
22
|
boxShadow: "inset 0 0 0px 2px ".concat(!activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)'),
|
|
20
23
|
borderRadius: '50%',
|
|
21
24
|
cursor: 'pointer'
|
|
22
|
-
},
|
|
23
|
-
onClick: function onClick() {
|
|
24
|
-
onSelect === null || onSelect === void 0 ? void 0 : onSelect(null);
|
|
25
25
|
}
|
|
26
26
|
}), colors.map(function (c) {
|
|
27
27
|
var borderColor = c === activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)';
|
|
28
28
|
return /*#__PURE__*/_jsx(Flexbox, {
|
|
29
|
+
onClick: function onClick() {
|
|
30
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(c);
|
|
31
|
+
},
|
|
29
32
|
style: {
|
|
30
33
|
width: 24,
|
|
31
34
|
height: 24,
|
|
@@ -33,9 +36,6 @@ var Swatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
33
36
|
boxShadow: "inset 0 0 0px 2px ".concat(borderColor),
|
|
34
37
|
borderRadius: '50%',
|
|
35
38
|
cursor: 'pointer'
|
|
36
|
-
},
|
|
37
|
-
onClick: function onClick() {
|
|
38
|
-
onSelect === null || onSelect === void 0 ? void 0 : onSelect(c);
|
|
39
39
|
}
|
|
40
40
|
}, c);
|
|
41
41
|
})]
|
package/es/TabsNav/index.d.ts
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import { TabsProps } from 'antd';
|
|
3
3
|
export interface TabsNavProps {
|
|
4
4
|
/**
|
|
5
|
-
* @description
|
|
5
|
+
* @description The key of the active tab
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
activeKey?: TabsProps['activeKey'];
|
|
8
8
|
/**
|
|
9
|
-
* @description
|
|
9
|
+
* @description Additional className to apply to the component
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
className?: string;
|
|
12
12
|
/**
|
|
13
13
|
* @description An array of objects representing the tabs to be rendered
|
|
14
14
|
*/
|
|
15
15
|
items?: TabsProps['items'];
|
|
16
16
|
/**
|
|
17
|
-
* @description
|
|
17
|
+
* @description Callback function that is triggered when a tab is changed
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
onChange?: (activeKey: string) => void;
|
|
20
20
|
}
|
|
21
21
|
declare const TabsNav: import("react").NamedExoticComponent<TabsNavProps>;
|
|
22
22
|
export default TabsNav;
|
package/es/TabsNav/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"];
|
|
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 { Tabs } from 'antd';
|
|
5
7
|
import { memo } from 'react';
|
|
6
8
|
import { useStyles } from "./style";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { createGlobalStyle } from 'antd-style';
|
|
4
|
-
var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n html,body {\n --font-settings: \"cv01\", \"tnum\", \"kern\";\n --font-variations: \"opsz\" auto, tabular-nums;\n\n overflow-x: hidden;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n font-size: ", "px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n line-height: 1;\n color: ", ";\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n vertical-align: baseline;\n\n color-scheme: dark;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-tap-highlight-color: transparent;\n }\n\n\n * {\n
|
|
4
|
+
var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n html,body {\n --font-settings: \"cv01\", \"tnum\", \"kern\";\n --font-variations: \"opsz\" auto, tabular-nums;\n\n overflow-x: hidden;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n font-size: ", "px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n line-height: 1;\n color: ", ";\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n vertical-align: baseline;\n\n color-scheme: dark;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-tap-highlight-color: transparent;\n }\n \n\n * {\n\t box-sizing: border-box;\n\t vertical-align: baseline;\n }\n\n ::-webkit-scrollbar {\n\t width: 0;\n\t height: 4px;\n\t background-color: transparent;\n\n\t &-thumb {\n\t\t background-color: transparent;\n\t\t border-radius: 4px;\n\t\t transition: background-color 500ms ", ";\n\t }\n\n\t &-corner {\n\t\t display: none;\n\t }\n }\n\n #root {\n\t min-height: 100vh;\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n \n code {\n\t font-family: ", " !important;\n\t * {\n\t\t font-family: inherit !important;\n\t }\n }\n\n *:hover, *:focus {\n\t ::-webkit-scrollbar {\n\t\t &-thumb {\n\t\t\t background-color: ", ";\n\t\t }\n\t }\n }\n"])), function (_ref) {
|
|
5
5
|
var theme = _ref.theme;
|
|
6
6
|
return theme.fontFamily;
|
|
7
7
|
}, function (_ref2) {
|
|
@@ -15,9 +15,12 @@ var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _tagge
|
|
|
15
15
|
return theme.colorBgLayout;
|
|
16
16
|
}, function (_ref5) {
|
|
17
17
|
var theme = _ref5.theme;
|
|
18
|
-
return theme.
|
|
18
|
+
return theme.motionEaseOut;
|
|
19
19
|
}, function (_ref6) {
|
|
20
20
|
var theme = _ref6.theme;
|
|
21
21
|
return theme.fontFamilyCode;
|
|
22
|
+
}, function (_ref7) {
|
|
23
|
+
var theme = _ref7.theme;
|
|
24
|
+
return theme.colorFill;
|
|
22
25
|
});
|
|
23
26
|
export default GlobalStyle;
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import { extractStaticStyle, type ThemeMode } from 'antd-style';
|
|
3
3
|
export interface ThemeProviderProps {
|
|
4
4
|
/**
|
|
5
|
-
* @description
|
|
5
|
+
* @description Cache for the extracted static styles
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
cache?: typeof extractStaticStyle.cache;
|
|
8
8
|
/**
|
|
9
|
-
* @description The
|
|
9
|
+
* @description The children of the ThemeProvider component
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
children: React.ReactNode;
|
|
12
12
|
/**
|
|
13
13
|
* @description Whether to inline the styles on server-side rendering or not
|
|
14
14
|
*/
|
|
15
15
|
ssrInline?: boolean;
|
|
16
16
|
/**
|
|
17
|
-
* @description
|
|
17
|
+
* @description The mode of the theme (light or dark)
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
themeMode?: ThemeMode;
|
|
20
20
|
}
|
|
21
21
|
declare const ThemeProvider: import("react").NamedExoticComponent<ThemeProviderProps>;
|
|
22
22
|
export default ThemeProvider;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { lobeCustomStylish, lobeCustomToken, lobeTheme } from "../styles";
|
|
2
1
|
import { App } from 'antd';
|
|
3
2
|
import { ThemeProvider as AntdThemeProvider, StyleProvider, setupStyled } from 'antd-style';
|
|
4
3
|
import { memo } from 'react';
|
|
5
4
|
// @ts-ignore
|
|
6
5
|
import ReactFontLoader from 'react-font-loader';
|
|
7
6
|
import { ThemeContext } from 'styled-components';
|
|
7
|
+
import { lobeCustomStylish, lobeCustomToken, lobeTheme } from "../styles";
|
|
8
8
|
import GlobalStyle from "./GlobalStyle";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -17,10 +17,10 @@ var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
|
|
|
17
17
|
return /*#__PURE__*/_jsx(StyleProvider, {
|
|
18
18
|
speedy: process.env.NODE_ENV === 'production',
|
|
19
19
|
children: /*#__PURE__*/_jsxs(AntdThemeProvider, {
|
|
20
|
-
themeMode: themeMode,
|
|
21
|
-
theme: lobeTheme,
|
|
22
20
|
customStylish: lobeCustomStylish,
|
|
23
21
|
customToken: lobeCustomToken,
|
|
22
|
+
theme: lobeTheme,
|
|
23
|
+
themeMode: themeMode,
|
|
24
24
|
children: [/*#__PURE__*/_jsx(ReactFontLoader, {
|
|
25
25
|
url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css"
|
|
26
26
|
}), /*#__PURE__*/_jsx(ReactFontLoader, {
|
|
@@ -3,6 +3,11 @@ import { type ActionIconSize } from "..";
|
|
|
3
3
|
import { ThemeMode } from 'antd-style';
|
|
4
4
|
import { DivProps } from "../types";
|
|
5
5
|
export interface ThemeSwitchProps extends DivProps {
|
|
6
|
+
/**
|
|
7
|
+
* @description Callback function when the theme mode is switched
|
|
8
|
+
* @type {(themeMode: ThemeMode) => void}
|
|
9
|
+
*/
|
|
10
|
+
onThemeSwitch: (themeMode: ThemeMode) => void;
|
|
6
11
|
/**
|
|
7
12
|
* @description Size of the action icon
|
|
8
13
|
* @default {
|
|
@@ -17,11 +22,6 @@ export interface ThemeSwitchProps extends DivProps {
|
|
|
17
22
|
* @type ThemeMode
|
|
18
23
|
*/
|
|
19
24
|
themeMode: ThemeMode;
|
|
20
|
-
/**
|
|
21
|
-
* @description Callback function when the theme mode is switched
|
|
22
|
-
* @type {(themeMode: ThemeMode) => void}
|
|
23
|
-
*/
|
|
24
|
-
onThemeSwitch: (themeMode: ThemeMode) => void;
|
|
25
25
|
}
|
|
26
26
|
declare const ThemeSwitch: import("react").NamedExoticComponent<ThemeSwitchProps>;
|
|
27
27
|
export default ThemeSwitch;
|