@seafile/sdoc-editor 0.5.44 → 0.5.45

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.
@@ -247,6 +247,10 @@ const updateDiffValue = (diff, element, oldElement) => {
247
247
  }
248
248
  const elements = getCommonDiff(element, oldElement, diff);
249
249
  elements.forEach(item => {
250
+ // Changing empty characters to other characters
251
+ if (!item.add && item.children.find(child => child.add === true)) {
252
+ item.add = true;
253
+ }
250
254
  diff.value.push(item);
251
255
  });
252
256
  };
@@ -17,7 +17,7 @@ const PublishedRevisionViewer = () => {
17
17
  const [isFirstLoading, setIsFirstLoading] = useState(true);
18
18
  const [errorMessage, setErrorMessage] = useState('');
19
19
  const [isShowChanges, setShowChanges] = useState(false);
20
- const [changes, setChanges] = useState([]);
20
+ const [changes, setChanges] = useState({});
21
21
  const [document, setDocument] = useState({});
22
22
 
23
23
  // useMount: reset title
@@ -29,7 +29,7 @@ const SimpleEditor = _ref => {
29
29
  } = useDocument();
30
30
  const [isShowChanges, setShowChanges] = useState(false);
31
31
  const [revisionContent, setRevisionContent] = useState(null);
32
- const [changes, setChanges] = useState([]);
32
+ const [changes, setChanges] = useState({});
33
33
  const initIsPublished = context.getSetting('isPublished') || false;
34
34
  const isSdocRevision = context.getSetting('isSdocRevision') || false;
35
35
  const [isPublished, setPublished] = useState(initIsPublished);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.5.44",
3
+ "version": "0.5.45",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",