@formicoidea/labre-framework-wardley 0.39.3 → 0.41.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/dist/actions.d.ts +29 -0
- package/dist/actions.js +61 -38
- package/dist/consts.d.ts +8 -1
- package/dist/consts.js +14 -6
- package/dist/import.d.ts +28 -0
- package/dist/import.js +66 -7
- package/dist/legend.d.ts +20 -2
- package/dist/legend.js +127 -37
- package/dist/morph.d.ts +12 -2
- package/dist/morph.js +25 -9
- package/dist/natures.js +19 -0
- package/dist/node/consts.d.ts +29 -6
- package/dist/node/consts.js +29 -5
- package/dist/presets.d.ts +21 -0
- package/dist/presets.js +21 -0
- package/dist/templates/index.d.ts +9 -0
- package/dist/templates/index.js +35 -17
- package/dist/templates/maps.d.ts +94 -0
- package/dist/templates/maps.js +153 -31
- package/dist/toolbar/config.d.ts +2 -0
- package/dist/toolbar/config.js +46 -7
- package/dist/toolbar/icons.js +16 -15
- package/dist/toolbar/node-config.d.ts +26 -2
- package/dist/toolbar/node-config.js +100 -9
- package/dist/translations.js +80 -1
- package/package.json +2 -2
package/dist/templates/index.js
CHANGED
|
@@ -3,7 +3,8 @@ import { ConnectorMode, PointStyle, StrokeStyle } from '@formicoidea/labre-core/
|
|
|
3
3
|
import { GfxControllerIdentifier } from '@formicoidea/labre-core/std/gfx';
|
|
4
4
|
import { lowerWardleyArea } from '../actions.js';
|
|
5
5
|
import { wardleyCommands } from '../commands.js';
|
|
6
|
-
import {
|
|
6
|
+
import { COLORS } from '../consts.js';
|
|
7
|
+
import { INERTIA_COLOR, LINK_GREY, LINK_STROKE_WIDTH, NODE_FILL, NODE_STROKE, WARDLEY_RED, } from '../node/consts.js';
|
|
7
8
|
import { WARDLEY_ROLE } from '../roles.js';
|
|
8
9
|
import { wardleyMaps } from './maps.js';
|
|
9
10
|
/**
|
|
@@ -64,20 +65,35 @@ function connect(source, target, opts = {}) {
|
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
67
|
const ATTRS = 'width="100%" height="100%" viewBox="0 0 135 80" xmlns="http://www.w3.org/2000/svg"';
|
|
67
|
-
const bgPreview = (extra = '') => `<svg ${ATTRS} fill="none"><path d="M22 12 V64 H120" stroke="
|
|
68
|
-
const dotPreview = (fill, sw = 2) => `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="13" fill="${fill}" stroke="
|
|
68
|
+
const bgPreview = (extra = '') => `<svg ${ATTRS} fill="none"><path d="M22 12 V64 H120" stroke="${COLORS.axis}" stroke-width="2"/><path d="M44 12 V64 M68 12 V64 M94 12 V64" stroke="${COLORS.divider}" stroke-width="0.8"/>${extra}</svg>`;
|
|
69
|
+
const dotPreview = (fill, sw = 2) => `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="13" fill="${fill}" stroke="${NODE_STROKE}" stroke-width="${sw}"/></svg>`;
|
|
69
70
|
/** The two fat arrows: the same outline, mirrored — the direction IS the kind. */
|
|
70
71
|
const arrowPreview = (rightwards) => `<svg ${ATTRS} fill="none"><path d="${rightwards
|
|
71
72
|
? 'M32 32 H80 V23 L103 40 L80 57 V48 H32 Z'
|
|
72
|
-
: 'M103 32 H55 V23 L32 40 L55 57 V48 H103 Z'}" fill="#bfbfbf" stroke="
|
|
73
|
+
: 'M103 32 H55 V23 L32 40 L55 57 V48 H103 Z'}" fill="#bfbfbf" stroke="${NODE_STROKE}" stroke-width="1.8" stroke-linejoin="round"/></svg>`;
|
|
73
74
|
/** The zone, in its Peace wash — the pair differs on the outline and on nothing else. */
|
|
74
75
|
const areaPreview = (outline) => `<svg ${ATTRS} fill="none">${outline}</svg>`;
|
|
76
|
+
/**
|
|
77
|
+
* The two hand-drawn palette swatches' own tile names (`Template.nameKey`):
|
|
78
|
+
* neither derives from a command, since `linkTool` / `evolutionArrow`
|
|
79
|
+
* activate a tool rather than draw anything (see `tpl` below and its
|
|
80
|
+
* docstring).
|
|
81
|
+
*/
|
|
82
|
+
export const WARDLEY_TEMPLATE_NAME_LINK = [
|
|
83
|
+
'com.labre.wardley.template.link',
|
|
84
|
+
'Link',
|
|
85
|
+
];
|
|
86
|
+
export const WARDLEY_TEMPLATE_NAME_EVOLUTION_ARROW = [
|
|
87
|
+
'com.labre.wardley.template.evolution-arrow',
|
|
88
|
+
'Evolution arrow',
|
|
89
|
+
];
|
|
75
90
|
/** A hand-composed template — what is left once the artefacts are derived. */
|
|
76
|
-
function tpl(name, preview, elements) {
|
|
91
|
+
function tpl(name, preview, elements, nameKey) {
|
|
77
92
|
return {
|
|
78
93
|
name,
|
|
79
94
|
type: 'template',
|
|
80
95
|
preview,
|
|
96
|
+
nameKey,
|
|
81
97
|
content: makeTemplateSnapshot(elements, name),
|
|
82
98
|
};
|
|
83
99
|
}
|
|
@@ -98,20 +114,22 @@ function areaTemplate(id, preview) {
|
|
|
98
114
|
}
|
|
99
115
|
export const wardleyTemplateCategory = {
|
|
100
116
|
name: 'Wardley',
|
|
117
|
+
// Reuses the senior button's own key — see `TemplateCategory.nameKey`.
|
|
118
|
+
nameKey: 'com.labre.framework.wardley',
|
|
101
119
|
templates: [
|
|
102
120
|
...wardleyMaps,
|
|
103
121
|
templateFromCommand(byId('wardley.addBackground'), bgPreview(), 'Map background'),
|
|
104
122
|
templateFromCommand(byId('wardley.addOpportunityBackground'), bgPreview('<rect x="22" y="12" width="98" height="52" fill="#eef4fb" opacity="0.6"/>'), 'Opportunity gradient'),
|
|
105
123
|
templateFromCommand(byId('wardley.addBenefitBackground'), bgPreview('<rect x="22" y="12" width="98" height="26" fill="#e6eef8" opacity="0.6"/>'), 'Benefit gradient'),
|
|
106
124
|
templateFromCommand(byId('wardley.addEvolutionBackground'), bgPreview('<rect x="22" y="12" width="98" height="52" fill="#e3e2e4" opacity="0.5"/>'), 'Evolution gradient'),
|
|
107
|
-
templateFromCommand(byId('wardley.addComponent'), dotPreview(
|
|
108
|
-
templateFromCommand(byId('wardley.addMethod'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="15" fill="#d9d9d9" stroke="
|
|
109
|
-
templateFromCommand(byId('wardley.addMarket'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="16" fill="
|
|
110
|
-
templateFromCommand(byId('wardley.addEcosystem'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="15" fill="
|
|
111
|
-
templateFromCommand(byId('wardley.addAnchor'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="13" fill="
|
|
112
|
-
templateFromCommand(byId('wardley.addPipeline'), `<svg ${ATTRS} fill="none"><rect x="34" y="40" width="66" height="14" fill="
|
|
113
|
-
templateFromCommand(byId('wardley.addInertia'), `<svg ${ATTRS} fill="none"><rect x="63" y="22" width="8" height="36" fill="
|
|
114
|
-
templateFromCommand(byId('wardley.addPorter'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="13" fill="
|
|
125
|
+
templateFromCommand(byId('wardley.addComponent'), dotPreview(NODE_FILL, 1.5), 'Component'),
|
|
126
|
+
templateFromCommand(byId('wardley.addMethod'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="15" fill="#d9d9d9" stroke="${NODE_STROKE}" stroke-width="1.5"/><circle cx="67" cy="40" r="7" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/></svg>`, 'Method'),
|
|
127
|
+
templateFromCommand(byId('wardley.addMarket'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="16" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/><circle cx="67" cy="30" r="3.5" fill="${NODE_FILL}" stroke="${NODE_STROKE}" stroke-width="1.5"/><circle cx="75" cy="46" r="3.5" fill="${NODE_FILL}" stroke="${NODE_STROKE}" stroke-width="1.5"/><circle cx="59" cy="46" r="3.5" fill="${NODE_FILL}" stroke="${NODE_STROKE}" stroke-width="1.5"/><path d="M67 30 L75 46 L59 46 Z" stroke="${NODE_STROKE}" stroke-width="0.8" fill="none"/></svg>`, 'Market'),
|
|
128
|
+
templateFromCommand(byId('wardley.addEcosystem'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="15" fill="${NODE_FILL}" stroke="${NODE_STROKE}" stroke-width="1.5"/><circle cx="67" cy="40" r="11" fill="none" stroke="${NODE_STROKE}"/><circle cx="67" cy="40" r="5" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/></svg>`, 'Ecosystem'),
|
|
129
|
+
templateFromCommand(byId('wardley.addAnchor'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="13" fill="${NODE_FILL}" stroke="${NODE_STROKE}" stroke-width="1.5"/><circle cx="67" cy="36" r="3.5" fill="${NODE_STROKE}"/><path d="M59 48 q8 -9 16 0" stroke="${NODE_STROKE}" stroke-width="1.5" fill="none"/></svg>`, 'Anchor'),
|
|
130
|
+
templateFromCommand(byId('wardley.addPipeline'), `<svg ${ATTRS} fill="none"><rect x="34" y="40" width="66" height="14" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/><rect x="60" y="33" width="14" height="14" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/></svg>`, 'Pipeline'),
|
|
131
|
+
templateFromCommand(byId('wardley.addInertia'), `<svg ${ATTRS} fill="none"><rect x="63" y="22" width="8" height="36" fill="${INERTIA_COLOR}"/></svg>`, 'Inertia'),
|
|
132
|
+
templateFromCommand(byId('wardley.addPorter'), `<svg ${ATTRS} fill="none"><circle cx="67" cy="40" r="13" fill="${NODE_FILL}" stroke="${NODE_STROKE}" stroke-width="1.5"/><g stroke="${WARDLEY_RED}" stroke-width="2" stroke-linecap="round"><line x1="67" y1="26" x2="67" y2="19"/><line x1="81" y1="40" x2="88" y2="40"/><line x1="67" y1="54" x2="67" y2="61"/><line x1="53" y1="40" x2="46" y2="40"/></g><g fill="${WARDLEY_RED}"><path d="M67 13 L71 21 H63 Z"/><path d="M94 40 L86 44 V36 Z"/><path d="M67 67 L63 59 H71 Z"/><path d="M40 40 L48 36 V44 Z"/></g></svg>`),
|
|
115
133
|
templateFromCommand(byId('wardley.addAccelerator'), arrowPreview(true)),
|
|
116
134
|
templateFromCommand(byId('wardley.addDecelerator'), arrowPreview(false)),
|
|
117
135
|
// NEUTRAL on purpose (`docs/adr/0010` § Compatibility). This is a horizontal
|
|
@@ -123,12 +141,12 @@ export const wardleyTemplateCategory = {
|
|
|
123
141
|
// Hand-written, and the one pair that cannot derive: `linkTool` and
|
|
124
142
|
// `evolutionArrow` ACTIVATE a tool rather than draw anything, so there is no
|
|
125
143
|
// artefact to record — the user draws it.
|
|
126
|
-
tpl('Link', `<svg ${ATTRS} fill="none"><path d="M24 40 H110" stroke="
|
|
144
|
+
tpl('Link', `<svg ${ATTRS} fill="none"><path d="M24 40 H110" stroke="${LINK_GREY}" stroke-width="2.4"/></svg>`, {
|
|
127
145
|
a: connect({ position: [0, 0] }, { position: [160, 0] }, { typed: false }),
|
|
128
|
-
}),
|
|
129
|
-
tpl('Evolution arrow', `<svg ${ATTRS} fill="none"><path d="M24 40 H100" stroke="
|
|
146
|
+
}, WARDLEY_TEMPLATE_NAME_LINK[0]),
|
|
147
|
+
tpl('Evolution arrow', `<svg ${ATTRS} fill="none"><path d="M24 40 H100" stroke="${WARDLEY_RED}" stroke-width="2.4" stroke-dasharray="6 4"/><path d="M98 33 L112 40 L98 47 Z" fill="${WARDLEY_RED}"/></svg>`, {
|
|
130
148
|
a: connect({ position: [0, 0] }, { position: [160, 0] }, { evolution: true, typed: false }),
|
|
131
|
-
}),
|
|
149
|
+
}, WARDLEY_TEMPLATE_NAME_EVOLUTION_ARROW[0]),
|
|
132
150
|
areaTemplate('wardley.addAreaRect', areaPreview('<rect x="24" y="16" width="87" height="48" rx="2" fill="#c6dbfc" fill-opacity="0.25" stroke="#5b9cf6" stroke-width="1.5"/>')),
|
|
133
151
|
areaTemplate('wardley.addAreaPolygon', areaPreview('<path d="M67 12 L110 43 L94 68 H40 L24 43 Z" fill="#c6dbfc" fill-opacity="0.25" stroke="#5b9cf6" stroke-width="1.5" stroke-linejoin="round"/>')),
|
|
134
152
|
],
|
package/dist/templates/maps.d.ts
CHANGED
|
@@ -1,2 +1,96 @@
|
|
|
1
1
|
import { type Template } from '@formicoidea/labre-core/gfx/template';
|
|
2
|
+
import { type ChromeWording } from '@formicoidea/labre-core/shared/services';
|
|
3
|
+
/**
|
|
4
|
+
* The seeds the two worked maps write — declared once so the builders below
|
|
5
|
+
* and the manifest (`../translations.ts`) read the very same fallback, never
|
|
6
|
+
* a restated literal. `com.labre.wardley.example.<map>.<slug>`, per
|
|
7
|
+
* `docs/adr/0016`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TEA_SHOP_SEED: {
|
|
10
|
+
readonly title: {
|
|
11
|
+
readonly key: "com.labre.wardley.example.tea-shop.title";
|
|
12
|
+
readonly fallback: "Tea Shop";
|
|
13
|
+
};
|
|
14
|
+
readonly annotations: {
|
|
15
|
+
readonly key: "com.labre.wardley.example.tea-shop.annotations";
|
|
16
|
+
readonly fallback: "Annotations:\n1. Standardising power lets kettles evolve faster\n2. Hot water is obvious and well known";
|
|
17
|
+
};
|
|
18
|
+
readonly business: {
|
|
19
|
+
readonly key: "com.labre.wardley.example.tea-shop.business";
|
|
20
|
+
readonly fallback: "Business";
|
|
21
|
+
};
|
|
22
|
+
readonly public: {
|
|
23
|
+
readonly key: "com.labre.wardley.example.tea-shop.public";
|
|
24
|
+
readonly fallback: "Public";
|
|
25
|
+
};
|
|
26
|
+
readonly cupOfTea: {
|
|
27
|
+
readonly key: "com.labre.wardley.example.tea-shop.cup-of-tea";
|
|
28
|
+
readonly fallback: "Cup of Tea";
|
|
29
|
+
};
|
|
30
|
+
readonly cup: {
|
|
31
|
+
readonly key: "com.labre.wardley.example.tea-shop.cup";
|
|
32
|
+
readonly fallback: "Cup";
|
|
33
|
+
};
|
|
34
|
+
readonly tea: {
|
|
35
|
+
readonly key: "com.labre.wardley.example.tea-shop.tea";
|
|
36
|
+
readonly fallback: "Tea";
|
|
37
|
+
};
|
|
38
|
+
readonly hotWater: {
|
|
39
|
+
readonly key: "com.labre.wardley.example.tea-shop.hot-water";
|
|
40
|
+
readonly fallback: "Hot Water";
|
|
41
|
+
};
|
|
42
|
+
readonly water: {
|
|
43
|
+
readonly key: "com.labre.wardley.example.tea-shop.water";
|
|
44
|
+
readonly fallback: "Water";
|
|
45
|
+
};
|
|
46
|
+
readonly kettle: {
|
|
47
|
+
readonly key: "com.labre.wardley.example.tea-shop.kettle";
|
|
48
|
+
readonly fallback: "Kettle";
|
|
49
|
+
};
|
|
50
|
+
readonly electricKettle: {
|
|
51
|
+
readonly key: "com.labre.wardley.example.tea-shop.electric-kettle";
|
|
52
|
+
readonly fallback: "Electric Kettle";
|
|
53
|
+
};
|
|
54
|
+
readonly power: {
|
|
55
|
+
readonly key: "com.labre.wardley.example.tea-shop.power";
|
|
56
|
+
readonly fallback: "Power";
|
|
57
|
+
};
|
|
58
|
+
readonly limitedBy: {
|
|
59
|
+
readonly key: "com.labre.wardley.example.tea-shop.limited-by";
|
|
60
|
+
readonly fallback: "limited by";
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const KODAK_INERTIA_SEED: {
|
|
64
|
+
readonly title: {
|
|
65
|
+
readonly key: "com.labre.wardley.example.kodak-inertia.title";
|
|
66
|
+
readonly fallback: "Wardley map of Kodak's 2005 inertia to digital";
|
|
67
|
+
};
|
|
68
|
+
readonly user: {
|
|
69
|
+
readonly key: "com.labre.wardley.example.kodak-inertia.user";
|
|
70
|
+
readonly fallback: "User";
|
|
71
|
+
};
|
|
72
|
+
readonly captureAMoment: {
|
|
73
|
+
readonly key: "com.labre.wardley.example.kodak-inertia.capture-a-moment";
|
|
74
|
+
readonly fallback: "Capture a moment";
|
|
75
|
+
};
|
|
76
|
+
readonly filmCamera: {
|
|
77
|
+
readonly key: "com.labre.wardley.example.kodak-inertia.film-camera";
|
|
78
|
+
readonly fallback: "Film camera";
|
|
79
|
+
};
|
|
80
|
+
readonly digitalCamera: {
|
|
81
|
+
readonly key: "com.labre.wardley.example.kodak-inertia.digital-camera";
|
|
82
|
+
readonly fallback: "Digital camera";
|
|
83
|
+
};
|
|
84
|
+
readonly photographicFilm: {
|
|
85
|
+
readonly key: "com.labre.wardley.example.kodak-inertia.photographic-film";
|
|
86
|
+
readonly fallback: "Photographic film";
|
|
87
|
+
};
|
|
88
|
+
readonly digitalStorage: {
|
|
89
|
+
readonly key: "com.labre.wardley.example.kodak-inertia.digital-storage";
|
|
90
|
+
readonly fallback: "Digital storage";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
/** The two worked maps' own tile names (`Template.nameKey`). */
|
|
94
|
+
export declare const WARDLEY_TEMPLATE_NAME_TEA_SHOP: ChromeWording;
|
|
95
|
+
export declare const WARDLEY_TEMPLATE_NAME_KODAK_INERTIA: ChromeWording;
|
|
2
96
|
export declare const wardleyMaps: Template[];
|
package/dist/templates/maps.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { makeTemplateSnapshot, surfaceText, surfaceYMap, } from '@formicoidea/labre-core/gfx/template';
|
|
2
2
|
import { ConnectorMode, FontFamily, PointStyle, ShapeStyle, StrokeStyle, TextAlign, } from '@formicoidea/labre-core/model';
|
|
3
|
-
import {
|
|
3
|
+
import { translateKey, } from '@formicoidea/labre-core/shared/services';
|
|
4
|
+
import { COLORS } from '../consts.js';
|
|
5
|
+
import { INERTIA_COLOR, LINK_GREY, LINK_STROKE_WIDTH, NODE_FILL, NODE_SIZE, NODE_STROKE, WARDLEY_RED, } from '../node/consts.js';
|
|
4
6
|
import { backgroundPlot, backgroundZoneBoundaries, } from '@formicoidea/labre-core/blocks/surface';
|
|
5
7
|
import { WARDLEY_BACKGROUND } from '../background.js';
|
|
6
8
|
import { WARDLEY_LABEL_H, wardleyInertiaProps, wardleyLabelProps, wardleyNodeProps, } from '../presets.js';
|
|
@@ -182,7 +184,7 @@ function panel(x, y, w, h) {
|
|
|
182
184
|
type: 'shape',
|
|
183
185
|
shapeType: 'rect',
|
|
184
186
|
filled: true,
|
|
185
|
-
fillColor:
|
|
187
|
+
fillColor: NODE_FILL,
|
|
186
188
|
strokeColor: NODE_STROKE,
|
|
187
189
|
strokeWidth: 1.2,
|
|
188
190
|
shapeStyle: ShapeStyle.General,
|
|
@@ -215,15 +217,120 @@ function title(str) {
|
|
|
215
217
|
};
|
|
216
218
|
}
|
|
217
219
|
const ATTRS = 'width="100%" height="100%" viewBox="0 0 135 80" xmlns="http://www.w3.org/2000/svg"';
|
|
218
|
-
const mapPreview = (extra) => `<svg ${ATTRS} fill="none"><path d="M22 12 V64 H120" stroke="
|
|
219
|
-
|
|
220
|
+
const mapPreview = (extra) => `<svg ${ATTRS} fill="none"><path d="M22 12 V64 H120" stroke="${COLORS.axis}" stroke-width="2"/>${extra}</svg>`;
|
|
221
|
+
/**
|
|
222
|
+
* The seeds the two worked maps write — declared once so the builders below
|
|
223
|
+
* and the manifest (`../translations.ts`) read the very same fallback, never
|
|
224
|
+
* a restated literal. `com.labre.wardley.example.<map>.<slug>`, per
|
|
225
|
+
* `docs/adr/0016`.
|
|
226
|
+
*/
|
|
227
|
+
export const TEA_SHOP_SEED = {
|
|
228
|
+
title: {
|
|
229
|
+
key: 'com.labre.wardley.example.tea-shop.title',
|
|
230
|
+
fallback: 'Tea Shop',
|
|
231
|
+
},
|
|
232
|
+
annotations: {
|
|
233
|
+
key: 'com.labre.wardley.example.tea-shop.annotations',
|
|
234
|
+
fallback: 'Annotations:\n1. Standardising power lets kettles evolve faster\n2. Hot water is obvious and well known',
|
|
235
|
+
},
|
|
236
|
+
business: {
|
|
237
|
+
key: 'com.labre.wardley.example.tea-shop.business',
|
|
238
|
+
fallback: 'Business',
|
|
239
|
+
},
|
|
240
|
+
public: {
|
|
241
|
+
key: 'com.labre.wardley.example.tea-shop.public',
|
|
242
|
+
fallback: 'Public',
|
|
243
|
+
},
|
|
244
|
+
cupOfTea: {
|
|
245
|
+
key: 'com.labre.wardley.example.tea-shop.cup-of-tea',
|
|
246
|
+
fallback: 'Cup of Tea',
|
|
247
|
+
},
|
|
248
|
+
cup: { key: 'com.labre.wardley.example.tea-shop.cup', fallback: 'Cup' },
|
|
249
|
+
tea: { key: 'com.labre.wardley.example.tea-shop.tea', fallback: 'Tea' },
|
|
250
|
+
hotWater: {
|
|
251
|
+
key: 'com.labre.wardley.example.tea-shop.hot-water',
|
|
252
|
+
fallback: 'Hot Water',
|
|
253
|
+
},
|
|
254
|
+
water: { key: 'com.labre.wardley.example.tea-shop.water', fallback: 'Water' },
|
|
255
|
+
kettle: {
|
|
256
|
+
key: 'com.labre.wardley.example.tea-shop.kettle',
|
|
257
|
+
fallback: 'Kettle',
|
|
258
|
+
},
|
|
259
|
+
electricKettle: {
|
|
260
|
+
key: 'com.labre.wardley.example.tea-shop.electric-kettle',
|
|
261
|
+
fallback: 'Electric Kettle',
|
|
262
|
+
},
|
|
263
|
+
power: { key: 'com.labre.wardley.example.tea-shop.power', fallback: 'Power' },
|
|
264
|
+
limitedBy: {
|
|
265
|
+
key: 'com.labre.wardley.example.tea-shop.limited-by',
|
|
266
|
+
fallback: 'limited by',
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
export const KODAK_INERTIA_SEED = {
|
|
270
|
+
title: {
|
|
271
|
+
key: 'com.labre.wardley.example.kodak-inertia.title',
|
|
272
|
+
fallback: "Wardley map of Kodak's 2005 inertia to digital",
|
|
273
|
+
},
|
|
274
|
+
user: {
|
|
275
|
+
key: 'com.labre.wardley.example.kodak-inertia.user',
|
|
276
|
+
fallback: 'User',
|
|
277
|
+
},
|
|
278
|
+
captureAMoment: {
|
|
279
|
+
key: 'com.labre.wardley.example.kodak-inertia.capture-a-moment',
|
|
280
|
+
fallback: 'Capture a moment',
|
|
281
|
+
},
|
|
282
|
+
filmCamera: {
|
|
283
|
+
key: 'com.labre.wardley.example.kodak-inertia.film-camera',
|
|
284
|
+
fallback: 'Film camera',
|
|
285
|
+
},
|
|
286
|
+
digitalCamera: {
|
|
287
|
+
key: 'com.labre.wardley.example.kodak-inertia.digital-camera',
|
|
288
|
+
fallback: 'Digital camera',
|
|
289
|
+
},
|
|
290
|
+
photographicFilm: {
|
|
291
|
+
key: 'com.labre.wardley.example.kodak-inertia.photographic-film',
|
|
292
|
+
fallback: 'Photographic film',
|
|
293
|
+
},
|
|
294
|
+
digitalStorage: {
|
|
295
|
+
key: 'com.labre.wardley.example.kodak-inertia.digital-storage',
|
|
296
|
+
fallback: 'Digital storage',
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* One seed's resolved text — the host's catalogue when `std` is a real
|
|
301
|
+
* inserting editor, the English fallback when building the module's own
|
|
302
|
+
* `content` (no editor exists yet at that point).
|
|
303
|
+
*/
|
|
304
|
+
function seedText(std, def) {
|
|
305
|
+
return std ? translateKey(std, def.key, def.fallback) : def.fallback;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* A shipped map — what is left once the artefacts are derived.
|
|
309
|
+
*
|
|
310
|
+
* `build` takes the OPTIONAL inserting editor: called with none, at module
|
|
311
|
+
* load, for the English `content`; called again with the real `std` as
|
|
312
|
+
* {@link Template.localize}, so the two builds read the very same layout and
|
|
313
|
+
* differ only in the words a seed resolves to (`docs/adr/0016`).
|
|
314
|
+
*/
|
|
315
|
+
function tpl(name, preview, build, nameKey) {
|
|
220
316
|
return {
|
|
221
317
|
name,
|
|
222
318
|
type: 'template',
|
|
223
319
|
preview,
|
|
224
|
-
|
|
320
|
+
nameKey,
|
|
321
|
+
content: makeTemplateSnapshot(build(), name),
|
|
322
|
+
localize: std => makeTemplateSnapshot(build(std), name),
|
|
225
323
|
};
|
|
226
324
|
}
|
|
325
|
+
/** The two worked maps' own tile names (`Template.nameKey`). */
|
|
326
|
+
export const WARDLEY_TEMPLATE_NAME_TEA_SHOP = [
|
|
327
|
+
'com.labre.wardley.template.tea-shop',
|
|
328
|
+
'Tea Shop',
|
|
329
|
+
];
|
|
330
|
+
export const WARDLEY_TEMPLATE_NAME_KODAK_INERTIA = [
|
|
331
|
+
'com.labre.wardley.template.kodak-inertia',
|
|
332
|
+
'Kodak inertia',
|
|
333
|
+
];
|
|
227
334
|
function ann(e, v) {
|
|
228
335
|
const cx = ex(e);
|
|
229
336
|
const cy = vy(v);
|
|
@@ -231,7 +338,7 @@ function ann(e, v) {
|
|
|
231
338
|
type: 'shape',
|
|
232
339
|
shapeType: 'ellipse',
|
|
233
340
|
filled: true,
|
|
234
|
-
fillColor:
|
|
341
|
+
fillColor: NODE_FILL,
|
|
235
342
|
strokeColor: NODE_STROKE,
|
|
236
343
|
strokeWidth: 1.5,
|
|
237
344
|
shapeStyle: ShapeStyle.General,
|
|
@@ -253,48 +360,56 @@ function annTxt(e, v, n) {
|
|
|
253
360
|
};
|
|
254
361
|
}
|
|
255
362
|
// ── Tea Shop (the canonical map) ──────────────────────────────────────
|
|
256
|
-
function teaShop() {
|
|
363
|
+
function teaShop(std) {
|
|
364
|
+
const s = (def) => seedText(std, def);
|
|
257
365
|
return {
|
|
258
366
|
bg: bg(),
|
|
259
|
-
title: title(
|
|
367
|
+
title: title(s(TEA_SHOP_SEED.title)),
|
|
260
368
|
annBox: panel(120, 200, 420, 64),
|
|
261
|
-
annText: freeText(132, 208, 400,
|
|
369
|
+
annText: freeText(132, 208, 400, s(TEA_SHOP_SEED.annotations), 13),
|
|
262
370
|
business: stake(0.62, 0.93),
|
|
263
|
-
businessL: lbl(0.62, 0.93,
|
|
371
|
+
businessL: lbl(0.62, 0.93, s(TEA_SHOP_SEED.business), {
|
|
264
372
|
align: 'center',
|
|
265
373
|
dy: -28,
|
|
266
374
|
w: 120,
|
|
267
375
|
}),
|
|
268
376
|
businessG: pair('business', 'businessL'),
|
|
269
377
|
public: stake(0.78, 0.93),
|
|
270
|
-
publicL: lbl(0.78, 0.93,
|
|
378
|
+
publicL: lbl(0.78, 0.93, s(TEA_SHOP_SEED.public), {
|
|
379
|
+
align: 'center',
|
|
380
|
+
dy: -28,
|
|
381
|
+
w: 120,
|
|
382
|
+
}),
|
|
271
383
|
publicG: pair('public', 'publicL'),
|
|
272
384
|
cupOfTea: comp(0.62, 0.74),
|
|
273
|
-
cupOfTeaL: lbl(0.62, 0.74,
|
|
385
|
+
cupOfTeaL: lbl(0.62, 0.74, s(TEA_SHOP_SEED.cupOfTea), { align: 'right' }),
|
|
274
386
|
cupOfTeaG: pair('cupOfTea', 'cupOfTeaL'),
|
|
275
387
|
cup: comp(0.8, 0.7),
|
|
276
|
-
cupL: lbl(0.8, 0.7,
|
|
388
|
+
cupL: lbl(0.8, 0.7, s(TEA_SHOP_SEED.cup)),
|
|
277
389
|
cupG: pair('cup', 'cupL'),
|
|
278
390
|
tea: comp(0.83, 0.6),
|
|
279
|
-
teaL: lbl(0.83, 0.6,
|
|
391
|
+
teaL: lbl(0.83, 0.6, s(TEA_SHOP_SEED.tea)),
|
|
280
392
|
teaG: pair('tea', 'teaL'),
|
|
281
393
|
hotWater: comp(0.8, 0.47),
|
|
282
|
-
hotWaterL: lbl(0.8, 0.47,
|
|
394
|
+
hotWaterL: lbl(0.8, 0.47, s(TEA_SHOP_SEED.hotWater)),
|
|
283
395
|
hotWaterG: pair('hotWater', 'hotWaterL'),
|
|
284
396
|
water: comp(0.81, 0.34),
|
|
285
|
-
waterL: lbl(0.81, 0.34,
|
|
397
|
+
waterL: lbl(0.81, 0.34, s(TEA_SHOP_SEED.water)),
|
|
286
398
|
waterG: pair('water', 'waterL'),
|
|
287
399
|
kettle: comp(0.36, 0.38),
|
|
288
|
-
kettleL: lbl(0.36, 0.38,
|
|
400
|
+
kettleL: lbl(0.36, 0.38, s(TEA_SHOP_SEED.kettle), {
|
|
401
|
+
align: 'right',
|
|
402
|
+
dy: 6,
|
|
403
|
+
}),
|
|
289
404
|
kettleG: pair('kettle', 'kettleL'),
|
|
290
405
|
electric: future(0.56, 0.38),
|
|
291
|
-
electricL: lbl(0.56, 0.38,
|
|
406
|
+
electricL: lbl(0.56, 0.38, s(TEA_SHOP_SEED.electricKettle)),
|
|
292
407
|
electricG: pair('electric', 'electricL'),
|
|
293
408
|
power: comp(0.7, 0.1),
|
|
294
|
-
powerL: lbl(0.7, 0.1,
|
|
409
|
+
powerL: lbl(0.7, 0.1, s(TEA_SHOP_SEED.power), { align: 'right', dy: 6 }),
|
|
295
410
|
powerG: pair('power', 'powerL'),
|
|
296
411
|
powerFut: future(0.88, 0.1),
|
|
297
|
-
powerFutL: lbl(0.88, 0.1,
|
|
412
|
+
powerFutL: lbl(0.88, 0.1, s(TEA_SHOP_SEED.power)),
|
|
298
413
|
powerFutG: pair('powerFut', 'powerFutL'),
|
|
299
414
|
// ABOVE the link it annotates, not across it. Written on the line it reads
|
|
300
415
|
// as a label nobody can read — which is the finding W3 raises, and it was
|
|
@@ -302,7 +417,7 @@ function teaShop() {
|
|
|
302
417
|
//
|
|
303
418
|
// NEUTRAL: it is a remark about a LINK, not the name of an artefact, so it
|
|
304
419
|
// travels with nothing and nothing measures it (see `LblOpts.neutral`).
|
|
305
|
-
limitedBy: lbl(0.56, 0.43,
|
|
420
|
+
limitedBy: lbl(0.56, 0.43, s(TEA_SHOP_SEED.limitedBy), {
|
|
306
421
|
align: 'center',
|
|
307
422
|
w: 120,
|
|
308
423
|
size: 13,
|
|
@@ -326,7 +441,8 @@ function teaShop() {
|
|
|
326
441
|
};
|
|
327
442
|
}
|
|
328
443
|
// ── Kodak inertia (2005) ──────────────────────────────────────────────
|
|
329
|
-
function kodak() {
|
|
444
|
+
function kodak(std) {
|
|
445
|
+
const s = (def) => seedText(std, def);
|
|
330
446
|
// The future dependency `capture → storage` is the movement Kodak resisted,
|
|
331
447
|
// and the inertia bar belongs where that dependency crosses into commodity —
|
|
332
448
|
// the boundary the capability refused to cross. It used to sit 105 units away
|
|
@@ -340,30 +456,36 @@ function kodak() {
|
|
|
340
456
|
const [barE, barV] = crossing(CAPTURE, STORAGE, 2);
|
|
341
457
|
return {
|
|
342
458
|
bg: bg(),
|
|
343
|
-
title: title(
|
|
459
|
+
title: title(s(KODAK_INERTIA_SEED.title)),
|
|
344
460
|
user: stake(0.54, 0.92),
|
|
345
|
-
userL: lbl(0.54, 0.92,
|
|
461
|
+
userL: lbl(0.54, 0.92, s(KODAK_INERTIA_SEED.user)),
|
|
346
462
|
userG: pair('user', 'userL'),
|
|
347
463
|
capture: dot(CAPTURE[0], CAPTURE[1], 3),
|
|
348
464
|
// To the LEFT, like the other two capability names: to the right of this
|
|
349
465
|
// node runs the future dependency towards digital storage, and a name
|
|
350
466
|
// written across the line that carries the whole argument is exactly the
|
|
351
467
|
// case W3 exists for.
|
|
352
|
-
captureL: lbl(CAPTURE[0], CAPTURE[1],
|
|
468
|
+
captureL: lbl(CAPTURE[0], CAPTURE[1], s(KODAK_INERTIA_SEED.captureAMoment), {
|
|
353
469
|
align: 'right',
|
|
354
470
|
}),
|
|
355
471
|
captureG: pair('capture', 'captureL'),
|
|
356
472
|
film: comp(0.52, 0.62),
|
|
357
|
-
filmL: lbl(0.52, 0.62,
|
|
473
|
+
filmL: lbl(0.52, 0.62, s(KODAK_INERTIA_SEED.filmCamera), {
|
|
474
|
+
align: 'right',
|
|
475
|
+
}),
|
|
358
476
|
filmG: pair('film', 'filmL'),
|
|
359
477
|
digital: future(0.74, 0.62),
|
|
360
|
-
digitalL: lbl(0.74, 0.62,
|
|
478
|
+
digitalL: lbl(0.74, 0.62, s(KODAK_INERTIA_SEED.digitalCamera), {
|
|
479
|
+
color: WARDLEY_RED,
|
|
480
|
+
}),
|
|
361
481
|
digitalG: pair('digital', 'digitalL'),
|
|
362
482
|
roll: comp(0.52, 0.4),
|
|
363
|
-
rollL: lbl(0.52, 0.4,
|
|
483
|
+
rollL: lbl(0.52, 0.4, s(KODAK_INERTIA_SEED.photographicFilm), {
|
|
484
|
+
align: 'right',
|
|
485
|
+
}),
|
|
364
486
|
rollG: pair('roll', 'rollL'),
|
|
365
487
|
storage: future(STORAGE[0], STORAGE[1]),
|
|
366
|
-
storageL: lbl(STORAGE[0], STORAGE[1],
|
|
488
|
+
storageL: lbl(STORAGE[0], STORAGE[1], s(KODAK_INERTIA_SEED.digitalStorage), {
|
|
367
489
|
color: WARDLEY_RED,
|
|
368
490
|
}),
|
|
369
491
|
storageG: pair('storage', 'storageL'),
|
|
@@ -377,6 +499,6 @@ function kodak() {
|
|
|
377
499
|
};
|
|
378
500
|
}
|
|
379
501
|
export const wardleyMaps = [
|
|
380
|
-
tpl('Tea Shop', mapPreview(
|
|
381
|
-
tpl('Kodak inertia', mapPreview(
|
|
502
|
+
tpl('Tea Shop', mapPreview(`<circle cx="78" cy="24" r="3" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/><circle cx="50" cy="44" r="3" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/><circle cx="86" cy="40" r="3" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/><circle cx="92" cy="58" r="3" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/><path d="M78 24 L50 44 M78 24 L86 40 L92 58" stroke="${LINK_GREY}"/><path d="M50 44 h22" stroke="${WARDLEY_RED}" stroke-dasharray="3 2"/>`), teaShop, WARDLEY_TEMPLATE_NAME_TEA_SHOP[0]),
|
|
503
|
+
tpl('Kodak inertia', mapPreview(`<circle cx="56" cy="22" r="3" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/><circle cx="54" cy="40" r="3" fill="${NODE_FILL}" stroke="${NODE_STROKE}"/><circle cx="86" cy="40" r="3" fill="${NODE_FILL}" stroke="${WARDLEY_RED}"/><rect x="76" y="35" width="2.5" height="11" fill="${INERTIA_COLOR}"/><path d="M57 40 h17" stroke="${WARDLEY_RED}" stroke-dasharray="3 2"/>`), kodak, WARDLEY_TEMPLATE_NAME_KODAK_INERTIA[0]),
|
|
382
504
|
];
|
package/dist/toolbar/config.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ChromeWording, type ToolbarContext } from '@formicoidea/labre-core/shared/services';
|
|
2
2
|
import { type TemplateResult } from 'lit';
|
|
3
|
+
/** Every wording above, for `translations.ts`'s manifest contribution. */
|
|
4
|
+
export declare const WARDLEY_TOOLBAR_WORDINGS: readonly ChromeWording[];
|
|
3
5
|
export declare const wardleyToolbarConfig: {
|
|
4
6
|
readonly actions: [{
|
|
5
7
|
id: string;
|
package/dist/toolbar/config.js
CHANGED
|
@@ -5,6 +5,45 @@ import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
|
|
|
5
5
|
import { html } from 'lit';
|
|
6
6
|
import { createWardleyLegend } from '../legend.js';
|
|
7
7
|
import { wardleyLegendIcon } from './icons.js';
|
|
8
|
+
/** The seven toolbar tooltips this file used to hard-code as English literals. */
|
|
9
|
+
const EVOLUTION_AXIS_TOGGLE = [
|
|
10
|
+
'com.labre.wardley.toolbar.evolution-axis',
|
|
11
|
+
'Evolution axis (X)',
|
|
12
|
+
];
|
|
13
|
+
const EVOLUTION_PHASE_LABELS_TOGGLE = [
|
|
14
|
+
'com.labre.wardley.toolbar.evolution-phase-labels',
|
|
15
|
+
'Evolution phase labels',
|
|
16
|
+
];
|
|
17
|
+
const COLUMNS_TOGGLE = [
|
|
18
|
+
'com.labre.wardley.toolbar.columns',
|
|
19
|
+
'Columns (dividers)',
|
|
20
|
+
];
|
|
21
|
+
const CORNER_LABELS_TOGGLE = [
|
|
22
|
+
'com.labre.wardley.toolbar.corner-labels',
|
|
23
|
+
'Labels Uncharted / Industrialized',
|
|
24
|
+
];
|
|
25
|
+
const GRADIENT_TOGGLE = [
|
|
26
|
+
'com.labre.wardley.toolbar.gradient',
|
|
27
|
+
'Show / hide the gradient',
|
|
28
|
+
];
|
|
29
|
+
const VALUE_CHAIN_AXIS_TOGGLE = [
|
|
30
|
+
'com.labre.wardley.toolbar.value-chain-axis',
|
|
31
|
+
'Value Chain axis (Y)',
|
|
32
|
+
];
|
|
33
|
+
const VISIBILITY_LABELS_TOGGLE = [
|
|
34
|
+
'com.labre.wardley.toolbar.visibility-labels',
|
|
35
|
+
'Labels Visible / Invisible',
|
|
36
|
+
];
|
|
37
|
+
/** Every wording above, for `translations.ts`'s manifest contribution. */
|
|
38
|
+
export const WARDLEY_TOOLBAR_WORDINGS = [
|
|
39
|
+
EVOLUTION_AXIS_TOGGLE,
|
|
40
|
+
EVOLUTION_PHASE_LABELS_TOGGLE,
|
|
41
|
+
COLUMNS_TOGGLE,
|
|
42
|
+
CORNER_LABELS_TOGGLE,
|
|
43
|
+
GRADIENT_TOGGLE,
|
|
44
|
+
VALUE_CHAIN_AXIS_TOGGLE,
|
|
45
|
+
VISIBILITY_LABELS_TOGGLE,
|
|
46
|
+
];
|
|
8
47
|
const ResizeIcon = html `<svg
|
|
9
48
|
width="24"
|
|
10
49
|
height="24"
|
|
@@ -162,12 +201,12 @@ export const wardleyToolbarConfig = {
|
|
|
162
201
|
{
|
|
163
202
|
id: 'b.evolution',
|
|
164
203
|
actions: [
|
|
165
|
-
booleanToggle('b.1-axis-x',
|
|
166
|
-
booleanToggle('b.2-column-labels',
|
|
167
|
-
booleanToggle('b.3-columns',
|
|
168
|
-
booleanToggle('b.4-corner-labels',
|
|
204
|
+
booleanToggle('b.1-axis-x', EVOLUTION_AXIS_TOGGLE, XAxisIcon, 'showXAxis'),
|
|
205
|
+
booleanToggle('b.2-column-labels', EVOLUTION_PHASE_LABELS_TOGGLE, ColumnLabelsIcon, 'showColumnLabels'),
|
|
206
|
+
booleanToggle('b.3-columns', COLUMNS_TOGGLE, ColumnsIcon, 'showColumnDividers'),
|
|
207
|
+
booleanToggle('b.4-corner-labels', CORNER_LABELS_TOGGLE, CornerLabelsIcon, 'showCornerLabels'),
|
|
169
208
|
// Only relevant when the selection has a gradient variant.
|
|
170
|
-
booleanToggle('b.5-gradient',
|
|
209
|
+
booleanToggle('b.5-gradient', GRADIENT_TOGGLE, GradientIcon, 'showGradient', ctx => ctx
|
|
171
210
|
.getSurfaceModelsByType(WardleyBackgroundElementModel)
|
|
172
211
|
.some(model => model.variant !== 'classic')),
|
|
173
212
|
],
|
|
@@ -176,8 +215,8 @@ export const wardleyToolbarConfig = {
|
|
|
176
215
|
{
|
|
177
216
|
id: 'c.value-chain',
|
|
178
217
|
actions: [
|
|
179
|
-
booleanToggle('c.1-axis-y',
|
|
180
|
-
booleanToggle('c.2-visibility-labels',
|
|
218
|
+
booleanToggle('c.1-axis-y', VALUE_CHAIN_AXIS_TOGGLE, YAxisIcon, 'showYAxis'),
|
|
219
|
+
booleanToggle('c.2-visibility-labels', VISIBILITY_LABELS_TOGGLE, VisibilityIcon, 'showVisibilityLabels'),
|
|
181
220
|
],
|
|
182
221
|
},
|
|
183
222
|
// Generate the auto-legend from the components present inside this
|