ketcher-react 3.1.0-rc.1 → 3.1.0-rc.10

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.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.1.0-rc.10\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: {
@@ -19913,13 +19913,6 @@ function initClipboard(dispatch) {
19913
19913
  }, _callee2);
19914
19914
  }))();
19915
19915
  },
19916
- onLegacyCopy: function onLegacyCopy() {
19917
- var state = global.currentState;
19918
- var editor = state.editor;
19919
- var data = legacyClipData(editor);
19920
- editor.selection(null);
19921
- return data;
19922
- },
19923
19916
  onCopy: function onCopy() {
19924
19917
  return _asyncToGenerator__default["default"]( _regeneratorRuntime__default["default"].mark(function _callee4() {
19925
19918
  var ketcherInstance, result;
@@ -20064,7 +20057,7 @@ function _clipData() {
20064
20057
  data = _context7.sent;
20065
20058
  res[ketcherCore.ChemicalMimeType.KET] = ket;
20066
20059
  type = struct.isReaction ? ketcherCore.ChemicalMimeType.Mol : ketcherCore.ChemicalMimeType.Rxn;
20067
- res['text/plain'] = ket;
20060
+ res['text/plain'] = data;
20068
20061
  res[type] = data;
20069
20062
  return _context7.abrupt("return", res);
20070
20063
  case 19:
@@ -23043,13 +23036,32 @@ var RotateTool = function () {
23043
23036
  key: "mouseup",
23044
23037
  value:
23045
23038
  function mouseup() {
23039
+ var _dragCtx$mergeItems,
23040
+ _this3 = this;
23046
23041
  if (!this.dragCtx) {
23047
23042
  return true;
23048
23043
  }
23049
23044
  this.reStruct.clearSnappingBonds();
23050
23045
  this.editor.update(true);
23051
23046
  var dragCtx = this.dragCtx;
23052
- 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
+ }
23053
23065
  delete this.dragCtx;
23054
23066
  this.editor.update(action);
23055
23067
  if (dragCtx.mergeItems) {
@@ -23164,18 +23176,18 @@ var RotateTool = function () {
23164
23176
  }, {
23165
23177
  key: "partitionNeighborsBySelection",
23166
23178
  value: function partitionNeighborsBySelection(selection, atom) {
23167
- var _this3 = this;
23179
+ var _this4 = this;
23168
23180
  var rotatableHalfBondIds = [];
23169
23181
  var rotatableHalfBondAngles = [];
23170
23182
  var fixedHalfBondIds = [];
23171
23183
  var fixedHalfBondAngles = [];
23172
23184
  atom.neighbors.forEach(function (halfBondId) {
23173
23185
  var _selection$atoms;
23174
- var halfBond = _this3.struct.halfBonds.get(halfBondId);
23186
+ var halfBond = _this4.struct.halfBonds.get(halfBondId);
23175
23187
  assert_1(halfBond != null);
23176
23188
  var neighborAtomId = halfBond.end;
23177
23189
  if (selection !== null && selection !== void 0 && (_selection$atoms = selection.atoms) !== null && _selection$atoms !== void 0 && _selection$atoms.includes(neighborAtomId)) {
23178
- if (!ketcherCore.FunctionalGroup.isHalfBondInContractedFunctionalGroup(halfBond, _this3.struct)) {
23190
+ if (!ketcherCore.FunctionalGroup.isHalfBondInContractedFunctionalGroup(halfBond, _this4.struct)) {
23179
23191
  rotatableHalfBondIds.push(halfBondId);
23180
23192
  rotatableHalfBondAngles.push(halfBond.ang);
23181
23193
  }
@@ -23194,7 +23206,7 @@ var RotateTool = function () {
23194
23206
  }, {
23195
23207
  key: "snap",
23196
23208
  value: function snap(mouseMoveAngle) {
23197
- var _this4 = this;
23209
+ var _this5 = this;
23198
23210
  var isSnapping = false;
23199
23211
  var rotateAngle = 0;
23200
23212
  if (!this.snapInfo) {
@@ -23204,18 +23216,18 @@ var RotateTool = function () {
23204
23216
  this.snapInfo.absoluteSnapAngles.some(function (snapAngle, index) {
23205
23217
  if (Math.abs(newRotatedHalfBondAngle - snapAngle) <= MAX_SNAP_DELTA) {
23206
23218
  isSnapping = true;
23207
- assert_1(_this4.snapInfo != null);
23208
- rotateAngle = snapAngle - _this4.snapInfo.rotatableHalfBondAngle;
23209
- _this4.saveSnappingBonds(snapAngle);
23210
- _this4.snapInfo.snapAngleDrawingProps = {
23219
+ assert_1(_this5.snapInfo != null);
23220
+ rotateAngle = snapAngle - _this5.snapInfo.rotatableHalfBondAngle;
23221
+ _this5.saveSnappingBonds(snapAngle);
23222
+ _this5.snapInfo.snapAngleDrawingProps = {
23211
23223
  isSnapping: isSnapping,
23212
23224
  absoluteAngle: snapAngle,
23213
23225
  relativeAngle: SNAP_ANGLES_RELATIVE_TO_FIXED_BOND[index]
23214
23226
  };
23215
23227
  return true;
23216
23228
  } else if (Math.abs(newRotatedHalfBondAngle - snapAngle) < ANGLE_INDICATOR_VISIBLE_DELTA) {
23217
- assert_1(_this4.snapInfo != null);
23218
- _this4.snapInfo.snapAngleDrawingProps = {
23229
+ assert_1(_this5.snapInfo != null);
23230
+ _this5.snapInfo.snapAngleDrawingProps = {
23219
23231
  isSnapping: isSnapping,
23220
23232
  absoluteAngle: snapAngle,
23221
23233
  relativeAngle: SNAP_ANGLES_RELATIVE_TO_FIXED_BOND[index]
@@ -23230,15 +23242,15 @@ var RotateTool = function () {
23230
23242
  key: "saveSnappingBonds",
23231
23243
  value: function saveSnappingBonds(snapAngle) {
23232
23244
  var _this$snapInfo2,
23233
- _this5 = this;
23245
+ _this6 = this;
23234
23246
  var halfBondsToBeHighlighted = (_this$snapInfo2 = this.snapInfo) === null || _this$snapInfo2 === void 0 ? void 0 : _this$snapInfo2.snapAngleToHalfBonds.get(snapAngle);
23235
23247
  var bondIds = halfBondsToBeHighlighted === null || halfBondsToBeHighlighted === void 0 ? void 0 : halfBondsToBeHighlighted.map(function (halfBond) {
23236
- var bondId = _this5.struct.getBondIdByHalfBond(halfBond);
23248
+ var bondId = _this6.struct.getBondIdByHalfBond(halfBond);
23237
23249
  assert_1(bondId != null);
23238
23250
  return bondId;
23239
23251
  });
23240
23252
  bondIds === null || bondIds === void 0 || bondIds.forEach(function (bondId) {
23241
- _this5.reStruct.addSnappingBonds(bondId);
23253
+ _this6.reStruct.addSnappingBonds(bondId);
23242
23254
  });
23243
23255
  }
23244
23256
  }]);
@@ -35072,8 +35084,8 @@ var KetcherBuilder = function () {
35072
35084
  cleanup = initApp(element, appRoot, staticResourcesUrl, {
35073
35085
  buttons: buttons || {},
35074
35086
  errorHandler: errorHandler || null,
35075
- version: "3.1.0-rc.1" ,
35076
- buildDate: "2025-02-04T21:35:49" ,
35087
+ version: "3.1.0-rc.10" ,
35088
+ buildDate: "2025-03-11T20:16:43" ,
35077
35089
  buildNumber: '',
35078
35090
  customButtons: customButtons || []
35079
35091
  }, structService, resolve, togglerComponent);
@@ -35365,7 +35377,7 @@ var ModeControl = function ModeControl(_ref3) {
35365
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; }
35366
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; }
35367
35379
  var MacromoleculesEditor = React.lazy(function () {
35368
- return Promise.resolve().then(function () { return require('./index.modern-d9d67a18.js'); });
35380
+ return Promise.resolve().then(function () { return require('./index.modern-9fe3bab9.js'); });
35369
35381
  });
35370
35382
  var Editor = function Editor(props) {
35371
35383
  var _useState = React.useState(false),