ketcher-react 3.8.0-rc.2 → 3.8.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/cjs/index.js +209 -61
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{index.modern-30f7e490.js → index.modern-7604afae.js} +63 -15
- package/dist/cjs/index.modern-7604afae.js.map +1 -0
- package/dist/cjs/script/editor/Editor.d.ts +3 -0
- package/dist/cjs/script/ui/views/components/MonomerCreationWizard/components/AttachmentPoint/AttachmentPoint.d.ts +2 -1
- package/dist/index.js +210 -62
- package/dist/index.js.map +1 -1
- package/dist/{index.modern-7694d091.js → index.modern-eb9aa0eb.js} +63 -15
- package/dist/index.modern-eb9aa0eb.js.map +1 -0
- package/dist/script/editor/Editor.d.ts +3 -0
- package/dist/script/ui/views/components/MonomerCreationWizard/components/AttachmentPoint/AttachmentPoint.d.ts +2 -1
- package/package.json +1 -1
- package/dist/cjs/index.modern-30f7e490.js.map +0 -1
- package/dist/index.modern-7694d091.js.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -3850,7 +3850,7 @@ var zoom = {
|
|
|
3850
3850
|
|
|
3851
3851
|
var openHelpLink = function openHelpLink() {
|
|
3852
3852
|
var _window$open;
|
|
3853
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.8.0-rc.
|
|
3853
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.8.0-rc.4\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
|
|
3854
3854
|
};
|
|
3855
3855
|
var help = {
|
|
3856
3856
|
help: {
|
|
@@ -24331,8 +24331,9 @@ var HoverIcon = function () {
|
|
|
24331
24331
|
}, {
|
|
24332
24332
|
key: "isOverLoader",
|
|
24333
24333
|
value: function isOverLoader(event) {
|
|
24334
|
+
var _target$classList;
|
|
24334
24335
|
var target = (event === null || event === void 0 ? void 0 : event.relatedTarget) || event.target;
|
|
24335
|
-
return target === null || target === void 0 ? void 0 :
|
|
24336
|
+
return target === null || target === void 0 || (_target$classList = target.classList) === null || _target$classList === void 0 ? void 0 : _target$classList.contains('loading-spinner');
|
|
24336
24337
|
}
|
|
24337
24338
|
}, {
|
|
24338
24339
|
key: "onMouseMove",
|
|
@@ -25405,10 +25406,23 @@ var Editor$3 = function () {
|
|
|
25405
25406
|
var currentStruct = this.render.ctab.molecule;
|
|
25406
25407
|
var selectionInvalid = selection.atoms.some(function (atomId) {
|
|
25407
25408
|
var atom = _this.render.ctab.molecule.atoms.get(atomId);
|
|
25408
|
-
|
|
25409
|
-
|
|
25409
|
+
if (!atom) {
|
|
25410
|
+
return true;
|
|
25411
|
+
}
|
|
25412
|
+
var sgs = atom.sgs,
|
|
25413
|
+
attachmentPoints = atom.attachmentPoints,
|
|
25414
|
+
rglabel = atom.rglabel,
|
|
25415
|
+
neighbors = atom.neighbors,
|
|
25416
|
+
label = atom.label;
|
|
25417
|
+
var belongsToSGroup = sgs.size > 0;
|
|
25418
|
+
var isAttachmentPoint = attachmentPoints !== null;
|
|
25419
|
+
var isNonTerminalRGroupLabel = rglabel !== null && neighbors.length > 1;
|
|
25420
|
+
var hasMultipleRGroupLabel = rglabel !== null && !ketcherCore.isSingleRGroupAttachmentPoint(Number(rglabel));
|
|
25421
|
+
var belongsToRGroup = _this.render.ctab.molecule.rgroups.some(function (rgroup) {
|
|
25410
25422
|
return rgroup.frags.has(atom.fragment);
|
|
25411
|
-
})
|
|
25423
|
+
});
|
|
25424
|
+
var isExtendedTableAtom = ketcherCore.genericsList.includes(label);
|
|
25425
|
+
return belongsToSGroup || isAttachmentPoint || isNonTerminalRGroupLabel || hasMultipleRGroupLabel || belongsToRGroup || isExtendedTableAtom;
|
|
25412
25426
|
});
|
|
25413
25427
|
if (selectionInvalid) {
|
|
25414
25428
|
return false;
|
|
@@ -25419,7 +25433,9 @@ var Editor$3 = function () {
|
|
|
25419
25433
|
}
|
|
25420
25434
|
var terminalRGroupAtoms = selection.atoms.filter(function (atomId) {
|
|
25421
25435
|
var atom = currentStruct.atoms.get(atomId);
|
|
25422
|
-
|
|
25436
|
+
if (!atom) {
|
|
25437
|
+
return false;
|
|
25438
|
+
}
|
|
25423
25439
|
return atom.rglabel !== null && atom.neighbors.length === 1;
|
|
25424
25440
|
});
|
|
25425
25441
|
var selectionAtoms = new Set(selection.atoms);
|
|
@@ -25437,11 +25453,24 @@ var Editor$3 = function () {
|
|
|
25437
25453
|
potentialLeavingAtoms.push(bond.begin);
|
|
25438
25454
|
}
|
|
25439
25455
|
});
|
|
25456
|
+
selectionAtoms.forEach(function (selectionAtomId) {
|
|
25457
|
+
var selectionAtom = currentStruct.atoms.get(selectionAtomId);
|
|
25458
|
+
assert_1(selectionAtom);
|
|
25459
|
+
if (selectionAtom.neighbors.length === 1 && !_.isNumber(selectionAtom.rglabel)) {
|
|
25460
|
+
potentialLeavingAtoms.push(selectionAtomId);
|
|
25461
|
+
}
|
|
25462
|
+
});
|
|
25440
25463
|
var totalPotentialLeavingAtoms = terminalRGroupAtoms.length + potentialLeavingAtoms.length;
|
|
25441
25464
|
if (totalPotentialLeavingAtoms > 8) {
|
|
25442
25465
|
return false;
|
|
25443
25466
|
}
|
|
25444
|
-
this.terminalRGroupAtoms = terminalRGroupAtoms
|
|
25467
|
+
this.terminalRGroupAtoms = terminalRGroupAtoms.map(function (atomId) {
|
|
25468
|
+
var atom = currentStruct.atoms.get(atomId);
|
|
25469
|
+
assert_1(atom);
|
|
25470
|
+
assert_1(atom.rglabel);
|
|
25471
|
+
var attachmentPointLabel = ketcherCore.getAttachmentPointLabelWithBinaryShift(Number(atom.rglabel));
|
|
25472
|
+
return [atomId, attachmentPointLabel];
|
|
25473
|
+
});
|
|
25445
25474
|
this.potentialLeavingAtoms = potentialLeavingAtoms;
|
|
25446
25475
|
return terminalRGroupAtoms.length > 0 || potentialLeavingAtoms.length > 0;
|
|
25447
25476
|
}
|
|
@@ -25466,21 +25495,54 @@ var Editor$3 = function () {
|
|
|
25466
25495
|
_this2.selectedToOriginalAtomsIdMap.set(i, atomId);
|
|
25467
25496
|
});
|
|
25468
25497
|
var assignedAttachmentPoints = new Map();
|
|
25469
|
-
this.terminalRGroupAtoms.
|
|
25498
|
+
var sideTerminalSGroupAtoms = this.terminalRGroupAtoms.filter(function (_ref) {
|
|
25499
|
+
var _ref2 = _slicedToArray__default["default"](_ref, 2),
|
|
25500
|
+
attachmentPointLabel = _ref2[1];
|
|
25501
|
+
return attachmentPointLabel !== ketcherCore.AttachmentPointName.R1 && attachmentPointLabel !== ketcherCore.AttachmentPointName.R2;
|
|
25502
|
+
});
|
|
25503
|
+
var sideAttachmentPointsNames = [];
|
|
25504
|
+
for (var i = 0; i < sideTerminalSGroupAtoms.length; i++) {
|
|
25505
|
+
var attachmentPointNumber = i + 3;
|
|
25506
|
+
if (attachmentPointNumber > 8) {
|
|
25507
|
+
break;
|
|
25508
|
+
}
|
|
25509
|
+
sideAttachmentPointsNames = sideAttachmentPointsNames.concat(ketcherCore.getAttachmentPointLabel(attachmentPointNumber));
|
|
25510
|
+
}
|
|
25511
|
+
var terminalRGroupAtomsSortedByLabel = _toConsumableArray__default["default"](this.terminalRGroupAtoms).sort(function (_ref3, _ref4) {
|
|
25512
|
+
var _ref5 = _slicedToArray__default["default"](_ref3, 2),
|
|
25513
|
+
labelA = _ref5[1];
|
|
25514
|
+
var _ref6 = _slicedToArray__default["default"](_ref4, 2),
|
|
25515
|
+
labelB = _ref6[1];
|
|
25516
|
+
var labelANumber = ketcherCore.getAttachmentPointNumberFromLabel(labelA);
|
|
25517
|
+
var labelBNumber = ketcherCore.getAttachmentPointNumberFromLabel(labelB);
|
|
25518
|
+
return labelANumber - labelBNumber;
|
|
25519
|
+
});
|
|
25520
|
+
terminalRGroupAtomsSortedByLabel.forEach(function (_ref7) {
|
|
25470
25521
|
var _selectedStruct$halfB;
|
|
25522
|
+
var _ref8 = _slicedToArray__default["default"](_ref7, 2),
|
|
25523
|
+
atomId = _ref8[0],
|
|
25524
|
+
attachmentPointLabel = _ref8[1];
|
|
25471
25525
|
var selectedStructLeavingAtomId = originalToSelectedAtomsIdMap.get(atomId);
|
|
25472
25526
|
assert_1(selectedStructLeavingAtomId !== undefined);
|
|
25473
25527
|
var selectedStructLeavingAtom = selectedStruct.atoms.get(selectedStructLeavingAtomId);
|
|
25474
25528
|
assert_1(selectedStructLeavingAtom);
|
|
25529
|
+
assert_1(selectedStructLeavingAtom.rglabel);
|
|
25530
|
+
var attachmentPointName;
|
|
25531
|
+
if (attachmentPointLabel === ketcherCore.AttachmentPointName.R1 || attachmentPointLabel === ketcherCore.AttachmentPointName.R2 || sideAttachmentPointsNames.includes(attachmentPointLabel)) {
|
|
25532
|
+
attachmentPointName = attachmentPointLabel;
|
|
25533
|
+
} else {
|
|
25534
|
+
var assignedAttachmentPointNames = Array.from(assignedAttachmentPoints.keys());
|
|
25535
|
+
attachmentPointName = ketcherCore.getNextFreeAttachmentPoint(assignedAttachmentPointNames, assignedAttachmentPointNames.length < sideAttachmentPointsNames.length);
|
|
25536
|
+
}
|
|
25475
25537
|
selectedStructLeavingAtom.rglabel = null;
|
|
25476
|
-
selectedStructLeavingAtom.label =
|
|
25538
|
+
selectedStructLeavingAtom.label = ketcherCore.AtomLabel.H;
|
|
25477
25539
|
var neighborHalfBondId = selectedStructLeavingAtom.neighbors[0];
|
|
25478
25540
|
var selectedStructAttachmentAtomId = (_selectedStruct$halfB = selectedStruct.halfBonds.get(neighborHalfBondId)) === null || _selectedStruct$halfB === void 0 ? void 0 : _selectedStruct$halfB.end;
|
|
25479
|
-
var attachmentPointName = ketcherCore.getAttachmentPointLabel(i + 1);
|
|
25480
25541
|
assert_1(selectedStructAttachmentAtomId !== undefined);
|
|
25481
25542
|
assignedAttachmentPoints.set(attachmentPointName, [selectedStructAttachmentAtomId, selectedStructLeavingAtomId]);
|
|
25482
25543
|
});
|
|
25483
|
-
|
|
25544
|
+
var selectedPotentialLeavingAtoms = new Map();
|
|
25545
|
+
this.potentialLeavingAtoms.forEach(function (atomId) {
|
|
25484
25546
|
var _selectedStruct$atoms, _selectedStruct$atoms2;
|
|
25485
25547
|
var leavingAtom = currentStruct.atoms.get(atomId);
|
|
25486
25548
|
assert_1(leavingAtom);
|
|
@@ -25496,7 +25558,20 @@ var Editor$3 = function () {
|
|
|
25496
25558
|
if (attachmentAtomId === -1) {
|
|
25497
25559
|
return;
|
|
25498
25560
|
}
|
|
25499
|
-
var
|
|
25561
|
+
var originalLeavingAtomId = originalToSelectedAtomsIdMap.get(atomId);
|
|
25562
|
+
var isLeavingAtomSelected = _.isNumber(originalLeavingAtomId);
|
|
25563
|
+
if (isLeavingAtomSelected) {
|
|
25564
|
+
var originalAttachmentAtomId = originalToSelectedAtomsIdMap.get(attachmentAtomId);
|
|
25565
|
+
if (!_.isNumber(originalAttachmentAtomId)) {
|
|
25566
|
+
return;
|
|
25567
|
+
}
|
|
25568
|
+
selectedPotentialLeavingAtoms.set(originalAttachmentAtomId, originalLeavingAtomId);
|
|
25569
|
+
return;
|
|
25570
|
+
}
|
|
25571
|
+
var selectedStructLeavingAtom = new ketcherCore.Atom({
|
|
25572
|
+
label: ketcherCore.AtomLabel.H,
|
|
25573
|
+
pp: leavingAtom.pp
|
|
25574
|
+
});
|
|
25500
25575
|
selectedStructLeavingAtom.fragment = (_selectedStruct$atoms = (_selectedStruct$atoms2 = selectedStruct.atoms.get(0)) === null || _selectedStruct$atoms2 === void 0 ? void 0 : _selectedStruct$atoms2.fragment) !== null && _selectedStruct$atoms !== void 0 ? _selectedStruct$atoms : 0;
|
|
25501
25576
|
var selectedStructLeavingAtomId = selectedStruct.atoms.add(selectedStructLeavingAtom);
|
|
25502
25577
|
_this2.selectedToOriginalAtomsIdMap.set(selectedStructLeavingAtomId, atomId);
|
|
@@ -25509,12 +25584,14 @@ var Editor$3 = function () {
|
|
|
25509
25584
|
end: selectedStructLeavingAtomId
|
|
25510
25585
|
});
|
|
25511
25586
|
selectedStruct.bonds.add(newBond);
|
|
25512
|
-
var
|
|
25587
|
+
var assignedAttachmentPointNames = Array.from(assignedAttachmentPoints.keys());
|
|
25588
|
+
var attachmentPointName = ketcherCore.getNextFreeAttachmentPoint(assignedAttachmentPointNames, assignedAttachmentPointNames.length < sideAttachmentPointsNames.length);
|
|
25513
25589
|
assignedAttachmentPoints.set(attachmentPointName, [selectedStructAttachmentAtomId, selectedStructLeavingAtomId]);
|
|
25514
25590
|
});
|
|
25515
25591
|
this.monomerCreationState = {
|
|
25516
25592
|
assignedAttachmentPoints: assignedAttachmentPoints,
|
|
25517
|
-
potentialAttachmentPoints:
|
|
25593
|
+
potentialAttachmentPoints: selectedPotentialLeavingAtoms,
|
|
25594
|
+
problematicAttachmentPoints: new Set()
|
|
25518
25595
|
};
|
|
25519
25596
|
this.originalStruct = currentStruct;
|
|
25520
25597
|
this.struct(selectedStruct);
|
|
@@ -25567,6 +25644,19 @@ var Editor$3 = function () {
|
|
|
25567
25644
|
this.struct(this.originalStruct, false);
|
|
25568
25645
|
this.tool('select');
|
|
25569
25646
|
}
|
|
25647
|
+
}, {
|
|
25648
|
+
key: "cleanupAttachmentPoint",
|
|
25649
|
+
value: function cleanupAttachmentPoint(leavingAtomId) {
|
|
25650
|
+
var leavingAtom = this.struct().atoms.get(leavingAtomId);
|
|
25651
|
+
assert_1(leavingAtom);
|
|
25652
|
+
var originalLeavingAtomId = this.selectedToOriginalAtomsIdMap.get(leavingAtomId);
|
|
25653
|
+
assert_1(_.isNumber(originalLeavingAtomId));
|
|
25654
|
+
var originalLeavingAtom = this.originalStruct.atoms.get(originalLeavingAtomId);
|
|
25655
|
+
assert_1(originalLeavingAtom);
|
|
25656
|
+
originalLeavingAtom.rglabel = null;
|
|
25657
|
+
originalLeavingAtom.label = leavingAtom.label;
|
|
25658
|
+
this.originalStruct.calcImplicitHydrogen(originalLeavingAtomId);
|
|
25659
|
+
}
|
|
25570
25660
|
}, {
|
|
25571
25661
|
key: "saveNewMonomer",
|
|
25572
25662
|
value: function saveNewMonomer(data) {
|
|
@@ -25582,10 +25672,10 @@ var Editor$3 = function () {
|
|
|
25582
25672
|
type = data.type,
|
|
25583
25673
|
naturalAnalogue = data.naturalAnalogue;
|
|
25584
25674
|
var attachmentPoints = [];
|
|
25585
|
-
this.monomerCreationState.assignedAttachmentPoints.forEach(function (
|
|
25586
|
-
var
|
|
25587
|
-
attachmentAtomId =
|
|
25588
|
-
leavingAtomId =
|
|
25675
|
+
this.monomerCreationState.assignedAttachmentPoints.forEach(function (_ref9, attachmentPointName) {
|
|
25676
|
+
var _ref10 = _slicedToArray__default["default"](_ref9, 2),
|
|
25677
|
+
attachmentAtomId = _ref10[0],
|
|
25678
|
+
leavingAtomId = _ref10[1];
|
|
25589
25679
|
var attachmentPoint = {
|
|
25590
25680
|
attachmentAtom: attachmentAtomId,
|
|
25591
25681
|
leavingGroup: {
|
|
@@ -25624,19 +25714,13 @@ var Editor$3 = function () {
|
|
|
25624
25714
|
Monomer = _monomerFactory2[0];
|
|
25625
25715
|
var monomerPosition = new ketcherCore.Vec2((this.selectionBBox.min.x + this.selectionBBox.max.x) / 2, (this.selectionBBox.min.y + this.selectionBBox.max.y) / 2);
|
|
25626
25716
|
var monomer = new Monomer(monomerItem, monomerPosition);
|
|
25627
|
-
|
|
25628
|
-
|
|
25629
|
-
|
|
25630
|
-
|
|
25631
|
-
|
|
25632
|
-
|
|
25633
|
-
|
|
25634
|
-
assert_1(originalLeavingAtomId);
|
|
25635
|
-
var originalLeavingAtom = _this3.originalStruct.atoms.get(originalLeavingAtomId);
|
|
25636
|
-
assert_1(originalLeavingAtom);
|
|
25637
|
-
originalLeavingAtom.rglabel = null;
|
|
25638
|
-
originalLeavingAtom.label = leavingAtom.label;
|
|
25639
|
-
_this3.originalStruct.calcImplicitHydrogen(originalLeavingAtomId);
|
|
25717
|
+
this.monomerCreationState.assignedAttachmentPoints.forEach(function (_ref11) {
|
|
25718
|
+
var _ref12 = _slicedToArray__default["default"](_ref11, 2),
|
|
25719
|
+
leavingAtomId = _ref12[1];
|
|
25720
|
+
return _this3.cleanupAttachmentPoint(leavingAtomId);
|
|
25721
|
+
});
|
|
25722
|
+
this.monomerCreationState.potentialAttachmentPoints.forEach(function (leavingAtomId) {
|
|
25723
|
+
return _this3.cleanupAttachmentPoint(leavingAtomId);
|
|
25640
25724
|
});
|
|
25641
25725
|
this.closeMonomerCreationWizard();
|
|
25642
25726
|
(_this$originalSelecti = this.originalSelection.atoms) === null || _this$originalSelecti === void 0 || _this$originalSelecti.forEach(function (atomId) {
|
|
@@ -25646,9 +25730,19 @@ var Editor$3 = function () {
|
|
|
25646
25730
|
}
|
|
25647
25731
|
});
|
|
25648
25732
|
var sGroupAttachmentPoints = ketcherCore.MacromoleculesConverter.convertMonomerAttachmentPointsToSGroupAttachmentPoints(monomer, this.selectedToOriginalAtomsIdMap);
|
|
25733
|
+
sGroupAttachmentPoints.forEach(function (ap) {
|
|
25734
|
+
_this3.render.ctab.molecule.bonds.forEach(function (bond) {
|
|
25735
|
+
var _this3$originalSelect, _this3$originalSelect2;
|
|
25736
|
+
if ((bond.begin === ap.atomId || bond.end === ap.atomId) && (!((_this3$originalSelect = _this3.originalSelection.atoms) !== null && _this3$originalSelect !== void 0 && _this3$originalSelect.includes(bond.begin)) || !((_this3$originalSelect2 = _this3.originalSelection.atoms) !== null && _this3$originalSelect2 !== void 0 && _this3$originalSelect2.includes(bond.end)))) {
|
|
25737
|
+
bond.beginSuperatomAttachmentPointNumber = ap.attachmentPointNumber;
|
|
25738
|
+
}
|
|
25739
|
+
});
|
|
25740
|
+
});
|
|
25649
25741
|
var action = ketcherCore.fromSgroupAddition(this.render.ctab, ketcherCore.SGroup.TYPES.SUP, this.originalSelection.atoms, {
|
|
25650
25742
|
expanded: true
|
|
25651
25743
|
}, this.render.ctab.molecule.sgroups.newId(), sGroupAttachmentPoints, monomer.position, true, monomer.monomerItem.props.MonomerName, null, monomer);
|
|
25744
|
+
this.render.ctab.molecule.clearFragments();
|
|
25745
|
+
this.render.ctab.molecule.markFragments();
|
|
25652
25746
|
this.update(action);
|
|
25653
25747
|
var templateRoot = monomerTemplate.root,
|
|
25654
25748
|
templateData = _objectWithoutProperties__default["default"](monomerTemplate, _excluded$p);
|
|
@@ -25673,6 +25767,7 @@ var Editor$3 = function () {
|
|
|
25673
25767
|
key: "reassignAttachmentPoint",
|
|
25674
25768
|
value: function reassignAttachmentPoint(currentName, newName) {
|
|
25675
25769
|
assert_1(this.monomerCreationState);
|
|
25770
|
+
this.monomerCreationState.problematicAttachmentPoints["delete"](currentName);
|
|
25676
25771
|
var atomPair = this.monomerCreationState.assignedAttachmentPoints.get(currentName);
|
|
25677
25772
|
assert_1(atomPair);
|
|
25678
25773
|
if (this.monomerCreationState.assignedAttachmentPoints.has(newName)) {
|
|
@@ -25697,6 +25792,21 @@ var Editor$3 = function () {
|
|
|
25697
25792
|
this.monomerCreationState = Object.assign({}, this.monomerCreationState);
|
|
25698
25793
|
this.render.update(true);
|
|
25699
25794
|
}
|
|
25795
|
+
}, {
|
|
25796
|
+
key: "cleanupCloseAttachmentPointEditPopup",
|
|
25797
|
+
value: function cleanupCloseAttachmentPointEditPopup() {
|
|
25798
|
+
assert_1(this.monomerCreationState);
|
|
25799
|
+
this.monomerCreationState.clickedAttachmentPoint = null;
|
|
25800
|
+
this.render.update(true);
|
|
25801
|
+
}
|
|
25802
|
+
}, {
|
|
25803
|
+
key: "setProblematicAttachmentPoints",
|
|
25804
|
+
value: function setProblematicAttachmentPoints(problematicPoints) {
|
|
25805
|
+
assert_1(this.monomerCreationState);
|
|
25806
|
+
this.monomerCreationState.problematicAttachmentPoints = problematicPoints;
|
|
25807
|
+
this.monomerCreationState = Object.assign({}, this.monomerCreationState);
|
|
25808
|
+
this.render.update(true);
|
|
25809
|
+
}
|
|
25700
25810
|
}, {
|
|
25701
25811
|
key: "selection",
|
|
25702
25812
|
value: function selection(ci) {
|
|
@@ -26116,10 +26226,10 @@ function domEventSetup(editor, clientArea) {
|
|
|
26116
26226
|
eventName: 'mouseover',
|
|
26117
26227
|
toolEventHandler: 'mouseover'
|
|
26118
26228
|
}];
|
|
26119
|
-
trackedDomEvents.forEach(function (
|
|
26120
|
-
var target =
|
|
26121
|
-
eventName =
|
|
26122
|
-
toolEventHandler =
|
|
26229
|
+
trackedDomEvents.forEach(function (_ref13) {
|
|
26230
|
+
var target = _ref13.target,
|
|
26231
|
+
eventName = _ref13.eventName,
|
|
26232
|
+
toolEventHandler = _ref13.toolEventHandler;
|
|
26123
26233
|
editor.event[eventName] = new subscription.DOMSubscription();
|
|
26124
26234
|
var subs = editor.event[eventName];
|
|
26125
26235
|
target.addEventListener(eventName, function () {
|
|
@@ -26493,7 +26603,7 @@ var useMakeLeavingGroupAtomMenuItem = function useMakeLeavingGroupAtomMenuItem(_
|
|
|
26493
26603
|
var attachmentPointName = Array.from(assignedAttachmentPoints.keys()).find(function (key) {
|
|
26494
26604
|
var atomsPair = assignedAttachmentPoints.get(key);
|
|
26495
26605
|
assert_1(atomsPair);
|
|
26496
|
-
return atomsPair
|
|
26606
|
+
return atomsPair[1] === selectedAtomId;
|
|
26497
26607
|
});
|
|
26498
26608
|
var isAtomAssignedAttachmentPoint = Boolean(attachmentPointName);
|
|
26499
26609
|
if (!isAtomPotentialAttachmentPoint && !isAtomAssignedAttachmentPoint) {
|
|
@@ -28654,6 +28764,9 @@ var attachmentPointAtomOptions = [{
|
|
|
28654
28764
|
}, {
|
|
28655
28765
|
value: ketcherCore.AtomLabel.F,
|
|
28656
28766
|
label: 'F'
|
|
28767
|
+
}, {
|
|
28768
|
+
value: ketcherCore.AtomLabel.C,
|
|
28769
|
+
label: 'CH3'
|
|
28657
28770
|
}];
|
|
28658
28771
|
var AttachmentPointEditPopup = function AttachmentPointEditPopup(_ref) {
|
|
28659
28772
|
var data = _ref.data,
|
|
@@ -28745,7 +28858,8 @@ var styles$f = {"attachmentPoint":"AttachmentPoint-module_attachmentPoint__6KD5K
|
|
|
28745
28858
|
|
|
28746
28859
|
var AttachmentPoint = function AttachmentPoint(_ref) {
|
|
28747
28860
|
var name = _ref.name,
|
|
28748
|
-
atomLabel = _ref.atomLabel
|
|
28861
|
+
atomLabel = _ref.atomLabel,
|
|
28862
|
+
implicitH = _ref.implicitH;
|
|
28749
28863
|
return jsxRuntime.jsx("div", {
|
|
28750
28864
|
className: styles$f.attachmentPoint,
|
|
28751
28865
|
children: jsxRuntime.jsxs("p", {
|
|
@@ -28753,7 +28867,13 @@ var AttachmentPoint = function AttachmentPoint(_ref) {
|
|
|
28753
28867
|
children: [jsxRuntime.jsx("span", {
|
|
28754
28868
|
className: styles$f.attachmentPointIndex,
|
|
28755
28869
|
children: name
|
|
28756
|
-
}), "\xA0
|
|
28870
|
+
}), "\xA0", jsxRuntime.jsxs("span", {
|
|
28871
|
+
children: ["(", implicitH > 1 && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
28872
|
+
children: ["H", jsxRuntime.jsx("sub", {
|
|
28873
|
+
children: implicitH
|
|
28874
|
+
})]
|
|
28875
|
+
}), atomLabel, ")"]
|
|
28876
|
+
})]
|
|
28757
28877
|
})
|
|
28758
28878
|
});
|
|
28759
28879
|
};
|
|
@@ -28880,31 +29000,50 @@ var validateInputs = function validateInputs(values) {
|
|
|
28880
29000
|
};
|
|
28881
29001
|
var validateAttachmentPoints = function validateAttachmentPoints(attachmentPoints) {
|
|
28882
29002
|
var notifications = new Map();
|
|
29003
|
+
var problematicAttachmentPoints = new Set();
|
|
28883
29004
|
if (attachmentPoints.length === 0) {
|
|
28884
29005
|
notifications.set('noAttachmentPoints', {
|
|
28885
29006
|
type: 'error',
|
|
28886
29007
|
message: NotificationMessages.noAttachmentPoints
|
|
28887
29008
|
});
|
|
28888
|
-
return
|
|
29009
|
+
return {
|
|
29010
|
+
notifications: notifications,
|
|
29011
|
+
problematicAttachmentPoints: problematicAttachmentPoints
|
|
29012
|
+
};
|
|
28889
29013
|
}
|
|
28890
|
-
var
|
|
28891
|
-
|
|
28892
|
-
return
|
|
29014
|
+
var sideAttachmentPoints = attachmentPoints.filter(function (attachmentPointName) {
|
|
29015
|
+
var pointNumber = ketcherCore.getAttachmentPointNumberFromLabel(attachmentPointName);
|
|
29016
|
+
return pointNumber > 2;
|
|
28893
29017
|
});
|
|
28894
|
-
|
|
28895
|
-
|
|
28896
|
-
|
|
29018
|
+
if (sideAttachmentPoints.length === 0) {
|
|
29019
|
+
return {
|
|
29020
|
+
notifications: notifications,
|
|
29021
|
+
problematicAttachmentPoints: problematicAttachmentPoints
|
|
29022
|
+
};
|
|
28897
29023
|
}
|
|
28898
|
-
|
|
28899
|
-
|
|
28900
|
-
|
|
28901
|
-
|
|
28902
|
-
|
|
28903
|
-
|
|
28904
|
-
|
|
29024
|
+
var expectedSequence = [];
|
|
29025
|
+
for (var i = 3; i < 3 + sideAttachmentPoints.length; i++) {
|
|
29026
|
+
expectedSequence.push(i);
|
|
29027
|
+
}
|
|
29028
|
+
var actualNumbers = sideAttachmentPoints.map(ketcherCore.getAttachmentPointNumberFromLabel).sort(function (a, b) {
|
|
29029
|
+
return a - b;
|
|
29030
|
+
});
|
|
29031
|
+
actualNumbers.forEach(function (actualNumber) {
|
|
29032
|
+
if (!expectedSequence.includes(actualNumber)) {
|
|
29033
|
+
var problematicPointName = ketcherCore.getAttachmentPointLabel(actualNumber);
|
|
29034
|
+
problematicAttachmentPoints.add(problematicPointName);
|
|
28905
29035
|
}
|
|
29036
|
+
});
|
|
29037
|
+
if (problematicAttachmentPoints.size > 0) {
|
|
29038
|
+
notifications.set('incorrectAttachmentPointsOrder', {
|
|
29039
|
+
type: 'error',
|
|
29040
|
+
message: NotificationMessages.incorrectAttachmentPointsOrder
|
|
29041
|
+
});
|
|
28906
29042
|
}
|
|
28907
|
-
return
|
|
29043
|
+
return {
|
|
29044
|
+
notifications: notifications,
|
|
29045
|
+
problematicAttachmentPoints: problematicAttachmentPoints
|
|
29046
|
+
};
|
|
28908
29047
|
};
|
|
28909
29048
|
var MonomerCreationWizard = function MonomerCreationWizard() {
|
|
28910
29049
|
var _useAppContext = useAppContext(),
|
|
@@ -29001,6 +29140,7 @@ var MonomerCreationWizard = function MonomerCreationWizard() {
|
|
|
29001
29140
|
};
|
|
29002
29141
|
var handleAttachmentPointEditPopupClose = function handleAttachmentPointEditPopupClose() {
|
|
29003
29142
|
setAttachmentPointEditPopupData(null);
|
|
29143
|
+
editor.cleanupCloseAttachmentPointEditPopup();
|
|
29004
29144
|
};
|
|
29005
29145
|
var handleDiscard = function handleDiscard() {
|
|
29006
29146
|
editor.closeMonomerCreationWizard();
|
|
@@ -29010,6 +29150,7 @@ var MonomerCreationWizard = function MonomerCreationWizard() {
|
|
|
29010
29150
|
wizardStateDispatch({
|
|
29011
29151
|
type: 'ResetErrors'
|
|
29012
29152
|
});
|
|
29153
|
+
editor.setProblematicAttachmentPoints(new Set());
|
|
29013
29154
|
var _validateInputs = validateInputs(values),
|
|
29014
29155
|
inputsErrors = _validateInputs.errors,
|
|
29015
29156
|
inputsNotifications = _validateInputs.notifications;
|
|
@@ -29025,12 +29166,15 @@ var MonomerCreationWizard = function MonomerCreationWizard() {
|
|
|
29025
29166
|
return;
|
|
29026
29167
|
}
|
|
29027
29168
|
assert_1(editor.monomerCreationState);
|
|
29028
|
-
var
|
|
29169
|
+
var _validateAttachmentPo = validateAttachmentPoints(Array.from(editor.monomerCreationState.assignedAttachmentPoints.keys())),
|
|
29170
|
+
attachmentPointsNotifications = _validateAttachmentPo.notifications,
|
|
29171
|
+
problematicAttachmentPoints = _validateAttachmentPo.problematicAttachmentPoints;
|
|
29029
29172
|
if (attachmentPointsNotifications.size > 0) {
|
|
29030
29173
|
wizardStateDispatch({
|
|
29031
29174
|
type: 'SetNotifications',
|
|
29032
29175
|
notifications: attachmentPointsNotifications
|
|
29033
29176
|
});
|
|
29177
|
+
editor.setProblematicAttachmentPoints(problematicAttachmentPoints);
|
|
29034
29178
|
return;
|
|
29035
29179
|
}
|
|
29036
29180
|
editor.saveNewMonomer({
|
|
@@ -29055,12 +29199,14 @@ var MonomerCreationWizard = function MonomerCreationWizard() {
|
|
|
29055
29199
|
if (!atom) {
|
|
29056
29200
|
return {
|
|
29057
29201
|
name: attachmentPointName,
|
|
29058
|
-
atomLabel: 'H'
|
|
29202
|
+
atomLabel: 'H',
|
|
29203
|
+
implicitH: 0
|
|
29059
29204
|
};
|
|
29060
29205
|
}
|
|
29061
29206
|
return {
|
|
29062
29207
|
name: attachmentPointName,
|
|
29063
|
-
atomLabel: atom.label
|
|
29208
|
+
atomLabel: atom.label,
|
|
29209
|
+
implicitH: atom.implicitH
|
|
29064
29210
|
};
|
|
29065
29211
|
});
|
|
29066
29212
|
var ketcherEditorRootElement = document.querySelector(KETCHER_ROOT_NODE_CSS_SELECTOR);
|
|
@@ -29160,10 +29306,12 @@ var MonomerCreationWizard = function MonomerCreationWizard() {
|
|
|
29160
29306
|
className: styles$l.attachmentPoints,
|
|
29161
29307
|
children: attachmentPointsData.map(function (_ref5) {
|
|
29162
29308
|
var name = _ref5.name,
|
|
29163
|
-
atomLabel = _ref5.atomLabel
|
|
29309
|
+
atomLabel = _ref5.atomLabel,
|
|
29310
|
+
implicitH = _ref5.implicitH;
|
|
29164
29311
|
return jsxRuntime.jsx(AttachmentPoint, {
|
|
29165
29312
|
name: name,
|
|
29166
|
-
atomLabel: atomLabel
|
|
29313
|
+
atomLabel: atomLabel,
|
|
29314
|
+
implicitH: implicitH
|
|
29167
29315
|
}, name);
|
|
29168
29316
|
})
|
|
29169
29317
|
})]
|
|
@@ -37174,8 +37322,8 @@ var KetcherBuilder = function () {
|
|
|
37174
37322
|
cleanup = initApp(prevKetcherId, ketcherId, element, appRoot, staticResourcesUrl, {
|
|
37175
37323
|
buttons: buttons || {},
|
|
37176
37324
|
errorHandler: errorHandler || null,
|
|
37177
|
-
version: "3.8.0-rc.
|
|
37178
|
-
buildDate: "2025-09-
|
|
37325
|
+
version: "3.8.0-rc.4" ,
|
|
37326
|
+
buildDate: "2025-09-17T17:13:08" ,
|
|
37179
37327
|
buildNumber: '',
|
|
37180
37328
|
customButtons: customButtons || []
|
|
37181
37329
|
}, structService, resolve, togglerComponent);
|
|
@@ -37470,7 +37618,7 @@ var ModeControl = function ModeControl(_ref3) {
|
|
|
37470
37618
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
37471
37619
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37472
37620
|
var MacromoleculesEditorComponent = React.lazy(function () {
|
|
37473
|
-
return Promise.resolve().then(function () { return require('./index.modern-
|
|
37621
|
+
return Promise.resolve().then(function () { return require('./index.modern-7604afae.js'); });
|
|
37474
37622
|
});
|
|
37475
37623
|
var Editor = function Editor(props) {
|
|
37476
37624
|
var _useState = React.useState(false),
|