动效层:把 beUI 的动效语言移植到两端,令牌放在 packages/shared/src/motion.ts(纯常量,后端也引用得到)。弹簧用数值积分生成 CSS linear(),纯 CSS 即可驱动,不必每组件一个 rAF 循环;两端各一份 composables/motion.ts 负责 DOM 部分,在 app.mount() 之前注入 :root。含 reduced-motion 全局降级与 hover 能力探测;灵动岛只移植单调曲线。
深色主题:Web 管理端补齐,机制与桌面客户端一致;语义色令牌只覆盖颜色,不动圆角与动效令牌。默认跟随系统,用户手动点过之后以用户为准。
图标:build/classhelper.{png,ico} 成为全项目唯一图形源,pnpm icons 从它派生各端图标与界面内品牌标。版本号统一到 1.1.2。
43 lines
1.5 KiB
JavaScript
43 lines
1.5 KiB
JavaScript
/**
|
|
* 图标生成启动器:pnpm icons
|
|
*
|
|
* 真正的活儿在 `scripts/icons/render.cjs`(跑在 Electron 里,用 Chromium 的 canvas
|
|
* 把 `build/classhelper.png` 重采样成各端要的尺寸)。这里只负责把 Electron 拉起来。
|
|
*
|
|
* 图形源是**手工放入的设计导出**,不从任何 SVG 渲染 —— 改图标请换
|
|
* `build/classhelper.{png,ico}` 这两个文件,别改这个脚本。
|
|
*/
|
|
import { spawn } from 'node:child_process';
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { resolveElectronEnv, resolveElectronExecutable } from './lib/electron-env.mjs';
|
|
|
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
const electronDir = path.join(root, 'packages', 'desktop-client', 'node_modules', 'electron');
|
|
|
|
if (!fs.existsSync(electronDir)) {
|
|
console.error('[icons] 未找到 Electron,请先执行 pnpm install');
|
|
process.exit(2);
|
|
}
|
|
|
|
for (const source of ['classhelper.png', 'classhelper.ico']) {
|
|
const file = path.join(root, 'build', source);
|
|
if (!fs.existsSync(file)) {
|
|
console.error(`[icons] 缺少图形源 build/${source}(设计导出,需手工放入)`);
|
|
process.exit(2);
|
|
}
|
|
}
|
|
|
|
const executable = resolveElectronExecutable(electronDir);
|
|
|
|
const child = spawn(executable, [path.join(root, 'scripts', 'icons', 'render.cjs')], {
|
|
cwd: root,
|
|
stdio: 'inherit',
|
|
env: resolveElectronEnv(),
|
|
});
|
|
|
|
child.on('exit', (code) => {
|
|
process.exit(code ?? 1);
|
|
});
|