ketcher-react 3.0.1 → 3.0.3

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.0.1\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.0.3\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: {
@@ -23032,13 +23032,32 @@ var RotateTool = function () {
23032
23032
  key: "mouseup",
23033
23033
  value:
23034
23034
  function mouseup() {
23035
+ var _dragCtx$mergeItems,
23036
+ _this3 = this;
23035
23037
  if (!this.dragCtx) {
23036
23038
  return true;
23037
23039
  }
23038
23040
  this.reStruct.clearSnappingBonds();
23039
23041
  this.editor.update(true);
23040
23042
  var dragCtx = this.dragCtx;
23041
- var action = dragCtx.action ? ketcherCore.fromItemsFuse(this.reStruct, dragCtx.mergeItems).mergeWith(dragCtx.action) : ketcherCore.fromItemsFuse(this.reStruct, dragCtx.mergeItems);
23043
+ var isMergingSGroup = false;
23044
+ var _ref = (_dragCtx$mergeItems = dragCtx.mergeItems) !== null && _dragCtx$mergeItems !== void 0 ? _dragCtx$mergeItems : {},
23045
+ atoms = _ref.atoms,
23046
+ bonds = _ref.bonds;
23047
+ atoms === null || atoms === void 0 || atoms.forEach(function (dst, src) {
23048
+ if (_this3.struct.isAtomFromMacromolecule(src) || _this3.struct.isAtomFromMacromolecule(dst)) {
23049
+ isMergingSGroup = true;
23050
+ }
23051
+ });
23052
+ bonds === null || bonds === void 0 || bonds.forEach(function (dst, src) {
23053
+ if (_this3.struct.isBondFromMacromolecule(src) || _this3.struct.isBondFromMacromolecule(dst)) {
23054
+ isMergingSGroup = true;
23055
+ }
23056
+ });
23057
+ var action = dragCtx.action;
23058
+ if (!isMergingSGroup) {
23059
+ action = action ? ketcherCore.fromItemsFuse(this.reStruct, dragCtx.mergeItems).mergeWith(action) : ketcherCore.fromItemsFuse(this.reStruct, dragCtx.mergeItems);
23060
+ }
23042
23061
  delete this.dragCtx;
23043
23062
  this.editor.update(action);
23044
23063
  if (dragCtx.mergeItems) {
@@ -23153,18 +23172,18 @@ var RotateTool = function () {
23153
23172
  }, {
23154
23173
  key: "partitionNeighborsBySelection",
23155
23174
  value: function partitionNeighborsBySelection(selection, atom) {
23156
- var _this3 = this;
23175
+ var _this4 = this;
23157
23176
  var rotatableHalfBondIds = [];
23158
23177
  var rotatableHalfBondAngles = [];
23159
23178
  var fixedHalfBondIds = [];
23160
23179
  var fixedHalfBondAngles = [];
23161
23180
  atom.neighbors.forEach(function (halfBondId) {
23162
23181
  var _selection$atoms;
23163
- var halfBond = _this3.struct.halfBonds.get(halfBondId);
23182
+ var halfBond = _this4.struct.halfBonds.get(halfBondId);
23164
23183
  assert_1(halfBond != null);
23165
23184
  var neighborAtomId = halfBond.end;
23166
23185
  if (selection !== null && selection !== void 0 && (_selection$atoms = selection.atoms) !== null && _selection$atoms !== void 0 && _selection$atoms.includes(neighborAtomId)) {
23167
- if (!ketcherCore.FunctionalGroup.isHalfBondInContractedFunctionalGroup(halfBond, _this3.struct)) {
23186
+ if (!ketcherCore.FunctionalGroup.isHalfBondInContractedFunctionalGroup(halfBond, _this4.struct)) {
23168
23187
  rotatableHalfBondIds.push(halfBondId);
23169
23188
  rotatableHalfBondAngles.push(halfBond.ang);
23170
23189
  }
@@ -23183,7 +23202,7 @@ var RotateTool = function () {
23183
23202
  }, {
23184
23203
  key: "snap",
23185
23204
  value: function snap(mouseMoveAngle) {
23186
- var _this4 = this;
23205
+ var _this5 = this;
23187
23206
  var isSnapping = false;
23188
23207
  var rotateAngle = 0;
23189
23208
  if (!this.snapInfo) {
@@ -23193,18 +23212,18 @@ var RotateTool = function () {
23193
23212
  this.snapInfo.absoluteSnapAngles.some(function (snapAngle, index) {
23194
23213
  if (Math.abs(newRotatedHalfBondAngle - snapAngle) <= MAX_SNAP_DELTA) {
23195
23214
  isSnapping = true;
23196
- assert_1(_this4.snapInfo != null);
23197
- rotateAngle = snapAngle - _this4.snapInfo.rotatableHalfBondAngle;
23198
- _this4.saveSnappingBonds(snapAngle);
23199
- _this4.snapInfo.snapAngleDrawingProps = {
23215
+ assert_1(_this5.snapInfo != null);
23216
+ rotateAngle = snapAngle - _this5.snapInfo.rotatableHalfBondAngle;
23217
+ _this5.saveSnappingBonds(snapAngle);
23218
+ _this5.snapInfo.snapAngleDrawingProps = {
23200
23219
  isSnapping: isSnapping,
23201
23220
  absoluteAngle: snapAngle,
23202
23221
  relativeAngle: SNAP_ANGLES_RELATIVE_TO_FIXED_BOND[index]
23203
23222
  };
23204
23223
  return true;
23205
23224
  } else if (Math.abs(newRotatedHalfBondAngle - snapAngle) < ANGLE_INDICATOR_VISIBLE_DELTA) {
23206
- assert_1(_this4.snapInfo != null);
23207
- _this4.snapInfo.snapAngleDrawingProps = {
23225
+ assert_1(_this5.snapInfo != null);
23226
+ _this5.snapInfo.snapAngleDrawingProps = {
23208
23227
  isSnapping: isSnapping,
23209
23228
  absoluteAngle: snapAngle,
23210
23229
  relativeAngle: SNAP_ANGLES_RELATIVE_TO_FIXED_BOND[index]
@@ -23219,15 +23238,15 @@ var RotateTool = function () {
23219
23238
  key: "saveSnappingBonds",
23220
23239
  value: function saveSnappingBonds(snapAngle) {
23221
23240
  var _this$snapInfo2,
23222
- _this5 = this;
23241
+ _this6 = this;
23223
23242
  var halfBondsToBeHighlighted = (_this$snapInfo2 = this.snapInfo) === null || _this$snapInfo2 === void 0 ? void 0 : _this$snapInfo2.snapAngleToHalfBonds.get(snapAngle);
23224
23243
  var bondIds = halfBondsToBeHighlighted === null || halfBondsToBeHighlighted === void 0 ? void 0 : halfBondsToBeHighlighted.map(function (halfBond) {
23225
- var bondId = _this5.struct.getBondIdByHalfBond(halfBond);
23244
+ var bondId = _this6.struct.getBondIdByHalfBond(halfBond);
23226
23245
  assert_1(bondId != null);
23227
23246
  return bondId;
23228
23247
  });
23229
23248
  bondIds === null || bondIds === void 0 || bondIds.forEach(function (bondId) {
23230
- _this5.reStruct.addSnappingBonds(bondId);
23249
+ _this6.reStruct.addSnappingBonds(bondId);
23231
23250
  });
23232
23251
  }
23233
23252
  }]);
@@ -35025,8 +35044,8 @@ var KetcherBuilder = function () {
35025
35044
  cleanup = initApp(element, appRoot, staticResourcesUrl, {
35026
35045
  buttons: buttons || {},
35027
35046
  errorHandler: errorHandler || null,
35028
- version: "3.0.1" ,
35029
- buildDate: "2025-02-20T16:03:19" ,
35047
+ version: "3.0.3" ,
35048
+ buildDate: "2025-02-26T15:51:37" ,
35030
35049
  buildNumber: '',
35031
35050
  customButtons: customButtons || []
35032
35051
  }, structService, resolve, togglerComponent);
@@ -35318,7 +35337,7 @@ var ModeControl = function ModeControl(_ref3) {
35318
35337
  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; }
35319
35338
  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; }
35320
35339
  var MacromoleculesEditor = React.lazy(function () {
35321
- return Promise.resolve().then(function () { return require('./index.modern-5c6e050a.js'); });
35340
+ return Promise.resolve().then(function () { return require('./index.modern-f182958a.js'); });
35322
35341
  });
35323
35342
  var Editor = function Editor(props) {
35324
35343
  var _useState = React.useState(false),