@steffolino/diagram-kit-element 0.1.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 +21 -0
- package/README.md +34 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +174 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Stefan Stretz
|
|
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,34 @@
|
|
|
1
|
+
# @steffolino/diagram-kit-element
|
|
2
|
+
|
|
3
|
+
`<diagram-kit-view>` — the framework-agnostic way to embed an interactive
|
|
4
|
+
diagram-kit graph. It's a real Custom Element (Web Component), so it works
|
|
5
|
+
with a plain `<script type="module">` import in React, Vue, Angular, or no
|
|
6
|
+
framework at all.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import '@steffolino/diagram-kit-element'
|
|
10
|
+
import { fromYaml } from '@steffolino/diagram-kit-adapters'
|
|
11
|
+
|
|
12
|
+
const graph = fromYaml(yamlSource)
|
|
13
|
+
const el = document.createElement('diagram-kit-view')
|
|
14
|
+
el.graph = graph
|
|
15
|
+
document.body.appendChild(el)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or declaratively, with the graph assigned from a script:
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<diagram-kit-view id="view" layout-mode="structural" mode="dark"></diagram-kit-view>
|
|
22
|
+
<script type="module">
|
|
23
|
+
import '@steffolino/diagram-kit-element'
|
|
24
|
+
document.getElementById('view').graph = myGraph
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Renders via `@steffolino/diagram-kit-static`'s `renderSvg` (no React dependency), and
|
|
29
|
+
supports the same `layout-mode`, `mode`, `preset`, `padding`,
|
|
30
|
+
`colorize-nodes`, `direction`, and `detail-placement` attributes as the
|
|
31
|
+
React `<DiagramView />`'s equivalent props.
|
|
32
|
+
|
|
33
|
+
Part of the diagram-kit monorepo. See the repo root README for the full
|
|
34
|
+
picture.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DiagramGraph, DiagramTheme } from '@steffolino/diagram-kit-core';
|
|
2
|
+
/**
|
|
3
|
+
* `<diagram-kit-view>` — the framework-agnostic way to embed an interactive
|
|
4
|
+
* diagram-kit graph: works with a plain <script type="module"> import in any
|
|
5
|
+
* app (React, Vue, Angular, or no framework at all), since it's just a DOM
|
|
6
|
+
* element once registered.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import '@steffolino/diagram-kit-element'
|
|
10
|
+
* const el = document.createElement('diagram-kit-view')
|
|
11
|
+
* el.graph = myGraph
|
|
12
|
+
* document.body.appendChild(el)
|
|
13
|
+
*
|
|
14
|
+
* Or declaratively, with the graph assigned from a script:
|
|
15
|
+
* <diagram-kit-view id="view" layout-mode="structural" mode="dark"></diagram-kit-view>
|
|
16
|
+
* <script type="module">
|
|
17
|
+
* document.getElementById('view').graph = myGraph
|
|
18
|
+
* </script>
|
|
19
|
+
*/
|
|
20
|
+
export declare class DiagramKitElement extends HTMLElement {
|
|
21
|
+
#private;
|
|
22
|
+
static get observedAttributes(): readonly string[];
|
|
23
|
+
constructor();
|
|
24
|
+
connectedCallback(): void;
|
|
25
|
+
attributeChangedCallback(): void;
|
|
26
|
+
get graph(): DiagramGraph | null;
|
|
27
|
+
set graph(value: DiagramGraph | null);
|
|
28
|
+
get theme(): DiagramTheme | null;
|
|
29
|
+
set theme(value: DiagramTheme | null);
|
|
30
|
+
}
|
|
31
|
+
/** Registers `<diagram-kit-view>` (or a custom tag name) as a Custom Element. Safe to call more than once. */
|
|
32
|
+
export declare function defineDiagramKitElement(tagName?: string): void;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAe,YAAY,EAAiB,MAAM,8BAA8B,CAAA;AA0C1G;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;;IAChD,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;;IAqCD,iBAAiB,IAAI,IAAI;IAIzB,wBAAwB,IAAI,IAAI;IAKhC,IAAI,KAAK,IAAI,YAAY,GAAG,IAAI,CAE/B;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,EAInC;IAED,IAAI,KAAK,IAAI,YAAY,GAAG,IAAI,CAE/B;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,EAGnC;CA6DF;AAED,8GAA8G;AAC9G,wBAAgB,uBAAuB,CAAC,OAAO,SAAqB,GAAG,IAAI,CAI1E"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { defaultTheme, themePresets } from '@steffolino/diagram-kit-core';
|
|
2
|
+
import { renderSvg } from '@steffolino/diagram-kit-static';
|
|
3
|
+
const OBSERVED_ATTRIBUTES = ['layout-mode', 'mode', 'preset', 'padding', 'colorize-nodes', 'direction', 'detail-placement'];
|
|
4
|
+
const STYLES = `
|
|
5
|
+
:host { display: block; position: relative; }
|
|
6
|
+
.dk-svg-wrap { width: 100%; height: 100%; overflow: auto; }
|
|
7
|
+
.dk-svg-wrap svg [data-node-id] { cursor: pointer; }
|
|
8
|
+
.dk-panel {
|
|
9
|
+
position: absolute;
|
|
10
|
+
top: 12px;
|
|
11
|
+
right: 12px;
|
|
12
|
+
max-width: 280px;
|
|
13
|
+
background: #fff;
|
|
14
|
+
border: 1px solid #DADCE0;
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
padding: 12px 30px 12px 14px;
|
|
17
|
+
font: 13px system-ui, sans-serif;
|
|
18
|
+
color: #1F2328;
|
|
19
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
.dk-panel.dk-panel-open { display: block; }
|
|
23
|
+
.dk-panel-close {
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 6px;
|
|
26
|
+
right: 8px;
|
|
27
|
+
border: none;
|
|
28
|
+
background: none;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
color: #5B6270;
|
|
32
|
+
padding: 0;
|
|
33
|
+
line-height: 1;
|
|
34
|
+
}
|
|
35
|
+
.dk-panel-title { font-weight: 600; margin: 0 0 4px; }
|
|
36
|
+
.dk-panel-category { font-size: 11px; color: #5B6270; margin: 0 0 6px; }
|
|
37
|
+
.dk-panel-detail { margin: 0; }
|
|
38
|
+
`;
|
|
39
|
+
/**
|
|
40
|
+
* `<diagram-kit-view>` — the framework-agnostic way to embed an interactive
|
|
41
|
+
* diagram-kit graph: works with a plain <script type="module"> import in any
|
|
42
|
+
* app (React, Vue, Angular, or no framework at all), since it's just a DOM
|
|
43
|
+
* element once registered.
|
|
44
|
+
*
|
|
45
|
+
* Usage:
|
|
46
|
+
* import '@steffolino/diagram-kit-element'
|
|
47
|
+
* const el = document.createElement('diagram-kit-view')
|
|
48
|
+
* el.graph = myGraph
|
|
49
|
+
* document.body.appendChild(el)
|
|
50
|
+
*
|
|
51
|
+
* Or declaratively, with the graph assigned from a script:
|
|
52
|
+
* <diagram-kit-view id="view" layout-mode="structural" mode="dark"></diagram-kit-view>
|
|
53
|
+
* <script type="module">
|
|
54
|
+
* document.getElementById('view').graph = myGraph
|
|
55
|
+
* </script>
|
|
56
|
+
*/
|
|
57
|
+
export class DiagramKitElement extends HTMLElement {
|
|
58
|
+
static get observedAttributes() {
|
|
59
|
+
return OBSERVED_ATTRIBUTES;
|
|
60
|
+
}
|
|
61
|
+
#graph = null;
|
|
62
|
+
#theme = null;
|
|
63
|
+
#wrap;
|
|
64
|
+
#panel;
|
|
65
|
+
constructor() {
|
|
66
|
+
super();
|
|
67
|
+
const root = this.attachShadow({ mode: 'open' });
|
|
68
|
+
const style = document.createElement('style');
|
|
69
|
+
style.textContent = STYLES;
|
|
70
|
+
root.appendChild(style);
|
|
71
|
+
this.#wrap = document.createElement('div');
|
|
72
|
+
this.#wrap.className = 'dk-svg-wrap';
|
|
73
|
+
root.appendChild(this.#wrap);
|
|
74
|
+
this.#panel = document.createElement('div');
|
|
75
|
+
this.#panel.className = 'dk-panel';
|
|
76
|
+
root.appendChild(this.#panel);
|
|
77
|
+
this.#wrap.addEventListener('click', (event) => {
|
|
78
|
+
const target = event.target;
|
|
79
|
+
if (!(target instanceof Element))
|
|
80
|
+
return;
|
|
81
|
+
const nodeGroup = target.closest('[data-node-id]');
|
|
82
|
+
if (!nodeGroup)
|
|
83
|
+
return;
|
|
84
|
+
const nodeId = nodeGroup.getAttribute('data-node-id');
|
|
85
|
+
const node = this.#graph?.nodes.find((n) => n.id === nodeId);
|
|
86
|
+
if (!node)
|
|
87
|
+
return;
|
|
88
|
+
if (this.getAttribute('detail-placement') !== 'inline')
|
|
89
|
+
this.#showPanel(node);
|
|
90
|
+
this.dispatchEvent(new CustomEvent('node-click', { detail: { nodeId: node.id, node }, bubbles: true, composed: true }));
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
connectedCallback() {
|
|
94
|
+
this.#render();
|
|
95
|
+
}
|
|
96
|
+
attributeChangedCallback() {
|
|
97
|
+
this.#panel.classList.remove('dk-panel-open');
|
|
98
|
+
this.#render();
|
|
99
|
+
}
|
|
100
|
+
get graph() {
|
|
101
|
+
return this.#graph;
|
|
102
|
+
}
|
|
103
|
+
set graph(value) {
|
|
104
|
+
this.#graph = value;
|
|
105
|
+
this.#panel.classList.remove('dk-panel-open');
|
|
106
|
+
this.#render();
|
|
107
|
+
}
|
|
108
|
+
get theme() {
|
|
109
|
+
return this.#theme;
|
|
110
|
+
}
|
|
111
|
+
set theme(value) {
|
|
112
|
+
this.#theme = value;
|
|
113
|
+
this.#render();
|
|
114
|
+
}
|
|
115
|
+
#showPanel(node) {
|
|
116
|
+
this.#panel.innerHTML = '';
|
|
117
|
+
const close = document.createElement('button');
|
|
118
|
+
close.type = 'button';
|
|
119
|
+
close.className = 'dk-panel-close';
|
|
120
|
+
close.setAttribute('aria-label', 'Close');
|
|
121
|
+
close.textContent = '✕';
|
|
122
|
+
close.addEventListener('click', () => this.#panel.classList.remove('dk-panel-open'));
|
|
123
|
+
this.#panel.appendChild(close);
|
|
124
|
+
const title = document.createElement('p');
|
|
125
|
+
title.className = 'dk-panel-title';
|
|
126
|
+
title.textContent = node.label;
|
|
127
|
+
this.#panel.appendChild(title);
|
|
128
|
+
if (node.category) {
|
|
129
|
+
const category = document.createElement('p');
|
|
130
|
+
category.className = 'dk-panel-category';
|
|
131
|
+
category.textContent = node.badge ? `${node.category} · ${node.badge}` : node.category;
|
|
132
|
+
this.#panel.appendChild(category);
|
|
133
|
+
}
|
|
134
|
+
if (node.detail) {
|
|
135
|
+
const detail = document.createElement('p');
|
|
136
|
+
detail.className = 'dk-panel-detail';
|
|
137
|
+
detail.textContent = node.detail;
|
|
138
|
+
this.#panel.appendChild(detail);
|
|
139
|
+
}
|
|
140
|
+
this.#panel.classList.add('dk-panel-open');
|
|
141
|
+
}
|
|
142
|
+
#render() {
|
|
143
|
+
if (!this.#graph) {
|
|
144
|
+
this.#wrap.innerHTML = '';
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const layoutMode = this.getAttribute('layout-mode') ?? 'graph';
|
|
148
|
+
const mode = this.getAttribute('mode') ?? 'light';
|
|
149
|
+
const presetName = this.getAttribute('preset');
|
|
150
|
+
const theme = this.#theme ?? (presetName && themePresets[presetName] ? themePresets[presetName] : defaultTheme);
|
|
151
|
+
const paddingAttr = this.getAttribute('padding');
|
|
152
|
+
const padding = paddingAttr ? Number(paddingAttr) : 24;
|
|
153
|
+
const colorizeNodes = this.hasAttribute('colorize-nodes');
|
|
154
|
+
const direction = this.getAttribute('direction');
|
|
155
|
+
const options = {
|
|
156
|
+
layoutMode,
|
|
157
|
+
theme,
|
|
158
|
+
mode,
|
|
159
|
+
padding,
|
|
160
|
+
colorizeNodes,
|
|
161
|
+
detailPlacement: this.getAttribute('detail-placement') === 'inline' ? 'inline' : 'panel',
|
|
162
|
+
layout: direction ? { direction } : undefined,
|
|
163
|
+
};
|
|
164
|
+
this.#wrap.innerHTML = renderSvg(this.#graph, options);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** Registers `<diagram-kit-view>` (or a custom tag name) as a Custom Element. Safe to call more than once. */
|
|
168
|
+
export function defineDiagramKitElement(tagName = 'diagram-kit-view') {
|
|
169
|
+
if (!customElements.get(tagName)) {
|
|
170
|
+
customElements.define(tagName, DiagramKitElement);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
defineDiagramKitElement();
|
|
174
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAwB,MAAM,8BAA8B,CAAA;AAC/F,OAAO,EAAE,SAAS,EAA0C,MAAM,gCAAgC,CAAA;AAElG,MAAM,mBAAmB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,CAAU,CAAA;AAEpI,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCd,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD,MAAM,KAAK,kBAAkB;QAC3B,OAAO,mBAAmB,CAAA;IAC5B,CAAC;IAED,MAAM,GAAwB,IAAI,CAAA;IAClC,MAAM,GAAwB,IAAI,CAAA;IAClC,KAAK,CAAgB;IACrB,MAAM,CAAgB;IAEtB;QACE,KAAK,EAAE,CAAA;QACP,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;QAChD,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QAC7C,KAAK,CAAC,WAAW,GAAG,MAAM,CAAA;QAC1B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QAEvB,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAC1C,IAAI,CA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/diagram-kit-element",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Framework-agnostic Custom Element (Web Component) for embedding interactive diagram-kit graphs in any app — React, Vue, Angular, or plain HTML.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Stefan Stretz",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/steffolino/diagram-kit.git",
|
|
10
|
+
"directory": "packages/element"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/steffolino/diagram-kit/tree/master/packages/element#readme",
|
|
13
|
+
"bugs": "https://github.com/steffolino/diagram-kit/issues",
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"diagram",
|
|
19
|
+
"custom-element",
|
|
20
|
+
"web-component",
|
|
21
|
+
"graph",
|
|
22
|
+
"visualization"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": true,
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@steffolino/diagram-kit-static": "0.1.0",
|
|
40
|
+
"@steffolino/diagram-kit-core": "0.1.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"happy-dom": "^15.11.7",
|
|
44
|
+
"typescript": "^5.7.2"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc -p tsconfig.json",
|
|
48
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
49
|
+
}
|
|
50
|
+
}
|