ketcher-react 2.8.0-rc.3-dev.3 → 2.8.0-rc.5

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 (67) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.css.map +1 -1
  3. package/dist/index.js +2000 -2031
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.modern.js +2024 -2054
  6. package/dist/index.modern.js.map +1 -1
  7. package/dist/script/builders/ketcher/ButtonName.d.ts +1 -1
  8. package/dist/script/editor/Editor.d.ts +1 -1
  9. package/dist/script/editor/shared/utils.d.ts +0 -29
  10. package/dist/script/editor/tool/bond.d.ts +2 -1
  11. package/dist/script/editor/tool/paste.d.ts +0 -5
  12. package/dist/script/editor/tool/select.d.ts +1 -1
  13. package/dist/script/editor/tool/sgroup.d.ts +3 -2
  14. package/dist/script/editor/tool/template.d.ts +2 -4
  15. package/dist/script/ui/Portal/Portal.d.ts +1 -2
  16. package/dist/script/ui/action/action.types.d.ts +1 -1
  17. package/dist/script/ui/action/index.d.ts +9 -21
  18. package/dist/script/ui/action/server.d.ts +2 -10
  19. package/dist/script/ui/action/tools.d.ts +9 -1
  20. package/dist/script/ui/action/zoom.d.ts +0 -2
  21. package/dist/script/ui/component/ContextMenu/ContextMenu.d.ts +3 -0
  22. package/dist/script/ui/data/convert/structconv.d.ts +0 -16
  23. package/dist/script/ui/data/schema/sdata-schema.d.ts +5 -7
  24. package/dist/script/ui/dialog/template/TemplateDialog.d.ts +3 -1
  25. package/dist/script/ui/dialog/template/template-attach.d.ts +1 -1
  26. package/dist/script/ui/dialog/toolbox/enhancedStereo/enhancedStereo.d.ts +3 -1
  27. package/dist/script/ui/dialog/toolbox/sdata.d.ts +19 -0
  28. package/dist/script/ui/dialog/toolbox/sgroup.d.ts +1 -1
  29. package/dist/script/ui/state/constants.d.ts +1 -0
  30. package/dist/script/ui/state/editor/index.d.ts +4 -0
  31. package/dist/script/ui/state/handleHotkeysOverAtom.d.ts +7 -0
  32. package/dist/script/ui/state/modal/form.d.ts +16 -5
  33. package/dist/script/ui/views/components/ContextMenu/ContextMenu.d.ts +1 -0
  34. package/dist/script/ui/views/components/ContextMenu/ContextMenuTrigger.d.ts +2 -2
  35. package/dist/script/ui/views/components/ContextMenu/contextMenu.types.d.ts +7 -15
  36. package/dist/script/ui/views/components/ContextMenu/items/AtomBatchOperations.d.ts +20 -0
  37. package/dist/script/ui/views/components/ContextMenu/items/AtomSingleOperations.d.ts +19 -0
  38. package/dist/script/ui/views/components/ContextMenu/items/BatchDelete.d.ts +3 -0
  39. package/dist/script/ui/views/components/ContextMenu/items/BondBatchOperations.d.ts +20 -0
  40. package/dist/script/ui/views/components/ContextMenu/items/BondSingleOperations.d.ts +19 -0
  41. package/dist/script/ui/views/components/ContextMenu/{utils.d.ts → items/utils.d.ts} +3 -1
  42. package/dist/script/ui/views/components/Dialog/Dialog.d.ts +2 -2
  43. package/dist/script/ui/views/components/StructEditor/InfoPanel.d.ts +3 -1
  44. package/dist/script/ui/views/modal/components/document/Open/Open.container.d.ts +2 -0
  45. package/dist/script/ui/views/modal/components/document/Save/Save.d.ts +0 -1
  46. package/dist/script/ui/views/modal/components/toolbox/Atom/Atom.container.d.ts +2 -0
  47. package/dist/script/ui/views/toolbars/toolbar.types.d.ts +1 -1
  48. package/package.json +10 -9
  49. package/dist/script/editor/tool/helper/dropAndMerge.d.ts +0 -8
  50. package/dist/script/editor/tool/helper/getGroupIdsFromItems.d.ts +0 -12
  51. package/dist/script/editor/tool/helper/getMergeItems.d.ts +0 -2
  52. package/dist/script/ui/dialog/toolbox/SDataFieldset.d.ts +0 -4
  53. package/dist/script/ui/dialog/toolbox/SGroupFieldset.d.ts +0 -4
  54. package/dist/script/ui/state/handleHotkeysOverItem.d.ts +0 -15
  55. package/dist/script/ui/views/components/ContextMenu/hooks/useAtomEdit.d.ts +0 -3
  56. package/dist/script/ui/views/components/ContextMenu/hooks/useAtomStereo.d.ts +0 -3
  57. package/dist/script/ui/views/components/ContextMenu/hooks/useBondEdit.d.ts +0 -3
  58. package/dist/script/ui/views/components/ContextMenu/hooks/useBondSGroupAttach.d.ts +0 -3
  59. package/dist/script/ui/views/components/ContextMenu/hooks/useBondSGroupEdit.d.ts +0 -3
  60. package/dist/script/ui/views/components/ContextMenu/hooks/useBondTypeChange.d.ts +0 -3
  61. package/dist/script/ui/views/components/ContextMenu/hooks/useDelete.d.ts +0 -3
  62. package/dist/script/ui/views/components/ContextMenu/hooks/useFunctionalGroupEoc.d.ts +0 -6
  63. package/dist/script/ui/views/components/ContextMenu/hooks/useFunctionalGroupRemove.d.ts +0 -3
  64. package/dist/script/ui/views/components/ContextMenu/menuItems/AtomMenuItems.d.ts +0 -3
  65. package/dist/script/ui/views/components/ContextMenu/menuItems/BondMenuItems.d.ts +0 -3
  66. package/dist/script/ui/views/components/ContextMenu/menuItems/FunctionalGroupMenuItems.d.ts +0 -3
  67. package/dist/script/ui/views/components/ContextMenu/menuItems/SelectionMenuItems.d.ts +0 -3
@@ -0,0 +1,19 @@
1
+ /****************************************************************************
2
+ * Copyright 2022 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
+ /// <reference types="react" />
17
+ import 'react-contexify/ReactContexify.css';
18
+ declare const BondSingleOperations: React.FC;
19
+ export default BondSingleOperations;
@@ -1,3 +1,5 @@
1
+ import { PredicateParams } from 'react-contexify';
2
+ import { ContextMenuShowProps, ItemData } from '../contextMenu.types';
1
3
  /**
2
4
  * Remove the word `bond` out of the title
3
5
  *
@@ -22,4 +24,4 @@ export declare const queryBondNames: string[];
22
24
  */
23
25
  export declare const getNonQueryBondNames: (tools: any) => string[];
24
26
  export declare const noOperation: () => null;
25
- export declare function onlyHasProperty<T extends object>(checkedObject: T, key: keyof T): boolean;
27
+ export declare const isBatchOperationHidden: ({ props }: PredicateParams<ContextMenuShowProps, ItemData>) => boolean;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
- import { FC, PropsWithChildren, ReactElement } from 'react';
16
+ import { FC, ReactElement } from 'react';
17
17
  interface DialogParamsCallProps {
18
18
  onCancel: () => void;
19
19
  onOk: (result: any) => void;
@@ -40,5 +40,5 @@ interface DialogCallProps {
40
40
  valid?: () => boolean;
41
41
  }
42
42
  declare type Props = DialogProps & DialogCallProps;
43
- declare const Dialog: FC<PropsWithChildren & Props>;
43
+ declare const Dialog: FC<Props>;
44
44
  export default Dialog;
@@ -23,5 +23,7 @@ interface InfoPanelProps {
23
23
  sGroup: SGroup;
24
24
  className?: string;
25
25
  }
26
- declare const _default: import("react-redux").ConnectedComponent<FC<InfoPanelProps>, import("react-redux").Omit<InfoPanelProps, "render" | "clientX" | "clientY" | "groupStruct" | "sGroup">>;
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">>;
27
29
  export default _default;
@@ -20,5 +20,7 @@ declare const OpenContainer: import("react-redux").ConnectedComponent<import("re
20
20
  onImageUpload: (file: File) => void;
21
21
  }>, import("react-redux").Omit<OpenProps & Pick<import("../../../modal.types").BaseProps, "className"> & BaseCallProps & {
22
22
  onImageUpload: (file: File) => void;
23
+ } & {
24
+ children?: import("react").ReactNode;
23
25
  }, "onOk" | "server" | "errorHandler" | "isRecognizeDisabled" | "isAnalyzingFile" | "onImageUpload">>;
24
26
  export default OpenContainer;
@@ -31,7 +31,6 @@ declare class SaveDialog extends Component<any, any, any> {
31
31
  };
32
32
  componentDidMount(): void;
33
33
  isImageFormat: (format: any) => boolean;
34
- isBinaryCdxFormat: (format: any) => boolean;
35
34
  showStructWarningMessage: (format: any) => boolean;
36
35
  changeType: (type: any) => any;
37
36
  changeTab: (index: any) => void;
@@ -18,5 +18,7 @@ declare const AtomContainer: import("react-redux").ConnectedComponent<import("re
18
18
  isMultipleAtoms?: boolean | undefined;
19
19
  }>, import("react-redux").Omit<import("./Atom").AtomProps & {
20
20
  isMultipleAtoms?: boolean | undefined;
21
+ } & {
22
+ children?: import("react").ReactNode;
21
23
  }, "formState">>;
22
24
  export default AtomContainer;
@@ -19,7 +19,7 @@ declare type BottomGroup = 'template-common' | 'template-lib';
19
19
  declare type RightGroup = 'atom' | 'period-table';
20
20
  declare type ToolbarGroupVariant = TopGroup | LeftGroup | BottomGroup | RightGroup;
21
21
  declare type TopToolbarItemVariant = 'clear' | 'open' | 'save' | 'undo' | 'redo' | 'cut' | 'copies' | 'copy' | 'copy-image' | 'copy-mol' | 'copy-ket' | 'paste' | 'zoom-in' | 'zoom-out' | 'zoom-list' | 'layout' | 'clean' | 'arom' | 'dearom' | 'cip' | 'check' | 'analyse' | 'recognize' | 'miew' | 'settings' | 'help' | 'about';
22
- declare type LeftToolbarItemVariant = 'hand' | 'select' | 'select-lasso' | 'select-rectangle' | 'select-fragment' | 'erase' | 'bonds' | 'bond-common' | 'bond-single' | 'bond-double' | 'bond-triple' | 'bond-dative' | 'bond-stereo' | 'bond-up' | 'bond-down' | 'bond-updown' | 'bond-crossed' | 'bond-query' | 'bond-special' | 'bond-any' | 'bond-hydrogen' | 'bond-aromatic' | 'bond-singledouble' | 'bond-singlearomatic' | 'bond-doublearomatic' | 'chain' | 'charge-plus' | 'charge-minus' | 'transforms' | 'transform-rotate' | 'transform-flip-h' | 'transform-flip-v' | 'sgroup' | 'reaction-plus' | 'arrows' | 'reaction-arrow-open-angle' | 'reaction-arrow-filled-triangle' | 'reaction-arrow-filled-bow' | 'reaction-arrow-dashed-open-angle' | 'reaction-arrow-failed' | 'reaction-arrow-both-ends-filled-triangle' | 'reaction-arrow-equilibrium-filled-half-bow' | 'reaction-arrow-equilibrium-filled-triangle' | 'reaction-arrow-equilibrium-open-angle' | 'reaction-arrow-unbalanced-equilibrium-filled-half-bow' | 'reaction-arrow-unbalanced-equilibrium-open-half-angle' | 'reaction-arrow-unbalanced-equilibrium-large-filled-half-bow' | 'reaction-arrow-unbalanced-equilibrium-filled-half-triangle' | 'reaction-arrow-elliptical-arc-arrow-filled-bow' | 'reaction-arrow-elliptical-arc-arrow-filled-triangle' | 'reaction-arrow-elliptical-arc-arrow-open-angle' | 'reaction-arrow-elliptical-arc-arrow-open-half-angle' | 'reaction-mapping-tools' | 'reaction-automap' | 'reaction-map' | 'reaction-unmap' | 'rgroup' | 'rgroup-label' | 'rgroup-fragment' | 'rgroup-attpoints' | 'shapes' | 'shape-ellipse' | 'shape-rectangle' | 'shape-line' | 'text';
22
+ declare type LeftToolbarItemVariant = 'hand' | 'select' | 'select-lasso' | 'select-rectangle' | 'select-fragment' | 'erase' | 'bonds' | 'bond-common' | 'bond-single' | 'bond-double' | 'bond-triple' | 'bond-dative' | 'bond-stereo' | 'bond-up' | 'bond-down' | 'bond-updown' | 'bond-crossed' | 'bond-query' | 'bond-special' | 'bond-any' | 'bond-hydrogen' | 'bond-aromatic' | 'bond-singledouble' | 'bond-singlearomatic' | 'bond-doublearomatic' | 'chain' | 'charge-plus' | 'charge-minus' | 'transforms' | 'transform-rotate' | 'transform-flip-h' | 'transform-flip-v' | 'sgroup' | 'sgroup-data' | 'reaction-plus' | 'arrows' | 'reaction-arrow-open-angle' | 'reaction-arrow-filled-triangle' | 'reaction-arrow-filled-bow' | 'reaction-arrow-dashed-open-angle' | 'reaction-arrow-failed' | 'reaction-arrow-both-ends-filled-triangle' | 'reaction-arrow-equilibrium-filled-half-bow' | 'reaction-arrow-equilibrium-filled-triangle' | 'reaction-arrow-equilibrium-open-angle' | 'reaction-arrow-unbalanced-equilibrium-filled-half-bow' | 'reaction-arrow-unbalanced-equilibrium-open-half-angle' | 'reaction-arrow-unbalanced-equilibrium-large-filled-half-bow' | 'reaction-arrow-unbalanced-equilibrium-filled-half-triangle' | 'reaction-arrow-elliptical-arc-arrow-filled-bow' | 'reaction-arrow-elliptical-arc-arrow-filled-triangle' | 'reaction-arrow-elliptical-arc-arrow-open-angle' | 'reaction-arrow-elliptical-arc-arrow-open-half-angle' | 'reaction-mapping-tools' | 'reaction-automap' | 'reaction-map' | 'reaction-unmap' | 'rgroup' | 'rgroup-label' | 'rgroup-fragment' | 'rgroup-attpoints' | 'shapes' | 'shape-ellipse' | 'shape-rectangle' | 'shape-line' | 'text';
23
23
  declare type BottomToolbarItemVariant = 'template-common' | 'template-lib' | 'enhanced-stereo' | 'fullscreen';
24
24
  declare type RightToolbarItemVariant = 'atom' | 'freq-atoms' | 'period-table' | 'extended-table' | 'any-atom';
25
25
  declare type ToolbarItemVariant = TopToolbarItemVariant | LeftToolbarItemVariant | BottomToolbarItemVariant | RightToolbarItemVariant;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ketcher-react",
3
- "version": "2.8.0-rc.3-dev.3",
3
+ "version": "2.8.0-rc.5",
4
4
  "description": "Web-based molecule sketcher",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "http://lifescience.opensource.epam.com/ketcher",
@@ -41,8 +41,8 @@
41
41
  "stylelint:fix": "stylelint \"./**/*.{css,less}\" --formatter verbose --fix"
42
42
  },
43
43
  "peerDependencies": {
44
- "react": "^18.2.0",
45
- "react-dom": "^18.2.0"
44
+ "react": "^17.0.2",
45
+ "react-dom": "^17.0.2"
46
46
  },
47
47
  "dependencies": {
48
48
  "@babel/runtime": "^7.17.9",
@@ -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": "*",
61
+ "ketcher-core": "workspace:*",
62
62
  "lodash": "^4.17.21",
63
63
  "miew-react": "^1.0.0",
64
64
  "react-colorful": "^5.4.0",
65
65
  "react-contexify": "^6.0.0",
66
+ "react-contextmenu": "^2.14.0",
66
67
  "react-device-detect": "^2.2.2",
67
68
  "react-dropzone": "^11.7.1",
68
69
  "react-intersection-observer": "^8.32.1",
@@ -94,15 +95,15 @@
94
95
  "@rollup/plugin-replace": "^2.3.4",
95
96
  "@rollup/plugin-strip": "^2.0.0",
96
97
  "@svgr/rollup": "^5.4.0",
97
- "@testing-library/jest-dom": "5.16.5",
98
- "@testing-library/react": "13.4.0",
99
- "@testing-library/user-event": "14.4.3",
98
+ "@testing-library/jest-dom": "^4.2.4",
99
+ "@testing-library/react": "^9.5.0",
100
+ "@testing-library/user-event": "^7.2.1",
100
101
  "@types/draft-js": "^0.11.7",
101
102
  "@types/jest": "^27.0.3",
102
103
  "@types/lodash": "^4.14.178",
103
104
  "@types/node": "^16.11.12",
104
- "@types/react": "^18.0.25",
105
- "@types/react-dom": "^18.0.8",
105
+ "@types/react": "^17.0.37",
106
+ "@types/react-dom": "^17.0.11",
106
107
  "@typescript-eslint/eslint-plugin": "^5.6.0",
107
108
  "@typescript-eslint/parser": "^5.6.0",
108
109
  "autoprefixer": "^10.2.5",
@@ -1,8 +0,0 @@
1
- import { Action } from 'ketcher-core';
2
- import Editor from '../../Editor';
3
- declare type MergeItems = {
4
- atoms: Map<number, number>;
5
- bonds: Map<number, number>;
6
- };
7
- export declare function dropAndMerge(editor: Editor, mergeItems: MergeItems, action?: Action): void;
8
- export {};
@@ -1,12 +0,0 @@
1
- import { Struct } from 'ketcher-core';
2
- declare type Items = {
3
- atoms?: number[];
4
- bonds?: number[];
5
- };
6
- declare function getGroupIdsFromItemArrays(struct: Struct, items?: Items): number[];
7
- declare type MergeItems = {
8
- atoms: Map<number, number>;
9
- bonds: Map<number, number>;
10
- };
11
- declare function getGroupIdsFromItemMaps(struct: Struct, mergeMaps: MergeItems | null): number[];
12
- export { getGroupIdsFromItemArrays, getGroupIdsFromItemMaps };
@@ -1,2 +0,0 @@
1
- import Editor from '../../Editor';
2
- export declare function getMergeItems(editor: Editor, items: Record<string, number[]>): Record<string, Map<unknown, unknown>> | null;
@@ -1,4 +0,0 @@
1
- export default SDataFieldset;
2
- declare function SDataFieldset({ formState }: {
3
- formState: any;
4
- }): JSX.Element;
@@ -1,4 +0,0 @@
1
- export default SGroupFieldset;
2
- declare function SGroupFieldset({ formState }: {
3
- formState: any;
4
- }): JSX.Element;
@@ -1,15 +0,0 @@
1
- import { Dispatch } from 'redux';
2
- import { Editor } from '../../editor';
3
- declare type TNewAction = {
4
- tool?: string;
5
- dialog?: string;
6
- opts?: any;
7
- };
8
- declare type HandleHotkeyOverItemProps = {
9
- hoveredItem: Record<string, number>;
10
- newAction: TNewAction;
11
- editor: Editor;
12
- dispatch: Dispatch;
13
- };
14
- export declare function handleHotkeyOverItem(props: HandleHotkeyOverItemProps): void;
15
- export {};
@@ -1,3 +0,0 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useAtomEdit: () => readonly [({ props }: ItemEventParams) => Promise<void>, ({ props }: ItemEventParams) => boolean];
3
- export default useAtomEdit;
@@ -1,3 +0,0 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useAtomStereo: () => readonly [({ props }: ItemEventParams) => Promise<void>, ({ props }: ItemEventParams) => boolean];
3
- export default useAtomStereo;
@@ -1,3 +0,0 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useBondEdit: () => readonly [({ props }: ItemEventParams) => Promise<void>, ({ props }: ItemEventParams) => boolean];
3
- export default useBondEdit;
@@ -1,3 +0,0 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useBondSGroupAttach: () => readonly [({ props }: ItemEventParams) => void, ({ props }: ItemEventParams) => boolean];
3
- export default useBondSGroupAttach;
@@ -1,3 +0,0 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useBondSGroupEdit: () => readonly [() => void, ({ props }: ItemEventParams) => boolean, () => boolean];
3
- export default useBondSGroupEdit;
@@ -1,3 +0,0 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useBondTypeChange: () => readonly [({ id, props }: ItemEventParams) => void, ({ props }: ItemEventParams) => boolean];
3
- export default useBondTypeChange;
@@ -1,3 +0,0 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useDelete: () => ({ props }: ItemEventParams) => Promise<void>;
3
- export default useDelete;
@@ -1,6 +0,0 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- /**
3
- * Fullname: useFunctionalGroupExpandOrContract
4
- */
5
- declare const useFunctionalGroupEoc: () => readonly [({ props }: ItemEventParams, toExpand: boolean) => void, ({ props }: ItemEventParams, toExpand: boolean) => boolean];
6
- export default useFunctionalGroupEoc;
@@ -1,3 +0,0 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useFunctionalGroupRemove: () => ({ props }: ItemEventParams) => void;
3
- export default useFunctionalGroupRemove;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const AtomMenuItems: React.FC;
3
- export default AtomMenuItems;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const BondMenuItems: React.FC;
3
- export default BondMenuItems;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const FunctionalGroupMenuItems: React.FC;
3
- export default FunctionalGroupMenuItems;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const SelectionMenuItems: React.FC;
3
- export default SelectionMenuItems;