Move library files into new folder
This commit is contained in:
@@ -24,7 +24,7 @@ import { useNavBarContext } from '@/components/context/NavbarContext.tsx';
|
|||||||
|
|
||||||
const { Browse } = loadable(() => import('@/screens/Browse'), lazyLoadFallback);
|
const { Browse } = loadable(() => import('@/screens/Browse'), lazyLoadFallback);
|
||||||
const { DownloadQueue } = loadable(() => import('@/screens/DownloadQueue'), lazyLoadFallback);
|
const { DownloadQueue } = loadable(() => import('@/screens/DownloadQueue'), lazyLoadFallback);
|
||||||
const { Library } = loadable(() => import('@/screens/Library'), lazyLoadFallback);
|
const { Library } = loadable(() => import('@/modules/library/screens/Library.tsx'), lazyLoadFallback);
|
||||||
const { Manga } = loadable(() => import('@/modules/manga/screens/Manga.tsx'), lazyLoadFallback);
|
const { Manga } = loadable(() => import('@/modules/manga/screens/Manga.tsx'), lazyLoadFallback);
|
||||||
const { Reader } = loadable(() => import('@/screens/Reader'), lazyLoadFallback);
|
const { Reader } = loadable(() => import('@/screens/Reader'), lazyLoadFallback);
|
||||||
const { SearchAll } = loadable(() => import('@/screens/SearchAll'), lazyLoadFallback);
|
const { SearchAll } = loadable(() => import('@/screens/SearchAll'), lazyLoadFallback);
|
||||||
@@ -36,7 +36,7 @@ const { DefaultReaderSettings } = loadable(() => import('@/screens/settings/Defa
|
|||||||
const { SourceConfigure } = loadable(() => import('@/screens/SourceConfigure'), lazyLoadFallback);
|
const { SourceConfigure } = loadable(() => import('@/screens/SourceConfigure'), lazyLoadFallback);
|
||||||
const { SourceMangas } = loadable(() => import('@/screens/SourceMangas'), lazyLoadFallback);
|
const { SourceMangas } = loadable(() => import('@/screens/SourceMangas'), lazyLoadFallback);
|
||||||
const { Updates } = loadable(() => import('@/screens/Updates'), lazyLoadFallback);
|
const { Updates } = loadable(() => import('@/screens/Updates'), lazyLoadFallback);
|
||||||
const { LibrarySettings } = loadable(() => import('@/screens/settings/LibrarySettings'), lazyLoadFallback);
|
const { LibrarySettings } = loadable(() => import('@/modules/library/screens/LibrarySettings.tsx'), lazyLoadFallback);
|
||||||
const { DownloadSettings } = loadable(() => import('@/screens/settings/DownloadSettings.tsx'), lazyLoadFallback);
|
const { DownloadSettings } = loadable(() => import('@/screens/settings/DownloadSettings.tsx'), lazyLoadFallback);
|
||||||
const { ServerSettings } = loadable(() => import('@/screens/settings/ServerSettings.tsx'), lazyLoadFallback);
|
const { ServerSettings } = loadable(() => import('@/screens/settings/ServerSettings.tsx'), lazyLoadFallback);
|
||||||
const { BrowseSettings } = loadable(() => import('@/screens/settings/BrowseSettings.tsx'), lazyLoadFallback);
|
const { BrowseSettings } = loadable(() => import('@/screens/settings/BrowseSettings.tsx'), lazyLoadFallback);
|
||||||
@@ -45,7 +45,10 @@ const { Migrate } = loadable(() => import('@/screens/Migrate.tsx'), lazyLoadFall
|
|||||||
const { DeviceSetting } = loadable(() => import('@/components/settings/DeviceSetting.tsx'), lazyLoadFallback);
|
const { DeviceSetting } = loadable(() => import('@/components/settings/DeviceSetting.tsx'), lazyLoadFallback);
|
||||||
const { TrackingSettings } = loadable(() => import('@/screens/settings/TrackingSettings.tsx'), lazyLoadFallback);
|
const { TrackingSettings } = loadable(() => import('@/screens/settings/TrackingSettings.tsx'), lazyLoadFallback);
|
||||||
const { TrackerOAuthLogin } = loadable(() => import('@/screens/TrackerOAuthLogin.tsx'), lazyLoadFallback);
|
const { TrackerOAuthLogin } = loadable(() => import('@/screens/TrackerOAuthLogin.tsx'), lazyLoadFallback);
|
||||||
const { LibraryDuplicates } = loadable(() => import('@/screens/settings/LibraryDuplicates.tsx'), lazyLoadFallback);
|
const { LibraryDuplicates } = loadable(
|
||||||
|
() => import('@/modules/library/screens/LibraryDuplicates.tsx'),
|
||||||
|
lazyLoadFallback,
|
||||||
|
);
|
||||||
const { Appearance } = loadable(() => import('@/screens/settings/appearance/Appearance.tsx'), lazyLoadFallback);
|
const { Appearance } = loadable(() => import('@/screens/settings/appearance/Appearance.tsx'), lazyLoadFallback);
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import Tooltip from '@mui/material/Tooltip';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ViewModuleIcon from '@mui/icons-material/ViewModule';
|
import ViewModuleIcon from '@mui/icons-material/ViewModule';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
|
|
||||||
// TODO: clean up this to use a FormControl, and remove dependency on name o radio button
|
// TODO: clean up this to use a FormControl, and remove dependency on name o radio button
|
||||||
export function GridLayouts({
|
export function GridLayouts({
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { GridLayouts } from '@/components/source/GridLayouts.tsx';
|
import { GridLayouts } from '@/components/source/GridLayouts.tsx';
|
||||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||||
|
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ import {
|
|||||||
CategoryMetadataKeys,
|
CategoryMetadataKeys,
|
||||||
GqlMetaHolder,
|
GqlMetaHolder,
|
||||||
ICategoryMetadata,
|
ICategoryMetadata,
|
||||||
LibraryOptions,
|
|
||||||
Metadata,
|
Metadata,
|
||||||
} from '@/typings.ts';
|
} from '@/typings.ts';
|
||||||
import { jsonSaveParse } from '@/lib/HelperFunctions.ts';
|
import { jsonSaveParse } from '@/lib/HelperFunctions.ts';
|
||||||
import { convertFromGqlMeta, getMetadataFrom, requestUpdateCategoryMetadata } from '@/lib/metadata/metadata.ts';
|
import { convertFromGqlMeta, getMetadataFrom, requestUpdateCategoryMetadata } from '@/lib/metadata/metadata.ts';
|
||||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||||
import { CategoryIdInfo } from '@/lib/data/Categories.ts';
|
import { CategoryIdInfo } from '@/lib/data/Categories.ts';
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext.tsx';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
|
import { LibraryOptions } from '@/modules/library/Library.types.ts';
|
||||||
|
|
||||||
export const getDefaultCategoryMetadata = (): ICategoryMetadata => ({
|
export const getDefaultCategoryMetadata = (): ICategoryMetadata => ({
|
||||||
// display options
|
// display options
|
||||||
|
|||||||
13
src/modules/core/Core.types.ts
Normal file
13
src/modules/core/Core.types.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) Contributors to the Suwayomi project
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export enum GridLayout {
|
||||||
|
Compact = 0,
|
||||||
|
Comfortable = 1,
|
||||||
|
List = 2,
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ import { createAndSetTheme } from '@/theme.tsx';
|
|||||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||||
import { ThemeMode, ThemeModeContext } from '@/components/context/ThemeModeContext.tsx';
|
import { ThemeMode, ThemeModeContext } from '@/components/context/ThemeModeContext.tsx';
|
||||||
import { NavBarContextProvider } from '@/components/navbar/NavBarContextProvider.tsx';
|
import { NavBarContextProvider } from '@/components/navbar/NavBarContextProvider.tsx';
|
||||||
import { LibraryOptionsContextProvider } from '@/components/library/LibraryOptionsProvider.tsx';
|
import { LibraryOptionsContextProvider } from '@/modules/library/contexts/LibraryOptionsProvider.tsx';
|
||||||
import { ActiveDevice, DEFAULT_DEVICE, setActiveDevice } from '@/util/device.ts';
|
import { ActiveDevice, DEFAULT_DEVICE, setActiveDevice } from '@/util/device.ts';
|
||||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||||
import { AppThemes, getTheme } from '@/lib/ui/AppThemes.ts';
|
import { AppThemes, getTheme } from '@/lib/ui/AppThemes.ts';
|
||||||
|
|||||||
46
src/modules/library/Library.types.ts
Normal file
46
src/modules/library/Library.types.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) Contributors to the Suwayomi project
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { NullAndUndefined } from '@/Base.types.ts';
|
||||||
|
import { MangaStatus, TrackerType } from '@/lib/graphql/generated/graphql.ts';
|
||||||
|
import { GridLayout } from '@/modules/core/Core.types.ts';
|
||||||
|
|
||||||
|
export type MetadataLibrarySettings = {
|
||||||
|
showAddToLibraryCategorySelectDialog: boolean;
|
||||||
|
ignoreFilters: boolean;
|
||||||
|
removeMangaFromCategories: boolean;
|
||||||
|
showTabSize: boolean;
|
||||||
|
};
|
||||||
|
export type LibrarySortMode =
|
||||||
|
| 'unreadChapters'
|
||||||
|
| 'totalChapters'
|
||||||
|
| 'alphabetically'
|
||||||
|
| 'dateAdded'
|
||||||
|
| 'lastRead'
|
||||||
|
| 'latestFetchedChapter'
|
||||||
|
| 'latestUploadedChapter';
|
||||||
|
|
||||||
|
export interface LibraryOptions {
|
||||||
|
// display options
|
||||||
|
showContinueReadingButton: boolean;
|
||||||
|
showDownloadBadge: boolean;
|
||||||
|
showUnreadBadge: boolean;
|
||||||
|
gridLayout: GridLayout;
|
||||||
|
|
||||||
|
// sort options
|
||||||
|
sortBy: NullAndUndefined<LibrarySortMode>;
|
||||||
|
sortDesc: NullAndUndefined<boolean>;
|
||||||
|
|
||||||
|
// filter options
|
||||||
|
hasDownloadedChapters: NullAndUndefined<boolean>;
|
||||||
|
hasBookmarkedChapters: NullAndUndefined<boolean>;
|
||||||
|
hasUnreadChapters: NullAndUndefined<boolean>;
|
||||||
|
hasDuplicateChapters: NullAndUndefined<boolean>;
|
||||||
|
hasTrackerBinding: Record<TrackerType['id'], NullAndUndefined<boolean>>;
|
||||||
|
hasStatus: Record<MangaStatus, NullAndUndefined<boolean>>;
|
||||||
|
}
|
||||||
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
import React, { useLayoutEffect } from 'react';
|
import React, { useLayoutEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { GridLayout, useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext';
|
import { GridLayout, useLibraryOptionsContext } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { IMangaGridProps, MangaGrid } from '@/modules/manga/components/MangaGrid';
|
import { IMangaGridProps, MangaGrid } from '@/modules/manga/components/MangaGrid.tsx';
|
||||||
|
|
||||||
interface LibraryMangaGridProps
|
interface LibraryMangaGridProps
|
||||||
extends Required<Pick<IMangaGridProps, 'isSelectModeActive' | 'selectedMangaIds' | 'handleSelection' | 'mangas'>>,
|
extends Required<Pick<IMangaGridProps, 'isSelectModeActive' | 'selectedMangaIds' | 'handleSelection' | 'mangas'>>,
|
||||||
@@ -10,12 +10,11 @@ import FormLabel from '@mui/material/FormLabel';
|
|||||||
import RadioGroup from '@mui/material/RadioGroup';
|
import RadioGroup from '@mui/material/RadioGroup';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { LibrarySortMode } from '@/typings';
|
|
||||||
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
||||||
import { RadioInput } from '@/modules/core/components/inputs/RadioInput.tsx';
|
import { RadioInput } from '@/modules/core/components/inputs/RadioInput.tsx';
|
||||||
import { SortRadioInput } from '@/modules/core/components/inputs/SortRadioInput.tsx';
|
import { SortRadioInput } from '@/modules/core/components/inputs/SortRadioInput.tsx';
|
||||||
import { ThreeStateCheckboxInput } from '@/modules/core/components/inputs/ThreeStateCheckboxInput.tsx';
|
import { ThreeStateCheckboxInput } from '@/modules/core/components/inputs/ThreeStateCheckboxInput.tsx';
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { OptionsTabs } from '@/modules/core/components/OptionsTabs.tsx';
|
import { OptionsTabs } from '@/modules/core/components/OptionsTabs.tsx';
|
||||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||||
import { Trackers } from '@/lib/data/Trackers.ts';
|
import { Trackers } from '@/lib/data/Trackers.ts';
|
||||||
@@ -30,6 +29,7 @@ import {
|
|||||||
useMetadataServerSettings,
|
useMetadataServerSettings,
|
||||||
} from '@/lib/metadata/metadataServerSettings.ts';
|
} from '@/lib/metadata/metadataServerSettings.ts';
|
||||||
import { TranslationKey } from '@/Base.types.ts';
|
import { TranslationKey } from '@/Base.types.ts';
|
||||||
|
import { LibrarySortMode } from '@/modules/library/Library.types.ts';
|
||||||
|
|
||||||
const TITLES: { [key in 'filter' | 'sort' | 'display']: TranslationKey } = {
|
const TITLES: { [key in 'filter' | 'sort' | 'display']: TranslationKey } = {
|
||||||
filter: 'global.label.filter',
|
filter: 'global.label.filter',
|
||||||
@@ -11,8 +11,8 @@ import IconButton from '@mui/material/IconButton';
|
|||||||
import Tooltip from '@mui/material/Tooltip';
|
import Tooltip from '@mui/material/Tooltip';
|
||||||
import { ComponentProps, useState } from 'react';
|
import { ComponentProps, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { LibraryOptionsPanel } from '@/components/library/LibraryOptionsPanel';
|
import { LibraryOptionsPanel } from '@/modules/library/components/LibraryOptionsPanel.tsx';
|
||||||
import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext.tsx';
|
import { useLibraryOptionsContext } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
|
|
||||||
export const LibraryToolbarMenu = ({
|
export const LibraryToolbarMenu = ({
|
||||||
category,
|
category,
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { LibraryOptions } from '@/typings';
|
|
||||||
import { getDefaultCategoryMetadata } from '@/lib/metadata/categoryMetadata.ts';
|
import { getDefaultCategoryMetadata } from '@/lib/metadata/categoryMetadata.ts';
|
||||||
|
import { LibraryOptions } from '@/modules/library/Library.types.ts';
|
||||||
|
|
||||||
type ContextType = {
|
type ContextType = {
|
||||||
options: LibraryOptions;
|
options: LibraryOptions;
|
||||||
@@ -7,10 +7,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { LibraryOptions } from '@/typings';
|
|
||||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||||
import { LibraryOptionsContext } from '@/components/context/LibraryOptionsContext';
|
import { LibraryOptionsContext } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { getDefaultCategoryMetadata } from '@/lib/metadata/categoryMetadata.ts';
|
import { getDefaultCategoryMetadata } from '@/lib/metadata/categoryMetadata.ts';
|
||||||
|
import { LibraryOptions } from '@/modules/library/Library.types.ts';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
import { StringParam, useQueryParam } from 'use-query-params';
|
import { StringParam, useQueryParam } from 'use-query-params';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { LibraryOptions, LibrarySortMode } from '@/typings.ts';
|
|
||||||
import { useMetadataServerSettings } from '@/lib/metadata/metadataServerSettings.ts';
|
import { useMetadataServerSettings } from '@/lib/metadata/metadataServerSettings.ts';
|
||||||
import { ChapterType, MangaType, SourceType, TrackRecordType } from '@/lib/graphql/generated/graphql.ts';
|
import { ChapterType, MangaType, SourceType, TrackRecordType } from '@/lib/graphql/generated/graphql.ts';
|
||||||
import { MangaChapterCountInfo, MangaIdInfo } from '@/modules/manga/services/Mangas.ts';
|
import { MangaChapterCountInfo, MangaIdInfo } from '@/modules/manga/services/Mangas.ts';
|
||||||
@@ -16,6 +15,7 @@ import { enhancedCleanup } from '@/lib/data/Strings.ts';
|
|||||||
import { CategoryMetadataInfo } from '@/lib/data/Categories.ts';
|
import { CategoryMetadataInfo } from '@/lib/data/Categories.ts';
|
||||||
import { getCategoryMetadata } from '@/lib/metadata/categoryMetadata.ts';
|
import { getCategoryMetadata } from '@/lib/metadata/categoryMetadata.ts';
|
||||||
import { NullAndUndefined } from '@/Base.types.ts';
|
import { NullAndUndefined } from '@/Base.types.ts';
|
||||||
|
import { LibraryOptions, LibrarySortMode } from '@/modules/library/Library.types.ts';
|
||||||
|
|
||||||
const triStateFilter = (
|
const triStateFilter = (
|
||||||
triState: NullAndUndefined<boolean>,
|
triState: NullAndUndefined<boolean>,
|
||||||
@@ -16,14 +16,14 @@ import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
|||||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||||
import { TabPanel } from '@/modules/core/components/tabs/TabPanel.tsx';
|
import { TabPanel } from '@/modules/core/components/tabs/TabPanel.tsx';
|
||||||
import { LibraryToolbarMenu } from '@/components/library/LibraryToolbarMenu';
|
import { LibraryToolbarMenu } from '@/modules/library/components/LibraryToolbarMenu.tsx';
|
||||||
import { LibraryMangaGrid } from '@/components/library/LibraryMangaGrid';
|
import { LibraryMangaGrid } from '@/modules/library/components/LibraryMangaGrid.tsx';
|
||||||
import { AppbarSearch } from '@/modules/core/components/AppbarSearch.tsx';
|
import { AppbarSearch } from '@/modules/core/components/AppbarSearch.tsx';
|
||||||
import { UpdateChecker } from '@/modules/core/components/UpdateChecker.tsx';
|
import { UpdateChecker } from '@/modules/core/components/UpdateChecker.tsx';
|
||||||
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
||||||
import { useSelectableCollection } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
import { useSelectableCollection } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
||||||
import { SelectableCollectionSelectMode } from '@/modules/collection/components/SelectableCollectionSelectMode.tsx';
|
import { SelectableCollectionSelectMode } from '@/modules/collection/components/SelectableCollectionSelectMode.tsx';
|
||||||
import { useGetVisibleLibraryMangas } from '@/components/library/useGetVisibleLibraryMangas.ts';
|
import { useGetVisibleLibraryMangas } from '@/modules/library/hooks/useGetVisibleLibraryMangas.ts';
|
||||||
import { SelectionFAB } from '@/modules/collection/components/SelectionFAB.tsx';
|
import { SelectionFAB } from '@/modules/collection/components/SelectionFAB.tsx';
|
||||||
import { MangaActionMenuItems } from '@/modules/manga/components/MangaActionMenuItems.tsx';
|
import { MangaActionMenuItems } from '@/modules/manga/components/MangaActionMenuItems.tsx';
|
||||||
import { TabsMenu } from '@/modules/core/components/tabs/TabsMenu.tsx';
|
import { TabsMenu } from '@/modules/core/components/tabs/TabsMenu.tsx';
|
||||||
@@ -38,7 +38,7 @@ import {
|
|||||||
import { GET_CATEGORIES_LIBRARY } from '@/lib/graphql/queries/CategoryQuery.ts';
|
import { GET_CATEGORIES_LIBRARY } from '@/lib/graphql/queries/CategoryQuery.ts';
|
||||||
import { Mangas } from '@/modules/manga/services/Mangas.ts';
|
import { Mangas } from '@/modules/manga/services/Mangas.ts';
|
||||||
import { MANGA_CHAPTER_STAT_FIELDS } from '@/lib/graphql/fragments/MangaFragments.ts';
|
import { MANGA_CHAPTER_STAT_FIELDS } from '@/lib/graphql/fragments/MangaFragments.ts';
|
||||||
import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext.tsx';
|
import { useLibraryOptionsContext } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { useMetadataServerSettings } from '@/lib/metadata/metadataServerSettings.ts';
|
import { useMetadataServerSettings } from '@/lib/metadata/metadataServerSettings.ts';
|
||||||
import { getCategoryMetadata } from '@/lib/metadata/categoryMetadata.ts';
|
import { getCategoryMetadata } from '@/lib/metadata/categoryMetadata.ts';
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ import Box from '@mui/material/Box';
|
|||||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||||
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
||||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext.tsx';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { GridLayouts } from '@/components/source/GridLayouts.tsx';
|
import { GridLayouts } from '@/components/source/GridLayouts.tsx';
|
||||||
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
||||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||||
@@ -17,7 +17,6 @@ import ListSubheader from '@mui/material/ListSubheader';
|
|||||||
import { t as translate } from 'i18next';
|
import { t as translate } from 'i18next';
|
||||||
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
||||||
import { GlobalUpdateSettings } from '@/components/settings/globalUpdate/GlobalUpdateSettings.tsx';
|
import { GlobalUpdateSettings } from '@/components/settings/globalUpdate/GlobalUpdateSettings.tsx';
|
||||||
import { MetadataLibrarySettings } from '@/typings.ts';
|
|
||||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||||
import {
|
import {
|
||||||
createUpdateMetadataServerSettings,
|
createUpdateMetadataServerSettings,
|
||||||
@@ -37,6 +36,7 @@ import {
|
|||||||
} from '@/lib/graphql/generated/graphql.ts';
|
} from '@/lib/graphql/generated/graphql.ts';
|
||||||
import { GET_CATEGORIES_SETTINGS } from '@/lib/graphql/queries/CategoryQuery.ts';
|
import { GET_CATEGORIES_SETTINGS } from '@/lib/graphql/queries/CategoryQuery.ts';
|
||||||
import { GET_MANGAS_BASE } from '@/lib/graphql/queries/MangaQuery.ts';
|
import { GET_MANGAS_BASE } from '@/lib/graphql/queries/MangaQuery.ts';
|
||||||
|
import { MetadataLibrarySettings } from '@/modules/library/Library.types.ts';
|
||||||
|
|
||||||
const removeNonLibraryMangasFromCategories = async (): Promise<void> => {
|
const removeNonLibraryMangasFromCategories = async (): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import { LongPressPointerHandlers, LongPressResult } from 'use-long-press/lib/use-long-press.types';
|
import { LongPressPointerHandlers, LongPressResult } from 'use-long-press/lib/use-long-press.types';
|
||||||
import { PopupState } from 'material-ui-popup-state/hooks';
|
import { PopupState } from 'material-ui-popup-state/hooks';
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext.tsx';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { SelectableCollectionReturnType } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
import { SelectableCollectionReturnType } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
||||||
import { useManageMangaLibraryState } from '@/modules/manga/hooks/useManageMangaLibraryState.tsx';
|
import { useManageMangaLibraryState } from '@/modules/manga/hooks/useManageMangaLibraryState.tsx';
|
||||||
import { MangaThumbnailInfo } from '@/modules/manga/services/Mangas.ts';
|
import { MangaThumbnailInfo } from '@/modules/manga/services/Mangas.ts';
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import Button from '@mui/material/Button';
|
|||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import { MangaCardMode } from '@/modules/manga/MangaCard.types.tsx';
|
import { MangaCardMode } from '@/modules/manga/MangaCard.types.tsx';
|
||||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||||
import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext.tsx';
|
import { useLibraryOptionsContext } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
|
|
||||||
const BadgeContainer = styled('div')(({ theme }) => ({
|
const BadgeContainer = styled('div')(({ theme }) => ({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||||
import { MangaCard } from '@/modules/manga/components/cards/MangaCard.tsx';
|
import { MangaCard } from '@/modules/manga/components/cards/MangaCard.tsx';
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { useLocalStorage, useSessionStorage } from '@/modules/core/hooks/useStorage.tsx';
|
import { useLocalStorage, useSessionStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||||
import { SelectableCollectionReturnType } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
import { SelectableCollectionReturnType } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
||||||
import { DEFAULT_FULL_FAB_HEIGHT } from '@/modules/core/components/buttons/StyledFab.tsx';
|
import { DEFAULT_FULL_FAB_HEIGHT } from '@/modules/core/components/buttons/StyledFab.tsx';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import PopupState, { bindMenu } from 'material-ui-popup-state';
|
import PopupState, { bindMenu } from 'material-ui-popup-state';
|
||||||
import { useMemo, useState } from 'react';
|
import { useMemo, useState } from 'react';
|
||||||
import { useLongPress } from 'use-long-press';
|
import { useLongPress } from 'use-long-press';
|
||||||
import { GridLayout, useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext';
|
import { GridLayout, useLibraryOptionsContext } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { MangaActionMenuItems, SingleModeProps } from '@/modules/manga/components/MangaActionMenuItems.tsx';
|
import { MangaActionMenuItems, SingleModeProps } from '@/modules/manga/components/MangaActionMenuItems.tsx';
|
||||||
import { Menu } from '@/modules/core/components/menu/Menu.tsx';
|
import { Menu } from '@/modules/core/components/menu/Menu.tsx';
|
||||||
import { MigrateDialog } from '@/components/MigrateDialog.tsx';
|
import { MigrateDialog } from '@/components/MigrateDialog.tsx';
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { styled } from '@mui/material/styles';
|
|||||||
import { useRef } from 'react';
|
import { useRef } from 'react';
|
||||||
import { SpinnerImage } from '@/modules/core/components/SpinnerImage.tsx';
|
import { SpinnerImage } from '@/modules/core/components/SpinnerImage.tsx';
|
||||||
import { MangaOptionButton } from '@/modules/manga/components/MangaOptionButton.tsx';
|
import { MangaOptionButton } from '@/modules/manga/components/MangaOptionButton.tsx';
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext.tsx';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { Mangas } from '@/modules/manga/services/Mangas.ts';
|
import { Mangas } from '@/modules/manga/services/Mangas.ts';
|
||||||
import { SpecificMangaCardProps } from '@/modules/manga/MangaCard.types.tsx';
|
import { SpecificMangaCardProps } from '@/modules/manga/MangaCard.types.tsx';
|
||||||
import { TypographyMaxLines } from '@/modules/core/components/TypographyMaxLines.tsx';
|
import { TypographyMaxLines } from '@/modules/core/components/TypographyMaxLines.tsx';
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { LoadingPlaceholder } from '@/modules/core/components/placeholder/Loadin
|
|||||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||||
import { GridLayouts } from '@/components/source/GridLayouts.tsx';
|
import { GridLayouts } from '@/components/source/GridLayouts.tsx';
|
||||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext.tsx';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||||
import { GetSourceMigratableQuery, GetSourceMigratableQueryVariables } from '@/lib/graphql/generated/graphql.ts';
|
import { GetSourceMigratableQuery, GetSourceMigratableQueryVariables } from '@/lib/graphql/generated/graphql.ts';
|
||||||
import { GET_SOURCE_MIGRATABLE } from '@/lib/graphql/queries/SourceQuery.ts';
|
import { GET_SOURCE_MIGRATABLE } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {
|
|||||||
AbortableApolloUseMutationPaginatedResponse,
|
AbortableApolloUseMutationPaginatedResponse,
|
||||||
SPECIAL_ED_SOURCES,
|
SPECIAL_ED_SOURCES,
|
||||||
} from '@/lib/requests/requests/RequestManager.ts';
|
} from '@/lib/requests/requests/RequestManager.ts';
|
||||||
import { GridLayout } from '@/components/context/LibraryOptionsContext';
|
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||||
import { SourceGridLayout } from '@/components/source/SourceGridLayout';
|
import { SourceGridLayout } from '@/components/source/SourceGridLayout';
|
||||||
import { AppbarSearch } from '@/modules/core/components/AppbarSearch.tsx';
|
import { AppbarSearch } from '@/modules/core/components/AppbarSearch.tsx';
|
||||||
import { SourceOptions } from '@/components/source/SourceOptions';
|
import { SourceOptions } from '@/components/source/SourceOptions';
|
||||||
|
|||||||
@@ -14,15 +14,14 @@ import {
|
|||||||
GetSourceBrowseQuery,
|
GetSourceBrowseQuery,
|
||||||
GetSourceSettingsQuery,
|
GetSourceSettingsQuery,
|
||||||
MangaReaderFieldsFragment,
|
MangaReaderFieldsFragment,
|
||||||
MangaStatus,
|
|
||||||
MetaType,
|
MetaType,
|
||||||
SourcePreferenceChangeInput,
|
SourcePreferenceChangeInput,
|
||||||
TrackerType,
|
|
||||||
} from '@/lib/graphql/generated/graphql.ts';
|
} from '@/lib/graphql/generated/graphql.ts';
|
||||||
import { AppTheme } from '@/lib/ui/AppThemes.ts';
|
import { AppTheme } from '@/lib/ui/AppThemes.ts';
|
||||||
import { SortSettings } from '@/screens/Migration.types.ts';
|
import { SortSettings } from '@/screens/Migration.types.ts';
|
||||||
import { NullAndUndefined, TranslationKey } from '@/Base.types.ts';
|
import { TranslationKey } from '@/Base.types.ts';
|
||||||
import { MangaMetadataKeys } from '@/modules/manga/MangaCard.types.tsx';
|
import { MangaMetadataKeys } from '@/modules/manga/MangaCard.types.tsx';
|
||||||
|
import { LibraryOptions, MetadataLibrarySettings } from '@/modules/library/Library.types.ts';
|
||||||
|
|
||||||
export interface IPos {
|
export interface IPos {
|
||||||
type: 'selectState' | 'textState' | 'checkBoxState' | 'triState' | 'sortState';
|
type: 'selectState' | 'textState' | 'checkBoxState' | 'triState' | 'sortState';
|
||||||
@@ -120,13 +119,6 @@ export type MetadataDownloadSettings = {
|
|||||||
downloadAheadLimit: number;
|
downloadAheadLimit: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type MetadataLibrarySettings = {
|
|
||||||
showAddToLibraryCategorySelectDialog: boolean;
|
|
||||||
ignoreFilters: boolean;
|
|
||||||
removeMangaFromCategories: boolean;
|
|
||||||
showTabSize: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type MetadataClientSettings = {
|
export type MetadataClientSettings = {
|
||||||
devices: string[];
|
devices: string[];
|
||||||
};
|
};
|
||||||
@@ -226,39 +218,4 @@ export interface NavbarItem {
|
|||||||
show: 'mobile' | 'desktop' | 'both';
|
show: 'mobile' | 'desktop' | 'both';
|
||||||
}
|
}
|
||||||
|
|
||||||
export type LibrarySortMode =
|
|
||||||
| 'unreadChapters'
|
|
||||||
| 'totalChapters'
|
|
||||||
| 'alphabetically'
|
|
||||||
| 'dateAdded'
|
|
||||||
| 'lastRead'
|
|
||||||
| 'latestFetchedChapter'
|
|
||||||
| 'latestUploadedChapter';
|
|
||||||
|
|
||||||
enum GridLayout {
|
|
||||||
Compact = 0,
|
|
||||||
Comfortable = 1,
|
|
||||||
List = 2,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface LibraryOptions {
|
|
||||||
// display options
|
|
||||||
showContinueReadingButton: boolean;
|
|
||||||
showDownloadBadge: boolean;
|
|
||||||
showUnreadBadge: boolean;
|
|
||||||
gridLayout: GridLayout;
|
|
||||||
|
|
||||||
// sort options
|
|
||||||
sortBy: NullAndUndefined<LibrarySortMode>;
|
|
||||||
sortDesc: NullAndUndefined<boolean>;
|
|
||||||
|
|
||||||
// filter options
|
|
||||||
hasDownloadedChapters: NullAndUndefined<boolean>;
|
|
||||||
hasBookmarkedChapters: NullAndUndefined<boolean>;
|
|
||||||
hasUnreadChapters: NullAndUndefined<boolean>;
|
|
||||||
hasDuplicateChapters: NullAndUndefined<boolean>;
|
|
||||||
hasTrackerBinding: Record<TrackerType['id'], NullAndUndefined<boolean>>;
|
|
||||||
hasStatus: Record<MangaStatus, NullAndUndefined<boolean>>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ServerSettings = GetServerSettingsQuery['settings'];
|
export type ServerSettings = GetServerSettingsQuery['settings'];
|
||||||
|
|||||||
Reference in New Issue
Block a user