Run eslint src --fix
This commit is contained in:
parent
c6c4bd1e32
commit
25cb0d14f7
82 changed files with 363 additions and 342 deletions
|
@ -2,14 +2,14 @@
|
||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { AddMethod } from '../../Enums/AddMethod';
|
import { AddMethod } from '../../Enums/AddMethod';
|
||||||
import { PositionReference } from '../../Enums/PositionReference';
|
import { PositionReference } from '../../Enums/PositionReference';
|
||||||
import { IAction } from '../../Interfaces/IAction';
|
import { type IAction } from '../../Interfaces/IAction';
|
||||||
import { IAvailableContainer } from '../../Interfaces/IAvailableContainer';
|
import { type IAvailableContainer } from '../../Interfaces/IAvailableContainer';
|
||||||
import { IAvailableSymbol } from '../../Interfaces/IAvailableSymbol';
|
import { type IAvailableSymbol } from '../../Interfaces/IAvailableSymbol';
|
||||||
import { ICategory } from '../../Interfaces/ICategory';
|
import { type ICategory } from '../../Interfaces/ICategory';
|
||||||
import { IConfiguration } from '../../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../../Interfaces/IConfiguration';
|
||||||
import { IContainerModel, ContainerModel } from '../../Interfaces/IContainerModel';
|
import { type IContainerModel, ContainerModel } from '../../Interfaces/IContainerModel';
|
||||||
import { IHistoryState } from '../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../Interfaces/IHistoryState';
|
||||||
import { IPattern } from '../../Interfaces/IPattern';
|
import { type IPattern } from '../../Interfaces/IPattern';
|
||||||
import { DEFAULT_MAINCONTAINER_PROPS, GetDefaultContainerProps } from '../../utils/default';
|
import { DEFAULT_MAINCONTAINER_PROPS, GetDefaultContainerProps } from '../../utils/default';
|
||||||
import { FetchConfiguration } from './api';
|
import { FetchConfiguration } from './api';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { IConfiguration } from '../../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../../Interfaces/IConfiguration';
|
||||||
import { ISetContainerListRequest } from '../../Interfaces/ISetContainerListRequest';
|
import { type ISetContainerListRequest } from '../../Interfaces/ISetContainerListRequest';
|
||||||
import { ISetContainerListResponse } from '../../Interfaces/ISetContainerListResponse';
|
import { type ISetContainerListResponse } from '../../Interfaces/ISetContainerListResponse';
|
||||||
import { GetCircularReplacer } from '../../utils/saveload';
|
import { GetCircularReplacer } from '../../utils/saveload';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,8 +9,7 @@ import { GetCircularReplacer } from '../../utils/saveload';
|
||||||
*/
|
*/
|
||||||
export async function FetchConfiguration(): Promise<IConfiguration> {
|
export async function FetchConfiguration(): Promise<IConfiguration> {
|
||||||
const url = import.meta.env.VITE_API_FETCH_URL;
|
const url = import.meta.env.VITE_API_FETCH_URL;
|
||||||
// The test library cannot use the Fetch API
|
// @ts-expect-error The test library cannot use the Fetch AP
|
||||||
// @ts-expect-error
|
|
||||||
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
||||||
if (window.fetch) {
|
if (window.fetch) {
|
||||||
return await fetch(url, {
|
return await fetch(url, {
|
||||||
|
@ -36,8 +35,7 @@ export async function FetchConfiguration(): Promise<IConfiguration> {
|
||||||
export async function SetContainerList(request: ISetContainerListRequest, configurationUrl?: string): Promise<ISetContainerListResponse> {
|
export async function SetContainerList(request: ISetContainerListRequest, configurationUrl?: string): Promise<ISetContainerListResponse> {
|
||||||
const url = configurationUrl ?? import.meta.env.VITE_API_SET_CONTAINER_LIST_URL;
|
const url = configurationUrl ?? import.meta.env.VITE_API_SET_CONTAINER_LIST_URL;
|
||||||
const dataParsed = JSON.stringify(request, GetCircularReplacer());
|
const dataParsed = JSON.stringify(request, GetCircularReplacer());
|
||||||
// The test library cannot use the Fetch API
|
// @ts-expect-error The test library cannot use the Fetch API
|
||||||
// @ts-expect-error
|
|
||||||
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
||||||
if (window.fetch) {
|
if (window.fetch) {
|
||||||
return await fetch(url, {
|
return await fetch(url, {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Dispatch, SetStateAction } from 'react';
|
import { type Dispatch, type SetStateAction } from 'react';
|
||||||
import { AppState } from '../../../Enums/AppState';
|
import { AppState } from '../../../Enums/AppState';
|
||||||
import { IEditorState } from '../../../Interfaces/IEditorState';
|
import { type IEditorState } from '../../../Interfaces/IEditorState';
|
||||||
import { Revive } from '../../../utils/saveload';
|
import { Revive } from '../../../utils/saveload';
|
||||||
|
|
||||||
export function LoadState(
|
export function LoadState(
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Dispatch, SetStateAction } from 'react';
|
import { type Dispatch, type SetStateAction } from 'react';
|
||||||
import { IConfiguration } from '../../../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../../../Interfaces/IConfiguration';
|
||||||
import { FetchConfiguration } from '../../API/api';
|
import { FetchConfiguration } from '../../API/api';
|
||||||
import { IEditorState } from '../../../Interfaces/IEditorState';
|
import { type IEditorState } from '../../../Interfaces/IEditorState';
|
||||||
import { LoadState } from './Load';
|
import { LoadState } from './Load';
|
||||||
import { DISABLE_API, GetDefaultEditorState } from '../../../utils/default';
|
import { DISABLE_API, GetDefaultEditorState } from '../../../utils/default';
|
||||||
import { AppState } from '../../../Enums/AppState';
|
import { type AppState } from '../../../Enums/AppState';
|
||||||
|
|
||||||
export function NewEditor(
|
export function NewEditor(
|
||||||
editorState: IEditorState,
|
editorState: IEditorState,
|
||||||
|
|
|
@ -2,7 +2,7 @@ import * as React from 'react';
|
||||||
import { beforeEach, describe, it } from 'vitest';
|
import { beforeEach, describe, it } from 'vitest';
|
||||||
import { AppState } from '../../Enums/AppState';
|
import { AppState } from '../../Enums/AppState';
|
||||||
import { FAST_BOOT } from '../../utils/default';
|
import { FAST_BOOT } from '../../utils/default';
|
||||||
import { fireEvent, render, RenderResult } from '../../utils/test-utils';
|
import { fireEvent, render, type RenderResult } from '../../utils/test-utils';
|
||||||
import { App } from './App';
|
import { App } from './App';
|
||||||
|
|
||||||
describe.concurrent('App', () => {
|
describe.concurrent('App', () => {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import React, { Dispatch, SetStateAction, useContext, useEffect, useRef, useState } from 'react';
|
import React, { type Dispatch, type SetStateAction, useContext, useEffect, useRef, useState } from 'react';
|
||||||
import { UseCustomEvents } from '../../Events/AppEvents';
|
import { UseCustomEvents } from '../../Events/AppEvents';
|
||||||
import { MainMenu } from '../MainMenu/MainMenu';
|
import { MainMenu } from '../MainMenu/MainMenu';
|
||||||
import { ContainerModel, IContainerModel } from '../../Interfaces/IContainerModel';
|
import { ContainerModel, type IContainerModel } from '../../Interfaces/IContainerModel';
|
||||||
import { Editor } from '../Editor/Editor';
|
import { Editor } from '../Editor/Editor';
|
||||||
import { IEditorState } from '../../Interfaces/IEditorState';
|
import { type IEditorState } from '../../Interfaces/IEditorState';
|
||||||
import { LoadState } from './Actions/Load';
|
import { LoadState } from './Actions/Load';
|
||||||
import { LoadEditor, NewEditor } from './Actions/MenuActions';
|
import { LoadEditor, NewEditor } from './Actions/MenuActions';
|
||||||
import { DEFAULT_CONFIG, DEFAULT_MAINCONTAINER_PROPS, FAST_BOOT } from '../../utils/default';
|
import { DEFAULT_CONFIG, DEFAULT_MAINCONTAINER_PROPS, FAST_BOOT } from '../../utils/default';
|
||||||
|
@ -116,15 +116,17 @@ export function App(props: IAppProps): JSX.Element {
|
||||||
setAppState(AppState.Loading);
|
setAppState(AppState.Loading);
|
||||||
NewEditor(
|
NewEditor(
|
||||||
editorState,
|
editorState,
|
||||||
(newEditor) => setEditorState(newEditor),
|
(newEditor) => { setEditorState(newEditor); },
|
||||||
() => setAppState(AppState.Loaded)
|
() => { setAppState(AppState.Loaded); }
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
loadEditor={(files: FileList | null) => LoadEditor(
|
loadEditor={(files: FileList | null) => {
|
||||||
|
LoadEditor(
|
||||||
files,
|
files,
|
||||||
setEditorState,
|
setEditorState,
|
||||||
setAppState
|
setAppState
|
||||||
)}
|
);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -37,7 +37,7 @@ export function Bar(props: IBarProps): JSX.Element {
|
||||||
<BarIcon
|
<BarIcon
|
||||||
isActive={props.isComponentsOpen}
|
isActive={props.isComponentsOpen}
|
||||||
title={Text({ textId: '@Components' })}
|
title={Text({ textId: '@Components' })}
|
||||||
onClick={() => props.toggleComponents()}>
|
onClick={() => { props.toggleComponents(); }}>
|
||||||
{
|
{
|
||||||
props.isComponentsOpen
|
props.isComponentsOpen
|
||||||
? <CubeIconS className='heroicon' />
|
? <CubeIconS className='heroicon' />
|
||||||
|
@ -47,7 +47,7 @@ export function Bar(props: IBarProps): JSX.Element {
|
||||||
<BarIcon
|
<BarIcon
|
||||||
isActive={props.isSymbolsOpen}
|
isActive={props.isSymbolsOpen}
|
||||||
title={Text({ textId: '@Symbols' })}
|
title={Text({ textId: '@Symbols' })}
|
||||||
onClick={() => props.toggleSymbols()}>
|
onClick={() => { props.toggleSymbols(); }}>
|
||||||
{
|
{
|
||||||
props.isSymbolsOpen
|
props.isSymbolsOpen
|
||||||
? <LinkIconS className='heroicon' />
|
? <LinkIconS className='heroicon' />
|
||||||
|
@ -57,7 +57,7 @@ export function Bar(props: IBarProps): JSX.Element {
|
||||||
<BarIcon
|
<BarIcon
|
||||||
isActive={props.isMessagesOpen}
|
isActive={props.isMessagesOpen}
|
||||||
title={Text({ textId: '@Messages' })}
|
title={Text({ textId: '@Messages' })}
|
||||||
onClick={() => props.toggleMessages()}>
|
onClick={() => { props.toggleMessages(); }}>
|
||||||
{
|
{
|
||||||
props.isMessagesOpen
|
props.isMessagesOpen
|
||||||
? <EnvolopeIconS className='heroicon' />
|
? <EnvolopeIconS className='heroicon' />
|
||||||
|
@ -68,7 +68,7 @@ export function Bar(props: IBarProps): JSX.Element {
|
||||||
<BarIcon
|
<BarIcon
|
||||||
isActive={props.isHistoryOpen}
|
isActive={props.isHistoryOpen}
|
||||||
title={Text({ textId: '@Timeline' })}
|
title={Text({ textId: '@Timeline' })}
|
||||||
onClick={() => props.toggleTimeline()}>
|
onClick={() => { props.toggleTimeline(); }}>
|
||||||
{
|
{
|
||||||
props.isHistoryOpen
|
props.isHistoryOpen
|
||||||
? <ClockIconS className='heroicon' />
|
? <ClockIconS className='heroicon' />
|
||||||
|
@ -78,7 +78,7 @@ export function Bar(props: IBarProps): JSX.Element {
|
||||||
<BarIcon
|
<BarIcon
|
||||||
isActive={props.isSettingsOpen}
|
isActive={props.isSettingsOpen}
|
||||||
title={Text({ textId: '@Settings' })}
|
title={Text({ textId: '@Settings' })}
|
||||||
onClick={() => props.toggleSettings()}>
|
onClick={() => { props.toggleSettings(); }}>
|
||||||
{
|
{
|
||||||
props.isSettingsOpen
|
props.isSettingsOpen
|
||||||
? <Cog8ToothIconS className='heroicon' />
|
? <Cog8ToothIconS className='heroicon' />
|
||||||
|
|
|
@ -13,7 +13,7 @@ export function BarIcon(props: IBarIconProps): JSX.Element {
|
||||||
<button type="button"
|
<button type="button"
|
||||||
className={`bar-btn group ${isActiveClasses}`}
|
className={`bar-btn group ${isActiveClasses}`}
|
||||||
title={props.title}
|
title={props.title}
|
||||||
onClick={() => props.onClick()}
|
onClick={() => { props.onClick(); }}
|
||||||
>
|
>
|
||||||
<span className='sidebar-tooltip group-hover:scale-100'>{props.title}</span>
|
<span className='sidebar-tooltip group-hover:scale-100'>{props.title}</span>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useEffect, useRef } from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
import { IPoint } from '../../Interfaces/IPoint';
|
import { type IPoint } from '../../Interfaces/IPoint';
|
||||||
import { BAR_WIDTH } from '../Bar/Bar';
|
import { BAR_WIDTH } from '../Bar/Bar';
|
||||||
|
|
||||||
interface ICanvasProps {
|
interface ICanvasProps {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Orientation } from '../../Enums/Orientation';
|
import { Orientation } from '../../Enums/Orientation';
|
||||||
import { Position } from '../../Enums/Position';
|
import { Position } from '../../Enums/Position';
|
||||||
import { IContainerModel } from '../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../Interfaces/IContainerModel';
|
||||||
import { SHOW_SELF_DIMENSIONS, SHOW_BORROWER_DIMENSIONS, SHOW_CHILDREN_DIMENSIONS } from '../../utils/default';
|
import { SHOW_SELF_DIMENSIONS, SHOW_BORROWER_DIMENSIONS, SHOW_CHILDREN_DIMENSIONS } from '../../utils/default';
|
||||||
import { FindContainerById, MakeRecursionDFSIterator, Pairwise } from '../../utils/itertools';
|
import { FindContainerById, MakeRecursionDFSIterator, Pairwise } from '../../utils/itertools';
|
||||||
import { TransformX, TransformY } from '../../utils/svg';
|
import { TransformX, TransformY } from '../../utils/svg';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { IContainerModel } from '../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../Interfaces/IContainerModel';
|
||||||
import { SHOW_SELECTOR_TEXT } from '../../utils/default';
|
import { SHOW_SELECTOR_TEXT } from '../../utils/default';
|
||||||
import { GetAbsolutePosition } from '../../utils/itertools';
|
import { GetAbsolutePosition } from '../../utils/itertools';
|
||||||
import { RemoveMargin } from '../../utils/svg';
|
import { RemoveMargin } from '../../utils/svg';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||||
import { DIMENSION_MARGIN } from '../../utils/default';
|
import { DIMENSION_MARGIN } from '../../utils/default';
|
||||||
|
|
||||||
const IMAGE_CACHE = new Map<string, HTMLImageElement>();
|
const IMAGE_CACHE = new Map<string, HTMLImageElement>();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ChevronRightIcon } from '@heroicons/react/24/outline';
|
import { ChevronRightIcon } from '@heroicons/react/24/outline';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { ICategory } from '../../Interfaces/ICategory';
|
import { type ICategory } from '../../Interfaces/ICategory';
|
||||||
import { TruncateString } from '../../utils/stringtools';
|
import { TruncateString } from '../../utils/stringtools';
|
||||||
|
|
||||||
interface ICategoryProps {
|
interface ICategoryProps {
|
||||||
|
@ -27,7 +27,7 @@ export function Category(props: ICategoryProps): JSX.Element {
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`flex flex-row group cursor-pointer ${heightClass}`}
|
className={`flex flex-row group cursor-pointer ${heightClass}`}
|
||||||
onClick={() => setIsOpen(!isOpen)}
|
onClick={() => { setIsOpen(!isOpen); }}
|
||||||
>
|
>
|
||||||
<span className={`transition-all flex-1 h-full justify-center sidebar-component-left ${isOpen ? 'rounded-b-none bg-slate-400/80 group-hover:bg-blue-600' : ''}`}>
|
<span className={`transition-all flex-1 h-full justify-center sidebar-component-left ${isOpen ? 'rounded-b-none bg-slate-400/80 group-hover:bg-blue-600' : ''}`}>
|
||||||
{TruncateString(categoryDisplayedText, 25)}
|
{TruncateString(categoryDisplayedText, 25)}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { EyeIcon, EyeSlashIcon } from '@heroicons/react/24/outline';
|
import { EyeIcon, EyeSlashIcon } from '@heroicons/react/24/outline';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IAvailableContainer } from '../../Interfaces/IAvailableContainer';
|
import { type IAvailableContainer } from '../../Interfaces/IAvailableContainer';
|
||||||
import { ICategory } from '../../Interfaces/ICategory';
|
import { type ICategory } from '../../Interfaces/ICategory';
|
||||||
import { IContainerModel } from '../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../Interfaces/IContainerModel';
|
||||||
import { TruncateString } from '../../utils/stringtools';
|
import { TruncateString } from '../../utils/stringtools';
|
||||||
import { Category } from '../Category/Category';
|
import { Category } from '../Category/Category';
|
||||||
import { Text } from '../Text/Text';
|
import { Text } from '../Text/Text';
|
||||||
|
@ -72,9 +72,9 @@ export function Components(props: IComponentsProps): JSX.Element {
|
||||||
className='w-full justify-center h-16 transition-all sidebar-component'
|
className='w-full justify-center h-16 transition-all sidebar-component'
|
||||||
id={componentOption.Type}
|
id={componentOption.Type}
|
||||||
title={componentOption.Type}
|
title={componentOption.Type}
|
||||||
onClick={() => props.buttonOnClick(componentOption.Type)}
|
onClick={() => { props.buttonOnClick(componentOption.Type); }}
|
||||||
draggable={true}
|
draggable={true}
|
||||||
onDragStart={(event) => HandleDragStart(event)}
|
onDragStart={(event) => { HandleDragStart(event); }}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
{TruncateString(componentOption.DisplayedText ?? componentOption.Type, 25)}
|
{TruncateString(componentOption.DisplayedText ?? componentOption.Type, 25)}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { PropertyType } from '../../Enums/PropertyType';
|
import { PropertyType } from '../../Enums/PropertyType';
|
||||||
import { IContainerProperties } from '../../Interfaces/IContainerProperties';
|
import { type IContainerProperties } from '../../Interfaces/IContainerProperties';
|
||||||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||||
import {
|
import {
|
||||||
SHOW_BORROWER_DIMENSIONS,
|
SHOW_BORROWER_DIMENSIONS,
|
||||||
SHOW_CHILDREN_DIMENSIONS,
|
SHOW_CHILDREN_DIMENSIONS,
|
||||||
|
@ -46,7 +46,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName=''
|
inputClassName=''
|
||||||
type='string'
|
type='string'
|
||||||
value={props.properties.displayedText?.toString()}
|
value={props.properties.displayedText?.toString()}
|
||||||
onChange={(value) => props.onChange('displayedText', value)}/>
|
onChange={(value) => { props.onChange('displayedText', value); }}/>
|
||||||
<OrientationSelector
|
<OrientationSelector
|
||||||
id='orientation'
|
id='orientation'
|
||||||
name='Orientation'
|
name='Orientation'
|
||||||
|
@ -117,7 +117,8 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
props.properties.width,
|
props.properties.width,
|
||||||
props.properties.positionReference
|
props.properties.positionReference
|
||||||
).toString()}
|
).toString()}
|
||||||
onChange={(value) => props.onChange(
|
onChange={(value) => {
|
||||||
|
props.onChange(
|
||||||
'x',
|
'x',
|
||||||
ApplyXMargin(
|
ApplyXMargin(
|
||||||
RestoreX(
|
RestoreX(
|
||||||
|
@ -127,7 +128,8 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
),
|
),
|
||||||
props.properties.margin.left
|
props.properties.margin.left
|
||||||
)
|
)
|
||||||
)}/>
|
);
|
||||||
|
}}/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-y`}
|
id={`${props.properties.id}-y`}
|
||||||
labelText={Text({ textId: '@ContainerY' })}
|
labelText={Text({ textId: '@ContainerY' })}
|
||||||
|
@ -140,7 +142,8 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
props.properties.height,
|
props.properties.height,
|
||||||
props.properties.positionReference
|
props.properties.positionReference
|
||||||
).toString()}
|
).toString()}
|
||||||
onChange={(value) => props.onChange(
|
onChange={(value) => {
|
||||||
|
props.onChange(
|
||||||
'y',
|
'y',
|
||||||
ApplyXMargin(
|
ApplyXMargin(
|
||||||
RestoreY(
|
RestoreY(
|
||||||
|
@ -150,7 +153,8 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
),
|
),
|
||||||
props.properties.margin.top
|
props.properties.margin.top
|
||||||
)
|
)
|
||||||
)}/>
|
);
|
||||||
|
}}/>
|
||||||
</div>
|
</div>
|
||||||
</Category>
|
</Category>
|
||||||
|
|
||||||
|
@ -171,7 +175,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={1}
|
min={1}
|
||||||
value={props.properties.minWidth.toString()}
|
value={props.properties.minWidth.toString()}
|
||||||
onChange={(value) => props.onChange('minWidth', Number(value))}/>
|
onChange={(value) => { props.onChange('minWidth', Number(value)); }}/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-width`}
|
id={`${props.properties.id}-width`}
|
||||||
labelText={Text({ textId: '@ContainerWidth' })}
|
labelText={Text({ textId: '@ContainerWidth' })}
|
||||||
|
@ -182,7 +186,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
min={props.properties.minWidth}
|
min={props.properties.minWidth}
|
||||||
max={props.properties.maxWidth}
|
max={props.properties.maxWidth}
|
||||||
value={(RemoveWidthMargin(props.properties.width, props.properties.margin.left, props.properties.margin.right)).toString()}
|
value={(RemoveWidthMargin(props.properties.width, props.properties.margin.left, props.properties.margin.right)).toString()}
|
||||||
onChange={(value) => props.onChange('width', ApplyWidthMargin(Number(value), props.properties.margin.left, props.properties.margin.right))}
|
onChange={(value) => { props.onChange('width', ApplyWidthMargin(Number(value), props.properties.margin.left, props.properties.margin.right)); }}
|
||||||
isDisabled={props.properties.isFlex}/>
|
isDisabled={props.properties.isFlex}/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-maxWidth`}
|
id={`${props.properties.id}-maxWidth`}
|
||||||
|
@ -193,7 +197,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={1}
|
min={1}
|
||||||
value={props.properties.maxWidth.toString()}
|
value={props.properties.maxWidth.toString()}
|
||||||
onChange={(value) => props.onChange('maxWidth', Number(value))}/>
|
onChange={(value) => { props.onChange('maxWidth', Number(value)); }}/>
|
||||||
<div className='col-span-5 p-3'></div>
|
<div className='col-span-5 p-3'></div>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-minHeight`}
|
id={`${props.properties.id}-minHeight`}
|
||||||
|
@ -204,7 +208,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={1}
|
min={1}
|
||||||
value={props.properties.minHeight.toString()}
|
value={props.properties.minHeight.toString()}
|
||||||
onChange={(value) => props.onChange('minHeight', Number(value))}/>
|
onChange={(value) => { props.onChange('minHeight', Number(value)); }}/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-height`}
|
id={`${props.properties.id}-height`}
|
||||||
labelText={Text({ textId: '@ContainerHeight' })}
|
labelText={Text({ textId: '@ContainerHeight' })}
|
||||||
|
@ -215,7 +219,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
min={props.properties.minHeight}
|
min={props.properties.minHeight}
|
||||||
max={props.properties.maxHeight}
|
max={props.properties.maxHeight}
|
||||||
value={(RemoveWidthMargin(props.properties.height, props.properties.margin.top, props.properties.margin.bottom)).toString()}
|
value={(RemoveWidthMargin(props.properties.height, props.properties.margin.top, props.properties.margin.bottom)).toString()}
|
||||||
onChange={(value) => props.onChange('height', ApplyWidthMargin(Number(value), props.properties.margin.top, props.properties.margin.bottom))}
|
onChange={(value) => { props.onChange('height', ApplyWidthMargin(Number(value), props.properties.margin.top, props.properties.margin.bottom)); }}
|
||||||
isDisabled={props.properties.isFlex}
|
isDisabled={props.properties.isFlex}
|
||||||
/>
|
/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
|
@ -227,7 +231,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={1}
|
min={1}
|
||||||
value={props.properties.maxHeight.toString()}
|
value={props.properties.maxHeight.toString()}
|
||||||
onChange={(value) => props.onChange('maxHeight', Number(value))}/>
|
onChange={(value) => { props.onChange('maxHeight', Number(value)); }}/>
|
||||||
</div>
|
</div>
|
||||||
</Category>
|
</Category>
|
||||||
|
|
||||||
|
@ -247,7 +251,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={0}
|
min={0}
|
||||||
value={(props.properties.margin.left ?? 0).toString()}
|
value={(props.properties.margin.left ?? 0).toString()}
|
||||||
onChange={(value) => props.onChange('left', Number(value), PropertyType.Margin)}/>
|
onChange={(value) => { props.onChange('left', Number(value), PropertyType.Margin); }}/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-mb`}
|
id={`${props.properties.id}-mb`}
|
||||||
labelText={Text({ textId: '@ContainerMarginBottom' })}
|
labelText={Text({ textId: '@ContainerMarginBottom' })}
|
||||||
|
@ -257,7 +261,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={0}
|
min={0}
|
||||||
value={(props.properties.margin.bottom ?? 0).toString()}
|
value={(props.properties.margin.bottom ?? 0).toString()}
|
||||||
onChange={(value) => props.onChange('bottom', Number(value), PropertyType.Margin)}/>
|
onChange={(value) => { props.onChange('bottom', Number(value), PropertyType.Margin); }}/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-mt`}
|
id={`${props.properties.id}-mt`}
|
||||||
labelText={Text({ textId: '@ContainerMarginTop' })}
|
labelText={Text({ textId: '@ContainerMarginTop' })}
|
||||||
|
@ -267,7 +271,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={0}
|
min={0}
|
||||||
value={(props.properties.margin.top ?? 0).toString()}
|
value={(props.properties.margin.top ?? 0).toString()}
|
||||||
onChange={(value) => props.onChange('top', Number(value), PropertyType.Margin)}/>
|
onChange={(value) => { props.onChange('top', Number(value), PropertyType.Margin); }}/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-mr`}
|
id={`${props.properties.id}-mr`}
|
||||||
labelText={Text({ textId: '@ContainerMarginRight' })}
|
labelText={Text({ textId: '@ContainerMarginRight' })}
|
||||||
|
@ -277,7 +281,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={0}
|
min={0}
|
||||||
value={(props.properties.margin.right ?? 0).toString()}
|
value={(props.properties.margin.right ?? 0).toString()}
|
||||||
onChange={(value) => props.onChange('right', Number(value), PropertyType.Margin)}/>
|
onChange={(value) => { props.onChange('right', Number(value), PropertyType.Margin); }}/>
|
||||||
</div>
|
</div>
|
||||||
</Category>
|
</Category>
|
||||||
|
|
||||||
|
@ -295,7 +299,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName='ml-auto mr-auto block'
|
inputClassName='ml-auto mr-auto block'
|
||||||
type={ToggleType.Full}
|
type={ToggleType.Full}
|
||||||
checked={props.properties.isFlex}
|
checked={props.properties.isFlex}
|
||||||
onChange={(event) => props.onChange('isFlex', event.target.checked)}
|
onChange={(event) => { props.onChange('isFlex', event.target.checked); }}
|
||||||
/>
|
/>
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
labelText={Text({ textId: '@ContainerAnchor' })}
|
labelText={Text({ textId: '@ContainerAnchor' })}
|
||||||
|
@ -304,7 +308,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName='ml-auto mr-auto block'
|
inputClassName='ml-auto mr-auto block'
|
||||||
type={ToggleType.Full}
|
type={ToggleType.Full}
|
||||||
checked={props.properties.isAnchor}
|
checked={props.properties.isAnchor}
|
||||||
onChange={(event) => props.onChange('isAnchor', event.target.checked)}/>
|
onChange={(event) => { props.onChange('isAnchor', event.target.checked); }}/>
|
||||||
</div>
|
</div>
|
||||||
</Category>
|
</Category>
|
||||||
|
|
||||||
|
@ -334,7 +338,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
value: symbol.id
|
value: symbol.id
|
||||||
}))}
|
}))}
|
||||||
value={props.properties.linkedSymbolId ?? ''}
|
value={props.properties.linkedSymbolId ?? ''}
|
||||||
onChange={(event) => props.onChange('linkedSymbolId', event.target.value)}/>
|
onChange={(event) => { props.onChange('linkedSymbolId', event.target.value); }}/>
|
||||||
</div>
|
</div>
|
||||||
</Category>
|
</Category>
|
||||||
|
|
||||||
|
@ -354,7 +358,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
name='ShowSelfDimensions'
|
name='ShowSelfDimensions'
|
||||||
labelText={Text({ textId: '@ContainerShowDimension' })}
|
labelText={Text({ textId: '@ContainerShowDimension' })}
|
||||||
value={props.properties.dimensionOptions.selfDimensions.positions}
|
value={props.properties.dimensionOptions.selfDimensions.positions}
|
||||||
onChange={(key, value) => props.onChange(key, value, PropertyType.SelfDimension)}
|
onChange={(key, value) => { props.onChange(key, value, PropertyType.SelfDimension); }}
|
||||||
/>
|
/>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
labelText={Text({ textId: '@Color' })}
|
labelText={Text({ textId: '@Color' })}
|
||||||
|
@ -363,7 +367,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName=''
|
inputClassName=''
|
||||||
type='color'
|
type='color'
|
||||||
value={props.properties.dimensionOptions.selfDimensions.color}
|
value={props.properties.dimensionOptions.selfDimensions.color}
|
||||||
onChange={(e) => props.onChange('color', e.target.value, PropertyType.SelfDimension)}/>
|
onChange={(e) => { props.onChange('color', e.target.value, PropertyType.SelfDimension); }}/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -375,7 +379,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
name='ShowSelfMarginsDimensions'
|
name='ShowSelfMarginsDimensions'
|
||||||
labelText={Text({ textId: '@ContainerShowMarginsDimension' })}
|
labelText={Text({ textId: '@ContainerShowMarginsDimension' })}
|
||||||
value={props.properties.dimensionOptions.selfMarginsDimensions.positions}
|
value={props.properties.dimensionOptions.selfMarginsDimensions.positions}
|
||||||
onChange={(key, value) => props.onChange(key, value, PropertyType.SelfMarginDimension)}
|
onChange={(key, value) => { props.onChange(key, value, PropertyType.SelfMarginDimension); }}
|
||||||
/>
|
/>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
labelText={Text({ textId: '@Color' })}
|
labelText={Text({ textId: '@Color' })}
|
||||||
|
@ -384,7 +388,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName=''
|
inputClassName=''
|
||||||
type='color'
|
type='color'
|
||||||
value={props.properties.dimensionOptions.selfMarginsDimensions.color}
|
value={props.properties.dimensionOptions.selfMarginsDimensions.color}
|
||||||
onChange={(e) => props.onChange('color', e.target.value, PropertyType.SelfMarginDimension)}/>
|
onChange={(e) => { props.onChange('color', e.target.value, PropertyType.SelfMarginDimension); }}/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -396,7 +400,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
name='ShowChildrenDimensions'
|
name='ShowChildrenDimensions'
|
||||||
labelText={Text({ textId: '@ContainerShowChildrenDimension' })}
|
labelText={Text({ textId: '@ContainerShowChildrenDimension' })}
|
||||||
value={props.properties.dimensionOptions.childrenDimensions.positions}
|
value={props.properties.dimensionOptions.childrenDimensions.positions}
|
||||||
onChange={(key, value) => props.onChange(key, value, PropertyType.ChildrenDimensions)}
|
onChange={(key, value) => { props.onChange(key, value, PropertyType.ChildrenDimensions); }}
|
||||||
/>
|
/>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
labelText={Text({ textId: '@Color' })}
|
labelText={Text({ textId: '@Color' })}
|
||||||
|
@ -405,7 +409,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName=''
|
inputClassName=''
|
||||||
type='color'
|
type='color'
|
||||||
value={props.properties.dimensionOptions.childrenDimensions.color}
|
value={props.properties.dimensionOptions.childrenDimensions.color}
|
||||||
onChange={(e) => props.onChange('color', e.target.value, PropertyType.ChildrenDimensions)}/>
|
onChange={(e) => { props.onChange('color', e.target.value, PropertyType.ChildrenDimensions); }}/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -417,7 +421,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
name='MarkPosition'
|
name='MarkPosition'
|
||||||
value={props.properties.dimensionOptions.markPosition}
|
value={props.properties.dimensionOptions.markPosition}
|
||||||
labelText={Text({ textId: '@ContainerMarkPosition' })}
|
labelText={Text({ textId: '@ContainerMarkPosition' })}
|
||||||
onChange={(key, value) => props.onChange(key, value, PropertyType.DimensionOptions)}
|
onChange={(key, value) => { props.onChange(key, value, PropertyType.DimensionOptions); }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className='grid grid-cols-1 gap-2'>
|
<div className='grid grid-cols-1 gap-2'>
|
||||||
|
@ -427,7 +431,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
name='ShowDimensionWithMarks'
|
name='ShowDimensionWithMarks'
|
||||||
labelText={Text({ textId: '@ContainerShowDimensionWithMarks' })}
|
labelText={Text({ textId: '@ContainerShowDimensionWithMarks' })}
|
||||||
value={props.properties.dimensionOptions.dimensionWithMarks.positions}
|
value={props.properties.dimensionOptions.dimensionWithMarks.positions}
|
||||||
onChange={(key, value) => props.onChange(key, value, PropertyType.DimensionWithMarks)}
|
onChange={(key, value) => { props.onChange(key, value, PropertyType.DimensionWithMarks); }}
|
||||||
/>
|
/>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
labelText={Text({ textId: '@Color' })}
|
labelText={Text({ textId: '@Color' })}
|
||||||
|
@ -436,7 +440,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName=''
|
inputClassName=''
|
||||||
type='color'
|
type='color'
|
||||||
value={props.properties.dimensionOptions.dimensionWithMarks.color}
|
value={props.properties.dimensionOptions.dimensionWithMarks.color}
|
||||||
onChange={(e) => props.onChange('color', e.target.value, PropertyType.DimensionWithMarks)}/>
|
onChange={(e) => { props.onChange('color', e.target.value, PropertyType.DimensionWithMarks); }}/>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
@ -459,7 +463,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName='col-span-3'
|
inputClassName='col-span-3'
|
||||||
type='string'
|
type='string'
|
||||||
value={props.properties.style.stroke ?? 'black'}
|
value={props.properties.style.stroke ?? 'black'}
|
||||||
onChange={(value) => props.onChange('stroke', value, PropertyType.Style)}
|
onChange={(value) => { props.onChange('stroke', value, PropertyType.Style); }}
|
||||||
/>
|
/>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
labelKey={`${props.properties.id}-strokeOpacity`}
|
labelKey={`${props.properties.id}-strokeOpacity`}
|
||||||
|
@ -472,7 +476,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
max={1}
|
max={1}
|
||||||
step={0.01}
|
step={0.01}
|
||||||
value={(props.properties.style.strokeOpacity ?? 1).toString()}
|
value={(props.properties.style.strokeOpacity ?? 1).toString()}
|
||||||
onChange={(event) => props.onChange('strokeOpacity', Number(event.target.value), PropertyType.Style)}
|
onChange={(event) => { props.onChange('strokeOpacity', Number(event.target.value), PropertyType.Style); }}
|
||||||
/>
|
/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-strokeWidth`}
|
id={`${props.properties.id}-strokeWidth`}
|
||||||
|
@ -482,7 +486,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName='col-span-3'
|
inputClassName='col-span-3'
|
||||||
type='number'
|
type='number'
|
||||||
value={(props.properties.style.strokeWidth ?? 1).toString()}
|
value={(props.properties.style.strokeWidth ?? 1).toString()}
|
||||||
onChange={(value) => props.onChange('strokeWidth', Number(value), PropertyType.Style)}
|
onChange={(value) => { props.onChange('strokeWidth', Number(value), PropertyType.Style); }}
|
||||||
/>
|
/>
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id={`${props.properties.id}-fill`}
|
id={`${props.properties.id}-fill`}
|
||||||
|
@ -492,7 +496,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
inputClassName='col-span-3'
|
inputClassName='col-span-3'
|
||||||
type='string'
|
type='string'
|
||||||
value={props.properties.style.fill ?? 'black'}
|
value={props.properties.style.fill ?? 'black'}
|
||||||
onChange={(value) => props.onChange('fill', value, PropertyType.Style)}
|
onChange={(value) => { props.onChange('fill', value, PropertyType.Style); }}
|
||||||
/>
|
/>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
labelKey={`${props.properties.id}-fillOpacity`}
|
labelKey={`${props.properties.id}-fillOpacity`}
|
||||||
|
@ -505,7 +509,7 @@ export function ContainerForm(props: IContainerFormProps): JSX.Element {
|
||||||
max={1}
|
max={1}
|
||||||
step={0.01}
|
step={0.01}
|
||||||
value={(props.properties.style.fillOpacity ?? 1).toString()}
|
value={(props.properties.style.fillOpacity ?? 1).toString()}
|
||||||
onChange={(event) => props.onChange('fillOpacity', Number(event.target.value), PropertyType.Style)}
|
onChange={(event) => { props.onChange('fillOpacity', Number(event.target.value), PropertyType.Style); }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Category>
|
</Category>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { fireEvent, render, screen } from '@testing-library/react';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { expect, describe, it, vi } from 'vitest';
|
import { expect, describe, it, vi } from 'vitest';
|
||||||
import { PositionReference } from '../../Enums/PositionReference';
|
import { PositionReference } from '../../Enums/PositionReference';
|
||||||
import { IContainerProperties } from '../../Interfaces/IContainerProperties';
|
import { type IContainerProperties } from '../../Interfaces/IContainerProperties';
|
||||||
import { Orientation } from '../../Enums/Orientation';
|
import { Orientation } from '../../Enums/Orientation';
|
||||||
import { ContainerProperties } from './ContainerProperties';
|
import { ContainerProperties } from './ContainerProperties';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { PropertyType } from '../../Enums/PropertyType';
|
import { type PropertyType } from '../../Enums/PropertyType';
|
||||||
import { IContainerProperties } from '../../Interfaces/IContainerProperties';
|
import { type IContainerProperties } from '../../Interfaces/IContainerProperties';
|
||||||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||||
import { ContainerForm } from './ContainerForm';
|
import { ContainerForm } from './ContainerForm';
|
||||||
|
|
||||||
interface IPropertiesProps {
|
interface IPropertiesProps {
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { AddMethod } from '../../../Enums/AddMethod';
|
import { AddMethod } from '../../../Enums/AddMethod';
|
||||||
import { IAvailableContainer } from '../../../Interfaces/IAvailableContainer';
|
import { type IAvailableContainer } from '../../../Interfaces/IAvailableContainer';
|
||||||
import { IConfiguration } from '../../../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../../../Interfaces/IConfiguration';
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { IHistoryState } from '../../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../../Interfaces/IHistoryState';
|
||||||
import { IPattern, GetPattern, ContainerOrPattern } from '../../../Interfaces/IPattern';
|
import { type IPattern, GetPattern, type ContainerOrPattern } from '../../../Interfaces/IPattern';
|
||||||
import { ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
||||||
import { Orientation } from '../../../Enums/Orientation';
|
import { Orientation } from '../../../Enums/Orientation';
|
||||||
import { GetDefaultContainerProps } from '../../../utils/default';
|
import { GetDefaultContainerProps } from '../../../utils/default';
|
||||||
import { FindContainerById } from '../../../utils/itertools';
|
import { FindContainerById } from '../../../utils/itertools';
|
||||||
|
@ -308,8 +308,8 @@ function InitializeChildrenWithPattern(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const configs: Map<string, IAvailableContainer> = new Map(configuration.AvailableContainers.map(config => [config.Type, config]));
|
const configs = new Map<string, IAvailableContainer>(configuration.AvailableContainers.map(config => [config.Type, config]));
|
||||||
const patterns: Map<string, IPattern> = new Map(configuration.Patterns.map(pattern => [pattern.id, pattern]));
|
const patterns = new Map<string, IPattern>(configuration.Patterns.map(pattern => [pattern.id, pattern]));
|
||||||
const containerOrPattern = GetPattern(patternId, configs, patterns);
|
const containerOrPattern = GetPattern(patternId, configs, patterns);
|
||||||
|
|
||||||
if (containerOrPattern === undefined) {
|
if (containerOrPattern === undefined) {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { IHistoryState } from '../../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../../Interfaces/IHistoryState';
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { FindContainerById, MakeDFSIterator } from '../../../utils/itertools';
|
import { FindContainerById, MakeDFSIterator } from '../../../utils/itertools';
|
||||||
import { GetCurrentHistory } from '../Editor';
|
import { GetCurrentHistory } from '../Editor';
|
||||||
import { ApplyBehaviors, ApplyBehaviorsOnSiblings, ApplyBehaviorsOnSiblingsChildren } from '../Behaviors/Behaviors';
|
import { ApplyBehaviors, ApplyBehaviorsOnSiblings, ApplyBehaviorsOnSiblingsChildren } from '../Behaviors/Behaviors';
|
||||||
import { ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
import { PropertyType } from '../../../Enums/PropertyType';
|
import { PropertyType } from '../../../Enums/PropertyType';
|
||||||
import { TransformX, TransformY } from '../../../utils/svg';
|
import { TransformX, TransformY } from '../../../utils/svg';
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
import { Dispatch, SetStateAction } from 'react';
|
import { type Dispatch, type SetStateAction } from 'react';
|
||||||
import { AddMethod } from '../../../Enums/AddMethod';
|
import { AddMethod } from '../../../Enums/AddMethod';
|
||||||
import { IAction } from '../../../Interfaces/IAction';
|
import { type IAction } from '../../../Interfaces/IAction';
|
||||||
import { IConfiguration } from '../../../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../../../Interfaces/IConfiguration';
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { IHistoryState } from '../../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../../Interfaces/IHistoryState';
|
||||||
import { ISetContainerListRequest } from '../../../Interfaces/ISetContainerListRequest';
|
import { type ISetContainerListRequest } from '../../../Interfaces/ISetContainerListRequest';
|
||||||
import { ISetContainerListResponse } from '../../../Interfaces/ISetContainerListResponse';
|
import { type ISetContainerListResponse } from '../../../Interfaces/ISetContainerListResponse';
|
||||||
import { DISABLE_API } from '../../../utils/default';
|
import { DISABLE_API } from '../../../utils/default';
|
||||||
import { FindContainerById } from '../../../utils/itertools';
|
import { FindContainerById } from '../../../utils/itertools';
|
||||||
import { SetContainerList } from '../../API/api';
|
import { SetContainerList } from '../../API/api';
|
||||||
import { IMenuAction } from '../../Menu/Menu';
|
import { type IMenuAction } from '../../Menu/Menu';
|
||||||
import { GetCurrentHistoryState } from '../Editor';
|
import { GetCurrentHistoryState } from '../Editor';
|
||||||
import { AddContainers } from './AddContainer';
|
import { AddContainers } from './AddContainer';
|
||||||
import { DeleteContainer } from './ContainerOperations';
|
import { DeleteContainer } from './ContainerOperations';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { IHistoryState } from '../../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../../Interfaces/IHistoryState';
|
||||||
import { IConfiguration } from '../../../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../../../Interfaces/IConfiguration';
|
||||||
import { GetCircularReplacer } from '../../../utils/saveload';
|
import { GetCircularReplacer } from '../../../utils/saveload';
|
||||||
import { ID } from '../../SVG/SVG';
|
import { ID } from '../../SVG/SVG';
|
||||||
import { IEditorState } from '../../../Interfaces/IEditorState';
|
import { type IEditorState } from '../../../Interfaces/IEditorState';
|
||||||
import { SHOW_SELECTOR_TEXT } from '../../../utils/default';
|
import { SHOW_SELECTOR_TEXT } from '../../../utils/default';
|
||||||
|
|
||||||
export function SaveEditorAsJSON(
|
export function SaveEditorAsJSON(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Dispatch, SetStateAction } from 'react';
|
import { type Dispatch, type SetStateAction } from 'react';
|
||||||
import { IHistoryState } from '../../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../../Interfaces/IHistoryState';
|
||||||
import { ENABLE_SHORTCUTS } from '../../../utils/default';
|
import { ENABLE_SHORTCUTS } from '../../../utils/default';
|
||||||
|
|
||||||
export function OnKey(
|
export function OnKey(
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { IConfiguration } from '../../../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../../../Interfaces/IConfiguration';
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { IHistoryState } from '../../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../../Interfaces/IHistoryState';
|
||||||
import { ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
||||||
import { GetDefaultSymbolModel } from '../../../utils/default';
|
import { GetDefaultSymbolModel } from '../../../utils/default';
|
||||||
import { FindContainerById } from '../../../utils/itertools';
|
import { FindContainerById } from '../../../utils/itertools';
|
||||||
import { RestoreX } from '../../../utils/svg';
|
import { RestoreX } from '../../../utils/svg';
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* or make them lose their property as a rigid body
|
* or make them lose their property as a rigid body
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { Orientation } from '../../../Enums/Orientation';
|
import { Orientation } from '../../../Enums/Orientation';
|
||||||
import { ConstraintBodyInsideUnallocatedWidth } from './RigidBodyBehaviors';
|
import { ConstraintBodyInsideUnallocatedWidth } from './RigidBodyBehaviors';
|
||||||
import { FindContainerById } from '../../../utils/itertools';
|
import { FindContainerById } from '../../../utils/itertools';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
||||||
import { APPLY_BEHAVIORS_ON_CHILDREN, ENABLE_RIGID, ENABLE_SWAP } from '../../../utils/default';
|
import { APPLY_BEHAVIORS_ON_CHILDREN, ENABLE_RIGID, ENABLE_SWAP } from '../../../utils/default';
|
||||||
import { FindContainerById, MakeChildrenIterator } from '../../../utils/itertools';
|
import { FindContainerById, MakeChildrenIterator } from '../../../utils/itertools';
|
||||||
import { ApplyAnchor, GetOverlappingContainers } from './AnchorBehaviors';
|
import { ApplyAnchor, GetOverlappingContainers } from './AnchorBehaviors';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { Orientation } from '../../../Enums/Orientation';
|
import { Orientation } from '../../../Enums/Orientation';
|
||||||
import { Simplex } from '../../../utils/simplex';
|
import { Simplex } from '../../../utils/simplex';
|
||||||
import { ApplyWidthMargin, ApplyXMargin } from '../../../utils/svg';
|
import { ApplyWidthMargin, ApplyXMargin } from '../../../utils/svg';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { Orientation } from '../../../Enums/Orientation';
|
import { Orientation } from '../../../Enums/Orientation';
|
||||||
import { MakeChildrenIterator, ReversePairwise } from '../../../utils/itertools';
|
import { MakeChildrenIterator, ReversePairwise } from '../../../utils/itertools';
|
||||||
import { Flex } from './FlexBehaviors';
|
import { Flex } from './FlexBehaviors';
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
* If the contraints fails, an error message will be returned
|
* If the contraints fails, an error message will be returned
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { ISizePointer } from '../../../Interfaces/ISizePointer';
|
import { type ISizePointer } from '../../../Interfaces/ISizePointer';
|
||||||
import { Orientation } from '../../../Enums/Orientation';
|
import { Orientation } from '../../../Enums/Orientation';
|
||||||
import { ENABLE_HARD_RIGID } from '../../../utils/default';
|
import { ENABLE_HARD_RIGID } from '../../../utils/default';
|
||||||
import { FindContainerById, MakeChildrenIterator } from '../../../utils/itertools';
|
import { FindContainerById, MakeChildrenIterator } from '../../../utils/itertools';
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Swap two flex container when one is overlapping another
|
* Swap two flex container when one is overlapping another
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { Orientation } from '../../../Enums/Orientation';
|
import { Orientation } from '../../../Enums/Orientation';
|
||||||
import { GetHorizontallyOverlappingContainers, GetVerticallyOverlappingContainers } from './AnchorBehaviors';
|
import { GetHorizontallyOverlappingContainers, GetVerticallyOverlappingContainers } from './AnchorBehaviors';
|
||||||
import { MakeChildrenIterator } from '../../../utils/itertools';
|
import { MakeChildrenIterator } from '../../../utils/itertools';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
||||||
import { ApplyParentTransform, FindContainerById } from '../../../utils/itertools';
|
import { ApplyParentTransform, FindContainerById } from '../../../utils/itertools';
|
||||||
import { RestoreX, TransformX } from '../../../utils/svg';
|
import { RestoreX, TransformX } from '../../../utils/svg';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Dispatch, SetStateAction, useEffect, useRef } from 'react';
|
import React, { type Dispatch, type SetStateAction, useEffect, useRef } from 'react';
|
||||||
import './Editor.scss';
|
import './Editor.scss';
|
||||||
import { IConfiguration } from '../../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../../Interfaces/IConfiguration';
|
||||||
import { IHistoryState } from '../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../Interfaces/IHistoryState';
|
||||||
import { UI } from '../UI/UI';
|
import { UI } from '../UI/UI';
|
||||||
import { SelectContainer, DeleteContainer, OnPropertyChange } from './Actions/ContainerOperations';
|
import { SelectContainer, DeleteContainer, OnPropertyChange } from './Actions/ContainerOperations';
|
||||||
import { SaveEditorAsJSON, SaveEditorAsSVG } from './Actions/Save';
|
import { SaveEditorAsJSON, SaveEditorAsSVG } from './Actions/Save';
|
||||||
|
@ -29,7 +29,7 @@ function UseShortcuts(
|
||||||
): void {
|
): void {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function OnKeyUp(event: KeyboardEvent): void {
|
function OnKeyUp(event: KeyboardEvent): void {
|
||||||
return OnKey(
|
OnKey(
|
||||||
event,
|
event,
|
||||||
history,
|
history,
|
||||||
historyCurrentStep,
|
historyCurrentStep,
|
||||||
|
@ -120,25 +120,31 @@ export function Editor(props: IEditorProps): JSX.Element {
|
||||||
history,
|
history,
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
}}
|
}}
|
||||||
selectContainer={(container) => setNewHistory(
|
selectContainer={(container) => {
|
||||||
|
setNewHistory(
|
||||||
SelectContainer(
|
SelectContainer(
|
||||||
container,
|
container,
|
||||||
history,
|
history,
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
))}
|
));
|
||||||
deleteContainer={(containerId: string) => setNewHistory(
|
}}
|
||||||
|
deleteContainer={(containerId: string) => {
|
||||||
|
setNewHistory(
|
||||||
DeleteContainer(
|
DeleteContainer(
|
||||||
containerId,
|
containerId,
|
||||||
history,
|
history,
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
))}
|
));
|
||||||
onPropertyChange={(key, value, type) => setNewHistory(
|
}}
|
||||||
|
onPropertyChange={(key, value, type) => {
|
||||||
|
setNewHistory(
|
||||||
OnPropertyChange(
|
OnPropertyChange(
|
||||||
key, value, type,
|
key, value, type,
|
||||||
selected,
|
selected,
|
||||||
history,
|
history,
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
))}
|
));
|
||||||
|
}}
|
||||||
addContainer={(type) => {
|
addContainer={(type) => {
|
||||||
if (selected === null || selected === undefined) {
|
if (selected === null || selected === undefined) {
|
||||||
return;
|
return;
|
||||||
|
@ -152,7 +158,8 @@ export function Editor(props: IEditorProps): JSX.Element {
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
));
|
));
|
||||||
}}
|
}}
|
||||||
addContainerAt={(index, type, parent) => setNewHistory(
|
addContainerAt={(index, type, parent) => {
|
||||||
|
setNewHistory(
|
||||||
AddContainer(
|
AddContainer(
|
||||||
index,
|
index,
|
||||||
type,
|
type,
|
||||||
|
@ -161,39 +168,50 @@ export function Editor(props: IEditorProps): JSX.Element {
|
||||||
history,
|
history,
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
)
|
)
|
||||||
)}
|
);
|
||||||
addSymbol={(type) => setNewHistory(
|
}}
|
||||||
|
addSymbol={(type) => {
|
||||||
|
setNewHistory(
|
||||||
AddSymbol(
|
AddSymbol(
|
||||||
type,
|
type,
|
||||||
configuration,
|
configuration,
|
||||||
history,
|
history,
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
))}
|
));
|
||||||
onSymbolPropertyChange={(key, value) => setNewHistory(
|
}}
|
||||||
|
onSymbolPropertyChange={(key, value) => {
|
||||||
|
setNewHistory(
|
||||||
OnSymbolPropertyChange(
|
OnSymbolPropertyChange(
|
||||||
key, value,
|
key, value,
|
||||||
history,
|
history,
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
))}
|
));
|
||||||
selectSymbol={(symbolId) => setNewHistory(
|
}}
|
||||||
|
selectSymbol={(symbolId) => {
|
||||||
|
setNewHistory(
|
||||||
SelectSymbol(
|
SelectSymbol(
|
||||||
symbolId,
|
symbolId,
|
||||||
history,
|
history,
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
))}
|
));
|
||||||
deleteSymbol={(symbolId) => setNewHistory(
|
}}
|
||||||
|
deleteSymbol={(symbolId) => {
|
||||||
|
setNewHistory(
|
||||||
DeleteSymbol(
|
DeleteSymbol(
|
||||||
symbolId,
|
symbolId,
|
||||||
history,
|
history,
|
||||||
historyCurrentStep
|
historyCurrentStep
|
||||||
))}
|
));
|
||||||
saveEditorAsJSON={() => SaveEditorAsJSON(
|
}}
|
||||||
|
saveEditorAsJSON={() => {
|
||||||
|
SaveEditorAsJSON(
|
||||||
history,
|
history,
|
||||||
historyCurrentStep,
|
historyCurrentStep,
|
||||||
configuration
|
configuration
|
||||||
)}
|
);
|
||||||
saveEditorAsSVG={() => SaveEditorAsSVG()}
|
}}
|
||||||
loadState={(move) => setHistoryCurrentStep(move)}
|
saveEditorAsSVG={() => { SaveEditorAsSVG(); }}
|
||||||
|
loadState={(move) => { setHistoryCurrentStep(move); }}
|
||||||
/>
|
/>
|
||||||
<Menu
|
<Menu
|
||||||
getListener={() => editorRef.current}
|
getListener={() => editorRef.current}
|
||||||
|
|
|
@ -4,10 +4,10 @@ import useSize from '@react-hook/size';
|
||||||
import { FixedSizeList as List } from 'react-window';
|
import { FixedSizeList as List } from 'react-window';
|
||||||
import { ExclamationTriangleIcon } from '@heroicons/react/24/outline';
|
import { ExclamationTriangleIcon } from '@heroicons/react/24/outline';
|
||||||
import { ContainerProperties } from '../ContainerProperties/ContainerProperties';
|
import { ContainerProperties } from '../ContainerProperties/ContainerProperties';
|
||||||
import { IContainerModel } from '../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../Interfaces/IContainerModel';
|
||||||
import { FindContainerById, MakeRecursionDFSIterator } from '../../utils/itertools';
|
import { FindContainerById, MakeRecursionDFSIterator } from '../../utils/itertools';
|
||||||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||||
import { PropertyType } from '../../Enums/PropertyType';
|
import { type PropertyType } from '../../Enums/PropertyType';
|
||||||
import { ToggleSideBar } from '../Sidebar/ToggleSideBar/ToggleSideBar';
|
import { ToggleSideBar } from '../Sidebar/ToggleSideBar/ToggleSideBar';
|
||||||
import { Text } from '../Text/Text';
|
import { Text } from '../Text/Text';
|
||||||
|
|
||||||
|
@ -229,10 +229,10 @@ function ElementsListRow(
|
||||||
key={key}
|
key={key}
|
||||||
style={style}
|
style={style}
|
||||||
title={container.properties.warning}
|
title={container.properties.warning}
|
||||||
onClick={() => selectContainer(container.properties.id)}
|
onClick={() => { selectContainer(container.properties.id); }}
|
||||||
onDrop={(event) => HandleOnDrop(event, containers, mainContainer, addContainer)}
|
onDrop={(event) => { HandleOnDrop(event, containers, mainContainer, addContainer); }}
|
||||||
onDragOver={(event) => HandleDragOver(event, mainContainer)}
|
onDragOver={(event) => { HandleDragOver(event, mainContainer); }}
|
||||||
onDragLeave={(event) => HandleDragLeave(event)}
|
onDragLeave={(event) => { HandleDragLeave(event); }}
|
||||||
>
|
>
|
||||||
{verticalBars}
|
{verticalBars}
|
||||||
{text}
|
{text}
|
||||||
|
|
|
@ -26,7 +26,7 @@ export function FloatingButton(props: IFloatingButtonProps): JSX.Element {
|
||||||
<button type="button"
|
<button type="button"
|
||||||
className={'transition-all w-14 h-14 p-2 align-middle items-center justify-center rounded-full bg-blue-500 hover:bg-blue-800'}
|
className={'transition-all w-14 h-14 p-2 align-middle items-center justify-center rounded-full bg-blue-500 hover:bg-blue-800'}
|
||||||
title='Open menu'
|
title='Open menu'
|
||||||
onClick={() => ToggleState(isHidden, setHidden)}
|
onClick={() => { ToggleState(isHidden, setHidden); }}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { CameraIcon, ArrowUpOnSquareIcon } from '@heroicons/react/24/outline';
|
import { CameraIcon, ArrowUpOnSquareIcon } from '@heroicons/react/24/outline';
|
||||||
import { FloatingButton } from './FloatingButton';
|
import { FloatingButton } from './FloatingButton';
|
||||||
import { IUIProps } from '../UI/UI';
|
import { type IUIProps } from '../UI/UI';
|
||||||
|
|
||||||
export function MenuButton(props: IUIProps): JSX.Element {
|
export function MenuButton(props: IUIProps): JSX.Element {
|
||||||
return <FloatingButton className={'fixed z-10 flex flex-col gap-2 items-center bottom-12 right-12'}>
|
return <FloatingButton className={'fixed z-10 flex flex-col gap-2 items-center bottom-12 right-12'}>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { FixedSizeList as List } from 'react-window';
|
import { FixedSizeList as List } from 'react-window';
|
||||||
import { IHistoryState } from '../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../Interfaces/IHistoryState';
|
||||||
import { TITLE_BAR_HEIGHT } from '../Sidebar/Sidebar';
|
import { TITLE_BAR_HEIGHT } from '../Sidebar/Sidebar';
|
||||||
|
|
||||||
interface IHistoryProps {
|
interface IHistoryProps {
|
||||||
|
@ -23,7 +23,7 @@ export function History(props: IHistoryProps): JSX.Element {
|
||||||
<button type="button"
|
<button type="button"
|
||||||
key={reversedIndex}
|
key={reversedIndex}
|
||||||
style={style}
|
style={style}
|
||||||
onClick={() => props.jumpTo(reversedIndex)}
|
onClick={() => { props.jumpTo(reversedIndex); }}
|
||||||
title={step.lastAction}
|
title={step.lastAction}
|
||||||
className={`w-full elements-sidebar-row border-blue-500 whitespace-pre overflow-hidden
|
className={`w-full elements-sidebar-row border-blue-500 whitespace-pre overflow-hidden
|
||||||
text-left text-sm font-medium transition-all ${selectedClass}`}
|
text-left text-sm font-medium transition-all ${selectedClass}`}
|
||||||
|
|
|
@ -53,7 +53,7 @@ export function TextInputGroup(props: ITextInputGroupProps): JSX.Element {
|
||||||
className={`${className} ${props.inputClassName} ${warningClass}`}
|
className={`${className} ${props.inputClassName} ${warningClass}`}
|
||||||
type={props.type}
|
type={props.type}
|
||||||
value={value}
|
value={value}
|
||||||
onChange={(event) => setValue(event.target.value)}
|
onChange={(event) => { setValue(event.target.value); }}
|
||||||
onKeyUp={OnKeyUp}
|
onKeyUp={OnKeyUp}
|
||||||
min={props.min}
|
min={props.min}
|
||||||
max={props.max}
|
max={props.max}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { createContext, useState } from 'react';
|
import { createContext, useState } from 'react';
|
||||||
import { ILanguage } from '../../Interfaces/ILanguage';
|
import { type ILanguage } from '../../Interfaces/ILanguage';
|
||||||
import { languageOptions, translations } from '../../Translations/Translations';
|
import { languageOptions, translations } from '../../Translations/Translations';
|
||||||
import { DEFAULT_LANGUAGE } from '../../utils/default';
|
import { DEFAULT_LANGUAGE } from '../../utils/default';
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ export function MainMenu(props: IMainMenuProps): JSX.Element {
|
||||||
</label>
|
</label>
|
||||||
</form>
|
</form>
|
||||||
<button type="button"
|
<button type="button"
|
||||||
onClick={() => setWindowState(WindowState.Main)}
|
onClick={() => { setWindowState(WindowState.Main); }}
|
||||||
className='normal-btn block
|
className='normal-btn block
|
||||||
mt-8 '
|
mt-8 '
|
||||||
>
|
>
|
||||||
|
@ -70,7 +70,7 @@ export function MainMenu(props: IMainMenuProps): JSX.Element {
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className='mainmenu-btn'
|
className='mainmenu-btn'
|
||||||
onClick={() => setWindowState(WindowState.Load)}
|
onClick={() => { setWindowState(WindowState.Load); }}
|
||||||
>
|
>
|
||||||
{Text({ textId: '@LoadConfigFile' })}
|
{Text({ textId: '@LoadConfigFile' })}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import useSize from '@react-hook/size';
|
import useSize from '@react-hook/size';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IPoint } from '../../Interfaces/IPoint';
|
import { type IPoint } from '../../Interfaces/IPoint';
|
||||||
import { MenuItem } from './MenuItem';
|
import { MenuItem } from './MenuItem';
|
||||||
|
|
||||||
interface IMenuProps {
|
interface IMenuProps {
|
||||||
|
@ -136,7 +136,7 @@ function AddClassSpecificActions(
|
||||||
text={action.text}
|
text={action.text}
|
||||||
title={action.title}
|
title={action.title}
|
||||||
shortcut={action.shortcut}
|
shortcut={action.shortcut}
|
||||||
onClick={() => action.action(target)} />);
|
onClick={() => { action.action(target); }} />);
|
||||||
});
|
});
|
||||||
children.push(<hr key={`contextmenu-hr-${count}`} className='border-slate-400' />);
|
children.push(<hr key={`contextmenu-hr-${count}`} className='border-slate-400' />);
|
||||||
};
|
};
|
||||||
|
@ -155,7 +155,7 @@ function AddUniversalActions(props: IMenuProps, children: JSX.Element[], count:
|
||||||
text={action.text}
|
text={action.text}
|
||||||
title={action.title}
|
title={action.title}
|
||||||
shortcut={action.shortcut}
|
shortcut={action.shortcut}
|
||||||
onClick={() => action.action(target)} />);
|
onClick={() => { action.action(target); }} />);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ export function MenuItem(props: IMenuItemProps): JSX.Element {
|
||||||
<button type="button"
|
<button type="button"
|
||||||
className={`flex place-content-between ${props.className ?? ''}`}
|
className={`flex place-content-between ${props.className ?? ''}`}
|
||||||
title={props.title}
|
title={props.title}
|
||||||
onClick={() => props.onClick()}>
|
onClick={() => { props.onClick(); }}>
|
||||||
{props.text}
|
{props.text}
|
||||||
<span dangerouslySetInnerHTML={{ __html: props.shortcut ?? '' }} />
|
<span dangerouslySetInnerHTML={{ __html: props.shortcut ?? '' }} />
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { TrashIcon } from '@heroicons/react/24/outline';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { FixedSizeList as List } from 'react-window';
|
import { FixedSizeList as List } from 'react-window';
|
||||||
import { MessageType } from '../../Enums/MessageType';
|
import { MessageType } from '../../Enums/MessageType';
|
||||||
import { IHistoryState } from '../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../Interfaces/IHistoryState';
|
||||||
import { IMessage } from '../../Interfaces/IMessage';
|
import { type IMessage } from '../../Interfaces/IMessage';
|
||||||
import { TITLE_BAR_HEIGHT } from '../Sidebar/Sidebar';
|
import { TITLE_BAR_HEIGHT } from '../Sidebar/Sidebar';
|
||||||
import { Text } from '../Text/Text';
|
import { Text } from '../Text/Text';
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ interface IMessagesProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Messages(props: IMessagesProps): JSX.Element {
|
export function Messages(props: IMessagesProps): JSX.Element {
|
||||||
function Row({ index, style }: {index: number, style: React.CSSProperties}): JSX.Element {
|
function Row({ index, style }: { index: number, style: React.CSSProperties }): JSX.Element {
|
||||||
const reversedIndex = (props.messages.length - 1) - index;
|
const reversedIndex = (props.messages.length - 1) - index;
|
||||||
const message = props.messages[reversedIndex];
|
const message = props.messages[reversedIndex];
|
||||||
let classType = '';
|
let classType = '';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IInputGroup } from '../../Interfaces/IInputGroup';
|
import { type IInputGroup } from '../../Interfaces/IInputGroup';
|
||||||
|
|
||||||
interface IRadioGroupButtonsProps {
|
interface IRadioGroupButtonsProps {
|
||||||
name: string
|
name: string
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Interweave, Node } from 'interweave';
|
import { Interweave, type Node } from 'interweave';
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { IContainerProperties } from '../../../Interfaces/IContainerProperties';
|
import { type IContainerProperties } from '../../../Interfaces/IContainerProperties';
|
||||||
import { Camelize } from '../../../utils/stringtools';
|
import { Camelize } from '../../../utils/stringtools';
|
||||||
import { SHOW_TEXT } from '../../../utils/default';
|
import { SHOW_TEXT } from '../../../utils/default';
|
||||||
import { FindContainerById } from '../../../utils/itertools';
|
import { FindContainerById } from '../../../utils/itertools';
|
||||||
|
@ -67,7 +67,7 @@ export function Container(props: IContainerProps): JSX.Element {
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
style={style}
|
style={style}
|
||||||
onClick={() => props.selectContainer(props.model.properties.id)}
|
onClick={() => { props.selectContainer(props.model.properties.id); }}
|
||||||
>
|
>
|
||||||
</rect>);
|
</rect>);
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ function CreateReactCustomSVG(customSVG: string, properties: IContainerPropertie
|
||||||
function Transform(node: HTMLElement, children: Node[], properties: IContainerProperties): React.ReactNode {
|
function Transform(node: HTMLElement, children: Node[], properties: IContainerProperties): React.ReactNode {
|
||||||
const supportedTags = ['line', 'path', 'rect'];
|
const supportedTags = ['line', 'path', 'rect'];
|
||||||
if (supportedTags.includes(node.tagName.toLowerCase())) {
|
if (supportedTags.includes(node.tagName.toLowerCase())) {
|
||||||
const attributes: { [att: string]: string | object | null } = {};
|
const attributes: Record<string, string | object | null> = {};
|
||||||
node.getAttributeNames().forEach(attName => {
|
node.getAttributeNames().forEach(attName => {
|
||||||
const attributeValue = node.getAttribute(attName);
|
const attributeValue = node.getAttribute(attName);
|
||||||
if (attributeValue === null) {
|
if (attributeValue === null) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import { DIMENSION_MARGIN } from '../../../utils/default';
|
import { DIMENSION_MARGIN } from '../../../utils/default';
|
||||||
import { GetAbsolutePosition, MakeBFSIterator } from '../../../utils/itertools';
|
import { GetAbsolutePosition, MakeBFSIterator } from '../../../utils/itertools';
|
||||||
import { TransformX } from '../../../utils/svg';
|
import { TransformX } from '../../../utils/svg';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Orientation } from '../../../Enums/Orientation';
|
import { Orientation } from '../../../Enums/Orientation';
|
||||||
import { Position } from '../../../Enums/Position';
|
import { Position } from '../../../Enums/Position';
|
||||||
import { IContainerModel } from '../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../Interfaces/IContainerModel';
|
||||||
import {
|
import {
|
||||||
DIMENSION_MARGIN,
|
DIMENSION_MARGIN,
|
||||||
SHOW_BORROWER_DIMENSIONS,
|
SHOW_BORROWER_DIMENSIONS,
|
||||||
|
@ -12,7 +12,7 @@ import {
|
||||||
import { FindContainerById, MakeRecursionDFSIterator, Pairwise } from '../../../utils/itertools';
|
import { FindContainerById, MakeRecursionDFSIterator, Pairwise } from '../../../utils/itertools';
|
||||||
import { TransformX, TransformY } from '../../../utils/svg';
|
import { TransformX, TransformY } from '../../../utils/svg';
|
||||||
import { Dimension } from './Dimension';
|
import { Dimension } from './Dimension';
|
||||||
import { ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
||||||
|
|
||||||
interface IDimensionLayerProps {
|
interface IDimensionLayerProps {
|
||||||
containers: Map<string, IContainerModel>
|
containers: Map<string, IContainerModel>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import './Selector.scss';
|
import './Selector.scss';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IContainerModel } from '../../../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../../../Interfaces/IContainerModel';
|
||||||
import { SHOW_SELECTOR_TEXT } from '../../../../utils/default';
|
import { SHOW_SELECTOR_TEXT } from '../../../../utils/default';
|
||||||
import { GetAbsolutePosition } from '../../../../utils/itertools';
|
import { GetAbsolutePosition } from '../../../../utils/itertools';
|
||||||
import { RemoveMargin } from '../../../../utils/svg';
|
import { RemoveMargin } from '../../../../utils/svg';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Interweave } from 'interweave';
|
import { Interweave } from 'interweave';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
||||||
import { DIMENSION_MARGIN, SYMBOL_MARGIN } from '../../../utils/default';
|
import { DIMENSION_MARGIN, SYMBOL_MARGIN } from '../../../utils/default';
|
||||||
|
|
||||||
interface ISymbolProps {
|
interface ISymbolProps {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../../Interfaces/ISymbolModel';
|
||||||
import { Symbol } from './Symbol';
|
import { Symbol } from './Symbol';
|
||||||
|
|
||||||
interface ISymbolLayerProps {
|
interface ISymbolLayerProps {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { ReactSVGPanZoom, Tool, TOOL_PAN, Value } from 'react-svg-pan-zoom';
|
import { ReactSVGPanZoom, type Tool, TOOL_PAN, type Value } from 'react-svg-pan-zoom';
|
||||||
import { Container } from './Elements/Container';
|
import { Container } from './Elements/Container';
|
||||||
import { IContainerModel } from '../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../Interfaces/IContainerModel';
|
||||||
import { Selector } from './Elements/Selector/Selector';
|
import { Selector } from './Elements/Selector/Selector';
|
||||||
import { DepthDimensionLayer } from './Elements/DepthDimensionLayer';
|
import { DepthDimensionLayer } from './Elements/DepthDimensionLayer';
|
||||||
import { MAX_FRAMERATE, SHOW_DIMENSIONS_PER_DEPTH } from '../../utils/default';
|
import { MAX_FRAMERATE, SHOW_DIMENSIONS_PER_DEPTH } from '../../utils/default';
|
||||||
import { SymbolLayer } from './Elements/SymbolLayer';
|
import { SymbolLayer } from './Elements/SymbolLayer';
|
||||||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||||
import { DimensionLayer } from './Elements/DimensionLayer';
|
import { DimensionLayer } from './Elements/DimensionLayer';
|
||||||
|
|
||||||
interface ISVGProps {
|
interface ISVGProps {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IInputGroup } from '../../Interfaces/IInputGroup';
|
import { type IInputGroup } from '../../Interfaces/IInputGroup';
|
||||||
|
|
||||||
interface ISelectProps {
|
interface ISelectProps {
|
||||||
labelKey?: string
|
labelKey?: string
|
||||||
|
|
|
@ -13,7 +13,7 @@ export function ToggleSideBar({ title, checked, onChange }: IToggleSidebarProps)
|
||||||
<button
|
<button
|
||||||
className={'w-full py-2'}
|
className={'w-full py-2'}
|
||||||
type='button'
|
type='button'
|
||||||
onClick={() => onChange(!checked)}
|
onClick={() => { onChange(!checked); }}
|
||||||
>
|
>
|
||||||
<p className='text-vertical'>{title}
|
<p className='text-vertical'>{title}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||||
import { RestoreX, TransformX } from '../../utils/svg';
|
import { RestoreX, TransformX } from '../../utils/svg';
|
||||||
import { InputGroup } from '../InputGroup/InputGroup';
|
import { InputGroup } from '../InputGroup/InputGroup';
|
||||||
import { TextInputGroup } from '../InputGroup/TextInputGroup';
|
import { TextInputGroup } from '../InputGroup/TextInputGroup';
|
||||||
import { Text } from '../Text/Text';
|
import { Text } from '../Text/Text';
|
||||||
import { PropertyType } from '../../Enums/PropertyType';
|
|
||||||
import { ToggleButton } from '../ToggleButton/ToggleButton';
|
import { ToggleButton } from '../ToggleButton/ToggleButton';
|
||||||
|
|
||||||
interface ISymbolFormProps {
|
interface ISymbolFormProps {
|
||||||
|
@ -32,7 +31,7 @@ export function SymbolForm(props: ISymbolFormProps): JSX.Element {
|
||||||
inputClassName=''
|
inputClassName=''
|
||||||
type='string'
|
type='string'
|
||||||
value={props.symbol.displayedText}
|
value={props.symbol.displayedText}
|
||||||
onChange={(value) => props.onChange('displayedText', value)} />
|
onChange={(value) => { props.onChange('displayedText', value); }} />
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id='x'
|
id='x'
|
||||||
labelText={Text({ textId: '@SymbolX' })}
|
labelText={Text({ textId: '@SymbolX' })}
|
||||||
|
@ -41,7 +40,7 @@ export function SymbolForm(props: ISymbolFormProps): JSX.Element {
|
||||||
inputClassName=''
|
inputClassName=''
|
||||||
type='number'
|
type='number'
|
||||||
value={TransformX(props.symbol.x, props.symbol.width, props.symbol.config.PositionReference).toString()}
|
value={TransformX(props.symbol.x, props.symbol.width, props.symbol.config.PositionReference).toString()}
|
||||||
onChange={(value) => props.onChange('x', RestoreX(Number(value), props.symbol.width, props.symbol.config.PositionReference))} />
|
onChange={(value) => { props.onChange('x', RestoreX(Number(value), props.symbol.width, props.symbol.config.PositionReference)); }} />
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id='height'
|
id='height'
|
||||||
labelText={Text({ textId: '@SymbolHeight' })}
|
labelText={Text({ textId: '@SymbolHeight' })}
|
||||||
|
@ -51,7 +50,7 @@ export function SymbolForm(props: ISymbolFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={0}
|
min={0}
|
||||||
value={props.symbol.height.toString()}
|
value={props.symbol.height.toString()}
|
||||||
onChange={(value) => props.onChange('height', Number(value))} />
|
onChange={(value) => { props.onChange('height', Number(value)); }} />
|
||||||
<TextInputGroup
|
<TextInputGroup
|
||||||
id='width'
|
id='width'
|
||||||
labelText={Text({ textId: '@SymbolWidth' })}
|
labelText={Text({ textId: '@SymbolWidth' })}
|
||||||
|
@ -61,14 +60,14 @@ export function SymbolForm(props: ISymbolFormProps): JSX.Element {
|
||||||
type='number'
|
type='number'
|
||||||
min={0}
|
min={0}
|
||||||
value={props.symbol.width.toString()}
|
value={props.symbol.width.toString()}
|
||||||
onChange={(value) => props.onChange('width', Number(value))} />
|
onChange={(value) => { props.onChange('width', Number(value)); }} />
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
labelText={Text({ textId: '@ShowDimension' })}
|
labelText={Text({ textId: '@ShowDimension' })}
|
||||||
inputKey='showDimension'
|
inputKey='showDimension'
|
||||||
labelClassName=''
|
labelClassName=''
|
||||||
inputClassName=''
|
inputClassName=''
|
||||||
checked={props.symbol.showDimension}
|
checked={props.symbol.showDimension}
|
||||||
onChange={(e) => props.onChange('showDimension', e.target.checked)}/>
|
onChange={(e) => { props.onChange('showDimension', e.target.checked); }}/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||||
import { SymbolForm } from './SymbolForm';
|
import { SymbolForm } from './SymbolForm';
|
||||||
|
|
||||||
interface ISymbolPropertiesProps {
|
interface ISymbolPropertiesProps {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IAvailableSymbol } from '../../Interfaces/IAvailableSymbol';
|
import { type IAvailableSymbol } from '../../Interfaces/IAvailableSymbol';
|
||||||
import { TruncateString } from '../../utils/stringtools';
|
import { TruncateString } from '../../utils/stringtools';
|
||||||
|
|
||||||
interface ISymbolsProps {
|
interface ISymbolsProps {
|
||||||
|
@ -20,9 +20,9 @@ export function Symbols(props: ISymbolsProps): JSX.Element {
|
||||||
key={componentOption.Name}
|
key={componentOption.Name}
|
||||||
id={componentOption.Name}
|
id={componentOption.Name}
|
||||||
title={componentOption.Name}
|
title={componentOption.Name}
|
||||||
onClick={() => props.buttonOnClick(componentOption.Name)}
|
onClick={() => { props.buttonOnClick(componentOption.Name); }}
|
||||||
draggable={true}
|
draggable={true}
|
||||||
onDragStart={(event) => HandleDragStart(event)}
|
onDragStart={(event) => { HandleDragStart(event); }}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<img
|
<img
|
||||||
|
@ -41,9 +41,9 @@ export function Symbols(props: ISymbolsProps): JSX.Element {
|
||||||
key={componentOption.Name}
|
key={componentOption.Name}
|
||||||
id={componentOption.Name}
|
id={componentOption.Name}
|
||||||
title={componentOption.Name}
|
title={componentOption.Name}
|
||||||
onClick={() => props.buttonOnClick(componentOption.Name)}
|
onClick={() => { props.buttonOnClick(componentOption.Name); }}
|
||||||
draggable={true}
|
draggable={true}
|
||||||
onDragStart={(event) => HandleDragStart(event)}
|
onDragStart={(event) => { HandleDragStart(event); }}
|
||||||
>
|
>
|
||||||
|
|
||||||
{TruncateString(componentOption.Name, 5)}
|
{TruncateString(componentOption.Name, 5)}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import useSize from '@react-hook/size';
|
import useSize from '@react-hook/size';
|
||||||
import { FixedSizeList as List } from 'react-window';
|
import { FixedSizeList as List } from 'react-window';
|
||||||
import { ISymbolModel } from '../../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||||
import { SymbolProperties } from '../SymbolProperties/SymbolProperties';
|
import { SymbolProperties } from '../SymbolProperties/SymbolProperties';
|
||||||
import { ToggleSideBar } from '../Sidebar/ToggleSideBar/ToggleSideBar';
|
import { ToggleSideBar } from '../Sidebar/ToggleSideBar/ToggleSideBar';
|
||||||
import { Text } from '../Text/Text';
|
import { Text } from '../Text/Text';
|
||||||
|
@ -39,7 +39,7 @@ export function SymbolsSidebar(props: ISymbolsSidebarProps): JSX.Element {
|
||||||
id={key}
|
id={key}
|
||||||
key={key}
|
key={key}
|
||||||
style={style}
|
style={style}
|
||||||
onClick={() => props.selectSymbol(key)}
|
onClick={() => { props.selectSymbol(key); }}
|
||||||
>
|
>
|
||||||
{text}
|
{text}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -4,17 +4,17 @@ import { History } from '../History/History';
|
||||||
import { Bar, BAR_WIDTH } from '../Bar/Bar';
|
import { Bar, BAR_WIDTH } from '../Bar/Bar';
|
||||||
import { Symbols } from '../Symbols/Symbols';
|
import { Symbols } from '../Symbols/Symbols';
|
||||||
import { SymbolsSidebar } from '../SymbolsList/SymbolsSidebar';
|
import { SymbolsSidebar } from '../SymbolsList/SymbolsSidebar';
|
||||||
import { PropertyType } from '../../Enums/PropertyType';
|
import { type PropertyType } from '../../Enums/PropertyType';
|
||||||
import { Messages } from '../Messages/Messages';
|
import { Messages } from '../Messages/Messages';
|
||||||
import { Sidebar } from '../Sidebar/Sidebar';
|
import { Sidebar } from '../Sidebar/Sidebar';
|
||||||
import { Components } from '../Components/Components';
|
import { Components } from '../Components/Components';
|
||||||
import { Viewer } from '../Viewer/Viewer';
|
import { Viewer } from '../Viewer/Viewer';
|
||||||
import { Settings } from '../Settings/Settings';
|
import { Settings } from '../Settings/Settings';
|
||||||
import { IMessage } from '../../Interfaces/IMessage';
|
import { type IMessage } from '../../Interfaces/IMessage';
|
||||||
import { DISABLE_API } from '../../utils/default';
|
import { DISABLE_API } from '../../utils/default';
|
||||||
import { UseWorker, UseAsync } from './UseWorker';
|
import { UseWorker, UseAsync } from './UseWorker';
|
||||||
import { FindContainerById } from '../../utils/itertools';
|
import { FindContainerById } from '../../utils/itertools';
|
||||||
import { IEditorState } from '../../Interfaces/IEditorState';
|
import { type IEditorState } from '../../Interfaces/IEditorState';
|
||||||
import { GetCurrentHistoryState } from '../Editor/Editor';
|
import { GetCurrentHistoryState } from '../Editor/Editor';
|
||||||
import { Text } from '../Text/Text';
|
import { Text } from '../Text/Text';
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ export function UI({ editorState, ...methods }: IUIProps): JSX.Element {
|
||||||
selectContainer={methods.selectContainer}
|
selectContainer={methods.selectContainer}
|
||||||
addContainer={methods.addContainerAt}
|
addContainer={methods.addContainerAt}
|
||||||
isExpanded ={false}
|
isExpanded ={false}
|
||||||
onExpandChange={() => setOrToggleSidebar(SidebarType.ComponentsExpanded) }
|
onExpandChange={() => { setOrToggleSidebar(SidebarType.ComponentsExpanded); } }
|
||||||
/>;
|
/>;
|
||||||
break;
|
break;
|
||||||
case SidebarType.ComponentsExpanded:
|
case SidebarType.ComponentsExpanded:
|
||||||
|
@ -137,7 +137,7 @@ export function UI({ editorState, ...methods }: IUIProps): JSX.Element {
|
||||||
selectContainer={methods.selectContainer}
|
selectContainer={methods.selectContainer}
|
||||||
addContainer={methods.addContainerAt}
|
addContainer={methods.addContainerAt}
|
||||||
isExpanded ={true}
|
isExpanded ={true}
|
||||||
onExpandChange={() => setOrToggleSidebar(SidebarType.Components) }
|
onExpandChange={() => { setOrToggleSidebar(SidebarType.Components); } }
|
||||||
/>;
|
/>;
|
||||||
break;
|
break;
|
||||||
case SidebarType.Symbols:
|
case SidebarType.Symbols:
|
||||||
|
@ -153,7 +153,7 @@ export function UI({ editorState, ...methods }: IUIProps): JSX.Element {
|
||||||
onPropertyChange={methods.onSymbolPropertyChange}
|
onPropertyChange={methods.onSymbolPropertyChange}
|
||||||
selectSymbol={methods.selectSymbol}
|
selectSymbol={methods.selectSymbol}
|
||||||
isExpanded ={false}
|
isExpanded ={false}
|
||||||
onExpandChange={() => setOrToggleSidebar(SidebarType.SymbolsExpanded) }
|
onExpandChange={() => { setOrToggleSidebar(SidebarType.SymbolsExpanded); } }
|
||||||
/>;
|
/>;
|
||||||
break;
|
break;
|
||||||
case SidebarType.SymbolsExpanded:
|
case SidebarType.SymbolsExpanded:
|
||||||
|
@ -169,7 +169,7 @@ export function UI({ editorState, ...methods }: IUIProps): JSX.Element {
|
||||||
onPropertyChange={methods.onSymbolPropertyChange}
|
onPropertyChange={methods.onSymbolPropertyChange}
|
||||||
selectSymbol={methods.selectSymbol}
|
selectSymbol={methods.selectSymbol}
|
||||||
isExpanded ={true}
|
isExpanded ={true}
|
||||||
onExpandChange={() => setOrToggleSidebar(SidebarType.Symbols)}
|
onExpandChange={() => { setOrToggleSidebar(SidebarType.Symbols); }}
|
||||||
/>;
|
/>;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ export function UI({ editorState, ...methods }: IUIProps): JSX.Element {
|
||||||
leftChildren = <Messages
|
leftChildren = <Messages
|
||||||
historyState={current}
|
historyState={current}
|
||||||
messages={messages}
|
messages={messages}
|
||||||
clearMessage={() => setMessages([])}
|
clearMessage={() => { setMessages([]); }}
|
||||||
/>;
|
/>;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IHistoryState } from '../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../Interfaces/IHistoryState';
|
||||||
import { IGetFeedbackRequest } from '../../Interfaces/IGetFeedbackRequest';
|
import { type IGetFeedbackRequest } from '../../Interfaces/IGetFeedbackRequest';
|
||||||
import { IGetFeedbackResponse } from '../../Interfaces/IGetFeedbackResponse';
|
import { type IGetFeedbackResponse } from '../../Interfaces/IGetFeedbackResponse';
|
||||||
import { IMessage } from '../../Interfaces/IMessage';
|
import { type IMessage } from '../../Interfaces/IMessage';
|
||||||
import { GetCircularReplacer } from '../../utils/saveload';
|
import { GetCircularReplacer } from '../../utils/saveload';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { IContainerModel } from '../../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../../Interfaces/IContainerModel';
|
||||||
import { IHistoryState } from '../../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../../Interfaces/IHistoryState';
|
||||||
import { IPoint } from '../../Interfaces/IPoint';
|
import { type IPoint } from '../../Interfaces/IPoint';
|
||||||
import { DIMENSION_MARGIN, USE_EXPERIMENTAL_CANVAS_API } from '../../utils/default';
|
import { DIMENSION_MARGIN, USE_EXPERIMENTAL_CANVAS_API } from '../../utils/default';
|
||||||
import { FindContainerById, MakeRecursionDFSIterator } from '../../utils/itertools';
|
import { FindContainerById, MakeRecursionDFSIterator } from '../../utils/itertools';
|
||||||
import { BAR_WIDTH } from '../Bar/Bar';
|
import { BAR_WIDTH } from '../Bar/Bar';
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { AppState } from '../Enums/AppState';
|
import { AppState } from '../Enums/AppState';
|
||||||
import { IConfiguration } from '../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../Interfaces/IConfiguration';
|
||||||
import { IEditorState } from '../Interfaces/IEditorState';
|
import { type IEditorState } from '../Interfaces/IEditorState';
|
||||||
import { IHistoryState } from '../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../Interfaces/IHistoryState';
|
||||||
import { ILanguage } from '../Interfaces/ILanguage';
|
import { type ILanguage } from '../Interfaces/ILanguage';
|
||||||
import { languageOptions, translations } from '../Translations/Translations';
|
import { languageOptions, translations } from '../Translations/Translations';
|
||||||
import { GetDefaultEditorState as GetDefaultEditorStateAction } from '../utils/default';
|
import { GetDefaultEditorState as GetDefaultEditorStateAction } from '../utils/default';
|
||||||
import { Revive, ReviveHistory as ReviveHistoryAction } from '../utils/saveload';
|
import { Revive, ReviveHistory as ReviveHistoryAction } from '../utils/saveload';
|
||||||
|
@ -49,7 +49,7 @@ export function UseCustomEvents(
|
||||||
const funcs = new Map<string, () => void>();
|
const funcs = new Map<string, () => void>();
|
||||||
for (const event of events) {
|
for (const event of events) {
|
||||||
function Func(eventInitDict?: CustomEventInit): void {
|
function Func(eventInitDict?: CustomEventInit): void {
|
||||||
return event.func({
|
event.func({
|
||||||
root,
|
root,
|
||||||
languageContext,
|
languageContext,
|
||||||
setEditor,
|
setEditor,
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { AddContainer as AddContainerAction, AddContainerToSelectedContainer as
|
||||||
import { DeleteContainer as DeleteContainerAction, SelectContainer as SelectContainerAction } from '../Components/Editor/Actions/ContainerOperations';
|
import { DeleteContainer as DeleteContainerAction, SelectContainer as SelectContainerAction } from '../Components/Editor/Actions/ContainerOperations';
|
||||||
import { AddSymbol as AddSymbolAction, DeleteSymbol as DeleteSymbolAction, SelectSymbol as SelectSymbolAction } from '../Components/Editor/Actions/SymbolOperations';
|
import { AddSymbol as AddSymbolAction, DeleteSymbol as DeleteSymbolAction, SelectSymbol as SelectSymbolAction } from '../Components/Editor/Actions/SymbolOperations';
|
||||||
import { GetCurrentHistory } from '../Components/Editor/Editor';
|
import { GetCurrentHistory } from '../Components/Editor/Editor';
|
||||||
import { IConfiguration } from '../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../Interfaces/IConfiguration';
|
||||||
import { IEditorState } from '../Interfaces/IEditorState';
|
import { type IEditorState } from '../Interfaces/IEditorState';
|
||||||
import { IHistoryState } from '../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../Interfaces/IHistoryState';
|
||||||
import { FindContainerById } from '../utils/itertools';
|
import { FindContainerById } from '../utils/itertools';
|
||||||
import { GetCircularReplacer } from '../utils/saveload';
|
import { GetCircularReplacer } from '../utils/saveload';
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ export function UseCustomEvents(
|
||||||
|
|
||||||
for (const event of events) {
|
for (const event of events) {
|
||||||
function Func(eventInitDict?: CustomEventInit): void {
|
function Func(eventInitDict?: CustomEventInit): void {
|
||||||
return event.func({
|
event.func({
|
||||||
root,
|
root,
|
||||||
editorState,
|
editorState,
|
||||||
setNewHistory,
|
setNewHistory,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { AddMethod } from '../Enums/AddMethod';
|
import { type AddMethod } from '../Enums/AddMethod';
|
||||||
import { IImage } from './IImage';
|
import { type IImage } from './IImage';
|
||||||
|
|
||||||
export interface IAction {
|
export interface IAction {
|
||||||
Id: string
|
Id: string
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { AddMethod } from '../Enums/AddMethod';
|
import { type AddMethod } from '../Enums/AddMethod';
|
||||||
import { PositionReference } from '../Enums/PositionReference';
|
import { type PositionReference } from '../Enums/PositionReference';
|
||||||
import { IAction } from './IAction';
|
import { type IAction } from './IAction';
|
||||||
import { IMargin } from './IMargin';
|
import { type IMargin } from './IMargin';
|
||||||
import { Orientation } from '../Enums/Orientation';
|
import { type Orientation } from '../Enums/Orientation';
|
||||||
import { IKeyValue } from './IKeyValue';
|
import { type IKeyValue } from './IKeyValue';
|
||||||
import { IStyle } from './IStyle';
|
import { type IStyle } from './IStyle';
|
||||||
import { IDimensions } from './IDimensions';
|
import { type IDimensions } from './IDimensions';
|
||||||
|
|
||||||
/** Model of available container used in application configuration */
|
/** Model of available container used in application configuration */
|
||||||
export interface IAvailableContainer {
|
export interface IAvailableContainer {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { PositionReference } from '../Enums/PositionReference';
|
import { type PositionReference } from '../Enums/PositionReference';
|
||||||
import { IAvailableContainer } from './IAvailableContainer';
|
import { type IAvailableContainer } from './IAvailableContainer';
|
||||||
import { IImage } from './IImage';
|
import { type IImage } from './IImage';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model of available symbol to configure the application */
|
* Model of available symbol to configure the application */
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { IAPIConfiguration } from './IAPIConfiguration';
|
import { type IAPIConfiguration } from './IAPIConfiguration';
|
||||||
import { IAvailableContainer } from './IAvailableContainer';
|
import { type IAvailableContainer } from './IAvailableContainer';
|
||||||
import { IAvailableSymbol } from './IAvailableSymbol';
|
import { type IAvailableSymbol } from './IAvailableSymbol';
|
||||||
import { ICategory } from './ICategory';
|
import { type ICategory } from './ICategory';
|
||||||
import { IPattern } from './IPattern';
|
import { type IPattern } from './IPattern';
|
||||||
|
|
||||||
/** Model of configuration for the application to configure it */
|
/** Model of configuration for the application to configure it */
|
||||||
export interface IConfiguration {
|
export interface IConfiguration {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { IContainerProperties } from './IContainerProperties';
|
import { type IContainerProperties } from './IContainerProperties';
|
||||||
|
|
||||||
export interface IContainerModel {
|
export interface IContainerModel {
|
||||||
children: string[]
|
children: string[]
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { PositionReference } from '../Enums/PositionReference';
|
import { type PositionReference } from '../Enums/PositionReference';
|
||||||
import { IMargin } from './IMargin';
|
import { type IMargin } from './IMargin';
|
||||||
import { Orientation } from '../Enums/Orientation';
|
import { type Orientation } from '../Enums/Orientation';
|
||||||
import { IKeyValue } from './IKeyValue';
|
import { type IKeyValue } from './IKeyValue';
|
||||||
import { IStyle } from './IStyle';
|
import { type IStyle } from './IStyle';
|
||||||
import { IDimensions } from './IDimensions';
|
import { type IDimensions } from './IDimensions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Properties of a container
|
* Properties of a container
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Position } from '../Enums/Position';
|
import { type Position } from '../Enums/Position';
|
||||||
|
|
||||||
export interface IDimensionOptions {
|
export interface IDimensionOptions {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import { IDimensionOptions } from './IDimensionOptions';
|
import { type IDimensionOptions } from './IDimensionOptions';
|
||||||
import { Orientation } from '../Enums/Orientation';
|
import { type Orientation } from '../Enums/Orientation';
|
||||||
|
|
||||||
export interface IDimensions {
|
export interface IDimensions {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { IConfiguration } from './IConfiguration';
|
import { type IConfiguration } from './IConfiguration';
|
||||||
import { IHistoryState } from './IHistoryState';
|
import { type IHistoryState } from './IHistoryState';
|
||||||
|
|
||||||
export interface IEditorState {
|
export interface IEditorState {
|
||||||
history: IHistoryState[]
|
history: IHistoryState[]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { IHistoryState } from './IHistoryState';
|
import { type IHistoryState } from './IHistoryState';
|
||||||
|
|
||||||
export interface IGetFeedbackRequest {
|
export interface IGetFeedbackRequest {
|
||||||
/** Current application state */
|
/** Current application state */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
|
||||||
import { IMessage } from './IMessage';
|
import { type IMessage } from './IMessage';
|
||||||
|
|
||||||
export interface IGetFeedbackResponse {
|
export interface IGetFeedbackResponse {
|
||||||
messages: IMessage[]
|
messages: IMessage[]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { IContainerModel } from './IContainerModel';
|
import { type IContainerModel } from './IContainerModel';
|
||||||
import { ISymbolModel } from './ISymbolModel';
|
import { type ISymbolModel } from './ISymbolModel';
|
||||||
|
|
||||||
export interface IHistoryState {
|
export interface IHistoryState {
|
||||||
/** Last editor action */
|
/** Last editor action */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React from 'react';
|
import type React from 'react';
|
||||||
|
|
||||||
export interface IInputGroup {
|
export interface IInputGroup {
|
||||||
key: string
|
key: string
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { MessageType } from '../Enums/MessageType';
|
import { type MessageType } from '../Enums/MessageType';
|
||||||
|
|
||||||
export interface IMessage {
|
export interface IMessage {
|
||||||
text: string
|
text: string
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { IAvailableContainer } from './IAvailableContainer';
|
import { type IAvailableContainer } from './IAvailableContainer';
|
||||||
|
|
||||||
export interface IPattern {
|
export interface IPattern {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { IAction } from './IAction';
|
import { type IAction } from './IAction';
|
||||||
import { IContainerModel } from './IContainerModel';
|
import { type IContainerModel } from './IContainerModel';
|
||||||
import { IHistoryState } from './IHistoryState';
|
import { type IHistoryState } from './IHistoryState';
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
export interface ISetContainerListRequest {
|
export interface ISetContainerListRequest {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { AddMethod } from '../Enums/AddMethod';
|
import { type AddMethod } from '../Enums/AddMethod';
|
||||||
import { IAvailableContainer } from './IAvailableContainer';
|
import { type IAvailableContainer } from './IAvailableContainer';
|
||||||
|
|
||||||
export interface ISetContainerListResponse {
|
export interface ISetContainerListResponse {
|
||||||
Containers: IAvailableContainer[]
|
Containers: IAvailableContainer[]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { IAvailableSymbol } from './IAvailableSymbol';
|
import { type IAvailableSymbol } from './IAvailableSymbol';
|
||||||
|
|
||||||
export interface ISymbolModel {
|
export interface ISymbolModel {
|
||||||
/** Identifier */
|
/** Identifier */
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { PositionReference } from '../Enums/PositionReference';
|
import { PositionReference } from '../Enums/PositionReference';
|
||||||
import { IAvailableContainer } from '../Interfaces/IAvailableContainer';
|
import { type IAvailableContainer } from '../Interfaces/IAvailableContainer';
|
||||||
import { IAvailableSymbol } from '../Interfaces/IAvailableSymbol';
|
import { type IAvailableSymbol } from '../Interfaces/IAvailableSymbol';
|
||||||
import { IConfiguration } from '../Interfaces/IConfiguration';
|
import { type IConfiguration } from '../Interfaces/IConfiguration';
|
||||||
import { ContainerModel, IContainerModel } from '../Interfaces/IContainerModel';
|
import { ContainerModel, type IContainerModel } from '../Interfaces/IContainerModel';
|
||||||
import { IContainerProperties } from '../Interfaces/IContainerProperties';
|
import { type IContainerProperties } from '../Interfaces/IContainerProperties';
|
||||||
import { IEditorState } from '../Interfaces/IEditorState';
|
import { type IEditorState } from '../Interfaces/IEditorState';
|
||||||
import { ISymbolModel } from '../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../Interfaces/ISymbolModel';
|
||||||
import { Orientation } from '../Enums/Orientation';
|
import { Orientation } from '../Enums/Orientation';
|
||||||
import { AppState } from '../Enums/AppState';
|
import { AppState } from '../Enums/AppState';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { IContainerModel } from '../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../Interfaces/IContainerModel';
|
||||||
|
|
||||||
export function * MakeChildrenIterator(containers: Map<string, IContainerModel>, childrenIds: string[]): Generator<IContainerModel, void, unknown> {
|
export function * MakeChildrenIterator(containers: Map<string, IContainerModel>, childrenIds: string[]): Generator<IContainerModel, void, unknown> {
|
||||||
for (const childId of childrenIds) {
|
for (const childId of childrenIds) {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { IEditorState } from '../Interfaces/IEditorState';
|
import { type IEditorState } from '../Interfaces/IEditorState';
|
||||||
import { IHistoryState } from '../Interfaces/IHistoryState';
|
import { type IHistoryState } from '../Interfaces/IHistoryState';
|
||||||
import { IContainerModel } from '../Interfaces/IContainerModel';
|
import { type IContainerModel } from '../Interfaces/IContainerModel';
|
||||||
import { ISymbolModel } from '../Interfaces/ISymbolModel';
|
import { type ISymbolModel } from '../Interfaces/ISymbolModel';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Revive the Editor state
|
* Revive the Editor state
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable import/export */
|
/* eslint-disable import/export */
|
||||||
import * as React from 'react';
|
import type * as React from 'react';
|
||||||
import { cleanup, render, RenderResult } from '@testing-library/react';
|
import { cleanup, render, type RenderResult } from '@testing-library/react';
|
||||||
import { afterEach } from 'vitest';
|
import { afterEach } from 'vitest';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue