musae 1.0.27-beta.13 → 1.0.27-beta.14
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.
|
@@ -28,18 +28,13 @@ var ControlledStatePlugin = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
28
28
|
var editorState = editor.parseEditorState(updatedValue);
|
|
29
29
|
editor.setEditorState(editorState);
|
|
30
30
|
});
|
|
31
|
-
var _useControlledState = relax.useControlledState(value,
|
|
32
|
-
onChange: function onChange(nextValue) {
|
|
33
|
-
_setEditorState(nextValue);
|
|
34
|
-
}
|
|
35
|
-
}),
|
|
31
|
+
var _useControlledState = relax.useControlledState(value),
|
|
36
32
|
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
37
33
|
_value = _useControlledState2[0],
|
|
38
34
|
_setValue = _useControlledState2[1];
|
|
39
35
|
relax.useUpdateEffect(function () {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
36
|
+
_setEditorState(_value);
|
|
37
|
+
}, [_value]);
|
|
43
38
|
// 富文本组件发生数据变更时,同步更新受控数据
|
|
44
39
|
var change = relax.useEvent(function (state, editor) {
|
|
45
40
|
editor.read(function () {
|
|
@@ -24,18 +24,13 @@ var ControlledStatePlugin = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24
24
|
var editorState = editor.parseEditorState(updatedValue);
|
|
25
25
|
editor.setEditorState(editorState);
|
|
26
26
|
});
|
|
27
|
-
var _useControlledState = useControlledState(value,
|
|
28
|
-
onChange: function onChange(nextValue) {
|
|
29
|
-
_setEditorState(nextValue);
|
|
30
|
-
}
|
|
31
|
-
}),
|
|
27
|
+
var _useControlledState = useControlledState(value),
|
|
32
28
|
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
33
29
|
_value = _useControlledState2[0],
|
|
34
30
|
_setValue = _useControlledState2[1];
|
|
35
31
|
useUpdateEffect(function () {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
32
|
+
_setEditorState(_value);
|
|
33
|
+
}, [_value]);
|
|
39
34
|
// 富文本组件发生数据变更时,同步更新受控数据
|
|
40
35
|
var change = useEvent(function (state, editor) {
|
|
41
36
|
editor.read(function () {
|