@natilon/admin-ui
v0.10.0
Published
Bundleable admin UI for the Natilon CMS (Preact + htm-style hyperscript).
Readme
@natilon/admin-ui
Vite-built Preact + htm-style admin UI for the Natilon CMS. Pairs with
@natilon/cms-server, which serves the bundle under
/admin/ and provides the API.
Install
npm i @natilon/admin-uiBuild
npm run build --workspace=@natilon/admin-uiOutput: dist/index.html + dist/assets/index-*.{js,css} (single
chunk, hashed, with sourcemaps). The bundle bootstraps itself by
fetching /api/config from the server.
Dev mode
In dev, the server (@natilon/cms-server) mounts Vite as middleware,
so HMR is available without a second build process. Just run the
admin server.
Theming / customization
All site-specific data — block schemas, collections, media CDN base,
preview URL — comes from your project's cms.config.mjs, fetched at
runtime via GET /api/config. There is nothing project-specific in
the bundle; it's reusable across CMS instances.
What's inside
admin.js— top-level bootstrap (fetches/api/config, installs block schemas, renders).src/render.js— Preact root renderer.src/state.js— central store (auth, deploy pill, current page, modals).src/api.js—fetchJSONover basic-auth.src/auth.js— auth token persistence insessionStorage.src/media.js— CDN media picker (talks to/api/media/*).src/schemas.js— runtime-installable block schema registry.src/panels/— login, dashboard, header, sidebar, editor, canvas, props, modals.
