ketcher-react 3.8.0-dev.1 → 3.8.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 (39) hide show
  1. package/dist/cjs/components/Icon/utils/iconNameToIcon.d.ts +1 -0
  2. package/dist/cjs/index.css +1 -1
  3. package/dist/cjs/index.css.map +1 -1
  4. package/dist/cjs/index.js +1429 -1223
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/{index.modern-5d5e11f2.js → index.modern-e42372a4.js} +67 -12
  7. package/dist/cjs/index.modern-e42372a4.js.map +1 -0
  8. package/dist/cjs/script/editor/Editor.d.ts +11 -9
  9. package/dist/cjs/script/editor/tool/create-monomer.d.ts +0 -1
  10. package/dist/cjs/script/ui/state/editor/selectors/index.d.ts +1 -1
  11. package/dist/cjs/script/ui/views/components/AttachmentPointEditPopup/AttachmentPointEditPopup.d.ts +9 -0
  12. package/dist/cjs/script/ui/views/components/ContextMenu/hooks/useMakeLeavingGroupAtomMenuItem.d.ts +9 -0
  13. package/dist/cjs/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.types.d.ts +1 -1
  14. package/dist/cjs/script/ui/views/components/MonomerCreationWizard/components/AttachmentPoint/AttachmentPoint.d.ts +7 -0
  15. package/dist/components/Icon/utils/iconNameToIcon.d.ts +1 -0
  16. package/dist/index.css +1 -1
  17. package/dist/index.css.map +1 -1
  18. package/dist/index.js +1430 -1224
  19. package/dist/index.js.map +1 -1
  20. package/dist/{index.modern-7ce21378.js → index.modern-1aebb8e6.js} +67 -12
  21. package/dist/index.modern-1aebb8e6.js.map +1 -0
  22. package/dist/script/editor/Editor.d.ts +11 -9
  23. package/dist/script/editor/tool/create-monomer.d.ts +0 -1
  24. package/dist/script/ui/state/editor/selectors/index.d.ts +1 -1
  25. package/dist/script/ui/views/components/AttachmentPointEditPopup/AttachmentPointEditPopup.d.ts +9 -0
  26. package/dist/script/ui/views/components/ContextMenu/hooks/useMakeLeavingGroupAtomMenuItem.d.ts +9 -0
  27. package/dist/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.types.d.ts +1 -1
  28. package/dist/script/ui/views/components/MonomerCreationWizard/components/AttachmentPoint/AttachmentPoint.d.ts +7 -0
  29. package/package.json +1 -1
  30. package/dist/cjs/index.modern-5d5e11f2.js.map +0 -1
  31. package/dist/cjs/script/ui/state/editor/actions/monomerCreation.d.ts +0 -15
  32. package/dist/cjs/script/ui/state/editor/middlewares/monomerCreation.d.ts +0 -2
  33. package/dist/cjs/script/ui/views/components/ContextMenu/hooks/useAddAttachmentPoint.d.ts +0 -4
  34. package/dist/cjs/script/ui/views/components/ContextMenu/hooks/useRemoveAttachmentPoint.d.ts +0 -4
  35. package/dist/index.modern-7ce21378.js.map +0 -1
  36. package/dist/script/ui/state/editor/actions/monomerCreation.d.ts +0 -15
  37. package/dist/script/ui/state/editor/middlewares/monomerCreation.d.ts +0 -2
  38. package/dist/script/ui/views/components/ContextMenu/hooks/useAddAttachmentPoint.d.ts +0 -4
  39. package/dist/script/ui/views/components/ContextMenu/hooks/useRemoveAttachmentPoint.d.ts +0 -4
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  ***************************************************************************/
16
- import { Action, Editor as KetcherEditor, FloatingToolsParams, MULTITAIL_ARROW_KEY, Render, Struct } from 'ketcher-core';
16
+ import { Action, AttachmentPointName, Editor as KetcherEditor, FloatingToolsParams, MonomerCreationState, MULTITAIL_ARROW_KEY, Render, Struct } from 'ketcher-core';
17
17
  import { PipelineSubscription, Subscription } from 'subscription';
18
18
  import { Highlighter } from './highlighter';
19
19
  import { ContextMenuInfo } from '../ui/views/components/ContextMenu/contextMenu.types';
@@ -30,10 +30,6 @@ export interface Selection {
30
30
  rgroupAttachmentPoints?: Array<number>;
31
31
  [MULTITAIL_ARROW_KEY]?: Array<number>;
32
32
  }
33
- export declare type MonomerCreationState = {
34
- originalStruct: Struct;
35
- attachmentAtomIdToLeavingAtomId: Map<number, number>;
36
- } | null;
37
33
  declare class Editor implements KetcherEditor {
38
34
  #private;
39
35
  ketcherId: string;
@@ -75,7 +71,6 @@ declare class Editor implements KetcherEditor {
75
71
  cursor: Subscription;
76
72
  updateFloatingTools: Subscription<FloatingToolsParams>;
77
73
  };
78
- private _monomerCreationState;
79
74
  serverSettings: {};
80
75
  lastEvent: any;
81
76
  macromoleculeConvertionError: string | null | undefined;
@@ -99,16 +94,23 @@ declare class Editor implements KetcherEditor {
99
94
  positionStruct(x: number, y: number): void;
100
95
  zoomAccordingContent(struct: Struct): boolean;
101
96
  get monomerCreationState(): MonomerCreationState;
97
+ private set monomerCreationState(value);
102
98
  get isMonomerCreationWizardActive(): boolean;
103
- private singleBondsToOutsideOfSelection;
99
+ private terminalRGroupAtoms;
100
+ private potentialLeavingAtoms;
104
101
  get isMonomerCreationWizardEnabled(): boolean;
105
102
  static isSelectionContinuous(selection: Selection, struct: Struct): boolean;
103
+ private originalStruct;
106
104
  private originalSelection;
107
- private atomIdsMap;
105
+ private selectedToOriginalAtomsIdMap;
108
106
  private selectionBBox;
109
107
  openMonomerCreationWizard(): void;
108
+ assignLeavingGroupAtom(atomId: number): void;
110
109
  closeMonomerCreationWizard(): void;
111
110
  saveNewMonomer(data: any): void;
111
+ reassignAttachmentPointAtom(atomId: number, atomLabel: string): void;
112
+ reassignAttachmentPoint(currentName: AttachmentPointName, newName: AttachmentPointName): void;
113
+ removeAttachmentPoint(name: AttachmentPointName): void;
112
114
  selection(ci?: any): Selection | null;
113
115
  hover(ci: {
114
116
  id: number;
@@ -132,7 +134,7 @@ declare class Editor implements KetcherEditor {
132
134
  atomToFunctionalGroup: Map<any, any>;
133
135
  };
134
136
  explicitSelected(autoSelectBonds?: boolean): any;
135
- structSelected(): Struct;
137
+ structSelected(existingSelection?: Selection): Struct;
136
138
  alignDescriptors(): void;
137
139
  setMacromoleculeConvertionError(errorMessage: string): void;
138
140
  clearMacromoleculeConvertionError(): void;
@@ -3,7 +3,6 @@ import Editor from '../Editor';
3
3
  declare class CreateMonomerTool implements Tool {
4
4
  private editor;
5
5
  constructor(editor: Editor);
6
- cancel(): void;
7
6
  mousemove(): void;
8
7
  }
9
8
  export default CreateMonomerTool;
@@ -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 type { MonomerCreationState } from '../../../../editor/Editor';
16
+ import { MonomerCreationState } from 'ketcher-core';
17
17
  export declare const editorOptionsSelector: (state: any) => any;
18
18
  export declare const editorMonomerCreationStateSelector: (state: any) => MonomerCreationState;
@@ -0,0 +1,9 @@
1
+ import { AttachmentPointClickData, AttachmentPointName } from 'ketcher-core';
2
+ declare type Props = {
3
+ data: AttachmentPointClickData | null;
4
+ onNameChange: (currentName: AttachmentPointName, newName: AttachmentPointName) => void;
5
+ onAtomChange: (atomId: number, atomLabel: string) => void;
6
+ onClose: VoidFunction;
7
+ };
8
+ declare const AttachmentPointEditPopup: ({ data, onNameChange, onAtomChange, onClose, }: Props) => import("react/jsx-runtime").JSX.Element | null;
9
+ export default AttachmentPointEditPopup;
@@ -0,0 +1,9 @@
1
+ import { AtomContextMenuProps, MenuItemsProps } from '../contextMenu.types';
2
+ import { Editor } from 'src/script/editor';
3
+ declare type Props = {
4
+ props: MenuItemsProps<AtomContextMenuProps>;
5
+ selectedAtomId: number | undefined;
6
+ editor: Editor;
7
+ };
8
+ declare const useMakeLeavingGroupAtomMenuItem: ({ props, selectedAtomId, editor, }: Props) => import("react/jsx-runtime").JSX.Element | null;
9
+ export default useMakeLeavingGroupAtomMenuItem;
@@ -13,7 +13,7 @@ export declare type WizardValues = {
13
13
  [key in StringWizardFormFieldId]: string;
14
14
  };
15
15
  export declare type WizardNotificationType = 'info' | 'error';
16
- export declare type WizardNotificationId = 'defaultAttachmentPoints' | 'emptyMandatoryFields' | 'invalidSymbol' | 'symbolExists' | 'editingIsNotAllowed';
16
+ export declare type WizardNotificationId = 'defaultAttachmentPoints' | 'emptyMandatoryFields' | 'invalidSymbol' | 'symbolExists' | 'editingIsNotAllowed' | 'noAttachmentPoints' | 'incorrectAttachmentPointsOrder' | 'creationSuccessful';
17
17
  export declare type WizardNotificationTypeMap = Record<WizardNotificationId, WizardNotificationType>;
18
18
  export declare type WizardNotificationMessageMap = Record<WizardNotificationId, string>;
19
19
  export declare type WizardNotification = {
@@ -0,0 +1,7 @@
1
+ import { AttachmentPointName } from 'ketcher-core';
2
+ declare type Props = {
3
+ name: AttachmentPointName;
4
+ atomLabel: string;
5
+ };
6
+ declare const AttachmentPoint: ({ name, atomLabel }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default AttachmentPoint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ketcher-react",
3
- "version": "3.8.0-dev.1",
3
+ "version": "3.8.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",