@nkstack/refract-tool-contracts
v0.0.0
Published
Shared Refract contracts for runtime plugins, server plugins, and server bridge payloads.
Readme
@nkstack/refract-tool-contracts
Shared Refract contracts for runtime plugins, server plugins, and server bridge payloads.
Install
pnpm add @nkstack/refract-tool-contractsMain Types
RefractRuntimePluginRefractServerPluginRefractPluginBundleRefractPluginRegistryRefractBrowserContextRefractServerContextRefractServerResult
Runtime Plugin Notes
onSelectcontrols selection behavior ("open-panel"or"none").panelStylesaccepts CSS text strings injected into the plugin panel ShadowRoot.- Plugin panels receive
portalContainerandshadowRootinRefractPanelProps.
Registry Helper
import { createRefractRegistry } from "@nkstack/refract-tool-contracts";
const registry = createRefractRegistry({
plugins: [
{
runtime: runtimePlugin,
server: serverPlugin
}
],
defaultPluginId: "my-plugin"
});createRefractRegistry(...) validates:
- runtime plugin ids are unique and non-empty
- server plugin ids match runtime ids
defaultPluginIdexists in runtime plugins
Disclaimer
Most of the code in this repository was generated with AI assistance. All generated output was reviewed and supervised by humans.
