diff --git a/src/Components/App/App.tsx b/src/Components/App/App.tsx index ec0b7ad..c85d322 100644 --- a/src/Components/App/App.tsx +++ b/src/Components/App/App.tsx @@ -2,7 +2,8 @@ import React, { useEffect, useState } from 'react'; import './App.scss'; import { MainMenu } from '../MainMenu/MainMenu'; import { ContainerModel } from '../../Interfaces/IContainerModel'; -import Editor, { IEditorState } from '../Editor/Editor'; +import Editor from '../Editor/Editor'; +import { IEditorState } from '../../Interfaces/IEditorState'; import { LoadState } from './Load'; import { LoadEditor, NewEditor } from './MenuActions'; import { DEFAULT_CONFIG, DEFAULT_MAINCONTAINER_PROPS } from '../../utils/default'; diff --git a/src/Components/App/Load.ts b/src/Components/App/Load.ts index b5459c7..909dfc9 100644 --- a/src/Components/App/Load.ts +++ b/src/Components/App/Load.ts @@ -1,6 +1,6 @@ import { Dispatch, SetStateAction } from 'react'; import { Revive } from '../../utils/saveload'; -import { IEditorState } from '../Editor/Editor'; +import { IEditorState } from '../../Interfaces/IEditorState'; export function LoadState( editorState: IEditorState, diff --git a/src/Components/App/MenuActions.ts b/src/Components/App/MenuActions.ts index aa8ac80..c849ca8 100644 --- a/src/Components/App/MenuActions.ts +++ b/src/Components/App/MenuActions.ts @@ -2,7 +2,7 @@ import { Dispatch, SetStateAction } from 'react'; import { IConfiguration } from '../../Interfaces/IConfiguration'; import { ContainerModel } from '../../Interfaces/IContainerModel'; import { fetchConfiguration } from '../API/api'; -import { IEditorState } from '../Editor/Editor'; +import { IEditorState } from "../../Interfaces/IEditorState"; import { LoadState } from './Load'; export function NewEditor( diff --git a/src/Components/Editor/Editor.tsx b/src/Components/Editor/Editor.tsx index 64e6f7e..9c86f37 100644 --- a/src/Components/Editor/Editor.tsx +++ b/src/Components/Editor/Editor.tsx @@ -15,12 +15,6 @@ interface IEditorProps { historyCurrentStep: number } -export interface IEditorState { - history: IHistoryState[] - historyCurrentStep: number - configuration: IConfiguration -} - export const getCurrentHistory = (history: IHistoryState[], historyCurrentStep: number): IHistoryState[] => history.slice(0, historyCurrentStep + 1); export const getCurrentHistoryState = (history: IHistoryState[], historyCurrentStep: number): IHistoryState => history[historyCurrentStep]; diff --git a/src/Components/Editor/Save.ts b/src/Components/Editor/Save.ts index ef8d95f..5717a41 100644 --- a/src/Components/Editor/Save.ts +++ b/src/Components/Editor/Save.ts @@ -2,7 +2,7 @@ import { IHistoryState } from '../../Interfaces/IHistoryState'; import { IConfiguration } from '../../Interfaces/IConfiguration'; import { getCircularReplacer } from '../../utils/saveload'; import { ID } from '../SVG/SVG'; -import { IEditorState } from './Editor'; +import { IEditorState } from '../../Interfaces/IEditorState'; export function SaveEditorAsJSON( history: IHistoryState[], diff --git a/src/Interfaces/IEditorState.tsx b/src/Interfaces/IEditorState.tsx new file mode 100644 index 0000000..495a868 --- /dev/null +++ b/src/Interfaces/IEditorState.tsx @@ -0,0 +1,8 @@ +import { IConfiguration } from './IConfiguration'; +import { IHistoryState } from './IHistoryState'; + +export interface IEditorState { + history: IHistoryState[] + historyCurrentStep: number + configuration: IConfiguration +} diff --git a/src/utils/saveload.ts b/src/utils/saveload.ts index a33652e..356dd50 100644 --- a/src/utils/saveload.ts +++ b/src/utils/saveload.ts @@ -1,5 +1,5 @@ import { findContainerById, MakeIterator } from './itertools'; -import { IEditorState } from '../Components/Editor/Editor'; +import { IEditorState } from '../Interfaces/IEditorState'; /** * Revive the Editor state