ketcher-react 2.23.0-rc.1 → 2.23.0-rc.2

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.
@@ -24,7 +24,7 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
24
24
  import _regeneratorRuntime from '@babel/runtime/regenerator';
25
25
  import _classCallCheck$2 from '@babel/runtime/helpers/classCallCheck';
26
26
  import _createClass$2 from '@babel/runtime/helpers/createClass';
27
- import { KetSerializer, MolSerializer, KetcherLogger, Ketcher, defaultBondThickness, FormatterFactory, isClipboardAPIAvailable, notifyCopyCut, notifyRequestCompleted, isControlKey, StereLabelStyleType, StereoColoringType, ShowHydrogenLabels, ShowHydrogenLabelNames, SettingsManager, SdfSerializer, KETCHER_SAVED_OPTIONS_KEY, Bond as Bond$2, Elements, AtomList, getAtomType, StereoLabel, isAttachmentBond, Atom as Atom$2, findStereoAtoms, RxnArrowMode, SimpleObjectMode, SGroup as SGroup$1, Pile, getStereoAtomsMap, identifyStructFormat, SupportedFormat, ChemicalMimeType, RenderStruct, Struct, shortcutStr, MonomerMicromolecule, FunctionalGroupsProvider, SaltsAndSolventsProvider, KetcherAsyncEvents, ElementColor, generateMenuShortcuts, Vec2, Scale, fromMultipleMove, FunctionalGroup, fromSgroupDeletion, fromFragmentDeletion, mergeMapOfItemsToSet, vectorUtils, fromBondAddition, Action, fromAtomAddition, fromAtomsAttrs, checkOverlapping, fromSeveralSgroupAddition, expandSGroupWithMultipleAttachmentPoint, SgContexts, fromSgroupAction, fromItemsFuse, ReBond, setExpandSGroup, fromBondsAttrs, OperationType, ReStruct, fromSimpleObjectResizing, fromArrowResizing, getItemsToFuse, getHoverToFuse, fromTextDeletion, fromTextUpdating, CoordinateTransformation, fromTemplateOnCanvas, fromTemplateOnBondAction, fromTemplateOnAtom, BondAttr, AtomAttr, formatProperties, ketcherProvider, runAsyncAction, getStructStringFromClipboardData, getStructure, initHotKeys, keyNorm, Fragment as Fragment$1, fromRGroupAttachmentPointUpdate, fromOneBondDeletion, bondChangingAction, fromChain, fromStereoFlagUpdate, fromOneAtomDeletion, fromArrowDeletion, fromPlusDeletion, fromSimpleObjectDeletion, fromRGroupAttachmentPointDeletion, notifyItemsToMergeInitializationComplete, fromPaste, RGroup as RGroup$2, fromRGroupFragment, fromUpdateIfThen, fromRGroupAttrs, fromArrowAddition, fromPlusAddition, fromRotate, fromFlip, fromSimpleObjectAddition, fromTextCreation, fromHighlightCreate, fromHighlightClear, provideEditorSettings, fromNewCanvas, Render, fromDescriptorsAlign, fromSgroupAttachmentPointAddition, SGroupAttachmentPoint, fromSgroupAddition, atomGetAttr, genericsList, getAtomCustomQuery, getFormatMimeTypeByFileName, getPropertiesByFormat, StereoFlag, getPropertiesByImgFormat, b64toBlob, Generics, TextCommand, DefaultStructServiceOptions } from 'ketcher-core';
27
+ import { KetSerializer, MolSerializer, KetcherLogger, Ketcher, defaultBondThickness, FormatterFactory, isClipboardAPIAvailable, notifyCopyCut, notifyRequestCompleted, isControlKey, StereLabelStyleType, StereoColoringType, ShowHydrogenLabels, ShowHydrogenLabelNames, SettingsManager, SdfSerializer, KETCHER_SAVED_OPTIONS_KEY, Bond as Bond$2, Elements, AtomList, getAtomType, StereoLabel, isAttachmentBond, Atom as Atom$2, findStereoAtoms, RxnArrowMode, SimpleObjectMode, SGroup as SGroup$1, Pile, getStereoAtomsMap, identifyStructFormat, SupportedFormat, ChemicalMimeType, RenderStruct, Struct, shortcutStr, MonomerMicromolecule, UnresolvedMonomer, FunctionalGroupsProvider, SaltsAndSolventsProvider, KetcherAsyncEvents, ElementColor, generateMenuShortcuts, Vec2, Scale, fromMultipleMove, FunctionalGroup, fromSgroupDeletion, fromFragmentDeletion, mergeMapOfItemsToSet, vectorUtils, fromBondAddition, Action, fromAtomAddition, fromAtomsAttrs, checkOverlapping, fromSeveralSgroupAddition, expandSGroupWithMultipleAttachmentPoint, SgContexts, fromSgroupAction, fromItemsFuse, ReBond, setExpandSGroup, fromBondsAttrs, OperationType, ReStruct, fromSimpleObjectResizing, fromArrowResizing, getItemsToFuse, getHoverToFuse, fromTextDeletion, fromTextUpdating, CoordinateTransformation, fromTemplateOnCanvas, fromTemplateOnBondAction, fromTemplateOnAtom, BondAttr, AtomAttr, formatProperties, ketcherProvider, runAsyncAction, getStructStringFromClipboardData, getStructure, initHotKeys, keyNorm, Fragment as Fragment$1, fromRGroupAttachmentPointUpdate, fromOneBondDeletion, bondChangingAction, fromChain, fromStereoFlagUpdate, fromOneAtomDeletion, fromArrowDeletion, fromPlusDeletion, fromSimpleObjectDeletion, fromRGroupAttachmentPointDeletion, notifyItemsToMergeInitializationComplete, fromPaste, RGroup as RGroup$2, fromRGroupFragment, fromUpdateIfThen, fromRGroupAttrs, fromArrowAddition, fromPlusAddition, fromRotate, fromFlip, fromSimpleObjectAddition, fromTextCreation, fromHighlightCreate, fromHighlightClear, provideEditorSettings, fromNewCanvas, Render, fromDescriptorsAlign, fromSgroupAttachmentPointAddition, SGroupAttachmentPoint, fromSgroupAddition, atomGetAttr, genericsList, getAtomCustomQuery, getFormatMimeTypeByFileName, getPropertiesByFormat, StereoFlag, getPropertiesByImgFormat, b64toBlob, Generics, TextCommand, DefaultStructServiceOptions } from 'ketcher-core';
28
28
  import * as React from 'react';
29
29
  import React__default, { createRef, Component, useRef, useEffect, useLayoutEffect, useState, useMemo, createElement, forwardRef, useCallback, Fragment as Fragment$2, PureComponent, lazy, Suspense } from 'react';
30
30
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
@@ -3595,7 +3595,7 @@ var zoom = {
3595
3595
 
3596
3596
  var openHelpLink = function openHelpLink() {
3597
3597
  var _window$open;
3598
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.23.0-rc.1\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3598
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.23.0-rc.2\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3599
3599
  };
3600
3600
  var help = {
3601
3601
  help: {
@@ -13696,6 +13696,9 @@ function hideTooltip(editor) {
13696
13696
  }
13697
13697
  function showTooltip(editor, infoPanelData) {
13698
13698
  hideTooltip(editor);
13699
+ if ((infoPanelData === null || infoPanelData === void 0 ? void 0 : infoPanelData.sGroup) instanceof MonomerMicromolecule && infoPanelData.sGroup.monomer instanceof UnresolvedMonomer) {
13700
+ return;
13701
+ }
13699
13702
  showTooltipTimer = setTimeout(function () {
13700
13703
  editor.event.showInfo.dispatch(infoPanelData);
13701
13704
  }, TOOLTIP_DELAY);
@@ -15984,13 +15987,17 @@ function deleteFunctionalGroups(sGroupsId, struct, action) {
15984
15987
  }
15985
15988
 
15986
15989
  function getGroupIdsFromItemArrays(struct, items) {
15987
- var _items$atoms, _items$bonds;
15990
+ var _items$bonds;
15988
15991
  if (!struct.sgroups.size) return [];
15989
15992
  var groupsIds = new Set();
15990
- items === null || items === void 0 || (_items$atoms = items.atoms) === null || _items$atoms === void 0 || _items$atoms.forEach(function (atomId) {
15991
- var groupId = struct.getGroupIdFromAtomId(atomId);
15992
- if (groupId !== null) groupsIds.add(groupId);
15993
- });
15993
+ if (items !== null && items !== void 0 && items.atoms) {
15994
+ items.atoms.filter(function (atomId) {
15995
+ return !Atom$2.isSuperatomLeavingGroupAtom(struct, atomId);
15996
+ }).forEach(function (atomId) {
15997
+ var groupId = struct.getGroupIdFromAtomId(atomId);
15998
+ if (groupId !== null) groupsIds.add(groupId);
15999
+ });
16000
+ }
15994
16001
  items === null || items === void 0 || (_items$bonds = items.bonds) === null || _items$bonds === void 0 || _items$bonds.forEach(function (bondId) {
15995
16002
  var groupId = struct.getGroupIdFromBondId(bondId);
15996
16003
  if (groupId !== null) groupsIds.add(groupId);
@@ -16031,7 +16038,9 @@ var AtomTool = function () {
16031
16038
  var action = new Action();
16032
16039
  var selectedSGroupsId = editorSelection && getGroupIdsFromItemArrays(struct.molecule, editorSelection);
16033
16040
  var sgroups = struct.molecule.functionalGroups;
16034
- var atomsInFunctionalGroup = editorSelection.atoms.map(function (atom) {
16041
+ var atomsInFunctionalGroup = editorSelection.atoms.filter(function (atomId) {
16042
+ return !Atom$2.isSuperatomLeavingGroupAtom(struct.molecule, atomId);
16043
+ }).map(function (atom) {
16035
16044
  return FunctionalGroup.atomsInFunctionalGroup(sgroups, atom);
16036
16045
  });
16037
16046
  if (atomsInFunctionalGroup.some(function (atom) {
@@ -33085,8 +33094,8 @@ var KetcherBuilder = function () {
33085
33094
  initApp(element, appRoot, staticResourcesUrl, {
33086
33095
  buttons: buttons || {},
33087
33096
  errorHandler: errorHandler || null,
33088
- version: "2.23.0-rc.1" ,
33089
- buildDate: "2024-07-02T08:53:16" ,
33097
+ version: "2.23.0-rc.2" ,
33098
+ buildDate: "2024-07-10T19:46:12" ,
33090
33099
  buildNumber: ''
33091
33100
  }, structService, resolve, togglerComponent);
33092
33101
  });