Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 完善了单文件格式转换功能,修复了剪切板黏贴图片相关bug #293

Merged
merged 25 commits into from
Feb 3, 2025

Conversation

neooier
Copy link
Contributor

@neooier neooier commented Feb 2, 2025

添加了"从旧版文件打开"按钮,需选中原json格式文件,会自动加载在json数据内且存在于json文件相同文件夹的图片到当前舞台。
从旧版打开时项目将被设置为草稿。

neooier and others added 25 commits January 23, 2025 22:44
- 在 package.json 中添加 jszip 依赖,版本为 ^3.10.1
- jszip 是一个用于处理 ZIP 文件的 JavaScript 库,可能用于文件压缩或解压功能
- 重构 IndexedDBFileSystem 类,优化文件和目录操作逻辑
- 新增目录创建、读取、重命名和删除功能
- 改进文件重命名和删除,支持自动更新父目录条目
- 优化文件下载时的文件名处理,支持保留文件后缀
- 重构文件打开流程,使用 VFileSystem 统一处理文件读取
- 修改文件路径处理逻辑,支持获取文件名和文件名(含后缀)
- 更新文件对话框默认文件名,使用 .gp 后缀
- 重构 VFileSystem 类,增加 pullMetaData 和 saveToPath 方法
- 更新 RecentFileManager 和 StageSaveManager,使用新的文件系统方法
- 修改 ControllerDragFile 和 CopyEngine,使用 VFileSystem 替代直接文件操作
- 更新 StageExportEngine 和 SoundService,使用新的文件读写方法
- 重构 fs/com.tsx,提供统一的文件操作接口
- 在 VFileSystem 中添加 clear 方法,用于清除文件系统数据
- 优化 IndexedDBFileSystem 中的 getStore、addEntryToParent 和 clear 方法
- 删除多余的空格和括号,提高代码可读性
- 在加载文件前,增加清除虚拟文件系统的操作
- 在多个地方添加 VFileSystem.clear() 调用,以确保文件切换时清理虚拟文件系统
- 修改文件加载逻辑,只允许加载 .gp 后缀的文件
- 更新错误提示信息,明确指出需要选择 .gp 文件
- 在 dealPngFileDrop 函数中添加 async/await 以确保文件写入操作是异步执行的
- 在 readClipboardItems 函数中添加 await 以确保文件写入操作完成后再继续执行后续代码
- 新增 absolute2Ext 函数,用于将绝对路径转换为文件后缀
- 实现了 RecentFileManager.openLegacyFileByPath 方法,用于打开旧版文件格式
- 在 AppMenu 中添加了"打开旧版文件"选项
- 优化了文件打开流程,支持选择 legacy 文件
- 在英文、简体中文和繁体中文的本地化文件中添加了“Open Legacy Project”及其翻译
- 此更新支持了新开辟的功能,使用户能够从旧版本的文件中打开项目
- 将 Database 图标替换为 FileText 图标
- 优化用户体验和视觉一致性
@Littlefean Littlefean merged commit e36070c into LiRenTech:revert-290-file-sys Feb 3, 2025
2 checks passed
@Littlefean
Copy link
Contributor

粘贴板中的图片粘贴在舞台上时还是会报错

copyEngine.tsx:133  Uncaught (in promise) TypeError: blob.bytes is not a function

不过拖入png文件进入舞台倒是没问题

@Littlefean
Copy link
Contributor

目前已经push到 revert-290-file-sys 分支,如果这个问题解决了,gp文件再换个后缀名,然后我再把最近文件面板中做个旧文件提醒,然后
就可以直接合并到主分支了

@Littlefean
Copy link
Contributor

我在想是不是linux不会报blob.bytes is not a function的错?windows会报错

@Littlefean
Copy link
Contributor

已修复图片粘贴

@Littlefean
Copy link
Contributor

revert-290-file-sys 分支上我又继续更新了一些提示
当用户从最近打开的文件面板、启动文件面板打开旧文件的时候会拦截并弹窗。

@Littlefean
Copy link
Contributor

master分支上zty更新了monorepo架构,改动比较大。我把master分支合并了进来对齐了一下进度。启动指令变成 pnpm dev:app了

@neooier
Copy link
Contributor Author

neooier commented Feb 3, 2025

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants