@ag2/weave

中文文档
0.21.1发布于 2026/11/05Apache-2.0TypeScriptES Module近 30 天下载 1.1万

Weave — the AG2 Space design system (forked from folds 2.6.2)

原始使用文档
文档目录3 节
  1. Temporary sidebar collapse
  2. Ambient orb background
  3. Local development

Weave

Storybook: https://ag2-space.github.io/weave/ — every branch gets its own at https://ag2-space.github.io/weave/<branch>/.

The AG2 Space design system. Forked from folds 2.6.2 (Apache-2.0); @ag2/[email protected] is [email protected] under the new name.

Temporary sidebar collapse

Keep PageNav mounted and call useRoomNavAutoCollapse once from the room layout:

import { useRoomNavAutoCollapse } from "@ag2/weave";

useRoomNavAutoCollapse(commonsOpen && !isMobile, roomId);

The hook collapses the sidebar before paint without writing roomNavCollapsed. Closing Commons or unmounting the layout releases the request and restores the saved preference. Manual controls still use useRoomNavCollapsed(); they toggle the effective state, save the user's choice, and override requests already active. Switching tabs in the same room preserves that choice. Closing and reopening Commons, or changing roomId, starts a fresh automatic collapse. Leave the optional scope unchanged for the lifetime of one open panel, and disable the request on mobile.

useRoomNavCollapsed() retains its existing tuple and animation options. The collapsed sidebar's restore button remains the way to expand it; no room-header control is needed.

Ambient orb background

OrbBackground renders the Absorb / Calm / Aura field and is the default background of SplashScreen. Place it inside an element with the exported OrbBackgroundHost class so its decorative canvas sits behind content and is clipped at the surface edge. The parent supplies its background colour through the normal theme tokens.

It follows the resolved color.Background.Container token, including nested and custom themes. An optional appearance="light" | "dark" prop lets a framing host override the colour intensity. Reduced motion renders a static field; hidden documents pause animation. All animation frames, resize observers, and theme listeners are removed on unmount. Starfield and StarfieldHost remain exported for existing consumers.

The field is adapted from matty-morgs/octo-space.

Folds

Npm package

Folds is the design system made for Cinny matrix client.

Local development

Execute the following commands to start a development server:

npm ci # Install all dependencies
npm run storybook # Serve a development version

To build the package:

npm run build # Build package into dist directory

版本与发布记录

@ag2/weave 共发布 28 个版本,首次发布于 2026/09/14;过去 12 个月发布了 28 个版本。

版本发布日期距今
0.21.1latest2026/11/051 天前
0.21.02026/11/051 天前
0.20.02026/11/042 天前
0.19.02026/11/042 天前
0.18.02026/10/298 天前
0.17.02026/10/298 天前

其他发布通道:direction-d → 0.6.0-direction-d.2。

关于 @ag2/weave 的常见问题

@ag2/weave 是什么?

Weave — the AG2 Space design system (forked from folds 2.6.2)

如何安装 @ag2/weave?

在项目目录运行 npm install @ag2/weave,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=17 <19)、react-dom(>=17 <19)、classnames(^2.3.2)、@vanilla-extract/css(^1.9.2)、@phosphor-icons/react(^2.1.10)、@vanilla-extract/recipes(^0.3.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@ag2/weave 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ag2/weave 支持 ESM 还是 CommonJS?

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

@ag2/weave 可以商用吗?

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

@ag2/weave 的下载量有多少?

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

@ag2/weave 还在维护吗?

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