@seafile/seafile-editor 2.0.46-beta3 → 2.0.47-beta

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.
@@ -31,6 +31,7 @@ var _slateViewer = _interopRequireDefault(require("../editors/slate-viewer"));
31
31
  function MarkdownViewer(_ref) {
32
32
  let {
33
33
  isFetching,
34
+ isTyping,
34
35
  value,
35
36
  mathJaxSource,
36
37
  isShowOutline,
@@ -40,22 +41,26 @@ function MarkdownViewer(_ref) {
40
41
  options
41
42
  } = _ref;
42
43
  const [richValue, setRichValue] = (0, _react.useState)([]);
43
- const [isLoading, setIsLoading] = (0, _react.useState)(true);
44
+ const [isLoading, setIsLoading] = (0, _react.useState)(isTyping ? false : true);
44
45
  const {
45
46
  isLoadingMathJax
46
47
  } = (0, _useMathjax.default)(mathJaxSource);
47
48
  (0, _react.useEffect)(() => {
48
49
  if (!isFetching) {
49
- setIsLoading(true);
50
+ if (!isTyping) {
51
+ setIsLoading(true);
52
+ }
50
53
  const richValue = (0, _slateConvert.mdStringToSlate)(value);
51
54
  beforeRenderCallback && beforeRenderCallback(richValue);
52
55
  setRichValue(richValue);
53
- setTimeout(() => {
54
- setIsLoading(false);
55
- }, 0);
56
+ if (!isTyping) {
57
+ setTimeout(() => {
58
+ setIsLoading(false);
59
+ }, 0);
60
+ }
56
61
  }
57
62
  // eslint-disable-next-line react-hooks/exhaustive-deps
58
- }, [isFetching, value]);
63
+ }, [isFetching, value, isTyping]);
59
64
  const props = {
60
65
  options,
61
66
  isSupportFormula: !!mathJaxSource,
@@ -109,9 +109,6 @@ const applyMarkForInlineItem = function (result, item) {
109
109
  id: _slugid.default.nice(),
110
110
  text: ''
111
111
  }];
112
- delete textNode['bold'];
113
- delete textNode['code'];
114
- delete textNode['text'];
115
112
  result.push({
116
113
  ...textNode
117
114
  });
@@ -133,7 +130,9 @@ const applyMarkForInlineItem = function (result, item) {
133
130
  }
134
131
  textNode[attr_key] = true;
135
132
  children.forEach(item => {
136
- applyMarkForInlineItem(result, item, textNode);
133
+ applyMarkForInlineItem(result, item, {
134
+ ...textNode
135
+ });
137
136
  });
138
137
  };
139
138
  const transformNodeWithInlineChildren = node => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "2.0.46-beta3",
3
+ "version": "2.0.47-beta",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {