ketcher-react 2.17.0-rc.2 → 2.17.0
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.modern.js
CHANGED
|
@@ -3601,7 +3601,7 @@ var zoom = {
|
|
|
3601
3601
|
|
|
3602
3602
|
var openHelpLink = function openHelpLink() {
|
|
3603
3603
|
var _window$open;
|
|
3604
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.17.0
|
|
3604
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.17.0\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
|
|
3605
3605
|
};
|
|
3606
3606
|
var help = {
|
|
3607
3607
|
help: {
|
|
@@ -21243,28 +21243,17 @@ var TemplatePreview = function () {
|
|
|
21243
21243
|
this.previousPosition = this.position;
|
|
21244
21244
|
this.editor.render.update(false, null);
|
|
21245
21245
|
} else {
|
|
21246
|
-
this.moveFloatingPreview(
|
|
21246
|
+
this.moveFloatingPreview();
|
|
21247
21247
|
}
|
|
21248
21248
|
}
|
|
21249
21249
|
}
|
|
21250
21250
|
}, {
|
|
21251
21251
|
key: "moveFloatingPreview",
|
|
21252
|
-
value: function moveFloatingPreview(
|
|
21252
|
+
value: function moveFloatingPreview() {
|
|
21253
21253
|
var dist = this.position.sub(this.previousPosition);
|
|
21254
21254
|
this.previousPosition = this.position;
|
|
21255
21255
|
fromMultipleMove(this.restruct, this.floatingPreview, dist);
|
|
21256
21256
|
this.editor.render.update(false, null);
|
|
21257
|
-
this.hoverFusedItems(previewTarget, event);
|
|
21258
|
-
}
|
|
21259
|
-
}, {
|
|
21260
|
-
key: "hoverFusedItems",
|
|
21261
|
-
value: function hoverFusedItems(closestItem, event) {
|
|
21262
|
-
if (this.mode === 'fg') {
|
|
21263
|
-
this.editor.hover(closestItem, null, event);
|
|
21264
|
-
} else {
|
|
21265
|
-
var mergeItems = getItemsToFuse(this.editor, this.floatingPreview);
|
|
21266
|
-
this.editor.hover(getHoverToFuse(mergeItems));
|
|
21267
|
-
}
|
|
21268
21257
|
}
|
|
21269
21258
|
}, {
|
|
21270
21259
|
key: "showFloatingPreview",
|
|
@@ -21581,10 +21570,10 @@ var TemplateTool = function () {
|
|
|
21581
21570
|
var _fromTemplateOnBondAc = fromTemplateOnBondAction(this.editor.render.ctab, this.template, ci.id, this.editor.event, dragCtx.sign1 * dragCtx.sign2 > 0, false),
|
|
21582
21571
|
_fromTemplateOnBondAc2 = _slicedToArray$1(_fromTemplateOnBondAc, 2),
|
|
21583
21572
|
_action = _fromTemplateOnBondAc2[0],
|
|
21584
|
-
|
|
21573
|
+
pasteItems = _fromTemplateOnBondAc2[1];
|
|
21585
21574
|
dragCtx.action = _action;
|
|
21586
21575
|
this.editor.update(dragCtx.action, true);
|
|
21587
|
-
dragCtx.mergeItems = getItemsToFuse(this.editor,
|
|
21576
|
+
dragCtx.mergeItems = getItemsToFuse(this.editor, pasteItems);
|
|
21588
21577
|
this.editor.hover(getHoverToFuse(dragCtx.mergeItems));
|
|
21589
21578
|
}
|
|
21590
21579
|
return true;
|
|
@@ -21623,7 +21612,6 @@ var TemplateTool = function () {
|
|
|
21623
21612
|
}
|
|
21624
21613
|
dragCtx.angle = degrees;
|
|
21625
21614
|
var action = null;
|
|
21626
|
-
var pasteItems;
|
|
21627
21615
|
if (!ci) {
|
|
21628
21616
|
var _this$template;
|
|
21629
21617
|
var isAddingFunctionalGroup = (_this$template = this.template) === null || _this$template === void 0 || (_this$template = _this$template.molecule) === null || _this$template === void 0 ? void 0 : _this$template.sgroups.size;
|
|
@@ -21631,23 +21619,17 @@ var TemplateTool = function () {
|
|
|
21631
21619
|
return true;
|
|
21632
21620
|
}
|
|
21633
21621
|
var _fromTemplateOnCanvas = fromTemplateOnCanvas(this.editor.render.ctab, this.template, targetPos, angle);
|
|
21634
|
-
var _fromTemplateOnCanvas2 = _slicedToArray$1(_fromTemplateOnCanvas,
|
|
21622
|
+
var _fromTemplateOnCanvas2 = _slicedToArray$1(_fromTemplateOnCanvas, 1);
|
|
21635
21623
|
action = _fromTemplateOnCanvas2[0];
|
|
21636
|
-
pasteItems = _fromTemplateOnCanvas2[1];
|
|
21637
21624
|
} else if ((ci === null || ci === void 0 ? void 0 : ci.map) === 'atoms' || (ci === null || ci === void 0 ? void 0 : ci.map) === 'functionalGroups') {
|
|
21638
21625
|
var _atomId = getTargetAtomId(this.struct, ci);
|
|
21639
21626
|
var _fromTemplateOnAtom = fromTemplateOnAtom(this.editor.render.ctab, this.template, _atomId, angle, extraBond);
|
|
21640
|
-
var _fromTemplateOnAtom2 = _slicedToArray$1(_fromTemplateOnAtom,
|
|
21627
|
+
var _fromTemplateOnAtom2 = _slicedToArray$1(_fromTemplateOnAtom, 1);
|
|
21641
21628
|
action = _fromTemplateOnAtom2[0];
|
|
21642
|
-
pasteItems = _fromTemplateOnAtom2[1];
|
|
21643
21629
|
dragCtx.extra_bond = extraBond;
|
|
21644
21630
|
}
|
|
21645
21631
|
dragCtx.action = action;
|
|
21646
21632
|
this.editor.update(dragCtx.action, true);
|
|
21647
|
-
if (!this.isModeFunctionalGroup) {
|
|
21648
|
-
dragCtx.mergeItems = getItemsToFuse(this.editor, pasteItems);
|
|
21649
|
-
this.editor.hover(getHoverToFuse(dragCtx.mergeItems));
|
|
21650
|
-
}
|
|
21651
21633
|
if (this.targetGroupsIds.length) this.targetGroupsIds.length = 0;
|
|
21652
21634
|
return true;
|
|
21653
21635
|
}
|
|
@@ -21677,12 +21659,17 @@ var TemplateTool = function () {
|
|
|
21677
21659
|
return true;
|
|
21678
21660
|
}
|
|
21679
21661
|
var action, functionalGroupRemoveAction;
|
|
21680
|
-
var pasteItems = null;
|
|
21681
21662
|
if (((_ci = ci) === null || _ci === void 0 ? void 0 : _ci.map) === 'functionalGroups' && FunctionalGroup.isContractedFunctionalGroup(ci.id, this.functionalGroups) && this.isModeFunctionalGroup && this.targetGroupsIds.length) {
|
|
21682
21663
|
var _restruct = this.editor.render.ctab;
|
|
21683
21664
|
var functionalGroupToReplace = this.struct.sgroups.get(ci.id);
|
|
21684
21665
|
if (this.isSaltOrSolvent && functionalGroupToReplace.isGroupAttached(this.struct)) {
|
|
21685
|
-
|
|
21666
|
+
addOnCanvasWithoutMerge({
|
|
21667
|
+
restruct: _restruct,
|
|
21668
|
+
template: this.template,
|
|
21669
|
+
dragCtx: dragCtx,
|
|
21670
|
+
editor: this.editor,
|
|
21671
|
+
event: event
|
|
21672
|
+
});
|
|
21686
21673
|
return true;
|
|
21687
21674
|
}
|
|
21688
21675
|
functionalGroupRemoveAction = new Action();
|
|
@@ -21702,24 +21689,31 @@ var TemplateTool = function () {
|
|
|
21702
21689
|
}
|
|
21703
21690
|
if (!dragCtx.action) {
|
|
21704
21691
|
if (!ci) {
|
|
21705
|
-
|
|
21706
|
-
|
|
21707
|
-
|
|
21708
|
-
|
|
21709
|
-
|
|
21710
|
-
|
|
21692
|
+
addOnCanvasWithoutMerge({
|
|
21693
|
+
restruct: restruct,
|
|
21694
|
+
template: this.template,
|
|
21695
|
+
dragCtx: dragCtx,
|
|
21696
|
+
editor: this.editor,
|
|
21697
|
+
event: event
|
|
21698
|
+
});
|
|
21699
|
+
return true;
|
|
21711
21700
|
} else if (ci.map === 'atoms') {
|
|
21712
21701
|
var _restruct$atoms$get2;
|
|
21713
21702
|
var degree = (_restruct$atoms$get2 = restruct.atoms.get(ci.id)) === null || _restruct$atoms$get2 === void 0 ? void 0 : _restruct$atoms$get2.a.neighbors.length;
|
|
21714
21703
|
if (degree && degree >= 1 && this.isSaltOrSolvent) {
|
|
21715
|
-
|
|
21704
|
+
addOnCanvasWithoutMerge({
|
|
21705
|
+
restruct: restruct,
|
|
21706
|
+
template: this.template,
|
|
21707
|
+
dragCtx: dragCtx,
|
|
21708
|
+
editor: this.editor,
|
|
21709
|
+
event: event
|
|
21710
|
+
});
|
|
21716
21711
|
return true;
|
|
21717
21712
|
}
|
|
21718
21713
|
var angle = getAngleFromEvent(event, ci, restruct);
|
|
21719
21714
|
var _fromTemplateOnAtom3 = fromTemplateOnAtom(restruct, this.template, ci.id, angle, false);
|
|
21720
|
-
var _fromTemplateOnAtom4 = _slicedToArray$1(_fromTemplateOnAtom3,
|
|
21715
|
+
var _fromTemplateOnAtom4 = _slicedToArray$1(_fromTemplateOnAtom3, 1);
|
|
21721
21716
|
action = _fromTemplateOnAtom4[0];
|
|
21722
|
-
pasteItems = _fromTemplateOnAtom4[1];
|
|
21723
21717
|
if (functionalGroupRemoveAction) {
|
|
21724
21718
|
action = functionalGroupRemoveAction.mergeWith(action);
|
|
21725
21719
|
}
|
|
@@ -21739,11 +21733,6 @@ var TemplateTool = function () {
|
|
|
21739
21733
|
return true;
|
|
21740
21734
|
}
|
|
21741
21735
|
}
|
|
21742
|
-
this.editor.selection(null);
|
|
21743
|
-
if (!dragCtx.mergeItems && pasteItems && !this.isModeFunctionalGroup) {
|
|
21744
|
-
dragCtx.mergeItems = getItemsToFuse(this.editor, pasteItems);
|
|
21745
|
-
}
|
|
21746
|
-
dragCtx.action = dragCtx.action ? fromItemsFuse(restruct, dragCtx.mergeItems).mergeWith(dragCtx.action) : fromItemsFuse(restruct, dragCtx.mergeItems);
|
|
21747
21736
|
var _iterator = _createForOfIteratorHelper$1(restruct.molecule.bonds.keys()),
|
|
21748
21737
|
_step;
|
|
21749
21738
|
try {
|
|
@@ -21772,11 +21761,7 @@ var TemplateTool = function () {
|
|
|
21772
21761
|
if (completeAction && !completeAction.isDummy()) {
|
|
21773
21762
|
this.editor.update(completeAction);
|
|
21774
21763
|
}
|
|
21775
|
-
this.editor.hover(this.editor.findItem(event,
|
|
21776
|
-
this.editor.event.showInfo.dispatch(null);
|
|
21777
|
-
this.editor.event.message.dispatch({
|
|
21778
|
-
info: false
|
|
21779
|
-
});
|
|
21764
|
+
this.editor.hover(this.editor.findItem(event, null), null, event);
|
|
21780
21765
|
return true;
|
|
21781
21766
|
}
|
|
21782
21767
|
}, {
|
|
@@ -21800,13 +21785,18 @@ var TemplateTool = function () {
|
|
|
21800
21785
|
}]);
|
|
21801
21786
|
return TemplateTool;
|
|
21802
21787
|
}();
|
|
21803
|
-
function
|
|
21804
|
-
var
|
|
21805
|
-
|
|
21806
|
-
|
|
21788
|
+
function addOnCanvasWithoutMerge(_ref5) {
|
|
21789
|
+
var restruct = _ref5.restruct,
|
|
21790
|
+
template = _ref5.template,
|
|
21791
|
+
dragCtx = _ref5.dragCtx,
|
|
21792
|
+
editor = _ref5.editor,
|
|
21793
|
+
event = _ref5.event;
|
|
21794
|
+
var _fromTemplateOnCanvas3 = fromTemplateOnCanvas(restruct, template, dragCtx.xy0, 0, false),
|
|
21795
|
+
_fromTemplateOnCanvas4 = _slicedToArray$1(_fromTemplateOnCanvas3, 1),
|
|
21796
|
+
action = _fromTemplateOnCanvas4[0];
|
|
21807
21797
|
editor.update(action);
|
|
21808
21798
|
editor.selection(null);
|
|
21809
|
-
editor.hover(null);
|
|
21799
|
+
editor.hover(editor.findItem(event, null), null, event);
|
|
21810
21800
|
editor.event.message.dispatch({
|
|
21811
21801
|
info: false
|
|
21812
21802
|
});
|
|
@@ -32380,8 +32370,8 @@ var KetcherBuilder = function () {
|
|
|
32380
32370
|
initApp(element, appRoot, staticResourcesUrl, {
|
|
32381
32371
|
buttons: buttons || {},
|
|
32382
32372
|
errorHandler: errorHandler || null,
|
|
32383
|
-
version: "2.17.0
|
|
32384
|
-
buildDate: "
|
|
32373
|
+
version: "2.17.0" ,
|
|
32374
|
+
buildDate: "2024-03-01T18:29:32" ,
|
|
32385
32375
|
buildNumber: ''
|
|
32386
32376
|
}, structService, resolve, togglerComponent);
|
|
32387
32377
|
});
|