Skip to main content

Add connections and history

Install edges and undo without expanding the core package.

Install both plugins when constructing the engine:

ts
import { connectionsPlugin } from '@lupinum/board-connections'
import { historyPlugin } from '@lupinum/board-history'

const engine = createBoardEngine({
  plugins: [connectionsPlugin(), historyPlugin()],
})

Render connections under the matching BoardRoot:

vue
<BoardRoot :engine="engine" style="height: 100vh">
  <BoardConnectionLayer />
</BoardRoot>

Create an edge through its installed API and undo through history:

ts
engine.plugins.connections.createEdge({ from: source.id, to: target.id })
engine.plugins.history.undo()

Plugin names must be unique. Construction throws BoardConflictError before installation when the tuple contains duplicate names.