From 2a8326972788c56f7e4a793ac16db78e24c5fc52 Mon Sep 17 00:00:00 2001 From: MiracleHorizon Date: Fri, 22 Dec 2023 12:20:34 +0300 Subject: [PATCH 1/2] refactor: replace /libs with /lib and /server --- src/app/api/convert/route.ts | 4 ++-- .../rows/BlurRow/GaussianBlurPopover.tsx | 2 +- .../sections/MainSection/rows/GammaRow.tsx | 2 +- .../sections/MainSection/rows/NormaliseRow.tsx | 2 +- .../sections/MainSection/rows/RotateAngleRow.tsx | 2 +- .../MainSection/rows/RotateBackgroundRow.tsx | 2 +- .../ModulateSection/rows/BrightnessRow.tsx | 2 +- .../sections/ModulateSection/rows/HueRow.tsx | 2 +- .../sections/ModulateSection/rows/LightnessRow.tsx | 2 +- .../ModulateSection/rows/SaturationRow.tsx | 2 +- .../sections/ResizeSection/rows/BackgroundRow.tsx | 2 +- .../sections/ResizeSection/rows/EnlargementRow.tsx | 2 +- .../rows/FastShrinkRow/FastShrinkRow.tsx | 2 +- .../sections/ResizeSection/rows/FitRow.tsx | 2 +- .../sections/ResizeSection/rows/HeightRow.tsx | 2 +- .../sections/ResizeSection/rows/KernelRow.tsx | 2 +- .../sections/ResizeSection/rows/PositionRow.tsx | 2 +- .../sections/ResizeSection/rows/ReductionRow.tsx | 2 +- .../sections/ResizeSection/rows/WidthRow.tsx | 2 +- src/app/layout.tsx | 2 +- src/app/page.tsx | 4 ++-- .../UploadedFileCard/UploadedFileCard.tsx | 2 +- .../UploadedFile/UploadedFileLoading.tsx | 2 +- .../uploading/FileUploadZone/FileUploadZone.tsx | 4 ++-- src/hooks/useConvertMutation.ts | 2 +- src/layouts/default/Layout.tsx | 2 +- .../DocumentationLink/DocumentationLink.tsx | 2 +- src/layouts/default/LayoutHeader/LayoutHeader.tsx | 4 ++-- .../SettingsPopover/SettingsPopover.tsx | 2 +- .../ThemeColorGrid/ThemeColorGrid.tsx | 2 +- .../ThemeColorGridItem/ThemeColorGridItem.tsx | 2 +- .../SettingsPopover/ToggleTheme/ToggleTheme.tsx | 2 +- src/{shared => lib}/helpers/cookies.ts | 0 src/{shared => lib}/helpers/copyToClipboard.ts | 0 src/{shared => lib}/helpers/cropFileName.test.ts | 0 src/{shared => lib}/helpers/cropFileName.ts | 0 .../helpers/cropImageFileType.test.ts | 0 src/{shared => lib}/helpers/cropImageFileType.ts | 0 .../helpers/handleConvertError.test.ts | 0 src/{shared => lib}/helpers/handleConvertError.ts | 0 src/{shared => lib}/helpers/isDevelopment.ts | 0 src/{shared => lib}/helpers/isTooltipOpen.test.ts | 0 src/{shared => lib}/helpers/isTooltipOpen.ts | 0 .../helpers/isValidFileName.test.ts | 0 src/{shared => lib}/helpers/isValidFileName.ts | 0 .../helpers/isValidFileSize.test.ts | 0 src/{shared => lib}/helpers/isValidFileSize.ts | 0 src/{shared => lib}/router.ts | 0 src/{shared => lib}/theme/actions.ts | 2 +- src/{shared => lib}/theme/constants.ts | 0 src/{shared => lib}/theme/index.ts | 3 ++- .../theme => lib/theme/radix}/appearance.ts | 2 +- src/{shared/libs => lib/theme}/radix/types.ts | 0 src/{shared => lib}/theme/types.ts | 2 +- .../ui/ButtonBackTop/ButtonBackTop.module.css | 0 .../ui/ButtonBackTop/ButtonBackTop.tsx | 2 +- src/{shared => lib}/ui/ButtonBackTop/index.ts | 0 src/{shared => lib}/ui/ButtonClear.tsx | 0 src/{shared => lib}/ui/ButtonClipboardCopy.tsx | 2 +- src/{shared => lib}/ui/ButtonDelete.tsx | 0 src/{shared => lib}/ui/ButtonInfo.tsx | 0 src/{shared => lib}/ui/ButtonReset.tsx | 2 +- .../ui/HexColorInput/ColorInput.tsx | 0 .../ui/HexColorInput/HexColorInput.tsx | 2 +- src/{shared => lib}/ui/HexColorInput/index.ts | 0 .../ui/LoadingSpinner/LoadingSpinner.module.css | 0 .../ui/LoadingSpinner/LoadingSpinner.tsx | 2 +- src/{shared => lib}/ui/LoadingSpinner/index.ts | 0 src/{shared => lib}/ui/icons/BlurIcon.tsx | 10 ++++------ src/{shared => lib}/ui/icons/CookieIcon.tsx | 0 src/{shared => lib}/ui/icons/LogoIcon.tsx | 0 src/{shared => lib}/ui/icons/index.ts | 0 .../ButtonInfoSkeleton.module.css | 0 .../ButtonInfoSkeleton/ButtonInfoSkeleton.tsx | 0 .../ui/skeletons/ButtonInfoSkeleton/index.ts | 0 .../OptionsSkeleton/OptionsSkeleton.module.css | 0 .../skeletons/OptionsSkeleton/OptionsSkeleton.tsx | 0 .../ui/skeletons/OptionsSkeleton/index.ts | 0 .../ToolbarSkeleton/ToolbarSkeleton.module.css | 0 .../skeletons/ToolbarSkeleton/ToolbarSkeleton.tsx | 0 .../ui/skeletons/ToolbarSkeleton/index.ts | 0 .../libs => server}/Sharp/Sharp.constants.ts | 0 src/{shared/libs => server}/Sharp/Sharp.ts | 2 +- src/{shared/libs => server}/Sharp/Sharp.types.ts | 0 src/{shared/libs => server}/Sharp/index.ts | 0 src/shared/libs/radix/index.ts | 1 - src/stores/blur/store.ts | 2 +- src/stores/blur/types.ts | 2 +- src/stores/convert/store.ts | 2 +- src/stores/convert/types.ts | 2 +- src/stores/gamma/store.ts | 2 +- src/stores/gamma/types.ts | 2 +- src/stores/hooks/useConvertSettings.ts | 2 +- src/stores/modulate/types.ts | 2 +- src/stores/negate/store.ts | 2 +- src/stores/negate/types.ts | 2 +- src/stores/normalise/store.ts | 2 +- src/stores/normalise/types.ts | 2 +- src/stores/output/store.ts | 2 +- src/stores/output/types.ts | 2 +- src/stores/resize/store.ts | 2 +- src/stores/resize/types.ts | 2 +- src/stores/rotate/store.ts | 2 +- src/stores/rotate/types.ts | 2 +- src/stores/tint/store.ts | 2 +- src/widgets/SettingsPanel/OptionSwitch.tsx | 2 +- .../InputOutputFileName/InputOutputFileName.tsx | 2 +- .../TabDefault/options/Basic/BasicOptions.tsx | 2 +- .../SettingsPanel/TabDefault/options/Blur/Blur.tsx | 4 ++-- .../TabDefault/options/Gamma/GammaHeader.tsx | 2 +- .../TabDefault/options/Gamma/SliderGamma.tsx | 2 +- .../options/Modulate/sliders/SliderBrightness.tsx | 2 +- .../options/Modulate/sliders/SliderHue.tsx | 2 +- .../options/Modulate/sliders/SliderLightness.tsx | 2 +- .../options/Modulate/sliders/SliderSaturation.tsx | 2 +- .../TabDefault/options/Negate/Negate.tsx | 2 +- .../options/Normalise/SliderNormalise.tsx | 2 +- .../options/OutputFormat/SelectOutputFormat.tsx | 2 +- .../TabDefault/options/Rotate/RotateHeader.tsx | 2 +- .../options/Rotate/SliderRotateAngle.tsx | 2 +- .../ResizeFitExamplesPopover.tsx | 2 +- .../ResizeExtra/ResizeFit/SelectResizeFit.tsx | 2 +- .../ResizeKernel/SelectResizeKernel.tsx | 2 +- .../ResizePosition/SelectResizePosition.tsx | 2 +- .../ResizeSwitchers/SwitchFastShrink.tsx | 2 +- .../TabResize/ResizeSizesForm/ResizeSizesForm.tsx | 7 ++++++- tsconfig.json | 14 +++++++------- vitest.config.ts | 8 ++++---- 128 files changed, 108 insertions(+), 105 deletions(-) rename src/{shared => lib}/helpers/cookies.ts (100%) rename src/{shared => lib}/helpers/copyToClipboard.ts (100%) rename src/{shared => lib}/helpers/cropFileName.test.ts (100%) rename src/{shared => lib}/helpers/cropFileName.ts (100%) rename src/{shared => lib}/helpers/cropImageFileType.test.ts (100%) rename src/{shared => lib}/helpers/cropImageFileType.ts (100%) rename src/{shared => lib}/helpers/handleConvertError.test.ts (100%) rename src/{shared => lib}/helpers/handleConvertError.ts (100%) rename src/{shared => lib}/helpers/isDevelopment.ts (100%) rename src/{shared => lib}/helpers/isTooltipOpen.test.ts (100%) rename src/{shared => lib}/helpers/isTooltipOpen.ts (100%) rename src/{shared => lib}/helpers/isValidFileName.test.ts (100%) rename src/{shared => lib}/helpers/isValidFileName.ts (100%) rename src/{shared => lib}/helpers/isValidFileSize.test.ts (100%) rename src/{shared => lib}/helpers/isValidFileSize.ts (100%) rename src/{shared => lib}/router.ts (100%) rename src/{shared => lib}/theme/actions.ts (95%) rename src/{shared => lib}/theme/constants.ts (100%) rename src/{shared => lib}/theme/index.ts (54%) rename src/{shared/theme => lib/theme/radix}/appearance.ts (94%) rename src/{shared/libs => lib/theme}/radix/types.ts (100%) rename src/{shared => lib}/theme/types.ts (79%) rename src/{shared => lib}/ui/ButtonBackTop/ButtonBackTop.module.css (100%) rename src/{shared => lib}/ui/ButtonBackTop/ButtonBackTop.tsx (97%) rename src/{shared => lib}/ui/ButtonBackTop/index.ts (100%) rename src/{shared => lib}/ui/ButtonClear.tsx (100%) rename src/{shared => lib}/ui/ButtonClipboardCopy.tsx (92%) rename src/{shared => lib}/ui/ButtonDelete.tsx (100%) rename src/{shared => lib}/ui/ButtonInfo.tsx (100%) rename src/{shared => lib}/ui/ButtonReset.tsx (93%) rename src/{shared => lib}/ui/HexColorInput/ColorInput.tsx (100%) rename src/{shared => lib}/ui/HexColorInput/HexColorInput.tsx (95%) rename src/{shared => lib}/ui/HexColorInput/index.ts (100%) rename src/{shared => lib}/ui/LoadingSpinner/LoadingSpinner.module.css (100%) rename src/{shared => lib}/ui/LoadingSpinner/LoadingSpinner.tsx (90%) rename src/{shared => lib}/ui/LoadingSpinner/index.ts (100%) rename src/{shared => lib}/ui/icons/BlurIcon.tsx (97%) rename src/{shared => lib}/ui/icons/CookieIcon.tsx (100%) rename src/{shared => lib}/ui/icons/LogoIcon.tsx (100%) rename src/{shared => lib}/ui/icons/index.ts (100%) rename src/{shared => lib}/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.module.css (100%) rename src/{shared => lib}/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.tsx (100%) rename src/{shared => lib}/ui/skeletons/ButtonInfoSkeleton/index.ts (100%) rename src/{shared => lib}/ui/skeletons/OptionsSkeleton/OptionsSkeleton.module.css (100%) rename src/{shared => lib}/ui/skeletons/OptionsSkeleton/OptionsSkeleton.tsx (100%) rename src/{shared => lib}/ui/skeletons/OptionsSkeleton/index.ts (100%) rename src/{shared => lib}/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.module.css (100%) rename src/{shared => lib}/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.tsx (100%) rename src/{shared => lib}/ui/skeletons/ToolbarSkeleton/index.ts (100%) rename src/{shared/libs => server}/Sharp/Sharp.constants.ts (100%) rename src/{shared/libs => server}/Sharp/Sharp.ts (99%) rename src/{shared/libs => server}/Sharp/Sharp.types.ts (100%) rename src/{shared/libs => server}/Sharp/index.ts (100%) delete mode 100644 src/shared/libs/radix/index.ts diff --git a/src/app/api/convert/route.ts b/src/app/api/convert/route.ts index 80c14715..06cbf925 100644 --- a/src/app/api/convert/route.ts +++ b/src/app/api/convert/route.ts @@ -1,9 +1,9 @@ import { type NextRequest, NextResponse } from 'next/server' import isEmpty from 'lodash.isempty' -import { Sharp } from '@libs/Sharp/Sharp' +import { Sharp } from '@server/Sharp/Sharp' import { isValidFileSize } from '@helpers/isValidFileSize' -import type { ConvertSettings } from '@libs/Sharp' +import type { ConvertSettings } from '@server/Sharp' export async function POST(req: NextRequest) { const formData = await req.formData() diff --git a/src/app/docs/components/DocsContent/sections/MainSection/rows/BlurRow/GaussianBlurPopover.tsx b/src/app/docs/components/DocsContent/sections/MainSection/rows/BlurRow/GaussianBlurPopover.tsx index 565f7175..884b6642 100644 --- a/src/app/docs/components/DocsContent/sections/MainSection/rows/BlurRow/GaussianBlurPopover.tsx +++ b/src/app/docs/components/DocsContent/sections/MainSection/rows/BlurRow/GaussianBlurPopover.tsx @@ -3,7 +3,7 @@ import { Code, Text } from '@radix-ui/themes' import { DetailsPopover } from '@app/docs/components/DocsContent/DetailsPopover' -import { MAX_BLUR_SIGMA, MIN_BLUR_SIGMA } from '@libs/Sharp' +import { MAX_BLUR_SIGMA, MIN_BLUR_SIGMA } from '@server/Sharp' export default function GaussianBlurPopover() { return ( diff --git a/src/app/docs/components/DocsContent/sections/MainSection/rows/GammaRow.tsx b/src/app/docs/components/DocsContent/sections/MainSection/rows/GammaRow.tsx index 8b97d614..367ca80e 100644 --- a/src/app/docs/components/DocsContent/sections/MainSection/rows/GammaRow.tsx +++ b/src/app/docs/components/DocsContent/sections/MainSection/rows/GammaRow.tsx @@ -1,7 +1,7 @@ import { Code, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_GAMMA } from '@libs/Sharp' +import { DEFAULT_GAMMA } from '@server/Sharp' export function GammaRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/MainSection/rows/NormaliseRow.tsx b/src/app/docs/components/DocsContent/sections/MainSection/rows/NormaliseRow.tsx index 86e14cb8..718d933b 100644 --- a/src/app/docs/components/DocsContent/sections/MainSection/rows/NormaliseRow.tsx +++ b/src/app/docs/components/DocsContent/sections/MainSection/rows/NormaliseRow.tsx @@ -1,7 +1,7 @@ import { Code, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { MAX_NORMALISE, MIN_NORMALISE } from '@libs/Sharp' +import { MAX_NORMALISE, MIN_NORMALISE } from '@server/Sharp' export function NormaliseRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/MainSection/rows/RotateAngleRow.tsx b/src/app/docs/components/DocsContent/sections/MainSection/rows/RotateAngleRow.tsx index b52271a1..1c453311 100644 --- a/src/app/docs/components/DocsContent/sections/MainSection/rows/RotateAngleRow.tsx +++ b/src/app/docs/components/DocsContent/sections/MainSection/rows/RotateAngleRow.tsx @@ -1,7 +1,7 @@ import { Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_ROTATE_ANGLE } from '@libs/Sharp' +import { DEFAULT_ROTATE_ANGLE } from '@server/Sharp' export function RotateAngleRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/MainSection/rows/RotateBackgroundRow.tsx b/src/app/docs/components/DocsContent/sections/MainSection/rows/RotateBackgroundRow.tsx index c859a68c..2a739bd5 100644 --- a/src/app/docs/components/DocsContent/sections/MainSection/rows/RotateBackgroundRow.tsx +++ b/src/app/docs/components/DocsContent/sections/MainSection/rows/RotateBackgroundRow.tsx @@ -1,7 +1,7 @@ import { Box, Code, Flex, Table, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_ROTATE_BACKGROUND } from '@libs/Sharp' +import { DEFAULT_ROTATE_BACKGROUND } from '@server/Sharp' const previewBoxStyle = { backgroundColor: DEFAULT_ROTATE_BACKGROUND diff --git a/src/app/docs/components/DocsContent/sections/ModulateSection/rows/BrightnessRow.tsx b/src/app/docs/components/DocsContent/sections/ModulateSection/rows/BrightnessRow.tsx index fa18618a..0b96677b 100644 --- a/src/app/docs/components/DocsContent/sections/ModulateSection/rows/BrightnessRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ModulateSection/rows/BrightnessRow.tsx @@ -1,7 +1,7 @@ import { Code, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { MAX_BRIGHTNESS, MIN_BRIGHTNESS } from '@libs/Sharp' +import { MAX_BRIGHTNESS, MIN_BRIGHTNESS } from '@server/Sharp' export function BrightnessRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ModulateSection/rows/HueRow.tsx b/src/app/docs/components/DocsContent/sections/ModulateSection/rows/HueRow.tsx index f88c661f..f5e12ea1 100644 --- a/src/app/docs/components/DocsContent/sections/ModulateSection/rows/HueRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ModulateSection/rows/HueRow.tsx @@ -1,7 +1,7 @@ import { Code, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { MAX_HUE, MIN_HUE } from '@libs/Sharp' +import { MAX_HUE, MIN_HUE } from '@server/Sharp' export function HueRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ModulateSection/rows/LightnessRow.tsx b/src/app/docs/components/DocsContent/sections/ModulateSection/rows/LightnessRow.tsx index fe2e6730..5d5e4c4c 100644 --- a/src/app/docs/components/DocsContent/sections/ModulateSection/rows/LightnessRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ModulateSection/rows/LightnessRow.tsx @@ -1,7 +1,7 @@ import { Code, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { MIN_LIGHTNESS } from '@libs/Sharp' +import { MIN_LIGHTNESS } from '@server/Sharp' export function LightnessRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ModulateSection/rows/SaturationRow.tsx b/src/app/docs/components/DocsContent/sections/ModulateSection/rows/SaturationRow.tsx index e403a7d8..983625d2 100644 --- a/src/app/docs/components/DocsContent/sections/ModulateSection/rows/SaturationRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ModulateSection/rows/SaturationRow.tsx @@ -1,7 +1,7 @@ import { Code, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { MAX_SATURATION, MIN_SATURATION } from '@libs/Sharp' +import { MAX_SATURATION, MIN_SATURATION } from '@server/Sharp' export function SaturationRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/BackgroundRow.tsx b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/BackgroundRow.tsx index 66c853b1..07702970 100644 --- a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/BackgroundRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/BackgroundRow.tsx @@ -1,7 +1,7 @@ import { Box, Code, Flex, Table, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_RESIZE_BACKGROUND, ResizeFit } from '@libs/Sharp' +import { DEFAULT_RESIZE_BACKGROUND, ResizeFit } from '@server/Sharp' const previewBoxStyle = { backgroundColor: DEFAULT_RESIZE_BACKGROUND diff --git a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/EnlargementRow.tsx b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/EnlargementRow.tsx index ae5ead9b..a0e784aa 100644 --- a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/EnlargementRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/EnlargementRow.tsx @@ -1,7 +1,7 @@ import { Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_WITHOUT_ENLARGEMENT } from '@libs/Sharp' +import { DEFAULT_WITHOUT_ENLARGEMENT } from '@server/Sharp' export function EnlargementRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/FastShrinkRow/FastShrinkRow.tsx b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/FastShrinkRow/FastShrinkRow.tsx index 792b1c78..3546520d 100644 --- a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/FastShrinkRow/FastShrinkRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/FastShrinkRow/FastShrinkRow.tsx @@ -2,7 +2,7 @@ import dynamic from 'next/dynamic' import { Code, Strong, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_FAST_SHRINK } from '@libs/Sharp' +import { DEFAULT_FAST_SHRINK } from '@server/Sharp' const MoirePatternPopover = dynamic(() => import('./MoirePatternPopover'), { ssr: false, diff --git a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/FitRow.tsx b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/FitRow.tsx index 76d6395b..b18266f9 100644 --- a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/FitRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/FitRow.tsx @@ -3,7 +3,7 @@ import { Code, Text } from '@radix-ui/themes' import capitalize from 'lodash.capitalize' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_RESIZE_FIT, ResizeFit } from '@libs/Sharp' +import { DEFAULT_RESIZE_FIT, ResizeFit } from '@server/Sharp' export function FitRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/HeightRow.tsx b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/HeightRow.tsx index f98bd121..25148dde 100644 --- a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/HeightRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/HeightRow.tsx @@ -1,7 +1,7 @@ import { Code, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { MAX_RESIZE_HEIGHT, MIN_RESIZE_SIZE } from '@libs/Sharp' +import { MAX_RESIZE_HEIGHT, MIN_RESIZE_SIZE } from '@server/Sharp' export function HeightRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/KernelRow.tsx b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/KernelRow.tsx index d2d70870..5b971847 100644 --- a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/KernelRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/KernelRow.tsx @@ -2,7 +2,7 @@ import { Text } from '@radix-ui/themes' import capitalize from 'lodash.capitalize' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_RESIZE_KERNEL } from '@libs/Sharp' +import { DEFAULT_RESIZE_KERNEL } from '@server/Sharp' export function KernelRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/PositionRow.tsx b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/PositionRow.tsx index f863246a..3e46fd0e 100644 --- a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/PositionRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/PositionRow.tsx @@ -2,7 +2,7 @@ import { Code, Text } from '@radix-ui/themes' import capitalize from 'lodash.capitalize' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_RESIZE_POSITION, ResizeFit } from '@libs/Sharp' +import { DEFAULT_RESIZE_POSITION, ResizeFit } from '@server/Sharp' export function PositionRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/ReductionRow.tsx b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/ReductionRow.tsx index 5eb52625..200b9e34 100644 --- a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/ReductionRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/ReductionRow.tsx @@ -1,7 +1,7 @@ import { Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { DEFAULT_WITHOUT_REDUCTION } from '@libs/Sharp' +import { DEFAULT_WITHOUT_REDUCTION } from '@server/Sharp' export function ReductionRow() { return ( diff --git a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/WidthRow.tsx b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/WidthRow.tsx index 47ea960f..7d03b578 100644 --- a/src/app/docs/components/DocsContent/sections/ResizeSection/rows/WidthRow.tsx +++ b/src/app/docs/components/DocsContent/sections/ResizeSection/rows/WidthRow.tsx @@ -1,7 +1,7 @@ import { Code, Text } from '@radix-ui/themes' import { DocsTableRow } from '../../../DocsSection/DocsTable/DocsTableRow' -import { MAX_RESIZE_WIDTH, MIN_RESIZE_SIZE } from '@libs/Sharp' +import { MAX_RESIZE_WIDTH, MIN_RESIZE_SIZE } from '@server/Sharp' export function WidthRow() { return ( diff --git a/src/app/layout.tsx b/src/app/layout.tsx index b56036de..0acf5cf6 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -7,7 +7,7 @@ import 'yet-another-react-lightbox/styles.css' import 'react-loading-skeleton/dist/skeleton.css' import { Layout } from '@layouts/default' -import { getThemeAppearance } from '@shared/theme' +import { getThemeAppearance } from '@lib/theme' import { isDevelopment } from '@helpers/isDevelopment' import './globals.css' diff --git a/src/app/page.tsx b/src/app/page.tsx index 1256ee8d..1642c025 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -11,8 +11,8 @@ import { UploadedFileLoading } from '@components/UploadedFile/UploadedFileLoadin import { FileUploadZone } from '@components/uploading/FileUploadZone' import { useOutputStore } from '@stores/output' import { useConvertImage } from '@hooks/useConvertImage' -import { ALLOWED_IMAGE_FORMATS } from '@libs/Sharp' -import type { FlexDirection } from '@libs/radix' +import { ALLOWED_IMAGE_FORMATS } from '@server/Sharp' +import type { FlexDirection } from '@lib/theme/radix' import styles from './page.module.css' const RequestErrorAlert = dynamic( diff --git a/src/components/UploadedFile/UploadedFileCard/UploadedFileCard.tsx b/src/components/UploadedFile/UploadedFileCard/UploadedFileCard.tsx index 8bc8fd24..5695a246 100644 --- a/src/components/UploadedFile/UploadedFileCard/UploadedFileCard.tsx +++ b/src/components/UploadedFile/UploadedFileCard/UploadedFileCard.tsx @@ -7,7 +7,7 @@ import { LoadingSpinner } from '@ui/LoadingSpinner' import { ButtonDelete } from '@ui/ButtonDelete' import { ButtonFileUpload } from '@components/uploading/ButtonFileUpload' import { useOutputStore } from '@stores/output' -import { ALLOWED_IMAGE_FORMATS } from '@libs/Sharp' +import { ALLOWED_IMAGE_FORMATS } from '@server/Sharp' import styles from './UploadedFileCard.module.css' export function UploadedFileCard({ file, isLoading }: Props) { diff --git a/src/components/UploadedFile/UploadedFileLoading.tsx b/src/components/UploadedFile/UploadedFileLoading.tsx index 816247e0..b5de5943 100644 --- a/src/components/UploadedFile/UploadedFileLoading.tsx +++ b/src/components/UploadedFile/UploadedFileLoading.tsx @@ -2,7 +2,7 @@ import { Flex } from '@radix-ui/themes' import Skeleton from 'react-loading-skeleton' import { LoadingSpinner } from '@ui/LoadingSpinner' -import type { Size } from '@libs/radix' +import type { Size } from '@lib/theme' const spinnerSize: Size = { initial: '7', diff --git a/src/components/uploading/FileUploadZone/FileUploadZone.tsx b/src/components/uploading/FileUploadZone/FileUploadZone.tsx index 976f9965..ada01d86 100644 --- a/src/components/uploading/FileUploadZone/FileUploadZone.tsx +++ b/src/components/uploading/FileUploadZone/FileUploadZone.tsx @@ -6,8 +6,8 @@ import { clsx } from 'clsx' import { type ComponentProps, withFileUploader } from '@hoc/withFileUploader' import { MAX_FILE_SIZE_MB } from '@helpers/isValidFileSize' -import { ConvertFormat } from '@libs/Sharp' -import type { TextSize } from '@libs/radix' +import { ConvertFormat } from '@server/Sharp' +import type { TextSize } from '@lib/theme' import styles from './FileUploadZone.module.css' const uploadTextSize: TextSize = { diff --git a/src/hooks/useConvertMutation.ts b/src/hooks/useConvertMutation.ts index 55626eb3..39067894 100644 --- a/src/hooks/useConvertMutation.ts +++ b/src/hooks/useConvertMutation.ts @@ -2,7 +2,7 @@ import { useMutation } from '@tanstack/react-query' import { convertImage } from '@api/convertImage' import { useOutputStore } from '@stores/output' -import type { ConvertSettings } from '@libs/Sharp' +import type { ConvertSettings } from '@server/Sharp' import type { DownloadPayload } from '@app-types/DownloadPayload' interface ConvertPayload { diff --git a/src/layouts/default/Layout.tsx b/src/layouts/default/Layout.tsx index 7e7ca4bd..52457555 100644 --- a/src/layouts/default/Layout.tsx +++ b/src/layouts/default/Layout.tsx @@ -5,7 +5,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import type { PropsWithChildren } from 'react' import { LayoutHeader } from './LayoutHeader' -import type { ThemeProps } from '@shared/theme' +import type { ThemeProps } from '@lib/theme' const queryClient = new QueryClient({ defaultOptions: { diff --git a/src/layouts/default/LayoutHeader/DocumentationLink/DocumentationLink.tsx b/src/layouts/default/LayoutHeader/DocumentationLink/DocumentationLink.tsx index 0368d542..ce1c394c 100644 --- a/src/layouts/default/LayoutHeader/DocumentationLink/DocumentationLink.tsx +++ b/src/layouts/default/LayoutHeader/DocumentationLink/DocumentationLink.tsx @@ -5,7 +5,7 @@ import Link from 'next/link' import { Flex, IconButton, Link as RadixLink, Text, Tooltip } from '@radix-ui/themes' import { ReaderIcon } from '@radix-ui/react-icons' -import { Route } from '@shared/router' +import { Route } from '@lib/router' import styles from './DocumentationLink.module.css' export function DocumentationLink() { diff --git a/src/layouts/default/LayoutHeader/LayoutHeader.tsx b/src/layouts/default/LayoutHeader/LayoutHeader.tsx index 31fd6b42..adcea5fe 100644 --- a/src/layouts/default/LayoutHeader/LayoutHeader.tsx +++ b/src/layouts/default/LayoutHeader/LayoutHeader.tsx @@ -6,8 +6,8 @@ import { LogoIcon } from '@ui/icons' import { ButtonGithub } from './ButtonGithub' import { DocumentationLink } from './DocumentationLink' import { SettingsPopoverSkeleton } from './SettingsPopover' -import { Route } from '@shared/router' -import type { ThemeProps } from '@shared/theme' +import { Route } from '@lib/router' +import type { ThemeProps } from '@lib/theme' import styles from './LayoutHeader.module.css' const SettingsPopover = dynamic( diff --git a/src/layouts/default/LayoutHeader/SettingsPopover/SettingsPopover.tsx b/src/layouts/default/LayoutHeader/SettingsPopover/SettingsPopover.tsx index 17c34c06..785cbc91 100644 --- a/src/layouts/default/LayoutHeader/SettingsPopover/SettingsPopover.tsx +++ b/src/layouts/default/LayoutHeader/SettingsPopover/SettingsPopover.tsx @@ -5,7 +5,7 @@ import { MixerHorizontalIcon } from '@radix-ui/react-icons' import { ToggleTheme } from './ToggleTheme' import { ThemeColorGrid } from './ThemeColorGrid' -import type { ThemeProps } from '@shared/theme' +import type { ThemeProps } from '@lib/theme' export function SettingsPopover({ theme, themeColor }: ThemeProps) { return ( diff --git a/src/layouts/default/LayoutHeader/SettingsPopover/ThemeColorGrid/ThemeColorGrid.tsx b/src/layouts/default/LayoutHeader/SettingsPopover/ThemeColorGrid/ThemeColorGrid.tsx index 9e6e8d30..58be1ff0 100644 --- a/src/layouts/default/LayoutHeader/SettingsPopover/ThemeColorGrid/ThemeColorGrid.tsx +++ b/src/layouts/default/LayoutHeader/SettingsPopover/ThemeColorGrid/ThemeColorGrid.tsx @@ -4,7 +4,7 @@ import { Flex, Grid } from '@radix-ui/themes' import { ThemeColorGridItem } from './ThemeColorGridItem' import { SettingsPopoverTitle } from '../SettingsPopoverTitle' -import { themeColorItems, type ThemeProps } from '@shared/theme' +import { themeColorItems, type ThemeProps } from '@lib/theme' export function ThemeColorGrid({ themeColor }: Pick) { return ( diff --git a/src/layouts/default/LayoutHeader/SettingsPopover/ThemeColorGrid/ThemeColorGridItem/ThemeColorGridItem.tsx b/src/layouts/default/LayoutHeader/SettingsPopover/ThemeColorGrid/ThemeColorGridItem/ThemeColorGridItem.tsx index ffb758d0..a2dc919d 100644 --- a/src/layouts/default/LayoutHeader/SettingsPopover/ThemeColorGrid/ThemeColorGridItem/ThemeColorGridItem.tsx +++ b/src/layouts/default/LayoutHeader/SettingsPopover/ThemeColorGrid/ThemeColorGridItem/ThemeColorGridItem.tsx @@ -5,7 +5,7 @@ import { Box, Tooltip } from '@radix-ui/themes' import capitalize from 'lodash.capitalize' import { clsx } from 'clsx' -import { setThemeColorCookie, type ThemeColorItem } from '@shared/theme' +import { setThemeColorCookie, type ThemeColorItem } from '@lib/theme' import styles from './ThemeColorGridItem.module.css' export function ThemeColorGridItem({ color, isSelected }: Props) { diff --git a/src/layouts/default/LayoutHeader/SettingsPopover/ToggleTheme/ToggleTheme.tsx b/src/layouts/default/LayoutHeader/SettingsPopover/ToggleTheme/ToggleTheme.tsx index b56a1b1b..0a0807a4 100644 --- a/src/layouts/default/LayoutHeader/SettingsPopover/ToggleTheme/ToggleTheme.tsx +++ b/src/layouts/default/LayoutHeader/SettingsPopover/ToggleTheme/ToggleTheme.tsx @@ -5,7 +5,7 @@ import { MoonIcon, SunIcon } from '@radix-ui/react-icons' import { clsx } from 'clsx' import { SettingsPopoverTitle } from '../SettingsPopoverTitle' -import { setThemeCookie, type Theme, type ThemeProps } from '@shared/theme' +import { setThemeCookie, type Theme, type ThemeProps } from '@lib/theme' import type { ClassNameProps } from '@app-types/ClassNameProps' import styles from './ToggleTheme.module.css' diff --git a/src/shared/helpers/cookies.ts b/src/lib/helpers/cookies.ts similarity index 100% rename from src/shared/helpers/cookies.ts rename to src/lib/helpers/cookies.ts diff --git a/src/shared/helpers/copyToClipboard.ts b/src/lib/helpers/copyToClipboard.ts similarity index 100% rename from src/shared/helpers/copyToClipboard.ts rename to src/lib/helpers/copyToClipboard.ts diff --git a/src/shared/helpers/cropFileName.test.ts b/src/lib/helpers/cropFileName.test.ts similarity index 100% rename from src/shared/helpers/cropFileName.test.ts rename to src/lib/helpers/cropFileName.test.ts diff --git a/src/shared/helpers/cropFileName.ts b/src/lib/helpers/cropFileName.ts similarity index 100% rename from src/shared/helpers/cropFileName.ts rename to src/lib/helpers/cropFileName.ts diff --git a/src/shared/helpers/cropImageFileType.test.ts b/src/lib/helpers/cropImageFileType.test.ts similarity index 100% rename from src/shared/helpers/cropImageFileType.test.ts rename to src/lib/helpers/cropImageFileType.test.ts diff --git a/src/shared/helpers/cropImageFileType.ts b/src/lib/helpers/cropImageFileType.ts similarity index 100% rename from src/shared/helpers/cropImageFileType.ts rename to src/lib/helpers/cropImageFileType.ts diff --git a/src/shared/helpers/handleConvertError.test.ts b/src/lib/helpers/handleConvertError.test.ts similarity index 100% rename from src/shared/helpers/handleConvertError.test.ts rename to src/lib/helpers/handleConvertError.test.ts diff --git a/src/shared/helpers/handleConvertError.ts b/src/lib/helpers/handleConvertError.ts similarity index 100% rename from src/shared/helpers/handleConvertError.ts rename to src/lib/helpers/handleConvertError.ts diff --git a/src/shared/helpers/isDevelopment.ts b/src/lib/helpers/isDevelopment.ts similarity index 100% rename from src/shared/helpers/isDevelopment.ts rename to src/lib/helpers/isDevelopment.ts diff --git a/src/shared/helpers/isTooltipOpen.test.ts b/src/lib/helpers/isTooltipOpen.test.ts similarity index 100% rename from src/shared/helpers/isTooltipOpen.test.ts rename to src/lib/helpers/isTooltipOpen.test.ts diff --git a/src/shared/helpers/isTooltipOpen.ts b/src/lib/helpers/isTooltipOpen.ts similarity index 100% rename from src/shared/helpers/isTooltipOpen.ts rename to src/lib/helpers/isTooltipOpen.ts diff --git a/src/shared/helpers/isValidFileName.test.ts b/src/lib/helpers/isValidFileName.test.ts similarity index 100% rename from src/shared/helpers/isValidFileName.test.ts rename to src/lib/helpers/isValidFileName.test.ts diff --git a/src/shared/helpers/isValidFileName.ts b/src/lib/helpers/isValidFileName.ts similarity index 100% rename from src/shared/helpers/isValidFileName.ts rename to src/lib/helpers/isValidFileName.ts diff --git a/src/shared/helpers/isValidFileSize.test.ts b/src/lib/helpers/isValidFileSize.test.ts similarity index 100% rename from src/shared/helpers/isValidFileSize.test.ts rename to src/lib/helpers/isValidFileSize.test.ts diff --git a/src/shared/helpers/isValidFileSize.ts b/src/lib/helpers/isValidFileSize.ts similarity index 100% rename from src/shared/helpers/isValidFileSize.ts rename to src/lib/helpers/isValidFileSize.ts diff --git a/src/shared/router.ts b/src/lib/router.ts similarity index 100% rename from src/shared/router.ts rename to src/lib/router.ts diff --git a/src/shared/theme/actions.ts b/src/lib/theme/actions.ts similarity index 95% rename from src/shared/theme/actions.ts rename to src/lib/theme/actions.ts index cb1c0e0a..701d3ffb 100644 --- a/src/shared/theme/actions.ts +++ b/src/lib/theme/actions.ts @@ -4,7 +4,7 @@ import { cookies } from 'next/headers' import { THEME_COLOR_COOKIE_NAME, THEME_COOKIE_NAME } from './constants' import type { Theme } from './types' -import type { RadixThemeColor } from '@libs/radix' +import type { RadixThemeColor } from '@lib/theme/radix' export async function setThemeCookie(value: Theme): Promise { const cookieStore = cookies() diff --git a/src/shared/theme/constants.ts b/src/lib/theme/constants.ts similarity index 100% rename from src/shared/theme/constants.ts rename to src/lib/theme/constants.ts diff --git a/src/shared/theme/index.ts b/src/lib/theme/index.ts similarity index 54% rename from src/shared/theme/index.ts rename to src/lib/theme/index.ts index 47bb443c..e94ea94a 100644 --- a/src/shared/theme/index.ts +++ b/src/lib/theme/index.ts @@ -1,4 +1,5 @@ -export * from './appearance' +export * from './radix/appearance' +export * from './radix/types' export * from './actions' export * from './constants' export * from './types' diff --git a/src/shared/theme/appearance.ts b/src/lib/theme/radix/appearance.ts similarity index 94% rename from src/shared/theme/appearance.ts rename to src/lib/theme/radix/appearance.ts index b8bf33ea..f0a7f228 100644 --- a/src/shared/theme/appearance.ts +++ b/src/lib/theme/radix/appearance.ts @@ -1,4 +1,4 @@ -import type { ThemeColorItem } from './types' +import type { ThemeColorItem } from '@lib/theme/types' export const themeColorItems: ThemeColorItem[] = [ { key: 'tomato', color: 'tomato' }, diff --git a/src/shared/libs/radix/types.ts b/src/lib/theme/radix/types.ts similarity index 100% rename from src/shared/libs/radix/types.ts rename to src/lib/theme/radix/types.ts diff --git a/src/shared/theme/types.ts b/src/lib/theme/types.ts similarity index 79% rename from src/shared/theme/types.ts rename to src/lib/theme/types.ts index 8e3f1332..554be8d6 100644 --- a/src/shared/theme/types.ts +++ b/src/lib/theme/types.ts @@ -1,4 +1,4 @@ -import type { RadixThemeColor } from '@libs/radix' +import type { RadixThemeColor } from './radix' export type Theme = 'light' | 'dark' diff --git a/src/shared/ui/ButtonBackTop/ButtonBackTop.module.css b/src/lib/ui/ButtonBackTop/ButtonBackTop.module.css similarity index 100% rename from src/shared/ui/ButtonBackTop/ButtonBackTop.module.css rename to src/lib/ui/ButtonBackTop/ButtonBackTop.module.css diff --git a/src/shared/ui/ButtonBackTop/ButtonBackTop.tsx b/src/lib/ui/ButtonBackTop/ButtonBackTop.tsx similarity index 97% rename from src/shared/ui/ButtonBackTop/ButtonBackTop.tsx rename to src/lib/ui/ButtonBackTop/ButtonBackTop.tsx index 988abb10..6f8a0719 100644 --- a/src/shared/ui/ButtonBackTop/ButtonBackTop.tsx +++ b/src/lib/ui/ButtonBackTop/ButtonBackTop.tsx @@ -5,7 +5,7 @@ import { ChevronUpIcon } from '@radix-ui/react-icons' import { type MutableRefObject, useEffect, useState } from 'react' import { clsx } from 'clsx' -import type { ButtonSize } from '@libs/radix' +import type { ButtonSize } from '@lib/theme' import type { ClassNameProps } from '@app-types/ClassNameProps' import styles from './ButtonBackTop.module.css' diff --git a/src/shared/ui/ButtonBackTop/index.ts b/src/lib/ui/ButtonBackTop/index.ts similarity index 100% rename from src/shared/ui/ButtonBackTop/index.ts rename to src/lib/ui/ButtonBackTop/index.ts diff --git a/src/shared/ui/ButtonClear.tsx b/src/lib/ui/ButtonClear.tsx similarity index 100% rename from src/shared/ui/ButtonClear.tsx rename to src/lib/ui/ButtonClear.tsx diff --git a/src/shared/ui/ButtonClipboardCopy.tsx b/src/lib/ui/ButtonClipboardCopy.tsx similarity index 92% rename from src/shared/ui/ButtonClipboardCopy.tsx rename to src/lib/ui/ButtonClipboardCopy.tsx index a74fda7c..858bedbb 100644 --- a/src/shared/ui/ButtonClipboardCopy.tsx +++ b/src/lib/ui/ButtonClipboardCopy.tsx @@ -4,7 +4,7 @@ import { IconButton } from '@radix-ui/themes' import { ClipboardCopyIcon } from '@radix-ui/react-icons' import { copyToClipboard } from '@helpers/copyToClipboard' -import type { ButtonProps } from '@libs/radix' +import type { ButtonProps } from '@lib/theme' export function ButtonClipboardCopy({ copyValue, size, variant = 'ghost', color = 'gray' }: Props) { const handleCopy = () => copyToClipboard(copyValue) diff --git a/src/shared/ui/ButtonDelete.tsx b/src/lib/ui/ButtonDelete.tsx similarity index 100% rename from src/shared/ui/ButtonDelete.tsx rename to src/lib/ui/ButtonDelete.tsx diff --git a/src/shared/ui/ButtonInfo.tsx b/src/lib/ui/ButtonInfo.tsx similarity index 100% rename from src/shared/ui/ButtonInfo.tsx rename to src/lib/ui/ButtonInfo.tsx diff --git a/src/shared/ui/ButtonReset.tsx b/src/lib/ui/ButtonReset.tsx similarity index 93% rename from src/shared/ui/ButtonReset.tsx rename to src/lib/ui/ButtonReset.tsx index 80c75bda..b4519af8 100644 --- a/src/shared/ui/ButtonReset.tsx +++ b/src/lib/ui/ButtonReset.tsx @@ -4,7 +4,7 @@ import { IconButton, Tooltip } from '@radix-ui/themes' import { ResetIcon } from '@radix-ui/react-icons' import { isTooltipOpen } from '@helpers/isTooltipOpen' -import type { ButtonVariant } from '@libs/radix' +import type { ButtonVariant } from '@lib/theme' export function ButtonReset({ tooltipTitle, disabled, variant, onClick }: Props) { return ( diff --git a/src/shared/ui/HexColorInput/ColorInput.tsx b/src/lib/ui/HexColorInput/ColorInput.tsx similarity index 100% rename from src/shared/ui/HexColorInput/ColorInput.tsx rename to src/lib/ui/HexColorInput/ColorInput.tsx diff --git a/src/shared/ui/HexColorInput/HexColorInput.tsx b/src/lib/ui/HexColorInput/HexColorInput.tsx similarity index 95% rename from src/shared/ui/HexColorInput/HexColorInput.tsx rename to src/lib/ui/HexColorInput/HexColorInput.tsx index 3e258d1d..8dc82e6d 100644 --- a/src/shared/ui/HexColorInput/HexColorInput.tsx +++ b/src/lib/ui/HexColorInput/HexColorInput.tsx @@ -2,7 +2,7 @@ import { TextField } from '@radix-ui/themes' import { ButtonClipboardCopy } from '@ui/ButtonClipboardCopy' import { ColorInput } from './ColorInput' -import type { TextFieldInputProps } from '@libs/radix' +import type { TextFieldInputProps } from '@lib/theme' export const validHex = (value: string, alpha?: boolean): boolean => { const matcher = /^#?([0-9A-F]{3,8})$/i diff --git a/src/shared/ui/HexColorInput/index.ts b/src/lib/ui/HexColorInput/index.ts similarity index 100% rename from src/shared/ui/HexColorInput/index.ts rename to src/lib/ui/HexColorInput/index.ts diff --git a/src/shared/ui/LoadingSpinner/LoadingSpinner.module.css b/src/lib/ui/LoadingSpinner/LoadingSpinner.module.css similarity index 100% rename from src/shared/ui/LoadingSpinner/LoadingSpinner.module.css rename to src/lib/ui/LoadingSpinner/LoadingSpinner.module.css diff --git a/src/shared/ui/LoadingSpinner/LoadingSpinner.tsx b/src/lib/ui/LoadingSpinner/LoadingSpinner.tsx similarity index 90% rename from src/shared/ui/LoadingSpinner/LoadingSpinner.tsx rename to src/lib/ui/LoadingSpinner/LoadingSpinner.tsx index 5bb328b4..258bef7b 100644 --- a/src/shared/ui/LoadingSpinner/LoadingSpinner.tsx +++ b/src/lib/ui/LoadingSpinner/LoadingSpinner.tsx @@ -1,6 +1,6 @@ import { Box, type MarginProps } from '@radix-ui/themes' -import type { Size } from '@libs/radix' +import type { Size } from '@lib/theme' import styles from './LoadingSpinner.module.css' export function LoadingSpinner({ width, height, ...marginProps }: Props) { diff --git a/src/shared/ui/LoadingSpinner/index.ts b/src/lib/ui/LoadingSpinner/index.ts similarity index 100% rename from src/shared/ui/LoadingSpinner/index.ts rename to src/lib/ui/LoadingSpinner/index.ts diff --git a/src/shared/ui/icons/BlurIcon.tsx b/src/lib/ui/icons/BlurIcon.tsx similarity index 97% rename from src/shared/ui/icons/BlurIcon.tsx rename to src/lib/ui/icons/BlurIcon.tsx index 63592cce..1480b0de 100644 --- a/src/shared/ui/icons/BlurIcon.tsx +++ b/src/lib/ui/icons/BlurIcon.tsx @@ -1,4 +1,6 @@ -export function BlurIcon({ width = 24, height = 24 }: Props) { +import type { SVGProps } from 'react' + +export function BlurIcon({ width = 24, height = 24, ...props }: SVGProps) { return ( ) } - -interface Props { - width?: number - height?: number -} diff --git a/src/shared/ui/icons/CookieIcon.tsx b/src/lib/ui/icons/CookieIcon.tsx similarity index 100% rename from src/shared/ui/icons/CookieIcon.tsx rename to src/lib/ui/icons/CookieIcon.tsx diff --git a/src/shared/ui/icons/LogoIcon.tsx b/src/lib/ui/icons/LogoIcon.tsx similarity index 100% rename from src/shared/ui/icons/LogoIcon.tsx rename to src/lib/ui/icons/LogoIcon.tsx diff --git a/src/shared/ui/icons/index.ts b/src/lib/ui/icons/index.ts similarity index 100% rename from src/shared/ui/icons/index.ts rename to src/lib/ui/icons/index.ts diff --git a/src/shared/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.module.css b/src/lib/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.module.css similarity index 100% rename from src/shared/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.module.css rename to src/lib/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.module.css diff --git a/src/shared/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.tsx b/src/lib/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.tsx similarity index 100% rename from src/shared/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.tsx rename to src/lib/ui/skeletons/ButtonInfoSkeleton/ButtonInfoSkeleton.tsx diff --git a/src/shared/ui/skeletons/ButtonInfoSkeleton/index.ts b/src/lib/ui/skeletons/ButtonInfoSkeleton/index.ts similarity index 100% rename from src/shared/ui/skeletons/ButtonInfoSkeleton/index.ts rename to src/lib/ui/skeletons/ButtonInfoSkeleton/index.ts diff --git a/src/shared/ui/skeletons/OptionsSkeleton/OptionsSkeleton.module.css b/src/lib/ui/skeletons/OptionsSkeleton/OptionsSkeleton.module.css similarity index 100% rename from src/shared/ui/skeletons/OptionsSkeleton/OptionsSkeleton.module.css rename to src/lib/ui/skeletons/OptionsSkeleton/OptionsSkeleton.module.css diff --git a/src/shared/ui/skeletons/OptionsSkeleton/OptionsSkeleton.tsx b/src/lib/ui/skeletons/OptionsSkeleton/OptionsSkeleton.tsx similarity index 100% rename from src/shared/ui/skeletons/OptionsSkeleton/OptionsSkeleton.tsx rename to src/lib/ui/skeletons/OptionsSkeleton/OptionsSkeleton.tsx diff --git a/src/shared/ui/skeletons/OptionsSkeleton/index.ts b/src/lib/ui/skeletons/OptionsSkeleton/index.ts similarity index 100% rename from src/shared/ui/skeletons/OptionsSkeleton/index.ts rename to src/lib/ui/skeletons/OptionsSkeleton/index.ts diff --git a/src/shared/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.module.css b/src/lib/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.module.css similarity index 100% rename from src/shared/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.module.css rename to src/lib/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.module.css diff --git a/src/shared/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.tsx b/src/lib/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.tsx similarity index 100% rename from src/shared/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.tsx rename to src/lib/ui/skeletons/ToolbarSkeleton/ToolbarSkeleton.tsx diff --git a/src/shared/ui/skeletons/ToolbarSkeleton/index.ts b/src/lib/ui/skeletons/ToolbarSkeleton/index.ts similarity index 100% rename from src/shared/ui/skeletons/ToolbarSkeleton/index.ts rename to src/lib/ui/skeletons/ToolbarSkeleton/index.ts diff --git a/src/shared/libs/Sharp/Sharp.constants.ts b/src/server/Sharp/Sharp.constants.ts similarity index 100% rename from src/shared/libs/Sharp/Sharp.constants.ts rename to src/server/Sharp/Sharp.constants.ts diff --git a/src/shared/libs/Sharp/Sharp.ts b/src/server/Sharp/Sharp.ts similarity index 99% rename from src/shared/libs/Sharp/Sharp.ts rename to src/server/Sharp/Sharp.ts index 0c46e14c..8564c792 100644 --- a/src/shared/libs/Sharp/Sharp.ts +++ b/src/server/Sharp/Sharp.ts @@ -14,7 +14,7 @@ import { type NormaliseOptions, type ResizeOptions, type RotateOptions -} from '@libs/Sharp' +} from '@server/Sharp' export class Sharp { private readonly imageSharp: sharp.Sharp diff --git a/src/shared/libs/Sharp/Sharp.types.ts b/src/server/Sharp/Sharp.types.ts similarity index 100% rename from src/shared/libs/Sharp/Sharp.types.ts rename to src/server/Sharp/Sharp.types.ts diff --git a/src/shared/libs/Sharp/index.ts b/src/server/Sharp/index.ts similarity index 100% rename from src/shared/libs/Sharp/index.ts rename to src/server/Sharp/index.ts diff --git a/src/shared/libs/radix/index.ts b/src/shared/libs/radix/index.ts deleted file mode 100644 index c9f6f047..00000000 --- a/src/shared/libs/radix/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './types' diff --git a/src/stores/blur/store.ts b/src/stores/blur/store.ts index cdeba095..af3c2f66 100644 --- a/src/stores/blur/store.ts +++ b/src/stores/blur/store.ts @@ -1,6 +1,6 @@ import { create } from 'zustand' -import { DEFAULT_BLUR, MIN_BLUR_SIGMA } from '@libs/Sharp' +import { DEFAULT_BLUR, MIN_BLUR_SIGMA } from '@server/Sharp' import type { Store } from './types' export const useBlurStore = create((set, get) => ({ diff --git a/src/stores/blur/types.ts b/src/stores/blur/types.ts index 3e68d70a..b79c6867 100644 --- a/src/stores/blur/types.ts +++ b/src/stores/blur/types.ts @@ -1,4 +1,4 @@ -import type { BlurOptions } from '@libs/Sharp' +import type { BlurOptions } from '@server/Sharp' export type Store = BlurOptions & Computed & Actions diff --git a/src/stores/convert/store.ts b/src/stores/convert/store.ts index 15568421..753f93f5 100644 --- a/src/stores/convert/store.ts +++ b/src/stores/convert/store.ts @@ -1,7 +1,7 @@ import { create } from 'zustand' import { devtools } from 'zustand/middleware' -import { DEFAULT_FLIP, DEFAULT_FLOP, DEFAULT_GRAYSCALE } from '@libs/Sharp' +import { DEFAULT_FLIP, DEFAULT_FLOP, DEFAULT_GRAYSCALE } from '@server/Sharp' import type { Settings, Store } from './types' const defaultState: Settings = { diff --git a/src/stores/convert/types.ts b/src/stores/convert/types.ts index 255c9a49..ebf7bc5d 100644 --- a/src/stores/convert/types.ts +++ b/src/stores/convert/types.ts @@ -1,4 +1,4 @@ -import type { ConvertSettings } from '@libs/Sharp' +import type { ConvertSettings } from '@server/Sharp' export type Store = Settings & Computed & Actions diff --git a/src/stores/gamma/store.ts b/src/stores/gamma/store.ts index b9bb82ff..86edf1d6 100644 --- a/src/stores/gamma/store.ts +++ b/src/stores/gamma/store.ts @@ -1,6 +1,6 @@ import { create } from 'zustand' -import { DEFAULT_GAMMA } from '@libs/Sharp' +import { DEFAULT_GAMMA } from '@server/Sharp' import type { Store } from './types' export const useGammaStore = create(set => ({ diff --git a/src/stores/gamma/types.ts b/src/stores/gamma/types.ts index b082110f..a5f18edd 100644 --- a/src/stores/gamma/types.ts +++ b/src/stores/gamma/types.ts @@ -1,4 +1,4 @@ -import type { GammaOptions } from '@libs/Sharp' +import type { GammaOptions } from '@server/Sharp' export type Store = State & Actions diff --git a/src/stores/hooks/useConvertSettings.ts b/src/stores/hooks/useConvertSettings.ts index ec34f189..1e160a7b 100644 --- a/src/stores/hooks/useConvertSettings.ts +++ b/src/stores/hooks/useConvertSettings.ts @@ -8,7 +8,7 @@ import { useGammaStore } from '@stores/gamma' import { useNormaliseStore } from '@stores/normalise' import { useTintStore } from '@stores/tint' import { useOutputStore } from '@stores/output' -import type { ConvertSettings } from '@libs/Sharp' +import type { ConvertSettings } from '@server/Sharp' export function useConvertSettings(): ConvertSettings { const convertSettings = useConvertStore(state => state.getConvertSettings()) diff --git a/src/stores/modulate/types.ts b/src/stores/modulate/types.ts index 0ec3354b..6dc911f7 100644 --- a/src/stores/modulate/types.ts +++ b/src/stores/modulate/types.ts @@ -1,4 +1,4 @@ -import type { ModulateOptions } from '@libs/Sharp' +import type { ModulateOptions } from '@server/Sharp' export type Store = State & Computed & Actions diff --git a/src/stores/negate/store.ts b/src/stores/negate/store.ts index 67114bd5..f25f2eac 100644 --- a/src/stores/negate/store.ts +++ b/src/stores/negate/store.ts @@ -1,6 +1,6 @@ import { create } from 'zustand' -import { DEFAULT_NEGATE } from '@libs/Sharp' +import { DEFAULT_NEGATE } from '@server/Sharp' import type { Store } from './types' export const useNegateStore = create((set, get) => ({ diff --git a/src/stores/negate/types.ts b/src/stores/negate/types.ts index dcf620fd..469da128 100644 --- a/src/stores/negate/types.ts +++ b/src/stores/negate/types.ts @@ -1,4 +1,4 @@ -import type { NegateOptions } from '@libs/Sharp' +import type { NegateOptions } from '@server/Sharp' export type Store = NegateOptions & Computed & Actions diff --git a/src/stores/normalise/store.ts b/src/stores/normalise/store.ts index 0d0e0db8..73681b55 100644 --- a/src/stores/normalise/store.ts +++ b/src/stores/normalise/store.ts @@ -1,6 +1,6 @@ import { create } from 'zustand' -import { DEFAULT_NORMALISE } from '@libs/Sharp' +import { DEFAULT_NORMALISE } from '@server/Sharp' import type { Store } from './types' export const useNormaliseStore = create((set, get) => ({ diff --git a/src/stores/normalise/types.ts b/src/stores/normalise/types.ts index 3a5b78bc..44827c73 100644 --- a/src/stores/normalise/types.ts +++ b/src/stores/normalise/types.ts @@ -1,4 +1,4 @@ -import type { NormaliseOptions } from '@libs/Sharp' +import type { NormaliseOptions } from '@server/Sharp' export type Store = State & Computed & Actions diff --git a/src/stores/output/store.ts b/src/stores/output/store.ts index 3a3e4d9e..cd2d7fa7 100644 --- a/src/stores/output/store.ts +++ b/src/stores/output/store.ts @@ -3,7 +3,7 @@ import { create } from 'zustand' import { cropImageFileType } from '@helpers/cropImageFileType' import { cropFileName } from '@helpers/cropFileName' import { isValidFileName } from '@helpers/isValidFileName' -import type { ConvertFormat } from '@libs/Sharp' +import type { ConvertFormat } from '@server/Sharp' import type { State, Store } from './types' const defaultState: State = { diff --git a/src/stores/output/types.ts b/src/stores/output/types.ts index c4923f6a..b8b287eb 100644 --- a/src/stores/output/types.ts +++ b/src/stores/output/types.ts @@ -1,5 +1,5 @@ import type { DownloadPayload } from '@app-types/DownloadPayload' -import type { ConvertFormat } from '@libs/Sharp' +import type { ConvertFormat } from '@server/Sharp' export type Store = State & Computed & Actions diff --git a/src/stores/resize/store.ts b/src/stores/resize/store.ts index dbefaa53..a3266d58 100644 --- a/src/stores/resize/store.ts +++ b/src/stores/resize/store.ts @@ -9,7 +9,7 @@ import { DEFAULT_WITHOUT_ENLARGEMENT, DEFAULT_WITHOUT_REDUCTION, ResizeFit -} from '@libs/Sharp' +} from '@server/Sharp' import type { Store } from './types' export const defaultState = { diff --git a/src/stores/resize/types.ts b/src/stores/resize/types.ts index 0aa5aca7..f75ca24a 100644 --- a/src/stores/resize/types.ts +++ b/src/stores/resize/types.ts @@ -1,4 +1,4 @@ -import type { ResizeFit, ResizeKernel, ResizeOptions, ResizePosition } from '@libs/Sharp' +import type { ResizeFit, ResizeKernel, ResizeOptions, ResizePosition } from '@server/Sharp' export type Store = ResizeOptions & Computed & Actions diff --git a/src/stores/rotate/store.ts b/src/stores/rotate/store.ts index 5ac20ce5..ac19ef3b 100644 --- a/src/stores/rotate/store.ts +++ b/src/stores/rotate/store.ts @@ -1,6 +1,6 @@ import { create } from 'zustand' -import { DEFAULT_ROTATE, DEFAULT_ROTATE_ANGLE, DEFAULT_ROTATE_BACKGROUND } from '@libs/Sharp' +import { DEFAULT_ROTATE, DEFAULT_ROTATE_ANGLE, DEFAULT_ROTATE_BACKGROUND } from '@server/Sharp' import type { State, Store } from './types' const defaultState: State = { diff --git a/src/stores/rotate/types.ts b/src/stores/rotate/types.ts index 4a417f3e..9a092b4b 100644 --- a/src/stores/rotate/types.ts +++ b/src/stores/rotate/types.ts @@ -1,4 +1,4 @@ -import type { RotateOptions } from '@libs/Sharp' +import type { RotateOptions } from '@server/Sharp' export type Store = State & Computed & Actions diff --git a/src/stores/tint/store.ts b/src/stores/tint/store.ts index 592a72b5..92ee917c 100644 --- a/src/stores/tint/store.ts +++ b/src/stores/tint/store.ts @@ -1,6 +1,6 @@ import { create } from 'zustand' -import { DEFAULT_TINT_COLOR } from '@libs/Sharp' +import { DEFAULT_TINT_COLOR } from '@server/Sharp' import type { State, Store } from './types' const defaultState: State = { diff --git a/src/widgets/SettingsPanel/OptionSwitch.tsx b/src/widgets/SettingsPanel/OptionSwitch.tsx index 67163bab..1a76324e 100644 --- a/src/widgets/SettingsPanel/OptionSwitch.tsx +++ b/src/widgets/SettingsPanel/OptionSwitch.tsx @@ -3,7 +3,7 @@ import { memo } from 'react' import { Flex, Switch, Text } from '@radix-ui/themes' -import type { Size } from '@libs/radix' +import type { Size } from '@lib/theme' const width: Size = { initial: '100%', diff --git a/src/widgets/SettingsPanel/TabDefault/InputOutputFileName/InputOutputFileName.tsx b/src/widgets/SettingsPanel/TabDefault/InputOutputFileName/InputOutputFileName.tsx index ddbece87..c3df0147 100644 --- a/src/widgets/SettingsPanel/TabDefault/InputOutputFileName/InputOutputFileName.tsx +++ b/src/widgets/SettingsPanel/TabDefault/InputOutputFileName/InputOutputFileName.tsx @@ -11,7 +11,7 @@ import { MAX_FILE_NAME_LENGTH, MIN_FILE_NAME_LENGTH } from '@helpers/isValidFileName' -import type { TextFieldInputProps } from '@libs/radix' +import type { TextFieldInputProps } from '@lib/theme' import styles from './InputOutputFileName.module.css' const PopoverOutputFileName = dynamic( diff --git a/src/widgets/SettingsPanel/TabDefault/options/Basic/BasicOptions.tsx b/src/widgets/SettingsPanel/TabDefault/options/Basic/BasicOptions.tsx index 11cefbe2..0c4c7c14 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Basic/BasicOptions.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Basic/BasicOptions.tsx @@ -3,7 +3,7 @@ import { Flex } from '@radix-ui/themes' import { SwitchFlip } from './SwitchFlip' import { SwitchFlop } from './SwitchFlop' import { SwitchGrayscale } from './SwitchGrayscale' -import type { FlexDirection } from '@libs/radix' +import type { FlexDirection } from '@lib/theme' const direction: FlexDirection = { initial: 'column', diff --git a/src/widgets/SettingsPanel/TabDefault/options/Blur/Blur.tsx b/src/widgets/SettingsPanel/TabDefault/options/Blur/Blur.tsx index c64a245f..661b386a 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Blur/Blur.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Blur/Blur.tsx @@ -9,8 +9,8 @@ import { OptionSwitch } from '@widgets/SettingsPanel/OptionSwitch' import { ButtonAddBlurSigma } from './ButtonAddBlurSigma' import { ButtonRemoveBlurSigma } from './ButtonRemoveBlurSigma' import { useBlurStore } from '@stores/blur' -import { MAX_BLUR_SIGMA, MIN_BLUR_SIGMA } from '@libs/Sharp' -import type { AlignItems, FlexDirection, Gap } from '@libs/radix' +import { MAX_BLUR_SIGMA, MIN_BLUR_SIGMA } from '@server/Sharp' +import type { AlignItems, FlexDirection, Gap } from '@lib/theme' function BlurInfo() { return ( diff --git a/src/widgets/SettingsPanel/TabDefault/options/Gamma/GammaHeader.tsx b/src/widgets/SettingsPanel/TabDefault/options/Gamma/GammaHeader.tsx index 6bffedff..c233e471 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Gamma/GammaHeader.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Gamma/GammaHeader.tsx @@ -3,7 +3,7 @@ import { ShadowIcon } from '@radix-ui/react-icons' import { OptionSectionHeader } from '@widgets/SettingsPanel/OptionSectionHeader' import { ButtonResetGamma } from './ButtonResetGamma' import { ButtonRemoveGamma } from './ButtonRemoveGamma' -import type { GammaOptions } from '@libs/Sharp' +import type { GammaOptions } from '@server/Sharp' export function GammaHeader({ gamma }: Props) { return ( diff --git a/src/widgets/SettingsPanel/TabDefault/options/Gamma/SliderGamma.tsx b/src/widgets/SettingsPanel/TabDefault/options/Gamma/SliderGamma.tsx index e25345c9..803e83ae 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Gamma/SliderGamma.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Gamma/SliderGamma.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { OptionSlider } from '@widgets/SettingsPanel/OptionSlider' import { useGammaStore } from '@stores/gamma' -import { MAX_GAMMA, MIN_GAMMA } from '@libs/Sharp' +import { MAX_GAMMA, MIN_GAMMA } from '@server/Sharp' export function SliderGamma() { const gammaValue = useGammaStore(state => state.gamma?.value) diff --git a/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderBrightness.tsx b/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderBrightness.tsx index 1b2084cb..52f6c6bc 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderBrightness.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderBrightness.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { OptionSlider } from '@widgets/SettingsPanel/OptionSlider' import { useModulateStore } from '@stores/modulate' -import { MAX_BRIGHTNESS, MIN_BRIGHTNESS } from '@libs/Sharp' +import { MAX_BRIGHTNESS, MIN_BRIGHTNESS } from '@server/Sharp' export function SliderBrightness() { const brightness = useModulateStore(state => state.brightness) diff --git a/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderHue.tsx b/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderHue.tsx index bf091c69..ae38a41b 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderHue.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderHue.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { OptionSlider } from '@widgets/SettingsPanel/OptionSlider' import { useModulateStore } from '@stores/modulate' -import { MAX_HUE, MIN_HUE } from '@libs/Sharp' +import { MAX_HUE, MIN_HUE } from '@server/Sharp' export function SliderHue() { const hue = useModulateStore(state => state.hue) diff --git a/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderLightness.tsx b/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderLightness.tsx index 6b65fc6d..87996a1a 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderLightness.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderLightness.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { OptionSlider } from '@widgets/SettingsPanel/OptionSlider' import { useModulateStore } from '@stores/modulate' -import { MAX_LIGHTNESS, MIN_LIGHTNESS } from '@libs/Sharp' +import { MAX_LIGHTNESS, MIN_LIGHTNESS } from '@server/Sharp' export function SliderLightness() { const lightness = useModulateStore(state => state.lightness) diff --git a/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderSaturation.tsx b/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderSaturation.tsx index 4de29a3f..a6cca095 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderSaturation.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Modulate/sliders/SliderSaturation.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { OptionSlider } from '@widgets/SettingsPanel/OptionSlider' import { useModulateStore } from '@stores/modulate' -import { MAX_SATURATION, MIN_SATURATION } from '@libs/Sharp' +import { MAX_SATURATION, MIN_SATURATION } from '@server/Sharp' export function SliderSaturation() { const saturation = useModulateStore(state => state.saturation) diff --git a/src/widgets/SettingsPanel/TabDefault/options/Negate/Negate.tsx b/src/widgets/SettingsPanel/TabDefault/options/Negate/Negate.tsx index 3476ee9b..807fa08f 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Negate/Negate.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Negate/Negate.tsx @@ -2,7 +2,7 @@ import { Flex } from '@radix-ui/themes' import { SwitchNegate } from './SwitchNegate' import { SwitchNegateAlpha } from './SwitchNegateAlpha' -import type { FlexDirection } from '@libs/radix' +import type { FlexDirection } from '@lib/theme' const direction: FlexDirection = { initial: 'column', diff --git a/src/widgets/SettingsPanel/TabDefault/options/Normalise/SliderNormalise.tsx b/src/widgets/SettingsPanel/TabDefault/options/Normalise/SliderNormalise.tsx index 812b4631..ea9320d0 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Normalise/SliderNormalise.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Normalise/SliderNormalise.tsx @@ -2,7 +2,7 @@ import { useCallback } from 'react' import { OptionSlider } from '@widgets/SettingsPanel/OptionSlider' import { useNormaliseStore } from '@stores/normalise' -import { MAX_NORMALISE, MIN_NORMALISE } from '@libs/Sharp' +import { MAX_NORMALISE, MIN_NORMALISE } from '@server/Sharp' export function SliderNormalise() { const lower = useNormaliseStore(state => state.lower) diff --git a/src/widgets/SettingsPanel/TabDefault/options/OutputFormat/SelectOutputFormat.tsx b/src/widgets/SettingsPanel/TabDefault/options/OutputFormat/SelectOutputFormat.tsx index b528ace2..6913b22b 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/OutputFormat/SelectOutputFormat.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/OutputFormat/SelectOutputFormat.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { Select } from '@radix-ui/themes' import { useOutputStore } from '@stores/output' -import { ConvertFormat } from '@libs/Sharp' +import { ConvertFormat } from '@server/Sharp' export function SelectOutputFormat() { const outputFormat = useOutputStore(state => state.outputFormat) diff --git a/src/widgets/SettingsPanel/TabDefault/options/Rotate/RotateHeader.tsx b/src/widgets/SettingsPanel/TabDefault/options/Rotate/RotateHeader.tsx index cdcd52ed..bfd37862 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Rotate/RotateHeader.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Rotate/RotateHeader.tsx @@ -6,7 +6,7 @@ import { OptionSectionHeader } from '@widgets/SettingsPanel/OptionSectionHeader' import { ButtonResetRotate } from './ButtonResetRotate' import { ButtonRemoveRotate } from './ButtonRemoveRotate' import { useRotateStore } from '@stores/rotate' -import { DEFAULT_ROTATE_ANGLE } from '@libs/Sharp' +import { DEFAULT_ROTATE_ANGLE } from '@server/Sharp' export function RotateHeader() { const rotateAngle = useRotateStore(state => state.angle) diff --git a/src/widgets/SettingsPanel/TabDefault/options/Rotate/SliderRotateAngle.tsx b/src/widgets/SettingsPanel/TabDefault/options/Rotate/SliderRotateAngle.tsx index f3a63c1b..e8664609 100644 --- a/src/widgets/SettingsPanel/TabDefault/options/Rotate/SliderRotateAngle.tsx +++ b/src/widgets/SettingsPanel/TabDefault/options/Rotate/SliderRotateAngle.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { OptionSlider } from '@widgets/SettingsPanel/OptionSlider' import { useRotateStore } from '@stores/rotate' -import { DEFAULT_ROTATE_ANGLE, MAX_ROTATE_ANGLE, MIN_ROTATE_ANGLE } from '@libs/Sharp' +import { DEFAULT_ROTATE_ANGLE, MAX_ROTATE_ANGLE, MIN_ROTATE_ANGLE } from '@server/Sharp' export function SliderRotateAngle() { const rotateAngle = useRotateStore(state => state.angle) diff --git a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeFit/ResizeFitExamplesPopover/ResizeFitExamplesPopover.tsx b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeFit/ResizeFitExamplesPopover/ResizeFitExamplesPopover.tsx index 4fffdf41..0c25c862 100644 --- a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeFit/ResizeFitExamplesPopover/ResizeFitExamplesPopover.tsx +++ b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeFit/ResizeFitExamplesPopover/ResizeFitExamplesPopover.tsx @@ -8,7 +8,7 @@ import fillExample from '@public/resize-fit-examples/fill.png' import insideExample from '@public/resize-fit-examples/inside.png' import outsideExample from '@public/resize-fit-examples/outside.png' import styles from './ResizeFitExamplesPopover.module.css' -import type { FlexDirection, Gap } from '@libs/radix' +import type { FlexDirection, Gap } from '@lib/theme' const examples = [ { diff --git a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeFit/SelectResizeFit.tsx b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeFit/SelectResizeFit.tsx index 2459cdbc..27af2a8f 100644 --- a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeFit/SelectResizeFit.tsx +++ b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeFit/SelectResizeFit.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { ResizeSelect } from '../ResizeSelect' import { useResizeStore } from '@stores/resize' -import { DEFAULT_RESIZE_FIT, ResizeFit } from '@libs/Sharp' +import { DEFAULT_RESIZE_FIT, ResizeFit } from '@server/Sharp' const data = [ { diff --git a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeKernel/SelectResizeKernel.tsx b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeKernel/SelectResizeKernel.tsx index 6b8ec1a2..00030330 100644 --- a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeKernel/SelectResizeKernel.tsx +++ b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeKernel/SelectResizeKernel.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { ResizeSelect } from '../ResizeSelect' import { useResizeStore } from '@stores/resize' -import { DEFAULT_RESIZE_KERNEL, ResizeKernel } from '@libs/Sharp' +import { DEFAULT_RESIZE_KERNEL, ResizeKernel } from '@server/Sharp' const data = [ { diff --git a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizePosition/SelectResizePosition.tsx b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizePosition/SelectResizePosition.tsx index bdebdc85..23f48422 100644 --- a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizePosition/SelectResizePosition.tsx +++ b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizePosition/SelectResizePosition.tsx @@ -4,7 +4,7 @@ import { useCallback } from 'react' import { ResizeSelect } from '../ResizeSelect' import { useResizeStore } from '@stores/resize' -import { DEFAULT_RESIZE_POSITION, ResizePosition, ResizePositionGravity } from '@libs/Sharp' +import { DEFAULT_RESIZE_POSITION, ResizePosition, ResizePositionGravity } from '@server/Sharp' const data = [ { diff --git a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeSwitchers/SwitchFastShrink.tsx b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeSwitchers/SwitchFastShrink.tsx index fecd2f0a..96973c12 100644 --- a/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeSwitchers/SwitchFastShrink.tsx +++ b/src/widgets/SettingsPanel/TabResize/ResizeExtra/ResizeSwitchers/SwitchFastShrink.tsx @@ -5,7 +5,7 @@ import { useCallback } from 'react' import { OptionSwitch } from '@widgets/SettingsPanel/OptionSwitch' import { useResizeStore } from '@stores/resize' import { useOutputStore } from '@stores/output' -import { ConvertFormat } from '@libs/Sharp' +import { ConvertFormat } from '@server/Sharp' const ALLOWED_FORMATS_FOR_FAST_SHRINK = [ConvertFormat.JPEG, ConvertFormat.WEBP] diff --git a/src/widgets/SettingsPanel/TabResize/ResizeSizesForm/ResizeSizesForm.tsx b/src/widgets/SettingsPanel/TabResize/ResizeSizesForm/ResizeSizesForm.tsx index 80498efd..befb3830 100644 --- a/src/widgets/SettingsPanel/TabResize/ResizeSizesForm/ResizeSizesForm.tsx +++ b/src/widgets/SettingsPanel/TabResize/ResizeSizesForm/ResizeSizesForm.tsx @@ -5,7 +5,12 @@ import { HeightIcon, WidthIcon } from '@radix-ui/react-icons' import { ResizeSizeInput } from './ResizeSizeInput' import { useResizeStore } from '@stores/resize' -import { MAX_RESIZE_HEIGHT, MAX_RESIZE_WIDTH, MIN_RESIZE_SIZE, RESIZE_SIZE_STEP } from '@libs/Sharp' +import { + MAX_RESIZE_HEIGHT, + MAX_RESIZE_WIDTH, + MIN_RESIZE_SIZE, + RESIZE_SIZE_STEP +} from '@server/Sharp' export function ResizeSizesForm() { const width = useResizeStore(state => state.width) diff --git a/tsconfig.json b/tsconfig.json index 45f4c309..8cd45806 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -41,6 +41,9 @@ "isolatedModules": true, /* Aliases */ "paths": { + "@server/*": [ + "./src/server/*" + ], "@public/*": [ "./public/*" ], @@ -68,17 +71,14 @@ "@hooks/*": [ "./src/hooks/*" ], - "@shared/*": [ - "./src/shared/*" + "@lib/*": [ + "./src/lib/*" ], "@ui/*": [ - "./src/shared/ui/*" + "./src/lib/ui/*" ], "@helpers/*": [ - "./src/shared/helpers/*" - ], - "@libs/*": [ - "./src/shared/libs/*" + "./src/lib/helpers/*" ], "@utils/*": [ "./src/utils/*" diff --git a/vitest.config.ts b/vitest.config.ts index d0360091..3aedc435 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -13,12 +13,12 @@ const createAlias = ({ find, replacementPath }: Alias) => ({ const aliases: Alias[] = [ { - find: '@helpers', - replacementPath: './src/shared/helpers' + find: '@lib', + replacementPath: './src/lib/ui' }, { - find: '@libs', - replacementPath: './src/shared/libs' + find: '@helpers', + replacementPath: './src/lib/helpers' }, { find: '@stores', From 4c6b6b69298913785f271103612c4414c38b49ba Mon Sep 17 00:00:00 2001 From: MiracleHorizon Date: Fri, 22 Dec 2023 12:26:45 +0300 Subject: [PATCH 2/2] fix: radix imports --- src/app/page.tsx | 2 +- src/lib/theme/actions.ts | 2 +- src/lib/theme/types.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 1642c025..8062de0a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -12,7 +12,7 @@ import { FileUploadZone } from '@components/uploading/FileUploadZone' import { useOutputStore } from '@stores/output' import { useConvertImage } from '@hooks/useConvertImage' import { ALLOWED_IMAGE_FORMATS } from '@server/Sharp' -import type { FlexDirection } from '@lib/theme/radix' +import type { FlexDirection } from '@lib/theme' import styles from './page.module.css' const RequestErrorAlert = dynamic( diff --git a/src/lib/theme/actions.ts b/src/lib/theme/actions.ts index 701d3ffb..9c47770a 100644 --- a/src/lib/theme/actions.ts +++ b/src/lib/theme/actions.ts @@ -4,7 +4,7 @@ import { cookies } from 'next/headers' import { THEME_COLOR_COOKIE_NAME, THEME_COOKIE_NAME } from './constants' import type { Theme } from './types' -import type { RadixThemeColor } from '@lib/theme/radix' +import type { RadixThemeColor } from '@lib/theme' export async function setThemeCookie(value: Theme): Promise { const cookieStore = cookies() diff --git a/src/lib/theme/types.ts b/src/lib/theme/types.ts index 554be8d6..b190d1a2 100644 --- a/src/lib/theme/types.ts +++ b/src/lib/theme/types.ts @@ -1,4 +1,4 @@ -import type { RadixThemeColor } from './radix' +import type { RadixThemeColor } from './radix/types' export type Theme = 'light' | 'dark'