@seafile/seafile-editor 2.0.1 → 2.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.
Files changed (29) hide show
  1. package/dist/components/browser-tip/index.js +1 -1
  2. package/dist/components/longtext-modal.js +1 -1
  3. package/dist/containers/hotkeys-helper/index.js +1 -1
  4. package/dist/editors/inline-editor/index.js +1 -1
  5. package/dist/editors/simple-slate-editor/index.js +1 -1
  6. package/dist/editors/slate-editor/index.js +2 -2
  7. package/dist/editors/slate-viewer/index.js +2 -2
  8. package/dist/extension/commons/menu/menu-drop-down.js +4 -4
  9. package/dist/extension/commons/select/_option.js +2 -2
  10. package/dist/extension/commons/select/field-setting.js +1 -1
  11. package/dist/extension/commons/select/index.js +3 -3
  12. package/dist/extension/commons/select/menu/item.js +2 -2
  13. package/dist/extension/constants/element-types.js +6 -6
  14. package/dist/extension/constants/menus-config.js +25 -25
  15. package/dist/extension/plugins/column/render-elem.js +1 -1
  16. package/dist/extension/plugins/header/menu/index.js +2 -2
  17. package/dist/extension/plugins/header/render-elem.js +1 -1
  18. package/dist/extension/plugins/image/render-element/index.js +1 -1
  19. package/dist/extension/plugins/link/menu/index.js +1 -1
  20. package/dist/extension/plugins/table/menu/table-size-selector.js +2 -2
  21. package/dist/extension/plugins/text-style/render-elem.js +1 -1
  22. package/dist/pages/email-editor-dialog/index.js +1 -1
  23. package/dist/pages/longtext-editor-dialog/index.js +1 -1
  24. package/dist/slate-convert/html-to-slate/constants.js +6 -6
  25. package/dist/slate-convert/html-to-slate/index.js +2 -2
  26. package/dist/slate-convert/md-to-slate/transform.js +1 -1
  27. package/dist/slate-convert/slate-to-md/transform.js +2 -2
  28. package/dist/utils/object-utils.js +1 -1
  29. package/package.json +6 -6
@@ -20,6 +20,6 @@ function BrowserTip(_ref) {
20
20
  className: "browser-tip__icon iconfont icon-description"
21
21
  }), /*#__PURE__*/_react.default.createElement("span", {
22
22
  className: "browser-tip__message"
23
- }, "".concat(msg, "\u8BF7\u8BD5\u8BD5\u4EE5\u4E0B\u6D4F\u89C8\u5668: Chrome \u6D4F\u89C8\u5668\u6700\u65B0\u7248\uFF0C360 \u6781\u901F\u7248\uFF0CMicrosoft Edge \u6700\u65B0\u7248")));
23
+ }, `${msg}请试试以下浏览器: Chrome 浏览器最新版,360 极速版,Microsoft Edge 最新版`));
24
24
  }
25
25
  var _default = exports.default = BrowserTip;
@@ -27,7 +27,7 @@ class LongTextModal extends _react.default.Component {
27
27
  } = this.props;
28
28
  this.el = document.createElement('div');
29
29
  this.el.className = 'longtext-modal-wrapper';
30
- this.el.className = "longtext-modal-wrapper ".concat(containerClass || '');
30
+ this.el.className = `longtext-modal-wrapper ${containerClass || ''}`;
31
31
  document.body.appendChild(this.el);
32
32
  }
33
33
  componentDidMount() {
@@ -49,7 +49,7 @@ function HotkeysHelper() {
49
49
  shortcutData: shortcutDataNames
50
50
  } = item;
51
51
  return /*#__PURE__*/_react.default.createElement(_classifyHotkeys.default, {
52
- key: "use-hotkey-".concat(index),
52
+ key: `use-hotkey-${index}`,
53
53
  title: title,
54
54
  shortcutData: shortcutData,
55
55
  shortcutDataNames: shortcutDataNames
@@ -141,7 +141,7 @@ const InlineEditor = _ref => {
141
141
  initialValue: slateValue,
142
142
  onChange: onChange
143
143
  }, /*#__PURE__*/_react.default.createElement("div", {
144
- className: "sf-slate-scroll-container ".concat(isMacOS ? '' : 'isWin')
144
+ className: `sf-slate-scroll-container ${isMacOS ? '' : 'isWin'}`
145
145
  }, /*#__PURE__*/_react.default.createElement("div", {
146
146
  className: "sf-slate-article-container"
147
147
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -139,7 +139,7 @@ const SimpleSlateEditor = _ref => {
139
139
  initialValue: slateValue,
140
140
  onChange: onChange
141
141
  }, /*#__PURE__*/_react.default.createElement("div", {
142
- className: "sf-slate-scroll-container ".concat(isMacOS ? '' : 'isWin')
142
+ className: `sf-slate-scroll-container ${isMacOS ? '' : 'isWin'}`
143
143
  }, /*#__PURE__*/_react.default.createElement("div", {
144
144
  className: "sf-slate-article-container"
145
145
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -108,7 +108,7 @@ function SlateEditor(_ref) {
108
108
  }
109
109
  }, [editor, focusFirstNode]);
110
110
  return /*#__PURE__*/_react.default.createElement("div", {
111
- className: "sf-slate-editor-container ".concat(_common.isMobile && 'mobile')
111
+ className: `sf-slate-editor-container ${_common.isMobile && 'mobile'}`
112
112
  }, /*#__PURE__*/_react.default.createElement(_extension.Toolbar, {
113
113
  editor: editor,
114
114
  isRichEditor: true,
@@ -127,7 +127,7 @@ function SlateEditor(_ref) {
127
127
  onChange: onChange
128
128
  }, /*#__PURE__*/_react.default.createElement("div", {
129
129
  ref: scrollRef,
130
- className: "sf-slate-scroll-container ".concat(isMacOS ? '' : 'isWin')
130
+ className: `sf-slate-scroll-container ${isMacOS ? '' : 'isWin'}`
131
131
  }, /*#__PURE__*/_react.default.createElement("div", {
132
132
  className: "sf-slate-article-content"
133
133
  }, !_common.isMobile && /*#__PURE__*/_react.default.createElement(_outline.default, {
@@ -46,7 +46,7 @@ function SlateViewer(_ref) {
46
46
  // eslint-disable-next-line react-hooks/exhaustive-deps
47
47
  }, []);
48
48
  return /*#__PURE__*/_react.default.createElement("div", {
49
- className: "sf-slate-viewer-container ".concat(_common.isMobile && 'mobile')
49
+ className: `sf-slate-viewer-container ${_common.isMobile && 'mobile'}`
50
50
  }, /*#__PURE__*/_react.default.createElement(_slateReact.Slate, {
51
51
  editor: editor,
52
52
  initialValue: value
@@ -56,7 +56,7 @@ function SlateViewer(_ref) {
56
56
  }
57
57
  }, /*#__PURE__*/_react.default.createElement("div", {
58
58
  ref: scrollRef,
59
- className: "sf-slate-viewer-scroll-container ".concat(isMacOS ? '' : 'isWin', " ").concat(isShowOutline ? 'outline' : '')
59
+ className: `sf-slate-viewer-scroll-container ${isMacOS ? '' : 'isWin'} ${isShowOutline ? 'outline' : ''}`
60
60
  }, /*#__PURE__*/_react.default.createElement("div", {
61
61
  className: "sf-slate-article-content"
62
62
  }, isShowOutline && !_common.isMobile && /*#__PURE__*/_react.default.createElement(_outline.default, {
@@ -29,7 +29,7 @@ const MenuDropDown = props => {
29
29
  const {
30
30
  t
31
31
  } = (0, _reactI18next.useTranslation)(_constants.TRANSLATE_NAMESPACE);
32
- const containerId = (0, _react.useMemo)(() => "menu-dropdown-".concat(id), [id]);
32
+ const containerId = (0, _react.useMemo)(() => `menu-dropdown-${id}`, [id]);
33
33
  const handleHideDropDownList = (0, _react.useCallback)(e => {
34
34
  var _menuItemRef$current, _menuDropdownRef$curr;
35
35
  const isClickOnMenuItem = menuItemRef === null || menuItemRef === void 0 ? void 0 : (_menuItemRef$current = menuItemRef.current) === null || _menuItemRef$current === void 0 ? void 0 : _menuItemRef$current.contains(e.target);
@@ -61,11 +61,11 @@ const MenuDropDown = props => {
61
61
  }),
62
62
  onClick: !readonly && !isDisabled && registerClickEvent
63
63
  }, /*#__PURE__*/_react.default.createElement("span", {
64
- className: "sf-menu-with-dropdown-icon active ".concat(iconClass)
64
+ className: `sf-menu-with-dropdown-icon active ${iconClass}`
65
65
  }), /*#__PURE__*/_react.default.createElement("div", {
66
66
  className: "sf-menu-with-dropdown-triangle"
67
67
  }, /*#__PURE__*/_react.default.createElement("i", {
68
- className: "sf-menu-with-dropdown-triangle-icon iconfont icon-".concat(isShowDropDown ? 'caret-up' : 'drop-down')
68
+ className: `sf-menu-with-dropdown-triangle-icon iconfont icon-${isShowDropDown ? 'caret-up' : 'drop-down'}`
69
69
  })), !!isShowDropDown && /*#__PURE__*/_react.default.createElement("div", {
70
70
  ref: menuDropdownRef,
71
71
  className: "sf-dropdown-list "
@@ -83,7 +83,7 @@ const MenuDropDown = props => {
83
83
  className: (0, _classnames.default)('sf-dropdown-list-item'),
84
84
  onClick: event => handleClickDropDownItem(event, item, handleClick)
85
85
  }, isShowListItemIcon && iconClass && /*#__PURE__*/_react.default.createElement("i", {
86
- className: "sf-dropdown-menu-item-icon ".concat(iconClass)
86
+ className: `sf-dropdown-menu-item-icon ${iconClass}`
87
87
  }), /*#__PURE__*/_react.default.createElement("span", {
88
88
  className: "sf-dropdown-menu-item-text"
89
89
  }, t(text))));
@@ -25,12 +25,12 @@ class Option extends _react.default.Component {
25
25
  isActive,
26
26
  optionClass
27
27
  } = this.props;
28
- const className = "option-item ".concat(optionClass || '', " ").concat(isActive ? 'active' : '');
28
+ const className = `option-item ${optionClass || ''} ${isActive ? 'active' : ''}`;
29
29
  return /*#__PURE__*/_react.default.createElement("span", {
30
30
  className: className,
31
31
  onClick: this.onClick
32
32
  }, option.iconClass && /*#__PURE__*/_react.default.createElement("span", {
33
- className: "item-icon ".concat(option.iconClass)
33
+ className: `item-icon ${option.iconClass}`
34
34
  }), /*#__PURE__*/_react.default.createElement("span", {
35
35
  className: "label"
36
36
  }, option.label));
@@ -79,7 +79,7 @@ class FieldSetting extends _react.default.Component {
79
79
  const {
80
80
  isShowMenu
81
81
  } = this.state;
82
- const className = "sf-field-setting ".concat(isDisable ? 'disable' : '', " option-item");
82
+ const className = `sf-field-setting ${isDisable ? 'disable' : ''} option-item`;
83
83
  return /*#__PURE__*/_react.default.createElement("span", {
84
84
  ref: this.setSettingRef,
85
85
  className: className,
@@ -103,14 +103,14 @@ class Select extends _react.default.Component {
103
103
  const isActive = isShowSelector || isSelected;
104
104
  return /*#__PURE__*/_react.default.createElement("span", {
105
105
  ref: this.setSelectorRef,
106
- className: "select-container ".concat(selectClass || '')
106
+ className: `select-container ${selectClass || ''}`
107
107
  }, /*#__PURE__*/_react.default.createElement("span", {
108
- className: "control-container ".concat(isActive ? 'active' : ''),
108
+ className: `control-container ${isActive ? 'active' : ''}`,
109
109
  onClick: this.onSelectToggle
110
110
  }, !currentOption && /*#__PURE__*/_react.default.createElement("span", {
111
111
  className: "label placeholder"
112
112
  }, placeholder), currentOption && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
113
- className: "control-icon ".concat(currentOption.iconClass)
113
+ className: `control-icon ${currentOption.iconClass}`
114
114
  }), /*#__PURE__*/_react.default.createElement("span", {
115
115
  className: "control-label"
116
116
  }, currentOption.label)), /*#__PURE__*/_react.default.createElement("span", {
@@ -22,8 +22,8 @@ class MenuItem extends _react.default.Component {
22
22
  iconClass,
23
23
  isChecked
24
24
  } = this.props;
25
- const containerClass = "sf-menu-item ".concat(itemClass || '');
26
- const itemIconClass = "menu-item-icon ".concat(iconClass || '');
25
+ const containerClass = `sf-menu-item ${itemClass || ''}`;
26
+ const itemIconClass = `menu-item-icon ${iconClass || ''}`;
27
27
  return /*#__PURE__*/_react.default.createElement("span", {
28
28
  className: containerClass,
29
29
  onClick: this.onClick
@@ -7,12 +7,12 @@ exports.UNORDERED_LIST = exports.TABLE_ROW = exports.TABLE_CELL = exports.TABLE
7
7
  const BLOCKQUOTE = exports.BLOCKQUOTE = 'blockquote';
8
8
  const HEADER = exports.HEADER = 'header';
9
9
  // each header type should be start with HEADER, all of justices should based on HEADER
10
- const HEADER1 = exports.HEADER1 = "".concat(HEADER, "1");
11
- const HEADER2 = exports.HEADER2 = "".concat(HEADER, "2");
12
- const HEADER3 = exports.HEADER3 = "".concat(HEADER, "3");
13
- const HEADER4 = exports.HEADER4 = "".concat(HEADER, "4");
14
- const HEADER5 = exports.HEADER5 = "".concat(HEADER, "5");
15
- const HEADER6 = exports.HEADER6 = "".concat(HEADER, "6");
10
+ const HEADER1 = exports.HEADER1 = `${HEADER}1`;
11
+ const HEADER2 = exports.HEADER2 = `${HEADER}2`;
12
+ const HEADER3 = exports.HEADER3 = `${HEADER}3`;
13
+ const HEADER4 = exports.HEADER4 = `${HEADER}4`;
14
+ const HEADER5 = exports.HEADER5 = `${HEADER}5`;
15
+ const HEADER6 = exports.HEADER6 = `${HEADER}6`;
16
16
  const ORDERED_LIST = exports.ORDERED_LIST = 'ordered_list'; // <ol>
17
17
  const UNORDERED_LIST = exports.UNORDERED_LIST = 'unordered_list'; // <ul> // unordered_list can not work
18
18
  const LIST_ITEM = exports.LIST_ITEM = 'list_item'; // <li>
@@ -21,7 +21,7 @@ const TEXT_STYLE_MAP = exports.TEXT_STYLE_MAP = {
21
21
  CODE: CODE,
22
22
  DELETE: DELETE,
23
23
  ADD: ADD,
24
- BOLD_ITALIC: "".concat(BOLD, "_").concat(ITALIC)
24
+ BOLD_ITALIC: `${BOLD}_${ITALIC}`
25
25
  };
26
26
  const TABLE_SUBMENU_MAP = exports.TABLE_SUBMENU_MAP = {
27
27
  TABLE_ALIGN_LEFT: 'table_align_left',
@@ -35,123 +35,123 @@ const TABLE_SUBMENU_MAP = exports.TABLE_SUBMENU_MAP = {
35
35
  };
36
36
  const MENUS_CONFIG_MAP = exports.MENUS_CONFIG_MAP = {
37
37
  [_elementTypes.BLOCKQUOTE]: {
38
- id: "seafile_".concat(_elementTypes.BLOCKQUOTE),
38
+ id: `seafile_${_elementTypes.BLOCKQUOTE}`,
39
39
  iconClass: 'iconfont icon-quote-left',
40
40
  text: 'Quote'
41
41
  },
42
42
  [_elementTypes.ORDERED_LIST]: {
43
- id: "seafile_".concat(_elementTypes.ORDERED_LIST),
43
+ id: `seafile_${_elementTypes.ORDERED_LIST}`,
44
44
  iconClass: 'iconfont icon-list-ol',
45
45
  text: 'Ordered_list'
46
46
  },
47
47
  [_elementTypes.UNORDERED_LIST]: {
48
- id: "seafile_".concat(_elementTypes.UNORDERED_LIST),
48
+ id: `seafile_${_elementTypes.UNORDERED_LIST}`,
49
49
  iconClass: 'iconfont icon-list-ul',
50
50
  text: 'Unordered_list'
51
51
  },
52
52
  [_elementTypes.CHECK_LIST_ITEM]: {
53
- id: "seafle_".concat(_elementTypes.CHECK_LIST_ITEM),
53
+ id: `seafle_${_elementTypes.CHECK_LIST_ITEM}`,
54
54
  iconClass: 'iconfont icon-check-square',
55
55
  text: 'Check_list_item'
56
56
  },
57
57
  [_elementTypes.CODE_BLOCK]: {
58
- id: "seafile_".concat(_elementTypes.CODE_BLOCK),
58
+ id: `seafile_${_elementTypes.CODE_BLOCK}`,
59
59
  iconClass: 'iconfont icon-code-block',
60
60
  text: 'Code_block'
61
61
  },
62
62
  [_elementTypes.LINK]: {
63
- id: "seafile_".concat(_elementTypes.LINK),
63
+ id: `seafile_${_elementTypes.LINK}`,
64
64
  iconClass: 'iconfont icon-link',
65
65
  text: 'Insert_link'
66
66
  },
67
67
  [_elementTypes.IMAGE]: {
68
- id: "seafile_".concat(_elementTypes.IMAGE),
68
+ id: `seafile_${_elementTypes.IMAGE}`,
69
69
  iconClass: 'iconfont icon-image',
70
70
  text: 'Insert_image'
71
71
  },
72
72
  [_elementTypes.TABLE]: {
73
- id: "seafile_".concat(_elementTypes.TABLE),
73
+ id: `seafile_${_elementTypes.TABLE}`,
74
74
  iconClass: 'iconfont icon-table',
75
75
  text: 'Insert_table'
76
76
  },
77
77
  [ITALIC]: {
78
- id: "seafile_".concat(ITALIC),
78
+ id: `seafile_${ITALIC}`,
79
79
  iconClass: 'iconfont icon-italic',
80
80
  text: 'Italic',
81
81
  type: ITALIC
82
82
  },
83
83
  [BOLD]: {
84
- id: "seafile_".concat(BOLD),
84
+ id: `seafile_${BOLD}`,
85
85
  iconClass: 'iconfont icon-bold',
86
86
  text: 'Bold',
87
87
  type: BOLD
88
88
  },
89
89
  [CODE]: {
90
- id: "seafile_".concat(CODE),
90
+ id: `seafile_${CODE}`,
91
91
  iconClass: 'iconfont icon-code',
92
92
  text: 'Code',
93
93
  type: CODE
94
94
  },
95
95
  [TABLE_SUBMENU_MAP.TABLE_ALIGN_LEFT]: {
96
- id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_ALIGN_LEFT),
96
+ id: `seafile_${TABLE_SUBMENU_MAP.TABLE_ALIGN_LEFT}`,
97
97
  iconClass: 'iconfont icon-left-alignment',
98
98
  text: 'Left'
99
99
  },
100
100
  [TABLE_SUBMENU_MAP.TABLE_ALIGN_CENTER]: {
101
- id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_ALIGN_CENTER),
101
+ id: `seafile_${TABLE_SUBMENU_MAP.TABLE_ALIGN_CENTER}`,
102
102
  iconClass: 'iconfont icon-center-horizontally',
103
103
  text: 'Center'
104
104
  },
105
105
  [TABLE_SUBMENU_MAP.TABLE_ALIGN_RIGHT]: {
106
- id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_ALIGN_RIGHT),
106
+ id: `seafile_${TABLE_SUBMENU_MAP.TABLE_ALIGN_RIGHT}`,
107
107
  iconClass: 'iconfont icon-align-right',
108
108
  text: 'Right'
109
109
  },
110
110
  [TABLE_SUBMENU_MAP.TABLE_INSERT_COLUMN]: {
111
- id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_INSERT_COLUMN),
111
+ id: `seafile_${TABLE_SUBMENU_MAP.TABLE_INSERT_COLUMN}`,
112
112
  iconClass: 'iconfont icon-column',
113
113
  text: 'Insert_column'
114
114
  },
115
115
  [TABLE_SUBMENU_MAP.TABLE_DELETE_COLUMN]: {
116
- id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_DELETE_COLUMN),
116
+ id: `seafile_${TABLE_SUBMENU_MAP.TABLE_DELETE_COLUMN}`,
117
117
  text: 'Delete_column'
118
118
  },
119
119
  [TABLE_SUBMENU_MAP.TABLE_INSERT_ROW]: {
120
- id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_INSERT_ROW),
120
+ id: `seafile_${TABLE_SUBMENU_MAP.TABLE_INSERT_ROW}`,
121
121
  iconClass: 'iconfont icon-row',
122
122
  text: 'Insert_row'
123
123
  },
124
124
  [TABLE_SUBMENU_MAP.TABLE_DELETE_ROW]: {
125
- id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_DELETE_ROW),
125
+ id: `seafile_${TABLE_SUBMENU_MAP.TABLE_DELETE_ROW}`,
126
126
  text: 'Delete_row'
127
127
  },
128
128
  [TABLE_SUBMENU_MAP.TABLE_DELETE_TABLE]: {
129
- id: "seafile_".concat(TABLE_SUBMENU_MAP.TABLE_DELETE_TABLE),
129
+ id: `seafile_${TABLE_SUBMENU_MAP.TABLE_DELETE_TABLE}`,
130
130
  iconClass: 'iconfont icon-delete-table',
131
131
  text: 'Delete_table'
132
132
  },
133
133
  [_elementTypes.FORMULA]: {
134
- id: "seafile_".concat(_elementTypes.FORMULA),
134
+ id: `seafile_${_elementTypes.FORMULA}`,
135
135
  iconClass: 'iconfont icon-formula',
136
136
  text: 'Insert_formula'
137
137
  },
138
138
  [CLEAR_FORMAT]: {
139
- id: "seafile_".concat(CLEAR_FORMAT),
139
+ id: `seafile_${CLEAR_FORMAT}`,
140
140
  iconClass: 'iconfont icon-clear-format',
141
141
  text: 'Clear_format'
142
142
  },
143
143
  [_elementTypes.COLUMN]: {
144
- id: "seafile_".concat(_elementTypes.COLUMN),
144
+ id: `seafile_${_elementTypes.COLUMN}`,
145
145
  iconClass: 'iconfont icon-choose-column',
146
146
  text: 'Insert_column'
147
147
  },
148
148
  [MORE_OPERATION]: {
149
- id: "seafile_".concat(MORE_OPERATION),
149
+ id: `seafile_${MORE_OPERATION}`,
150
150
  iconClass: 'iconfont icon-more',
151
151
  text: ''
152
152
  },
153
153
  [EXPAND_EDITOR]: {
154
- id: "seafile_".concat(EXPAND_EDITOR),
154
+ id: `seafile_${EXPAND_EDITOR}`,
155
155
  iconClass: 'iconfont icon-fullscreen',
156
156
  text: 'Expand_editor'
157
157
  }
@@ -101,7 +101,7 @@ const renderColumn = props => {
101
101
  } = props;
102
102
  const data = element.data || {};
103
103
  const columnName = data.name;
104
- const displayValue = columnName ? "{".concat(columnName, "}") : '';
104
+ const displayValue = columnName ? `{${columnName}}` : '';
105
105
  return /*#__PURE__*/_react.default.createElement("span", attributes, displayValue);
106
106
  }
107
107
  return /*#__PURE__*/_react.default.createElement(Column, props);
@@ -76,12 +76,12 @@ const HeaderMenu = _ref => {
76
76
  }, /*#__PURE__*/_react.default.createElement("span", {
77
77
  className: "active"
78
78
  }, t(_constants.HEADER_TITLE_MAP[currentHeaderType !== null && currentHeaderType !== void 0 ? currentHeaderType : _constants.ELementTypes.PARAGRAPH])), !isDisabled && /*#__PURE__*/_react.default.createElement("span", {
79
- className: "iconfont icon-".concat(isShowHeaderPopover ? 'caret-up' : 'drop-down')
79
+ className: `iconfont icon-${isShowHeaderPopover ? 'caret-up' : 'drop-down'}`
80
80
  })), isShowHeaderPopover && /*#__PURE__*/_react.default.createElement("div", {
81
81
  ref: headerPopoverRef,
82
82
  className: "sf-header-popover"
83
83
  }, headerPopoverShowerList.map((item, index) => {
84
- const id = "".concat(item, "-").concat(index);
84
+ const id = `${item}-${index}`;
85
85
  const isSelected = currentHeaderType === item;
86
86
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
87
87
  key: index
@@ -14,7 +14,7 @@ const renderHeader = (props, editor) => {
14
14
  attributes,
15
15
  children
16
16
  } = props;
17
- const HeaderTagName = "h".concat(getHeaderTagName(element));
17
+ const HeaderTagName = `h${getHeaderTagName(element)}`;
18
18
  const style = {
19
19
  textAlign: element.align
20
20
  };
@@ -129,7 +129,7 @@ const renderImage = (_ref, editor) => {
129
129
  title: t('Full_screen')
130
130
  }))), isResizing && /*#__PURE__*/_react.default.createElement("span", {
131
131
  className: "image-size-info-tooltip"
132
- }, "".concat(t('Width'), ":").concat(imgSizeInfo.width, " ").concat(t('Height'), ":").concat(imgSizeInfo.height)), isFullScreening && /*#__PURE__*/_react.default.createElement(_imagePreviewer.default, {
132
+ }, `${t('Width')}:${imgSizeInfo.width} ${t('Height')}:${imgSizeInfo.height}`), isFullScreening && /*#__PURE__*/_react.default.createElement(_imagePreviewer.default, {
133
133
  imgUrl: element === null || element === void 0 ? void 0 : (_element$data4 = element.data) === null || _element$data4 === void 0 ? void 0 : _element$data4.src,
134
134
  toggleImagePreviewer: toggleImagePreviewer
135
135
  }), children);
@@ -65,7 +65,7 @@ const LinkMenu = _ref => {
65
65
  });
66
66
  }
67
67
  setIsOpenLinkModal(true);
68
- document.getElementById("seafile_".concat(_elementTypes.LINK)).blur();
68
+ document.getElementById(`seafile_${_elementTypes.LINK}`).blur();
69
69
  }, [editor, isLinkActive, linkInfo]);
70
70
  const onCloseModal = (0, _react.useCallback)(() => {
71
71
  setIsOpenLinkModal(false);
@@ -67,7 +67,7 @@ const TableSizeSelector = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
67
67
  className: (0, _classnames.default)('sf-table-selector-cell', {
68
68
  selected: isCellSelected
69
69
  }),
70
- key: "".concat(rowIndex, "-").concat(columnIndex)
70
+ key: `${rowIndex}-${columnIndex}`
71
71
  }));
72
72
  }
73
73
  rowElements.push( /*#__PURE__*/_react.default.createElement("div", {
@@ -85,6 +85,6 @@ const TableSizeSelector = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
85
85
  ref: ref
86
86
  }, /*#__PURE__*/_react.default.createElement("p", {
87
87
  className: "sf-table-grid-info"
88
- }, "".concat(selectedGridInfo.row, " x ").concat(selectedGridInfo.column)), tableGridElement);
88
+ }, `${selectedGridInfo.row} x ${selectedGridInfo.column}`), tableGridElement);
89
89
  });
90
90
  var _default = exports.default = TableSizeSelector;
@@ -42,7 +42,7 @@ const renderText = (props, editor) => {
42
42
  }
43
43
  if (leaf.decoration) {
44
44
  markedChildren = /*#__PURE__*/_react.default.createElement("span", {
45
- className: "token ".concat(leaf.type)
45
+ className: `token ${leaf.type}`
46
46
  }, markedChildren);
47
47
  }
48
48
  return /*#__PURE__*/_react.default.createElement("span", Object.assign({
@@ -123,7 +123,7 @@ function EmailEditorDialog(_ref) {
123
123
  className: "longtext-header-tool"
124
124
  }, /*#__PURE__*/_react.default.createElement("span", {
125
125
  onClick: onFullScreenToggle,
126
- className: "longtext-header-tool-item mr-1 dtable-font dtable-icon-full-screen ".concat(isFullScreen ? 'long-text-full-screen' : '')
126
+ className: `longtext-header-tool-item mr-1 dtable-font dtable-icon-full-screen ${isFullScreen ? 'long-text-full-screen' : ''}`
127
127
  }), /*#__PURE__*/_react.default.createElement("span", {
128
128
  onClick: onCloseToggle,
129
129
  className: "longtext-header-tool-item dtable-font dtable-icon-x"
@@ -167,7 +167,7 @@ function LongTextEditorDialog(_ref) {
167
167
  className: "longtext-header-tool"
168
168
  }, /*#__PURE__*/_react.default.createElement("span", {
169
169
  onClick: onFullScreenToggle,
170
- className: "longtext-header-tool-item mr-1 iconfont icon-full-screen ".concat(isFullScreen ? 'long-text-full-screen' : '')
170
+ className: `longtext-header-tool-item mr-1 iconfont icon-full-screen ${isFullScreen ? 'long-text-full-screen' : ''}`
171
171
  }), /*#__PURE__*/_react.default.createElement("span", {
172
172
  onClick: onCloseToggle,
173
173
  className: "longtext-header-tool-item iconfont icon-x"
@@ -7,12 +7,12 @@ exports.UNORDERED_LIST = exports.TOP_LEVEL_TYPES = exports.TABLE_ROW = exports.T
7
7
  const BLOCKQUOTE = exports.BLOCKQUOTE = 'blockquote';
8
8
  const HEADER = exports.HEADER = 'header';
9
9
  // each header type should be start with HEADER, all of justices should based on HEADER
10
- const HEADER1 = exports.HEADER1 = "".concat(HEADER, "1");
11
- const HEADER2 = exports.HEADER2 = "".concat(HEADER, "2");
12
- const HEADER3 = exports.HEADER3 = "".concat(HEADER, "3");
13
- const HEADER4 = exports.HEADER4 = "".concat(HEADER, "4");
14
- const HEADER5 = exports.HEADER5 = "".concat(HEADER, "5");
15
- const HEADER6 = exports.HEADER6 = "".concat(HEADER, "6");
10
+ const HEADER1 = exports.HEADER1 = `${HEADER}1`;
11
+ const HEADER2 = exports.HEADER2 = `${HEADER}2`;
12
+ const HEADER3 = exports.HEADER3 = `${HEADER}3`;
13
+ const HEADER4 = exports.HEADER4 = `${HEADER}4`;
14
+ const HEADER5 = exports.HEADER5 = `${HEADER}5`;
15
+ const HEADER6 = exports.HEADER6 = `${HEADER}6`;
16
16
  const ORDERED_LIST = exports.ORDERED_LIST = 'ordered_list'; // <ol>
17
17
  const UNORDERED_LIST = exports.UNORDERED_LIST = 'unordered_list'; // <ul> // unordered_list can not work
18
18
  const LIST_ITEM = exports.LIST_ITEM = 'list_item'; // <li>
@@ -28,7 +28,7 @@ const deserializeElement = element => {
28
28
  case 'undefined':
29
29
  return;
30
30
  default:
31
- throw new Error("The `next` argument was called with invalid children: \"".concat(elements, "\"."));
31
+ throw new Error(`The \`next\` argument was called with invalid children: "${elements}".`);
32
32
  }
33
33
  };
34
34
  for (let i = 0; i < _rules.default.length; i++) {
@@ -37,7 +37,7 @@ const deserializeElement = element => {
37
37
  const ret = rule(element, next);
38
38
  const type = (0, _typeOf.default)(ret);
39
39
  if (type !== 'array' && type !== 'object' && type !== 'null' && type !== 'undefined') {
40
- throw new Error("A rule returned an invalid deserialized representation: \"".concat(node, "\"."));
40
+ throw new Error(`A rule returned an invalid deserialized representation: "${node}".`);
41
41
  }
42
42
 
43
43
  // Not eligible for current component processing
@@ -131,7 +131,7 @@ const transformHeader = node => {
131
131
  const {
132
132
  depth
133
133
  } = node;
134
- const type = "".concat(_elementTypes.HEADER).concat(depth);
134
+ const type = `${_elementTypes.HEADER}${depth}`;
135
135
  return {
136
136
  id: _slugid.default.nice(),
137
137
  type: type,
@@ -112,7 +112,7 @@ const transformInlineChildren = (result, item) => {
112
112
  if (data.height || data.width) {
113
113
  image = {
114
114
  type: 'html',
115
- value: "<img src=\"".concat(data.src, "\" alt=\"").concat(data.alt, "\" title=\"").concat(data.title, "\" width=\"").concat(data.width, "\" height=\"").concat(data.height, "\" />")
115
+ value: `<img src="${data.src}" alt="${data.alt}" title="${data.title}" width="${data.width}" height="${data.height}" />`
116
116
  };
117
117
  }
118
118
  result.push(image);
@@ -133,7 +133,7 @@ const transformInlineChildren = (result, item) => {
133
133
  if (item.type && item.type === 'column') {
134
134
  const data = item.data;
135
135
  const newNode = {
136
- text: "{".concat(data.name, "}")
136
+ text: `{${data.name}}`
137
137
  };
138
138
  const column = transformTextNode(newNode);
139
139
  result.push(column);
@@ -20,7 +20,7 @@ class ObjectUtils {
20
20
  }
21
21
  static isObjectChanged(source, comparison, notIncludeKeys) {
22
22
  if (!this.iterable(source)) {
23
- throw new Error("source should be a Object or Array , but got ".concat(this.getDataType(source)));
23
+ throw new Error(`source should be a Object or Array , but got ${this.getDataType(source)}`);
24
24
  }
25
25
  if (this.getDataType(source) !== this.getDataType(comparison)) {
26
26
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -29,7 +29,7 @@
29
29
  "@babel/plugin-proposal-private-property-in-object": "7.21.11",
30
30
  "@babel/plugin-transform-class-properties": "7.23.3",
31
31
  "@babel/plugin-transform-private-methods": "7.23.3",
32
- "@babel/runtime": "7.22.15",
32
+ "@babel/runtime": "7.26.10",
33
33
  "axios": "^1.7.3",
34
34
  "babel-jest": "29.7.0",
35
35
  "babel-loader": "9.1.3",
@@ -38,7 +38,7 @@
38
38
  "clean-webpack-plugin": "4.0.0",
39
39
  "css-loader": "6.8.1",
40
40
  "css-minimizer-webpack-plugin": "5.0.1",
41
- "ejs": "3.1.9",
41
+ "ejs": "3.1.10",
42
42
  "eslint": "8.49.0",
43
43
  "eslint-config-react-app": "7.0.1",
44
44
  "file-loader": "6.2.0",
@@ -48,7 +48,7 @@
48
48
  "ignore-loader": "0.1.2",
49
49
  "jest": "29.7.0",
50
50
  "jest-environment-jsdom": "29.7.0",
51
- "koa": "2.14.2",
51
+ "koa": "2.16.0",
52
52
  "koa-router": "7.3.0",
53
53
  "koa-send": "5.0.1",
54
54
  "koa2-cors": "2.0.6",
@@ -68,7 +68,7 @@
68
68
  "style-loader": "3.3.3",
69
69
  "terser-webpack-plugin": "5.3.9",
70
70
  "url-loader": "4.1.1",
71
- "webpack": "5.88.2",
71
+ "webpack": "5.98.0",
72
72
  "webpack-dev-server": "4.15.1",
73
73
  "webpack-merge": "5.9.0"
74
74
  },
@@ -90,7 +90,7 @@
90
90
  "deep-copy": "1.4.2",
91
91
  "deepmerge": "4.3.1",
92
92
  "is-url": "^1.2.4",
93
- "prismjs": "1.29.0",
93
+ "prismjs": "1.30.0",
94
94
  "reactstrap": "9.2.3",
95
95
  "rehype-format": "5.0.0",
96
96
  "rehype-mathjax": "5.0.0",