@formicoidea/labre-framework-uml 0.42.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 +384 -0
- package/dist/actions.d.ts +430 -0
- package/dist/actions.js +724 -0
- package/dist/background.d.ts +153 -0
- package/dist/background.js +557 -0
- package/dist/board-hit.d.ts +137 -0
- package/dist/board-hit.js +191 -0
- package/dist/commands-manifest.d.ts +19 -0
- package/dist/commands-manifest.js +571 -0
- package/dist/commands.d.ts +4 -0
- package/dist/commands.js +983 -0
- package/dist/component.d.ts +521 -0
- package/dist/component.js +708 -0
- package/dist/consts.d.ts +365 -0
- package/dist/consts.js +463 -0
- package/dist/descriptor.d.ts +12 -0
- package/dist/descriptor.js +10 -0
- package/dist/drawio-decode.d.ts +32 -0
- package/dist/drawio-decode.js +96 -0
- package/dist/drawio-import.d.ts +133 -0
- package/dist/drawio-import.js +885 -0
- package/dist/edge-morph.d.ts +154 -0
- package/dist/edge-morph.js +153 -0
- package/dist/edge-styles.d.ts +78 -0
- package/dist/edge-styles.js +210 -0
- package/dist/effects.d.ts +9 -0
- package/dist/effects.js +6 -0
- package/dist/element-renderer.d.ts +64 -0
- package/dist/element-renderer.js +114 -0
- package/dist/element-view.d.ts +234 -0
- package/dist/element-view.js +430 -0
- package/dist/export.d.ts +61 -0
- package/dist/export.js +41 -0
- package/dist/filename.d.ts +17 -0
- package/dist/filename.js +26 -0
- package/dist/frame-tag.d.ts +70 -0
- package/dist/frame-tag.js +78 -0
- package/dist/grammar.d.ts +695 -0
- package/dist/grammar.js +1436 -0
- package/dist/import.d.ts +306 -0
- package/dist/import.js +1270 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +67 -0
- package/dist/interchange.d.ts +125 -0
- package/dist/interchange.js +372 -0
- package/dist/keywords.d.ts +204 -0
- package/dist/keywords.js +361 -0
- package/dist/kinds.d.ts +73 -0
- package/dist/kinds.js +91 -0
- package/dist/legend.d.ts +30 -0
- package/dist/legend.js +255 -0
- package/dist/model.d.ts +862 -0
- package/dist/model.js +1316 -0
- package/dist/morph.d.ts +178 -0
- package/dist/morph.js +496 -0
- package/dist/node/act-glyphs.d.ts +30 -0
- package/dist/node/act-glyphs.js +142 -0
- package/dist/node/compartment-watcher.d.ts +107 -0
- package/dist/node/compartment-watcher.js +163 -0
- package/dist/node/fit.d.ts +85 -0
- package/dist/node/fit.js +129 -0
- package/dist/node/node-renderer.d.ts +49 -0
- package/dist/node/node-renderer.js +611 -0
- package/dist/node/node-view.d.ts +51 -0
- package/dist/node/node-view.js +89 -0
- package/dist/node/paint.d.ts +84 -0
- package/dist/node/paint.js +143 -0
- package/dist/node/sd-glyphs.d.ts +36 -0
- package/dist/node/sd-glyphs.js +79 -0
- package/dist/node/stm-glyphs.d.ts +22 -0
- package/dist/node/stm-glyphs.js +111 -0
- package/dist/node/tier-metrics.d.ts +38 -0
- package/dist/node/tier-metrics.js +45 -0
- package/dist/operators.d.ts +45 -0
- package/dist/operators.js +75 -0
- package/dist/plantuml-import.d.ts +113 -0
- package/dist/plantuml-import.js +1723 -0
- package/dist/plantuml.d.ts +94 -0
- package/dist/plantuml.js +985 -0
- package/dist/presets.d.ts +149 -0
- package/dist/presets.js +302 -0
- package/dist/profiles.d.ts +2 -0
- package/dist/profiles.js +358 -0
- package/dist/reading.d.ts +160 -0
- package/dist/reading.js +648 -0
- package/dist/roles.d.ts +257 -0
- package/dist/roles.js +997 -0
- package/dist/rules.d.ts +267 -0
- package/dist/rules.js +3090 -0
- package/dist/templates.d.ts +2 -0
- package/dist/templates.js +197 -0
- package/dist/toolbar/config.d.ts +228 -0
- package/dist/toolbar/config.js +833 -0
- package/dist/toolbar/icons.d.ts +440 -0
- package/dist/toolbar/icons.js +711 -0
- package/dist/toolbar/senior-tool.d.ts +11 -0
- package/dist/toolbar/senior-tool.js +21 -0
- package/dist/toolbar/uml-menu.d.ts +17 -0
- package/dist/toolbar/uml-menu.js +20 -0
- package/dist/toolbar/uml-senior-button.d.ts +18 -0
- package/dist/toolbar/uml-senior-button.js +22 -0
- package/dist/translations.d.ts +27 -0
- package/dist/translations.js +117 -0
- package/dist/view.d.ts +33 -0
- package/dist/view.js +236 -0
- package/dist/xmi-import.d.ts +174 -0
- package/dist/xmi-import.js +2268 -0
- package/dist/xmi.d.ts +61 -0
- package/dist/xmi.js +1860 -0
- package/dist/xml-reader.d.ts +157 -0
- package/dist/xml-reader.js +430 -0
- package/dist/xml.d.ts +72 -0
- package/dist/xml.js +96 -0
- package/package.json +38 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { type UmlDiagramKind, UmlDiagramElementModel, type UmlFragmentOperator } from '@formicoidea/labre-core/model';
|
|
2
|
+
import type { BlockStdScope } from '@formicoidea/labre-core/std';
|
|
3
|
+
import { type GfxPrimitiveElementModel } from '@formicoidea/labre-core/std/gfx';
|
|
4
|
+
import { type UmlEdgeRole } from './edge-styles.js';
|
|
5
|
+
/**
|
|
6
|
+
* Create a UML diagram frame centred on the viewport — the sheet one diagram is
|
|
7
|
+
* drawn on (Annex A).
|
|
8
|
+
*
|
|
9
|
+
* The KIND is written here and it is not optional: Annex A's heading is
|
|
10
|
+
* `<kind> <name>`, so a frame with no kind has nothing to write in its tag. It
|
|
11
|
+
* defaults to `class`, which is the diagram an architect reaches for first and
|
|
12
|
+
* the only one Annex A gives no abbreviation for — and the kind picker on the
|
|
13
|
+
* frame's own toolbar changes it afterwards.
|
|
14
|
+
*
|
|
15
|
+
* The NAME is seeded through the translation seam rather than left to the
|
|
16
|
+
* model's default, so a diagram drawn in a French host does not start out called
|
|
17
|
+
* "Diagram" (#183). The key is the diagram ROLE's: the two are the same noun,
|
|
18
|
+
* and a second key would ask a host to word it twice. It is content from that
|
|
19
|
+
* moment on — the heading is editable on a double-click — so it is asked for
|
|
20
|
+
* once and never re-resolved.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createUmlDiagram(std: BlockStdScope, kind?: UmlDiagramKind): void;
|
|
23
|
+
/**
|
|
24
|
+
* Create a use case SUBJECT centred on the viewport (§18.1.4) — the rectangle
|
|
25
|
+
* drawn around the use cases a system offers, with the actors left outside it.
|
|
26
|
+
*
|
|
27
|
+
* No variant and no kind, unlike a C4 boundary: §18.1.4 draws ONE rectangle with
|
|
28
|
+
* ONE name, so there is nothing for a discriminant to discriminate.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createUmlSubject(std: BlockStdScope): void;
|
|
31
|
+
/**
|
|
32
|
+
* Create an activity PARTITION — a swimlane (§15.6.4), the band an activity
|
|
33
|
+
* diagram draws round the steps one participant is responsible for.
|
|
34
|
+
*
|
|
35
|
+
* ## Why a background and not a field on the frame
|
|
36
|
+
*
|
|
37
|
+
* Because membership is GEOMETRIC and partitions nest and overlap: §15.6.4 lets
|
|
38
|
+
* a diagram be cut vertically by role and horizontally by phase at the same
|
|
39
|
+
* time, and an action belongs to whichever bands its centre falls in. A list of
|
|
40
|
+
* lane names on `umlDiagram` could express neither, and adding a field to a
|
|
41
|
+
* shipped model is the red zone `docs/adr/0009` guards. So a partition is an
|
|
42
|
+
* element like the subject beside it, read at audit and export time by centre
|
|
43
|
+
* containment (R11).
|
|
44
|
+
*
|
|
45
|
+
* ## VERTICAL, and it is a default rather than a preference
|
|
46
|
+
*
|
|
47
|
+
* §15.6.4's own figures are drawn as vertical columns, which is also the way a
|
|
48
|
+
* left-to-right flow reads: the steps travel across the lanes rather than down
|
|
49
|
+
* them. The model's own default says so, and this site deliberately writes no
|
|
50
|
+
* `orientation` at all — a creation that restated the default would be a second
|
|
51
|
+
* place for it to be changed, and the band's own toolbar is where an author
|
|
52
|
+
* turns a column into a row.
|
|
53
|
+
*/
|
|
54
|
+
export declare function createUmlPartition(std: BlockStdScope): void;
|
|
55
|
+
/**
|
|
56
|
+
* Create a REGION — the rounded, named rectangle a composite state is drawn as
|
|
57
|
+
* (§14.2.4), and the container its sub-states sit inside.
|
|
58
|
+
*
|
|
59
|
+
* A composite state IS a region here rather than a `state` node holding
|
|
60
|
+
* regions, and the simplification is deliberate and has a ceiling worth
|
|
61
|
+
* stating: §14.2.4 draws a composite state as a rounded rectangle with its name
|
|
62
|
+
* in a band at the top and its sub-machine below, which is exactly this
|
|
63
|
+
* element. What it does NOT give is a state with two or more ORTHOGONAL regions
|
|
64
|
+
* separated by dashed lines — that is one state drawn as several boxes, and it
|
|
65
|
+
* is a phase-3 refinement rather than something this element can be stretched
|
|
66
|
+
* into.
|
|
67
|
+
*/
|
|
68
|
+
export declare function createUmlRegion(std: BlockStdScope): void;
|
|
69
|
+
/**
|
|
70
|
+
* Create a COMBINED FRAGMENT — the box §17.6.4 draws round the part of an
|
|
71
|
+
* interaction that only happens sometimes, or happens repeatedly, or happens in
|
|
72
|
+
* parallel with something else.
|
|
73
|
+
*
|
|
74
|
+
* ## Why the operator is a parameter and the name is not a title
|
|
75
|
+
*
|
|
76
|
+
* §17.6.4 draws the fragment as a rectangle with a pentagon tag in its
|
|
77
|
+
* top-left corner holding the INTERACTION OPERATOR — `alt`, `opt`, `loop`,
|
|
78
|
+
* `par` — and that word is what the frame IS. It is written here rather than
|
|
79
|
+
* left to the model's default for the same reason `createUmlDiagram` writes a
|
|
80
|
+
* kind: the tag has to have something in it from the first frame the author
|
|
81
|
+
* draws, and the picker on the fragment's own row is what changes it
|
|
82
|
+
* afterwards.
|
|
83
|
+
*
|
|
84
|
+
* ## Nothing is NAMED, which is the one place this frame differs from the other
|
|
85
|
+
* three
|
|
86
|
+
*
|
|
87
|
+
* A diagram, a subject, a partition and a region are all seeded with a default
|
|
88
|
+
* name through the translation seam. This one is not, and the model says why in
|
|
89
|
+
* as many words: its `name` is the GUARD of the first operand — §17.6.4's
|
|
90
|
+
* `[condition]` — or, under `ref`, the name of the interaction being referred
|
|
91
|
+
* to (§17.7.4), and the notation draws a guard only where there is one. An
|
|
92
|
+
* `alt` born carrying `[condition]` would be a condition the author never
|
|
93
|
+
* wrote, sitting on the picture until somebody noticed and deleted it. So the
|
|
94
|
+
* field is left at the model's empty default and the author writes the guard
|
|
95
|
+
* into the band on a double-click, exactly as a state's behaviour compartment
|
|
96
|
+
* is seeded empty for the same reason (§14.2.4).
|
|
97
|
+
*
|
|
98
|
+
* ## One frame, no operands
|
|
99
|
+
*
|
|
100
|
+
* A fresh fragment has ONE zone and therefore no `operands` at all — the same
|
|
101
|
+
* promise a BPMN pool makes about its lanes, and the same bytes: nothing is
|
|
102
|
+
* written until the author asks for a second operand from the row, and the
|
|
103
|
+
* dashed separator §17.6.4 draws appears with it. An `alt` with one branch is
|
|
104
|
+
* the honest first draft of an `alt`, and a stencil that seeded two would be
|
|
105
|
+
* putting a branch on the sheet nobody asked for.
|
|
106
|
+
*/
|
|
107
|
+
export declare function createUmlFragment(std: BlockStdScope, operator?: UmlFragmentOperator): void;
|
|
108
|
+
/**
|
|
109
|
+
* Create an INTERACTION USE — §17.7.4's `ref` frame, the box that says "and
|
|
110
|
+
* here the sequence described on another sheet happens".
|
|
111
|
+
*
|
|
112
|
+
* The same element as {@link createUmlFragment} with a different operator, and
|
|
113
|
+
* that is §17.7.4's own doing rather than an economy: an InteractionUse is
|
|
114
|
+
* drawn as the very rectangle a combined fragment is, with `ref` in the
|
|
115
|
+
* pentagon instead of `alt`, and the name of the referenced interaction in the
|
|
116
|
+
* fragment's own `name` — which this pack anchors where every other guard is
|
|
117
|
+
* written, at the top-left of the plot, rather than centred as §17.7.4's figure
|
|
118
|
+
* draws it. Giving it an element of its own would mean two things to
|
|
119
|
+
* select, two rows, two sets of rules and two exporters for one picture.
|
|
120
|
+
*
|
|
121
|
+
* It has a COMMAND of its own all the same, because it is a different modelling
|
|
122
|
+
* act: an author reaching for `ref` is pointing at another diagram, not
|
|
123
|
+
* branching this one, and making them draw an `alt` and then change the
|
|
124
|
+
* operator would be hiding a gesture behind a dropdown.
|
|
125
|
+
*/
|
|
126
|
+
export declare function createUmlInteractionUse(std: BlockStdScope): void;
|
|
127
|
+
/**
|
|
128
|
+
* The kinds drawn as a divided rectangle (§9.2.4, §9.8.4, §11.6.4, §19.3.4).
|
|
129
|
+
*
|
|
130
|
+
* Phase 2 adds two, and both are boxes rather than pictures for the reason the
|
|
131
|
+
* first four are: a **component** is a Class (§11.6) drawn as a classifier
|
|
132
|
+
* rectangle with the two-tab mark in its corner, and an **artifact** is a
|
|
133
|
+
* classifier drawn as a rectangle with a document mark in the same corner and
|
|
134
|
+
* `«artifact»` over the name (§19.3.4). Neither mark replaces the box — they
|
|
135
|
+
* are stamped ON it — so both walk the compartment path and arrive with the
|
|
136
|
+
* tiers their kind is worth.
|
|
137
|
+
*/
|
|
138
|
+
export type UmlClassifierKind = 'class' | 'interface' | 'enumeration' | 'object' | 'component' | 'artifact' | 'state';
|
|
139
|
+
/**
|
|
140
|
+
* The kinds the notation draws as a picture rather than as a box.
|
|
141
|
+
*
|
|
142
|
+
* Phase 2 adds six, and each earns its place here by having no compartment to
|
|
143
|
+
* divide: a **port** is a filled square on a border (§11.3.4), a **provided**
|
|
144
|
+
* and a **required interface** are the ball and the socket on a stub (§10.4.4),
|
|
145
|
+
* and a **node**, a **device** and an **execution environment** are the 3D box
|
|
146
|
+
* of §19.4.4 — a drawing with a front face, a top and a side, not a rectangle
|
|
147
|
+
* with lines across it.
|
|
148
|
+
*/
|
|
149
|
+
export type UmlGlyphKind = 'package' | 'note' | 'actor' | 'use-case' | 'port' | 'provided-interface' | 'required-interface' | 'node' | 'device' | 'execution-environment' | 'action' | 'initial' | 'activity-final' | 'flow-final' | 'decision' | 'fork' | 'object-node' | 'send-signal' | 'accept-event' | 'time-event' | 'final-state' | 'choice' | 'junction' | 'shallow-history' | 'deep-history' | 'entry-point' | 'exit-point' | 'terminate' | 'lifeline' | 'execution' | 'destruction';
|
|
150
|
+
/**
|
|
151
|
+
* Create one of the SINGLE-LABEL artefacts — a package, a note, an actor, a use
|
|
152
|
+
* case, and since phase 2 a port, the two interface marks and the three
|
|
153
|
+
* deployment cubes — as the shape, its one word-bearing child, and the group
|
|
154
|
+
* that makes the two one thing.
|
|
155
|
+
*
|
|
156
|
+
* ## Why three elements and not one shape carrying text
|
|
157
|
+
*
|
|
158
|
+
* R16: a label is a free text element grouped with the shape, never text ON the
|
|
159
|
+
* shape. The pack has to obey it here even though these have only one tier,
|
|
160
|
+
* because a classifier next door has three — and two mechanisms for "the words
|
|
161
|
+
* on a UML artefact" would mean two editors, two toolbars and two sets of rules
|
|
162
|
+
* for the same gesture. One click selects the artefact, a second descends into
|
|
163
|
+
* its label.
|
|
164
|
+
*
|
|
165
|
+
* ## `uml:name` for five of them, `uml:label` for the rest
|
|
166
|
+
*
|
|
167
|
+
* See {@link NAMED_GLYPHS}: a package, a note and the three cubes carry a NAME
|
|
168
|
+
* the grammar parses a keyword off; a port, a ball and a socket carry a LABEL.
|
|
169
|
+
* Keeping them apart is what lets the exporter read a tier without first asking
|
|
170
|
+
* what shape it is under.
|
|
171
|
+
*
|
|
172
|
+
* ## The label is where the notation puts it, and that is not this file's call
|
|
173
|
+
*
|
|
174
|
+
* The box comes out of {@link umlCompartmentBoxes}, which is where every
|
|
175
|
+
* "beside the glyph" and "inside the front face" decision is written down: a
|
|
176
|
+
* port's label sits next to the square rather than on it (the square is 16
|
|
177
|
+
* units, and words do not fit in it), an interface mark's sits beside the ball
|
|
178
|
+
* or the socket, and a cube's sits in its FRONT FACE, which is the only part of
|
|
179
|
+
* a 3D box §19.4.4 writes in. Creation reads the answer; it does not have one.
|
|
180
|
+
*
|
|
181
|
+
* ## The alignments
|
|
182
|
+
*
|
|
183
|
+
* Centred, except the NOTE. A note holds a sentence rather than a title (Annex
|
|
184
|
+
* A), and a centred paragraph of three lines is the one thing on a UML diagram
|
|
185
|
+
* that reads as a poem.
|
|
186
|
+
*
|
|
187
|
+
* ## The kinds that get no words at all, and no group either
|
|
188
|
+
*
|
|
189
|
+
* Phase 2's behaviour vocabulary is the first in this pack with artefacts that
|
|
190
|
+
* carry NOTHING: a filled disc, a bullseye, a bar, a cross. §15.3.4 and §14.2.4
|
|
191
|
+
* name none of them — an initial node has no name, a fork has no name, a
|
|
192
|
+
* history mark is an `H` and a final state is a target — and a stencil that
|
|
193
|
+
* seeded one would be putting a word on the picture that the notation says is
|
|
194
|
+
* not there, which the `label-presence` audits would then be right to complain
|
|
195
|
+
* about forever.
|
|
196
|
+
*
|
|
197
|
+
* {@link UML_UNLABELLED_KINDS} is that list, and creation READS it rather than
|
|
198
|
+
* restating it: those kinds arrive as the shape and nothing else — no text, and
|
|
199
|
+
* therefore no group, because a group of one element is a wrapper round nothing
|
|
200
|
+
* that a user would have to descend through to reach the mark it holds. The
|
|
201
|
+
* SHAPE is what the gesture produced, so the shape is what is selected.
|
|
202
|
+
*
|
|
203
|
+
* Every kind that IS labelled here takes exactly one tier, and the one that
|
|
204
|
+
* would have been the exception does not travel this path at all: a **state**
|
|
205
|
+
* is a divided box (§14.2.4) and is built by {@link createUmlClassifier}, whose
|
|
206
|
+
* walk gives it the name compartment and the behaviour compartment the renderer
|
|
207
|
+
* rules off and the exporter reads.
|
|
208
|
+
*/
|
|
209
|
+
export declare function createUmlNode(std: BlockStdScope, kind: UmlGlyphKind): void;
|
|
210
|
+
/**
|
|
211
|
+
* Create one of the COMPARTMENTED artefacts — a class, an interface, an
|
|
212
|
+
* enumeration, an object, and since phase 2 a component, an artifact or a
|
|
213
|
+
* state — as the shape, its compartments, and the group.
|
|
214
|
+
*
|
|
215
|
+
* ## How many tiers is the LAYOUT's answer, not this file's
|
|
216
|
+
*
|
|
217
|
+
* The walk below writes a tier for each box `umlCompartmentBoxes` returns and
|
|
218
|
+
* for no other, which is what lets two kinds be added to the notation without a
|
|
219
|
+
* line changing here: a component and an artifact arrive with the name tier and
|
|
220
|
+
* the one body tier §11.6.4 and §19.3.4 draw them with, because that is what the
|
|
221
|
+
* layout hands over. The alternative — a table of tier counts in this file —
|
|
222
|
+
* would be a second statement of the geometry, and the first one to drift.
|
|
223
|
+
*
|
|
224
|
+
* ## Four or five elements, and the object is the four
|
|
225
|
+
*
|
|
226
|
+
* A class, an interface and an enumeration arrive as shape + name + attributes +
|
|
227
|
+
* operations + group. An OBJECT arrives with no operations compartment at all,
|
|
228
|
+
* and that is §9.8.4 rather than an economy: an instance specification has
|
|
229
|
+
* SLOTS — values its attributes hold — and no behaviour of its own. Its second
|
|
230
|
+
* tier is stamped `uml:attributes` all the same, because a slot is what an
|
|
231
|
+
* attribute is worth on an instance, and giving it a fifth role would make every
|
|
232
|
+
* reader of the vocabulary handle two spellings of one idea.
|
|
233
|
+
*
|
|
234
|
+
* ## Seeded, not empty
|
|
235
|
+
*
|
|
236
|
+
* Every tier carries the stencil's own prompt from the moment the artefact is
|
|
237
|
+
* drawn: the kind's name line (`«interface»\nInterface` for an interface —
|
|
238
|
+
* §9.5.4's keyword, which is what tells the reader it is not a class),
|
|
239
|
+
* `+ attribute : Type`, `+ operation() : Type`. The author meets a worked
|
|
240
|
+
* example of the notation rather than an empty box, and the grammar can be read
|
|
241
|
+
* back off it immediately.
|
|
242
|
+
*
|
|
243
|
+
* ## The name is the one bold tier, and the features are read LEFT
|
|
244
|
+
*
|
|
245
|
+
* A compartment of attributes is a LIST of signatures, and a list is read down
|
|
246
|
+
* its left edge: centring `+ attribute : Type` over `+ operation() : Type` would
|
|
247
|
+
* put the `+` of every line in a different column and cost the reader the one
|
|
248
|
+
* visual cue UML gives for visibility (§9.5.4).
|
|
249
|
+
*/
|
|
250
|
+
export declare function createUmlClassifier(std: BlockStdScope, kind: UmlClassifierKind): void;
|
|
251
|
+
/**
|
|
252
|
+
* The edges the toolbox arms, and the style each wears, are ONE table — and it
|
|
253
|
+
* lives in `./edge-styles.js` so the morph that retypes a connector somebody
|
|
254
|
+
* already drew reads the very rows this tool writes. Re-exported here because
|
|
255
|
+
* the union is what {@link activateUmlEdge} takes, and a caller holding this
|
|
256
|
+
* module should not have to know which file it was written in.
|
|
257
|
+
*/
|
|
258
|
+
export type { UmlEdgeRole };
|
|
259
|
+
/**
|
|
260
|
+
* Arm the native connector tool, pre-styled for one UML relationship.
|
|
261
|
+
*
|
|
262
|
+
* ## One function for every edge, where C4 and BPMN wrote one each
|
|
263
|
+
*
|
|
264
|
+
* Because UML has twelve of them and they differ on three props out of a table
|
|
265
|
+
* that is otherwise identical — the same mode, the same ink, the same weight. A
|
|
266
|
+
* dozen near-identical functions would be a dozen places for a stroke width to
|
|
267
|
+
* drift, and {@link UML_EDGE_STYLE} is the notation itself, which is the thing
|
|
268
|
+
* worth reading. It is also what made phase 2 free: `deploy`, `manifest` and
|
|
269
|
+
* `communication-path` arm through this function without a line changing in it.
|
|
270
|
+
*
|
|
271
|
+
* ## STRAIGHT, always
|
|
272
|
+
*
|
|
273
|
+
* A class diagram is a graph, not a process laid out in lanes: the elbows an
|
|
274
|
+
* orthogonal router adds would read as a route through the diagram that nobody
|
|
275
|
+
* drew. BPMN routes orthogonally because a sequence flow really does travel
|
|
276
|
+
* through a layout; UML's lines state a relationship between two classifiers and
|
|
277
|
+
* the shortest one says it best.
|
|
278
|
+
*
|
|
279
|
+
* The role is carried by the TOOL, so the connector is born with it rather than
|
|
280
|
+
* acquiring one afterwards (`docs/adr/0010`) — and the look rides on the
|
|
281
|
+
* activation, never through the last-props store: the plain connector tool must
|
|
282
|
+
* keep the user's own style (#144 M1).
|
|
283
|
+
*/
|
|
284
|
+
export declare function activateUmlEdge(std: BlockStdScope, role: UmlEdgeRole): void;
|
|
285
|
+
/**
|
|
286
|
+
* The diagram frames of the current selection, on an EDITABLE document.
|
|
287
|
+
*
|
|
288
|
+
* The read-only filter is here rather than delegated to the caller because it
|
|
289
|
+
* belongs to what this list is FOR: generating a legend writes elements onto the
|
|
290
|
+
* canvas, so it is offered only where writing is possible. The export's own
|
|
291
|
+
* {@link umlDiagramsForExport} deliberately has no such filter — reading a
|
|
292
|
+
* diagram and handing the reader a file is exactly what a published, read-only
|
|
293
|
+
* document is for.
|
|
294
|
+
*/
|
|
295
|
+
export declare function umlDiagramsSelected(std: BlockStdScope): UmlDiagramElementModel[];
|
|
296
|
+
/**
|
|
297
|
+
* Draw the legend of what is actually on the selected frame, bottom-left of it.
|
|
298
|
+
*
|
|
299
|
+
* The FIRST selected frame and no other: a legend is placed relative to one
|
|
300
|
+
* background, and two of them would put two boxes on top of whatever sits in
|
|
301
|
+
* that corner. Everything about the gesture — the scan, the placement, the box —
|
|
302
|
+
* is `createBoardLegend`'s; UML contributes nothing but the rows its own
|
|
303
|
+
* commands subscribe (`commands.ts`, `docs/adr/0026`).
|
|
304
|
+
*
|
|
305
|
+
* The one action in this file with no command behind it, exactly as in C4: the
|
|
306
|
+
* legend is reached from the selected frame's contextual toolbar and from
|
|
307
|
+
* nowhere else (PO arbitration, 27/08/2026 — see `toolbar/config.ts`). It is a
|
|
308
|
+
* legend OF something you have in front of you, not an artefact to pick off a
|
|
309
|
+
* palette. Kept here beside its siblings all the same, because it is the same
|
|
310
|
+
* kind of thing — a gesture that writes elements — and because a unit test can
|
|
311
|
+
* drive it without a toolbar.
|
|
312
|
+
*
|
|
313
|
+
* A legend earns its place in UML more than in most packs: the notation's dozen
|
|
314
|
+
* relationships differ by a diamond's fill and a triangle's outline, and a
|
|
315
|
+
* reader who is not fluent in §11.5.4 cannot tell a shared aggregation from a
|
|
316
|
+
* composition without a key on the sheet.
|
|
317
|
+
*/
|
|
318
|
+
export declare function createUmlLegend(std: BlockStdScope): void;
|
|
319
|
+
/**
|
|
320
|
+
* The diagrams the export speaks about: the SELECTED ones, or every diagram on
|
|
321
|
+
* the surface when nothing is selected.
|
|
322
|
+
*
|
|
323
|
+
* ## Why the fallback, where C4 has none
|
|
324
|
+
*
|
|
325
|
+
* `c4BoardsForExport` returns the selection and stops there, because a C4 board
|
|
326
|
+
* is one LEVEL of one model and merging three of them produces the picture C4
|
|
327
|
+
* exists to stop people drawing. UML is the opposite object: ADR 0017 ships the
|
|
328
|
+
* four diagram kinds as ONE framework precisely because they are views of one
|
|
329
|
+
* model — the classes in a class diagram are the classifiers the objects in the
|
|
330
|
+
* object diagram instantiate — and both target formats are built to hold all of
|
|
331
|
+
* them. An XMI `uml:Model` is a single model element holding every packaged
|
|
332
|
+
* element; a `.puml` file is one document. So a document with four frames on it
|
|
333
|
+
* and nothing selected exports as the model it is.
|
|
334
|
+
*
|
|
335
|
+
* Selecting a frame narrows it, which is the gesture an author makes when they
|
|
336
|
+
* want one diagram out of a page of them.
|
|
337
|
+
*
|
|
338
|
+
* No read-only filter: an export WRITES nothing. A diagram published read-only
|
|
339
|
+
* is precisely the one somebody wants to take away.
|
|
340
|
+
*/
|
|
341
|
+
export declare function umlDiagramsForExport(std: BlockStdScope): UmlDiagramElementModel[];
|
|
342
|
+
/**
|
|
343
|
+
* The elements the export speaks about, as ONE list the declared capability
|
|
344
|
+
* takes: the diagrams in scope, then everything else on the surface in document
|
|
345
|
+
* order.
|
|
346
|
+
*
|
|
347
|
+
* The scope is expressed by which DIAGRAMS are in the list — that is the
|
|
348
|
+
* capability's contract for this framework (`interchange.ts`) — so an unselected
|
|
349
|
+
* frame is the one thing left out, and the exporter's own geometric attribution
|
|
350
|
+
* reads back exactly what {@link umlDiagramsForExport} says.
|
|
351
|
+
*
|
|
352
|
+
* Document order matters and is preserved for the same reason it does in BPMN
|
|
353
|
+
* and C4: it is the tie-break attribution breaks on — a centre inside two
|
|
354
|
+
* overlapping subjects goes to the first — and sorting here would make the file
|
|
355
|
+
* disagree with the badge the user can see.
|
|
356
|
+
*
|
|
357
|
+
* The compartment texts and the groups that say whose words they are ride along
|
|
358
|
+
* untouched: a tier belongs to its node through the GROUP rather than through
|
|
359
|
+
* the geometry, so both lists cross the seam whole and unfiltered.
|
|
360
|
+
*/
|
|
361
|
+
export declare function umlExportElementsOf(std: BlockStdScope): readonly GfxPrimitiveElementModel[];
|
|
362
|
+
/**
|
|
363
|
+
* What the downloaded file is called, minus the extension.
|
|
364
|
+
*
|
|
365
|
+
* The document's own title first — a diagram is what the file is OF — then the
|
|
366
|
+
* name of the frame whose toolbar launched the export, then a last resort.
|
|
367
|
+
* Making the answer safe to write to disk is {@link umlSafeFilename}'s job, so
|
|
368
|
+
* the command and the interchange capability cannot name the same diagram
|
|
369
|
+
* differently.
|
|
370
|
+
*/
|
|
371
|
+
export declare function umlExportFilename(std: BlockStdScope): string;
|
|
372
|
+
/**
|
|
373
|
+
* Serialize the diagrams in scope as PlantUML and hand the file to the browser.
|
|
374
|
+
*
|
|
375
|
+
* Three steps, and only the first and the last know what an editor is: read the
|
|
376
|
+
* surface, run the DECLARED capability (`docs/adr/0012`), download what it
|
|
377
|
+
* produced. The middle step is not re-implemented here — the document, the
|
|
378
|
+
* filename and the content type all come out of `UML_PLANTUML_EXPORT.run`, so
|
|
379
|
+
* the command and the registry cannot describe the same diagram differently.
|
|
380
|
+
* There is one door; the registry is the label on it.
|
|
381
|
+
*/
|
|
382
|
+
export declare function exportUmlPlantumlFile(std: BlockStdScope): void;
|
|
383
|
+
/**
|
|
384
|
+
* Serialize the diagrams in scope as XMI 2.5.1 and hand the file to the browser.
|
|
385
|
+
*
|
|
386
|
+
* The same three steps as {@link exportUmlPlantumlFile}, against the other
|
|
387
|
+
* capability. Two formats because they answer different questions: PlantUML is
|
|
388
|
+
* what a reader diffs and commits next to the code, XMI is what another UML tool
|
|
389
|
+
* reads back — the OMG's own interchange format, and the reason this pack
|
|
390
|
+
* implements 2.5.1 rather than a dialect.
|
|
391
|
+
*/
|
|
392
|
+
export declare function exportUmlXmiFile(std: BlockStdScope): void;
|
|
393
|
+
/**
|
|
394
|
+
* Read a PlantUML source the user picks, draw it, and say what it cost.
|
|
395
|
+
*
|
|
396
|
+
* The whole gesture is {@link runInterchangeImportFile}, over the capability
|
|
397
|
+
* UML declares: pick the file, run the DECLARED reader, write what it returned,
|
|
398
|
+
* fit the drawing, report. `UML_PLANTUML_IMPORT.run` is the same function
|
|
399
|
+
* labre-mcp calls, so the command and the registry cannot read the same file
|
|
400
|
+
* differently — one door, and the registry is the label on it. The picker's
|
|
401
|
+
* filter comes off `UML_PLANTUML_FORMAT` rather than a table of file types, so
|
|
402
|
+
* `.plantuml` is offered beside `.puml` because the declaration says both.
|
|
403
|
+
*
|
|
404
|
+
* Three commands and three one-line bodies, which is the point of the seam: a
|
|
405
|
+
* second format costs a declaration and a command, never a pipeline. What
|
|
406
|
+
* differs between them is the PROMISE, and the promise is made by each
|
|
407
|
+
* command's own label and description before the picker ever opens (ADR 0012
|
|
408
|
+
* P2) — two semantic readers that carry the model, and one visual reader that
|
|
409
|
+
* recognises a drawing.
|
|
410
|
+
*/
|
|
411
|
+
export declare function importUmlPlantumlFile(std: BlockStdScope): Promise<void>;
|
|
412
|
+
/** Read an XMI 2.5.1 document the user picks. The same four steps. */
|
|
413
|
+
export declare function importUmlXmiFile(std: BlockStdScope): Promise<void>;
|
|
414
|
+
/**
|
|
415
|
+
* Read a draw.io drawing the user picks — the one import with a step before the
|
|
416
|
+
* reader (`docs/adr/0019`).
|
|
417
|
+
*
|
|
418
|
+
* A `.drawio` file holds its `<mxGraphModel>` as base64 of a raw deflate, and
|
|
419
|
+
* inflating it needs `DecompressionStream`: a platform API, asynchronous, and
|
|
420
|
+
* therefore forbidden inside a reader that ADR 0012 P3 makes pure. So the
|
|
421
|
+
* unwrapping rides on the pipeline's `decode` hook, which runs here — where
|
|
422
|
+
* there is already an editor and an `await` — and `UML_DRAWIO_IMPORT.run` still
|
|
423
|
+
* takes decoded XML and still answers a compressed payload with a remark rather
|
|
424
|
+
* than a guess.
|
|
425
|
+
*
|
|
426
|
+
* {@link decodeDrawio} is identity for a file that is already plain XML, so the
|
|
427
|
+
* `.drawio.xml` case and the "Compressed: off" case cost nothing and take the
|
|
428
|
+
* same path.
|
|
429
|
+
*/
|
|
430
|
+
export declare function importUmlDrawioFile(std: BlockStdScope): Promise<void>;
|