@seafile/seafile-editor 1.0.4-4 → 1.0.4-6

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.
@@ -15,7 +15,6 @@ export default function SlateEditor(_ref) {
15
15
  editorApi,
16
16
  onSave,
17
17
  isSupportFormula,
18
- scrollRef: externalScrollRef,
19
18
  children
20
19
  } = _ref;
21
20
  const [slateValue, setSlateValue] = useState(value);
@@ -59,7 +58,6 @@ export default function SlateEditor(_ref) {
59
58
  };
60
59
  // eslint-disable-next-line react-hooks/exhaustive-deps
61
60
  }, []);
62
- const containerScrollRef = externalScrollRef ? externalScrollRef : scrollRef;
63
61
  return /*#__PURE__*/React.createElement("div", {
64
62
  className: "sf-slate-editor-container"
65
63
  }, /*#__PURE__*/React.createElement(Toolbar, {
@@ -70,7 +68,7 @@ export default function SlateEditor(_ref) {
70
68
  className: "sf-slate-editor-content"
71
69
  }, /*#__PURE__*/React.createElement(ScrollContext.Provider, {
72
70
  value: {
73
- scrollRef: containerScrollRef
71
+ scrollRef
74
72
  }
75
73
  }, /*#__PURE__*/React.createElement(Slate, {
76
74
  editor: editor,
@@ -7,15 +7,17 @@ import './style.css';
7
7
  export default function SlateViewer(_ref) {
8
8
  let {
9
9
  value,
10
- isShowOutline
10
+ isShowOutline,
11
+ scrollRef: externalScrollRef
11
12
  } = _ref;
12
13
  const scrollRef = useRef(null);
14
+ const containerScrollRef = externalScrollRef ? externalScrollRef : scrollRef;
13
15
  return /*#__PURE__*/React.createElement(Slate, {
14
16
  editor: baseEditor,
15
17
  initialValue: value
16
18
  }, /*#__PURE__*/React.createElement(ScrollContext.Provider, {
17
19
  value: {
18
- scrollRef
20
+ scrollRef: containerScrollRef
19
21
  }
20
22
  }, /*#__PURE__*/React.createElement("div", {
21
23
  ref: scrollRef,
@@ -9,6 +9,7 @@ export default function MarkdownViewer(_ref) {
9
9
  value,
10
10
  mathJaxSource,
11
11
  isShowOutline,
12
+ scrollRef,
12
13
  beforeRenderCallback
13
14
  } = _ref;
14
15
  const [richValue, setRichValue] = useState([]);
@@ -28,7 +29,8 @@ export default function MarkdownViewer(_ref) {
28
29
  const props = {
29
30
  isSupportFormula: !!mathJaxSource,
30
31
  value: richValue,
31
- isShowOutline: isShowOutline
32
+ isShowOutline: isShowOutline,
33
+ scrollRef: scrollRef
32
34
  };
33
35
  if (isFetching || isLoading || isLoadingMathJax) {
34
36
  return /*#__PURE__*/React.createElement(Loading, null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "1.0.4-4",
3
+ "version": "1.0.4-6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {