@applemusic-like-lyrics/react-full 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import React, { forwardRef, memo, useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
4
- import classnames from "classnames";
4
+ import classNames from "classnames";
5
5
  import { AnimatePresence, LayoutGroup, animate, motion, useAnimationFrame, useMotionTemplate, useMotionValue, useSpring, useTransform } from "framer-motion";
6
6
  import { Squircle } from "corner-smoothing";
7
- import { BackgroundRender, LyricPlayer, MeshGradientRenderer, PixiRenderer } from "@applemusic-like-lyrics/react";
7
+ import { DomLyricPlayer, IsolationRenderer, MeshGradientRenderer, PixiRenderer } from "@applemusic-like-lyrics/core";
8
+ import { BackgroundRender, LyricPlayer } from "@applemusic-like-lyrics/react";
8
9
  import structuredClone from "@ungap/structured-clone";
9
10
  import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
10
- import { DomLyricPlayer, MeshGradientRenderer as MeshGradientRenderer$1, PixiRenderer as PixiRenderer$1 } from "@applemusic-like-lyrics/core";
11
11
  import { atomWithStorage } from "jotai/utils";
12
12
  //#region src/components/AudioFFTVisualizer/index.tsx
13
13
  globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || {
@@ -296,7 +296,7 @@ const AudioQualityTag = memo(forwardRef((t0, ref) => {
296
296
  const t1 = onClick && index_module_default$10.clickable;
297
297
  let t2;
298
298
  if ($[7] !== className || $[8] !== t1) {
299
- t2 = classnames(className, index_module_default$10.audioQualityTag, t1);
299
+ t2 = classNames(className, index_module_default$10.audioQualityTag, t1);
300
300
  $[7] = className;
301
301
  $[8] = t1;
302
302
  $[9] = t2;
@@ -368,7 +368,7 @@ globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || {
368
368
  return inst;
369
369
  }
370
370
  };
371
- const INITIAL_INSET = 12 / 2;
371
+ const INITIAL_INSET = 6;
372
372
  const MAX_BOUNCE_DISTANCE = 12;
373
373
  const BouncingSlider = ({ className, style, value, min, max, isPlaying = false, onChange, onAfterChange, onBeforeChange, onSeeking, beforeIcon, afterIcon, changeOnDrag = false }) => {
374
374
  const containerRef = useRef(null);
@@ -469,7 +469,7 @@ const BouncingSlider = ({ className, style, value, min, max, isPlaying = false,
469
469
  };
470
470
  return /* @__PURE__ */ jsxs(motion.div, {
471
471
  ref: containerRef,
472
- className: classnames(index_module_default$9.nowPlayingSlider, className),
472
+ className: classNames(index_module_default$9.nowPlayingSlider, className),
473
473
  style: {
474
474
  ...style,
475
475
  x: bounceXSpring
@@ -561,7 +561,7 @@ const ControlThumb = (t0) => {
561
561
  const onMouseMove = t2;
562
562
  let t3;
563
563
  if ($[6] !== className) {
564
- t3 = classnames(index_module_default$8.controlThumb, className);
564
+ t3 = classNames(index_module_default$8.controlThumb, className);
565
565
  $[6] = className;
566
566
  $[7] = t3;
567
567
  } else t3 = $[7];
@@ -735,7 +735,7 @@ globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || {
735
735
  * 一个专辑图组件
736
736
  */
737
737
  const Cover = forwardRef((t0, ref) => {
738
- const $ = c(33);
738
+ const $ = c(36);
739
739
  let className;
740
740
  let coverIsVideo;
741
741
  let coverUrl;
@@ -766,7 +766,7 @@ const Cover = forwardRef((t0, ref) => {
766
766
  const t1 = musicPaused && index_module_default$7.musicPaused;
767
767
  let t2;
768
768
  if ($[8] !== className || $[9] !== t1) {
769
- t2 = classnames(index_module_default$7.cover, t1, className);
769
+ t2 = classNames(index_module_default$7.cover, t1, className);
770
770
  $[8] = className;
771
771
  $[9] = t1;
772
772
  $[10] = t2;
@@ -778,8 +778,10 @@ const Cover = forwardRef((t0, ref) => {
778
778
  if ($[11] !== coverVideoPaused) {
779
779
  t3 = () => {
780
780
  const videoEl = videoRef.current;
781
- if (videoEl) if (coverVideoPaused) videoEl.pause();
782
- else videoEl.play();
781
+ if (videoEl) {
782
+ if (coverVideoPaused) videoEl.pause();
783
+ else videoEl.play();
784
+ }
783
785
  };
784
786
  t4 = [coverVideoPaused];
785
787
  $[11] = coverVideoPaused;
@@ -817,34 +819,41 @@ const Cover = forwardRef((t0, ref) => {
817
819
  t6 = $[15];
818
820
  }
819
821
  useLayoutEffect(t5, t6);
820
- const t7 = pauseShrinkAspect ?? .75;
821
- let t8;
822
- if ($[16] !== t7) {
823
- t8 = { "--scale-level": t7 };
824
- $[16] = t7;
825
- $[17] = t8;
826
- } else t8 = $[17];
827
- const t9 = t8;
828
- let t10;
829
- if ($[18] !== ref) {
830
- t10 = (node) => {
822
+ let t7;
823
+ if ($[16] !== coverUrl) {
824
+ t7 = coverUrl?.startsWith("http://") || coverUrl?.startsWith("https://");
825
+ $[16] = coverUrl;
826
+ $[17] = t7;
827
+ } else t7 = $[17];
828
+ const isRemoteUrl = t7;
829
+ const t8 = pauseShrinkAspect ?? .75;
830
+ let t9;
831
+ if ($[18] !== t8) {
832
+ t9 = { "--scale-level": t8 };
833
+ $[18] = t8;
834
+ $[19] = t9;
835
+ } else t9 = $[19];
836
+ const t10 = t9;
837
+ let t11;
838
+ if ($[20] !== ref) {
839
+ t11 = (node) => {
831
840
  frameRef.current = node;
832
841
  if (typeof ref === "function") ref(node);
833
842
  else if (ref) ref.current = node;
834
843
  };
835
- $[18] = ref;
836
- $[19] = t10;
837
- } else t10 = $[19];
838
- let t11;
839
- if ($[20] !== coverIsVideo || $[21] !== coverUrl || $[22] !== pauseShrinkAspect) {
840
- t11 = coverIsVideo ? /* @__PURE__ */ jsx("video", {
844
+ $[20] = ref;
845
+ $[21] = t11;
846
+ } else t11 = $[21];
847
+ let t12;
848
+ if ($[22] !== coverIsVideo || $[23] !== coverUrl || $[24] !== isRemoteUrl || $[25] !== pauseShrinkAspect) {
849
+ t12 = coverIsVideo ? /* @__PURE__ */ jsx("video", {
841
850
  className: index_module_default$7.coverInner,
842
851
  src: coverUrl,
843
852
  autoPlay: true,
844
853
  loop: true,
845
854
  muted: true,
846
855
  playsInline: true,
847
- crossOrigin: "anonymous",
856
+ crossOrigin: isRemoteUrl ? "anonymous" : void 0,
848
857
  ref: videoRef
849
858
  }) : /* @__PURE__ */ jsx("div", {
850
859
  className: index_module_default$7.coverInner,
@@ -853,40 +862,41 @@ const Cover = forwardRef((t0, ref) => {
853
862
  "--scale-level": pauseShrinkAspect ?? .75
854
863
  }
855
864
  });
856
- $[20] = coverIsVideo;
857
- $[21] = coverUrl;
858
- $[22] = pauseShrinkAspect;
859
- $[23] = t11;
860
- } else t11 = $[23];
861
- let t12;
862
- if ($[24] !== cornerRadius || $[25] !== t11) {
863
- t12 = /* @__PURE__ */ jsx(Squircle, {
865
+ $[22] = coverIsVideo;
866
+ $[23] = coverUrl;
867
+ $[24] = isRemoteUrl;
868
+ $[25] = pauseShrinkAspect;
869
+ $[26] = t12;
870
+ } else t12 = $[26];
871
+ let t13;
872
+ if ($[27] !== cornerRadius || $[28] !== t12) {
873
+ t13 = /* @__PURE__ */ jsx(Squircle, {
864
874
  cornerRadius,
865
875
  cornerSmoothing: .7,
866
876
  className: index_module_default$7.coverInner,
867
- children: t11
877
+ children: t12
868
878
  });
869
- $[24] = cornerRadius;
870
- $[25] = t11;
871
- $[26] = t12;
872
- } else t12 = $[26];
873
- let t13;
874
- if ($[27] !== clsNames || $[28] !== rest || $[29] !== t10 || $[30] !== t12 || $[31] !== t9) {
875
- t13 = /* @__PURE__ */ jsx("div", {
879
+ $[27] = cornerRadius;
880
+ $[28] = t12;
881
+ $[29] = t13;
882
+ } else t13 = $[29];
883
+ let t14;
884
+ if ($[30] !== clsNames || $[31] !== rest || $[32] !== t10 || $[33] !== t11 || $[34] !== t13) {
885
+ t14 = /* @__PURE__ */ jsx("div", {
876
886
  className: clsNames,
877
- style: t9,
878
- ref: t10,
887
+ style: t10,
888
+ ref: t11,
879
889
  ...rest,
880
- children: t12
890
+ children: t13
881
891
  });
882
- $[27] = clsNames;
883
- $[28] = rest;
884
- $[29] = t10;
885
- $[30] = t12;
886
- $[31] = t9;
887
- $[32] = t13;
888
- } else t13 = $[32];
889
- return t13;
892
+ $[30] = clsNames;
893
+ $[31] = rest;
894
+ $[32] = t10;
895
+ $[33] = t11;
896
+ $[34] = t13;
897
+ $[35] = t14;
898
+ } else t14 = $[35];
899
+ return t14;
890
900
  });
891
901
  //#endregion
892
902
  //#region src/components/MediaButton/index.module.css
@@ -954,7 +964,7 @@ const MediaButton = memo((t0) => {
954
964
  const handleAnimationEnd = t3;
955
965
  let t4;
956
966
  if ($[11] !== className || $[12] !== isAnimating) {
957
- t4 = classnames(index_module_default$6.mediaButton, { [index_module_default$6.animate]: isAnimating }, className);
967
+ t4 = classNames(index_module_default$6.mediaButton, { [index_module_default$6.animate]: isAnimating }, className);
958
968
  $[11] = className;
959
969
  $[12] = isAnimating;
960
970
  $[13] = t4;
@@ -1027,7 +1037,7 @@ const MenuButton = memo((t0) => {
1027
1037
  }
1028
1038
  let t1;
1029
1039
  if ($[3] !== className) {
1030
- t1 = classnames(index_module_default$5.menuButton, className);
1040
+ t1 = classNames(index_module_default$5.menuButton, className);
1031
1041
  $[3] = className;
1032
1042
  $[4] = t1;
1033
1043
  } else t1 = $[4];
@@ -1126,7 +1136,7 @@ const TextMarquee = memo((t0) => {
1126
1136
  const onMouseLeave = t3;
1127
1137
  let t4;
1128
1138
  if ($[7] !== className) {
1129
- t4 = classnames(index_module_default$4.textMarquee, className);
1139
+ t4 = classNames(index_module_default$4.textMarquee, className);
1130
1140
  $[7] = className;
1131
1141
  $[8] = t4;
1132
1142
  } else t4 = $[8];
@@ -1208,7 +1218,7 @@ const MusicInfo = memo((t0) => {
1208
1218
  }
1209
1219
  let t1;
1210
1220
  if ($[7] !== className) {
1211
- t1 = classnames(index_module_default$3.musicInfo, className);
1221
+ t1 = classNames(index_module_default$3.musicInfo, className);
1212
1222
  $[7] = className;
1213
1223
  $[8] = t1;
1214
1224
  } else t1 = $[8];
@@ -1350,7 +1360,7 @@ const HorizontalLayout = (t0) => {
1350
1360
  const t2 = !asChild && hideLyric && horizontal_module_default.hideLyric;
1351
1361
  let t3;
1352
1362
  if ($[10] !== className || $[11] !== t1 || $[12] !== t2) {
1353
- t3 = classnames(className, t1, t2);
1363
+ t3 = classNames(className, t1, t2);
1354
1364
  $[10] = className;
1355
1365
  $[11] = t1;
1356
1366
  $[12] = t2;
@@ -1486,7 +1496,11 @@ const VerticalLayout = ({ thumbSlot, coverSlot, smallControlsSlot, bigControlsSl
1486
1496
  const targetCover = hideLyric_0 ? phonyBigCoverRef.current : phonySmallCoverRef.current;
1487
1497
  if (!targetCover || !rootEl) return;
1488
1498
  const immerseCover_0 = immerseCoverRef.current;
1489
- while (getComputedStyle(rootEl).display === "contents") rootEl = rootEl.parentElement;
1499
+ while (getComputedStyle(rootEl).display === "contents") {
1500
+ const parentEl = rootEl.parentElement;
1501
+ if (!parentEl) return;
1502
+ rootEl = parentEl;
1503
+ }
1490
1504
  const rootB = rootEl.getBoundingClientRect();
1491
1505
  const targetCoverB = targetCover.getBoundingClientRect();
1492
1506
  if (immerseCover_0) {
@@ -1525,13 +1539,14 @@ const VerticalLayout = ({ thumbSlot, coverSlot, smallControlsSlot, bigControlsSl
1525
1539
  });
1526
1540
  obz.observe(phonyBigCoverEl);
1527
1541
  obz.observe(phonySmallCoverEl);
1528
- setCurrentCoverStyle(calcCoverLayout(hideLyricRef.current));
1542
+ const init = calcCoverLayout(hideLyricRef.current);
1543
+ setCurrentCoverStyle(init);
1529
1544
  return () => {
1530
1545
  obz.disconnect();
1531
1546
  };
1532
1547
  }, [calcCoverLayout]);
1533
1548
  return /* @__PURE__ */ jsxs("div", {
1534
- className: classnames(className, !asChild && vertical_module_default.verticalLayout, !asChild && hideLyric && vertical_module_default.hideLyric),
1549
+ className: classNames(className, !asChild && vertical_module_default.verticalLayout, !asChild && hideLyric && vertical_module_default.hideLyric),
1535
1550
  ref: rootRef,
1536
1551
  ...rest,
1537
1552
  children: [
@@ -1567,7 +1582,7 @@ const VerticalLayout = ({ thumbSlot, coverSlot, smallControlsSlot, bigControlsSl
1567
1582
  })]
1568
1583
  }),
1569
1584
  currentCoverStyle && /* @__PURE__ */ jsx(motion.div, {
1570
- className: classnames(vertical_module_default.coverFrame, immerseCover && vertical_module_default.immerseCover),
1585
+ className: classNames(vertical_module_default.coverFrame, immerseCover && vertical_module_default.immerseCover),
1571
1586
  animate: currentCoverStyle,
1572
1587
  initial: false,
1573
1588
  transition: {
@@ -2005,7 +2020,7 @@ const ToggleIconButton = memo((t0) => {
2005
2020
  }
2006
2021
  let t1;
2007
2022
  if ($[6] !== className) {
2008
- t1 = classnames(className, index_module_default$2.toggleIconButton);
2023
+ t1 = classNames(className, index_module_default$2.toggleIconButton);
2009
2024
  $[6] = className;
2010
2025
  $[7] = t1;
2011
2026
  } else t1 = $[7];
@@ -2676,22 +2691,59 @@ const showVolumeControlAtom = globalThis.jotaiAtomCache.get("/home/runner/work/a
2676
2691
  showVolumeControlAtom.debugLabel = "showVolumeControlAtom";
2677
2692
  const showBottomControlAtom = globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/showBottomControlAtom", atomWithStorage("amll-react-full.showBottomControl", true));
2678
2693
  showBottomControlAtom.debugLabel = "showBottomControlAtom";
2679
- const getInitialBackgroundRenderer = () => {
2680
- switch (localStorage.getItem("amll-react-full.lyricBackgroundRenderer")) {
2681
- case "pixi": return { renderer: PixiRenderer$1 };
2682
- case "css-bg": return { renderer: "css-bg" };
2683
- default: return { renderer: MeshGradientRenderer$1 };
2694
+ const CSS_BACKGROUND_RENDERER_ID = "css-bg";
2695
+ const DEFAULT_BACKGROUND_RENDERER_ID = "mesh";
2696
+ /**
2697
+ * 所有可选的背景渲染器。
2698
+ *
2699
+ * `"css-bg"` 不在表内,因为它不是渲染器,而是固定的纯色 CSS 背景
2700
+ */
2701
+ const BACKGROUND_RENDERERS = {
2702
+ mesh: {
2703
+ renderer: MeshGradientRenderer,
2704
+ isSupported: () => MeshGradientRenderer.isSupported()
2705
+ },
2706
+ pixi: {
2707
+ renderer: PixiRenderer,
2708
+ isSupported: () => PixiRenderer.isSupported()
2709
+ },
2710
+ isolation: {
2711
+ renderer: IsolationRenderer,
2712
+ isSupported: () => IsolationRenderer.isSupported()
2684
2713
  }
2685
2714
  };
2715
+ /** 背景渲染器配置在 localStorage 中的键名。 */
2716
+ const LYRIC_BACKGROUND_RENDERER_STORAGE_KEY = "amll-react-full.lyricBackgroundRenderer";
2717
+ /**
2718
+ * 把字符串标识解析成渲染器
2719
+ *
2720
+ * 如果传入的渲染器标识在当前环境不支持,则会依次回退到 Mesh 渲染器和 CSS 背景
2721
+ */
2722
+ const resolveBackgroundRenderer = (id) => {
2723
+ if (id === "css-bg") return CSS_BACKGROUND_RENDERER_ID;
2724
+ const entry = BACKGROUND_RENDERERS[id];
2725
+ if (entry?.isSupported()) return entry.renderer;
2726
+ const fallback = BACKGROUND_RENDERERS[DEFAULT_BACKGROUND_RENDERER_ID];
2727
+ if (fallback?.isSupported()) return fallback.renderer;
2728
+ return CSS_BACKGROUND_RENDERER_ID;
2729
+ };
2730
+ const getInitialBackgroundRenderer = () => ({ renderer: resolveBackgroundRenderer(localStorage.getItem("amll-react-full.lyricBackgroundRenderer") ?? "mesh") });
2686
2731
  /**
2687
2732
  * 配置所使用的歌词背景渲染器
2688
2733
  */
2689
2734
  const lyricBackgroundRendererAtom = globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/lyricBackgroundRendererAtom", atom(getInitialBackgroundRenderer()));
2690
2735
  /**
2736
+ * Isolation 背景渲染器的专属选项
2737
+ *
2738
+ * 仅在背景渲染器为 Isolation 时生效
2739
+ */
2740
+ lyricBackgroundRendererAtom.debugLabel = "lyricBackgroundRendererAtom";
2741
+ const isolationRendererOptionsAtom = globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/isolationRendererOptionsAtom", atomWithStorage("amll-react-full.isolationRendererOptions", { ...IsolationRenderer.defaultOptions }));
2742
+ /**
2691
2743
  * 当背景渲染器设置为纯色或CSS背景时,使用此值
2692
2744
  * @default "#111111"
2693
2745
  */
2694
- lyricBackgroundRendererAtom.debugLabel = "lyricBackgroundRendererAtom";
2746
+ isolationRendererOptionsAtom.debugLabel = "isolationRendererOptionsAtom";
2695
2747
  const cssBackgroundPropertyAtom = globalThis.jotaiAtomCache.get("/home/runner/work/applemusic-like-lyrics/applemusic-like-lyrics/packages/react-full/src/states/configAtoms.ts/cssBackgroundPropertyAtom", atomWithStorage("amll-player.cssBackgroundProperty", "#111111"));
2696
2748
  /**
2697
2749
  * 调节背景的最大渲染帧率,较低的值可以提升性能
@@ -2927,6 +2979,10 @@ var index_module_default = {
2927
2979
  };
2928
2980
  //#endregion
2929
2981
  //#region src/components/PrebuiltLyricPlayer/index.tsx
2982
+ /**
2983
+ * @fileoverview
2984
+ * 已经部署好所有组件的歌词播放器组件,在正确设置所有的 Jotai 状态后可以开箱即用
2985
+ */
2930
2986
  globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || {
2931
2987
  cache: /* @__PURE__ */ new Map(),
2932
2988
  get(name, inst) {
@@ -3522,7 +3578,7 @@ const PrebuiltMusicControls = (t0) => {
3522
3578
  const fftData = useAtomValue(fftDataAtom);
3523
3579
  let t1;
3524
3580
  if ($[4] !== className) {
3525
- t1 = classnames(index_module_default.controls, className);
3581
+ t1 = classNames(index_module_default.controls, className);
3526
3582
  $[4] = className;
3527
3583
  $[5] = t1;
3528
3584
  } else t1 = $[5];
@@ -3565,7 +3621,7 @@ const PrebuiltMusicControls = (t0) => {
3565
3621
  * 已经部署好所有组件的歌词播放器组件,在正确设置所有的 Jotai 状态后可以开箱即用
3566
3622
  */
3567
3623
  const PrebuiltLyricPlayer = (t0) => {
3568
- const $ = c(67);
3624
+ const $ = c(74);
3569
3625
  let bottomLineSlot;
3570
3626
  let className;
3571
3627
  let optimizeOptions;
@@ -3600,12 +3656,44 @@ const PrebuiltLyricPlayer = (t0) => {
3600
3656
  const coverElRef = useRef(null);
3601
3657
  const [layoutEl, setLayoutEl] = useState(null);
3602
3658
  const backgroundRenderer = useAtomValue(lyricBackgroundRendererAtom);
3603
- const showBottomControl = useAtomValue(showBottomControlAtom);
3604
- const cssBackgroundProperty = useAtomValue(cssBackgroundPropertyAtom);
3605
3659
  let t1;
3660
+ bb0: {
3661
+ const configured = backgroundRenderer.renderer;
3662
+ if (typeof configured === "string") {
3663
+ let t2;
3664
+ if ($[5] !== configured) {
3665
+ t2 = resolveBackgroundRenderer(configured);
3666
+ $[5] = configured;
3667
+ $[6] = t2;
3668
+ } else t2 = $[6];
3669
+ t1 = t2;
3670
+ break bb0;
3671
+ }
3672
+ let t2;
3673
+ if ($[7] !== configured) {
3674
+ t2 = configured ?? resolveBackgroundRenderer("mesh");
3675
+ $[7] = configured;
3676
+ $[8] = t2;
3677
+ } else t2 = $[8];
3678
+ t1 = t2;
3679
+ }
3680
+ const resolvedBackgroundRenderer = t1;
3681
+ const isolationRendererOptions = useAtomValue(isolationRendererOptionsAtom);
3606
3682
  let t2;
3607
- if ($[5] !== isVertical || $[6] !== layoutEl) {
3608
- t1 = () => {
3683
+ if ($[9] !== isolationRendererOptions) {
3684
+ t2 = (renderer) => {
3685
+ if (renderer instanceof IsolationRenderer) renderer.setOptions(isolationRendererOptions);
3686
+ };
3687
+ $[9] = isolationRendererOptions;
3688
+ $[10] = t2;
3689
+ } else t2 = $[10];
3690
+ const configureBackgroundRenderer = t2;
3691
+ const showBottomControl = useAtomValue(showBottomControlAtom);
3692
+ const cssBackgroundProperty = useAtomValue(cssBackgroundPropertyAtom);
3693
+ let t3;
3694
+ let t4;
3695
+ if ($[11] !== isVertical || $[12] !== layoutEl) {
3696
+ t3 = () => {
3609
3697
  if (!isVertical && coverElRef.current && layoutEl) {
3610
3698
  const obz = new ResizeObserver(() => {
3611
3699
  if (!(coverElRef.current && layoutEl)) return;
@@ -3623,59 +3711,59 @@ const PrebuiltLyricPlayer = (t0) => {
3623
3711
  setAlignAnchor("top");
3624
3712
  }
3625
3713
  };
3626
- t2 = [isVertical, layoutEl];
3627
- $[5] = isVertical;
3628
- $[6] = layoutEl;
3629
- $[7] = t1;
3630
- $[8] = t2;
3714
+ t4 = [isVertical, layoutEl];
3715
+ $[11] = isVertical;
3716
+ $[12] = layoutEl;
3717
+ $[13] = t3;
3718
+ $[14] = t4;
3631
3719
  } else {
3632
- t1 = $[7];
3633
- t2 = $[8];
3720
+ t3 = $[13];
3721
+ t4 = $[14];
3634
3722
  }
3635
- useLayoutEffect(t1, t2);
3723
+ useLayoutEffect(t3, t4);
3636
3724
  const verticalImmerseCover = hideLyricView && (verticalCoverLayout === "auto" ? musicCoverIsVideo && isVertical : verticalCoverLayout === "force-immersive");
3637
- let t3;
3638
- if ($[9] !== className) {
3639
- t3 = classnames(index_module_default.autoLyricLayout, className);
3640
- $[9] = className;
3641
- $[10] = t3;
3642
- } else t3 = $[10];
3643
- const t4 = !musicIsPlaying && !musicCoverIsVideo && verticalImmerseCover;
3644
3725
  let t5;
3645
- if ($[11] !== musicCover || $[12] !== musicCoverIsVideo || $[13] !== t4) {
3646
- t5 = /* @__PURE__ */ jsx(Cover, {
3726
+ if ($[15] !== className) {
3727
+ t5 = classNames(index_module_default.autoLyricLayout, className);
3728
+ $[15] = className;
3729
+ $[16] = t5;
3730
+ } else t5 = $[16];
3731
+ const t6 = !musicIsPlaying && !musicCoverIsVideo && verticalImmerseCover;
3732
+ let t7;
3733
+ if ($[17] !== musicCover || $[18] !== musicCoverIsVideo || $[19] !== t6) {
3734
+ t7 = /* @__PURE__ */ jsx(Cover, {
3647
3735
  coverUrl: musicCover,
3648
3736
  coverIsVideo: musicCoverIsVideo,
3649
3737
  ref: coverElRef,
3650
- musicPaused: t4
3738
+ musicPaused: t6
3651
3739
  });
3652
- $[11] = musicCover;
3653
- $[12] = musicCoverIsVideo;
3654
- $[13] = t4;
3655
- $[14] = t5;
3656
- } else t5 = $[14];
3657
- let t6;
3658
- if ($[15] !== onClickControlThumb) {
3659
- t6 = /* @__PURE__ */ jsx(ControlThumb, { onClick: onClickControlThumb });
3660
- $[15] = onClickControlThumb;
3661
- $[16] = t6;
3662
- } else t6 = $[16];
3663
- const t7 = hideLyricView && index_module_default.hideLyric;
3740
+ $[17] = musicCover;
3741
+ $[18] = musicCoverIsVideo;
3742
+ $[19] = t6;
3743
+ $[20] = t7;
3744
+ } else t7 = $[20];
3664
3745
  let t8;
3665
- if ($[17] !== t7) {
3666
- t8 = classnames(index_module_default.smallMusicInfo, t7);
3667
- $[17] = t7;
3668
- $[18] = t8;
3669
- } else t8 = $[18];
3670
- let t9;
3671
- if ($[19] !== t8) {
3672
- t9 = /* @__PURE__ */ jsx(PrebuiltMusicInfo, { className: t8 });
3673
- $[19] = t8;
3674
- $[20] = t9;
3675
- } else t9 = $[20];
3746
+ if ($[21] !== onClickControlThumb) {
3747
+ t8 = /* @__PURE__ */ jsx(ControlThumb, { onClick: onClickControlThumb });
3748
+ $[21] = onClickControlThumb;
3749
+ $[22] = t8;
3750
+ } else t8 = $[22];
3751
+ const t9 = hideLyricView && index_module_default.hideLyric;
3676
3752
  let t10;
3677
- if ($[21] !== backgroundRenderer.renderer || $[22] !== cssBackgroundProperty || $[23] !== isLyricPageOpened || $[24] !== lowFreqVolume || $[25] !== lyricBackgroundFPS || $[26] !== lyricBackgroundRenderScale || $[27] !== lyricBackgroundStaticMode || $[28] !== musicCover || $[29] !== musicCoverIsVideo) {
3678
- t10 = typeof backgroundRenderer.renderer === "string" && backgroundRenderer.renderer === "css-bg" ? /* @__PURE__ */ jsx("div", { style: {
3753
+ if ($[23] !== t9) {
3754
+ t10 = classNames(index_module_default.smallMusicInfo, t9);
3755
+ $[23] = t9;
3756
+ $[24] = t10;
3757
+ } else t10 = $[24];
3758
+ let t11;
3759
+ if ($[25] !== t10) {
3760
+ t11 = /* @__PURE__ */ jsx(PrebuiltMusicInfo, { className: t10 });
3761
+ $[25] = t10;
3762
+ $[26] = t11;
3763
+ } else t11 = $[26];
3764
+ let t12;
3765
+ if ($[27] !== configureBackgroundRenderer || $[28] !== cssBackgroundProperty || $[29] !== isLyricPageOpened || $[30] !== lowFreqVolume || $[31] !== lyricBackgroundFPS || $[32] !== lyricBackgroundRenderScale || $[33] !== lyricBackgroundStaticMode || $[34] !== musicCover || $[35] !== musicCoverIsVideo || $[36] !== resolvedBackgroundRenderer) {
3766
+ t12 = resolvedBackgroundRenderer === "css-bg" ? /* @__PURE__ */ jsx("div", { style: {
3679
3767
  zIndex: -1,
3680
3768
  width: "100%",
3681
3769
  height: "100%",
@@ -3689,48 +3777,50 @@ const PrebuiltLyricPlayer = (t0) => {
3689
3777
  lowFreqVolume,
3690
3778
  renderScale: lyricBackgroundRenderScale,
3691
3779
  fps: lyricBackgroundFPS,
3692
- renderer: typeof backgroundRenderer.renderer === "string" ? backgroundRenderer.renderer === "pixi" ? PixiRenderer : MeshGradientRenderer : backgroundRenderer.renderer,
3780
+ renderer: resolvedBackgroundRenderer,
3693
3781
  staticMode: lyricBackgroundStaticMode || !isLyricPageOpened,
3782
+ configureRenderer: configureBackgroundRenderer,
3694
3783
  style: { zIndex: -1 }
3695
3784
  });
3696
- $[21] = backgroundRenderer.renderer;
3697
- $[22] = cssBackgroundProperty;
3698
- $[23] = isLyricPageOpened;
3699
- $[24] = lowFreqVolume;
3700
- $[25] = lyricBackgroundFPS;
3701
- $[26] = lyricBackgroundRenderScale;
3702
- $[27] = lyricBackgroundStaticMode;
3703
- $[28] = musicCover;
3704
- $[29] = musicCoverIsVideo;
3705
- $[30] = t10;
3706
- } else t10 = $[30];
3707
- const t11 = hideLyricView && index_module_default.hideLyric;
3708
- let t12;
3709
- if ($[31] !== t11) {
3710
- t12 = classnames(index_module_default.bigMusicInfo, t11);
3711
- $[31] = t11;
3712
- $[32] = t12;
3713
- } else t12 = $[32];
3714
- let t13;
3715
- if ($[33] !== t12) {
3716
- t13 = /* @__PURE__ */ jsx(PrebuiltMusicInfo, { className: t12 });
3717
- $[33] = t12;
3718
- $[34] = t13;
3719
- } else t13 = $[34];
3785
+ $[27] = configureBackgroundRenderer;
3786
+ $[28] = cssBackgroundProperty;
3787
+ $[29] = isLyricPageOpened;
3788
+ $[30] = lowFreqVolume;
3789
+ $[31] = lyricBackgroundFPS;
3790
+ $[32] = lyricBackgroundRenderScale;
3791
+ $[33] = lyricBackgroundStaticMode;
3792
+ $[34] = musicCover;
3793
+ $[35] = musicCoverIsVideo;
3794
+ $[36] = resolvedBackgroundRenderer;
3795
+ $[37] = t12;
3796
+ } else t12 = $[37];
3797
+ const t13 = hideLyricView && index_module_default.hideLyric;
3720
3798
  let t14;
3799
+ if ($[38] !== t13) {
3800
+ t14 = classNames(index_module_default.bigMusicInfo, t13);
3801
+ $[38] = t13;
3802
+ $[39] = t14;
3803
+ } else t14 = $[39];
3721
3804
  let t15;
3722
- if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
3723
- t14 = /* @__PURE__ */ jsx(PrebuiltProgressBar, {});
3724
- t15 = /* @__PURE__ */ jsx(PrebuiltMusicControls, { className: index_module_default.bigControls });
3725
- $[35] = t14;
3726
- $[36] = t15;
3805
+ if ($[40] !== t14) {
3806
+ t15 = /* @__PURE__ */ jsx(PrebuiltMusicInfo, { className: t14 });
3807
+ $[40] = t14;
3808
+ $[41] = t15;
3809
+ } else t15 = $[41];
3810
+ let t16;
3811
+ let t17;
3812
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
3813
+ t16 = /* @__PURE__ */ jsx(PrebuiltProgressBar, {});
3814
+ t17 = /* @__PURE__ */ jsx(PrebuiltMusicControls, { className: index_module_default.bigControls });
3815
+ $[42] = t16;
3816
+ $[43] = t17;
3727
3817
  } else {
3728
- t14 = $[35];
3729
- t15 = $[36];
3818
+ t16 = $[42];
3819
+ t17 = $[43];
3730
3820
  }
3731
- let t16;
3732
- if ($[37] !== hideLyricView || $[38] !== setHideLyricView || $[39] !== showBottomControl) {
3733
- t16 = showBottomControl && /* @__PURE__ */ jsxs("div", {
3821
+ let t18;
3822
+ if ($[44] !== hideLyricView || $[45] !== setHideLyricView || $[46] !== showBottomControl) {
3823
+ t18 = showBottomControl && /* @__PURE__ */ jsxs("div", {
3734
3824
  style: {
3735
3825
  display: "flex",
3736
3826
  justifyContent: "space-evenly"
@@ -3745,32 +3835,32 @@ const PrebuiltLyricPlayer = (t0) => {
3745
3835
  /* @__PURE__ */ jsx(PrebuiltToggleIconButton, { type: "playlist" })
3746
3836
  ]
3747
3837
  });
3748
- $[37] = hideLyricView;
3749
- $[38] = setHideLyricView;
3750
- $[39] = showBottomControl;
3751
- $[40] = t16;
3752
- } else t16 = $[40];
3753
- let t17;
3754
- if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
3755
- t17 = /* @__PURE__ */ jsx(PrebuiltVolumeControl, { className: index_module_default.bigVolumeControl });
3756
- $[41] = t17;
3757
- } else t17 = $[41];
3758
- let t18;
3759
- if ($[42] !== t13 || $[43] !== t16) {
3760
- t18 = /* @__PURE__ */ jsxs(Fragment, { children: [
3761
- t13,
3762
- t14,
3838
+ $[44] = hideLyricView;
3839
+ $[45] = setHideLyricView;
3840
+ $[46] = showBottomControl;
3841
+ $[47] = t18;
3842
+ } else t18 = $[47];
3843
+ let t19;
3844
+ if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
3845
+ t19 = /* @__PURE__ */ jsx(PrebuiltVolumeControl, { className: index_module_default.bigVolumeControl });
3846
+ $[48] = t19;
3847
+ } else t19 = $[48];
3848
+ let t20;
3849
+ if ($[49] !== t15 || $[50] !== t18) {
3850
+ t20 = /* @__PURE__ */ jsxs(Fragment, { children: [
3763
3851
  t15,
3764
3852
  t16,
3765
- t17
3853
+ t17,
3854
+ t18,
3855
+ t19
3766
3856
  ] });
3767
- $[42] = t13;
3768
- $[43] = t16;
3769
- $[44] = t18;
3770
- } else t18 = $[44];
3771
- let t19;
3772
- if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
3773
- t19 = /* @__PURE__ */ jsxs(Fragment, { children: [
3857
+ $[49] = t15;
3858
+ $[50] = t18;
3859
+ $[51] = t20;
3860
+ } else t20 = $[51];
3861
+ let t21;
3862
+ if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
3863
+ t21 = /* @__PURE__ */ jsxs(Fragment, { children: [
3774
3864
  /* @__PURE__ */ jsx(PrebuiltMusicInfo, { className: index_module_default.horizontalControls }),
3775
3865
  /* @__PURE__ */ jsx(PrebuiltProgressBar, {}),
3776
3866
  /* @__PURE__ */ jsx(PrebuiltMusicControls, {
@@ -3779,11 +3869,11 @@ const PrebuiltLyricPlayer = (t0) => {
3779
3869
  }),
3780
3870
  /* @__PURE__ */ jsx(PrebuiltVolumeControl, {})
3781
3871
  ] });
3782
- $[45] = t19;
3783
- } else t19 = $[45];
3784
- let t20;
3785
- if ($[46] !== hideLyricView || $[47] !== setHideLyricView || $[48] !== showBottomControl) {
3786
- t20 = showBottomControl && /* @__PURE__ */ jsxs(Fragment, { children: [
3872
+ $[52] = t21;
3873
+ } else t21 = $[52];
3874
+ let t22;
3875
+ if ($[53] !== hideLyricView || $[54] !== setHideLyricView || $[55] !== showBottomControl) {
3876
+ t22 = showBottomControl && /* @__PURE__ */ jsxs(Fragment, { children: [
3787
3877
  /* @__PURE__ */ jsx(PrebuiltToggleIconButton, { type: "playlist" }),
3788
3878
  /* @__PURE__ */ jsx(PrebuiltToggleIconButton, {
3789
3879
  type: "lyrics",
@@ -3793,57 +3883,57 @@ const PrebuiltLyricPlayer = (t0) => {
3793
3883
  /* @__PURE__ */ jsx("div", { style: { flex: "1" } }),
3794
3884
  /* @__PURE__ */ jsx(PrebuiltToggleIconButton, { type: "airplay" })
3795
3885
  ] });
3796
- $[46] = hideLyricView;
3797
- $[47] = setHideLyricView;
3798
- $[48] = showBottomControl;
3799
- $[49] = t20;
3800
- } else t20 = $[49];
3801
- let t21;
3802
- if ($[50] !== alignAnchor || $[51] !== alignPosition || $[52] !== bottomLineSlot || $[53] !== optimizeOptions) {
3803
- t21 = /* @__PURE__ */ jsx(PrebuiltCoreLyricPlayer, {
3886
+ $[53] = hideLyricView;
3887
+ $[54] = setHideLyricView;
3888
+ $[55] = showBottomControl;
3889
+ $[56] = t22;
3890
+ } else t22 = $[56];
3891
+ let t23;
3892
+ if ($[57] !== alignAnchor || $[58] !== alignPosition || $[59] !== bottomLineSlot || $[60] !== optimizeOptions) {
3893
+ t23 = /* @__PURE__ */ jsx(PrebuiltCoreLyricPlayer, {
3804
3894
  alignPosition,
3805
3895
  alignAnchor,
3806
3896
  bottomLine: bottomLineSlot,
3807
3897
  optimizeOptions
3808
3898
  });
3809
- $[50] = alignAnchor;
3810
- $[51] = alignPosition;
3811
- $[52] = bottomLineSlot;
3812
- $[53] = optimizeOptions;
3813
- $[54] = t21;
3814
- } else t21 = $[54];
3815
- let t22;
3816
- if ($[55] !== hideLyricView || $[56] !== rest || $[57] !== t10 || $[58] !== t18 || $[59] !== t20 || $[60] !== t21 || $[61] !== t3 || $[62] !== t5 || $[63] !== t6 || $[64] !== t9 || $[65] !== verticalImmerseCover) {
3817
- t22 = /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(AutoLyricLayout, {
3899
+ $[57] = alignAnchor;
3900
+ $[58] = alignPosition;
3901
+ $[59] = bottomLineSlot;
3902
+ $[60] = optimizeOptions;
3903
+ $[61] = t23;
3904
+ } else t23 = $[61];
3905
+ let t24;
3906
+ if ($[62] !== hideLyricView || $[63] !== rest || $[64] !== t11 || $[65] !== t12 || $[66] !== t20 || $[67] !== t22 || $[68] !== t23 || $[69] !== t5 || $[70] !== t7 || $[71] !== t8 || $[72] !== verticalImmerseCover) {
3907
+ t24 = /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(AutoLyricLayout, {
3818
3908
  onElementMounted: setLayoutEl,
3819
- className: t3,
3909
+ className: t5,
3820
3910
  onLayoutChange: setIsVertical,
3821
3911
  verticalImmerseCover,
3822
- coverSlot: t5,
3823
- thumbSlot: t6,
3824
- smallControlsSlot: t9,
3825
- backgroundSlot: t10,
3826
- bigControlsSlot: t18,
3827
- controlsSlot: t19,
3828
- horizontalBottomControls: t20,
3829
- lyricSlot: t21,
3912
+ coverSlot: t7,
3913
+ thumbSlot: t8,
3914
+ smallControlsSlot: t11,
3915
+ backgroundSlot: t12,
3916
+ bigControlsSlot: t20,
3917
+ controlsSlot: t21,
3918
+ horizontalBottomControls: t22,
3919
+ lyricSlot: t23,
3830
3920
  hideLyric: hideLyricView,
3831
3921
  ...rest
3832
3922
  }) });
3833
- $[55] = hideLyricView;
3834
- $[56] = rest;
3835
- $[57] = t10;
3836
- $[58] = t18;
3837
- $[59] = t20;
3838
- $[60] = t21;
3839
- $[61] = t3;
3840
- $[62] = t5;
3841
- $[63] = t6;
3842
- $[64] = t9;
3843
- $[65] = verticalImmerseCover;
3844
- $[66] = t22;
3845
- } else t22 = $[66];
3846
- return t22;
3923
+ $[62] = hideLyricView;
3924
+ $[63] = rest;
3925
+ $[64] = t11;
3926
+ $[65] = t12;
3927
+ $[66] = t20;
3928
+ $[67] = t22;
3929
+ $[68] = t23;
3930
+ $[69] = t5;
3931
+ $[70] = t7;
3932
+ $[71] = t8;
3933
+ $[72] = verticalImmerseCover;
3934
+ $[73] = t24;
3935
+ } else t24 = $[73];
3936
+ return t24;
3847
3937
  };
3848
3938
  function _temp(v) {
3849
3939
  return v.name;
@@ -3859,6 +3949,6 @@ globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || {
3859
3949
  }
3860
3950
  };
3861
3951
  //#endregion
3862
- export { AudioFFTVisualizer, AudioQualityTag, AudioQualityType, AutoLyricLayout, BouncingSlider, ControlThumb, Cover, HorizontalLayout, LyricPlayerImplementation, LyricSizePreset, MediaButton, MenuButton, MusicInfo, PlayerControlsType, PrebuiltLyricPlayer, PrebuiltToggleIconButton, PrebuiltToggleIconButtonType, RepeatMode, TextMarquee, ToggleIconButton, VerticalCoverLayout, VerticalLayout, VolumeControl, cssBackgroundPropertyAtom, cycleRepeatModeActionAtom, enableLyricLineBlurEffectAtom, enableLyricLineScaleEffectAtom, enableLyricLineSpringAnimationAtom, enableLyricRomanLineAtom, enableLyricSwapTransRomanLineAtom, enableLyricTranslationLineAtom, fftDataAtom, fftDataRangeAtom, hideLyricViewAtom, isLyricPageOpenedAtom, isRepeatEnabledAtom, isShuffleActiveAtom, isShuffleEnabledAtom, lowFreqVolumeAtom, lyricBackgroundFPSAtom, lyricBackgroundRenderScaleAtom, lyricBackgroundRendererAtom, lyricBackgroundStaticModeAtom, lyricFontFamilyAtom, lyricFontWeightAtom, lyricLetterSpacingAtom, lyricPlayerImplementationAtom, lyricSizePresetAtom, lyricWordFadeWidthAtom, musicAlbumNameAtom, musicArtistsAtom, musicCoverAtom, musicCoverIsVideoAtom, musicDurationAtom, musicIdAtom, musicLyricLinesAtom, musicNameAtom, musicPlayingAtom, musicPlayingPositionAtom, musicQualityAtom, musicQualityTagAtom, musicVolumeAtom, onChangeVolumeAtom, onClickAudioQualityTagAtom, onClickControlThumbAtom, onCycleRepeatModeAtom, onLyricLineClickAtom, onLyricLineContextMenuAtom, onPlayOrResumeAtom, onRequestNextSongAtom, onRequestOpenMenuAtom, onRequestPrevSongAtom, onSeekPositionAtom, onToggleShuffleAtom, playerControlsTypeAtom, repeatModeAtom, showBottomControlAtom, showMusicAlbumAtom, showMusicArtistsAtom, showMusicNameAtom, showRemainingTimeAtom, showVolumeControlAtom, toDuration, toggleShuffleActionAtom, verticalCoverLayoutAtom };
3952
+ export { AudioFFTVisualizer, AudioQualityTag, AudioQualityType, AutoLyricLayout, BACKGROUND_RENDERERS, BouncingSlider, CSS_BACKGROUND_RENDERER_ID, ControlThumb, Cover, DEFAULT_BACKGROUND_RENDERER_ID, HorizontalLayout, LYRIC_BACKGROUND_RENDERER_STORAGE_KEY, LyricPlayerImplementation, LyricSizePreset, MediaButton, MenuButton, MusicInfo, PlayerControlsType, PrebuiltLyricPlayer, PrebuiltToggleIconButton, PrebuiltToggleIconButtonType, RepeatMode, TextMarquee, ToggleIconButton, VerticalCoverLayout, VerticalLayout, VolumeControl, cssBackgroundPropertyAtom, cycleRepeatModeActionAtom, enableLyricLineBlurEffectAtom, enableLyricLineScaleEffectAtom, enableLyricLineSpringAnimationAtom, enableLyricRomanLineAtom, enableLyricSwapTransRomanLineAtom, enableLyricTranslationLineAtom, fftDataAtom, fftDataRangeAtom, hideLyricViewAtom, isLyricPageOpenedAtom, isRepeatEnabledAtom, isShuffleActiveAtom, isShuffleEnabledAtom, isolationRendererOptionsAtom, lowFreqVolumeAtom, lyricBackgroundFPSAtom, lyricBackgroundRenderScaleAtom, lyricBackgroundRendererAtom, lyricBackgroundStaticModeAtom, lyricFontFamilyAtom, lyricFontWeightAtom, lyricLetterSpacingAtom, lyricPlayerImplementationAtom, lyricSizePresetAtom, lyricWordFadeWidthAtom, musicAlbumNameAtom, musicArtistsAtom, musicCoverAtom, musicCoverIsVideoAtom, musicDurationAtom, musicIdAtom, musicLyricLinesAtom, musicNameAtom, musicPlayingAtom, musicPlayingPositionAtom, musicQualityAtom, musicQualityTagAtom, musicVolumeAtom, onChangeVolumeAtom, onClickAudioQualityTagAtom, onClickControlThumbAtom, onCycleRepeatModeAtom, onLyricLineClickAtom, onLyricLineContextMenuAtom, onPlayOrResumeAtom, onRequestNextSongAtom, onRequestOpenMenuAtom, onRequestPrevSongAtom, onSeekPositionAtom, onToggleShuffleAtom, playerControlsTypeAtom, repeatModeAtom, resolveBackgroundRenderer, showBottomControlAtom, showMusicAlbumAtom, showMusicArtistsAtom, showMusicNameAtom, showRemainingTimeAtom, showVolumeControlAtom, toDuration, toggleShuffleActionAtom, verticalCoverLayoutAtom };
3863
3953
 
3864
3954
  //# sourceMappingURL=amll-react-framework.mjs.map