@seafile/sdoc-editor 0.1.27-beta1 → 0.1.27-beta2
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.
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
6
|
import { Editable, Slate } from '@seafile/slate-react';
|
|
7
|
-
import editor, { renderLeaf, renderElement
|
|
7
|
+
import editor, { renderLeaf, renderElement } from '../../basic-sdk/extension';
|
|
8
8
|
import withNodeId from '../../basic-sdk/node-id';
|
|
9
9
|
import { getDiffValue } from '../../basic-sdk/utils/diff';
|
|
10
10
|
var DiffViewer = /*#__PURE__*/function (_Component) {
|
|
@@ -18,13 +18,16 @@ var DiffViewer = /*#__PURE__*/function (_Component) {
|
|
|
18
18
|
console.log('renderLeaf params: ', props);
|
|
19
19
|
return renderLeaf(props, _this.editor);
|
|
20
20
|
};
|
|
21
|
+
_this.renderElement = function (props) {
|
|
22
|
+
console.log('renderElement params: ', props);
|
|
23
|
+
return renderElement(props, _this.editor);
|
|
24
|
+
};
|
|
21
25
|
_this.editor = withNodeId(editor);
|
|
22
26
|
return _this;
|
|
23
27
|
}
|
|
24
28
|
_createClass(DiffViewer, [{
|
|
25
29
|
key: "render",
|
|
26
30
|
value: function render() {
|
|
27
|
-
var _this2 = this;
|
|
28
31
|
var _this$props = this.props,
|
|
29
32
|
currentContent = _this$props.currentContent,
|
|
30
33
|
lastContent = _this$props.lastContent;
|
|
@@ -38,9 +41,7 @@ var DiffViewer = /*#__PURE__*/function (_Component) {
|
|
|
38
41
|
}, /*#__PURE__*/React.createElement(Editable, {
|
|
39
42
|
readOnly: true,
|
|
40
43
|
placeholder: "",
|
|
41
|
-
renderElement:
|
|
42
|
-
return _renderElement(props, _this2.editor);
|
|
43
|
-
},
|
|
44
|
+
renderElement: this.renderElement,
|
|
44
45
|
renderLeaf: this.renderLeaf,
|
|
45
46
|
onDOMBeforeInput: function onDOMBeforeInput() {},
|
|
46
47
|
onKeyDown: function onKeyDown() {}
|