ketcher-react 2.15.0-rc.2 → 2.15.0-rc.4
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/index.js
CHANGED
|
@@ -360,20 +360,76 @@ var ClipArea = function (_Component) {
|
|
|
360
360
|
mousedown: function mousedown(event) {
|
|
361
361
|
if (event.shiftKey && !isActiveElement(event.target)) event.preventDefault();
|
|
362
362
|
},
|
|
363
|
-
copy: function
|
|
364
|
-
|
|
365
|
-
var data
|
|
366
|
-
|
|
367
|
-
|
|
363
|
+
copy: function () {
|
|
364
|
+
var _copy2 = _asyncToGenerator__default["default"]( _regeneratorRuntime__default["default"].mark(function _callee(event) {
|
|
365
|
+
var data;
|
|
366
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
367
|
+
while (1) {
|
|
368
|
+
switch (_context.prev = _context.next) {
|
|
369
|
+
case 0:
|
|
370
|
+
if (!(_this2.props.focused() && _this2.props.onCopy)) {
|
|
371
|
+
_context.next = 8;
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
_context.next = 3;
|
|
375
|
+
return _this2.props.onCopy();
|
|
376
|
+
case 3:
|
|
377
|
+
data = _context.sent;
|
|
378
|
+
if (!data) {
|
|
379
|
+
_context.next = 7;
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
_context.next = 7;
|
|
383
|
+
return _copy(data);
|
|
384
|
+
case 7:
|
|
385
|
+
event.preventDefault();
|
|
386
|
+
case 8:
|
|
387
|
+
case "end":
|
|
388
|
+
return _context.stop();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}, _callee);
|
|
392
|
+
}));
|
|
393
|
+
function copy(_x) {
|
|
394
|
+
return _copy2.apply(this, arguments);
|
|
368
395
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
396
|
+
return copy;
|
|
397
|
+
}(),
|
|
398
|
+
cut: function () {
|
|
399
|
+
var _cut = _asyncToGenerator__default["default"]( _regeneratorRuntime__default["default"].mark(function _callee2(event) {
|
|
400
|
+
var data;
|
|
401
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
|
|
402
|
+
while (1) {
|
|
403
|
+
switch (_context2.prev = _context2.next) {
|
|
404
|
+
case 0:
|
|
405
|
+
if (!(_this2.props.focused() && _this2.props.onCut)) {
|
|
406
|
+
_context2.next = 8;
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
_context2.next = 3;
|
|
410
|
+
return _this2.props.onCut();
|
|
411
|
+
case 3:
|
|
412
|
+
data = _context2.sent;
|
|
413
|
+
if (!data) {
|
|
414
|
+
_context2.next = 7;
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
_context2.next = 7;
|
|
418
|
+
return _copy(data);
|
|
419
|
+
case 7:
|
|
420
|
+
event.preventDefault();
|
|
421
|
+
case 8:
|
|
422
|
+
case "end":
|
|
423
|
+
return _context2.stop();
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}, _callee2);
|
|
427
|
+
}));
|
|
428
|
+
function cut(_x2) {
|
|
429
|
+
return _cut.apply(this, arguments);
|
|
375
430
|
}
|
|
376
|
-
|
|
431
|
+
return cut;
|
|
432
|
+
}(),
|
|
377
433
|
paste: function paste(event) {
|
|
378
434
|
if (_this2.props.focused() && _this2.props.onPaste) {
|
|
379
435
|
var data = _paste(event.clipboardData, _this2.props.formats);
|
|
@@ -422,20 +478,32 @@ function autoselect(cliparea) {
|
|
|
422
478
|
cliparea.value = ' ';
|
|
423
479
|
cliparea.select();
|
|
424
480
|
}
|
|
425
|
-
function _copy(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
481
|
+
function _copy(_x3) {
|
|
482
|
+
return _copy3.apply(this, arguments);
|
|
483
|
+
}
|
|
484
|
+
function _copy3() {
|
|
485
|
+
_copy3 = _asyncToGenerator__default["default"]( _regeneratorRuntime__default["default"].mark(function _callee3(data) {
|
|
486
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
|
|
487
|
+
while (1) {
|
|
488
|
+
switch (_context3.prev = _context3.next) {
|
|
489
|
+
case 0:
|
|
490
|
+
_context3.prev = 0;
|
|
491
|
+
_context3.next = 3;
|
|
492
|
+
return navigator.clipboard.writeText(data['text/plain']);
|
|
493
|
+
case 3:
|
|
494
|
+
_context3.next = 8;
|
|
495
|
+
break;
|
|
496
|
+
case 5:
|
|
497
|
+
_context3.prev = 5;
|
|
498
|
+
_context3.t0 = _context3["catch"](0);
|
|
499
|
+
case 8:
|
|
500
|
+
case "end":
|
|
501
|
+
return _context3.stop();
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}, _callee3, null, [[0, 5]]);
|
|
505
|
+
}));
|
|
506
|
+
return _copy3.apply(this, arguments);
|
|
439
507
|
}
|
|
440
508
|
function _paste(cb, formats) {
|
|
441
509
|
var data = {};
|
|
@@ -3264,7 +3332,7 @@ var zoom = {
|
|
|
3264
3332
|
|
|
3265
3333
|
var openHelpLink = function openHelpLink() {
|
|
3266
3334
|
var _window$open;
|
|
3267
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.15.0-rc.
|
|
3335
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.15.0-rc.4\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
|
|
3268
3336
|
};
|
|
3269
3337
|
var help = {
|
|
3270
3338
|
help: {
|
|
@@ -17055,21 +17123,53 @@ function initClipboard(dispatch) {
|
|
|
17055
17123
|
return !state.modal;
|
|
17056
17124
|
},
|
|
17057
17125
|
onCut: function onCut() {
|
|
17058
|
-
|
|
17059
|
-
|
|
17060
|
-
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
|
|
17064
|
-
|
|
17065
|
-
|
|
17126
|
+
return _asyncToGenerator__default["default"]( _regeneratorRuntime__default["default"].mark(function _callee() {
|
|
17127
|
+
var state, editor, data;
|
|
17128
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
17129
|
+
while (1) {
|
|
17130
|
+
switch (_context.prev = _context.next) {
|
|
17131
|
+
case 0:
|
|
17132
|
+
state = global.currentState;
|
|
17133
|
+
editor = state.editor;
|
|
17134
|
+
_context.next = 4;
|
|
17135
|
+
return clipData(editor);
|
|
17136
|
+
case 4:
|
|
17137
|
+
data = _context.sent;
|
|
17138
|
+
if (data) debAction({
|
|
17139
|
+
tool: 'eraser',
|
|
17140
|
+
opts: 1
|
|
17141
|
+
});else editor.selection(null);
|
|
17142
|
+
return _context.abrupt("return", data);
|
|
17143
|
+
case 7:
|
|
17144
|
+
case "end":
|
|
17145
|
+
return _context.stop();
|
|
17146
|
+
}
|
|
17147
|
+
}
|
|
17148
|
+
}, _callee);
|
|
17149
|
+
}))();
|
|
17066
17150
|
},
|
|
17067
17151
|
onCopy: function onCopy() {
|
|
17068
|
-
|
|
17069
|
-
|
|
17070
|
-
|
|
17071
|
-
|
|
17072
|
-
|
|
17152
|
+
return _asyncToGenerator__default["default"]( _regeneratorRuntime__default["default"].mark(function _callee2() {
|
|
17153
|
+
var state, editor, data;
|
|
17154
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
|
|
17155
|
+
while (1) {
|
|
17156
|
+
switch (_context2.prev = _context2.next) {
|
|
17157
|
+
case 0:
|
|
17158
|
+
state = global.currentState;
|
|
17159
|
+
editor = state.editor;
|
|
17160
|
+
_context2.next = 4;
|
|
17161
|
+
return clipData(editor);
|
|
17162
|
+
case 4:
|
|
17163
|
+
data = _context2.sent;
|
|
17164
|
+
editor.selection(null);
|
|
17165
|
+
return _context2.abrupt("return", data);
|
|
17166
|
+
case 7:
|
|
17167
|
+
case "end":
|
|
17168
|
+
return _context2.stop();
|
|
17169
|
+
}
|
|
17170
|
+
}
|
|
17171
|
+
}, _callee2);
|
|
17172
|
+
}))();
|
|
17073
17173
|
},
|
|
17074
17174
|
onPaste: function onPaste(data) {
|
|
17075
17175
|
var structStr = data[ketcherCore.ChemicalMimeType.KET] || data[ketcherCore.ChemicalMimeType.Mol] || data[ketcherCore.ChemicalMimeType.Rxn] || data['text/plain'];
|
|
@@ -17080,30 +17180,61 @@ function initClipboard(dispatch) {
|
|
|
17080
17180
|
}
|
|
17081
17181
|
};
|
|
17082
17182
|
}
|
|
17083
|
-
function clipData(
|
|
17084
|
-
|
|
17085
|
-
|
|
17086
|
-
|
|
17087
|
-
|
|
17088
|
-
|
|
17089
|
-
|
|
17090
|
-
|
|
17091
|
-
|
|
17092
|
-
|
|
17093
|
-
|
|
17094
|
-
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
|
|
17098
|
-
|
|
17099
|
-
|
|
17100
|
-
|
|
17101
|
-
|
|
17102
|
-
|
|
17103
|
-
|
|
17104
|
-
|
|
17105
|
-
|
|
17106
|
-
|
|
17183
|
+
function clipData(_x) {
|
|
17184
|
+
return _clipData.apply(this, arguments);
|
|
17185
|
+
}
|
|
17186
|
+
function _clipData() {
|
|
17187
|
+
_clipData = _asyncToGenerator__default["default"]( _regeneratorRuntime__default["default"].mark(function _callee3(editor) {
|
|
17188
|
+
var res, struct, errorHandler, simpleObjectOrText, serializer, ket, ketcherInstance, data, type;
|
|
17189
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
|
|
17190
|
+
while (1) {
|
|
17191
|
+
switch (_context3.prev = _context3.next) {
|
|
17192
|
+
case 0:
|
|
17193
|
+
res = {};
|
|
17194
|
+
struct = editor.structSelected();
|
|
17195
|
+
errorHandler = editor.errorHandler;
|
|
17196
|
+
if (!struct.isBlank()) {
|
|
17197
|
+
_context3.next = 5;
|
|
17198
|
+
break;
|
|
17199
|
+
}
|
|
17200
|
+
return _context3.abrupt("return", null);
|
|
17201
|
+
case 5:
|
|
17202
|
+
simpleObjectOrText = Boolean(struct.simpleObjects.size || struct.texts.size);
|
|
17203
|
+
if (!(simpleObjectOrText && reactDeviceDetect.isIE && errorHandler)) {
|
|
17204
|
+
_context3.next = 9;
|
|
17205
|
+
break;
|
|
17206
|
+
}
|
|
17207
|
+
errorHandler('The structure you are trying to copy contains Simple object or/and Text object.' + 'To copy Simple object or Text object in Internet Explorer try "Copy as KET" button');
|
|
17208
|
+
return _context3.abrupt("return", null);
|
|
17209
|
+
case 9:
|
|
17210
|
+
_context3.prev = 9;
|
|
17211
|
+
serializer = new ketcherCore.KetSerializer();
|
|
17212
|
+
ket = serializer.serialize(struct);
|
|
17213
|
+
ketcherInstance = ketcherCore.ketcherProvider.getKetcher();
|
|
17214
|
+
_context3.next = 15;
|
|
17215
|
+
return ketcherCore.getStructure(ketcherCore.SupportedFormat.molAuto,
|
|
17216
|
+
ketcherInstance.formatterFactory, struct);
|
|
17217
|
+
case 15:
|
|
17218
|
+
data = _context3.sent;
|
|
17219
|
+
res[ketcherCore.ChemicalMimeType.KET] = ket;
|
|
17220
|
+
type = struct.isReaction ? ketcherCore.ChemicalMimeType.Mol : ketcherCore.ChemicalMimeType.Rxn;
|
|
17221
|
+
res['text/plain'] = data;
|
|
17222
|
+
res[type] = data;
|
|
17223
|
+
return _context3.abrupt("return", res);
|
|
17224
|
+
case 23:
|
|
17225
|
+
_context3.prev = 23;
|
|
17226
|
+
_context3.t0 = _context3["catch"](9);
|
|
17227
|
+
errorHandler && errorHandler(_context3.t0.message);
|
|
17228
|
+
case 26:
|
|
17229
|
+
return _context3.abrupt("return", null);
|
|
17230
|
+
case 27:
|
|
17231
|
+
case "end":
|
|
17232
|
+
return _context3.stop();
|
|
17233
|
+
}
|
|
17234
|
+
}
|
|
17235
|
+
}, _callee3, null, [[9, 23]]);
|
|
17236
|
+
}));
|
|
17237
|
+
return _clipData.apply(this, arguments);
|
|
17107
17238
|
}
|
|
17108
17239
|
|
|
17109
17240
|
var AppClipArea = reactRedux.connect(null, function (dispatch) {
|
|
@@ -30697,8 +30828,8 @@ var KetcherBuilder = function () {
|
|
|
30697
30828
|
initApp(element, appRoot, staticResourcesUrl, {
|
|
30698
30829
|
buttons: buttons || {},
|
|
30699
30830
|
errorHandler: errorHandler || null,
|
|
30700
|
-
version: "2.15.0-rc.
|
|
30701
|
-
buildDate: "2023-
|
|
30831
|
+
version: "2.15.0-rc.4" ,
|
|
30832
|
+
buildDate: "2023-10-10T15:38:15" ,
|
|
30702
30833
|
buildNumber: ''
|
|
30703
30834
|
}, structService, resolve);
|
|
30704
30835
|
});
|
|
@@ -30739,6 +30870,7 @@ var KetcherBuilder = function () {
|
|
|
30739
30870
|
if (initialMol) {
|
|
30740
30871
|
ketcher.setMolecule(initialMol);
|
|
30741
30872
|
}
|
|
30873
|
+
ketcherCore.ketcherProvider.setKetcherInstance(ketcher);
|
|
30742
30874
|
return ketcher;
|
|
30743
30875
|
}
|
|
30744
30876
|
}]);
|