ketcher-react 2.10.0-rc.6 → 2.11.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 +2394 -2100
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2396 -2100
- package/dist/index.modern.js.map +1 -1
- package/dist/script/editor/Editor.d.ts +3 -0
- package/dist/script/editor/tool/helper/dropAndMerge.d.ts +1 -7
- package/dist/script/editor/tool/rotate-controller.d.ts +46 -0
- package/dist/script/editor/tool/rotate-controller.test.d.ts +1 -0
- package/dist/script/editor/tool/rotate.d.ts +10 -2
- package/dist/script/editor/tool/select.d.ts +1 -1
- package/dist/script/editor/tool/template.d.ts +1 -1
- package/dist/script/editor/utils/functionalGroupsTooltip.d.ts +6 -2
- package/dist/script/ui/component/form/Input/Input.test.d.ts +1 -0
- package/dist/script/ui/component/view/SaveButton.test.d.ts +16 -0
- package/dist/script/ui/component/view/savebutton.d.ts +1 -0
- package/dist/script/ui/state/saltsAndSolvents/index.d.ts +1 -1
- package/dist/script/ui/views/Editor.d.ts +1 -1
- package/dist/script/ui/views/components/ContextMenu/contextMenu.types.d.ts +23 -1
- package/dist/script/ui/views/components/ContextMenu/menuItems/AtomMenuItems.d.ts +3 -2
- package/dist/script/ui/views/components/ContextMenu/menuItems/BondMenuItems.d.ts +3 -2
- package/dist/script/ui/views/components/ContextMenu/menuItems/FunctionalGroupMenuItems.d.ts +3 -2
- package/dist/script/ui/views/components/ContextMenu/menuItems/SelectionMenuItems.d.ts +3 -2
- package/dist/script/ui/views/components/ContextMenu/utils.d.ts +1 -1
- package/dist/script/ui/views/components/ContextMenu/utils.test.d.ts +1 -0
- package/dist/setupTests.d.ts +1 -0
- package/package.json +1 -1
- /package/dist/script/ui/component/form/{input.d.ts → Input/Input.d.ts} +0 -0
|
@@ -18,12 +18,14 @@ import { PipelineSubscription, Subscription } from 'subscription';
|
|
|
18
18
|
import { Highlighter } from './highlighter';
|
|
19
19
|
import { contextMenuInfo } from '../ui/views/components/ContextMenu/contextMenu.types';
|
|
20
20
|
import { HoverIcon } from './HoverIcon';
|
|
21
|
+
import RotateController from './tool/rotate-controller';
|
|
21
22
|
export interface Selection {
|
|
22
23
|
atoms?: Array<number>;
|
|
23
24
|
bonds?: Array<number>;
|
|
24
25
|
enhancedFlags?: Array<number>;
|
|
25
26
|
rxnPluses?: Array<number>;
|
|
26
27
|
rxnArrows?: Array<number>;
|
|
28
|
+
texts?: Array<number>;
|
|
27
29
|
}
|
|
28
30
|
declare class Editor implements KetcherEditor {
|
|
29
31
|
#private;
|
|
@@ -40,6 +42,7 @@ declare class Editor implements KetcherEditor {
|
|
|
40
42
|
y: number;
|
|
41
43
|
};
|
|
42
44
|
contextMenu: contextMenuInfo;
|
|
45
|
+
rotateController: RotateController;
|
|
43
46
|
event: {
|
|
44
47
|
message: Subscription;
|
|
45
48
|
elementEdit: PipelineSubscription;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { Action } from 'ketcher-core';
|
|
2
2
|
import Editor from '../../Editor';
|
|
3
|
-
declare
|
|
4
|
-
atoms: Map<number, number>;
|
|
5
|
-
bonds: Map<number, number>;
|
|
6
|
-
atomToFunctionalGroup?: Map<number, number>;
|
|
7
|
-
};
|
|
8
|
-
export declare function dropAndMerge(editor: Editor, mergeItems: MergeItems, action?: Action, resizeCanvas?: boolean): Action;
|
|
9
|
-
export {};
|
|
3
|
+
export declare function dropAndMerge(editor: Editor, mergeItems: any, action?: Action, resizeCanvas?: boolean): Action;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import Editor from '../Editor';
|
|
2
|
+
declare class RotateController {
|
|
3
|
+
private editor;
|
|
4
|
+
private rotateTool;
|
|
5
|
+
private originalCenter;
|
|
6
|
+
private normalizedCenterInitialHandleVec;
|
|
7
|
+
private handleCenter;
|
|
8
|
+
private initialRadius;
|
|
9
|
+
private isRotating;
|
|
10
|
+
private isMovingCenter;
|
|
11
|
+
private handle?;
|
|
12
|
+
private boundingRect?;
|
|
13
|
+
private cross?;
|
|
14
|
+
private link?;
|
|
15
|
+
private protractor?;
|
|
16
|
+
private rotateArc?;
|
|
17
|
+
constructor(editor: Editor);
|
|
18
|
+
private init;
|
|
19
|
+
private get render();
|
|
20
|
+
private get paper();
|
|
21
|
+
private get center();
|
|
22
|
+
rerender(): void;
|
|
23
|
+
clean(): void;
|
|
24
|
+
private isPartOfFragmentSelected;
|
|
25
|
+
private show;
|
|
26
|
+
private drawCross;
|
|
27
|
+
private drawBoundingRect;
|
|
28
|
+
private drawHandle;
|
|
29
|
+
private drawLink;
|
|
30
|
+
private drawProtractor;
|
|
31
|
+
private drawRotateArc;
|
|
32
|
+
private hoverIn;
|
|
33
|
+
private hoverOut;
|
|
34
|
+
private getProtractorBaseInfo;
|
|
35
|
+
private dragStart;
|
|
36
|
+
private dragMove;
|
|
37
|
+
private dragEnd;
|
|
38
|
+
private hoverCrossIn;
|
|
39
|
+
private hoverCrossOut;
|
|
40
|
+
private dragCrossStart;
|
|
41
|
+
private dragCrossMove;
|
|
42
|
+
private dragCrossEnd;
|
|
43
|
+
private dragCrossEndOUtOfBounding;
|
|
44
|
+
}
|
|
45
|
+
export default RotateController;
|
|
46
|
+
export declare const getDifference: (currentDegree: number, structRotateDegree: number) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,13 +13,21 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
***************************************************************************/
|
|
16
|
+
import { Vec2 } from 'ketcher-core';
|
|
16
17
|
import Editor from '../Editor';
|
|
17
18
|
declare class RotateTool {
|
|
18
19
|
editor: Editor;
|
|
19
20
|
dragCtx: any;
|
|
20
21
|
isNotActiveTool: boolean | undefined;
|
|
21
|
-
constructor(editor: any, dir: any);
|
|
22
|
-
mousedown(event: any): boolean;
|
|
22
|
+
constructor(editor: any, dir: any, isNotActiveTool?: boolean);
|
|
23
|
+
mousedown(event: any, handleCenter?: Vec2, center?: Vec2): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @returns `[center, visibleAtoms]`,
|
|
26
|
+
* `visibleAtoms` = selected atoms
|
|
27
|
+
* - atoms in contracted functional groups
|
|
28
|
+
* + functional groups's attachment atoms
|
|
29
|
+
*/
|
|
30
|
+
getCenter(editor: Editor): readonly [Vec2 | undefined, number[]];
|
|
23
31
|
mousemove(event: any): boolean;
|
|
24
32
|
mouseup(): boolean;
|
|
25
33
|
cancel(): void;
|
|
@@ -25,7 +25,7 @@ declare class SelectTool {
|
|
|
25
25
|
mousemove(event: any): boolean;
|
|
26
26
|
mouseup(event: any): void;
|
|
27
27
|
dblclick(event: any): true | undefined;
|
|
28
|
-
mouseleave(
|
|
28
|
+
mouseleave(): void;
|
|
29
29
|
selectElementsOnCanvas(elements: {
|
|
30
30
|
atoms: number[];
|
|
31
31
|
bonds: number[];
|
|
@@ -34,7 +34,7 @@ declare class TemplateTool {
|
|
|
34
34
|
get isNeedToShowRemoveAbbreviationPopup(): boolean;
|
|
35
35
|
findKeyOfRelatedGroupId(clickedClosestItemId: number): number;
|
|
36
36
|
showRemoveAbbreviationPopup(): Promise<void>;
|
|
37
|
-
mousedown(event:
|
|
37
|
+
mousedown(event: MouseEvent): Promise<void>;
|
|
38
38
|
mousemove(event: any): boolean;
|
|
39
39
|
mouseup(event: any): boolean;
|
|
40
40
|
cancel(e: any): void;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import Editor from '../Editor';
|
|
1
2
|
export declare const TOOLTIP_DELAY = 300;
|
|
2
|
-
export declare function
|
|
3
|
-
|
|
3
|
+
export declare function setFunctionalGroupsTooltip({ editor, event, isShow }: {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
event?: PointerEvent;
|
|
6
|
+
isShow: boolean;
|
|
7
|
+
}): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 {};
|
|
@@ -19,5 +19,5 @@ interface SaltsAndSolventsState {
|
|
|
19
19
|
mode: string;
|
|
20
20
|
}
|
|
21
21
|
declare const saltsAndSolventsReducer: (state: SaltsAndSolventsState | undefined, { type, payload }: AnyAction) => any;
|
|
22
|
-
export declare function initSaltsAndSolventsTemplates(): (dispatch: any
|
|
22
|
+
export declare function initSaltsAndSolventsTemplates(): (dispatch: any) => Promise<void>;
|
|
23
23
|
export default saltsAndSolventsReducer;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export default Editor;
|
|
2
|
-
declare const Editor: import("react-redux").ConnectedComponent<typeof StructEditor, import("react-redux").Omit<any, "
|
|
2
|
+
declare const Editor: import("react-redux").ConnectedComponent<typeof StructEditor, import("react-redux").Omit<any, "options" | "type" | "indigoVerification">>;
|
|
3
3
|
import { StructEditor } from "./components";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FunctionalGroup } from 'ketcher-core';
|
|
2
|
-
import type { PredicateParams } from 'react-contexify';
|
|
2
|
+
import type { TriggerEvent, PredicateParams } from 'react-contexify';
|
|
3
|
+
import { Selection } from '../../../../editor/Editor';
|
|
3
4
|
export declare enum CONTEXT_MENU_ID {
|
|
4
5
|
FOR_BONDS = "context-menu-for-bonds",
|
|
5
6
|
FOR_ATOMS = "context-menu-for-atoms",
|
|
@@ -12,8 +13,29 @@ export declare type ContextMenuShowProps = {
|
|
|
12
13
|
functionalGroups?: FunctionalGroup[];
|
|
13
14
|
bondIds?: number[];
|
|
14
15
|
atomIds?: number[];
|
|
16
|
+
extraItemsSelected?: boolean;
|
|
15
17
|
} | null;
|
|
18
|
+
export interface MenuItemsProps {
|
|
19
|
+
triggerEvent?: TriggerEvent;
|
|
20
|
+
propsFromTrigger?: ContextMenuShowProps;
|
|
21
|
+
}
|
|
16
22
|
export declare type ItemEventParams = PredicateParams<ContextMenuShowProps, ItemData>;
|
|
17
23
|
export declare type contextMenuInfo = {
|
|
18
24
|
[id in CONTEXT_MENU_ID]?: boolean;
|
|
19
25
|
};
|
|
26
|
+
export declare enum ContextMenuTriggerType {
|
|
27
|
+
None = "none",
|
|
28
|
+
Selection = "selection",
|
|
29
|
+
ClosestItem = "closestItem"
|
|
30
|
+
}
|
|
31
|
+
export interface ClosestItem {
|
|
32
|
+
id: number;
|
|
33
|
+
dist: number;
|
|
34
|
+
map: string;
|
|
35
|
+
}
|
|
36
|
+
export interface GetIsItemInSelectionArgs {
|
|
37
|
+
item: ClosestItem | null;
|
|
38
|
+
selection: Selection | null;
|
|
39
|
+
selectedFunctionalGroups: Map<number, FunctionalGroup>;
|
|
40
|
+
selectedSGroupsIds: Set<number>;
|
|
41
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MenuItemsProps } from '../contextMenu.types';
|
|
3
|
+
declare const FunctionalGroupMenuItems: FC<MenuItemsProps>;
|
|
3
4
|
export default FunctionalGroupMenuItems;
|
|
@@ -22,4 +22,4 @@ export declare const queryBondNames: string[];
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const getNonQueryBondNames: (tools: any) => string[];
|
|
24
24
|
export declare const noOperation: () => null;
|
|
25
|
-
export declare function onlyHasProperty<T extends object>(checkedObject: T, key: keyof T): boolean;
|
|
25
|
+
export declare function onlyHasProperty<T extends object>(checkedObject: T, key: keyof T, ignoredProps?: string[]): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
package/package.json
CHANGED
|
File without changes
|