ketcher-react 2.6.0-rc.3 → 2.6.0
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.css +7938 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +25 -10
- package/dist/index.modern.js.map +1 -1
- package/dist/script/ui/views/Editor.d.ts +1 -1
- package/dist/script/ui/views/modal/components/document/Save/Save.d.ts +1 -1
- package/dist/script/ui/views/modal/components/process/Recognize/Recognize.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -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 'redux-logger';
|
|
43
|
+
import { logger } from '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,6 +356,7 @@ 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));
|
|
359
360
|
}
|
|
360
361
|
}
|
|
361
362
|
}
|
|
@@ -681,6 +682,7 @@ var storage = {
|
|
|
681
682
|
try {
|
|
682
683
|
item = JSON.parse(localStorage.getItem(key));
|
|
683
684
|
} catch (ex) {
|
|
685
|
+
console.info('LocalStorage:', ex.name);
|
|
684
686
|
}
|
|
685
687
|
return item;
|
|
686
688
|
},
|
|
@@ -690,6 +692,7 @@ var storage = {
|
|
|
690
692
|
localStorage.setItem(key, JSON.stringify(data));
|
|
691
693
|
isSet = true;
|
|
692
694
|
} catch (ex) {
|
|
695
|
+
console.info('LocalStorage:', ex.name);
|
|
693
696
|
isSet = false;
|
|
694
697
|
}
|
|
695
698
|
return isSet;
|
|
@@ -823,6 +826,7 @@ function constant(schema, prop) {
|
|
|
823
826
|
return desc.constant || desc["enum"][0];
|
|
824
827
|
}
|
|
825
828
|
function mapOf(schema, prop) {
|
|
829
|
+
console.assert(schema.oneOf);
|
|
826
830
|
return schema.oneOf.reduce(function (res, desc) {
|
|
827
831
|
res[constant(desc, prop)] = desc;
|
|
828
832
|
return res;
|
|
@@ -2850,7 +2854,7 @@ var zoom = {
|
|
|
2850
2854
|
|
|
2851
2855
|
var openHelpLink = function openHelpLink() {
|
|
2852
2856
|
var _window$open;
|
|
2853
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.
|
|
2857
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.5.2\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
|
|
2854
2858
|
};
|
|
2855
2859
|
var help = {
|
|
2856
2860
|
help: {
|
|
@@ -7620,7 +7624,9 @@ function execute(activeTool, _ref) {
|
|
|
7620
7624
|
}
|
|
7621
7625
|
} else if (typeof action === 'function') {
|
|
7622
7626
|
action(editor, server, options);
|
|
7623
|
-
} else
|
|
7627
|
+
} else {
|
|
7628
|
+
console.info('no action');
|
|
7629
|
+
}
|
|
7624
7630
|
return activeTool;
|
|
7625
7631
|
}
|
|
7626
7632
|
function selected(actObj, activeTool, _ref2) {
|
|
@@ -7918,6 +7924,7 @@ function createStore (options, server, setEditor) {
|
|
|
7918
7924
|
templates: initTmplsState
|
|
7919
7925
|
};
|
|
7920
7926
|
var middleware = [thunk];
|
|
7927
|
+
middleware.push(logger);
|
|
7921
7928
|
var rootReducer = getRootReducer(setEditor);
|
|
7922
7929
|
return createStore$1(rootReducer, initState, applyMiddleware.apply(void 0, middleware));
|
|
7923
7930
|
}
|
|
@@ -9502,6 +9509,7 @@ var TopToolbar = function TopToolbar(_ref) {
|
|
|
9502
9509
|
isCollapsed: width < collapseLimit
|
|
9503
9510
|
}), jsx(SystemControls, {
|
|
9504
9511
|
onHistoryClick: function onHistoryClick() {
|
|
9512
|
+
console.log('History button clicked');
|
|
9505
9513
|
},
|
|
9506
9514
|
onSettingsOpen: onSettingsOpen,
|
|
9507
9515
|
onFullscreen: onFullscreen,
|
|
@@ -12222,6 +12230,7 @@ function sgroupDialog(editor, id, defaultType) {
|
|
|
12222
12230
|
var type = sg ? sg.type : defaultType;
|
|
12223
12231
|
var eventName = type === 'DAT' ? 'sdataEdit' : 'sgroupEdit';
|
|
12224
12232
|
if (!selection.atoms && !selection.bonds && !sg) {
|
|
12233
|
+
console.info('There is no selection or sgroup');
|
|
12225
12234
|
return;
|
|
12226
12235
|
}
|
|
12227
12236
|
var attrs;
|
|
@@ -13052,6 +13061,7 @@ var EraserTool = function () {
|
|
|
13052
13061
|
} else if (ci.map === 'texts') {
|
|
13053
13062
|
this.editor.update(fromTextDeletion(restruct, ci.id));
|
|
13054
13063
|
} else {
|
|
13064
|
+
console.error('EraserTool: unable to delete the object ' + ci.map + '[' + ci.id + ']');
|
|
13055
13065
|
return;
|
|
13056
13066
|
}
|
|
13057
13067
|
this.editor.selection(null);
|
|
@@ -14790,8 +14800,8 @@ var Editor$3 = function () {
|
|
|
14790
14800
|
value: function renderAndRecoordinateStruct(struct) {
|
|
14791
14801
|
var action = fromNewCanvas(this.render.ctab, struct);
|
|
14792
14802
|
this.update(action);
|
|
14793
|
-
getStructCenter(this.render.ctab);
|
|
14794
|
-
recoordinate(this);
|
|
14803
|
+
var structCenter = getStructCenter(this.render.ctab);
|
|
14804
|
+
recoordinate(this, structCenter);
|
|
14795
14805
|
return this.render.ctab.molecule;
|
|
14796
14806
|
}
|
|
14797
14807
|
}, {
|
|
@@ -14840,8 +14850,8 @@ var Editor$3 = function () {
|
|
|
14840
14850
|
}
|
|
14841
14851
|
this.render.setZoom(value);
|
|
14842
14852
|
var selection = this.selection();
|
|
14843
|
-
getStructCenter(this.render.ctab, selection);
|
|
14844
|
-
recoordinate(this);
|
|
14853
|
+
var structCenter = getStructCenter(this.render.ctab, selection);
|
|
14854
|
+
recoordinate(this, structCenter);
|
|
14845
14855
|
this.render.update();
|
|
14846
14856
|
return this.render.options.zoom;
|
|
14847
14857
|
}
|
|
@@ -15079,6 +15089,7 @@ function domEventSetup(editor, clientArea) {
|
|
|
15079
15089
|
}
|
|
15080
15090
|
function recoordinate(editor, rp
|
|
15081
15091
|
) {
|
|
15092
|
+
console.assert(rp, 'Reference point not specified');
|
|
15082
15093
|
editor.render.setScrollOffset(0, 0);
|
|
15083
15094
|
}
|
|
15084
15095
|
function getStructCenter(ReStruct, selection) {
|
|
@@ -16096,6 +16107,7 @@ function greekify(str) {
|
|
|
16096
16107
|
});
|
|
16097
16108
|
}
|
|
16098
16109
|
function filterLib(lib, filter$1) {
|
|
16110
|
+
console.warn('Filter', filter$1);
|
|
16099
16111
|
var re = new RegExp(escapeRegExp(greekify(filter$1)), 'i');
|
|
16100
16112
|
return flow(filter(function (item) {
|
|
16101
16113
|
return !filter$1 || re.test(greekify(item.struct.name)) || re.test(greekify(item.props.group));
|
|
@@ -16105,6 +16117,7 @@ function filterLib(lib, filter$1) {
|
|
|
16105
16117
|
}, {}))(lib);
|
|
16106
16118
|
}
|
|
16107
16119
|
function filterFGLib(lib, filter$1) {
|
|
16120
|
+
console.warn('Filter', filter$1);
|
|
16108
16121
|
var re = new RegExp(escapeRegExp(greekify(filter$1)), 'i');
|
|
16109
16122
|
return flow(filter(function (item) {
|
|
16110
16123
|
return !filter$1 || re.test(greekify(item.struct.name));
|
|
@@ -17153,6 +17166,7 @@ var mapDispatchToProps$b = function mapDispatchToProps(dispatch, ownProps) {
|
|
|
17153
17166
|
result: JSON.parse(newOpts)
|
|
17154
17167
|
}));
|
|
17155
17168
|
} catch (ex) {
|
|
17169
|
+
console.info('Bad file');
|
|
17156
17170
|
}
|
|
17157
17171
|
},
|
|
17158
17172
|
onReset: function onReset() {
|
|
@@ -17567,6 +17581,7 @@ function renderStruct(el, struct) {
|
|
|
17567
17581
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
17568
17582
|
if (el) {
|
|
17569
17583
|
if (struct) {
|
|
17584
|
+
console.info('render!', el.clientWidth, el.clientWidth);
|
|
17570
17585
|
struct.initHalfBonds();
|
|
17571
17586
|
struct.initNeighbors();
|
|
17572
17587
|
struct.setImplicitHydrogen();
|
|
@@ -17930,7 +17945,7 @@ var MiewDialog = function MiewDialog(_ref) {
|
|
|
17930
17945
|
}).then(function () {
|
|
17931
17946
|
return miew.setOptions(miewOpts);
|
|
17932
17947
|
})["catch"](function (ex) {
|
|
17933
|
-
return (
|
|
17948
|
+
return console.error(ex.message);
|
|
17934
17949
|
});
|
|
17935
17950
|
}, [miewOpts, server, struct]);
|
|
17936
17951
|
var exportCML = useCallback(function () {
|
|
@@ -21746,8 +21761,8 @@ var KetcherBuilder = function () {
|
|
|
21746
21761
|
initApp(element, staticResourcesUrl, {
|
|
21747
21762
|
buttons: buttons || {},
|
|
21748
21763
|
errorHandler: errorHandler || null,
|
|
21749
|
-
version: "2.
|
|
21750
|
-
buildDate: "2022-10-
|
|
21764
|
+
version: "2.5.2" ,
|
|
21765
|
+
buildDate: "2022-10-31T09:16:26" ,
|
|
21751
21766
|
buildNumber: ''
|
|
21752
21767
|
}, structService, resolve);
|
|
21753
21768
|
});
|