ketcher-react 2.28.0-dev.1 → 2.28.0-rc.2
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 +193 -147
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +194 -148
- 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';
|
|
@@ -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.28.0-
|
|
3740
|
+
return (_window$open = window.open("https://github.com/epam/ketcher/blob/".concat("v2.28.0-rc.2\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:
|
|
@@ -31526,6 +31552,22 @@ var SaveDialog = function (_Component) {
|
|
|
31526
31552
|
})]
|
|
31527
31553
|
});
|
|
31528
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
|
+
});
|
|
31529
31571
|
_defineProperty$1(_assertThisInitialized$2(_this), "renderSaveFile", function () {
|
|
31530
31572
|
var formState = Object.assign({}, _this.props.formState);
|
|
31531
31573
|
delete formState.moleculeErrors;
|
|
@@ -31564,15 +31606,20 @@ var SaveDialog = function (_Component) {
|
|
|
31564
31606
|
};
|
|
31565
31607
|
var PreviewContent = function PreviewContent(_ref3) {
|
|
31566
31608
|
var format = _ref3.format;
|
|
31567
|
-
return
|
|
31609
|
+
return jsxs("div", {
|
|
31568
31610
|
className: classes$l.previewBackground,
|
|
31569
|
-
children: jsx("textarea", {
|
|
31611
|
+
children: [jsx("textarea", {
|
|
31570
31612
|
value: structStr,
|
|
31571
31613
|
className: classes$l.previewArea,
|
|
31572
31614
|
readOnly: true,
|
|
31573
31615
|
ref: _this.textAreaRef,
|
|
31574
31616
|
"data-testid": "".concat(format, "-preview-area-text")
|
|
31575
|
-
})
|
|
31617
|
+
}), jsx(IconButton, {
|
|
31618
|
+
onClick: _this.handleCopy,
|
|
31619
|
+
iconName: "copy",
|
|
31620
|
+
title: "Copy to clipboard",
|
|
31621
|
+
testId: "copy-to-clipboard"
|
|
31622
|
+
})]
|
|
31576
31623
|
});
|
|
31577
31624
|
};
|
|
31578
31625
|
if (isLoading) {
|
|
@@ -34702,7 +34749,6 @@ var App = function App(props) {
|
|
|
34702
34749
|
checkServer();
|
|
34703
34750
|
dispatch(initFGTemplates());
|
|
34704
34751
|
dispatch(initSaltsAndSolventsTemplates());
|
|
34705
|
-
window.scrollTo(0, 0);
|
|
34706
34752
|
return function () {
|
|
34707
34753
|
dispatch(initLib([]));
|
|
34708
34754
|
dispatch(initSaltsAndSolvents([]));
|
|
@@ -34918,8 +34964,8 @@ var KetcherBuilder = function () {
|
|
|
34918
34964
|
cleanup = initApp(element, appRoot, staticResourcesUrl, {
|
|
34919
34965
|
buttons: buttons || {},
|
|
34920
34966
|
errorHandler: errorHandler || null,
|
|
34921
|
-
version: "2.28.0-
|
|
34922
|
-
buildDate: "2024-
|
|
34967
|
+
version: "2.28.0-rc.2" ,
|
|
34968
|
+
buildDate: "2024-12-10T18:48:53" ,
|
|
34923
34969
|
buildNumber: '',
|
|
34924
34970
|
customButtons: customButtons || []
|
|
34925
34971
|
}, structService, resolve, togglerComponent);
|