Update lint rules
This commit is contained in:
@@ -15,7 +15,8 @@ import DialogActions from '@mui/material/DialogActions';
|
||||
import Button from '@mui/material/Button';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { UpdateState, WebUiChannel, WebUiUpdateStatus } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { WebUiUpdateStatus } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { UpdateState, WebUiChannel } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { useLocalStorage, useSessionStorage } from '@/base/hooks/useStorage.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { ReactNode, useEffect } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { SplashScreen } from '@/features/authentication/components/SplashScreen.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { AuthManager } from '@/features/authentication/AuthManager.ts';
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
*/
|
||||
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import Stack, { StackProps } from '@mui/material/Stack';
|
||||
import { ComponentProps } from 'react';
|
||||
import type { StackProps } from '@mui/material/Stack';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import type { ComponentProps } from 'react';
|
||||
import { SuwayomiLogo } from '@/assets/SuwayomiLogo.tsx';
|
||||
import { ServerAddressSetting } from '@/features/settings/components/ServerAddressSetting.tsx';
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { BackupFlag, BackupFlagGroup } from '@/features/backup/Backup.types.ts';
|
||||
import type { BackupFlag } from '@/features/backup/Backup.types.ts';
|
||||
import { BackupFlagGroup } from '@/features/backup/Backup.types.ts';
|
||||
|
||||
export const BACKUP_FLAGS_TO_TRANSLATION: Record<BackupFlag, MessageDescriptor> = {
|
||||
includeManga: msg`Library entries`,
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { PartialBackupFlagsInput } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { ServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
import type { PartialBackupFlagsInput } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { ServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
|
||||
export enum BackupFlagGroup {
|
||||
LIBRARY = 'library',
|
||||
|
||||
@@ -7,7 +7,11 @@
|
||||
*/
|
||||
|
||||
import { plural, t } from '@lingui/core/macro';
|
||||
import { AutoBackupFlagInclusionState, BackupFlag, BackupFlagInclusionState } from '@/features/backup/Backup.types.ts';
|
||||
import type {
|
||||
AutoBackupFlagInclusionState,
|
||||
BackupFlag,
|
||||
BackupFlagInclusionState,
|
||||
} from '@/features/backup/Backup.types.ts';
|
||||
import { BACKUP_FLAGS_TO_TRANSLATION } from '@/features/backup/Backup.constants.ts';
|
||||
|
||||
export const convertToAutoBackupFlags = (flags: BackupFlagInclusionState): AutoBackupFlagInclusionState => ({
|
||||
|
||||
@@ -15,7 +15,7 @@ import { useState } from 'react';
|
||||
import Button from '@mui/material/Button';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { AwaitableComponentProps } from 'awaitable-component';
|
||||
import type { AwaitableComponentProps } from 'awaitable-component';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { CheckboxInput } from '@/base/components/inputs/CheckboxInput.tsx';
|
||||
import {
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
BACKUP_FLAGS_BY_GROUP,
|
||||
BACKUP_FLAGS_TO_TRANSLATION,
|
||||
} from '@/features/backup/Backup.constants.ts';
|
||||
import { BackupFlagGroup, BackupFlagInclusionState } from '@/features/backup/Backup.types.ts';
|
||||
import type { BackupFlagGroup, BackupFlagInclusionState } from '@/features/backup/Backup.types.ts';
|
||||
|
||||
export const BackupFlagInclusionDialog = ({
|
||||
onDismiss,
|
||||
|
||||
@@ -15,11 +15,11 @@ import Button from '@mui/material/Button';
|
||||
import ListItem from '@mui/material/ListItem';
|
||||
import { Link } from 'react-router-dom';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { AwaitableComponentProps } from 'awaitable-component';
|
||||
import type { AwaitableComponentProps } from 'awaitable-component';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { BrowseTab } from '@/features/browse/Browse.types.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { ValidateBackupResult } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { ValidateBackupResult } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
export const BackupValidationDialog = ({
|
||||
validationResult,
|
||||
|
||||
@@ -37,10 +37,17 @@ import {
|
||||
getAutoBackupFlagsInfo,
|
||||
getBackupCleanupDisplayValue,
|
||||
} from '@/features/backup/Backup.utils.ts';
|
||||
import { BackupSettingsType } from '@/features/backup/Backup.types.ts';
|
||||
import type { BackupSettingsType } from '@/features/backup/Backup.types.ts';
|
||||
|
||||
let backupRestoreId: string | undefined;
|
||||
|
||||
const resetBackupState = () => {
|
||||
const input = document.getElementById('backup-file') as HTMLInputElement;
|
||||
if (input) {
|
||||
input.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
export function Backup() {
|
||||
const { t } = useLingui();
|
||||
|
||||
@@ -113,13 +120,6 @@ export function Backup() {
|
||||
}
|
||||
}, [data?.restoreStatus?.state]);
|
||||
|
||||
const resetBackupState = () => {
|
||||
const input = document.getElementById('backup-file') as HTMLInputElement;
|
||||
if (input) {
|
||||
input.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
const createBackup = async () => {
|
||||
const flags = await AwaitableComponent.show(BackupFlagInclusionDialog, {
|
||||
title: t`Create backup`,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
|
||||
export type MetadataBrowseSettings = {
|
||||
hideLibraryEntries: boolean;
|
||||
|
||||
@@ -36,12 +36,8 @@ import {
|
||||
translateExtensionLanguage,
|
||||
filterExtensions,
|
||||
} from '@/features/extension/Extensions.utils.ts';
|
||||
import {
|
||||
ExtensionAction,
|
||||
ExtensionGroupState,
|
||||
ExtensionState,
|
||||
TExtension,
|
||||
} from '@/features/extension/Extensions.types.ts';
|
||||
import type { TExtension } from '@/features/extension/Extensions.types.ts';
|
||||
import { ExtensionAction, ExtensionGroupState, ExtensionState } from '@/features/extension/Extensions.types.ts';
|
||||
import { EXTENSION_ACTION_TO_FAILURE_TRANSLATION_MAP } from '@/features/extension/Extensions.constants.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
@@ -49,7 +45,7 @@ import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import { MetadataBrowseSettings } from '@/features/browse/Browse.types.ts';
|
||||
import type { MetadataBrowseSettings } from '@/features/browse/Browse.types.ts';
|
||||
import { useAppAction } from '@/features/navigation-bar/hooks/useAppAction.ts';
|
||||
import { SearchParam } from '@/base/Base.types.ts';
|
||||
import { i18n } from '@/i18n';
|
||||
@@ -159,7 +155,7 @@ export function Extensions({ tabsMenuHeight }: { tabsMenuHeight: number }) {
|
||||
[groupedExtensions],
|
||||
);
|
||||
const visibleExtensions = useMemo(
|
||||
() => groupedExtensions.map(([, extensions]) => extensions).flat(1),
|
||||
() => groupedExtensions.flatMap(([, extensions]) => extensions),
|
||||
[groupedExtensions],
|
||||
);
|
||||
|
||||
|
||||
@@ -16,13 +16,8 @@ import Stack from '@mui/material/Stack';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import {
|
||||
ExtensionAction,
|
||||
ExtensionState,
|
||||
InstalledState,
|
||||
InstalledStates,
|
||||
TExtension,
|
||||
} from '@/features/extension/Extensions.types.ts';
|
||||
import type { InstalledStates, TExtension } from '@/features/extension/Extensions.types.ts';
|
||||
import { ExtensionAction, ExtensionState, InstalledState } from '@/features/extension/Extensions.types.ts';
|
||||
import {
|
||||
EXTENSION_ACTION_TO_NEXT_ACTION_MAP,
|
||||
EXTENSION_ACTION_TO_STATE_MAP,
|
||||
|
||||
@@ -24,8 +24,8 @@ import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholde
|
||||
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { MetadataBrowseSettings } from '@/features/browse/Browse.types.ts';
|
||||
import { ServerSettings as GqlServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
import type { MetadataBrowseSettings } from '@/features/browse/Browse.types.ts';
|
||||
import type { ServerSettings as GqlServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ export function Sources({ tabsMenuHeight }: { tabsMenuHeight: number }) {
|
||||
[filteredSources],
|
||||
);
|
||||
const visibleSources = useMemo(
|
||||
() => sourcesByLanguage.map(([, sourcesOfLanguage]) => sourcesOfLanguage).flat(1),
|
||||
() => sourcesByLanguage.flatMap(([, sourcesOfLanguage]) => sourcesOfLanguage),
|
||||
[sourcesByLanguage],
|
||||
);
|
||||
|
||||
@@ -125,7 +125,9 @@ export function Sources({ tabsMenuHeight }: { tabsMenuHeight: number }) {
|
||||
[t, shownLangs, sourceLanguages, sourcesForLanguageFilter],
|
||||
);
|
||||
|
||||
if (isLoading) return <LoadingPlaceholder />;
|
||||
if (isLoading) {
|
||||
return <LoadingPlaceholder />;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
|
||||
@@ -19,7 +19,7 @@ import IconButton from '@mui/material/IconButton';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { SourceContentType } from '@/features/source/browse/screens/SourceMangas.tsx';
|
||||
import { GetSourcesListQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { GetSourcesListQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
|
||||
import { Sources } from '@/features/source/services/Sources.ts';
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { LibraryOptions } from '@/features/library/Library.types.ts';
|
||||
import { CategoryMetaType, CategoryType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { LibraryOptions } from '@/features/library/Library.types.ts';
|
||||
import type { CategoryMetaType, CategoryType } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
export interface ICategoryMetadata extends LibraryOptions {}
|
||||
export type ICategoryMetadata = LibraryOptions;
|
||||
|
||||
export type CategoryMetadataKeys = keyof ICategoryMetadata;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { IncludeOrExclude } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { CheckboxContainer } from '@/base/components/inputs/CheckboxContainer.ts';
|
||||
import {
|
||||
import type {
|
||||
CategoryDownloadInclusionInfo,
|
||||
CategoryIdInfo,
|
||||
CategoryNameInfo,
|
||||
|
||||
@@ -15,7 +15,7 @@ import Dialog from '@mui/material/Dialog';
|
||||
import FormGroup from '@mui/material/FormGroup';
|
||||
import { Link } from 'react-router-dom';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { AwaitableComponentProps } from 'awaitable-component';
|
||||
import type { AwaitableComponentProps } from 'awaitable-component';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { Mangas } from '@/features/manga/services/Mangas.ts';
|
||||
@@ -26,7 +26,7 @@ import { CheckboxInput } from '@/base/components/inputs/CheckboxInput.tsx';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { updateMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import {
|
||||
import type {
|
||||
GetCategoriesBaseQuery,
|
||||
GetCategoriesBaseQueryVariables,
|
||||
GetMangaCategoriesQuery,
|
||||
|
||||
@@ -17,7 +17,7 @@ import Typography from '@mui/material/Typography';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { CategoryType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { CategoryType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { ListCardContent } from '@/base/components/lists/cards/ListCardContent.tsx';
|
||||
|
||||
export const CategorySettingsCard = ({
|
||||
|
||||
@@ -17,7 +17,7 @@ import Checkbox from '@mui/material/Checkbox';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { CategoryDefaultInfo, CategoryIdInfo, CategoryNameInfo } from '@/features/category/Category.types.ts';
|
||||
import type { CategoryDefaultInfo, CategoryIdInfo, CategoryNameInfo } from '@/features/category/Category.types.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { assertIsDefined } from '@/base/Asserts.ts';
|
||||
|
||||
@@ -6,11 +6,13 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { ComponentProps, useMemo, useState } from 'react';
|
||||
import type { ComponentProps } from 'react';
|
||||
import { useMemo, useState } from 'react';
|
||||
import Fab from '@mui/material/Fab';
|
||||
import AddIcon from '@mui/icons-material/Add';
|
||||
import Box from '@mui/material/Box';
|
||||
import { closestCenter, DndContext, DragEndEvent } from '@dnd-kit/core';
|
||||
import type { DragEndEvent } from '@dnd-kit/core';
|
||||
import { closestCenter, DndContext } from '@dnd-kit/core';
|
||||
import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
@@ -18,10 +20,13 @@ import { DEFAULT_FULL_FAB_HEIGHT } from '@/base/components/buttons/StyledFab.tsx
|
||||
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { GetCategoriesSettingsQuery, GetCategoriesSettingsQueryVariables } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type {
|
||||
GetCategoriesSettingsQuery,
|
||||
GetCategoriesSettingsQueryVariables,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_CATEGORIES_SETTINGS } from '@/lib/graphql/category/CategoryQuery.ts';
|
||||
import { CategorySettingsCard } from '@/features/category/components/CategorySettingsCard.tsx';
|
||||
import { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import type { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import { getErrorMessage, noOp } from '@/lib/HelperFunctions.ts';
|
||||
import { DndSortableItem } from '@/lib/dnd-kit/DndSortableItem.tsx';
|
||||
import { DndKitUtil } from '@/lib/dnd-kit/DndKitUtil.ts';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { CategoryDefaultInfo, CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import type { CategoryDefaultInfo, CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
|
||||
export const DEFAULT_CATEGORY_ID = 0;
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ import {
|
||||
requestBatchCategoryMetadataUpdate,
|
||||
} from '@/features/metadata/services/MetadataUpdater.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { LibraryOptions } from '@/features/library/Library.types.ts';
|
||||
import { CategoryIdInfo, CategoryMetadataKeys, ICategoryMetadata } from '@/features/category/Category.types.ts';
|
||||
import type { LibraryOptions } from '@/features/library/Library.types.ts';
|
||||
import type { CategoryIdInfo, CategoryMetadataKeys, ICategoryMetadata } from '@/features/category/Category.types.ts';
|
||||
import { convertFromGqlMeta } from '@/features/metadata/services/MetadataConverter.ts';
|
||||
import { getMetadataFrom } from '@/features/metadata/services/MetadataReader.ts';
|
||||
import {
|
||||
import type {
|
||||
AllowedMetadataValueTypes,
|
||||
GqlMetaHolder,
|
||||
Metadata,
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { ChapterAction, ChapterListOptions, ChapterSortMode } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { ChapterAction, ChapterListOptions, ChapterSortMode } from '@/features/chapter/Chapter.types.ts';
|
||||
|
||||
export const FALLBACK_CHAPTER = { id: -1, name: '', realUrl: '', isDownloaded: false, isBookmarked: false };
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import {
|
||||
import type {
|
||||
ChapterReaderFieldsFragment,
|
||||
ChapterType,
|
||||
DownloadStatusFieldsFragment,
|
||||
|
||||
@@ -11,7 +11,7 @@ import PeopleAltOutlinedIcon from '@mui/icons-material/PeopleAltOutlined';
|
||||
import DisabledByDefaultRounded from '@mui/icons-material/DisabledByDefaultRounded';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { CheckboxListSetting } from '@/base/components/settings/CheckboxListSetting.tsx';
|
||||
import { updateChapterListOptions } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import type { updateChapterListOptions } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import { CheckboxInput } from '@/base/components/inputs/CheckboxInput.tsx';
|
||||
|
||||
export const ChapterExcludeSanlatorsFilter = ({
|
||||
|
||||
@@ -10,7 +10,8 @@ import Box from '@mui/material/Box';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { ComponentProps, useCallback, useMemo, useState } from 'react';
|
||||
import type { ComponentProps } from 'react';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { plural } from '@lingui/core/macro';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
@@ -24,7 +25,7 @@ import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewA
|
||||
import { ChaptersToolbarMenu } from '@/features/chapter/components/ChaptersToolbarMenu.tsx';
|
||||
import { SelectionFAB } from '@/base/collection/components/SelectionFAB.tsx';
|
||||
import { DEFAULT_FULL_FAB_HEIGHT } from '@/base/components/buttons/StyledFab.tsx';
|
||||
import {
|
||||
import type {
|
||||
ChapterListFieldsFragment,
|
||||
GetChaptersMangaQuery,
|
||||
GetChaptersMangaQueryVariables,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import RadioGroup from '@mui/material/RadioGroup';
|
||||
import React from 'react';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
@@ -16,8 +16,8 @@ import { SortRadioInput } from '@/base/components/inputs/SortRadioInput.tsx';
|
||||
import { ThreeStateCheckboxInput } from '@/base/components/inputs/ThreeStateCheckboxInput.tsx';
|
||||
import { OptionsTabs } from '@/base/components/modals/OptionsTabs.tsx';
|
||||
import { CHAPTER_SORT_OPTIONS_TO_TRANSLATION } from '@/features/chapter/Chapter.constants.ts';
|
||||
import { ChapterListOptions } from '@/features/chapter/Chapter.types.ts';
|
||||
import { updateChapterListOptions } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import type { ChapterListOptions } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { updateChapterListOptions } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import { ChapterExcludeSanlatorsFilter } from '@/features/chapter/components/ChapterExcludeSanlatorsFilter.tsx';
|
||||
|
||||
interface IProps {
|
||||
|
||||
@@ -17,8 +17,9 @@ import { useMemo } from 'react';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { ChapterOptions } from '@/features/chapter/components/ChapterOptions.tsx';
|
||||
import { isFilterActive, updateChapterListOptions } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import {
|
||||
import type { updateChapterListOptions } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import { isFilterActive } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import type {
|
||||
ChapterBookmarkInfo,
|
||||
ChapterDownloadInfo,
|
||||
ChapterIdInfo,
|
||||
|
||||
@@ -14,9 +14,10 @@ import Done from '@mui/icons-material/Done';
|
||||
import BookmarkRemove from '@mui/icons-material/BookmarkRemove';
|
||||
import BookmarkAdd from '@mui/icons-material/BookmarkAdd';
|
||||
import DoneAll from '@mui/icons-material/DoneAll';
|
||||
import { ComponentProps, useMemo } from 'react';
|
||||
import type { ComponentProps } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import type { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { MenuItem } from '@/base/components/menu/MenuItem.tsx';
|
||||
import {
|
||||
@@ -26,12 +27,12 @@ import {
|
||||
} from '@/base/components/menu/Menu.utils.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import { ChapterCard } from '@/features/chapter/components/cards/ChapterCard.tsx';
|
||||
import type { ChapterCard } from '@/features/chapter/components/cards/ChapterCard.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { GetChaptersMangaQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { GetChaptersMangaQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_CHAPTERS_MANGA } from '@/lib/graphql/chapter/ChapterQuery.ts';
|
||||
import { CHAPTER_ACTION_TO_TRANSLATION } from '@/features/chapter/Chapter.constants.ts';
|
||||
import {
|
||||
import type {
|
||||
ChapterAction,
|
||||
ChapterBookmarkInfo,
|
||||
ChapterDownloadInfo,
|
||||
|
||||
@@ -6,20 +6,19 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
import gql from 'graphql-tag';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import { Mangas } from '@/features/manga/services/Mangas.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import {
|
||||
ChapterOrderBy,
|
||||
import type {
|
||||
GetChaptersMangaQuery,
|
||||
GetChaptersMangaQueryVariables,
|
||||
MangaType,
|
||||
SortOrder,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { ChapterOrderBy, SortOrder } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { MANGA_META_FIELDS } from '@/lib/graphql/manga/MangaFragments.ts';
|
||||
import { getMangaMetadata } from '@/features/manga/services/MangaMetadata.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
|
||||
import { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
|
||||
export const ChapterDownloadButton = ({
|
||||
chapterId,
|
||||
|
||||
@@ -16,7 +16,7 @@ import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
|
||||
import { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
|
||||
export const ChapterDownloadRetryButton = ({ chapterId }: { chapterId: ChapterIdInfo['id'] }) => {
|
||||
const { t } = useLingui();
|
||||
|
||||
@@ -14,7 +14,8 @@ import Stack from '@mui/material/Stack';
|
||||
import Card from '@mui/material/Card';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import React, { memo, MouseEvent, TouchEvent, useRef } from 'react';
|
||||
import type { MouseEvent, TouchEvent } from 'react';
|
||||
import React, { memo, useRef } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import PopupState, { bindMenu, bindTrigger } from 'material-ui-popup-state';
|
||||
import { useLongPress } from 'use-long-press';
|
||||
@@ -22,7 +23,7 @@ import { useLingui } from '@lingui/react/macro';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { getDateString } from '@/base/utils/DateHelper.ts';
|
||||
import { DownloadStateIndicator } from '@/base/components/downloads/DownloadStateIndicator.tsx';
|
||||
import { ChapterType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { ChapterType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { ChapterActionMenuItems } from '@/features/chapter/components/actions/ChapterActionMenuItems.tsx';
|
||||
import { Menu } from '@/base/components/menu/Menu.tsx';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
@@ -30,7 +31,7 @@ import { applyStyles } from '@/base/utils/ApplyStyles.ts';
|
||||
import { ChapterCardMetadata } from '@/features/chapter/components/cards/ChapterCardMetadata.tsx';
|
||||
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
|
||||
import { ListCardContent } from '@/base/components/lists/cards/ListCardContent.tsx';
|
||||
import {
|
||||
import type {
|
||||
ChapterBookmarkInfo,
|
||||
ChapterDownloadInfo,
|
||||
ChapterIdInfo,
|
||||
@@ -60,6 +61,15 @@ interface IProps {
|
||||
isActiveChapter?: boolean; // reader
|
||||
}
|
||||
|
||||
const handleClickOpenMenu = (
|
||||
event: React.MouseEvent | React.TouchEvent,
|
||||
openMenu?: (e: React.SyntheticEvent) => void,
|
||||
) => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
openMenu?.(event);
|
||||
};
|
||||
|
||||
export const ChapterCard = memo((props: IProps) => {
|
||||
const { t } = useLingui();
|
||||
const theme = useTheme();
|
||||
@@ -81,22 +91,15 @@ export const ChapterCard = memo((props: IProps) => {
|
||||
const { isDownloaded } = chapter;
|
||||
|
||||
const handleClick = (event: MouseEvent | TouchEvent) => {
|
||||
if (!isSelecting) return;
|
||||
if (!isSelecting) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
onSelect(chapter.id, !selected, event.shiftKey);
|
||||
};
|
||||
|
||||
const handleClickOpenMenu = (
|
||||
event: React.MouseEvent | React.TouchEvent,
|
||||
openMenu?: (e: React.SyntheticEvent) => void,
|
||||
) => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
openMenu?.(event);
|
||||
};
|
||||
|
||||
const longPressBind = useLongPress((event, { context: openMenu }) => {
|
||||
if (!isSelecting && !!menuButtonRef.current) {
|
||||
handleClickOpenMenu(event, () => (openMenu as (event: Element) => void)?.(menuButtonRef.current!));
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import Box from '@mui/material/Box';
|
||||
import { ComponentProps, ReactNode } from 'react';
|
||||
import type { ComponentProps, ReactNode } from 'react';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { TypographyMaxLines } from '@/base/components/texts/TypographyMaxLines.tsx';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { Mangas } from '@/features/manga/services/Mangas.ts';
|
||||
import { MangaIdInfo, MangaThumbnailInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { MangaIdInfo, MangaThumbnailInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { ListCardAvatar } from '@/base/components/lists/cards/ListCardAvatar.tsx';
|
||||
|
||||
export const ChapterCardThumbnail = ({
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { ComponentProps } from 'react';
|
||||
import type { ComponentProps } from 'react';
|
||||
import { ChapterCard } from '@/features/chapter/components/cards/ChapterCard.tsx';
|
||||
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
|
||||
@@ -6,22 +6,23 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { DocumentNode, MaybeMasked, Unmasked } from '@apollo/client';
|
||||
import type { DocumentNode, MaybeMasked, Unmasked } from '@apollo/client';
|
||||
import { useFragment } from '@apollo/client/react';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { getMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import {
|
||||
import type {
|
||||
ChapterListFieldsFragment,
|
||||
ChapterType,
|
||||
DownloadState,
|
||||
DownloadTypeFieldsFragment,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { DownloadState } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { CHAPTER_LIST_FIELDS } from '@/lib/graphql/chapter/ChapterFragments.ts';
|
||||
import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
|
||||
import { ReaderOpenChapterLocationState, ReaderResumeMode } from '@/features/reader/Reader.types.ts';
|
||||
import type { ReaderOpenChapterLocationState } from '@/features/reader/Reader.types.ts';
|
||||
import { ReaderResumeMode } from '@/features/reader/Reader.types.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { DOWNLOAD_TYPE_FIELDS } from '@/lib/graphql/download/DownloadFragments.ts';
|
||||
@@ -30,7 +31,7 @@ import {
|
||||
CHAPTER_ACTION_TO_CONFIRMATION_REQUIRED,
|
||||
CHAPTER_ACTION_TO_TRANSLATION,
|
||||
} from '@/features/chapter/Chapter.constants.ts';
|
||||
import {
|
||||
import type {
|
||||
ChapterAction,
|
||||
ChapterBookmarkInfo,
|
||||
ChapterDownloadInfo,
|
||||
@@ -355,9 +356,9 @@ export class Chapters {
|
||||
): T[] {
|
||||
const chapterNumberToChapters = Object.groupBy(allChapters, ({ chapterNumber }) => chapterNumber);
|
||||
|
||||
return uniqueChapters
|
||||
.map((uniqueChapter) => chapterNumberToChapters[uniqueChapter.chapterNumber] ?? [uniqueChapter])
|
||||
.flat();
|
||||
return uniqueChapters.flatMap(
|
||||
(uniqueChapter) => chapterNumberToChapters[uniqueChapter.chapterNumber] ?? [uniqueChapter],
|
||||
);
|
||||
}
|
||||
|
||||
static removeDuplicates<T extends ChapterIdInfo & ChapterScanlatorInfo & ChapterNumberInfo>(
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
*/
|
||||
|
||||
import { useMemo } from 'react';
|
||||
import { ChapterType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import {
|
||||
import type { ChapterType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type {
|
||||
ChapterBookmarkInfo,
|
||||
ChapterDownloadInfo,
|
||||
ChapterListOptions,
|
||||
ChapterReadInfo,
|
||||
ChapterScanlatorInfo,
|
||||
} from '@/features/chapter/Chapter.types.ts';
|
||||
import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { GqlMetaHolder } from '@/features/metadata/Metadata.types.ts';
|
||||
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { GqlMetaHolder } from '@/features/metadata/Metadata.types.ts';
|
||||
import { createUpdateMangaMetadata, useGetMangaMetadata } from '@/features/manga/services/MangaMetadata.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import React, { ReactNode, useContext, useMemo } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import React, { useContext, useMemo } from 'react';
|
||||
import { DEFAULT_DEVICE, setActiveDevice } from '@/features/device/services/Device.ts';
|
||||
import { useLocalStorage } from '@/base/hooks/useStorage.tsx';
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholde
|
||||
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { DEFAULT_DEVICE } from '@/features/device/services/Device.ts';
|
||||
import { MetadataServerSettingKeys, MetadataServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
import type { MetadataServerSettingKeys, MetadataServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
|
||||
|
||||
|
||||
@@ -8,11 +8,8 @@
|
||||
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import {
|
||||
SelectSetting,
|
||||
SelectSettingValue,
|
||||
SelectSettingValueDisplayInfo,
|
||||
} from '@/base/components/settings/SelectSetting.tsx';
|
||||
import type { SelectSettingValue, SelectSettingValueDisplayInfo } from '@/base/components/settings/SelectSetting.tsx';
|
||||
import { SelectSetting } from '@/base/components/settings/SelectSetting.tsx';
|
||||
|
||||
const CHAPTERS_TO_DELETE = [0, 1, 2, 3, 4, 5] as const;
|
||||
const CHAPTERS_TO_DELETE_TO_TRANSLATION: {
|
||||
|
||||
@@ -16,8 +16,8 @@ import { NumberSetting } from '@/base/components/settings/NumberSetting.tsx';
|
||||
import { getPersistedServerSetting, usePersistedValue } from '@/base/hooks/usePersistedValue.tsx';
|
||||
import { updateMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { MetadataDownloadSettings } from '@/features/downloads/Downloads.types.ts';
|
||||
import { MetadataServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
import type { MetadataDownloadSettings } from '@/features/downloads/Downloads.types.ts';
|
||||
import type { MetadataServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { DOWNLOAD_AHEAD } from '@/features/downloads/Downloads.constants.ts';
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { DownloaderState } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { ChapterDownloadStatus, ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { ChapterDownloadStatus, ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
|
||||
|
||||
export const DownloadQueueChapterCard = memo(
|
||||
|
||||
@@ -12,7 +12,8 @@ import Box from '@mui/material/Box';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import DeleteSweepIcon from '@mui/icons-material/DeleteSweep';
|
||||
import { closestCenter, DndContext, DragEndEvent } from '@dnd-kit/core';
|
||||
import type { DragEndEvent } from '@dnd-kit/core';
|
||||
import { closestCenter, DndContext } from '@dnd-kit/core';
|
||||
import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
||||
import { useWindowEvent } from '@mantine/hooks';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
@@ -30,7 +31,7 @@ import { DndOverlayItem } from '@/lib/dnd-kit/DndOverlayItem.tsx';
|
||||
import { DownloadQueueChapterCard } from '@/features/downloads/components/DownloadQueueChapterCard.tsx';
|
||||
import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
|
||||
import { useAppAction } from '@/features/navigation-bar/hooks/useAppAction.ts';
|
||||
import { ChapterDownloadStatus } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { ChapterDownloadStatus } from '@/features/chapter/Chapter.types.ts';
|
||||
import { VirtuosoPersisted } from '@/lib/virtuoso/Component/VirtuosoPersisted.tsx';
|
||||
|
||||
export const DownloadQueue: React.FC = () => {
|
||||
|
||||
@@ -27,10 +27,13 @@ import { NumberSetting } from '@/base/components/settings/NumberSetting.tsx';
|
||||
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { GetCategoriesSettingsQuery, GetCategoriesSettingsQueryVariables } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type {
|
||||
GetCategoriesSettingsQuery,
|
||||
GetCategoriesSettingsQueryVariables,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_CATEGORIES_SETTINGS } from '@/lib/graphql/category/CategoryQuery.ts';
|
||||
import { MetadataDownloadSettings } from '@/features/downloads/Downloads.types.ts';
|
||||
import { ServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
import type { MetadataDownloadSettings } from '@/features/downloads/Downloads.types.ts';
|
||||
import type { ServerSettings } from '@/features/settings/Settings.types.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
|
||||
import { ListItemLink } from '@/base/components/lists/ListItemLink.tsx';
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import type { InstalledStates } from '@/features/extension/Extensions.types.ts';
|
||||
import {
|
||||
ExtensionAction,
|
||||
ExtensionGroupState,
|
||||
ExtensionState,
|
||||
InstalledState,
|
||||
InstalledStates,
|
||||
} from '@/features/extension/Extensions.types.ts';
|
||||
import { DefaultLanguage } from '@/base/utils/Languages.ts';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { ExtensionType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { ExtensionType } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
export enum ExtensionAction {
|
||||
UPDATE = 'UPDATE',
|
||||
|
||||
@@ -6,14 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import {
|
||||
ExtensionAction,
|
||||
ExtensionGroupState,
|
||||
ExtensionState,
|
||||
GroupedExtensionsResult,
|
||||
InstalledState,
|
||||
TExtension,
|
||||
} from '@/features/extension/Extensions.types.ts';
|
||||
import type { ExtensionState, GroupedExtensionsResult, TExtension } from '@/features/extension/Extensions.types.ts';
|
||||
import { ExtensionAction, ExtensionGroupState, InstalledState } from '@/features/extension/Extensions.types.ts';
|
||||
import {
|
||||
DefaultLanguage,
|
||||
languageCodeToName,
|
||||
|
||||
@@ -13,7 +13,8 @@ import { INSTALLED_STATE_TO_TRANSLATION_MAP } from '@/features/extension/Extensi
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { getInstalledState, updateExtension } from '@/features/extension/Extensions.utils.ts';
|
||||
import { useBackButton } from '@/base/hooks/useBackButton.ts';
|
||||
import { ExtensionAction, InstalledState, TExtension } from '@/features/extension/Extensions.types.ts';
|
||||
import type { TExtension } from '@/features/extension/Extensions.types.ts';
|
||||
import { ExtensionAction, InstalledState } from '@/features/extension/Extensions.types.ts';
|
||||
|
||||
export const ActionButton = ({ pkgName, isInstalled, isObsolete, hasUpdate }: TExtension) => {
|
||||
const handleBack = useBackButton();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { ComponentProps } from 'react';
|
||||
import type { ComponentProps } from 'react';
|
||||
import Divider from '@mui/material/Divider';
|
||||
import { Metadata } from '@/base/components/texts/Metadata.tsx';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import Stack from '@mui/material/Stack';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { SpinnerImage } from '@/base/components/SpinnerImage.tsx';
|
||||
import { TExtension } from '@/features/extension/Extensions.types.ts';
|
||||
import type { TExtension } from '@/features/extension/Extensions.types.ts';
|
||||
|
||||
export const Header = ({ name, pkgName, iconUrl, repo }: TExtension) => (
|
||||
<Stack sx={{ alignItems: 'center' }}>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { TExtension } from '@/features/extension/Extensions.types.ts';
|
||||
import type { TExtension } from '@/features/extension/Extensions.types.ts';
|
||||
import { ExtensionMetadata } from '@/features/extension/info/components/ExtensionMetadata.tsx';
|
||||
import { languageCodeToName } from '@/base/utils/Languages.ts';
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import { StyledGroupItemWrapper } from '@/base/components/virtuoso/StyledGroupIt
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { createUpdateSourceMetadata, useGetSourceMetadata } from '@/features/source/services/SourceMetadata.ts';
|
||||
import { SourceConfigurableInfo, SourceIdInfo, SourceLanguageInfo } from '@/features/source/Source.types.ts';
|
||||
import type { SourceConfigurableInfo, SourceIdInfo, SourceLanguageInfo } from '@/features/source/Source.types.ts';
|
||||
|
||||
export const SourceCard = (source: SourceIdInfo & SourceLanguageInfo & SourceConfigurableInfo) => {
|
||||
const { id, isConfigurable } = source;
|
||||
|
||||
@@ -26,7 +26,7 @@ import { useLingui } from '@lingui/react/macro';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { AppbarSearch } from '@/base/components/AppbarSearch.tsx';
|
||||
import { useDebounce } from '@/base/hooks/useDebounce.ts';
|
||||
import { MangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import { EmptyView } from '@/base/components/feedback/EmptyView.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
|
||||
@@ -36,7 +36,7 @@ import { translateExtensionLanguage } from '@/features/extension/Extensions.util
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { Sources } from '@/features/source/services/Sources.ts';
|
||||
import {
|
||||
import type {
|
||||
SourceDisplayNameInfo,
|
||||
SourceIdInfo,
|
||||
SourceLanguageInfo,
|
||||
@@ -52,7 +52,7 @@ import { getSourceMetadata } from '@/features/source/services/SourceMetadata.ts'
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
|
||||
import { MetadataBrowseSettings } from '@/features/browse/Browse.types.ts';
|
||||
import type { MetadataBrowseSettings } from '@/features/browse/Browse.types.ts';
|
||||
import { SourceLanguageSelect } from '@/features/source/components/SourceLanguageSelect.tsx';
|
||||
import { SearchParam } from '@/base/Base.types.ts';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import Card from '@mui/material/Card';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { memo } from 'react';
|
||||
import { DownloadStateIndicator } from '@/base/components/downloads/DownloadStateIndicator.tsx';
|
||||
import { ChapterHistoryListFieldsFragment } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { ChapterHistoryListFieldsFragment } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { epochToDate, timeFormatter } from '@/base/utils/DateHelper.ts';
|
||||
|
||||
@@ -20,7 +20,7 @@ import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewA
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { MetadataHistorySettings } from '@/features/history/History.types.ts';
|
||||
import type { MetadataHistorySettings } from '@/features/history/History.types.ts';
|
||||
import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
|
||||
|
||||
export const HistorySettings = () => {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { HotkeysProvider } from 'react-hotkeys-hook';
|
||||
import { ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { HotkeyScope } from '@/features/hotkeys/Hotkeys.types.ts';
|
||||
|
||||
export const AppHotkeysProvider = ({ children }: { children?: ReactNode }) => (
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MangaStatus, MangaType, TrackerType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GridLayout } from '@/base/Base.types.ts';
|
||||
import type { MangaStatus, MangaType, TrackerType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { GridLayout } from '@/base/Base.types.ts';
|
||||
|
||||
export type MetadataLibrarySettings = {
|
||||
showAddToLibraryCategorySelectDialog: boolean;
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
import React, { useLayoutEffect } from 'react';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { IMangaGridProps, MangaGrid } from '@/features/manga/components/MangaGrid.tsx';
|
||||
import type { IMangaGridProps } from '@/features/manga/components/MangaGrid.tsx';
|
||||
import { MangaGrid } from '@/features/manga/components/MangaGrid.tsx';
|
||||
import { GridLayout } from '@/base/Base.types.ts';
|
||||
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import FormLabel from '@mui/material/FormLabel';
|
||||
import RadioGroup from '@mui/material/RadioGroup';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
@@ -18,7 +18,8 @@ import { ThreeStateCheckboxInput } from '@/base/components/inputs/ThreeStateChec
|
||||
import { OptionsTabs } from '@/base/components/modals/OptionsTabs.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { Trackers } from '@/features/tracker/services/Trackers.ts';
|
||||
import { GetTrackersSettingsQuery, MangaStatus } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { GetTrackersSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { MangaStatus } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_TRACKERS_SETTINGS } from '@/lib/graphql/tracker/TrackerQuery.ts';
|
||||
import { createUpdateCategoryMetadata, useGetCategoryMetadata } from '@/features/category/services/CategoryMetadata.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
@@ -27,8 +28,8 @@ import {
|
||||
updateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import { LibrarySortMode } from '@/features/library/Library.types.ts';
|
||||
import { CategoryMetadataInfo } from '@/features/category/Category.types.ts';
|
||||
import type { LibrarySortMode } from '@/features/library/Library.types.ts';
|
||||
import type { CategoryMetadataInfo } from '@/features/category/Category.types.ts';
|
||||
import { MANGA_STATUS_TO_TRANSLATION } from '@/features/manga/Manga.constants.ts';
|
||||
import { GridLayout } from '@/base/Base.types';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
import FilterList from '@mui/icons-material/FilterList';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import { ComponentProps, useState } from 'react';
|
||||
import type { ComponentProps } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { LibraryOptionsPanel } from '@/features/library/components/LibraryOptionsPanel.tsx';
|
||||
|
||||
@@ -9,19 +9,19 @@
|
||||
import { StringParam, useQueryParam } from 'use-query-params';
|
||||
import { useMemo } from 'react';
|
||||
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import { ChapterType, MangaType, TrackRecordType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { ChapterType, MangaType, TrackRecordType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { enhancedCleanup } from '@/base/utils/Strings.ts';
|
||||
import { useGetCategoryMetadata } from '@/features/category/services/CategoryMetadata.ts';
|
||||
import { LibraryOptions, LibrarySortMode } from '@/features/library/Library.types.ts';
|
||||
import { CategoryIdInfo, CategoryMetadataInfo } from '@/features/category/Category.types.ts';
|
||||
import {
|
||||
import type { LibraryOptions, LibrarySortMode } from '@/features/library/Library.types.ts';
|
||||
import type { CategoryIdInfo, CategoryMetadataInfo } from '@/features/category/Category.types.ts';
|
||||
import type {
|
||||
MangaChapterCountInfo,
|
||||
MangaDownloadInfo,
|
||||
MangaIdInfo,
|
||||
MangaStatusInfo,
|
||||
MangaUnreadInfo,
|
||||
} from '@/features/manga/Manga.types.ts';
|
||||
import { SourceDisplayNameInfo } from '@/features/source/Source.types.ts';
|
||||
import type { SourceDisplayNameInfo } from '@/features/source/Source.types.ts';
|
||||
import { SearchParam } from '@/base/Base.types.ts';
|
||||
|
||||
const triStateFilter = (
|
||||
@@ -60,7 +60,9 @@ const performSearch = (
|
||||
const actualQueries = queries?.filter((query) => query != null);
|
||||
const actualStrings = strings?.filter((str) => str != null);
|
||||
|
||||
if (!actualQueries?.length) return true;
|
||||
if (!actualQueries?.length) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const cleanedUpQueries = actualQueries.map(enhancedCleanup);
|
||||
const cleanedUpStrings = actualStrings.map(enhancedCleanup).join(', ');
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import Chip, { ChipProps } from '@mui/material/Chip';
|
||||
import type { ChipProps } from '@mui/material/Chip';
|
||||
import Chip from '@mui/material/Chip';
|
||||
import Tab from '@mui/material/Tab';
|
||||
import { styled, useTheme } from '@mui/material/styles';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
@@ -32,7 +33,7 @@ import { MangaActionMenuItems } from '@/features/manga/components/MangaActionMen
|
||||
import { TabsMenu } from '@/base/components/tabs/TabsMenu.tsx';
|
||||
import { TabsWrapper } from '@/base/components/tabs/TabsWrapper.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import {
|
||||
import type {
|
||||
GetCategoriesLibraryQuery,
|
||||
GetCategoriesLibraryQueryVariables,
|
||||
GetLibraryMangaCountQuery,
|
||||
|
||||
@@ -25,13 +25,17 @@ import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts'
|
||||
import { MangaCard } from '@/features/manga/components/cards/MangaCard.tsx';
|
||||
import { StyledGroupedVirtuoso } from '@/base/components/virtuoso/StyledGroupedVirtuoso.tsx';
|
||||
import { StyledGroupHeader } from '@/base/components/virtuoso/StyledGroupHeader.tsx';
|
||||
import { GetMangasDuplicatesQuery, GetMangasDuplicatesQueryVariables } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { GetMangasDuplicatesQuery, GetMangasDuplicatesQueryVariables } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_MANGAS_DUPLICATES } from '@/lib/graphql/manga/MangaQuery.ts';
|
||||
import { BaseMangaGrid } from '@/features/manga/components/BaseMangaGrid.tsx';
|
||||
import { IMangaGridProps } from '@/features/manga/components/MangaGrid.tsx';
|
||||
import type { IMangaGridProps } from '@/features/manga/components/MangaGrid.tsx';
|
||||
import { StyledGroupItemWrapper } from '@/base/components/virtuoso/StyledGroupItemWrapper.tsx';
|
||||
import { VirtuosoUtil } from '@/lib/virtuoso/Virtuoso.util.tsx';
|
||||
import { LibraryDuplicatesWorkerInput, TMangaDuplicate, TMangaDuplicates } from '@/features/library/Library.types.ts';
|
||||
import type {
|
||||
LibraryDuplicatesWorkerInput,
|
||||
TMangaDuplicate,
|
||||
TMangaDuplicates,
|
||||
} from '@/features/library/Library.types.ts';
|
||||
import { GridLayout } from '@/base/Base.types.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { useAppTitleAndAction } from '@/features/navigation-bar/hooks/useAppTitleAndAction.ts';
|
||||
@@ -105,10 +109,7 @@ export const LibraryDuplicates = () => {
|
||||
() => Object.keys(mangasByTitle).toSorted((titleA, titleB) => titleA.localeCompare(titleB)),
|
||||
[mangasByTitle],
|
||||
);
|
||||
const duplicatedMangas = useMemo(
|
||||
() => duplicatedTitles.map((title) => mangasByTitle[title]).flat(),
|
||||
[mangasByTitle],
|
||||
);
|
||||
const duplicatedMangas = useMemo(() => duplicatedTitles.flatMap((title) => mangasByTitle[title]), [mangasByTitle]);
|
||||
const mangasCountByTitle = useMemo(
|
||||
() => duplicatedTitles.map((title) => mangasByTitle[title]).map((mangas) => mangas.length),
|
||||
[mangasByTitle],
|
||||
|
||||
@@ -26,7 +26,7 @@ import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewA
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
|
||||
import { ListItemLink } from '@/base/components/lists/ListItemLink.tsx';
|
||||
import {
|
||||
import type {
|
||||
GetCategoriesSettingsQuery,
|
||||
GetCategoriesSettingsQueryVariables,
|
||||
GetMangasBaseQuery,
|
||||
@@ -34,7 +34,7 @@ import {
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_CATEGORIES_SETTINGS } from '@/lib/graphql/category/CategoryQuery.ts';
|
||||
import { GET_MANGAS_BASE } from '@/lib/graphql/manga/MangaQuery.ts';
|
||||
import { MetadataLibrarySettings } from '@/features/library/Library.types.ts';
|
||||
import type { MetadataLibrarySettings } from '@/features/library/Library.types.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { enhancedCleanup } from '@/base/utils/Strings.ts';
|
||||
import { TMangaDuplicate, TMangaDuplicateResult, TMangaDuplicates } from '@/features/library/Library.types.ts';
|
||||
import type { TMangaDuplicate, TMangaDuplicateResult, TMangaDuplicates } from '@/features/library/Library.types.ts';
|
||||
|
||||
export const findDuplicatesByTitle = <Manga extends Pick<MangaType, 'title'>>(
|
||||
libraryMangas: Manga[],
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { findDuplicatesByTitleAndAlternativeTitles } from '@/features/library/util/LibraryDuplicates.util.ts';
|
||||
import { LibraryDuplicatesDescriptionWorkerInput } from '@/features/library/Library.types.ts';
|
||||
import type { LibraryDuplicatesDescriptionWorkerInput } from '@/features/library/Library.types.ts';
|
||||
|
||||
self.onmessage = (event: MessageEvent<LibraryDuplicatesDescriptionWorkerInput>) => {
|
||||
const { mangasToCheck, mangas } = event.data;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { findDuplicatesByTitle } from '@/features/library/util/LibraryDuplicates.util.ts';
|
||||
import {
|
||||
import type {
|
||||
LibraryDuplicatesDescriptionWorkerInput,
|
||||
LibraryDuplicatesWorkerInput,
|
||||
TMangaDuplicate,
|
||||
|
||||
@@ -6,15 +6,16 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { MangaStatus } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { MangaAction, MangaIdInfo, MangaType } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaAction, MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { MangaType } from '@/features/manga/Manga.types.ts';
|
||||
import {
|
||||
CHAPTER_ACTION_TO_CONFIRMATION_REQUIRED,
|
||||
CHAPTER_ACTION_TO_TRANSLATION,
|
||||
} from '@/features/chapter/Chapter.constants.ts';
|
||||
import { GqlMetaHolder } from '@/features/metadata/Metadata.types.ts';
|
||||
import type { GqlMetaHolder } from '@/features/metadata/Metadata.types.ts';
|
||||
|
||||
export const FALLBACK_MANGA: MangaIdInfo & GqlMetaHolder = { id: -1 };
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { LongPressPointerHandlers, LongPressResult } from 'use-long-press';
|
||||
import { PopupState } from 'material-ui-popup-state/hooks';
|
||||
import type { LongPressPointerHandlers, LongPressResult } from 'use-long-press';
|
||||
import type { PopupState } from 'material-ui-popup-state/hooks';
|
||||
import type { JSX } from 'react';
|
||||
import { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import { useManageMangaLibraryState } from '@/features/manga/hooks/useManageMangaLibraryState.tsx';
|
||||
import {
|
||||
import type { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import type { useManageMangaLibraryState } from '@/features/manga/hooks/useManageMangaLibraryState.tsx';
|
||||
import type {
|
||||
ChapterType,
|
||||
MangaReaderFieldsFragment,
|
||||
MangaType as MangaTypeGql,
|
||||
@@ -19,9 +19,9 @@ import {
|
||||
SourceType,
|
||||
TrackRecordType,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { SingleModeProps } from '@/features/manga/components/MangaActionMenuItems.tsx';
|
||||
import { GridLayout } from '@/base/Base.types.ts';
|
||||
import { ChapterListOptions } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { SingleModeProps } from '@/features/manga/components/MangaActionMenuItems.tsx';
|
||||
import type { GridLayout } from '@/base/Base.types.ts';
|
||||
import type { ChapterListOptions } from '@/features/chapter/Chapter.types.ts';
|
||||
|
||||
export type MangaCardMode = 'default' | 'source' | 'migrate.search' | 'migrate.select' | 'duplicate';
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MangaGrid, IMangaGridProps } from '@/features/manga/components/MangaGrid.tsx';
|
||||
import type { IMangaGridProps } from '@/features/manga/components/MangaGrid.tsx';
|
||||
import { MangaGrid } from '@/features/manga/components/MangaGrid.tsx';
|
||||
|
||||
type TMangaBaseGrid = Omit<IMangaGridProps['mangas'][number], 'downloadCount' | 'unreadCount' | 'chapters'>;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import PlayArrowIcon from '@mui/icons-material/PlayArrow';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
|
||||
import {
|
||||
import type {
|
||||
ChapterNameInfo,
|
||||
ChapterNumberInfo,
|
||||
ChapterReadInfo,
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { ReactElement } from 'react';
|
||||
import type { ReactElement } from 'react';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip';
|
||||
import {
|
||||
import type {
|
||||
ChapterNameInfo,
|
||||
ChapterNumberInfo,
|
||||
ChapterScanlatorInfo,
|
||||
|
||||
@@ -21,7 +21,7 @@ import Dialog from '@mui/material/Dialog';
|
||||
import { AwaitableComponent } from 'awaitable-component';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { Mangas } from '@/features/manga/services/Mangas.ts';
|
||||
import { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import type { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import { MenuItem } from '@/base/components/menu/MenuItem.tsx';
|
||||
import {
|
||||
createGetMenuItemTitle,
|
||||
@@ -32,8 +32,8 @@ import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts'
|
||||
import { TrackManga } from '@/features/tracker/components/TrackManga.tsx';
|
||||
import { ChaptersDownloadActionMenuItems } from '@/features/chapter/components/actions/ChaptersDownloadActionMenuItems.tsx';
|
||||
import { NestedMenuItem } from '@/base/components/menu/NestedMenuItem.tsx';
|
||||
import { MangaChapterStatFieldsFragment, MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { MangaAction, MangaDownloadInfo, MangaIdInfo, MangaUnreadInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaChapterStatFieldsFragment, MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { MangaAction, MangaDownloadInfo, MangaIdInfo, MangaUnreadInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { MANGA_ACTION_TO_TRANSLATION } from '@/features/manga/Manga.constants.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { CategorySelect } from '@/features/category/components/CategorySelect.tsx';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { styled } from '@mui/material/styles';
|
||||
import Button from '@mui/material/Button';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { MangaCardMode } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaCardMode } from '@/features/manga/Manga.types.ts';
|
||||
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
|
||||
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
|
||||
|
||||
@@ -6,18 +6,29 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import React, { ForwardedRef, Ref, useCallback, useLayoutEffect, useMemo, useRef, useState, type JSX } from 'react';
|
||||
import Grid, { GridTypeMap } from '@mui/material/Grid';
|
||||
import Box, { BoxProps } from '@mui/material/Box';
|
||||
import { GridItemProps } from 'react-virtuoso';
|
||||
import React, {
|
||||
useCallback,
|
||||
useLayoutEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
type ForwardedRef,
|
||||
type Ref,
|
||||
type JSX,
|
||||
} from 'react';
|
||||
import type { GridTypeMap } from '@mui/material/Grid';
|
||||
import Grid from '@mui/material/Grid';
|
||||
import type { BoxProps } from '@mui/material/Box';
|
||||
import Box from '@mui/material/Box';
|
||||
import type { GridItemProps } from 'react-virtuoso';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
|
||||
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
|
||||
import { MangaCard } from '@/features/manga/components/cards/MangaCard.tsx';
|
||||
import { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import type { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import { DEFAULT_FULL_FAB_HEIGHT } from '@/base/components/buttons/StyledFab.tsx';
|
||||
import { MangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { MangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { useResizeObserver } from '@/base/hooks/useResizeObserver.tsx';
|
||||
import { useNavBarContext } from '@/features/navigation-bar/NavbarContext.tsx';
|
||||
import { GridLayout } from '@/base/Base.types.ts';
|
||||
|
||||
@@ -6,19 +6,25 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { BaseSyntheticEvent, ChangeEvent, useMemo, ForwardedRef } from 'react';
|
||||
import type { BaseSyntheticEvent, ChangeEvent, ForwardedRef } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import Button from '@mui/material/Button';
|
||||
import Checkbox from '@mui/material/Checkbox';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
||||
import { PopupState } from 'material-ui-popup-state/hooks';
|
||||
import type { PopupState } from 'material-ui-popup-state/hooks';
|
||||
import { bindTrigger } from 'material-ui-popup-state';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
|
||||
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
|
||||
|
||||
const preventDefaultAction = (e: BaseSyntheticEvent) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
export const MangaOptionButton = ({
|
||||
id,
|
||||
selected,
|
||||
@@ -38,11 +44,6 @@ export const MangaOptionButton = ({
|
||||
|
||||
const bindTriggerProps = useMemo(() => bindTrigger(popupState), [popupState]);
|
||||
|
||||
const preventDefaultAction = (e: BaseSyntheticEvent) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
const handleSelectionChange = (e: ChangeEvent, isSelected: boolean) => {
|
||||
preventDefaultAction(e);
|
||||
handleSelection?.(id, isSelected);
|
||||
|
||||
@@ -23,7 +23,7 @@ import { AwaitableComponent } from 'awaitable-component';
|
||||
import ColorLensIcon from '@mui/icons-material/ColorLens';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { CategorySelect } from '@/features/category/components/CategorySelect.tsx';
|
||||
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
|
||||
@@ -11,7 +11,7 @@ import PlayArrow from '@mui/icons-material/PlayArrow';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { StyledFab } from '@/base/components/buttons/StyledFab.tsx';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import {
|
||||
import type {
|
||||
ChapterMangaInfo,
|
||||
ChapterNameInfo,
|
||||
ChapterNumberInfo,
|
||||
|
||||
@@ -18,9 +18,9 @@ import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { TrackManga } from '@/features/tracker/components/TrackManga.tsx';
|
||||
import { Trackers } from '@/features/tracker/services/Trackers.ts';
|
||||
import { CustomButton } from '@/base/components/buttons/CustomButton.tsx';
|
||||
import { GetTrackersSettingsQuery, MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { GetTrackersSettingsQuery, MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_TRACKERS_SETTINGS } from '@/lib/graphql/tracker/TrackerQuery.ts';
|
||||
import { MangaTrackRecordInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaTrackRecordInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
|
||||
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
import PopupState, { bindMenu } from 'material-ui-popup-state';
|
||||
import { memo, useCallback, useMemo, useState } from 'react';
|
||||
import { useLongPress } from 'use-long-press';
|
||||
import { MangaActionMenuItems, SingleModeProps } from '@/features/manga/components/MangaActionMenuItems.tsx';
|
||||
import type { SingleModeProps } from '@/features/manga/components/MangaActionMenuItems.tsx';
|
||||
import { MangaActionMenuItems } from '@/features/manga/components/MangaActionMenuItems.tsx';
|
||||
import { Menu } from '@/base/components/menu/Menu.tsx';
|
||||
import { MigrateDialog } from '@/features/migration/components/MigrateDialog.tsx';
|
||||
import { useManageMangaLibraryState } from '@/features/manga/hooks/useManageMangaLibraryState.tsx';
|
||||
import { MangaGridCard } from '@/features/manga/components/cards/MangaGridCard.tsx';
|
||||
import { MangaListCard } from '@/features/manga/components/cards/MangaListCard.tsx';
|
||||
import { MangaCardMode, MangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaCardMode, MangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import { ContinueReadingButton } from '@/features/manga/components/ContinueReadingButton.tsx';
|
||||
import { MangaBadges } from '@/features/manga/components/MangaBadges.tsx';
|
||||
import { GridLayout } from '@/base/Base.types.ts';
|
||||
@@ -98,7 +99,7 @@ export const MangaCard = memo((props: MangaCardProps) => {
|
||||
(e: any, { context }: any) => {
|
||||
// oxlint-disable-next-line no-param-reassign
|
||||
e.shiftKey = true;
|
||||
handleClick(e, context as () => {});
|
||||
handleClick(e, context as () => void);
|
||||
},
|
||||
[handleClick],
|
||||
),
|
||||
|
||||
@@ -18,7 +18,7 @@ import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { SpinnerImage } from '@/base/components/SpinnerImage.tsx';
|
||||
import { MangaOptionButton } from '@/features/manga/components/MangaOptionButton.tsx';
|
||||
import { Mangas } from '@/features/manga/services/Mangas.ts';
|
||||
import { SpecificMangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import type { SpecificMangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import { TypographyMaxLines } from '@/base/components/texts/TypographyMaxLines.tsx';
|
||||
import { MANGA_COVER_ASPECT_RATIO } from '@/features/manga/Manga.constants.ts';
|
||||
import { GridLayout } from '@/base/Base.types.ts';
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Link as RouterLink } from 'react-router-dom';
|
||||
import { memo, useRef } from 'react';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { TypographyMaxLines } from '@/base/components/texts/TypographyMaxLines.tsx';
|
||||
import { SpecificMangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import type { SpecificMangaCardProps } from '@/features/manga/Manga.types.ts';
|
||||
import { Mangas } from '@/features/manga/services/Mangas.ts';
|
||||
import { MangaOptionButton } from '@/features/manga/components/MangaOptionButton.tsx';
|
||||
import { ListCardAvatar } from '@/base/components/lists/cards/ListCardAvatar.tsx';
|
||||
|
||||
@@ -16,7 +16,7 @@ import ExpandLessIcon from '@mui/icons-material/ExpandLess';
|
||||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
||||
import { useLocalStorage } from '@/base/hooks/useStorage.tsx';
|
||||
import { useResizeObserver } from '@/base/hooks/useResizeObserver.tsx';
|
||||
import {
|
||||
import type {
|
||||
MangaDescriptionInfo,
|
||||
MangaGenreInfo,
|
||||
MangaLocationState,
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
import FavoriteIcon from '@mui/icons-material/Favorite';
|
||||
import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { ComponentProps, ReactNode, useEffect } from 'react';
|
||||
import type { ComponentProps, ReactNode } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import Link from '@mui/material/Link';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Stack from '@mui/material/Stack';
|
||||
@@ -27,10 +28,10 @@ import { TrackMangaButton } from '@/features/manga/components/TrackMangaButton.t
|
||||
import { useManageMangaLibraryState } from '@/features/manga/hooks/useManageMangaLibraryState.tsx';
|
||||
import { Metadata as BaseMetadata } from '@/base/components/texts/Metadata.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { MangaType, SourceType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { MangaType, SourceType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import { MANGA_STATUS_TO_TRANSLATION } from '@/features/manga/Manga.constants.ts';
|
||||
import {
|
||||
import type {
|
||||
MangaArtistInfo,
|
||||
MangaAuthorInfo,
|
||||
MangaDescriptionInfo,
|
||||
@@ -47,7 +48,7 @@ import {
|
||||
import { applyStyles } from '@/base/utils/ApplyStyles.ts';
|
||||
import { CustomButtonIcon } from '@/base/components/buttons/CustomButtonIcon.tsx';
|
||||
import { Sources } from '@/features/source/services/Sources.ts';
|
||||
import { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import { Thumbnail } from '@/features/manga/components/details/Thumbnail.tsx';
|
||||
import { DescriptionGenre } from '@/features/manga/components/details/DescriptionGenre.tsx';
|
||||
import { SearchLink } from '@/features/manga/components/details/SearchLink.tsx';
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import Link from '@mui/material/Link';
|
||||
import { Link as RouterLink } from 'react-router-dom';
|
||||
import { MangaLocationState } from '@/features/manga/Manga.types.ts';
|
||||
import { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import type { MangaLocationState } from '@/features/manga/Manga.types.ts';
|
||||
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
|
||||
export const SearchLink = ({
|
||||
|
||||
@@ -17,10 +17,11 @@ import { FastAverageColor } from 'fast-average-color';
|
||||
import { Mangas } from '@/features/manga/services/Mangas.ts';
|
||||
import { SpinnerImage } from '@/base/components/SpinnerImage.tsx';
|
||||
import { MANGA_COVER_ASPECT_RATIO } from '@/features/manga/Manga.constants.ts';
|
||||
import { MangaThumbnailInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaThumbnailInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { useAppThemeContext } from '@/features/theme/AppThemeContext.tsx';
|
||||
import { TAppThemeContext } from '@/features/theme/AppTheme.types.ts';
|
||||
import { ImageRequest, requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import type { TAppThemeContext } from '@/features/theme/AppTheme.types.ts';
|
||||
import type { ImageRequest } from '@/lib/requests/RequestManager.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { noOp } from '@/lib/HelperFunctions.ts';
|
||||
|
||||
export const Thumbnail = ({
|
||||
|
||||
@@ -16,7 +16,11 @@ import { getMetadataServerSettings } from '@/features/settings/services/ServerSe
|
||||
import { Categories } from '@/features/category/services/Categories.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { Mangas } from '@/features/manga/services/Mangas.ts';
|
||||
import { GetCategoriesBaseQuery, GetCategoriesBaseQueryVariables, MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type {
|
||||
GetCategoriesBaseQuery,
|
||||
GetCategoriesBaseQueryVariables,
|
||||
MangaType,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_CATEGORIES_BASE } from '@/lib/graphql/category/CategoryQuery.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
|
||||
@@ -23,11 +23,11 @@ import { MangaDetails } from '@/features/manga/components/details/MangaDetails.t
|
||||
import { MangaToolbarMenu } from '@/features/manga/components/MangaToolbarMenu.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
|
||||
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
|
||||
import { GetMangaScreenQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { GetMangaScreenQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_MANGA_SCREEN } from '@/lib/graphql/manga/MangaQuery.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { useAppTitleAndAction } from '@/features/navigation-bar/hooks/useAppTitleAndAction.ts';
|
||||
import { MangaLocationState } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaLocationState } from '@/features/manga/Manga.types.ts';
|
||||
|
||||
export const Manga: React.FC = () => {
|
||||
const { t } = useLingui();
|
||||
@@ -51,7 +51,9 @@ export const Manga: React.FC = () => {
|
||||
const error = mangaError ?? refreshError;
|
||||
|
||||
useEffect(() => {
|
||||
if (manga == null) return;
|
||||
if (manga == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const doFetch = !autofetchedRef.current && !manga.initialized;
|
||||
if (doFetch) {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { DEFAULT_CHAPTER_OPTIONS } from '@/features/chapter/Chapter.constants.ts';
|
||||
import { getMetadataFrom } from '@/features/metadata/services/MetadataReader.ts';
|
||||
import { MangaIdInfo, MangaMetadata, MangaMetadataKeys } from '@/features/manga/Manga.types.ts';
|
||||
import {
|
||||
import type { MangaIdInfo, MangaMetadata, MangaMetadataKeys } from '@/features/manga/Manga.types.ts';
|
||||
import type {
|
||||
AllowedMetadataValueTypes,
|
||||
GqlMetaHolder,
|
||||
Metadata,
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { DocumentNode, Unmasked } from '@apollo/client';
|
||||
import type { DocumentNode, Unmasked } from '@apollo/client';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { i18n } from '@/i18n';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import {
|
||||
import type {
|
||||
ChapterConditionInput,
|
||||
GetMangasBaseQuery,
|
||||
GetMangasBaseQueryVariables,
|
||||
@@ -26,8 +26,8 @@ import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { getMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import { GET_MANGAS_BASE } from '@/lib/graphql/manga/MangaQuery.ts';
|
||||
import { MANGA_BASE_FIELDS } from '@/lib/graphql/manga/MangaFragments.ts';
|
||||
import { MetadataMigrationSettings } from '@/features/migration/Migration.types.ts';
|
||||
import {
|
||||
import type { MetadataMigrationSettings } from '@/features/migration/Migration.types.ts';
|
||||
import type {
|
||||
MangaAction,
|
||||
MangaArtistInfo,
|
||||
MangaAuthorInfo,
|
||||
@@ -39,10 +39,10 @@ import {
|
||||
MangaSourceNameInfo,
|
||||
MangaThumbnailInfo,
|
||||
MangaTitleInfo,
|
||||
MangaType,
|
||||
MangaUnreadInfo,
|
||||
MigrateMode,
|
||||
} from '@/features/manga/Manga.types.ts';
|
||||
import { MangaType } from '@/features/manga/Manga.types.ts';
|
||||
import {
|
||||
MANGA_ACTION_TO_CONFIRMATION_REQUIRED,
|
||||
MANGA_ACTION_TO_TRANSLATION,
|
||||
@@ -104,6 +104,9 @@ type PerformActionOptions<Action extends MangaAction> = Action extends 'mark_as_
|
||||
type MigrateAction = { copy: () => Promise<unknown>[]; cleanup: () => Promise<unknown>[] };
|
||||
type MigrateActionCreator = () => MigrateAction;
|
||||
|
||||
const performMigrationAction = async (migrateAction: keyof MigrateAction, ...actions: MigrateAction[]) =>
|
||||
Promise.all(actions.flatMap((action) => action[migrateAction]()));
|
||||
|
||||
const ARTIST_AUTHOR_SEPARATOR_REGEX = /\s*[,|、]\s*/;
|
||||
|
||||
export class Mangas {
|
||||
@@ -236,25 +239,23 @@ export class Mangas {
|
||||
Object.fromEntries([...mangaIdToDefaultDownloadSize, ...mangaIdToDownloadSize]),
|
||||
) satisfies MangaIdToDownloadSize[];
|
||||
|
||||
const chapterIdsToDownload = mangaIdToActualDownloadSize
|
||||
.map(([mangaId, actualSize]) => {
|
||||
const mangaChapters = mangaIdToChaptersToConsider[Number(mangaId)] ?? [];
|
||||
const chapterIdsToDownload = mangaIdToActualDownloadSize.flatMap(([mangaId, actualSize]) => {
|
||||
const mangaChapters = mangaIdToChaptersToConsider[Number(mangaId)] ?? [];
|
||||
|
||||
if (!mangaChapters.length) {
|
||||
return [];
|
||||
}
|
||||
if (!mangaChapters.length) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const shouldDownloadAll = actualSize === undefined;
|
||||
if (shouldDownloadAll) {
|
||||
return mangaChapters;
|
||||
}
|
||||
const shouldDownloadAll = actualSize === undefined;
|
||||
if (shouldDownloadAll) {
|
||||
return mangaChapters;
|
||||
}
|
||||
|
||||
const uniqueMangaChapters = Chapters.removeDuplicates(mangaChapters[0], mangaChapters);
|
||||
const uniqueMangaChaptersToDownload = uniqueMangaChapters.slice(0, actualSize);
|
||||
const uniqueMangaChapters = Chapters.removeDuplicates(mangaChapters[0], mangaChapters);
|
||||
const uniqueMangaChaptersToDownload = uniqueMangaChapters.slice(0, actualSize);
|
||||
|
||||
return Chapters.addDuplicates(uniqueMangaChaptersToDownload, mangaChapters);
|
||||
})
|
||||
.flat();
|
||||
return Chapters.addDuplicates(uniqueMangaChaptersToDownload, mangaChapters);
|
||||
});
|
||||
|
||||
if (!chapterIdsToDownload.length) {
|
||||
return Promise.resolve();
|
||||
@@ -531,11 +532,6 @@ export class Mangas {
|
||||
mangaToMigrateToData.fetchChapters = { chapters: [] };
|
||||
}
|
||||
|
||||
const performMigrationAction = async (
|
||||
migrateAction: keyof MigrateAction,
|
||||
...actions: MigrateAction[]
|
||||
) => Promise.all(actions.map((action) => action[migrateAction]()).flat());
|
||||
|
||||
const performMigrationActions = async (
|
||||
...actionCreators: [boolean | undefined, MigrateActionCreator][]
|
||||
) => {
|
||||
|
||||
@@ -7,14 +7,9 @@
|
||||
*/
|
||||
|
||||
import deepmerge from '@mui/utils/deepmerge';
|
||||
import { AppMetadataKeys, IMetadataMigration } from '@/features/metadata/Metadata.types.ts';
|
||||
import {
|
||||
IReaderSettings,
|
||||
ProgressBarPosition,
|
||||
ReaderCustomFilter,
|
||||
ReaderPageScaleMode,
|
||||
ReadingMode,
|
||||
} from '@/features/reader/Reader.types.ts';
|
||||
import type { AppMetadataKeys, IMetadataMigration } from '@/features/metadata/Metadata.types.ts';
|
||||
import type { IReaderSettings, ReaderCustomFilter } from '@/features/reader/Reader.types.ts';
|
||||
import { ProgressBarPosition, ReaderPageScaleMode, ReadingMode } from '@/features/reader/Reader.types.ts';
|
||||
import {
|
||||
AUTO_SCROLL_SPEED,
|
||||
CUSTOM_FILTER,
|
||||
@@ -27,20 +22,25 @@ import {
|
||||
import { coerceIn, jsonSaveParse } from '@/lib/HelperFunctions.ts';
|
||||
import { DOWNLOAD_AHEAD } from '@/features/downloads/Downloads.constants.ts';
|
||||
import { MANGA_GRID_WIDTH } from '@/features/settings/Settings.constants.ts';
|
||||
import { SortSettings } from '@/features/migration/Migration.types.ts';
|
||||
import { ISourceMetadata } from '@/features/source/Source.types.ts';
|
||||
import { LibraryOptions } from '@/features/library/Library.types.ts';
|
||||
import { MetadataThemeSettings } from '@/features/theme/AppTheme.types.ts';
|
||||
import { TapZoneInvertMode } from '@/features/reader/tap-zones/TapZoneLayout.types.ts';
|
||||
import type { SortSettings } from '@/features/migration/Migration.types.ts';
|
||||
import type { ISourceMetadata } from '@/features/source/Source.types.ts';
|
||||
import type { LibraryOptions } from '@/features/library/Library.types.ts';
|
||||
import type { MetadataThemeSettings } from '@/features/theme/AppTheme.types.ts';
|
||||
import type { TapZoneInvertMode } from '@/features/reader/tap-zones/TapZoneLayout.types.ts';
|
||||
import { detectLocale, getISOLanguage } from '@/lib/ISOLanguageUtil.ts';
|
||||
import { I18nResourceCode, i18nResources } from '@/i18n';
|
||||
import type { I18nResourceCode } from '@/i18n';
|
||||
import { i18nResources } from '@/i18n';
|
||||
import { toUniqueLanguageCodes } from '@/base/utils/Languages.ts';
|
||||
|
||||
export const APP_METADATA_KEY_PREFIX = 'webUI';
|
||||
|
||||
const convertToTypeNullAndUndefined = <T>(value: string, convertToType: (value: string) => T): NullAndUndefined<T> => {
|
||||
if (value === 'null') return null;
|
||||
if (value === 'undefined') return undefined;
|
||||
if (value === 'null') {
|
||||
return null;
|
||||
}
|
||||
if (value === 'undefined') {
|
||||
return undefined;
|
||||
}
|
||||
return convertToType(value);
|
||||
};
|
||||
const convertToString = (value: string): string => value;
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MetadataServerSettingKeys, SearchMetadataKeys } from '@/features/settings/Settings.types.ts';
|
||||
import { MangaMetadataKeys } from '@/features/manga/Manga.types.ts';
|
||||
import { SourceMetadataKeys } from '@/features/source/Source.types.ts';
|
||||
import { CategoryMetadataKeys } from '@/features/category/Category.types.ts';
|
||||
import { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { IReaderSettings } from '@/features/reader/Reader.types.ts';
|
||||
import type { MetadataServerSettingKeys, SearchMetadataKeys } from '@/features/settings/Settings.types.ts';
|
||||
import type { MangaMetadataKeys } from '@/features/manga/Manga.types.ts';
|
||||
import type { SourceMetadataKeys } from '@/features/source/Source.types.ts';
|
||||
import type { CategoryMetadataKeys } from '@/features/category/Category.types.ts';
|
||||
import type { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { IReaderSettings } from '@/features/reader/Reader.types.ts';
|
||||
|
||||
export interface IMetadataMigration {
|
||||
appKeyPrefix?: { oldPrefix: string; newPrefix: string };
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { APP_METADATA_KEY_PREFIX, GLOBAL_METADATA_KEYS } from '@/features/metadata/Metadata.constants.ts';
|
||||
import { AppMetadataKeys, Metadata } from '@/features/metadata/Metadata.types.ts';
|
||||
import type { AppMetadataKeys, Metadata } from '@/features/metadata/Metadata.types.ts';
|
||||
import { getActiveDevice } from '@/features/device/services/Device.ts';
|
||||
|
||||
export const extractOriginalKey = (key: string) => key.split('_').slice(-1)[0];
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { FieldFunctionOptions } from '@apollo/client/cache';
|
||||
import { Reference } from '@apollo/client/utilities';
|
||||
import { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { FieldFunctionOptions } from '@apollo/client/cache';
|
||||
import type { Reference } from '@apollo/client/utilities';
|
||||
import type { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
type ReadFieldFunction = FieldFunctionOptions['readField'];
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { GqlMetaHolder, Metadata, MetadataHolderType } from '@/features/metadata/Metadata.types.ts';
|
||||
import type { GqlMetaHolder, Metadata, MetadataHolderType } from '@/features/metadata/Metadata.types.ts';
|
||||
import { convertFromGqlMeta } from '@/features/metadata/services/MetadataConverter.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { GET_GLOBAL_METADATAS } from '@/lib/graphql/metadata/GlobalMetadataQuery.ts';
|
||||
import {
|
||||
import type {
|
||||
GetGlobalMetadatasQuery,
|
||||
GetGlobalMetadatasQueryVariables,
|
||||
MetaInput,
|
||||
@@ -52,7 +52,9 @@ export class MetadataChunker {
|
||||
}
|
||||
|
||||
static getStaleChunkKeyCount(metadata: Metadata | undefined, fullKey: string): number {
|
||||
if (!metadata) return 0;
|
||||
if (!metadata) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const scanFrom = (index: number): number =>
|
||||
doesMetadataKeyExistIn(metadata, this.getChunkIndexKey(fullKey, index)) ? scanFrom(index + 1) : index;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AllowedMetadataValueTypes, AppMetadataKeys, Metadata } from '@/features/metadata/Metadata.types.ts';
|
||||
import type { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import type { AllowedMetadataValueTypes, AppMetadataKeys, Metadata } from '@/features/metadata/Metadata.types.ts';
|
||||
import { APP_METADATA } from '@/features/metadata/Metadata.constants.ts';
|
||||
|
||||
export const convertValueFromMetadata = <T extends AllowedMetadataValueTypes = AllowedMetadataValueTypes>(
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import type { useEffect } from 'react';
|
||||
import {
|
||||
APP_METADATA_KEY_PREFIX,
|
||||
METADATA_MIGRATIONS,
|
||||
VALID_APP_METADATA_KEYS,
|
||||
} from '@/features/metadata/Metadata.constants.ts';
|
||||
import {
|
||||
import type {
|
||||
AppMetadataKeys,
|
||||
IMetadataMigration,
|
||||
Metadata,
|
||||
@@ -21,13 +21,13 @@ import {
|
||||
MetadataKeyValuePair,
|
||||
} from '@/features/metadata/Metadata.types.ts';
|
||||
import { extractOriginalKey, getMetadataKey } from '@/features/metadata/Metadata.utils.ts';
|
||||
import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { getMetadataUpdateFunction } from '@/features/metadata/services/MetadataUpdater.ts';
|
||||
import { MetadataChunker } from '@/features/metadata/services/MetadataChunker.ts';
|
||||
import { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import type { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
|
||||
const getAppKeyPrefixForMigration = (migrationId: number): string => {
|
||||
const appKeyPrefix = METADATA_MIGRATIONS.slice(0, migrationId)
|
||||
|
||||
@@ -6,23 +6,23 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import type { useEffect } from 'react';
|
||||
import { convertValueFromMetadata } from '@/features/metadata/services/MetadataConverter.ts';
|
||||
import {
|
||||
import type {
|
||||
AllowedMetadataValueTypes,
|
||||
AppMetadataKeys,
|
||||
Metadata,
|
||||
MetadataHolder,
|
||||
MetadataHolderType,
|
||||
} from '@/features/metadata/Metadata.types.ts';
|
||||
import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
|
||||
import { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import type { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import { doesMetadataKeyExistIn, getMetadataKey } from '@/features/metadata/Metadata.utils.ts';
|
||||
import { MetadataChunker } from '@/features/metadata/services/MetadataChunker.ts';
|
||||
import { applyMetadataMigrations } from '@/features/metadata/services/MetadataMigrations.ts';
|
||||
import { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import type { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
import { APP_METADATA } from '@/features/metadata/Metadata.constants.ts';
|
||||
import { MetadataValueCache } from '@/features/metadata/services/MetadataValueCache.ts';
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user