@plenary/core
v0.5.1
Published
Plenary SDK core types: DOM nodes, component registration, prop definitions, and the preview protocol. Types only, zero deps.
Readme
@plenary/core
The shared type layer of the Plenary SDK: the JSON DOM a page builder document is made of, the component/prop/slot registration contract, the style panel and theme types, and the postMessage protocol that connects a site's live preview to the Plenary console.
Types only, zero runtime dependencies. You normally don't install this
directly — it comes in as a dependency of @plenary/client and
@plenary/react — but it's the package to import from when you need the
underlying types:
import type { PlenaryDocument, PlenaryNode } from "@plenary/core";PlenaryDocument/PlenaryNode— the component tree stored in an entry'sblocksfield: component name, props, styles per breakpoint, and named slots of child nodes.- Registration types —
ComponentRegistration,PropDefinition,SlotDefinition,StylePanel,ThemeRegistration: what a framework adapter reports to the console so the page builder knows which components exist and how to edit them. - Preview protocol — the message types exchanged between the console's
page builder and an embedded site preview. Origin discipline is the security
model:
isAllowedEditorOriginmatches an origin against a configured list (exact origins,https://*.example.comsubdomain patterns, orhttp://localhost:*port patterns) and everything else is ignored.
Framework adapters build on these types; @plenary/react is the reference
implementation. Full documentation at
docs.plenarycms.com.
