ketcher-react 2.13.0-rc.4 → 2.14.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/Editor.d.ts +1 -1
- package/dist/index.js +10842 -10446
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +10843 -10447
- package/dist/index.modern.js.map +1 -1
- package/dist/script/builders/ketcher/KetcherBuilder.d.ts +2 -1
- package/dist/script/editor/Editor.d.ts +1 -0
- package/dist/script/editor/shared/closest.d.ts +1 -0
- package/dist/script/editor/tool/apoint.utils.d.ts +2 -0
- package/dist/script/editor/tool/helper/lasso.d.ts +3 -0
- package/dist/script/editor/tool/helper/locate.d.ts +2 -0
- package/dist/script/editor/tool/select.d.ts +1 -0
- package/dist/script/editor/tool/template.d.ts +11 -0
- package/dist/script/editor/utils/handleMovingPosibilityCursor.d.ts +1 -0
- package/dist/script/editor/utils/handleMovingPosibilityCursor.test.d.ts +1 -0
- package/dist/script/editor/utils/index.d.ts +1 -0
- package/dist/script/editor/utils/normalizeAngle.d.ts +11 -0
- package/dist/script/index.d.ts +3 -1
- package/dist/script/ui/App/initApp.d.ts +2 -1
- package/dist/script/ui/component/view/ToolActions.test.d.ts +1 -0
- package/dist/script/ui/component/view/savebutton.d.ts +1 -0
- package/dist/script/ui/views/components/ContextMenu/contextMenu.types.d.ts +3 -1
- package/dist/script/ui/views/components/ContextMenu/hooks/useRGroupAttachmentPointEdit.d.ts +3 -0
- package/dist/script/ui/views/components/ContextMenu/hooks/useRGroupAttachmentPointRemove.d.ts +3 -0
- package/dist/script/ui/views/components/ContextMenu/menuItems/RGroupAttachmentPointMenuItems.d.ts +4 -0
- package/dist/script/ui/views/modal/components/document/Save/Save.d.ts +1 -1
- package/dist/script/ui/views/modal/components/document/Save/Save.test.d.ts +1 -0
- package/dist/script/ui/views/modal/components/document/Save/Save.test.utils.d.ts +2 -0
- package/dist/script/ui/views/toolbars/LeftToolbar/LeftToolbar.container.d.ts +1 -1
- package/dist/script/ui/views/toolbars/ToolbarGroupItem/ActionButton/ActionButton.d.ts +1 -0
- package/dist/script/ui/views/toolbars/ToolbarGroupItem/ToolbarGroupItem.d.ts +1 -0
- package/dist/script/ui/views/toolbars/ToolbarGroupItem/ToolbarMultiToolItem/ToolbarMultiToolItem.d.ts +1 -0
- package/dist/script/ui/views/toolbars/toolbar.types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/script/editor/shared/utils.d.ts +0 -24
- /package/dist/script/ui/views/modal/components/InfoModal/{mockStore.d.ts → InfoModal.test.utils.d.ts} +0 -0
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
***************************************************************************/
|
|
16
16
|
import { Ketcher, ServiceMode, StructServiceProvider } from 'ketcher-core';
|
|
17
17
|
import { ButtonsConfig } from './ButtonsConfig';
|
|
18
|
+
import { Root } from 'react-dom/client';
|
|
18
19
|
declare class KetcherBuilder {
|
|
19
20
|
private structService;
|
|
20
21
|
private editor;
|
|
@@ -23,7 +24,7 @@ declare class KetcherBuilder {
|
|
|
23
24
|
constructor();
|
|
24
25
|
appendApiAsync(structServiceProvider: StructServiceProvider): Promise<void>;
|
|
25
26
|
appendServiceMode(mode: ServiceMode): void;
|
|
26
|
-
appendUiAsync(element: HTMLDivElement | null, staticResourcesUrl: string, errorHandler: (message: string) => void, buttons?: ButtonsConfig): Promise<void>;
|
|
27
|
+
appendUiAsync(element: HTMLDivElement | null, appRoot: Root, staticResourcesUrl: string, errorHandler: (message: string) => void, buttons?: ButtonsConfig): Promise<void>;
|
|
27
28
|
build(): Ketcher;
|
|
28
29
|
}
|
|
29
30
|
export { KetcherBuilder };
|
|
@@ -30,6 +30,7 @@ declare class LassoHelper {
|
|
|
30
30
|
sgroupData: number[];
|
|
31
31
|
simpleObjects: number[];
|
|
32
32
|
texts: number[];
|
|
33
|
+
rgroupAttachmentPoints: number[];
|
|
33
34
|
};
|
|
34
35
|
begin(event: any): void;
|
|
35
36
|
running(): boolean;
|
|
@@ -42,6 +43,7 @@ declare class LassoHelper {
|
|
|
42
43
|
sgroupData: number[];
|
|
43
44
|
simpleObjects: number[];
|
|
44
45
|
texts: number[];
|
|
46
|
+
rgroupAttachmentPoints: number[];
|
|
45
47
|
} | null;
|
|
46
48
|
update(): void;
|
|
47
49
|
end(): {
|
|
@@ -53,6 +55,7 @@ declare class LassoHelper {
|
|
|
53
55
|
sgroupData: number[];
|
|
54
56
|
simpleObjects: number[];
|
|
55
57
|
texts: number[];
|
|
58
|
+
rgroupAttachmentPoints: number[];
|
|
56
59
|
};
|
|
57
60
|
cancel(): void;
|
|
58
61
|
}
|
|
@@ -22,6 +22,7 @@ declare function getElementsInRectangle(restruct: any, p0: any, p1: any): {
|
|
|
22
22
|
sgroupData: number[];
|
|
23
23
|
simpleObjects: number[];
|
|
24
24
|
texts: number[];
|
|
25
|
+
rgroupAttachmentPoints: number[];
|
|
25
26
|
};
|
|
26
27
|
declare function getElementsInPolygon(restruct: any, rr: any): {
|
|
27
28
|
atoms: number[];
|
|
@@ -32,6 +33,7 @@ declare function getElementsInPolygon(restruct: any, rr: any): {
|
|
|
32
33
|
sgroupData: number[];
|
|
33
34
|
simpleObjects: number[];
|
|
34
35
|
texts: number[];
|
|
36
|
+
rgroupAttachmentPoints: number[];
|
|
35
37
|
};
|
|
36
38
|
declare const _default: {
|
|
37
39
|
inRectangle: typeof getElementsInRectangle;
|
|
@@ -22,6 +22,7 @@ declare class SelectTool implements Tool {
|
|
|
22
22
|
private readonly editor;
|
|
23
23
|
private dragCtx;
|
|
24
24
|
isMousedDown: boolean;
|
|
25
|
+
readonly isMoving = false;
|
|
25
26
|
constructor(editor: Editor, mode: SelectMode);
|
|
26
27
|
isSelectionRunning(): boolean;
|
|
27
28
|
mousedown(event: any): boolean;
|
|
@@ -13,14 +13,20 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
***************************************************************************/
|
|
16
|
+
import { ReStruct } from 'ketcher-core';
|
|
16
17
|
import Editor from '../Editor';
|
|
17
18
|
import { Tool } from './Tool';
|
|
19
|
+
export declare const PREVIEW_DELAY = 300;
|
|
18
20
|
declare class TemplateTool implements Tool {
|
|
19
21
|
private readonly editor;
|
|
20
22
|
private readonly mode;
|
|
21
23
|
private readonly template;
|
|
22
24
|
private readonly findItems;
|
|
23
25
|
private dragCtx;
|
|
26
|
+
private isPreviewVisible;
|
|
27
|
+
private previewRemoveAction;
|
|
28
|
+
private previewTimeout;
|
|
29
|
+
private lastPreviewId;
|
|
24
30
|
private targetGroupsIds;
|
|
25
31
|
private readonly isSaltOrSolvent;
|
|
26
32
|
private event;
|
|
@@ -37,5 +43,10 @@ declare class TemplateTool implements Tool {
|
|
|
37
43
|
mouseup(event?: any): boolean;
|
|
38
44
|
cancel(): void;
|
|
39
45
|
mouseleave(e: any): void;
|
|
46
|
+
hidePreview(): void;
|
|
47
|
+
showPreview(event: MouseEvent | {
|
|
48
|
+
clientX: number;
|
|
49
|
+
clientY: number;
|
|
50
|
+
}, ci: any, restruct: ReStruct): void;
|
|
40
51
|
}
|
|
41
52
|
export default TemplateTool;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const handleMovingPosibilityCursor: (item: unknown, canvas: SVGElement, cursor: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {number} angle angle (in radians) from the X axis
|
|
3
|
+
* @returns {number} normalized angle (in radians) from the X axis
|
|
4
|
+
* @example
|
|
5
|
+
* normalizeAngleRelativeToXAxis(PI / 2) === PI / 2
|
|
6
|
+
* normalizeAngleRelativeToXAxis(PI) === PI
|
|
7
|
+
* normalizeAngleRelativeToXAxis(3/2 * PI) === -PI / 2
|
|
8
|
+
* normalizeAngleRelativeToXAxis(2 * PI) === 0
|
|
9
|
+
* normalizeAngleRelativeToXAxis(3 * PI) === PI
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalizeAngle(angle: any): number;
|
package/dist/script/index.d.ts
CHANGED
|
@@ -13,15 +13,17 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
***************************************************************************/
|
|
16
|
+
import { Root } from 'react-dom/client';
|
|
16
17
|
import { ButtonsConfig } from './builders';
|
|
17
18
|
import { StructServiceProvider } from 'ketcher-core';
|
|
18
19
|
interface Config {
|
|
19
20
|
element: HTMLDivElement | null;
|
|
21
|
+
appRoot: Root;
|
|
20
22
|
staticResourcesUrl: string;
|
|
21
23
|
structServiceProvider: StructServiceProvider;
|
|
22
24
|
buttons?: ButtonsConfig;
|
|
23
25
|
errorHandler: (message: string) => void;
|
|
24
26
|
}
|
|
25
|
-
declare function buildKetcherAsync({ element, staticResourcesUrl, structServiceProvider, buttons, errorHandler, }: Config): Promise<import("ketcher-core").Ketcher>;
|
|
27
|
+
declare function buildKetcherAsync({ element, appRoot, staticResourcesUrl, structServiceProvider, buttons, errorHandler, }: Config): Promise<import("ketcher-core").Ketcher>;
|
|
26
28
|
export type { Config, ButtonsConfig };
|
|
27
29
|
export default buildKetcherAsync;
|
|
@@ -14,5 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
***************************************************************************/
|
|
16
16
|
import { StructService } from 'ketcher-core';
|
|
17
|
-
|
|
17
|
+
import { Root } from 'react-dom/client';
|
|
18
|
+
declare function initApp(element: HTMLDivElement | null, appRoot: Root, staticResourcesUrl: string, options: any, server: StructService, setEditor: (editor: any) => void): void;
|
|
18
19
|
export { initApp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,8 @@ export declare enum CONTEXT_MENU_ID {
|
|
|
5
5
|
FOR_BONDS = "context-menu-for-bonds",
|
|
6
6
|
FOR_ATOMS = "context-menu-for-atoms",
|
|
7
7
|
FOR_SELECTION = "context-menu-for-selection",
|
|
8
|
-
FOR_FUNCTIONAL_GROUPS = "context-menu-for-functional-groups"
|
|
8
|
+
FOR_FUNCTIONAL_GROUPS = "context-menu-for-functional-groups",
|
|
9
|
+
FOR_R_GROUP_ATTACHMENT_POINT = "context-menu-for-rgroup-attachment-point"
|
|
9
10
|
}
|
|
10
11
|
export declare type ItemData = unknown;
|
|
11
12
|
export declare type ContextMenuShowProps = {
|
|
@@ -14,6 +15,7 @@ export declare type ContextMenuShowProps = {
|
|
|
14
15
|
bondIds?: number[];
|
|
15
16
|
atomIds?: number[];
|
|
16
17
|
extraItemsSelected?: boolean;
|
|
18
|
+
rgroupAttachmentPoints?: number[];
|
|
17
19
|
} | null;
|
|
18
20
|
export interface MenuItemsProps {
|
|
19
21
|
triggerEvent?: TriggerEvent;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ItemEventParams } from '../contextMenu.types';
|
|
2
|
+
declare const useRGroupAttachmentPointEdit: () => readonly [({ props }: ItemEventParams) => void, ({ props }: ItemEventParams) => boolean, ({ props }: ItemEventParams) => boolean];
|
|
3
|
+
export default useRGroupAttachmentPointEdit;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default Save;
|
|
2
|
-
declare const Save: import("react-redux").ConnectedComponent<typeof SaveDialog, import("react-redux").Omit<any, "server" | "options" | "formState" | "struct" | "checkState" | "onCheck" | "moleculeErrors" | "ignoreChiralFlag" | "onTmplSave" | "onResetForm">>;
|
|
2
|
+
declare const Save: import("react-redux").ConnectedComponent<typeof SaveDialog, import("react-redux").Omit<any, "server" | "options" | "bondThickness" | "formState" | "struct" | "checkState" | "onCheck" | "moleculeErrors" | "ignoreChiralFlag" | "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);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
***************************************************************************/
|
|
16
16
|
/// <reference types="react" />
|
|
17
17
|
import { LeftToolbarProps } from './LeftToolbar';
|
|
18
|
-
declare const LeftToolbarContainer: import("react-redux").ConnectedComponent<(props: LeftToolbarProps & import("../ToolbarGroupItem/ToolbarGroupItem").ToolbarGroupItemCallProps) => JSX.Element, import("react-redux").Omit<LeftToolbarProps & import("../ToolbarGroupItem/ToolbarGroupItem").ToolbarGroupItemCallProps, "status" | "opened" | "disableableButtons" | "indigoVerification" | "vertical" | "onAction" | "onOpen">>;
|
|
18
|
+
declare const LeftToolbarContainer: import("react-redux").ConnectedComponent<(props: LeftToolbarProps & import("../ToolbarGroupItem/ToolbarGroupItem").ToolbarGroupItemCallProps) => JSX.Element, import("react-redux").Omit<LeftToolbarProps & import("../ToolbarGroupItem/ToolbarGroupItem").ToolbarGroupItemCallProps, "status" | "opened" | "disableableButtons" | "indigoVerification" | "vertical" | "dataTestId" | "onAction" | "onOpen">>;
|
|
19
19
|
export { LeftToolbarContainer };
|
|
@@ -23,7 +23,7 @@ declare type LeftToolbarItemVariant = 'hand' | 'select' | 'select-lasso' | 'sele
|
|
|
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 FloatingToolItemVariant = 'transform-flip-h' | 'transform-flip-v' | 'erase';
|
|
26
|
-
declare type ToolbarItemVariant = TopToolbarItemVariant | LeftToolbarItemVariant | BottomToolbarItemVariant | RightToolbarItemVariant | FloatingToolItemVariant;
|
|
26
|
+
declare type ToolbarItemVariant = TopToolbarItemVariant | LeftToolbarItemVariant | BottomToolbarItemVariant | RightToolbarItemVariant | FloatingToolItemVariant | 'bonds';
|
|
27
27
|
interface ToolbarItem {
|
|
28
28
|
id: ToolbarItemVariant;
|
|
29
29
|
options?: ToolbarItem[];
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
export { calcAngle };
|
|
3
|
-
export { fracAngle };
|
|
4
|
-
export { calcNewAtomPos };
|
|
5
|
-
export { degrees };
|
|
6
|
-
export { normalizeAngle };
|
|
7
|
-
}
|
|
8
|
-
export default _default;
|
|
9
|
-
declare function calcAngle(pos0: any, pos1: any): number;
|
|
10
|
-
import { fracAngle } from "ketcher-core/dist/application/editor";
|
|
11
|
-
declare function calcNewAtomPos(pos0: any, pos1: any, ctrlKey: any): Vec2;
|
|
12
|
-
declare function degrees(angle: any): number;
|
|
13
|
-
/**
|
|
14
|
-
* @param {number} angle angle (in radians) from the X axis
|
|
15
|
-
* @returns {number} normalized angle (in radians) from the X axis
|
|
16
|
-
* @example
|
|
17
|
-
* normalizeAngleRelativeToXAxis(PI / 2) === PI / 2
|
|
18
|
-
* normalizeAngleRelativeToXAxis(PI) === PI
|
|
19
|
-
* normalizeAngleRelativeToXAxis(3/2 * PI) === -PI / 2
|
|
20
|
-
* normalizeAngleRelativeToXAxis(2 * PI) === 0
|
|
21
|
-
* normalizeAngleRelativeToXAxis(3 * PI) === PI
|
|
22
|
-
*/
|
|
23
|
-
declare function normalizeAngle(angle: number): number;
|
|
24
|
-
import { Vec2 } from "ketcher-core/dist/domain/entities/vec2";
|
|
File without changes
|