@aphrody/identity

中文文档
1.4.7发布于 2026/10/23Apache-2.0ES Module零依赖近 30 天下载 1998

Aphrody product identity for the M3 surfaces: brand emblem and icons, the Aphrody avatar, the animated pet (React component and Custom Element, Codex-composed tracks, 16-way gaze) drawn from crates/ui/identity.

原始使用文档

@aphrody/identity

The Aphrody product identity for React/M3 surfaces, drawn from crates/ui/identity of the aphrody repository.

ImportContentsNeeds
@aphrody/identityAphrodyAvatar, AphrodyPet, BRAND_ICONS, brandIcon, brandSrcSet, pet datathe @aphrody/m3 ?url loader
@aphrody/identity/brandbrand emblem icons (icon-64/128/192.png) as URLs?url loader
@aphrody/identity/themeAPHRODY_M3_SEED: the shared Aphrody/Bun product seed for native and web M3 themesnothing
@aphrody/identity/atlasPET_ATLAS_URL (sprite sheet)?url loader
@aphrody/identity/petPET, frameAt, gazeFrame, spriteStyle (timed tracks, 16-way gaze)nothing
@aphrody/identity/runtimePET_WEB, resolve, currentFrame, Ambient, gaze: the crate clock (Codex-composed tracks, state lifetimes), tick for ticknothing
@aphrody/identity/element<aphrody-pet> Custom Element, defineAphrodyPet() (16.6 KB minified, 3.6 KB gzip)an atlas URL in src
@aphrody/identity/loadloadIcon(source, { size, scale, tint, fit, output }): PNG, JPEG, WebP, GIF, SVG, ICO (best entry for size × scale) and symbol:<name>?style=…&fill=…&wght=…&grad=…&opsz=… from cdn.aphrody.com, to an ImageBitmap or SVG markup; the browser side of the crate loader (8.4 KB minified, 3.8 KB gzip)a browser for bitmaps

The brand and atlas modules import the crate assets by relative path, so they resolve in an aphrody checkout (this repository mounted at m3/). src/animations.generated.ts is generated from the crate's assets/aphrody/animations.json by bun run gen; bun run test (src/pet.test.ts) fails when the two disagree. Typecheck: bun run typecheck.

<aphrody-pet src="…/spritesheet.webp" size="104">: one timer per frame change, prefers-reduced-motion shows the first frame, setState("running" | "waiting" | "review" | "failed"), clearState(), play(name | null), gaze follows the pointer at rest (no-gaze disables it). src/web.generated.ts comes from the crate's assets/aphrody/web.json; src/runtime.test.ts replays the crate's tests/fixtures/parite-web.json. bun run demo serves a demo with Bun.serve, bun demo/check.ts drives it in headless Chrome, and bun run measure [--wasm file] prints bundle sizes and timings (choice and figures: crate README).

版本与发布记录

@aphrody/identity 共发布 8 个版本,首次发布于 2026/10/05;过去 12 个月发布了 8 个版本。

版本发布日期距今
1.4.7latest2026/10/2315 天前
1.4.42026/10/1820 天前
0.1.52026/10/1028 天前
0.1.42026/10/1028 天前
0.1.32026/10/1029 天前
0.1.22026/10/0929 天前

关于 @aphrody/identity 的常见问题

@aphrody/identity 是什么?

Aphrody product identity for the M3 surfaces: brand emblem and icons, the Aphrody avatar, the animated pet (React component and Custom Element, Codex-composed tracks, 16-way gaze) drawn from crates/ui/identity.

如何安装 @aphrody/identity?

在项目目录运行 npm install @aphrody/identity,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@aphrody/identity 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/aphrody__identity 是否存在。

@aphrody/identity 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aphrody/identity 可以商用吗?

@aphrody/identity 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aphrody/identity 的下载量有多少?

根据 npm 官方下载统计,@aphrody/identity 在 2026/10/06 – 2026/11/04 这 30 天内被下载 1,998 次,日均约 67 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aphrody/identity 还在维护吗?

最新版本 1.4.7 发布于 2026/10/23(15 天前);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/10/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。