@starcier/collab-ui

中文文档
1.0.0发布于 2026/11/02MITTypeScriptES Module

Visual half of the Starcier collaboration layer: the review layer and guided tours, the BuilderPalette contract, and the chrome primitives styled from it.

原始使用文档
文档目录4 节
  1. Install
  2. Use
  3. Stacking order
  4. License

@starcier/collab-ui

The visual half of the Starcier collaboration layer: review comments pinned to the page, the comments drawer, guided tours and the workflow selector. It looks and behaves the same in every builder, whatever the builder's own design system.

Most builders do not use this package directly. @starcier/builder-shell mounts it for you. Reach for it yourself only when your app keeps its own shell; it needs React, but no router.

Install

npm install @starcier/collab-core@next @starcier/collab-ui@next

Until 1.0.0 is released, versions are prereleases (1.0.0-next.N): always install with @next. Without it, npm installs the first prerelease, not the newest. Requires React 18 or 19, and @starcier/collab-core, which holds the data.

Use

Mount CollabUiProvider inside CollabProvider, around everything that renders the collaboration components:

import { CollabProvider } from '@starcier/collab-core';
import { CollabUiProvider } from '@starcier/collab-ui';

<CollabProvider apiBaseUrl={API_BASE_URL} getToken={getAccessToken} tenant={TENANT_SLUG}>
  <CollabUiProvider
    overlaySelectors={['.my-modal', '.my-drawer']}   // your design system's overlay roots
    fieldWrapperSelectors={['.my-field']}            // wrappers around your form fields
  >
    {children}
  </CollabUiProvider>
</CollabProvider>

Both selector lists are optional. They keep recorded tour steps stable, including tours that open a dialog.

Dialogs cannot be reviewed. Review mode never places a comment inside an element matched by overlaySelectors; a click there reaches the dialog. Comments go on the page itself.

Stacking order

The collaboration layer draws between z-index 9140 (the review highlight) and 10000 (the tour tooltip). Keep your own modals, drawers and popovers below 9140, so comments and tours always appear above them.

The collaboration layer uses its own fixed colours and system fonts, so it reads as a tool on top of your product rather than part of it. The BuilderPalette type exported here is the contract for a builder's chrome — the catalogue and sign-in pages — which @starcier/builder-shell draws from your design tokens.

License

MIT

版本与发布记录

@starcier/collab-ui 共发布 5 个版本,首次发布于 2026/10/23;过去 12 个月发布了 5 个版本。

版本发布日期距今
1.0.0latest2026/11/021 天前
1.0.0-next.2next2026/10/2311 天前
1.0.0-next.12026/10/2311 天前
1.0.0-next.02026/10/2311 天前
0.0.0-stage2026/10/2311 天前

关于 @starcier/collab-ui 的常见问题

@starcier/collab-ui 是什么?

Starcier协作层的视觉部分:回顾层和导览、BuilderPalette契约,以及基于它的chrome原语样式。

如何安装 @starcier/collab-ui?

在项目目录运行 npm install @starcier/collab-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.0.0 || ^19.0.0)、react-dom(^18.0.0 || ^19.0.0)、@starcier/collab-core(^1.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@starcier/collab-ui 支持 TypeScript 吗?

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

@starcier/collab-ui 支持 ESM 还是 CommonJS?

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

@starcier/collab-ui 可以商用吗?

@starcier/collab-ui 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@starcier/collab-ui 还在维护吗?

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