ketcher-react 3.12.0-rc.2 → 3.13.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/cjs/components/Icon/utils/iconNameToIcon.d.ts +1 -0
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +1 -1
- package/dist/cjs/index.js +1497 -942
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{index.modern-0386b391.js → index.modern-046987f4.js} +9 -7
- package/dist/cjs/{index.modern-0386b391.js.map → index.modern-046987f4.js.map} +1 -1
- package/dist/cjs/script/editor/Editor.d.ts +4 -5
- package/dist/cjs/script/editor/tool/Tool.d.ts +8 -0
- package/dist/cjs/script/editor/tool/fragmentSelection.d.ts +26 -0
- package/dist/cjs/script/ui/action/action.types.d.ts +1 -1
- package/dist/cjs/script/ui/action/tools.d.ts +9 -1
- package/dist/cjs/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.types.d.ts +1 -1
- package/dist/cjs/script/ui/views/components/StructEditor/StructEditor.d.ts +1 -0
- package/dist/cjs/script/ui/views/components/Tooltip/Tooltip.d.ts +23 -0
- package/dist/cjs/script/ui/views/components/Tooltip/index.d.ts +16 -0
- package/dist/cjs/script/ui/views/toolbars/toolbar.types.d.ts +1 -1
- package/dist/components/Icon/utils/iconNameToIcon.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1500 -946
- package/dist/index.js.map +1 -1
- package/dist/{index.modern-3f8330b9.js → index.modern-a0a9b2aa.js} +9 -7
- package/dist/{index.modern-3f8330b9.js.map → index.modern-a0a9b2aa.js.map} +1 -1
- package/dist/script/editor/Editor.d.ts +4 -5
- package/dist/script/editor/tool/Tool.d.ts +8 -0
- package/dist/script/editor/tool/fragmentSelection.d.ts +26 -0
- package/dist/script/ui/action/action.types.d.ts +1 -1
- package/dist/script/ui/action/tools.d.ts +9 -1
- package/dist/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.types.d.ts +1 -1
- package/dist/script/ui/views/components/StructEditor/StructEditor.d.ts +1 -0
- package/dist/script/ui/views/components/Tooltip/Tooltip.d.ts +23 -0
- package/dist/script/ui/views/components/Tooltip/index.d.ts +16 -0
- package/dist/script/ui/views/toolbars/toolbar.types.d.ts +1 -1
- package/package.json +5 -4
|
@@ -19,7 +19,7 @@ import { Highlighter } from './highlighter';
|
|
|
19
19
|
import { ContextMenuInfo } from '../ui/views/components/ContextMenu/contextMenu.types';
|
|
20
20
|
import { HoverIcon } from './HoverIcon';
|
|
21
21
|
import RotateController from './tool/rotate-controller';
|
|
22
|
-
import { Tool } from './tool/Tool';
|
|
22
|
+
import { HoverTarget, Tool } from './tool/Tool';
|
|
23
23
|
export interface Selection {
|
|
24
24
|
atoms?: Array<number>;
|
|
25
25
|
bonds?: Array<number>;
|
|
@@ -49,6 +49,7 @@ declare class Editor implements KetcherEditor {
|
|
|
49
49
|
rotateController: RotateController;
|
|
50
50
|
event: {
|
|
51
51
|
message: Subscription;
|
|
52
|
+
tooltip: Subscription;
|
|
52
53
|
elementEdit: PipelineSubscription;
|
|
53
54
|
zoomIn: PipelineSubscription;
|
|
54
55
|
zoomOut: PipelineSubscription;
|
|
@@ -154,10 +155,8 @@ declare class Editor implements KetcherEditor {
|
|
|
154
155
|
private invalidateMonomerCreationWizardState;
|
|
155
156
|
setRnaMonomerCreationMode(isActive: boolean): void;
|
|
156
157
|
selection(ci?: any): Selection | null;
|
|
157
|
-
hover(ci:
|
|
158
|
-
|
|
159
|
-
map: string;
|
|
160
|
-
} | null, newTool?: any, event?: PointerEvent): void;
|
|
158
|
+
hover(ci: HoverTarget | null, newTool?: any, event?: PointerEvent): void;
|
|
159
|
+
private getHoverId;
|
|
161
160
|
update(action: Action | true, ignoreHistory?: boolean): void;
|
|
162
161
|
historySize(): {
|
|
163
162
|
readonly undo: number;
|
|
@@ -9,10 +9,18 @@ interface ToolEventHandler {
|
|
|
9
9
|
mouseLeaveClientArea?(event: Event): void;
|
|
10
10
|
mouseover?(event: Event): void;
|
|
11
11
|
}
|
|
12
|
+
export declare type HoverTarget = {
|
|
13
|
+
id: number;
|
|
14
|
+
map: string;
|
|
15
|
+
} | {
|
|
16
|
+
map: 'merge';
|
|
17
|
+
items: Record<string, number[]>;
|
|
18
|
+
};
|
|
12
19
|
export interface Tool extends ToolEventHandler {
|
|
13
20
|
cancel?(): void;
|
|
14
21
|
isSelectionRunning?(): boolean;
|
|
15
22
|
isNotActiveTool?: boolean;
|
|
23
|
+
ci?: HoverTarget;
|
|
16
24
|
}
|
|
17
25
|
export declare type ToolConstructorInterface = new (editor: Editor, ...args: any[]) => Tool;
|
|
18
26
|
export declare type ToolEventHandlerName = keyof ToolEventHandler;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Editor from '../Editor';
|
|
2
|
+
import { Tool } from './Tool';
|
|
3
|
+
export default class FragmentSelectionTool implements Tool {
|
|
4
|
+
private readonly editor;
|
|
5
|
+
private preview;
|
|
6
|
+
private tooltipTimeoutId?;
|
|
7
|
+
private disabledMessage?;
|
|
8
|
+
private bondPreview?;
|
|
9
|
+
private dragCtx?;
|
|
10
|
+
constructor(editor: Editor);
|
|
11
|
+
mousedown(event: PointerEvent): boolean;
|
|
12
|
+
mouseup(): boolean;
|
|
13
|
+
private removeBondPreview;
|
|
14
|
+
mousemove(event: PointerEvent): boolean;
|
|
15
|
+
mouseleave(): void;
|
|
16
|
+
mouseLeaveClientArea(): void;
|
|
17
|
+
private resetPreview;
|
|
18
|
+
private setDisabledState;
|
|
19
|
+
private queueTooltip;
|
|
20
|
+
private clearTooltip;
|
|
21
|
+
private setCursor;
|
|
22
|
+
private isBondInCycle;
|
|
23
|
+
private collectFragment;
|
|
24
|
+
private getComponentData;
|
|
25
|
+
cancel(): void;
|
|
26
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
***************************************************************************/
|
|
16
16
|
import { Dispatch } from 'redux';
|
|
17
|
-
declare type ToolVariant = 'any-atom' | 'about' | 'analyse' | 'arom' | 'atom-props' | 'bond-any' | 'bond-hydrogen' | 'bond-aromatic' | 'bond-crossed' | 'bond-dative' | 'bond-double' | 'bond-doublearomatic' | 'bond-down' | 'bond-props' | 'bond-single' | 'bond-singlearomatic' | 'bond-singledouble' | 'bond-triple' | 'bond-up' | 'bond-updown' | 'copies' | 'copy-mol' | 'copy-ket' | 'chain' | 'charge-minus' | 'charge-plus' | 'check' | 'chiral-flag' | 'cip' | 'clean' | 'copy' | 'copy-image' | 'cut' | 'dearom' | 'dropdown' | 'deselect-all' | 'enhanced-stereo' | 'erase' | 'extended-table' | 'fullscreen' | 'functional-groups' | 'generic-groups' | 'help' | 'info-modal' | 'layout' | 'logo' | 'miew' | 'clear' | 'open' | 'paste' | 'period-table' | 'reaction-arrow' | 'reaction-automap' | 'reaction-map' | 'reaction-plus' | 'reaction-unmap' | 'recognize' | 'redo' | 'rgroup-attpoints' | 'rgroup-fragment' | 'rgroup-label' | 'save' | 'select-fragment' | 'select-lasso' | 'select-rectangle' | 'select-all' | 'select-descriptors' | 'settings' | 'sgroup' | 'template-0' | 'template-1' | 'template-2' | 'template-3' | 'template-4' | 'template-5' | 'template-6' | 'template-7' | 'template-lib' | 'text' | 'transform-flip-h' | 'transform-flip-v' | 'transform-rotate' | 'zoom-in' | 'zoom-out' | 'shape-circle' | 'shape-rectangle' | 'shape-polyline' | 'shape-line' | 'undo';
|
|
17
|
+
declare type ToolVariant = 'any-atom' | 'about' | 'analyse' | 'arom' | 'atom-props' | 'bond-any' | 'bond-hydrogen' | 'bond-aromatic' | 'bond-crossed' | 'bond-dative' | 'bond-double' | 'bond-doublearomatic' | 'bond-down' | 'bond-props' | 'bond-single' | 'bond-singlearomatic' | 'bond-singledouble' | 'bond-triple' | 'bond-up' | 'bond-updown' | 'copies' | 'copy-mol' | 'copy-ket' | 'chain' | 'charge-minus' | 'charge-plus' | 'check' | 'chiral-flag' | 'cip' | 'clean' | 'copy' | 'copy-image' | 'cut' | 'dearom' | 'dropdown' | 'deselect-all' | 'enhanced-stereo' | 'erase' | 'extended-table' | 'fullscreen' | 'functional-groups' | 'generic-groups' | 'help' | 'info-modal' | 'layout' | 'logo' | 'miew' | 'clear' | 'open' | 'paste' | 'period-table' | 'reaction-arrow' | 'reaction-automap' | 'reaction-map' | 'reaction-plus' | 'reaction-unmap' | 'recognize' | 'redo' | 'rgroup-attpoints' | 'rgroup-fragment' | 'rgroup-label' | 'save' | 'select-structure' | 'select-fragment' | 'select-lasso' | 'select-rectangle' | 'select-all' | 'select-descriptors' | 'settings' | 'sgroup' | 'template-0' | 'template-1' | 'template-2' | 'template-3' | 'template-4' | 'template-5' | 'template-6' | 'template-7' | 'template-lib' | 'text' | 'transform-flip-h' | 'transform-flip-v' | 'transform-rotate' | 'zoom-in' | 'zoom-out' | 'shape-circle' | 'shape-rectangle' | 'shape-polyline' | 'shape-line' | 'undo';
|
|
18
18
|
declare type ActionObj = {
|
|
19
19
|
tool?: string;
|
|
20
20
|
opts?: any;
|
|
@@ -27,7 +27,7 @@ declare const _default: {
|
|
|
27
27
|
opts: string;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
'select-
|
|
30
|
+
'select-structure': {
|
|
31
31
|
title: string;
|
|
32
32
|
shortcut: string[];
|
|
33
33
|
action: {
|
|
@@ -36,6 +36,14 @@ declare const _default: {
|
|
|
36
36
|
};
|
|
37
37
|
hidden: (options: any) => boolean;
|
|
38
38
|
};
|
|
39
|
+
'select-fragment': {
|
|
40
|
+
title: string;
|
|
41
|
+
shortcut: string[];
|
|
42
|
+
action: {
|
|
43
|
+
tool: string;
|
|
44
|
+
};
|
|
45
|
+
hidden: (options: any) => boolean;
|
|
46
|
+
};
|
|
39
47
|
erase: {
|
|
40
48
|
title: string;
|
|
41
49
|
shortcut: string[];
|
package/dist/cjs/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare type WizardValues = {
|
|
|
19
19
|
[key in StringWizardFormFieldId]: string;
|
|
20
20
|
};
|
|
21
21
|
export declare type WizardNotificationType = 'info' | 'error' | 'warning';
|
|
22
|
-
export declare type WizardNotificationId = 'defaultAttachmentPoints' | 'emptyMandatoryFields' | 'invalidSymbol' | 'symbolExists' | 'editingIsNotAllowed' | 'noAttachmentPoints' | 'incorrectAttachmentPointsOrder' | 'creationSuccessful' | 'creationRNASuccessful' | 'incontinuousStructure' | 'notUniqueModificationTypes' | 'modificationTypeExists' | 'notMinimalViableStructure' | 'impureStructure' | 'notUniqueHELMAlias' | 'invalidHELMAlias' | 'invalidRnaPresetStructure' | 'notUniquePresetCode' | 'invalidPresetCode';
|
|
22
|
+
export declare type WizardNotificationId = 'defaultAttachmentPoints' | 'emptyMandatoryFields' | 'invalidSymbol' | 'symbolExists' | 'editingIsNotAllowed' | 'noAttachmentPoints' | 'incorrectAttachmentPointsOrder' | 'attachmentPointsNotUnique' | 'creationSuccessful' | 'creationRNASuccessful' | 'incontinuousStructure' | 'notUniqueModificationTypes' | 'modificationTypeExists' | 'notMinimalViableStructure' | 'impureStructure' | 'notUniqueHELMAlias' | 'invalidHELMAlias' | 'invalidRnaPresetStructure' | 'notUniquePresetCode' | 'invalidPresetCode';
|
|
23
23
|
export declare type WizardNotificationTypeMap = Record<WizardNotificationId, WizardNotificationType>;
|
|
24
24
|
export declare type WizardNotificationMessageMap = Record<WizardNotificationId, string>;
|
|
25
25
|
export declare type WizardNotification = {
|
|
@@ -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
|
+
export interface TooltipProps {
|
|
17
|
+
message: string;
|
|
18
|
+
position: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare const Tooltip: (props: TooltipProps) => "" | import("react/jsx-runtime").JSX.Element;
|
|
@@ -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 * from './Tooltip';
|
|
@@ -20,7 +20,7 @@ declare type BottomGroup = 'template-common' | 'template-lib';
|
|
|
20
20
|
declare type RightGroup = 'atom' | 'period-table';
|
|
21
21
|
declare type ToolbarGroupVariant = TopGroup | LeftGroup | BottomGroup | RightGroup;
|
|
22
22
|
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';
|
|
23
|
-
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' | '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-retrosynthetic' | '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' | typeof MULTITAIL_ARROW_TOOL_NAME | 'reaction-mapping-tools' | 'reaction-automap' | 'reaction-map' | 'reaction-unmap' | 'rgroup' | 'rgroup-label' | 'rgroup-fragment' | 'rgroup-attpoints' | 'create-monomer' | 'shapes' | 'shape-ellipse' | 'shape-rectangle' | 'shape-line' | 'text' | typeof IMAGE_KEY;
|
|
23
|
+
declare type LeftToolbarItemVariant = 'hand' | 'select' | 'select-lasso' | 'select-rectangle' | 'select-structure' | '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' | '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-retrosynthetic' | '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' | typeof MULTITAIL_ARROW_TOOL_NAME | 'reaction-mapping-tools' | 'reaction-automap' | 'reaction-map' | 'reaction-unmap' | 'rgroup' | 'rgroup-label' | 'rgroup-fragment' | 'rgroup-attpoints' | 'create-monomer' | 'shapes' | 'shape-ellipse' | 'shape-rectangle' | 'shape-line' | 'text' | typeof IMAGE_KEY;
|
|
24
24
|
declare type BottomToolbarItemVariant = 'template-common' | 'template-lib' | 'enhanced-stereo' | 'fullscreen';
|
|
25
25
|
declare type RightToolbarItemVariant = 'atom' | 'freq-atoms' | 'period-table' | 'extended-table' | 'any-atom';
|
|
26
26
|
declare type FloatingToolItemVariant = 'transform-flip-h' | 'transform-flip-v' | 'erase';
|
|
@@ -159,6 +159,7 @@ export declare const iconNameToIcon: {
|
|
|
159
159
|
readonly 'rgroup-label': ReactComponent;
|
|
160
160
|
readonly save: ReactComponent;
|
|
161
161
|
readonly search: ReactComponent;
|
|
162
|
+
readonly 'select-structure': ReactComponent;
|
|
162
163
|
readonly 'select-fragment': ReactComponent;
|
|
163
164
|
readonly 'select-lasso': ReactComponent;
|
|
164
165
|
readonly 'select-rectangle': ReactComponent;
|