@lobehub/ui 1.4.0 → 1.5.0
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/EditableMessage/index.d.ts +43 -0
- package/es/EditableMessage/index.js +67 -0
- package/es/Markdown/CodeBlock.js +2 -1
- package/es/Markdown/index.js +2 -0
- package/es/Markdown/style.js +1 -1
- package/es/MessageModal/index.d.ts +11 -0
- package/es/MessageModal/index.js +80 -0
- package/es/ThemeProvider/GlobalStyle.js +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/styles/theme/base.js +1 -1
- package/lib/EditableMessage/index.d.ts +43 -0
- package/lib/EditableMessage/index.js +96 -0
- package/lib/Markdown/CodeBlock.js +5 -1
- package/lib/Markdown/index.js +10 -1
- package/lib/Markdown/style.js +84 -9
- package/lib/MessageModal/index.d.ts +11 -0
- package/lib/MessageModal/index.js +98 -0
- package/lib/ThemeProvider/GlobalStyle.js +0 -18
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/styles/theme/base.js +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface EditableMessageProps {
|
|
3
|
+
/**
|
|
4
|
+
* @title 当前文本值
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* @title 值改变时的回调函数
|
|
9
|
+
* @param value - 改变后的值
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* @title 是否打开模态框
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
openModal?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @title 模态框打开状态变化的回调函数
|
|
19
|
+
* @param open - 模态框是否打开
|
|
20
|
+
*/
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
/**
|
|
23
|
+
* @title 是否处于编辑状态
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
editing?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @title 编辑状态变化的回调函数
|
|
29
|
+
* @param editing - 是否处于编辑状态
|
|
30
|
+
*/
|
|
31
|
+
onEditingChange?: (editing: boolean) => void;
|
|
32
|
+
/**
|
|
33
|
+
* @title 当文本值为空时是否显示编辑按钮
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
showEditWhenEmpty?: boolean;
|
|
37
|
+
classNames?: {
|
|
38
|
+
markdown?: string;
|
|
39
|
+
input?: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
declare const EditableMessage: import("react").NamedExoticComponent<EditableMessageProps>;
|
|
43
|
+
export default EditableMessage;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import Markdown from "../Markdown";
|
|
3
|
+
import MessageInput from "../MessageInput";
|
|
4
|
+
import MessageModal from "../MessageModal";
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import useControlledState from 'use-merge-value';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
var EditableMessage = /*#__PURE__*/memo(function (_ref) {
|
|
11
|
+
var value = _ref.value,
|
|
12
|
+
_onChange = _ref.onChange,
|
|
13
|
+
_ref$classNames = _ref.classNames,
|
|
14
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
15
|
+
onEditingChange = _ref.onEditingChange,
|
|
16
|
+
editing = _ref.editing,
|
|
17
|
+
openModal = _ref.openModal,
|
|
18
|
+
onOpenChange = _ref.onOpenChange,
|
|
19
|
+
_ref$showEditWhenEmpt = _ref.showEditWhenEmpty,
|
|
20
|
+
showEditWhenEmpty = _ref$showEditWhenEmpt === void 0 ? false : _ref$showEditWhenEmpt;
|
|
21
|
+
var _useControlledState = useControlledState(false, {
|
|
22
|
+
value: editing,
|
|
23
|
+
onChange: onEditingChange
|
|
24
|
+
}),
|
|
25
|
+
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
26
|
+
isEdit = _useControlledState2[0],
|
|
27
|
+
setTyping = _useControlledState2[1];
|
|
28
|
+
var _useControlledState3 = useControlledState(false, {
|
|
29
|
+
value: openModal,
|
|
30
|
+
onChange: onOpenChange
|
|
31
|
+
}),
|
|
32
|
+
_useControlledState4 = _slicedToArray(_useControlledState3, 2),
|
|
33
|
+
expand = _useControlledState4[0],
|
|
34
|
+
setExpand = _useControlledState4[1];
|
|
35
|
+
return !value && showEditWhenEmpty ? /*#__PURE__*/_jsx(MessageInput, {
|
|
36
|
+
onConfirm: function onConfirm(text) {
|
|
37
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
|
|
38
|
+
setTyping(false);
|
|
39
|
+
},
|
|
40
|
+
className: classNames.input
|
|
41
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
42
|
+
children: [/*#__PURE__*/_jsx(MessageModal, {
|
|
43
|
+
open: expand,
|
|
44
|
+
onOpenChange: setExpand,
|
|
45
|
+
value: value,
|
|
46
|
+
editing: isEdit,
|
|
47
|
+
onEditingChange: setTyping,
|
|
48
|
+
onChange: function onChange(text) {
|
|
49
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
|
|
50
|
+
}
|
|
51
|
+
}), !expand && isEdit ? /*#__PURE__*/_jsx(MessageInput, {
|
|
52
|
+
onConfirm: function onConfirm(text) {
|
|
53
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
|
|
54
|
+
setTyping(false);
|
|
55
|
+
},
|
|
56
|
+
onCancel: function onCancel() {
|
|
57
|
+
return setTyping(false);
|
|
58
|
+
},
|
|
59
|
+
defaultValue: value,
|
|
60
|
+
className: classNames.input
|
|
61
|
+
}) : /*#__PURE__*/_jsx(Markdown, {
|
|
62
|
+
className: classNames.markdown,
|
|
63
|
+
children: value
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
export default EditableMessage;
|
package/es/Markdown/CodeBlock.js
CHANGED
|
@@ -6,7 +6,7 @@ import { memo } from 'react';
|
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
var useStyles = createStyles(function (_ref) {
|
|
8
8
|
var css = _ref.css;
|
|
9
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :not(:last-child) {\n margin-
|
|
9
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :not(:last-child) {\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n }\n "])));
|
|
10
10
|
});
|
|
11
11
|
var Code = /*#__PURE__*/memo(function (props) {
|
|
12
12
|
var _useStyles = useStyles(),
|
|
@@ -18,6 +18,7 @@ var Code = /*#__PURE__*/memo(function (props) {
|
|
|
18
18
|
className = _props$children$0$pro.className;
|
|
19
19
|
if (!children) return null;
|
|
20
20
|
return /*#__PURE__*/_jsx(Highlighter, {
|
|
21
|
+
type: "block",
|
|
21
22
|
theme: theme.appearance,
|
|
22
23
|
language: (className === null || className === void 0 ? void 0 : className.replace('language-', '')) || 'markdown',
|
|
23
24
|
className: styles,
|
package/es/Markdown/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Divider, Typography } from 'antd';
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import ReactMarkdown from 'react-markdown';
|
|
4
|
+
import remarkGfm from 'remark-gfm';
|
|
4
5
|
import { useStyles } from "./style";
|
|
5
6
|
import Code from "./Code";
|
|
6
7
|
import CodeBlock from "./CodeBlock";
|
|
@@ -21,6 +22,7 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
21
22
|
children: /*#__PURE__*/_jsx(ReactMarkdown, {
|
|
22
23
|
className: cx(styles.container, className),
|
|
23
24
|
components: components,
|
|
25
|
+
remarkPlugins: [remarkGfm],
|
|
24
26
|
children: children
|
|
25
27
|
})
|
|
26
28
|
});
|
package/es/Markdown/style.js
CHANGED
|
@@ -6,7 +6,7 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
6
6
|
token = _ref.token,
|
|
7
7
|
isDarkMode = _ref.isDarkMode;
|
|
8
8
|
return {
|
|
9
|
-
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n p {\n margin: 20px auto;\n line-height: 2;\n word-wrap: break-word;\n font-size: 14px;\n color: ", ";\n }\n\n
|
|
9
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n\n\n p {\n margin: 20px auto;\n line-height: 2;\n word-wrap: break-word;\n font-size: 14px;\n color: ", ";\n\n &:not(:last-child) {\n margin-bottom: 1em;\n }\n }\n\n // hyperlink\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 // inline code\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n color: ", ";\n background: ", ";\n border-radius: 4px;\n }\n\n\n // table\n table {\n width: 100%;\n border-spacing: 0;\n border: 1px solid ", ";\n border-radius: ", "px;\n padding: 8px;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n }\n\n th {\n\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 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 // blockquote\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n // list\n ul li {\n line-height: 1.8;\n }\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorLink, token.colorLinkHover, token.colorLinkActive, isDarkMode ? token['cyan-7'] : token.colorPrimaryText, isDarkMode ? token['cyan-1'] : token.colorPrimaryBg, token.colorBorder, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.colorTextDescription),
|
|
10
10
|
code: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 2px 4px;\n font-family: ", " !important;\n color: ", ";\n border-radius: 4px;\n "])), token.fontFamilyCode, isDarkMode ? token.cyan8 : token.pink7)
|
|
11
11
|
};
|
|
12
12
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface MessageModalProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
editing?: boolean;
|
|
6
|
+
onEditingChange?: (editing: boolean) => void;
|
|
7
|
+
onChange?: (text: string) => void;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
declare const MessageModal: import("react").NamedExoticComponent<MessageModalProps>;
|
|
11
|
+
export default MessageModal;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
import { AimOutlined } from '@ant-design/icons';
|
|
5
|
+
import { Modal } from 'antd';
|
|
6
|
+
import { createStyles } from 'antd-style';
|
|
7
|
+
import { memo } from 'react';
|
|
8
|
+
import { Flexbox } from 'react-layout-kit';
|
|
9
|
+
import useControlledState from 'use-merge-value';
|
|
10
|
+
import Markdown from "../Markdown";
|
|
11
|
+
import MessageInput from "../MessageInput";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
var useStyles = createStyles(function (_ref) {
|
|
15
|
+
var css = _ref.css,
|
|
16
|
+
prefixCls = _ref.prefixCls;
|
|
17
|
+
return {
|
|
18
|
+
modal: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 70%;\n .", "-modal-header {\n margin-bottom: 24px;\n }\n "])), prefixCls),
|
|
19
|
+
body: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow-y: scroll;\n max-height: 70vh;\n "])))
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
var MessageModal = /*#__PURE__*/memo(function (_ref2) {
|
|
23
|
+
var editing = _ref2.editing,
|
|
24
|
+
open = _ref2.open,
|
|
25
|
+
onOpenChange = _ref2.onOpenChange,
|
|
26
|
+
onEditingChange = _ref2.onEditingChange,
|
|
27
|
+
value = _ref2.value,
|
|
28
|
+
onChange = _ref2.onChange;
|
|
29
|
+
var _useStyles = useStyles(),
|
|
30
|
+
styles = _useStyles.styles;
|
|
31
|
+
var _useControlledState = useControlledState(false, {
|
|
32
|
+
value: editing,
|
|
33
|
+
onChange: onEditingChange
|
|
34
|
+
}),
|
|
35
|
+
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
36
|
+
isEdit = _useControlledState2[0],
|
|
37
|
+
setTyping = _useControlledState2[1];
|
|
38
|
+
var _useControlledState3 = useControlledState(false, {
|
|
39
|
+
value: open,
|
|
40
|
+
onChange: onOpenChange
|
|
41
|
+
}),
|
|
42
|
+
_useControlledState4 = _slicedToArray(_useControlledState3, 2),
|
|
43
|
+
expand = _useControlledState4[0],
|
|
44
|
+
setExpand = _useControlledState4[1];
|
|
45
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
46
|
+
open: expand,
|
|
47
|
+
width: 800,
|
|
48
|
+
onCancel: function onCancel() {
|
|
49
|
+
return setExpand(false);
|
|
50
|
+
},
|
|
51
|
+
okText: '编辑',
|
|
52
|
+
onOk: function onOk() {
|
|
53
|
+
setTyping(true);
|
|
54
|
+
},
|
|
55
|
+
footer: isEdit ? null : undefined,
|
|
56
|
+
cancelText: '关闭',
|
|
57
|
+
title: /*#__PURE__*/_jsxs(Flexbox, {
|
|
58
|
+
horizontal: true,
|
|
59
|
+
align: 'center',
|
|
60
|
+
gap: 4,
|
|
61
|
+
children: [/*#__PURE__*/_jsx(AimOutlined, {}), "\u63D0\u793A\u8BCD"]
|
|
62
|
+
}),
|
|
63
|
+
className: styles.modal,
|
|
64
|
+
children: isEdit ? /*#__PURE__*/_jsx(MessageInput, {
|
|
65
|
+
onConfirm: function onConfirm(text) {
|
|
66
|
+
setTyping(false);
|
|
67
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(text);
|
|
68
|
+
},
|
|
69
|
+
onCancel: function onCancel() {
|
|
70
|
+
return setTyping(false);
|
|
71
|
+
},
|
|
72
|
+
defaultValue: value,
|
|
73
|
+
height: 400
|
|
74
|
+
}) : /*#__PURE__*/_jsx(Markdown, {
|
|
75
|
+
className: styles.body,
|
|
76
|
+
children: value
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
export default MessageModal;
|
|
@@ -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 body {\n font-family: ", ";\n font-size: ", "px;\n line-height: 1;\n color: ", ";\n\n margin: 0;\n padding: 0;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n * {\n box-sizing: border-box;\n }\n\n #root {\n\t min-height: 100vh;\n }\n
|
|
4
|
+
var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n body {\n font-family: ", ";\n font-size: ", "px;\n line-height: 1;\n color: ", ";\n\n margin: 0;\n padding: 0;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n * {\n box-sizing: border-box;\n }\n\n #root {\n\t min-height: 100vh;\n }\n /* \u5B9A\u4E49\u6EDA\u52A8\u69FD\u7684\u6837\u5F0F */\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n margin-right: 4px;\n background-color: transparent; // \u5B9A\u4E49\u6EDA\u52A8\u69FD\u7684\u80CC\u666F\u8272\n\n &-thumb {\n background-color: ", "; // \u5B9A\u4E49\u6EDA\u52A8\u5757\u7684\u80CC\u666F\u8272\n border-radius: 4px; // \u5B9A\u4E49\u6EDA\u52A8\u5757\u7684\u5706\u89D2\u534A\u5F84\n }\n\n &-corner {\n display: none;\n }\n }\n"])), function (_ref) {
|
|
5
5
|
var theme = _ref.theme;
|
|
6
6
|
return theme.fontFamily;
|
|
7
7
|
}, function (_ref2) {
|
package/es/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { default as Avatar, type AvatarProps } from './Avatar';
|
|
|
3
3
|
export { default as ContextMenu, type ContextMenuProps } from './ContextMenu';
|
|
4
4
|
export { default as CopyButton, type CopyButtonProps } from './CopyButton';
|
|
5
5
|
export { default as DraggablePanel, type DraggablePanelProps } from './DraggablePanel';
|
|
6
|
+
export { default as EditableMessage, type EditableMessageProps } from './EditableMessage';
|
|
6
7
|
export { default as EditableText, type EditableTextProps } from './EditableText';
|
|
7
8
|
export { default as Highlighter, SyntaxHighlighter, type HighlighterProps, type SyntaxHighlighterProps, } from './Highlighter';
|
|
8
9
|
export { default as Icon, type IconProps, type IconSize } from './Icon';
|
|
@@ -10,6 +11,7 @@ export { default as List } from './List';
|
|
|
10
11
|
export { default as Logo, type LogoProps } from './Logo';
|
|
11
12
|
export { default as Markdown, type MarkdownProps } from './Markdown';
|
|
12
13
|
export { default as MessageInput, type MessageInputProps } from './MessageInput';
|
|
14
|
+
export { default as MessageModal, type MessageModalProps } from './MessageModal';
|
|
13
15
|
export { default as SearchBar, type SearchBarProps } from './SearchBar';
|
|
14
16
|
export { default as SideNav, type SideNavProps } from './SideNav';
|
|
15
17
|
export { default as Snippet, type SnippetProps } from './Snippet';
|
package/es/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { default as Avatar } from "./Avatar";
|
|
|
3
3
|
export { default as ContextMenu } from "./ContextMenu";
|
|
4
4
|
export { default as CopyButton } from "./CopyButton";
|
|
5
5
|
export { default as DraggablePanel } from "./DraggablePanel";
|
|
6
|
+
export { default as EditableMessage } from "./EditableMessage";
|
|
6
7
|
export { default as EditableText } from "./EditableText";
|
|
7
8
|
export { default as Highlighter, SyntaxHighlighter } from "./Highlighter";
|
|
8
9
|
export { default as Icon } from "./Icon";
|
|
@@ -10,6 +11,7 @@ export { default as List } from "./List";
|
|
|
10
11
|
export { default as Logo } from "./Logo";
|
|
11
12
|
export { default as Markdown } from "./Markdown";
|
|
12
13
|
export { default as MessageInput } from "./MessageInput";
|
|
14
|
+
export { default as MessageModal } from "./MessageModal";
|
|
13
15
|
export { default as SearchBar } from "./SearchBar";
|
|
14
16
|
export { default as SideNav } from "./SideNav";
|
|
15
17
|
export { default as Snippet } from "./Snippet";
|
package/es/styles/theme/base.js
CHANGED
|
@@ -9,7 +9,7 @@ export var baseTheme = {
|
|
|
9
9
|
borderRadiusSM: 3,
|
|
10
10
|
borderRadiusLG: 8,
|
|
11
11
|
controlHeight: 36,
|
|
12
|
-
fontFamily: "'Segoe UI', SegoeUI,
|
|
12
|
+
fontFamily: "'Segoe UI', SegoeUI, -apple-system ,BlinkMacSystemFont,Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'",
|
|
13
13
|
fontFamilyCode: "'Hack Nerd Font Mono', 'Hack', 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace"
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface EditableMessageProps {
|
|
3
|
+
/**
|
|
4
|
+
* @title 当前文本值
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* @title 值改变时的回调函数
|
|
9
|
+
* @param value - 改变后的值
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* @title 是否打开模态框
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
openModal?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @title 模态框打开状态变化的回调函数
|
|
19
|
+
* @param open - 模态框是否打开
|
|
20
|
+
*/
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
/**
|
|
23
|
+
* @title 是否处于编辑状态
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
editing?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @title 编辑状态变化的回调函数
|
|
29
|
+
* @param editing - 是否处于编辑状态
|
|
30
|
+
*/
|
|
31
|
+
onEditingChange?: (editing: boolean) => void;
|
|
32
|
+
/**
|
|
33
|
+
* @title 当文本值为空时是否显示编辑按钮
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
showEditWhenEmpty?: boolean;
|
|
37
|
+
classNames?: {
|
|
38
|
+
markdown?: string;
|
|
39
|
+
input?: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
declare const EditableMessage: import("react").NamedExoticComponent<EditableMessageProps>;
|
|
43
|
+
export default EditableMessage;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/EditableMessage/index.tsx
|
|
30
|
+
var EditableMessage_exports = {};
|
|
31
|
+
__export(EditableMessage_exports, {
|
|
32
|
+
default: () => EditableMessage_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(EditableMessage_exports);
|
|
35
|
+
var import_Markdown = __toESM(require("../Markdown"));
|
|
36
|
+
var import_MessageInput = __toESM(require("../MessageInput"));
|
|
37
|
+
var import_MessageModal = __toESM(require("../MessageModal"));
|
|
38
|
+
var import_react = require("react");
|
|
39
|
+
var import_use_merge_value = __toESM(require("use-merge-value"));
|
|
40
|
+
var EditableMessage = (0, import_react.memo)(
|
|
41
|
+
({
|
|
42
|
+
value,
|
|
43
|
+
onChange,
|
|
44
|
+
classNames = {},
|
|
45
|
+
onEditingChange,
|
|
46
|
+
editing,
|
|
47
|
+
openModal,
|
|
48
|
+
onOpenChange,
|
|
49
|
+
showEditWhenEmpty = false
|
|
50
|
+
}) => {
|
|
51
|
+
const [isEdit, setTyping] = (0, import_use_merge_value.default)(false, {
|
|
52
|
+
value: editing,
|
|
53
|
+
onChange: onEditingChange
|
|
54
|
+
});
|
|
55
|
+
const [expand, setExpand] = (0, import_use_merge_value.default)(false, {
|
|
56
|
+
value: openModal,
|
|
57
|
+
onChange: onOpenChange
|
|
58
|
+
});
|
|
59
|
+
return !value && showEditWhenEmpty ? /* @__PURE__ */ React.createElement(
|
|
60
|
+
import_MessageInput.default,
|
|
61
|
+
{
|
|
62
|
+
onConfirm: (text) => {
|
|
63
|
+
onChange == null ? void 0 : onChange(text);
|
|
64
|
+
setTyping(false);
|
|
65
|
+
},
|
|
66
|
+
className: classNames.input
|
|
67
|
+
}
|
|
68
|
+
) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
69
|
+
import_MessageModal.default,
|
|
70
|
+
{
|
|
71
|
+
open: expand,
|
|
72
|
+
onOpenChange: setExpand,
|
|
73
|
+
value,
|
|
74
|
+
editing: isEdit,
|
|
75
|
+
onEditingChange: setTyping,
|
|
76
|
+
onChange: (text) => {
|
|
77
|
+
onChange == null ? void 0 : onChange(text);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
), !expand && isEdit ? /* @__PURE__ */ React.createElement(
|
|
81
|
+
import_MessageInput.default,
|
|
82
|
+
{
|
|
83
|
+
onConfirm: (text) => {
|
|
84
|
+
onChange == null ? void 0 : onChange(text);
|
|
85
|
+
setTyping(false);
|
|
86
|
+
},
|
|
87
|
+
onCancel: () => setTyping(false),
|
|
88
|
+
defaultValue: value,
|
|
89
|
+
className: classNames.input
|
|
90
|
+
}
|
|
91
|
+
) : /* @__PURE__ */ React.createElement(import_Markdown.default, { className: classNames.markdown }, value));
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
var EditableMessage_default = EditableMessage;
|
|
95
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
+
0 && (module.exports = {});
|
|
@@ -38,7 +38,10 @@ var import_react = require("react");
|
|
|
38
38
|
var useStyles = (0, import_antd_style.createStyles)(
|
|
39
39
|
({ css }) => css`
|
|
40
40
|
:not(:last-child) {
|
|
41
|
-
margin-
|
|
41
|
+
margin-block-start: 1em;
|
|
42
|
+
margin-block-end: 1em;
|
|
43
|
+
margin-inline-start: 0px;
|
|
44
|
+
margin-inline-end: 0px;
|
|
42
45
|
}
|
|
43
46
|
`
|
|
44
47
|
);
|
|
@@ -52,6 +55,7 @@ var Code = (0, import_react.memo)((props) => {
|
|
|
52
55
|
return /* @__PURE__ */ React.createElement(
|
|
53
56
|
import_Highlighter.default,
|
|
54
57
|
{
|
|
58
|
+
type: "block",
|
|
55
59
|
theme: theme.appearance,
|
|
56
60
|
language: (className == null ? void 0 : className.replace("language-", "")) || "markdown",
|
|
57
61
|
className: styles
|
package/lib/Markdown/index.js
CHANGED
|
@@ -35,13 +35,22 @@ module.exports = __toCommonJS(Markdown_exports);
|
|
|
35
35
|
var import_antd = require("antd");
|
|
36
36
|
var import_react = require("react");
|
|
37
37
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
38
|
+
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
38
39
|
var import_style = require("./style");
|
|
39
40
|
var import_Code = __toESM(require("./Code"));
|
|
40
41
|
var import_CodeBlock = __toESM(require("./CodeBlock"));
|
|
41
42
|
var Markdown = (0, import_react.memo)(({ children, className }) => {
|
|
42
43
|
const { styles, cx } = (0, import_style.useStyles)();
|
|
43
44
|
const components = { pre: import_CodeBlock.default, code: import_Code.default, hr: import_antd.Divider, a: import_antd.Typography.Link };
|
|
44
|
-
return /* @__PURE__ */ React.createElement(import_antd.Typography, null, /* @__PURE__ */ React.createElement(
|
|
45
|
+
return /* @__PURE__ */ React.createElement(import_antd.Typography, null, /* @__PURE__ */ React.createElement(
|
|
46
|
+
import_react_markdown.default,
|
|
47
|
+
{
|
|
48
|
+
className: cx(styles.container, className),
|
|
49
|
+
components,
|
|
50
|
+
remarkPlugins: [import_remark_gfm.default]
|
|
51
|
+
},
|
|
52
|
+
children
|
|
53
|
+
));
|
|
45
54
|
});
|
|
46
55
|
var Markdown_default = Markdown;
|
|
47
56
|
// Annotate the CommonJS export names for ESM import in node:
|
package/lib/Markdown/style.js
CHANGED
|
@@ -26,29 +26,104 @@ var import_antd_style = require("antd-style");
|
|
|
26
26
|
var useStyles = (0, import_antd_style.createStyles)(({ css, token, isDarkMode }) => {
|
|
27
27
|
return {
|
|
28
28
|
container: css`
|
|
29
|
+
color: ${isDarkMode ? token.colorTextSecondary : token.colorText};
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
29
33
|
p {
|
|
30
34
|
margin: 20px auto;
|
|
31
35
|
line-height: 2;
|
|
32
36
|
word-wrap: break-word;
|
|
33
37
|
font-size: 14px;
|
|
34
38
|
color: ${token.colorText};
|
|
39
|
+
|
|
40
|
+
&:not(:last-child) {
|
|
41
|
+
margin-bottom: 1em;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// hyperlink
|
|
46
|
+
a {
|
|
47
|
+
color: ${token.colorLink};
|
|
48
|
+
|
|
49
|
+
&:hover {
|
|
50
|
+
color: ${token.colorLinkHover};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:active {
|
|
54
|
+
color: ${token.colorLinkActive};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
img {
|
|
59
|
+
max-width: 100%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// inline code
|
|
63
|
+
> :not([data-code-type='highlighter']) code {
|
|
64
|
+
padding: 2px 6px;
|
|
65
|
+
color: ${isDarkMode ? token["cyan-7"] : token.colorPrimaryText};
|
|
66
|
+
background: ${isDarkMode ? token["cyan-1"] : token.colorPrimaryBg};
|
|
67
|
+
border-radius: 4px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// table
|
|
72
|
+
table {
|
|
73
|
+
width: 100%;
|
|
74
|
+
border-spacing: 0;
|
|
75
|
+
border: 1px solid ${token.colorBorder};
|
|
76
|
+
border-radius: ${token.borderRadius}px;
|
|
77
|
+
padding: 8px;
|
|
78
|
+
margin-block-start: 1em;
|
|
79
|
+
margin-block-end: 1em;
|
|
80
|
+
margin-inline-start: 0px;
|
|
81
|
+
margin-inline-end: 0px;
|
|
35
82
|
}
|
|
36
83
|
|
|
37
|
-
|
|
38
|
-
|
|
84
|
+
th {
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
thead {
|
|
89
|
+
tr {
|
|
90
|
+
th {
|
|
91
|
+
background: ${token.colorFillTertiary};
|
|
92
|
+
&:first-child {
|
|
93
|
+
border-top-left-radius: ${token.borderRadius}px;
|
|
94
|
+
border-bottom-left-radius: ${token.borderRadius}px;
|
|
95
|
+
}
|
|
96
|
+
&:last-child {
|
|
97
|
+
border-top-right-radius: ${token.borderRadius}px;
|
|
98
|
+
border-bottom-right-radius: ${token.borderRadius}px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
39
102
|
}
|
|
40
103
|
|
|
41
|
-
|
|
42
|
-
|
|
104
|
+
th,
|
|
105
|
+
td {
|
|
106
|
+
padding-block-start: 10px;
|
|
107
|
+
padding-block-end: 10px;
|
|
108
|
+
padding-inline-start: 16px;
|
|
109
|
+
padding-inline-end: 16px;
|
|
43
110
|
}
|
|
44
111
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
112
|
+
// blockquote
|
|
113
|
+
blockquote {
|
|
114
|
+
margin: 16px 0;
|
|
115
|
+
padding: 0 12px;
|
|
116
|
+
p {
|
|
117
|
+
font-style: italic;
|
|
118
|
+
color: ${token.colorTextDescription};
|
|
50
119
|
}
|
|
51
120
|
}
|
|
121
|
+
|
|
122
|
+
// list
|
|
123
|
+
ul li {
|
|
124
|
+
line-height: 1.8;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
52
127
|
`,
|
|
53
128
|
code: css`
|
|
54
129
|
padding: 2px 4px;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface MessageModalProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
editing?: boolean;
|
|
6
|
+
onEditingChange?: (editing: boolean) => void;
|
|
7
|
+
onChange?: (text: string) => void;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
declare const MessageModal: import("react").NamedExoticComponent<MessageModalProps>;
|
|
11
|
+
export default MessageModal;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/MessageModal/index.tsx
|
|
30
|
+
var MessageModal_exports = {};
|
|
31
|
+
__export(MessageModal_exports, {
|
|
32
|
+
default: () => MessageModal_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(MessageModal_exports);
|
|
35
|
+
var import_icons = require("@ant-design/icons");
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_antd_style = require("antd-style");
|
|
38
|
+
var import_react = require("react");
|
|
39
|
+
var import_react_layout_kit = require("react-layout-kit");
|
|
40
|
+
var import_use_merge_value = __toESM(require("use-merge-value"));
|
|
41
|
+
var import_Markdown = __toESM(require("../Markdown"));
|
|
42
|
+
var import_MessageInput = __toESM(require("../MessageInput"));
|
|
43
|
+
var useStyles = (0, import_antd_style.createStyles)(({ css, prefixCls }) => ({
|
|
44
|
+
modal: css`
|
|
45
|
+
height: 70%;
|
|
46
|
+
.${prefixCls}-modal-header {
|
|
47
|
+
margin-bottom: 24px;
|
|
48
|
+
}
|
|
49
|
+
`,
|
|
50
|
+
body: css`
|
|
51
|
+
overflow-y: scroll;
|
|
52
|
+
max-height: 70vh;
|
|
53
|
+
`
|
|
54
|
+
}));
|
|
55
|
+
var MessageModal = (0, import_react.memo)(
|
|
56
|
+
({ editing, open, onOpenChange, onEditingChange, value, onChange }) => {
|
|
57
|
+
const { styles } = useStyles();
|
|
58
|
+
const [isEdit, setTyping] = (0, import_use_merge_value.default)(false, {
|
|
59
|
+
value: editing,
|
|
60
|
+
onChange: onEditingChange
|
|
61
|
+
});
|
|
62
|
+
const [expand, setExpand] = (0, import_use_merge_value.default)(false, {
|
|
63
|
+
value: open,
|
|
64
|
+
onChange: onOpenChange
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ React.createElement(
|
|
67
|
+
import_antd.Modal,
|
|
68
|
+
{
|
|
69
|
+
open: expand,
|
|
70
|
+
width: 800,
|
|
71
|
+
onCancel: () => setExpand(false),
|
|
72
|
+
okText: "编辑",
|
|
73
|
+
onOk: () => {
|
|
74
|
+
setTyping(true);
|
|
75
|
+
},
|
|
76
|
+
footer: isEdit ? null : void 0,
|
|
77
|
+
cancelText: "关闭",
|
|
78
|
+
title: /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { horizontal: true, align: "center", gap: 4 }, /* @__PURE__ */ React.createElement(import_icons.AimOutlined, null), "提示词"),
|
|
79
|
+
className: styles.modal
|
|
80
|
+
},
|
|
81
|
+
isEdit ? /* @__PURE__ */ React.createElement(
|
|
82
|
+
import_MessageInput.default,
|
|
83
|
+
{
|
|
84
|
+
onConfirm: (text) => {
|
|
85
|
+
setTyping(false);
|
|
86
|
+
onChange == null ? void 0 : onChange(text);
|
|
87
|
+
},
|
|
88
|
+
onCancel: () => setTyping(false),
|
|
89
|
+
defaultValue: value,
|
|
90
|
+
height: 400
|
|
91
|
+
}
|
|
92
|
+
) : /* @__PURE__ */ React.createElement(import_Markdown.default, { className: styles.body }, value)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
var MessageModal_default = MessageModal;
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {});
|
|
@@ -46,24 +46,6 @@ var GlobalStyle = import_antd_style.createGlobalStyle`
|
|
|
46
46
|
#root {
|
|
47
47
|
min-height: 100vh;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
@font-face {
|
|
51
|
-
font-family: AliPuHui;
|
|
52
|
-
font-weight: normal;
|
|
53
|
-
src: url('//at.alicdn.com/t/webfont_exesdog9toj.woff2') format('woff2'),
|
|
54
|
-
url('//at.alicdn.com/t/webfont_exesdog9toj.woff') format('woff'),
|
|
55
|
-
url('//at.alicdn.com/t/webfont_exesdog9toj.ttf') format('truetype');
|
|
56
|
-
font-display: swap;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@font-face {
|
|
60
|
-
font-family: AliPuHui;
|
|
61
|
-
font-weight: bold;
|
|
62
|
-
src: url('https://at.alicdn.com/wf/webfont/exMpJIukiCms/Gsw2PSKrftc1yNWMNlXgw.woff2') format('woff2'),
|
|
63
|
-
url('https://at.alicdn.com/wf/webfont/exMpJIukiCms/vtu73by4O2gEBcvBuLgeu.woff') format('woff');
|
|
64
|
-
font-display: swap;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
49
|
/* 定义滚动槽的样式 */
|
|
68
50
|
::-webkit-scrollbar {
|
|
69
51
|
width: 0;
|
package/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { default as Avatar, type AvatarProps } from './Avatar';
|
|
|
3
3
|
export { default as ContextMenu, type ContextMenuProps } from './ContextMenu';
|
|
4
4
|
export { default as CopyButton, type CopyButtonProps } from './CopyButton';
|
|
5
5
|
export { default as DraggablePanel, type DraggablePanelProps } from './DraggablePanel';
|
|
6
|
+
export { default as EditableMessage, type EditableMessageProps } from './EditableMessage';
|
|
6
7
|
export { default as EditableText, type EditableTextProps } from './EditableText';
|
|
7
8
|
export { default as Highlighter, SyntaxHighlighter, type HighlighterProps, type SyntaxHighlighterProps, } from './Highlighter';
|
|
8
9
|
export { default as Icon, type IconProps, type IconSize } from './Icon';
|
|
@@ -10,6 +11,7 @@ export { default as List } from './List';
|
|
|
10
11
|
export { default as Logo, type LogoProps } from './Logo';
|
|
11
12
|
export { default as Markdown, type MarkdownProps } from './Markdown';
|
|
12
13
|
export { default as MessageInput, type MessageInputProps } from './MessageInput';
|
|
14
|
+
export { default as MessageModal, type MessageModalProps } from './MessageModal';
|
|
13
15
|
export { default as SearchBar, type SearchBarProps } from './SearchBar';
|
|
14
16
|
export { default as SideNav, type SideNavProps } from './SideNav';
|
|
15
17
|
export { default as Snippet, type SnippetProps } from './Snippet';
|
package/lib/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(src_exports, {
|
|
|
34
34
|
ContextMenu: () => import_ContextMenu.default,
|
|
35
35
|
CopyButton: () => import_CopyButton.default,
|
|
36
36
|
DraggablePanel: () => import_DraggablePanel.default,
|
|
37
|
+
EditableMessage: () => import_EditableMessage.default,
|
|
37
38
|
EditableText: () => import_EditableText.default,
|
|
38
39
|
Highlighter: () => import_Highlighter.default,
|
|
39
40
|
Icon: () => import_Icon.default,
|
|
@@ -41,6 +42,7 @@ __export(src_exports, {
|
|
|
41
42
|
Logo: () => import_Logo.default,
|
|
42
43
|
Markdown: () => import_Markdown.default,
|
|
43
44
|
MessageInput: () => import_MessageInput.default,
|
|
45
|
+
MessageModal: () => import_MessageModal.default,
|
|
44
46
|
SearchBar: () => import_SearchBar.default,
|
|
45
47
|
SideNav: () => import_SideNav.default,
|
|
46
48
|
Snippet: () => import_Snippet.default,
|
|
@@ -60,6 +62,7 @@ var import_Avatar = __toESM(require("./Avatar"));
|
|
|
60
62
|
var import_ContextMenu = __toESM(require("./ContextMenu"));
|
|
61
63
|
var import_CopyButton = __toESM(require("./CopyButton"));
|
|
62
64
|
var import_DraggablePanel = __toESM(require("./DraggablePanel"));
|
|
65
|
+
var import_EditableMessage = __toESM(require("./EditableMessage"));
|
|
63
66
|
var import_EditableText = __toESM(require("./EditableText"));
|
|
64
67
|
var import_Highlighter = __toESM(require("./Highlighter"));
|
|
65
68
|
var import_Icon = __toESM(require("./Icon"));
|
|
@@ -67,6 +70,7 @@ var import_List = __toESM(require("./List"));
|
|
|
67
70
|
var import_Logo = __toESM(require("./Logo"));
|
|
68
71
|
var import_Markdown = __toESM(require("./Markdown"));
|
|
69
72
|
var import_MessageInput = __toESM(require("./MessageInput"));
|
|
73
|
+
var import_MessageModal = __toESM(require("./MessageModal"));
|
|
70
74
|
var import_SearchBar = __toESM(require("./SearchBar"));
|
|
71
75
|
var import_SideNav = __toESM(require("./SideNav"));
|
|
72
76
|
var import_Snippet = __toESM(require("./Snippet"));
|
|
@@ -83,6 +87,7 @@ var import_Tooltip = __toESM(require("./Tooltip"));
|
|
|
83
87
|
ContextMenu,
|
|
84
88
|
CopyButton,
|
|
85
89
|
DraggablePanel,
|
|
90
|
+
EditableMessage,
|
|
86
91
|
EditableText,
|
|
87
92
|
Highlighter,
|
|
88
93
|
Icon,
|
|
@@ -90,6 +95,7 @@ var import_Tooltip = __toESM(require("./Tooltip"));
|
|
|
90
95
|
Logo,
|
|
91
96
|
Markdown,
|
|
92
97
|
MessageInput,
|
|
98
|
+
MessageModal,
|
|
93
99
|
SearchBar,
|
|
94
100
|
SideNav,
|
|
95
101
|
Snippet,
|
package/lib/styles/theme/base.js
CHANGED
|
@@ -33,7 +33,7 @@ var baseTheme = {
|
|
|
33
33
|
borderRadiusSM: 3,
|
|
34
34
|
borderRadiusLG: 8,
|
|
35
35
|
controlHeight: 36,
|
|
36
|
-
fontFamily: `'Segoe UI', SegoeUI,
|
|
36
|
+
fontFamily: `'Segoe UI', SegoeUI, -apple-system ,BlinkMacSystemFont,Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'`,
|
|
37
37
|
fontFamilyCode: `'Hack Nerd Font Mono', 'Hack', 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace`
|
|
38
38
|
}
|
|
39
39
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building chatbot web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"react-layout-kit": "^1",
|
|
81
81
|
"react-markdown": "^8",
|
|
82
82
|
"react-rnd": "^10",
|
|
83
|
+
"remark-gfm": "^3.0.1",
|
|
83
84
|
"shiki-es": "^0.2",
|
|
84
85
|
"styled-components": "^6.0.0-rc.1",
|
|
85
86
|
"use-merge-value": "^1",
|