@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.
Files changed (114) hide show
  1. package/LICENSE +384 -0
  2. package/dist/actions.d.ts +430 -0
  3. package/dist/actions.js +724 -0
  4. package/dist/background.d.ts +153 -0
  5. package/dist/background.js +557 -0
  6. package/dist/board-hit.d.ts +137 -0
  7. package/dist/board-hit.js +191 -0
  8. package/dist/commands-manifest.d.ts +19 -0
  9. package/dist/commands-manifest.js +571 -0
  10. package/dist/commands.d.ts +4 -0
  11. package/dist/commands.js +983 -0
  12. package/dist/component.d.ts +521 -0
  13. package/dist/component.js +708 -0
  14. package/dist/consts.d.ts +365 -0
  15. package/dist/consts.js +463 -0
  16. package/dist/descriptor.d.ts +12 -0
  17. package/dist/descriptor.js +10 -0
  18. package/dist/drawio-decode.d.ts +32 -0
  19. package/dist/drawio-decode.js +96 -0
  20. package/dist/drawio-import.d.ts +133 -0
  21. package/dist/drawio-import.js +885 -0
  22. package/dist/edge-morph.d.ts +154 -0
  23. package/dist/edge-morph.js +153 -0
  24. package/dist/edge-styles.d.ts +78 -0
  25. package/dist/edge-styles.js +210 -0
  26. package/dist/effects.d.ts +9 -0
  27. package/dist/effects.js +6 -0
  28. package/dist/element-renderer.d.ts +64 -0
  29. package/dist/element-renderer.js +114 -0
  30. package/dist/element-view.d.ts +234 -0
  31. package/dist/element-view.js +430 -0
  32. package/dist/export.d.ts +61 -0
  33. package/dist/export.js +41 -0
  34. package/dist/filename.d.ts +17 -0
  35. package/dist/filename.js +26 -0
  36. package/dist/frame-tag.d.ts +70 -0
  37. package/dist/frame-tag.js +78 -0
  38. package/dist/grammar.d.ts +695 -0
  39. package/dist/grammar.js +1436 -0
  40. package/dist/import.d.ts +306 -0
  41. package/dist/import.js +1270 -0
  42. package/dist/index.d.ts +47 -0
  43. package/dist/index.js +67 -0
  44. package/dist/interchange.d.ts +125 -0
  45. package/dist/interchange.js +372 -0
  46. package/dist/keywords.d.ts +204 -0
  47. package/dist/keywords.js +361 -0
  48. package/dist/kinds.d.ts +73 -0
  49. package/dist/kinds.js +91 -0
  50. package/dist/legend.d.ts +30 -0
  51. package/dist/legend.js +255 -0
  52. package/dist/model.d.ts +862 -0
  53. package/dist/model.js +1316 -0
  54. package/dist/morph.d.ts +178 -0
  55. package/dist/morph.js +496 -0
  56. package/dist/node/act-glyphs.d.ts +30 -0
  57. package/dist/node/act-glyphs.js +142 -0
  58. package/dist/node/compartment-watcher.d.ts +107 -0
  59. package/dist/node/compartment-watcher.js +163 -0
  60. package/dist/node/fit.d.ts +85 -0
  61. package/dist/node/fit.js +129 -0
  62. package/dist/node/node-renderer.d.ts +49 -0
  63. package/dist/node/node-renderer.js +611 -0
  64. package/dist/node/node-view.d.ts +51 -0
  65. package/dist/node/node-view.js +89 -0
  66. package/dist/node/paint.d.ts +84 -0
  67. package/dist/node/paint.js +143 -0
  68. package/dist/node/sd-glyphs.d.ts +36 -0
  69. package/dist/node/sd-glyphs.js +79 -0
  70. package/dist/node/stm-glyphs.d.ts +22 -0
  71. package/dist/node/stm-glyphs.js +111 -0
  72. package/dist/node/tier-metrics.d.ts +38 -0
  73. package/dist/node/tier-metrics.js +45 -0
  74. package/dist/operators.d.ts +45 -0
  75. package/dist/operators.js +75 -0
  76. package/dist/plantuml-import.d.ts +113 -0
  77. package/dist/plantuml-import.js +1723 -0
  78. package/dist/plantuml.d.ts +94 -0
  79. package/dist/plantuml.js +985 -0
  80. package/dist/presets.d.ts +149 -0
  81. package/dist/presets.js +302 -0
  82. package/dist/profiles.d.ts +2 -0
  83. package/dist/profiles.js +358 -0
  84. package/dist/reading.d.ts +160 -0
  85. package/dist/reading.js +648 -0
  86. package/dist/roles.d.ts +257 -0
  87. package/dist/roles.js +997 -0
  88. package/dist/rules.d.ts +267 -0
  89. package/dist/rules.js +3090 -0
  90. package/dist/templates.d.ts +2 -0
  91. package/dist/templates.js +197 -0
  92. package/dist/toolbar/config.d.ts +228 -0
  93. package/dist/toolbar/config.js +833 -0
  94. package/dist/toolbar/icons.d.ts +440 -0
  95. package/dist/toolbar/icons.js +711 -0
  96. package/dist/toolbar/senior-tool.d.ts +11 -0
  97. package/dist/toolbar/senior-tool.js +21 -0
  98. package/dist/toolbar/uml-menu.d.ts +17 -0
  99. package/dist/toolbar/uml-menu.js +20 -0
  100. package/dist/toolbar/uml-senior-button.d.ts +18 -0
  101. package/dist/toolbar/uml-senior-button.js +22 -0
  102. package/dist/translations.d.ts +27 -0
  103. package/dist/translations.js +117 -0
  104. package/dist/view.d.ts +33 -0
  105. package/dist/view.js +236 -0
  106. package/dist/xmi-import.d.ts +174 -0
  107. package/dist/xmi-import.js +2268 -0
  108. package/dist/xmi.d.ts +61 -0
  109. package/dist/xmi.js +1860 -0
  110. package/dist/xml-reader.d.ts +157 -0
  111. package/dist/xml-reader.js +430 -0
  112. package/dist/xml.d.ts +72 -0
  113. package/dist/xml.js +96 -0
  114. 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;