JSPM

@bpmn-io/diagram-js-ui

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 65617
  • Score
    100M100P100Q241659F
  • License MIT

Package Exports

  • @bpmn-io/diagram-js-ui
  • @bpmn-io/diagram-js-ui/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bpmn-io/diagram-js-ui) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

diagram-js-ui

This library provides a building block for creating and rendering Preact components in the context of the bpmn.io tools without directly importing Preact.

Getting started

# install all dependencies
npm install

# lint and build the library 
npm run all

Usage

The module can be injected into other modules. It allows to render a Preact component and provides other utilities such as an html wrapper and preact hooks.

function CustomComponent(diagramJsUi) {
  const { useState } = diagramJsUi.getHoooks();
  const counter = useState(0);

  diagramJsUi.render(
    diagramJsUi.html`
      <div>Counter: ${counter}</div>
    `
  )
}

CustomComponent.$inject = [
  'diagramJsUi'
];

License

MIT