@seafile/comment-editor 0.0.1-alpha.73 → 0.0.1-alpha.75

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.
@@ -47,14 +47,11 @@ const CommentEditor = _ref => {
47
47
  toolMenus = ['text_style', _constants2.BLOCKQUOTE, _constants2.UNORDERED_LIST, _constants2.ORDERED_LIST, _constants2.LINK, _constants2.IMAGE],
48
48
  closePanel
49
49
  } = _ref;
50
- const commentWrapperRef = (0, _react.useRef)();
51
- // const { t } = useTranslation('sdoc-editor');
50
+ // const commentWrapperRef = useRef();
52
51
  const {
53
- className,
54
- userInfo,
55
- type,
56
- addParticipants
57
- } = (0, _useComment.useComment)();
52
+ t
53
+ } = (0, _reactI18next.useTranslation)('sdoc-editor');
54
+ // const { className, userInfo, type, addParticipants } = useComment();
58
55
  // const submitTip = useMemo(() => getSubmitTip(type, content), [content, type]);
59
56
 
60
57
  // const document = useMemo(() => {
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
+ var _react = _interopRequireWildcard(require("react"));
9
10
  var _basicSdk = require("../basic-sdk");
10
11
  var _errorBoundary = _interopRequireDefault(require("../components/error-boundary"));
11
12
  // import { I18nextProvider } from 'react-i18next';
@@ -41,29 +42,26 @@ const SeafileCommentEditor = _ref => {
41
42
  lang
42
43
  } = settings || {};
43
44
  _basicSdk.context.init(settings, api);
44
- return (
45
- /*#__PURE__*/
46
- // <I18nextProvider i18n={ getI18n(lang || 'en') }>
47
- _react.default.createElement(_errorBoundary.default, null, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentProvider, {
48
- type: type,
49
- className: className,
50
- pluginName: pluginName,
51
- pluginEventBus: pluginEventBus,
52
- pluginEvent: pluginEvent,
53
- collaborators: collaborators,
54
- participants: participants,
55
- addParticipants: addParticipants
56
- }, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentEditor, {
57
- content: content,
58
- insertContent: insertContent,
59
- onContentChange: onContentChange,
60
- hiddenUserInfo: hiddenUserInfo,
61
- hiddenComment: hiddenComment,
62
- toolMenus: toolMenus,
63
- closePanel: closePanel,
64
- addParticipants: addParticipants
65
- })))
66
- // </I18nextProvider>
67
- );
45
+ return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
46
+ fallback: "loading"
47
+ }, /*#__PURE__*/_react.default.createElement(_errorBoundary.default, null, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentProvider, {
48
+ type: type,
49
+ className: className,
50
+ pluginName: pluginName,
51
+ pluginEventBus: pluginEventBus,
52
+ pluginEvent: pluginEvent,
53
+ collaborators: collaborators,
54
+ participants: participants,
55
+ addParticipants: addParticipants
56
+ }, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentEditor, {
57
+ content: content,
58
+ insertContent: insertContent,
59
+ onContentChange: onContentChange,
60
+ hiddenUserInfo: hiddenUserInfo,
61
+ hiddenComment: hiddenComment,
62
+ toolMenus: toolMenus,
63
+ closePanel: closePanel,
64
+ addParticipants: addParticipants
65
+ }))));
68
66
  };
69
67
  var _default = exports.default = SeafileCommentEditor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/comment-editor",
3
- "version": "0.0.1-alpha.73",
3
+ "version": "0.0.1-alpha.75",
4
4
  "private": false,
5
5
  "description": "This is a comment editor",
6
6
  "main": "dist/index.js",