@applemusic-like-lyrics/react-full 0.4.2 → 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;
@@ -1529,13 +1539,14 @@ const VerticalLayout = ({ thumbSlot, coverSlot, smallControlsSlot, bigControlsSl
1529
1539
  });
1530
1540
  obz.observe(phonyBigCoverEl);
1531
1541
  obz.observe(phonySmallCoverEl);
1532
- setCurrentCoverStyle(calcCoverLayout(hideLyricRef.current));
1542
+ const init = calcCoverLayout(hideLyricRef.current);
1543
+ setCurrentCoverStyle(init);
1533
1544
  return () => {
1534
1545
  obz.disconnect();
1535
1546
  };
1536
1547
  }, [calcCoverLayout]);
1537
1548
  return /* @__PURE__ */ jsxs("div", {
1538
- 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),
1539
1550
  ref: rootRef,
1540
1551
  ...rest,
1541
1552
  children: [
@@ -1571,7 +1582,7 @@ const VerticalLayout = ({ thumbSlot, coverSlot, smallControlsSlot, bigControlsSl
1571
1582
  })]
1572
1583
  }),
1573
1584
  currentCoverStyle && /* @__PURE__ */ jsx(motion.div, {
1574
- className: classnames(vertical_module_default.coverFrame, immerseCover && vertical_module_default.immerseCover),
1585
+ className: classNames(vertical_module_default.coverFrame, immerseCover && vertical_module_default.immerseCover),
1575
1586
  animate: currentCoverStyle,
1576
1587
  initial: false,
1577
1588
  transition: {
@@ -2009,7 +2020,7 @@ const ToggleIconButton = memo((t0) => {
2009
2020
  }
2010
2021
  let t1;
2011
2022
  if ($[6] !== className) {
2012
- t1 = classnames(className, index_module_default$2.toggleIconButton);
2023
+ t1 = classNames(className, index_module_default$2.toggleIconButton);
2013
2024
  $[6] = className;
2014
2025
  $[7] = t1;
2015
2026
  } else t1 = $[7];
@@ -2680,22 +2691,59 @@ const showVolumeControlAtom = globalThis.jotaiAtomCache.get("/home/runner/work/a
2680
2691
  showVolumeControlAtom.debugLabel = "showVolumeControlAtom";
2681
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));
2682
2693
  showBottomControlAtom.debugLabel = "showBottomControlAtom";
2683
- const getInitialBackgroundRenderer = () => {
2684
- switch (localStorage.getItem("amll-react-full.lyricBackgroundRenderer")) {
2685
- case "pixi": return { renderer: PixiRenderer$1 };
2686
- case "css-bg": return { renderer: "css-bg" };
2687
- 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()
2688
2713
  }
2689
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") });
2690
2731
  /**
2691
2732
  * 配置所使用的歌词背景渲染器
2692
2733
  */
2693
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()));
2694
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
+ /**
2695
2743
  * 当背景渲染器设置为纯色或CSS背景时,使用此值
2696
2744
  * @default "#111111"
2697
2745
  */
2698
- lyricBackgroundRendererAtom.debugLabel = "lyricBackgroundRendererAtom";
2746
+ isolationRendererOptionsAtom.debugLabel = "isolationRendererOptionsAtom";
2699
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"));
2700
2748
  /**
2701
2749
  * 调节背景的最大渲染帧率,较低的值可以提升性能
@@ -2931,6 +2979,10 @@ var index_module_default = {
2931
2979
  };
2932
2980
  //#endregion
2933
2981
  //#region src/components/PrebuiltLyricPlayer/index.tsx
2982
+ /**
2983
+ * @fileoverview
2984
+ * 已经部署好所有组件的歌词播放器组件,在正确设置所有的 Jotai 状态后可以开箱即用
2985
+ */
2934
2986
  globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || {
2935
2987
  cache: /* @__PURE__ */ new Map(),
2936
2988
  get(name, inst) {
@@ -3526,7 +3578,7 @@ const PrebuiltMusicControls = (t0) => {
3526
3578
  const fftData = useAtomValue(fftDataAtom);
3527
3579
  let t1;
3528
3580
  if ($[4] !== className) {
3529
- t1 = classnames(index_module_default.controls, className);
3581
+ t1 = classNames(index_module_default.controls, className);
3530
3582
  $[4] = className;
3531
3583
  $[5] = t1;
3532
3584
  } else t1 = $[5];
@@ -3569,7 +3621,7 @@ const PrebuiltMusicControls = (t0) => {
3569
3621
  * 已经部署好所有组件的歌词播放器组件,在正确设置所有的 Jotai 状态后可以开箱即用
3570
3622
  */
3571
3623
  const PrebuiltLyricPlayer = (t0) => {
3572
- const $ = c(67);
3624
+ const $ = c(74);
3573
3625
  let bottomLineSlot;
3574
3626
  let className;
3575
3627
  let optimizeOptions;
@@ -3604,12 +3656,44 @@ const PrebuiltLyricPlayer = (t0) => {
3604
3656
  const coverElRef = useRef(null);
3605
3657
  const [layoutEl, setLayoutEl] = useState(null);
3606
3658
  const backgroundRenderer = useAtomValue(lyricBackgroundRendererAtom);
3607
- const showBottomControl = useAtomValue(showBottomControlAtom);
3608
- const cssBackgroundProperty = useAtomValue(cssBackgroundPropertyAtom);
3609
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);
3610
3682
  let t2;
3611
- if ($[5] !== isVertical || $[6] !== layoutEl) {
3612
- 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 = () => {
3613
3697
  if (!isVertical && coverElRef.current && layoutEl) {
3614
3698
  const obz = new ResizeObserver(() => {
3615
3699
  if (!(coverElRef.current && layoutEl)) return;
@@ -3627,59 +3711,59 @@ const PrebuiltLyricPlayer = (t0) => {
3627
3711
  setAlignAnchor("top");
3628
3712
  }
3629
3713
  };
3630
- t2 = [isVertical, layoutEl];
3631
- $[5] = isVertical;
3632
- $[6] = layoutEl;
3633
- $[7] = t1;
3634
- $[8] = t2;
3714
+ t4 = [isVertical, layoutEl];
3715
+ $[11] = isVertical;
3716
+ $[12] = layoutEl;
3717
+ $[13] = t3;
3718
+ $[14] = t4;
3635
3719
  } else {
3636
- t1 = $[7];
3637
- t2 = $[8];
3720
+ t3 = $[13];
3721
+ t4 = $[14];
3638
3722
  }
3639
- useLayoutEffect(t1, t2);
3723
+ useLayoutEffect(t3, t4);
3640
3724
  const verticalImmerseCover = hideLyricView && (verticalCoverLayout === "auto" ? musicCoverIsVideo && isVertical : verticalCoverLayout === "force-immersive");
3641
- let t3;
3642
- if ($[9] !== className) {
3643
- t3 = classnames(index_module_default.autoLyricLayout, className);
3644
- $[9] = className;
3645
- $[10] = t3;
3646
- } else t3 = $[10];
3647
- const t4 = !musicIsPlaying && !musicCoverIsVideo && verticalImmerseCover;
3648
3725
  let t5;
3649
- if ($[11] !== musicCover || $[12] !== musicCoverIsVideo || $[13] !== t4) {
3650
- 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, {
3651
3735
  coverUrl: musicCover,
3652
3736
  coverIsVideo: musicCoverIsVideo,
3653
3737
  ref: coverElRef,
3654
- musicPaused: t4
3738
+ musicPaused: t6
3655
3739
  });
3656
- $[11] = musicCover;
3657
- $[12] = musicCoverIsVideo;
3658
- $[13] = t4;
3659
- $[14] = t5;
3660
- } else t5 = $[14];
3661
- let t6;
3662
- if ($[15] !== onClickControlThumb) {
3663
- t6 = /* @__PURE__ */ jsx(ControlThumb, { onClick: onClickControlThumb });
3664
- $[15] = onClickControlThumb;
3665
- $[16] = t6;
3666
- } else t6 = $[16];
3667
- const t7 = hideLyricView && index_module_default.hideLyric;
3740
+ $[17] = musicCover;
3741
+ $[18] = musicCoverIsVideo;
3742
+ $[19] = t6;
3743
+ $[20] = t7;
3744
+ } else t7 = $[20];
3668
3745
  let t8;
3669
- if ($[17] !== t7) {
3670
- t8 = classnames(index_module_default.smallMusicInfo, t7);
3671
- $[17] = t7;
3672
- $[18] = t8;
3673
- } else t8 = $[18];
3674
- let t9;
3675
- if ($[19] !== t8) {
3676
- t9 = /* @__PURE__ */ jsx(PrebuiltMusicInfo, { className: t8 });
3677
- $[19] = t8;
3678
- $[20] = t9;
3679
- } 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;
3680
3752
  let t10;
3681
- if ($[21] !== backgroundRenderer.renderer || $[22] !== cssBackgroundProperty || $[23] !== isLyricPageOpened || $[24] !== lowFreqVolume || $[25] !== lyricBackgroundFPS || $[26] !== lyricBackgroundRenderScale || $[27] !== lyricBackgroundStaticMode || $[28] !== musicCover || $[29] !== musicCoverIsVideo) {
3682
- 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: {
3683
3767
  zIndex: -1,
3684
3768
  width: "100%",
3685
3769
  height: "100%",
@@ -3693,48 +3777,50 @@ const PrebuiltLyricPlayer = (t0) => {
3693
3777
  lowFreqVolume,
3694
3778
  renderScale: lyricBackgroundRenderScale,
3695
3779
  fps: lyricBackgroundFPS,
3696
- renderer: typeof backgroundRenderer.renderer === "string" ? backgroundRenderer.renderer === "pixi" ? PixiRenderer : MeshGradientRenderer : backgroundRenderer.renderer,
3780
+ renderer: resolvedBackgroundRenderer,
3697
3781
  staticMode: lyricBackgroundStaticMode || !isLyricPageOpened,
3782
+ configureRenderer: configureBackgroundRenderer,
3698
3783
  style: { zIndex: -1 }
3699
3784
  });
3700
- $[21] = backgroundRenderer.renderer;
3701
- $[22] = cssBackgroundProperty;
3702
- $[23] = isLyricPageOpened;
3703
- $[24] = lowFreqVolume;
3704
- $[25] = lyricBackgroundFPS;
3705
- $[26] = lyricBackgroundRenderScale;
3706
- $[27] = lyricBackgroundStaticMode;
3707
- $[28] = musicCover;
3708
- $[29] = musicCoverIsVideo;
3709
- $[30] = t10;
3710
- } else t10 = $[30];
3711
- const t11 = hideLyricView && index_module_default.hideLyric;
3712
- let t12;
3713
- if ($[31] !== t11) {
3714
- t12 = classnames(index_module_default.bigMusicInfo, t11);
3715
- $[31] = t11;
3716
- $[32] = t12;
3717
- } else t12 = $[32];
3718
- let t13;
3719
- if ($[33] !== t12) {
3720
- t13 = /* @__PURE__ */ jsx(PrebuiltMusicInfo, { className: t12 });
3721
- $[33] = t12;
3722
- $[34] = t13;
3723
- } 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;
3724
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];
3725
3804
  let t15;
3726
- if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
3727
- t14 = /* @__PURE__ */ jsx(PrebuiltProgressBar, {});
3728
- t15 = /* @__PURE__ */ jsx(PrebuiltMusicControls, { className: index_module_default.bigControls });
3729
- $[35] = t14;
3730
- $[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;
3731
3817
  } else {
3732
- t14 = $[35];
3733
- t15 = $[36];
3818
+ t16 = $[42];
3819
+ t17 = $[43];
3734
3820
  }
3735
- let t16;
3736
- if ($[37] !== hideLyricView || $[38] !== setHideLyricView || $[39] !== showBottomControl) {
3737
- t16 = showBottomControl && /* @__PURE__ */ jsxs("div", {
3821
+ let t18;
3822
+ if ($[44] !== hideLyricView || $[45] !== setHideLyricView || $[46] !== showBottomControl) {
3823
+ t18 = showBottomControl && /* @__PURE__ */ jsxs("div", {
3738
3824
  style: {
3739
3825
  display: "flex",
3740
3826
  justifyContent: "space-evenly"
@@ -3749,32 +3835,32 @@ const PrebuiltLyricPlayer = (t0) => {
3749
3835
  /* @__PURE__ */ jsx(PrebuiltToggleIconButton, { type: "playlist" })
3750
3836
  ]
3751
3837
  });
3752
- $[37] = hideLyricView;
3753
- $[38] = setHideLyricView;
3754
- $[39] = showBottomControl;
3755
- $[40] = t16;
3756
- } else t16 = $[40];
3757
- let t17;
3758
- if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
3759
- t17 = /* @__PURE__ */ jsx(PrebuiltVolumeControl, { className: index_module_default.bigVolumeControl });
3760
- $[41] = t17;
3761
- } else t17 = $[41];
3762
- let t18;
3763
- if ($[42] !== t13 || $[43] !== t16) {
3764
- t18 = /* @__PURE__ */ jsxs(Fragment, { children: [
3765
- t13,
3766
- 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: [
3767
3851
  t15,
3768
3852
  t16,
3769
- t17
3853
+ t17,
3854
+ t18,
3855
+ t19
3770
3856
  ] });
3771
- $[42] = t13;
3772
- $[43] = t16;
3773
- $[44] = t18;
3774
- } else t18 = $[44];
3775
- let t19;
3776
- if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
3777
- 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: [
3778
3864
  /* @__PURE__ */ jsx(PrebuiltMusicInfo, { className: index_module_default.horizontalControls }),
3779
3865
  /* @__PURE__ */ jsx(PrebuiltProgressBar, {}),
3780
3866
  /* @__PURE__ */ jsx(PrebuiltMusicControls, {
@@ -3783,11 +3869,11 @@ const PrebuiltLyricPlayer = (t0) => {
3783
3869
  }),
3784
3870
  /* @__PURE__ */ jsx(PrebuiltVolumeControl, {})
3785
3871
  ] });
3786
- $[45] = t19;
3787
- } else t19 = $[45];
3788
- let t20;
3789
- if ($[46] !== hideLyricView || $[47] !== setHideLyricView || $[48] !== showBottomControl) {
3790
- 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: [
3791
3877
  /* @__PURE__ */ jsx(PrebuiltToggleIconButton, { type: "playlist" }),
3792
3878
  /* @__PURE__ */ jsx(PrebuiltToggleIconButton, {
3793
3879
  type: "lyrics",
@@ -3797,57 +3883,57 @@ const PrebuiltLyricPlayer = (t0) => {
3797
3883
  /* @__PURE__ */ jsx("div", { style: { flex: "1" } }),
3798
3884
  /* @__PURE__ */ jsx(PrebuiltToggleIconButton, { type: "airplay" })
3799
3885
  ] });
3800
- $[46] = hideLyricView;
3801
- $[47] = setHideLyricView;
3802
- $[48] = showBottomControl;
3803
- $[49] = t20;
3804
- } else t20 = $[49];
3805
- let t21;
3806
- if ($[50] !== alignAnchor || $[51] !== alignPosition || $[52] !== bottomLineSlot || $[53] !== optimizeOptions) {
3807
- 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, {
3808
3894
  alignPosition,
3809
3895
  alignAnchor,
3810
3896
  bottomLine: bottomLineSlot,
3811
3897
  optimizeOptions
3812
3898
  });
3813
- $[50] = alignAnchor;
3814
- $[51] = alignPosition;
3815
- $[52] = bottomLineSlot;
3816
- $[53] = optimizeOptions;
3817
- $[54] = t21;
3818
- } else t21 = $[54];
3819
- let t22;
3820
- if ($[55] !== hideLyricView || $[56] !== rest || $[57] !== t10 || $[58] !== t18 || $[59] !== t20 || $[60] !== t21 || $[61] !== t3 || $[62] !== t5 || $[63] !== t6 || $[64] !== t9 || $[65] !== verticalImmerseCover) {
3821
- 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, {
3822
3908
  onElementMounted: setLayoutEl,
3823
- className: t3,
3909
+ className: t5,
3824
3910
  onLayoutChange: setIsVertical,
3825
3911
  verticalImmerseCover,
3826
- coverSlot: t5,
3827
- thumbSlot: t6,
3828
- smallControlsSlot: t9,
3829
- backgroundSlot: t10,
3830
- bigControlsSlot: t18,
3831
- controlsSlot: t19,
3832
- horizontalBottomControls: t20,
3833
- 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,
3834
3920
  hideLyric: hideLyricView,
3835
3921
  ...rest
3836
3922
  }) });
3837
- $[55] = hideLyricView;
3838
- $[56] = rest;
3839
- $[57] = t10;
3840
- $[58] = t18;
3841
- $[59] = t20;
3842
- $[60] = t21;
3843
- $[61] = t3;
3844
- $[62] = t5;
3845
- $[63] = t6;
3846
- $[64] = t9;
3847
- $[65] = verticalImmerseCover;
3848
- $[66] = t22;
3849
- } else t22 = $[66];
3850
- 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;
3851
3937
  };
3852
3938
  function _temp(v) {
3853
3939
  return v.name;
@@ -3863,6 +3949,6 @@ globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || {
3863
3949
  }
3864
3950
  };
3865
3951
  //#endregion
3866
- 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 };
3867
3953
 
3868
3954
  //# sourceMappingURL=amll-react-framework.mjs.map