Skip to content

A bpmn-js extension to use the system clipboard for copy and paste

Notifications You must be signed in to change notification settings

nikku/bpmn-js-native-copy-paste

Repository files navigation

bpmn-js-native-copy-paste

CI

Copy and paste for bpmn-js implemented using the native operating system clipboard. As a result, copy and paste works across browser tabs, windows and applications that build on top of the web platform.

Features

  • copy and paste using the system clipboard
  • works between different BPMN modeler instances
  • works across browser windows
  • disables built-in clipboard
  • works in modern browsers

Usage

import NativeCopyPaste from 'bpmn-js-native-copy-paste';

const modeler = new BpmnModeler({
  additionalModules: [
    NativeCopyPasteModule
  ]
});

await modeler.importXML(require('./ticket-booking.bpmn'));

How it Works

It relies on the bpmn-js copy tree to be serializable to JSON. When re-creating the tree from JSON we use a reviver to re-construct the model types.

Build and Run

# install dependencies
npm install

# run development setup
npm run dev

Open multiple instances of the test site and copy/paste across.

License

MIT

❤️

About

A bpmn-js extension to use the system clipboard for copy and paste

Topics

Resources

Security policy

Stars

Watchers

Forks

Sponsor this project