@x12i/diagrams 0.0.0-stage → 1.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 +48 -3
- package/dist/chunk-3DJFQRU3.js +2708 -0
- package/dist/chunk-3DJFQRU3.js.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +205 -0
- package/dist/index.js.map +1 -0
- package/dist/messages-ZCyCfyO0.d.ts +857 -0
- package/dist/react.d.ts +348 -0
- package/dist/react.js +2525 -0
- package/dist/react.js.map +1 -0
- package/dist/styles.css +1389 -0
- package/package.json +81 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 x12i
|
|
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,48 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @x12i/diagrams
|
|
2
|
+
|
|
3
|
+
Diagrams for the Unified UI Kit: one versioned JSON diagram document, a headless
|
|
4
|
+
core, and accessible React views themed by kit tokens.
|
|
5
|
+
|
|
6
|
+
| Import | Contains |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| `@x12i/diagrams` | Schema, validation, layout, geometry, history, mutations, JSON and static SVG export, the text outline. No React, no DOM. |
|
|
9
|
+
| `@x12i/diagrams/react` | `DiagramCanvas` (node canvas on `@xyflow/react`), `StaticDiagram`, `DiagramOutline`, `MermaidDiagram`, `useDiagramHistory`. Starts with `"use client"`. |
|
|
10
|
+
| `@x12i/diagrams/styles.css` | The one stylesheet. |
|
|
11
|
+
|
|
12
|
+
`@x12i/ui` and React are peer dependencies. `MermaidDiagram` takes a loader, so
|
|
13
|
+
Mermaid is only installed by apps that use it. The Excalidraw whiteboard is not
|
|
14
|
+
built yet.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { defineDiagram, diagramToOutline } from "@x12i/diagrams";
|
|
18
|
+
|
|
19
|
+
const diagram = defineDiagram({
|
|
20
|
+
version: 1,
|
|
21
|
+
title: "Order approval",
|
|
22
|
+
nodes: [
|
|
23
|
+
{ id: "a", kind: "start", label: "Order placed", position: { x: 0, y: 0 } },
|
|
24
|
+
{ id: "b", kind: "task", label: "Review", position: { x: 200, y: 0 } },
|
|
25
|
+
{ id: "c", kind: "end", label: "Shipped", position: { x: 400, y: 0 } },
|
|
26
|
+
],
|
|
27
|
+
edges: [
|
|
28
|
+
{ id: "ab", source: "a", target: "b" },
|
|
29
|
+
{ id: "bc", source: "b", target: "c" },
|
|
30
|
+
],
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
diagramToOutline(diagram); // ["Order placed to Review to Shipped"]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Every canvas generates this outline, so a diagram has a form screen readers can
|
|
37
|
+
read (spec section 10).
|
|
38
|
+
|
|
39
|
+
## Engines
|
|
40
|
+
|
|
41
|
+
| Tier | Engine | Status |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| Text to diagram | Mermaid (MIT) | Built, loaded by the app |
|
|
44
|
+
| Node canvas | `@xyflow/react` (MIT) | Built |
|
|
45
|
+
| Automatic layout | dagre (MIT), D3 hierarchy (ISC) | Built |
|
|
46
|
+
| Freeform whiteboard | Excalidraw (MIT) | Planned |
|
|
47
|
+
|
|
48
|
+
tldraw is excluded on license grounds.
|