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.modern.js
CHANGED
|
@@ -24,7 +24,7 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
|
24
24
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
25
25
|
import _classCallCheck$2 from '@babel/runtime/helpers/classCallCheck';
|
|
26
26
|
import _createClass$2 from '@babel/runtime/helpers/createClass';
|
|
27
|
-
import { KetSerializer, MolSerializer, KetcherLogger, Ketcher, defaultBondThickness, FormatterFactory, isClipboardAPIAvailable, notifyCopyCut, notifyRequestCompleted, isControlKey, StereLabelStyleType, StereoColoringType, ShowHydrogenLabels, ShowHydrogenLabelNames, SettingsManager, SdfSerializer, KETCHER_SAVED_OPTIONS_KEY, Bond as Bond$2, Elements, AtomList, getAtomType, StereoLabel, isAttachmentBond, Atom as Atom$2, findStereoAtoms, RxnArrowMode, MULTITAIL_ARROW_TOOL_NAME, SimpleObjectMode, IMAGE_KEY, SGroup as SGroup$1, Pile, identifyStructFormat, SupportedFormat, MULTITAIL_ARROW_KEY, ChemicalMimeType, RenderStruct, Struct, ZoomTool, shortcutStr, MonomerMicromolecule, UnresolvedMonomer, FunctionalGroupsProvider, SaltsAndSolventsProvider, KetcherAsyncEvents, ElementColor, ketcherProvider, generateMenuShortcuts, Vec2, Scale, fromMultipleMove, FunctionalGroup, mergeMapOfItemsToSet, fromSgroupDeletion, fromFragmentDeletion, vectorUtils, fromBondAddition, Action, fromAtomAddition, fromAtomsAttrs, checkOverlapping, fromSeveralSgroupAddition, expandSGroupWithMultipleAttachmentPoint, SgContexts, fromSgroupAction, fromItemsFuse, ReBond, setExpandSGroup, fromBondsAttrs, OperationType, ReStruct, imageReferencePositionToCursor, multitailArrowReferenceLinesToCursor, multitailReferencePositionToCursor, CoordinateTransformation, MultitailArrowRefName, fromMultitailArrowHeadTailMove, fromMultitailArrowHeadTailsResize, fromMultitailArrowMove, fromArrowResizing, fromPaste, fromImageResize, fromSimpleObjectResizing, getItemsToFuse, getHoverToFuse, fromTextDeletion, fromTextUpdating, fromTemplateOnCanvas, fromTemplateOnBondAction, fromTemplateOnAtom, BondAttr, AtomAttr, formatProperties, runAsyncAction, getStructStringFromClipboardData, getStructure, initHotKeys, keyNorm, Fragment as Fragment$1, fromRGroupAttachmentPointUpdate, fromOneBondDeletion, bondChangingAction, fromChain, fromStereoFlagUpdate, fromOneAtomDeletion, fromArrowDeletion, fromPlusDeletion, fromSimpleObjectDeletion, fromRGroupAttachmentPointDeletion, fromImageDeletion, fromMultitailArrowDeletion, notifyItemsToMergeInitializationComplete, RGroup as RGroup$2, fromRGroupFragment, fromUpdateIfThen, fromRGroupAttrs, fromArrowAddition, fromMultitailArrowCreation, fromPlusAddition, fromRotate, fromFlip, fromSimpleObjectAddition, fromTextCreation, fromImageMove, fromImageCreation, fromHighlightCreate, fromHighlightClear, getOptionsWithConvertedUnits, provideEditorSettings, fromNewCanvas, Render, fromDescriptorsAlign, fromSgroupAttachmentPointAddition, SGroupAttachmentPoint, fromSgroupAddition, atomGetAttr, fromBondFlipping, fromMultitailArrowTailAdd, MultitailArrow, fromMultitailArrowTailRemove, setExpandMonomerSGroup, AmbiguousMonomer, genericsList, getAtomCustomQuery, getFormatMimeTypeByFileName, getPropertiesByFormat, StereoFlag, getPropertiesByImgFormat, b64toBlob, Generics, TextCommand, DefaultStructServiceOptions } from 'ketcher-core';
|
|
27
|
+
import { KetSerializer, MolSerializer, KetcherLogger, Ketcher, defaultBondThickness, FormatterFactory, isClipboardAPIAvailable, notifyCopyCut, notifyRequestCompleted, isControlKey, StereLabelStyleType, StereoColoringType, ShowHydrogenLabels, ShowHydrogenLabelNames, SettingsManager, SdfSerializer, KETCHER_SAVED_OPTIONS_KEY, Bond as Bond$2, Elements, AtomList, getAtomType, StereoLabel, isAttachmentBond, Atom as Atom$2, findStereoAtoms, RxnArrowMode, MULTITAIL_ARROW_TOOL_NAME, SimpleObjectMode, IMAGE_KEY, SGroup as SGroup$1, Pile, identifyStructFormat, SupportedFormat, MULTITAIL_ARROW_KEY, ChemicalMimeType, RenderStruct, Struct, ZoomTool, shortcutStr, MonomerMicromolecule, UnresolvedMonomer, FunctionalGroupsProvider, SaltsAndSolventsProvider, KetcherAsyncEvents, ElementColor, ketcherProvider, generateMenuShortcuts, Vec2, Scale, fromMultipleMove, FunctionalGroup, mergeMapOfItemsToSet, fromSgroupDeletion, fromFragmentDeletion, vectorUtils, fromBondAddition, Action, fromAtomAddition, fromAtomsAttrs, checkOverlapping, fromSeveralSgroupAddition, expandSGroupWithMultipleAttachmentPoint, SgContexts, fromSgroupAction, fromItemsFuse, ReBond, setExpandSGroup, fromBondsAttrs, OperationType, ReStruct, imageReferencePositionToCursor, multitailArrowReferenceLinesToCursor, multitailReferencePositionToCursor, CoordinateTransformation, MultitailArrowRefName, fromMultitailArrowHeadTailMove, fromMultitailArrowHeadTailsResize, fromMultitailArrowMove, fromArrowResizing, fromPaste, fromImageResize, fromSimpleObjectResizing, getItemsToFuse, getHoverToFuse, fromTextDeletion, fromTextUpdating, fromTemplateOnCanvas, fromTemplateOnBondAction, fromTemplateOnAtom, BondAttr, AtomAttr, formatProperties, runAsyncAction, getStructStringFromClipboardData, getStructure, initHotKeys, keyNorm, Fragment as Fragment$1, fromRGroupAttachmentPointUpdate, fromOneBondDeletion, bondChangingAction, fromChain, fromStereoFlagUpdate, fromOneAtomDeletion, fromArrowDeletion, fromPlusDeletion, fromSimpleObjectDeletion, fromRGroupAttachmentPointDeletion, fromImageDeletion, fromMultitailArrowDeletion, notifyItemsToMergeInitializationComplete, RGroup as RGroup$2, fromRGroupFragment, fromUpdateIfThen, fromRGroupAttrs, fromArrowAddition, fromMultitailArrowCreation, fromPlusAddition, fromRotate, fromFlip, fromSimpleObjectAddition, fromTextCreation, fromImageMove, fromImageCreation, fromHighlightCreate, fromHighlightClear, getOptionsWithConvertedUnits, provideEditorSettings, fromNewCanvas, Render, fromDescriptorsAlign, fromSgroupAttachmentPointAddition, SGroupAttachmentPoint, fromSgroupAddition, atomGetAttr, fromBondFlipping, fromMultitailArrowTailAdd, MultitailArrow, fromMultitailArrowTailRemove, setExpandMonomerSGroup, AmbiguousMonomer, genericsList, getAtomCustomQuery, getFormatMimeTypeByFileName, getPropertiesByFormat, StereoFlag, getPropertiesByImgFormat, legacyCopy as legacyCopy$1, b64toBlob, Generics, TextCommand, DefaultStructServiceOptions } from 'ketcher-core';
|
|
28
28
|
import * as React from 'react';
|
|
29
29
|
import React__default, { createRef, Component, useRef, useEffect, useLayoutEffect, useMemo, useState, createElement, forwardRef, useCallback, Fragment as Fragment$2, PureComponent, lazy, Suspense } from 'react';
|
|
30
30
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -51,7 +51,7 @@ import 'redux-logger';
|
|
|
51
51
|
import thunk from 'redux-thunk';
|
|
52
52
|
import useResizeObserver from 'use-resize-observer/polyfilled';
|
|
53
53
|
import { useInView } from 'react-intersection-observer';
|
|
54
|
-
import { IconButton as IconButton$1, Collapse, ClickAwayListener, Button as Button$1, Popover, ToggleButtonGroup, ToggleButton, MenuList, createTheme, ThemeProvider } from '@mui/material';
|
|
54
|
+
import { IconButton as IconButton$1, Collapse, ClickAwayListener, Button as Button$1, Popover, ToggleButtonGroup, ToggleButton, Tooltip, MenuList, createTheme, ThemeProvider } from '@mui/material';
|
|
55
55
|
import { createSelector } from 'reselect';
|
|
56
56
|
import { isIE } from 'react-device-detect';
|
|
57
57
|
import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
|
|
@@ -1183,6 +1183,9 @@ var initOptionsState = {
|
|
|
1183
1183
|
version: null
|
|
1184
1184
|
},
|
|
1185
1185
|
settings: Object.assign(getDefaultOptions(), validation(storage.getItem(KETCHER_SAVED_OPTIONS_KEY))),
|
|
1186
|
+
getSettings: function getSettings() {
|
|
1187
|
+
this.settings = Object.assign(getDefaultOptions(), validation(storage.getItem(KETCHER_SAVED_OPTIONS_KEY)));
|
|
1188
|
+
},
|
|
1186
1189
|
getServerSettings: function getServerSettings() {
|
|
1187
1190
|
var seriliazedServerOptions = getSerilizedServerOptions(this.settings);
|
|
1188
1191
|
var defaultServerOptions = pick(SERVER_OPTIONS, this.settings);
|
|
@@ -1231,6 +1234,7 @@ function appUpdate(data) {
|
|
|
1231
1234
|
function saveSettings(newSettings) {
|
|
1232
1235
|
storage.setItem(KETCHER_SAVED_OPTIONS_KEY, newSettings);
|
|
1233
1236
|
reinitializeTemplateLibrary();
|
|
1237
|
+
initOptionsState.getSettings();
|
|
1234
1238
|
return {
|
|
1235
1239
|
type: 'SAVE_SETTINGS',
|
|
1236
1240
|
data: newSettings
|
|
@@ -3733,7 +3737,7 @@ var zoom = {
|
|
|
3733
3737
|
|
|
3734
3738
|
var openHelpLink = function openHelpLink() {
|
|
3735
3739
|
var _window$open;
|
|
3736
|
-
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.
|
|
3740
|
+
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();
|
|
3737
3741
|
};
|
|
3738
3742
|
var help = {
|
|
3739
3743
|
help: {
|
|
@@ -17725,145 +17729,159 @@ function updateSelectedBonds(_ref) {
|
|
|
17725
17729
|
|
|
17726
17730
|
function customOnChangeHandler(action, handler) {
|
|
17727
17731
|
var data = [];
|
|
17728
|
-
action
|
|
17729
|
-
|
|
17730
|
-
|
|
17731
|
-
|
|
17732
|
-
|
|
17733
|
-
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17745
|
-
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
|
|
17753
|
-
|
|
17754
|
-
|
|
17755
|
-
|
|
17756
|
-
|
|
17757
|
-
|
|
17758
|
-
|
|
17759
|
-
|
|
17760
|
-
|
|
17761
|
-
|
|
17762
|
-
|
|
17763
|
-
|
|
17764
|
-
|
|
17765
|
-
|
|
17766
|
-
|
|
17767
|
-
|
|
17768
|
-
|
|
17769
|
-
|
|
17770
|
-
|
|
17771
|
-
|
|
17772
|
-
|
|
17773
|
-
|
|
17774
|
-
|
|
17775
|
-
|
|
17776
|
-
|
|
17777
|
-
|
|
17778
|
-
|
|
17779
|
-
|
|
17780
|
-
|
|
17781
|
-
|
|
17782
|
-
|
|
17783
|
-
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17791
|
-
|
|
17792
|
-
|
|
17793
|
-
|
|
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
|
-
|
|
17732
|
+
if (action === undefined) {
|
|
17733
|
+
return handler();
|
|
17734
|
+
} else {
|
|
17735
|
+
if (window.isPolymerEditorTurnedOn) {
|
|
17736
|
+
return handleMacroChanges(handler);
|
|
17737
|
+
} else {
|
|
17738
|
+
return handleMicroChanges(action, handler);
|
|
17739
|
+
}
|
|
17740
|
+
}
|
|
17741
|
+
function handleMacroChanges(handler) {
|
|
17742
|
+
return handler();
|
|
17743
|
+
}
|
|
17744
|
+
function handleMicroChanges(action, handler) {
|
|
17745
|
+
action.operations.reverse().forEach(function (operation) {
|
|
17746
|
+
var op = operation._inverted;
|
|
17747
|
+
switch (op.type) {
|
|
17748
|
+
case OperationType.ATOM_ADD:
|
|
17749
|
+
case OperationType.ATOM_DELETE:
|
|
17750
|
+
data.push({
|
|
17751
|
+
operation: op.type,
|
|
17752
|
+
id: op.data.aid,
|
|
17753
|
+
label: op.data.atom.label ? op.data.atom.label : '',
|
|
17754
|
+
position: {
|
|
17755
|
+
x: +op.data.pos.x.toFixed(2),
|
|
17756
|
+
y: +op.data.pos.y.toFixed(2)
|
|
17757
|
+
}
|
|
17758
|
+
});
|
|
17759
|
+
break;
|
|
17760
|
+
case OperationType.ATOM_ATTR:
|
|
17761
|
+
data.push({
|
|
17762
|
+
operation: operation.type,
|
|
17763
|
+
id: operation.data.aid,
|
|
17764
|
+
attribute: operation.data.attribute,
|
|
17765
|
+
from: operation.data.value,
|
|
17766
|
+
to: operation.data2.value
|
|
17767
|
+
});
|
|
17768
|
+
break;
|
|
17769
|
+
case OperationType.ATOM_MOVE:
|
|
17770
|
+
data.push({
|
|
17771
|
+
operation: op.type,
|
|
17772
|
+
id: op.data.aid,
|
|
17773
|
+
position: {
|
|
17774
|
+
x: +op.data.d.x.toFixed(2),
|
|
17775
|
+
y: +op.data.d.y.toFixed(2)
|
|
17776
|
+
}
|
|
17777
|
+
});
|
|
17778
|
+
break;
|
|
17779
|
+
case OperationType.BOND_ADD:
|
|
17780
|
+
case OperationType.BOND_DELETE:
|
|
17781
|
+
data.push({
|
|
17782
|
+
operation: op.type,
|
|
17783
|
+
id: op.data.bid
|
|
17784
|
+
});
|
|
17785
|
+
break;
|
|
17786
|
+
case OperationType.FRAGMENT_ADD:
|
|
17787
|
+
case OperationType.FRAGMENT_DELETE:
|
|
17788
|
+
data.push({
|
|
17789
|
+
operation: op.type,
|
|
17790
|
+
id: op.frid
|
|
17791
|
+
});
|
|
17792
|
+
break;
|
|
17793
|
+
case OperationType.FRAGMENT_ADD_STEREO_ATOM:
|
|
17794
|
+
case OperationType.FRAGMENT_DELETE_STEREO_ATOM:
|
|
17795
|
+
data.push({
|
|
17796
|
+
operation: op.type,
|
|
17797
|
+
atomId: op.data.aid,
|
|
17798
|
+
fragId: op.data.frid
|
|
17799
|
+
});
|
|
17800
|
+
break;
|
|
17801
|
+
case OperationType.S_GROUP_ATOM_ADD:
|
|
17802
|
+
case OperationType.S_GROUP_ATOM_REMOVE:
|
|
17803
|
+
data.push({
|
|
17804
|
+
operation: op.type,
|
|
17805
|
+
atomId: op.data.aid,
|
|
17806
|
+
sGroupId: op.data.sgid
|
|
17807
|
+
});
|
|
17808
|
+
break;
|
|
17809
|
+
case OperationType.S_GROUP_CREATE:
|
|
17810
|
+
case OperationType.S_GROUP_DELETE:
|
|
17811
|
+
data.push({
|
|
17812
|
+
operation: op.type,
|
|
17813
|
+
type: op.data.type,
|
|
17814
|
+
sGroupId: op.data.sgid
|
|
17815
|
+
});
|
|
17816
|
+
break;
|
|
17817
|
+
case OperationType.RXN_ARROW_ADD:
|
|
17818
|
+
case OperationType.RXN_ARROW_DELETE:
|
|
17819
|
+
data.push({
|
|
17820
|
+
operation: op.type,
|
|
17821
|
+
id: op.data.id,
|
|
17822
|
+
mode: op.data.mode,
|
|
17823
|
+
position: op.data.pos.map(function (pos) {
|
|
17824
|
+
return {
|
|
17825
|
+
x: +pos.x.toFixed(2),
|
|
17826
|
+
y: +pos.y.toFixed(2)
|
|
17827
|
+
};
|
|
17828
|
+
})
|
|
17829
|
+
});
|
|
17830
|
+
break;
|
|
17831
|
+
case OperationType.RXN_ARROW_RESIZE:
|
|
17832
|
+
data.push({
|
|
17833
|
+
operation: op.type,
|
|
17834
|
+
id: op.data.id
|
|
17835
|
+
});
|
|
17836
|
+
break;
|
|
17837
|
+
case OperationType.RXN_ARROW_MOVE:
|
|
17838
|
+
data.push({
|
|
17839
|
+
operation: op.type,
|
|
17840
|
+
id: op.data.id,
|
|
17841
|
+
position: {
|
|
17842
|
+
x: +op.data.d.x.toFixed(2),
|
|
17843
|
+
y: +op.data.d.y.toFixed(2)
|
|
17844
|
+
}
|
|
17845
|
+
});
|
|
17846
|
+
break;
|
|
17847
|
+
case OperationType.R_GROUP_FRAGMENT:
|
|
17848
|
+
data.push({
|
|
17849
|
+
operation: operation.type,
|
|
17850
|
+
id: op.frid
|
|
17851
|
+
});
|
|
17852
|
+
break;
|
|
17853
|
+
case OperationType.SIMPLE_OBJECT_ADD:
|
|
17854
|
+
case OperationType.SIMPLE_OBJECT_DELETE:
|
|
17855
|
+
data.push({
|
|
17856
|
+
operation: op.type,
|
|
17857
|
+
id: op.data.id,
|
|
17858
|
+
mode: op.data.mode
|
|
17859
|
+
});
|
|
17860
|
+
break;
|
|
17861
|
+
case OperationType.SIMPLE_OBJECT_RESIZE:
|
|
17862
|
+
data.push({
|
|
17863
|
+
operation: op.type,
|
|
17864
|
+
id: op.data.id
|
|
17865
|
+
});
|
|
17866
|
+
break;
|
|
17867
|
+
case OperationType.SIMPLE_OBJECT_MOVE:
|
|
17868
|
+
data.push({
|
|
17869
|
+
operation: operation.type,
|
|
17870
|
+
id: operation.data.id,
|
|
17871
|
+
position: {
|
|
17872
|
+
x: +operation.data.d.x.toFixed(2),
|
|
17873
|
+
y: +operation.data.d.y.toFixed(2)
|
|
17874
|
+
}
|
|
17875
|
+
});
|
|
17876
|
+
break;
|
|
17877
|
+
default:
|
|
17878
|
+
data.push({
|
|
17879
|
+
operation: op.type
|
|
17880
|
+
});
|
|
17881
|
+
}
|
|
17882
|
+
});
|
|
17883
|
+
return handler(data);
|
|
17884
|
+
}
|
|
17867
17885
|
}
|
|
17868
17886
|
|
|
17869
17887
|
function getSelectionMap(structure) {
|
|
@@ -24567,6 +24585,7 @@ var Editor$3 = function () {
|
|
|
24567
24585
|
if (!wasViewOnlyEnabled && isViewOnlyEnabled === true || wasViewOnlyEnabled && isViewOnlyEnabled === false) {
|
|
24568
24586
|
this.tool('select');
|
|
24569
24587
|
this.event.change.dispatch('force');
|
|
24588
|
+
ketcherProvider.getKetcher().changeEvent.dispatch('force');
|
|
24570
24589
|
}
|
|
24571
24590
|
}
|
|
24572
24591
|
}, {
|
|
@@ -24695,6 +24714,7 @@ var Editor$3 = function () {
|
|
|
24695
24714
|
}
|
|
24696
24715
|
this.historyPtr = this.historyStack.length;
|
|
24697
24716
|
this.event.change.dispatch(action);
|
|
24717
|
+
ketcherProvider.getKetcher().changeEvent.dispatch(action);
|
|
24698
24718
|
}
|
|
24699
24719
|
this.render.update(false, null);
|
|
24700
24720
|
}
|
|
@@ -24710,6 +24730,7 @@ var Editor$3 = function () {
|
|
|
24710
24730
|
}, {
|
|
24711
24731
|
key: "undo",
|
|
24712
24732
|
value: function undo() {
|
|
24733
|
+
var ketcherChangeEvent = ketcherProvider.getKetcher().changeEvent;
|
|
24713
24734
|
if (this.historyPtr === 0) {
|
|
24714
24735
|
throw new Error('Undo stack is empty');
|
|
24715
24736
|
}
|
|
@@ -24723,14 +24744,17 @@ var Editor$3 = function () {
|
|
|
24723
24744
|
this.historyStack[this.historyPtr] = action;
|
|
24724
24745
|
if (this._tool instanceof toolsMap.paste) {
|
|
24725
24746
|
this.event.change.dispatch();
|
|
24747
|
+
ketcherChangeEvent.dispatch();
|
|
24726
24748
|
} else {
|
|
24727
24749
|
this.event.change.dispatch(action);
|
|
24750
|
+
ketcherChangeEvent.dispatch(action);
|
|
24728
24751
|
}
|
|
24729
24752
|
this.render.update();
|
|
24730
24753
|
}
|
|
24731
24754
|
}, {
|
|
24732
24755
|
key: "redo",
|
|
24733
24756
|
value: function redo() {
|
|
24757
|
+
var ketcherChangeEvent = ketcherProvider.getKetcher().changeEvent;
|
|
24734
24758
|
if (this.historyPtr === this.historyStack.length) {
|
|
24735
24759
|
throw new Error('Redo stack is empty');
|
|
24736
24760
|
}
|
|
@@ -24743,8 +24767,10 @@ var Editor$3 = function () {
|
|
|
24743
24767
|
this.historyPtr++;
|
|
24744
24768
|
if (this._tool instanceof toolsMap.paste) {
|
|
24745
24769
|
this.event.change.dispatch();
|
|
24770
|
+
ketcherChangeEvent.dispatch();
|
|
24746
24771
|
} else {
|
|
24747
24772
|
this.event.change.dispatch(action);
|
|
24773
|
+
ketcherChangeEvent.dispatch(action);
|
|
24748
24774
|
}
|
|
24749
24775
|
this.render.update();
|
|
24750
24776
|
}
|
|
@@ -24761,7 +24787,7 @@ var Editor$3 = function () {
|
|
|
24761
24787
|
return customOnChangeHandler(action, handler);
|
|
24762
24788
|
};
|
|
24763
24789
|
subscriber.handler = subscribeFuncWrapper;
|
|
24764
|
-
|
|
24790
|
+
ketcherProvider.getKetcher().changeEvent.add(subscribeFuncWrapper);
|
|
24765
24791
|
break;
|
|
24766
24792
|
}
|
|
24767
24793
|
default:
|
|
@@ -27896,7 +27922,7 @@ var Select = function Select(_ref2) {
|
|
|
27896
27922
|
});
|
|
27897
27923
|
};
|
|
27898
27924
|
|
|
27899
|
-
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"};
|
|
27925
|
+
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"};
|
|
27900
27926
|
|
|
27901
27927
|
var _excluded$m = ["schema", "result"],
|
|
27902
27928
|
_excluded2$3 = ["labelPos", "title", "children"],
|
|
@@ -28023,11 +28049,33 @@ function Label(_ref) {
|
|
|
28023
28049
|
props = _objectWithoutProperties(_ref, _excluded2$3);
|
|
28024
28050
|
var tooltip = props.tooltip ? props.tooltip : null;
|
|
28025
28051
|
return jsxs("label", _objectSpread$D(_objectSpread$D({}, props), {}, {
|
|
28026
|
-
children: [title && labelPos !== 'after' ?
|
|
28027
|
-
|
|
28052
|
+
children: [title && labelPos !== 'after' ? tooltip ? jsxs("div", {
|
|
28053
|
+
className: clsx(_defineProperty$1({}, classes$B.divWithTooltipAndAboutIcon, true)),
|
|
28054
|
+
children: [jsx("span", {
|
|
28055
|
+
children: title
|
|
28056
|
+
}), jsx(Tooltip, {
|
|
28057
|
+
title: tooltip,
|
|
28058
|
+
children: jsx("div", {
|
|
28059
|
+
children: jsx(Icon, {
|
|
28060
|
+
name: "about"
|
|
28061
|
+
})
|
|
28062
|
+
})
|
|
28063
|
+
})]
|
|
28064
|
+
}) : jsx("span", {
|
|
28028
28065
|
children: title
|
|
28029
|
-
}) : '', children, title && labelPos === 'after' ?
|
|
28030
|
-
|
|
28066
|
+
}) : '', children, title && labelPos === 'after' ? tooltip ? jsxs("div", {
|
|
28067
|
+
className: clsx(_defineProperty$1({}, classes$B.divWithTooltipAndAboutIcon, true)),
|
|
28068
|
+
children: [jsx(Tooltip, {
|
|
28069
|
+
title: tooltip,
|
|
28070
|
+
children: jsx("div", {
|
|
28071
|
+
children: jsx(Icon, {
|
|
28072
|
+
name: "about"
|
|
28073
|
+
})
|
|
28074
|
+
})
|
|
28075
|
+
}), jsx("span", {
|
|
28076
|
+
children: title
|
|
28077
|
+
})]
|
|
28078
|
+
}) : jsx("span", {
|
|
28031
28079
|
children: title
|
|
28032
28080
|
}) : '']
|
|
28033
28081
|
}));
|
|
@@ -29107,7 +29155,7 @@ var SettingsDialog = function SettingsDialog(props) {
|
|
|
29107
29155
|
return jsx(Dialog, {
|
|
29108
29156
|
className: classes$x.settings,
|
|
29109
29157
|
result: function result() {
|
|
29110
|
-
return formState.result;
|
|
29158
|
+
return [formState.result, initState];
|
|
29111
29159
|
},
|
|
29112
29160
|
valid: function valid() {
|
|
29113
29161
|
return formState.valid;
|
|
@@ -29161,8 +29209,20 @@ var mapDispatchToProps$d = function mapDispatchToProps(dispatch, ownProps) {
|
|
|
29161
29209
|
return dispatch(setDefaultSettings());
|
|
29162
29210
|
},
|
|
29163
29211
|
onOk: function onOk(res) {
|
|
29164
|
-
|
|
29165
|
-
|
|
29212
|
+
var _res = _slicedToArray$1(res, 2),
|
|
29213
|
+
result = _res[0],
|
|
29214
|
+
initState = _res[1];
|
|
29215
|
+
dispatch(saveSettings(result));
|
|
29216
|
+
ownProps.onOk(result);
|
|
29217
|
+
var showNotification = initState.reactionComponentMarginSize !== result.reactionComponentMarginSize;
|
|
29218
|
+
showNotification && dispatch(onAction({
|
|
29219
|
+
dialog: 'info-modal',
|
|
29220
|
+
prop: {
|
|
29221
|
+
title: '',
|
|
29222
|
+
customText: 'To fully apply these changes, you need to apply the layout.',
|
|
29223
|
+
button: 'OK'
|
|
29224
|
+
}
|
|
29225
|
+
}));
|
|
29166
29226
|
},
|
|
29167
29227
|
onACSStyle: function onACSStyle(result) {
|
|
29168
29228
|
dispatch(updateFormState({
|
|
@@ -31170,7 +31230,7 @@ function couldBeSaved(struct, format) {
|
|
|
31170
31230
|
if (hasRxnArrow) {
|
|
31171
31231
|
var arrayOfArrows = Array.from(struct.rxnArrows.values());
|
|
31172
31232
|
var rxnArrowMode = arrayOfArrows[0].mode;
|
|
31173
|
-
if (
|
|
31233
|
+
if (![RxnArrowMode.OpenAngle, RxnArrowMode.Retrosynthetic].includes(rxnArrowMode)) {
|
|
31174
31234
|
warnings.push("The ".concat(formatName, " format does not support drawn elements: the reaction ").concat(rxnArrowMode, " arrow will be replaced with the reaction arrow"));
|
|
31175
31235
|
}
|
|
31176
31236
|
}
|
|
@@ -31492,6 +31552,22 @@ var SaveDialog = function (_Component) {
|
|
|
31492
31552
|
})]
|
|
31493
31553
|
});
|
|
31494
31554
|
});
|
|
31555
|
+
_defineProperty$1(_assertThisInitialized$2(_this), "handleCopy", function (event) {
|
|
31556
|
+
var structStr = _this.state.structStr;
|
|
31557
|
+
try {
|
|
31558
|
+
if (isClipboardAPIAvailable()) {
|
|
31559
|
+
navigator.clipboard.writeText(structStr);
|
|
31560
|
+
} else {
|
|
31561
|
+
legacyCopy$1(event.clipboardData, {
|
|
31562
|
+
'text/plain': structStr
|
|
31563
|
+
});
|
|
31564
|
+
event.preventDefault();
|
|
31565
|
+
}
|
|
31566
|
+
} catch (e) {
|
|
31567
|
+
KetcherLogger.error('copyAs.js::copyAs', e);
|
|
31568
|
+
_this.props.editor.errorHandler('This feature is not available in your browser');
|
|
31569
|
+
}
|
|
31570
|
+
});
|
|
31495
31571
|
_defineProperty$1(_assertThisInitialized$2(_this), "renderSaveFile", function () {
|
|
31496
31572
|
var formState = Object.assign({}, _this.props.formState);
|
|
31497
31573
|
delete formState.moleculeErrors;
|
|
@@ -31530,15 +31606,20 @@ var SaveDialog = function (_Component) {
|
|
|
31530
31606
|
};
|
|
31531
31607
|
var PreviewContent = function PreviewContent(_ref3) {
|
|
31532
31608
|
var format = _ref3.format;
|
|
31533
|
-
return
|
|
31609
|
+
return jsxs("div", {
|
|
31534
31610
|
className: classes$l.previewBackground,
|
|
31535
|
-
children: jsx("textarea", {
|
|
31611
|
+
children: [jsx("textarea", {
|
|
31536
31612
|
value: structStr,
|
|
31537
31613
|
className: classes$l.previewArea,
|
|
31538
31614
|
readOnly: true,
|
|
31539
31615
|
ref: _this.textAreaRef,
|
|
31540
31616
|
"data-testid": "".concat(format, "-preview-area-text")
|
|
31541
|
-
})
|
|
31617
|
+
}), jsx(IconButton, {
|
|
31618
|
+
onClick: _this.handleCopy,
|
|
31619
|
+
iconName: "copy",
|
|
31620
|
+
title: "Copy to clipboard",
|
|
31621
|
+
testId: "copy-to-clipboard"
|
|
31622
|
+
})]
|
|
31542
31623
|
});
|
|
31543
31624
|
};
|
|
31544
31625
|
if (isLoading) {
|
|
@@ -33985,12 +34066,12 @@ var PasteErrorModalBody = function PasteErrorModalBody() {
|
|
|
33985
34066
|
var styles = {"infoModal":"InfoModal-module_infoModal__0Vza1","ok":"InfoModal-module_ok__BZ1ar"};
|
|
33986
34067
|
|
|
33987
34068
|
function ErrorInfoModal(props) {
|
|
33988
|
-
var _config$paste$title;
|
|
34069
|
+
var _config$paste$title, _props$title;
|
|
33989
34070
|
var paste = (_config$paste$title = configWithNonViewOnlyActionsDisabled.paste.title) !== null && _config$paste$title !== void 0 ? _config$paste$title : 'Paste';
|
|
33990
34071
|
var isPasteError = props.message === paste;
|
|
33991
34072
|
var defaultCutCopyMessage = "This action is unavailable via menu. Instead, use shortcut to ".concat(props.message, ".");
|
|
33992
34073
|
var headerContent = jsx("div", {
|
|
33993
|
-
children: error.message
|
|
34074
|
+
children: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : error.message
|
|
33994
34075
|
});
|
|
33995
34076
|
return jsx(Dialog, {
|
|
33996
34077
|
className: styles.infoModal,
|
|
@@ -33998,7 +34079,7 @@ function ErrorInfoModal(props) {
|
|
|
33998
34079
|
buttons: [jsx("button", {
|
|
33999
34080
|
onClick: props.onOk,
|
|
34000
34081
|
className: styles.ok,
|
|
34001
|
-
children:
|
|
34082
|
+
children: props.button || 'Close'
|
|
34002
34083
|
}, "ok")],
|
|
34003
34084
|
headerContent: headerContent,
|
|
34004
34085
|
children: jsx("div", {
|
|
@@ -34668,7 +34749,6 @@ var App = function App(props) {
|
|
|
34668
34749
|
checkServer();
|
|
34669
34750
|
dispatch(initFGTemplates());
|
|
34670
34751
|
dispatch(initSaltsAndSolventsTemplates());
|
|
34671
|
-
window.scrollTo(0, 0);
|
|
34672
34752
|
return function () {
|
|
34673
34753
|
dispatch(initLib([]));
|
|
34674
34754
|
dispatch(initSaltsAndSolvents([]));
|
|
@@ -34884,8 +34964,8 @@ var KetcherBuilder = function () {
|
|
|
34884
34964
|
cleanup = initApp(element, appRoot, staticResourcesUrl, {
|
|
34885
34965
|
buttons: buttons || {},
|
|
34886
34966
|
errorHandler: errorHandler || null,
|
|
34887
|
-
version: "2.
|
|
34888
|
-
buildDate: "2024-
|
|
34967
|
+
version: "2.28.0-rc.1" ,
|
|
34968
|
+
buildDate: "2024-12-03T17:11:53" ,
|
|
34889
34969
|
buildNumber: '',
|
|
34890
34970
|
customButtons: customButtons || []
|
|
34891
34971
|
}, structService, resolve, togglerComponent);
|