Move more core logic to new folder
This commit is contained in:
@@ -18,7 +18,7 @@ import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts'
|
||||
import { UpdateState, WebUiChannel, WebUiUpdateStatus } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { ABOUT_WEBUI, WEBUI_UPDATE_CHECK } from '@/lib/graphql/fragments/InfoFragments.ts';
|
||||
import { VersionUpdateInfoDialog } from '@/modules/app-updates/components/VersionUpdateInfoDialog.tsx';
|
||||
import { useUpdateChecker } from '@/modules/app-updates/hooks/useUpdateChecker.tsx';
|
||||
|
||||
@@ -24,7 +24,7 @@ import ListItem from '@mui/material/ListItem';
|
||||
import { Link } from 'react-router-dom';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { BackupRestoreState, ValidateBackupQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { Progress } from '@/modules/core/components/Progress.tsx';
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { MetadataBrowseSettings } from '@/modules/browse/Browse.types.ts';
|
||||
import { ServerSettings as GqlServerSettings } from '@/modules/settings/Settings.types.ts';
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import DialogActions from '@mui/material/DialogActions';
|
||||
import Button from '@mui/material/Button';
|
||||
import { t as translate } from 'i18next';
|
||||
import { ThreeStateCheckboxInput } from '@/modules/core/components/inputs/ThreeStateCheckboxInput.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { IncludeOrExclude } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { CheckboxContainer } from '@/modules/core/components/inputs/CheckboxContainer.ts';
|
||||
|
||||
@@ -22,7 +22,7 @@ import { useSelectableCollection } from '@/modules/collection/hooks/useSelectabl
|
||||
import { ThreeStateCheckboxInput } from '@/modules/core/components/inputs/ThreeStateCheckboxInput.tsx';
|
||||
import { Categories } from '@/modules/category/services/Categories.ts';
|
||||
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { updateMetadataServerSettings } from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import {
|
||||
|
||||
@@ -44,7 +44,7 @@ import { GET_CHAPTERS_MANGA } from '@/lib/graphql/queries/ChapterQuery.ts';
|
||||
import { Mangas } from '@/modules/manga/services/Mangas.ts';
|
||||
import { useNavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { useResizeObserver } from '@/modules/core/hooks/useResizeObserver.tsx';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
import { shouldForwardProp } from '@/modules/core/utils/ShouldForwardProp.ts';
|
||||
import { useChapterOptions } from '@/modules/chapter/hooks/useChapterOptions.tsx';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { t as translate } from 'i18next';
|
||||
import gql from 'graphql-tag';
|
||||
import { DocumentNode } from '@apollo/client';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { getMetadataServerSettings } from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import {
|
||||
|
||||
802
src/modules/core/IsoLanguages.ts
Normal file
802
src/modules/core/IsoLanguages.ts
Normal file
@@ -0,0 +1,802 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { I18nResourceCode } from '@/i18n';
|
||||
|
||||
export type ISOLanguage = {
|
||||
name: string;
|
||||
nativeName: string;
|
||||
};
|
||||
|
||||
// full list: https://github.com/meikidd/iso-639-1/blob/master/src/data.js
|
||||
export const IsoLanguages: { [languageCode in I18nResourceCode]: ISOLanguage } & Record<string, ISOLanguage> = {
|
||||
// #############################
|
||||
// ### ###
|
||||
// ### START: manually added ###
|
||||
// ### ###
|
||||
// #############################
|
||||
'es-419': {
|
||||
name: 'Spanish; Castilian',
|
||||
nativeName: 'Español',
|
||||
},
|
||||
'pt-pt': {
|
||||
name: 'Portuguese',
|
||||
nativeName: 'Português (Portugal)',
|
||||
},
|
||||
'pt-br': {
|
||||
name: 'Portuguese; Brasil',
|
||||
nativeName: 'Português (Brasil)',
|
||||
},
|
||||
zh_Hans: {
|
||||
name: 'Chinese (Simplified)',
|
||||
nativeName: '中文 (HANS)',
|
||||
},
|
||||
zh_Hant: {
|
||||
name: 'Chinese (Traditional)',
|
||||
nativeName: '中文 (HANT)',
|
||||
},
|
||||
'zh-rhk': {
|
||||
name: 'Chinese',
|
||||
nativeName: '中文 (RHK)',
|
||||
},
|
||||
'zh-rtw': {
|
||||
name: 'Chinese',
|
||||
nativeName: '中文 (RTW)',
|
||||
},
|
||||
fil: {
|
||||
name: 'Filipino',
|
||||
nativeName: 'Filipino',
|
||||
},
|
||||
sh: {
|
||||
name: 'Serbo-Croatian',
|
||||
nativeName: 'srpskohrvatski',
|
||||
},
|
||||
'nb-NO': {
|
||||
name: 'Norwegian Bokmål',
|
||||
nativeName: 'Norsk bokmål',
|
||||
},
|
||||
// #############################
|
||||
// ### ###
|
||||
// ### END: manually added ###
|
||||
// ### ###
|
||||
// #############################
|
||||
aa: {
|
||||
name: 'Afar',
|
||||
nativeName: 'Afaraf',
|
||||
},
|
||||
ab: {
|
||||
name: 'Abkhaz',
|
||||
nativeName: 'аҧсуа бызшәа',
|
||||
},
|
||||
ae: {
|
||||
name: 'Avestan',
|
||||
nativeName: 'avesta',
|
||||
},
|
||||
af: {
|
||||
name: 'Afrikaans',
|
||||
nativeName: 'Afrikaans',
|
||||
},
|
||||
ak: {
|
||||
name: 'Akan',
|
||||
nativeName: 'Akan',
|
||||
},
|
||||
am: {
|
||||
name: 'Amharic',
|
||||
nativeName: 'አማርኛ',
|
||||
},
|
||||
an: {
|
||||
name: 'Aragonese',
|
||||
nativeName: 'aragonés',
|
||||
},
|
||||
ar: {
|
||||
name: 'Arabic',
|
||||
nativeName: 'اَلْعَرَبِيَّةُ',
|
||||
},
|
||||
as: {
|
||||
name: 'Assamese',
|
||||
nativeName: 'অসমীয়া',
|
||||
},
|
||||
av: {
|
||||
name: 'Avaric',
|
||||
nativeName: 'авар мацӀ',
|
||||
},
|
||||
ay: {
|
||||
name: 'Aymara',
|
||||
nativeName: 'aymar aru',
|
||||
},
|
||||
az: {
|
||||
name: 'Azerbaijani',
|
||||
nativeName: 'azərbaycan dili',
|
||||
},
|
||||
ba: {
|
||||
name: 'Bashkir',
|
||||
nativeName: 'башҡорт теле',
|
||||
},
|
||||
be: {
|
||||
name: 'Belarusian',
|
||||
nativeName: 'беларуская мова',
|
||||
},
|
||||
bg: {
|
||||
name: 'Bulgarian',
|
||||
nativeName: 'български език',
|
||||
},
|
||||
bi: {
|
||||
name: 'Bislama',
|
||||
nativeName: 'Bislama',
|
||||
},
|
||||
bm: {
|
||||
name: 'Bambara',
|
||||
nativeName: 'bamanankan',
|
||||
},
|
||||
bn: {
|
||||
name: 'Bengali',
|
||||
nativeName: 'বাংলা',
|
||||
},
|
||||
bo: {
|
||||
name: 'Tibetan',
|
||||
nativeName: 'བོད་ཡིག',
|
||||
},
|
||||
br: {
|
||||
name: 'Breton',
|
||||
nativeName: 'brezhoneg',
|
||||
},
|
||||
bs: {
|
||||
name: 'Bosnian',
|
||||
nativeName: 'bosanski jezik',
|
||||
},
|
||||
ca: {
|
||||
name: 'Catalan',
|
||||
nativeName: 'Català',
|
||||
},
|
||||
ce: {
|
||||
name: 'Chechen',
|
||||
nativeName: 'нохчийн мотт',
|
||||
},
|
||||
ch: {
|
||||
name: 'Chamorro',
|
||||
nativeName: 'Chamoru',
|
||||
},
|
||||
co: {
|
||||
name: 'Corsican',
|
||||
nativeName: 'corsu',
|
||||
},
|
||||
cr: {
|
||||
name: 'Cree',
|
||||
nativeName: 'ᓀᐦᐃᔭᐍᐏᐣ',
|
||||
},
|
||||
cs: {
|
||||
name: 'Czech',
|
||||
nativeName: 'čeština',
|
||||
},
|
||||
cu: {
|
||||
name: 'Old Church Slavonic',
|
||||
nativeName: 'ѩзыкъ словѣньскъ',
|
||||
},
|
||||
cv: {
|
||||
name: 'Chuvash',
|
||||
nativeName: 'чӑваш чӗлхи',
|
||||
},
|
||||
cy: {
|
||||
name: 'Welsh',
|
||||
nativeName: 'Cymraeg',
|
||||
},
|
||||
da: {
|
||||
name: 'Danish',
|
||||
nativeName: 'Dansk',
|
||||
},
|
||||
de: {
|
||||
name: 'German',
|
||||
nativeName: 'Deutsch',
|
||||
},
|
||||
dv: {
|
||||
name: 'Divehi',
|
||||
nativeName: 'ދިވެހި',
|
||||
},
|
||||
dz: {
|
||||
name: 'Dzongkha',
|
||||
nativeName: 'རྫོང་ཁ',
|
||||
},
|
||||
ee: {
|
||||
name: 'Ewe',
|
||||
nativeName: 'Eʋegbe',
|
||||
},
|
||||
el: {
|
||||
name: 'Greek',
|
||||
nativeName: 'Ελληνικά',
|
||||
},
|
||||
en: {
|
||||
name: 'English',
|
||||
nativeName: 'English',
|
||||
},
|
||||
eo: {
|
||||
name: 'Esperanto',
|
||||
nativeName: 'Esperanto',
|
||||
},
|
||||
es: {
|
||||
name: 'Spanish',
|
||||
nativeName: 'Español',
|
||||
},
|
||||
et: {
|
||||
name: 'Estonian',
|
||||
nativeName: 'eesti',
|
||||
},
|
||||
eu: {
|
||||
name: 'Basque',
|
||||
nativeName: 'euskara',
|
||||
},
|
||||
fa: {
|
||||
name: 'Persian',
|
||||
nativeName: 'فارسی',
|
||||
},
|
||||
ff: {
|
||||
name: 'Fula',
|
||||
nativeName: 'Fulfulde',
|
||||
},
|
||||
fi: {
|
||||
name: 'Finnish',
|
||||
nativeName: 'suomi',
|
||||
},
|
||||
fj: {
|
||||
name: 'Fijian',
|
||||
nativeName: 'vosa Vakaviti',
|
||||
},
|
||||
fo: {
|
||||
name: 'Faroese',
|
||||
nativeName: 'Føroyskt',
|
||||
},
|
||||
fr: {
|
||||
name: 'French',
|
||||
nativeName: 'Français',
|
||||
},
|
||||
fy: {
|
||||
name: 'Western Frisian',
|
||||
nativeName: 'Frysk',
|
||||
},
|
||||
ga: {
|
||||
name: 'Irish',
|
||||
nativeName: 'Gaeilge',
|
||||
},
|
||||
gd: {
|
||||
name: 'Scottish Gaelic',
|
||||
nativeName: 'Gàidhlig',
|
||||
},
|
||||
gl: {
|
||||
name: 'Galician',
|
||||
nativeName: 'galego',
|
||||
},
|
||||
gn: {
|
||||
name: 'Guaraní',
|
||||
nativeName: "Avañe'ẽ",
|
||||
},
|
||||
gu: {
|
||||
name: 'Gujarati',
|
||||
nativeName: 'ગુજરાતી',
|
||||
},
|
||||
gv: {
|
||||
name: 'Manx',
|
||||
nativeName: 'Gaelg',
|
||||
},
|
||||
ha: {
|
||||
name: 'Hausa',
|
||||
nativeName: 'هَوُسَ',
|
||||
},
|
||||
he: {
|
||||
name: 'Hebrew',
|
||||
nativeName: 'עברית',
|
||||
},
|
||||
hi: {
|
||||
name: 'Hindi',
|
||||
nativeName: 'हिन्दी',
|
||||
},
|
||||
ho: {
|
||||
name: 'Hiri Motu',
|
||||
nativeName: 'Hiri Motu',
|
||||
},
|
||||
hr: {
|
||||
name: 'Croatian',
|
||||
nativeName: 'Hrvatski',
|
||||
},
|
||||
ht: {
|
||||
name: 'Haitian',
|
||||
nativeName: 'Kreyòl ayisyen',
|
||||
},
|
||||
hu: {
|
||||
name: 'Hungarian',
|
||||
nativeName: 'magyar',
|
||||
},
|
||||
hy: {
|
||||
name: 'Armenian',
|
||||
nativeName: 'Հայերեն',
|
||||
},
|
||||
hz: {
|
||||
name: 'Herero',
|
||||
nativeName: 'Otjiherero',
|
||||
},
|
||||
ia: {
|
||||
name: 'Interlingua',
|
||||
nativeName: 'Interlingua',
|
||||
},
|
||||
id: {
|
||||
name: 'Indonesian',
|
||||
nativeName: 'Bahasa Indonesia',
|
||||
},
|
||||
ie: {
|
||||
name: 'Interlingue',
|
||||
nativeName: 'Interlingue',
|
||||
},
|
||||
ig: {
|
||||
name: 'Igbo',
|
||||
nativeName: 'Asụsụ Igbo',
|
||||
},
|
||||
ii: {
|
||||
name: 'Nuosu',
|
||||
nativeName: 'ꆈꌠ꒿ Nuosuhxop',
|
||||
},
|
||||
ik: {
|
||||
name: 'Inupiaq',
|
||||
nativeName: 'Iñupiaq',
|
||||
},
|
||||
io: {
|
||||
name: 'Ido',
|
||||
nativeName: 'Ido',
|
||||
},
|
||||
is: {
|
||||
name: 'Icelandic',
|
||||
nativeName: 'Íslenska',
|
||||
},
|
||||
it: {
|
||||
name: 'Italian',
|
||||
nativeName: 'Italiano',
|
||||
},
|
||||
iu: {
|
||||
name: 'Inuktitut',
|
||||
nativeName: 'ᐃᓄᒃᑎᑐᑦ',
|
||||
},
|
||||
ja: {
|
||||
name: 'Japanese',
|
||||
nativeName: '日本語',
|
||||
},
|
||||
jv: {
|
||||
name: 'Javanese',
|
||||
nativeName: 'basa Jawa',
|
||||
},
|
||||
ka: {
|
||||
name: 'Georgian',
|
||||
nativeName: 'ქართული',
|
||||
},
|
||||
kg: {
|
||||
name: 'Kongo',
|
||||
nativeName: 'Kikongo',
|
||||
},
|
||||
ki: {
|
||||
name: 'Kikuyu',
|
||||
nativeName: 'Gĩkũyũ',
|
||||
},
|
||||
kj: {
|
||||
name: 'Kwanyama',
|
||||
nativeName: 'Kuanyama',
|
||||
},
|
||||
kk: {
|
||||
name: 'Kazakh',
|
||||
nativeName: 'қазақ тілі',
|
||||
},
|
||||
kl: {
|
||||
name: 'Kalaallisut',
|
||||
nativeName: 'kalaallisut',
|
||||
},
|
||||
km: {
|
||||
name: 'Khmer',
|
||||
nativeName: 'ខេមរភាសា',
|
||||
},
|
||||
kn: {
|
||||
name: 'Kannada',
|
||||
nativeName: 'ಕನ್ನಡ',
|
||||
},
|
||||
ko: {
|
||||
name: 'Korean',
|
||||
nativeName: '한국어',
|
||||
},
|
||||
kr: {
|
||||
name: 'Kanuri',
|
||||
nativeName: 'Kanuri',
|
||||
},
|
||||
ks: {
|
||||
name: 'Kashmiri',
|
||||
nativeName: 'कश्मीरी',
|
||||
},
|
||||
ku: {
|
||||
name: 'Kurdish',
|
||||
nativeName: 'Kurdî',
|
||||
},
|
||||
kv: {
|
||||
name: 'Komi',
|
||||
nativeName: 'коми кыв',
|
||||
},
|
||||
kw: {
|
||||
name: 'Cornish',
|
||||
nativeName: 'Kernewek',
|
||||
},
|
||||
ky: {
|
||||
name: 'Kyrgyz',
|
||||
nativeName: 'Кыргызча',
|
||||
},
|
||||
la: {
|
||||
name: 'Latin',
|
||||
nativeName: 'latine',
|
||||
},
|
||||
lb: {
|
||||
name: 'Luxembourgish',
|
||||
nativeName: 'Lëtzebuergesch',
|
||||
},
|
||||
lg: {
|
||||
name: 'Ganda',
|
||||
nativeName: 'Luganda',
|
||||
},
|
||||
li: {
|
||||
name: 'Limburgish',
|
||||
nativeName: 'Limburgs',
|
||||
},
|
||||
ln: {
|
||||
name: 'Lingala',
|
||||
nativeName: 'Lingála',
|
||||
},
|
||||
lo: {
|
||||
name: 'Lao',
|
||||
nativeName: 'ພາສາລາວ',
|
||||
},
|
||||
lt: {
|
||||
name: 'Lithuanian',
|
||||
nativeName: 'lietuvių kalba',
|
||||
},
|
||||
lu: {
|
||||
name: 'Luba-Katanga',
|
||||
nativeName: 'Kiluba',
|
||||
},
|
||||
lv: {
|
||||
name: 'Latvian',
|
||||
nativeName: 'latviešu valoda',
|
||||
},
|
||||
mg: {
|
||||
name: 'Malagasy',
|
||||
nativeName: 'fiteny malagasy',
|
||||
},
|
||||
mh: {
|
||||
name: 'Marshallese',
|
||||
nativeName: 'Kajin M̧ajeļ',
|
||||
},
|
||||
mi: {
|
||||
name: 'Māori',
|
||||
nativeName: 'te reo Māori',
|
||||
},
|
||||
mk: {
|
||||
name: 'Macedonian',
|
||||
nativeName: 'македонски јазик',
|
||||
},
|
||||
ml: {
|
||||
name: 'Malayalam',
|
||||
nativeName: 'മലയാളം',
|
||||
},
|
||||
mn: {
|
||||
name: 'Mongolian',
|
||||
nativeName: 'Монгол хэл',
|
||||
},
|
||||
mr: {
|
||||
name: 'Marathi',
|
||||
nativeName: 'मराठी',
|
||||
},
|
||||
ms: {
|
||||
name: 'Malay',
|
||||
nativeName: 'Bahasa Melayu',
|
||||
},
|
||||
mt: {
|
||||
name: 'Maltese',
|
||||
nativeName: 'Malti',
|
||||
},
|
||||
my: {
|
||||
name: 'Burmese',
|
||||
nativeName: 'ဗမာစာ',
|
||||
},
|
||||
na: {
|
||||
name: 'Nauru',
|
||||
nativeName: 'Dorerin Naoero',
|
||||
},
|
||||
nb: {
|
||||
name: 'Norwegian Bokmål',
|
||||
nativeName: 'Norsk bokmål',
|
||||
},
|
||||
nd: {
|
||||
name: 'Northern Ndebele',
|
||||
nativeName: 'isiNdebele',
|
||||
},
|
||||
ne: {
|
||||
name: 'Nepali',
|
||||
nativeName: 'नेपाली',
|
||||
},
|
||||
ng: {
|
||||
name: 'Ndonga',
|
||||
nativeName: 'Owambo',
|
||||
},
|
||||
nl: {
|
||||
name: 'Dutch',
|
||||
nativeName: 'Nederlands',
|
||||
},
|
||||
nn: {
|
||||
name: 'Norwegian Nynorsk',
|
||||
nativeName: 'Norsk nynorsk',
|
||||
},
|
||||
no: {
|
||||
name: 'Norwegian',
|
||||
nativeName: 'Norsk',
|
||||
},
|
||||
nr: {
|
||||
name: 'Southern Ndebele',
|
||||
nativeName: 'isiNdebele',
|
||||
},
|
||||
nv: {
|
||||
name: 'Navajo',
|
||||
nativeName: 'Diné bizaad',
|
||||
},
|
||||
ny: {
|
||||
name: 'Chichewa',
|
||||
nativeName: 'chiCheŵa',
|
||||
},
|
||||
oc: {
|
||||
name: 'Occitan',
|
||||
nativeName: 'occitan',
|
||||
},
|
||||
oj: {
|
||||
name: 'Ojibwe',
|
||||
nativeName: 'ᐊᓂᔑᓈᐯᒧᐎᓐ',
|
||||
},
|
||||
om: {
|
||||
name: 'Oromo',
|
||||
nativeName: 'Afaan Oromoo',
|
||||
},
|
||||
or: {
|
||||
name: 'Oriya',
|
||||
nativeName: 'ଓଡ଼ିଆ',
|
||||
},
|
||||
os: {
|
||||
name: 'Ossetian',
|
||||
nativeName: 'ирон æвзаг',
|
||||
},
|
||||
pa: {
|
||||
name: 'Panjabi',
|
||||
nativeName: 'ਪੰਜਾਬੀ',
|
||||
},
|
||||
pi: {
|
||||
name: 'Pāli',
|
||||
nativeName: 'पाऴि',
|
||||
},
|
||||
pl: {
|
||||
name: 'Polish',
|
||||
nativeName: 'Polski',
|
||||
},
|
||||
ps: {
|
||||
name: 'Pashto',
|
||||
nativeName: 'پښتو',
|
||||
},
|
||||
pt: {
|
||||
name: 'Portuguese',
|
||||
nativeName: 'Português',
|
||||
},
|
||||
qu: {
|
||||
name: 'Quechua',
|
||||
nativeName: 'Runa Simi',
|
||||
|
||||
// asdfasdfasdfasdf
|
||||
},
|
||||
rm: {
|
||||
name: 'Romansh',
|
||||
nativeName: 'rumantsch grischun',
|
||||
},
|
||||
rn: {
|
||||
name: 'Kirundi',
|
||||
nativeName: 'Ikirundi',
|
||||
},
|
||||
ro: {
|
||||
name: 'Romanian',
|
||||
nativeName: 'Română',
|
||||
},
|
||||
ru: {
|
||||
name: 'Russian',
|
||||
nativeName: 'Русский',
|
||||
},
|
||||
rw: {
|
||||
name: 'Kinyarwanda',
|
||||
nativeName: 'Ikinyarwanda',
|
||||
},
|
||||
sa: {
|
||||
name: 'Sanskrit',
|
||||
nativeName: 'संस्कृतम्',
|
||||
},
|
||||
sc: {
|
||||
name: 'Sardinian',
|
||||
nativeName: 'sardu',
|
||||
},
|
||||
sd: {
|
||||
name: 'Sindhi',
|
||||
nativeName: 'सिन्धी',
|
||||
},
|
||||
se: {
|
||||
name: 'Northern Sami',
|
||||
nativeName: 'Davvisámegiella',
|
||||
},
|
||||
sg: {
|
||||
name: 'Sango',
|
||||
nativeName: 'yângâ tî sängö',
|
||||
},
|
||||
si: {
|
||||
name: 'Sinhala',
|
||||
nativeName: 'සිංහල',
|
||||
},
|
||||
sk: {
|
||||
name: 'Slovak',
|
||||
nativeName: 'slovenčina',
|
||||
},
|
||||
sl: {
|
||||
name: 'Slovenian',
|
||||
nativeName: 'slovenščina',
|
||||
},
|
||||
sm: {
|
||||
name: 'Samoan',
|
||||
nativeName: "gagana fa'a Samoa",
|
||||
},
|
||||
sn: {
|
||||
name: 'Shona',
|
||||
nativeName: 'chiShona',
|
||||
},
|
||||
so: {
|
||||
name: 'Somali',
|
||||
nativeName: 'Soomaaliga',
|
||||
},
|
||||
sq: {
|
||||
name: 'Albanian',
|
||||
nativeName: 'Shqip',
|
||||
},
|
||||
sr: {
|
||||
name: 'Serbian',
|
||||
nativeName: 'српски језик',
|
||||
},
|
||||
ss: {
|
||||
name: 'Swati',
|
||||
nativeName: 'SiSwati',
|
||||
},
|
||||
st: {
|
||||
name: 'Southern Sotho',
|
||||
nativeName: 'Sesotho',
|
||||
},
|
||||
su: {
|
||||
name: 'Sundanese',
|
||||
nativeName: 'Basa Sunda',
|
||||
},
|
||||
sv: {
|
||||
name: 'Swedish',
|
||||
nativeName: 'Svenska',
|
||||
},
|
||||
sw: {
|
||||
name: 'Swahili',
|
||||
nativeName: 'Kiswahili',
|
||||
},
|
||||
ta: {
|
||||
name: 'Tamil',
|
||||
nativeName: 'தமிழ்',
|
||||
},
|
||||
te: {
|
||||
name: 'Telugu',
|
||||
nativeName: 'తెలుగు',
|
||||
},
|
||||
tg: {
|
||||
name: 'Tajik',
|
||||
nativeName: 'тоҷикӣ',
|
||||
},
|
||||
th: {
|
||||
name: 'Thai',
|
||||
nativeName: 'ไทย',
|
||||
},
|
||||
ti: {
|
||||
name: 'Tigrinya',
|
||||
nativeName: 'ትግርኛ',
|
||||
},
|
||||
tk: {
|
||||
name: 'Turkmen',
|
||||
nativeName: 'Türkmençe',
|
||||
},
|
||||
tl: {
|
||||
name: 'Tagalog',
|
||||
nativeName: 'Wikang Tagalog',
|
||||
},
|
||||
tn: {
|
||||
name: 'Tswana',
|
||||
nativeName: 'Setswana',
|
||||
},
|
||||
to: {
|
||||
name: 'Tonga',
|
||||
nativeName: 'faka Tonga',
|
||||
},
|
||||
tr: {
|
||||
name: 'Turkish',
|
||||
nativeName: 'Türkçe',
|
||||
},
|
||||
ts: {
|
||||
name: 'Tsonga',
|
||||
nativeName: 'Xitsonga',
|
||||
},
|
||||
tt: {
|
||||
name: 'Tatar',
|
||||
nativeName: 'татар теле',
|
||||
},
|
||||
tw: {
|
||||
name: 'Twi',
|
||||
nativeName: 'Twi',
|
||||
},
|
||||
ty: {
|
||||
name: 'Tahitian',
|
||||
nativeName: 'Reo Tahiti',
|
||||
},
|
||||
ug: {
|
||||
name: 'Uyghur',
|
||||
nativeName: 'ئۇيغۇرچە',
|
||||
},
|
||||
uk: {
|
||||
name: 'Ukrainian',
|
||||
nativeName: 'Українська',
|
||||
},
|
||||
ur: {
|
||||
name: 'Urdu',
|
||||
nativeName: 'اردو',
|
||||
},
|
||||
uz: {
|
||||
name: 'Uzbek',
|
||||
nativeName: 'Ўзбек',
|
||||
},
|
||||
ve: {
|
||||
name: 'Venda',
|
||||
nativeName: 'Tshivenḓa',
|
||||
},
|
||||
vi: {
|
||||
name: 'Vietnamese',
|
||||
nativeName: 'Tiếng Việt',
|
||||
},
|
||||
vo: {
|
||||
name: 'Volapük',
|
||||
nativeName: 'Volapük',
|
||||
},
|
||||
wa: {
|
||||
name: 'Walloon',
|
||||
nativeName: 'walon',
|
||||
},
|
||||
wo: {
|
||||
name: 'Wolof',
|
||||
nativeName: 'Wollof',
|
||||
},
|
||||
xh: {
|
||||
name: 'Xhosa',
|
||||
nativeName: 'isiXhosa',
|
||||
},
|
||||
yi: {
|
||||
name: 'Yiddish',
|
||||
nativeName: 'ייִדיש',
|
||||
},
|
||||
yo: {
|
||||
name: 'Yoruba',
|
||||
nativeName: 'Yorùbá',
|
||||
},
|
||||
za: {
|
||||
name: 'Zhuang',
|
||||
nativeName: 'Saɯ cueŋƅ',
|
||||
},
|
||||
zh: {
|
||||
name: 'Chinese',
|
||||
nativeName: '中文',
|
||||
},
|
||||
zu: {
|
||||
name: 'Zulu',
|
||||
nativeName: 'isiZulu',
|
||||
},
|
||||
};
|
||||
@@ -17,12 +17,12 @@ import MenuItem from '@mui/material/MenuItem';
|
||||
import ClearIcon from '@mui/icons-material/Clear';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { UpdaterSubscription } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { Progress } from '@/modules/core/components/Progress.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { dateTimeFormatter } from '@/util/DateHelper.ts';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
|
||||
import { CategoryIdInfo } from '@/modules/category/Category.types.ts';
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import { OverridableComponent } from '@mui/material/OverridableComponent';
|
||||
import { SvgIconTypeMap } from '@mui/material/SvgIcon';
|
||||
import { IconMenuItem } from '@/modules/core/components/menu/IconMenuItem.tsx';
|
||||
import { getOptionForDirection } from '@/theme.tsx';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
|
||||
export type NestedMenuItemProps = Omit<MuiMenuItemProps, 'button'> & {
|
||||
parentMenuOpen: boolean;
|
||||
|
||||
@@ -26,7 +26,7 @@ import DialogContentText from '@mui/material/DialogContentText';
|
||||
import InfoIcon from '@mui/icons-material/Info';
|
||||
import { TextSetting, TextSettingProps } from '@/modules/core/components/settings/text/TextSetting.tsx';
|
||||
import { TextSettingDialog } from '@/modules/core/components/settings/text/TextSettingDialog.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
|
||||
const MutableListItem = ({
|
||||
handleDelete,
|
||||
|
||||
@@ -23,7 +23,7 @@ import { ThemeMode, ThemeModeContext } from '@/modules/theme/contexts/ThemeModeC
|
||||
import { NavBarContextProvider } from '@/modules/navigation-bar/contexts/NavBarContextProvider.tsx';
|
||||
import { LibraryOptionsContextProvider } from '@/modules/library/contexts/LibraryOptionsProvider.tsx';
|
||||
import { ActiveDeviceContextProvider } from '@/modules/device/contexts/DeviceContext.tsx';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
import { AppThemes, getTheme } from '@/modules/theme/services/AppThemes.ts';
|
||||
import { useMetadataServerSettings } from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { Dispatch, Reducer, SetStateAction, useCallback, useMemo, useReducer, useSyncExternalStore } from 'react';
|
||||
import { AppStorage, Storage } from '@/lib/AppStorage.ts';
|
||||
import { AppStorage, Storage } from '@/lib/storage/AppStorage.ts';
|
||||
|
||||
const subscribeToStorageUpdates = (callback: () => void) => {
|
||||
window.addEventListener('storage', callback);
|
||||
|
||||
51
src/modules/core/utils/AwaitableDialog.tsx
Normal file
51
src/modules/core/utils/AwaitableDialog.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { ThemeProvider } from '@mui/material/styles';
|
||||
import { ConfirmDialog } from '@/modules/core/components/ConfirmDialog.tsx';
|
||||
import { ControlledPromise } from '@/lib/ControlledPromise.ts';
|
||||
import { getCurrentTheme } from '@/theme.tsx';
|
||||
|
||||
export const awaitConfirmation = async (
|
||||
dialogProps: Omit<React.ComponentProps<typeof ConfirmDialog>, 'onCancel' | 'onConfirm'>,
|
||||
) => {
|
||||
const dialogContainer = document.createElement('div');
|
||||
document.body.appendChild(dialogContainer);
|
||||
|
||||
const root = createRoot(dialogContainer);
|
||||
|
||||
const confirmationPromise = new ControlledPromise();
|
||||
const handleConfirmation = (accepted: boolean) => {
|
||||
if (accepted) {
|
||||
confirmationPromise.resolve();
|
||||
} else {
|
||||
confirmationPromise.reject();
|
||||
}
|
||||
|
||||
root.unmount();
|
||||
document.body.removeChild(dialogContainer);
|
||||
};
|
||||
|
||||
root.render(
|
||||
<ThemeProvider theme={getCurrentTheme()}>
|
||||
<ConfirmDialog
|
||||
{...dialogProps}
|
||||
onExtra={() => {
|
||||
handleConfirmation(false);
|
||||
dialogProps.onExtra?.();
|
||||
}}
|
||||
onCancel={() => handleConfirmation(false)}
|
||||
onConfirm={() => handleConfirmation(true)}
|
||||
/>
|
||||
,
|
||||
</ThemeProvider>,
|
||||
);
|
||||
|
||||
return confirmationPromise.promise;
|
||||
};
|
||||
78
src/modules/core/utils/Languages.ts
Normal file
78
src/modules/core/utils/Languages.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { t } from 'i18next';
|
||||
import { ISOLanguage, IsoLanguages } from '@/modules/core/IsoLanguages.ts';
|
||||
|
||||
export enum DefaultLanguage {
|
||||
ALL = 'all',
|
||||
OTHER = 'other',
|
||||
LOCAL_SOURCE = 'localsourcelang',
|
||||
}
|
||||
|
||||
function getISOLanguage(code: string): ISOLanguage | null {
|
||||
if (IsoLanguages[code]) {
|
||||
return IsoLanguages[code];
|
||||
}
|
||||
|
||||
if (IsoLanguages[code.toLocaleLowerCase()]) {
|
||||
return IsoLanguages[code.toLocaleLowerCase()];
|
||||
}
|
||||
|
||||
const whereToCut = code.indexOf('-') !== -1 ? code.indexOf('-') : code.length;
|
||||
const processedCode = code.toLocaleLowerCase().substring(0, whereToCut);
|
||||
if (IsoLanguages[processedCode]) {
|
||||
return IsoLanguages[processedCode];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
export function getLanguage(code: string): { name: string; nativeName: string } {
|
||||
const isoLanguage = getISOLanguage(code);
|
||||
|
||||
if (isoLanguage) {
|
||||
return isoLanguage;
|
||||
}
|
||||
|
||||
return {
|
||||
name: t('global.language.label.language_with_code', { code }),
|
||||
nativeName: t('global.language.label.language_with_code', { code }),
|
||||
};
|
||||
}
|
||||
|
||||
export function langCodeToName(code: string): string {
|
||||
return getLanguage(code).nativeName;
|
||||
}
|
||||
|
||||
function defaultNativeLang() {
|
||||
return 'en'; // TODO: infer from the browser
|
||||
}
|
||||
|
||||
export function extensionDefaultLangs() {
|
||||
return [defaultNativeLang(), DefaultLanguage.ALL];
|
||||
}
|
||||
|
||||
export function sourceDefualtLangs() {
|
||||
return [defaultNativeLang(), DefaultLanguage.LOCAL_SOURCE];
|
||||
}
|
||||
|
||||
export function sourceForcedDefaultLangs(): string[] {
|
||||
return [DefaultLanguage.LOCAL_SOURCE];
|
||||
}
|
||||
|
||||
export const langSortCmp = (a: string, b: string) => {
|
||||
// puts english first for convience
|
||||
const aLang = langCodeToName(a);
|
||||
const bLang = langCodeToName(b);
|
||||
|
||||
if (a === 'en') return -1;
|
||||
if (b === 'en') return 1;
|
||||
|
||||
return aLang.localeCompare(bLang);
|
||||
};
|
||||
74
src/modules/core/utils/MediaQuery.tsx
Normal file
74
src/modules/core/utils/MediaQuery.tsx
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import useMediaQuery from '@mui/material/useMediaQuery';
|
||||
import { Breakpoint } from '@mui/material/styles';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { getCurrentTheme } from '@/theme.tsx';
|
||||
import { ThemeMode } from '@/modules/theme/contexts/ThemeModeContext.tsx';
|
||||
import { AppStorage } from '@/lib/storage/AppStorage.ts';
|
||||
import { useResizeObserver } from '@/modules/core/hooks/useResizeObserver.tsx';
|
||||
|
||||
export class MediaQuery {
|
||||
static useIsTouchDevice(): boolean {
|
||||
return useMediaQuery('not (pointer: fine)');
|
||||
}
|
||||
|
||||
static useIsBelowWidth(breakpoint: Breakpoint): boolean {
|
||||
return useMediaQuery(getCurrentTheme().breakpoints.down(breakpoint));
|
||||
}
|
||||
|
||||
static useIsMobileWidth(): boolean {
|
||||
return this.useIsBelowWidth('sm');
|
||||
}
|
||||
|
||||
static useGetScrollbarSize(type: 'height' | 'width'): number {
|
||||
const [scrollbarSize, setScrollbarSize] = useState(0);
|
||||
|
||||
useResizeObserver(
|
||||
document.documentElement,
|
||||
useCallback(() => {
|
||||
const height = window.innerHeight - document.documentElement.clientHeight;
|
||||
const width = window.innerWidth - document.documentElement.clientWidth;
|
||||
const size = type === 'height' ? height : width;
|
||||
|
||||
setScrollbarSize(size);
|
||||
}, []),
|
||||
);
|
||||
|
||||
return scrollbarSize;
|
||||
}
|
||||
|
||||
static getSystemThemeMode(): Exclude<ThemeMode, 'system'> {
|
||||
const prefersDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
return prefersDarkMode ? ThemeMode.DARK : ThemeMode.LIGHT;
|
||||
}
|
||||
|
||||
static getThemeMode(): Exclude<ThemeMode, 'system'> {
|
||||
const themeMode = AppStorage.local.getItemParsed<ThemeMode>('themeMode', ThemeMode.SYSTEM);
|
||||
|
||||
const isSystemMode = themeMode === ThemeMode.SYSTEM;
|
||||
if (isSystemMode) {
|
||||
return this.getSystemThemeMode();
|
||||
}
|
||||
|
||||
return themeMode;
|
||||
}
|
||||
|
||||
static listenToSystemThemeChange(onChange: (themeMode: Exclude<ThemeMode, 'system'>) => void): () => void {
|
||||
const handleSystemThemeModeChange = (e: MediaQueryListEvent) => {
|
||||
onChange(e.matches ? ThemeMode.DARK : ThemeMode.LIGHT);
|
||||
};
|
||||
|
||||
const matchSystemThemeMode = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
|
||||
matchSystemThemeMode.addEventListener('change', handleSystemThemeModeChange);
|
||||
|
||||
return () => matchSystemThemeMode.removeEventListener('change', handleSystemThemeModeChange);
|
||||
}
|
||||
}
|
||||
19
src/modules/core/utils/Toast.ts
Normal file
19
src/modules/core/utils/Toast.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { enqueueSnackbar, OptionsObject, SnackbarKey } from 'notistack';
|
||||
|
||||
export function makeToast(message: string, severity?: OptionsObject['variant']): SnackbarKey;
|
||||
export function makeToast(message: string, options?: OptionsObject): SnackbarKey;
|
||||
export function makeToast(message: string, options: OptionsObject['variant'] | OptionsObject = 'default'): SnackbarKey {
|
||||
if (typeof options === 'string') {
|
||||
return enqueueSnackbar(message, { variant: options });
|
||||
}
|
||||
|
||||
return enqueueSnackbar(message, options);
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
updateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { MutableListSetting } from '@/modules/core/components/settings/MutableListSetting.tsx';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { DeviceContext } from '@/modules/device/contexts/DeviceContext.tsx';
|
||||
|
||||
@@ -14,7 +14,7 @@ import Switch from '@mui/material/Switch';
|
||||
import { NumberSetting } from '@/modules/core/components/settings/NumberSetting.tsx';
|
||||
import { getPersistedServerSetting, usePersistedValue } from '@/modules/core/hooks/usePersistedValue.tsx';
|
||||
import { updateMetadataServerSettings } from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { MetadataDownloadSettings } from '@/modules/downloads/Downloads.types.ts';
|
||||
import { MetadataServerSettings } from '@/modules/settings/Settings.types.ts';
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import CardContent from '@mui/material/CardContent';
|
||||
import Refresh from '@mui/icons-material/Refresh';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { StrictModeDroppable } from '@/modules/core/components/StrictModeDroppable.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { DownloadStateIndicator } from '@/modules/core/components/DownloadStateIndicator.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { DeleteChaptersWhileReadingSetting } from '@/modules/downloads/components/DeleteChaptersWhileReadingSetting.tsx';
|
||||
import { CategoriesInclusionSetting } from '@/modules/category/components/CategoriesInclusionSetting.tsx';
|
||||
import { NumberSetting } from '@/modules/core/components/settings/NumberSetting.tsx';
|
||||
|
||||
@@ -16,7 +16,7 @@ import Box from '@mui/material/Box';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { SpinnerImage } from '@/modules/core/components/SpinnerImage.tsx';
|
||||
import { TExtension } from '@/modules/extension/services/Extensions.ts';
|
||||
import { TranslationKey } from '@/Base.types.ts';
|
||||
|
||||
@@ -18,7 +18,7 @@ import Typography from '@mui/material/Typography';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { extensionDefaultLangs, DefaultLanguage, langSortCmp } from '@/lib/Languages.tsx';
|
||||
import { extensionDefaultLangs, DefaultLanguage, langSortCmp } from '@/modules/core/utils/Languages.ts';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import {
|
||||
ExtensionState,
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
} from '@/modules/extension/services/Extensions.ts';
|
||||
import { AppbarSearch } from '@/modules/core/components/AppbarSearch.tsx';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { LangSelect } from '@/modules/core/components/inputs/LangSelect.tsx';
|
||||
import { ExtensionCard } from '@/modules/extension/components/ExtensionCard.tsx';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { t } from 'i18next';
|
||||
import { DefaultLanguage, langCodeToName } from '@/lib/Languages.tsx';
|
||||
import { DefaultLanguage, langCodeToName } from '@/modules/core/utils/Languages.ts';
|
||||
import { ExtensionType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { TranslationKey } from '@/Base.types.ts';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import Box from '@mui/material/Box';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { langSortCmp, sourceDefualtLangs, sourceForcedDefaultLangs } from '@/lib/Languages.tsx';
|
||||
import { langSortCmp, sourceDefualtLangs, sourceForcedDefaultLangs } from '@/modules/core/utils/Languages.ts';
|
||||
import { translateExtensionLanguage } from '@/modules/extension/services/Extensions.ts';
|
||||
import { AppbarSearch } from '@/modules/core/components/AppbarSearch.tsx';
|
||||
import { LangSelect } from '@/modules/core/components/inputs/LangSelect.tsx';
|
||||
|
||||
@@ -22,7 +22,7 @@ import { GetTrackersSettingsQuery, MangaStatus } from '@/lib/graphql/generated/g
|
||||
import { GET_TRACKERS_SETTINGS } from '@/lib/graphql/queries/TrackerQuery.ts';
|
||||
import { statusToTranslationKey } from '@/modules/manga/services/Mangas.ts';
|
||||
import { createUpdateCategoryMetadata, getCategoryMetadata } from '@/modules/category/services/CategoryMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useMemo } from 'react';
|
||||
import { useMetadataServerSettings } from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { ChapterType, MangaType, SourceType, TrackRecordType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { MangaChapterCountInfo, MangaIdInfo } from '@/modules/manga/services/Mangas.ts';
|
||||
import { enhancedCleanup } from '@/lib/data/Strings.ts';
|
||||
import { enhancedCleanup } from '@/util/Strings.ts';
|
||||
import { getCategoryMetadata } from '@/modules/category/services/CategoryMetadata.ts';
|
||||
import { NullAndUndefined } from '@/Base.types.ts';
|
||||
import { LibraryOptions, LibrarySortMode } from '@/modules/library/Library.types.ts';
|
||||
|
||||
@@ -35,7 +35,7 @@ import { GET_MANGAS_DUPLICATES } from '@/lib/graphql/queries/MangaQuery.ts';
|
||||
import { BaseMangaGrid } from '@/modules/manga/components/BaseMangaGrid.tsx';
|
||||
import { IMangaGridProps } from '@/modules/manga/components/MangaGrid.tsx';
|
||||
import { StyledGroupItemWrapper } from '@/modules/core/components/virtuoso/StyledGroupItemWrapper.tsx';
|
||||
import { enhancedCleanup } from '@/lib/data/Strings.ts';
|
||||
import { enhancedCleanup } from '@/util/Strings.ts';
|
||||
|
||||
const findDuplicatesByTitle = <Manga extends Pick<MangaType, 'title'>>(
|
||||
libraryMangas: Manga[],
|
||||
|
||||
@@ -17,7 +17,7 @@ import ListSubheader from '@mui/material/ListSubheader';
|
||||
import { t as translate } from 'i18next';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { GlobalUpdateSettings } from '@/modules/settings/components/globalUpdate/GlobalUpdateSettings.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import Button from '@mui/material/Button';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { MangaCardMode } from '@/modules/manga/MangaCard.types.tsx';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
import { useLibraryOptionsContext } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||
|
||||
const BadgeContainer = styled('div')(({ theme }) => ({
|
||||
|
||||
@@ -26,7 +26,7 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
||||
import OpenInFullIcon from '@mui/icons-material/OpenInFull';
|
||||
import Modal from '@mui/material/Modal';
|
||||
import { bindPopover, bindTrigger, usePopupState } from 'material-ui-popup-state/hooks';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import {
|
||||
Mangas,
|
||||
MangaThumbnailInfo,
|
||||
|
||||
@@ -28,7 +28,7 @@ import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx
|
||||
import { useLocalStorage, useSessionStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { SelectableCollectionReturnType } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
||||
import { DEFAULT_FULL_FAB_HEIGHT } from '@/modules/core/components/buttons/StyledFab.tsx';
|
||||
import { AppStorage } from '@/lib/AppStorage.ts';
|
||||
import { AppStorage } from '@/lib/storage/AppStorage.ts';
|
||||
import { MangaCardProps } from '@/modules/manga/MangaCard.types.tsx';
|
||||
import { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { useResizeObserver } from '@/modules/core/hooks/useResizeObserver.tsx';
|
||||
|
||||
@@ -16,7 +16,7 @@ import MoreVertIcon from '@mui/icons-material/MoreVert';
|
||||
import { PopupState } from 'material-ui-popup-state/hooks';
|
||||
import { bindTrigger } from 'material-ui-popup-state';
|
||||
import { SelectableCollectionReturnType } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
import { MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
export const MangaOptionButton = forwardRef(
|
||||
|
||||
@@ -13,7 +13,7 @@ import PopupState, { bindDialog, bindTrigger } from 'material-ui-popup-state';
|
||||
import Dialog from '@mui/material/Dialog';
|
||||
import CheckIcon from '@mui/icons-material/Check';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { TrackManga } from '@/modules/tracker/components/TrackManga.tsx';
|
||||
import { Trackers } from '@/modules/tracker/services/Trackers.ts';
|
||||
import { CustomIconButton } from '@/modules/core/components/buttons/CustomIconButton.tsx';
|
||||
|
||||
@@ -12,12 +12,12 @@ import { useNavigate } from 'react-router-dom';
|
||||
import gql from 'graphql-tag';
|
||||
import { useCategorySelect } from '@/modules/category/hooks/useCategorySelect.tsx';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { getMetadataServerSettings } from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { Categories } from '@/modules/category/services/Categories.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { Mangas } from '@/modules/manga/services/Mangas.ts';
|
||||
import { awaitConfirmation } from '@/lib/ui/AwaitableDialog.tsx';
|
||||
import { awaitConfirmation } from '@/modules/core/utils/AwaitableDialog.tsx';
|
||||
import { GetCategoriesBaseQuery, GetCategoriesBaseQueryVariables, MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_CATEGORIES_BASE } from '@/lib/graphql/queries/CategoryQuery.ts';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { useCallback, useState } from 'react';
|
||||
import { ApolloError } from '@apollo/client';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { baseCleanup } from '@/lib/data/Strings.ts';
|
||||
import { baseCleanup } from '@/util/Strings.ts';
|
||||
|
||||
export const useRefreshManga = (mangaId: string) => {
|
||||
const [fetchingOnline, setFetchingOnline] = useState(false);
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
UpdateMangaCategoriesPatchInput,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { Chapters } from '@/modules/chapter/services/Chapters.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { getMetadataServerSettings } from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { GET_MANGAS_BASE } from '@/lib/graphql/queries/MangaQuery.ts';
|
||||
import { MANGA_BASE_FIELDS } from '@/lib/graphql/fragments/MangaFragments.ts';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { useState } from 'react';
|
||||
import FormGroup from '@mui/material/FormGroup';
|
||||
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
||||
import { Mangas, MigrateMode } from '@/modules/manga/services/Mangas.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { useNavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
|
||||
const getMigratableSources = (
|
||||
|
||||
@@ -29,7 +29,7 @@ import { useTheme } from '@mui/material/styles';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { useBackButton } from '@/modules/core/hooks/useBackButton.ts';
|
||||
import { useGetOptionForDirection } from '@/theme.tsx';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
import { DesktopSideBar } from '@/modules/navigation-bar/components/DesktopSideBar.tsx';
|
||||
import { useResizeObserver } from '@/modules/core/hooks/useResizeObserver.tsx';
|
||||
import { MobileBottomBar } from '@/modules/navigation-bar/components/MobileBottomBar.tsx';
|
||||
|
||||
@@ -11,7 +11,7 @@ import Box from '@mui/material/Box';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import useMediaQuery from '@mui/material/useMediaQuery';
|
||||
import { SpinnerImage } from '@/modules/core/components/SpinnerImage.tsx';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
import { IReaderSettings, ReaderType } from '@/modules/reader/Reader.types.ts';
|
||||
|
||||
export const isHorizontalReaderType = (readerType: ReaderType): boolean =>
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
useDefaultReaderSettings,
|
||||
} from '@/modules/reader/services/ReaderSettingsMetadata.ts';
|
||||
import { ReaderSettingsOptions } from '@/modules/reader/components/ReaderSettingsOptions.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||
|
||||
@@ -24,7 +24,7 @@ import { PagedPager } from '@/modules/reader/components/pager/PagedPager.tsx';
|
||||
import { DoublePagedPager } from '@/modules/reader/components/pager/DoublePagedPager.tsx';
|
||||
import { VerticalPager } from '@/modules/reader/components/pager/VerticalPager.tsx';
|
||||
import { ReaderNavBar } from '@/modules/reader/components/ReaderNavBar.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { useDebounce } from '@/modules/core/hooks/useDebounce.ts';
|
||||
import {
|
||||
@@ -41,7 +41,7 @@ import { GET_CHAPTERS_READER } from '@/lib/graphql/queries/ChapterQuery.ts';
|
||||
import { GET_MANGA_READER } from '@/lib/graphql/queries/MangaQuery.ts';
|
||||
import { TMangaReader } from '@/modules/manga/services/Mangas.ts';
|
||||
import { CHAPTER_READER_FIELDS } from '@/lib/graphql/fragments/ChapterFragments.ts';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
import { IReaderSettings, ReaderType } from '@/modules/reader/Reader.types.ts';
|
||||
import { DirectionOffset } from '@/Base.types.ts';
|
||||
import { AllowedMetadataValueTypes } from '@/modules/metadata/Metadata.types.ts';
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import { GlobalUpdateSettingsEntries } from '@/modules/settings/components/globalUpdate/GlobalUpdateSettingsEntries.tsx';
|
||||
import { GlobalUpdateSettingsInterval } from '@/modules/settings/components/globalUpdate/GlobalUpdateSettingsInterval.tsx';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { ServerSettings } from '@/modules/settings/Settings.types.ts';
|
||||
|
||||
type LibrarySettingsType = Pick<ServerSettings, 'updateMangas'>;
|
||||
|
||||
@@ -17,7 +17,7 @@ import DialogActions from '@mui/material/DialogActions';
|
||||
import DialogContent from '@mui/material/DialogContent';
|
||||
import DialogTitle from '@mui/material/DialogTitle';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { CheckboxContainer } from '@/modules/core/components/inputs/CheckboxContainer.ts';
|
||||
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
||||
import { TranslationKey } from '@/Base.types.ts';
|
||||
|
||||
@@ -18,11 +18,11 @@ import Link from '@mui/material/Link';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { ThemeMode, ThemeModeContext } from '@/modules/theme/contexts/ThemeModeContext.tsx';
|
||||
import { Select } from '@/modules/core/components/inputs/Select.tsx';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
import { NumberSetting } from '@/modules/core/components/settings/NumberSetting.tsx';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { I18nResourceCode, i18nResources } from '@/i18n';
|
||||
import { langCodeToName } from '@/lib/Languages.tsx';
|
||||
import { langCodeToName } from '@/modules/core/utils/Languages.ts';
|
||||
import { getTheme } from '@/modules/theme/services/AppThemes.ts';
|
||||
import { ThemeList } from '@/modules/theme/components/ThemeList.tsx';
|
||||
import {
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { MetadataThemeSettings } from '@/modules/theme/AppTheme.types.ts';
|
||||
|
||||
export const Appearance = () => {
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { MetadataUpdateSettings } from '@/modules/app-updates/AppUpdateChecker.types.ts';
|
||||
import { ServerSettings as GqlServerSettings } from '@/modules/settings/Settings.types.ts';
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import PaletteIcon from '@mui/icons-material/Palette';
|
||||
import { ListItemLink } from '@/modules/core/components/ListItemLink.tsx';
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
|
||||
export function Settings() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { MetadataUpdateSettings } from '@/modules/app-updates/AppUpdateChecker.types.ts';
|
||||
import { ServerSettings } from '@/modules/settings/Settings.types.ts';
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import { translateExtensionLanguage } from '@/modules/extension/services/Extensi
|
||||
import { SourceContentType } from '@/modules/source/screens/SourceMangas.tsx';
|
||||
import { SpinnerImage } from '@/modules/core/components/SpinnerImage.tsx';
|
||||
import { GetSourcesListQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
|
||||
interface IProps {
|
||||
source: GetSourcesListQuery['sources']['nodes'][number];
|
||||
|
||||
@@ -36,7 +36,7 @@ import { TriStateFilter } from '@/modules/source/components/filters/TriStateFilt
|
||||
import { GroupFilter } from '@/modules/source/components/filters/GroupFilter.tsx';
|
||||
import { SeparatorFilter } from '@/modules/source/components/filters/SeparatorFilter.tsx';
|
||||
import { StyledFab } from '@/modules/core/components/buttons/StyledFab.tsx';
|
||||
import { awaitConfirmation } from '@/lib/ui/AwaitableDialog.tsx';
|
||||
import { awaitConfirmation } from '@/modules/core/utils/AwaitableDialog.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { ISourceMetadata, SourceFilters } from '@/modules/source/Source.types.ts';
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { GetCategoriesSettingsQueryVariables, GetSourceSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_SOURCE_SETTINGS } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { PreferenceProps } from '@/modules/source/Source.types.ts';
|
||||
|
||||
function getPrefComponent(type: string) {
|
||||
|
||||
@@ -39,10 +39,10 @@ import {
|
||||
import { NavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx';
|
||||
import { useMetadataServerSettings } from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { useLocalStorage, useSessionStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { AppStorage } from '@/lib/AppStorage.ts';
|
||||
import { AppStorage } from '@/lib/storage/AppStorage.ts';
|
||||
import { getGridSnapshotKey } from '@/modules/manga/components/MangaGrid.tsx';
|
||||
import { createUpdateSourceMetadata, getSourceMetadata } from '@/modules/source/services/SourceMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { GET_SOURCE_BROWSE } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||
import { MangaIdInfo } from '@/modules/manga/services/Mangas.ts';
|
||||
import { TranslationKey } from '@/Base.types.ts';
|
||||
|
||||
@@ -15,7 +15,12 @@ import { useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { sourceDefualtLangs, sourceForcedDefaultLangs, langSortCmp, DefaultLanguage } from '@/lib/Languages.tsx';
|
||||
import {
|
||||
sourceDefualtLangs,
|
||||
sourceForcedDefaultLangs,
|
||||
langSortCmp,
|
||||
DefaultLanguage,
|
||||
} from '@/modules/core/utils/Languages.ts';
|
||||
import { translateExtensionLanguage } from '@/modules/extension/services/Extensions.ts';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { SourceCard } from '@/modules/source/components/SourceCard.tsx';
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { EmptyView } from '@/modules/core/components/placeholder/EmptyView.tsx';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { EmptyView } from '@/modules/core/components/placeholder/EmptyView.tsx';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
|
||||
@@ -23,7 +23,7 @@ import { ThemeModeContext } from '@/modules/theme/contexts/ThemeModeContext.tsx'
|
||||
import { AppTheme, hasMissingFonts, loadThemeFonts } from '@/modules/theme/services/AppThemes.ts';
|
||||
import { createTheme } from '@/theme.tsx';
|
||||
import { ThemeCreationDialog } from '@/modules/theme/components/CreateThemeDialog.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { TypographyMaxLines } from '@/modules/core/components/TypographyMaxLines.tsx';
|
||||
|
||||
const ThemePreviewBadge = styled(Box)(() => ({
|
||||
|
||||
@@ -16,7 +16,7 @@ import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { Trackers } from '@/modules/tracker/services/Trackers.ts';
|
||||
import { TrackerCard, TrackerMode } from '@/modules/tracker/components/cards/TrackerCard.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { GetMangaTrackRecordsQuery, GetTrackersBindQuery, MangaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_TRACKERS_BIND } from '@/lib/graphql/queries/TrackerQuery.ts';
|
||||
|
||||
@@ -26,7 +26,7 @@ import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { Tracker, TTrackerBase } from '@/modules/tracker/services/Trackers.ts';
|
||||
import { SearchTextField } from '@/modules/core/components/inputs/SearchTextField.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { TrackerMangaCard } from '@/modules/tracker/components/cards/TrackerMangaCard.tsx';
|
||||
import { DIALOG_PADDING } from '@/modules/tracker/Tracker.constants.ts';
|
||||
import { useGetOptionForDirection } from '@/theme.tsx';
|
||||
|
||||
@@ -22,7 +22,7 @@ import TextField from '@mui/material/TextField';
|
||||
import DialogActions from '@mui/material/DialogActions';
|
||||
import Button from '@mui/material/Button';
|
||||
import { PasswordTextField } from '@/modules/core/components/inputs/PasswordTextField.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { Trackers, TTrackerSearch } from '@/modules/tracker/services/Trackers.ts';
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import { Trackers, TTrackerBind, TTrackRecordBind, UNSET_DATE } from '@/modules/
|
||||
import { ListPreference } from '@/modules/source/components/sourceConfiguration/ListPreference.tsx';
|
||||
import { NumberSetting } from '@/modules/core/components/settings/NumberSetting.tsx';
|
||||
import { DateSetting } from '@/modules/core/components/settings/DateSetting.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { Menu } from '@/modules/core/components/menu/Menu.tsx';
|
||||
import { CARD_STYLING } from '@/modules/tracker/Tracker.constants.ts';
|
||||
import { TypographyMaxLines } from '@/modules/core/components/TypographyMaxLines.tsx';
|
||||
|
||||
@@ -25,7 +25,7 @@ import sanitizeHtml from 'sanitize-html';
|
||||
import { SpinnerImage } from '@/modules/core/components/SpinnerImage.tsx';
|
||||
import { TypographyMaxLines } from '@/modules/core/components/TypographyMaxLines.tsx';
|
||||
import { Metadata } from '@/modules/core/components/Metadata.tsx';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
import { MediaQuery } from '@/modules/core/utils/MediaQuery.tsx';
|
||||
import { TTrackerManga } from '@/modules/tracker/services/Trackers.ts';
|
||||
|
||||
const TrackerMangaCardTitle = ({ title, selected }: { title: string; selected: boolean }) => (
|
||||
|
||||
@@ -10,7 +10,7 @@ import { useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
|
||||
export const TrackerOAuthLogin = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
createUpdateMetadataServerSettings,
|
||||
useMetadataServerSettings,
|
||||
} from '@/modules/settings/services/ServerSettingsMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { GET_TRACKERS_SETTINGS } from '@/lib/graphql/queries/TrackerQuery.ts';
|
||||
import { GetTrackersSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
@@ -35,7 +35,7 @@ import { dateTimeFormatter, epochToDate, getDateString } from '@/util/DateHelper
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { TypographyMaxLines } from '@/modules/core/components/TypographyMaxLines.tsx';
|
||||
import { ChapterIdInfo, ChapterMangaInfo } from '@/modules/chapter/services/Chapters.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||
|
||||
const groupByDate = (updates: Pick<ChapterType, 'fetchedAt'>[]): [date: string, items: number][] => {
|
||||
if (!updates.length) {
|
||||
|
||||
Reference in New Issue
Block a user