ketcher-react 2.27.0-rc.2 → 2.28.0-rc.1
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 +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +239 -159
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +241 -161
- package/dist/index.modern.js.map +1 -1
- package/dist/script/ui/state/options/index.d.ts +2 -0
- package/dist/script/ui/views/modal/components/document/Save/Save.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1248,6 +1248,9 @@ var initOptionsState = {
|
|
|
1248
1248
|
version: null
|
|
1249
1249
|
},
|
|
1250
1250
|
settings: Object.assign(getDefaultOptions(), validation(storage.getItem(ketcherCore.KETCHER_SAVED_OPTIONS_KEY))),
|
|
1251
|
+
getSettings: function getSettings() {
|
|
1252
|
+
this.settings = Object.assign(getDefaultOptions(), validation(storage.getItem(ketcherCore.KETCHER_SAVED_OPTIONS_KEY)));
|
|
1253
|
+
},
|
|
1251
1254
|
getServerSettings: function getServerSettings() {
|
|
1252
1255
|
var seriliazedServerOptions = getSerilizedServerOptions(this.settings);
|
|
1253
1256
|
var defaultServerOptions = fp.pick(SERVER_OPTIONS, this.settings);
|
|
@@ -1296,6 +1299,7 @@ function appUpdate(data) {
|
|
|
1296
1299
|
function saveSettings(newSettings) {
|
|
1297
1300
|
storage.setItem(ketcherCore.KETCHER_SAVED_OPTIONS_KEY, newSettings);
|
|
1298
1301
|
reinitializeTemplateLibrary();
|
|
1302
|
+
initOptionsState.getSettings();
|
|
1299
1303
|
return {
|
|
1300
1304
|
type: 'SAVE_SETTINGS',
|
|
1301
1305
|
data: newSettings
|
|
@@ -3798,7 +3802,7 @@ var zoom = {
|
|
|
3798
3802
|
|
|
3799
3803
|
var openHelpLink = function openHelpLink() {
|
|
3800
3804
|
var _window$open;
|
|
3801
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.
|
|
3805
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.28.0-rc.1\n", "/documentation/help.md#ketcher-overview"))) === null || _window$open === void 0 ? void 0 : _window$open.focus();
|
|
3802
3806
|
};
|
|
3803
3807
|
var help = {
|
|
3804
3808
|
help: {
|
|
@@ -17790,145 +17794,159 @@ function updateSelectedBonds(_ref) {
|
|
|
17790
17794
|
|
|
17791
17795
|
function customOnChangeHandler(action, handler) {
|
|
17792
17796
|
var data = [];
|
|
17793
|
-
action
|
|
17794
|
-
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17805
|
-
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17812
|
-
|
|
17813
|
-
|
|
17814
|
-
|
|
17815
|
-
|
|
17816
|
-
|
|
17817
|
-
|
|
17818
|
-
|
|
17819
|
-
|
|
17820
|
-
|
|
17821
|
-
|
|
17822
|
-
|
|
17823
|
-
|
|
17824
|
-
|
|
17825
|
-
|
|
17826
|
-
|
|
17827
|
-
|
|
17828
|
-
|
|
17829
|
-
|
|
17830
|
-
|
|
17831
|
-
|
|
17832
|
-
|
|
17833
|
-
|
|
17834
|
-
|
|
17835
|
-
|
|
17836
|
-
|
|
17837
|
-
|
|
17838
|
-
|
|
17839
|
-
|
|
17840
|
-
|
|
17841
|
-
|
|
17842
|
-
|
|
17843
|
-
|
|
17844
|
-
|
|
17845
|
-
|
|
17846
|
-
|
|
17847
|
-
|
|
17848
|
-
|
|
17849
|
-
|
|
17850
|
-
|
|
17851
|
-
|
|
17852
|
-
|
|
17853
|
-
|
|
17854
|
-
|
|
17855
|
-
|
|
17856
|
-
|
|
17857
|
-
|
|
17858
|
-
|
|
17859
|
-
|
|
17860
|
-
|
|
17861
|
-
|
|
17862
|
-
|
|
17863
|
-
|
|
17864
|
-
|
|
17865
|
-
|
|
17866
|
-
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
|
|
17870
|
-
|
|
17871
|
-
|
|
17872
|
-
|
|
17873
|
-
|
|
17874
|
-
|
|
17875
|
-
|
|
17876
|
-
})
|
|
17877
|
-
|
|
17878
|
-
|
|
17879
|
-
|
|
17880
|
-
|
|
17881
|
-
|
|
17882
|
-
|
|
17883
|
-
|
|
17884
|
-
|
|
17885
|
-
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
|
|
17889
|
-
|
|
17890
|
-
|
|
17891
|
-
|
|
17892
|
-
|
|
17893
|
-
|
|
17894
|
-
|
|
17895
|
-
|
|
17896
|
-
|
|
17897
|
-
|
|
17898
|
-
|
|
17899
|
-
|
|
17900
|
-
|
|
17901
|
-
|
|
17902
|
-
|
|
17903
|
-
|
|
17904
|
-
|
|
17905
|
-
|
|
17906
|
-
|
|
17907
|
-
|
|
17908
|
-
|
|
17909
|
-
|
|
17910
|
-
|
|
17911
|
-
|
|
17912
|
-
|
|
17913
|
-
|
|
17914
|
-
|
|
17915
|
-
|
|
17916
|
-
|
|
17917
|
-
|
|
17918
|
-
|
|
17919
|
-
|
|
17920
|
-
|
|
17921
|
-
|
|
17922
|
-
|
|
17923
|
-
|
|
17924
|
-
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17928
|
-
|
|
17929
|
-
|
|
17930
|
-
|
|
17931
|
-
|
|
17797
|
+
if (action === undefined) {
|
|
17798
|
+
return handler();
|
|
17799
|
+
} else {
|
|
17800
|
+
if (window.isPolymerEditorTurnedOn) {
|
|
17801
|
+
return handleMacroChanges(handler);
|
|
17802
|
+
} else {
|
|
17803
|
+
return handleMicroChanges(action, handler);
|
|
17804
|
+
}
|
|
17805
|
+
}
|
|
17806
|
+
function handleMacroChanges(handler) {
|
|
17807
|
+
return handler();
|
|
17808
|
+
}
|
|
17809
|
+
function handleMicroChanges(action, handler) {
|
|
17810
|
+
action.operations.reverse().forEach(function (operation) {
|
|
17811
|
+
var op = operation._inverted;
|
|
17812
|
+
switch (op.type) {
|
|
17813
|
+
case ketcherCore.OperationType.ATOM_ADD:
|
|
17814
|
+
case ketcherCore.OperationType.ATOM_DELETE:
|
|
17815
|
+
data.push({
|
|
17816
|
+
operation: op.type,
|
|
17817
|
+
id: op.data.aid,
|
|
17818
|
+
label: op.data.atom.label ? op.data.atom.label : '',
|
|
17819
|
+
position: {
|
|
17820
|
+
x: +op.data.pos.x.toFixed(2),
|
|
17821
|
+
y: +op.data.pos.y.toFixed(2)
|
|
17822
|
+
}
|
|
17823
|
+
});
|
|
17824
|
+
break;
|
|
17825
|
+
case ketcherCore.OperationType.ATOM_ATTR:
|
|
17826
|
+
data.push({
|
|
17827
|
+
operation: operation.type,
|
|
17828
|
+
id: operation.data.aid,
|
|
17829
|
+
attribute: operation.data.attribute,
|
|
17830
|
+
from: operation.data.value,
|
|
17831
|
+
to: operation.data2.value
|
|
17832
|
+
});
|
|
17833
|
+
break;
|
|
17834
|
+
case ketcherCore.OperationType.ATOM_MOVE:
|
|
17835
|
+
data.push({
|
|
17836
|
+
operation: op.type,
|
|
17837
|
+
id: op.data.aid,
|
|
17838
|
+
position: {
|
|
17839
|
+
x: +op.data.d.x.toFixed(2),
|
|
17840
|
+
y: +op.data.d.y.toFixed(2)
|
|
17841
|
+
}
|
|
17842
|
+
});
|
|
17843
|
+
break;
|
|
17844
|
+
case ketcherCore.OperationType.BOND_ADD:
|
|
17845
|
+
case ketcherCore.OperationType.BOND_DELETE:
|
|
17846
|
+
data.push({
|
|
17847
|
+
operation: op.type,
|
|
17848
|
+
id: op.data.bid
|
|
17849
|
+
});
|
|
17850
|
+
break;
|
|
17851
|
+
case ketcherCore.OperationType.FRAGMENT_ADD:
|
|
17852
|
+
case ketcherCore.OperationType.FRAGMENT_DELETE:
|
|
17853
|
+
data.push({
|
|
17854
|
+
operation: op.type,
|
|
17855
|
+
id: op.frid
|
|
17856
|
+
});
|
|
17857
|
+
break;
|
|
17858
|
+
case ketcherCore.OperationType.FRAGMENT_ADD_STEREO_ATOM:
|
|
17859
|
+
case ketcherCore.OperationType.FRAGMENT_DELETE_STEREO_ATOM:
|
|
17860
|
+
data.push({
|
|
17861
|
+
operation: op.type,
|
|
17862
|
+
atomId: op.data.aid,
|
|
17863
|
+
fragId: op.data.frid
|
|
17864
|
+
});
|
|
17865
|
+
break;
|
|
17866
|
+
case ketcherCore.OperationType.S_GROUP_ATOM_ADD:
|
|
17867
|
+
case ketcherCore.OperationType.S_GROUP_ATOM_REMOVE:
|
|
17868
|
+
data.push({
|
|
17869
|
+
operation: op.type,
|
|
17870
|
+
atomId: op.data.aid,
|
|
17871
|
+
sGroupId: op.data.sgid
|
|
17872
|
+
});
|
|
17873
|
+
break;
|
|
17874
|
+
case ketcherCore.OperationType.S_GROUP_CREATE:
|
|
17875
|
+
case ketcherCore.OperationType.S_GROUP_DELETE:
|
|
17876
|
+
data.push({
|
|
17877
|
+
operation: op.type,
|
|
17878
|
+
type: op.data.type,
|
|
17879
|
+
sGroupId: op.data.sgid
|
|
17880
|
+
});
|
|
17881
|
+
break;
|
|
17882
|
+
case ketcherCore.OperationType.RXN_ARROW_ADD:
|
|
17883
|
+
case ketcherCore.OperationType.RXN_ARROW_DELETE:
|
|
17884
|
+
data.push({
|
|
17885
|
+
operation: op.type,
|
|
17886
|
+
id: op.data.id,
|
|
17887
|
+
mode: op.data.mode,
|
|
17888
|
+
position: op.data.pos.map(function (pos) {
|
|
17889
|
+
return {
|
|
17890
|
+
x: +pos.x.toFixed(2),
|
|
17891
|
+
y: +pos.y.toFixed(2)
|
|
17892
|
+
};
|
|
17893
|
+
})
|
|
17894
|
+
});
|
|
17895
|
+
break;
|
|
17896
|
+
case ketcherCore.OperationType.RXN_ARROW_RESIZE:
|
|
17897
|
+
data.push({
|
|
17898
|
+
operation: op.type,
|
|
17899
|
+
id: op.data.id
|
|
17900
|
+
});
|
|
17901
|
+
break;
|
|
17902
|
+
case ketcherCore.OperationType.RXN_ARROW_MOVE:
|
|
17903
|
+
data.push({
|
|
17904
|
+
operation: op.type,
|
|
17905
|
+
id: op.data.id,
|
|
17906
|
+
position: {
|
|
17907
|
+
x: +op.data.d.x.toFixed(2),
|
|
17908
|
+
y: +op.data.d.y.toFixed(2)
|
|
17909
|
+
}
|
|
17910
|
+
});
|
|
17911
|
+
break;
|
|
17912
|
+
case ketcherCore.OperationType.R_GROUP_FRAGMENT:
|
|
17913
|
+
data.push({
|
|
17914
|
+
operation: operation.type,
|
|
17915
|
+
id: op.frid
|
|
17916
|
+
});
|
|
17917
|
+
break;
|
|
17918
|
+
case ketcherCore.OperationType.SIMPLE_OBJECT_ADD:
|
|
17919
|
+
case ketcherCore.OperationType.SIMPLE_OBJECT_DELETE:
|
|
17920
|
+
data.push({
|
|
17921
|
+
operation: op.type,
|
|
17922
|
+
id: op.data.id,
|
|
17923
|
+
mode: op.data.mode
|
|
17924
|
+
});
|
|
17925
|
+
break;
|
|
17926
|
+
case ketcherCore.OperationType.SIMPLE_OBJECT_RESIZE:
|
|
17927
|
+
data.push({
|
|
17928
|
+
operation: op.type,
|
|
17929
|
+
id: op.data.id
|
|
17930
|
+
});
|
|
17931
|
+
break;
|
|
17932
|
+
case ketcherCore.OperationType.SIMPLE_OBJECT_MOVE:
|
|
17933
|
+
data.push({
|
|
17934
|
+
operation: operation.type,
|
|
17935
|
+
id: operation.data.id,
|
|
17936
|
+
position: {
|
|
17937
|
+
x: +operation.data.d.x.toFixed(2),
|
|
17938
|
+
y: +operation.data.d.y.toFixed(2)
|
|
17939
|
+
}
|
|
17940
|
+
});
|
|
17941
|
+
break;
|
|
17942
|
+
default:
|
|
17943
|
+
data.push({
|
|
17944
|
+
operation: op.type
|
|
17945
|
+
});
|
|
17946
|
+
}
|
|
17947
|
+
});
|
|
17948
|
+
return handler(data);
|
|
17949
|
+
}
|
|
17932
17950
|
}
|
|
17933
17951
|
|
|
17934
17952
|
function getSelectionMap(structure) {
|
|
@@ -24632,6 +24650,7 @@ var Editor$3 = function () {
|
|
|
24632
24650
|
if (!wasViewOnlyEnabled && isViewOnlyEnabled === true || wasViewOnlyEnabled && isViewOnlyEnabled === false) {
|
|
24633
24651
|
this.tool('select');
|
|
24634
24652
|
this.event.change.dispatch('force');
|
|
24653
|
+
ketcherCore.ketcherProvider.getKetcher().changeEvent.dispatch('force');
|
|
24635
24654
|
}
|
|
24636
24655
|
}
|
|
24637
24656
|
}, {
|
|
@@ -24760,6 +24779,7 @@ var Editor$3 = function () {
|
|
|
24760
24779
|
}
|
|
24761
24780
|
this.historyPtr = this.historyStack.length;
|
|
24762
24781
|
this.event.change.dispatch(action);
|
|
24782
|
+
ketcherCore.ketcherProvider.getKetcher().changeEvent.dispatch(action);
|
|
24763
24783
|
}
|
|
24764
24784
|
this.render.update(false, null);
|
|
24765
24785
|
}
|
|
@@ -24775,6 +24795,7 @@ var Editor$3 = function () {
|
|
|
24775
24795
|
}, {
|
|
24776
24796
|
key: "undo",
|
|
24777
24797
|
value: function undo() {
|
|
24798
|
+
var ketcherChangeEvent = ketcherCore.ketcherProvider.getKetcher().changeEvent;
|
|
24778
24799
|
if (this.historyPtr === 0) {
|
|
24779
24800
|
throw new Error('Undo stack is empty');
|
|
24780
24801
|
}
|
|
@@ -24788,14 +24809,17 @@ var Editor$3 = function () {
|
|
|
24788
24809
|
this.historyStack[this.historyPtr] = action;
|
|
24789
24810
|
if (this._tool instanceof toolsMap.paste) {
|
|
24790
24811
|
this.event.change.dispatch();
|
|
24812
|
+
ketcherChangeEvent.dispatch();
|
|
24791
24813
|
} else {
|
|
24792
24814
|
this.event.change.dispatch(action);
|
|
24815
|
+
ketcherChangeEvent.dispatch(action);
|
|
24793
24816
|
}
|
|
24794
24817
|
this.render.update();
|
|
24795
24818
|
}
|
|
24796
24819
|
}, {
|
|
24797
24820
|
key: "redo",
|
|
24798
24821
|
value: function redo() {
|
|
24822
|
+
var ketcherChangeEvent = ketcherCore.ketcherProvider.getKetcher().changeEvent;
|
|
24799
24823
|
if (this.historyPtr === this.historyStack.length) {
|
|
24800
24824
|
throw new Error('Redo stack is empty');
|
|
24801
24825
|
}
|
|
@@ -24808,8 +24832,10 @@ var Editor$3 = function () {
|
|
|
24808
24832
|
this.historyPtr++;
|
|
24809
24833
|
if (this._tool instanceof toolsMap.paste) {
|
|
24810
24834
|
this.event.change.dispatch();
|
|
24835
|
+
ketcherChangeEvent.dispatch();
|
|
24811
24836
|
} else {
|
|
24812
24837
|
this.event.change.dispatch(action);
|
|
24838
|
+
ketcherChangeEvent.dispatch(action);
|
|
24813
24839
|
}
|
|
24814
24840
|
this.render.update();
|
|
24815
24841
|
}
|
|
@@ -24826,7 +24852,7 @@ var Editor$3 = function () {
|
|
|
24826
24852
|
return customOnChangeHandler(action, handler);
|
|
24827
24853
|
};
|
|
24828
24854
|
subscriber.handler = subscribeFuncWrapper;
|
|
24829
|
-
|
|
24855
|
+
ketcherCore.ketcherProvider.getKetcher().changeEvent.add(subscribeFuncWrapper);
|
|
24830
24856
|
break;
|
|
24831
24857
|
}
|
|
24832
24858
|
default:
|
|
@@ -27961,7 +27987,7 @@ var Select = function Select(_ref2) {
|
|
|
27961
27987
|
});
|
|
27962
27988
|
};
|
|
27963
27989
|
|
|
27964
|
-
var classes$B = {"button-common-styles":"form-module_button-common-styles__BvKSn","scrollbar":"form-module_scrollbar__MgLtc","inputWithExtraLabel":"form-module_inputWithExtraLabel__Y--OH","extraLabel":"form-module_extraLabel__2IE13","dataError":"form-module_dataError__IXK1h","inputWrapper":"form-module_inputWrapper__sIDHH","inputWithEditButtonWrapper":"form-module_inputWithEditButtonWrapper__hM70e","editButton":"form-module_editButton__zLQI5"};
|
|
27990
|
+
var classes$B = {"button-common-styles":"form-module_button-common-styles__BvKSn","scrollbar":"form-module_scrollbar__MgLtc","inputWithExtraLabel":"form-module_inputWithExtraLabel__Y--OH","extraLabel":"form-module_extraLabel__2IE13","dataError":"form-module_dataError__IXK1h","inputWrapper":"form-module_inputWrapper__sIDHH","inputWithEditButtonWrapper":"form-module_inputWithEditButtonWrapper__hM70e","editButton":"form-module_editButton__zLQI5","divWithTooltipAndAboutIcon":"form-module_divWithTooltipAndAboutIcon__rnNIB"};
|
|
27965
27991
|
|
|
27966
27992
|
var _excluded$m = ["schema", "result"],
|
|
27967
27993
|
_excluded2$3 = ["labelPos", "title", "children"],
|
|
@@ -28088,11 +28114,33 @@ function Label(_ref) {
|
|
|
28088
28114
|
props = _objectWithoutProperties__default["default"](_ref, _excluded2$3);
|
|
28089
28115
|
var tooltip = props.tooltip ? props.tooltip : null;
|
|
28090
28116
|
return jsxRuntime.jsxs("label", _objectSpread$D(_objectSpread$D({}, props), {}, {
|
|
28091
|
-
children: [title && labelPos !== 'after' ? jsxRuntime.
|
|
28092
|
-
|
|
28117
|
+
children: [title && labelPos !== 'after' ? tooltip ? jsxRuntime.jsxs("div", {
|
|
28118
|
+
className: clsx__default["default"](_defineProperty__default["default"]({}, classes$B.divWithTooltipAndAboutIcon, true)),
|
|
28119
|
+
children: [jsxRuntime.jsx("span", {
|
|
28120
|
+
children: title
|
|
28121
|
+
}), jsxRuntime.jsx(material.Tooltip, {
|
|
28122
|
+
title: tooltip,
|
|
28123
|
+
children: jsxRuntime.jsx("div", {
|
|
28124
|
+
children: jsxRuntime.jsx(Icon, {
|
|
28125
|
+
name: "about"
|
|
28126
|
+
})
|
|
28127
|
+
})
|
|
28128
|
+
})]
|
|
28129
|
+
}) : jsxRuntime.jsx("span", {
|
|
28093
28130
|
children: title
|
|
28094
|
-
}) : '', children, title && labelPos === 'after' ? jsxRuntime.
|
|
28095
|
-
|
|
28131
|
+
}) : '', children, title && labelPos === 'after' ? tooltip ? jsxRuntime.jsxs("div", {
|
|
28132
|
+
className: clsx__default["default"](_defineProperty__default["default"]({}, classes$B.divWithTooltipAndAboutIcon, true)),
|
|
28133
|
+
children: [jsxRuntime.jsx(material.Tooltip, {
|
|
28134
|
+
title: tooltip,
|
|
28135
|
+
children: jsxRuntime.jsx("div", {
|
|
28136
|
+
children: jsxRuntime.jsx(Icon, {
|
|
28137
|
+
name: "about"
|
|
28138
|
+
})
|
|
28139
|
+
})
|
|
28140
|
+
}), jsxRuntime.jsx("span", {
|
|
28141
|
+
children: title
|
|
28142
|
+
})]
|
|
28143
|
+
}) : jsxRuntime.jsx("span", {
|
|
28096
28144
|
children: title
|
|
28097
28145
|
}) : '']
|
|
28098
28146
|
}));
|
|
@@ -29172,7 +29220,7 @@ var SettingsDialog = function SettingsDialog(props) {
|
|
|
29172
29220
|
return jsxRuntime.jsx(Dialog, {
|
|
29173
29221
|
className: classes$x.settings,
|
|
29174
29222
|
result: function result() {
|
|
29175
|
-
return formState.result;
|
|
29223
|
+
return [formState.result, initState];
|
|
29176
29224
|
},
|
|
29177
29225
|
valid: function valid() {
|
|
29178
29226
|
return formState.valid;
|
|
@@ -29226,8 +29274,20 @@ var mapDispatchToProps$d = function mapDispatchToProps(dispatch, ownProps) {
|
|
|
29226
29274
|
return dispatch(setDefaultSettings());
|
|
29227
29275
|
},
|
|
29228
29276
|
onOk: function onOk(res) {
|
|
29229
|
-
|
|
29230
|
-
|
|
29277
|
+
var _res = _slicedToArray__default["default"](res, 2),
|
|
29278
|
+
result = _res[0],
|
|
29279
|
+
initState = _res[1];
|
|
29280
|
+
dispatch(saveSettings(result));
|
|
29281
|
+
ownProps.onOk(result);
|
|
29282
|
+
var showNotification = initState.reactionComponentMarginSize !== result.reactionComponentMarginSize;
|
|
29283
|
+
showNotification && dispatch(onAction({
|
|
29284
|
+
dialog: 'info-modal',
|
|
29285
|
+
prop: {
|
|
29286
|
+
title: '',
|
|
29287
|
+
customText: 'To fully apply these changes, you need to apply the layout.',
|
|
29288
|
+
button: 'OK'
|
|
29289
|
+
}
|
|
29290
|
+
}));
|
|
29231
29291
|
},
|
|
29232
29292
|
onACSStyle: function onACSStyle(result) {
|
|
29233
29293
|
dispatch(updateFormState({
|
|
@@ -31235,7 +31295,7 @@ function couldBeSaved(struct, format) {
|
|
|
31235
31295
|
if (hasRxnArrow) {
|
|
31236
31296
|
var arrayOfArrows = Array.from(struct.rxnArrows.values());
|
|
31237
31297
|
var rxnArrowMode = arrayOfArrows[0].mode;
|
|
31238
|
-
if (
|
|
31298
|
+
if (![ketcherCore.RxnArrowMode.OpenAngle, ketcherCore.RxnArrowMode.Retrosynthetic].includes(rxnArrowMode)) {
|
|
31239
31299
|
warnings.push("The ".concat(formatName, " format does not support drawn elements: the reaction ").concat(rxnArrowMode, " arrow will be replaced with the reaction arrow"));
|
|
31240
31300
|
}
|
|
31241
31301
|
}
|
|
@@ -31557,6 +31617,22 @@ var SaveDialog = function (_Component) {
|
|
|
31557
31617
|
})]
|
|
31558
31618
|
});
|
|
31559
31619
|
});
|
|
31620
|
+
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "handleCopy", function (event) {
|
|
31621
|
+
var structStr = _this.state.structStr;
|
|
31622
|
+
try {
|
|
31623
|
+
if (ketcherCore.isClipboardAPIAvailable()) {
|
|
31624
|
+
navigator.clipboard.writeText(structStr);
|
|
31625
|
+
} else {
|
|
31626
|
+
ketcherCore.legacyCopy(event.clipboardData, {
|
|
31627
|
+
'text/plain': structStr
|
|
31628
|
+
});
|
|
31629
|
+
event.preventDefault();
|
|
31630
|
+
}
|
|
31631
|
+
} catch (e) {
|
|
31632
|
+
ketcherCore.KetcherLogger.error('copyAs.js::copyAs', e);
|
|
31633
|
+
_this.props.editor.errorHandler('This feature is not available in your browser');
|
|
31634
|
+
}
|
|
31635
|
+
});
|
|
31560
31636
|
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "renderSaveFile", function () {
|
|
31561
31637
|
var formState = Object.assign({}, _this.props.formState);
|
|
31562
31638
|
delete formState.moleculeErrors;
|
|
@@ -31595,15 +31671,20 @@ var SaveDialog = function (_Component) {
|
|
|
31595
31671
|
};
|
|
31596
31672
|
var PreviewContent = function PreviewContent(_ref3) {
|
|
31597
31673
|
var format = _ref3.format;
|
|
31598
|
-
return jsxRuntime.
|
|
31674
|
+
return jsxRuntime.jsxs("div", {
|
|
31599
31675
|
className: classes$l.previewBackground,
|
|
31600
|
-
children: jsxRuntime.jsx("textarea", {
|
|
31676
|
+
children: [jsxRuntime.jsx("textarea", {
|
|
31601
31677
|
value: structStr,
|
|
31602
31678
|
className: classes$l.previewArea,
|
|
31603
31679
|
readOnly: true,
|
|
31604
31680
|
ref: _this.textAreaRef,
|
|
31605
31681
|
"data-testid": "".concat(format, "-preview-area-text")
|
|
31606
|
-
})
|
|
31682
|
+
}), jsxRuntime.jsx(IconButton, {
|
|
31683
|
+
onClick: _this.handleCopy,
|
|
31684
|
+
iconName: "copy",
|
|
31685
|
+
title: "Copy to clipboard",
|
|
31686
|
+
testId: "copy-to-clipboard"
|
|
31687
|
+
})]
|
|
31607
31688
|
});
|
|
31608
31689
|
};
|
|
31609
31690
|
if (isLoading) {
|
|
@@ -34050,12 +34131,12 @@ var PasteErrorModalBody = function PasteErrorModalBody() {
|
|
|
34050
34131
|
var styles = {"infoModal":"InfoModal-module_infoModal__0Vza1","ok":"InfoModal-module_ok__BZ1ar"};
|
|
34051
34132
|
|
|
34052
34133
|
function ErrorInfoModal(props) {
|
|
34053
|
-
var _config$paste$title;
|
|
34134
|
+
var _config$paste$title, _props$title;
|
|
34054
34135
|
var paste = (_config$paste$title = configWithNonViewOnlyActionsDisabled.paste.title) !== null && _config$paste$title !== void 0 ? _config$paste$title : 'Paste';
|
|
34055
34136
|
var isPasteError = props.message === paste;
|
|
34056
34137
|
var defaultCutCopyMessage = "This action is unavailable via menu. Instead, use shortcut to ".concat(props.message, ".");
|
|
34057
34138
|
var headerContent = jsxRuntime.jsx("div", {
|
|
34058
|
-
children: error.message
|
|
34139
|
+
children: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : error.message
|
|
34059
34140
|
});
|
|
34060
34141
|
return jsxRuntime.jsx(Dialog, {
|
|
34061
34142
|
className: styles.infoModal,
|
|
@@ -34063,7 +34144,7 @@ function ErrorInfoModal(props) {
|
|
|
34063
34144
|
buttons: [jsxRuntime.jsx("button", {
|
|
34064
34145
|
onClick: props.onOk,
|
|
34065
34146
|
className: styles.ok,
|
|
34066
|
-
children:
|
|
34147
|
+
children: props.button || 'Close'
|
|
34067
34148
|
}, "ok")],
|
|
34068
34149
|
headerContent: headerContent,
|
|
34069
34150
|
children: jsxRuntime.jsx("div", {
|
|
@@ -34733,7 +34814,6 @@ var App = function App(props) {
|
|
|
34733
34814
|
checkServer();
|
|
34734
34815
|
dispatch(initFGTemplates());
|
|
34735
34816
|
dispatch(initSaltsAndSolventsTemplates());
|
|
34736
|
-
window.scrollTo(0, 0);
|
|
34737
34817
|
return function () {
|
|
34738
34818
|
dispatch(initLib([]));
|
|
34739
34819
|
dispatch(initSaltsAndSolvents([]));
|
|
@@ -34949,8 +35029,8 @@ var KetcherBuilder = function () {
|
|
|
34949
35029
|
cleanup = initApp(element, appRoot, staticResourcesUrl, {
|
|
34950
35030
|
buttons: buttons || {},
|
|
34951
35031
|
errorHandler: errorHandler || null,
|
|
34952
|
-
version: "2.
|
|
34953
|
-
buildDate: "2024-
|
|
35032
|
+
version: "2.28.0-rc.1" ,
|
|
35033
|
+
buildDate: "2024-12-03T17:11:53" ,
|
|
34954
35034
|
buildNumber: '',
|
|
34955
35035
|
customButtons: customButtons || []
|
|
34956
35036
|
}, structService, resolve, togglerComponent);
|