@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,94 @@
|
|
|
1
|
+
import { type UmlModel } from './model.js';
|
|
2
|
+
/**
|
|
3
|
+
* One diagram as **PlantUML** source (https://plantuml.com/class-diagram).
|
|
4
|
+
*
|
|
5
|
+
* ## Why PlantUML beside XMI
|
|
6
|
+
*
|
|
7
|
+
* They answer different questions. XMI is what a MODELLING TOOL reads — it
|
|
8
|
+
* carries the metamodel, and no human opens it. PlantUML is what a repository
|
|
9
|
+
* reads: it goes in a `docs/` folder beside the code, it diffs line by line in a
|
|
10
|
+
* review, and the architect who wrote the diagram can still read it a year
|
|
11
|
+
* later. A framework that only exported XMI would be a framework whose diagrams
|
|
12
|
+
* cannot live in version control.
|
|
13
|
+
*
|
|
14
|
+
* ## What it writes, and what it declines to
|
|
15
|
+
*
|
|
16
|
+
* No `skinparam`, not one line. A `skinparam` is a THEME, and a theme baked into
|
|
17
|
+
* an exported file overrides whatever the repository it lands in has decided
|
|
18
|
+
* about how its diagrams look — silently, and in every diagram, forever. Labre's
|
|
19
|
+
* canvas colours are Labre's; the file carries the model.
|
|
20
|
+
*
|
|
21
|
+
* Member lines are written back VERBATIM, and that is a decision rather than
|
|
22
|
+
* laziness: PlantUML's member syntax IS UML's own §9.5.4 / §9.6.4 notation, the
|
|
23
|
+
* same grammar the author typed in the compartment. Re-spelling a parsed
|
|
24
|
+
* property could only lose what the parser did not model — a constraint, an
|
|
25
|
+
* unusual modifier, a qualified redefinition — so the parser is used where
|
|
26
|
+
* PlantUML needs STRUCTURE it cannot infer (an enumeration's literals, an
|
|
27
|
+
* object's slots) and nowhere else.
|
|
28
|
+
*
|
|
29
|
+
* ## The one thing it drops, said out loud
|
|
30
|
+
*
|
|
31
|
+
* A PORT. §11.3.4's small square has a place in the XMI file — it is an
|
|
32
|
+
* `ownedAttribute` of its component, with an id other elements can point at —
|
|
33
|
+
* and in a `.puml` it would have to be a `port` declaration inside a
|
|
34
|
+
* `component … { }` block, which is a recent addition to the language and not
|
|
35
|
+
* one every renderer in a repository's toolchain has. What the port CARRIES is
|
|
36
|
+
* not lost: the lollipops and sockets drawn on it are attributed to its
|
|
37
|
+
* component by `model.ts` and written below, so the picture still says which
|
|
38
|
+
* contracts the component offers and needs. Only the square itself goes, and
|
|
39
|
+
* the day the `port` syntax is safe to assume it is four lines here and a
|
|
40
|
+
* golden.
|
|
41
|
+
*
|
|
42
|
+
* ## Pure
|
|
43
|
+
*
|
|
44
|
+
* A model in, a string out. No `std`, no DOM, no clock — `docs/adr/0012` P3.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* An alias — the identifier every declaration takes and every relation refers
|
|
48
|
+
* back to.
|
|
49
|
+
*
|
|
50
|
+
* Derived from the NAME rather than from the surface id, because an alias is
|
|
51
|
+
* READ: `customer --> order` says what it relates and `_x7fQa --> _9bTz1` says
|
|
52
|
+
* nothing at all to the person who opens the file. The folding is deliberately
|
|
53
|
+
* lossy — ASCII only, since PlantUML's bare identifier is a word and a unicode
|
|
54
|
+
* one needs quoting everywhere — and the NAME is preserved separately, in the
|
|
55
|
+
* quoted label every declaration carries.
|
|
56
|
+
*/
|
|
57
|
+
export declare function toPlantumlAlias(raw: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* A label, as something PlantUML can carry inside `"…"`.
|
|
60
|
+
*
|
|
61
|
+
* Two transformations, and both are a thing the grammar cannot express:
|
|
62
|
+
*
|
|
63
|
+
* - **a line break becomes `\n`**, PlantUML's own escape. A declaration is one
|
|
64
|
+
* line and a canvas label routinely is not — it is how a class name fits in
|
|
65
|
+
* its box — so a raw newline would end the statement halfway through;
|
|
66
|
+
* - **`"` becomes `'`**, because PlantUML has no escape for a double quote
|
|
67
|
+
* inside a quoted label: the first one ENDS it, and the rest of the line is
|
|
68
|
+
* read as syntax.
|
|
69
|
+
*
|
|
70
|
+
* Nothing else is touched. Accents, CJK and emoji go through unharmed: they are
|
|
71
|
+
* text, PlantUML carries text, and folding them would be this exporter
|
|
72
|
+
* rewriting somebody's diagram.
|
|
73
|
+
*/
|
|
74
|
+
export declare function toPlantumlLabel(raw: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* One diagram, as one complete PlantUML document.
|
|
77
|
+
*
|
|
78
|
+
* Elements first, nested in the packages and subjects they are drawn inside,
|
|
79
|
+
* then every relationship — PlantUML resolves an arrow by alias, and an element
|
|
80
|
+
* declared after the line referring to it renders as a bare box with none of its
|
|
81
|
+
* members.
|
|
82
|
+
*
|
|
83
|
+
* Containment is geometric, exactly as it is in `xmi.ts` and for the same
|
|
84
|
+
* reason: on a UML diagram, a class drawn inside a package IS in that package
|
|
85
|
+
* (§12.2.4), and a use case inside the subject rectangle IS the subject's
|
|
86
|
+
* (§18.1.4). Layout is the statement here, which is the one place this exporter
|
|
87
|
+
* reads geometry at all.
|
|
88
|
+
*
|
|
89
|
+
* The `title` is the diagram's own HEADING — `class Orders`, Annex A's frame tag
|
|
90
|
+
* — and there is no option to override it: the document's name is a different
|
|
91
|
+
* fact about a different thing, and substituting it would drop the kind tag,
|
|
92
|
+
* which is the half of the heading a `.puml` has nowhere else to put.
|
|
93
|
+
*/
|
|
94
|
+
export declare function exportPlantuml(model: UmlModel): string;
|