ketcher-react 2.26.0-rc.6 → 2.26.0-rc.7
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 +82 -44
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +82 -44
- package/dist/index.modern.js.map +1 -1
- package/dist/script/editor/Editor.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -3733,7 +3733,7 @@ var zoom = {
|
|
|
3733
3733
|
|
|
3734
3734
|
var openHelpLink = function openHelpLink() {
|
|
3735
3735
|
var _window$open;
|
|
3736
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.26.0-rc.
|
|
3736
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.26.0-rc.7\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
|
|
3737
3737
|
};
|
|
3738
3738
|
var help = {
|
|
3739
3739
|
help: {
|
|
@@ -16150,22 +16150,34 @@ function getElementsInRectangle(restruct, p0, p1) {
|
|
|
16150
16150
|
var bottomLeftPosition = new Vec2(x0, y1);
|
|
16151
16151
|
var polygon = [topLeftPosition, topRightPosition, bottomRightPosition, bottomLeftPosition];
|
|
16152
16152
|
restruct.bonds.forEach(function (bond, bid) {
|
|
16153
|
-
if (
|
|
16153
|
+
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups)) {
|
|
16154
16154
|
return;
|
|
16155
16155
|
}
|
|
16156
|
-
var
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16156
|
+
var center;
|
|
16157
|
+
if (bond.b.isExternalBondBetweenMonomers(struct)) {
|
|
16158
|
+
var firstMonomer = struct.getGroupFromAtomId(bond.b.begin);
|
|
16159
|
+
var secondMonomer = struct.getGroupFromAtomId(bond.b.end);
|
|
16160
|
+
assert_1(firstMonomer);
|
|
16161
|
+
assert_1(secondMonomer);
|
|
16162
|
+
center = firstMonomer.pp && secondMonomer.pp ? Vec2.centre(firstMonomer.pp, secondMonomer.pp) : bond.b.center;
|
|
16163
|
+
} else {
|
|
16164
|
+
center = bond.b.center;
|
|
16165
|
+
}
|
|
16166
|
+
if (center.x > x0 && center.x < x1 && center.y > y0 && center.y < y1) {
|
|
16160
16167
|
bondList.push(bid);
|
|
16161
16168
|
}
|
|
16162
16169
|
});
|
|
16163
16170
|
restruct.atoms.forEach(function (atom, aid) {
|
|
16164
16171
|
var relatedFGId = FunctionalGroup.findFunctionalGroupByAtom(functionalGroups, aid);
|
|
16165
|
-
var
|
|
16166
|
-
if (
|
|
16167
|
-
|
|
16168
|
-
|
|
16172
|
+
var sGroup = struct.sgroups.get(relatedFGId);
|
|
16173
|
+
if (struct.isAtomFromMacromolecule(aid)) {
|
|
16174
|
+
if (sGroup && sGroup.pp && sGroup.pp.x > x0 && sGroup.pp.x < x1 && sGroup.pp.y > y0 && sGroup.pp.y < y1) {
|
|
16175
|
+
atomList.push(aid);
|
|
16176
|
+
}
|
|
16177
|
+
} else {
|
|
16178
|
+
if (atom.a.pp.x > x0 && atom.a.pp.x < x1 && atom.a.pp.y > y0 && atom.a.pp.y < y1 && (!FunctionalGroup.isAtomInContractedFunctionalGroup(atom.a, sGroups, functionalGroups, true) || aid === (sGroup === null || sGroup === void 0 ? void 0 : sGroup.atoms[0]))) {
|
|
16179
|
+
atomList.push(aid);
|
|
16180
|
+
}
|
|
16169
16181
|
}
|
|
16170
16182
|
});
|
|
16171
16183
|
var rxnArrowsList = [];
|
|
@@ -16260,22 +16272,34 @@ function getElementsInPolygon(restruct, rr) {
|
|
|
16260
16272
|
r[i] = new Vec2(rr[i].x, rr[i].y);
|
|
16261
16273
|
}
|
|
16262
16274
|
restruct.bonds.forEach(function (bond, bid) {
|
|
16263
|
-
if (
|
|
16275
|
+
if (FunctionalGroup.isBondInContractedFunctionalGroup(bond.b, sGroups, functionalGroups)) {
|
|
16264
16276
|
return;
|
|
16265
16277
|
}
|
|
16266
|
-
var
|
|
16267
|
-
|
|
16268
|
-
|
|
16269
|
-
|
|
16278
|
+
var center;
|
|
16279
|
+
if (bond.b.isExternalBondBetweenMonomers(struct)) {
|
|
16280
|
+
var firstMonomer = struct.getGroupFromAtomId(bond.b.begin);
|
|
16281
|
+
var secondMonomer = struct.getGroupFromAtomId(bond.b.end);
|
|
16282
|
+
assert_1(firstMonomer);
|
|
16283
|
+
assert_1(secondMonomer);
|
|
16284
|
+
center = firstMonomer !== null && firstMonomer !== void 0 && firstMonomer.pp && secondMonomer !== null && secondMonomer !== void 0 && secondMonomer.pp ? Vec2.centre(firstMonomer.pp, secondMonomer.pp) : bond.b.center;
|
|
16285
|
+
} else {
|
|
16286
|
+
center = bond.b.center;
|
|
16287
|
+
}
|
|
16288
|
+
if (isPointInPolygon(r, center)) {
|
|
16270
16289
|
bondList.push(bid);
|
|
16271
16290
|
}
|
|
16272
16291
|
});
|
|
16273
16292
|
restruct.atoms.forEach(function (atom, aid) {
|
|
16274
16293
|
var relatedFGId = FunctionalGroup.findFunctionalGroupByAtom(functionalGroups, aid);
|
|
16275
|
-
var
|
|
16276
|
-
if (
|
|
16277
|
-
|
|
16278
|
-
|
|
16294
|
+
var sGroup = struct.sgroups.get(relatedFGId);
|
|
16295
|
+
if (struct.isAtomFromMacromolecule(aid)) {
|
|
16296
|
+
if (sGroup && sGroup.pp && isPointInPolygon(r, sGroup.pp)) {
|
|
16297
|
+
atomList.push(aid);
|
|
16298
|
+
}
|
|
16299
|
+
} else {
|
|
16300
|
+
if (isPointInPolygon(r, atom.a.pp) && (!FunctionalGroup.isAtomInContractedFunctionalGroup(atom.a, sGroups, functionalGroups, true) || aid === (sGroup === null || sGroup === void 0 ? void 0 : sGroup.atoms[0]))) {
|
|
16301
|
+
atomList.push(aid);
|
|
16302
|
+
}
|
|
16279
16303
|
}
|
|
16280
16304
|
});
|
|
16281
16305
|
var rxnArrowsList = [];
|
|
@@ -24581,21 +24605,13 @@ var Editor$3 = function () {
|
|
|
24581
24605
|
if (arguments.length === 0) {
|
|
24582
24606
|
return this._selection;
|
|
24583
24607
|
}
|
|
24584
|
-
var struct = this.struct();
|
|
24585
24608
|
var ReStruct = this.render.ctab;
|
|
24586
24609
|
var selectAll = false;
|
|
24587
24610
|
this._selection = null;
|
|
24588
24611
|
if (ci === 'all') {
|
|
24589
24612
|
selectAll = true;
|
|
24590
24613
|
ci = structObjects.reduce(function (res, key) {
|
|
24591
|
-
|
|
24592
|
-
restructItemsIds = restructItemsIds.filter(function (restructItemId) {
|
|
24593
|
-
return !struct.isTargetFromMacromolecule({
|
|
24594
|
-
map: key,
|
|
24595
|
-
id: restructItemId
|
|
24596
|
-
});
|
|
24597
|
-
});
|
|
24598
|
-
res[key] = restructItemsIds;
|
|
24614
|
+
res[key] = Array.from(ReStruct[key].keys());
|
|
24599
24615
|
return res;
|
|
24600
24616
|
}, {});
|
|
24601
24617
|
}
|
|
@@ -26409,24 +26425,46 @@ function getMenuPropsForClosestItem(editor, closestItem) {
|
|
|
26409
26425
|
case 'bonds':
|
|
26410
26426
|
{
|
|
26411
26427
|
var functionalGroup = FunctionalGroup.findFunctionalGroupByBond(struct, struct.functionalGroups, closestItem.id, true);
|
|
26412
|
-
|
|
26413
|
-
|
|
26414
|
-
|
|
26415
|
-
|
|
26416
|
-
|
|
26417
|
-
|
|
26418
|
-
|
|
26428
|
+
var noFunctionalGroup = functionalGroup === null || (functionalGroup === null || functionalGroup === void 0 ? void 0 : functionalGroup.relatedSGroup.isSuperatomWithoutLabel);
|
|
26429
|
+
var isMonomer = (functionalGroup === null || functionalGroup === void 0 ? void 0 : functionalGroup.relatedSGroup) instanceof MonomerMicromolecule;
|
|
26430
|
+
if (noFunctionalGroup) {
|
|
26431
|
+
return {
|
|
26432
|
+
id: CONTEXT_MENU_ID.FOR_BONDS,
|
|
26433
|
+
bondIds: [closestItem.id]
|
|
26434
|
+
};
|
|
26435
|
+
} else if (isMonomer) {
|
|
26436
|
+
return {
|
|
26437
|
+
id: CONTEXT_MENU_ID.FOR_MACROMOLECULE,
|
|
26438
|
+
functionalGroups: [functionalGroup]
|
|
26439
|
+
};
|
|
26440
|
+
} else {
|
|
26441
|
+
return {
|
|
26442
|
+
id: CONTEXT_MENU_ID.FOR_FUNCTIONAL_GROUPS,
|
|
26443
|
+
functionalGroups: [functionalGroup]
|
|
26444
|
+
};
|
|
26445
|
+
}
|
|
26419
26446
|
}
|
|
26420
26447
|
case 'atoms':
|
|
26421
26448
|
{
|
|
26422
26449
|
var _functionalGroup = FunctionalGroup.findFunctionalGroupByAtom(struct.functionalGroups, closestItem.id, true);
|
|
26423
|
-
|
|
26424
|
-
|
|
26425
|
-
|
|
26426
|
-
|
|
26427
|
-
|
|
26428
|
-
|
|
26429
|
-
|
|
26450
|
+
var _noFunctionalGroup = _functionalGroup === null || (_functionalGroup === null || _functionalGroup === void 0 ? void 0 : _functionalGroup.relatedSGroup.isSuperatomWithoutLabel);
|
|
26451
|
+
var _isMonomer = (_functionalGroup === null || _functionalGroup === void 0 ? void 0 : _functionalGroup.relatedSGroup) instanceof MonomerMicromolecule;
|
|
26452
|
+
if (_noFunctionalGroup) {
|
|
26453
|
+
return {
|
|
26454
|
+
id: CONTEXT_MENU_ID.FOR_ATOMS,
|
|
26455
|
+
atomIds: [closestItem.id]
|
|
26456
|
+
};
|
|
26457
|
+
} else if (_isMonomer) {
|
|
26458
|
+
return {
|
|
26459
|
+
id: CONTEXT_MENU_ID.FOR_MACROMOLECULE,
|
|
26460
|
+
functionalGroups: [_functionalGroup]
|
|
26461
|
+
};
|
|
26462
|
+
} else {
|
|
26463
|
+
return {
|
|
26464
|
+
id: CONTEXT_MENU_ID.FOR_FUNCTIONAL_GROUPS,
|
|
26465
|
+
functionalGroups: [_functionalGroup]
|
|
26466
|
+
};
|
|
26467
|
+
}
|
|
26430
26468
|
}
|
|
26431
26469
|
case 'sgroups':
|
|
26432
26470
|
case 'functionalGroups':
|
|
@@ -34784,8 +34822,8 @@ var KetcherBuilder = function () {
|
|
|
34784
34822
|
cleanup = initApp(element, appRoot, staticResourcesUrl, {
|
|
34785
34823
|
buttons: buttons || {},
|
|
34786
34824
|
errorHandler: errorHandler || null,
|
|
34787
|
-
version: "2.26.0-rc.
|
|
34788
|
-
buildDate: "2024-
|
|
34825
|
+
version: "2.26.0-rc.7" ,
|
|
34826
|
+
buildDate: "2024-11-04T09:39:10" ,
|
|
34789
34827
|
buildNumber: '',
|
|
34790
34828
|
customButtons: customButtons || []
|
|
34791
34829
|
}, structService, resolve, togglerComponent);
|