ketcher-react 2.24.0-rc.2 → 2.25.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 (58) hide show
  1. package/dist/components/Icon/utils/iconNameToIcon.d.ts +2 -0
  2. package/dist/components/MonomerPreview/AmbiguousMonomerPreview/AmbiguousMonomerPreview.d.ts +9 -0
  3. package/dist/components/MonomerPreview/AmbiguousMonomerPreview/AmbiguousMonomerPreview.styles.d.ts +29 -0
  4. package/dist/components/MonomerPreview/AmbiguousMonomerPreview/index.d.ts +3 -0
  5. package/dist/components/MonomerPreview/AmbiguousMonomerPreview/types.d.ts +46 -0
  6. package/dist/components/MonomerPreview/calculatePreviewPosition.d.ts +28 -0
  7. package/dist/components/MonomerPreview/constants.d.ts +9 -0
  8. package/dist/components/MonomerPreview/index.d.ts +3 -0
  9. package/dist/components/index.d.ts +1 -0
  10. package/dist/index.js +3769 -3068
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.modern.js +3758 -3070
  13. package/dist/index.modern.js.map +1 -1
  14. package/dist/script/builders/ketcher/ButtonName.d.ts +2 -1
  15. package/dist/script/editor/Editor.d.ts +7 -6
  16. package/dist/script/editor/shared/closest.types.d.ts +2 -2
  17. package/dist/script/editor/tool/arrow/arrow.types.d.ts +19 -0
  18. package/dist/script/editor/tool/arrow/arrowTool.d.ts +9 -0
  19. package/dist/script/editor/tool/arrow/commonArrow.d.ts +17 -0
  20. package/dist/script/editor/tool/arrow/multitailArrowAdd.d.ts +14 -0
  21. package/dist/script/editor/tool/arrow/multitailArrowMoveTool.d.ts +12 -0
  22. package/dist/script/editor/tool/arrow/reactionArrowAdd.d.ts +20 -0
  23. package/dist/script/editor/tool/arrow/reactionArrowMoveTool.d.ts +12 -0
  24. package/dist/script/editor/tool/helper/lasso.d.ts +3 -0
  25. package/dist/script/editor/tool/helper/locate.d.ts +2 -0
  26. package/dist/script/editor/tool/select.d.ts +5 -4
  27. package/dist/script/editor/utils/getItemCursor.d.ts +3 -0
  28. package/dist/script/ui/action/index.d.ts +16 -0
  29. package/dist/script/ui/action/tools.d.ts +16 -0
  30. package/dist/script/ui/component/form/MeasureInput/measure-input.d.ts +4 -1
  31. package/dist/script/ui/component/form/form/form.d.ts +3 -1
  32. package/dist/script/ui/data/schema/options-schema.d.ts +10 -0
  33. package/dist/script/ui/views/components/ContextMenu/ContextMenuTrigger.d.ts +2 -2
  34. package/dist/script/ui/views/components/ContextMenu/ContextMenuTrigger.utils.d.ts +4 -4
  35. package/dist/script/ui/views/components/ContextMenu/contextMenu.types.d.ts +37 -11
  36. package/dist/script/ui/views/components/ContextMenu/hooks/useAddAttachmentPoint.d.ts +3 -2
  37. package/dist/script/ui/views/components/ContextMenu/hooks/useAtomEdit.d.ts +3 -2
  38. package/dist/script/ui/views/components/ContextMenu/hooks/useAtomStereo.d.ts +3 -2
  39. package/dist/script/ui/views/components/ContextMenu/hooks/useBondEdit.d.ts +3 -2
  40. package/dist/script/ui/views/components/ContextMenu/hooks/useBondSGroupAttach.d.ts +3 -2
  41. package/dist/script/ui/views/components/ContextMenu/hooks/useBondSGroupEdit.d.ts +3 -2
  42. package/dist/script/ui/views/components/ContextMenu/hooks/useBondTypeChange.d.ts +3 -2
  43. package/dist/script/ui/views/components/ContextMenu/hooks/useDelete.d.ts +3 -2
  44. package/dist/script/ui/views/components/ContextMenu/hooks/useFunctionalGroupEoc.d.ts +3 -2
  45. package/dist/script/ui/views/components/ContextMenu/hooks/useFunctionalGroupRemove.d.ts +3 -2
  46. package/dist/script/ui/views/components/ContextMenu/hooks/useMultitailArrowTails.d.ts +11 -0
  47. package/dist/script/ui/views/components/ContextMenu/hooks/useRGroupAttachmentPointEdit.d.ts +3 -2
  48. package/dist/script/ui/views/components/ContextMenu/hooks/useRGroupAttachmentPointRemove.d.ts +3 -2
  49. package/dist/script/ui/views/components/ContextMenu/hooks/useRemoveAttachmentPoint.d.ts +3 -2
  50. package/dist/script/ui/views/components/ContextMenu/menuItems/AtomMenuItems.d.ts +2 -2
  51. package/dist/script/ui/views/components/ContextMenu/menuItems/BondMenuItems.d.ts +2 -2
  52. package/dist/script/ui/views/components/ContextMenu/menuItems/FunctionalGroupMenuItems.d.ts +2 -2
  53. package/dist/script/ui/views/components/ContextMenu/menuItems/MultitailArrowMenuItems.d.ts +2 -0
  54. package/dist/script/ui/views/components/ContextMenu/menuItems/RGroupAttachmentPointMenuItems.d.ts +2 -2
  55. package/dist/script/ui/views/components/ContextMenu/menuItems/SelectionMenuItems.d.ts +2 -2
  56. package/dist/script/ui/views/toolbars/toolbar.types.d.ts +2 -2
  57. package/package.json +1 -1
  58. package/dist/script/editor/tool/reactionarrow.d.ts +0 -31
@@ -13,4 +13,5 @@
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' | '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
+ import { MULTITAIL_ARROW_TOOL_NAME } from 'domain/constants';
17
+ 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' | typeof MULTITAIL_ARROW_TOOL_NAME | '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';
@@ -13,10 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
- import { Action, FloatingToolsParams, Editor as KetcherEditor, Render, Struct } from 'ketcher-core';
16
+ import { Action, FloatingToolsParams, Editor as KetcherEditor, Render, Struct, MULTITAIL_ARROW_KEY } from 'ketcher-core';
17
17
  import { PipelineSubscription, Subscription } from 'subscription';
18
18
  import { Highlighter } from './highlighter';
19
- import { contextMenuInfo } from '../ui/views/components/ContextMenu/contextMenu.types';
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
22
  import { Tool } from './tool/Tool';
@@ -28,6 +28,7 @@ export interface Selection {
28
28
  rxnArrows?: Array<number>;
29
29
  texts?: Array<number>;
30
30
  rgroupAttachmentPoints?: Array<number>;
31
+ [MULTITAIL_ARROW_KEY]?: Array<number>;
31
32
  }
32
33
  declare class Editor implements KetcherEditor {
33
34
  #private;
@@ -43,7 +44,7 @@ declare class Editor implements KetcherEditor {
43
44
  x: number;
44
45
  y: number;
45
46
  };
46
- contextMenu: contextMenuInfo;
47
+ contextMenu: ContextMenuInfo;
47
48
  rotateController: RotateController;
48
49
  event: {
49
50
  message: Subscription;
@@ -78,8 +79,8 @@ declare class Editor implements KetcherEditor {
78
79
  renderAndRecoordinateStruct(struct: Struct, needToCenterStruct?: boolean): Struct;
79
80
  struct(value?: Struct, needToCenterStruct?: boolean): Struct;
80
81
  structToAddFragment(value: Struct): Struct;
81
- setOptions(opts: string): false | import("ketcher-core/dist/application/render/render.types").RenderOptions;
82
- options(value?: any): import("ketcher-core/dist/application/render/render.types").RenderOptions;
82
+ setOptions(opts: string): false | import("ketcher-core").RenderOptions;
83
+ options(value?: any): import("ketcher-core").RenderOptions;
83
84
  zoom(value?: any, event?: WheelEvent): number;
84
85
  centerStruct(): void;
85
86
  zoomAccordingContent(struct: Struct): void;
@@ -99,7 +100,7 @@ declare class Editor implements KetcherEditor {
99
100
  handler: any;
100
101
  };
101
102
  unsubscribe(eventName: any, subscriber: any): void;
102
- findItem(event: any, maps: Array<string> | null, skip?: any): import(".").ClosestItemWithMap<unknown> | null;
103
+ findItem(event: any, maps: Array<string> | null, skip?: any): import(".").ClosestItemWithMap<unknown, string> | null;
103
104
  findMerge(srcItems: any, maps: any): {
104
105
  atoms: Map<any, any>;
105
106
  atomToFunctionalGroup: Map<any, any>;
@@ -4,6 +4,6 @@ export interface ClosestItem<T = Vec2> {
4
4
  dist: number;
5
5
  ref?: T | null;
6
6
  }
7
- export interface ClosestItemWithMap<T = unknown> extends ClosestItem<T> {
8
- map: string;
7
+ export interface ClosestItemWithMap<T = unknown, Map extends string = string> extends ClosestItem<T> {
8
+ map: Map;
9
9
  }
@@ -0,0 +1,19 @@
1
+ import { Tool } from '../Tool';
2
+ import { Vec2 } from 'domain/entities';
3
+ import { Action } from 'application/editor';
4
+ import { ClosestItemWithMap } from '../../shared/closest.types';
5
+ import { MultitailArrowReferencePosition } from 'application/render';
6
+ import { MULTITAIL_ARROW_KEY } from 'domain/constants';
7
+ export declare type ArrowAddTool = Required<Pick<Tool, 'mousemove' | 'mouseup' | 'mousedown'>>;
8
+ export declare type ReactionArrowClosestItem = ClosestItemWithMap<Vec2, 'rxnArrows'>;
9
+ export declare type MultitailArrowClosestItem = ClosestItemWithMap<MultitailArrowReferencePosition, typeof MULTITAIL_ARROW_KEY>;
10
+ export interface CommonArrowDragContext<CI> {
11
+ originalPosition: Vec2;
12
+ action: Action | null;
13
+ closestItem: CI;
14
+ }
15
+ export interface ArrowMoveTool<CI> {
16
+ mousedown: (event: PointerEvent, closestItem: CI) => CommonArrowDragContext<CI>;
17
+ mousemove: (event: PointerEvent, dragContext: CommonArrowDragContext<CI>) => Action;
18
+ mouseup: (event: PointerEvent, dragContext: CommonArrowDragContext<CI>) => Action | null;
19
+ }
@@ -0,0 +1,9 @@
1
+ import Editor from '../../Editor';
2
+ import { Vec2 } from 'ketcher-core';
3
+ export declare abstract class ArrowTool {
4
+ protected readonly editor: Editor;
5
+ constructor(editor: Editor);
6
+ protected get render(): import("ketcher-core").Render;
7
+ protected get reStruct(): import("ketcher-core/dist/application/render/restruct/restruct").default;
8
+ protected getOffset(event: PointerEvent, original: Vec2): Vec2;
9
+ }
@@ -0,0 +1,17 @@
1
+ import { Tool } from '../Tool';
2
+ import Editor from '../../Editor';
3
+ import { MULTITAIL_ARROW_TOOL_NAME, RxnArrowMode } from 'ketcher-core';
4
+ import { CommonArrowDragContext, MultitailArrowClosestItem, ReactionArrowClosestItem } from './arrow.types';
5
+ import { ArrowTool } from './arrowTool';
6
+ export declare class CommonArrowTool extends ArrowTool implements Tool {
7
+ static isDragContextMultitail(dragContext: CommonArrowDragContext<MultitailArrowClosestItem | ReactionArrowClosestItem>): dragContext is CommonArrowDragContext<MultitailArrowClosestItem>;
8
+ static isDragContextReaction(dragContext: CommonArrowDragContext<MultitailArrowClosestItem | ReactionArrowClosestItem>): dragContext is CommonArrowDragContext<ReactionArrowClosestItem>;
9
+ private dragContext;
10
+ private addTool;
11
+ private multitailMoveTool;
12
+ private reactionMoveTool;
13
+ constructor(editor: Editor, mode: RxnArrowMode | typeof MULTITAIL_ARROW_TOOL_NAME);
14
+ mousedown(event: PointerEvent): void;
15
+ mousemove(event: PointerEvent): void;
16
+ mouseup(event: PointerEvent): void;
17
+ }
@@ -0,0 +1,14 @@
1
+ import { ArrowAddTool } from './arrow.types';
2
+ import Editor from '../../Editor';
3
+ export declare class MultitailArrowAddTool implements ArrowAddTool {
4
+ private editor;
5
+ static MIN_HEIGHT: number;
6
+ static MIN_WIDTH: number;
7
+ constructor(editor: Editor);
8
+ private get render();
9
+ private get reStruct();
10
+ mousedown(): void;
11
+ mousemove(): void;
12
+ mouseup(event: MouseEvent): void;
13
+ private getArrowWithMinimalSizeEnd;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { ArrowMoveTool, CommonArrowDragContext, MultitailArrowClosestItem } from './arrow.types';
2
+ import { Action } from 'ketcher-core';
3
+ import { ArrowTool } from './arrowTool';
4
+ export declare class MultitailArrowMoveTool extends ArrowTool implements ArrowMoveTool<MultitailArrowClosestItem> {
5
+ mousedown(event: PointerEvent, closestItem: MultitailArrowClosestItem): {
6
+ originalPosition: import("ketcher-core").Vec2;
7
+ action: null;
8
+ closestItem: MultitailArrowClosestItem;
9
+ };
10
+ mousemove(event: PointerEvent, dragContext: CommonArrowDragContext<MultitailArrowClosestItem>): Action;
11
+ mouseup(event: PointerEvent, dragContext: CommonArrowDragContext<MultitailArrowClosestItem>): any;
12
+ }
@@ -0,0 +1,20 @@
1
+ import { RxnArrowMode } from 'ketcher-core';
2
+ import { Editor } from '../../Editor';
3
+ import { ArrowAddTool } from './arrow.types';
4
+ export declare class ReactionArrowAddTool implements ArrowAddTool {
5
+ private editor;
6
+ private mode;
7
+ static MIN_LENGTH: number;
8
+ static DEFAULT_LENGTH: number;
9
+ private dragCtx;
10
+ constructor(editor: Editor, mode: RxnArrowMode);
11
+ private get render();
12
+ private get reStruct();
13
+ mousedown(event: MouseEvent): void;
14
+ mousemove(event: MouseEvent): void;
15
+ mouseup(event: MouseEvent): void;
16
+ private getArrowWithMinimalLengthEnd;
17
+ private addNewArrowWithDragging;
18
+ private addNewArrowWithClicking;
19
+ private updateResizingState;
20
+ }
@@ -0,0 +1,12 @@
1
+ import { ArrowMoveTool, CommonArrowDragContext, ReactionArrowClosestItem } from './arrow.types';
2
+ import { ArrowTool } from './arrowTool';
3
+ export declare class ReactionArrowMoveTool extends ArrowTool implements ArrowMoveTool<ReactionArrowClosestItem> {
4
+ private updateResizingState;
5
+ mousedown(event: PointerEvent, closestItem: ReactionArrowClosestItem): {
6
+ originalPosition: import("ketcher-core").Vec2;
7
+ action: null;
8
+ closestItem: ReactionArrowClosestItem;
9
+ };
10
+ mousemove(event: PointerEvent, dragContext: CommonArrowDragContext<ReactionArrowClosestItem>): import("ketcher-core").Action;
11
+ mouseup(_event: PointerEvent, dragContext: CommonArrowDragContext<ReactionArrowClosestItem>): any;
12
+ }
@@ -32,6 +32,7 @@ declare class LassoHelper {
32
32
  texts: number[];
33
33
  rgroupAttachmentPoints: number[];
34
34
  images: number[];
35
+ multitailArrows: number[];
35
36
  };
36
37
  begin(event: any): void;
37
38
  running(): boolean;
@@ -46,6 +47,7 @@ declare class LassoHelper {
46
47
  texts: number[];
47
48
  rgroupAttachmentPoints: number[];
48
49
  images: number[];
50
+ multitailArrows: number[];
49
51
  } | null;
50
52
  update(): void;
51
53
  end(): {
@@ -59,6 +61,7 @@ declare class LassoHelper {
59
61
  texts: number[];
60
62
  rgroupAttachmentPoints: number[];
61
63
  images: number[];
64
+ multitailArrows: number[];
62
65
  };
63
66
  cancel(): void;
64
67
  }
@@ -25,6 +25,7 @@ declare function getElementsInRectangle(restruct: ReStruct, p0: any, p1: any): {
25
25
  texts: number[];
26
26
  rgroupAttachmentPoints: number[];
27
27
  images: number[];
28
+ multitailArrows: number[];
28
29
  };
29
30
  declare function getElementsInPolygon(restruct: ReStruct, rr: any): {
30
31
  atoms: number[];
@@ -37,6 +38,7 @@ declare function getElementsInPolygon(restruct: ReStruct, rr: any): {
37
38
  texts: number[];
38
39
  rgroupAttachmentPoints: number[];
39
40
  images: number[];
41
+ multitailArrows: number[];
40
42
  };
41
43
  declare const _default: {
42
44
  inRectangle: typeof getElementsInRectangle;
@@ -24,16 +24,17 @@ declare class SelectTool implements Tool {
24
24
  private previousMouseMoveEvent?;
25
25
  isMouseDown: boolean;
26
26
  readonly isMoving = false;
27
+ private multitailArrowMoveTool;
28
+ private reactionArrowMoveTool;
27
29
  constructor(editor: Editor, mode: SelectMode);
28
30
  isSelectionRunning(): boolean;
29
- mousedown(event: any): true | undefined;
30
- mousemove(event: any): boolean;
31
- mouseup(event: any): void;
31
+ mousedown(event: PointerEvent): true | undefined;
32
+ mousemove(event: PointerEvent): boolean;
33
+ mouseup(event: PointerEvent): void;
32
34
  dblclick(event: any): true | undefined;
33
35
  mouseleave(): void;
34
36
  private selectElementsOnCanvas;
35
37
  private isDraggingStructureOnSaltOrSolvent;
36
- private updateArrowResizingState;
37
38
  private isCloseToEdgeOfCanvas;
38
39
  private handleMoveCloseToEdgeOfCanvas;
39
40
  private moveViewBox;
@@ -0,0 +1,3 @@
1
+ import { ClosestItemWithMap } from '../shared/closest.types';
2
+ import { Render } from 'ketcher-core';
3
+ export declare function getItemCursor(render: Render, item?: ClosestItemWithMap | null): string;
@@ -215,6 +215,14 @@ declare const config: {
215
215
  };
216
216
  hidden: (options: any) => boolean;
217
217
  };
218
+ 'reaction-arrow-retrosynthetic': {
219
+ title: string;
220
+ action: {
221
+ tool: string;
222
+ opts: import("ketcher-core").RxnArrowMode;
223
+ };
224
+ hidden: (options: any) => boolean;
225
+ };
218
226
  'reaction-arrow-both-ends-filled-triangle': {
219
227
  title: string;
220
228
  action: {
@@ -311,6 +319,14 @@ declare const config: {
311
319
  };
312
320
  hidden: (options: any) => boolean;
313
321
  };
322
+ "reaction-arrow-multitail": {
323
+ title: string;
324
+ action: {
325
+ tool: string;
326
+ opts: string;
327
+ };
328
+ hidden: (options: any) => boolean;
329
+ };
314
330
  'reaction-plus': {
315
331
  title: string;
316
332
  action: {
@@ -154,6 +154,14 @@ declare const _default: {
154
154
  };
155
155
  hidden: (options: any) => boolean;
156
156
  };
157
+ 'reaction-arrow-retrosynthetic': {
158
+ title: string;
159
+ action: {
160
+ tool: string;
161
+ opts: RxnArrowMode;
162
+ };
163
+ hidden: (options: any) => boolean;
164
+ };
157
165
  'reaction-arrow-both-ends-filled-triangle': {
158
166
  title: string;
159
167
  action: {
@@ -250,6 +258,14 @@ declare const _default: {
250
258
  };
251
259
  hidden: (options: any) => boolean;
252
260
  };
261
+ "reaction-arrow-multitail": {
262
+ title: string;
263
+ action: {
264
+ tool: string;
265
+ opts: string;
266
+ };
267
+ hidden: (options: any) => boolean;
268
+ };
253
269
  'reaction-plus': {
254
270
  title: string;
255
271
  action: {
@@ -1,9 +1,12 @@
1
1
  export default MeasureInput;
2
- declare function MeasureInput({ schema, value, onChange, name, className, ...rest }: {
2
+ declare function MeasureInput({ schema, extraSchema: _, value, extraValue, onChange, onExtraChange, name, className, ...rest }: {
3
3
  [x: string]: any;
4
4
  schema: any;
5
+ extraSchema: any;
5
6
  value: any;
7
+ extraValue: any;
6
8
  onChange: any;
9
+ onExtraChange: any;
7
10
  name: any;
8
11
  className: any;
9
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -13,10 +13,12 @@ declare class Form extends Component<any, any, any> {
13
13
  };
14
14
  updateState(newState: any): void;
15
15
  componentDidUpdate(prevProps: any): void;
16
- field(name: any, onChange: any): {
16
+ field(name: any, onChange: any, extraName: any): {
17
17
  dataError: any;
18
18
  value: any;
19
+ extraValue: any;
19
20
  onChange: (val: any) => void;
21
+ onExtraChange: (val: any) => void;
20
22
  };
21
23
  render(): import("react/jsx-runtime").JSX.Element;
22
24
  }
@@ -18,6 +18,16 @@ declare type ExtendedSchema = SchemaObject & {
18
18
  enumNames?: Array<string>;
19
19
  default?: any;
20
20
  };
21
+ export declare enum MeasurementUnits {
22
+ Px = "px",
23
+ Cm = "cm",
24
+ Pt = "pt",
25
+ Inch = "inch"
26
+ }
27
+ export declare enum ImageResolution {
28
+ high = "600",
29
+ low = "72"
30
+ }
21
31
  export declare const SERVER_OPTIONS: string[];
22
32
  export declare const MIEW_OPTIONS: string[];
23
33
  declare const optionsSchema: ExtendedSchema;
@@ -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
- import { PropsWithChildren } from 'react';
17
- declare const ContextMenuTrigger: React.FC<PropsWithChildren>;
16
+ import { FC, PropsWithChildren } from 'react';
17
+ declare const ContextMenuTrigger: FC<PropsWithChildren>;
18
18
  export default ContextMenuTrigger;
@@ -1,7 +1,7 @@
1
1
  import { FunctionalGroup } from 'ketcher-core';
2
- import Editor from 'src/script/editor';
3
- import { ClosestItem, ContextMenuShowProps, GetIsItemInSelectionArgs } from './contextMenu.types';
2
+ import Editor, { ClosestItemWithMap } from 'src/script/editor';
3
+ import { ContextMenuProps, GetIsItemInSelectionArgs } from './contextMenu.types';
4
4
  import { Selection } from '../../../../editor/Editor';
5
5
  export declare const getIsItemInSelection: ({ item, selection, selectedSGroupsIds, selectedFunctionalGroups, }: GetIsItemInSelectionArgs) => boolean;
6
- export declare function getMenuPropsForClosestItem(editor: Editor, closestItem: ClosestItem): ContextMenuShowProps | null;
7
- export declare function getMenuPropsForSelection(selection: Selection | null, selectedFunctionalGroups: Map<number, FunctionalGroup>): ContextMenuShowProps | null;
6
+ export declare function getMenuPropsForClosestItem(editor: Editor, closestItem: ClosestItemWithMap): ContextMenuProps | null;
7
+ export declare function getMenuPropsForSelection(selection: Selection | null, selectedFunctionalGroups: Map<number, FunctionalGroup>): ContextMenuProps | null;
@@ -6,23 +6,48 @@ export declare enum CONTEXT_MENU_ID {
6
6
  FOR_ATOMS = "context-menu-for-atoms",
7
7
  FOR_SELECTION = "context-menu-for-selection",
8
8
  FOR_FUNCTIONAL_GROUPS = "context-menu-for-functional-groups",
9
- FOR_R_GROUP_ATTACHMENT_POINT = "context-menu-for-rgroup-attachment-point"
9
+ FOR_R_GROUP_ATTACHMENT_POINT = "context-menu-for-rgroup-attachment-point",
10
+ FOR_MULTITAIL_ARROW = "context-menu-for-multiple-arrowed"
10
11
  }
11
12
  export declare type ItemData = unknown;
12
- export declare type ContextMenuShowProps = {
13
+ interface BaseContextMenuProps {
13
14
  id: CONTEXT_MENU_ID;
14
- functionalGroups?: FunctionalGroup[];
15
- bondIds?: number[];
16
- atomIds?: number[];
15
+ }
16
+ interface WithExtraItems {
17
17
  extraItemsSelected?: boolean;
18
- rgroupAttachmentPoints?: number[];
19
- } | null;
20
- export interface MenuItemsProps {
18
+ }
19
+ export interface BondsContextMenuProps extends BaseContextMenuProps, WithExtraItems {
20
+ id: CONTEXT_MENU_ID.FOR_BONDS;
21
+ bondIds: Array<number>;
22
+ }
23
+ export interface AtomContextMenuProps extends BaseContextMenuProps, WithExtraItems {
24
+ id: CONTEXT_MENU_ID.FOR_ATOMS;
25
+ atomIds: Array<number>;
26
+ }
27
+ export interface SelectionContextMenuProps extends BaseContextMenuProps, Partial<Pick<BondsContextMenuProps, 'bondIds'>>, Partial<Pick<AtomContextMenuProps, 'atomIds'>> {
28
+ id: CONTEXT_MENU_ID.FOR_SELECTION;
29
+ }
30
+ export interface FunctionalGroupsContextMenuProps extends BaseContextMenuProps {
31
+ id: CONTEXT_MENU_ID.FOR_FUNCTIONAL_GROUPS;
32
+ functionalGroups: FunctionalGroup[];
33
+ }
34
+ export interface RGroupAttachmentPointContextMenuProps extends BaseContextMenuProps, WithExtraItems {
35
+ id: CONTEXT_MENU_ID.FOR_R_GROUP_ATTACHMENT_POINT;
36
+ rgroupAttachmentPoints: Array<number>;
37
+ atomIds?: AtomContextMenuProps['atomIds'];
38
+ }
39
+ export interface MultitailArrowContextMenuProps {
40
+ id: CONTEXT_MENU_ID.FOR_MULTITAIL_ARROW;
41
+ itemId: number;
42
+ tailId: number | null;
43
+ }
44
+ export declare type ContextMenuProps = BondsContextMenuProps | AtomContextMenuProps | SelectionContextMenuProps | FunctionalGroupsContextMenuProps | RGroupAttachmentPointContextMenuProps | MultitailArrowContextMenuProps;
45
+ export interface MenuItemsProps<T extends ContextMenuProps> {
21
46
  triggerEvent?: TriggerEvent;
22
- propsFromTrigger?: ContextMenuShowProps;
47
+ propsFromTrigger?: T;
23
48
  }
24
- export declare type ItemEventParams = PredicateParams<ContextMenuShowProps, ItemData>;
25
- export declare type contextMenuInfo = {
49
+ export declare type ItemEventParams<T extends ContextMenuProps = ContextMenuProps> = PredicateParams<T, ItemData>;
50
+ export declare type ContextMenuInfo = {
26
51
  [id in CONTEXT_MENU_ID]?: boolean;
27
52
  };
28
53
  export declare enum ContextMenuTriggerType {
@@ -41,3 +66,4 @@ export interface GetIsItemInSelectionArgs {
41
66
  selectedFunctionalGroups: Map<number, FunctionalGroup>;
42
67
  selectedSGroupsIds: Set<number>;
43
68
  }
69
+ export {};
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useAddAttachmentPoint: () => (({ props }: ItemEventParams) => Promise<void>)[];
1
+ import { AtomContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<AtomContextMenuProps>;
3
+ declare const useAddAttachmentPoint: () => (({ props }: Params) => Promise<void>)[];
3
4
  export default useAddAttachmentPoint;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useAtomEdit: () => readonly [({ props }: ItemEventParams) => Promise<void>, ({ props }: ItemEventParams) => boolean];
1
+ import { AtomContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<AtomContextMenuProps>;
3
+ declare const useAtomEdit: () => readonly [({ props }: Params) => Promise<void>, ({ props }: Params) => boolean];
3
4
  export default useAtomEdit;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useAtomStereo: () => readonly [({ props }: ItemEventParams) => Promise<void>, ({ props }: ItemEventParams) => boolean];
1
+ import { AtomContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<AtomContextMenuProps>;
3
+ declare const useAtomStereo: () => readonly [({ props }: Params) => Promise<void>, ({ props }: Params) => boolean];
3
4
  export default useAtomStereo;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useBondEdit: () => readonly [({ props }: ItemEventParams) => Promise<void>, ({ props }: ItemEventParams) => boolean];
1
+ import { BondsContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<BondsContextMenuProps>;
3
+ declare const useBondEdit: () => readonly [({ props }: Params) => Promise<void>, ({ props }: Params) => boolean];
3
4
  export default useBondEdit;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useBondSGroupAttach: () => readonly [({ props }: ItemEventParams) => void, ({ props }: ItemEventParams) => boolean];
1
+ import { BondsContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<BondsContextMenuProps>;
3
+ declare const useBondSGroupAttach: () => readonly [({ props }: Params) => void, ({ props }: Params) => boolean];
3
4
  export default useBondSGroupAttach;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useBondSGroupEdit: () => readonly [() => void, ({ props }: ItemEventParams) => boolean, () => boolean];
1
+ import { BondsContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<BondsContextMenuProps>;
3
+ declare const useBondSGroupEdit: () => readonly [() => void, ({ props }: Params) => boolean, () => boolean];
3
4
  export default useBondSGroupEdit;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useBondTypeChange: () => readonly [({ id, props }: ItemEventParams) => void, ({ props }: ItemEventParams) => boolean];
1
+ import { BondsContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<BondsContextMenuProps>;
3
+ declare const useBondTypeChange: () => readonly [({ id, props }: Params) => void, ({ props }: Params) => boolean];
3
4
  export default useBondTypeChange;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useDelete: () => ({ props }: ItemEventParams) => Promise<void>;
1
+ import { ItemEventParams, SelectionContextMenuProps } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<SelectionContextMenuProps>;
3
+ declare const useDelete: () => ({ props }: Params) => Promise<void>;
3
4
  export default useDelete;
@@ -1,6 +1,7 @@
1
- import { ItemEventParams } from '../contextMenu.types';
1
+ import { FunctionalGroupsContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<FunctionalGroupsContextMenuProps>;
2
3
  /**
3
4
  * Fullname: useFunctionalGroupExpandOrContract
4
5
  */
5
- declare const useFunctionalGroupEoc: () => readonly [({ props }: ItemEventParams, toExpand: boolean) => void, ({ props }: ItemEventParams, toExpand: boolean) => boolean, ({ props }: ItemEventParams) => boolean];
6
+ declare const useFunctionalGroupEoc: () => readonly [({ props }: Params, toExpand: boolean) => void, ({ props }: Params, toExpand: boolean) => boolean, ({ props }: Params) => boolean];
6
7
  export default useFunctionalGroupEoc;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useFunctionalGroupRemove: () => ({ props }: ItemEventParams) => void;
1
+ import { FunctionalGroupsContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<FunctionalGroupsContextMenuProps>;
3
+ declare const useFunctionalGroupRemove: () => ({ props }: Params) => void;
3
4
  export default useFunctionalGroupRemove;
@@ -0,0 +1,11 @@
1
+ import { ItemEventParams, MultitailArrowContextMenuProps } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<MultitailArrowContextMenuProps>;
3
+ export declare const useMultitailArrowTailsAdd: () => {
4
+ addTail: ({ props }: Params) => void;
5
+ isAddTailDisabled: ({ props }: Params) => boolean;
6
+ };
7
+ export declare const useMultitailArrowTailsRemove: () => {
8
+ removeTail: ({ props }: Params) => void;
9
+ removeTailHidden: ({ props }: Params) => boolean;
10
+ };
11
+ export {};
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useRGroupAttachmentPointEdit: () => readonly [({ props }: ItemEventParams) => void, ({ props }: ItemEventParams) => boolean, ({ props }: ItemEventParams) => boolean];
1
+ import { ItemEventParams, RGroupAttachmentPointContextMenuProps } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<RGroupAttachmentPointContextMenuProps>;
3
+ declare const useRGroupAttachmentPointEdit: () => readonly [({ props }: Params) => void, ({ props }: Params) => boolean, ({ props }: Params) => boolean];
3
4
  export default useRGroupAttachmentPointEdit;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useDelete: () => ({ props }: ItemEventParams) => Promise<void>;
1
+ import { ItemEventParams, RGroupAttachmentPointContextMenuProps } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<RGroupAttachmentPointContextMenuProps>;
3
+ declare const useDelete: () => ({ props }: Params) => Promise<void>;
3
4
  export default useDelete;
@@ -1,3 +1,4 @@
1
- import { ItemEventParams } from '../contextMenu.types';
2
- declare const useRemoveAttachmentPoint: () => (({ props }: ItemEventParams) => Promise<void>)[];
1
+ import { AtomContextMenuProps, ItemEventParams } from '../contextMenu.types';
2
+ declare type Params = ItemEventParams<AtomContextMenuProps>;
3
+ declare const useRemoveAttachmentPoint: () => (({ props }: Params) => Promise<void>)[];
3
4
  export default useRemoveAttachmentPoint;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { MenuItemsProps } from '../contextMenu.types';
3
- declare const AtomMenuItems: FC<MenuItemsProps>;
2
+ import { AtomContextMenuProps, MenuItemsProps } from '../contextMenu.types';
3
+ declare const AtomMenuItems: FC<MenuItemsProps<AtomContextMenuProps>>;
4
4
  export default AtomMenuItems;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { MenuItemsProps } from '../contextMenu.types';
3
- declare const BondMenuItems: FC<MenuItemsProps>;
2
+ import { BondsContextMenuProps, MenuItemsProps } from '../contextMenu.types';
3
+ declare const BondMenuItems: FC<MenuItemsProps<BondsContextMenuProps>>;
4
4
  export default BondMenuItems;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { MenuItemsProps } from '../contextMenu.types';
3
- declare const FunctionalGroupMenuItems: FC<MenuItemsProps>;
2
+ import { FunctionalGroupsContextMenuProps, MenuItemsProps } from '../contextMenu.types';
3
+ declare const FunctionalGroupMenuItems: FC<MenuItemsProps<FunctionalGroupsContextMenuProps>>;
4
4
  export default FunctionalGroupMenuItems;
@@ -0,0 +1,2 @@
1
+ import { MenuItemsProps, MultitailArrowContextMenuProps } from '../contextMenu.types';
2
+ export declare function MultitailArrowMenuItems(props: MenuItemsProps<MultitailArrowContextMenuProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { MenuItemsProps } from '../contextMenu.types';
3
- declare const RGroupAttachmentPointMenuItems: FC<MenuItemsProps>;
2
+ import { MenuItemsProps, RGroupAttachmentPointContextMenuProps } from '../contextMenu.types';
3
+ declare const RGroupAttachmentPointMenuItems: FC<MenuItemsProps<RGroupAttachmentPointContextMenuProps>>;
4
4
  export default RGroupAttachmentPointMenuItems;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { MenuItemsProps } from '../contextMenu.types';
3
- declare const SelectionMenuItems: FC<MenuItemsProps>;
2
+ import { MenuItemsProps, SelectionContextMenuProps } from '../contextMenu.types';
3
+ declare const SelectionMenuItems: FC<MenuItemsProps<SelectionContextMenuProps>>;
4
4
  export default SelectionMenuItems;