mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-12-05 11:15:01 +03:00
Add the zero-dependency ui-tokens crate to export generated theme tokens, icon definitions, and bundled font bytes without cross-tree include_bytes! paths. Add the domain-neutral ui-kit crate with logical geometry helpers, SafeArea, VirtualList, SwipeDialog, and SwipeMenu state machines backed by scheduler time and four-rate replay invariance tests. Extract blocksuite-editor from playground with the WorkspaceDocDirectory host port, exact substring UTF-16 highlight matching, and LTR/RTL logical start/end block flow layout. Slim playground to the demo and harness host. Update workspace manifests, static invariant guards, CI workflows, and AGENTS.md files.
904 B
904 B
Working in packages/ui/kit/ (for agents)
packages/ui/kit/ holds the domain-neutral cross-platform component library (ui-kit) inside the client workspace at packages/frontend/Cargo.toml.
Invariants
- Depend only on
uiandui-tokens(ALLOWED_DEPS["packages/ui/kit"] = {"packages/ui/tokens", "packages/ui/ui"}). - Keep
packages/ui/kit/free of editor or product domain names. - Keep
#![forbid(unsafe_code)]insrc/lib.rsand keep each.rsfile at or below 800 non-test lines. - Use logical geometry (
LogicalEdges,LogicalStyled,Edges::from_logical,inline_start, andinline_end) instead of physical left/right layout helpers (.left(,.right(,.pl(,.pr(,.ml(,.mr(,.border_l(,.border_r(). - Drive every transition from closed-form scheduler time (
ui::Motionandui::MotionCurve). Never read wall clocks or run frame-by-frame recurrence loops.