22// #warning Using local Apple Music Like Lyrics, skip importing css style
33// #else
44import "@applemusic-like-lyrics/core/style.css" ;
5+
56// #endif
67
8+ import { audioEngine } from "$/modules/audio/audio-engine" ;
9+ import { audioPlayingAtom , currentTimeAtom } from "$/modules/audio/states" ;
10+ import {
11+ hideObsceneWordsAtom ,
12+ lyricWordFadeWidthAtom ,
13+ showRomanLinesAtom ,
14+ showTranslationLinesAtom ,
15+ } from "$/modules/settings/states/preview" ;
16+ import { isDarkThemeAtom , lyricLinesAtom } from "$/states/main.ts" ;
17+ import { MaskObsceneWordsMode } from "@applemusic-like-lyrics/core" ;
718import {
819 LyricPlayer ,
920 type LyricPlayerRef ,
@@ -13,14 +24,6 @@ import structuredClone from "@ungap/structured-clone";
1324import classNames from "classnames" ;
1425import { useAtomValue } from "jotai" ;
1526import { memo , useEffect , useMemo , useRef } from "react" ;
16- import { audioEngine } from "$/modules/audio/audio-engine" ;
17- import { audioPlayingAtom , currentTimeAtom } from "$/modules/audio/states" ;
18- import {
19- lyricWordFadeWidthAtom ,
20- showRomanLinesAtom ,
21- showTranslationLinesAtom ,
22- } from "$/modules/settings/states/preview" ;
23- import { isDarkThemeAtom , lyricLinesAtom } from "$/states/main.ts" ;
2427import styles from "./index.module.css" ;
2528
2629export const AMLLWrapper = memo ( ( ) => {
@@ -30,6 +33,7 @@ export const AMLLWrapper = memo(() => {
3033 const darkMode = useAtomValue ( isDarkThemeAtom ) ;
3134 const showTranslationLines = useAtomValue ( showTranslationLinesAtom ) ;
3235 const showRomanLines = useAtomValue ( showRomanLinesAtom ) ;
36+ const hideObsceneWords = useAtomValue ( hideObsceneWordsAtom ) ;
3337 const wordFadeWidth = useAtomValue ( lyricWordFadeWidthAtom ) ;
3438 const playerRef = useRef < LyricPlayerRef > ( null ) ;
3539
@@ -63,6 +67,11 @@ export const AMLLWrapper = memo(() => {
6367 lyricLines = { lyricLines }
6468 currentTime = { currentTime }
6569 playing = { isPlaying }
70+ maskObsceneWordsMode = {
71+ hideObsceneWords
72+ ? MaskObsceneWordsMode . FullMask
73+ : MaskObsceneWordsMode . Disabled
74+ }
6675 wordFadeWidth = { wordFadeWidth }
6776 ref = { playerRef }
6877 />
0 commit comments