ketcher-react 2.8.0-rc.6 → 2.9.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.
Files changed (70) hide show
  1. package/dist/hooks/useClickOutside.d.ts +2 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.css.map +1 -1
  4. package/dist/index.js +2355 -2031
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.modern.js +2379 -2056
  7. package/dist/index.modern.js.map +1 -1
  8. package/dist/script/builders/ketcher/ButtonName.d.ts +1 -1
  9. package/dist/script/editor/Editor.d.ts +3 -1
  10. package/dist/script/editor/shared/utils.d.ts +29 -0
  11. package/dist/script/editor/tool/helper/dropAndMerge.d.ts +8 -0
  12. package/dist/script/editor/tool/helper/getGroupIdsFromItems.d.ts +12 -0
  13. package/dist/script/editor/tool/helper/getMergeItems.d.ts +2 -0
  14. package/dist/script/editor/tool/paste.d.ts +5 -0
  15. package/dist/script/editor/tool/select.d.ts +1 -1
  16. package/dist/script/editor/tool/sgroup.d.ts +2 -3
  17. package/dist/script/editor/tool/template.d.ts +8 -3
  18. package/dist/script/editor/utils/canvasExtension.d.ts +16 -0
  19. package/dist/script/ui/Portal/Portal.d.ts +2 -1
  20. package/dist/script/ui/action/action.types.d.ts +1 -1
  21. package/dist/script/ui/action/index.d.ts +21 -9
  22. package/dist/script/ui/action/server.d.ts +10 -2
  23. package/dist/script/ui/action/tools.d.ts +1 -9
  24. package/dist/script/ui/action/zoom.d.ts +2 -0
  25. package/dist/script/ui/data/convert/structconv.d.ts +16 -0
  26. package/dist/script/ui/data/schema/sdata-schema.d.ts +7 -5
  27. package/dist/script/ui/dialog/template/TemplateDialog.d.ts +1 -3
  28. package/dist/script/ui/dialog/template/template-attach.d.ts +1 -1
  29. package/dist/script/ui/dialog/toolbox/SDataFieldset.d.ts +4 -0
  30. package/dist/script/ui/dialog/toolbox/SGroupFieldset.d.ts +4 -0
  31. package/dist/script/ui/dialog/toolbox/enhancedStereo/enhancedStereo.d.ts +1 -3
  32. package/dist/script/ui/dialog/toolbox/sgroup.d.ts +1 -1
  33. package/dist/script/ui/state/constants.d.ts +0 -1
  34. package/dist/script/ui/state/editor/index.d.ts +0 -4
  35. package/dist/script/ui/state/handleHotkeysOverItem.d.ts +15 -0
  36. package/dist/script/ui/state/modal/form.d.ts +5 -16
  37. package/dist/script/ui/views/components/ContextMenu/ContextMenu.d.ts +0 -1
  38. package/dist/script/ui/views/components/ContextMenu/ContextMenuTrigger.d.ts +2 -2
  39. package/dist/script/ui/views/components/ContextMenu/contextMenu.types.d.ts +17 -6
  40. package/dist/script/ui/views/components/ContextMenu/hooks/useAtomEdit.d.ts +3 -0
  41. package/dist/script/ui/views/components/ContextMenu/hooks/useAtomStereo.d.ts +3 -0
  42. package/dist/script/ui/views/components/ContextMenu/hooks/useBondEdit.d.ts +3 -0
  43. package/dist/script/ui/views/components/ContextMenu/hooks/useBondSGroupAttach.d.ts +3 -0
  44. package/dist/script/ui/views/components/ContextMenu/hooks/useBondSGroupEdit.d.ts +3 -0
  45. package/dist/script/ui/views/components/ContextMenu/hooks/useBondTypeChange.d.ts +3 -0
  46. package/dist/script/ui/views/components/ContextMenu/hooks/useDelete.d.ts +3 -0
  47. package/dist/script/ui/views/components/ContextMenu/hooks/useFunctionalGroupEoc.d.ts +6 -0
  48. package/dist/script/ui/views/components/ContextMenu/hooks/useFunctionalGroupRemove.d.ts +3 -0
  49. package/dist/script/ui/views/components/ContextMenu/menuItems/AtomMenuItems.d.ts +3 -0
  50. package/dist/script/ui/views/components/ContextMenu/menuItems/BondMenuItems.d.ts +3 -0
  51. package/dist/script/ui/views/components/ContextMenu/menuItems/FunctionalGroupMenuItems.d.ts +3 -0
  52. package/dist/script/ui/views/components/ContextMenu/menuItems/SelectionMenuItems.d.ts +3 -0
  53. package/dist/script/ui/views/components/ContextMenu/{items/utils.d.ts → utils.d.ts} +1 -3
  54. package/dist/script/ui/views/components/Dialog/Dialog.d.ts +2 -2
  55. package/dist/script/ui/views/components/StructEditor/InfoPanel.d.ts +1 -3
  56. package/dist/script/ui/views/components/StructEditor/SGroupDataRender.d.ts +13 -0
  57. package/dist/script/ui/views/components/StructEditor/helpers.d.ts +4 -0
  58. package/dist/script/ui/views/modal/components/document/Open/Open.container.d.ts +0 -2
  59. package/dist/script/ui/views/modal/components/document/Save/Save.d.ts +1 -0
  60. package/dist/script/ui/views/modal/components/toolbox/Atom/Atom.container.d.ts +0 -2
  61. package/dist/script/ui/views/toolbars/toolbar.types.d.ts +1 -1
  62. package/package.json +8 -9
  63. package/dist/script/ui/component/ContextMenu/ContextMenu.d.ts +0 -3
  64. package/dist/script/ui/dialog/toolbox/sdata.d.ts +0 -19
  65. package/dist/script/ui/state/handleHotkeysOverAtom.d.ts +0 -7
  66. package/dist/script/ui/views/components/ContextMenu/items/AtomBatchOperations.d.ts +0 -20
  67. package/dist/script/ui/views/components/ContextMenu/items/AtomSingleOperations.d.ts +0 -19
  68. package/dist/script/ui/views/components/ContextMenu/items/BatchDelete.d.ts +0 -3
  69. package/dist/script/ui/views/components/ContextMenu/items/BondBatchOperations.d.ts +0 -20
  70. package/dist/script/ui/views/components/ContextMenu/items/BondSingleOperations.d.ts +0 -19
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
- export declare type ButtonName = 'layout' | 'clean' | 'arom' | 'dearom' | 'cip' | 'check' | 'analyse' | 'recognize' | 'miew' | 'settings' | 'help' | 'about' | 'fullscreen' | 'sgroup' | 'sgroup-data' | '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-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' | 'reaction-mapping-tools' | 'reaction-automap' | 'reaction-map' | 'reaction-unmap' | 'rgroup' | 'rgroup-label' | 'rgroup-fragment' | 'rgroup-attpoints' | 'shape' | 'shape-ellipse' | 'shape-rectangle' | 'shape-line' | 'text' | 'enhanced-stereo';
16
+ export declare type ButtonName = 'layout' | 'clean' | 'arom' | 'dearom' | 'cip' | 'check' | 'analyse' | 'recognize' | 'miew' | 'settings' | 'help' | 'about' | 'fullscreen' | '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-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' | 'reaction-mapping-tools' | 'reaction-automap' | 'reaction-map' | 'reaction-unmap' | 'rgroup' | 'rgroup-label' | 'rgroup-fragment' | 'rgroup-attpoints' | 'shape' | 'shape-ellipse' | 'shape-rectangle' | 'shape-line' | 'text' | 'enhanced-stereo';
@@ -16,7 +16,8 @@
16
16
  import { Action, Editor as KetcherEditor, Render, Struct } from 'ketcher-core';
17
17
  import { PipelineSubscription, Subscription } from 'subscription';
18
18
  import { Highlighter } from './highlighter';
19
- interface Selection {
19
+ import { contextMenuInfo } from '../ui/views/components/ContextMenu/contextMenu.types';
20
+ export interface Selection {
20
21
  atoms?: Array<number>;
21
22
  bonds?: Array<number>;
22
23
  enhancedFlags?: Array<number>;
@@ -37,6 +38,7 @@ declare class Editor implements KetcherEditor {
37
38
  x: number;
38
39
  y: number;
39
40
  };
41
+ contextMenu: contextMenuInfo;
40
42
  event: {
41
43
  message: Subscription;
42
44
  elementEdit: PipelineSubscription;
@@ -4,6 +4,8 @@ declare namespace _default {
4
4
  export { calcNewAtomPos };
5
5
  export { degrees };
6
6
  export { mergeBondsParams };
7
+ export { getOnlyNonGroupItems };
8
+ export { getNonGroupItemsAndAttachmentPoints };
7
9
  }
8
10
  export default _default;
9
11
  declare function calcAngle(pos0: any, pos1: any): number;
@@ -16,4 +18,31 @@ declare function mergeBondsParams(struct1: any, bond1: any, struct2: any, bond2:
16
18
  scale: number;
17
19
  cross: boolean;
18
20
  };
21
+ /**
22
+ * Get all items IDs that do not belong to sgroups
23
+ * @param items {{ atoms?: number[]; bonds?: number[] } | null}
24
+ * @param struct {Struct}
25
+ * @returns {{ atoms: number[], bonds: number[] }}
26
+ */
27
+ declare function getOnlyNonGroupItems(items: {
28
+ atoms?: number[] | undefined;
29
+ bonds?: number[] | undefined;
30
+ } | null, struct: Struct): {
31
+ atoms: number[];
32
+ bonds: number[];
33
+ };
34
+ /**
35
+ * Get all items IDs that do not belong to sgroups (except their attachment points)
36
+ * @param items {{ atoms?: number[]; bonds?: number[] } | null}
37
+ * @param struct {Struct}
38
+ * @returns {{ atoms: number[], bonds: number[] }}
39
+ */
40
+ declare function getNonGroupItemsAndAttachmentPoints(items: {
41
+ atoms?: number[] | undefined;
42
+ bonds?: number[] | undefined;
43
+ } | null, struct: Struct): {
44
+ atoms: number[];
45
+ bonds: number[];
46
+ };
19
47
  import { Vec2 } from "ketcher-core/dist/domain/entities/vec2";
48
+ import { Struct } from "ketcher-core/dist/domain/entities/struct";
@@ -0,0 +1,8 @@
1
+ import { Action } from 'ketcher-core';
2
+ import Editor from '../../Editor';
3
+ declare type MergeItems = {
4
+ atoms: Map<number, number>;
5
+ bonds: Map<number, number>;
6
+ };
7
+ export declare function dropAndMerge(editor: Editor, mergeItems: MergeItems, action?: Action): void;
8
+ export {};
@@ -0,0 +1,12 @@
1
+ import { Struct } from 'ketcher-core';
2
+ declare type Items = {
3
+ atoms?: number[];
4
+ bonds?: number[];
5
+ };
6
+ declare function getGroupIdsFromItemArrays(struct: Struct, items?: Items): number[];
7
+ declare type MergeItems = {
8
+ atoms: Map<number, number>;
9
+ bonds: Map<number, number>;
10
+ };
11
+ declare function getGroupIdsFromItemMaps(struct: Struct, mergeMaps: MergeItems | null): number[];
12
+ export { getGroupIdsFromItemArrays, getGroupIdsFromItemMaps };
@@ -0,0 +1,2 @@
1
+ import Editor from '../../Editor';
2
+ export declare function getMergeItems(editor: Editor, items: Record<string, number[]>): Record<string, Map<unknown, unknown>> | null;
@@ -19,8 +19,13 @@ declare class PasteTool {
19
19
  editor: Editor;
20
20
  struct: Struct;
21
21
  action: any;
22
+ templateAction: any;
23
+ dragCtx: any;
24
+ findItems: string[];
22
25
  mergeItems: any;
26
+ isSingleContractedGroup: boolean;
23
27
  constructor(editor: any, struct: any);
28
+ mousedown(event: any): void;
24
29
  mousemove(event: any): void;
25
30
  mouseup(): void;
26
31
  cancel(): void;
@@ -23,7 +23,7 @@ declare class SelectTool {
23
23
  isSelectionRunning(): boolean;
24
24
  mousedown(event: any): boolean;
25
25
  mousemove(event: any): boolean;
26
- mouseup(event: any): boolean;
26
+ mouseup(event: any): void;
27
27
  dblclick(event: any): true | undefined;
28
28
  mouseleave(_: any): void;
29
29
  selectElementsOnCanvas(elements: {
@@ -16,16 +16,15 @@
16
16
  import Editor from '../Editor';
17
17
  declare class SGroupTool {
18
18
  editor: Editor;
19
- type: any;
20
19
  lassoHelper: any;
21
20
  isNotActiveTool: boolean | undefined;
22
- constructor(editor: any, type: any);
21
+ constructor(editor: any);
23
22
  checkSelection(): void;
24
23
  mousedown(event: any): void;
25
24
  mousemove(event: any): void;
26
25
  mouseleave(event: any): void;
27
26
  mouseup(event: any): void;
28
27
  cancel(): void;
29
- static sgroupDialog(editor: any, id: any, defaultType: any): void;
28
+ static sgroupDialog(editor: any, id: any): void;
30
29
  }
31
30
  export default SGroupTool;
@@ -14,16 +14,21 @@
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
16
  import Editor from '../Editor';
17
+ declare type MergeItems = Record<string, Map<unknown, unknown>> | null;
17
18
  declare class TemplateTool {
18
19
  editor: Editor;
19
20
  mode: any;
20
21
  template: any;
21
22
  findItems: Array<string>;
23
+ mergeItems: MergeItems;
22
24
  dragCtx: any;
25
+ targetGroupsIds: Array<number>;
26
+ isSaltOrSolvent: boolean;
27
+ followAction: any;
23
28
  constructor(editor: any, tmpl: any);
24
- mousedown(event: any): true | undefined;
25
- mousemove(event: any): boolean;
26
- mouseup(event: any): boolean;
29
+ mousedown(event: any): void;
30
+ mousemove(event: any): true | undefined;
31
+ mouseup(event: any): true | undefined;
27
32
  cancel(e: any): void;
28
33
  mouseleave(e: any): void;
29
34
  }
@@ -0,0 +1,16 @@
1
+ import { Vec2 } from 'ketcher-core';
2
+ export declare function isCloseToEdgeOfScreen(event: any): {
3
+ isCloseToLeftEdgeOfScreen: boolean;
4
+ isCloseToTopEdgeOfScreen: boolean;
5
+ isCloseToRightEdgeOfScreen: boolean;
6
+ isCloseToBottomEdgeOfScreen: boolean;
7
+ };
8
+ export declare function isCloseToEdgeOfCanvas(event: any, canvasSize: any): {
9
+ isCloseToLeftEdgeOfCanvas: boolean;
10
+ isCloseToTopEdgeOfCanvas: boolean;
11
+ isCloseToRightEdgeOfCanvas: boolean;
12
+ isCloseToBottomEdgeOfCanvas: boolean;
13
+ };
14
+ export declare function calculateCanvasExtension(clientArea: any, currentCanvasSize: any, extensionVector: any): Vec2;
15
+ export declare function shiftAndExtendCanvasByVector(vector: Vec2, render: any): void;
16
+ export declare function scrollByVector(vector: Vec2, render: any): void;
@@ -13,11 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
- import { CSSProperties, Component } from 'react';
16
+ import { CSSProperties, Component, ReactNode } from 'react';
17
17
  interface PortalProps {
18
18
  isOpen: boolean;
19
19
  className?: string;
20
20
  style?: CSSProperties;
21
+ children: ReactNode;
21
22
  }
22
23
  declare type Props = PortalProps;
23
24
  declare class Portal extends Component<Props> {
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
16
  import { Dispatch } from 'redux';
17
- declare type ToolVariant = 'about' | 'analyse' | 'arom' | 'bond-any' | 'bond-hydrogen' | 'bond-aromatic' | 'bond-crossed' | 'bond-dative' | 'bond-double' | 'bond-doublearomatic' | 'bond-down' | 'bond-single' | 'bond-singlearomatic' | 'bond-singledouble' | 'bond-triple' | 'bond-up' | 'bond-updown' | 'chain' | 'charge-minus' | 'charge-plus' | 'check' | 'chiral-flag' | 'cip' | 'clean' | 'copy' | 'copy-image' | 'cut' | 'dearom' | 'dropdown' | 'enhanced-stereo' | 'erase' | 'fullscreen' | 'functional-groups' | 'generic-groups' | 'help' | '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' | 'settings' | 'sgroup' | 'sgroup-data' | '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 = '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' | 'chain' | 'charge-minus' | 'charge-plus' | 'check' | 'chiral-flag' | 'cip' | 'clean' | 'copy' | 'copy-image' | 'cut' | 'dearom' | 'dropdown' | 'enhanced-stereo' | 'erase' | 'fullscreen' | 'functional-groups' | 'generic-groups' | 'help' | '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' | '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 Editor = any;
19
19
  declare type Server = any;
20
20
  declare type Options = any;
@@ -38,7 +38,9 @@ declare const config: {
38
38
  hidden: (options: any) => boolean;
39
39
  };
40
40
  zoom: {
41
+ shortcut: string[];
41
42
  selected: (editor: any) => any;
43
+ action: (editor: any) => any;
42
44
  hidden: (options: any) => boolean;
43
45
  };
44
46
  'zoom-out': {
@@ -174,15 +176,6 @@ declare const config: {
174
176
  };
175
177
  hidden: (options: any) => boolean;
176
178
  };
177
- 'sgroup-data': {
178
- shortcut: string;
179
- title: string;
180
- action: {
181
- tool: string;
182
- opts: string;
183
- };
184
- hidden: (options: any) => boolean;
185
- };
186
179
  arrows: {
187
180
  hidden: (options: any) => boolean;
188
181
  };
@@ -401,6 +394,7 @@ declare const config: {
401
394
  hidden: (options: any) => boolean;
402
395
  };
403
396
  text: {
397
+ shortcut: string;
404
398
  title: string;
405
399
  action: {
406
400
  tool: string;
@@ -439,6 +433,7 @@ declare const config: {
439
433
  hidden: (options: any) => boolean;
440
434
  };
441
435
  arom: {
436
+ shortcut: string;
442
437
  title: string;
443
438
  action: {
444
439
  thunk: (dispatch: any, getState: any) => void;
@@ -447,6 +442,7 @@ declare const config: {
447
442
  hidden: (options: any) => boolean;
448
443
  };
449
444
  dearom: {
445
+ shortcut: string;
450
446
  title: string;
451
447
  action: {
452
448
  thunk: (dispatch: any, getState: any) => void;
@@ -464,6 +460,7 @@ declare const config: {
464
460
  hidden: (options: any) => boolean;
465
461
  };
466
462
  check: {
463
+ shortcut: string;
467
464
  title: string;
468
465
  action: {
469
466
  dialog: string;
@@ -472,6 +469,7 @@ declare const config: {
472
469
  hidden: (options: any) => boolean;
473
470
  };
474
471
  analyse: {
472
+ shortcut: string;
475
473
  title: string;
476
474
  action: {
477
475
  dialog: string;
@@ -518,6 +516,20 @@ declare const config: {
518
516
  };
519
517
  hidden: (options: any) => boolean;
520
518
  };
519
+ 'atom-props': {
520
+ title: string;
521
+ action: {
522
+ dialog: string;
523
+ };
524
+ hidden: (options: any) => boolean;
525
+ };
526
+ 'bond-props': {
527
+ title: string;
528
+ action: {
529
+ dialog: string;
530
+ };
531
+ hidden: (options: any) => boolean;
532
+ };
521
533
  undo: {
522
534
  shortcut: string;
523
535
  title: string;
@@ -25,6 +25,8 @@ declare namespace config {
25
25
  export { hidden_1 as hidden };
26
26
  }
27
27
  namespace arom {
28
+ const shortcut_2: string;
29
+ export { shortcut_2 as shortcut };
28
30
  const title_2: string;
29
31
  export { title_2 as title };
30
32
  export namespace action_2 {
@@ -38,6 +40,8 @@ declare namespace config {
38
40
  export { hidden_2 as hidden };
39
41
  }
40
42
  namespace dearom {
43
+ const shortcut_3: string;
44
+ export { shortcut_3 as shortcut };
41
45
  const title_3: string;
42
46
  export { title_3 as title };
43
47
  export namespace action_3 {
@@ -51,8 +55,8 @@ declare namespace config {
51
55
  export { hidden_3 as hidden };
52
56
  }
53
57
  namespace cip {
54
- const shortcut_2: string;
55
- export { shortcut_2 as shortcut };
58
+ const shortcut_4: string;
59
+ export { shortcut_4 as shortcut };
56
60
  const title_4: string;
57
61
  export { title_4 as title };
58
62
  export namespace action_4 {
@@ -66,6 +70,8 @@ declare namespace config {
66
70
  export { hidden_4 as hidden };
67
71
  }
68
72
  namespace check {
73
+ const shortcut_5: string;
74
+ export { shortcut_5 as shortcut };
69
75
  const title_5: string;
70
76
  export { title_5 as title };
71
77
  export namespace action_5 {
@@ -78,6 +84,8 @@ declare namespace config {
78
84
  export { hidden_5 as hidden };
79
85
  }
80
86
  namespace analyse {
87
+ const shortcut_6: string;
88
+ export { shortcut_6 as shortcut };
81
89
  const title_6: string;
82
90
  export { title_6 as title };
83
91
  export namespace action_6 {
@@ -115,15 +115,6 @@ declare var _default: {
115
115
  };
116
116
  hidden: (options: any) => boolean;
117
117
  };
118
- 'sgroup-data': {
119
- shortcut: string;
120
- title: string;
121
- action: {
122
- tool: string;
123
- opts: string;
124
- };
125
- hidden: (options: any) => boolean;
126
- };
127
118
  arrows: {
128
119
  hidden: (options: any) => boolean;
129
120
  };
@@ -342,6 +333,7 @@ declare var _default: {
342
333
  hidden: (options: any) => boolean;
343
334
  };
344
335
  text: {
336
+ shortcut: string;
345
337
  title: string;
346
338
  action: {
347
339
  tool: string;
@@ -1,7 +1,9 @@
1
1
  export const zoomList: number[];
2
2
  declare var _default: {
3
3
  zoom: {
4
+ shortcut: string[];
4
5
  selected: (editor: any) => any;
6
+ action: (editor: any) => any;
5
7
  hidden: (options: any) => boolean;
6
8
  };
7
9
  'zoom-out': {
@@ -1,5 +1,21 @@
1
1
  export function fromElement(selem: any): any;
2
2
  export function toElement(elem: any): any;
3
+ export function fromAtom(satom: any): {
4
+ alias: any;
5
+ label: any;
6
+ charge: any;
7
+ isotope: any;
8
+ explicitValence: any;
9
+ radical: any;
10
+ invRet: any;
11
+ exactChangeFlag: boolean;
12
+ ringBondCount: any;
13
+ substitutionCount: any;
14
+ unsaturatedAtom: boolean;
15
+ hCount: any;
16
+ stereoParity: any;
17
+ };
18
+ export function toAtom(atom: any): any;
3
19
  export function fromStereoLabel(stereoLabel: any): {
4
20
  type: null;
5
21
  orNumber?: undefined;
@@ -10,6 +10,7 @@
10
10
  export function getSdataDefault(schema: {} | undefined, context: any, fieldName: any): string;
11
11
  export namespace sdataCustomSchema {
12
12
  const key: string;
13
+ const title: string;
13
14
  const type: string;
14
15
  namespace properties {
15
16
  export namespace type_1 {
@@ -18,15 +19,16 @@ export namespace sdataCustomSchema {
18
19
  }
19
20
  export { type_1 as type };
20
21
  export namespace context {
21
- export const title: string;
22
+ const title_1: string;
23
+ export { title_1 as title };
22
24
  const _enum_1: string[];
23
25
  export { _enum_1 as enum };
24
26
  const _default: string;
25
27
  export { _default as default };
26
28
  }
27
29
  export namespace fieldName {
28
- const title_1: string;
29
- export { title_1 as title };
30
+ const title_2: string;
31
+ export { title_2 as title };
30
32
  const type_2: string;
31
33
  export { type_2 as type };
32
34
  const _default_1: string;
@@ -35,8 +37,8 @@ export namespace sdataCustomSchema {
35
37
  export const invalidMessage: string;
36
38
  }
37
39
  export namespace fieldValue {
38
- const title_2: string;
39
- export { title_2 as title };
40
+ const title_3: string;
41
+ export { title_3 as title };
40
42
  const type_3: string;
41
43
  export { type_3 as type };
42
44
  const _default_2: string;
@@ -38,7 +38,5 @@ interface TemplateLibCallProps {
38
38
  functionalGroups: Template[];
39
39
  }
40
40
  declare type Props = TemplateLibProps & TemplateLibCallProps;
41
- declare const _default: import("react-redux").ConnectedComponent<FC<Props>, import("react-redux").Omit<TemplateLibProps & TemplateLibCallProps & {
42
- children?: import("react").ReactNode;
43
- }, "onFilter" | "onTabChange" | "onSelect" | "onChangeGroup" | "onAttach" | "onCancel" | "onDelete" | "initialTab" | "renderOptions" | "functionalGroups" | "saltsAndSolvents"> & TemplateLibProps & TemplateLibCallProps>;
41
+ declare const _default: import("react-redux").ConnectedComponent<FC<Props>, import("react-redux").Omit<TemplateLibProps & TemplateLibCallProps, "onFilter" | "onTabChange" | "onSelect" | "onChangeGroup" | "onAttach" | "onCancel" | "onDelete" | "initialTab" | "renderOptions" | "functionalGroups" | "saltsAndSolvents"> & TemplateLibProps & TemplateLibCallProps>;
44
42
  export default _default;
@@ -1,4 +1,4 @@
1
- declare var _default: import("react-redux").ConnectedComponent<typeof Attach, import("react-redux").Omit<{
1
+ declare var _default: import("react-redux").ConnectedComponent<typeof Attach, import("react-redux").Omit<import("react").ClassAttributes<Attach> & {
2
2
  [x: string]: any;
3
3
  onInit: any;
4
4
  }, string | number>>;
@@ -0,0 +1,4 @@
1
+ export default SDataFieldset;
2
+ declare function SDataFieldset({ formState }: {
3
+ formState: any;
4
+ }): JSX.Element;
@@ -0,0 +1,4 @@
1
+ export default SGroupFieldset;
2
+ declare function SGroupFieldset({ formState }: {
3
+ formState: any;
4
+ }): JSX.Element;
@@ -38,7 +38,5 @@ interface EnhancedStereoCallProps {
38
38
  onOk: (res: any) => void;
39
39
  }
40
40
  declare type Props = EnhancedStereoProps & EnhancedStereoCallProps;
41
- declare const _default: import("react-redux").ConnectedComponent<FC<Props>, import("react-redux").Omit<EnhancedStereoProps & EnhancedStereoCallProps & {
42
- children?: import("react").ReactNode;
43
- }, "formState" | "struct">>;
41
+ declare const _default: import("react-redux").ConnectedComponent<FC<Props>, import("react-redux").Omit<EnhancedStereoProps & EnhancedStereoCallProps, "formState" | "struct">>;
44
42
  export default _default;
@@ -3,7 +3,7 @@ declare var _default: import("react-redux").ConnectedComponent<typeof Sgroup, im
3
3
  formState: any;
4
4
  }, "formState" | "dispatch">>;
5
5
  export default _default;
6
- declare function Sgroup({ formState, ...prop }: {
6
+ declare function Sgroup({ formState, ...props }: {
7
7
  [x: string]: any;
8
8
  formState: any;
9
9
  }): JSX.Element;
@@ -3,5 +3,4 @@ export namespace supportedSGroupTypes {
3
3
  const SRU: string;
4
4
  const SUP: string;
5
5
  const DAT: string;
6
- const GEN: string;
7
6
  }
@@ -14,10 +14,6 @@ export default function initEditor(dispatch: any, getState: any): {
14
14
  attrs: any;
15
15
  }>;
16
16
  onRemoveFG: (result: any) => Promise<any>;
17
- onSdataEdit: (sgroup: any) => Promise<{
18
- type: any;
19
- attrs: any;
20
- }>;
21
17
  onMessage: (msg: any) => void;
22
18
  onAromatizeStruct: (struct: any) => any;
23
19
  onDearomatizeStruct: (struct: any) => any;
@@ -0,0 +1,15 @@
1
+ import { Dispatch } from 'redux';
2
+ import { Editor } from '../../editor';
3
+ declare type TNewAction = {
4
+ tool?: string;
5
+ dialog?: string;
6
+ opts?: any;
7
+ };
8
+ declare type HandleHotkeyOverItemProps = {
9
+ hoveredItem: Record<string, number>;
10
+ newAction: TNewAction;
11
+ editor: Editor;
12
+ dispatch: Dispatch;
13
+ };
14
+ export declare function handleHotkeyOverItem(props: HandleHotkeyOverItemProps): void;
15
+ export {};
@@ -16,7 +16,7 @@ export function setDefaultSettings(): {
16
16
  errors: {};
17
17
  };
18
18
  };
19
- export function formReducer(state: any, action: any, formName: any): any;
19
+ export function formReducer(state: any, action: any): any;
20
20
  export namespace formsState {
21
21
  namespace atomProps {
22
22
  const errors: {};
@@ -123,18 +123,15 @@ export namespace formsState {
123
123
  const result_8: Record<string, any>;
124
124
  export { result_8 as result };
125
125
  }
126
- namespace sgroup {
126
+ namespace text {
127
127
  const errors_10: {};
128
128
  export { errors_10 as errors };
129
129
  const valid_9: boolean;
130
130
  export { valid_9 as valid };
131
- export namespace result_9 {
132
- const type_1: string;
133
- export { type_1 as type };
134
- }
131
+ const result_9: {};
135
132
  export { result_9 as result };
136
133
  }
137
- namespace text {
134
+ namespace attach {
138
135
  const errors_11: {};
139
136
  export { errors_11 as errors };
140
137
  const valid_10: boolean;
@@ -142,15 +139,7 @@ export namespace formsState {
142
139
  const result_10: {};
143
140
  export { result_10 as result };
144
141
  }
145
- namespace attach {
146
- const errors_12: {};
147
- export { errors_12 as errors };
148
- const valid_11: boolean;
149
- export { valid_11 as valid };
150
- const result_11: {};
151
- export { result_11 as result };
152
- }
153
- const sdata: {
142
+ const sgroup: {
154
143
  errors: {};
155
144
  valid: boolean;
156
145
  result: {
@@ -15,6 +15,5 @@
15
15
  ***************************************************************************/
16
16
  /// <reference types="react" />
17
17
  import 'react-contexify/ReactContexify.css';
18
- export declare const CONTEXT_MENU_ID = "ketcherBondAndAtomContextMenu";
19
18
  declare const ContextMenu: React.FC;
20
19
  export default ContextMenu;
@@ -13,6 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
- /// <reference types="react" />
17
- declare const ContextMenuTrigger: React.FC;
16
+ import { PropsWithChildren } from 'react';
17
+ declare const ContextMenuTrigger: React.FC<PropsWithChildren>;
18
18
  export default ContextMenuTrigger;
@@ -1,8 +1,19 @@
1
- import type { ItemProps, SubMenuProps } from 'react-contexify';
1
+ import { FunctionalGroup } from 'ketcher-core';
2
+ import type { PredicateParams } from 'react-contexify';
3
+ export declare enum CONTEXT_MENU_ID {
4
+ FOR_BONDS = "context-menu-for-bonds",
5
+ FOR_ATOMS = "context-menu-for-atoms",
6
+ FOR_SELECTION = "context-menu-for-selection",
7
+ FOR_FUNCTIONAL_GROUPS = "context-menu-for-functional-groups"
8
+ }
9
+ export declare type ItemData = unknown;
2
10
  export declare type ContextMenuShowProps = {
3
- selected: boolean;
4
- closestItem: any;
11
+ id: CONTEXT_MENU_ID;
12
+ functionalGroups?: FunctionalGroup[];
13
+ bondIds?: number[];
14
+ atomIds?: number[];
15
+ } | null;
16
+ export declare type ItemEventParams = PredicateParams<ContextMenuShowProps, ItemData>;
17
+ export declare type contextMenuInfo = {
18
+ [id in CONTEXT_MENU_ID]?: boolean;
5
19
  };
6
- export declare type ItemData = unknown;
7
- export declare type CustomItemProps = Omit<ItemProps, 'children'>;
8
- export declare type CustomSubMenuProps = Omit<SubMenuProps, 'children' | 'label'>;
@@ -0,0 +1,3 @@
1
+ import { ItemEventParams } from '../contextMenu.types';
2
+ declare const useAtomEdit: () => readonly [({ props }: ItemEventParams) => Promise<void>, ({ props }: ItemEventParams) => boolean];
3
+ export default useAtomEdit;
@@ -0,0 +1,3 @@
1
+ import { ItemEventParams } from '../contextMenu.types';
2
+ declare const useAtomStereo: () => readonly [({ props }: ItemEventParams) => Promise<void>, ({ props }: ItemEventParams) => boolean];
3
+ export default useAtomStereo;
@@ -0,0 +1,3 @@
1
+ import { ItemEventParams } from '../contextMenu.types';
2
+ declare const useBondEdit: () => readonly [({ props }: ItemEventParams) => Promise<void>, ({ props }: ItemEventParams) => boolean];
3
+ export default useBondEdit;
@@ -0,0 +1,3 @@
1
+ import { ItemEventParams } from '../contextMenu.types';
2
+ declare const useBondSGroupAttach: () => readonly [({ props }: ItemEventParams) => void, ({ props }: ItemEventParams) => boolean];
3
+ export default useBondSGroupAttach;
@@ -0,0 +1,3 @@
1
+ import { ItemEventParams } from '../contextMenu.types';
2
+ declare const useBondSGroupEdit: () => readonly [() => void, ({ props }: ItemEventParams) => boolean, () => boolean];
3
+ export default useBondSGroupEdit;