ketcher-react 3.11.0-rc.1 → 3.11.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.
package/dist/cjs/index.js CHANGED
@@ -8528,7 +8528,7 @@ var zoom = {
8528
8528
 
8529
8529
  var openHelpLink = function openHelpLink() {
8530
8530
  var _window$open;
8531
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.11.0-rc.1\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
8531
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.11.0-rc.2\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
8532
8532
  };
8533
8533
  var help = {
8534
8534
  help: {
@@ -25793,16 +25793,17 @@ var Editor$3 = function () {
25793
25793
  }, {
25794
25794
  key: "isMonomerCreationWizardEnabled",
25795
25795
  get: function get() {
25796
+ var _this$selection;
25796
25797
  if (this.isMonomerCreationWizardActive) {
25797
25798
  return false;
25798
25799
  }
25799
- var selection = this.selection();
25800
- if (!selection) {
25801
- return true;
25802
- }
25800
+ var selection = (_this$selection = this.selection()) !== null && _this$selection !== void 0 ? _this$selection : {
25801
+ atoms: Array.from(this.struct().atoms.keys()),
25802
+ bonds: Array.from(this.struct().bonds.keys())
25803
+ };
25803
25804
  var currentStruct = this.struct();
25804
25805
  if (!selection.atoms || selection.atoms.length === 0) {
25805
- return false;
25806
+ return true;
25806
25807
  }
25807
25808
  var selectionInvalid = selection.atoms.some(function (atomId) {
25808
25809
  var atom = currentStruct.atoms.get(atomId);
@@ -25887,11 +25888,11 @@ var Editor$3 = function () {
25887
25888
  }, {
25888
25889
  key: "openMonomerCreationWizard",
25889
25890
  value: function openMonomerCreationWizard() {
25890
- var _this$selection,
25891
+ var _this$selection2,
25891
25892
  _selection$atoms,
25892
25893
  _this = this;
25893
25894
  var currentStruct = this.render.ctab.molecule;
25894
- var selection = (_this$selection = this.selection()) !== null && _this$selection !== void 0 ? _this$selection : {
25895
+ var selection = (_this$selection2 = this.selection()) !== null && _this$selection2 !== void 0 ? _this$selection2 : {
25895
25896
  atoms: Array.from(this.struct().atoms.keys()),
25896
25897
  bonds: Array.from(this.struct().bonds.keys())
25897
25898
  };
@@ -26051,11 +26052,12 @@ var Editor$3 = function () {
26051
26052
  key: "assignConnectionPointAtom",
26052
26053
  value: function assignConnectionPointAtom(atomId, attachmentPointName, assignedAttachmentPointsByMonomer, monomerStructure) {
26053
26054
  var _this2 = this;
26055
+ var forceAddNewLeavingGroupAtom = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
26054
26056
  assert_1(this.monomerCreationState);
26055
26057
  var potentialLeavingAtoms = this.monomerCreationState.potentialAttachmentPoints.get(atomId);
26056
26058
  var leavingAtomId;
26057
26059
  var additionalAction = null;
26058
- if (potentialLeavingAtoms) {
26060
+ if (!forceAddNewLeavingGroupAtom && potentialLeavingAtoms) {
26059
26061
  var _Array$from$sort$redu = Array.from(potentialLeavingAtoms).sort(function (a, b) {
26060
26062
  return a - b;
26061
26063
  }).reduce(function (acc, currentAtomId) {
@@ -30914,6 +30916,9 @@ var rnaPresetWizardReducer = function rnaPresetWizardReducer(state, action) {
30914
30916
  })
30915
30917
  });
30916
30918
  }
30919
+ if (action.type === 'ResetWizard') {
30920
+ return initialRnaPresetWizardState;
30921
+ }
30917
30922
  if (action.type === 'RemoveNotification') {
30918
30923
  var presetNotifications = new Map(state.preset.notifications);
30919
30924
  var baseNotifications = new Map(state.base.notifications);
@@ -31222,6 +31227,9 @@ var MonomerCreationWizard = function MonomerCreationWizard() {
31222
31227
  wizardStateDispatch({
31223
31228
  type: 'ResetWizard'
31224
31229
  });
31230
+ rnaPresetWizardStateDispatch({
31231
+ type: 'ResetWizard'
31232
+ });
31225
31233
  } else {
31226
31234
  wizardStateDispatch({
31227
31235
  type: 'SetFieldValue',
@@ -31262,6 +31270,9 @@ var MonomerCreationWizard = function MonomerCreationWizard() {
31262
31270
  wizardStateDispatch({
31263
31271
  type: 'ResetWizard'
31264
31272
  });
31273
+ rnaPresetWizardStateDispatch({
31274
+ type: 'ResetWizard'
31275
+ });
31265
31276
  setAttachmentPointEditPopupData(null);
31266
31277
  };
31267
31278
  var selectRectangleAction = tools['select-rectangle'].action;
@@ -31548,10 +31559,10 @@ var MonomerCreationWizard = function MonomerCreationWizard() {
31548
31559
  var sugarR2AttachmentPointAtom = sugarStructure !== null && sugarStructure !== void 0 && (_sugarStructure$atoms6 = sugarStructure.atoms) !== null && _sugarStructure$atoms6 !== void 0 && _sugarStructure$atoms6.includes(bondBetweenSugarAndPhosphate.begin) ? bondBetweenSugarAndPhosphate.begin : bondBetweenSugarAndPhosphate.end;
31549
31560
  var baseR1AttachmentPointAtom = baseStructure !== null && baseStructure !== void 0 && (_baseStructure$atoms3 = baseStructure.atoms) !== null && _baseStructure$atoms3 !== void 0 && _baseStructure$atoms3.includes(bondBetweenSugarAndBase.begin) ? bondBetweenSugarAndBase.begin : bondBetweenSugarAndBase.end;
31550
31561
  var phosphateR1AttachmentPointAtom = phosphateStructure !== null && phosphateStructure !== void 0 && (_phosphateStructure$a3 = phosphateStructure.atoms) !== null && _phosphateStructure$a3 !== void 0 && _phosphateStructure$a3.includes(bondBetweenSugarAndPhosphate.begin) ? bondBetweenSugarAndPhosphate.begin : bondBetweenSugarAndPhosphate.end;
31551
- editor.assignConnectionPointAtom(baseR1AttachmentPointAtom, ketcherCore.AttachmentPointName.R1, assignedAttachmentPointsByMonomer.get(rnaPresetWizardState.base), rnaPresetWizardState.base.structure);
31552
- editor.assignConnectionPointAtom(sugarR2AttachmentPointAtom, ketcherCore.AttachmentPointName.R2, assignedAttachmentPointsByMonomer.get(rnaPresetWizardState.sugar), rnaPresetWizardState.sugar.structure);
31553
- editor.assignConnectionPointAtom(sugarR3AttachmentPointAtom, ketcherCore.AttachmentPointName.R3, assignedAttachmentPointsByMonomer.get(rnaPresetWizardState.sugar), rnaPresetWizardState.sugar.structure);
31554
- editor.assignConnectionPointAtom(phosphateR1AttachmentPointAtom, ketcherCore.AttachmentPointName.R1, assignedAttachmentPointsByMonomer.get(rnaPresetWizardState.phosphate), rnaPresetWizardState.phosphate.structure);
31562
+ editor.assignConnectionPointAtom(baseR1AttachmentPointAtom, ketcherCore.AttachmentPointName.R1, assignedAttachmentPointsByMonomer.get(rnaPresetWizardState.base), rnaPresetWizardState.base.structure, true);
31563
+ editor.assignConnectionPointAtom(sugarR2AttachmentPointAtom, ketcherCore.AttachmentPointName.R2, assignedAttachmentPointsByMonomer.get(rnaPresetWizardState.sugar), rnaPresetWizardState.sugar.structure, true);
31564
+ editor.assignConnectionPointAtom(sugarR3AttachmentPointAtom, ketcherCore.AttachmentPointName.R3, assignedAttachmentPointsByMonomer.get(rnaPresetWizardState.sugar), rnaPresetWizardState.sugar.structure, true);
31565
+ editor.assignConnectionPointAtom(phosphateR1AttachmentPointAtom, ketcherCore.AttachmentPointName.R1, assignedAttachmentPointsByMonomer.get(rnaPresetWizardState.phosphate), rnaPresetWizardState.phosphate.structure, true);
31555
31566
  }
31556
31567
  monomersToSave.forEach(function (monomerToSave) {
31557
31568
  var atomIdMap = new Map();
@@ -39945,8 +39956,8 @@ var KetcherBuilder = function () {
39945
39956
  cleanup = initApp(prevKetcherId, ketcherId, element, appRoot, staticResourcesUrl, {
39946
39957
  buttons: buttons || {},
39947
39958
  errorHandler: errorHandler || null,
39948
- version: "3.11.0-rc.1" ,
39949
- buildDate: "2025-11-27T18:16:05" ,
39959
+ version: "3.11.0-rc.2" ,
39960
+ buildDate: "2025-12-03T16:03:50" ,
39950
39961
  buildNumber: '',
39951
39962
  customButtons: customButtons || []
39952
39963
  }, structService, resolve, togglerComponent);
@@ -40247,7 +40258,7 @@ var ModeControl = function ModeControl(_ref3) {
40247
40258
  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; }
40248
40259
  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; }
40249
40260
  var MacromoleculesEditorComponent = React.lazy(function () {
40250
- return Promise.resolve().then(function () { return require('./index.modern-ecfd991d.js'); });
40261
+ return Promise.resolve().then(function () { return require('./index.modern-e2b89024.js'); });
40251
40262
  });
40252
40263
  var Editor = function Editor(props) {
40253
40264
  var _useState = React.useState(false),