fix all imports for new structure

This commit is contained in:
jeffvli 2025-05-20 19:23:36 -07:00
parent 249eaf89f8
commit 930165d006
291 changed files with 2056 additions and 1894 deletions

View file

@ -7,15 +7,14 @@ import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';
import i18n from '/@/i18n/i18n';
import { ScrollArea, Spinner, Text, TextInput } from '/@/renderer/components';
import { useLyricSearch } from '/@/renderer/features/lyrics/queries/lyric-search-query';
import {
InternetProviderLyricSearchResponse,
LyricSource,
LyricsOverride,
} from '../../../api/types';
import { useLyricSearch } from '../queries/lyric-search-query';
import i18n from '/@/i18n/i18n';
import { ScrollArea, Spinner, Text, TextInput } from '/@/renderer/components';
} from '/@/shared/types/domain-types';
const SearchItem = styled.button`
all: unset;

View file

@ -3,7 +3,6 @@ import isElectron from 'is-electron';
import { useTranslation } from 'react-i18next';
import { RiAddFill, RiSubtractFill } from 'react-icons/ri';
import { LyricsOverride } from '/@/renderer/api/types';
import { Button, NumberInput, Tooltip } from '/@/renderer/components';
import { openLyricSearchModal } from '/@/renderer/features/lyrics/components/lyrics-search-form';
import {
@ -12,6 +11,7 @@ import {
useSettingsStore,
useSettingsStoreActions,
} from '/@/renderer/store';
import { LyricsOverride } from '/@/shared/types/domain-types';
interface LyricsActionsProps {
index: number;

View file

@ -6,21 +6,26 @@ import { useTranslation } from 'react-i18next';
import { RiInformationFill } from 'react-icons/ri';
import styled from 'styled-components';
import { useSongLyricsByRemoteId, useSongLyricsBySong } from './queries/lyric-query';
import { translateLyrics } from './queries/lyric-translate';
import { SynchronizedLyrics, SynchronizedLyricsProps } from './synchronized-lyrics';
import { queryKeys } from '/@/renderer/api/query-keys';
import { FullLyricsMetadata, LyricSource, LyricsOverride } from '/@/renderer/api/types';
import { Spinner, TextTitle } from '/@/renderer/components';
import { ErrorFallback } from '/@/renderer/features/action-required';
import { LyricsActions } from '/@/renderer/features/lyrics/lyrics-actions';
import {
useSongLyricsByRemoteId,
useSongLyricsBySong,
} from '/@/renderer/features/lyrics/queries/lyric-query';
import { translateLyrics } from '/@/renderer/features/lyrics/queries/lyric-translate';
import {
SynchronizedLyrics,
SynchronizedLyricsProps,
} from '/@/renderer/features/lyrics/synchronized-lyrics';
import {
UnsynchronizedLyrics,
UnsynchronizedLyricsProps,
} from '/@/renderer/features/lyrics/unsynchronized-lyrics';
import { queryClient } from '/@/renderer/lib/react-query';
import { useCurrentSong, useLyricsSettings, usePlayerStore } from '/@/renderer/store';
import { FullLyricsMetadata, LyricSource, LyricsOverride } from '/@/shared/types/domain-types';
const ActionsContainer = styled.div`
position: absolute;

View file

@ -2,8 +2,10 @@ import { useQuery, useQueryClient, UseQueryResult } from '@tanstack/react-query'
import isElectron from 'is-electron';
import { api } from '/@/renderer/api';
import { ServerFeature } from '/@/renderer/api/features-types';
import { queryKeys } from '/@/renderer/api/query-keys';
import { QueryHookArgs } from '/@/renderer/lib/react-query';
import { getServerById, useLyricsSettings } from '/@/renderer/store';
import { hasFeature } from '/@/shared/api/utils';
import {
FullLyricsMetadata,
InternetProviderLyricResponse,
@ -13,10 +15,8 @@ import {
ServerType,
StructuredLyric,
SynchronizedLyricsArray,
} from '/@/renderer/api/types';
import { hasFeature } from '/@/renderer/api/utils';
import { QueryHookArgs } from '/@/renderer/lib/react-query';
import { getServerById, useLyricsSettings } from '/@/renderer/store';
} from '/@/shared/types/domain-types';
import { ServerFeature } from '/@/shared/types/features-types';
const lyricsIpc = isElectron() ? window.api.lyrics : null;

View file

@ -2,12 +2,12 @@ import { useQuery } from '@tanstack/react-query';
import isElectron from 'is-electron';
import { queryKeys } from '/@/renderer/api/query-keys';
import { QueryHookArgs } from '/@/renderer/lib/react-query';
import {
InternetProviderLyricSearchResponse,
LyricSearchQuery,
LyricSource,
} from '/@/renderer/api/types';
import { QueryHookArgs } from '/@/renderer/lib/react-query';
} from '/@/shared/types/domain-types';
const lyricsIpc = isElectron() ? window.api.lyrics : null;

View file

@ -2,7 +2,6 @@ import isElectron from 'is-electron';
import { useCallback, useEffect, useRef } from 'react';
import styled from 'styled-components';
import { FullLyricsMetadata, SynchronizedLyricsArray } from '/@/renderer/api/types';
import { LyricLine } from '/@/renderer/features/lyrics/lyric-line';
import { useScrobble } from '/@/renderer/features/player/hooks/use-scrobble';
import { PlayersRef } from '/@/renderer/features/player/ref/players-ref';
@ -16,7 +15,8 @@ import {
useSeeked,
useSetCurrentTime,
} from '/@/renderer/store';
import { PlaybackType, PlayerStatus } from '/@/renderer/types';
import { FullLyricsMetadata, SynchronizedLyricsArray } from '/@/shared/types/domain-types';
import { PlaybackType, PlayerStatus } from '/@/shared/types/types';
const mpvPlayer = isElectron() ? window.api.mpvPlayer : null;
const utils = isElectron() ? window.api.utils : null;
@ -31,7 +31,6 @@ const SynchronizedLyricsContainer = styled.div<{ $gap: number }>`
padding: 10vh 0 50vh;
overflow: scroll;
word-break: break-word;
transform: translateY(-2rem);
-webkit-mask-image: linear-gradient(
180deg,
@ -48,6 +47,7 @@ const SynchronizedLyricsContainer = styled.div<{ $gap: number }>`
rgb(0 0 0 / 100%) 85%,
transparent 95%
);
transform: translateY(-2rem);
@media screen and (orientation: portrait) {
padding: 5vh 0;
@ -96,12 +96,12 @@ export const SynchronizedLyrics = ({
const seeked = useSeeked();
// A reference to the timeout handler
const lyricTimer = useRef<ReturnType<typeof setTimeout>>();
const lyricTimer = useRef<null | ReturnType<typeof setTimeout>>(null);
// A reference to the lyrics. This is necessary for the
// timers, which are not part of react necessarily, to always
// have the most updated values
const lyricRef = useRef<SynchronizedLyricsArray>();
const lyricRef = useRef<null | SynchronizedLyricsArray>(null);
// A constantly increasing value, used to tell timers that may be out of date
// whether to proceed or stop
@ -178,7 +178,7 @@ export const SynchronizedLyrics = ({
.forEach((node) => node.classList.remove('active'));
if (index === -1) {
lyricRef.current = undefined;
lyricRef.current = null;
return;
}
@ -187,10 +187,10 @@ export const SynchronizedLyrics = ({
) as HTMLElement;
const currentLyric = document.querySelector(`#lyric-${index}`) as HTMLElement;
const offsetTop = currentLyric?.offsetTop - doc?.clientHeight / 2 ?? 0;
const offsetTop = currentLyric?.offsetTop - doc?.clientHeight / 2 || 0;
if (currentLyric === null) {
lyricRef.current = undefined;
lyricRef.current = null;
return;
}

View file

@ -1,9 +1,9 @@
import { useMemo } from 'react';
import styled from 'styled-components';
import { FullLyricsMetadata } from '/@/renderer/api/types';
import { LyricLine } from '/@/renderer/features/lyrics/lyric-line';
import { useLyricsSettings } from '/@/renderer/store';
import { FullLyricsMetadata } from '/@/shared/types/domain-types';
export interface UnsynchronizedLyricsProps extends Omit<FullLyricsMetadata, 'lyrics'> {
lyrics: string;
@ -18,7 +18,6 @@ const UnsynchronizedLyricsContainer = styled.div<{ $gap: number }>`
height: 100%;
padding: 10vh 0 6vh;
overflow: scroll;
transform: translateY(-2rem);
-webkit-mask-image: linear-gradient(
180deg,
@ -35,6 +34,7 @@ const UnsynchronizedLyricsContainer = styled.div<{ $gap: number }>`
rgb(0 0 0 / 100%) 85%,
transparent 95%
);
transform: translateY(-2rem);
@media screen and (orientation: portrait) {
padding: 5vh 0;