Move "core" folder out of "features" into "base"
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { TranslationKey } from '@/Base.types.ts';
|
||||
import { ChapterAction, ChapterListOptions, ChapterSortMode } from '@/features/chapter/Chapter.types.ts';
|
||||
import { TranslationKey } from '@/base/Base.types.ts';
|
||||
|
||||
export const FALLBACK_CHAPTER = { id: -1, name: '', realUrl: '', isBookmarked: false };
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { NullAndUndefined } from '@/Base.types.ts';
|
||||
import {
|
||||
ChapterReaderFieldsFragment,
|
||||
ChapterType,
|
||||
DownloadStatusFieldsFragment,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { NullAndUndefined } from '@/base/Base.types.ts';
|
||||
|
||||
export type ChapterSortMode = 'fetchedAt' | 'source' | 'chapterNumber' | 'uploadedAt';
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import { bindTrigger, usePopupState } from 'material-ui-popup-state/hooks';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import PeopleAltOutlinedIcon from '@mui/icons-material/PeopleAltOutlined';
|
||||
import DisabledByDefaultRounded from '@mui/icons-material/DisabledByDefaultRounded';
|
||||
import { CheckboxListSetting } from '@/features/core/components/settings/CheckboxListSetting.tsx';
|
||||
import { CheckboxListSetting } from '@/base/components/settings/CheckboxListSetting.tsx';
|
||||
import { updateChapterListOptions } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import { CheckboxInput } from '@/features/core/components/inputs/CheckboxInput.tsx';
|
||||
import { CheckboxInput } from '@/base/components/inputs/CheckboxInput.tsx';
|
||||
|
||||
export const ChapterExcludeSanlatorsFilter = ({
|
||||
updateOption,
|
||||
|
||||
@@ -19,10 +19,10 @@ import {
|
||||
updateChapterListOptions,
|
||||
useChapterListOptions,
|
||||
} from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/features/core/components/feedback/EmptyViewAbsoluteCentered.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
|
||||
import { ChaptersToolbarMenu } from '@/features/chapter/components/ChaptersToolbarMenu.tsx';
|
||||
import { SelectionFAB } from '@/features/collection/components/SelectionFAB.tsx';
|
||||
import { DEFAULT_FULL_FAB_HEIGHT } from '@/features/core/components/buttons/StyledFab.tsx';
|
||||
import { DEFAULT_FULL_FAB_HEIGHT } from '@/base/components/buttons/StyledFab.tsx';
|
||||
import {
|
||||
ChapterListFieldsFragment,
|
||||
GetChaptersMangaQuery,
|
||||
@@ -34,14 +34,14 @@ import { SelectableCollectionSelectAll } from '@/features/collection/components/
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { ChapterActionMenuItems } from '@/features/chapter/components/actions/ChapterActionMenuItems.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { LoadingPlaceholder } from '@/features/core/components/feedback/LoadingPlaceholder.tsx';
|
||||
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
|
||||
import { GET_CHAPTERS_MANGA } from '@/lib/graphql/queries/ChapterQuery.ts';
|
||||
import { useNavBarContext } from '@/features/navigation-bar/NavbarContext.tsx';
|
||||
import { useResizeObserver } from '@/features/core/hooks/useResizeObserver.tsx';
|
||||
import { MediaQuery } from '@/features/core/utils/MediaQuery.tsx';
|
||||
import { shouldForwardProp } from '@/features/core/utils/ShouldForwardProp.ts';
|
||||
import { useResizeObserver } from '@/base/hooks/useResizeObserver.tsx';
|
||||
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
|
||||
import { shouldForwardProp } from '@/base/utils/ShouldForwardProp.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { makeToast } from '@/features/core/utils/Toast.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { ChapterListCard } from '@/features/chapter/components/cards/ChapterListCard.tsx';
|
||||
import { VirtuosoPersisted } from '@/lib/virtuoso/Component/VirtuosoPersisted.tsx';
|
||||
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
import RadioGroup from '@mui/material/RadioGroup';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { RadioInput } from '@/features/core/components/inputs/RadioInput.tsx';
|
||||
import { SortRadioInput } from '@/features/core/components/inputs/SortRadioInput.tsx';
|
||||
import { ThreeStateCheckboxInput } from '@/features/core/components/inputs/ThreeStateCheckboxInput.tsx';
|
||||
import { OptionsTabs } from '@/features/core/components/modals/OptionsTabs.tsx';
|
||||
import { RadioInput } from '@/base/components/inputs/RadioInput.tsx';
|
||||
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_KEY } from '@/features/chapter/Chapter.constants.ts';
|
||||
import { TranslationKey } from '@/Base.types.ts';
|
||||
import { ChapterListOptions } from '@/features/chapter/Chapter.types.ts';
|
||||
import { updateChapterListOptions } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import { ChapterExcludeSanlatorsFilter } from '@/features/chapter/components/ChapterExcludeSanlatorsFilter.tsx';
|
||||
import { TranslationKey } from '@/base/Base.types.ts';
|
||||
|
||||
interface IProps {
|
||||
open: boolean;
|
||||
|
||||
@@ -15,7 +15,7 @@ import Menu from '@mui/material/Menu';
|
||||
import DownloadIcon from '@mui/icons-material/Download';
|
||||
import DoneAllIcon from '@mui/icons-material/DoneAll';
|
||||
import { useMemo } from 'react';
|
||||
import { CustomTooltip } from '@/features/core/components/CustomTooltip.tsx';
|
||||
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 {
|
||||
|
||||
@@ -18,12 +18,12 @@ import DoneAll from '@mui/icons-material/DoneAll';
|
||||
import { ComponentProps, useMemo } from 'react';
|
||||
import { SelectableCollectionReturnType } from '@/features/collection/hooks/useSelectableCollection.ts';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { MenuItem } from '@/features/core/components/menu/MenuItem.tsx';
|
||||
import { MenuItem } from '@/base/components/menu/MenuItem.tsx';
|
||||
import {
|
||||
createGetMenuItemTitle,
|
||||
createIsMenuItemDisabled,
|
||||
createShouldShowMenuItem,
|
||||
} from '@/features/core/components/menu/Menu.utils.ts';
|
||||
} 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';
|
||||
|
||||
@@ -19,16 +19,16 @@ import {
|
||||
MangaType,
|
||||
SortOrder,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { TranslationKey } from '@/Base.types.ts';
|
||||
import { MANGA_META_FIELDS } from '@/lib/graphql/fragments/MangaFragments.ts';
|
||||
import { getMangaMetadata } from '@/features/manga/services/MangaMetadata.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { GET_CHAPTERS_MANGA } from '@/lib/graphql/queries/ChapterQuery.ts';
|
||||
import { filterChapters } from '@/features/chapter/utils/ChapterList.util.tsx';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { makeToast } from '@/features/core/utils/Toast.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { CHAPTER_ACTION_TO_TRANSLATION } from '@/features/chapter/Chapter.constants.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { TranslationKey } from '@/base/Base.types.ts';
|
||||
|
||||
const DOWNLOAD_OPTIONS: {
|
||||
title: TranslationKey;
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import DownloadIcon from '@mui/icons-material/Download';
|
||||
import { CustomTooltip } from '@/features/core/components/CustomTooltip.tsx';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/features/core/utils/Toast.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';
|
||||
|
||||
@@ -10,10 +10,10 @@ import Refresh from '@mui/icons-material/Refresh';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { DownloadState } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { CustomTooltip } from '@/features/core/components/CustomTooltip.tsx';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/features/core/utils/Toast.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';
|
||||
|
||||
@@ -19,17 +19,17 @@ import { Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import PopupState, { bindMenu, bindTrigger } from 'material-ui-popup-state';
|
||||
import { useLongPress } from 'use-long-press';
|
||||
import { CustomTooltip } from '@/features/core/components/CustomTooltip.tsx';
|
||||
import { getDateString } from '@/util/DateHelper.ts';
|
||||
import { DownloadStateIndicator } from '@/features/core/components/downloads/DownloadStateIndicator.tsx';
|
||||
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 { ChapterActionMenuItems } from '@/features/chapter/components/actions/ChapterActionMenuItems.tsx';
|
||||
import { Menu } from '@/features/core/components/menu/Menu.tsx';
|
||||
import { Menu } from '@/base/components/menu/Menu.tsx';
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { applyStyles } from '@/features/core/utils/ApplyStyles.ts';
|
||||
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 '@/features/core/components/lists/cards/ListCardContent.tsx';
|
||||
import { ListCardContent } from '@/base/components/lists/cards/ListCardContent.tsx';
|
||||
import {
|
||||
ChapterBookmarkInfo,
|
||||
ChapterDownloadInfo,
|
||||
@@ -39,7 +39,7 @@ import {
|
||||
ChapterReadInfo,
|
||||
ChapterScanlatorInfo,
|
||||
} from '@/features/chapter/Chapter.types.ts';
|
||||
import { MediaQuery } from '@/features/core/utils/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
|
||||
|
||||
type TChapter = ChapterIdInfo &
|
||||
ChapterMangaInfo &
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
import Box from '@mui/material/Box';
|
||||
import { ComponentProps, ReactNode } from 'react';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { TypographyMaxLines } from '@/features/core/components/texts/TypographyMaxLines.tsx';
|
||||
import { CustomTooltip } from '@/features/core/components/CustomTooltip.tsx';
|
||||
import { TypographyMaxLines } from '@/base/components/texts/TypographyMaxLines.tsx';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
|
||||
export const ChapterCardMetadata = ({
|
||||
title,
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
*/
|
||||
|
||||
import { Link } from 'react-router-dom';
|
||||
import { AppRoutes } from '@/features/core/AppRoute.constants.ts';
|
||||
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 { ListCardAvatar } from '@/features/core/components/lists/cards/ListCardAvatar.tsx';
|
||||
import { ListCardAvatar } from '@/base/components/lists/cards/ListCardAvatar.tsx';
|
||||
|
||||
export const ChapterCardThumbnail = ({
|
||||
mangaId,
|
||||
|
||||
@@ -11,7 +11,7 @@ import { ComponentProps } from 'react';
|
||||
import { ChapterCard } from '@/features/chapter/components/cards/ChapterCard.tsx';
|
||||
|
||||
import { Chapters } from '@/features/chapter/services/Chapters.ts';
|
||||
import { applyStyles } from '@/features/core/utils/ApplyStyles.ts';
|
||||
import { applyStyles } from '@/base/utils/ApplyStyles.ts';
|
||||
import { MissingChaptersInfoSeparator } from '@/features/chapter/components/MissingChaptersInfoSeparator.tsx';
|
||||
|
||||
type ChapterCardProps = ComponentProps<typeof ChapterCard>;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import { t as translate } from 'i18next';
|
||||
import { DocumentNode, MaybeMasked, Unmasked, useFragment } from '@apollo/client';
|
||||
import { makeToast } from '@/features/core/utils/Toast.ts';
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { getMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
|
||||
import {
|
||||
@@ -19,13 +19,12 @@ import {
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { CHAPTER_LIST_FIELDS } from '@/lib/graphql/fragments/ChapterFragments.ts';
|
||||
|
||||
import { DirectionOffset } from '@/Base.types.ts';
|
||||
import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { ReaderOpenChapterLocationState, ReaderResumeMode } from '@/features/reader/Reader.types.ts';
|
||||
import { AppRoutes } from '@/features/core/AppRoute.constants.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { DOWNLOAD_TYPE_FIELDS } from '@/lib/graphql/fragments/DownloadFragments.ts';
|
||||
import { epochToDate, getDateString } from '@/util/DateHelper.ts';
|
||||
import { epochToDate, getDateString } from '@/base/utils/DateHelper.ts';
|
||||
import {
|
||||
CHAPTER_ACTION_TO_CONFIRMATION_REQUIRED,
|
||||
CHAPTER_ACTION_TO_TRANSLATION,
|
||||
@@ -41,8 +40,9 @@ import {
|
||||
ChapterScanlatorInfo,
|
||||
ChapterSourceOrderInfo,
|
||||
} from '@/features/chapter/Chapter.types.ts';
|
||||
import { assertIsDefined } from '@/Asserts.ts';
|
||||
import { awaitConfirmation } from '@/features/core/utils/AwaitableDialog.tsx';
|
||||
import { assertIsDefined } from '@/base/Asserts.ts';
|
||||
import { awaitConfirmation } from '@/base/utils/AwaitableDialog.tsx';
|
||||
import { DirectionOffset } from '@/base/Base.types.ts';
|
||||
|
||||
export class Chapters {
|
||||
static getIds(chapters: { id: number }[]): number[] {
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
import { useMemo } from 'react';
|
||||
import { ChapterType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { NullAndUndefined } from '@/Base.types.ts';
|
||||
import {
|
||||
ChapterBookmarkInfo,
|
||||
ChapterDownloadInfo,
|
||||
@@ -20,6 +19,7 @@ import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { GqlMetaHolder } from '@/features/metadata/Metadata.types.ts';
|
||||
import { createUpdateMangaMetadata, useGetMangaMetadata } from '@/features/manga/services/MangaMetadata.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { NullAndUndefined } from '@/base/Base.types.ts';
|
||||
|
||||
export function unreadFilter(unread: NullAndUndefined<boolean>, { isRead: isChapterRead }: ChapterReadInfo) {
|
||||
switch (unread) {
|
||||
|
||||
Reference in New Issue
Block a user