ketcher-react 3.7.0-rc.2 → 3.7.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.
@@ -132,7 +132,7 @@ declare class Editor implements KetcherEditor {
132
132
  atomToFunctionalGroup: Map<any, any>;
133
133
  };
134
134
  explicitSelected(autoSelectBonds?: boolean): any;
135
- structSelected(): Struct;
135
+ structSelected(existingSelection?: Selection): Struct;
136
136
  alignDescriptors(): void;
137
137
  setMacromoleculeConvertionError(errorMessage: string): void;
138
138
  clearMacromoleculeConvertionError(): void;
@@ -3,7 +3,6 @@ import Editor from '../Editor';
3
3
  declare class CreateMonomerTool implements Tool {
4
4
  private editor;
5
5
  constructor(editor: Editor);
6
- cancel(): void;
7
6
  mousemove(): void;
8
7
  }
9
8
  export default CreateMonomerTool;
package/dist/index.js CHANGED
@@ -3787,7 +3787,7 @@ var zoom = {
3787
3787
 
3788
3788
  var openHelpLink = function openHelpLink() {
3789
3789
  var _window$open;
3790
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.7.0-rc.2\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3790
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.7.0\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3791
3791
  };
3792
3792
  var help = {
3793
3793
  help: {
@@ -24080,11 +24080,6 @@ var CreateMonomerTool = function () {
24080
24080
  this.editor.openMonomerCreationWizard();
24081
24081
  }
24082
24082
  _createClass$2(CreateMonomerTool, [{
24083
- key: "cancel",
24084
- value: function cancel() {
24085
- this.editor.closeMonomerCreationWizard();
24086
- }
24087
- }, {
24088
24083
  key: "mousemove",
24089
24084
  value: function mousemove() {
24090
24085
  }
@@ -24258,8 +24253,9 @@ var HoverIcon = function () {
24258
24253
  }, {
24259
24254
  key: "isOverLoader",
24260
24255
  value: function isOverLoader(event) {
24256
+ var _target$classList;
24261
24257
  var target = (event === null || event === void 0 ? void 0 : event.relatedTarget) || event.target;
24262
- return target === null || target === void 0 ? void 0 : target.classList.contains('loading-spinner');
24258
+ return target === null || target === void 0 || (_target$classList = target.classList) === null || _target$classList === void 0 ? void 0 : _target$classList.contains('loading-spinner');
24263
24259
  }
24264
24260
  }, {
24265
24261
  key: "onMouseMove",
@@ -25323,7 +25319,7 @@ var Editor$3 = function () {
25323
25319
  if (this._monomerCreationState) {
25324
25320
  return true;
25325
25321
  }
25326
- var selection = this.explicitSelected(false);
25322
+ var selection = this.selection();
25327
25323
  if (selection && (_selection$atoms = selection.atoms) !== null && _selection$atoms !== void 0 && _selection$atoms.length && (_selection$bonds = selection.bonds) !== null && _selection$bonds !== void 0 && _selection$bonds.length) {
25328
25324
  var currentStruct = this.render.ctab.molecule;
25329
25325
  var selectionInvalid = selection.atoms.some(function (atomId) {
@@ -25331,9 +25327,9 @@ var Editor$3 = function () {
25331
25327
  if (!atom) {
25332
25328
  return false;
25333
25329
  }
25334
- return atom.sgs.size > 0 || genericsList.includes(atom.label) || _this.render.ctab.molecule.rgroups.some(function (rgroup) {
25330
+ return atom.sgs.size > 0 || atom.rglabel !== null || atom.attachmentPoints !== null || _this.render.ctab.molecule.rgroups.some(function (rgroup) {
25335
25331
  return rgroup.frags.has(atom.fragment);
25336
- });
25332
+ }) || genericsList.includes(atom.label);
25337
25333
  });
25338
25334
  if (selectionInvalid) {
25339
25335
  return false;
@@ -25347,7 +25343,7 @@ var Editor$3 = function () {
25347
25343
  return selectionAtoms.has(bond.begin) && !selectionAtoms.has(bond.end) || selectionAtoms.has(bond.end) && !selectionAtoms.has(bond.begin);
25348
25344
  });
25349
25345
  if (bondsToOutside.some(function (bond) {
25350
- return bond.type !== Bond$2.PATTERN.TYPE.SINGLE;
25346
+ return bond.type !== Bond$2.PATTERN.TYPE.SINGLE || bond.stereo !== Bond$2.PATTERN.STEREO.NONE;
25351
25347
  })) {
25352
25348
  return false;
25353
25349
  }
@@ -25362,10 +25358,11 @@ var Editor$3 = function () {
25362
25358
  var _selection$atoms2,
25363
25359
  _this2 = this;
25364
25360
  var currentStruct = this.render.ctab.molecule;
25365
- var selection = this.explicitSelected();
25361
+ var selection = this.selection();
25362
+ assert_1(selection);
25366
25363
  this.originalSelection = selection;
25367
25364
  var selectionAtoms = new Set(selection.atoms);
25368
- var selectedStruct = this.structSelected();
25365
+ var selectedStruct = this.structSelected(selection);
25369
25366
  this.selectionBBox = selectedStruct.getCoordBoundingBoxObj();
25370
25367
  var atomIdsMap = new Map();
25371
25368
  _toConsumableArray((_selection$atoms2 = selection.atoms) !== null && _selection$atoms2 !== void 0 ? _selection$atoms2 : []).sort(function (a, b) {
@@ -25750,9 +25747,9 @@ var Editor$3 = function () {
25750
25747
  }
25751
25748
  }, {
25752
25749
  key: "structSelected",
25753
- value: function structSelected() {
25750
+ value: function structSelected(existingSelection) {
25754
25751
  var struct = this.render.ctab.molecule;
25755
- var selection = this.explicitSelected();
25752
+ var selection = existingSelection !== null && existingSelection !== void 0 ? existingSelection : this.explicitSelected();
25756
25753
  var dst = struct.clone(new Pile(selection.atoms), new Pile(selection.bonds), true, null, new Pile(selection.simpleObjects), new Pile(selection.texts), null, new Pile(selection.images), new Pile(selection[MULTITAIL_ARROW_KEY]));
25757
25754
  struct.rxnArrows.forEach(function (item, id) {
25758
25755
  if (selection.rxnArrows.indexOf(id) !== -1) dst.rxnArrows.add(item.clone());
@@ -36851,8 +36848,8 @@ var KetcherBuilder = function () {
36851
36848
  cleanup = initApp(prevKetcherId, ketcherId, element, appRoot, staticResourcesUrl, {
36852
36849
  buttons: buttons || {},
36853
36850
  errorHandler: errorHandler || null,
36854
- version: "3.7.0-rc.2" ,
36855
- buildDate: "2025-08-20T17:19:11" ,
36851
+ version: "3.7.0" ,
36852
+ buildDate: "2025-09-19T11:29:51" ,
36856
36853
  buildNumber: '',
36857
36854
  customButtons: customButtons || []
36858
36855
  }, structService, resolve, togglerComponent);
@@ -37147,7 +37144,7 @@ var ModeControl = function ModeControl(_ref3) {
37147
37144
  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; }
37148
37145
  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$1(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; }
37149
37146
  var MacromoleculesEditorComponent = lazy(function () {
37150
- return import('./index.modern-43985e95.js');
37147
+ return import('./index.modern-9eda1441.js');
37151
37148
  });
37152
37149
  var Editor = function Editor(props) {
37153
37150
  var _useState = useState(false),