@wemake4u/dmn-drd 0.0.0-stage → 1.0.1

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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ivan Senatore
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,76 @@
1
- # Temporary Holding Version
1
+ # @wemake4u/dmn-drd
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
+ The DRD (Decision Requirements Diagram) components of the `@wemake4u` DMN editor, for Angular 22.
4
+ Most applications use the complete [`@wemake4u/dmn-editor`](https://www.npmjs.com/package/@wemake4u/dmn-editor);
5
+ this package is for building a different layout around the diagram.
6
+
7
+ - `DrdCanvas` (`dmn-drd-canvas`): SVG canvas with the DMN notation; selection and lasso, pan and
8
+ zoom, drag with grid snapping, connections checked against the DMN rules, orthogonal routing
9
+ with editable bends and docking sides, resize, context pad and menu, rename on the canvas,
10
+ validation badges, full keyboard use.
11
+ - `DrdPalette` (`dmn-drd-palette`), `DrdZoomControls` (`dmn-drd-zoom-controls`),
12
+ `DrdMinimap` (`dmn-drd-minimap`), `DrdPropertiesPanel` (`dmn-drd-properties-panel`).
13
+ - `DrdController`: the state they share (store, tool, selection, viewport, open editor,
14
+ validation issues).
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @wemake4u/dmn-drd @wemake4u/dmn-core
20
+ ```
21
+
22
+ Peer dependencies: `@angular/core` and `@angular/common` 22.2.x, and `@wemake4u/dmn-core` 1.x.
23
+
24
+ ## Usage
25
+
26
+ Provide one `DrdController` in the component that hosts the diagram and give it a store:
27
+
28
+ ```ts
29
+ import { Component, inject } from '@angular/core';
30
+ import { DmnStore } from '@wemake4u/dmn-core';
31
+ import {
32
+ DrdCanvas,
33
+ DrdController,
34
+ DrdMinimap,
35
+ DrdPalette,
36
+ DrdPropertiesPanel,
37
+ DrdZoomControls,
38
+ } from '@wemake4u/dmn-drd';
39
+
40
+ @Component({
41
+ selector: 'app-diagram',
42
+ imports: [DrdCanvas, DrdPalette, DrdZoomControls, DrdMinimap, DrdPropertiesPanel],
43
+ providers: [DrdController],
44
+ template: `
45
+ <dmn-drd-palette />
46
+ <div class="area">
47
+ <dmn-drd-canvas />
48
+ <dmn-drd-zoom-controls />
49
+ <dmn-drd-minimap />
50
+ </div>
51
+ <dmn-drd-properties-panel />
52
+ `,
53
+ })
54
+ export class Diagram {
55
+ private readonly controller = inject(DrdController);
56
+
57
+ async load(xml: string): Promise<void> {
58
+ this.controller.store.set(await DmnStore.open(xml));
59
+ }
60
+ }
61
+ ```
62
+
63
+ `controller.logicElementId()` is set when the user asks to open the logic of a decision, BKM or
64
+ decision service (Enter, double click in read-only mode, menu, properties panel): show the
65
+ editor of your choice, for example `ElementEditorShell` from
66
+ [`@wemake4u/dmn-boxed`](https://www.npmjs.com/package/@wemake4u/dmn-boxed).
67
+
68
+ The canvas follows the read-only mode of the store (`store.readOnly`): no palette tools,
69
+ handles, drag or editing keys.
70
+
71
+ The accent colors are CSS custom properties of the canvas: `--dmn-accent`,
72
+ `--dmn-accent-soft`, `--dmn-danger`, `--dmn-danger-soft`.
73
+
74
+ ## License
75
+
76
+ MIT. The licenses of the dependencies are in THIRD_PARTY_NOTICES.txt.
@@ -0,0 +1,17 @@
1
+ Third-Party Licenses for @wemake4u/dmn-drd
2
+ ==========================================
3
+
4
+ ==============================================================================
5
+ Dependencies (package.json)
6
+ ==============================================================================
7
+
8
+ Installed with the package, with its own license file.
9
+
10
+ tslib (0BSD License)
11
+ Copyright (c) Microsoft Corporation
12
+ https://github.com/Microsoft/tslib
13
+
14
+ Peer dependencies, installed by the application: @angular/core, @angular/common (MIT License,
15
+ Copyright (c) Google LLC); @wemake4u/dmn-core (MIT License, Copyright (c) Ivan Senatore).
16
+
17
+ The package includes no third-party code.