@themodcraft/cms-editor
v1.2.2
Published
Reusable, auth-free editor logic for `@themodcraft/cms`.
Readme
@themodcraft/cms-editor
Reusable, auth-free editor logic for @themodcraft/cms.
- immutable nested block-tree operations;
- clean block and draft factories;
- component composition rules;
- registry-driven TSX generation;
- import deduplication;
- TSX, CSS, and README ZIP download.
The exporter never copies UI-kit source code. Each export renderer declares the npm import it needs and emits only the page composition.
An active TheModCraft license containing the cms entitlement must be configured before editor operations or export generation can run.
import {
createImportedComponentRenderer,
downloadCmsSourceArchive,
generateCmsPageSource,
} from "@themodcraft/cms-editor";
const registry = {
button: createImportedComponentRenderer({
importName: "Button",
moduleSpecifier: "@themodcraft/core-ui",
}),
container: createImportedComponentRenderer({
importName: "Container",
moduleSpecifier: "@themodcraft/pro-kit",
}),
};
const files = generateCmsPageSource(draft, { registry });
await downloadCmsSourceArchive(files);Authentication, permissions, routing, API origins, and editor-session handling remain responsibilities of the host application.
