@miragon/dmn-modeler 0.7.0 → 0.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.0](https://github.com/Miragon/bpmn-modeler/compare/dmn-modeler-v0.8.0...dmn-modeler-v0.9.0) (2026-11-12)
4
+
5
+
6
+ ### 🎉 New Features
7
+
8
+ * **bpmn-modeler:** keep hidden element templates out of new choices ([#2301](https://github.com/Miragon/bpmn-modeler/issues/2301)) [sync 2d6033d] ([e40e3c8](https://github.com/Miragon/bpmn-modeler/commit/e40e3c8bfaa5f74c88a80882d01e5f68c50d0541))
9
+ * **dmn-diff:** show DMN changes in a visual diff of DRD and decision tables ([#2359](https://github.com/Miragon/bpmn-modeler/issues/2359)) ([e66b46d](https://github.com/Miragon/bpmn-modeler/commit/e66b46d056f5c72b87a81152182a695249dc9937))
10
+ * fit the diagram to the view from a canvas button ([#2343](https://github.com/Miragon/bpmn-modeler/issues/2343)) ([00da896](https://github.com/Miragon/bpmn-modeler/commit/00da8960e5bbdf0cf0c5fd9c8518ff3495aa5775))
11
+ * **modeler-core:** list element templates and marketplaces in the add-on catalog ([#2296](https://github.com/Miragon/bpmn-modeler/issues/2296)) [sync d7dd275] ([4eab152](https://github.com/Miragon/bpmn-modeler/commit/4eab1525a247dd18626a3de5ee6d9a98783e86bf))
12
+ * replace the canvas focus reticle with a focus ring ([#2342](https://github.com/Miragon/bpmn-modeler/issues/2342)) ([3f64891](https://github.com/Miragon/bpmn-modeler/commit/3f648910c76288ec018eaa25a2d9743ca7b33f42))
13
+ * show the canvas keyboard focus as a dot on the fit button ([#2362](https://github.com/Miragon/bpmn-modeler/issues/2362)) ([0f56772](https://github.com/Miragon/bpmn-modeler/commit/0f567728f53e88561a6d28de68d18207ff94a9d3))
14
+
15
+
16
+ ### 📔 Documentation
17
+
18
+ * rewrite READMEs for users, move package reference to the docs ([#2331](https://github.com/Miragon/bpmn-modeler/issues/2331)) ([6177741](https://github.com/Miragon/bpmn-modeler/commit/6177741ca798c7c86da068cabb1e4802cb187e6a))
19
+
20
+
21
+ ### 🛠️ Misc
22
+
23
+ * **deps:** bump the bpmn-io group except @bpmn-io/properties-panel ([#2123](https://github.com/Miragon/bpmn-modeler/issues/2123)) ([4a03893](https://github.com/Miragon/bpmn-modeler/commit/4a0389337341a562ed9e2b366df1e175c7adf5cb))
24
+ * **deps:** bump the npm-minor-patch group across 1 directory with 24 updates ([#2334](https://github.com/Miragon/bpmn-modeler/issues/2334)) ([0f3f59d](https://github.com/Miragon/bpmn-modeler/commit/0f3f59db46031a56defb0a48e839c50de4f17a00))
25
+
26
+ ## [0.8.0](https://github.com/Miragon/bpmn-modeler/compare/dmn-modeler-v0.7.0...dmn-modeler-v0.8.0) (2026-11-09)
27
+
28
+
29
+ ### 🎉 New Features
30
+
31
+ * **modeler-core:** load approved workspace bpmn-js plugins in VS Code ([#2251](https://github.com/Miragon/bpmn-modeler/issues/2251)) [sync 5457858] ([7107b52](https://github.com/Miragon/bpmn-modeler/commit/7107b529e1d4d7f23f584420b315d2b4c38cfd35))
32
+
3
33
  ## [0.7.0](https://github.com/Miragon/bpmn-modeler/compare/dmn-modeler-v0.6.0...dmn-modeler-v0.7.0) (2026-11-08)
4
34
 
5
35
 
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # @miragon/dmn-modeler
2
2
 
3
- A host-free, embeddable DMN modeler, built on
4
- [dmn-js](https://github.com/bpmn-io/dmn-js). One `createModeler(container,
5
- options)` call stands up an independent modeler — decision requirements diagram, decision tables,
6
- literal expressions, a properties panel, and our own simulation module.
3
+ [![npm](https://img.shields.io/npm/v/@miragon/dmn-modeler)](https://www.npmjs.com/package/@miragon/dmn-modeler)
4
+ [![License: Apache 2.0](https://img.shields.io/github/license/Miragon/bpmn-modeler)](https://github.com/Miragon/bpmn-modeler/blob/main/LICENSE)
7
5
 
8
- This page is for developers who embed the modeler in their own application. To model DMN yourself,
9
- use one of the hosts built on it: [VS Code](https://marketplace.visualstudio.com/items?itemName=miragon-gmbh.vs-code-bpmn-modeler),
10
- the [desktop app](https://miragon.github.io/bpmn-modeler/download) or, experimental,
11
- [Orca](https://miragon.github.io/bpmn-modeler/orca/getting-started).
6
+ **Put a DMN modeler with decision simulation into your own web app with one call.**
7
+
8
+ `@miragon/dmn-modeler` is the DMN modeler behind the Miragon BPMN Modeler for VS Code, the desktop app and Orca, built on [dmn-js](https://github.com/bpmn-io/dmn-js). To model DMN yourself instead, install one of those [editors](https://github.com/Miragon/bpmn-modeler#install).
9
+
10
+ ## What you get
11
+
12
+ - **One call, a full modeler.** `createModeler(container, options)` brings the decision requirements diagram, decision tables, literal expressions and a properties panel.
13
+ - **Decisions you can try.** A simulation module evaluates a decision table in place.
14
+ - **Light and dark per instance.** One stylesheet holds both looks, and the theme follows `prefers-color-scheme` unless you pin it.
15
+ - **12 languages.** Set the locale up front or switch it live with `setLocale`; it applies to the whole page.
12
16
 
13
17
  ## Install
14
18
 
@@ -16,148 +20,37 @@ the [desktop app](https://miragon.github.io/bpmn-modeler/download) or, experimen
16
20
  npm install @miragon/dmn-modeler
17
21
  ```
18
22
 
19
- The dmn-js stack (`dmn-js`, `diagram-js`, `dmn-js-properties-panel`, …) ships as real
20
- `dependencies`, so a single install pulls everything the modeler needs.
23
+ The dmn-js stack ships as regular dependencies, so this one install is all you need. With Yarn 2 or later and the `node-modules` linker, pin `diagram-js` as the [caveats](https://miragon.github.io/bpmn-modeler/embed/dmn-modeler#caveats) describe.
21
24
 
22
- ## Usage
25
+ ## Get started
23
26
 
24
27
  ```ts
25
28
  import { createModeler } from "@miragon/dmn-modeler";
26
- // The stock dmn-js component styles (needed to render at all):
27
29
  import "@miragon/dmn-modeler/styles.css";
28
30
 
29
- const canvas = document.querySelector( "#canvas" )!;
30
- const panel = document.querySelector( "#properties" )!;
31
-
32
- const modeler = await createModeler( canvas, {
33
- propertiesPanel: { parent: panel },
34
- } );
31
+ const modeler = await createModeler(document.querySelector("#canvas")!, {
32
+ propertiesPanel: { parent: document.querySelector("#properties")! },
33
+ });
35
34
 
36
- await modeler.loadDiagram( existingDmnXml );
35
+ const dmnXml = await (await fetch("decision.dmn")).text();
36
+ await modeler.loadDiagram(dmnXml);
37
37
  const xml = await modeler.exportDiagram();
38
38
  ```
39
39
 
40
- ## Theming
40
+ `propertiesPanel` is required, and `#canvas` needs a height; there is no empty starter diagram, so load existing DMN XML. The [reference](https://miragon.github.io/bpmn-modeler/embed/dmn-modeler) covers theming, locale, views, the escape hatch and caveats.
41
41
 
42
- Theming is **per-instance** and needs no extra `<link>`: importing
43
- `@miragon/dmn-modeler/styles.css` (above) already ships both looks. The modeler toggles a
44
- `data-dmn-theme="light" | "dark"` attribute on its container and properties-panel parent, and the
45
- dark rules are scoped under
46
- `[data-dmn-theme="dark"]`, so two modelers on one page can hold different themes.
47
- `theme` defaults to `"automatic"` (follows `prefers-color-scheme` live); pass
48
- `theme: "light"` / `"dark"` to pin one, or call `modeler.setTheme(...)` later.
49
-
50
- ```ts
51
- const modeler = await createModeler( canvas, {
52
- propertiesPanel: { parent: panel },
53
- theme: "automatic", // "automatic" (default) | "light" | "dark"
54
- } );
55
- ```
42
+ ## Help and feedback
56
43
 
57
- **Legacy `#theme-link` fallback.** If you still link a theme stylesheet tagged
58
- `id="theme-link"`, the modeler keeps swapping its href between
59
- `@miragon/dmn-modeler/light-theme.css` and `.../dark-theme.css` as before — a permanent, page-global
60
- compatibility path. It is optional; a missing
61
- `#theme-link` is a silent no-op. Because it is page-global, it cannot express per-instance themes —
62
- prefer the attribute mechanism (i.e. just `styles.css`).
44
+ - **Documentation:** the [`@miragon/dmn-modeler` reference](https://miragon.github.io/bpmn-modeler/embed/dmn-modeler).
45
+ - **Bugs and ideas:** [open an issue](https://github.com/Miragon/bpmn-modeler/issues).
46
+ - **Changes:** see the [changelog](https://github.com/Miragon/bpmn-modeler/blob/main/packages/dmn-modeler/CHANGELOG.md).
63
47
 
64
- > Caveat: setting `data-dmn-theme` on a page **root** element (`<html>`) themes
65
- > everything below it. Mixing that with two instances that hold _different_
66
- > per-instance themes would let the root value leak; a single-instance page or
67
- > one that never sets the root attribute is unaffected.
68
-
69
- ## Locale
70
-
71
- The dmn-js UI is translated through the shared
72
- [`@miragon/bpmn-modeler-i18n`](https://www.npmjs.com/package/@miragon/bpmn-modeler-i18n)
73
- dictionaries. Pass an initial `locale` to `createModeler`, or switch it live with
74
- `setLocale(...)`:
75
-
76
- ```ts
77
- const modeler = await createModeler( canvas, {
78
- propertiesPanel: { parent: panel },
79
- locale: "de", // any locale the shared library ships; unknown codes fall back to "en"
80
- } );
81
-
82
- await modeler.setLocale( "en" ); // re-translate live
83
- ```
48
+ ## Contributing
84
49
 
85
- The locale is **page-global** — the i18n instance is a singleton, so `locale` /
86
- `setLocale` set the language for every modeler on the page (there is no per-instance locale).
87
- Switching a running modeler re-opens its active view so the already rendered labels re-translate;
88
- that resets the view's undo history and re-fires `onViewChanged` (the DRD viewbox is preserved).
89
- `setLocale` is a no-op when the resolved locale is unchanged.
90
-
91
- ## Views
92
-
93
- A loaded document exposes its views (`getViews`), the active view (`getActiveView`), and lets you
94
- switch between them (`openView`). Each view is a DRD, decision table, literal expression, or boxed
95
- expression editor.
96
-
97
- ```ts
98
- const views = modeler.getViews();
99
- await modeler.openView( views.find( ( v ) => v.type === "decisionTable" )! );
100
- ```
101
-
102
- ## Escape hatch
103
-
104
- `modeler.getService(name)` reaches into the **active** dmn-js viewer's dependency-injection graph by
105
- service name. The names and returned shapes are **not** covered by this facade's API and may change
106
- without a major bump — prefer a typed option or method where one exists.
107
-
108
- ```ts
109
- const eventBus = modeler.getService( "eventBus" );
110
- ```
111
-
112
- ## Caveats
113
-
114
- - **bpmn.io watermark.** dmn-js renders the bpmn.io logo. Per the bpmn.io license you must keep it
115
- visible unless you hold a commercial
116
- [bpmn.io license](https://bpmn.io/license/). Do not hide it in CSS.
117
- - **Locale is page-global** in this release (the i18n instance is a singleton); theming is
118
- per-instance via the `data-dmn-theme` attribute (see
119
- [Theming](#theming)).
120
- - **Yarn Berry installs.** This package pins `diagram-js` exactly, but the dmn-js packages
121
- declare it with caret ranges. Yarn 2+ resolves each range to the newest matching version, so
122
- once diagram-js publishes a release newer than this package's pin, a second copy is nested
123
- under dmn-js and the modeler splits across two versions. npm and pnpm reuse the pinned
124
- version. With Yarn, pin it in your root `package.json` to the version that
125
- `node_modules/@miragon/dmn-modeler/package.json` declares, and update it whenever you upgrade
126
- `@miragon/dmn-modeler`:
127
-
128
- ```json
129
- {
130
- "resolutions": {
131
- "diagram-js": "<pin from @miragon/dmn-modeler>"
132
- }
133
- }
134
- ```
135
-
136
- - **Bundler dedupe.** The modeler and its plugins must share single copies of
137
- `inferno` and the properties-panel / CodeMirror stack. If you build with Vite, add these to
138
- `resolve.dedupe`:
139
-
140
- ```ts
141
- resolve: {
142
- dedupe: [
143
- "inferno",
144
- "@bpmn-io/properties-panel",
145
- "@codemirror/state",
146
- "@codemirror/view",
147
- "@codemirror/language",
148
- "@codemirror/autocomplete",
149
- "@codemirror/commands",
150
- "@codemirror/lint",
151
- "@codemirror/search",
152
- "@lezer/common",
153
- "@lezer/highlight",
154
- "@lezer/lr",
155
- ],
156
- }
157
- ```
50
+ How to build, test and change the package is in [CONTRIBUTING.md](https://github.com/Miragon/bpmn-modeler/blob/main/CONTRIBUTING.md).
158
51
 
159
52
  ## License
160
53
 
161
- Apache-2.0 — see [`LICENSE`](./LICENSE). This package depends on third-party software (dmn-js,
162
- diagram-js, dmn-js-properties-panel and the bpmn.io ecosystem, and others); their respective
163
- licenses and the bpmn.io watermark requirement continue to apply to your usage.
54
+ [Apache License 2.0](https://github.com/Miragon/bpmn-modeler/blob/main/packages/dmn-modeler/LICENSE). Made by [Miragon](https://www.miragon.io).
55
+
56
+ The package depends on third-party software (dmn-js, diagram-js, dmn-js-properties-panel and the bpmn.io ecosystem); their licenses apply, and dmn-js renders the bpmn.io watermark, which you must keep visible unless you hold a commercial [bpmn.io license](https://bpmn.io/license/).