@luscii-healthtech/web-ui 35.14.0 → 35.14.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/dist/index.development.js +13 -5
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -6016,8 +6016,13 @@ const TextEditor = (_a) => {
|
|
|
6016
6016
|
[{ list: "ordered" }, { list: "bullet" }],
|
|
6017
6017
|
["link"]
|
|
6018
6018
|
], placeholder, onValueChange } = _a, attrs = __rest(_a, ["defaultValue", "formats", "toolbar", "placeholder", "onValueChange"]);
|
|
6019
|
+
const defaultValueRef = React.useRef(defaultValue);
|
|
6020
|
+
const onTextChangeRef = React.useRef(onValueChange);
|
|
6019
6021
|
const editorRef = React.useRef(null);
|
|
6020
6022
|
const quillRef = React.useRef(null);
|
|
6023
|
+
React.useLayoutEffect(() => {
|
|
6024
|
+
onTextChangeRef.current = onValueChange;
|
|
6025
|
+
});
|
|
6021
6026
|
React.useEffect(() => {
|
|
6022
6027
|
if (editorRef.current) {
|
|
6023
6028
|
const quill = new Quill__default.default(editorRef.current, {
|
|
@@ -6028,12 +6033,15 @@ const TextEditor = (_a) => {
|
|
|
6028
6033
|
},
|
|
6029
6034
|
placeholder
|
|
6030
6035
|
});
|
|
6031
|
-
quill.on(
|
|
6032
|
-
|
|
6036
|
+
quill.on(Quill__default.default.events.TEXT_CHANGE, (value, _, source) => {
|
|
6037
|
+
var _a2;
|
|
6038
|
+
(_a2 = onTextChangeRef.current) === null || _a2 === void 0 ? void 0 : _a2.call(onTextChangeRef, quill.getSemanticHTML(), value, source);
|
|
6033
6039
|
});
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6040
|
+
if (defaultValueRef.current) {
|
|
6041
|
+
quill.setContents(quill.clipboard.convert({
|
|
6042
|
+
html: defaultValueRef.current
|
|
6043
|
+
}));
|
|
6044
|
+
}
|
|
6037
6045
|
quillRef.current = quill;
|
|
6038
6046
|
}
|
|
6039
6047
|
}, []);
|