@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,178 @@
1
+ import { type MorphSpec } from '@formicoidea/labre-core/blocks/surface';
2
+ import { UmlNodeElementModel, type UmlNodeKind } from '@formicoidea/labre-core/model';
3
+ import type { GfxPrimitiveElementModel } from '@formicoidea/labre-core/std/gfx';
4
+ /**
5
+ * What a UML artefact may BECOME — the declaration behind the "Change type"
6
+ * dropdown on a selected component's contextual toolbar.
7
+ *
8
+ * ## Six families, and the kinds that are alone
9
+ *
10
+ * A class, an interface and an enumeration are THE SAME PICTURE: §9.5.4 draws
11
+ * one divided rectangle for all three and tells them apart by the keyword
12
+ * written above the name — `«interface»`, `«enumeration»`, nothing at all. That
13
+ * is the strongest statement of "the same artefact, said more precisely" any
14
+ * notation in this library makes.
15
+ *
16
+ * Phase 2 adds the second, and it is the same statement in a different clause:
17
+ * a **node**, a **device** and an **execution environment** are ONE 3D box
18
+ * (§19.4.4), told apart by `«device»` / `«executionEnvironment»` above the name
19
+ * and by nothing else. A deployment diagram is drawn coarse and then made
20
+ * precise — "this runs on a server", then "on that server's application
21
+ * container" — so the swap is the modelling act itself rather than a repair.
22
+ *
23
+ * Everything else is declared alone, and each singleton is a REFUSAL written
24
+ * down rather than an omission to be discovered later:
25
+ *
26
+ * - an **object** is an InstanceSpecification (§11.6), a thing that exists at
27
+ * run time. A class is a type. Offering the swap would invite a diagram that
28
+ * confuses the two levels, and its name compartment is `object : Class`
29
+ * underlined — different words as well as a different meaning;
30
+ * - a **package** is a namespace (§12.2), not a classifier in it;
31
+ * - a **note** is a Comment (Annex A) and carries no semantics at all;
32
+ * - an **actor** and a **use case** belong to a behaviour diagram (§18.1) and
33
+ * are not structural classifiers;
34
+ * - a **component** is a Class (§11.6) and would in principle join the first
35
+ * family, but it is the one classifier the notation draws with a MARK of its
36
+ * own — the two-tab icon in the corner — rather than with a keyword, and a
37
+ * component diagram is a different conversation from a class diagram. Left
38
+ * alone until a PO asks for the swap;
39
+ * - an **artifact** is a physical file (§19.3) — a `.war`, a script, a
40
+ * document. Offering to turn one into a class would invite a diagram that
41
+ * confuses what a thing IS with what it is deployed AS, which is the very
42
+ * distinction the `«manifest»` arrow exists to draw;
43
+ * - a **port** is a property of its owner (§11.3), not a classifier standing
44
+ * beside it, and it is the only artefact in the pack whose position is part
45
+ * of its meaning: it sits ON a border;
46
+ * - a **provided interface** and a **required interface** are the ball and the
47
+ * socket of §10.4.4 — two DIFFERENT drawings, unlike every family above, and
48
+ * a phase-2 pack should not decide by itself that a modeller who drew one
49
+ * meant the other. The pair is the obvious candidate for a third family and
50
+ * is deliberately left for a product decision.
51
+ *
52
+ * The declaration is therefore TOTAL over `UmlNodeKind` — every kind is named
53
+ * exactly once — which is what lets the unit suite prove that a kind added to
54
+ * the pack cannot be silently left out of this decision. The MENU is a different
55
+ * question, and {@link UML_MORPH_SPEC} answers it: a family of one has nothing
56
+ * to offer, so it is not offered.
57
+ *
58
+ * Families are DATA. Nothing derives them, and the role tree would have been the
59
+ * wrong source in the same way it is for BPMN and C4: `roleIsA` makes
60
+ * `uml:interface` a `uml:classifier` and thence reaches `uml:class`, but it says
61
+ * nothing about whether a reader would ACCEPT the swap — which is the only
62
+ * question this table answers.
63
+ */
64
+ export declare const UML_MORPH_FAMILIES: readonly (readonly UmlNodeKind[])[];
65
+ /**
66
+ * The `umlNode` shape a selected GROUP is the component of — `undefined` when
67
+ * the group is not one.
68
+ *
69
+ * A UML artefact is a native `group` holding the shape and its tiers of words
70
+ * (`actions.ts`), so what a click selects is the group and what carries `kind`
71
+ * is the shape. This is the whole of the indirection, and it is also the gate: a
72
+ * plain group somebody lassoed round three rectangles, a C4 component (a group
73
+ * of a shape and three lines) and a group of two UML classifiers all answer
74
+ * `undefined`, so none of them is ever offered the menu.
75
+ *
76
+ * TWO shapes is a refusal rather than a first-wins pick. A group holding two
77
+ * classifiers is a group somebody made of two classifiers — morphing "it" would
78
+ * mean picking one of them by document order, and the honest answer to an
79
+ * ambiguous selection is the same one the generic module gives to a mixed
80
+ * family: nothing.
81
+ *
82
+ * ## Why this is not `component.ts`'s `umlNodeOfComponent`
83
+ *
84
+ * Because that one answers a different question with a different vocabulary: it
85
+ * takes a RESOLVED `UmlComponent` — the pure, Yjs-free shape the exporter
86
+ * and the renderer build out of ids and roles — and reads a field off it. This
87
+ * one takes a live model and walks `childElements`, because that is what the
88
+ * toolbar hands over and `instanceof` is what makes the refusals above real. The
89
+ * two are deliberately not merged: one is the pure half of the pack and must
90
+ * stay free of the model classes, and this one exists to touch them.
91
+ */
92
+ export declare function umlNodeOfGroup(model: GfxPrimitiveElementModel): UmlNodeElementModel | undefined;
93
+ /**
94
+ * What a name compartment should say once its shape has morphed — or `null` when
95
+ * nothing about it is the notation's to change.
96
+ *
97
+ * ## Two rewrites, and the one rule they share
98
+ *
99
+ * The rule is the same for both and it is deliberately timid: rewrite ONLY what
100
+ * the notation itself wrote, and never what an author typed. A morph is not
101
+ * allowed to take away words somebody put on the picture.
102
+ *
103
+ * - **The keyword line.** `«interface»` is not a name, it is what makes the same
104
+ * rectangle mean a different metaclass (§9.5.4) — so a class morphed to an
105
+ * interface that kept an unmarked name compartment would be an interface drawn
106
+ * exactly as a class, which is to say not drawn at all. The SOURCE kind's own
107
+ * keyword is dropped and the target's is put in its place; a first line an
108
+ * author wrote themselves (`«service»`, `«entity»` — Annex C is explicit that
109
+ * not every word in guillemets is a keyword) is not the source kind's, so it
110
+ * survives and the new keyword is written above it.
111
+ * - **The name.** Placeholder→placeholder and nothing else: the name is
112
+ * rewritten only when it is EXACTLY the source kind's own seed, which is what
113
+ * a classifier nobody has named still carries. A class called `Payments` is
114
+ * called that whatever keyword it ends up wearing, which is the PO's "the
115
+ * label is intact" for every name that is real content.
116
+ *
117
+ * Pure and total over every string, because the input is a canvas text element
118
+ * somebody may have typed anything into.
119
+ */
120
+ export declare function umlMorphedName(from: UmlNodeKind, to: UmlNodeKind, rawText: string | null | undefined): string | null;
121
+ /**
122
+ * UML's morph declaration, handed to the generic `morphToolbarConfig`.
123
+ *
124
+ * `modelType` is the native `GroupElementModel` and not `UmlNodeElementModel`,
125
+ * because the group is what a click on a component selects. Everything that
126
+ * makes that safe is in {@link umlNodeOfGroup}: the toolbar's own homogeneity
127
+ * test only proves that every selected element is A group, and the resolution
128
+ * proves that every one of them is one of OURS.
129
+ *
130
+ * `propsOf` is the shipped creation builder minus `type` / `xywh` / `text`
131
+ * ({@link umlMorphProps}), so the toolbox and the morph cannot disagree about
132
+ * what an interface looks like; `clearOf` is empty on today's table and derived
133
+ * rather than assumed so (`presets.ts`).
134
+ */
135
+ export declare const UML_MORPH_SPEC: MorphSpec<UmlNodeKind>;
136
+ /**
137
+ * The SAME dropdown, on a UML shape that is not inside a group.
138
+ *
139
+ * ## Why a second spec exists at all
140
+ *
141
+ * Because phase 2 made the pack's own rule about composites untrue for a third
142
+ * of its artefacts. Until then every UML artefact was a `group` — a shape and
143
+ * the canvas texts grouped with it — so `modelType: GroupElementModel` was the
144
+ * whole selection filter. The behaviour vocabulary is not: §15.3.4 and §14.2.4
145
+ * name none of their routing marks, so a bullseye, a bar, a diamond and a
146
+ * crossed circle are created as the SHAPE alone (`actions.ts`), and what a
147
+ * click selects for them is a `umlNode`, never a group.
148
+ *
149
+ * `umlNodeOfGroup` refuses a bare shape by design — it is the gate that keeps a
150
+ * plain lasso and another framework's component out of the menu — so the group
151
+ * spec resolves nothing for them and three whole families (`activity-final` /
152
+ * `flow-final`, `shallow-history` / `deep-history`, `entry-point` /
153
+ * `exit-point`) had a dropdown nobody could ever open.
154
+ *
155
+ * ## Why not one spec with a widened `modelType`
156
+ *
157
+ * Because the selection filter is not the only thing that differs: the two
158
+ * specs are registered under two DIFFERENT toolbar flavours. A bare `umlNode`'s
159
+ * contextual row is `affine:surface:umlNode`'s (the widget derives the flavour
160
+ * from `model.type`), and a grouped artefact's is `affine:surface:group`'s.
161
+ * Widening `modelType` to the abstract base would leave the group registration
162
+ * answering for shapes it will never be handed, and would make its homogeneity
163
+ * gate — the thing that refuses a group holding two classifiers — apply to a
164
+ * selection it was not written about. Two registrations, two keys, one table.
165
+ *
166
+ * Everything that decides what the menu SAYS and what a pick WRITES is shared
167
+ * with {@link UML_MORPH_SPEC} by reference, so the two can never offer
168
+ * different families or write different props.
169
+ *
170
+ * `resolveTarget` is absent, which is identity: a bare mark is one element —
171
+ * what the user selects, what carries the kind and what the patch lands on are
172
+ * the same object, exactly as they are for a connector. `afterMorph` is absent
173
+ * too, and that is the notation's doing rather than an omission: `rewriteName`
174
+ * exists to keep a `uml:name` tier saying what the shape now is, and these
175
+ * kinds have no tier at all — there is nothing to rewrite, and reaching for one
176
+ * would be looking for words the specification says are not there.
177
+ */
178
+ export declare const UML_BARE_MORPH_SPEC: MorphSpec<UmlNodeKind>;