ketcher-react 3.12.0-dev.1 → 3.12.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/index.css +1 -1
- package/dist/cjs/index.css.map +1 -1
- package/dist/cjs/index.js +1226 -524
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{index.modern-b232add2.js → index.modern-0386b391.js} +4 -3
- package/dist/cjs/index.modern-0386b391.js.map +1 -0
- package/dist/cjs/script/editor/Editor.d.ts +19 -2
- package/dist/cjs/script/editor/tool/sgroup.d.ts +17 -0
- package/dist/cjs/script/editor/utils/customOnChangeHandler.test.d.ts +16 -0
- package/dist/cjs/script/ui/data/schema/sdata-schema.d.ts +1 -1
- package/dist/cjs/script/ui/state/functionalGroups/index.d.ts +1 -1
- package/dist/cjs/script/ui/state/notifications/index.d.ts +17 -0
- package/dist/cjs/script/ui/state/saltsAndSolvents/index.d.ts +1 -1
- package/dist/cjs/script/ui/views/components/ContextMenu/hooks/useMarkAs.d.ts +9 -0
- package/dist/cjs/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.constants.d.ts +2 -0
- package/dist/cjs/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.types.d.ts +6 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1228 -526
- package/dist/index.js.map +1 -1
- package/dist/{index.modern-06d576e1.js → index.modern-3f8330b9.js} +5 -4
- package/dist/index.modern-3f8330b9.js.map +1 -0
- package/dist/script/editor/Editor.d.ts +19 -2
- package/dist/script/editor/tool/sgroup.d.ts +17 -0
- package/dist/script/editor/utils/customOnChangeHandler.test.d.ts +16 -0
- package/dist/script/ui/data/schema/sdata-schema.d.ts +1 -1
- package/dist/script/ui/state/functionalGroups/index.d.ts +1 -1
- package/dist/script/ui/state/notifications/index.d.ts +17 -0
- package/dist/script/ui/state/saltsAndSolvents/index.d.ts +1 -1
- package/dist/script/ui/views/components/ContextMenu/hooks/useMarkAs.d.ts +9 -0
- package/dist/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.constants.d.ts +2 -0
- package/dist/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.types.d.ts +6 -1
- package/package.json +1 -1
- package/dist/cjs/index.modern-b232add2.js.map +0 -1
- package/dist/index.modern-06d576e1.js.map +0 -1
|
@@ -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 { Action, Atom, AtomLabel, AttachmentPointName, Editor as KetcherEditor, FloatingToolsParams, IKetMonomerTemplate, MonomerCreationState, MULTITAIL_ARROW_KEY, Render, Struct, KetMonomerClass } from 'ketcher-core';
|
|
16
|
+
import { Action, Atom, AtomLabel, AttachmentPointName, Editor as KetcherEditor, FloatingToolsParams, IKetMonomerTemplate, MonomerCreationState, MULTITAIL_ARROW_KEY, Render, Struct, Vec2, KetMonomerClass, RnaPresetComponentKey } from 'ketcher-core';
|
|
17
17
|
import { PipelineSubscription, Subscription } from 'subscription';
|
|
18
18
|
import { Highlighter } from './highlighter';
|
|
19
19
|
import { ContextMenuInfo } from '../ui/views/components/ContextMenu/contextMenu.types';
|
|
@@ -96,6 +96,7 @@ declare class Editor implements KetcherEditor {
|
|
|
96
96
|
get monomerCreationState(): MonomerCreationState;
|
|
97
97
|
private set monomerCreationState(value);
|
|
98
98
|
setMonomerCreationSelectedType(type: KetMonomerClass | 'rnaPreset' | undefined): void;
|
|
99
|
+
setRnaComponentAtoms(componentKey: RnaPresetComponentKey, atomIds: number[], bondIds: number[]): void;
|
|
99
100
|
get isMonomerCreationWizardActive(): boolean;
|
|
100
101
|
private terminalRGroupAtoms;
|
|
101
102
|
private potentialLeavingAtomsForAutoAssignment;
|
|
@@ -116,7 +117,7 @@ declare class Editor implements KetcherEditor {
|
|
|
116
117
|
assignConnectionPointAtom(atomId: number, attachmentPointName?: AttachmentPointName, assignedAttachmentPointsByMonomer?: Map<AttachmentPointName, [
|
|
117
118
|
number,
|
|
118
119
|
number
|
|
119
|
-
]>, monomerStructure?: Selection, forceAddNewLeavingGroupAtom?: boolean, leavingAtomLabel?: AtomLabel): void;
|
|
120
|
+
]>, monomerStructure?: Selection, forceAddNewLeavingGroupAtom?: boolean, leavingAtomLabel?: AtomLabel, leavingAtomPosition?: Vec2): void;
|
|
120
121
|
closeMonomerCreationWizard(restoreOriginalStruct?: boolean): void;
|
|
121
122
|
saveNewMonomer(data: any): {
|
|
122
123
|
monomer: import("ketcher-core").Chem | import("ketcher-core").Sugar | import("ketcher-core").Peptide | import("ketcher-core").RNABase | import("ketcher-core").Phosphate;
|
|
@@ -132,10 +133,26 @@ declare class Editor implements KetcherEditor {
|
|
|
132
133
|
setProblematicAttachmentPoints(problematicPoints: Set<AttachmentPointName>): void;
|
|
133
134
|
highlightAttachmentPoint(name: AttachmentPointName | null): void;
|
|
134
135
|
findPotentialLeavingAtoms(attachmentAtomId: number): Atom[];
|
|
136
|
+
private getRnaComponentForAtom;
|
|
137
|
+
private canAssignRnaComponent;
|
|
138
|
+
/**
|
|
139
|
+
* Auto-assigns atoms to RNA preset components when new bonds are added.
|
|
140
|
+
* If one atom belongs to a component and the other doesn't belong to any,
|
|
141
|
+
* the unassigned atom (and the bond) is added to the same component.
|
|
142
|
+
*/
|
|
143
|
+
private autoAssignAtomToRnaComponent;
|
|
144
|
+
private updateRnaComponentStructureState;
|
|
145
|
+
/**
|
|
146
|
+
* Adds an atom and bond to an RNA preset component and fires an event
|
|
147
|
+
* so the wizard can update its state.
|
|
148
|
+
*/
|
|
149
|
+
private addAtomsAndBondsToRnaComponent;
|
|
150
|
+
private removeAtomsAndBondsFromRnaComponents;
|
|
135
151
|
private subscribeToChangeEventInMonomerCreationWizard;
|
|
136
152
|
private unsubscribeFromChangeEventInMonomerCreationWizard;
|
|
137
153
|
private collectChangesForMonomerCreationStateInvalidation;
|
|
138
154
|
private invalidateMonomerCreationWizardState;
|
|
155
|
+
setRnaMonomerCreationMode(isActive: boolean): void;
|
|
139
156
|
selection(ci?: any): Selection | null;
|
|
140
157
|
hover(ci: {
|
|
141
158
|
id: number;
|
|
@@ -24,6 +24,23 @@ declare class SGroupTool implements Tool {
|
|
|
24
24
|
mousedown(event: any): void;
|
|
25
25
|
mousemove(event: any): void;
|
|
26
26
|
mouseleave(event: any): void;
|
|
27
|
+
private isContractedFunctionalGroupClicked;
|
|
28
|
+
private processSelectedAtoms;
|
|
29
|
+
private getActualSgroupId;
|
|
30
|
+
private isAtomInContractedGroup;
|
|
31
|
+
private addContractedGroupToSelection;
|
|
32
|
+
private processSelectedBonds;
|
|
33
|
+
private expandFunctionalGroupSelection;
|
|
34
|
+
private expandAtomsToFunctionalGroups;
|
|
35
|
+
private expandBondsToFunctionalGroups;
|
|
36
|
+
private collectFunctionalGroupIds;
|
|
37
|
+
private collectFunctionalGroupIdsFromAtoms;
|
|
38
|
+
private collectFunctionalGroupIdsFromBonds;
|
|
39
|
+
private shouldRemoveSingleFunctionalGroup;
|
|
40
|
+
private determineSelection;
|
|
41
|
+
private handleLassoSelection;
|
|
42
|
+
private handleClickSelection;
|
|
43
|
+
private shouldOpenDialog;
|
|
27
44
|
mouseup(event: any): void;
|
|
28
45
|
cancel(): void;
|
|
29
46
|
static sgroupDialog(editor: Editor, id: number | null): Promise<void>;
|
|
@@ -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 {};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @param fieldName? { string }
|
|
8
8
|
* @returns { string }
|
|
9
9
|
*/
|
|
10
|
-
export function getSdataDefault(schema
|
|
10
|
+
export function getSdataDefault(schema?: {}, context?: undefined, fieldName?: undefined): string;
|
|
11
11
|
export namespace sdataCustomSchema {
|
|
12
12
|
const key: string;
|
|
13
13
|
const title: string;
|
|
@@ -20,7 +20,7 @@ interface FGState {
|
|
|
20
20
|
functionalGroupInfo: any;
|
|
21
21
|
mode: string;
|
|
22
22
|
}
|
|
23
|
-
declare const functionalGroupsReducer: (state: FGState | undefined,
|
|
23
|
+
declare const functionalGroupsReducer: (state: FGState | undefined, action: AnyAction) => any;
|
|
24
24
|
export declare const initFGroups: (lib: SdfItem[]) => {
|
|
25
25
|
type: string;
|
|
26
26
|
payload: {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const initNotificationsState: {
|
|
2
|
+
snackbarNotificationText: string;
|
|
3
|
+
};
|
|
4
|
+
export declare function showSnackbarNotification(text: string): {
|
|
5
|
+
type: string;
|
|
6
|
+
data: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function hideSnackbarNotification(): {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function selectSnackbarNotificationText(state: any): any;
|
|
12
|
+
declare function notificationsReducer(state: {
|
|
13
|
+
snackbarNotificationText: string;
|
|
14
|
+
} | undefined, action: any): {
|
|
15
|
+
snackbarNotificationText: any;
|
|
16
|
+
};
|
|
17
|
+
export default notificationsReducer;
|
|
@@ -19,7 +19,7 @@ interface SaltsAndSolventsState {
|
|
|
19
19
|
lib: [];
|
|
20
20
|
mode: string;
|
|
21
21
|
}
|
|
22
|
-
declare const saltsAndSolventsReducer: (state: SaltsAndSolventsState | undefined,
|
|
22
|
+
declare const saltsAndSolventsReducer: (state: SaltsAndSolventsState | undefined, action: AnyAction) => any;
|
|
23
23
|
export declare const initSaltsAndSolvents: (lib: SdfItem[]) => {
|
|
24
24
|
type: string;
|
|
25
25
|
payload: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SelectionContextMenuProps, ItemEventParams } from '../contextMenu.types';
|
|
2
|
+
import { RnaPresetComponentType } from '../../MonomerCreationWizard/MonomerCreationWizard.constants';
|
|
3
|
+
declare type Params = ItemEventParams<SelectionContextMenuProps>;
|
|
4
|
+
declare const useMarkAs: () => {
|
|
5
|
+
handler: (componentType: RnaPresetComponentType) => (_params: Params) => void;
|
|
6
|
+
isVisible: () => boolean | undefined;
|
|
7
|
+
isDisabled: () => boolean;
|
|
8
|
+
};
|
|
9
|
+
export default useMarkAs;
|
package/dist/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.constants.d.ts
CHANGED
|
@@ -4,3 +4,5 @@ export declare const MAX_MODIFICATION_TYPES = 5;
|
|
|
4
4
|
export declare const NotificationMessages: WizardNotificationMessageMap;
|
|
5
5
|
export declare const NotificationTypes: WizardNotificationTypeMap;
|
|
6
6
|
export declare const MonomerCreationExternalNotificationAction = "MonomerCreationExternalNotification";
|
|
7
|
+
export declare const MonomerCreationMarkAsComponentAction = "MonomerCreationMarkAsComponent";
|
|
8
|
+
export declare type RnaPresetComponentType = 'base' | 'sugar' | 'phosphate';
|
package/dist/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' | 'incontinuousStructure' | 'notUniqueModificationTypes' | 'modificationTypeExists' | 'notMinimalViableStructure' | 'impureStructure' | 'notUniqueHELMAlias' | 'invalidHELMAlias' | 'invalidRnaPresetStructure' | 'notUniquePresetCode' | 'invalidPresetCode';
|
|
22
|
+
export declare type WizardNotificationId = 'defaultAttachmentPoints' | 'emptyMandatoryFields' | 'invalidSymbol' | 'symbolExists' | 'editingIsNotAllowed' | 'noAttachmentPoints' | 'incorrectAttachmentPointsOrder' | '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 = {
|
|
@@ -84,6 +84,11 @@ export declare type RnaPresetWizardAction = (WizardAction & {
|
|
|
84
84
|
type: 'SetRnaPresetComponentStructure';
|
|
85
85
|
rnaComponentKey: RnaPresetWizardStateFieldId;
|
|
86
86
|
editor: Editor;
|
|
87
|
+
} | {
|
|
88
|
+
type: 'UpdateRnaPresetComponentStructure';
|
|
89
|
+
rnaComponentKey: RnaPresetWizardComponentStateFieldId;
|
|
90
|
+
atomIds: number[];
|
|
91
|
+
bondIds: number[];
|
|
87
92
|
} | {
|
|
88
93
|
type: 'ResetErrors';
|
|
89
94
|
} | {
|