@applemusic-like-lyrics/vue 0.4.0 → 0.4.1
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.
- package/dist/amll-vue.cjs +16 -4
- package/dist/amll-vue.cjs.map +1 -1
- package/dist/amll-vue.d.cts +22 -1
- package/dist/amll-vue.d.mts +22 -1
- package/dist/amll-vue.mjs +17 -5
- package/dist/amll-vue.mjs.map +1 -1
- package/package.json +6 -6
package/dist/amll-vue.cjs
CHANGED
|
@@ -126,9 +126,13 @@ const lyricPlayerProps = {
|
|
|
126
126
|
default: false
|
|
127
127
|
},
|
|
128
128
|
maskObsceneWordsMode: {
|
|
129
|
-
type:
|
|
129
|
+
type: String,
|
|
130
130
|
default: _applemusic_like_lyrics_core.MaskObsceneWordsMode.Disabled
|
|
131
131
|
},
|
|
132
|
+
optimizeOptions: {
|
|
133
|
+
type: Object,
|
|
134
|
+
required: false
|
|
135
|
+
},
|
|
132
136
|
lyricLines: {
|
|
133
137
|
type: Object,
|
|
134
138
|
required: false
|
|
@@ -234,9 +238,17 @@ const LyricPlayer = (0, vue.defineComponent)({
|
|
|
234
238
|
if (props.enableScale !== void 0) playerRef.value?.setEnableScale(props.enableScale);
|
|
235
239
|
else playerRef.value?.setEnableScale(true);
|
|
236
240
|
});
|
|
237
|
-
(0, vue.
|
|
238
|
-
|
|
239
|
-
|
|
241
|
+
(0, vue.watch)([
|
|
242
|
+
playerRef,
|
|
243
|
+
() => props.lyricLines,
|
|
244
|
+
() => props.optimizeOptions
|
|
245
|
+
], ([player, lyricLines, optimizeOptions]) => {
|
|
246
|
+
if (!player) return;
|
|
247
|
+
if (optimizeOptions !== void 0) player.setOptimizeOptions(optimizeOptions);
|
|
248
|
+
if (lyricLines !== void 0) player.setLyricLines(lyricLines);
|
|
249
|
+
else player.setLyricLines([]);
|
|
250
|
+
if (props.currentTime !== void 0) player.setCurrentTime(props.currentTime, true);
|
|
251
|
+
}, { immediate: true });
|
|
240
252
|
(0, vue.watchEffect)(() => {
|
|
241
253
|
if (props.currentTime !== void 0) playerRef.value?.setCurrentTime(props.currentTime);
|
|
242
254
|
});
|
package/dist/amll-vue.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amll-vue.cjs","names":["AbstractBaseRenderer","BaseRenderer","BackgroundRender","CoreBackgroundRender","MeshGradientRenderer","defineComponent","ExtractPublicPropTypes","onMounted","onUnmounted","PropType","Ref","ref","ShallowRef","useTemplateRef","watchEffect","BackgroundRenderRef","bgRender","wrapperEl","Readonly","HTMLDivElement","backgroundRenderProps","album","type","String","Object","HTMLImageElement","HTMLVideoElement","required","albumIsVideo","Boolean","fps","Number","playing","flowSpeed","hasLyric","lowFreqVolume","renderScale","renderer","args","ConstructorParameters","const","BackgroundRenderProps","name","props","setup","expose","wrapperRef","bgRenderRef","value","new","el","getElement","style","width","height","appendChild","dispose","setAlbum","setFPS","pause","resume","setFlowSpeed","setRenderScale","setLowFreqVolume","undefined","setHasLyric","_createVNode","BaseRenderer","LyricPlayer","CoreLyricPlayer","LyricLine","LyricLineMouseEvent","LyricPlayerBase","MaskObsceneWordsMode","spring","computed","defineComponent","ExtractPublicPropTypes","onMounted","onUnmounted","PropType","Ref","ref","ShallowRef","SlotsType","Teleport","useTemplateRef","watchEffect","lyricPlayerProps","disabled","type","Boolean","default","playing","alignAnchor","String","alignPosition","Number","enableSpring","enableBlur","enableScale","hidePassedLines","maskObsceneWordsMode","Object","Disabled","lyricLines","required","currentTime","wordFadeWidth","linePosXSpringParams","Partial","SpringParams","linePosYSpringParams","lineScaleSpringParams","lyricPlayer","args","ConstructorParameters","const","LyricPlayerProps","lyricPlayerEmits","lineClick","_","lineContextmenu","LyricPlayerEmits","LyricPlayerRef","wrapperEl","Readonly","HTMLDivElement","name","props","emits","slots","setup","expose","emit","attrs","wrapperRef","playerRef","lineClickHandler","e","Event","lineContextMenuHandler","wrapper","value","appendChild","getElement","addEventListener","removeEventListener","dispose","onCleanup","canceled","lastTime","onFrame","time","update","requestAnimationFrame","undefined","resume","pause","setAlignAnchor","setHidePassedLines","setMaskObsceneWords","setAlignPosition","setEnableSpring","setEnableBlur","setEnableScale","setLyricLines","setCurrentTime","setWordFadeWidth","setLinePosXSpringParams","setLinePosYSpringParams","setLineScaleSpringParams","bottomLineEl","getBottomLineElement","_createVNode","_mergeProps"],"sources":["../src/BackgroundRender.tsx","../src/LyricPlayer.tsx"],"sourcesContent":["import {\n\ttype AbstractBaseRenderer,\n\ttype BaseRenderer,\n\tBackgroundRender as CoreBackgroundRender,\n\tMeshGradientRenderer,\n} from \"@applemusic-like-lyrics/core\";\nimport {\n\tdefineComponent,\n\ttype ExtractPublicPropTypes,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\ttype Ref,\n\tref,\n\ttype ShallowRef,\n\tuseTemplateRef,\n\twatchEffect,\n} from \"vue\";\n\n/**\n * 背景渲染组件的引用\n */\nexport interface BackgroundRenderRef {\n\t/**\n\t * 背景渲染实例引用\n\t */\n\tbgRender?: Ref<AbstractBaseRenderer | undefined>;\n\t/**\n\t * 将背景渲染实例的元素包裹起来的 DIV 元素实例\n\t */\n\twrapperEl: Readonly<ShallowRef<HTMLDivElement | null>>;\n}\n\nconst backgroundRenderProps = {\n\t/**\n\t * 设置背景专辑资源\n\t */\n\talbum: {\n\t\ttype: [String, Object] as PropType<\n\t\t\tstring | HTMLImageElement | HTMLVideoElement\n\t\t>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置专辑资源是否为视频\n\t */\n\talbumIsVideo: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前背景动画帧率,如果为 `undefined` 则默认为 `30`\n\t */\n\tfps: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放状态,如果为 `undefined` 则默认为 `true`\n\t */\n\tplaying: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前动画流动速度,如果为 `undefined` 则默认为 `2`\n\t */\n\tflowSpeed: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置背景是否根据“是否有歌词”这个特征调整自身效果,例如有歌词时会变得更加活跃\n\t *\n\t * 部分渲染器会根据这个特征调整自身效果\n\t *\n\t * 如果不确定是否需要赋值或无法知晓是否包含歌词,请传入 true 或不做任何处理(默认值为 true)\n\t */\n\thasLyric: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置低频的音量大小,范围在 80hz-120hz 之间为宜,取值范围在 [0.0-1.0] 之间\n\t *\n\t * 部分渲染器会根据音量大小调整背景效果(例如根据鼓点跳动)\n\t *\n\t * 如果无法获取到类似的数据,请传入 undefined 或 1.0 作为默认值,或不做任何处理(默认值即 1.0)\n\t */\n\tlowFreqVolume: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前渲染缩放比例,如果为 `undefined` 则默认为 `0.5`\n\t */\n\trenderScale: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置渲染器,如果为 `undefined` 则默认为 `MeshGradientRenderer`\n\t * 默认渲染器有可能会随着版本更新而更换\n\t */\n\trenderer: {\n\t\ttype: Object as PropType<{\n\t\t\tnew (...args: ConstructorParameters<typeof BaseRenderer>): BaseRenderer;\n\t\t}>,\n\t\trequired: false,\n\t},\n} as const;\n\nexport type BackgroundRenderProps = ExtractPublicPropTypes<\n\ttypeof backgroundRenderProps\n>;\n\nexport const BackgroundRender = defineComponent({\n\tname: \"BackgroundRender\",\n\tprops: backgroundRenderProps,\n\tsetup(props, { expose }) {\n\t\tconst wrapperRef = useTemplateRef<HTMLDivElement>(\"wrapper-ref\");\n\t\tconst bgRenderRef = ref<AbstractBaseRenderer>();\n\n\t\tonMounted(() => {\n\t\t\tif (wrapperRef.value) {\n\t\t\t\tbgRenderRef.value = CoreBackgroundRender.new(\n\t\t\t\t\tprops.renderer ?? MeshGradientRenderer,\n\t\t\t\t);\n\t\t\t\tconst el = bgRenderRef.value.getElement();\n\t\t\t\tel.style.width = \"100%\";\n\t\t\t\tel.style.height = \"100%\";\n\t\t\t\twrapperRef.value.appendChild(el);\n\t\t\t}\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tif (bgRenderRef.value) {\n\t\t\t\tbgRenderRef.value.dispose();\n\t\t\t}\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.album)\n\t\t\t\tbgRenderRef.value?.setAlbum(props.album, props.albumIsVideo);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.fps) bgRenderRef.value?.setFPS(props.fps);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.playing) bgRenderRef.value?.pause();\n\t\t\telse bgRenderRef.value?.resume();\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.flowSpeed) bgRenderRef.value?.setFlowSpeed(props.flowSpeed);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.renderScale)\n\t\t\t\tbgRenderRef.value?.setRenderScale(props.renderScale);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lowFreqVolume)\n\t\t\t\tbgRenderRef.value?.setLowFreqVolume(props.lowFreqVolume);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.hasLyric !== undefined)\n\t\t\t\tbgRenderRef.value?.setHasLyric(props.hasLyric ?? true);\n\t\t});\n\n\t\texpose<BackgroundRenderRef>({\n\t\t\tbgRender: bgRenderRef,\n\t\t\twrapperEl: wrapperRef,\n\t\t});\n\n\t\treturn () => <div style=\"display: contents;\" ref=\"wrapper-ref\" />;\n\t},\n});\n","import {\n\ttype BaseRenderer,\n\tLyricPlayer as CoreLyricPlayer,\n\ttype LyricLine,\n\ttype LyricLineMouseEvent,\n\ttype LyricPlayerBase,\n\tMaskObsceneWordsMode,\n\ttype spring,\n} from \"@applemusic-like-lyrics/core\";\nimport {\n\tcomputed,\n\tdefineComponent,\n\ttype ExtractPublicPropTypes,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\ttype Ref,\n\tref,\n\ttype ShallowRef,\n\ttype SlotsType,\n\tTeleport,\n\tuseTemplateRef,\n\twatchEffect,\n} from \"vue\";\n\nconst lyricPlayerProps = {\n\t/**\n\t * 是否禁用歌词播放组件,默认为 `false`,歌词组件启用后将会开始逐帧更新歌词的动画效果,并对传入的其他参数变更做出反馈。\n\t *\n\t * 如果禁用了歌词组件动画,你也可以通过引用取得原始渲染组件实例,手动逐帧调用其 `update` 函数来更新动画效果。\n\t */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/**\n\t * 是否演出部分效果,目前会控制播放间奏点的动画的播放暂停与否,默认为 `true`\n\t */\n\tplaying: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置歌词行的对齐方式,如果为 `undefined` 则默认为 `center`\n\t *\n\t * - 设置成 `top` 的话将会向目标歌词行的顶部对齐\n\t * - 设置成 `bottom` 的话将会向目标歌词行的底部对齐\n\t * - 设置成 `center` 的话将会向目标歌词行的垂直中心对齐\n\t */\n\talignAnchor: {\n\t\ttype: String as PropType<\"top\" | \"bottom\" | \"center\">,\n\t\tdefault: \"center\",\n\t},\n\t/**\n\t * 设置默认的歌词行对齐位置,相对于整个歌词播放组件的大小位置,如果为 `undefined`\n\t * 则默认为 `0.5`\n\t *\n\t * 可以设置一个 `[0.0-1.0]` 之间的任意数字,代表组件高度由上到下的比例位置\n\t */\n\talignPosition: {\n\t\ttype: Number,\n\t\tdefault: 0.5,\n\t},\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tenableSpring: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否启用歌词行的模糊效果,默认为 `true`\n\t */\n\tenableBlur: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tenableScale: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否隐藏已经播放过的歌词行,默认不隐藏\n\t */\n\thidePassedLines: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/**\n\t * 设置歌词中不雅用语的掩码模式,默认为 `MaskObsceneWordsMode.Disabled`,即不掩码\n\t */\n\tmaskObsceneWordsMode: {\n\t\ttype: Object as PropType<MaskObsceneWordsMode>,\n\t\tdefault: MaskObsceneWordsMode.Disabled,\n\t},\n\t/**\n\t * 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误\n\t */\n\tlyricLines: {\n\t\ttype: Object as PropType<LyricLine[]>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放进度,单位为毫秒且**必须是整数**,此时将会更新内部的歌词进度信息\n\t * 内部会根据调用间隔和播放进度自动决定如何滚动和显示歌词,所以这个的调用频率越快越准确越好\n\t */\n\tcurrentTime: {\n\t\ttype: Number,\n\t\tdefault: 0,\n\t},\n\t/**\n\t * 设置文字动画的渐变宽度,单位以歌词行的主文字字体大小的倍数为单位,默认为 0.5,即一个全角字符的一半宽度\n\t *\n\t * 如果要模拟 Apple Music for Android 的效果,可以设置为 1\n\t *\n\t * 如果要模拟 Apple Music for iPad 的效果,可以设置为 0.5\n\t *\n\t * 如果想要近乎禁用渐变效果,可以设置成非常接近 0 的小数(例如 `0.0001` ),但是**不可以为 0**\n\t */\n\twordFadeWidth: {\n\t\ttype: Number,\n\t\tdefault: 0.5,\n\t},\n\t/**\n\t * 设置所有歌词行在横坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlinePosXSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置所有歌词行在纵坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlinePosYSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置所有歌词行在缩放大小上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlineScaleSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置渲染器,如果为 `undefined` 则默认为 `MeshGradientRenderer`\n\t * 默认渲染器有可能会随着版本更新而更换\n\t */\n\tlyricPlayer: {\n\t\ttype: Object as PropType<{\n\t\t\tnew (...args: ConstructorParameters<typeof BaseRenderer>): BaseRenderer;\n\t\t}>,\n\t\trequired: false,\n\t},\n} as const;\n\n/**\n * 歌词播放组件的属性\n */\nexport type LyricPlayerProps = ExtractPublicPropTypes<typeof lyricPlayerProps>;\n\nconst lyricPlayerEmits = {\n\tlineClick: (_: LyricLineMouseEvent) => true,\n\tlineContextmenu: (_: LyricLineMouseEvent) => true,\n} as const;\n\n/**\n * 歌词播放组件的事件\n */\nexport type LyricPlayerEmits = typeof lyricPlayerEmits;\n\n/**\n * 歌词播放组件的引用\n */\nexport interface LyricPlayerRef {\n\t/**\n\t * 歌词播放实例\n\t */\n\tlyricPlayer: Ref<LyricPlayerBase | undefined>;\n\t/**\n\t * 将歌词播放实例的元素包裹起来的 DIV 元素实例\n\t */\n\twrapperEl: Readonly<ShallowRef<HTMLDivElement | null>>;\n}\n\nexport const LyricPlayer = defineComponent({\n\tname: \"LyricPlayer\",\n\tprops: lyricPlayerProps,\n\temits: lyricPlayerEmits,\n\tslots: Object as SlotsType<{\n\t\t\"bottom-line\": () => void;\n\t}>,\n\tsetup(props, { expose, emit, attrs, slots }) {\n\t\tconst wrapperRef = useTemplateRef<HTMLDivElement>(\"wrapper-ref\");\n\t\tconst playerRef = ref<CoreLyricPlayer>();\n\n\t\tconst lineClickHandler = (e: Event) =>\n\t\t\temit(\"lineClick\", e as LyricLineMouseEvent);\n\t\tconst lineContextMenuHandler = (e: Event) =>\n\t\t\temit(\"lineContextmenu\", e as LyricLineMouseEvent);\n\n\t\tonMounted(() => {\n\t\t\tconst wrapper = wrapperRef.value;\n\t\t\tif (wrapper) {\n\t\t\t\tplayerRef.value = new CoreLyricPlayer();\n\t\t\t\twrapper.appendChild(playerRef.value.getElement());\n\t\t\t\tplayerRef.value.addEventListener(\"line-click\", lineClickHandler);\n\t\t\t\tplayerRef.value.addEventListener(\n\t\t\t\t\t\"line-contextmenu\",\n\t\t\t\t\tlineContextMenuHandler,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tif (playerRef.value) {\n\t\t\t\tplayerRef.value.removeEventListener(\"line-click\", lineClickHandler);\n\t\t\t\tplayerRef.value.removeEventListener(\n\t\t\t\t\t\"line-contextmenu\",\n\t\t\t\t\tlineContextMenuHandler,\n\t\t\t\t);\n\t\t\t\tplayerRef.value.dispose();\n\t\t\t}\n\t\t});\n\n\t\twatchEffect((onCleanup) => {\n\t\t\tif (!props.disabled) {\n\t\t\t\tlet canceled = false;\n\t\t\t\tlet lastTime = -1;\n\t\t\t\tconst onFrame = (time: number) => {\n\t\t\t\t\tif (canceled) return;\n\t\t\t\t\tif (lastTime === -1) {\n\t\t\t\t\t\tlastTime = time;\n\t\t\t\t\t}\n\t\t\t\t\tplayerRef.value?.update(time - lastTime);\n\t\t\t\t\tlastTime = time;\n\t\t\t\t\trequestAnimationFrame(onFrame);\n\t\t\t\t};\n\t\t\t\trequestAnimationFrame(onFrame);\n\t\t\t\tonCleanup(() => {\n\t\t\t\t\tcanceled = true;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.playing !== undefined) {\n\t\t\t\tif (props.playing) {\n\t\t\t\t\tplayerRef.value?.resume();\n\t\t\t\t} else {\n\t\t\t\t\tplayerRef.value?.pause();\n\t\t\t\t}\n\t\t\t} else playerRef.value?.resume();\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.alignAnchor !== undefined)\n\t\t\t\tplayerRef.value?.setAlignAnchor(props.alignAnchor);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.hidePassedLines !== undefined)\n\t\t\t\tplayerRef.value?.setHidePassedLines(props.hidePassedLines);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.maskObsceneWordsMode !== undefined)\n\t\t\t\tplayerRef.value?.setMaskObsceneWords(props.maskObsceneWordsMode);\n\t\t\telse playerRef.value?.setMaskObsceneWords(MaskObsceneWordsMode.Disabled);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.alignPosition !== undefined)\n\t\t\t\tplayerRef.value?.setAlignPosition(props.alignPosition);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableSpring !== undefined)\n\t\t\t\tplayerRef.value?.setEnableSpring(props.enableSpring);\n\t\t\telse playerRef.value?.setEnableSpring(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableBlur !== undefined)\n\t\t\t\tplayerRef.value?.setEnableBlur(props.enableBlur);\n\t\t\telse playerRef.value?.setEnableBlur(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableScale !== undefined)\n\t\t\t\tplayerRef.value?.setEnableScale(props.enableScale);\n\t\t\telse playerRef.value?.setEnableScale(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lyricLines !== undefined)\n\t\t\t\tplayerRef.value?.setLyricLines(props.lyricLines);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.currentTime !== undefined)\n\t\t\t\tplayerRef.value?.setCurrentTime(props.currentTime);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.wordFadeWidth !== undefined)\n\t\t\t\tplayerRef.value?.setWordFadeWidth(props.wordFadeWidth);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.linePosXSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLinePosXSpringParams(props.linePosXSpringParams);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.linePosYSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLinePosYSpringParams(props.linePosYSpringParams);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lineScaleSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLineScaleSpringParams(props.lineScaleSpringParams);\n\t\t});\n\n\t\tconst bottomLineEl = computed(() =>\n\t\t\tplayerRef.value?.getBottomLineElement(),\n\t\t);\n\n\t\texpose<LyricPlayerRef>({\n\t\t\tlyricPlayer: playerRef,\n\t\t\twrapperEl: wrapperRef,\n\t\t});\n\n\t\treturn () => (\n\t\t\t<div ref=\"wrapper-ref\" {...attrs}>\n\t\t\t\t{bottomLineEl.value && (\n\t\t\t\t\t<Teleport to={bottomLineEl.value}>\n\t\t\t\t\t\t{slots[\"bottom-line\"]?.()}\n\t\t\t\t\t</Teleport>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n});\n"],"mappings":";;;;AAiCA,MAAMoB,wBAAwB;CAI7BC,OAAO;EACNC,MAAM,CAACC,QAAQC,OAAO;EAGtBG,UAAU;EACV;CAIDC,cAAc;EACbN,MAAMO;EACNF,UAAU;EACV;CAIDG,KAAK;EACJR,MAAMS;EACNJ,UAAU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,MAAK,EAAA,CAC9BqC,aAAa7B,UAAAA,GAAAA,IAAAA,aAAK1D,IAAAA,UAAA,EAAA,MACJuF,aAAa7B,OAAK,EAAA,EAAAnD,eAAA,CAC9BuC,MAAM,kBAAkB,CAAA,EAAA,CAE1B,CAAA,CAEF;;CAEF,CAAC"}
|
|
1
|
+
{"version":3,"file":"amll-vue.cjs","names":["AbstractBaseRenderer","BaseRenderer","BackgroundRender","CoreBackgroundRender","MeshGradientRenderer","defineComponent","ExtractPublicPropTypes","onMounted","onUnmounted","PropType","Ref","ref","ShallowRef","useTemplateRef","watchEffect","BackgroundRenderRef","bgRender","wrapperEl","Readonly","HTMLDivElement","backgroundRenderProps","album","type","String","Object","HTMLImageElement","HTMLVideoElement","required","albumIsVideo","Boolean","fps","Number","playing","flowSpeed","hasLyric","lowFreqVolume","renderScale","renderer","args","ConstructorParameters","const","BackgroundRenderProps","name","props","setup","expose","wrapperRef","bgRenderRef","value","new","el","getElement","style","width","height","appendChild","dispose","setAlbum","setFPS","pause","resume","setFlowSpeed","setRenderScale","setLowFreqVolume","undefined","setHasLyric","_createVNode","BaseRenderer","LyricPlayer","CoreLyricPlayer","LyricLine","LyricLineMouseEvent","LyricPlayerBase","MaskObsceneWordsMode","OptimizeLyricOptions","spring","computed","defineComponent","ExtractPublicPropTypes","onMounted","onUnmounted","PropType","Ref","ref","ShallowRef","SlotsType","Teleport","useTemplateRef","watch","watchEffect","lyricPlayerProps","disabled","type","Boolean","default","playing","alignAnchor","String","alignPosition","Number","enableSpring","enableBlur","enableScale","hidePassedLines","maskObsceneWordsMode","Disabled","optimizeOptions","Object","required","lyricLines","currentTime","wordFadeWidth","linePosXSpringParams","Partial","SpringParams","linePosYSpringParams","lineScaleSpringParams","lyricPlayer","args","ConstructorParameters","const","LyricPlayerProps","lyricPlayerEmits","lineClick","_","lineContextmenu","LyricPlayerEmits","LyricPlayerRef","wrapperEl","Readonly","HTMLDivElement","name","props","emits","slots","setup","expose","emit","attrs","wrapperRef","playerRef","lineClickHandler","e","Event","lineContextMenuHandler","wrapper","value","appendChild","getElement","addEventListener","removeEventListener","dispose","onCleanup","canceled","lastTime","onFrame","time","update","requestAnimationFrame","undefined","resume","pause","setAlignAnchor","setHidePassedLines","setMaskObsceneWords","setAlignPosition","setEnableSpring","setEnableBlur","setEnableScale","player","setOptimizeOptions","setLyricLines","setCurrentTime","immediate","setWordFadeWidth","setLinePosXSpringParams","setLinePosYSpringParams","setLineScaleSpringParams","bottomLineEl","getBottomLineElement","_createVNode","_mergeProps"],"sources":["../src/BackgroundRender.tsx","../src/LyricPlayer.tsx"],"sourcesContent":["import {\n\ttype AbstractBaseRenderer,\n\ttype BaseRenderer,\n\tBackgroundRender as CoreBackgroundRender,\n\tMeshGradientRenderer,\n} from \"@applemusic-like-lyrics/core\";\nimport {\n\tdefineComponent,\n\ttype ExtractPublicPropTypes,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\ttype Ref,\n\tref,\n\ttype ShallowRef,\n\tuseTemplateRef,\n\twatchEffect,\n} from \"vue\";\n\n/**\n * 背景渲染组件的引用\n */\nexport interface BackgroundRenderRef {\n\t/**\n\t * 背景渲染实例引用\n\t */\n\tbgRender?: Ref<AbstractBaseRenderer | undefined>;\n\t/**\n\t * 将背景渲染实例的元素包裹起来的 DIV 元素实例\n\t */\n\twrapperEl: Readonly<ShallowRef<HTMLDivElement | null>>;\n}\n\nconst backgroundRenderProps = {\n\t/**\n\t * 设置背景专辑资源\n\t */\n\talbum: {\n\t\ttype: [String, Object] as PropType<\n\t\t\tstring | HTMLImageElement | HTMLVideoElement\n\t\t>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置专辑资源是否为视频\n\t */\n\talbumIsVideo: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前背景动画帧率,如果为 `undefined` 则默认为 `30`\n\t */\n\tfps: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放状态,如果为 `undefined` 则默认为 `true`\n\t */\n\tplaying: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前动画流动速度,如果为 `undefined` 则默认为 `2`\n\t */\n\tflowSpeed: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置背景是否根据“是否有歌词”这个特征调整自身效果,例如有歌词时会变得更加活跃\n\t *\n\t * 部分渲染器会根据这个特征调整自身效果\n\t *\n\t * 如果不确定是否需要赋值或无法知晓是否包含歌词,请传入 true 或不做任何处理(默认值为 true)\n\t */\n\thasLyric: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置低频的音量大小,范围在 80hz-120hz 之间为宜,取值范围在 [0.0-1.0] 之间\n\t *\n\t * 部分渲染器会根据音量大小调整背景效果(例如根据鼓点跳动)\n\t *\n\t * 如果无法获取到类似的数据,请传入 undefined 或 1.0 作为默认值,或不做任何处理(默认值即 1.0)\n\t */\n\tlowFreqVolume: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前渲染缩放比例,如果为 `undefined` 则默认为 `0.5`\n\t */\n\trenderScale: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置渲染器,如果为 `undefined` 则默认为 `MeshGradientRenderer`\n\t * 默认渲染器有可能会随着版本更新而更换\n\t */\n\trenderer: {\n\t\ttype: Object as PropType<{\n\t\t\tnew (...args: ConstructorParameters<typeof BaseRenderer>): BaseRenderer;\n\t\t}>,\n\t\trequired: false,\n\t},\n} as const;\n\nexport type BackgroundRenderProps = ExtractPublicPropTypes<\n\ttypeof backgroundRenderProps\n>;\n\nexport const BackgroundRender = defineComponent({\n\tname: \"BackgroundRender\",\n\tprops: backgroundRenderProps,\n\tsetup(props, { expose }) {\n\t\tconst wrapperRef = useTemplateRef<HTMLDivElement>(\"wrapper-ref\");\n\t\tconst bgRenderRef = ref<AbstractBaseRenderer>();\n\n\t\tonMounted(() => {\n\t\t\tif (wrapperRef.value) {\n\t\t\t\tbgRenderRef.value = CoreBackgroundRender.new(\n\t\t\t\t\tprops.renderer ?? MeshGradientRenderer,\n\t\t\t\t);\n\t\t\t\tconst el = bgRenderRef.value.getElement();\n\t\t\t\tel.style.width = \"100%\";\n\t\t\t\tel.style.height = \"100%\";\n\t\t\t\twrapperRef.value.appendChild(el);\n\t\t\t}\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tif (bgRenderRef.value) {\n\t\t\t\tbgRenderRef.value.dispose();\n\t\t\t}\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.album)\n\t\t\t\tbgRenderRef.value?.setAlbum(props.album, props.albumIsVideo);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.fps) bgRenderRef.value?.setFPS(props.fps);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.playing) bgRenderRef.value?.pause();\n\t\t\telse bgRenderRef.value?.resume();\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.flowSpeed) bgRenderRef.value?.setFlowSpeed(props.flowSpeed);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.renderScale)\n\t\t\t\tbgRenderRef.value?.setRenderScale(props.renderScale);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lowFreqVolume)\n\t\t\t\tbgRenderRef.value?.setLowFreqVolume(props.lowFreqVolume);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.hasLyric !== undefined)\n\t\t\t\tbgRenderRef.value?.setHasLyric(props.hasLyric ?? true);\n\t\t});\n\n\t\texpose<BackgroundRenderRef>({\n\t\t\tbgRender: bgRenderRef,\n\t\t\twrapperEl: wrapperRef,\n\t\t});\n\n\t\treturn () => <div style=\"display: contents;\" ref=\"wrapper-ref\" />;\n\t},\n});\n","import {\n\ttype BaseRenderer,\n\tLyricPlayer as CoreLyricPlayer,\n\ttype LyricLine,\n\ttype LyricLineMouseEvent,\n\ttype LyricPlayerBase,\n\tMaskObsceneWordsMode,\n\ttype OptimizeLyricOptions,\n\ttype spring,\n} from \"@applemusic-like-lyrics/core\";\nimport {\n\tcomputed,\n\tdefineComponent,\n\ttype ExtractPublicPropTypes,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\ttype Ref,\n\tref,\n\ttype ShallowRef,\n\ttype SlotsType,\n\tTeleport,\n\tuseTemplateRef,\n\twatch,\n\twatchEffect,\n} from \"vue\";\n\nconst lyricPlayerProps = {\n\t/**\n\t * 是否禁用歌词播放组件,默认为 `false`,歌词组件启用后将会开始逐帧更新歌词的动画效果,并对传入的其他参数变更做出反馈。\n\t *\n\t * 如果禁用了歌词组件动画,你也可以通过引用取得原始渲染组件实例,手动逐帧调用其 `update` 函数来更新动画效果。\n\t */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/**\n\t * 是否演出部分效果,目前会控制播放间奏点的动画的播放暂停与否,默认为 `true`\n\t */\n\tplaying: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置歌词行的对齐方式,如果为 `undefined` 则默认为 `center`\n\t *\n\t * - 设置成 `top` 的话将会向目标歌词行的顶部对齐\n\t * - 设置成 `bottom` 的话将会向目标歌词行的底部对齐\n\t * - 设置成 `center` 的话将会向目标歌词行的垂直中心对齐\n\t */\n\talignAnchor: {\n\t\ttype: String as PropType<\"top\" | \"bottom\" | \"center\">,\n\t\tdefault: \"center\",\n\t},\n\t/**\n\t * 设置默认的歌词行对齐位置,相对于整个歌词播放组件的大小位置,如果为 `undefined`\n\t * 则默认为 `0.5`\n\t *\n\t * 可以设置一个 `[0.0-1.0]` 之间的任意数字,代表组件高度由上到下的比例位置\n\t */\n\talignPosition: {\n\t\ttype: Number,\n\t\tdefault: 0.5,\n\t},\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tenableSpring: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否启用歌词行的模糊效果,默认为 `true`\n\t */\n\tenableBlur: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tenableScale: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否隐藏已经播放过的歌词行,默认不隐藏\n\t */\n\thidePassedLines: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/**\n\t * 设置歌词中不雅用语的掩码模式,默认为 `MaskObsceneWordsMode.Disabled`,即不掩码\n\t */\n\tmaskObsceneWordsMode: {\n\t\ttype: String as PropType<MaskObsceneWordsMode>,\n\t\tdefault: MaskObsceneWordsMode.Disabled,\n\t},\n\t/**\n\t * 设置歌词优化选项\n\t */\n\toptimizeOptions: {\n\t\ttype: Object as PropType<OptimizeLyricOptions>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误\n\t */\n\tlyricLines: {\n\t\ttype: Object as PropType<LyricLine[]>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放进度,单位为毫秒且**必须是整数**,此时将会更新内部的歌词进度信息\n\t * 内部会根据调用间隔和播放进度自动决定如何滚动和显示歌词,所以这个的调用频率越快越准确越好\n\t */\n\tcurrentTime: {\n\t\ttype: Number,\n\t\tdefault: 0,\n\t},\n\t/**\n\t * 设置文字动画的渐变宽度,单位以歌词行的主文字字体大小的倍数为单位,默认为 0.5,即一个全角字符的一半宽度\n\t *\n\t * 如果要模拟 Apple Music for Android 的效果,可以设置为 1\n\t *\n\t * 如果要模拟 Apple Music for iPad 的效果,可以设置为 0.5\n\t *\n\t * 如果想要近乎禁用渐变效果,可以设置成非常接近 0 的小数(例如 `0.0001` ),但是**不可以为 0**\n\t */\n\twordFadeWidth: {\n\t\ttype: Number,\n\t\tdefault: 0.5,\n\t},\n\t/**\n\t * 设置所有歌词行在横坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlinePosXSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置所有歌词行在纵坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlinePosYSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置所有歌词行在缩放大小上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlineScaleSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置渲染器,如果为 `undefined` 则默认为 `MeshGradientRenderer`\n\t * 默认渲染器有可能会随着版本更新而更换\n\t */\n\tlyricPlayer: {\n\t\ttype: Object as PropType<{\n\t\t\tnew (...args: ConstructorParameters<typeof BaseRenderer>): BaseRenderer;\n\t\t}>,\n\t\trequired: false,\n\t},\n} as const;\n\n/**\n * 歌词播放组件的属性\n */\nexport type LyricPlayerProps = ExtractPublicPropTypes<typeof lyricPlayerProps>;\n\nconst lyricPlayerEmits = {\n\tlineClick: (_: LyricLineMouseEvent) => true,\n\tlineContextmenu: (_: LyricLineMouseEvent) => true,\n} as const;\n\n/**\n * 歌词播放组件的事件\n */\nexport type LyricPlayerEmits = typeof lyricPlayerEmits;\n\n/**\n * 歌词播放组件的引用\n */\nexport interface LyricPlayerRef {\n\t/**\n\t * 歌词播放实例\n\t */\n\tlyricPlayer: Ref<LyricPlayerBase | undefined>;\n\t/**\n\t * 将歌词播放实例的元素包裹起来的 DIV 元素实例\n\t */\n\twrapperEl: Readonly<ShallowRef<HTMLDivElement | null>>;\n}\n\nexport const LyricPlayer = defineComponent({\n\tname: \"LyricPlayer\",\n\tprops: lyricPlayerProps,\n\temits: lyricPlayerEmits,\n\tslots: Object as SlotsType<{\n\t\t\"bottom-line\": () => void;\n\t}>,\n\tsetup(props, { expose, emit, attrs, slots }) {\n\t\tconst wrapperRef = useTemplateRef<HTMLDivElement>(\"wrapper-ref\");\n\t\tconst playerRef = ref<CoreLyricPlayer>();\n\n\t\tconst lineClickHandler = (e: Event) =>\n\t\t\temit(\"lineClick\", e as LyricLineMouseEvent);\n\t\tconst lineContextMenuHandler = (e: Event) =>\n\t\t\temit(\"lineContextmenu\", e as LyricLineMouseEvent);\n\n\t\tonMounted(() => {\n\t\t\tconst wrapper = wrapperRef.value;\n\t\t\tif (wrapper) {\n\t\t\t\tplayerRef.value = new CoreLyricPlayer();\n\t\t\t\twrapper.appendChild(playerRef.value.getElement());\n\t\t\t\tplayerRef.value.addEventListener(\"line-click\", lineClickHandler);\n\t\t\t\tplayerRef.value.addEventListener(\n\t\t\t\t\t\"line-contextmenu\",\n\t\t\t\t\tlineContextMenuHandler,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tif (playerRef.value) {\n\t\t\t\tplayerRef.value.removeEventListener(\"line-click\", lineClickHandler);\n\t\t\t\tplayerRef.value.removeEventListener(\n\t\t\t\t\t\"line-contextmenu\",\n\t\t\t\t\tlineContextMenuHandler,\n\t\t\t\t);\n\t\t\t\tplayerRef.value.dispose();\n\t\t\t}\n\t\t});\n\n\t\twatchEffect((onCleanup) => {\n\t\t\tif (!props.disabled) {\n\t\t\t\tlet canceled = false;\n\t\t\t\tlet lastTime = -1;\n\t\t\t\tconst onFrame = (time: number) => {\n\t\t\t\t\tif (canceled) return;\n\t\t\t\t\tif (lastTime === -1) {\n\t\t\t\t\t\tlastTime = time;\n\t\t\t\t\t}\n\t\t\t\t\tplayerRef.value?.update(time - lastTime);\n\t\t\t\t\tlastTime = time;\n\t\t\t\t\trequestAnimationFrame(onFrame);\n\t\t\t\t};\n\t\t\t\trequestAnimationFrame(onFrame);\n\t\t\t\tonCleanup(() => {\n\t\t\t\t\tcanceled = true;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.playing !== undefined) {\n\t\t\t\tif (props.playing) {\n\t\t\t\t\tplayerRef.value?.resume();\n\t\t\t\t} else {\n\t\t\t\t\tplayerRef.value?.pause();\n\t\t\t\t}\n\t\t\t} else playerRef.value?.resume();\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.alignAnchor !== undefined)\n\t\t\t\tplayerRef.value?.setAlignAnchor(props.alignAnchor);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.hidePassedLines !== undefined)\n\t\t\t\tplayerRef.value?.setHidePassedLines(props.hidePassedLines);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.maskObsceneWordsMode !== undefined)\n\t\t\t\tplayerRef.value?.setMaskObsceneWords(props.maskObsceneWordsMode);\n\t\t\telse playerRef.value?.setMaskObsceneWords(MaskObsceneWordsMode.Disabled);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.alignPosition !== undefined)\n\t\t\t\tplayerRef.value?.setAlignPosition(props.alignPosition);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableSpring !== undefined)\n\t\t\t\tplayerRef.value?.setEnableSpring(props.enableSpring);\n\t\t\telse playerRef.value?.setEnableSpring(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableBlur !== undefined)\n\t\t\t\tplayerRef.value?.setEnableBlur(props.enableBlur);\n\t\t\telse playerRef.value?.setEnableBlur(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableScale !== undefined)\n\t\t\t\tplayerRef.value?.setEnableScale(props.enableScale);\n\t\t\telse playerRef.value?.setEnableScale(true);\n\t\t});\n\n\t\twatch(\n\t\t\t[playerRef, () => props.lyricLines, () => props.optimizeOptions],\n\t\t\t([player, lyricLines, optimizeOptions]) => {\n\t\t\t\tif (!player) return;\n\n\t\t\t\tif (optimizeOptions !== undefined) {\n\t\t\t\t\tplayer.setOptimizeOptions(optimizeOptions);\n\t\t\t\t}\n\n\t\t\t\tif (lyricLines !== undefined) {\n\t\t\t\t\tplayer.setLyricLines(lyricLines);\n\t\t\t\t} else {\n\t\t\t\t\tplayer.setLyricLines([]);\n\t\t\t\t}\n\n\t\t\t\tif (props.currentTime !== undefined) {\n\t\t\t\t\tplayer.setCurrentTime(props.currentTime, true);\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ immediate: true },\n\t\t);\n\n\t\twatchEffect(() => {\n\t\t\tif (props.currentTime !== undefined)\n\t\t\t\tplayerRef.value?.setCurrentTime(props.currentTime);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.wordFadeWidth !== undefined)\n\t\t\t\tplayerRef.value?.setWordFadeWidth(props.wordFadeWidth);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.linePosXSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLinePosXSpringParams(props.linePosXSpringParams);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.linePosYSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLinePosYSpringParams(props.linePosYSpringParams);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lineScaleSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLineScaleSpringParams(props.lineScaleSpringParams);\n\t\t});\n\n\t\tconst bottomLineEl = computed(() =>\n\t\t\tplayerRef.value?.getBottomLineElement(),\n\t\t);\n\n\t\texpose<LyricPlayerRef>({\n\t\t\tlyricPlayer: playerRef,\n\t\t\twrapperEl: wrapperRef,\n\t\t});\n\n\t\treturn () => (\n\t\t\t<div ref=\"wrapper-ref\" {...attrs}>\n\t\t\t\t{bottomLineEl.value && (\n\t\t\t\t\t<Teleport to={bottomLineEl.value}>\n\t\t\t\t\t\t{slots[\"bottom-line\"]?.()}\n\t\t\t\t\t</Teleport>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n});\n"],"mappings":";;;;AAiCA,MAAMoB,wBAAwB;CAI7BC,OAAO;EACNC,MAAM,CAACC,QAAQC,OAAO;EAGtBG,UAAU;EACV;CAIDC,cAAc;EACbN,MAAMO;EACNF,UAAU;EACV;CAIDG,KAAK;EACJR,MAAMS;EACNJ,UAAU;EACV;CAIDK,SAAS;EACRV,MAAMO;EACNF,UAAU;EACV;CAIDM,WAAW;EACVX,MAAMS;EACNJ,UAAU;EACV;CAQDO,UAAU;EACTZ,MAAMO;EACNF,UAAU;EACV;CAQDQ,eAAe;EACdb,MAAMS;EACNJ,UAAU;EACV;CAIDS,aAAa;EACZd,MAAMS;EACNJ,UAAU;EACV;CAKDU,UAAU;EACTf,MAAME;EAGNG,UAAU;EACX;CACA;AAMD,MAAazB,oBAAAA,GAAAA,IAAAA,iBAAmC;CAC/CwC,MAAM;CACNC,OAAOvB;CACPwB,MAAMD,OAAO,EAAEE,UAAU;EACxB,MAAMC,cAAAA,GAAAA,IAAAA,gBAA4C,cAAc;EAChE,MAAMC,eAAAA,GAAAA,IAAAA,MAAyC;AAE/CxC,GAAAA,GAAAA,IAAAA,iBAAgB;AACf,OAAIuC,WAAWE,OAAO;AACrBD,gBAAYC,QAAQ7C,6BAAAA,iBAAqB8C,IACxCN,MAAMN,YAAYjC,6BAAAA,qBAClB;IACD,MAAM8C,KAAKH,YAAYC,M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Ref, ShallowRef, SlotsType } from "vue";
|
|
3
3
|
import * as _$vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
4
|
-
import { AbstractBaseRenderer, BaseRenderer, LyricLine, LyricLineMouseEvent, LyricPlayerBase, MaskObsceneWordsMode, spring } from "@applemusic-like-lyrics/core";
|
|
4
|
+
import { AbstractBaseRenderer, BaseRenderer, LyricLine, LyricLineMouseEvent, LyricPlayerBase, MaskObsceneWordsMode, OptimizeLyricOptions, spring } from "@applemusic-like-lyrics/core";
|
|
5
5
|
|
|
6
6
|
//#region src/BackgroundRender.d.ts
|
|
7
7
|
/**
|
|
@@ -332,6 +332,13 @@ declare const lyricPlayerProps: {
|
|
|
332
332
|
readonly type: PropType<MaskObsceneWordsMode>;
|
|
333
333
|
readonly default: MaskObsceneWordsMode.Disabled;
|
|
334
334
|
};
|
|
335
|
+
/**
|
|
336
|
+
* 设置歌词优化选项
|
|
337
|
+
*/
|
|
338
|
+
readonly optimizeOptions: {
|
|
339
|
+
readonly type: PropType<OptimizeLyricOptions>;
|
|
340
|
+
readonly required: false;
|
|
341
|
+
};
|
|
335
342
|
/**
|
|
336
343
|
* 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误
|
|
337
344
|
*/
|
|
@@ -504,6 +511,13 @@ declare const LyricPlayer: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
504
511
|
readonly type: PropType<MaskObsceneWordsMode>;
|
|
505
512
|
readonly default: MaskObsceneWordsMode.Disabled;
|
|
506
513
|
};
|
|
514
|
+
/**
|
|
515
|
+
* 设置歌词优化选项
|
|
516
|
+
*/
|
|
517
|
+
readonly optimizeOptions: {
|
|
518
|
+
readonly type: PropType<OptimizeLyricOptions>;
|
|
519
|
+
readonly required: false;
|
|
520
|
+
};
|
|
507
521
|
/**
|
|
508
522
|
* 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误
|
|
509
523
|
*/
|
|
@@ -653,6 +667,13 @@ declare const LyricPlayer: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
653
667
|
readonly type: PropType<MaskObsceneWordsMode>;
|
|
654
668
|
readonly default: MaskObsceneWordsMode.Disabled;
|
|
655
669
|
};
|
|
670
|
+
/**
|
|
671
|
+
* 设置歌词优化选项
|
|
672
|
+
*/
|
|
673
|
+
readonly optimizeOptions: {
|
|
674
|
+
readonly type: PropType<OptimizeLyricOptions>;
|
|
675
|
+
readonly required: false;
|
|
676
|
+
};
|
|
656
677
|
/**
|
|
657
678
|
* 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误
|
|
658
679
|
*/
|
package/dist/amll-vue.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _$vue from "vue";
|
|
2
2
|
import { ExtractPublicPropTypes, PropType, Ref, ShallowRef, SlotsType } from "vue";
|
|
3
|
-
import { AbstractBaseRenderer, BaseRenderer, LyricLine, LyricLineMouseEvent, LyricPlayerBase, MaskObsceneWordsMode, spring } from "@applemusic-like-lyrics/core";
|
|
3
|
+
import { AbstractBaseRenderer, BaseRenderer, LyricLine, LyricLineMouseEvent, LyricPlayerBase, MaskObsceneWordsMode, OptimizeLyricOptions, spring } from "@applemusic-like-lyrics/core";
|
|
4
4
|
import * as _$vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/BackgroundRender.d.ts
|
|
@@ -332,6 +332,13 @@ declare const lyricPlayerProps: {
|
|
|
332
332
|
readonly type: PropType<MaskObsceneWordsMode>;
|
|
333
333
|
readonly default: MaskObsceneWordsMode.Disabled;
|
|
334
334
|
};
|
|
335
|
+
/**
|
|
336
|
+
* 设置歌词优化选项
|
|
337
|
+
*/
|
|
338
|
+
readonly optimizeOptions: {
|
|
339
|
+
readonly type: PropType<OptimizeLyricOptions>;
|
|
340
|
+
readonly required: false;
|
|
341
|
+
};
|
|
335
342
|
/**
|
|
336
343
|
* 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误
|
|
337
344
|
*/
|
|
@@ -504,6 +511,13 @@ declare const LyricPlayer: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
504
511
|
readonly type: PropType<MaskObsceneWordsMode>;
|
|
505
512
|
readonly default: MaskObsceneWordsMode.Disabled;
|
|
506
513
|
};
|
|
514
|
+
/**
|
|
515
|
+
* 设置歌词优化选项
|
|
516
|
+
*/
|
|
517
|
+
readonly optimizeOptions: {
|
|
518
|
+
readonly type: PropType<OptimizeLyricOptions>;
|
|
519
|
+
readonly required: false;
|
|
520
|
+
};
|
|
507
521
|
/**
|
|
508
522
|
* 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误
|
|
509
523
|
*/
|
|
@@ -653,6 +667,13 @@ declare const LyricPlayer: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
653
667
|
readonly type: PropType<MaskObsceneWordsMode>;
|
|
654
668
|
readonly default: MaskObsceneWordsMode.Disabled;
|
|
655
669
|
};
|
|
670
|
+
/**
|
|
671
|
+
* 设置歌词优化选项
|
|
672
|
+
*/
|
|
673
|
+
readonly optimizeOptions: {
|
|
674
|
+
readonly type: PropType<OptimizeLyricOptions>;
|
|
675
|
+
readonly required: false;
|
|
676
|
+
};
|
|
656
677
|
/**
|
|
657
678
|
* 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误
|
|
658
679
|
*/
|
package/dist/amll-vue.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Teleport, computed, createVNode, defineComponent, mergeProps, onMounted, onUnmounted, ref, useTemplateRef, watchEffect } from "vue";
|
|
1
|
+
import { Teleport, computed, createVNode, defineComponent, mergeProps, onMounted, onUnmounted, ref, useTemplateRef, watch, watchEffect } from "vue";
|
|
2
2
|
import { BackgroundRender as BackgroundRender$1, LyricPlayer as LyricPlayer$1, MaskObsceneWordsMode, MeshGradientRenderer } from "@applemusic-like-lyrics/core";
|
|
3
3
|
const BackgroundRender = defineComponent({
|
|
4
4
|
name: "BackgroundRender",
|
|
@@ -123,9 +123,13 @@ const LyricPlayer = defineComponent({
|
|
|
123
123
|
default: false
|
|
124
124
|
},
|
|
125
125
|
maskObsceneWordsMode: {
|
|
126
|
-
type:
|
|
126
|
+
type: String,
|
|
127
127
|
default: MaskObsceneWordsMode.Disabled
|
|
128
128
|
},
|
|
129
|
+
optimizeOptions: {
|
|
130
|
+
type: Object,
|
|
131
|
+
required: false
|
|
132
|
+
},
|
|
129
133
|
lyricLines: {
|
|
130
134
|
type: Object,
|
|
131
135
|
required: false
|
|
@@ -228,9 +232,17 @@ const LyricPlayer = defineComponent({
|
|
|
228
232
|
if (props.enableScale !== void 0) playerRef.value?.setEnableScale(props.enableScale);
|
|
229
233
|
else playerRef.value?.setEnableScale(true);
|
|
230
234
|
});
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
235
|
+
watch([
|
|
236
|
+
playerRef,
|
|
237
|
+
() => props.lyricLines,
|
|
238
|
+
() => props.optimizeOptions
|
|
239
|
+
], ([player, lyricLines, optimizeOptions]) => {
|
|
240
|
+
if (!player) return;
|
|
241
|
+
if (optimizeOptions !== void 0) player.setOptimizeOptions(optimizeOptions);
|
|
242
|
+
if (lyricLines !== void 0) player.setLyricLines(lyricLines);
|
|
243
|
+
else player.setLyricLines([]);
|
|
244
|
+
if (props.currentTime !== void 0) player.setCurrentTime(props.currentTime, true);
|
|
245
|
+
}, { immediate: true });
|
|
234
246
|
watchEffect(() => {
|
|
235
247
|
if (props.currentTime !== void 0) playerRef.value?.setCurrentTime(props.currentTime);
|
|
236
248
|
});
|
package/dist/amll-vue.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amll-vue.mjs","names":["AbstractBaseRenderer","BaseRenderer","BackgroundRender","CoreBackgroundRender","MeshGradientRenderer","defineComponent","ExtractPublicPropTypes","onMounted","onUnmounted","PropType","Ref","ref","ShallowRef","useTemplateRef","watchEffect","BackgroundRenderRef","bgRender","wrapperEl","Readonly","HTMLDivElement","backgroundRenderProps","album","type","String","Object","HTMLImageElement","HTMLVideoElement","required","albumIsVideo","Boolean","fps","Number","playing","flowSpeed","hasLyric","lowFreqVolume","renderScale","renderer","args","ConstructorParameters","const","BackgroundRenderProps","name","props","setup","expose","wrapperRef","bgRenderRef","value","new","el","getElement","style","width","height","appendChild","dispose","setAlbum","setFPS","pause","resume","setFlowSpeed","setRenderScale","setLowFreqVolume","undefined","setHasLyric","_createVNode","BaseRenderer","LyricPlayer","CoreLyricPlayer","LyricLine","LyricLineMouseEvent","LyricPlayerBase","MaskObsceneWordsMode","spring","computed","defineComponent","ExtractPublicPropTypes","onMounted","onUnmounted","PropType","Ref","ref","ShallowRef","SlotsType","Teleport","useTemplateRef","watchEffect","lyricPlayerProps","disabled","type","Boolean","default","playing","alignAnchor","String","alignPosition","Number","enableSpring","enableBlur","enableScale","hidePassedLines","maskObsceneWordsMode","Object","Disabled","lyricLines","required","currentTime","wordFadeWidth","linePosXSpringParams","Partial","SpringParams","linePosYSpringParams","lineScaleSpringParams","lyricPlayer","args","ConstructorParameters","const","LyricPlayerProps","lyricPlayerEmits","lineClick","_","lineContextmenu","LyricPlayerEmits","LyricPlayerRef","wrapperEl","Readonly","HTMLDivElement","name","props","emits","slots","setup","expose","emit","attrs","wrapperRef","playerRef","lineClickHandler","e","Event","lineContextMenuHandler","wrapper","value","appendChild","getElement","addEventListener","removeEventListener","dispose","onCleanup","canceled","lastTime","onFrame","time","update","requestAnimationFrame","undefined","resume","pause","setAlignAnchor","setHidePassedLines","setMaskObsceneWords","setAlignPosition","setEnableSpring","setEnableBlur","setEnableScale","setLyricLines","setCurrentTime","setWordFadeWidth","setLinePosXSpringParams","setLinePosYSpringParams","setLineScaleSpringParams","bottomLineEl","getBottomLineElement","_createVNode","_mergeProps"],"sources":["../src/BackgroundRender.tsx","../src/LyricPlayer.tsx"],"sourcesContent":["import {\n\ttype AbstractBaseRenderer,\n\ttype BaseRenderer,\n\tBackgroundRender as CoreBackgroundRender,\n\tMeshGradientRenderer,\n} from \"@applemusic-like-lyrics/core\";\nimport {\n\tdefineComponent,\n\ttype ExtractPublicPropTypes,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\ttype Ref,\n\tref,\n\ttype ShallowRef,\n\tuseTemplateRef,\n\twatchEffect,\n} from \"vue\";\n\n/**\n * 背景渲染组件的引用\n */\nexport interface BackgroundRenderRef {\n\t/**\n\t * 背景渲染实例引用\n\t */\n\tbgRender?: Ref<AbstractBaseRenderer | undefined>;\n\t/**\n\t * 将背景渲染实例的元素包裹起来的 DIV 元素实例\n\t */\n\twrapperEl: Readonly<ShallowRef<HTMLDivElement | null>>;\n}\n\nconst backgroundRenderProps = {\n\t/**\n\t * 设置背景专辑资源\n\t */\n\talbum: {\n\t\ttype: [String, Object] as PropType<\n\t\t\tstring | HTMLImageElement | HTMLVideoElement\n\t\t>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置专辑资源是否为视频\n\t */\n\talbumIsVideo: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前背景动画帧率,如果为 `undefined` 则默认为 `30`\n\t */\n\tfps: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放状态,如果为 `undefined` 则默认为 `true`\n\t */\n\tplaying: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前动画流动速度,如果为 `undefined` 则默认为 `2`\n\t */\n\tflowSpeed: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置背景是否根据“是否有歌词”这个特征调整自身效果,例如有歌词时会变得更加活跃\n\t *\n\t * 部分渲染器会根据这个特征调整自身效果\n\t *\n\t * 如果不确定是否需要赋值或无法知晓是否包含歌词,请传入 true 或不做任何处理(默认值为 true)\n\t */\n\thasLyric: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置低频的音量大小,范围在 80hz-120hz 之间为宜,取值范围在 [0.0-1.0] 之间\n\t *\n\t * 部分渲染器会根据音量大小调整背景效果(例如根据鼓点跳动)\n\t *\n\t * 如果无法获取到类似的数据,请传入 undefined 或 1.0 作为默认值,或不做任何处理(默认值即 1.0)\n\t */\n\tlowFreqVolume: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前渲染缩放比例,如果为 `undefined` 则默认为 `0.5`\n\t */\n\trenderScale: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置渲染器,如果为 `undefined` 则默认为 `MeshGradientRenderer`\n\t * 默认渲染器有可能会随着版本更新而更换\n\t */\n\trenderer: {\n\t\ttype: Object as PropType<{\n\t\t\tnew (...args: ConstructorParameters<typeof BaseRenderer>): BaseRenderer;\n\t\t}>,\n\t\trequired: false,\n\t},\n} as const;\n\nexport type BackgroundRenderProps = ExtractPublicPropTypes<\n\ttypeof backgroundRenderProps\n>;\n\nexport const BackgroundRender = defineComponent({\n\tname: \"BackgroundRender\",\n\tprops: backgroundRenderProps,\n\tsetup(props, { expose }) {\n\t\tconst wrapperRef = useTemplateRef<HTMLDivElement>(\"wrapper-ref\");\n\t\tconst bgRenderRef = ref<AbstractBaseRenderer>();\n\n\t\tonMounted(() => {\n\t\t\tif (wrapperRef.value) {\n\t\t\t\tbgRenderRef.value = CoreBackgroundRender.new(\n\t\t\t\t\tprops.renderer ?? MeshGradientRenderer,\n\t\t\t\t);\n\t\t\t\tconst el = bgRenderRef.value.getElement();\n\t\t\t\tel.style.width = \"100%\";\n\t\t\t\tel.style.height = \"100%\";\n\t\t\t\twrapperRef.value.appendChild(el);\n\t\t\t}\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tif (bgRenderRef.value) {\n\t\t\t\tbgRenderRef.value.dispose();\n\t\t\t}\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.album)\n\t\t\t\tbgRenderRef.value?.setAlbum(props.album, props.albumIsVideo);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.fps) bgRenderRef.value?.setFPS(props.fps);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.playing) bgRenderRef.value?.pause();\n\t\t\telse bgRenderRef.value?.resume();\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.flowSpeed) bgRenderRef.value?.setFlowSpeed(props.flowSpeed);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.renderScale)\n\t\t\t\tbgRenderRef.value?.setRenderScale(props.renderScale);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lowFreqVolume)\n\t\t\t\tbgRenderRef.value?.setLowFreqVolume(props.lowFreqVolume);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.hasLyric !== undefined)\n\t\t\t\tbgRenderRef.value?.setHasLyric(props.hasLyric ?? true);\n\t\t});\n\n\t\texpose<BackgroundRenderRef>({\n\t\t\tbgRender: bgRenderRef,\n\t\t\twrapperEl: wrapperRef,\n\t\t});\n\n\t\treturn () => <div style=\"display: contents;\" ref=\"wrapper-ref\" />;\n\t},\n});\n","import {\n\ttype BaseRenderer,\n\tLyricPlayer as CoreLyricPlayer,\n\ttype LyricLine,\n\ttype LyricLineMouseEvent,\n\ttype LyricPlayerBase,\n\tMaskObsceneWordsMode,\n\ttype spring,\n} from \"@applemusic-like-lyrics/core\";\nimport {\n\tcomputed,\n\tdefineComponent,\n\ttype ExtractPublicPropTypes,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\ttype Ref,\n\tref,\n\ttype ShallowRef,\n\ttype SlotsType,\n\tTeleport,\n\tuseTemplateRef,\n\twatchEffect,\n} from \"vue\";\n\nconst lyricPlayerProps = {\n\t/**\n\t * 是否禁用歌词播放组件,默认为 `false`,歌词组件启用后将会开始逐帧更新歌词的动画效果,并对传入的其他参数变更做出反馈。\n\t *\n\t * 如果禁用了歌词组件动画,你也可以通过引用取得原始渲染组件实例,手动逐帧调用其 `update` 函数来更新动画效果。\n\t */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/**\n\t * 是否演出部分效果,目前会控制播放间奏点的动画的播放暂停与否,默认为 `true`\n\t */\n\tplaying: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置歌词行的对齐方式,如果为 `undefined` 则默认为 `center`\n\t *\n\t * - 设置成 `top` 的话将会向目标歌词行的顶部对齐\n\t * - 设置成 `bottom` 的话将会向目标歌词行的底部对齐\n\t * - 设置成 `center` 的话将会向目标歌词行的垂直中心对齐\n\t */\n\talignAnchor: {\n\t\ttype: String as PropType<\"top\" | \"bottom\" | \"center\">,\n\t\tdefault: \"center\",\n\t},\n\t/**\n\t * 设置默认的歌词行对齐位置,相对于整个歌词播放组件的大小位置,如果为 `undefined`\n\t * 则默认为 `0.5`\n\t *\n\t * 可以设置一个 `[0.0-1.0]` 之间的任意数字,代表组件高度由上到下的比例位置\n\t */\n\talignPosition: {\n\t\ttype: Number,\n\t\tdefault: 0.5,\n\t},\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tenableSpring: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否启用歌词行的模糊效果,默认为 `true`\n\t */\n\tenableBlur: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tenableScale: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否隐藏已经播放过的歌词行,默认不隐藏\n\t */\n\thidePassedLines: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/**\n\t * 设置歌词中不雅用语的掩码模式,默认为 `MaskObsceneWordsMode.Disabled`,即不掩码\n\t */\n\tmaskObsceneWordsMode: {\n\t\ttype: Object as PropType<MaskObsceneWordsMode>,\n\t\tdefault: MaskObsceneWordsMode.Disabled,\n\t},\n\t/**\n\t * 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误\n\t */\n\tlyricLines: {\n\t\ttype: Object as PropType<LyricLine[]>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放进度,单位为毫秒且**必须是整数**,此时将会更新内部的歌词进度信息\n\t * 内部会根据调用间隔和播放进度自动决定如何滚动和显示歌词,所以这个的调用频率越快越准确越好\n\t */\n\tcurrentTime: {\n\t\ttype: Number,\n\t\tdefault: 0,\n\t},\n\t/**\n\t * 设置文字动画的渐变宽度,单位以歌词行的主文字字体大小的倍数为单位,默认为 0.5,即一个全角字符的一半宽度\n\t *\n\t * 如果要模拟 Apple Music for Android 的效果,可以设置为 1\n\t *\n\t * 如果要模拟 Apple Music for iPad 的效果,可以设置为 0.5\n\t *\n\t * 如果想要近乎禁用渐变效果,可以设置成非常接近 0 的小数(例如 `0.0001` ),但是**不可以为 0**\n\t */\n\twordFadeWidth: {\n\t\ttype: Number,\n\t\tdefault: 0.5,\n\t},\n\t/**\n\t * 设置所有歌词行在横坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlinePosXSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置所有歌词行在纵坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlinePosYSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置所有歌词行在缩放大小上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlineScaleSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置渲染器,如果为 `undefined` 则默认为 `MeshGradientRenderer`\n\t * 默认渲染器有可能会随着版本更新而更换\n\t */\n\tlyricPlayer: {\n\t\ttype: Object as PropType<{\n\t\t\tnew (...args: ConstructorParameters<typeof BaseRenderer>): BaseRenderer;\n\t\t}>,\n\t\trequired: false,\n\t},\n} as const;\n\n/**\n * 歌词播放组件的属性\n */\nexport type LyricPlayerProps = ExtractPublicPropTypes<typeof lyricPlayerProps>;\n\nconst lyricPlayerEmits = {\n\tlineClick: (_: LyricLineMouseEvent) => true,\n\tlineContextmenu: (_: LyricLineMouseEvent) => true,\n} as const;\n\n/**\n * 歌词播放组件的事件\n */\nexport type LyricPlayerEmits = typeof lyricPlayerEmits;\n\n/**\n * 歌词播放组件的引用\n */\nexport interface LyricPlayerRef {\n\t/**\n\t * 歌词播放实例\n\t */\n\tlyricPlayer: Ref<LyricPlayerBase | undefined>;\n\t/**\n\t * 将歌词播放实例的元素包裹起来的 DIV 元素实例\n\t */\n\twrapperEl: Readonly<ShallowRef<HTMLDivElement | null>>;\n}\n\nexport const LyricPlayer = defineComponent({\n\tname: \"LyricPlayer\",\n\tprops: lyricPlayerProps,\n\temits: lyricPlayerEmits,\n\tslots: Object as SlotsType<{\n\t\t\"bottom-line\": () => void;\n\t}>,\n\tsetup(props, { expose, emit, attrs, slots }) {\n\t\tconst wrapperRef = useTemplateRef<HTMLDivElement>(\"wrapper-ref\");\n\t\tconst playerRef = ref<CoreLyricPlayer>();\n\n\t\tconst lineClickHandler = (e: Event) =>\n\t\t\temit(\"lineClick\", e as LyricLineMouseEvent);\n\t\tconst lineContextMenuHandler = (e: Event) =>\n\t\t\temit(\"lineContextmenu\", e as LyricLineMouseEvent);\n\n\t\tonMounted(() => {\n\t\t\tconst wrapper = wrapperRef.value;\n\t\t\tif (wrapper) {\n\t\t\t\tplayerRef.value = new CoreLyricPlayer();\n\t\t\t\twrapper.appendChild(playerRef.value.getElement());\n\t\t\t\tplayerRef.value.addEventListener(\"line-click\", lineClickHandler);\n\t\t\t\tplayerRef.value.addEventListener(\n\t\t\t\t\t\"line-contextmenu\",\n\t\t\t\t\tlineContextMenuHandler,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tif (playerRef.value) {\n\t\t\t\tplayerRef.value.removeEventListener(\"line-click\", lineClickHandler);\n\t\t\t\tplayerRef.value.removeEventListener(\n\t\t\t\t\t\"line-contextmenu\",\n\t\t\t\t\tlineContextMenuHandler,\n\t\t\t\t);\n\t\t\t\tplayerRef.value.dispose();\n\t\t\t}\n\t\t});\n\n\t\twatchEffect((onCleanup) => {\n\t\t\tif (!props.disabled) {\n\t\t\t\tlet canceled = false;\n\t\t\t\tlet lastTime = -1;\n\t\t\t\tconst onFrame = (time: number) => {\n\t\t\t\t\tif (canceled) return;\n\t\t\t\t\tif (lastTime === -1) {\n\t\t\t\t\t\tlastTime = time;\n\t\t\t\t\t}\n\t\t\t\t\tplayerRef.value?.update(time - lastTime);\n\t\t\t\t\tlastTime = time;\n\t\t\t\t\trequestAnimationFrame(onFrame);\n\t\t\t\t};\n\t\t\t\trequestAnimationFrame(onFrame);\n\t\t\t\tonCleanup(() => {\n\t\t\t\t\tcanceled = true;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.playing !== undefined) {\n\t\t\t\tif (props.playing) {\n\t\t\t\t\tplayerRef.value?.resume();\n\t\t\t\t} else {\n\t\t\t\t\tplayerRef.value?.pause();\n\t\t\t\t}\n\t\t\t} else playerRef.value?.resume();\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.alignAnchor !== undefined)\n\t\t\t\tplayerRef.value?.setAlignAnchor(props.alignAnchor);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.hidePassedLines !== undefined)\n\t\t\t\tplayerRef.value?.setHidePassedLines(props.hidePassedLines);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.maskObsceneWordsMode !== undefined)\n\t\t\t\tplayerRef.value?.setMaskObsceneWords(props.maskObsceneWordsMode);\n\t\t\telse playerRef.value?.setMaskObsceneWords(MaskObsceneWordsMode.Disabled);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.alignPosition !== undefined)\n\t\t\t\tplayerRef.value?.setAlignPosition(props.alignPosition);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableSpring !== undefined)\n\t\t\t\tplayerRef.value?.setEnableSpring(props.enableSpring);\n\t\t\telse playerRef.value?.setEnableSpring(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableBlur !== undefined)\n\t\t\t\tplayerRef.value?.setEnableBlur(props.enableBlur);\n\t\t\telse playerRef.value?.setEnableBlur(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableScale !== undefined)\n\t\t\t\tplayerRef.value?.setEnableScale(props.enableScale);\n\t\t\telse playerRef.value?.setEnableScale(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lyricLines !== undefined)\n\t\t\t\tplayerRef.value?.setLyricLines(props.lyricLines);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.currentTime !== undefined)\n\t\t\t\tplayerRef.value?.setCurrentTime(props.currentTime);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.wordFadeWidth !== undefined)\n\t\t\t\tplayerRef.value?.setWordFadeWidth(props.wordFadeWidth);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.linePosXSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLinePosXSpringParams(props.linePosXSpringParams);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.linePosYSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLinePosYSpringParams(props.linePosYSpringParams);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lineScaleSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLineScaleSpringParams(props.lineScaleSpringParams);\n\t\t});\n\n\t\tconst bottomLineEl = computed(() =>\n\t\t\tplayerRef.value?.getBottomLineElement(),\n\t\t);\n\n\t\texpose<LyricPlayerRef>({\n\t\t\tlyricPlayer: playerRef,\n\t\t\twrapperEl: wrapperRef,\n\t\t});\n\n\t\treturn () => (\n\t\t\t<div ref=\"wrapper-ref\" {...attrs}>\n\t\t\t\t{bottomLineEl.value && (\n\t\t\t\t\t<Teleport to={bottomLineEl.value}>\n\t\t\t\t\t\t{slots[\"bottom-line\"]?.()}\n\t\t\t\t\t</Teleport>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n});\n"],"mappings":";;AAoHA,MAAaE,mBAAmBG,gBAAgB;CAC/CqC,MAAM;CACNC,OArF6B;EAI7BtB,OAAO;GACNC,MAAM,CAACC,QAAQC,OAAO;GAGtBG,UAAU;GACV;EAIDC,cAAc;GACbN,MAAMO;GACNF,UAAU;GACV;EAIDG,KAAK;GACJR,MAAMS;GACNJ,UAAU;GACV;EAIDK,SAAS;GACRV,MAAMO;GACNF,UAAU;GACV;EAIDM,WAAW;GACVX,MAAMS;GACNJ,UAAU;GACV;EAQDO,UAAU;GACTZ,MAAMO;GACNF,UAAU;GACV;EAQDQ,eAAe;GACdb,MAAMS;GACNJ,UAAU;GACV;EAIDS,aAAa;GACZd,MAAMS;GACNJ,UAAU;GACV;EAKDU,UAAU;GACTf,MAAME;GAGNG,UAAU;GACX;EACA;CASAiB,MAAMD,OAAO,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C;AAEDxC,SAAuB;GACtBnB,aAAauB;GACbZ,WAAWW;GACX,CAAC;AAEF,eAAOsC,YAAA,OAAAC,WAAA,EAAA,OAAA,eAAA,EACqBxC,MAAK,EAAA,CAC9BqC,aAAa7B,SAAK+B,YAAAzF,UAAA,EAAA,MACJuF,aAAa7B,OAAK,EAAA,EAAAnD,eAAA,CAC9BuC,MAAM,kBAAkB,CAAA,EAAA,CAE1B,CAAA,CAEF;;CAEF,CAAC"}
|
|
1
|
+
{"version":3,"file":"amll-vue.mjs","names":["AbstractBaseRenderer","BaseRenderer","BackgroundRender","CoreBackgroundRender","MeshGradientRenderer","defineComponent","ExtractPublicPropTypes","onMounted","onUnmounted","PropType","Ref","ref","ShallowRef","useTemplateRef","watchEffect","BackgroundRenderRef","bgRender","wrapperEl","Readonly","HTMLDivElement","backgroundRenderProps","album","type","String","Object","HTMLImageElement","HTMLVideoElement","required","albumIsVideo","Boolean","fps","Number","playing","flowSpeed","hasLyric","lowFreqVolume","renderScale","renderer","args","ConstructorParameters","const","BackgroundRenderProps","name","props","setup","expose","wrapperRef","bgRenderRef","value","new","el","getElement","style","width","height","appendChild","dispose","setAlbum","setFPS","pause","resume","setFlowSpeed","setRenderScale","setLowFreqVolume","undefined","setHasLyric","_createVNode","BaseRenderer","LyricPlayer","CoreLyricPlayer","LyricLine","LyricLineMouseEvent","LyricPlayerBase","MaskObsceneWordsMode","OptimizeLyricOptions","spring","computed","defineComponent","ExtractPublicPropTypes","onMounted","onUnmounted","PropType","Ref","ref","ShallowRef","SlotsType","Teleport","useTemplateRef","watch","watchEffect","lyricPlayerProps","disabled","type","Boolean","default","playing","alignAnchor","String","alignPosition","Number","enableSpring","enableBlur","enableScale","hidePassedLines","maskObsceneWordsMode","Disabled","optimizeOptions","Object","required","lyricLines","currentTime","wordFadeWidth","linePosXSpringParams","Partial","SpringParams","linePosYSpringParams","lineScaleSpringParams","lyricPlayer","args","ConstructorParameters","const","LyricPlayerProps","lyricPlayerEmits","lineClick","_","lineContextmenu","LyricPlayerEmits","LyricPlayerRef","wrapperEl","Readonly","HTMLDivElement","name","props","emits","slots","setup","expose","emit","attrs","wrapperRef","playerRef","lineClickHandler","e","Event","lineContextMenuHandler","wrapper","value","appendChild","getElement","addEventListener","removeEventListener","dispose","onCleanup","canceled","lastTime","onFrame","time","update","requestAnimationFrame","undefined","resume","pause","setAlignAnchor","setHidePassedLines","setMaskObsceneWords","setAlignPosition","setEnableSpring","setEnableBlur","setEnableScale","player","setOptimizeOptions","setLyricLines","setCurrentTime","immediate","setWordFadeWidth","setLinePosXSpringParams","setLinePosYSpringParams","setLineScaleSpringParams","bottomLineEl","getBottomLineElement","_createVNode","_mergeProps"],"sources":["../src/BackgroundRender.tsx","../src/LyricPlayer.tsx"],"sourcesContent":["import {\n\ttype AbstractBaseRenderer,\n\ttype BaseRenderer,\n\tBackgroundRender as CoreBackgroundRender,\n\tMeshGradientRenderer,\n} from \"@applemusic-like-lyrics/core\";\nimport {\n\tdefineComponent,\n\ttype ExtractPublicPropTypes,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\ttype Ref,\n\tref,\n\ttype ShallowRef,\n\tuseTemplateRef,\n\twatchEffect,\n} from \"vue\";\n\n/**\n * 背景渲染组件的引用\n */\nexport interface BackgroundRenderRef {\n\t/**\n\t * 背景渲染实例引用\n\t */\n\tbgRender?: Ref<AbstractBaseRenderer | undefined>;\n\t/**\n\t * 将背景渲染实例的元素包裹起来的 DIV 元素实例\n\t */\n\twrapperEl: Readonly<ShallowRef<HTMLDivElement | null>>;\n}\n\nconst backgroundRenderProps = {\n\t/**\n\t * 设置背景专辑资源\n\t */\n\talbum: {\n\t\ttype: [String, Object] as PropType<\n\t\t\tstring | HTMLImageElement | HTMLVideoElement\n\t\t>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置专辑资源是否为视频\n\t */\n\talbumIsVideo: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前背景动画帧率,如果为 `undefined` 则默认为 `30`\n\t */\n\tfps: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放状态,如果为 `undefined` 则默认为 `true`\n\t */\n\tplaying: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前动画流动速度,如果为 `undefined` 则默认为 `2`\n\t */\n\tflowSpeed: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置背景是否根据“是否有歌词”这个特征调整自身效果,例如有歌词时会变得更加活跃\n\t *\n\t * 部分渲染器会根据这个特征调整自身效果\n\t *\n\t * 如果不确定是否需要赋值或无法知晓是否包含歌词,请传入 true 或不做任何处理(默认值为 true)\n\t */\n\thasLyric: {\n\t\ttype: Boolean,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置低频的音量大小,范围在 80hz-120hz 之间为宜,取值范围在 [0.0-1.0] 之间\n\t *\n\t * 部分渲染器会根据音量大小调整背景效果(例如根据鼓点跳动)\n\t *\n\t * 如果无法获取到类似的数据,请传入 undefined 或 1.0 作为默认值,或不做任何处理(默认值即 1.0)\n\t */\n\tlowFreqVolume: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前渲染缩放比例,如果为 `undefined` 则默认为 `0.5`\n\t */\n\trenderScale: {\n\t\ttype: Number,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置渲染器,如果为 `undefined` 则默认为 `MeshGradientRenderer`\n\t * 默认渲染器有可能会随着版本更新而更换\n\t */\n\trenderer: {\n\t\ttype: Object as PropType<{\n\t\t\tnew (...args: ConstructorParameters<typeof BaseRenderer>): BaseRenderer;\n\t\t}>,\n\t\trequired: false,\n\t},\n} as const;\n\nexport type BackgroundRenderProps = ExtractPublicPropTypes<\n\ttypeof backgroundRenderProps\n>;\n\nexport const BackgroundRender = defineComponent({\n\tname: \"BackgroundRender\",\n\tprops: backgroundRenderProps,\n\tsetup(props, { expose }) {\n\t\tconst wrapperRef = useTemplateRef<HTMLDivElement>(\"wrapper-ref\");\n\t\tconst bgRenderRef = ref<AbstractBaseRenderer>();\n\n\t\tonMounted(() => {\n\t\t\tif (wrapperRef.value) {\n\t\t\t\tbgRenderRef.value = CoreBackgroundRender.new(\n\t\t\t\t\tprops.renderer ?? MeshGradientRenderer,\n\t\t\t\t);\n\t\t\t\tconst el = bgRenderRef.value.getElement();\n\t\t\t\tel.style.width = \"100%\";\n\t\t\t\tel.style.height = \"100%\";\n\t\t\t\twrapperRef.value.appendChild(el);\n\t\t\t}\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tif (bgRenderRef.value) {\n\t\t\t\tbgRenderRef.value.dispose();\n\t\t\t}\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.album)\n\t\t\t\tbgRenderRef.value?.setAlbum(props.album, props.albumIsVideo);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.fps) bgRenderRef.value?.setFPS(props.fps);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.playing) bgRenderRef.value?.pause();\n\t\t\telse bgRenderRef.value?.resume();\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.flowSpeed) bgRenderRef.value?.setFlowSpeed(props.flowSpeed);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.renderScale)\n\t\t\t\tbgRenderRef.value?.setRenderScale(props.renderScale);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lowFreqVolume)\n\t\t\t\tbgRenderRef.value?.setLowFreqVolume(props.lowFreqVolume);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.hasLyric !== undefined)\n\t\t\t\tbgRenderRef.value?.setHasLyric(props.hasLyric ?? true);\n\t\t});\n\n\t\texpose<BackgroundRenderRef>({\n\t\t\tbgRender: bgRenderRef,\n\t\t\twrapperEl: wrapperRef,\n\t\t});\n\n\t\treturn () => <div style=\"display: contents;\" ref=\"wrapper-ref\" />;\n\t},\n});\n","import {\n\ttype BaseRenderer,\n\tLyricPlayer as CoreLyricPlayer,\n\ttype LyricLine,\n\ttype LyricLineMouseEvent,\n\ttype LyricPlayerBase,\n\tMaskObsceneWordsMode,\n\ttype OptimizeLyricOptions,\n\ttype spring,\n} from \"@applemusic-like-lyrics/core\";\nimport {\n\tcomputed,\n\tdefineComponent,\n\ttype ExtractPublicPropTypes,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\ttype Ref,\n\tref,\n\ttype ShallowRef,\n\ttype SlotsType,\n\tTeleport,\n\tuseTemplateRef,\n\twatch,\n\twatchEffect,\n} from \"vue\";\n\nconst lyricPlayerProps = {\n\t/**\n\t * 是否禁用歌词播放组件,默认为 `false`,歌词组件启用后将会开始逐帧更新歌词的动画效果,并对传入的其他参数变更做出反馈。\n\t *\n\t * 如果禁用了歌词组件动画,你也可以通过引用取得原始渲染组件实例,手动逐帧调用其 `update` 函数来更新动画效果。\n\t */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/**\n\t * 是否演出部分效果,目前会控制播放间奏点的动画的播放暂停与否,默认为 `true`\n\t */\n\tplaying: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置歌词行的对齐方式,如果为 `undefined` 则默认为 `center`\n\t *\n\t * - 设置成 `top` 的话将会向目标歌词行的顶部对齐\n\t * - 设置成 `bottom` 的话将会向目标歌词行的底部对齐\n\t * - 设置成 `center` 的话将会向目标歌词行的垂直中心对齐\n\t */\n\talignAnchor: {\n\t\ttype: String as PropType<\"top\" | \"bottom\" | \"center\">,\n\t\tdefault: \"center\",\n\t},\n\t/**\n\t * 设置默认的歌词行对齐位置,相对于整个歌词播放组件的大小位置,如果为 `undefined`\n\t * 则默认为 `0.5`\n\t *\n\t * 可以设置一个 `[0.0-1.0]` 之间的任意数字,代表组件高度由上到下的比例位置\n\t */\n\talignPosition: {\n\t\ttype: Number,\n\t\tdefault: 0.5,\n\t},\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tenableSpring: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否启用歌词行的模糊效果,默认为 `true`\n\t */\n\tenableBlur: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tenableScale: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * 设置是否隐藏已经播放过的歌词行,默认不隐藏\n\t */\n\thidePassedLines: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/**\n\t * 设置歌词中不雅用语的掩码模式,默认为 `MaskObsceneWordsMode.Disabled`,即不掩码\n\t */\n\tmaskObsceneWordsMode: {\n\t\ttype: String as PropType<MaskObsceneWordsMode>,\n\t\tdefault: MaskObsceneWordsMode.Disabled,\n\t},\n\t/**\n\t * 设置歌词优化选项\n\t */\n\toptimizeOptions: {\n\t\ttype: Object as PropType<OptimizeLyricOptions>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误\n\t */\n\tlyricLines: {\n\t\ttype: Object as PropType<LyricLine[]>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置当前播放进度,单位为毫秒且**必须是整数**,此时将会更新内部的歌词进度信息\n\t * 内部会根据调用间隔和播放进度自动决定如何滚动和显示歌词,所以这个的调用频率越快越准确越好\n\t */\n\tcurrentTime: {\n\t\ttype: Number,\n\t\tdefault: 0,\n\t},\n\t/**\n\t * 设置文字动画的渐变宽度,单位以歌词行的主文字字体大小的倍数为单位,默认为 0.5,即一个全角字符的一半宽度\n\t *\n\t * 如果要模拟 Apple Music for Android 的效果,可以设置为 1\n\t *\n\t * 如果要模拟 Apple Music for iPad 的效果,可以设置为 0.5\n\t *\n\t * 如果想要近乎禁用渐变效果,可以设置成非常接近 0 的小数(例如 `0.0001` ),但是**不可以为 0**\n\t */\n\twordFadeWidth: {\n\t\ttype: Number,\n\t\tdefault: 0.5,\n\t},\n\t/**\n\t * 设置所有歌词行在横坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlinePosXSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置所有歌词行在纵坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlinePosYSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置所有歌词行在缩放大小上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tlineScaleSpringParams: {\n\t\ttype: Object as PropType<Partial<spring.SpringParams>>,\n\t\trequired: false,\n\t},\n\t/**\n\t * 设置渲染器,如果为 `undefined` 则默认为 `MeshGradientRenderer`\n\t * 默认渲染器有可能会随着版本更新而更换\n\t */\n\tlyricPlayer: {\n\t\ttype: Object as PropType<{\n\t\t\tnew (...args: ConstructorParameters<typeof BaseRenderer>): BaseRenderer;\n\t\t}>,\n\t\trequired: false,\n\t},\n} as const;\n\n/**\n * 歌词播放组件的属性\n */\nexport type LyricPlayerProps = ExtractPublicPropTypes<typeof lyricPlayerProps>;\n\nconst lyricPlayerEmits = {\n\tlineClick: (_: LyricLineMouseEvent) => true,\n\tlineContextmenu: (_: LyricLineMouseEvent) => true,\n} as const;\n\n/**\n * 歌词播放组件的事件\n */\nexport type LyricPlayerEmits = typeof lyricPlayerEmits;\n\n/**\n * 歌词播放组件的引用\n */\nexport interface LyricPlayerRef {\n\t/**\n\t * 歌词播放实例\n\t */\n\tlyricPlayer: Ref<LyricPlayerBase | undefined>;\n\t/**\n\t * 将歌词播放实例的元素包裹起来的 DIV 元素实例\n\t */\n\twrapperEl: Readonly<ShallowRef<HTMLDivElement | null>>;\n}\n\nexport const LyricPlayer = defineComponent({\n\tname: \"LyricPlayer\",\n\tprops: lyricPlayerProps,\n\temits: lyricPlayerEmits,\n\tslots: Object as SlotsType<{\n\t\t\"bottom-line\": () => void;\n\t}>,\n\tsetup(props, { expose, emit, attrs, slots }) {\n\t\tconst wrapperRef = useTemplateRef<HTMLDivElement>(\"wrapper-ref\");\n\t\tconst playerRef = ref<CoreLyricPlayer>();\n\n\t\tconst lineClickHandler = (e: Event) =>\n\t\t\temit(\"lineClick\", e as LyricLineMouseEvent);\n\t\tconst lineContextMenuHandler = (e: Event) =>\n\t\t\temit(\"lineContextmenu\", e as LyricLineMouseEvent);\n\n\t\tonMounted(() => {\n\t\t\tconst wrapper = wrapperRef.value;\n\t\t\tif (wrapper) {\n\t\t\t\tplayerRef.value = new CoreLyricPlayer();\n\t\t\t\twrapper.appendChild(playerRef.value.getElement());\n\t\t\t\tplayerRef.value.addEventListener(\"line-click\", lineClickHandler);\n\t\t\t\tplayerRef.value.addEventListener(\n\t\t\t\t\t\"line-contextmenu\",\n\t\t\t\t\tlineContextMenuHandler,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tif (playerRef.value) {\n\t\t\t\tplayerRef.value.removeEventListener(\"line-click\", lineClickHandler);\n\t\t\t\tplayerRef.value.removeEventListener(\n\t\t\t\t\t\"line-contextmenu\",\n\t\t\t\t\tlineContextMenuHandler,\n\t\t\t\t);\n\t\t\t\tplayerRef.value.dispose();\n\t\t\t}\n\t\t});\n\n\t\twatchEffect((onCleanup) => {\n\t\t\tif (!props.disabled) {\n\t\t\t\tlet canceled = false;\n\t\t\t\tlet lastTime = -1;\n\t\t\t\tconst onFrame = (time: number) => {\n\t\t\t\t\tif (canceled) return;\n\t\t\t\t\tif (lastTime === -1) {\n\t\t\t\t\t\tlastTime = time;\n\t\t\t\t\t}\n\t\t\t\t\tplayerRef.value?.update(time - lastTime);\n\t\t\t\t\tlastTime = time;\n\t\t\t\t\trequestAnimationFrame(onFrame);\n\t\t\t\t};\n\t\t\t\trequestAnimationFrame(onFrame);\n\t\t\t\tonCleanup(() => {\n\t\t\t\t\tcanceled = true;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.playing !== undefined) {\n\t\t\t\tif (props.playing) {\n\t\t\t\t\tplayerRef.value?.resume();\n\t\t\t\t} else {\n\t\t\t\t\tplayerRef.value?.pause();\n\t\t\t\t}\n\t\t\t} else playerRef.value?.resume();\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.alignAnchor !== undefined)\n\t\t\t\tplayerRef.value?.setAlignAnchor(props.alignAnchor);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.hidePassedLines !== undefined)\n\t\t\t\tplayerRef.value?.setHidePassedLines(props.hidePassedLines);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.maskObsceneWordsMode !== undefined)\n\t\t\t\tplayerRef.value?.setMaskObsceneWords(props.maskObsceneWordsMode);\n\t\t\telse playerRef.value?.setMaskObsceneWords(MaskObsceneWordsMode.Disabled);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.alignPosition !== undefined)\n\t\t\t\tplayerRef.value?.setAlignPosition(props.alignPosition);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableSpring !== undefined)\n\t\t\t\tplayerRef.value?.setEnableSpring(props.enableSpring);\n\t\t\telse playerRef.value?.setEnableSpring(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableBlur !== undefined)\n\t\t\t\tplayerRef.value?.setEnableBlur(props.enableBlur);\n\t\t\telse playerRef.value?.setEnableBlur(true);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.enableScale !== undefined)\n\t\t\t\tplayerRef.value?.setEnableScale(props.enableScale);\n\t\t\telse playerRef.value?.setEnableScale(true);\n\t\t});\n\n\t\twatch(\n\t\t\t[playerRef, () => props.lyricLines, () => props.optimizeOptions],\n\t\t\t([player, lyricLines, optimizeOptions]) => {\n\t\t\t\tif (!player) return;\n\n\t\t\t\tif (optimizeOptions !== undefined) {\n\t\t\t\t\tplayer.setOptimizeOptions(optimizeOptions);\n\t\t\t\t}\n\n\t\t\t\tif (lyricLines !== undefined) {\n\t\t\t\t\tplayer.setLyricLines(lyricLines);\n\t\t\t\t} else {\n\t\t\t\t\tplayer.setLyricLines([]);\n\t\t\t\t}\n\n\t\t\t\tif (props.currentTime !== undefined) {\n\t\t\t\t\tplayer.setCurrentTime(props.currentTime, true);\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ immediate: true },\n\t\t);\n\n\t\twatchEffect(() => {\n\t\t\tif (props.currentTime !== undefined)\n\t\t\t\tplayerRef.value?.setCurrentTime(props.currentTime);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.wordFadeWidth !== undefined)\n\t\t\t\tplayerRef.value?.setWordFadeWidth(props.wordFadeWidth);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.linePosXSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLinePosXSpringParams(props.linePosXSpringParams);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.linePosYSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLinePosYSpringParams(props.linePosYSpringParams);\n\t\t});\n\n\t\twatchEffect(() => {\n\t\t\tif (props.lineScaleSpringParams !== undefined)\n\t\t\t\tplayerRef.value?.setLineScaleSpringParams(props.lineScaleSpringParams);\n\t\t});\n\n\t\tconst bottomLineEl = computed(() =>\n\t\t\tplayerRef.value?.getBottomLineElement(),\n\t\t);\n\n\t\texpose<LyricPlayerRef>({\n\t\t\tlyricPlayer: playerRef,\n\t\t\twrapperEl: wrapperRef,\n\t\t});\n\n\t\treturn () => (\n\t\t\t<div ref=\"wrapper-ref\" {...attrs}>\n\t\t\t\t{bottomLineEl.value && (\n\t\t\t\t\t<Teleport to={bottomLineEl.value}>\n\t\t\t\t\t\t{slots[\"bottom-line\"]?.()}\n\t\t\t\t\t</Teleport>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n});\n"],"mappings":";;AAoHA,MAAaE,mBAAmBG,gBAAgB;CAC/CqC,MAAM;CACNC,OArF6B;EAI7BtB,OAAO;GACNC,MAAM,CAACC,QAAQC,OAAO;GAGtBG,UAAU;GACV;EAIDC,cAAc;GACbN,MAAMO;GACNF,UAAU;GACV;EAIDG,KAAK;GACJR,MAAMS;GACNJ,UAAU;GACV;EAIDK,SAAS;GACRV,MAAMO;GACNF,UAAU;GACV;EAIDM,WAAW;GACVX,MAAMS;GACNJ,UAAU;GACV;EAQDO,UAAU;GACTZ,MAAMO;GACNF,UAAU;GACV;EAQDQ,eAAe;GACdb,MAAMS;GACNJ,UAAU;GACV;EAIDS,aAAa;GACZd,MAAMS;GACNJ,UAAU;GACV;EAKDU,UAAU;GACTf,MAAME;GAGNG,UAAU;GACX;EACA;CASAiB,MAAMD,OAAO,EAAEE,UAAU;EACxB,MAAMC,aAAajC,eAA+B,cAAc;EAChE,MAAMkC,cAAcpC,KAA2B;AAE/CJ,kBAAgB;AACf,OAAIuC,WAAWE,OAAO;AACrBD,gBAAYC,QAAQ7C,mBAAqB8C,IACxCN,MAAMN,YAAYjC,qBAClB;IACD,MAAM8C,KAAKH,YAAYC,MAAMG,Y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,KAAAA,EACnCnB,WAAUM,OAAO+B,yBAAyB7C,MAAMhB,sBAAsB;IACtE;EAEF,MAAM8D,eAAetG,eACpBgE,UAAUM,OAAOiC,sBAClB,CAAC;AAED3C,SAAuB;GACtBnB,aAAauB;GACbZ,WAAWW;GACX,CAAC;AAEF,eAAOyC,YAAA,OAAAC,WAAA,EAAA,OAAA,eAAA,EACqB3C,MAAK,EAAA,CAC9BwC,aAAahC,SAAKkC,YAAA9F,UAAA,EAAA,MACJ4F,aAAahC,OAAK,EAAA,EAAApD,eAAA,CAC9BwC,MAAM,kBAAkB,CAAA,EAAA,CAE1B,CAAA,CAEF;;CAEF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applemusic-like-lyrics/vue",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "AMLL 组件库的 Vue 绑定",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/amll-dev/applemusic-like-lyrics.git",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@applemusic-like-lyrics/core": "^0.4.
|
|
39
|
+
"@applemusic-like-lyrics/core": "^0.4.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"vue": "*"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@applemusic-like-lyrics/core": "^0.4.
|
|
45
|
+
"@applemusic-like-lyrics/core": "^0.4.1",
|
|
46
46
|
"@biomejs/biome": "^2.4.8",
|
|
47
47
|
"@pixi/app": "^7.4.3",
|
|
48
48
|
"@pixi/core": "^7.4.3",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"@pixi/filter-blur": "^7.4.3",
|
|
51
51
|
"@pixi/filter-color-matrix": "^7.4.3",
|
|
52
52
|
"@pixi/sprite": "^7.4.3",
|
|
53
|
-
"@rolldown/plugin-babel": "^0.2.
|
|
54
|
-
"@vue/babel-plugin-jsx": "^
|
|
55
|
-
"tsdown": "^0.21.
|
|
53
|
+
"@rolldown/plugin-babel": "^0.2.3",
|
|
54
|
+
"@vue/babel-plugin-jsx": "^2.0.1",
|
|
55
|
+
"tsdown": "^0.21.9",
|
|
56
56
|
"typedoc": "^0.28.17",
|
|
57
57
|
"typedoc-plugin-markdown": "^4.11.0",
|
|
58
58
|
"vue": "^3.5.30"
|