@formicoidea/labre-framework-cynefin 0.53.0 → 0.55.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementRendererExtension, taggedPath2D, } from '@formicoidea/labre-core/blocks/surface';
|
|
1
|
+
import { ElementRendererExtension, notationColor, taggedPath2D, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { TranslationProvider, translateKey, } from '@formicoidea/labre-core/shared/services';
|
|
3
3
|
import { FONT_FAMILY, refScale } from '../utils.js';
|
|
4
4
|
import { COLORS, DARK_BACK_PATHS, DARK_FRONT_PATHS, DASH_RECTS, DOMAINS, HATCHES, HEADING_SIZE, MARKERS, REF_H, REF_W, SMALL_LABELS, TEAL_LABELS, TEAL_PATH, TEAL_WIDTH, } from './consts.js';
|
|
@@ -28,6 +28,9 @@ import { cynefinHeadingText } from './labels.js';
|
|
|
28
28
|
* to split it would be inventing typography the translator never asked for.
|
|
29
29
|
*/
|
|
30
30
|
export const cynefin = (model, ctx, matrix, renderer) => {
|
|
31
|
+
// The official SVG's inks, on whatever the canvas is: on a dark one they go
|
|
32
|
+
// through the dark notation table (ADR 0039).
|
|
33
|
+
const ink = (color) => notationColor(renderer, color);
|
|
31
34
|
const tr = (wording) => renderer ? translateKey(renderer.std, ...wording) : wording[1];
|
|
32
35
|
// The host's catalogue, or `null` with no host — used to decide whether a
|
|
33
36
|
// decision line is drawn bold-lead/roman-rest (English, exactly as before)
|
|
@@ -45,7 +48,7 @@ export const cynefin = (model, ctx, matrix, renderer) => {
|
|
|
45
48
|
ctx.scale(s, s);
|
|
46
49
|
ctx.lineCap = 'butt';
|
|
47
50
|
// ── Dark boundary strokes (behind the teal curve) ───────────────────
|
|
48
|
-
ctx.strokeStyle = COLORS.boundary;
|
|
51
|
+
ctx.strokeStyle = ink(COLORS.boundary);
|
|
49
52
|
for (const [d, lw, miter] of DARK_BACK_PATHS) {
|
|
50
53
|
ctx.lineJoin = miter ? 'miter' : 'round';
|
|
51
54
|
ctx.lineWidth = lw;
|
|
@@ -53,7 +56,7 @@ export const cynefin = (model, ctx, matrix, renderer) => {
|
|
|
53
56
|
}
|
|
54
57
|
ctx.lineJoin = 'round';
|
|
55
58
|
// ── Dashed boundary (oriented square pavings) ───────────────────────
|
|
56
|
-
ctx.fillStyle = COLORS.boundary;
|
|
59
|
+
ctx.fillStyle = ink(COLORS.boundary);
|
|
57
60
|
for (const [x, y, sz, rot] of DASH_RECTS) {
|
|
58
61
|
ctx.save();
|
|
59
62
|
ctx.translate(x, y);
|
|
@@ -63,12 +66,12 @@ export const cynefin = (model, ctx, matrix, renderer) => {
|
|
|
63
66
|
}
|
|
64
67
|
// ── Teal "iterate" liminal curve ────────────────────────────────────
|
|
65
68
|
if (model.showLiminalLine) {
|
|
66
|
-
ctx.strokeStyle = COLORS.teal;
|
|
69
|
+
ctx.strokeStyle = ink(COLORS.teal);
|
|
67
70
|
ctx.lineWidth = TEAL_WIDTH;
|
|
68
71
|
ctx.stroke(taggedPath2D(TEAL_PATH));
|
|
69
72
|
}
|
|
70
73
|
// ── Dark boundary strokes (over the teal curve) ─────────────────────
|
|
71
|
-
ctx.strokeStyle = COLORS.boundary;
|
|
74
|
+
ctx.strokeStyle = ink(COLORS.boundary);
|
|
72
75
|
for (const [d, lw, miter] of DARK_FRONT_PATHS) {
|
|
73
76
|
ctx.lineJoin = miter ? 'miter' : 'round';
|
|
74
77
|
ctx.lineWidth = lw;
|
|
@@ -87,7 +90,7 @@ export const cynefin = (model, ctx, matrix, renderer) => {
|
|
|
87
90
|
// ── Titles: domain headings + A / C marker glyphs and names ─────────
|
|
88
91
|
if (model.showTitles) {
|
|
89
92
|
ctx.textAlign = 'left';
|
|
90
|
-
ctx.fillStyle = COLORS.heading;
|
|
93
|
+
ctx.fillStyle = ink(COLORS.heading);
|
|
91
94
|
ctx.font = `700 ${HEADING_SIZE}px ${FONT_FAMILY}`;
|
|
92
95
|
// The user's own word when they have renamed this domain, the catalogue's
|
|
93
96
|
// otherwise — the same precedence a declared background applies.
|
|
@@ -96,7 +99,7 @@ export const cynefin = (model, ctx, matrix, renderer) => {
|
|
|
96
99
|
}
|
|
97
100
|
ctx.textAlign = 'center';
|
|
98
101
|
for (const m of MARKERS) {
|
|
99
|
-
ctx.fillStyle = COLORS.body;
|
|
102
|
+
ctx.fillStyle = ink(COLORS.body);
|
|
100
103
|
ctx.font = `700 38px ${FONT_FAMILY}`;
|
|
101
104
|
// The letter itself is notation, not a word — never translated.
|
|
102
105
|
ctx.fillText(m.letter, m.lx, m.ly);
|
|
@@ -109,10 +112,10 @@ export const cynefin = (model, ctx, matrix, renderer) => {
|
|
|
109
112
|
// Subheadings (h2) + decision lines
|
|
110
113
|
ctx.textAlign = 'left';
|
|
111
114
|
for (const d of DOMAINS) {
|
|
112
|
-
ctx.fillStyle = COLORS.heading;
|
|
115
|
+
ctx.fillStyle = ink(COLORS.heading);
|
|
113
116
|
ctx.font = `700 15px ${FONT_FAMILY}`;
|
|
114
117
|
ctx.fillText(tr(d.subheading), d.x, d.sy);
|
|
115
|
-
ctx.fillStyle = COLORS.body;
|
|
118
|
+
ctx.fillStyle = ink(COLORS.body);
|
|
116
119
|
for (const { lead, rest, wording, y } of d.lines) {
|
|
117
120
|
if (hasHost) {
|
|
118
121
|
// A translated sentence: one run, no assumed bold-lead boundary.
|
|
@@ -132,18 +135,18 @@ export const cynefin = (model, ctx, matrix, renderer) => {
|
|
|
132
135
|
}
|
|
133
136
|
ctx.textAlign = 'center';
|
|
134
137
|
// Teal annotation labels
|
|
135
|
-
ctx.fillStyle = COLORS.teal;
|
|
138
|
+
ctx.fillStyle = ink(COLORS.teal);
|
|
136
139
|
ctx.font = `700 15px ${FONT_FAMILY}`;
|
|
137
140
|
for (const [wording, x, y] of TEAL_LABELS)
|
|
138
141
|
ctx.fillText(tr(wording), x, y);
|
|
139
142
|
// Small exaptation sub-labels
|
|
140
|
-
ctx.fillStyle = COLORS.body;
|
|
143
|
+
ctx.fillStyle = ink(COLORS.body);
|
|
141
144
|
ctx.font = `10.5px ${FONT_FAMILY}`;
|
|
142
145
|
for (const [wording, x, y] of SMALL_LABELS) {
|
|
143
146
|
ctx.fillText(tr(wording), x, y);
|
|
144
147
|
}
|
|
145
148
|
// Marker notes ("prepare to exit")
|
|
146
|
-
ctx.fillStyle = COLORS.teal;
|
|
149
|
+
ctx.fillStyle = ink(COLORS.teal);
|
|
147
150
|
ctx.font = `700 15px ${FONT_FAMILY}`;
|
|
148
151
|
for (const m of MARKERS) {
|
|
149
152
|
if (m.note)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NotationDarkPalette } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
/**
|
|
3
|
+
* Cynefin and Estuarine on a dark canvas (ADR 0039). The inks of the two
|
|
4
|
+
* reference drawings go light, keeping the contrast they have on white; the
|
|
5
|
+
* hues (the teal curve, the liminal green, the volatile red) stay as drawn.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CYNEFIN_ESTUARINE_DARK_PALETTE: NotationDarkPalette;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { COLORS as CYNEFIN } from './cynefin/consts.js';
|
|
2
|
+
import { COLORS as ESTUARINE, HEX_STROKE } from './estuarine/consts.js';
|
|
3
|
+
/**
|
|
4
|
+
* Cynefin and Estuarine on a dark canvas (ADR 0039). The inks of the two
|
|
5
|
+
* reference drawings go light, keeping the contrast they have on white; the
|
|
6
|
+
* hues (the teal curve, the liminal green, the volatile red) stay as drawn.
|
|
7
|
+
*/
|
|
8
|
+
export const CYNEFIN_ESTUARINE_DARK_PALETTE = {
|
|
9
|
+
framework: 'cynefin-estuarine',
|
|
10
|
+
colors: {
|
|
11
|
+
[CYNEFIN.boundary]: '#d6d6d6',
|
|
12
|
+
[CYNEFIN.heading]: '#86878a',
|
|
13
|
+
[CYNEFIN.body]: '#eaeaea',
|
|
14
|
+
[ESTUARINE.axis]: '#ff8cbe',
|
|
15
|
+
[ESTUARINE.axisLabel]: '#e95f4e',
|
|
16
|
+
[ESTUARINE.liminalLabel]: '#4a984c',
|
|
17
|
+
[ESTUARINE.label]: '#eaeaea',
|
|
18
|
+
[HEX_STROKE]: '#eaeaea',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementRendererExtension, taggedPath2D, } from '@formicoidea/labre-core/blocks/surface';
|
|
1
|
+
import { ElementRendererExtension, notationColor, taggedPath2D, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { translateKey, } from '@formicoidea/labre-core/shared/services';
|
|
3
3
|
import { FONT_FAMILY } from '../utils.js';
|
|
4
4
|
import { ARROWHEADS, AXIS_LABELS, AXIS_WIDTH, COLORS, COUNTERFACTUAL_PATH, COUNTERFACTUAL_WIDTH, E_AXIS, LABEL_LETTER_SPACING, LABELS, LIMINAL_PATH, LIMINAL_WIDTH, REF_H, REF_W, REF_X, REF_Y, T_AXIS, VOLATILE_PATH, VOLATILE_WIDTH, } from './consts.js';
|
|
@@ -114,6 +114,9 @@ export function applyEstuarineTransform(ctx, w, h) {
|
|
|
114
114
|
*/
|
|
115
115
|
export const estuarine = (model, ctx, matrix, renderer) => {
|
|
116
116
|
const tr = (wording) => renderer ? translateKey(renderer.std, ...wording) : wording[1];
|
|
117
|
+
// The official SVG's inks, through the dark notation table on a dark
|
|
118
|
+
// canvas (ADR 0039).
|
|
119
|
+
const ink = (color) => notationColor(renderer, color);
|
|
117
120
|
const [, , w, h] = model.deserializedXYWH;
|
|
118
121
|
const cx = w / 2;
|
|
119
122
|
const cy = h / 2;
|
|
@@ -132,8 +135,8 @@ export const estuarine = (model, ctx, matrix, renderer) => {
|
|
|
132
135
|
// Drawn in element coordinates so the e axis spans the real height and the
|
|
133
136
|
// t axis the real width, while `lineWidth` stays one honest thickness
|
|
134
137
|
// instead of being fattened in whichever direction the map was pulled.
|
|
135
|
-
ctx.strokeStyle = COLORS.axis;
|
|
136
|
-
ctx.fillStyle = COLORS.axis;
|
|
138
|
+
ctx.strokeStyle = ink(COLORS.axis);
|
|
139
|
+
ctx.fillStyle = ink(COLORS.axis);
|
|
137
140
|
ctx.lineWidth = AXIS_WIDTH * fit.strokeScale;
|
|
138
141
|
ctx.beginPath();
|
|
139
142
|
ctx.moveTo(ax(E_AXIS.x), ay(E_AXIS.y1));
|
|
@@ -172,7 +175,7 @@ export const estuarine = (model, ctx, matrix, renderer) => {
|
|
|
172
175
|
const hasSpacing = 'letterSpacing' in ctx;
|
|
173
176
|
const legend = (key) => {
|
|
174
177
|
const l = LABELS[key];
|
|
175
|
-
ctx.fillStyle = l.color;
|
|
178
|
+
ctx.fillStyle = ink(l.color);
|
|
176
179
|
ctx.font = `600 ${l.size * fit.strokeScale}px ${FONT_FAMILY}`;
|
|
177
180
|
ctx.textAlign = 'center';
|
|
178
181
|
ctx.textBaseline = 'alphabetic';
|
|
@@ -194,7 +197,7 @@ export const estuarine = (model, ctx, matrix, renderer) => {
|
|
|
194
197
|
continue;
|
|
195
198
|
ctx.save();
|
|
196
199
|
applyEstuarineTransform(ctx, w, h);
|
|
197
|
-
ctx.strokeStyle = curve.color;
|
|
200
|
+
ctx.strokeStyle = ink(curve.color);
|
|
198
201
|
ctx.lineWidth = curve.width * fit.curveLineScale;
|
|
199
202
|
ctx.globalAlpha = GHOST_ALPHA;
|
|
200
203
|
ctx.setLineDash([...GHOST_DASH]);
|
|
@@ -208,7 +211,7 @@ export const estuarine = (model, ctx, matrix, renderer) => {
|
|
|
208
211
|
// writes as `backgroundPoint`. The glyph and the gap then scale together, so
|
|
209
212
|
// the letter sits the same distance from its axis at every ratio.
|
|
210
213
|
if (model.showAxisLabels) {
|
|
211
|
-
ctx.fillStyle = COLORS.axisLabel;
|
|
214
|
+
ctx.fillStyle = ink(COLORS.axisLabel);
|
|
212
215
|
ctx.font = `italic 700 ${AXIS_LABELS.size * k}px Georgia, serif`;
|
|
213
216
|
ctx.textAlign = 'left';
|
|
214
217
|
ctx.textBaseline = 'alphabetic';
|
package/dist/view.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QualityNudgeExtension, ReadingProfileExtension, ValidationFrameworkExtension, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
|
|
1
|
+
import { QualityNudgeExtension, ReadingProfileExtension, ValidationFrameworkExtension, validationToolbarConfig, NotationDarkPaletteExtension, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { FrameworkPaletteExtension } from '@formicoidea/labre-core/components/color-picker';
|
|
3
3
|
import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
|
|
4
4
|
import { TemplateCategoryExtension } from '@formicoidea/labre-core/gfx/template';
|
|
@@ -20,6 +20,7 @@ import { estuarineToolbarExtension } from './estuarine/toolbar/config.js';
|
|
|
20
20
|
import { cynefinTemplateCategory, estuarineTemplateCategory, } from './templates/index.js';
|
|
21
21
|
import { CYNEFIN_ESTUARINE_FRAMEWORK_PALETTE } from './toolbar/palette.js';
|
|
22
22
|
import { cynefinEstuarineSeniorTool } from './toolbar/senior-tool.js';
|
|
23
|
+
import { CYNEFIN_ESTUARINE_DARK_PALETTE } from './dark-palette.js';
|
|
23
24
|
/**
|
|
24
25
|
* Cynefin / Estuarine rendering — ALWAYS registered, independent of any flag.
|
|
25
26
|
* Disabling `cynefin-estuarine` hides only the creation tooling (see
|
|
@@ -34,6 +35,7 @@ export class CynefinEstuarineRenderViewExtension extends ViewExtensionProvider {
|
|
|
34
35
|
}
|
|
35
36
|
setup(context) {
|
|
36
37
|
super.setup(context);
|
|
38
|
+
context.register(NotationDarkPaletteExtension(CYNEFIN_ESTUARINE_DARK_PALETTE));
|
|
37
39
|
context.register(CynefinView);
|
|
38
40
|
context.register(CynefinRendererExtension);
|
|
39
41
|
context.register(EstuarineView);
|
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.55.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.55.0",
|
|
35
35
|
"@preact/signals-core": "^1.8.0",
|
|
36
36
|
"lit": "^3.2.0"
|
|
37
37
|
}
|