@oh-just-another/diagram-angular 0.2.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 +18 -0
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/dist/Diagram.d.ts +50 -0
- package/dist/Diagram.d.ts.map +1 -0
- package/dist/Diagram.js +127 -0
- package/dist/Diagram.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# @oh-just-another/diagram-angular
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ddb2fcb: First published release — Angular standalone `<oja-diagram-ng>` component wrapping the `<oja-diagram>` custom element.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [783749e]
|
|
12
|
+
- Updated dependencies [c189261]
|
|
13
|
+
- Updated dependencies [c189261]
|
|
14
|
+
- Updated dependencies [bdc847e]
|
|
15
|
+
- Updated dependencies [a9558d9]
|
|
16
|
+
- Updated dependencies [cf8b735]
|
|
17
|
+
- @oh-just-another/scene@0.60.0
|
|
18
|
+
- @oh-just-another/diagram@0.1.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rustam Garifulin
|
|
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
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @oh-just-another/diagram-angular
|
|
2
|
+
|
|
3
|
+
Angular wrapper for the diagram editor — a thin standalone `<oja-diagram-ng>` component over the framework-neutral [`<oja-diagram>`](../diagram) custom element. The editor (canvas, WASM text shaping, workers, React internals) is bundled inside the custom element; this package just maps Angular inputs / outputs to it.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @oh-just-another/diagram-angular
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`@angular/core` (>= 17) is a peer dependency.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { Component, viewChild } from "@angular/core";
|
|
17
|
+
import { DiagramComponent } from "@oh-just-another/diagram-angular";
|
|
18
|
+
import type { Scene } from "@oh-just-another/scene";
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: "app-canvas",
|
|
22
|
+
standalone: true,
|
|
23
|
+
imports: [DiagramComponent],
|
|
24
|
+
template: `
|
|
25
|
+
<oja-diagram-ng
|
|
26
|
+
[scene]="scene"
|
|
27
|
+
theme="system"
|
|
28
|
+
[grid]="true"
|
|
29
|
+
[snap]="true"
|
|
30
|
+
(scenechange)="scene = $event"
|
|
31
|
+
(ready)="onReady($event)"
|
|
32
|
+
/>
|
|
33
|
+
`,
|
|
34
|
+
})
|
|
35
|
+
export class CanvasComponent {
|
|
36
|
+
scene?: Scene;
|
|
37
|
+
diagram = viewChild.required(DiagramComponent);
|
|
38
|
+
|
|
39
|
+
onReady({ editor }: { editor: unknown }) {
|
|
40
|
+
console.log("editor ready", editor);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The component fills its parent — give the parent a height.
|
|
46
|
+
|
|
47
|
+
## Inputs
|
|
48
|
+
|
|
49
|
+
| Input | Type | Notes |
|
|
50
|
+
| ---------- | --------------------------------------- | ------------------------------------ |
|
|
51
|
+
| `scene` | `Scene` | Initial / current scene. |
|
|
52
|
+
| `theme` | `"dark" \| "light" \| "system"` | Defaults to following the OS. |
|
|
53
|
+
| `renderer` | `"canvas2d" \| "webgl2" \| "offscreen"` | Backend; auto-detected when omitted. |
|
|
54
|
+
| `grid` | `boolean` | Show the background grid. |
|
|
55
|
+
| `snap` | `boolean` | Snap dragged shapes to the grid. |
|
|
56
|
+
|
|
57
|
+
## Outputs
|
|
58
|
+
|
|
59
|
+
`(ready)` (`{ editor }`), `(scenechange)` (`Scene`), `(selectionchange)` (`ElementId[]`), `(themechange)` (`"dark" | "light" | "system"`).
|
|
60
|
+
|
|
61
|
+
## Imperative API
|
|
62
|
+
|
|
63
|
+
On the component instance (template reference variable or `viewChild`): `getScene`, `loadScene`, `undo`, `redo`, `zoomToFit`, `getMode`, `setMode`, `getSelection`, `setSelection`.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EventEmitter, type AfterViewInit, type OnChanges, type OnDestroy } from "@angular/core";
|
|
2
|
+
import "@oh-just-another/diagram";
|
|
3
|
+
import { type DiagramRenderer, type DiagramTheme, type OjaDiagramController } from "@oh-just-another/diagram";
|
|
4
|
+
import type { Scene } from "@oh-just-another/scene";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* `<oja-diagram-ng>` — a thin Angular standalone component over the
|
|
8
|
+
* `<oja-diagram>` custom element. Inputs map one-to-one to the element's
|
|
9
|
+
* configuration; the four element events re-emit as Angular outputs
|
|
10
|
+
* (`(ready)`, `(scenechange)`, `(selectionchange)`, `(themechange)`). The
|
|
11
|
+
* element is driven imperatively rather than through the template so
|
|
12
|
+
* custom-element property-vs-attribute quirks never bite, and the binding
|
|
13
|
+
* logic itself lives once in `@oh-just-another/diagram`.
|
|
14
|
+
*
|
|
15
|
+
* Imperative control (`undo`, `loadScene`, …) is reachable through the
|
|
16
|
+
* component instance (template reference variable or `viewChild`) — it
|
|
17
|
+
* implements the curated {@link OjaDiagramController} surface.
|
|
18
|
+
*/
|
|
19
|
+
export declare class DiagramComponent implements AfterViewInit, OnChanges, OnDestroy, OjaDiagramController {
|
|
20
|
+
scene?: Scene;
|
|
21
|
+
theme?: DiagramTheme;
|
|
22
|
+
renderer?: DiagramRenderer;
|
|
23
|
+
grid: boolean;
|
|
24
|
+
snap: boolean;
|
|
25
|
+
readonly ready: EventEmitter<{
|
|
26
|
+
readonly editor: import("@oh-just-another/editor").EditorAPI["editor"];
|
|
27
|
+
}>;
|
|
28
|
+
readonly scenechange: EventEmitter<Scene>;
|
|
29
|
+
readonly selectionchange: EventEmitter<readonly import("@oh-just-another/types").ElementId[]>;
|
|
30
|
+
readonly themechange: EventEmitter<DiagramTheme>;
|
|
31
|
+
private readonly elRef?;
|
|
32
|
+
private unbind;
|
|
33
|
+
private readonly controller;
|
|
34
|
+
ngAfterViewInit(): void;
|
|
35
|
+
ngOnChanges(): void;
|
|
36
|
+
ngOnDestroy(): void;
|
|
37
|
+
private sync;
|
|
38
|
+
getScene(): Scene | undefined;
|
|
39
|
+
loadScene(scene: Scene): void;
|
|
40
|
+
undo(): void;
|
|
41
|
+
redo(): void;
|
|
42
|
+
zoomToFit(): void;
|
|
43
|
+
getMode(): ReturnType<OjaDiagramController["getMode"]>;
|
|
44
|
+
setMode(mode: Parameters<OjaDiagramController["setMode"]>[0]): void;
|
|
45
|
+
getSelection(): ReturnType<OjaDiagramController["getSelection"]>;
|
|
46
|
+
setSelection(ids: Parameters<OjaDiagramController["setSelection"]>[0]): void;
|
|
47
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DiagramComponent, never>;
|
|
48
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DiagramComponent, "oja-diagram-ng", never, { "scene": { "alias": "scene"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "renderer": { "alias": "renderer"; "required": false; }; "grid": { "alias": "grid"; "required": false; }; "snap": { "alias": "snap"; "required": false; }; }, { "ready": "ready"; "scenechange": "scenechange"; "selectionchange": "selectionchange"; "themechange": "themechange"; }, never, never, true, never>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=Diagram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Diagram.d.ts","sourceRoot":"","sources":["../src/Diagram.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAIZ,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AAGvB,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAG1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;;AAEpD;;;;;;;;;;;;GAYG;AACH,qBAOa,gBAAiB,YAAW,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,oBAAoB;IACvF,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,IAAI,UAAS;IACb,IAAI,UAAS;IAEZ,QAAQ,CAAC,KAAK;;OAAmD;IACjE,QAAQ,CAAC,WAAW,sBAAyD;IAC7E,QAAQ,CAAC,eAAe,sEAA6D;IACrF,QAAQ,CAAC,WAAW,6BAAyD;IAGvF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAgC;IAEvD,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAEzB;IAEF,eAAe,IAAI,IAAI;IAqBvB,WAAW,IAAI,IAAI;IAInB,WAAW,IAAI,IAAI;IAKnB,OAAO,CAAC,IAAI;IAcZ,QAAQ,IAAI,KAAK,GAAG,SAAS;IAG7B,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAG7B,IAAI,IAAI,IAAI;IAGZ,IAAI,IAAI,IAAI;IAGZ,SAAS,IAAI,IAAI;IAGjB,OAAO,IAAI,UAAU,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAGtD,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAGnE,YAAY,IAAI,UAAU,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IAGhE,YAAY,CAAC,GAAG,EAAE,UAAU,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;yCAxFjE,gBAAgB;2CAAhB,gBAAgB;CA2F5B"}
|
package/dist/Diagram.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Component, CUSTOM_ELEMENTS_SCHEMA, EventEmitter, Input, Output, ViewChild, } from "@angular/core";
|
|
2
|
+
// Side effect: registers the <oja-diagram> custom element the moment this
|
|
3
|
+
// wrapper is imported, so the host never has to call `defineOjaDiagram`.
|
|
4
|
+
import "@oh-just-another/diagram";
|
|
5
|
+
import { applyOjaDiagramProps, bindOjaDiagramEvents, ojaDiagramController, } from "@oh-just-another/diagram";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* `<oja-diagram-ng>` — a thin Angular standalone component over the
|
|
9
|
+
* `<oja-diagram>` custom element. Inputs map one-to-one to the element's
|
|
10
|
+
* configuration; the four element events re-emit as Angular outputs
|
|
11
|
+
* (`(ready)`, `(scenechange)`, `(selectionchange)`, `(themechange)`). The
|
|
12
|
+
* element is driven imperatively rather than through the template so
|
|
13
|
+
* custom-element property-vs-attribute quirks never bite, and the binding
|
|
14
|
+
* logic itself lives once in `@oh-just-another/diagram`.
|
|
15
|
+
*
|
|
16
|
+
* Imperative control (`undo`, `loadScene`, …) is reachable through the
|
|
17
|
+
* component instance (template reference variable or `viewChild`) — it
|
|
18
|
+
* implements the curated {@link OjaDiagramController} surface.
|
|
19
|
+
*/
|
|
20
|
+
export class DiagramComponent {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.grid = false;
|
|
23
|
+
this.snap = false;
|
|
24
|
+
this.ready = new EventEmitter();
|
|
25
|
+
this.scenechange = new EventEmitter();
|
|
26
|
+
this.selectionchange = new EventEmitter();
|
|
27
|
+
this.themechange = new EventEmitter();
|
|
28
|
+
this.unbind = null;
|
|
29
|
+
this.controller = ojaDiagramController(() => this.elRef?.nativeElement ?? null);
|
|
30
|
+
}
|
|
31
|
+
ngAfterViewInit() {
|
|
32
|
+
const el = this.elRef?.nativeElement;
|
|
33
|
+
if (!el)
|
|
34
|
+
return;
|
|
35
|
+
this.sync();
|
|
36
|
+
this.unbind = bindOjaDiagramEvents(el, {
|
|
37
|
+
ready: (detail) => {
|
|
38
|
+
this.ready.emit(detail);
|
|
39
|
+
},
|
|
40
|
+
scenechange: (detail) => {
|
|
41
|
+
this.scenechange.emit(detail);
|
|
42
|
+
},
|
|
43
|
+
selectionchange: (detail) => {
|
|
44
|
+
this.selectionchange.emit(detail);
|
|
45
|
+
},
|
|
46
|
+
themechange: (detail) => {
|
|
47
|
+
this.themechange.emit(detail);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// One hook over every input — `applyOjaDiagramProps` is idempotent.
|
|
52
|
+
ngOnChanges() {
|
|
53
|
+
this.sync();
|
|
54
|
+
}
|
|
55
|
+
ngOnDestroy() {
|
|
56
|
+
this.unbind?.();
|
|
57
|
+
this.unbind = null;
|
|
58
|
+
}
|
|
59
|
+
sync() {
|
|
60
|
+
const el = this.elRef?.nativeElement;
|
|
61
|
+
if (!el)
|
|
62
|
+
return;
|
|
63
|
+
applyOjaDiagramProps(el, {
|
|
64
|
+
scene: this.scene,
|
|
65
|
+
theme: this.theme,
|
|
66
|
+
renderer: this.renderer,
|
|
67
|
+
grid: this.grid,
|
|
68
|
+
snap: this.snap,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// --- Imperative controller (pass-throughs to the element) ---
|
|
72
|
+
getScene() {
|
|
73
|
+
return this.controller.getScene();
|
|
74
|
+
}
|
|
75
|
+
loadScene(scene) {
|
|
76
|
+
this.controller.loadScene(scene);
|
|
77
|
+
}
|
|
78
|
+
undo() {
|
|
79
|
+
this.controller.undo();
|
|
80
|
+
}
|
|
81
|
+
redo() {
|
|
82
|
+
this.controller.redo();
|
|
83
|
+
}
|
|
84
|
+
zoomToFit() {
|
|
85
|
+
this.controller.zoomToFit();
|
|
86
|
+
}
|
|
87
|
+
getMode() {
|
|
88
|
+
return this.controller.getMode();
|
|
89
|
+
}
|
|
90
|
+
setMode(mode) {
|
|
91
|
+
this.controller.setMode(mode);
|
|
92
|
+
}
|
|
93
|
+
getSelection() {
|
|
94
|
+
return this.controller.getSelection();
|
|
95
|
+
}
|
|
96
|
+
setSelection(ids) {
|
|
97
|
+
this.controller.setSelection(ids);
|
|
98
|
+
}
|
|
99
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DiagramComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
100
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: DiagramComponent, isStandalone: true, selector: "oja-diagram-ng", inputs: { scene: "scene", theme: "theme", renderer: "renderer", grid: "grid", snap: "snap" }, outputs: { ready: "ready", scenechange: "scenechange", selectionchange: "selectionchange", themechange: "themechange" }, viewQueries: [{ propertyName: "elRef", first: true, predicate: ["el"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `<oja-diagram #el style="display:block;width:100%;height:100%"></oja-diagram>`, isInline: true, styles: [":host{display:block;width:100%;height:100%}"] }); }
|
|
101
|
+
}
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DiagramComponent, decorators: [{
|
|
103
|
+
type: Component,
|
|
104
|
+
args: [{ selector: "oja-diagram-ng", standalone: true, template: `<oja-diagram #el style="display:block;width:100%;height:100%"></oja-diagram>`, schemas: [CUSTOM_ELEMENTS_SCHEMA], styles: [":host{display:block;width:100%;height:100%}"] }]
|
|
105
|
+
}], propDecorators: { scene: [{
|
|
106
|
+
type: Input
|
|
107
|
+
}], theme: [{
|
|
108
|
+
type: Input
|
|
109
|
+
}], renderer: [{
|
|
110
|
+
type: Input
|
|
111
|
+
}], grid: [{
|
|
112
|
+
type: Input
|
|
113
|
+
}], snap: [{
|
|
114
|
+
type: Input
|
|
115
|
+
}], ready: [{
|
|
116
|
+
type: Output
|
|
117
|
+
}], scenechange: [{
|
|
118
|
+
type: Output
|
|
119
|
+
}], selectionchange: [{
|
|
120
|
+
type: Output
|
|
121
|
+
}], themechange: [{
|
|
122
|
+
type: Output
|
|
123
|
+
}], elRef: [{
|
|
124
|
+
type: ViewChild,
|
|
125
|
+
args: ["el", { static: true }]
|
|
126
|
+
}] } });
|
|
127
|
+
//# sourceMappingURL=Diagram.js.map
|
|
@@ -0,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AAC;IACD,OAAO,CAAC,IAAoD;QAC1D,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IACD,YAAY;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;IACxC,CAAC;IACD,YAAY,CAAC,GAAwD;QACnE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;+GA1FU,gBAAgB;mGAAhB,gBAAgB,iaAJjB,8EAA8E;;4FAI7E,gBAAgB;kBAP5B,SAAS;+BACE,gBAAgB,cACd,IAAI,YACN,8EAA8E,WAE/E,CAAC,sBAAsB,CAAC;;sBAGhC,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBAEL,MAAM;;sBACN,MAAM;;sBACN,MAAM;;sBACN,MAAM;;sBAEN,SAAS;uBAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,YAAY,EACV,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oh-just-another/diagram-angular",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Angular wrapper for the diagram editor — a thin standalone component over the <oja-diagram> custom element.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Rustam Garifulin <rustam@n69.in>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/oh-just-another/diagram.git",
|
|
10
|
+
"directory": "packages/diagram-angular"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/oh-just-another/diagram#readme",
|
|
13
|
+
"bugs": "https://github.com/oh-just-another/diagram/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"diagram",
|
|
16
|
+
"canvas",
|
|
17
|
+
"editor",
|
|
18
|
+
"angular"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"README.md",
|
|
33
|
+
"CHANGELOG.md"
|
|
34
|
+
],
|
|
35
|
+
"sideEffects": [
|
|
36
|
+
"./dist/Diagram.js"
|
|
37
|
+
],
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@angular/core": ">=17.0.0"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@oh-just-another/diagram": "0.1.1",
|
|
43
|
+
"@oh-just-another/scene": "0.60.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@angular/compiler": "20.3.25",
|
|
47
|
+
"@angular/compiler-cli": "20.3.25",
|
|
48
|
+
"@angular/core": "20.3.25",
|
|
49
|
+
"@angular/platform-browser": "20.3.25",
|
|
50
|
+
"jsdom": "25.0.1",
|
|
51
|
+
"rxjs": "7.8.2",
|
|
52
|
+
"vite": "6.4.3",
|
|
53
|
+
"zone.js": "0.15.1"
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "ngc -p tsconfig.build.json",
|
|
60
|
+
"typecheck": "tsc --noEmit",
|
|
61
|
+
"test": "vitest run",
|
|
62
|
+
"test:watch": "vitest",
|
|
63
|
+
"lint": "eslint src",
|
|
64
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
65
|
+
}
|
|
66
|
+
}
|