@seafile/sdoc-editor 1.0.198-test0.4 → 1.0.198-test0.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/basic-sdk/extension/commons/insert-element-dialog/index.js +3 -0
- package/dist/basic-sdk/extension/commons/select-file-dialog/index.js +2 -0
- package/dist/basic-sdk/extension/plugins/whiteboard/helpers.js +2 -0
- package/dist/basic-sdk/extension/plugins/whiteboard/menu/index.js +4 -4
- package/dist/basic-sdk/extension/plugins/whiteboard/render-elem.js +12 -8
- package/dist/basic-sdk/extension/toolbar/header-toolbar/insert-toolbar/index.js +1 -0
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ const InsertElementDialog = _ref => {
|
|
|
27
27
|
let {
|
|
28
28
|
editor
|
|
29
29
|
} = _ref;
|
|
30
|
+
console.log(3, editor);
|
|
30
31
|
const [dialogType, setDialogType] = (0, _react.useState)('');
|
|
31
32
|
const [element, setElement] = (0, _react.useState)('');
|
|
32
33
|
const [insertPosition, setInsertPosition] = (0, _react.useState)(_constants2.INSERT_POSITION.CURRENT);
|
|
@@ -97,6 +98,7 @@ const InsertElementDialog = _ref => {
|
|
|
97
98
|
// link shortcut wrapping link
|
|
98
99
|
handleSubmit
|
|
99
100
|
} = _ref2;
|
|
101
|
+
console.log(5, insertWhiteboard, paramEditor);
|
|
100
102
|
setInsertPosition(insertPosition);
|
|
101
103
|
setSlateNode(slateNode);
|
|
102
104
|
setElement(element);
|
|
@@ -181,6 +183,7 @@ const InsertElementDialog = _ref => {
|
|
|
181
183
|
insertWhiteboardFile,
|
|
182
184
|
closeDialog
|
|
183
185
|
};
|
|
186
|
+
console.log(555, editor, insertWhiteboardFile);
|
|
184
187
|
return /*#__PURE__*/_react.default.createElement(_index.default, whiteboardProps);
|
|
185
188
|
}
|
|
186
189
|
case _constants2.LOCAL_IMAGE:
|
|
@@ -24,6 +24,7 @@ const SelectSdocFileDialog = _ref => {
|
|
|
24
24
|
insertLinkCallback,
|
|
25
25
|
insertWhiteboardFile
|
|
26
26
|
} = _ref;
|
|
27
|
+
console.log(3, insertWhiteboardFile);
|
|
27
28
|
const {
|
|
28
29
|
t
|
|
29
30
|
} = (0, _reactI18next.useTranslation)('sdoc-editor');
|
|
@@ -61,6 +62,7 @@ const SelectSdocFileDialog = _ref => {
|
|
|
61
62
|
insertSdocFileLinkCallback && insertSdocFileLinkCallback(editor, fileInfo.name, fileInfo.file_uuid);
|
|
62
63
|
break;
|
|
63
64
|
case _constants.ELEMENT_TYPE.WHITEBOARD:
|
|
65
|
+
console.log(12, dialogType, editor);
|
|
64
66
|
insertWhiteboardFile && insertWhiteboardFile(editor, fileInfo.name, fileInfo.path);
|
|
65
67
|
break;
|
|
66
68
|
default:
|
|
@@ -13,6 +13,7 @@ var _eventBus = _interopRequireDefault(require("../../../utils/event-bus"));
|
|
|
13
13
|
var _constants2 = require("../../../../constants");
|
|
14
14
|
const isInsertWhiteboardMenuDisabled = (editor, readonly) => {
|
|
15
15
|
if (readonly) return true;
|
|
16
|
+
console.log(9, editor);
|
|
16
17
|
const {
|
|
17
18
|
selection
|
|
18
19
|
} = editor;
|
|
@@ -61,6 +62,7 @@ const generateWhiteboardNode = function (repoID) {
|
|
|
61
62
|
};
|
|
62
63
|
exports.generateWhiteboardNode = generateWhiteboardNode;
|
|
63
64
|
const insertWhiteboard = (editor, filename, filePath) => {
|
|
65
|
+
console.log(8, editor);
|
|
64
66
|
if (isInsertWhiteboardMenuDisabled(editor)) return;
|
|
65
67
|
const {
|
|
66
68
|
repoID
|
|
@@ -20,22 +20,22 @@ const WhiteboardMenu = _ref => {
|
|
|
20
20
|
eventBus,
|
|
21
21
|
toggle
|
|
22
22
|
} = _ref;
|
|
23
|
+
console.log(1, editor, readonly);
|
|
23
24
|
const disabled = (0, _helpers.isInsertWhiteboardMenuDisabled)(editor, readonly);
|
|
24
25
|
const menuConfig = _constants.MENUS_CONFIG_MAP[_constants.WHITEBOARD];
|
|
25
26
|
const {
|
|
26
27
|
t
|
|
27
|
-
} = (0, _reactI18next.useTranslation)();
|
|
28
|
+
} = (0, _reactI18next.useTranslation)('sdoc-editor');
|
|
28
29
|
const onCreateFile = () => {
|
|
29
30
|
(0, _helpers.onCreateWhiteboardFile)(editor);
|
|
30
31
|
};
|
|
31
32
|
const openSelectSdocFileDialog = (0, _react.useCallback)(() => {
|
|
32
33
|
eventBus.dispatch(_constants2.INTERNAL_EVENT.INSERT_ELEMENT, {
|
|
33
34
|
type: _constants.ELEMENT_TYPE.WHITEBOARD,
|
|
34
|
-
insertWhiteboard: _helpers.insertWhiteboard
|
|
35
|
+
insertWhiteboard: _helpers.insertWhiteboard,
|
|
36
|
+
paramEditor: editor || null
|
|
35
37
|
});
|
|
36
38
|
toggle && toggle();
|
|
37
|
-
|
|
38
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
39
|
}, [toggle, eventBus]);
|
|
40
40
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_dropdownMenuItem.default, {
|
|
41
41
|
disabled: disabled,
|
|
@@ -16,14 +16,14 @@ const Whiteboard = _ref => {
|
|
|
16
16
|
repoID,
|
|
17
17
|
filePath
|
|
18
18
|
} = _ref;
|
|
19
|
-
|
|
19
|
+
const whiteboardRef = (0, _react.useRef)();
|
|
20
20
|
const [tldraw, setTldraw] = (0, _react.useState)(null);
|
|
21
|
+
console.log(33, repoID, filePath);
|
|
21
22
|
const renderWhiteboardEditor = Tldraw => {
|
|
22
|
-
console.log(4, Tldraw);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}));
|
|
23
|
+
console.log(4, Tldraw, repoID, filePath);
|
|
24
|
+
if (Tldraw) {
|
|
25
|
+
setTldraw(() => Tldraw);
|
|
26
|
+
}
|
|
27
27
|
};
|
|
28
28
|
(0, _react.useEffect)(() => {
|
|
29
29
|
const eventBus = _eventBus.default.getInstance();
|
|
@@ -34,8 +34,12 @@ const Whiteboard = _ref => {
|
|
|
34
34
|
};
|
|
35
35
|
}, []);
|
|
36
36
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
-
id: "sdoc-whiteboard-container"
|
|
38
|
-
|
|
37
|
+
id: "sdoc-whiteboard-container",
|
|
38
|
+
ref: whiteboardRef
|
|
39
|
+
}, tldraw && /*#__PURE__*/_react.default.createElement("tldraw", {
|
|
40
|
+
repoID: repoID,
|
|
41
|
+
filePath: filePath
|
|
42
|
+
}));
|
|
39
43
|
};
|
|
40
44
|
function renderWhiteboard(props, editor) {
|
|
41
45
|
console.log(3, editor, props);
|
|
@@ -66,6 +66,7 @@ const InsertToolbar = _ref => {
|
|
|
66
66
|
readonly,
|
|
67
67
|
toggle
|
|
68
68
|
};
|
|
69
|
+
console.log(9, props.editor);
|
|
69
70
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
|
|
70
71
|
type: "button",
|
|
71
72
|
className: validClassName,
|