ketcher-macromolecules 2.22.0-rc.6 → 2.23.0-rc.1-dev.1

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 CHANGED
@@ -6525,6 +6525,10 @@ var generateLabeledNodes = function generateLabeledNodes(selectionsFlatten) {
6525
6525
  }
6526
6526
  return labeledNodes;
6527
6527
  };
6528
+ function isNucleotideNucleosideOrPhosphate(selection) {
6529
+ var node = selection.node;
6530
+ return node instanceof ketcherCore.Nucleotide || node instanceof ketcherCore.Nucleoside || (node === null || node === void 0 ? void 0 : node.monomer) instanceof ketcherCore.Phosphate;
6531
+ }
6528
6532
  var generateNucleoelementTitle = function generateNucleoelementTitle(elements) {
6529
6533
  var tempTitle = '';
6530
6534
  var element = elements.length === 1 ? elements[0] : lodash.merge.apply(void 0, [{}].concat(_toConsumableArray__default["default"](elements)));
@@ -6564,6 +6568,11 @@ var generateSequenceContextMenuProps = function generateSequenceContextMenuProps
6564
6568
  isSelectedOnlyNucleoelements = false;
6565
6569
  }
6566
6570
  }
6571
+ if (countOfSelections > countOfNucleoelements) {
6572
+ if (!selectionsFlatten.every(isNucleotideNucleosideOrPhosphate)) {
6573
+ isSelectedOnlyNucleoelements = false;
6574
+ }
6575
+ }
6567
6576
  if (countOfSelections === 1 || countOfNucleoelements === 1 && isSelectedOnlyNucleoelements) {
6568
6577
  title = generateNucleoelementTitle(selectedSequenceLabeledNodes);
6569
6578
  } else {