@grethel-labs/excaliplant 0.6.0 → 0.7.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 +24 -0
- package/README.md +40 -4
- package/assets/arrowheads/arrowheads.svg +46 -0
- package/assets/arrowheads/manifest.json +17 -0
- package/index.mjs +26 -0
- package/package.json +4 -3
- package/src/layout/sequence_layout.mjs +559 -77
- package/src/layout/sequence_spacing.mjs +106 -0
- package/src/model/diagram.mjs +388 -11
- package/src/parser/plantuml.mjs +6 -0
- package/src/parser/plugins/sequence/advanced.mjs +100 -2
- package/src/parser/plugins/sequence/fragments.mjs +28 -1
- package/src/parser/plugins/sequence/messages.mjs +400 -31
- package/src/parser/plugins/sequence/notes.mjs +127 -20
- package/src/parser/plugins/sequence/participants.mjs +52 -5
- package/src/parser/plugins/sequence/preamble.mjs +57 -0
- package/src/parser/sequence_context.mjs +185 -10
- package/src/parser/utils.mjs +8 -1
- package/src/render/excalidraw.mjs +41 -1
- package/src/render/sequence_render.mjs +736 -149
- package/src/render/svg.mjs +71 -8
- package/src/style/text.mjs +103 -0
package/CHANGELOG.md
CHANGED
|
@@ -45,6 +45,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
45
45
|
[`docs/API.template.md.njk`](docs/API.template.md.njk) on every
|
|
46
46
|
`npm run build:docs` run, so it can never drift from the README.
|
|
47
47
|
The TypeDoc devDependency was removed.
|
|
48
|
+
- Reusable arrow model classes (`DiagramArrow`, `ArrowEndpoint`,
|
|
49
|
+
`ArrowLine`, `ArrowLabel`) are now exported from the package root
|
|
50
|
+
and used by both sequence messages and component/class connections.
|
|
51
|
+
- Sequence diagrams now support endpoint labels, long label wrapping
|
|
52
|
+
against arrowhead-safe budgets, `hide unlinked`, `header`,
|
|
53
|
+
`footer`, `mainframe`, single-canvas `newpage`, solid lifelines,
|
|
54
|
+
and simplified `&` parallel-message parsing.
|
|
55
|
+
- Sequence diagrams now support multiline participant block titles,
|
|
56
|
+
message alignment / response-below-arrow skinparams, actor style
|
|
57
|
+
modes, group secondary labels and colours, safe formatted
|
|
58
|
+
autonumber output, Teoz pragmas / partition wrappers, and expanded
|
|
59
|
+
sequence skinparams for messages, notes, groups, dividers, and
|
|
60
|
+
activation bars.
|
|
61
|
+
- SVG marker assets for all produced arrowhead forms are stored under
|
|
62
|
+
[`assets/arrowheads/`](assets/arrowheads/), and the docs build now
|
|
63
|
+
emits a self-updating model class diagram in the README architecture
|
|
64
|
+
section.
|
|
48
65
|
|
|
49
66
|
### Changed
|
|
50
67
|
|
|
@@ -72,6 +89,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
72
89
|
style document. Existing reads (`FONT.sizeTitle`, `FONT.family`,
|
|
73
90
|
…) keep working; calls to `setStyle()` / `loadStyleFromFile()`
|
|
74
91
|
immediately propagate to sizing and rendering.
|
|
92
|
+
- Sequence-diagram timeline spacing is centralized in one spacing
|
|
93
|
+
contract so messages, notes, refs, markers, fragments, and wrapped
|
|
94
|
+
endpoint labels reserve symmetric top/bottom gaps consistently.
|
|
75
95
|
|
|
76
96
|
### Fixed
|
|
77
97
|
|
|
@@ -108,6 +128,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
108
128
|
in `src/style/text.mjs`, with continuation indent. Sizing
|
|
109
129
|
grows the box height accordingly so members no longer bleed
|
|
110
130
|
past the right edge.
|
|
131
|
+
- SVG start markers are now anchored at the visual tip, so backward
|
|
132
|
+
and start-side arrowheads point at their endpoint instead of starting
|
|
133
|
+
there. Additional rendered heads include circles, dots, bars, and
|
|
134
|
+
partial top/bottom heads.
|
|
111
135
|
|
|
112
136
|
## [0.3.7] - 2026-05-04
|
|
113
137
|
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://nodejs.org)
|
|
8
8
|
[](./LICENSE)
|
|
9
9
|
|
|
10
|
-
> PlantUML → ELK layout → Excalidraw renderer with a plugin-based parser. · **v0.
|
|
10
|
+
> PlantUML → ELK layout → Excalidraw renderer with a plugin-based parser. · **v0.7.0** · 162 tests · MIT
|
|
11
11
|
|
|
12
12
|
`@grethel-labs/excaliplant` takes PlantUML source, runs it through a plugin-based
|
|
13
13
|
parser, lays it out with [ELK](https://github.com/kieler/elkjs), and
|
|
@@ -123,13 +123,15 @@ directly to output colours in block or compact form: `ArrowColor`,
|
|
|
123
123
|
`ParticipantBackgroundColor`, `ParticipantBorderColor`, and
|
|
124
124
|
`LifeLineBorderColor`.
|
|
125
125
|
|
|
126
|
+
See the full [Sequence Diagram Component Coverage](./docs/sequence-components.md) for detailed examples and support matrix.
|
|
127
|
+
|
|
126
128
|
### Run the tests
|
|
127
129
|
|
|
128
130
|
```sh
|
|
129
131
|
npm test
|
|
130
132
|
```
|
|
131
133
|
|
|
132
|
-
Ships with **
|
|
134
|
+
Ships with **162 tests** across functional, edge-case,
|
|
133
135
|
security (XSS / ReDoS / prototype-pollution), and self-introspection
|
|
134
136
|
suites.
|
|
135
137
|
|
|
@@ -186,6 +188,18 @@ To add support for a new PlantUML keyword, drop a new file in
|
|
|
186
188
|
`src/parser/plugins/` and append it to the default array in
|
|
187
189
|
[`plantuml.mjs`](./src/parser/plantuml.mjs). No engine change required.
|
|
188
190
|
|
|
191
|
+
### Model classes
|
|
192
|
+
|
|
193
|
+

|
|
194
|
+
|
|
195
|
+
_Sources: [PlantUML](docs/ressources/generated/puml/model.puml) · [SVG](docs/ressources/generated/svg/model.svg)_
|
|
196
|
+
|
|
197
|
+
The model diagram is generated dynamically from exported classes in
|
|
198
|
+
[`src/model/diagram.mjs`](./src/model/diagram.mjs). It shows how the
|
|
199
|
+
reusable arrow classes sit underneath both component connections and
|
|
200
|
+
sequence messages, so future model classes appear in the README without
|
|
201
|
+
hand-maintained PlantUML.
|
|
202
|
+
|
|
189
203
|
## Pipeline
|
|
190
204
|
|
|
191
205
|
```text
|
|
@@ -209,6 +223,9 @@ PlantUML text
|
|
|
209
223
|
```text
|
|
210
224
|
excaliplant
|
|
211
225
|
├── assets
|
|
226
|
+
│ ├── arrowheads
|
|
227
|
+
│ │ ├── arrowheads.svg
|
|
228
|
+
│ │ └── manifest.json
|
|
212
229
|
│ └── fonts
|
|
213
230
|
│ ├── Excalifont-Regular.ttf
|
|
214
231
|
│ ├── Excalifont-Regular.woff2
|
|
@@ -217,17 +234,24 @@ excaliplant
|
|
|
217
234
|
│ └── excaliplant.mjs
|
|
218
235
|
├── docs
|
|
219
236
|
│ ├── ressources
|
|
237
|
+
│ │ └── sequence
|
|
238
|
+
│ │ ├── puml
|
|
239
|
+
│ │ └── svg
|
|
220
240
|
│ ├── scripts
|
|
221
241
|
│ │ ├── build-docs.mjs
|
|
242
|
+
│ │ ├── build-sequence-coverage.mjs
|
|
222
243
|
│ │ ├── check-build-manifest.mjs
|
|
223
244
|
│ │ ├── config.mjs
|
|
224
245
|
│ │ ├── extract-api.mjs
|
|
225
246
|
│ │ ├── extract-docs.mjs
|
|
226
247
|
│ │ ├── file-tree.mjs
|
|
227
|
-
│ │
|
|
248
|
+
│ │ ├── self-diagrams.mjs
|
|
249
|
+
│ │ └── sequence-coverage-examples.mjs
|
|
228
250
|
│ ├── API.md
|
|
229
251
|
│ ├── API.template.md.njk
|
|
230
|
-
│
|
|
252
|
+
│ ├── README.template.md.njk
|
|
253
|
+
│ ├── sequence-components.md
|
|
254
|
+
│ └── sequence-components.template.md.njk
|
|
231
255
|
├── scripts
|
|
232
256
|
│ ├── auto-patch-deps.mjs
|
|
233
257
|
│ ├── bump-release-version.mjs
|
|
@@ -240,6 +264,7 @@ excaliplant
|
|
|
240
264
|
│ ├── layout
|
|
241
265
|
│ │ ├── elk_layout.mjs
|
|
242
266
|
│ │ ├── sequence_layout.mjs
|
|
267
|
+
│ │ ├── sequence_spacing.mjs
|
|
243
268
|
│ │ └── sizing.mjs
|
|
244
269
|
│ ├── model
|
|
245
270
|
│ │ └── diagram.mjs
|
|
@@ -274,6 +299,7 @@ excaliplant
|
|
|
274
299
|
│ ├── plantuml.test.mjs
|
|
275
300
|
│ ├── security.test.mjs
|
|
276
301
|
│ ├── self_introspection.test.mjs
|
|
302
|
+
│ ├── sequence_components.test.mjs
|
|
277
303
|
│ └── style.test.mjs
|
|
278
304
|
├── AGENTS.md
|
|
279
305
|
├── CHANGELOG.md
|
|
@@ -285,6 +311,7 @@ excaliplant
|
|
|
285
311
|
├── SECURITY.md
|
|
286
312
|
├── THIRD_PARTY_NOTICES.md
|
|
287
313
|
├── index.mjs
|
|
314
|
+
├── lifecycle-test.svg
|
|
288
315
|
├── package.json
|
|
289
316
|
├── style.example.json
|
|
290
317
|
├── style.example.yaml
|
|
@@ -342,6 +369,15 @@ that any Excalidraw front-end can open. The companion module
|
|
|
342
369
|
`src/render/svg.mjs` converts the same JSON to SVG for the
|
|
343
370
|
build-time documentation pipeline.
|
|
344
371
|
|
|
372
|
+
### sequence-spacing
|
|
373
|
+
|
|
374
|
+
Central spacing contract for sequence diagrams.
|
|
375
|
+
|
|
376
|
+
Sequence layout has many visual item types (messages, notes, refs,
|
|
377
|
+
dividers, fragments, lifecycle bars). They all reserve vertical space
|
|
378
|
+
through this module so adding a new timeline item does not introduce a
|
|
379
|
+
one-off top/bottom rhythm.
|
|
380
|
+
|
|
345
381
|
## License
|
|
346
382
|
|
|
347
383
|
MIT © grethel-labs
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 80" aria-label="Arrowhead marker shapes">
|
|
2
|
+
<defs>
|
|
3
|
+
<symbol id="arrow" viewBox="0 0 10 10">
|
|
4
|
+
<path d="M0,0 L10,5 L0,10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
5
|
+
</symbol>
|
|
6
|
+
<symbol id="triangle" viewBox="0 0 10 10">
|
|
7
|
+
<path d="M0,0 L10,5 L0,10 z" fill="currentColor" />
|
|
8
|
+
</symbol>
|
|
9
|
+
<symbol id="triangle_outline" viewBox="0 0 10 10">
|
|
10
|
+
<path d="M0,0 L10,5 L0,10 z" fill="#fff" stroke="currentColor" />
|
|
11
|
+
</symbol>
|
|
12
|
+
<symbol id="diamond" viewBox="0 0 12 10">
|
|
13
|
+
<path d="M0,5 L6,0 L12,5 L6,10 z" fill="currentColor" />
|
|
14
|
+
</symbol>
|
|
15
|
+
<symbol id="diamond_outline" viewBox="0 0 12 10">
|
|
16
|
+
<path d="M0,5 L6,0 L12,5 L6,10 z" fill="#fff" stroke="currentColor" />
|
|
17
|
+
</symbol>
|
|
18
|
+
<symbol id="circle_outline" viewBox="0 0 10 10">
|
|
19
|
+
<path d="M5,5 m-4,0 a4,4 0 1,0 8,0 a4,4 0 1,0 -8,0" fill="#fff" stroke="currentColor" />
|
|
20
|
+
</symbol>
|
|
21
|
+
<symbol id="dot" viewBox="0 0 10 10">
|
|
22
|
+
<path d="M5,5 m-3,0 a3,3 0 1,0 6,0 a3,3 0 1,0 -6,0" fill="currentColor" />
|
|
23
|
+
</symbol>
|
|
24
|
+
<symbol id="bar" viewBox="0 0 10 10">
|
|
25
|
+
<path d="M5,0 L5,10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
26
|
+
</symbol>
|
|
27
|
+
<symbol id="partial_top" viewBox="0 0 10 10">
|
|
28
|
+
<path d="M0,0 L10,5" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
29
|
+
</symbol>
|
|
30
|
+
<symbol id="partial_bottom" viewBox="0 0 10 10">
|
|
31
|
+
<path d="M0,10 L10,5" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
32
|
+
</symbol>
|
|
33
|
+
</defs>
|
|
34
|
+
<g color="#1f2933" transform="translate(8 8)">
|
|
35
|
+
<use href="#arrow" x="0" y="0" width="16" height="16" />
|
|
36
|
+
<use href="#triangle" x="22" y="0" width="16" height="16" />
|
|
37
|
+
<use href="#triangle_outline" x="44" y="0" width="16" height="16" />
|
|
38
|
+
<use href="#diamond" x="66" y="0" width="19" height="16" />
|
|
39
|
+
<use href="#diamond_outline" x="91" y="0" width="19" height="16" />
|
|
40
|
+
<use href="#circle_outline" x="0" y="34" width="16" height="16" />
|
|
41
|
+
<use href="#dot" x="22" y="34" width="16" height="16" />
|
|
42
|
+
<use href="#bar" x="44" y="34" width="16" height="16" />
|
|
43
|
+
<use href="#partial_top" x="66" y="34" width="16" height="16" />
|
|
44
|
+
<use href="#partial_bottom" x="88" y="34" width="16" height="16" />
|
|
45
|
+
</g>
|
|
46
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "assets/arrowheads/arrowheads.svg",
|
|
3
|
+
"generatedBy": "src/render/svg.mjs marker geometry",
|
|
4
|
+
"arrowheads": [
|
|
5
|
+
"arrow",
|
|
6
|
+
"triangle",
|
|
7
|
+
"triangle_outline",
|
|
8
|
+
"diamond",
|
|
9
|
+
"diamond_outline",
|
|
10
|
+
"circle",
|
|
11
|
+
"circle_outline",
|
|
12
|
+
"dot",
|
|
13
|
+
"bar",
|
|
14
|
+
"partial_top",
|
|
15
|
+
"partial_bottom"
|
|
16
|
+
]
|
|
17
|
+
}
|
package/index.mjs
CHANGED
|
@@ -46,6 +46,16 @@
|
|
|
46
46
|
* each plugin handling one PlantUML construct.
|
|
47
47
|
*/
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* @diagram model
|
|
51
|
+
*
|
|
52
|
+
* The model diagram is generated dynamically from exported classes in
|
|
53
|
+
* [`src/model/diagram.mjs`](./src/model/diagram.mjs). It shows how the
|
|
54
|
+
* reusable arrow classes sit underneath both component connections and
|
|
55
|
+
* sequence messages, so future model classes appear in the README without
|
|
56
|
+
* hand-maintained PlantUML.
|
|
57
|
+
*/
|
|
58
|
+
|
|
49
59
|
import { parsePlantUml } from "./src/parser/plantuml.mjs";
|
|
50
60
|
import { layoutDiagram } from "./src/layout/elk_layout.mjs";
|
|
51
61
|
import { exportDiagram } from "./src/render/excalidraw.mjs";
|
|
@@ -76,20 +86,36 @@ export {
|
|
|
76
86
|
parseSimpleYaml,
|
|
77
87
|
} from "./src/style/style.mjs";
|
|
78
88
|
export {
|
|
89
|
+
ARROW_ANCHORS,
|
|
90
|
+
ARROW_DIRECTIONS,
|
|
91
|
+
ARROW_HEADS,
|
|
92
|
+
ARROW_LINE_STYLES,
|
|
93
|
+
ArrowEndpoint,
|
|
94
|
+
ArrowLabel,
|
|
95
|
+
ArrowLine,
|
|
79
96
|
Box,
|
|
80
97
|
Connection,
|
|
98
|
+
DEFAULT_ARROW_HEAD_SIZE,
|
|
81
99
|
Diagram,
|
|
100
|
+
DiagramArrow,
|
|
82
101
|
Plane,
|
|
83
102
|
Subplane,
|
|
84
103
|
Participant,
|
|
85
104
|
Message,
|
|
86
105
|
SequenceDiagram,
|
|
87
106
|
SequenceActivation,
|
|
107
|
+
SequenceArrow,
|
|
108
|
+
SequenceArrowEndpoint,
|
|
109
|
+
SequenceArrowLine,
|
|
88
110
|
SequenceFragment,
|
|
89
111
|
SequenceMarker,
|
|
90
112
|
SequenceNote,
|
|
91
113
|
SequenceParticipantGroup,
|
|
92
114
|
SequenceReference,
|
|
115
|
+
SEQUENCE_ARROW_ANCHORS,
|
|
116
|
+
SEQUENCE_ARROW_DIRECTIONS,
|
|
117
|
+
SEQUENCE_ARROW_HEADS,
|
|
118
|
+
SEQUENCE_ARROW_LINE_STYLES,
|
|
93
119
|
SHAPES,
|
|
94
120
|
} from "./src/model/diagram.mjs";
|
|
95
121
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grethel-labs/excaliplant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "PlantUML → ELK layout → Excalidraw renderer with a plugin-based parser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.mjs",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"index.mjs",
|
|
12
12
|
"bin/",
|
|
13
13
|
"src/",
|
|
14
|
+
"assets/arrowheads/",
|
|
14
15
|
"assets/fonts/",
|
|
15
16
|
"README.md",
|
|
16
17
|
"CHANGELOG.md",
|
|
@@ -35,11 +36,11 @@
|
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"pretest": "node scripts/clean-test-output.mjs",
|
|
38
|
-
"test": "node --test tests/edge_cases.test.mjs tests/functional_more.test.mjs tests/merge_driver.test.mjs tests/plantuml.test.mjs tests/security.test.mjs tests/self_introspection.test.mjs tests/style.test.mjs",
|
|
39
|
+
"test": "node --test tests/edge_cases.test.mjs tests/functional_more.test.mjs tests/merge_driver.test.mjs tests/plantuml.test.mjs tests/security.test.mjs tests/self_introspection.test.mjs tests/sequence_components.test.mjs tests/style.test.mjs",
|
|
39
40
|
"typecheck": "tsc -p tsconfig.json",
|
|
40
41
|
"build:docs": "node docs/scripts/build-docs.mjs",
|
|
41
42
|
"build:api": "node docs/scripts/build-docs.mjs",
|
|
42
|
-
"build": "npm run build:docs",
|
|
43
|
+
"build": "npm run test && npm run build:docs && npm run build:api && tsc -p tsconfig.json --emitDeclarationOnly",
|
|
43
44
|
"format": "prettier --write .",
|
|
44
45
|
"format:check": "prettier --check .",
|
|
45
46
|
"prepare": "husky && node scripts/setup-merge-drivers.mjs",
|