ketcher-react 2.13.0-rc.3-dev.2 → 2.14.0-rc.1

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.
@@ -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 };
@@ -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,7 @@ 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(ci: any, restruct: ReStruct): void;
40
48
  }
41
49
  export default TemplateTool;
@@ -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;
@@ -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
- declare function initApp(element: HTMLDivElement | null, staticResourcesUrl: string, options: any, server: StructService, setEditor: (editor: any) => void): void;
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 };
@@ -19,6 +19,7 @@ declare type Props = {
19
19
  server?: any;
20
20
  filename: string;
21
21
  outputFormat?: OutputFormatType;
22
+ bondThickness?: number;
22
23
  data: any;
23
24
  type?: string;
24
25
  mode?: string;
@@ -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);
@@ -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 };
@@ -27,6 +27,7 @@ interface ActionButtonProps {
27
27
  disableableButtons: string[];
28
28
  indigoVerification: boolean;
29
29
  className?: string;
30
+ dataTestId?: string;
30
31
  }
31
32
  interface ActionButtonCallProps {
32
33
  onAction: (action: UiActionAction) => void;
@@ -25,6 +25,7 @@ interface ToolbarGroupItemProps extends ToolbarItem {
25
25
  indigoVerification: boolean;
26
26
  className?: string;
27
27
  vertical?: boolean;
28
+ dataTestId?: string;
28
29
  }
29
30
  interface ToolbarGroupItemCallProps {
30
31
  onAction: (action: UiActionAction) => void;
@@ -30,6 +30,7 @@ interface ToolbarMultiToolItemProps {
30
30
  indigoVerification: boolean;
31
31
  className?: string;
32
32
  vertical?: boolean;
33
+ dataTestId?: string;
33
34
  }
34
35
  interface ToolbarMultiToolItemCallProps {
35
36
  onAction: (action: UiActionAction) => void;
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "ketcher-react",
3
- "version": "2.13.0-rc.3-dev.2",
3
+ "version": "2.14.0-rc.1",
4
4
  "description": "Web-based molecule sketcher",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "http://lifescience.opensource.epam.com/ketcher",
@@ -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";