@seafile/sdoc-editor 1.0.36-alpha.2 → 1.0.36-alpha.3

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.
@@ -24,7 +24,8 @@ export const INTERNAL_EVENT = {
24
24
  TABLE_SHOW_DRAG_HANDLER: 'table_show_drag_handler',
25
25
  TABLE_HIDE_DRAG_HANDLER: 'table_show_drag_handler',
26
26
  ON_PRINT: 'on_print',
27
- COMMENT_EDITOR_POST_COMMENT: 'comment_editor_post_comment'
27
+ COMMENT_EDITOR_POST_COMMENT: 'comment_editor_post_comment',
28
+ CLOSE_FILE_INSET_DIALOG: 'close_file_insert_dialog'
28
29
  };
29
30
  export const REVISION_DIFF_KEY = 'diff';
30
31
  export const REVISION_DIFF_VALUE = '1';
@@ -134,7 +134,7 @@ const FileLinkInsertDialog = _ref => {
134
134
  document.addEventListener('keydown', onKeydown);
135
135
  sdocScrollContainer.addEventListener('scroll', onScroll);
136
136
  const unsubscribeInsertLink = eventBus.subscribe(EXTERNAL_EVENT.INSERT_LINK, onInsertLink);
137
- const unsubscribeCloseDialog = eventBus.subscribe(EXTERNAL_EVENT.CLOSE_FILE_INSET_DIALOG, closeDialog);
137
+ const unsubscribeCloseDialog = eventBus.subscribe(INTERNAL_EVENT.CLOSE_FILE_INSET_DIALOG, closeDialog);
138
138
  return () => {
139
139
  sdocScrollContainer.removeEventListener('scroll', onScroll);
140
140
  document.removeEventListener('click', onClick);
@@ -15,6 +15,9 @@ const RenderFileLinkTempInput = _ref => {
15
15
  type: FILE_LINK_INSET_INPUT_TEMP,
16
16
  slateNode: element
17
17
  });
18
+ return () => {
19
+ eventBus.dispatch(INTERNAL_EVENT.CLOSE_FILE_INSET_DIALOG);
20
+ };
18
21
  }, [element, eventBus]);
19
22
  return /*#__PURE__*/React.createElement("span", Object.assign({}, attributes, {
20
23
  className: "sdoc-file-name-insert-collector"
@@ -20,7 +20,6 @@ export const EXTERNAL_EVENT = {
20
20
  PARTICIPANT_REMOVED: 'participant-removed',
21
21
  CREATE_SDOC_FILE: 'create_sdoc_file',
22
22
  CREATE_WIKI_PAGE: 'create_wiki_page',
23
- CLOSE_FILE_INSET_DIALOG: 'close_file_insert_dialog',
24
23
  // wiki
25
24
  INSERT_LINK: 'insert_link',
26
25
  // document
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "1.0.36-alpha.2",
3
+ "version": "1.0.36-alpha.3",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",