bpmn-canvas 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Don Hussey
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,354 @@
1
- # Temporary Holding Version
1
+ # BPMN Canvas
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![CI](https://github.com/dphseven/bpmn-canvas/actions/workflows/ci.yml/badge.svg)](https://github.com/dphseven/bpmn-canvas/actions/workflows/ci.yml)
4
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
5
+ [![npm version](https://img.shields.io/npm/v/bpmn-canvas.svg)](https://www.npmjs.com/package/bpmn-canvas)
6
+ [![Tests](https://img.shields.io/badge/tests-143%20passed-brightgreen.svg)](https://github.com/dphseven/bpmn-canvas/actions)
7
+ [![Coverage](https://img.shields.io/badge/coverage-80%25-brightgreen.svg)](https://github.com/dphseven/bpmn-canvas)
8
+ [![Dependencies](https://img.shields.io/badge/dependencies-0-success.svg)](package.json)
9
+
10
+ > A lightweight, zero-dependency workflow canvas and diagram modeler inspired by BPMN 2.0, built with native DOM + SVG architecture.
11
+
12
+ ![BPMN Canvas Demo](./assets/demo.png)
13
+
14
+ ## Key Features
15
+
16
+ - **Zero-Dependency Native DOM + SVG Architecture**
17
+ Built entirely on standard browser APIs with zero runtime dependencies. Nodes render as native HTML elements for crisp typography and instant CSS styling, while connectors render as scalable SVG vector paths with high-DPI clarity
18
+
19
+ - **BPMN-Inspired Semantics Without the XML Bloat**
20
+ Model familiar BPMN concepts—activities, tasks, gateways, boundary event docking, and expandable subprocesses—without wrestling with rigid 5,000-line XML schemas. Diagrams serialize cleanly to and from predictable, human-readable JSON that stores directly in PostgreSQL JSONB, MongoDB, or REST APIs
21
+
22
+ - **Modular & Headless-Friendly by Design**
23
+ Architected on Single Responsibility Principles with decoupled subsystems (`BpmnCanvas`, `NodeTypeRegistry`, `Palette`, `Inspector`, `HistoryManager`, and `SelectionManager`). Embed the complete out-of-the-box studio, or mount just the canvas engine and control it from your own custom React, Vue, or Angular panels
24
+
25
+ - **Design System First (CSS Variable Theming)**
26
+ Every visual element is styled via standard CSS custom properties (`--bg-canvas`, `--border-focus`, `--accent-primary`, etc.). Seamlessly switch between dark mode, light mode, or custom enterprise palettes with zero canvas re-rendering
27
+
28
+ - **Reactive Event Bus & Transactional Commands**
29
+ Comprehensive, typed-like event catalog (`canvas.on()`, `once()`, `off()`) for fine-grained workflow telemetry. Full programmatic manipulation API (`updateNode`, `updateEdge`, `splitEdgeWithNode`) with atomic batching (`canvas.batch()`) to bundle compound operations into single undo/redo steps
30
+
31
+ - **Production-Grade Interaction Engine**
32
+ Includes smart Bezier and orthogonal Manhattan connector routing, boundary event snapping, automatic downstream node displacement on subprocess expansion, multi-node marquee selection, and animated token simulation for previewing execution paths
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ npm install bpmn-canvas
38
+ # or
39
+ pnpm add bpmn-canvas
40
+ # or
41
+ yarn add bpmn-canvas
42
+ ```
43
+
44
+ Include the companion stylesheets in your application entry point:
45
+
46
+ ```javascript
47
+ import 'bpmn-canvas/styles/ui.css';
48
+ import 'bpmn-canvas/styles/canvas.css';
49
+ import 'bpmn-canvas/styles/nodes.css';
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Quick Start
55
+
56
+ ### 1. HTML Container
57
+
58
+ Provide a styled container element where the canvas can mount:
59
+
60
+ ```html
61
+ <div id="canvas-container" style="width: 100vw; height: 100vh;"></div>
62
+ ```
63
+
64
+ ### 2. Instantiate and Build a Workflow
65
+
66
+ ```javascript
67
+ import { BpmnCanvas } from 'bpmn-canvas';
68
+
69
+ // Mount canvas to the DOM container
70
+ const container = document.getElementById('canvas-container');
71
+ const canvas = new BpmnCanvas(container, {
72
+ snapToGrid: true,
73
+ gridSize: 24,
74
+ defaultRouting: 'bezier' // or 'orthogonal'
75
+ });
76
+
77
+ // Add BPMN-inspired workflow nodes
78
+ const start = canvas.addNode({
79
+ type: 'start-event',
80
+ x: 100,
81
+ y: 150,
82
+ label: 'Order Placed'
83
+ });
84
+
85
+ const task = canvas.addNode({
86
+ type: 'user-task',
87
+ x: 260,
88
+ y: 130,
89
+ label: 'Review Order'
90
+ });
91
+
92
+ const end = canvas.addNode({
93
+ type: 'end-event',
94
+ x: 480,
95
+ y: 150,
96
+ label: 'Order Fulfilled'
97
+ });
98
+
99
+ // Connect with sequence flows
100
+ canvas.addEdge({ sourceId: start.id, targetId: task.id });
101
+ canvas.addEdge({ sourceId: task.id, targetId: end.id });
102
+ ```
103
+
104
+ ## Framework Integration
105
+
106
+ Because `bpmn-canvas` mounts directly onto any standard DOM element, it drops seamlessly into modern component lifecycles:
107
+
108
+ ### React
109
+
110
+ ```jsx
111
+ import { useEffect, useRef } from 'react';
112
+ import { BpmnCanvas } from 'bpmn-canvas';
113
+ import 'bpmn-canvas/styles/canvas.css';
114
+ import 'bpmn-canvas/styles/nodes.css';
115
+
116
+ export function WorkflowCanvas() {
117
+ const containerRef = useRef(null);
118
+ const canvasRef = useRef(null);
119
+
120
+ useEffect(() => {
121
+ if (containerRef.current && !canvasRef.current) {
122
+ canvasRef.current = new BpmnCanvas(containerRef.current, {
123
+ snapToGrid: true
124
+ });
125
+ }
126
+ }, []);
127
+
128
+ return <div ref={containerRef} style={{ width: '100%', height: '100vh' }} />;
129
+ }
130
+ ```
131
+
132
+ ### Vue 3
133
+
134
+ ```vue
135
+ <script setup>
136
+ import { ref, onMounted } from 'vue';
137
+ import { BpmnCanvas } from 'bpmn-canvas';
138
+ import 'bpmn-canvas/styles/canvas.css';
139
+ import 'bpmn-canvas/styles/nodes.css';
140
+
141
+ const containerRef = ref(null);
142
+ let canvas = null;
143
+
144
+ onMounted(() => {
145
+ canvas = new BpmnCanvas(containerRef.value, {
146
+ snapToGrid: true
147
+ });
148
+ });
149
+ </script>
150
+
151
+ <template>
152
+ <div ref="containerRef" style="width: 100%; height: 100vh;" />
153
+ </template>
154
+ ```
155
+
156
+ ### Svelte
157
+
158
+ ```svelte
159
+ <script>
160
+ import { onMount } from 'svelte';
161
+ import { BpmnCanvas } from 'bpmn-canvas';
162
+ import 'bpmn-canvas/styles/canvas.css';
163
+ import 'bpmn-canvas/styles/nodes.css';
164
+
165
+ let container;
166
+ let canvas;
167
+
168
+ onMount(() => {
169
+ canvas = new BpmnCanvas(container);
170
+ });
171
+ </script>
172
+
173
+ <div bind:this={container} style="width: 100%; height: 100vh;" />
174
+ ```
175
+
176
+ ## Core Concepts & Architecture
177
+
178
+ `bpmn-canvas` separates visual modeling concerns into focused, decoupled subsystems:
179
+
180
+ ```mermaid
181
+ flowchart TD
182
+ Canvas["BpmnCanvas<br/><b>(Viewport, Projections & Orchestration)</b>"]
183
+
184
+ Entities["Node & Edge Entities<br/><i>(DOM/SVG Render & Lifecycle)</i>"]
185
+ Registry["NodeTypeRegistry<br/><i>(Shape Catalog & Geometry)</i>"]
186
+ History["HistoryManager<br/><i>(Transactional Undo/Redo)</i>"]
187
+ Selection["SelectionManager<br/><i>(Marquee & Multi-Select)</i>"]
188
+ Panels["Palette & Inspector<br/><i>(Companion UI Panels)</i>"]
189
+
190
+ Canvas --> Entities
191
+ Canvas --> Registry
192
+ Canvas --> History
193
+ Canvas --> Selection
194
+ Canvas -.->|Events| Panels
195
+ ```
196
+
197
+ - **`BpmnCanvas`**: Core viewport engine. Manages DOM container lifecycle, zoom/pan transforms, coordinate mapping (`clientToCanvas`), connector rendering, and user capabilities (e.g. `readOnly`, `allowDrag`)
198
+ - **`Node` & `Edge` Entities**: Stateful graph primitives. Nodes manage DOM element rendering, port anchors, and boundary docking; Edges manage SVG path calculation, routing strategies (Bezier/orthogonal), and animated token simulation
199
+ - **`NodeTypeRegistry`**: The extensible element type catalog. Defines shape categories, icons, badges, SVG geometry, and default dimensions
200
+ - **`HistoryManager`**: Transactional undo/redo engine. Captures debounced property modifications and atomic compound operations executed via `canvas.batch()`
201
+ - **`SelectionManager`**: Encapsulates single-selection, multi-select modifier clicks, and background marquee box sweeps
202
+ - **`Palette` & `Inspector`**: Standalone companion UI panels that communicate with the canvas via standard event bus subscriptions
203
+
204
+ ---
205
+
206
+ ### Custom Node Type Extension
207
+
208
+ You can register custom domain shapes with custom icons, badges, and default dimensions directly into the registry:
209
+
210
+ ```javascript
211
+ import { NodeTypeRegistry } from 'bpmn-canvas';
212
+
213
+ const registry = new NodeTypeRegistry();
214
+
215
+ registry.register('ai-agent-task', {
216
+ label: 'AI Agent Task',
217
+ category: 'activities',
218
+ badge: 'AI Agent',
219
+ icon: '🤖',
220
+ width: 130,
221
+ height: 80,
222
+ ports: ['top', 'bottom', 'left', 'right']
223
+ });
224
+
225
+ // Pass custom or shared registry to your canvas instance
226
+ const canvas = new BpmnCanvas(container, { registry });
227
+ ```
228
+
229
+ ---
230
+
231
+ ### Event System
232
+
233
+ The canvas and companion panels provide a unified, typed-like event bus with automatic teardown functions:
234
+
235
+ ```javascript
236
+ // Subscribe to any canvas event
237
+ const unsub = canvas.on('node:add', (node) => {
238
+ console.log('Added node:', node.id, node.type);
239
+ });
240
+
241
+ // One-time listener
242
+ canvas.once('simulation:start', () => {
243
+ console.log('Token animation commenced');
244
+ });
245
+
246
+ // Clean up when component unmounts
247
+ unsub();
248
+ ```
249
+
250
+ #### Event Catalog
251
+
252
+ | Event Name | Description | Payload |
253
+ | :-------------------------- | :------------------------------------------------------- | :---------------------------------------------------------------------------------- |
254
+ | `node:add` | Fired when a node is added | `BpmnNode` |
255
+ | `node:remove` | Fired when a node is removed | `nodeId` |
256
+ | `node:update` | Fired when node properties, label, or position change | `BpmnNode` |
257
+ | `node:labelChange` | Fired when node label text is committed | `{ node, label }` |
258
+ | `edge:add` | Fired when an edge is added | `BpmnEdge` |
259
+ | `edge:remove` | Fired when an edge is removed | `edgeId` |
260
+ | `edge:update` | Fired when edge properties or routing change | `BpmnEdge` |
261
+ | `edge:reconnect` | Fired when an edge is reconnected to new endpoints | `{ edge, updates }` |
262
+ | `edge:split` | Fired when an edge is split by a dropped node | `{ edgeId, nodeId, edge1, edge2 }` |
263
+ | `selection:change` | Fired when selection state changes | `{ type: 'node'\|'edge'\|'multi'\|'none', item?, items? }` |
264
+ | `palette:dragstart` | Fired when user starts dragging an item from the palette | `{ type, element, grabOffsetX, grabOffsetY, event }` |
265
+ | `palette:drop` | Fired when an item from the palette is dropped on canvas | `{ type, node, position, isBoundary, splitEdgeId?, parentId?, hostNodeId?, event }` |
266
+ | `palette:filterChange` | Fired when palette filters are modified | `{ filter }` |
267
+ | `palette:itemRegister` | Fired when a custom item is registered on palette | `{ category, itemDef }` |
268
+ | `history:change` | Fired on undo/redo availability change | `{ canUndo, canRedo }` |
269
+ | `viewport:change` | Fired on zoom or pan adjustments | `{ zoom, panX, panY }` |
270
+ | `batch:complete` | Fired when an atomic batch operation completes | `{ preBatchState, postBatchState }` |
271
+ | `simulation:start` / `stop` | Fired when token simulation begins or ends | `void` |
272
+
273
+ ---
274
+
275
+ ## Programmatic Command API
276
+
277
+ External systems and headless integrations can fully inspect and manipulate the workflow graph programmatically:
278
+
279
+ ```javascript
280
+ import { BpmnCanvas } from 'bpmn-canvas';
281
+
282
+ const canvas = new BpmnCanvas(document.getElementById('canvas-container'));
283
+
284
+ // 1. Transactional Batch Execution (Single Undo Step)
285
+ canvas.batch(() => {
286
+ const start = canvas.addNode({ type: 'start-event', x: 100, y: 150 });
287
+ const task = canvas.addNode({ type: 'user-task', x: 260, y: 135, label: 'Review Order' });
288
+ const edge = canvas.addEdge({ sourceId: start.id, targetId: task.id });
289
+ });
290
+
291
+ // 2. Granular Updates & Queries
292
+ const node = canvas.getNode('some-node-id');
293
+ canvas.updateNode('some-node-id', { label: 'Updated Label', x: 300 });
294
+ canvas.updateEdge('some-edge-id', { animated: true });
295
+ canvas.removeNode('some-node-id');
296
+ canvas.removeEdge('some-edge-id');
297
+
298
+ // 3. Diagram Serialization
299
+ const workflowJson = canvas.exportToJson();
300
+ canvas.importFromJson(workflowJson);
301
+ ```
302
+
303
+ ---
304
+
305
+ ## Keyboard Shortcuts & Controls
306
+
307
+ | Shortcut / Gesture | Action |
308
+ | :---------------------------------------------- | :---------------------------------------------- |
309
+ | **Click + Drag (Node)** | Move selected node(s) with snap-to-grid |
310
+ | **Space + Click Drag** or **Middle-Click Drag** | Pan canvas viewport |
311
+ | **Mouse Wheel** | Zoom in / Zoom out centered on cursor position |
312
+ | **Click + Drag (Canvas Background)** | Draw rectangular marquee multi-selection box |
313
+ | **Shift + Click** | Add / remove node from multi-selection |
314
+ | **Double Click (Node / Edge)** | Enter inline label editing mode |
315
+ | **Delete** / **Backspace** | Delete currently selected node(s) or edge |
316
+ | **Ctrl + Z** / **Cmd + Z** | Undo previous canvas action |
317
+ | **Ctrl + Y** / **Cmd + Shift + Z** | Redo previous undone canvas action |
318
+ | **Ctrl + A** / **Cmd + A** | Select all nodes and edges |
319
+ | **Escape** | Clear active selection or dismiss inline editor |
320
+
321
+ ---
322
+
323
+ ## Contributing
324
+
325
+ We welcome contributions, bug reports, and enhancements!
326
+
327
+ ### Local Development Setup
328
+
329
+ ```bash
330
+ # Clone the repository
331
+ git clone https://github.com/dphseven/bpmn-canvas.git
332
+ cd bpmn-canvas
333
+
334
+ # Install dependencies
335
+ npm install
336
+
337
+ # Run the test suite
338
+ npm test
339
+
340
+ # Run tests in watch mode
341
+ npm run test:watch
342
+
343
+ # Check test coverage (enforcing >= 80% coverage)
344
+ npx vitest run --coverage
345
+ ```
346
+
347
+ ### License
348
+ This project is licensed under the [Apache License, Version 2.0](LICENSE).
349
+
350
+ ### Acknowledgements
351
+ - **[OMG (Object Management Group)](https://www.omg.org/bpmn/)**: For the BPMN 2.0 (Business Process Model and Notation) standard and visual specification that guides the shapes, semantics, and connection rules in this library
352
+ - **[bpmn.io / bpmn-js (Camunda)](https://bpmn.io/)**: For pioneering modern, open-source web-based BPMN modeling and setting the benchmark for browser diagramming ergonomics
353
+ - **Modern Canvas & Node Graph Pioneers**: Architectural patterns and interaction models inspired by modern visual node graphs such as [React Flow / xyflow](https://reactflow.dev/) and [LiteGraph](https://github.com/jagenjo/litegraph.js)
354
+ - **Google Fonts**: For the clean UI typography powered by [Inter](https://fonts.google.com/specimen/Inter)
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "bpmn-canvas",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "A lightweight, zero-dependency workflow canvas and diagram modeler inspired by BPMN 2.0, built with native DOM + SVG architecture.",
5
+ "type": "module",
6
+ "main": "./src/index.js",
7
+ "module": "./src/index.js",
8
+ "exports": {
9
+ ".": "./src/index.js",
10
+ "./styles/*": "./src/styles/*",
11
+ "./package.json": "./package.json"
12
+ },
13
+ "files": [
14
+ "src",
15
+ "LICENSE",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "test": "vitest run",
20
+ "test:watch": "vitest",
21
+ "coverage": "vitest run --coverage"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/dphseven/bpmn-canvas.git"
26
+ },
27
+ "keywords": [
28
+ "bpmn",
29
+ "bpmn-canvas",
30
+ "workflow",
31
+ "workflow-canvas",
32
+ "diagram",
33
+ "diagramming",
34
+ "graph",
35
+ "flowchart",
36
+ "process-modeling",
37
+ "svg",
38
+ "zero-dependencies"
39
+ ],
40
+ "author": "Don Hussey",
41
+ "license": "Apache-2.0",
42
+ "bugs": {
43
+ "url": "https://github.com/dphseven/bpmn-canvas/issues"
44
+ },
45
+ "homepage": "https://github.com/dphseven/bpmn-canvas#readme",
46
+ "devDependencies": {
47
+ "@vitest/coverage-v8": "^5.0.5",
48
+ "jsdom": "^29.1.1",
49
+ "vitest": "^5.0.5"
50
+ }
51
+ }
52
+