@formicoidea/labre-framework-wardley 0.23.1 → 0.23.2
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/package.json +6 -15
- package/{dist/consts.js → src/consts.ts} +72 -63
- package/{dist/descriptor.js → src/descriptor.ts} +1 -1
- package/src/effects.ts +17 -0
- package/src/element-renderer.ts +242 -0
- package/src/element-view.ts +143 -0
- package/src/gradient.ts +137 -0
- package/src/index.ts +1 -0
- package/src/label-layout.ts +126 -0
- package/src/legend.ts +438 -0
- package/{dist/node/consts.js → src/node/consts.ts} +109 -101
- package/src/node/node-renderer.ts +142 -0
- package/{dist/node/node-view.d.ts → src/node/node-view.ts} +11 -11
- package/src/templates/index.ts +236 -0
- package/src/templates/maps.ts +283 -0
- package/src/toolbar/config.ts +280 -0
- package/{dist/toolbar/icons.js → src/toolbar/icons.ts} +66 -51
- package/{dist/toolbar/node-config.js → src/toolbar/node-config.ts} +28 -21
- package/{dist/toolbar/senior-tool.js → src/toolbar/senior-tool.ts} +11 -11
- package/src/toolbar/wardley-menu.ts +552 -0
- package/src/toolbar/wardley-senior-button.ts +154 -0
- package/src/view.ts +39 -0
- package/dist/consts.d.ts +0 -72
- package/dist/descriptor.d.ts +0 -7
- package/dist/effects.d.ts +0 -10
- package/dist/effects.js +0 -7
- package/dist/element-renderer.d.ts +0 -15
- package/dist/element-renderer.js +0 -160
- package/dist/element-view.d.ts +0 -21
- package/dist/element-view.js +0 -122
- package/dist/gradient.d.ts +0 -18
- package/dist/gradient.js +0 -112
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/label-layout.d.ts +0 -21
- package/dist/label-layout.js +0 -73
- package/dist/legend.d.ts +0 -12
- package/dist/legend.js +0 -333
- package/dist/node/consts.d.ts +0 -107
- package/dist/node/label-editor.d.ts +0 -28
- package/dist/node/label-editor.js +0 -216
- package/dist/node/node-renderer.d.ts +0 -17
- package/dist/node/node-renderer.js +0 -106
- package/dist/node/node-view.js +0 -10
- package/dist/templates/index.d.ts +0 -3
- package/dist/templates/index.js +0 -172
- package/dist/templates/maps.d.ts +0 -3
- package/dist/templates/maps.js +0 -247
- package/dist/toolbar/config.d.ts +0 -75
- package/dist/toolbar/config.js +0 -206
- package/dist/toolbar/icons.d.ts +0 -31
- package/dist/toolbar/node-config.d.ts +0 -2
- package/dist/toolbar/senior-tool.d.ts +0 -2
- package/dist/toolbar/wardley-menu.d.ts +0 -53
- package/dist/toolbar/wardley-menu.js +0 -408
- package/dist/toolbar/wardley-senior-button.d.ts +0 -18
- package/dist/toolbar/wardley-senior-button.js +0 -146
- package/dist/toolbar/wardley-tool-button.d.ts +0 -10
- package/dist/toolbar/wardley-tool-button.js +0 -123
- package/dist/view.d.ts +0 -7
- package/dist/view.js +0 -36
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { svg } from 'lit';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { svg } from 'lit';
|
|
2
|
+
|
|
3
|
+
/** Colored Wardley glyph (mockup proposal B) for the main toolbar button. */
|
|
4
|
+
export const wardleyToolbarIcon = svg`<svg width="100%" height="100%" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
5
|
<defs>
|
|
5
6
|
<linearGradient id="wardley-evo" x1="0" y1="0" x2="0" y2="1">
|
|
6
7
|
<stop offset="0" stop-color="#ffffff" stop-opacity="0"/>
|
|
@@ -21,61 +22,71 @@ export const wardleyToolbarIcon = svg `<svg width="100%" height="100%" viewBox="
|
|
|
21
22
|
<circle cx="27" cy="16.5" r="2.6" fill="#e2a32b"/>
|
|
22
23
|
<circle cx="24" cy="26" r="2.6" fill="#d6455d"/>
|
|
23
24
|
</svg>
|
|
24
|
-
</svg>`;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
</svg>`;
|
|
26
|
+
|
|
27
|
+
/** Monochrome glyph for the "create background" menu item (uses currentColor). */
|
|
28
|
+
export const wardleyBackgroundIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
27
29
|
<path d="M6 4 V19 H21" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
28
30
|
<path d="M6 2.6 L3.8 6 H8.2 Z" fill="currentColor"/>
|
|
29
31
|
<path d="M22.4 19 L19 16.8 V21.2 Z" fill="currentColor"/>
|
|
30
32
|
<line x1="11" y1="6" x2="11" y2="19" stroke="currentColor" stroke-width="0.9" stroke-dasharray="1.8 1.8" opacity="0.6"/>
|
|
31
33
|
<line x1="16" y1="6" x2="16" y2="19" stroke="currentColor" stroke-width="0.9" stroke-dasharray="1.8 1.8" opacity="0.6"/>
|
|
32
|
-
</svg>`;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
</svg>`;
|
|
35
|
+
|
|
36
|
+
/** Wardley red — matches the renderer presets (consts WARDLEY_RED). */
|
|
37
|
+
const RED = '#d6455d';
|
|
38
|
+
/** Gradient green — matches gradient.ts GRADIENT_GREEN. */
|
|
39
|
+
const GREEN = '#1f9e4d';
|
|
40
|
+
|
|
41
|
+
/** Component node (validated COMP-C2): single circle. */
|
|
42
|
+
export const wardleyComponentIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
39
43
|
<circle cx="12" cy="12" r="6.3" fill="#fff" stroke="currentColor" stroke-width="1.5"/>
|
|
40
|
-
</svg>`;
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
</svg>`;
|
|
45
|
+
|
|
46
|
+
/** Anchor (validated ANCH-B): person glyph inscribed in a circle. */
|
|
47
|
+
export const wardleyAnchorIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
48
|
<circle cx="12" cy="12" r="6" fill="#fff" stroke="currentColor" stroke-width="1.6"/>
|
|
44
49
|
<circle cx="12" cy="9.4" r="1.8" fill="none" stroke="currentColor" stroke-width="1.3"/>
|
|
45
50
|
<path d="M7.4 15.9 C 8.2 12.1, 15.8 12.1, 16.6 15.9" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
|
46
|
-
</svg>`;
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
</svg>`;
|
|
52
|
+
|
|
53
|
+
/** Dependency link (validated LINK-A3): two outline nodes joined by a line. */
|
|
54
|
+
export const wardleyLinkIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
49
55
|
<line x1="5.5" y1="16" x2="18.5" y2="8" stroke="currentColor" stroke-width="1.8"/>
|
|
50
56
|
<circle cx="5.5" cy="16" r="2.2" fill="#fff" stroke="currentColor" stroke-width="1.5"/>
|
|
51
57
|
<circle cx="18.5" cy="8" r="2.2" fill="#fff" stroke="currentColor" stroke-width="1.5"/>
|
|
52
|
-
</svg>`;
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
</svg>`;
|
|
59
|
+
|
|
60
|
+
/** Evolution arrow (validated ARR-B): red dashed arrow. */
|
|
61
|
+
export const wardleyArrowIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
55
62
|
<line x1="4.5" y1="12" x2="16" y2="12" stroke="${RED}" stroke-width="1.7" stroke-dasharray="2.4 2.2" stroke-linecap="round"/>
|
|
56
63
|
<path d="M14.5 7.8 L20 12 L14.5 16.2 Z" fill="${RED}"/>
|
|
57
|
-
</svg>`;
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
</svg>`;
|
|
65
|
+
|
|
66
|
+
/** Inertia (validated INER): black bar barring the red dashed arrow. */
|
|
67
|
+
export const wardleyInertiaIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
60
68
|
<line x1="3.5" y1="12" x2="16.5" y2="12" stroke="${RED}" stroke-width="1.7" stroke-dasharray="2.4 2.2" stroke-linecap="round"/>
|
|
61
69
|
<path d="M15 7.8 L20.5 12 L15 16.2 Z" fill="${RED}"/>
|
|
62
70
|
<rect x="9.6" y="5.4" width="2.9" height="13.2" rx="0.6" fill="currentColor"/>
|
|
63
|
-
</svg>`;
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
</svg>`;
|
|
72
|
+
|
|
73
|
+
/** Pipeline (validated PIPE-D): wide thin rect + square handle astride the top edge, thin borders. */
|
|
74
|
+
export const wardleyPipelineIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
66
75
|
<rect x="3.5" y="11" width="17" height="7" rx="1" fill="#fff" stroke="currentColor" stroke-width="1.2"/>
|
|
67
76
|
<rect x="10" y="9" width="4" height="4" rx="0.6" fill="#fff" stroke="currentColor" stroke-width="1.2"/>
|
|
68
|
-
</svg>`;
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
</svg>`;
|
|
78
|
+
|
|
79
|
+
/** Market (validated MKT-B): thin outer circle + 3 thick-bordered nodes wired in a triangle. */
|
|
80
|
+
export const wardleyMarketIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
71
81
|
<circle cx="12" cy="12" r="9.6" fill="#fff" stroke="currentColor" stroke-width="1.2"/>
|
|
72
82
|
<path d="M12 6.6 L7.3 14.7 H16.7 Z" fill="none" stroke="currentColor" stroke-width="1.1"/>
|
|
73
83
|
<circle cx="12" cy="6.6" r="2.3" fill="#fff" stroke="currentColor" stroke-width="2.1"/>
|
|
74
84
|
<circle cx="7.3" cy="14.7" r="2.3" fill="#fff" stroke="currentColor" stroke-width="2.1"/>
|
|
75
85
|
<circle cx="16.7" cy="14.7" r="2.3" fill="#fff" stroke="currentColor" stroke-width="2.1"/>
|
|
76
|
-
</svg>`;
|
|
77
|
-
|
|
78
|
-
|
|
86
|
+
</svg>`;
|
|
87
|
+
|
|
88
|
+
/** Ecosystem (validated ECO-A): double border at the rim + hatching confined to the inner donut + hollow center. */
|
|
89
|
+
export const wardleyEcosystemIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
79
90
|
<defs><clipPath id="ecoHatch"><path d="M12 3.8 a8.2 8.2 0 1 0 0.001 0 Z M12 7.8 a4.2 4.2 0 1 1 -0.001 0 Z" clip-rule="evenodd"/></clipPath></defs>
|
|
80
91
|
<circle cx="12" cy="12" r="9.8" fill="#fff" stroke="currentColor" stroke-width="1.2"/>
|
|
81
92
|
<g clip-path="url(#ecoHatch)" stroke="currentColor" stroke-width="0.6">
|
|
@@ -92,14 +103,16 @@ export const wardleyEcosystemIcon = svg `<svg width="24" height="24" viewBox="0
|
|
|
92
103
|
</g>
|
|
93
104
|
<circle cx="12" cy="12" r="8.5" fill="none" stroke="currentColor" stroke-width="0.8"/>
|
|
94
105
|
<circle cx="12" cy="12" r="4.2" fill="#fff" stroke="currentColor" stroke-width="1"/>
|
|
95
|
-
</svg>`;
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
</svg>`;
|
|
107
|
+
|
|
108
|
+
/** Component + method (validated METH-A): component inscribed in a colored outer circle (default grey). */
|
|
109
|
+
export const wardleyMethodIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
98
110
|
<circle cx="12" cy="12" r="9.6" fill="#d9d9d9" stroke="#1f2328" stroke-width="1.2"/>
|
|
99
111
|
<circle cx="12" cy="12" r="4.6" fill="#fff" stroke="#1f2328" stroke-width="1.2"/>
|
|
100
|
-
</svg>`;
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
</svg>`;
|
|
113
|
+
|
|
114
|
+
/** Legend: a bordered box with glyph + line rows. */
|
|
115
|
+
export const wardleyLegendIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
103
116
|
<rect x="3" y="4" width="18" height="16" rx="2" fill="none" stroke="currentColor" stroke-width="1.3"/>
|
|
104
117
|
<circle cx="6.6" cy="8" r="1.4" fill="currentColor"/>
|
|
105
118
|
<line x1="9.6" y1="8" x2="18" y2="8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
@@ -107,21 +120,24 @@ export const wardleyLegendIcon = svg `<svg width="24" height="24" viewBox="0 0 2
|
|
|
107
120
|
<line x1="9.6" y1="12" x2="18" y2="12" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
108
121
|
<circle cx="6.6" cy="16" r="1.4" fill="currentColor"/>
|
|
109
122
|
<line x1="9.6" y1="16" x2="15" y2="16" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
110
|
-
</svg>`;
|
|
111
|
-
|
|
112
|
-
|
|
123
|
+
</svg>`;
|
|
124
|
+
|
|
125
|
+
/** Opportunity gradient background: axes + green differential hump + red operational bump. */
|
|
126
|
+
export const wardleyOpportunityIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
113
127
|
<path d="M4 20V4M4 20h16" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
|
114
128
|
<path d="M5 12 C6 7, 8.5 7, 9.5 11 C11 17, 14 19, 18 20" stroke="${GREEN}" stroke-width="1.7" fill="none" stroke-linecap="round"/>
|
|
115
129
|
<path d="M14.5 19.5 C15.5 16.5, 17 16.5, 18 19" stroke="${RED}" stroke-width="1.7" fill="none" stroke-linecap="round"/>
|
|
116
|
-
</svg>`;
|
|
117
|
-
|
|
118
|
-
|
|
130
|
+
</svg>`;
|
|
131
|
+
|
|
132
|
+
/** Benefit/Investment gradient background: axes + zero line + green J-curve. */
|
|
133
|
+
export const wardleyBenefitIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
119
134
|
<path d="M4 20V4M4 20h16" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
|
120
135
|
<line x1="4" y1="14" x2="20" y2="14" stroke="currentColor" stroke-width="0.9" opacity="0.45"/>
|
|
121
136
|
<path d="M5 17 C6 18.5, 7 18.5, 8 15 C9.5 9, 12 5.5, 13.5 8 C16 12, 18 14, 20 14.5" stroke="${GREEN}" stroke-width="1.7" fill="none" stroke-linecap="round"/>
|
|
122
|
-
</svg>`;
|
|
123
|
-
|
|
124
|
-
|
|
137
|
+
</svg>`;
|
|
138
|
+
|
|
139
|
+
/** Evolution-gradient background (Wardley's S-curve presentation): grey at both edges fading to white center. */
|
|
140
|
+
export const wardleyEvolutionGradientIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
125
141
|
<defs>
|
|
126
142
|
<linearGradient id="wardleyGreyU" x1="0" y1="0" x2="1" y2="0">
|
|
127
143
|
<stop offset="0" stop-color="#9aa0a6"/>
|
|
@@ -131,5 +147,4 @@ export const wardleyEvolutionGradientIcon = svg `<svg width="24" height="24" vie
|
|
|
131
147
|
</linearGradient>
|
|
132
148
|
</defs>
|
|
133
149
|
<rect x="4" y="4.5" width="16" height="15" rx="2" fill="url(#wardleyGreyU)" stroke="currentColor" stroke-width="1.2"/>
|
|
134
|
-
</svg>`;
|
|
135
|
-
//# sourceMappingURL=icons.js.map
|
|
150
|
+
</svg>`;
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import { shapeToolbarConfig } from '@formicoidea/labre-core/gfx/shape';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { shapeToolbarConfig } from '@formicoidea/labre-core/gfx/shape';
|
|
2
|
+
import {
|
|
3
|
+
type ToolbarModuleConfig,
|
|
4
|
+
ToolbarModuleExtension,
|
|
5
|
+
} from '@formicoidea/labre-core/shared/services';
|
|
6
|
+
import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Wardley nodes are {@link ShapeElementModel} subclasses, so the shape toolbar's
|
|
10
|
+
* actions (which target `getSurfaceModelsByType(ShapeElementModel)`) operate on
|
|
11
|
+
* them directly. We re-register only the color / line-style actions under the
|
|
12
|
+
* `wardleyNode` flavour so the circle's fill / stroke color / stroke width are
|
|
13
|
+
* editable — while excluding the shape-only actions (switch type, add inner
|
|
14
|
+
* text, edit vertices) that don't make sense for a Wardley node.
|
|
15
|
+
*/
|
|
16
|
+
const KEEP_ACTION_IDS = new Set(['e.color', 'd.style']);
|
|
17
|
+
|
|
18
|
+
const wardleyNodeToolbarConfig = {
|
|
19
|
+
actions: shapeToolbarConfig.actions.filter(action =>
|
|
20
|
+
KEEP_ACTION_IDS.has(action.id)
|
|
21
|
+
),
|
|
22
|
+
when: shapeToolbarConfig.when,
|
|
23
|
+
} as ToolbarModuleConfig;
|
|
24
|
+
|
|
25
|
+
export const wardleyNodeToolbarExtension = ToolbarModuleExtension({
|
|
26
|
+
id: BlockFlavourIdentifier('affine:surface:wardleyNode'),
|
|
27
|
+
config: wardleyNodeToolbarConfig,
|
|
28
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SeniorToolExtension } from '@formicoidea/labre-core/widgets/edgeless-toolbar';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
1
|
+
import { SeniorToolExtension } from '@formicoidea/labre-core/widgets/edgeless-toolbar';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
|
|
4
|
+
export const wardleySeniorTool = SeniorToolExtension('wardley', ({ block }) => {
|
|
5
|
+
return {
|
|
6
|
+
name: 'Wardley map',
|
|
7
|
+
content: html`<edgeless-wardley-senior-button
|
|
8
|
+
.edgeless=${block}
|
|
9
|
+
></edgeless-wardley-senior-button>`,
|
|
10
|
+
};
|
|
11
|
+
});
|