@seafile/sdoc-editor 2.0.38-alph-0.0.1 → 2.0.39

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.
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "PLUGIN_DISPLAY_TYPE", {
17
17
  return _plugin.PLUGIN_DISPLAY_TYPE;
18
18
  }
19
19
  });
20
- exports.Z_INDEX = exports.WIKI_OUTLINE = exports.WIKI_EDITOR_EDIT_AREA_WIDTH = exports.WIKI_EDITOR = exports.SDOC_STORAGE = exports.REVISION_DIFF_VALUE = exports.REVISION_DIFF_KEY = exports.REBASE_TYPES = exports.REBASE_TYPE = exports.REBASE_ORIGIN = exports.REBASE_MARK_KEY = exports.REBASE_MARKS = void 0;
20
+ exports.Z_INDEX = exports.WIKI_OUTLINE = exports.WIKI_EDITOR = exports.SDOC_STORAGE = exports.REVISION_DIFF_VALUE = exports.REVISION_DIFF_KEY = exports.REBASE_TYPES = exports.REBASE_TYPE = exports.REBASE_ORIGIN = exports.REBASE_MARK_KEY = exports.REBASE_MARKS = void 0;
21
21
  var Z_INDEX = _interopRequireWildcard(require("./z-index"));
22
22
  exports.Z_INDEX = Z_INDEX;
23
23
  var _plugin = require("./plugin");
@@ -55,7 +55,6 @@ const REVISION_DIFF_KEY = exports.REVISION_DIFF_KEY = 'diff';
55
55
  const REVISION_DIFF_VALUE = exports.REVISION_DIFF_VALUE = '1';
56
56
  const PAGE_EDIT_AREA_WIDTH = exports.PAGE_EDIT_AREA_WIDTH = 672; // 672 = 794 - 2[borderLeft + borderRight] - 120[paddingLeft + paddingRight]
57
57
  const COMMENT_EDITOR_EDIT_AREA_WIDTH = exports.COMMENT_EDITOR_EDIT_AREA_WIDTH = 364;
58
- const WIKI_EDITOR_EDIT_AREA_WIDTH = exports.WIKI_EDITOR_EDIT_AREA_WIDTH = 714;
59
58
  const COMMENT_EDITOR = exports.COMMENT_EDITOR = 'comment_editor';
60
59
  const WIKI_EDITOR = exports.WIKI_EDITOR = 'wiki_editor';
61
60
  const DOCUMENT_PLUGIN_EDITOR = exports.DOCUMENT_PLUGIN_EDITOR = 'document_plugin_editor';
@@ -47,7 +47,7 @@ const WikiEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
47
47
  cursors
48
48
  } = document;
49
49
  newEditor.cursors = cursors || {};
50
- newEditor.width = _constants.WIKI_EDITOR_EDIT_AREA_WIDTH; // default width
50
+ newEditor.width = _constants.PAGE_EDIT_AREA_WIDTH; // default width
51
51
  return newEditor;
52
52
 
53
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -32,7 +32,7 @@ const LinkHover = _ref => {
32
32
  location.href = element.href;
33
33
  }
34
34
  }, [element.href]);
35
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement("div", {
35
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement("div", {
36
36
  id: "link-op-menu",
37
37
  className: "link-op-menu",
38
38
  style: menuPosition
@@ -54,7 +54,7 @@ const SearchReplaceMenu = _ref => {
54
54
  const canvasList = [];
55
55
  for (let index = 0; index < generateCount; index++) {
56
56
  const top = index * 5000;
57
- canvasList.push(/*#__PURE__*/_react.default.createElement("canvas", {
57
+ canvasList.push( /*#__PURE__*/_react.default.createElement("canvas", {
58
58
  key: 'sdoc-find-search-' + index,
59
59
  id: `sdoc-find-search-${index}`,
60
60
  className: "sdoc-find-search-highlight-canvas",
@@ -79,7 +79,7 @@ const SearchReplaceMenu = _ref => {
79
79
  readonly: readonly,
80
80
  isOpen: isOpenPopover,
81
81
  closePopover: onMouseDown
82
- }), isOpenPopover && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement("div", {
82
+ }), isOpenPopover && /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement("div", {
83
83
  style: {
84
84
  height: articleContainerSize.clientHeight
85
85
  },
@@ -168,7 +168,7 @@ const SearchReplacePopover = _ref => {
168
168
  if ((0, _isHotkey.default)('enter', e)) handleNext();
169
169
  if ((0, _isHotkey.default)('enter+shift', e)) handleLast();
170
170
  };
171
- return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
171
+ return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
172
172
  className: "sdoc-search-replace-popover-container",
173
173
  onMouseDown: handleStartMove,
174
174
  onMouseMove: handleMouseMove,
@@ -78,7 +78,7 @@ class RowCardHeader extends _react.default.Component {
78
78
  // Start from the second column without name
79
79
  for (let i = 1; i < renderedColumns.length; i++) {
80
80
  const renderedColumn = renderedColumns[i];
81
- cardHeaderCells.push(/*#__PURE__*/_react.default.createElement(_rowCardHeaderCell.default, {
81
+ cardHeaderCells.push( /*#__PURE__*/_react.default.createElement(_rowCardHeaderCell.default, {
82
82
  key: renderedColumn.key,
83
83
  column: renderedColumn,
84
84
  rowCardType: rowCardType,
@@ -70,7 +70,7 @@ class DtableSearchInput extends _react.Component {
70
70
  const {
71
71
  ClearIndicator
72
72
  } = components;
73
- if (/*#__PURE__*/_react.default.isValidElement(ClearIndicator)) {
73
+ if ( /*#__PURE__*/_react.default.isValidElement(ClearIndicator)) {
74
74
  return /*#__PURE__*/_react.default.cloneElement(ClearIndicator, {
75
75
  clearValue: this.clearSearch
76
76
  });
@@ -310,7 +310,7 @@ class FilterItem extends _react.default.Component {
310
310
  background: inOption.color,
311
311
  color: inOption.textColor || null
312
312
  };
313
- labelArray.push(/*#__PURE__*/_react.default.createElement("span", {
313
+ labelArray.push( /*#__PURE__*/_react.default.createElement("span", {
314
314
  className: className,
315
315
  style: optionStyle,
316
316
  key: 'option_' + item,
@@ -205,7 +205,7 @@ const TableSizePopover = _ref => {
205
205
  });
206
206
  children.push(child);
207
207
  }
208
- tableSize.push(/*#__PURE__*/_react.default.createElement("div", {
208
+ tableSize.push( /*#__PURE__*/_react.default.createElement("div", {
209
209
  key: `sdoc-table-size-row-${i}`,
210
210
  className: "sdoc-table-size-row d-flex"
211
211
  }, children));
@@ -62,7 +62,7 @@ const ContextToolbar = () => {
62
62
  el.removeAttribute('style');
63
63
  }
64
64
  }, []);
65
- return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement("div", {
65
+ return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement("div", {
66
66
  ref: ref,
67
67
  className: "sdoc-context-toolbar",
68
68
  onMouseDown: onMouseDown,
@@ -63,20 +63,22 @@ const onSetNodeType = (editor, element, type) => {
63
63
  // Callout, List-item, Blockquote in multi_column
64
64
  if ([_constants.CALL_OUT].includes(currentNodeInColumn.type)) {
65
65
  (0, _helper.unwrapCallout)(editor);
66
+ return;
66
67
  }
67
68
  if ([_constants.ORDERED_LIST, _constants.UNORDERED_LIST].includes(currentNodeInColumn.type)) {
68
69
  (0, _transforms.toggleList)(editor, currentNodeInColumn.type);
69
70
  if ([..._constants.HEADERS].includes(type)) {
70
71
  (0, _helpers5.setHeaderType)(editor, type);
71
72
  }
73
+ return;
72
74
  }
73
75
  if ([_constants.BLOCKQUOTE].includes(currentNodeInColumn.type)) {
74
76
  if ([..._constants.HEADERS].includes(type)) {
75
77
  (0, _helpers5.setHeaderType)(editor, type);
76
78
  }
77
79
  (0, _helpers4.setBlockQuoteType)(editor, true);
80
+ return;
78
81
  }
79
- return;
80
82
  } else {
81
83
  // List-item, blockquote, callout is top node
82
84
  if ([_constants.ORDERED_LIST, _constants.UNORDERED_LIST].includes(topNodeType)) {
@@ -84,17 +86,19 @@ const onSetNodeType = (editor, element, type) => {
84
86
  if ([..._constants.HEADERS].includes(type)) {
85
87
  (0, _helpers5.setHeaderType)(editor, type);
86
88
  }
89
+ return;
87
90
  }
88
91
  if ([_constants.BLOCKQUOTE].includes(topNodeType)) {
89
92
  if ([..._constants.HEADERS].includes(type)) {
90
93
  (0, _helpers5.setHeaderType)(editor, type);
91
94
  }
92
95
  (0, _helpers4.setBlockQuoteType)(editor, true);
96
+ return;
93
97
  }
94
98
  if ([_constants.CALL_OUT].includes(topNodeType)) {
95
99
  (0, _helper.unwrapCallout)(editor);
100
+ return;
96
101
  }
97
- return;
98
102
  }
99
103
  }
100
104
  if (type === _constants.CHECK_LIST_ITEM) {
@@ -67,7 +67,7 @@ class Toaster {
67
67
  container.setAttribute('data-evergreen-toaster-container', '');
68
68
  document.body.appendChild(container);
69
69
  const root = (0, _client.createRoot)(container);
70
- root.render(/*#__PURE__*/_react.default.createElement(_toastManager.default, {
70
+ root.render( /*#__PURE__*/_react.default.createElement(_toastManager.default, {
71
71
  bindNotify: this._bindNotify,
72
72
  bindGetToasts: this._bindGetToasts,
73
73
  bindCloseAll: this._bindCloseAll
@@ -42,7 +42,7 @@ const SdocWikiEditor = _ref => {
42
42
  cursors
43
43
  } = document;
44
44
  newEditor.cursors = cursors || {};
45
- newEditor.width = _constants.WIKI_EDITOR_EDIT_AREA_WIDTH; // default width
45
+ newEditor.width = _constants.PAGE_EDIT_AREA_WIDTH; // default width
46
46
  newEditor.editorType = _constants.WIKI_EDITOR;
47
47
  return newEditor;
48
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "2.0.38-alph-0.0.1",
3
+ "version": "2.0.39",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",