ketcher-react 2.6.1 → 2.6.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.
@@ -40,7 +40,7 @@ import ReactDOM from 'react-dom';
40
40
  import { connect, useDispatch, useSelector, Provider } from 'react-redux';
41
41
  import { combineReducers, createStore as createStore$1, applyMiddleware } from 'redux';
42
42
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
43
- import { logger } from 'redux-logger';
43
+ import 'redux-logger';
44
44
  import thunk from 'redux-thunk';
45
45
  import { throttle as throttle$1, inRange, isEqual as isEqual$1, range as range$1 } from 'lodash';
46
46
  import useResizeObserver from 'use-resize-observer/polyfilled';
@@ -356,7 +356,6 @@ function _copy(cb, data) {
356
356
  cb.setData(fmt, data[fmt]);
357
357
  });
358
358
  } catch (ex) {
359
- console.info("Could not write exact type ".concat(curFmt));
360
359
  }
361
360
  }
362
361
  }
@@ -682,7 +681,6 @@ var storage = {
682
681
  try {
683
682
  item = JSON.parse(localStorage.getItem(key));
684
683
  } catch (ex) {
685
- console.info('LocalStorage:', ex.name);
686
684
  }
687
685
  return item;
688
686
  },
@@ -692,7 +690,6 @@ var storage = {
692
690
  localStorage.setItem(key, JSON.stringify(data));
693
691
  isSet = true;
694
692
  } catch (ex) {
695
- console.info('LocalStorage:', ex.name);
696
693
  isSet = false;
697
694
  }
698
695
  return isSet;
@@ -826,7 +823,6 @@ function constant(schema, prop) {
826
823
  return desc.constant || desc["enum"][0];
827
824
  }
828
825
  function mapOf(schema, prop) {
829
- console.assert(schema.oneOf);
830
826
  return schema.oneOf.reduce(function (res, desc) {
831
827
  res[constant(desc, prop)] = desc;
832
828
  return res;
@@ -2447,7 +2443,7 @@ function load(struct, options) {
2447
2443
  _context.next = 16;
2448
2444
  return editor.event.confirm.dispatch();
2449
2445
  case 16:
2450
- parsedStruct.sgroups = parsedStruct.sgroups.filter(function (key, sGroup) {
2446
+ parsedStruct.sgroups = parsedStruct.sgroups.filter(function (_key, sGroup) {
2451
2447
  return supportedSGroupTypes[sGroup.type];
2452
2448
  });
2453
2449
  case 17:
@@ -2466,7 +2462,8 @@ function load(struct, options) {
2466
2462
  parsedStruct.setImplicitHydrogen();
2467
2463
  stereAtomsMap = getStereoAtomsMap(parsedStruct, Array.from(parsedStruct.bonds.values()));
2468
2464
  parsedStruct.atoms.forEach(function (atom, id) {
2469
- if (parsedStruct.atomGetNeighbors(id).length === 0) {
2465
+ var _parsedStruct$atomGet;
2466
+ if ((parsedStruct === null || parsedStruct === void 0 ? void 0 : (_parsedStruct$atomGet = parsedStruct.atomGetNeighbors(id)) === null || _parsedStruct$atomGet === void 0 ? void 0 : _parsedStruct$atomGet.length) === 0) {
2470
2467
  atom.stereoLabel = null;
2471
2468
  atom.stereoParity = 0;
2472
2469
  } else {
@@ -2854,7 +2851,7 @@ var zoom = {
2854
2851
 
2855
2852
  var openHelpLink = function openHelpLink() {
2856
2853
  var _window$open;
2857
- return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.6.0\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
2854
+ return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.6.2\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
2858
2855
  };
2859
2856
  var help = {
2860
2857
  help: {
@@ -7624,9 +7621,7 @@ function execute(activeTool, _ref) {
7624
7621
  }
7625
7622
  } else if (typeof action === 'function') {
7626
7623
  action(editor, server, options);
7627
- } else {
7628
- console.info('no action');
7629
- }
7624
+ } else ;
7630
7625
  return activeTool;
7631
7626
  }
7632
7627
  function selected(actObj, activeTool, _ref2) {
@@ -7924,7 +7919,6 @@ function createStore (options, server, setEditor) {
7924
7919
  templates: initTmplsState
7925
7920
  };
7926
7921
  var middleware = [thunk];
7927
- middleware.push(logger);
7928
7922
  var rootReducer = getRootReducer(setEditor);
7929
7923
  return createStore$1(rootReducer, initState, applyMiddleware.apply(void 0, middleware));
7930
7924
  }
@@ -9511,7 +9505,6 @@ var TopToolbar = function TopToolbar(_ref) {
9511
9505
  isCollapsed: width < collapseLimit
9512
9506
  }), jsx(SystemControls, {
9513
9507
  onHistoryClick: function onHistoryClick() {
9514
- console.log('History button clicked');
9515
9508
  },
9516
9509
  onSettingsOpen: onSettingsOpen,
9517
9510
  onFullscreen: onFullscreen,
@@ -12232,7 +12225,6 @@ function sgroupDialog(editor, id, defaultType) {
12232
12225
  var type = sg ? sg.type : defaultType;
12233
12226
  var eventName = type === 'DAT' ? 'sdataEdit' : 'sgroupEdit';
12234
12227
  if (!selection.atoms && !selection.bonds && !sg) {
12235
- console.info('There is no selection or sgroup');
12236
12228
  return;
12237
12229
  }
12238
12230
  var attrs;
@@ -13063,7 +13055,6 @@ var EraserTool = function () {
13063
13055
  } else if (ci.map === 'texts') {
13064
13056
  this.editor.update(fromTextDeletion(restruct, ci.id));
13065
13057
  } else {
13066
- console.error('EraserTool: unable to delete the object ' + ci.map + '[' + ci.id + ']');
13067
13058
  return;
13068
13059
  }
13069
13060
  this.editor.selection(null);
@@ -14802,8 +14793,8 @@ var Editor$3 = function () {
14802
14793
  value: function renderAndRecoordinateStruct(struct) {
14803
14794
  var action = fromNewCanvas(this.render.ctab, struct);
14804
14795
  this.update(action);
14805
- var structCenter = getStructCenter(this.render.ctab);
14806
- recoordinate(this, structCenter);
14796
+ getStructCenter(this.render.ctab);
14797
+ recoordinate(this);
14807
14798
  return this.render.ctab.molecule;
14808
14799
  }
14809
14800
  }, {
@@ -14852,8 +14843,8 @@ var Editor$3 = function () {
14852
14843
  }
14853
14844
  this.render.setZoom(value);
14854
14845
  var selection = this.selection();
14855
- var structCenter = getStructCenter(this.render.ctab, selection);
14856
- recoordinate(this, structCenter);
14846
+ getStructCenter(this.render.ctab, selection);
14847
+ recoordinate(this);
14857
14848
  this.render.update();
14858
14849
  return this.render.options.zoom;
14859
14850
  }
@@ -15091,7 +15082,6 @@ function domEventSetup(editor, clientArea) {
15091
15082
  }
15092
15083
  function recoordinate(editor, rp
15093
15084
  ) {
15094
- console.assert(rp, 'Reference point not specified');
15095
15085
  editor.render.setScrollOffset(0, 0);
15096
15086
  }
15097
15087
  function getStructCenter(ReStruct, selection) {
@@ -16109,7 +16099,6 @@ function greekify(str) {
16109
16099
  });
16110
16100
  }
16111
16101
  function filterLib(lib, filter$1) {
16112
- console.warn('Filter', filter$1);
16113
16102
  var re = new RegExp(escapeRegExp(greekify(filter$1)), 'i');
16114
16103
  return flow(filter(function (item) {
16115
16104
  return !filter$1 || re.test(greekify(item.struct.name)) || re.test(greekify(item.props.group));
@@ -16119,7 +16108,6 @@ function filterLib(lib, filter$1) {
16119
16108
  }, {}))(lib);
16120
16109
  }
16121
16110
  function filterFGLib(lib, filter$1) {
16122
- console.warn('Filter', filter$1);
16123
16111
  var re = new RegExp(escapeRegExp(greekify(filter$1)), 'i');
16124
16112
  return flow(filter(function (item) {
16125
16113
  return !filter$1 || re.test(greekify(item.struct.name));
@@ -17168,7 +17156,6 @@ var mapDispatchToProps$b = function mapDispatchToProps(dispatch, ownProps) {
17168
17156
  result: JSON.parse(newOpts)
17169
17157
  }));
17170
17158
  } catch (ex) {
17171
- console.info('Bad file');
17172
17159
  }
17173
17160
  },
17174
17161
  onReset: function onReset() {
@@ -17583,7 +17570,6 @@ function renderStruct(el, struct) {
17583
17570
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
17584
17571
  if (el) {
17585
17572
  if (struct) {
17586
- console.info('render!', el.clientWidth, el.clientWidth);
17587
17573
  struct.initHalfBonds();
17588
17574
  struct.initNeighbors();
17589
17575
  struct.setImplicitHydrogen();
@@ -17947,7 +17933,7 @@ var MiewDialog = function MiewDialog(_ref) {
17947
17933
  }).then(function () {
17948
17934
  return miew.setOptions(miewOpts);
17949
17935
  })["catch"](function (ex) {
17950
- return console.error(ex.message);
17936
+ return (void 0);
17951
17937
  });
17952
17938
  }, [miewOpts, server, struct]);
17953
17939
  var exportCML = useCallback(function () {
@@ -21767,8 +21753,8 @@ var KetcherBuilder = function () {
21767
21753
  initApp(element, staticResourcesUrl, {
21768
21754
  buttons: buttons || {},
21769
21755
  errorHandler: errorHandler || null,
21770
- version: "2.6.1" ,
21771
- buildDate: "2022-11-12T14:27:59" ,
21756
+ version: "2.6.3" ,
21757
+ buildDate: "2022-11-29T12:22:11" ,
21772
21758
  buildNumber: ''
21773
21759
  }, structService, resolve);
21774
21760
  });