@seafile/seafile-editor 1.0.32-4 → 1.0.32-5

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.js CHANGED
@@ -5,10 +5,11 @@ import MarkdownEditor from './pages/markdown-editor';
5
5
  import MarkdownViewer from './pages/markdown-view';
6
6
  import SimpleEditor from './pages/simple-editor';
7
7
  import LongTextEditorDialog from './pages/longtext-editor-dialog';
8
+ import MarkdownPreview from './pages/markdown-preview';
8
9
  import SeaTableEditor from './pages/seatable-editor';
9
10
  import SeaTableViewer from './pages/seatable-viewer';
10
11
  import EventBus from './utils/event-bus';
11
12
  import { mdStringToSlate, slateToMdString, deserializeHtml, processor } from './slate-convert';
12
13
  import { replaceColumnData } from './utils/replace-slate-nodes';
13
14
  import getPreviewContent from './utils/get-preview-content';
14
- export { MarkdownEditor, PlainMarkdownEditor, RichMarkdownEditor, MarkdownViewer, SimpleEditor, SeaTableEditor, SeaTableViewer, LongTextEditorDialog, EXTERNAL_EVENTS, EventBus, mdStringToSlate, slateToMdString, deserializeHtml, processor, replaceColumnData, getPreviewContent };
15
+ export { MarkdownEditor, PlainMarkdownEditor, RichMarkdownEditor, MarkdownViewer, SimpleEditor, SeaTableEditor, SeaTableViewer, LongTextEditorDialog, MarkdownPreview, EXTERNAL_EVENTS, EventBus, mdStringToSlate, slateToMdString, deserializeHtml, processor, replaceColumnData, getPreviewContent };
@@ -81,18 +81,21 @@ export default function LongTextEditorDialog(_ref) {
81
81
  setDialogStyle(containerStyle);
82
82
  }, [isFullScreen]);
83
83
  const onContentChanged = useCallback(() => {
84
- // update parent's component cache value
85
- if (onEditorValueChanged && typeof onEditorValueChanged === 'function') {
86
- var _editorRef$current3, _editorRef$current4;
87
- const markdownString = (_editorRef$current3 = editorRef.current) === null || _editorRef$current3 === void 0 ? void 0 : _editorRef$current3.getValue();
88
- const slateNodes = (_editorRef$current4 = editorRef.current) === null || _editorRef$current4 === void 0 ? void 0 : _editorRef$current4.getSlateValue();
89
- const value = getPreviewContent(slateNodes);
90
- onEditorValueChanged({
91
- ...value,
92
- text: markdownString
93
- });
94
- }
95
- setValueChanged(true);
84
+ // delay to update editor's content
85
+ setTimeout(() => {
86
+ // update parent's component cache value
87
+ if (onEditorValueChanged && typeof onEditorValueChanged === 'function') {
88
+ var _editorRef$current3, _editorRef$current4;
89
+ const markdownString = (_editorRef$current3 = editorRef.current) === null || _editorRef$current3 === void 0 ? void 0 : _editorRef$current3.getValue();
90
+ const slateNodes = (_editorRef$current4 = editorRef.current) === null || _editorRef$current4 === void 0 ? void 0 : _editorRef$current4.getSlateValue();
91
+ const value = getPreviewContent(slateNodes);
92
+ onEditorValueChanged({
93
+ ...value,
94
+ text: markdownString
95
+ });
96
+ }
97
+ setValueChanged(true);
98
+ }, 0);
96
99
  }, [onEditorValueChanged]);
97
100
  const onContainerKeyDown = event => {
98
101
  if (event.keyCode === 27) {
@@ -1,7 +1,7 @@
1
1
  const getBrowserInfo = isCheckBrowser => {
2
2
  if (!isCheckBrowser) return {
3
3
  isValidBrowser: true,
4
- isWindowsWechat: true
4
+ isWindowsWechat: false
5
5
  };
6
6
  let isValidBrowser = false;
7
7
  let isWindowsWechat = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "1.0.32-4",
3
+ "version": "1.0.32-5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {