@vdatacloud/cms-components

中文文档
0.14.2发布于 2026/11/03UNLICENSEDTypeScriptES Module零依赖

Embeddable web components for drafting and sharing escrow agreements (daml-escrow-cms, PLAN.md 81.4 T10): light-DOM custom elements styled by @vdatacloud/cx-commons tokens, in the page's language (en/fr), talking only to the CMS API (/api/v1/cms).

原始使用文档

@vdatacloud/cms-components

Embeddable web components for drafting and sharing escrow agreements, from daml-escrow-cms (PLAN.md 81.4, T10).

  • Light-DOM custom elements: <cms-workspace-list>, <cms-workspace workspace-id>, <cms-agreement-editor workspace-id>, <cms-shared-agreements>. The host's Tailwind, the @vdatacloud/cx-commons tokens, dark mode and fonts apply unchanged.
  • The CMS API only (/api/v1/cms/...), directly or through the host's proxy, which passes the user's own token. They never talk to the ledger.
  • English and French, following the page's <html lang> through cx-commons i18n.
import { configure, defineCmsElements } from '@vdatacloud/cms-components';

configure({
  base: 'https://api.example.com',                         // where /api/v1/cms is served
  headers: () => ({ Authorization: `Bearer ${token()}` }), // the user's own token; no Content-Type
});
defineCmsElements();

The elements emit cms-open-workspace ({ id }) when the user opens a workspace; the host decides where to show <cms-workspace>.

Tailwind v4 hosts must scan the package so the classes the elements use are generated:

@source "../node_modules/@vdatacloud/cms-components/src";

@vdatacloud/cx-commons is a peer dependency: the components register their messages in the host's i18n registry and render its error notices and dialogs.

The package ships TypeScript sources (like cx-commons); the host's bundler (Vite/Astro) compiles them. It is versioned with daml-escrow-cms releases.

版本与发布记录

@vdatacloud/cms-components 共发布 16 个版本,首次发布于 2026/10/14;过去 12 个月发布了 16 个版本。

版本发布日期距今
0.14.2latest2026/11/03今天
0.14.12026/11/02今天
0.14.02026/11/011 天前
0.13.32026/10/313 天前
0.13.22026/10/313 天前
0.13.12026/10/285 天前

关于 @vdatacloud/cms-components 的常见问题

@vdatacloud/cms-components 是什么?

用于起草和共享托管协议的可嵌入web组件(dam -escrow-cms, PLAN。md 81.4 T10):轻dom自定义元素样式的@vdatacloud/cx-commons令牌,在页面的语言(en/fr),只与CMS API (/ API /v1/ CMS)。

如何安装 @vdatacloud/cms-components?

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

@vdatacloud/cms-components 支持 TypeScript 吗?

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

@vdatacloud/cms-components 支持 ESM 还是 CommonJS?

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

@vdatacloud/cms-components 可以商用吗?

@vdatacloud/cms-components 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@vdatacloud/cms-components 还在维护吗?

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