@miragon/wardley-renderer 0.3.0 → 0.5.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/README.md +4 -3
- package/dist/draw/styles.d.ts +46 -42
- package/dist/draw/styles.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +422 -404
- package/dist/index.js.map +1 -1
- package/dist/label-editing/WardleyLabelEditing.d.ts.map +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/palette.d.ts +55 -0
- package/dist/theme/palette.d.ts.map +1 -0
- package/dist/wardley.css +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -36,11 +36,12 @@ Swap `NavigatedViewer` for `Modeler` to get the editable map (palette, context p
|
|
|
36
36
|
|
|
37
37
|
### Fonts
|
|
38
38
|
|
|
39
|
-
The package ships no fonts and uses no CDN.
|
|
40
|
-
[`@fontsource`](https://fontsource.org/)
|
|
39
|
+
The package ships no fonts and uses no CDN. The canvas typeface is **Geist** (Miragon corporate
|
|
40
|
+
identity); provide it yourself — recommended self-hosted via [`@fontsource`](https://fontsource.org/)
|
|
41
|
+
(one variable file covers all weights):
|
|
41
42
|
|
|
42
43
|
```ts
|
|
43
|
-
import '@fontsource-variable/
|
|
44
|
+
import '@fontsource-variable/geist/wght.css';
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
Part of the [Wardley Maps](https://github.com/Miragon/wardley-maps-modeler) monorepo.
|
package/dist/draw/styles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Central rendering constants (geometry, colors, typography) —
|
|
1
|
+
/** Central rendering constants (geometry, colors, typography) — Miragon corporate identity. */
|
|
2
2
|
/** Default plot area in diagram px (interior without axis margins). Changeable at runtime via
|
|
3
3
|
* config.size. Width/height come from schema-model (single source, also used for migrations). */
|
|
4
4
|
export declare const PLOT: {
|
|
@@ -15,11 +15,9 @@ export declare const PLOT_MIN: {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const NODE_SIZE = 34;
|
|
17
17
|
export declare const COMPONENT_RADIUS = 15;
|
|
18
|
-
/** Inner ring for "evolving" (intermediate-event look). */
|
|
19
18
|
export declare const COMPONENT_INNER_RADIUS = 12;
|
|
20
19
|
export declare const ANCHOR_ICON_SIZE = 26;
|
|
21
20
|
export declare const PIPELINE_HEIGHT = 30;
|
|
22
|
-
/** Side length of the ■ anchor square drawn on the pipeline box's top edge. */
|
|
23
21
|
export declare const PIPELINE_ANCHOR_SIZE = 16;
|
|
24
22
|
export declare const NOTE_LINE_HEIGHT = 17;
|
|
25
23
|
/**
|
|
@@ -31,32 +29,35 @@ export declare function noteMetrics(label: string): {
|
|
|
31
29
|
width: number;
|
|
32
30
|
height: number;
|
|
33
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Canvas colours — Miragon palette (blue = interactive/flow, green = accelerate/positive,
|
|
34
|
+
* red = movement/decelerate). Keys are the public contract; brand values come from the single source
|
|
35
|
+
* of truth in `theme/palette.ts` (`MIRAGON`). Referenced (not spread) so the literal-string types
|
|
36
|
+
* survive into the published `.d.ts`.
|
|
37
|
+
*/
|
|
34
38
|
export declare const COLORS: {
|
|
35
|
-
readonly paper: "#
|
|
36
|
-
readonly ink: "#
|
|
37
|
-
readonly inkSoft: "#
|
|
38
|
-
readonly axis: "
|
|
39
|
-
readonly axisText: "#
|
|
40
|
-
readonly grid: "
|
|
41
|
-
readonly band: "rgba(
|
|
42
|
-
readonly stroke: "#
|
|
43
|
-
readonly componentFill: "#
|
|
44
|
-
readonly anchorFill: "#
|
|
45
|
-
readonly dependency: "#
|
|
46
|
-
readonly accent: "#
|
|
47
|
-
readonly accentSoft: "rgba(
|
|
48
|
-
readonly flow: "#
|
|
49
|
-
readonly movement: "#
|
|
50
|
-
readonly inertia: "#
|
|
51
|
-
readonly noteText: "#
|
|
52
|
-
readonly pipeline: "#
|
|
53
|
-
|
|
54
|
-
readonly
|
|
55
|
-
|
|
56
|
-
readonly
|
|
57
|
-
/** Accelerator / deaccelerator (own semantic constants — not flow/movement). */
|
|
58
|
-
readonly accelerator: "#0e7c74";
|
|
59
|
-
readonly deaccelerator: "#bf2f2a";
|
|
39
|
+
readonly paper: "#F9F7F7";
|
|
40
|
+
readonly ink: "#1D1D1D";
|
|
41
|
+
readonly inkSoft: "#5B5B5B";
|
|
42
|
+
readonly axis: "rgba(51,93,229,0.22)";
|
|
43
|
+
readonly axisText: "#6E7797";
|
|
44
|
+
readonly grid: "rgba(51,93,229,0.12)";
|
|
45
|
+
readonly band: "rgba(51,93,229,0.04)";
|
|
46
|
+
readonly stroke: "#1D1D1D";
|
|
47
|
+
readonly componentFill: "#FFFFFF";
|
|
48
|
+
readonly anchorFill: "#1D1D1D";
|
|
49
|
+
readonly dependency: "#9E9E9E";
|
|
50
|
+
readonly accent: "#335DE5";
|
|
51
|
+
readonly accentSoft: "rgba(51,93,229,0.12)";
|
|
52
|
+
readonly flow: "#335DE5";
|
|
53
|
+
readonly movement: "#C92A2A";
|
|
54
|
+
readonly inertia: "#1D1D1D";
|
|
55
|
+
readonly noteText: "#5B5B5B";
|
|
56
|
+
readonly pipeline: "#1D1D1D";
|
|
57
|
+
readonly annotationFill: "#FBF3E0";
|
|
58
|
+
readonly plotBackground: "#FFFFFF";
|
|
59
|
+
readonly accelerator: "#00C853";
|
|
60
|
+
readonly deaccelerator: "#C92A2A";
|
|
60
61
|
};
|
|
61
62
|
/**
|
|
62
63
|
* Note color palette (bpmn.io-style mini picker; deliberately NOT a full color picker). Values are
|
|
@@ -67,37 +68,40 @@ export declare const COLORS: {
|
|
|
67
68
|
export declare const NOTE_COLORS: readonly [{
|
|
68
69
|
readonly id: "green";
|
|
69
70
|
readonly name: "Green · good";
|
|
70
|
-
readonly value: "#
|
|
71
|
+
readonly value: "#0B7A55";
|
|
71
72
|
}, {
|
|
72
73
|
readonly id: "amber";
|
|
73
74
|
readonly name: "Amber · watch";
|
|
74
|
-
readonly value: "#
|
|
75
|
+
readonly value: "#92610A";
|
|
75
76
|
}, {
|
|
76
77
|
readonly id: "red";
|
|
77
78
|
readonly name: "Red · problem";
|
|
78
|
-
readonly value: "#
|
|
79
|
+
readonly value: "#C92A2A";
|
|
79
80
|
}, {
|
|
80
81
|
readonly id: "blue";
|
|
81
82
|
readonly name: "Blue · info";
|
|
82
|
-
readonly value: "#
|
|
83
|
+
readonly value: "#2B50D4";
|
|
83
84
|
}, {
|
|
84
85
|
readonly id: "teal";
|
|
85
86
|
readonly name: "Teal";
|
|
86
|
-
readonly value: "#
|
|
87
|
+
readonly value: "#0E8181";
|
|
87
88
|
}, {
|
|
88
89
|
readonly id: "purple";
|
|
89
90
|
readonly name: "Purple · idea";
|
|
90
|
-
readonly value: "#
|
|
91
|
+
readonly value: "#6A3DB8";
|
|
91
92
|
}, {
|
|
92
93
|
readonly id: "pink";
|
|
93
94
|
readonly name: "Pink";
|
|
94
|
-
readonly value: "#
|
|
95
|
+
readonly value: "#C2185B";
|
|
95
96
|
}, {
|
|
96
97
|
readonly id: "slate";
|
|
97
98
|
readonly name: "Slate · neutral";
|
|
98
|
-
readonly value: "#
|
|
99
|
+
readonly value: "#4A4A4A";
|
|
99
100
|
}];
|
|
100
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Colors of the attitude regions per kind (shared by renderer + palette icons). Miragon palette:
|
|
103
|
+
* pioneers = blue (explore), settlers = amber (stabilise), town planners = green (industrialise).
|
|
104
|
+
*/
|
|
101
105
|
export declare const ATTITUDE_COLORS: Record<string, {
|
|
102
106
|
fill: string;
|
|
103
107
|
stroke: string;
|
|
@@ -106,12 +110,12 @@ export declare const FONT: {
|
|
|
106
110
|
/**
|
|
107
111
|
* Set as the `font-family` attribute DIRECTLY on all SVG text elements (canvas labels,
|
|
108
112
|
* axis/stage text and consequently the SVG export too) – not inherited from a CSS container.
|
|
109
|
-
* In EVERY context it reaches for the self-hosted '
|
|
110
|
-
* it; otherwise (e.g. an export SVG opened standalone) it falls back safely to a
|
|
111
|
-
* The library does NOT ship the font – consumers must
|
|
112
|
-
* (e.g. via @fontsource-variable/
|
|
113
|
+
* In EVERY context it reaches for the self-hosted 'Geist' (Miragon corporate typeface) if the
|
|
114
|
+
* consumer provides it; otherwise (e.g. an export SVG opened standalone) it falls back safely to a
|
|
115
|
+
* system sans. The library does NOT ship the font – consumers must self-host Geist themselves
|
|
116
|
+
* (e.g. via @fontsource-variable/geist), see README.
|
|
113
117
|
*/
|
|
114
|
-
readonly family: "'
|
|
118
|
+
readonly family: "'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif";
|
|
115
119
|
readonly label: 13;
|
|
116
120
|
readonly axis: 12;
|
|
117
121
|
readonly stage: 12;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/draw/styles.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/draw/styles.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAK/F;kGACkG;AAClG,eAAO,MAAM,IAAI;;;;;;;CAOP,CAAC;AAEX,eAAO,MAAM,QAAQ;;;CAAuC,CAAC;AAE7D,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAKnC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQ7F;AAED;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAuBT,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASd,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAI5E,CAAC;AAEF,eAAO,MAAM,IAAI;IACf;;;;;;;OAOG;;;;;CAKK,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { wardleyModelModule, WardleyElementFactory } from './model/index.js';
|
|
|
7
7
|
export { evolutionGridModule, evolutionConstraintModule, EvolutionGrid, } from './evolution-grid/index.js';
|
|
8
8
|
export { wardleyDrawModule, WardleyRenderer } from './draw/index.js';
|
|
9
9
|
export { COLORS, PLOT } from './draw/styles.js';
|
|
10
|
+
export { MIRAGON } from './theme/index.js';
|
|
10
11
|
export { ioModule, WardleyImporter, WardleyExporter, saveSVG, ROOT_ID } from './io/index.js';
|
|
11
12
|
export { wardleyModelingModule, WardleyModeling } from './modeling/index.js';
|
|
12
13
|
export type { EvolveOptions } from './modeling/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElF,OAAO,EAAE,kB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