@formicoidea/labre-framework-c4 0.40.0 → 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 +2 -1
- package/dist/actions.js +35 -12
- package/dist/commands.d.ts +3 -0
- package/dist/commands.js +143 -1
- package/dist/consts.d.ts +24 -0
- package/dist/consts.js +24 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +4 -4
- package/dist/morph.js +2 -2
- package/dist/node/type-line-watcher.js +6 -1
- package/dist/templates.js +2 -0
- package/dist/toolbar/c4-senior-button.d.ts +1 -0
- package/dist/toolbar/c4-senior-button.js +1 -0
- package/dist/toolbar/config.d.ts +18 -29
- package/dist/toolbar/config.js +22 -85
- package/dist/toolbar/icons.d.ts +6 -3
- package/dist/toolbar/icons.js +6 -3
- package/dist/toolbar/palette.d.ts +33 -0
- package/dist/toolbar/palette.js +114 -0
- package/dist/translations.js +51 -2
- package/dist/type-line.d.ts +45 -8
- package/dist/type-line.js +133 -16
- package/dist/view.js +7 -0
- package/package.json +3 -3
- package/dist/legend.d.ts +0 -37
- package/dist/legend.js +0 -123
package/dist/legend.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { roleLabel } from '@formicoidea/labre-ddd-shared';
|
|
2
|
-
import { BOUNDARY_STROKE, NODE_PALETTE, RELATIONSHIP_STROKE } from './consts.js';
|
|
3
|
-
import { C4_ROLE, C4_ROLES } from './roles.js';
|
|
4
|
-
/**
|
|
5
|
-
* What the C4 board's automatic legend can say — a TABLE, and nothing else: the
|
|
6
|
-
* scan, the placement and the box are `createAutoLegend`'s job, shared with the
|
|
7
|
-
* three DDD boards.
|
|
8
|
-
*
|
|
9
|
-
* Every row is DERIVED twice over: its WORDING from the role vocabulary's own
|
|
10
|
-
* `labelFallback` ({@link roleLabel}), and its COLOUR from the very palette the
|
|
11
|
-
* creation site paints with ({@link NODE_PALETTE}). Neither is restated here, so
|
|
12
|
-
* renaming a role renames its legend row and restyling the pack restyles its
|
|
13
|
-
* swatches — which is what keeps a legend a description of the board rather than
|
|
14
|
-
* a second opinion about it.
|
|
15
|
-
*
|
|
16
|
-
* ## Why `exact` on the container, and only there
|
|
17
|
-
*
|
|
18
|
-
* `c4:database` specialises `c4:container`, so an inclusive entry on the parent
|
|
19
|
-
* would put a "Container" row — with the container's blue square — on a board
|
|
20
|
-
* carrying nothing but cylinders. The row would name a shape that is nowhere on
|
|
21
|
-
* the diagram. EDGY's four base kinds hit this first and `AutoLegendEntry.exact`
|
|
22
|
-
* exists for it: base and specialisation become two separate statements, each
|
|
23
|
-
* listed when it is the thing the user actually drew.
|
|
24
|
-
*
|
|
25
|
-
* The other four element roles are childless, so `exact` would change nothing
|
|
26
|
-
* for them and is left off — the flag marks the places where the distinction is
|
|
27
|
-
* real.
|
|
28
|
-
*
|
|
29
|
-
* ## What is missing, and why
|
|
30
|
-
*
|
|
31
|
-
* `mobile` and `browser` get no row of their own: they carry `c4:container`,
|
|
32
|
-
* because a phone app and a single-page app are containers with a picture
|
|
33
|
-
* (`roles.ts`). Detection is by role and only by role, so a board of nothing but
|
|
34
|
-
* mobile apps lists "Container" — which is the honest answer about what the
|
|
35
|
-
* boxes MEAN. `person-ext` and `system-ext` collapse the same way onto person
|
|
36
|
-
* and system, for the same reason: the grey says "out of scope", not "a
|
|
37
|
-
* different sort of thing".
|
|
38
|
-
*/
|
|
39
|
-
export const C4_AUTO_LEGEND = {
|
|
40
|
-
title: 'Legend',
|
|
41
|
-
width: 290,
|
|
42
|
-
roles: C4_ROLES,
|
|
43
|
-
sections: [
|
|
44
|
-
{
|
|
45
|
-
title: 'Elements',
|
|
46
|
-
entries: [
|
|
47
|
-
{
|
|
48
|
-
role: C4_ROLE.person,
|
|
49
|
-
row: {
|
|
50
|
-
swatch: 'square',
|
|
51
|
-
color: NODE_PALETTE.person.fill,
|
|
52
|
-
label: roleLabel(C4_ROLES, C4_ROLE.person),
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
role: C4_ROLE.system,
|
|
57
|
-
row: {
|
|
58
|
-
swatch: 'square',
|
|
59
|
-
color: NODE_PALETTE.system.fill,
|
|
60
|
-
label: roleLabel(C4_ROLES, C4_ROLE.system),
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
role: C4_ROLE.container,
|
|
65
|
-
// See the note above: a board of cylinders must not claim a container.
|
|
66
|
-
exact: true,
|
|
67
|
-
row: {
|
|
68
|
-
swatch: 'square',
|
|
69
|
-
color: NODE_PALETTE.container.fill,
|
|
70
|
-
label: roleLabel(C4_ROLES, C4_ROLE.container),
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
role: C4_ROLE.database,
|
|
75
|
-
row: {
|
|
76
|
-
swatch: 'square',
|
|
77
|
-
color: NODE_PALETTE.database.fill,
|
|
78
|
-
label: roleLabel(C4_ROLES, C4_ROLE.database),
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
role: C4_ROLE.component,
|
|
83
|
-
row: {
|
|
84
|
-
swatch: 'square',
|
|
85
|
-
color: NODE_PALETTE.component.fill,
|
|
86
|
-
label: roleLabel(C4_ROLES, C4_ROLE.component),
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
title: 'Frames',
|
|
93
|
-
entries: [
|
|
94
|
-
{
|
|
95
|
-
role: C4_ROLE.boundary,
|
|
96
|
-
row: {
|
|
97
|
-
// A line, not a square: a boundary has no body — it is the dashed
|
|
98
|
-
// frame itself, and a filled swatch would draw the one thing this
|
|
99
|
-
// background deliberately does not paint.
|
|
100
|
-
swatch: 'line',
|
|
101
|
-
color: BOUNDARY_STROKE,
|
|
102
|
-
dashed: true,
|
|
103
|
-
label: roleLabel(C4_ROLES, C4_ROLE.boundary),
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
title: 'Relations',
|
|
110
|
-
entries: [
|
|
111
|
-
{
|
|
112
|
-
role: C4_ROLE.relationship,
|
|
113
|
-
row: {
|
|
114
|
-
swatch: 'line',
|
|
115
|
-
color: RELATIONSHIP_STROKE,
|
|
116
|
-
dashed: true,
|
|
117
|
-
label: roleLabel(C4_ROLES, C4_ROLE.relationship),
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
};
|