@arach/arc 0.4.2 → 0.4.4
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/README.md +82 -10
- package/lib/arc.es.js +38 -32804
- package/lib/arc.umd.js +276 -145
- package/lib/index.d.ts +713 -111
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
+
<img src="https://raw.githubusercontent.com/arach/arc/master/public/arc-mark.svg" alt="Arc" width="52" height="52" />
|
|
4
|
+
|
|
3
5
|
# Arc
|
|
4
6
|
|
|
5
|
-
###
|
|
7
|
+
### Diagrams as code.
|
|
6
8
|
|
|
7
|
-
Arc
|
|
8
|
-
|
|
9
|
-
crisp ASCII**.
|
|
10
|
-
straight to text for a README. Same diagram, everywhere.
|
|
9
|
+
Arc turns typed, diffable config into clean, themeable architecture diagrams.
|
|
10
|
+
Design in the visual editor, render with React, or export as **TypeScript, JSON,
|
|
11
|
+
SVG, PNG, or crisp ASCII**. The diagram lives with the system it describes.
|
|
11
12
|
|
|
12
13
|
[](https://www.npmjs.com/package/@arach/arc)
|
|
13
14
|
[](./LICENSE)
|
|
14
15
|
[](./lib/index.d.ts)
|
|
15
16
|
|
|
16
|
-

|
|
17
|
+

|
|
17
18
|
|
|
18
|
-
<sub>Not a screenshot of a drawing tool — that's the config in <a href="#example-output">Example Output</a>, rendered
|
|
19
|
+
<sub>Not a screenshot of a drawing tool — that's the config in <a href="#example-output">Example Output</a>, rendered by <code><ArcDiagram /></code> in the Engineering theme.</sub>
|
|
19
20
|
|
|
20
21
|
</div>
|
|
21
22
|
|
|
@@ -42,7 +43,7 @@ export function Architecture() {
|
|
|
42
43
|
return (
|
|
43
44
|
<ArcDiagram
|
|
44
45
|
data={diagram} // your ArcDiagramData (see below)
|
|
45
|
-
theme="default" //
|
|
46
|
+
theme="default" // seven themes, each with light & dark
|
|
46
47
|
mode="dark" // light · dark
|
|
47
48
|
defaultZoom="fit" // auto-fit to the container
|
|
48
49
|
/>
|
|
@@ -51,13 +52,38 @@ export function Architecture() {
|
|
|
51
52
|
```
|
|
52
53
|
|
|
53
54
|
You get pan/zoom, hover highlighting, light/dark modes, and seven color themes
|
|
54
|
-
out of the box.
|
|
55
|
+
out of the box.
|
|
56
|
+
|
|
57
|
+
### Key props
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Notes |
|
|
60
|
+
|------|------|-------|
|
|
61
|
+
| `data` | `ArcDiagramData` | The diagram config (required) — see [Example Output](#example-output). |
|
|
62
|
+
| `theme` | `'default' \| 'warm' \| 'cool' \| 'mono' \| 'engineering' \| 'workbench' \| 'tactical'` | Palette + drafting grammar (grid, frame, type). |
|
|
63
|
+
| `mode` | `'light' \| 'dark'` | Appearance. |
|
|
64
|
+
| `frame` | `'hairline' \| 'inset' \| 'brackets' \| 'ticks' \| 'cropmarks' \| 'corners' \| 'sheet' \| 'none'` | Override the theme's edge treatment. |
|
|
65
|
+
| `interactive` | `boolean` | Pan/zoom controls. |
|
|
66
|
+
| `defaultZoom` | `number \| 'fit'` | Initial zoom, or `'fit'` to auto-fit (`maxFitZoom` caps it). |
|
|
67
|
+
| `showControls` / `showMinimap` | `boolean` | Zoom controls / minimap for read-only chrome. |
|
|
68
|
+
| `hoverEffects` | `boolean \| { dim, lift, glow, highlightEdges }` | Hover highlighting (granular). |
|
|
69
|
+
| `label` | `string` | Override the bottom-left label. |
|
|
70
|
+
|
|
71
|
+
## The Studio
|
|
72
|
+
|
|
73
|
+
Prefer to design visually? Arc ships a full drag-and-drop **studio** — infinite
|
|
74
|
+
canvas, floating toolbar, reusable connector styles, live properties panel, and
|
|
75
|
+
a minimap. Clone the repo and open it:
|
|
55
76
|
|
|
56
77
|
```bash
|
|
57
78
|
git clone https://github.com/arach/arc && cd arc
|
|
58
|
-
bun install && bun dev # → http://localhost:5188
|
|
79
|
+
bun install && bun dev # → http://localhost:5188/editor
|
|
59
80
|
```
|
|
60
81
|
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
Design on the canvas, then **Export** to TypeScript, JSON, SVG, PNG, or a
|
|
85
|
+
shareable link — and drop the result straight into `<ArcDiagram />`.
|
|
86
|
+
|
|
61
87
|
## Features
|
|
62
88
|
|
|
63
89
|
- **Visual Editor** - Drag-and-drop nodes, connect with arrows
|
|
@@ -69,6 +95,52 @@ bun install && bun dev # → http://localhost:5188
|
|
|
69
95
|
- **Groups & Images** - Visual grouping, background images
|
|
70
96
|
- **Templates** - Quick-start layouts
|
|
71
97
|
|
|
98
|
+
## Native Mermaid Sequences
|
|
99
|
+
|
|
100
|
+
`@arach/arc-viewer` turns canonical Mermaid `sequenceDiagram` source into a
|
|
101
|
+
typed Arc document and a native, interactive React player—without embedding the
|
|
102
|
+
generic Mermaid runtime.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npm install @arach/arc-viewer
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
import { ArcMermaidPlayer } from '@arach/arc-viewer'
|
|
110
|
+
|
|
111
|
+
const source = `sequenceDiagram
|
|
112
|
+
participant App
|
|
113
|
+
participant API
|
|
114
|
+
App->>API: Load architecture
|
|
115
|
+
API-->>App: Typed diagram`
|
|
116
|
+
|
|
117
|
+
export function Sequence() {
|
|
118
|
+
return <ArcMermaidPlayer source={source} mode="light" />
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Themes
|
|
123
|
+
|
|
124
|
+
One diagram, several drafting grammars. The nodes and palette stay the same —
|
|
125
|
+
what changes is the grid system, edge treatment, type, and geometry. Here's
|
|
126
|
+
Arc's own architecture rendered three ways:
|
|
127
|
+
|
|
128
|
+
<div align="center">
|
|
129
|
+
<img src="https://raw.githubusercontent.com/arach/arc/master/public/theme-engineering.png" alt="Arc's architecture in the Engineering theme" width="840" />
|
|
130
|
+
<br/>
|
|
131
|
+
<sub><strong>Engineering</strong> — graph grid, drawing-sheet border, title block, uppercase mono</sub>
|
|
132
|
+
<br/><br/>
|
|
133
|
+
<img src="https://raw.githubusercontent.com/arach/arc/master/public/theme-workbench.png" alt="Arc's architecture in the Workbench theme" width="840" />
|
|
134
|
+
<br/>
|
|
135
|
+
<sub><strong>Workbench</strong> — dot grid, hairline frame, soft corners</sub>
|
|
136
|
+
<br/><br/>
|
|
137
|
+
<img src="https://raw.githubusercontent.com/arach/arc/master/public/theme-tactical.png" alt="Arc's architecture in the Tactical theme" width="840" />
|
|
138
|
+
<br/>
|
|
139
|
+
<sub><strong>Tactical</strong> — crosshair grid, corner brackets, hard edges</sub>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
Plus `default`, `warm`, `cool`, and `mono` — seven in all, each with light and dark modes.
|
|
143
|
+
|
|
72
144
|
## Example Output
|
|
73
145
|
|
|
74
146
|
Arc stores diagrams as plain, typed data — the same config that renders the
|