@lobehub/ui 1.164.14 → 1.164.16
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.
|
@@ -11,7 +11,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
11
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
12
|
import { InputNumber, Slider } from 'antd';
|
|
13
13
|
import { isNull } from 'lodash-es';
|
|
14
|
-
import { memo
|
|
14
|
+
import { memo } from 'react';
|
|
15
15
|
import { Flexbox } from 'react-layout-kit';
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -30,10 +30,10 @@ var SliderWithInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
30
30
|
className = _ref.className,
|
|
31
31
|
disabled = _ref.disabled,
|
|
32
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
-
var handleOnchange =
|
|
33
|
+
var handleOnchange = function handleOnchange(value) {
|
|
34
34
|
if (Number.isNaN(value) || isNull(value)) return;
|
|
35
35
|
onChange === null || onChange === void 0 || onChange(value);
|
|
36
|
-
}
|
|
36
|
+
};
|
|
37
37
|
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
38
38
|
align: 'center',
|
|
39
39
|
className: className,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TextAreaProps } from "../../Input";
|
|
3
|
+
interface MessageTextAreaProps extends Omit<TextAreaProps, 'onChange' | 'onBlur' | 'value'> {
|
|
4
|
+
defaultValue: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const MessageTextArea: import("react").NamedExoticComponent<MessageTextAreaProps>;
|
|
8
|
+
export default MessageTextArea;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["defaultValue", "onChange"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
+
import { memo, useState } from 'react';
|
|
17
|
+
import { TextArea } from "../../Input";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
var MessageTextArea = /*#__PURE__*/memo(function (_ref) {
|
|
20
|
+
var defaultValue = _ref.defaultValue,
|
|
21
|
+
onChange = _ref.onChange,
|
|
22
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
var _useState = useState(defaultValue || ''),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
text = _useState2[0],
|
|
26
|
+
setText = _useState2[1];
|
|
27
|
+
return /*#__PURE__*/_jsx(TextArea, _objectSpread(_objectSpread({
|
|
28
|
+
onBlur: function onBlur() {
|
|
29
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(text);
|
|
30
|
+
},
|
|
31
|
+
onChange: function onChange(e) {
|
|
32
|
+
setText(e.target.value);
|
|
33
|
+
},
|
|
34
|
+
onPressEnter: function onPressEnter() {
|
|
35
|
+
onChange === null || onChange === void 0 || onChange(text);
|
|
36
|
+
}
|
|
37
|
+
}, rest), {}, {
|
|
38
|
+
value: text
|
|
39
|
+
}));
|
|
40
|
+
});
|
|
41
|
+
export default MessageTextArea;
|
|
@@ -17,10 +17,10 @@ import { useResponsive } from 'antd-style';
|
|
|
17
17
|
import { memo, useState } from 'react';
|
|
18
18
|
import { Flexbox } from 'react-layout-kit';
|
|
19
19
|
import useControlledState from 'use-merge-value';
|
|
20
|
-
import { TextArea } from "../../Input";
|
|
21
20
|
import Markdown from "../../Markdown";
|
|
22
21
|
import Modal from "../../Modal";
|
|
23
22
|
import { useStyles as useTextStyles } from "../MessageInput/style";
|
|
23
|
+
import MessageTextArea from "./TextArea";
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
26
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -58,7 +58,7 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
58
58
|
var _useState = useState(value),
|
|
59
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
60
60
|
temporaryValue = _useState2[0],
|
|
61
|
-
|
|
61
|
+
setMessage = _useState2[1];
|
|
62
62
|
var isAutoSize = height === 'auto';
|
|
63
63
|
var markdownStyle = {
|
|
64
64
|
height: isAutoSize ? 'unset' : height,
|
|
@@ -72,14 +72,14 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
72
72
|
onClick: function onClick() {
|
|
73
73
|
setTyping(false);
|
|
74
74
|
onChange === null || onChange === void 0 || onChange(temporaryValue);
|
|
75
|
-
|
|
75
|
+
setMessage(value);
|
|
76
76
|
},
|
|
77
77
|
type: "primary",
|
|
78
78
|
children: (text === null || text === void 0 ? void 0 : text.confirm) || 'Confirm'
|
|
79
79
|
}), /*#__PURE__*/_jsx(Button, {
|
|
80
80
|
onClick: function onClick() {
|
|
81
81
|
setTyping(false);
|
|
82
|
-
|
|
82
|
+
setMessage(value);
|
|
83
83
|
},
|
|
84
84
|
children: (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel'
|
|
85
85
|
})]
|
|
@@ -93,21 +93,19 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
93
93
|
onCancel: function onCancel() {
|
|
94
94
|
setShowModal(false);
|
|
95
95
|
setTyping(false);
|
|
96
|
-
|
|
96
|
+
setMessage(value);
|
|
97
97
|
},
|
|
98
98
|
onOk: function onOk() {
|
|
99
99
|
return setTyping(true);
|
|
100
100
|
},
|
|
101
101
|
open: showModal,
|
|
102
102
|
title: text === null || text === void 0 ? void 0 : text.title,
|
|
103
|
-
children: isEdit ? /*#__PURE__*/_jsx(
|
|
103
|
+
children: isEdit ? /*#__PURE__*/_jsx(MessageTextArea, {
|
|
104
104
|
autoSize: isAutoSize,
|
|
105
105
|
className: textStyles,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
onChange: function onChange(e) {
|
|
110
|
-
return setValue(e.target.value);
|
|
106
|
+
defaultValue: value,
|
|
107
|
+
onChange: function onChange(value) {
|
|
108
|
+
return setMessage(value);
|
|
111
109
|
},
|
|
112
110
|
placeholder: placeholder,
|
|
113
111
|
resize: false,
|
|
@@ -116,8 +114,7 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
116
114
|
height: isAutoSize ? 'unset' : height,
|
|
117
115
|
minHeight: mobile ? 'unset' : '100%'
|
|
118
116
|
},
|
|
119
|
-
type: mobile ? 'pure' : 'block'
|
|
120
|
-
value: temporaryValue
|
|
117
|
+
type: mobile ? 'pure' : 'block'
|
|
121
118
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
122
119
|
children: [extra, /*#__PURE__*/_jsx(Markdown, {
|
|
123
120
|
style: value ? markdownStyle : _objectSpread(_objectSpread({}, markdownStyle), {}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.164.
|
|
3
|
+
"version": "1.164.16",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building AIGC web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"immer": "^10.1.1",
|
|
72
72
|
"leva": "^0.9.35",
|
|
73
73
|
"lodash-es": "^4.17.21",
|
|
74
|
-
"lucide-react": "^0.
|
|
74
|
+
"lucide-react": "^0.475.0",
|
|
75
75
|
"mermaid": "^11.4.1",
|
|
76
76
|
"numeral": "^2.0.6",
|
|
77
77
|
"polished": "^4.3.1",
|