@seafile/sdoc-editor 3.0.23 → 3.0.25
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.
- package/dist/comment/components/global-comment/index.css +0 -4
- package/dist/extension/constants/menus-config.js +0 -5
- package/dist/extension/plugins/ai/ai-module/style.css +3 -2
- package/dist/extension/plugins/link/helpers.js +9 -1
- package/dist/extension/plugins/link/plugin.js +29 -17
- package/dist/extension/toolbar/insert-element-toolbar/index.js +59 -59
- package/package.json +2 -2
|
@@ -351,11 +351,6 @@ var SIDE_INSERT_MENUS_CONFIG = exports.SIDE_INSERT_MENUS_CONFIG = (_SIDE_INSERT_
|
|
|
351
351
|
iconClass: 'sdocfont sdoc-header3',
|
|
352
352
|
type: _elementType.HEADER3,
|
|
353
353
|
text: 'Header_three'
|
|
354
|
-
}, {
|
|
355
|
-
id: _elementType.HEADER4,
|
|
356
|
-
iconClass: 'sdocfont sdoc-header4',
|
|
357
|
-
type: _elementType.HEADER4,
|
|
358
|
-
text: 'Header_four'
|
|
359
354
|
}]), _elementType.MULTI_COLUMN, [{
|
|
360
355
|
id: _elementType.TWO_COLUMN,
|
|
361
356
|
iconClass: 'sdocfont sdoc-multi-column',
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.upsertLinkText = exports.updateLink = exports.unWrapLinkNode = exports.parseHtmlString = exports.isWeChat = exports.isSdocFile = exports.isNodeInCurrentView = exports.isMenuDisabled = exports.isLinkToolBarActive = exports.isEmptyNode = exports.insertLink = exports.getMenuPosition = exports.getLinkType = exports.genLinkNode = exports.checkLink = void 0;
|
|
7
|
+
exports.upsertLinkText = exports.updateLink = exports.unWrapLinkNode = exports.parseHtmlString = exports.isWeChat = exports.isSdocFile = exports.isNodeInCurrentView = exports.isMenuDisabled = exports.isLinkToolBarActive = exports.isExdrawFile = exports.isEmptyNode = exports.insertLink = exports.getMenuPosition = exports.getLinkType = exports.genLinkNode = exports.checkLink = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
@@ -206,6 +206,14 @@ var isSdocFile = exports.isSdocFile = function isSdocFile(res, url) {
|
|
|
206
206
|
file_ext = _ref3.file_ext;
|
|
207
207
|
return !is_dir && file_ext === 'sdoc';
|
|
208
208
|
};
|
|
209
|
+
var isExdrawFile = exports.isExdrawFile = function isExdrawFile(res, url) {
|
|
210
|
+
var files_info = res.data.files_info;
|
|
211
|
+
var fileInfo = files_info[url];
|
|
212
|
+
var _ref4 = fileInfo || {},
|
|
213
|
+
is_dir = _ref4.is_dir,
|
|
214
|
+
file_ext = _ref4.file_ext;
|
|
215
|
+
return !is_dir && file_ext === 'exdraw';
|
|
216
|
+
};
|
|
209
217
|
var isWeChat = exports.isWeChat = function isWeChat() {
|
|
210
218
|
var ua = window.navigator.userAgent.toLowerCase();
|
|
211
219
|
var isWeChat = ua.match(/MicroMessenger/i) === 'micromessenger';
|
|
@@ -19,6 +19,7 @@ var _constants2 = require("../../constants");
|
|
|
19
19
|
var _core = require("../../core");
|
|
20
20
|
var _utils = require("../../utils");
|
|
21
21
|
var _helpers = require("../sdoc-link/helpers");
|
|
22
|
+
var _helper = require("../whiteboard/helper");
|
|
22
23
|
var _helpers2 = require("./helpers");
|
|
23
24
|
var withLink = function withLink(editor) {
|
|
24
25
|
var normalizeNode = editor.normalizeNode,
|
|
@@ -39,18 +40,18 @@ var withLink = function withLink(editor) {
|
|
|
39
40
|
};
|
|
40
41
|
newEditor.insertData = /*#__PURE__*/function () {
|
|
41
42
|
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee(data) {
|
|
42
|
-
var text, res, fileName, fileUuid, url, linkedNodeId, title, params, link, _link, _link2, _Editor$next, _Editor$next2, focusPath, focusPoint, _t;
|
|
43
|
+
var text, res, fileName, fileUuid, _fileName, fileParentPath, filePath, url, linkedNodeId, title, params, link, _link, _link2, _Editor$next, _Editor$next2, focusPath, focusPoint, _t;
|
|
43
44
|
return (0, _regenerator2["default"])().w(function (_context) {
|
|
44
45
|
while (1) switch (_context.p = _context.n) {
|
|
45
46
|
case 0:
|
|
46
47
|
// Paste link content
|
|
47
48
|
text = data.getData('text/plain'); // Internal link, insert sdoc file link
|
|
48
49
|
if (!((0, _isUrl["default"])(text) && !(0, _utils.isImage)(text))) {
|
|
49
|
-
_context.n =
|
|
50
|
+
_context.n = 11;
|
|
50
51
|
break;
|
|
51
52
|
}
|
|
52
53
|
if (!(0, _utils.isSameDomain)(text, _context2["default"].getSetting('serviceUrl'))) {
|
|
53
|
-
_context.n =
|
|
54
|
+
_context.n = 9;
|
|
54
55
|
break;
|
|
55
56
|
}
|
|
56
57
|
_context.p = 1;
|
|
@@ -65,19 +66,30 @@ var withLink = function withLink(editor) {
|
|
|
65
66
|
fileName = res.data.files_info[text].name;
|
|
66
67
|
fileUuid = res.data.files_info[text].file_uuid;
|
|
67
68
|
(0, _helpers.insertSdocFileLink)(editor, fileName, fileUuid);
|
|
68
|
-
_context.n =
|
|
69
|
+
_context.n = 6;
|
|
69
70
|
break;
|
|
70
71
|
case 3:
|
|
72
|
+
if (!(0, _helpers2.isExdrawFile)(res, text)) {
|
|
73
|
+
_context.n = 4;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
_fileName = res.data.files_info[text].name;
|
|
77
|
+
fileParentPath = res.data.files_info[text].parent_path;
|
|
78
|
+
filePath = fileParentPath + '/' + _fileName;
|
|
79
|
+
(0, _helper.insertWhiteboard)(editor, _fileName, filePath);
|
|
80
|
+
_context.n = 6;
|
|
81
|
+
break;
|
|
82
|
+
case 4:
|
|
71
83
|
url = new URL(text);
|
|
72
84
|
linkedNodeId = url.hash.replace(/^#/, '');
|
|
73
85
|
if (!(editor.selection && !_slate.Range.isCollapsed(editor.selection))) {
|
|
74
|
-
_context.n =
|
|
86
|
+
_context.n = 5;
|
|
75
87
|
break;
|
|
76
88
|
}
|
|
77
89
|
title = (0, _core.getEditorString)(editor, editor.selection);
|
|
78
90
|
(0, _helpers2.insertLink)(editor, title, text, _constants2.INSERT_POSITION.CURRENT, null, linkedNodeId);
|
|
79
91
|
return _context.a(2);
|
|
80
|
-
case
|
|
92
|
+
case 5:
|
|
81
93
|
params = new URLSearchParams(url.search);
|
|
82
94
|
if (params.get('from') === 'copy-block') {
|
|
83
95
|
link = (0, _helpers2.genLinkNode)(text, text, linkedNodeId);
|
|
@@ -85,32 +97,32 @@ var withLink = function withLink(editor) {
|
|
|
85
97
|
link = (0, _helpers2.genLinkNode)(text, text);
|
|
86
98
|
}
|
|
87
99
|
_slate.Transforms.insertNodes(newEditor, link);
|
|
88
|
-
case 5:
|
|
89
|
-
_context.n = 7;
|
|
90
|
-
break;
|
|
91
100
|
case 6:
|
|
92
|
-
_context.
|
|
101
|
+
_context.n = 8;
|
|
102
|
+
break;
|
|
103
|
+
case 7:
|
|
104
|
+
_context.p = 7;
|
|
93
105
|
_t = _context.v;
|
|
94
106
|
_link = (0, _helpers2.genLinkNode)(text, text);
|
|
95
107
|
_slate.Transforms.insertNodes(newEditor, _link);
|
|
96
|
-
case 7:
|
|
97
|
-
_context.n = 9;
|
|
98
|
-
break;
|
|
99
108
|
case 8:
|
|
109
|
+
_context.n = 10;
|
|
110
|
+
break;
|
|
111
|
+
case 9:
|
|
100
112
|
_link2 = (0, _helpers2.genLinkNode)(text, text);
|
|
101
113
|
_slate.Transforms.insertNodes(newEditor, _link2);
|
|
102
|
-
case
|
|
114
|
+
case 10:
|
|
103
115
|
// Void merging text from link
|
|
104
116
|
_Editor$next = _slate.Editor.next(newEditor), _Editor$next2 = (0, _slicedToArray2["default"])(_Editor$next, 2), focusPath = _Editor$next2[1];
|
|
105
117
|
focusPoint = _slate.Editor.start(newEditor, focusPath);
|
|
106
118
|
_slate.Transforms.select(newEditor, focusPoint);
|
|
107
119
|
return _context.a(2);
|
|
108
|
-
case 10:
|
|
109
|
-
insertData(data);
|
|
110
120
|
case 11:
|
|
121
|
+
insertData(data);
|
|
122
|
+
case 12:
|
|
111
123
|
return _context.a(2);
|
|
112
124
|
}
|
|
113
|
-
}, _callee, null, [[1,
|
|
125
|
+
}, _callee, null, [[1, 7]]);
|
|
114
126
|
}));
|
|
115
127
|
return function (_x) {
|
|
116
128
|
return _ref.apply(this, arguments);
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
10
|
-
var
|
|
10
|
+
var _objectSpread6 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _reactI18next = require("react-i18next");
|
|
@@ -213,16 +213,53 @@ var QuickInsertBlockMenu = function QuickInsertBlockMenu(_ref) {
|
|
|
213
213
|
(0, _helper2.insertMultiColumn)(editor, editor.selection, newInsertPosition, type);
|
|
214
214
|
}, [callback, editor, insertPosition, slateNode]);
|
|
215
215
|
var dropDownItems = (0, _react.useMemo)(function () {
|
|
216
|
-
var items = (0,
|
|
216
|
+
var items = (0, _objectSpread6["default"])((0, _objectSpread6["default"])((0, _objectSpread6["default"])((0, _objectSpread6["default"])((0, _defineProperty2["default"])({}, _constants2.PARAGRAPH, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
217
|
+
isHidden: !quickInsertMenuSearchMap[_constants2.PARAGRAPH],
|
|
218
|
+
disabled: isEmptyNode,
|
|
219
|
+
key: "sdoc-insert-menu-paragraph",
|
|
220
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.PARAGRAPH]),
|
|
221
|
+
onClick: function onClick() {
|
|
222
|
+
return onInsert(_constants2.ELEMENT_TYPE.PARAGRAPH);
|
|
223
|
+
}
|
|
224
|
+
})), _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.HEADER].reduce(function (acc, item) {
|
|
225
|
+
acc[item.id] = /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
226
|
+
isHidden: !quickInsertMenuSearchMap[item.type],
|
|
227
|
+
key: item.id,
|
|
228
|
+
menuConfig: item,
|
|
229
|
+
onClick: function onClick() {
|
|
230
|
+
return onInsert(item.type);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
return acc;
|
|
234
|
+
}, {})), {}, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _constants2.UNORDERED_LIST, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
235
|
+
isHidden: !quickInsertMenuSearchMap[_constants2.UNORDERED_LIST],
|
|
236
|
+
key: "sdoc-insert-menu-unorder-list",
|
|
237
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.UNORDERED_LIST]),
|
|
238
|
+
onClick: function onClick() {
|
|
239
|
+
onInsertList(_constants2.ELEMENT_TYPE.UNORDERED_LIST);
|
|
240
|
+
}
|
|
241
|
+
})), _constants2.ORDERED_LIST, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
242
|
+
isHidden: !quickInsertMenuSearchMap[_constants2.ORDERED_LIST],
|
|
243
|
+
key: "sdoc-insert-menu-order-list",
|
|
244
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.ORDERED_LIST]),
|
|
245
|
+
onClick: function onClick() {
|
|
246
|
+
onInsertList(_constants2.ELEMENT_TYPE.ORDERED_LIST);
|
|
247
|
+
}
|
|
248
|
+
})), _constants2.CHECK_LIST_ITEM, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
249
|
+
isHidden: !quickInsertMenuSearchMap[_constants2.CHECK_LIST_ITEM],
|
|
250
|
+
key: "sdoc-insert-menu-check-list",
|
|
251
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.CHECK_LIST_ITEM]),
|
|
252
|
+
onClick: onInsertCheckList
|
|
253
|
+
})), editor.editorType === _constants.WIKI_EDITOR && (0, _defineProperty2["default"])({}, _constants2.FILE_VIEW, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
217
254
|
isHidden: !quickInsertMenuSearchMap[_constants2.FILE_VIEW],
|
|
218
255
|
key: "sdoc-insert-menu-file-view",
|
|
219
|
-
menuConfig: (0,
|
|
256
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.FILE_VIEW]),
|
|
220
257
|
onClick: openFileViewDialog
|
|
221
258
|
}))), {}, (0, _defineProperty2["default"])({}, _constants2.IMAGE, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
222
259
|
isHidden: !quickInsertMenuSearchMap[_constants2.IMAGE],
|
|
223
260
|
disabled: isDisableImage,
|
|
224
261
|
key: "sdoc-insert-menu-image",
|
|
225
|
-
menuConfig: (0,
|
|
262
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.IMAGE]),
|
|
226
263
|
onClick: onInsertImageToggle
|
|
227
264
|
})), editor.editorType !== _constants.DOCUMENT_PLUGIN_EDITOR && (0, _defineProperty2["default"])({}, _constants2.VIDEO,
|
|
228
265
|
/*#__PURE__*/
|
|
@@ -231,7 +268,7 @@ var QuickInsertBlockMenu = function QuickInsertBlockMenu(_ref) {
|
|
|
231
268
|
isHidden: !quickInsertMenuSearchMap[_constants2.VIDEO],
|
|
232
269
|
disabled: isDisableVideo,
|
|
233
270
|
key: "sdoc-insert-menu-video",
|
|
234
|
-
menuConfig: (0,
|
|
271
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.VIDEO]),
|
|
235
272
|
className: "pr-2"
|
|
236
273
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
237
274
|
className: "sdocfont sdoc-right-slide sdoc-dropdown-item-right-icon"
|
|
@@ -253,14 +290,14 @@ var QuickInsertBlockMenu = function QuickInsertBlockMenu(_ref) {
|
|
|
253
290
|
}, t('Add_video_link')), editor.editorType !== _constants.WIKI_EDITOR && /*#__PURE__*/_react["default"].createElement("div", {
|
|
254
291
|
className: "sdoc-dropdown-menu-item",
|
|
255
292
|
onClick: openSelectVideoFileDialog
|
|
256
|
-
}, t('Link_video_file'))))))), {}, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])(
|
|
293
|
+
}, t('Link_video_file'))))))), {}, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _constants2.TABLE,
|
|
257
294
|
/*#__PURE__*/
|
|
258
295
|
// eslint-disable-next-line react/jsx-indent
|
|
259
296
|
_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
260
297
|
isHidden: !quickInsertMenuSearchMap[_constants2.TABLE],
|
|
261
298
|
disabled: isDisableTable,
|
|
262
299
|
key: "sdoc-insert-menu-table",
|
|
263
|
-
menuConfig: (0,
|
|
300
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.TABLE]),
|
|
264
301
|
className: "pr-2"
|
|
265
302
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
266
303
|
className: "sdocfont sdoc-right-slide sdoc-dropdown-item-right-icon"
|
|
@@ -277,90 +314,53 @@ var QuickInsertBlockMenu = function QuickInsertBlockMenu(_ref) {
|
|
|
277
314
|
}))), _constants2.LINK, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
278
315
|
isHidden: !quickInsertMenuSearchMap[_constants2.LINK],
|
|
279
316
|
key: "sdoc-insert-menu-link",
|
|
280
|
-
menuConfig: (0,
|
|
317
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.LINK]),
|
|
281
318
|
onClick: openLinkDialog
|
|
282
319
|
})), _constants2.CODE_BLOCK, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
283
320
|
isHidden: !quickInsertMenuSearchMap[_constants2.CODE_BLOCK],
|
|
284
321
|
disabled: isDisableCodeBlock,
|
|
285
322
|
key: "sdoc-insert-menu-code-block",
|
|
286
|
-
menuConfig: (0,
|
|
323
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.CODE_BLOCK]),
|
|
287
324
|
onClick: onInsertCodeBlock
|
|
288
325
|
})), _constants2.CALL_OUT, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
289
326
|
isHidden: !quickInsertMenuSearchMap[_constants2.CALL_OUT],
|
|
290
327
|
disabled: isDisableCallout,
|
|
291
328
|
key: "sdoc-insert-menu-callout",
|
|
292
|
-
menuConfig: (0,
|
|
329
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.CALL_OUT]),
|
|
293
330
|
onClick: function onClick() {
|
|
294
331
|
return onInsertCallout(_constants2.PARAGRAPH);
|
|
295
332
|
}
|
|
296
|
-
})), _constants2.UNORDERED_LIST, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
297
|
-
isHidden: !quickInsertMenuSearchMap[_constants2.UNORDERED_LIST],
|
|
298
|
-
key: "sdoc-insert-menu-unorder-list",
|
|
299
|
-
menuConfig: (0, _objectSpread4["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.UNORDERED_LIST]),
|
|
300
|
-
onClick: function onClick() {
|
|
301
|
-
onInsertList(_constants2.ELEMENT_TYPE.UNORDERED_LIST);
|
|
302
|
-
}
|
|
303
|
-
})), _constants2.ORDERED_LIST, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
304
|
-
isHidden: !quickInsertMenuSearchMap[_constants2.ORDERED_LIST],
|
|
305
|
-
key: "sdoc-insert-menu-order-list",
|
|
306
|
-
menuConfig: (0, _objectSpread4["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.ORDERED_LIST]),
|
|
307
|
-
onClick: function onClick() {
|
|
308
|
-
onInsertList(_constants2.ELEMENT_TYPE.ORDERED_LIST);
|
|
309
|
-
}
|
|
310
|
-
})), _constants2.CHECK_LIST_ITEM, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
311
|
-
isHidden: !quickInsertMenuSearchMap[_constants2.CHECK_LIST_ITEM],
|
|
312
|
-
key: "sdoc-insert-menu-check-list",
|
|
313
|
-
menuConfig: (0, _objectSpread4["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.CHECK_LIST_ITEM]),
|
|
314
|
-
onClick: onInsertCheckList
|
|
315
|
-
})), _constants2.PARAGRAPH, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
316
|
-
isHidden: !quickInsertMenuSearchMap[_constants2.PARAGRAPH],
|
|
317
|
-
disabled: isEmptyNode,
|
|
318
|
-
key: "sdoc-insert-menu-paragraph",
|
|
319
|
-
menuConfig: (0, _objectSpread4["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.PARAGRAPH]),
|
|
320
|
-
onClick: function onClick() {
|
|
321
|
-
return onInsert(_constants2.ELEMENT_TYPE.PARAGRAPH);
|
|
322
|
-
}
|
|
323
333
|
})));
|
|
324
334
|
if (_commonUtils.isMobile) {
|
|
325
|
-
items = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _constants2.
|
|
335
|
+
items = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _constants2.PARAGRAPH, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
336
|
+
isHidden: !quickInsertMenuSearchMap[_constants2.PARAGRAPH],
|
|
337
|
+
disabled: isEmptyNode,
|
|
338
|
+
key: "sdoc-insert-menu-paragraph",
|
|
339
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.PARAGRAPH]),
|
|
340
|
+
onClick: function onClick() {
|
|
341
|
+
return onInsert(_constants2.ELEMENT_TYPE.PARAGRAPH);
|
|
342
|
+
}
|
|
343
|
+
})), _constants2.UNORDERED_LIST, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
326
344
|
isHidden: !quickInsertMenuSearchMap[_constants2.UNORDERED_LIST],
|
|
327
345
|
key: "sdoc-insert-menu-unorder-list",
|
|
328
|
-
menuConfig: (0,
|
|
346
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.UNORDERED_LIST]),
|
|
329
347
|
onClick: function onClick() {
|
|
330
348
|
onInsertList(_constants2.ELEMENT_TYPE.UNORDERED_LIST);
|
|
331
349
|
}
|
|
332
350
|
})), _constants2.ORDERED_LIST, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
333
351
|
isHidden: !quickInsertMenuSearchMap[_constants2.ORDERED_LIST],
|
|
334
352
|
key: "sdoc-insert-menu-order-list",
|
|
335
|
-
menuConfig: (0,
|
|
353
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.ORDERED_LIST]),
|
|
336
354
|
onClick: function onClick() {
|
|
337
355
|
onInsertList(_constants2.ELEMENT_TYPE.ORDERED_LIST);
|
|
338
356
|
}
|
|
339
357
|
})), _constants2.CHECK_LIST_ITEM, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
340
358
|
isHidden: !quickInsertMenuSearchMap[_constants2.CHECK_LIST_ITEM],
|
|
341
359
|
key: "sdoc-insert-menu-check-list",
|
|
342
|
-
menuConfig: (0,
|
|
360
|
+
menuConfig: (0, _objectSpread6["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.CHECK_LIST_ITEM]),
|
|
343
361
|
onClick: onInsertCheckList
|
|
344
|
-
})), _constants2.PARAGRAPH, /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
345
|
-
isHidden: !quickInsertMenuSearchMap[_constants2.PARAGRAPH],
|
|
346
|
-
disabled: isEmptyNode,
|
|
347
|
-
key: "sdoc-insert-menu-paragraph",
|
|
348
|
-
menuConfig: (0, _objectSpread4["default"])({}, _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.PARAGRAPH]),
|
|
349
|
-
onClick: function onClick() {
|
|
350
|
-
return onInsert(_constants2.ELEMENT_TYPE.PARAGRAPH);
|
|
351
|
-
}
|
|
352
362
|
}));
|
|
353
363
|
}
|
|
354
|
-
_constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.HEADER].forEach(function (item) {
|
|
355
|
-
items[item.id.toLowerCase()] = /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
356
|
-
isHidden: !quickInsertMenuSearchMap[item.type],
|
|
357
|
-
key: item.id,
|
|
358
|
-
menuConfig: item,
|
|
359
|
-
onClick: function onClick() {
|
|
360
|
-
return onInsert(item.type);
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
});
|
|
364
364
|
!_commonUtils.isMobile && _constants2.SIDE_INSERT_MENUS_CONFIG[_constants2.ELEMENT_TYPE.MULTI_COLUMN].forEach(function (item) {
|
|
365
365
|
items[item.id.toLowerCase()] = /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
|
|
366
366
|
isHidden: !quickInsertMenuSearchMap[item.type],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.25",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "d9fce7ae47f01c975cec0b05c06a2d8831a31564"
|
|
75
75
|
}
|