@lobehub/ui 1.97.1 → 1.98.1
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/Highlighter/FullFeatured.js +1 -1
- package/es/Highlighter/SyntaxHighlighter/index.js +1 -1
- package/es/Highlighter/index.js +1 -1
- package/es/MessageInput/index.js +6 -8
- package/es/MessageModal/index.js +3 -21
- package/es/Modal/index.d.ts +5 -0
- package/es/Modal/index.js +62 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +1 -1
- package/es/MessageModal/style.d.ts +0 -5
- package/es/MessageModal/style.js +0 -12
|
@@ -18,7 +18,7 @@ var SyntaxHighlighter = /*#__PURE__*/memo(function (_ref) {
|
|
|
18
18
|
cx = _useStyles.cx;
|
|
19
19
|
var _useThemeMode = useThemeMode(),
|
|
20
20
|
isDarkMode = _useThemeMode.isDarkMode;
|
|
21
|
-
var _useHighlight = useHighlight(children
|
|
21
|
+
var _useHighlight = useHighlight(children, language, isDarkMode),
|
|
22
22
|
data = _useHighlight.data,
|
|
23
23
|
isLoading = _useHighlight.isLoading;
|
|
24
24
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
package/es/Highlighter/index.js
CHANGED
|
@@ -56,7 +56,7 @@ export var Highlighter = /*#__PURE__*/memo(function (_ref) {
|
|
|
56
56
|
children: language.toLowerCase()
|
|
57
57
|
}), /*#__PURE__*/_jsx(SyntaxHighlighter, {
|
|
58
58
|
language: language === null || language === void 0 ? void 0 : language.toLowerCase(),
|
|
59
|
-
children: children
|
|
59
|
+
children: children
|
|
60
60
|
})]
|
|
61
61
|
}));
|
|
62
62
|
});
|
package/es/MessageInput/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
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
|
-
var _excluded = ["text", "type", "onCancel", "defaultValue", "onConfirm", "renderButtons", "textareaStyle", "textareaClassname", "placeholder", "height", "style", "editButtonSize"
|
|
4
|
+
var _excluded = ["text", "type", "onCancel", "defaultValue", "onConfirm", "renderButtons", "textareaStyle", "textareaClassname", "placeholder", "height", "style", "editButtonSize"];
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
import { Button } from 'antd';
|
|
8
8
|
import { memo, useState } from 'react';
|
|
9
9
|
import { Flexbox } from 'react-layout-kit';
|
|
10
|
-
import
|
|
10
|
+
import CodeEditor from "../CodeEditor";
|
|
11
11
|
import { useStyles } from "./style";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -29,7 +29,6 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
29
29
|
style = _ref.style,
|
|
30
30
|
_ref$editButtonSize = _ref.editButtonSize,
|
|
31
31
|
editButtonSize = _ref$editButtonSize === void 0 ? 'middle' : _ref$editButtonSize,
|
|
32
|
-
classNames = _ref.classNames,
|
|
33
32
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
33
|
var _useState = useState(defaultValue || ''),
|
|
35
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -46,15 +45,14 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
46
45
|
width: '100%'
|
|
47
46
|
}, style)
|
|
48
47
|
}, props), {}, {
|
|
49
|
-
children: [/*#__PURE__*/_jsx(
|
|
50
|
-
autoSize: isAutoSize,
|
|
48
|
+
children: [/*#__PURE__*/_jsx(CodeEditor, {
|
|
51
49
|
className: cx(styles, textareaClassname),
|
|
52
|
-
|
|
50
|
+
language: 'md',
|
|
53
51
|
onBlur: function onBlur(e) {
|
|
54
52
|
return setRole(e.target.value);
|
|
55
53
|
},
|
|
56
|
-
|
|
57
|
-
return setRole(e
|
|
54
|
+
onValueChange: function onValueChange(e) {
|
|
55
|
+
return setRole(e);
|
|
58
56
|
},
|
|
59
57
|
placeholder: placeholder,
|
|
60
58
|
resize: false,
|
package/es/MessageModal/index.js
CHANGED
|
@@ -2,15 +2,11 @@ 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
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
|
-
import { Modal } from 'antd';
|
|
6
|
-
import { X } from 'lucide-react';
|
|
7
5
|
import { memo } from 'react';
|
|
8
|
-
import { Flexbox } from 'react-layout-kit';
|
|
9
6
|
import useControlledState from 'use-merge-value';
|
|
10
|
-
import Icon from "../Icon";
|
|
11
7
|
import Markdown from "../Markdown";
|
|
12
8
|
import MessageInput from "../MessageInput";
|
|
13
|
-
import
|
|
9
|
+
import Modal from "../Modal";
|
|
14
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
11
|
var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
16
12
|
var editing = _ref.editing,
|
|
@@ -23,8 +19,6 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
23
19
|
value = _ref.value,
|
|
24
20
|
onChange = _ref.onChange,
|
|
25
21
|
text = _ref.text;
|
|
26
|
-
var _useStyles = useStyles(),
|
|
27
|
-
styles = _useStyles.styles;
|
|
28
22
|
var _useControlledState = useControlledState(false, {
|
|
29
23
|
onChange: onEditingChange,
|
|
30
24
|
value: editing
|
|
@@ -47,27 +41,16 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
47
41
|
};
|
|
48
42
|
return /*#__PURE__*/_jsx(Modal, {
|
|
49
43
|
cancelText: (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel',
|
|
50
|
-
className: styles.modal,
|
|
51
|
-
closeIcon: /*#__PURE__*/_jsx(Icon, {
|
|
52
|
-
icon: X
|
|
53
|
-
}),
|
|
54
44
|
footer: isEdit ? null : undefined,
|
|
55
45
|
okText: (text === null || text === void 0 ? void 0 : text.edit) || 'Edit',
|
|
56
46
|
onCancel: function onCancel() {
|
|
57
47
|
return setExpand(false);
|
|
58
48
|
},
|
|
59
49
|
onOk: function onOk() {
|
|
60
|
-
setTyping(true);
|
|
50
|
+
return setTyping(true);
|
|
61
51
|
},
|
|
62
52
|
open: expand,
|
|
63
|
-
title:
|
|
64
|
-
align: 'center',
|
|
65
|
-
gap: 4,
|
|
66
|
-
horizontal: true,
|
|
67
|
-
children: (text === null || text === void 0 ? void 0 : text.title) || 'Prompt'
|
|
68
|
-
}),
|
|
69
|
-
width: 800,
|
|
70
|
-
wrapClassName: styles.root,
|
|
53
|
+
title: (text === null || text === void 0 ? void 0 : text.title) || 'Prompt',
|
|
71
54
|
children: isEdit ? /*#__PURE__*/_jsx(MessageInput, {
|
|
72
55
|
defaultValue: value,
|
|
73
56
|
height: height,
|
|
@@ -85,7 +68,6 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
85
68
|
},
|
|
86
69
|
type: 'block'
|
|
87
70
|
}) : /*#__PURE__*/_jsx(Markdown, {
|
|
88
|
-
className: styles.body,
|
|
89
71
|
style: value ? markdownStyle : _objectSpread(_objectSpread({}, markdownStyle), {}, {
|
|
90
72
|
opacity: 0.5
|
|
91
73
|
}),
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
4
|
+
var _excluded = ["children", "title", "className", "wrapClassName", "width"];
|
|
5
|
+
var _templateObject, _templateObject2;
|
|
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; }
|
|
8
|
+
import { Modal as AntModal, ConfigProvider } from 'antd';
|
|
9
|
+
import { createStyles } from 'antd-style';
|
|
10
|
+
import { X } from 'lucide-react';
|
|
11
|
+
import { lighten } from 'polished';
|
|
12
|
+
import { memo } from 'react';
|
|
13
|
+
import Icon from "../Icon";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
var useStyles = createStyles(function (_ref) {
|
|
16
|
+
var css = _ref.css,
|
|
17
|
+
token = _ref.token,
|
|
18
|
+
prefixCls = _ref.prefixCls;
|
|
19
|
+
return {
|
|
20
|
+
content: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-modal-body {\n overflow: hidden;\n padding: 0 16px 16px;\n }\n .", "-modal-footer {\n padding: 0 16px 16px;\n }\n .", "-modal-header {\n display: flex;\n gap: 4px;\n align-items: center;\n justify-content: center;\n\n margin-bottom: 0;\n padding: 16px;\n }\n .", "-modal-content {\n overflow: hidden;\n padding: 0;\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n "])), prefixCls, prefixCls, prefixCls, prefixCls, token.colorSplit, token.borderRadiusLG),
|
|
21
|
+
wrap: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow-x: hidden;\n overflow-y: auto;\n backdrop-filter: blur(2px);\n "])))
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
var Modal = /*#__PURE__*/memo(function (_ref2) {
|
|
25
|
+
var children = _ref2.children,
|
|
26
|
+
title = _ref2.title,
|
|
27
|
+
className = _ref2.className,
|
|
28
|
+
wrapClassName = _ref2.wrapClassName,
|
|
29
|
+
_ref2$width = _ref2.width,
|
|
30
|
+
width = _ref2$width === void 0 ? 700 : _ref2$width,
|
|
31
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
32
|
+
var _useStyles = useStyles(),
|
|
33
|
+
styles = _useStyles.styles,
|
|
34
|
+
cx = _useStyles.cx,
|
|
35
|
+
theme = _useStyles.theme;
|
|
36
|
+
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
37
|
+
theme: {
|
|
38
|
+
token: {
|
|
39
|
+
colorBgElevated: lighten(0.005, theme.colorBgContainer)
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
children: /*#__PURE__*/_jsx(AntModal, _objectSpread(_objectSpread({
|
|
43
|
+
centered: true,
|
|
44
|
+
className: cx(styles.content, className),
|
|
45
|
+
closable: true,
|
|
46
|
+
closeIcon: /*#__PURE__*/_jsx(Icon, {
|
|
47
|
+
icon: X,
|
|
48
|
+
size: {
|
|
49
|
+
fontSize: 20
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
maskClosable: true,
|
|
53
|
+
title: title,
|
|
54
|
+
width: width,
|
|
55
|
+
wrapClassName: cx(styles.wrap, wrapClassName)
|
|
56
|
+
}, props), {}, {
|
|
57
|
+
children: children
|
|
58
|
+
}))
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
export default Modal;
|
|
62
|
+
export { ModalProps } from 'antd';
|
package/es/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export { default as MobileNavBar, type MobileNavBarProps } from './MobileNavBar'
|
|
|
54
54
|
export { default as MobileNavBarTitle, type MobileNavBarTitleProps, } from './MobileNavBar/MobileNavBarTitle';
|
|
55
55
|
export { default as MobileSafeArea, type MobileSafeAreaProps } from './MobileSafeArea';
|
|
56
56
|
export { default as MobileTabBar, type MobileTabBarItemProps, type MobileTabBarProps, } from './MobileTabBar';
|
|
57
|
+
export { default as Modal, type ModalProps } from './Modal';
|
|
57
58
|
export { default as SearchBar, type SearchBarProps } from './SearchBar';
|
|
58
59
|
export { default as SelectWithImg, type SelectWithImgOptionItem, type SelectWithImgProps, } from './SelectWithImg';
|
|
59
60
|
export { default as SideNav, type SideNavProps } from './SideNav';
|
package/es/index.js
CHANGED
|
@@ -53,6 +53,7 @@ export { default as MobileNavBar } from "./MobileNavBar";
|
|
|
53
53
|
export { default as MobileNavBarTitle } from "./MobileNavBar/MobileNavBarTitle";
|
|
54
54
|
export { default as MobileSafeArea } from "./MobileSafeArea";
|
|
55
55
|
export { default as MobileTabBar } from "./MobileTabBar";
|
|
56
|
+
export { default as Modal } from "./Modal";
|
|
56
57
|
export { default as SearchBar } from "./SearchBar";
|
|
57
58
|
export { default as SelectWithImg } from "./SelectWithImg";
|
|
58
59
|
export { default as SideNav } from "./SideNav";
|
package/package.json
CHANGED
package/es/MessageModal/style.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
-
import { createStyles } from 'antd-style';
|
|
4
|
-
export var useStyles = createStyles(function (_ref) {
|
|
5
|
-
var css = _ref.css,
|
|
6
|
-
prefixCls = _ref.prefixCls;
|
|
7
|
-
return {
|
|
8
|
-
body: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-x: hidden;\n overflow-y: auto;\n max-height: 70vh;\n "]))),
|
|
9
|
-
modal: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-modal-content {\n padding: 16px;\n }\n .", "-modal-header {\n margin-bottom: 16px;\n }\n "])), prefixCls, prefixCls),
|
|
10
|
-
root: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n backdrop-filter: blur(2px);\n "])))
|
|
11
|
-
};
|
|
12
|
-
});
|