@lobehub/ui 1.31.0 → 1.31.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.
@@ -6,22 +6,21 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
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 { ConfigProvider, Space } from 'antd';
8
8
  import { RotateCcw, Save } from 'lucide-react';
9
- import { memo, useCallback, useEffect, useRef, useState } from 'react';
9
+ import { forwardRef, memo, useCallback, useEffect, useRef, useState } from 'react';
10
10
  import ActionIcon from "../ActionIcon";
11
11
  import { Input } from "../Input";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
- export var ControlInput = /*#__PURE__*/memo(function (_ref) {
14
+ export var ControlInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, reference) {
15
15
  var value = _ref.value,
16
16
  onChange = _ref.onChange,
17
17
  onValueChanging = _ref.onValueChanging,
18
18
  onChangeEnd = _ref.onChangeEnd,
19
- properties = _objectWithoutProperties(_ref, _excluded);
19
+ props = _objectWithoutProperties(_ref, _excluded);
20
20
  var _useState = useState(value || ''),
21
21
  _useState2 = _slicedToArray(_useState, 2),
22
22
  input = _useState2[0],
23
23
  setInput = _useState2[1];
24
- var inputReference = useRef();
25
24
  var isChineseInput = useRef(false);
26
25
  var isFocusing = useRef(false);
27
26
  var updateValue = useCallback(function () {
@@ -30,9 +29,7 @@ export var ControlInput = /*#__PURE__*/memo(function (_ref) {
30
29
  useEffect(function () {
31
30
  if (value !== undefined) setInput(value);
32
31
  }, [value]);
33
- return /*#__PURE__*/_jsx(Input, _objectSpread(_objectSpread({
34
- ref: inputReference
35
- }, properties), {}, {
32
+ return /*#__PURE__*/_jsx(Input, _objectSpread({
36
33
  onBlur: function onBlur() {
37
34
  isFocusing.current = false;
38
35
  onChangeEnd === null || onChangeEnd === void 0 ? void 0 : onChangeEnd(input);
@@ -58,6 +55,7 @@ export var ControlInput = /*#__PURE__*/memo(function (_ref) {
58
55
  onChangeEnd === null || onChangeEnd === void 0 ? void 0 : onChangeEnd(input);
59
56
  }
60
57
  },
58
+ ref: reference,
61
59
  suffix: value === input ? /*#__PURE__*/_jsx("span", {}) : /*#__PURE__*/_jsx(ConfigProvider, {
62
60
  theme: {
63
61
  token: {
@@ -82,5 +80,5 @@ export var ControlInput = /*#__PURE__*/memo(function (_ref) {
82
80
  })
83
81
  }),
84
82
  value: input
85
- }));
86
- });
83
+ }, props));
84
+ }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.31.0",
3
+ "version": "1.31.1",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -98,7 +98,7 @@
98
98
  "react-simple-code-editor": "^0",
99
99
  "remark-gfm": "^3",
100
100
  "shiki-es": "^0",
101
- "styled-components": "latest",
101
+ "styled-components": "^6",
102
102
  "ts-md5": "^1",
103
103
  "use-merge-value": "^1",
104
104
  "zustand": "^4",