@formicoidea/labre-framework-cynefin 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/commands.js +5 -1
- package/dist/cynefin/consts.d.ts +55 -12
- package/dist/cynefin/consts.js +281 -34
- package/dist/cynefin/element-renderer.d.ts +16 -0
- package/dist/cynefin/element-renderer.js +60 -23
- package/dist/cynefin/element-view.d.ts +11 -2
- package/dist/cynefin/element-view.js +17 -2
- package/dist/cynefin/labels.d.ts +25 -0
- package/dist/cynefin/labels.js +40 -0
- package/dist/cynefin/toolbar/config.d.ts +2 -0
- package/dist/cynefin/toolbar/config.js +22 -3
- package/dist/estuarine/consts.d.ts +29 -4
- package/dist/estuarine/consts.js +44 -4
- package/dist/estuarine/element-renderer.js +14 -8
- package/dist/estuarine/element-view.d.ts +10 -2
- package/dist/estuarine/element-view.js +17 -2
- package/dist/estuarine/labels.d.ts +39 -0
- package/dist/estuarine/labels.js +49 -0
- package/dist/estuarine/toolbar/config.d.ts +2 -0
- package/dist/estuarine/toolbar/config.js +28 -4
- package/dist/templates/index.d.ts +39 -0
- package/dist/templates/index.js +123 -16
- package/dist/toolbar/palette.d.ts +31 -0
- package/dist/toolbar/palette.js +105 -0
- package/dist/toolbar/senior-button.d.ts +2 -0
- package/dist/toolbar/senior-button.js +6 -2
- package/dist/translations.js +52 -1
- package/dist/view.js +7 -0
- package/package.json +2 -2
package/dist/templates/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { makeTemplateSnapshot, surfaceText, templateFromCommand, } from '@formicoidea/labre-core/gfx/template';
|
|
2
2
|
import { FontFamily, ShapeStyle, TextAlign } from '@formicoidea/labre-core/model';
|
|
3
3
|
import { NOTATION_NEUTRALS } from '@formicoidea/labre-core/shared/consts';
|
|
4
|
+
import { translateKey, } from '@formicoidea/labre-core/shared/services';
|
|
4
5
|
import { cynefinEstuarineCommands } from '../commands.js';
|
|
5
6
|
import { HEX_SIZE } from '../estuarine/consts.js';
|
|
6
7
|
import { CYNEFIN_H, CYNEFIN_W, cynefinBackgroundProps, ESTUARINE_MAP_H, ESTUARINE_MAP_W, estuarineHexagonBox, estuarineHexagonProps, estuarineMapProps, MAP_SCALE, } from '../presets.js';
|
|
@@ -80,46 +81,152 @@ function caption(cx, cy, str) {
|
|
|
80
81
|
xywh: `[${x},${y},${CAPTION_W},${CAPTION_H}]`,
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
|
-
/**
|
|
84
|
-
|
|
84
|
+
/**
|
|
85
|
+
* The seeds the two hand-composed templates below write into the document:
|
|
86
|
+
* the "Decision sorting" board's four domain stickies, and the "Constraint
|
|
87
|
+
* map" board's three hexagon captions. Exported so `translations.ts` derives
|
|
88
|
+
* the manifest entries from the SAME constants rather than restating them.
|
|
89
|
+
*/
|
|
90
|
+
export const CYNEFIN_SEED_PROBE_LEARN = [
|
|
91
|
+
'com.labre.cynefin-estuarine.seed.probe-learn',
|
|
92
|
+
'Probe & learn',
|
|
93
|
+
];
|
|
94
|
+
export const CYNEFIN_SEED_EXPERT_ANALYSIS = [
|
|
95
|
+
'com.labre.cynefin-estuarine.seed.expert-analysis',
|
|
96
|
+
'Expert analysis',
|
|
97
|
+
];
|
|
98
|
+
export const CYNEFIN_SEED_ACT_NOW = [
|
|
99
|
+
'com.labre.cynefin-estuarine.seed.act-now',
|
|
100
|
+
'Act now',
|
|
101
|
+
];
|
|
102
|
+
export const CYNEFIN_SEED_KNOWN_ISSUE = [
|
|
103
|
+
'com.labre.cynefin-estuarine.seed.known-issue',
|
|
104
|
+
'Known issue',
|
|
105
|
+
];
|
|
106
|
+
export const ESTUARINE_SEED_POLICY = [
|
|
107
|
+
'com.labre.cynefin-estuarine.seed.policy',
|
|
108
|
+
'Policy',
|
|
109
|
+
];
|
|
110
|
+
export const ESTUARINE_SEED_HABIT = [
|
|
111
|
+
'com.labre.cynefin-estuarine.seed.habit',
|
|
112
|
+
'Habit',
|
|
113
|
+
];
|
|
114
|
+
export const ESTUARINE_SEED_BUDGET = [
|
|
115
|
+
'com.labre.cynefin-estuarine.seed.budget',
|
|
116
|
+
'Budget',
|
|
117
|
+
];
|
|
118
|
+
/** All seven, for `translations.ts`'s manifest contribution. */
|
|
119
|
+
export const CYNEFIN_ESTUARINE_TEMPLATE_SEEDS = [
|
|
120
|
+
CYNEFIN_SEED_PROBE_LEARN,
|
|
121
|
+
CYNEFIN_SEED_EXPERT_ANALYSIS,
|
|
122
|
+
CYNEFIN_SEED_ACT_NOW,
|
|
123
|
+
CYNEFIN_SEED_KNOWN_ISSUE,
|
|
124
|
+
ESTUARINE_SEED_POLICY,
|
|
125
|
+
ESTUARINE_SEED_HABIT,
|
|
126
|
+
ESTUARINE_SEED_BUDGET,
|
|
127
|
+
];
|
|
128
|
+
/**
|
|
129
|
+
* The two Templates-panel tab names — new keys, since Cynefin and Estuarine
|
|
130
|
+
* share one senior-button key (`com.labre.framework.cynefin-estuarine`) that
|
|
131
|
+
* names neither individually (see `TemplateCategory.nameKey`). Both are proper
|
|
132
|
+
* nouns; the PO's French proposal for each is the identical word.
|
|
133
|
+
*/
|
|
134
|
+
export const CYNEFIN_TEMPLATE_CATEGORY_NAME = [
|
|
135
|
+
'com.labre.cynefin-estuarine.template.category.cynefin',
|
|
136
|
+
'Cynefin',
|
|
137
|
+
];
|
|
138
|
+
export const ESTUARINE_TEMPLATE_CATEGORY_NAME = [
|
|
139
|
+
'com.labre.cynefin-estuarine.template.category.estuarine',
|
|
140
|
+
'Estuarine',
|
|
141
|
+
];
|
|
142
|
+
/**
|
|
143
|
+
* The two Templates-panel tab names (chrome, not seeds — a widget-resolved
|
|
144
|
+
* label, never written into a document), for `translations.ts`'s manifest.
|
|
145
|
+
*/
|
|
146
|
+
export const CYNEFIN_ESTUARINE_TEMPLATE_CATEGORY_WORDINGS = [CYNEFIN_TEMPLATE_CATEGORY_NAME, ESTUARINE_TEMPLATE_CATEGORY_NAME];
|
|
147
|
+
/**
|
|
148
|
+
* The two hand-composed templates' own tile names (`Template.nameKey`):
|
|
149
|
+
* chrome, resolved by the panel widget every time it opens, never written
|
|
150
|
+
* into a document — distinct from {@link CYNEFIN_ESTUARINE_TEMPLATE_SEEDS}
|
|
151
|
+
* above, which the templates WRITE.
|
|
152
|
+
*/
|
|
153
|
+
export const CYNEFIN_TEMPLATE_NAME_DECISION_SORTING = [
|
|
154
|
+
'com.labre.cynefin-estuarine.template.decision-sorting',
|
|
155
|
+
'Decision sorting',
|
|
156
|
+
];
|
|
157
|
+
export const ESTUARINE_TEMPLATE_NAME_CONSTRAINT_MAP = [
|
|
158
|
+
'com.labre.cynefin-estuarine.template.constraint-map',
|
|
159
|
+
'Constraint map',
|
|
160
|
+
];
|
|
161
|
+
/** Both tile names, for `translations.ts`'s manifest. */
|
|
162
|
+
export const CYNEFIN_ESTUARINE_TEMPLATE_NAME_WORDINGS = [
|
|
163
|
+
CYNEFIN_TEMPLATE_NAME_DECISION_SORTING,
|
|
164
|
+
ESTUARINE_TEMPLATE_NAME_CONSTRAINT_MAP,
|
|
165
|
+
];
|
|
166
|
+
/** Resolve a wording through the host, or its English fallback with no host. */
|
|
167
|
+
function tr(std, wording) {
|
|
168
|
+
return std ? translateKey(std, ...wording) : wording[1];
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* A hand-composed template — what is left once the artefacts are derived.
|
|
172
|
+
*
|
|
173
|
+
* The seeds a template writes into the document go through the translation
|
|
174
|
+
* seam at placement (ADR 0023); `content` stays the English build, and
|
|
175
|
+
* `localize` rebuilds the same snapshot with translated seeds.
|
|
176
|
+
*/
|
|
177
|
+
function tpl(name, preview, build, nameKey) {
|
|
85
178
|
return {
|
|
86
179
|
name,
|
|
87
180
|
type: 'template',
|
|
88
181
|
preview,
|
|
89
|
-
|
|
182
|
+
nameKey,
|
|
183
|
+
content: makeTemplateSnapshot(build(), name),
|
|
184
|
+
localize: std => makeTemplateSnapshot(build(std), name),
|
|
90
185
|
};
|
|
91
186
|
}
|
|
92
187
|
const ATTRS = 'width="100%" height="100%" viewBox="0 0 135 80" xmlns="http://www.w3.org/2000/svg"';
|
|
93
188
|
export const cynefinTemplateCategory = {
|
|
94
189
|
name: 'Cynefin',
|
|
190
|
+
nameKey: CYNEFIN_TEMPLATE_CATEGORY_NAME[0],
|
|
95
191
|
templates: [
|
|
96
|
-
tpl('Decision sorting', `<svg ${ATTRS} fill="none"><rect x="8" y="10" width="119" height="60" rx="4" stroke="#2a9d99" stroke-width="1.5"/><path d="M67 10 V70 M8 40 H127" stroke="${NOTATION_NEUTRALS.divider}"/><rect x="18" y="18" width="34" height="14" rx="2" fill="#fff3b0"/><rect x="83" y="18" width="34" height="14" rx="2" fill="#fff3b0"/><rect x="18" y="48" width="34" height="14" rx="2" fill="#fff3b0"/><rect x="83" y="48" width="34" height="14" rx="2" fill="#fff3b0"/></svg>`, {
|
|
192
|
+
tpl('Decision sorting', `<svg ${ATTRS} fill="none"><rect x="8" y="10" width="119" height="60" rx="4" stroke="#2a9d99" stroke-width="1.5"/><path d="M67 10 V70 M8 40 H127" stroke="${NOTATION_NEUTRALS.divider}"/><rect x="18" y="18" width="34" height="14" rx="2" fill="#fff3b0"/><rect x="83" y="18" width="34" height="14" rx="2" fill="#fff3b0"/><rect x="18" y="48" width="34" height="14" rx="2" fill="#fff3b0"/><rect x="83" y="48" width="34" height="14" rx="2" fill="#fff3b0"/></svg>`, std => ({
|
|
97
193
|
bg: cynefinBackgroundProps({
|
|
98
194
|
xywh: `[0,0,${CYNEFIN_W},${CYNEFIN_H}]`,
|
|
99
195
|
}),
|
|
100
|
-
s1: sticky(190, 175,
|
|
101
|
-
s2: sticky(690, 175,
|
|
102
|
-
s3: sticky(190, 505,
|
|
103
|
-
s4: sticky(690, 505,
|
|
104
|
-
}),
|
|
105
|
-
|
|
196
|
+
s1: sticky(190, 175, tr(std, CYNEFIN_SEED_PROBE_LEARN)),
|
|
197
|
+
s2: sticky(690, 175, tr(std, CYNEFIN_SEED_EXPERT_ANALYSIS)),
|
|
198
|
+
s3: sticky(190, 505, tr(std, CYNEFIN_SEED_ACT_NOW)),
|
|
199
|
+
s4: sticky(690, 505, tr(std, CYNEFIN_SEED_KNOWN_ISSUE)),
|
|
200
|
+
}), CYNEFIN_TEMPLATE_NAME_DECISION_SORTING[0]),
|
|
201
|
+
// No name override: it would only restate `addCynefin`'s own
|
|
202
|
+
// `labelFallback` as a second literal the panel could not translate — see
|
|
203
|
+
// `resolveTemplateName`, which now reads the command's `labelKey` instead.
|
|
204
|
+
templateFromCommand(byId('cynefin-estuarine.addCynefin'), `<svg ${ATTRS} fill="none"><rect x="14" y="12" width="107" height="56" rx="4" stroke="#2a9d99" stroke-width="1.6"/><path d="M67 12 V68 M14 40 H121" stroke="${NOTATION_NEUTRALS.divider}"/></svg>`),
|
|
106
205
|
],
|
|
107
206
|
};
|
|
108
207
|
export const estuarineTemplateCategory = {
|
|
109
208
|
name: 'Estuarine',
|
|
209
|
+
nameKey: ESTUARINE_TEMPLATE_CATEGORY_NAME[0],
|
|
110
210
|
templates: [
|
|
111
|
-
tpl('Constraint map', `<svg ${ATTRS} fill="none"><path d="M20 12 V70 M20 70 H120" stroke="#941253" stroke-width="2"/><g fill="#34c724" stroke="#1f1f1f"><path d="M44 28 l6 4 l0 8 l-6 4 l-6 -4 l0 -8 z"/><path d="M74 40 l6 4 l0 8 l-6 4 l-6 -4 l0 -8 z"/><path d="M56 52 l6 4 l0 8 l-6 4 l-6 -4 l0 -8 z"/></g></svg>`, {
|
|
211
|
+
tpl('Constraint map', `<svg ${ATTRS} fill="none"><path d="M20 12 V70 M20 70 H120" stroke="#941253" stroke-width="2"/><g fill="#34c724" stroke="#1f1f1f"><path d="M44 28 l6 4 l0 8 l-6 4 l-6 -4 l0 -8 z"/><path d="M74 40 l6 4 l0 8 l-6 4 l-6 -4 l0 -8 z"/><path d="M56 52 l6 4 l0 8 l-6 4 l-6 -4 l0 -8 z"/></g></svg>`, std => ({
|
|
112
212
|
bg: estuarineMapProps({
|
|
113
213
|
xywh: `[0,0,${ESTUARINE_MAP_W},${ESTUARINE_MAP_H}]`,
|
|
114
214
|
}),
|
|
115
215
|
h1: hexAt(210, 280),
|
|
116
|
-
c1: caption(210, 280,
|
|
216
|
+
c1: caption(210, 280, tr(std, ESTUARINE_SEED_POLICY)),
|
|
117
217
|
h2: hexAt(390, 420),
|
|
118
|
-
c2: caption(390, 420,
|
|
218
|
+
c2: caption(390, 420, tr(std, ESTUARINE_SEED_HABIT)),
|
|
119
219
|
h3: hexAt(290, 580),
|
|
120
|
-
c3: caption(290, 580,
|
|
121
|
-
}),
|
|
122
|
-
|
|
220
|
+
c3: caption(290, 580, tr(std, ESTUARINE_SEED_BUDGET)),
|
|
221
|
+
}), ESTUARINE_TEMPLATE_NAME_CONSTRAINT_MAP[0]),
|
|
222
|
+
// No name override: same reason as `addCynefin` above.
|
|
223
|
+
templateFromCommand(byId('cynefin-estuarine.addEstuarineMap'), `<svg ${ATTRS} fill="none"><path d="M24 10 V70 M24 70 H120" stroke="#941253" stroke-width="2.4"/><path d="M30 52 q40 -30 84 -34" stroke="#5ecc44" stroke-width="2" fill="none"/></svg>`),
|
|
224
|
+
// Kept, unlike the two overrides above: `addConstraintHexagon`'s own
|
|
225
|
+
// label is "Hexagon node" (the generic node-picker's wording), and this
|
|
226
|
+
// tile is specifically the CONSTRAINT preset of it — a name of its own,
|
|
227
|
+
// not a restatement. `resolveTemplateName` still resolves it through the
|
|
228
|
+
// command's `labelKey`, with THIS literal (not the command's) as the
|
|
229
|
+
// fallback, so the tile keeps its own English wording with no catalogue.
|
|
123
230
|
templateFromCommand(byId('cynefin-estuarine.addConstraintHexagon'), `<svg ${ATTRS} fill="none"><path d="M67 24 l18 11 l0 22 l-18 11 l-18 -11 l0 -22 z" fill="#34c724" stroke="#1f1f1f" stroke-width="2"/></svg>`, 'Hexagon constraint'),
|
|
124
231
|
],
|
|
125
232
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FrameworkPalette, NamedPalette } from '@formicoidea/labre-core/components/color-picker';
|
|
2
|
+
import type { ChromeWording } from '@formicoidea/labre-core/shared/services';
|
|
3
|
+
/**
|
|
4
|
+
* The Cynefin / Estuarine swatches' own names, resolved by
|
|
5
|
+
* `resolvePaletteLabel` (`@labre/affine-components/color-picker`) through each
|
|
6
|
+
* swatch's own {@link NamedPalette.labelWording} — the mechanism
|
|
7
|
+
* `WARDLEY_PALETTE_WORDINGS` established, reused here without either package
|
|
8
|
+
* naming the other.
|
|
9
|
+
*
|
|
10
|
+
* Exported so `../translations.ts` can list them under source `chrome`: a
|
|
11
|
+
* swatch's name is toolbar chrome, re-rendered on every locale switch, never
|
|
12
|
+
* seeded into a document.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CYNEFIN_ESTUARINE_PALETTE_WORDING_ITERATE: ChromeWording;
|
|
15
|
+
export declare const CYNEFIN_ESTUARINE_PALETTE_WORDING_LIMINAL: ChromeWording;
|
|
16
|
+
export declare const CYNEFIN_ESTUARINE_PALETTE_WORDING_LIMINAL_DARK: ChromeWording;
|
|
17
|
+
export declare const CYNEFIN_ESTUARINE_PALETTE_WORDING_VOLATILE: ChromeWording;
|
|
18
|
+
export declare const CYNEFIN_ESTUARINE_PALETTE_WORDING_AXIS: ChromeWording;
|
|
19
|
+
export declare const CYNEFIN_ESTUARINE_PALETTE_WORDINGS: readonly ChromeWording[];
|
|
20
|
+
/**
|
|
21
|
+
* From the default editor palette we keep ONLY the neutrals — the historical
|
|
22
|
+
* colours say nothing in this notation.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CYNEFIN_ESTUARINE_PALETTE_LIST: NamedPalette[];
|
|
25
|
+
/**
|
|
26
|
+
* This pack's page of the colour pickers' carousel (`docs/adr/0027`).
|
|
27
|
+
* Registered from the FLAG-GATED view extension, because offering hues is
|
|
28
|
+
* TOOLING: a board drawn while the flag was on keeps every colour it was
|
|
29
|
+
* painted with when the flag goes off (`docs/adr/0009`).
|
|
30
|
+
*/
|
|
31
|
+
export declare const CYNEFIN_ESTUARINE_FRAMEWORK_PALETTE: FrameworkPalette;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { neutralPalettes } from '@formicoidea/labre-core/gfx/shape';
|
|
2
|
+
import { COLORS as CYNEFIN_COLORS } from '../cynefin/consts.js';
|
|
3
|
+
import { COLORS as ESTUARINE_COLORS } from '../estuarine/consts.js';
|
|
4
|
+
/**
|
|
5
|
+
* The Cynefin / Estuarine swatches' own names, resolved by
|
|
6
|
+
* `resolvePaletteLabel` (`@labre/affine-components/color-picker`) through each
|
|
7
|
+
* swatch's own {@link NamedPalette.labelWording} — the mechanism
|
|
8
|
+
* `WARDLEY_PALETTE_WORDINGS` established, reused here without either package
|
|
9
|
+
* naming the other.
|
|
10
|
+
*
|
|
11
|
+
* Exported so `../translations.ts` can list them under source `chrome`: a
|
|
12
|
+
* swatch's name is toolbar chrome, re-rendered on every locale switch, never
|
|
13
|
+
* seeded into a document.
|
|
14
|
+
*/
|
|
15
|
+
export const CYNEFIN_ESTUARINE_PALETTE_WORDING_ITERATE = [
|
|
16
|
+
'com.labre.cynefin.palette.iterate-teal',
|
|
17
|
+
'Iterate teal',
|
|
18
|
+
];
|
|
19
|
+
export const CYNEFIN_ESTUARINE_PALETTE_WORDING_LIMINAL = [
|
|
20
|
+
'com.labre.estuarine.palette.liminal-green',
|
|
21
|
+
'Liminal green',
|
|
22
|
+
];
|
|
23
|
+
export const CYNEFIN_ESTUARINE_PALETTE_WORDING_LIMINAL_DARK = [
|
|
24
|
+
'com.labre.estuarine.palette.liminal-green-dark',
|
|
25
|
+
'Liminal green dark',
|
|
26
|
+
];
|
|
27
|
+
export const CYNEFIN_ESTUARINE_PALETTE_WORDING_VOLATILE = [
|
|
28
|
+
'com.labre.estuarine.palette.volatile-red',
|
|
29
|
+
'Volatile red',
|
|
30
|
+
];
|
|
31
|
+
export const CYNEFIN_ESTUARINE_PALETTE_WORDING_AXIS = [
|
|
32
|
+
'com.labre.estuarine.palette.axis-plum',
|
|
33
|
+
'Axis plum',
|
|
34
|
+
];
|
|
35
|
+
export const CYNEFIN_ESTUARINE_PALETTE_WORDINGS = [
|
|
36
|
+
CYNEFIN_ESTUARINE_PALETTE_WORDING_ITERATE,
|
|
37
|
+
CYNEFIN_ESTUARINE_PALETTE_WORDING_LIMINAL,
|
|
38
|
+
CYNEFIN_ESTUARINE_PALETTE_WORDING_LIMINAL_DARK,
|
|
39
|
+
CYNEFIN_ESTUARINE_PALETTE_WORDING_VOLATILE,
|
|
40
|
+
CYNEFIN_ESTUARINE_PALETTE_WORDING_AXIS,
|
|
41
|
+
];
|
|
42
|
+
/**
|
|
43
|
+
* The hues the two boards of this pack are actually drawn in.
|
|
44
|
+
*
|
|
45
|
+
* ONE page for two diagrams, because they are one framework id
|
|
46
|
+
* (`cynefin-estuarine`) and an author works across both. Cynefin contributes
|
|
47
|
+
* the teal of its "iterate" curve — the only colour on a frame whose other
|
|
48
|
+
* inks are the shared notation neutrals — and Estuarine the three its curve
|
|
49
|
+
* legends are drawn in plus the plum of its two axes.
|
|
50
|
+
*
|
|
51
|
+
* Every value is read off the two `COLORS` tables rather than restated, so the
|
|
52
|
+
* shelf and the painted frames cannot drift apart. They are SHORTCUTS, never
|
|
53
|
+
* constraints: nothing on either board reads a colour.
|
|
54
|
+
*/
|
|
55
|
+
const CYNEFIN_ESTUARINE_PALETTES = [
|
|
56
|
+
{
|
|
57
|
+
key: 'Iterate teal',
|
|
58
|
+
value: CYNEFIN_COLORS.teal,
|
|
59
|
+
labelWording: CYNEFIN_ESTUARINE_PALETTE_WORDING_ITERATE,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: 'Liminal green',
|
|
63
|
+
value: ESTUARINE_COLORS.liminal,
|
|
64
|
+
labelWording: CYNEFIN_ESTUARINE_PALETTE_WORDING_LIMINAL,
|
|
65
|
+
},
|
|
66
|
+
// The LIMINAL legend's own darker green — the curve's colour is too light to
|
|
67
|
+
// read as words over the map.
|
|
68
|
+
{
|
|
69
|
+
key: 'Liminal green dark',
|
|
70
|
+
value: ESTUARINE_COLORS.liminalLabel,
|
|
71
|
+
labelWording: CYNEFIN_ESTUARINE_PALETTE_WORDING_LIMINAL_DARK,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'Volatile red',
|
|
75
|
+
value: ESTUARINE_COLORS.volatile,
|
|
76
|
+
labelWording: CYNEFIN_ESTUARINE_PALETTE_WORDING_VOLATILE,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: 'Axis plum',
|
|
80
|
+
value: ESTUARINE_COLORS.axis,
|
|
81
|
+
labelWording: CYNEFIN_ESTUARINE_PALETTE_WORDING_AXIS,
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
/**
|
|
85
|
+
* From the default editor palette we keep ONLY the neutrals — the historical
|
|
86
|
+
* colours say nothing in this notation.
|
|
87
|
+
*/
|
|
88
|
+
export const CYNEFIN_ESTUARINE_PALETTE_LIST = [
|
|
89
|
+
...CYNEFIN_ESTUARINE_PALETTES,
|
|
90
|
+
...neutralPalettes(),
|
|
91
|
+
];
|
|
92
|
+
/**
|
|
93
|
+
* This pack's page of the colour pickers' carousel (`docs/adr/0027`).
|
|
94
|
+
* Registered from the FLAG-GATED view extension, because offering hues is
|
|
95
|
+
* TOOLING: a board drawn while the flag was on keeps every colour it was
|
|
96
|
+
* painted with when the flag goes off (`docs/adr/0009`).
|
|
97
|
+
*/
|
|
98
|
+
export const CYNEFIN_ESTUARINE_FRAMEWORK_PALETTE = {
|
|
99
|
+
framework: 'cynefin-estuarine',
|
|
100
|
+
labelWording: [
|
|
101
|
+
'com.labre.framework.cynefin-estuarine',
|
|
102
|
+
'Cynefin / Estuarine',
|
|
103
|
+
],
|
|
104
|
+
palettes: CYNEFIN_ESTUARINE_PALETTE_LIST,
|
|
105
|
+
};
|
|
@@ -7,6 +7,8 @@ export declare class EdgelessCynefinEstuarineSeniorButton extends EdgelessCynefi
|
|
|
7
7
|
enableActiveBackground: boolean;
|
|
8
8
|
type: typeof EmptyTool;
|
|
9
9
|
private _toggleMenu;
|
|
10
|
+
/** Lit while one of THIS framework's artefacts is armed. See the Wardley one. */
|
|
11
|
+
private get _armed();
|
|
10
12
|
render(): import("lit-html").TemplateResult<1>;
|
|
11
13
|
}
|
|
12
14
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DefaultTool } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { EmptyTool } from '@formicoidea/labre-core/gfx/pointer';
|
|
3
3
|
import { translateKey } from '@formicoidea/labre-core/shared/services';
|
|
4
|
-
import { EdgelessToolbarToolMixin } from '@formicoidea/labre-core/widgets/edgeless-toolbar';
|
|
4
|
+
import { armedArtefact, EdgelessToolbarToolMixin, } from '@formicoidea/labre-core/widgets/edgeless-toolbar';
|
|
5
5
|
import { SignalWatcher } from '@formicoidea/labre-core/global/lit';
|
|
6
6
|
import { css, html, LitElement } from 'lit';
|
|
7
7
|
import { cynefinToolbarIcon } from './icons.js';
|
|
@@ -62,6 +62,10 @@ export class EdgelessCynefinEstuarineSeniorButton extends EdgelessToolbarToolMix
|
|
|
62
62
|
const menu = this.createPopper('edgeless-cynefin-estuarine-menu', this);
|
|
63
63
|
menu.element.edgeless = this.edgeless;
|
|
64
64
|
}
|
|
65
|
+
/** Lit while one of THIS framework's artefacts is armed. See the Wardley one. */
|
|
66
|
+
get _armed() {
|
|
67
|
+
return armedArtefact(this.gfx)?.owner === 'cynefin-estuarine';
|
|
68
|
+
}
|
|
65
69
|
render() {
|
|
66
70
|
return html `<edgeless-toolbar-button
|
|
67
71
|
class="ce-button"
|
|
@@ -69,7 +73,7 @@ export class EdgelessCynefinEstuarineSeniorButton extends EdgelessToolbarToolMix
|
|
|
69
73
|
? ''
|
|
70
74
|
: translateKey(this.edgeless.std, 'com.labre.framework.cynefin-estuarine', 'Cynefin / Estuarine')}
|
|
71
75
|
.tooltipOffset=${4}
|
|
72
|
-
.active=${!!this.popper}
|
|
76
|
+
.active=${!!this.popper || this._armed}
|
|
73
77
|
@click=${this._toggleMenu}
|
|
74
78
|
>
|
|
75
79
|
<div class="ce-root">
|
package/dist/translations.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { collectTranslationKeys, commandCategoryTranslationEntries, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
|
|
2
2
|
import { cynefinEstuarineCommands } from './commands.js';
|
|
3
|
+
import { CYNEFIN_CANVAS_WORDINGS } from './cynefin/consts.js';
|
|
4
|
+
import { CYNEFIN_TOOLBAR_WORDINGS } from './cynefin/toolbar/config.js';
|
|
5
|
+
import { ESTUARINE_CANVAS_WORDINGS } from './estuarine/consts.js';
|
|
3
6
|
import { ESTUARINE_NUDGES } from './estuarine/nudges.js';
|
|
4
7
|
import { ESTUARINE_READING } from './estuarine/reading.js';
|
|
5
8
|
import { ESTUARINE_ROLES } from './estuarine/roles.js';
|
|
9
|
+
import { ESTUARINE_TOOLBAR_WORDINGS } from './estuarine/toolbar/config.js';
|
|
10
|
+
import { CYNEFIN_ESTUARINE_TEMPLATE_CATEGORY_WORDINGS, CYNEFIN_ESTUARINE_TEMPLATE_NAME_WORDINGS, CYNEFIN_ESTUARINE_TEMPLATE_SEEDS, } from './templates/index.js';
|
|
11
|
+
import { CYNEFIN_ESTUARINE_PALETTE_WORDINGS } from './toolbar/palette.js';
|
|
6
12
|
/**
|
|
7
13
|
* THIS framework's contribution to the translation-key manifest.
|
|
8
14
|
*
|
|
@@ -34,4 +40,49 @@ commandCategoryTranslationEntries(cynefinEstuarineCommands), collectTranslationK
|
|
|
34
40
|
// This profile declares no relation, so today it contributes no key of its
|
|
35
41
|
// own — walking it costs nothing and means the day it gains one the
|
|
36
42
|
// manifest already names it.
|
|
37
|
-
collectTranslationKeys('reading', ESTUARINE_READING)
|
|
43
|
+
collectTranslationKeys('reading', ESTUARINE_READING),
|
|
44
|
+
// The seeds the two hand-composed templates write into the document
|
|
45
|
+
// (`templates/index.ts`), resolved through `Template.localize` rather than
|
|
46
|
+
// a creation action — no command draws these two scenes.
|
|
47
|
+
CYNEFIN_ESTUARINE_TEMPLATE_SEEDS.map(([key, fallback]) => ({
|
|
48
|
+
key,
|
|
49
|
+
fallback,
|
|
50
|
+
source: 'seed',
|
|
51
|
+
})),
|
|
52
|
+
// The Templates-panel tab names — chrome, resolved by the panel widget,
|
|
53
|
+
// never written into a document.
|
|
54
|
+
CYNEFIN_ESTUARINE_TEMPLATE_CATEGORY_WORDINGS.map(([key, fallback]) => ({
|
|
55
|
+
key,
|
|
56
|
+
fallback,
|
|
57
|
+
source: 'chrome',
|
|
58
|
+
})),
|
|
59
|
+
// The two hand-composed templates' own tile names — chrome as well, and
|
|
60
|
+
// distinct from the seeds they WRITE above.
|
|
61
|
+
CYNEFIN_ESTUARINE_TEMPLATE_NAME_WORDINGS.map(([key, fallback]) => ({
|
|
62
|
+
key,
|
|
63
|
+
fallback,
|
|
64
|
+
source: 'chrome',
|
|
65
|
+
})),
|
|
66
|
+
// The two frameworks' own toolbar tooltips.
|
|
67
|
+
[...CYNEFIN_TOOLBAR_WORDINGS, ...ESTUARINE_TOOLBAR_WORDINGS].map(([key, fallback]) => ({ key, fallback, source: 'chrome' })),
|
|
68
|
+
// Every word the Cynefin frame's canvas renderer paints (headings,
|
|
69
|
+
// decisions, annotations, markers) — fixed notation, not document seeds.
|
|
70
|
+
CYNEFIN_CANVAS_WORDINGS.map(([key, fallback]) => ({
|
|
71
|
+
key,
|
|
72
|
+
fallback,
|
|
73
|
+
source: 'chrome',
|
|
74
|
+
})),
|
|
75
|
+
// The Estuarine map's own three curve legends.
|
|
76
|
+
ESTUARINE_CANVAS_WORDINGS.map(([key, fallback]) => ({
|
|
77
|
+
key,
|
|
78
|
+
fallback,
|
|
79
|
+
source: 'chrome',
|
|
80
|
+
})),
|
|
81
|
+
// The carousel swatches' own names (`toolbar/palette.ts`) — chrome,
|
|
82
|
+
// re-rendered by the colour picker on every locale switch, never seeded
|
|
83
|
+
// into a document. Same treatment as Wardley's and EDGY's.
|
|
84
|
+
CYNEFIN_ESTUARINE_PALETTE_WORDINGS.map(([key, fallback]) => ({
|
|
85
|
+
key,
|
|
86
|
+
fallback,
|
|
87
|
+
source: 'chrome',
|
|
88
|
+
})));
|
package/dist/view.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { QualityNudgeExtension, ReadingProfileExtension, ValidationFrameworkExtension, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import { FrameworkPaletteExtension } from '@formicoidea/labre-core/components/color-picker';
|
|
2
3
|
import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
|
|
3
4
|
import { TemplateCategoryExtension } from '@formicoidea/labre-core/gfx/template';
|
|
4
5
|
import { ToolbarModuleExtension } from '@formicoidea/labre-core/shared/services';
|
|
@@ -17,6 +18,7 @@ import { ESTUARINE_READING } from './estuarine/reading.js';
|
|
|
17
18
|
import { ESTUARINE_ROLE, ESTUARINE_ROLES } from './estuarine/roles.js';
|
|
18
19
|
import { estuarineToolbarExtension } from './estuarine/toolbar/config.js';
|
|
19
20
|
import { cynefinTemplateCategory, estuarineTemplateCategory, } from './templates/index.js';
|
|
21
|
+
import { CYNEFIN_ESTUARINE_FRAMEWORK_PALETTE } from './toolbar/palette.js';
|
|
20
22
|
import { cynefinEstuarineSeniorTool } from './toolbar/senior-tool.js';
|
|
21
23
|
/**
|
|
22
24
|
* Cynefin / Estuarine rendering — ALWAYS registered, independent of any flag.
|
|
@@ -110,6 +112,11 @@ export class CynefinEstuarineViewExtension extends ViewExtensionProvider {
|
|
|
110
112
|
// free element on a Cynefin board carries no role and stays unreadable.
|
|
111
113
|
context.register(ReadingProfileExtension(ESTUARINE_READING));
|
|
112
114
|
context.register(cynefinEstuarineSeniorTool);
|
|
115
|
+
// This pack's page of the colour pickers' carousel (`docs/adr/0027`).
|
|
116
|
+
// Here, beside the senior tool, because offering hues is TOOLING — the
|
|
117
|
+
// colours already painted on a stored board are content and do not move
|
|
118
|
+
// (`docs/adr/0009`).
|
|
119
|
+
context.register(FrameworkPaletteExtension(CYNEFIN_ESTUARINE_FRAMEWORK_PALETTE));
|
|
113
120
|
// Both Templates-panel categories — tooling, so they go with the flag
|
|
114
121
|
// (#244).
|
|
115
122
|
context.register(TemplateCategoryExtension(cynefinTemplateCategory, estuarineTemplateCategory));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-cynefin",
|
|
3
3
|
"description": "Labre cynefin-estuarine framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.42.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@formicoidea/labre-core": "0.
|
|
34
|
+
"@formicoidea/labre-core": "0.42.0",
|
|
35
35
|
"@preact/signals-core": "^1.8.0",
|
|
36
36
|
"lit": "^3.2.0"
|
|
37
37
|
}
|