ketcher-react 2.6.3 → 2.7.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.
Files changed (29) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.css.map +1 -1
  3. package/dist/index.js +966 -505
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.modern.js +967 -506
  6. package/dist/index.modern.js.map +1 -1
  7. package/dist/script/editor/Editor.d.ts +3 -1
  8. package/dist/script/editor/tool/atom.d.ts +2 -0
  9. package/dist/script/editor/tool/select.d.ts +6 -0
  10. package/dist/script/ui/action/atoms.d.ts +9 -0
  11. package/dist/script/ui/component/form/input.d.ts +2 -1
  12. package/dist/script/ui/component/structrender.d.ts +4 -1
  13. package/dist/script/ui/data/schema/sdata-schema.d.ts +1 -1
  14. package/dist/script/ui/dialog/template/TemplateDialog.d.ts +3 -11
  15. package/dist/script/ui/dialog/template/TemplateTable.d.ts +2 -2
  16. package/dist/script/ui/state/editor/index.d.ts +1 -0
  17. package/dist/script/ui/state/functionalGroups/index.d.ts +2 -0
  18. package/dist/script/ui/state/functionalGroups/selectors/index.d.ts +1 -0
  19. package/dist/script/ui/state/hotkeys.d.ts +19 -8
  20. package/dist/script/ui/state/modal/sdata.d.ts +1 -1
  21. package/dist/script/ui/state/options/index.d.ts +1 -0
  22. package/dist/script/ui/state/saltsAndSolvents/index.d.ts +23 -0
  23. package/dist/script/ui/state/saltsAndSolvents/selectors/index.d.ts +16 -0
  24. package/dist/script/ui/utils/index.d.ts +1 -1
  25. package/dist/script/ui/views/Editor.d.ts +1 -1
  26. package/dist/script/ui/views/components/StructEditor/InfoPanel.d.ts +29 -0
  27. package/dist/script/ui/views/components/StructEditor/StructEditor.d.ts +2 -0
  28. package/dist/script/ui/views/modal/components/document/Save/Save.d.ts +1 -1
  29. package/package.json +3 -2
@@ -32,6 +32,7 @@ declare class Editor implements KetcherEditor {
32
32
  historyPtr: any;
33
33
  errorHandler: ((message: string) => void) | null;
34
34
  highlights: Highlighter;
35
+ hoverIcon: any;
35
36
  event: {
36
37
  message: Subscription;
37
38
  elementEdit: PipelineSubscription;
@@ -48,6 +49,7 @@ declare class Editor implements KetcherEditor {
48
49
  dearomatizeStruct: PipelineSubscription;
49
50
  enhancedStereoEdit: PipelineSubscription;
50
51
  confirm: PipelineSubscription;
52
+ showInfo: PipelineSubscription;
51
53
  cursor: Subscription;
52
54
  };
53
55
  lastEvent: any;
@@ -63,7 +65,7 @@ declare class Editor implements KetcherEditor {
63
65
  options(value?: any): any;
64
66
  zoom(value?: any): any;
65
67
  selection(ci?: any): Selection | null;
66
- hover(ci: any, newTool?: any): void;
68
+ hover(ci: any, newTool?: any, event?: PointerEvent): void;
67
69
  update(action: Action | true, ignoreHistory?: any): void;
68
70
  historySize(): {
69
71
  undo: any;
@@ -22,6 +22,8 @@ declare class AtomTool {
22
22
  isNotActiveTool: boolean | undefined;
23
23
  constructor(editor: any, atomProps: any);
24
24
  mousedown(event: any): void;
25
+ mouseleave(): void;
26
+ mouseover(): void;
25
27
  mousemove(event: any): void;
26
28
  mouseup(event: any): void;
27
29
  }
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
+ import { ReSGroup } from 'ketcher-core';
16
17
  import { Editor } from '../Editor';
17
18
  declare class SelectTool {
18
19
  #private;
@@ -24,6 +25,11 @@ declare class SelectTool {
24
25
  mouseup(event: any): boolean;
25
26
  dblclick(event: any): true | undefined;
26
27
  mouseleave(_: any): void;
28
+ selectElementsOnCanvas(elements: {
29
+ atoms: number[];
30
+ bonds: number[];
31
+ }, editor: Editor, event: any): void;
32
+ isDraggingStructureOnSaltOrSolvent(dragCtx: any, sgroups: Map<number, ReSGroup>): any;
27
33
  }
28
34
  export declare function selMerge(selection: any, add: any, reversible: boolean): any;
29
35
  export default SelectTool;
@@ -26,6 +26,15 @@ export namespace atomCuts {
26
26
  const Br: string;
27
27
  const I: string;
28
28
  const A: string;
29
+ const Q: string;
30
+ const R: string;
31
+ const K: string;
32
+ const M: string;
33
+ const Si: string;
34
+ const Na: string;
35
+ const X: string;
36
+ const D: string;
37
+ const B: string;
29
38
  }
30
39
  declare var _default: {};
31
40
  export default _default;
@@ -1,9 +1,10 @@
1
- export function GenericInput({ schema, value, onChange, type, ...props }: {
1
+ export function GenericInput({ schema, value, onChange, type, isFocused, ...props }: {
2
2
  [x: string]: any;
3
3
  schema: any;
4
4
  value?: string | undefined;
5
5
  onChange: any;
6
6
  type?: string | undefined;
7
+ isFocused?: boolean | undefined;
7
8
  }): JSX.Element;
8
9
  export namespace GenericInput {
9
10
  function val(ev: any, schema: any): any;
@@ -18,13 +18,16 @@ import { Struct } from 'ketcher-core';
18
18
  interface StructRenderProps {
19
19
  struct: Struct;
20
20
  options: any;
21
+ id?: any;
21
22
  Tag?: string | ComponentType<any>;
22
23
  }
23
24
  declare class StructRender extends Component<StructRenderProps> {
24
25
  tagRef: React.RefObject<HTMLElement>;
25
26
  constructor(props: any);
26
- shouldComponentUpdate(): boolean;
27
+ shouldComponentUpdate(previousProps: any): boolean;
28
+ update(): void;
27
29
  componentDidMount(): void;
30
+ componentDidUpdate(): void;
28
31
  render(): JSX.Element;
29
32
  }
30
33
  export default StructRender;
@@ -7,7 +7,7 @@
7
7
  * @param fieldName? { string }
8
8
  * @returns { string }
9
9
  */
10
- export function getSdataDefault(context: any, fieldName: any): string;
10
+ export function getSdataDefault(schema: {} | undefined, context: any, fieldName: any): string;
11
11
  export namespace sdataCustomSchema {
12
12
  const key: string;
13
13
  const type: string;
@@ -15,7 +15,6 @@
15
15
  ***************************************************************************/
16
16
  import { FC } from 'react';
17
17
  import { Template } from './TemplateTable';
18
- import { Struct } from 'ketcher-core';
19
18
  interface TemplateLibProps {
20
19
  filter: string;
21
20
  group: string;
@@ -23,6 +22,7 @@ interface TemplateLibProps {
23
22
  selected: Template;
24
23
  mode: string;
25
24
  initialTab: number;
25
+ saltsAndSolvents: Template[];
26
26
  }
27
27
  interface TemplateLibCallProps {
28
28
  onAttach: (tmpl: Template) => void;
@@ -32,18 +32,10 @@ interface TemplateLibCallProps {
32
32
  onFilter: (filter: string) => void;
33
33
  onOk: (res: any) => void;
34
34
  onSelect: (res: any) => void;
35
- functionalGroups: (Template & {
36
- modifiedStruct: Struct;
37
- })[];
35
+ functionalGroups: Template[];
38
36
  }
39
37
  declare type Props = TemplateLibProps & TemplateLibCallProps;
40
- export interface Result {
41
- struct: Struct;
42
- aid: number | null;
43
- bid: number | null;
44
- mode: string;
45
- }
46
38
  declare const _default: import("react-redux").ConnectedComponent<FC<Props>, import("react-redux").Omit<TemplateLibProps & TemplateLibCallProps & {
47
39
  children?: import("react").ReactNode;
48
- }, "initialTab" | "functionalGroups" | "onFilter" | "onSelect" | "onChangeGroup" | "onAttach" | "onDelete" | "onOk">>;
40
+ }, "onFilter" | "onSelect" | "onChangeGroup" | "onAttach" | "onDelete" | "initialTab" | "functionalGroups" | "saltsAndSolvents"> & TemplateLibProps & TemplateLibCallProps>;
49
41
  export default _default;
@@ -17,12 +17,13 @@ import { FC } from 'react';
17
17
  import { Struct } from 'ketcher-core';
18
18
  export interface Template {
19
19
  struct: Struct;
20
- modifiedStruct?: Struct;
21
20
  props: {
22
21
  atomid: number;
23
22
  bondid: number;
24
23
  group: string;
25
24
  prerender?: string;
25
+ abbreviation: string;
26
+ name: string;
26
27
  };
27
28
  }
28
29
  interface TemplateTableProps {
@@ -32,7 +33,6 @@ interface TemplateTableProps {
32
33
  onDelete?: (tmpl: Template) => void;
33
34
  onAttach?: (tmpl: Template) => void;
34
35
  titleRows?: 1 | 2;
35
- onDoubleClick: (tmpl: Template) => void;
36
36
  }
37
37
  declare const TemplateTable: FC<TemplateTableProps>;
38
38
  export default TemplateTable;
@@ -23,4 +23,5 @@ export default function initEditor(dispatch: any, getState: any): {
23
23
  onDearomatizeStruct: (struct: any) => any;
24
24
  onMouseDown: () => void;
25
25
  onConfirm: () => Promise<any>;
26
+ onShowInfo: (payload: any) => void;
26
27
  };
@@ -16,8 +16,10 @@
16
16
  import { AnyAction } from 'redux';
17
17
  interface FGState {
18
18
  lib: [];
19
+ functionalGroupInfo: any;
19
20
  mode: string;
20
21
  }
21
22
  declare const functionalGroupsReducer: (state: FGState | undefined, { type, payload }: AnyAction) => any;
23
+ export declare function highlightFG(dispatch: any, group: any): void;
22
24
  export declare function initFGTemplates(baseUrl: string): (dispatch: any) => Promise<void>;
23
25
  export default functionalGroupsReducer;
@@ -14,4 +14,5 @@
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
16
  export declare const functionalGroupsSelector: (state: any) => any;
17
+ export declare const functionGroupInfoSelector: (state: any) => any;
17
18
  export declare const modeSelector: (state: any) => any;
@@ -1,12 +1,23 @@
1
- export function initKeydownListener(element: any): (dispatch: any, getState: any) => void;
2
- export function initClipboard(dispatch: any, getState: any): {
1
+ /****************************************************************************
2
+ * Copyright 2021 EPAM Systems
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ ***************************************************************************/
16
+ export declare function initKeydownListener(element: any): (dispatch: any, getState: any) => void;
17
+ export declare function initClipboard(dispatch: any): {
3
18
  formats: any[];
4
19
  focused(): boolean;
5
- onCut(): {
6
- 'text/plain': string;
7
- } | null;
8
- onCopy(): {
9
- 'text/plain': string;
10
- } | null;
20
+ onCut(): {} | null;
21
+ onCopy(): {} | null;
11
22
  onPaste(data: any): void;
12
23
  };
@@ -3,7 +3,7 @@ export function sdataReducer(state: any, action: any): {
3
3
  valid: any;
4
4
  errors: any;
5
5
  };
6
- export function initSdata(): {
6
+ export function initSdata(schema: any): {
7
7
  errors: {};
8
8
  valid: boolean;
9
9
  result: {
@@ -43,6 +43,7 @@ export namespace initOptionsState {
43
43
  const server: boolean;
44
44
  const templates: boolean;
45
45
  const functionalGroups: boolean;
46
+ const saltsAndSolvents: boolean;
46
47
  }
47
48
  namespace analyse {
48
49
  const values: null;
@@ -0,0 +1,23 @@
1
+ /****************************************************************************
2
+ * Copyright 2021 EPAM Systems
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ ***************************************************************************/
16
+ import { AnyAction } from 'redux';
17
+ interface SaltsAndSolventsState {
18
+ lib: [];
19
+ mode: string;
20
+ }
21
+ declare const saltsAndSolventsReducer: (state: SaltsAndSolventsState | undefined, { type, payload }: AnyAction) => any;
22
+ export declare function initSaltsAndSolventsTemplates(baseUrl: string): (dispatch: any) => Promise<void>;
23
+ export default saltsAndSolventsReducer;
@@ -0,0 +1,16 @@
1
+ /****************************************************************************
2
+ * Copyright 2021 EPAM Systems
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ ***************************************************************************/
16
+ export declare const saltsAndSolventsSelector: (state: any) => any;
@@ -1,6 +1,6 @@
1
1
  import { Option } from '../component/form/Select';
2
2
  export declare function greekify(str: string): string;
3
- export declare function filterLib(lib: any, filter: any): {};
3
+ export declare function filterLib(lib: any, filter: string): {};
4
4
  export declare function filterFGLib(lib: any, filter: any): {};
5
5
  export { fileOpener } from './fileOpener';
6
6
  export declare const getSelectOptionsFromSchema: (schema: any) => Array<Option>;
@@ -1,3 +1,3 @@
1
1
  export default Editor;
2
- declare const Editor: import("react-redux").ConnectedComponent<typeof StructEditor, import("react-redux").Omit<any, "options" | "type" | "indigoVerification">>;
2
+ declare const Editor: import("react-redux").ConnectedComponent<typeof StructEditor, import("react-redux").Omit<any, "type" | "indigoVerification" | "options">>;
3
3
  import { StructEditor } from "./components";
@@ -0,0 +1,29 @@
1
+ /****************************************************************************
2
+ * Copyright 2021 EPAM Systems
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ ***************************************************************************/
16
+ import { FC } from 'react';
17
+ import { Render, Struct, SGroup } from 'ketcher-core';
18
+ interface InfoPanelProps {
19
+ clientX: number;
20
+ clientY: number;
21
+ render: Render;
22
+ groupStruct: Struct;
23
+ sGroup: SGroup;
24
+ className?: string;
25
+ }
26
+ declare const _default: import("react-redux").ConnectedComponent<FC<InfoPanelProps>, import("react-redux").Omit<InfoPanelProps & {
27
+ children?: import("react").ReactNode;
28
+ }, "render" | "clientX" | "clientY" | "groupStruct" | "sGroup">>;
29
+ export default _default;
@@ -3,6 +3,8 @@ declare class StructEditor extends Component<any, any, any> {
3
3
  constructor(props: any);
4
4
  state: {
5
5
  enableCursor: boolean;
6
+ clientX: number;
7
+ clientY: number;
6
8
  };
7
9
  editorRef: import("react").RefObject<any>;
8
10
  logRef: import("react").RefObject<any>;
@@ -1,5 +1,5 @@
1
1
  export default Save;
2
- declare const Save: import("react-redux").ConnectedComponent<typeof SaveDialog, import("react-redux").Omit<any, "formState" | "options" | "server" | "struct" | "checkState" | "onCheck" | "moleculeErrors" | "onTmplSave" | "onResetForm">>;
2
+ declare const Save: import("react-redux").ConnectedComponent<typeof SaveDialog, import("react-redux").Omit<any, "options" | "server" | "formState" | "struct" | "checkState" | "onCheck" | "moleculeErrors" | "onTmplSave" | "onResetForm">>;
3
3
  declare class SaveDialog extends Component<any, any, any> {
4
4
  static contextType: import("react").Context<import("../../../../../../../contexts").IErrorsContext>;
5
5
  constructor(props: any);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ketcher-react",
3
- "version": "2.6.3",
3
+ "version": "2.7.0-rc.2",
4
4
  "description": "Web-based molecule sketcher",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "http://lifescience.opensource.epam.com/ketcher",
@@ -58,11 +58,12 @@
58
58
  "font-face-observer": "^1.0.0",
59
59
  "hoist-non-react-statics": "^3.3.2",
60
60
  "intersection-observer": "^0.12.0",
61
- "ketcher-core": "2.6.3",
61
+ "ketcher-core": "2.7.0-rc.2",
62
62
  "lodash": "^4.17.21",
63
63
  "miew-react": "^1.0.0",
64
64
  "react-colorful": "^5.4.0",
65
65
  "react-contextmenu": "^2.14.0",
66
+ "react-device-detect": "^2.2.2",
66
67
  "react-dropzone": "^11.7.1",
67
68
  "react-intersection-observer": "^8.32.1",
68
69
  "react-redux": "^7.2.1",