@vdatacloud/cms-components
v0.13.0
Published
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).
Readme
@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-commonstokens, 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.
