@seafile/seafile-sdoc-editor 2.0.47 → 2.0.48-test-0.0.2
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.
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
-
var
|
|
9
|
+
var _regenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactI18next = require("react-i18next");
|
|
@@ -15,23 +15,22 @@ var _sdocEditor = require("@seafile/sdoc-editor");
|
|
|
15
15
|
require("./error-page.css");
|
|
16
16
|
function ErrorPage(_ref) {
|
|
17
17
|
var t = _ref.t;
|
|
18
|
-
var normalizeSdoc = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/(0,
|
|
18
|
+
var normalizeSdoc = (0, _react.useCallback)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee() {
|
|
19
19
|
var res, success;
|
|
20
|
-
return (0,
|
|
21
|
-
while (1) switch (_context.
|
|
20
|
+
return (0, _regenerator2["default"])().w(function (_context) {
|
|
21
|
+
while (1) switch (_context.n) {
|
|
22
22
|
case 0:
|
|
23
|
-
_context.
|
|
23
|
+
_context.n = 1;
|
|
24
24
|
return _sdocEditor.context.normalizeSdocContent();
|
|
25
|
-
case
|
|
26
|
-
res = _context.
|
|
25
|
+
case 1:
|
|
26
|
+
res = _context.v;
|
|
27
27
|
success = res.data.success;
|
|
28
28
|
if (success) {
|
|
29
29
|
// eslint-disable-next-line no-restricted-globals
|
|
30
30
|
location.reload(true);
|
|
31
31
|
}
|
|
32
|
-
case
|
|
33
|
-
|
|
34
|
-
return _context.stop();
|
|
32
|
+
case 2:
|
|
33
|
+
return _context.a(2);
|
|
35
34
|
}
|
|
36
35
|
}, _callee);
|
|
37
36
|
})), []);
|
package/dist/constants/index.js
CHANGED
|
@@ -20,6 +20,8 @@ var EXTERNAL_EVENT = exports.EXTERNAL_EVENT = {
|
|
|
20
20
|
REFRESH_DOCUMENT: _sdocEditor.INTERNAL_EVENT.REFRESH_DOCUMENT,
|
|
21
21
|
NEW_NOTIFICATION: _sdocEditor.INTERNAL_EVENT.NEW_NOTIFICATION,
|
|
22
22
|
CLEAR_NOTIFICATION: _sdocEditor.INTERNAL_EVENT.CLEAR_NOTIFICATION,
|
|
23
|
+
CREATE_WHITEBOARD_FILE: _sdocEditor.INTERNAL_EVENT.CREATE_WHITEBOARD_FILE,
|
|
24
|
+
GENERATE_EXDRAW_READ_ONLY_LINK: _sdocEditor.INTERNAL_EVENT.GENERATE_EXDRAW_READ_ONLY_LINK,
|
|
23
25
|
// wiki
|
|
24
26
|
CREATE_SDOC_FILE: _sdocEditor.INTERNAL_EVENT.CREATE_SDOC_FILE,
|
|
25
27
|
CREATE_WIKI_PAGE: _sdocEditor.INTERNAL_EVENT.CREATE_WIKI_PAGE,
|
|
@@ -15,7 +15,10 @@ var SdocWikiEditor = function SdocWikiEditor(_ref) {
|
|
|
15
15
|
var document = _ref.document,
|
|
16
16
|
docUuid = _ref.docUuid,
|
|
17
17
|
isWikiReadOnly = _ref.isWikiReadOnly,
|
|
18
|
-
scrollRef = _ref.scrollRef
|
|
18
|
+
scrollRef = _ref.scrollRef,
|
|
19
|
+
collaborators = _ref.collaborators,
|
|
20
|
+
showComment = _ref.showComment,
|
|
21
|
+
isShowRightPanel = _ref.isShowRightPanel;
|
|
19
22
|
_sdocEditor.context.initApi();
|
|
20
23
|
var validEditor = (0, _react.useMemo)(function () {
|
|
21
24
|
var defaultEditor = (0, _sdocEditor.createWikiEditor)();
|
|
@@ -46,12 +49,26 @@ var SdocWikiEditor = function SdocWikiEditor(_ref) {
|
|
|
46
49
|
validEditor.closeConnection();
|
|
47
50
|
};
|
|
48
51
|
}, [isWikiReadOnly, validEditor]);
|
|
49
|
-
|
|
52
|
+
|
|
53
|
+
// If you don't display comment, use Fragment to replace CommentProvider
|
|
54
|
+
var WithCommentProvider = showComment ? CommentProvider : Fragment;
|
|
55
|
+
console.log(2, isShowRightPanel);
|
|
56
|
+
return /*#__PURE__*/_react["default"].createElement(_errorBoundary["default"], null, /*#__PURE__*/_react["default"].createElement(_sdocEditor.CollaboratorsProvider, {
|
|
57
|
+
collaborators: collaborators
|
|
58
|
+
}, /*#__PURE__*/_react["default"].createElement(_sdocEditor.PluginsProvider, {
|
|
59
|
+
plugins: [],
|
|
60
|
+
showComment: showComment
|
|
61
|
+
}, /*#__PURE__*/_react["default"].createElement(WithCommentProvider, showComment && {
|
|
62
|
+
editor: validEditor
|
|
63
|
+
}, /*#__PURE__*/_react["default"].createElement(_sdocEditor.WikiEditor, {
|
|
50
64
|
document: document,
|
|
51
65
|
docUuid: docUuid,
|
|
52
66
|
editor: validEditor,
|
|
53
67
|
isWikiReadOnly: isWikiReadOnly,
|
|
54
|
-
scrollRef: scrollRef
|
|
55
|
-
|
|
68
|
+
scrollRef: scrollRef,
|
|
69
|
+
showComment: showComment
|
|
70
|
+
}), isShowRightPanel && /*#__PURE__*/_react["default"].createElement(_sdocEditor.RightPanel, {
|
|
71
|
+
editor: validEditor
|
|
72
|
+
})))));
|
|
56
73
|
};
|
|
57
74
|
var _default = exports["default"] = (0, _reactI18next.withTranslation)('sdoc-editor')(SdocWikiEditor);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
-
var
|
|
9
|
+
var _regenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
11
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
12
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
@@ -35,39 +35,38 @@ var SimpleViewer = /*#__PURE__*/function (_React$Component) {
|
|
|
35
35
|
return (0, _createClass2["default"])(SimpleViewer, [{
|
|
36
36
|
key: "componentDidMount",
|
|
37
37
|
value: function () {
|
|
38
|
-
var _componentDidMount = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0,
|
|
39
|
-
var contentRes, result;
|
|
40
|
-
return (0,
|
|
41
|
-
while (1) switch (_context.
|
|
38
|
+
var _componentDidMount = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee() {
|
|
39
|
+
var contentRes, result, _t;
|
|
40
|
+
return (0, _regenerator2["default"])().w(function (_context) {
|
|
41
|
+
while (1) switch (_context.p = _context.n) {
|
|
42
42
|
case 0:
|
|
43
43
|
_sdocEditor.context.initApi();
|
|
44
|
-
_context.
|
|
45
|
-
_context.
|
|
44
|
+
_context.p = 1;
|
|
45
|
+
_context.n = 2;
|
|
46
46
|
return _sdocEditor.context.getFileContent();
|
|
47
|
-
case
|
|
48
|
-
contentRes = _context.
|
|
47
|
+
case 2:
|
|
48
|
+
contentRes = _context.v;
|
|
49
49
|
result = contentRes.data || null;
|
|
50
50
|
this.setState({
|
|
51
51
|
isContextInit: true,
|
|
52
52
|
document: result
|
|
53
53
|
});
|
|
54
|
-
_context.
|
|
54
|
+
_context.n = 4;
|
|
55
55
|
break;
|
|
56
|
-
case
|
|
57
|
-
_context.
|
|
58
|
-
|
|
56
|
+
case 3:
|
|
57
|
+
_context.p = 3;
|
|
58
|
+
_t = _context.v;
|
|
59
59
|
// eslint-disable-next-line
|
|
60
|
-
console.log(
|
|
60
|
+
console.log(_t);
|
|
61
61
|
this.setState({
|
|
62
62
|
isContextInit: true,
|
|
63
63
|
errorMessage: 'Load_doc_content_error',
|
|
64
64
|
document: null
|
|
65
65
|
});
|
|
66
|
-
case
|
|
67
|
-
|
|
68
|
-
return _context.stop();
|
|
66
|
+
case 4:
|
|
67
|
+
return _context.a(2);
|
|
69
68
|
}
|
|
70
|
-
}, _callee, this, [[1,
|
|
69
|
+
}, _callee, this, [[1, 3]]);
|
|
71
70
|
}));
|
|
72
71
|
function componentDidMount() {
|
|
73
72
|
return _componentDidMount.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/seafile-sdoc-editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.48-test-0.0.2",
|
|
4
4
|
"author": "shuntian <978987373@qq.com>",
|
|
5
5
|
"homepage": "https://github.com/seafileltd/sea-sdoc-editor#readme",
|
|
6
6
|
"license": "ISC",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"description": "",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@seafile/print-js": "1.6.6",
|
|
32
|
-
"@seafile/sdoc-editor": "^2.0.
|
|
32
|
+
"@seafile/sdoc-editor": "^2.0.131-test-0.0.2",
|
|
33
33
|
"classnames": "2.3.2",
|
|
34
34
|
"dayjs": "1.10.7"
|
|
35
35
|
},
|
|
@@ -44,6 +44,5 @@
|
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
|
-
}
|
|
48
|
-
"gitHead": "10b0c1c64b87fea3d83594109d061393c24d66a8"
|
|
47
|
+
}
|
|
49
48
|
}
|
package/LICENSE.txt
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2025 Seafile Ltd.
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
See the License for the specific language governing permissions and
|
|
13
|
-
limitations under the License.
|