{"_id":"@anycms/a2ui-dom","_rev":"2-e435868228f757bc4f82200affbf3578","name":"@anycms/a2ui-dom","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.1":{"name":"@anycms/a2ui-dom","version":"0.1.1","keywords":["a2ui","anycms","generative-ui","dom","vanilla","renderer","ai-ui"],"author":{"name":"Liangdi","email":"wu@liangdi.me"},"license":"MIT","_id":"@anycms/a2ui-dom@0.1.1","maintainers":[{"name":"wuliangdi","email":"wu@liangdi.me"}],"homepage":"https://github.com/anycms/a2ui","bugs":{"url":"https://github.com/anycms/a2ui/issues"},"dist":{"shasum":"1a0ccf9c7f19ee37678770e97e966f37c51596f7","tarball":"https://registry.npmjs.org/@anycms/a2ui-dom/-/a2ui-dom-0.1.1.tgz","fileCount":53,"integrity":"sha512-QYtYt9iJ8uaj66BDOQAcWVDWEXIp2WrYVhJDX7J9StnnrISVGf2Hn6vnjA8cUKZJ2iZfleiUy3pbUhMzXu8n7Q==","signatures":[{"sig":"MEYCIQDOZF8OXV+5jn4M+ILVgipPICZ7eN23czZhHk9ylLgm1AIhALF5jDxkca4mjTp/jk3vbPS7tVw23iRKnGK34N+P9IIq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":396810},"main":"./dist/index.cjs","type":"module","_from":"file:anycms-a2ui-dom-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"wuliangdi","email":"wu@liangdi.me"},"_resolved":"/tmp/aa8e1aaf35732bc3e3a965eb7750c8de/anycms-a2ui-dom-0.1.1.tgz","_integrity":"sha512-QYtYt9iJ8uaj66BDOQAcWVDWEXIp2WrYVhJDX7J9StnnrISVGf2Hn6vnjA8cUKZJ2iZfleiUy3pbUhMzXu8n7Q==","repository":{"url":"git+https://github.com/anycms/a2ui.git","type":"git","directory":"packages/a2ui-dom"},"_npmVersion":"11.6.2","description":"Framework-agnostic vanilla-DOM renderer for A2UI v1.0 (zero UI-framework dependency).","directories":{},"_nodeVersion":"25.1.0","dependencies":{"@anycms/a2ui-core":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","jsdom":"^25.0.1","vitest":"^2.1.8"},"_npmOperationalInternal":{"tmp":"tmp/a2ui-dom_0.1.1_1781526680317_0.4454896717744625","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@anycms/a2ui-dom","version":"0.2.0","description":"Framework-agnostic vanilla-DOM renderer for A2UI v1.0 (zero UI-framework dependency).","license":"MIT","author":{"name":"Liangdi","email":"wu@liangdi.me"},"homepage":"https://github.com/anycms/a2ui","repository":{"type":"git","url":"git+https://github.com/anycms/a2ui.git","directory":"packages/a2ui-dom"},"bugs":{"url":"https://github.com/anycms/a2ui/issues"},"keywords":["a2ui","anycms","generative-ui","dom","vanilla","renderer","ai-ui"],"publishConfig":{"access":"public"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"dependencies":{"@anycms/a2ui-core":"0.2.0"},"devDependencies":{"jsdom":"^25.0.1","tsup":"^8.3.5","vitest":"^2.1.8"},"scripts":{"build":"tsup","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit"},"_id":"@anycms/a2ui-dom@0.2.0","_integrity":"sha512-s0qalPLbakKrP29vvZGj1Rdk+MC26LArT63V7Wafc1vyPrVxAk0VaOFpdU7mVMHkdG84iltmsGzTwB5dT06C+Q==","_resolved":"/tmp/91ee117b1c7856a623e630e94418ba89/anycms-a2ui-dom-0.2.0.tgz","_from":"file:anycms-a2ui-dom-0.2.0.tgz","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-s0qalPLbakKrP29vvZGj1Rdk+MC26LArT63V7Wafc1vyPrVxAk0VaOFpdU7mVMHkdG84iltmsGzTwB5dT06C+Q==","shasum":"4024b811f78cca65420bd8854611dbb6bb3007b1","tarball":"https://registry.npmjs.org/@anycms/a2ui-dom/-/a2ui-dom-0.2.0.tgz","fileCount":53,"unpackedSize":417699,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHTVe84i1UcmWi21ov6drcYEhURiOlECIt3K6wXQnKS8AiEA6V8dMa3GZEHU1rlzes7jlgxmn/wCMrz9jJDaPs5x7Gk="}]},"_npmUser":{"name":"wuliangdi","email":"wu@liangdi.me"},"directories":{},"maintainers":[{"name":"wuliangdi","email":"wu@liangdi.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/a2ui-dom_0.2.0_1781606790499_0.3530936748726834"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T12:31:20.149Z","modified":"2026-06-16T10:46:30.780Z","0.1.1":"2026-06-15T12:31:20.460Z","0.2.0":"2026-06-16T10:46:30.672Z"},"bugs":{"url":"https://github.com/anycms/a2ui/issues"},"author":{"name":"Liangdi","email":"wu@liangdi.me"},"license":"MIT","homepage":"https://github.com/anycms/a2ui","keywords":["a2ui","anycms","generative-ui","dom","vanilla","renderer","ai-ui"],"repository":{"type":"git","url":"git+https://github.com/anycms/a2ui.git","directory":"packages/a2ui-dom"},"description":"Framework-agnostic vanilla-DOM renderer for A2UI v1.0 (zero UI-framework dependency).","maintainers":[{"name":"wuliangdi","email":"wu@liangdi.me"}],"readme":"# @anycms/a2ui-dom\n\nA **framework-agnostic vanilla-DOM renderer** for [A2UI](https://github.com/anycms/a2ui) v1.0. It renders the same server-driven A2UI message stream as the React renderer, but with native DOM elements and **zero UI-framework dependency** — no React, Angular, or Vue.\n\nIt is a peer of `@anycms/a2ui-react`. The A2UI binders, reactive runtime, and message processor are reused unchanged from `@anycms/a2ui-core`; only the ~135-line adapter/surface and the 18 component Views are reimplemented, targeting `HTMLElement`.\n\n## Why\n\nDrop-in rendering for hosts that don't want a framework runtime: Web Components, SSR fragments, embedded widgets, or anywhere React's bundle weight is unwanted.\n\n## Install\n\n```bash\npnpm add @anycms/a2ui-dom @anycms/a2ui-core\n```\n\n## Usage\n\n```ts\nimport { mountDomSurface } from '@anycms/a2ui-dom';\n// `surface` is a SurfaceModel produced by MessageProcessor.processMessages(...)\nconst handle = mountDomSurface(surface, document.getElementById('host')!);\n// later\nhandle.dispose();\n```\n\n`mountDomSurface(surface, hostEl, opts?)` mounts the `root` component into `hostEl` and returns `{ element, dispose() }`. Each bound node subscribes to its own reactive props stream; inputs preserve focus across re-renders and Tabs/Modal preserve local UI state.\n\nThe default registry (`basicDomComponents`) renders all 18 Basic Catalog components. Pass a custom registry to override individual components:\n\n```ts\nimport { mountDomSurface, createDomComponent, basicDomComponents } from '@anycms/a2ui-dom';\nimport { textBinder } from '@anycms/a2ui-core';\n\nconst registry = new Map(basicDomComponents);\nregistry.set('Text', createDomComponent(textBinder, myTextView));\nmountDomSurface(surface, host, { registry });\n```\n\n## Styling\n\nMirrors the React vanilla preset: inline styles with the leaf-margin strategy (leaves carry 8px; containers flush) and semantic class hooks (`a2ui-surface`, `a2ui-row`, `a2ui-column`, `a2ui-list`, `a2ui-leaf`, `a2ui-modal`). No CSS framework required.\n\n## License\n\nMIT © Liangdi\n","readmeFilename":"README.md"}