feat(ui): ux improvements & redesign

This is a squash merge of a bajillion messy small commits created while iterating on the UI component library and redesign.
This commit is contained in:
psychedelicious
2023-12-29 00:03:21 +11:00
committed by Kent Keirsey
parent a47d91f0e7
commit f0b102d830
889 changed files with 16645 additions and 15595 deletions

View File

@ -1,4 +1,4 @@
import { Vector2d } from 'konva/lib/types';
import type { Vector2d } from 'konva/lib/types';
const calculateCoordinates = (
containerWidth: number,

View File

@ -1,4 +1,4 @@
import { RgbaColor, RgbColor } from 'react-colorful';
import type { RgbaColor, RgbColor } from 'react-colorful';
export const rgbaColorToString = (color: RgbaColor): string => {
const { r, g, b, a } = color;

View File

@ -1,6 +1,6 @@
import { CanvasMaskLine } from 'features/canvas/store/canvasTypes';
import type { CanvasMaskLine } from 'features/canvas/store/canvasTypes';
import Konva from 'konva';
import { IRect } from 'konva/lib/types';
import type { IRect } from 'konva/lib/types';
/**
* Creates a stage from array of mask objects.

View File

@ -1,4 +1,4 @@
import { Vector2d } from 'konva/lib/types';
import type { Vector2d } from 'konva/lib/types';
const floorCoordinates = (coord: Vector2d): Vector2d => {
return {

View File

@ -1,4 +1,5 @@
import { RootState } from 'app/store/store';
import type { RootState } from 'app/store/store';
import { getCanvasBaseLayer } from './konvaInstanceProvider';
import { konvaNodeToBlob } from './konvaNodeToBlob';

View File

@ -1,10 +1,11 @@
import { logger } from 'app/logging/logger';
import { Vector2d } from 'konva/lib/types';
import {
import type {
CanvasLayerState,
Dimensions,
isCanvasMaskLine,
} from 'features/canvas/store/canvasTypes';
import { isCanvasMaskLine } from 'features/canvas/store/canvasTypes';
import type { Vector2d } from 'konva/lib/types';
import createMaskStage from './createMaskStage';
import { getCanvasBaseLayer, getCanvasStage } from './konvaInstanceProvider';
import { konvaNodeToBlob } from './konvaNodeToBlob';

View File

@ -2,7 +2,7 @@ import {
areAnyPixelsBlack,
getImageDataTransparency,
} from 'common/util/arrayBuffer';
import { GenerationMode } from 'features/canvas/store/canvasTypes';
import type { GenerationMode } from 'features/canvas/store/canvasTypes';
export const getCanvasGenerationMode = (
baseImageData: ImageData,

View File

@ -1,5 +1,5 @@
import { roundToMultiple } from 'common/util/roundDownToMultiple';
import { Dimensions } from 'features/canvas/store/canvasTypes';
import type { Dimensions } from 'features/canvas/store/canvasTypes';
const getScaledBoundingBoxDimensions = (dimensions: Dimensions) => {
const { width, height } = dimensions;

View File

@ -1,4 +1,4 @@
import { Stage } from 'konva/lib/Stage';
import type { Stage } from 'konva/lib/Stage';
const getScaledCursorPosition = (stage: Stage) => {
const pointerPosition = stage.getPointerPosition();

View File

@ -1,4 +1,4 @@
import Konva from 'konva';
import type Konva from 'konva';
let canvasBaseLayer: Konva.Layer | null = null;
let canvasStage: Konva.Stage | null = null;

View File

@ -1,5 +1,6 @@
import Konva from 'konva';
import { IRect } from 'konva/lib/types';
import type Konva from 'konva';
import type { IRect } from 'konva/lib/types';
import { canvasToBlob } from './canvasToBlob';
/**

View File

@ -1,5 +1,6 @@
import Konva from 'konva';
import { IRect } from 'konva/lib/types';
import type Konva from 'konva';
import type { IRect } from 'konva/lib/types';
import { dataURLToImageData } from './dataURLToImageData';
/**

View File

@ -1,5 +1,5 @@
import { roundToMultiple } from 'common/util/roundDownToMultiple';
import { Dimensions } from 'features/canvas/store/canvasTypes';
import type { Dimensions } from 'features/canvas/store/canvasTypes';
const roundDimensionsTo64 = (dimensions: Dimensions): Dimensions => {
return {