feat(workspace): refresh desktop editing experience and prepare 0.1.2
Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s
Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s
This commit is contained in:
1 parent
aa5255d1e4
commit
2e0033ce2d
260 files changed
+43963
-5591
No files matched your search
@@ -4,7 +4,8 @@ Cutdex workspace 内部 Flutter 包,维护通用组件与基础视觉主题,
|
||||
|
||||
- `theme.dart`:主题、语义颜色、间距与控件尺寸。
|
||||
- `widgets.dart`:菜单、选择框、对话框、输入控件、标签页、面板、下载进度、滚动渐隐等。
|
||||
- `cutdex_ui.dart`:上述两个入口。
|
||||
- `icons.dart`:`AppIcons` 及 Phosphor Regular、Fill 静态图标目录。
|
||||
- `cutdex_ui.dart`:上述三个入口。
|
||||
|
||||
组件通过参数接收文本、数据与回调;应用本地化与项目状态由调用方提供。选择框的空列表文案使用 `emptyLabel`,可搜索选择框同时传入 `searchHint`。对话框默认关闭提示由 Flutter 的 Material 本地化提供,也可传入 `closeLabel`。
|
||||
|
||||
@@ -12,6 +13,8 @@ Cutdex workspace 内部 Flutter 包,维护通用组件与基础视觉主题,
|
||||
|
||||
原生菜单通过 `cutdex_native` 展示,无法展示时回退到 Flutter 菜单。时间线与编辑器的业务样式由应用维护。
|
||||
|
||||
桌面入口通过 `AppTheme.desktopWorkspaceTheme` 应用 `DesktopControlDensity`,使用 `AppDesktopMetrics` 中的按钮、输入框、面板标题与播放栏尺寸。移动端不继承这套密度。`AppCommandToolbar` 接收分组命令及固定的右侧命令,空间不足时将次要操作收入更多菜单;预览位于 `app_command_toolbar_previews.dart`。
|
||||
|
||||
在应用根目录执行 `fvm dart tool/flutter_local.dart pub get`;在本包目录执行:
|
||||
|
||||
```sh
|
||||
@@ -20,3 +23,41 @@ python3 ../../tool/project_tools.py flutter test
|
||||
```
|
||||
|
||||
生成的 Freezed 文件随源码提交。测试维护在本包 `test/`,应用接线测试保留在应用中。
|
||||
|
||||
## 图标
|
||||
|
||||
图标使用随包打包的 Phosphor 官方字体,由 Flutter `Icon` 渲染,无第三方图标包依赖。
|
||||
应用与共享组件优先使用 `AppIcons`,默认 Regular;填充图标使用显式的 `Filled` 名称。
|
||||
|
||||
```dart
|
||||
import 'package:cutdex_ui/icons.dart';
|
||||
|
||||
const Icon(AppIcons.search);
|
||||
const Icon(AppIcons.folderFilled);
|
||||
```
|
||||
|
||||
需要新增项目图标时,在 `lib/src/icons/app_icons.dart` 增加语义映射。完整目录通过
|
||||
`PhosphorIconsRegular` 与 `PhosphorIconsFill` 提供,例如
|
||||
`PhosphorIconsRegular.filmStrip`。颜色、尺寸及无障碍标签使用 `Icon` 的参数,或由
|
||||
`IconTheme` 继承。左右导航箭头和尖括号随 RTL 镜像,播放、撤销/重做及品牌图标保持原方向。
|
||||
|
||||
两套样式使用独立字体族,不能通过 `fontWeight` 在 Regular 与 Fill 之间切换。
|
||||
图标定义均为 `static const IconData`,支持 Flutter release 构建的字体裁剪;不要在运行时
|
||||
用 codepoint 创建图标。当前不包含 Duotone。
|
||||
|
||||
资源来自 [Phosphor web](https://github.com/phosphor-icons/web) 2.1.2,固定提交
|
||||
`3d40a3eaa73b25d20d263f0e1e55c9fed3e66809`。来源路径、字体及原始映射 SHA-256
|
||||
保存在 `tool/phosphor/catalog.json`,MIT 许可证随资源打包在
|
||||
`assets/fonts/PHOSPHOR_LICENSE.txt`。
|
||||
|
||||
在本包目录执行以下命令,生成过程只依赖 Python 标准库,不联网:
|
||||
|
||||
```sh
|
||||
python3 tool/generate_icons.py
|
||||
python3 tool/generate_icons.py --check
|
||||
```
|
||||
|
||||
升级时选定上游完整提交 SHA,并执行 `python3 tool/generate_icons.py --update <COMMIT_SHA>`。
|
||||
脚本从同一提交下载 Regular、Fill 字体及映射,保留上游别名,验证两套目录一致,再生成
|
||||
Dart 常量。字体、目录快照、生成代码和许可证一起提交。升级后运行图标测试及一次带字体
|
||||
裁剪的 release 构建,确认资源可加载、图形正确。
|
||||
Reference in new issue
Block a user