@seafile/sdoc-editor 1.0.198-test1.8 → 1.0.198-test1.9
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.
|
@@ -98,7 +98,7 @@ const InsertElementDialog = _ref => {
|
|
|
98
98
|
// link shortcut wrapping link
|
|
99
99
|
handleSubmit
|
|
100
100
|
} = _ref2;
|
|
101
|
-
console.log(5, insertSdocFileLinkCallback, insertWhiteboard
|
|
101
|
+
console.log(5, type, element, insertSdocFileLinkCallback, insertWhiteboard);
|
|
102
102
|
setInsertPosition(insertPosition);
|
|
103
103
|
setSlateNode(slateNode);
|
|
104
104
|
setElement(element);
|
|
@@ -107,7 +107,9 @@ const InsertElementDialog = _ref => {
|
|
|
107
107
|
insertSdocFileLinkCallback,
|
|
108
108
|
insertFileLinkCallback
|
|
109
109
|
});
|
|
110
|
-
setInsertWhiteboardFile(
|
|
110
|
+
setInsertWhiteboardFile({
|
|
111
|
+
insertWhiteboard
|
|
112
|
+
});
|
|
111
113
|
setLinkTitle(linkTitle);
|
|
112
114
|
setHandleSubmit(handleSubmit);
|
|
113
115
|
// Apply for comment editor, as it has a different editor instance
|
|
@@ -183,7 +185,6 @@ const InsertElementDialog = _ref => {
|
|
|
183
185
|
insertWhiteboardFile,
|
|
184
186
|
closeDialog
|
|
185
187
|
};
|
|
186
|
-
console.log(555, editor.selection, insertWhiteboardFile);
|
|
187
188
|
return /*#__PURE__*/_react.default.createElement(_index.default, whiteboardProps);
|
|
188
189
|
}
|
|
189
190
|
case _constants2.LOCAL_IMAGE:
|
|
@@ -62,6 +62,7 @@ const generateWhiteboardNode = function (repoID) {
|
|
|
62
62
|
};
|
|
63
63
|
exports.generateWhiteboardNode = generateWhiteboardNode;
|
|
64
64
|
const insertWhiteboard = (editor, filename, filePath) => {
|
|
65
|
+
var _editor$selection;
|
|
65
66
|
console.log(8, editor.selection);
|
|
66
67
|
if (isInsertWhiteboardMenuDisabled(editor)) return;
|
|
67
68
|
console.log(99);
|
|
@@ -76,7 +77,7 @@ const insertWhiteboard = (editor, filename, filePath) => {
|
|
|
76
77
|
// const isCollapsed = Range.isCollapsed(selection);
|
|
77
78
|
|
|
78
79
|
const whiteboardNode = generateWhiteboardNode(repoID, filename, filePath);
|
|
79
|
-
let path =
|
|
80
|
+
let path = (_editor$selection = editor.selection) === null || _editor$selection === void 0 ? void 0 : _editor$selection.anchor.path;
|
|
80
81
|
const position = 'after';
|
|
81
82
|
if (position === _constants.INSERT_POSITION.AFTER) {
|
|
82
83
|
_slate.Transforms.insertNodes(editor, whiteboardNode, {
|
|
@@ -17,10 +17,9 @@ const WhiteboardMenu = _ref => {
|
|
|
17
17
|
let {
|
|
18
18
|
editor,
|
|
19
19
|
readonly,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
toggle,
|
|
21
|
+
eventBus
|
|
22
22
|
} = _ref;
|
|
23
|
-
console.log(1, editor.selection, readonly);
|
|
24
23
|
const disabled = (0, _helpers.isInsertWhiteboardMenuDisabled)(editor, readonly);
|
|
25
24
|
const menuConfig = _constants.MENUS_CONFIG_MAP[_constants.WHITEBOARD];
|
|
26
25
|
const {
|
|
@@ -29,12 +28,15 @@ const WhiteboardMenu = _ref => {
|
|
|
29
28
|
const onCreateFile = () => {
|
|
30
29
|
(0, _helpers.onCreateWhiteboardFile)(editor);
|
|
31
30
|
};
|
|
32
|
-
|
|
31
|
+
console.log(88, editor.selection);
|
|
32
|
+
const openSelectWhiteboardFileDialog = (0, _react.useCallback)(() => {
|
|
33
33
|
eventBus.dispatch(_constants2.INTERNAL_EVENT.INSERT_ELEMENT, {
|
|
34
|
+
editor,
|
|
34
35
|
type: _constants.ELEMENT_TYPE.WHITEBOARD,
|
|
35
36
|
insertWhiteboard: _helpers.insertWhiteboard
|
|
36
37
|
});
|
|
37
38
|
toggle && toggle();
|
|
39
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
40
|
}, [toggle, eventBus]);
|
|
39
41
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_dropdownMenuItem.default, {
|
|
40
42
|
disabled: disabled,
|
|
@@ -53,7 +55,7 @@ const WhiteboardMenu = _ref => {
|
|
|
53
55
|
className: "sdoc-insert-whiteboard-menu-popover-container sdoc-dropdown-menu-container"
|
|
54
56
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
55
57
|
className: "sdoc-dropdown-menu-item",
|
|
56
|
-
onClick:
|
|
58
|
+
onClick: openSelectWhiteboardFileDialog
|
|
57
59
|
}, t('Upload_local_whiteboard')), /*#__PURE__*/_react.default.createElement("div", {
|
|
58
60
|
className: "sdoc-dropdown-menu-item",
|
|
59
61
|
onClick: onCreateFile
|