diff --git a/CHANGELOG.md b/CHANGELOG.md index c90a2ae5..399ba92b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,29 @@ +### [1.5.6] - 2023.10.27 + +#### 优化 + +- 优化文件支持性相关错误信息显示逻辑 + +#### 修复 + +- 修复部分谱面读取逻辑与本体不一致的问题 + ### [1.5.5] - 2023.10.12 #### 新内容 -- 重新添加`视频录制`复选框,该项选中时,画面内出现半透明的摄像机图标: - - 未播放时点击图标切换自动(默认值)/手动录制 - - 自动录制时(图标为摄像机开启),以任何方式开始播放都会自动开始录制 - - 手动录制时(图标为摄像机关闭),播放时点击图标切换开始/结束录制 - - 录制状态下图标为红色,否则为绿色 - - 无论是手动录制还是自动录制,以任何方式停止播放都会结束录制 - - 结束录制会打开录制预览的窗口,可在此进行预览或将视频保存到本地 - - 未录制时,可长按图标重新打开最近一次的录制预览窗口 - - 可拖动图标以改变位置,拖动时不会触发点击/长按操作 +- 重新添加`视频录制`复选框,该项选中时: + - 会在画面内显示一个带摄像机图标的半透明悬浮按钮 + - 播放前,点击按钮切换录制模式(自动/手动模式) + - 自动模式(图标为摄像机开启):以任何方式播放都会自动开始录制 + - 手动模式(图标为摄像机关闭):不会自动开始录制,需手动点击按钮录制 + - 播放时,点击按钮切换录制状态(开始/结束录制) + - 按钮为红色表示正在录制,绿色表示未录制 + - 暂停/继续播放不会影响录制状态 + - 只有在播放时才能进行录制,以任何方式结束播放都会自动结束录制 + - 结束录制后,会自动打开录制预览窗口,可对录制结果进行预览或保存到本地 + - 未录制时,长按按钮可再次打开录制预览窗口,预览上一次录制结果 + - 通过拖动按钮改变其位置,拖动时不会触发点击/长按操作 #### 更改 @@ -140,7 +153,7 @@ #### 优化 - 优化谱面镜像逻辑 -- 优化不支持类型错误信息的显示 +- 优化兼容性相关错误信息显示逻辑 - 为不支持或禁用全屏功能的浏览器提供兼容 (充满屏幕) - 优化图片着色,避免 iOS 15.6+ 出现`InvalidStateError`错误信息 - 感谢 [@luch4736](https://space.bilibili.com/481266830) 提供 `iPad Pro (2016)` 设备支持 @@ -163,7 +176,7 @@ #### 修复 -- 修复长度超过一定值的`Hold`在旋转一定角度时不正常显示的问题 +- 修复长度超过一定值的`Hold`在旋转一定角度时显示异常的问题 ### [1.4.18] - 2022.5.23 @@ -215,7 +228,7 @@ #### 修复 -- 修复部分包含时间异常事件的谱面不正常显示的问题 +- 修复部分包含时间异常事件的谱面显示异常的问题 #### 已删除 diff --git a/package.json b/package.json index 464685bf..69ae2027 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sim-phi-vite", "private": true, - "version": "1.5.5", + "version": "1.5.6", "type": "module", "scripts": { "dev": "vite", @@ -17,18 +17,18 @@ }, "devDependencies": { "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.11", - "@rollup/plugin-babel": "^6.0.3", - "@rollup/plugin-terser": "^0.4.3", - "@types/eslint": "^8.44.3", - "@types/md5": "^2.3.3", - "@types/prompts": "^2.4.5", - "@typescript-eslint/eslint-plugin": "^6.7.3", - "@typescript-eslint/parser": "^6.7.3", - "eslint": "^8.50.0", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-terser": "^0.4.4", + "@types/eslint": "^8.44.6", + "@types/md5": "^2.3.4", + "@types/prompts": "^2.4.7", + "@typescript-eslint/eslint-plugin": "^6.9.0", + "@typescript-eslint/parser": "^6.9.0", + "eslint": "^8.52.0", "eslint-plugin-rulesdir": "^0.2.2", "picocolors": "^1.0.0", "prompts": "^2.4.2", "typescript": "^5.2.2", - "vite": "^4.4.9" + "vite": "^4.5.0" } } diff --git a/scripts/meta.json b/scripts/meta.json index 9c81ff1b..5940d308 100644 --- a/scripts/meta.json +++ b/scripts/meta.json @@ -1,5 +1,5 @@ { - "version": "1.5.5", + "version": "1.5.6", "pubdate": 1611795955, - "lastupdate": 1697125670 + "lastupdate": 1698412304 } diff --git a/src/components/Checkbox.ts b/src/components/Checkbox.ts index 8d9742d2..32fce573 100644 --- a/src/components/Checkbox.ts +++ b/src/components/Checkbox.ts @@ -26,14 +26,14 @@ export class Checkbox { return this; } public appendBefore(node: HTMLElement): this { - if (node.parentNode == null) { throw new Error('Node must have a parent node') } + if (node.parentNode == null) throw new Error('Node must have a parent node'); node.parentNode.insertBefore(this.container, node); return this; } public toggle(): void { this.checked = !this.checkbox.checked; } - public hook(callback = (_arg0: HTMLInputElement, _arg1: HTMLDivElement) => {}): this { + public hook(callback: (arg0: HTMLInputElement, arg1: HTMLDivElement) => void): this { callback(this.checkbox, this.container); return this; } diff --git a/src/components/HitEvents.ts b/src/components/HitEvents.ts index ecf646e2..5e841b43 100644 --- a/src/components/HitEvents.ts +++ b/src/components/HitEvents.ts @@ -1,23 +1,27 @@ -export class HitEvents extends Array { +interface HitEventsOptions { + updateCallback?: (arg0: T) => boolean; + iterateCallback?: (arg0: T) => void; +} +export class HitEvents extends Array { public update: () => void; public animate: () => void; public constructor({ - updateCallback = (..._arg: any[]): boolean => false, - iterateCallback = (..._arg: any[]) => {} - } = {}) { + updateCallback = () => false, + iterateCallback = () => {} + }: HitEventsOptions = {}) { super(); this.update = this.defilter.bind(this, updateCallback); this.animate = this.iterate.bind(this, iterateCallback); } - private defilter(predicate: (arg0: unknown) => boolean): this { + private defilter(predicate: (arg0: T) => boolean): this { let i = this.length; while (i--) if (predicate(this[i])) this.splice(i, 1); return this; } - private iterate(callback: (arg0: unknown) => void): void { + private iterate(callback: (arg0: T) => void): void { for (const i of this) callback(i); } - public add(value: unknown): void { + public add(value: T): void { this[this.length] = value; } public clear(): void { diff --git a/src/components/StatusManager.ts b/src/components/StatusManager.ts index 696701d3..09ede902 100644 --- a/src/components/StatusManager.ts +++ b/src/components/StatusManager.ts @@ -31,18 +31,18 @@ export class StatusManager { if (node instanceof HTMLInputElement || node instanceof HTMLSelectElement) { const property = node.type === 'checkbox' ? 'checked' : 'value'; const value = this.get(key); - if (value !== undefined) { ((node as HTMLInputElement)[property] as string) = value } + if (value !== undefined) ((node as HTMLInputElement)[property] as string) = value; node.addEventListener('change', () => { this.set(key, (node as HTMLInputElement)[property] as string); }); - if (dispatch as boolean) { node.dispatchEvent(new Event('change')) } + if (dispatch as boolean) node.dispatchEvent(new Event('change')); } else if (node instanceof HTMLTextAreaElement) { const value = this.get(key); - if (value !== undefined) { (node.value as unknown) = value } + if (value !== undefined) (node.value as unknown) = value; node.addEventListener('change', () => { this.set(key, node.value); }); - if (dispatch as boolean) { node.dispatchEvent(new Event('change')) } - } else { throw new Error('Node must be ,