ketcher-react 3.1.0-rc.5 → 3.1.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/cjs/index.js CHANGED
@@ -3808,7 +3808,7 @@ var zoom = {
3808
3808
 
3809
3809
  var openHelpLink = function openHelpLink() {
3810
3810
  var _window$open;
3811
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.1.0-rc.5\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3811
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v3.1.0-rc.7\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
3812
3812
  };
3813
3813
  var help = {
3814
3814
  help: {
@@ -23036,13 +23036,32 @@ var RotateTool = function () {
23036
23036
  key: "mouseup",
23037
23037
  value:
23038
23038
  function mouseup() {
23039
+ var _dragCtx$mergeItems,
23040
+ _this3 = this;
23039
23041
  if (!this.dragCtx) {
23040
23042
  return true;
23041
23043
  }
23042
23044
  this.reStruct.clearSnappingBonds();
23043
23045
  this.editor.update(true);
23044
23046
  var dragCtx = this.dragCtx;
23045
- var action = dragCtx.action ? ketcherCore.fromItemsFuse(this.reStruct, dragCtx.mergeItems).mergeWith(dragCtx.action) : ketcherCore.fromItemsFuse(this.reStruct, dragCtx.mergeItems);
23047
+ var isMergingSGroup = false;
23048
+ var _ref = (_dragCtx$mergeItems = dragCtx.mergeItems) !== null && _dragCtx$mergeItems !== void 0 ? _dragCtx$mergeItems : {},
23049
+ atoms = _ref.atoms,
23050
+ bonds = _ref.bonds;
23051
+ atoms === null || atoms === void 0 || atoms.forEach(function (dst, src) {
23052
+ if (_this3.struct.isAtomFromMacromolecule(src) || _this3.struct.isAtomFromMacromolecule(dst)) {
23053
+ isMergingSGroup = true;
23054
+ }
23055
+ });
23056
+ bonds === null || bonds === void 0 || bonds.forEach(function (dst, src) {
23057
+ if (_this3.struct.isBondFromMacromolecule(src) || _this3.struct.isBondFromMacromolecule(dst)) {
23058
+ isMergingSGroup = true;
23059
+ }
23060
+ });
23061
+ var action = dragCtx.action;
23062
+ if (!isMergingSGroup) {
23063
+ action = action ? ketcherCore.fromItemsFuse(this.reStruct, dragCtx.mergeItems).mergeWith(action) : ketcherCore.fromItemsFuse(this.reStruct, dragCtx.mergeItems);
23064
+ }
23046
23065
  delete this.dragCtx;
23047
23066
  this.editor.update(action);
23048
23067
  if (dragCtx.mergeItems) {
@@ -23157,18 +23176,18 @@ var RotateTool = function () {
23157
23176
  }, {
23158
23177
  key: "partitionNeighborsBySelection",
23159
23178
  value: function partitionNeighborsBySelection(selection, atom) {
23160
- var _this3 = this;
23179
+ var _this4 = this;
23161
23180
  var rotatableHalfBondIds = [];
23162
23181
  var rotatableHalfBondAngles = [];
23163
23182
  var fixedHalfBondIds = [];
23164
23183
  var fixedHalfBondAngles = [];
23165
23184
  atom.neighbors.forEach(function (halfBondId) {
23166
23185
  var _selection$atoms;
23167
- var halfBond = _this3.struct.halfBonds.get(halfBondId);
23186
+ var halfBond = _this4.struct.halfBonds.get(halfBondId);
23168
23187
  assert_1(halfBond != null);
23169
23188
  var neighborAtomId = halfBond.end;
23170
23189
  if (selection !== null && selection !== void 0 && (_selection$atoms = selection.atoms) !== null && _selection$atoms !== void 0 && _selection$atoms.includes(neighborAtomId)) {
23171
- if (!ketcherCore.FunctionalGroup.isHalfBondInContractedFunctionalGroup(halfBond, _this3.struct)) {
23190
+ if (!ketcherCore.FunctionalGroup.isHalfBondInContractedFunctionalGroup(halfBond, _this4.struct)) {
23172
23191
  rotatableHalfBondIds.push(halfBondId);
23173
23192
  rotatableHalfBondAngles.push(halfBond.ang);
23174
23193
  }
@@ -23187,7 +23206,7 @@ var RotateTool = function () {
23187
23206
  }, {
23188
23207
  key: "snap",
23189
23208
  value: function snap(mouseMoveAngle) {
23190
- var _this4 = this;
23209
+ var _this5 = this;
23191
23210
  var isSnapping = false;
23192
23211
  var rotateAngle = 0;
23193
23212
  if (!this.snapInfo) {
@@ -23197,18 +23216,18 @@ var RotateTool = function () {
23197
23216
  this.snapInfo.absoluteSnapAngles.some(function (snapAngle, index) {
23198
23217
  if (Math.abs(newRotatedHalfBondAngle - snapAngle) <= MAX_SNAP_DELTA) {
23199
23218
  isSnapping = true;
23200
- assert_1(_this4.snapInfo != null);
23201
- rotateAngle = snapAngle - _this4.snapInfo.rotatableHalfBondAngle;
23202
- _this4.saveSnappingBonds(snapAngle);
23203
- _this4.snapInfo.snapAngleDrawingProps = {
23219
+ assert_1(_this5.snapInfo != null);
23220
+ rotateAngle = snapAngle - _this5.snapInfo.rotatableHalfBondAngle;
23221
+ _this5.saveSnappingBonds(snapAngle);
23222
+ _this5.snapInfo.snapAngleDrawingProps = {
23204
23223
  isSnapping: isSnapping,
23205
23224
  absoluteAngle: snapAngle,
23206
23225
  relativeAngle: SNAP_ANGLES_RELATIVE_TO_FIXED_BOND[index]
23207
23226
  };
23208
23227
  return true;
23209
23228
  } else if (Math.abs(newRotatedHalfBondAngle - snapAngle) < ANGLE_INDICATOR_VISIBLE_DELTA) {
23210
- assert_1(_this4.snapInfo != null);
23211
- _this4.snapInfo.snapAngleDrawingProps = {
23229
+ assert_1(_this5.snapInfo != null);
23230
+ _this5.snapInfo.snapAngleDrawingProps = {
23212
23231
  isSnapping: isSnapping,
23213
23232
  absoluteAngle: snapAngle,
23214
23233
  relativeAngle: SNAP_ANGLES_RELATIVE_TO_FIXED_BOND[index]
@@ -23223,15 +23242,15 @@ var RotateTool = function () {
23223
23242
  key: "saveSnappingBonds",
23224
23243
  value: function saveSnappingBonds(snapAngle) {
23225
23244
  var _this$snapInfo2,
23226
- _this5 = this;
23245
+ _this6 = this;
23227
23246
  var halfBondsToBeHighlighted = (_this$snapInfo2 = this.snapInfo) === null || _this$snapInfo2 === void 0 ? void 0 : _this$snapInfo2.snapAngleToHalfBonds.get(snapAngle);
23228
23247
  var bondIds = halfBondsToBeHighlighted === null || halfBondsToBeHighlighted === void 0 ? void 0 : halfBondsToBeHighlighted.map(function (halfBond) {
23229
- var bondId = _this5.struct.getBondIdByHalfBond(halfBond);
23248
+ var bondId = _this6.struct.getBondIdByHalfBond(halfBond);
23230
23249
  assert_1(bondId != null);
23231
23250
  return bondId;
23232
23251
  });
23233
23252
  bondIds === null || bondIds === void 0 || bondIds.forEach(function (bondId) {
23234
- _this5.reStruct.addSnappingBonds(bondId);
23253
+ _this6.reStruct.addSnappingBonds(bondId);
23235
23254
  });
23236
23255
  }
23237
23256
  }]);
@@ -35065,8 +35084,8 @@ var KetcherBuilder = function () {
35065
35084
  cleanup = initApp(element, appRoot, staticResourcesUrl, {
35066
35085
  buttons: buttons || {},
35067
35086
  errorHandler: errorHandler || null,
35068
- version: "3.1.0-rc.5" ,
35069
- buildDate: "2025-02-20T17:53:33" ,
35087
+ version: "3.1.0-rc.7" ,
35088
+ buildDate: "2025-03-07T14:57:08" ,
35070
35089
  buildNumber: '',
35071
35090
  customButtons: customButtons || []
35072
35091
  }, structService, resolve, togglerComponent);
@@ -35358,7 +35377,7 @@ var ModeControl = function ModeControl(_ref3) {
35358
35377
  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; }
35359
35378
  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; }
35360
35379
  var MacromoleculesEditor = React.lazy(function () {
35361
- return Promise.resolve().then(function () { return require('./index.modern-8730b9f1.js'); });
35380
+ return Promise.resolve().then(function () { return require('./index.modern-3044c696.js'); });
35362
35381
  });
35363
35382
  var Editor = function Editor(props) {
35364
35383
  var _useState = React.useState(false),