@seafile/sdoc-editor 0.1.166-beta → 0.1.167
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.
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import { getDiff } from '../utils/diff';
|
|
3
3
|
import SDocViewer from './sdoc-viewer';
|
|
4
4
|
import '../../assets/css/diff-viewer.css';
|
|
5
5
|
var DiffViewer = function DiffViewer(_ref) {
|
|
6
6
|
var currentContent = _ref.currentContent,
|
|
7
|
-
lastContent = _ref.lastContent
|
|
7
|
+
lastContent = _ref.lastContent,
|
|
8
|
+
didMountCallback = _ref.didMountCallback;
|
|
8
9
|
var diff = getDiff(currentContent, lastContent);
|
|
10
|
+
useEffect(function () {
|
|
11
|
+
didMountCallback && didMountCallback(diff);
|
|
12
|
+
}, [didMountCallback, diff]);
|
|
9
13
|
return /*#__PURE__*/React.createElement(SDocViewer, {
|
|
10
14
|
showToolbar: false,
|
|
11
15
|
showOutline: false,
|
|
@@ -339,7 +339,7 @@ var SimpleEditor = function SimpleEditor(_ref) {
|
|
|
339
339
|
document: document
|
|
340
340
|
}), isShowChanges && /*#__PURE__*/React.createElement(RevisionDiffViewer, {
|
|
341
341
|
revisionContent: revisionContent,
|
|
342
|
-
|
|
342
|
+
didMountCallback: setDiffChanges
|
|
343
343
|
}))), showTip && /*#__PURE__*/React.createElement(TipDialog, {
|
|
344
344
|
toggle: closeTip,
|
|
345
345
|
submit: tipSubmit,
|