diff --git a/packages/ketcher-core/src/application/editor/editor.types.ts b/packages/ketcher-core/src/application/editor/editor.types.ts index 14c41772f6..f39e4be9a3 100644 --- a/packages/ketcher-core/src/application/editor/editor.types.ts +++ b/packages/ketcher-core/src/application/editor/editor.types.ts @@ -64,6 +64,8 @@ export interface Editor { message: Subscription; elementEdit: PipelineSubscription; bondEdit: PipelineSubscription; + zoomIn: PipelineSubscription; + zoomOut: PipelineSubscription; rgroupEdit: PipelineSubscription; sgroupEdit: PipelineSubscription; sdataEdit: PipelineSubscription; diff --git a/packages/ketcher-react/src/script/editor/Editor.ts b/packages/ketcher-react/src/script/editor/Editor.ts index a8b7bfbec8..0ad38eb80f 100644 --- a/packages/ketcher-react/src/script/editor/Editor.ts +++ b/packages/ketcher-react/src/script/editor/Editor.ts @@ -133,6 +133,8 @@ class Editor implements KetcherEditor { event: { message: Subscription; elementEdit: PipelineSubscription; + zoomIn: PipelineSubscription; + zoomOut: PipelineSubscription; bondEdit: PipelineSubscription; rgroupEdit: PipelineSubscription; sgroupEdit: PipelineSubscription; @@ -188,6 +190,8 @@ class Editor implements KetcherEditor { message: new Subscription(), elementEdit: new PipelineSubscription(), bondEdit: new PipelineSubscription(), + zoomIn: new PipelineSubscription(), + zoomOut: new PipelineSubscription(), rgroupEdit: new PipelineSubscription(), sgroupEdit: new PipelineSubscription(), sdataEdit: new PipelineSubscription(), diff --git a/packages/ketcher-react/src/script/ui/App/App.tsx b/packages/ketcher-react/src/script/ui/App/App.tsx index 1fce9c5f2b..4918c25bac 100644 --- a/packages/ketcher-react/src/script/ui/App/App.tsx +++ b/packages/ketcher-react/src/script/ui/App/App.tsx @@ -26,7 +26,7 @@ import { createTheme, ThemeProvider } from '@mui/material'; import AppClipArea from '../views/AppClipArea'; import { AppHiddenContainer } from './AppHidden'; import AppModalContainer from '../views/modal'; -import Editor from '../views/Editor'; +import ConnectedEditor from '../views/Editor'; import classes from './App.module.less'; import { initFGTemplates } from '../state/functionalGroups'; import { initSaltsAndSolventsTemplates } from '../state/saltsAndSolvents'; @@ -62,6 +62,9 @@ const App = (props: Props) => { window.scrollTo(0, 0); }, []); + // Temporary workaround: add proper types for Editor + const Editor = ConnectedEditor as React.ComponentType<{ className: string }>; + return (
diff --git a/packages/ketcher-react/src/script/ui/state/editor/index.js b/packages/ketcher-react/src/script/ui/state/editor/index.js index 92f0903fbd..0cb42081cc 100644 --- a/packages/ketcher-react/src/script/ui/state/editor/index.js +++ b/packages/ketcher-react/src/script/ui/state/editor/index.js @@ -229,5 +229,8 @@ export default function initEditor(dispatch, getState) { dispatch(updateFloatingTools(payload)); }, ), + + onZoomIn: updateAction, + onZoomOut: updateAction, }; } diff --git a/packages/ketcher-react/src/script/ui/views/Editor.jsx b/packages/ketcher-react/src/script/ui/views/Editor.jsx index a9e0887c73..e0c68bf8fe 100644 --- a/packages/ketcher-react/src/script/ui/views/Editor.jsx +++ b/packages/ketcher-react/src/script/ui/views/Editor.jsx @@ -31,7 +31,7 @@ const mapDispatchToProps = (dispatch) => { return { onZoomIn, onZoomOut, - ...initEditor(dispatch), + ...dispatch(initEditor), }; }; diff --git a/packages/ketcher-react/src/script/ui/views/components/StructEditor/StructEditor.jsx b/packages/ketcher-react/src/script/ui/views/components/StructEditor/StructEditor.jsx index eed121b2db..255f28bdbb 100644 --- a/packages/ketcher-react/src/script/ui/views/components/StructEditor/StructEditor.jsx +++ b/packages/ketcher-react/src/script/ui/views/components/StructEditor/StructEditor.jsx @@ -224,6 +224,8 @@ class StructEditor extends Component { onEnhancedStereoEdit, onQuickEdit, onBondEdit, + onZoomIn, + onZoomOut, onRgroupEdit, onSgroupEdit, onRemoveFG,