@renderx-plugins/library-component
v1.0.3
Published
Runtime for Library-Component drag/drop sequences (externalized).
Downloads
17
Maintainers
Readme
@renderx-plugins/library-component
Runtime package that registers the Library Component drag/drop sequences for RenderX.
- Entry:
src/index.ts - Export:
register(conductor) - Sequences:
drag,drop,container-drop - Types: bundled
.d.ts(tsup dts) - Peer dependency:
@renderx-plugins/host-sdk - NEW: Ships with bundled json-sequences and advertises them via
renderx.sequencesmetadata
Note: This is a pre-release (0.1.0-rc.1). API surface is stable for current host usage, but may have minor breaking changes prior to 1.0.
Install
npm install @renderx-plugins/library-component @renderx-plugins/host-sdk
# or
pnpm add @renderx-plugins/library-component @renderx-plugins/host-sdk
# or
yarn add @renderx-plugins/library-component @renderx-plugins/host-sdkUsage
import { register as registerLibraryComponent } from '@renderx-plugins/library-component';
// Your application should provide a Musical Conductor instance
import { conductor } from '@renderx-plugins/host-sdk';
registerLibraryComponent(conductor);This call registers the library-component sequences so your app can:
- start a drag with a preview ghost (no setDragImage fallbacks included)
- drop components onto the canvas (root or container drops)
Auto-Discovery
As of v0.1.0-rc.1, this package includes its own json-sequences and advertises them via package.json metadata:
{
"renderx": {
"sequences": ["json-sequences"]
},
"files": ["dist", "src", "json-sequences"]
}The host can now auto-discover and load sequences from this package without needing them to be copied to the host repository.
Events
Handlers publish standard Host SDK events (abbrev.):
canvas.component.create.requested— emitted on drop with component payload
Requirements
- Node 18+
- RenderX Host SDK
@renderx-plugins/host-sdk(declared as peer dep)
License
MIT
