@formicoidea/labre-framework-wardley 0.23.0 → 0.23.1
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/consts.d.ts +72 -0
- package/{src/consts.ts → dist/consts.js} +63 -72
- package/dist/descriptor.d.ts +7 -0
- package/{src/descriptor.ts → dist/descriptor.js} +1 -1
- package/dist/effects.d.ts +10 -0
- package/dist/effects.js +7 -0
- package/dist/element-renderer.d.ts +15 -0
- package/dist/element-renderer.js +160 -0
- package/dist/element-view.d.ts +21 -0
- package/dist/element-view.js +122 -0
- package/dist/gradient.d.ts +18 -0
- package/dist/gradient.js +112 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/label-layout.d.ts +21 -0
- package/dist/label-layout.js +73 -0
- package/dist/legend.d.ts +12 -0
- package/dist/legend.js +333 -0
- package/dist/node/consts.d.ts +107 -0
- package/{src/node/consts.ts → dist/node/consts.js} +12 -20
- package/dist/node/label-editor.d.ts +28 -0
- package/dist/node/label-editor.js +216 -0
- package/dist/node/node-renderer.d.ts +17 -0
- package/dist/node/node-renderer.js +106 -0
- package/{src/node/node-view.ts → dist/node/node-view.d.ts} +3 -3
- package/dist/node/node-view.js +10 -0
- package/dist/templates/index.d.ts +3 -0
- package/dist/templates/index.js +172 -0
- package/dist/templates/maps.d.ts +3 -0
- package/dist/templates/maps.js +247 -0
- package/dist/toolbar/config.d.ts +75 -0
- package/dist/toolbar/config.js +206 -0
- package/dist/toolbar/icons.d.ts +31 -0
- package/{src/toolbar/icons.ts → dist/toolbar/icons.js} +51 -66
- package/dist/toolbar/node-config.d.ts +2 -0
- package/{src/toolbar/node-config.ts → dist/toolbar/node-config.js} +7 -14
- package/dist/toolbar/senior-tool.d.ts +2 -0
- package/{src/toolbar/senior-tool.ts → dist/toolbar/senior-tool.js} +5 -5
- package/dist/toolbar/wardley-menu.d.ts +53 -0
- package/dist/toolbar/wardley-menu.js +408 -0
- package/dist/toolbar/wardley-senior-button.d.ts +18 -0
- package/dist/toolbar/wardley-senior-button.js +146 -0
- package/dist/toolbar/wardley-tool-button.d.ts +10 -0
- package/dist/toolbar/wardley-tool-button.js +123 -0
- package/dist/view.d.ts +7 -0
- package/dist/view.js +36 -0
- package/package.json +15 -6
- package/src/effects.ts +0 -17
- package/src/element-renderer.ts +0 -242
- package/src/element-view.ts +0 -143
- package/src/gradient.ts +0 -137
- package/src/index.ts +0 -1
- package/src/label-layout.ts +0 -126
- package/src/legend.ts +0 -438
- package/src/node/node-renderer.ts +0 -142
- package/src/templates/index.ts +0 -236
- package/src/templates/maps.ts +0 -283
- package/src/toolbar/config.ts +0 -280
- package/src/toolbar/wardley-menu.ts +0 -552
- package/src/toolbar/wardley-senior-button.ts +0 -154
- package/src/view.ts +0 -39
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { EdgelessCRUDIdentifier } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import { WardleyBackgroundElementModel } from '@formicoidea/labre-core/model';
|
|
3
|
+
import { TelemetryProvider, ToolbarModuleExtension, } from '@formicoidea/labre-core/shared/services';
|
|
4
|
+
import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
|
|
5
|
+
import { html } from 'lit';
|
|
6
|
+
import { createWardleyLegend } from '../legend';
|
|
7
|
+
import { wardleyLegendIcon } from './icons';
|
|
8
|
+
const ResizeIcon = html `<svg
|
|
9
|
+
width="24"
|
|
10
|
+
height="24"
|
|
11
|
+
viewBox="0 0 24 24"
|
|
12
|
+
fill="none"
|
|
13
|
+
stroke="currentColor"
|
|
14
|
+
stroke-width="1.6"
|
|
15
|
+
stroke-linecap="round"
|
|
16
|
+
stroke-linejoin="round"
|
|
17
|
+
>
|
|
18
|
+
<path d="M9 5H5v4M15 19h4v-4" />
|
|
19
|
+
<path d="M5 5l6 6M19 19l-6-6" />
|
|
20
|
+
</svg>`;
|
|
21
|
+
/** Gradient swatch — show/hide the variant gradient. */
|
|
22
|
+
const GradientIcon = html `<svg
|
|
23
|
+
width="24"
|
|
24
|
+
height="24"
|
|
25
|
+
viewBox="0 0 24 24"
|
|
26
|
+
fill="none"
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
>
|
|
29
|
+
<defs>
|
|
30
|
+
<linearGradient id="wardleyToolbarGrad" x1="0" y1="0" x2="1" y2="0">
|
|
31
|
+
<stop offset="0" stop-color="currentColor" stop-opacity="0.85" />
|
|
32
|
+
<stop offset="1" stop-color="currentColor" stop-opacity="0.1" />
|
|
33
|
+
</linearGradient>
|
|
34
|
+
</defs>
|
|
35
|
+
<rect
|
|
36
|
+
x="4"
|
|
37
|
+
y="5"
|
|
38
|
+
width="16"
|
|
39
|
+
height="14"
|
|
40
|
+
rx="2"
|
|
41
|
+
fill="url(#wardleyToolbarGrad)"
|
|
42
|
+
stroke="currentColor"
|
|
43
|
+
stroke-width="1.4"
|
|
44
|
+
/>
|
|
45
|
+
</svg>`;
|
|
46
|
+
/** Horizontal axis with a right-pointing arrow (Evolution / X). */
|
|
47
|
+
const XAxisIcon = html `<svg
|
|
48
|
+
width="24"
|
|
49
|
+
height="24"
|
|
50
|
+
viewBox="0 0 24 24"
|
|
51
|
+
fill="none"
|
|
52
|
+
stroke="currentColor"
|
|
53
|
+
stroke-width="1.6"
|
|
54
|
+
stroke-linecap="round"
|
|
55
|
+
stroke-linejoin="round"
|
|
56
|
+
>
|
|
57
|
+
<path d="M3 17h15" />
|
|
58
|
+
<path d="M15 14l3 3-3 3" />
|
|
59
|
+
</svg>`;
|
|
60
|
+
/** Vertical axis with an up-pointing arrow (Value Chain / Y). */
|
|
61
|
+
const YAxisIcon = html `<svg
|
|
62
|
+
width="24"
|
|
63
|
+
height="24"
|
|
64
|
+
viewBox="0 0 24 24"
|
|
65
|
+
fill="none"
|
|
66
|
+
stroke="currentColor"
|
|
67
|
+
stroke-width="1.6"
|
|
68
|
+
stroke-linecap="round"
|
|
69
|
+
stroke-linejoin="round"
|
|
70
|
+
>
|
|
71
|
+
<path d="M7 21V6" />
|
|
72
|
+
<path d="M4 9l3-3 3 3" />
|
|
73
|
+
</svg>`;
|
|
74
|
+
/** Dashed vertical column dividers. */
|
|
75
|
+
const ColumnsIcon = html `<svg
|
|
76
|
+
width="24"
|
|
77
|
+
height="24"
|
|
78
|
+
viewBox="0 0 24 24"
|
|
79
|
+
fill="none"
|
|
80
|
+
stroke="currentColor"
|
|
81
|
+
stroke-width="1.6"
|
|
82
|
+
stroke-linecap="round"
|
|
83
|
+
stroke-dasharray="3 3"
|
|
84
|
+
>
|
|
85
|
+
<path d="M9 4v16M15 4v16" />
|
|
86
|
+
</svg>`;
|
|
87
|
+
/** Column labels (short bars under the columns). */
|
|
88
|
+
const ColumnLabelsIcon = html `<svg
|
|
89
|
+
width="24"
|
|
90
|
+
height="24"
|
|
91
|
+
viewBox="0 0 24 24"
|
|
92
|
+
fill="currentColor"
|
|
93
|
+
stroke="none"
|
|
94
|
+
>
|
|
95
|
+
<rect x="3" y="15" width="4.5" height="3" rx="1" />
|
|
96
|
+
<rect x="9.75" y="15" width="4.5" height="3" rx="1" />
|
|
97
|
+
<rect x="16.5" y="15" width="4.5" height="3" rx="1" />
|
|
98
|
+
</svg>`;
|
|
99
|
+
/** Corner labels (Uncharted / Industrialized, top corners). */
|
|
100
|
+
const CornerLabelsIcon = html `<svg
|
|
101
|
+
width="24"
|
|
102
|
+
height="24"
|
|
103
|
+
viewBox="0 0 24 24"
|
|
104
|
+
fill="currentColor"
|
|
105
|
+
stroke="none"
|
|
106
|
+
>
|
|
107
|
+
<rect x="3" y="5" width="6" height="3" rx="1" />
|
|
108
|
+
<rect x="15" y="5" width="6" height="3" rx="1" />
|
|
109
|
+
</svg>`;
|
|
110
|
+
/** Visibility labels (Visible / Invisible) — an eye. */
|
|
111
|
+
const VisibilityIcon = html `<svg
|
|
112
|
+
width="24"
|
|
113
|
+
height="24"
|
|
114
|
+
viewBox="0 0 24 24"
|
|
115
|
+
fill="none"
|
|
116
|
+
stroke="currentColor"
|
|
117
|
+
stroke-width="1.6"
|
|
118
|
+
stroke-linecap="round"
|
|
119
|
+
stroke-linejoin="round"
|
|
120
|
+
>
|
|
121
|
+
<path d="M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12z" />
|
|
122
|
+
<circle cx="12" cy="12" r="2.4" />
|
|
123
|
+
</svg>`;
|
|
124
|
+
/**
|
|
125
|
+
* Build a toolbar toggle that flips a boolean flag on every selected Wardley
|
|
126
|
+
* background: `active` reflects the current state, `run` flips it (with an
|
|
127
|
+
* undo checkpoint). An optional `when` predicate hides the button.
|
|
128
|
+
*/
|
|
129
|
+
function booleanToggle(id, tooltip, icon, prop, when) {
|
|
130
|
+
return {
|
|
131
|
+
id,
|
|
132
|
+
tooltip,
|
|
133
|
+
icon,
|
|
134
|
+
when: when ?? true,
|
|
135
|
+
active(ctx) {
|
|
136
|
+
const models = ctx.getSurfaceModelsByType(WardleyBackgroundElementModel);
|
|
137
|
+
return models.length > 0 && models.every(model => model[prop]);
|
|
138
|
+
},
|
|
139
|
+
run(ctx) {
|
|
140
|
+
const models = ctx.getSurfaceModelsByType(WardleyBackgroundElementModel);
|
|
141
|
+
if (!models.length)
|
|
142
|
+
return;
|
|
143
|
+
const enable = !models.every(model => model[prop]);
|
|
144
|
+
ctx.std.store.captureSync();
|
|
145
|
+
const crud = ctx.std.get(EdgelessCRUDIdentifier);
|
|
146
|
+
for (const model of models) {
|
|
147
|
+
crud.updateElement(model.id, { [prop]: enable });
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export const wardleyToolbarConfig = {
|
|
153
|
+
actions: [
|
|
154
|
+
booleanToggle('a.toggle-resize', 'Enable / lock resizing', ResizeIcon, 'resizeEnabled'),
|
|
155
|
+
// Group 1 — evolution (X) side: axis, phase labels, columns, corner
|
|
156
|
+
// labels, and the gradient toggle.
|
|
157
|
+
{
|
|
158
|
+
id: 'b.evolution',
|
|
159
|
+
actions: [
|
|
160
|
+
booleanToggle('b.1-axis-x', 'Evolution axis (X)', XAxisIcon, 'showXAxis'),
|
|
161
|
+
booleanToggle('b.2-column-labels', 'Evolution phase labels', ColumnLabelsIcon, 'showColumnLabels'),
|
|
162
|
+
booleanToggle('b.3-columns', 'Columns (dividers)', ColumnsIcon, 'showColumnDividers'),
|
|
163
|
+
booleanToggle('b.4-corner-labels', 'Labels Uncharted / Industrialized', CornerLabelsIcon, 'showCornerLabels'),
|
|
164
|
+
// Only relevant when the selection has a gradient variant.
|
|
165
|
+
booleanToggle('b.5-gradient', 'Show / hide the gradient', GradientIcon, 'showGradient', ctx => ctx
|
|
166
|
+
.getSurfaceModelsByType(WardleyBackgroundElementModel)
|
|
167
|
+
.some(model => model.variant !== 'classic')),
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
// Group 2 — value-chain (Y) side: axis and Visible/Invisible labels.
|
|
171
|
+
{
|
|
172
|
+
id: 'c.value-chain',
|
|
173
|
+
actions: [
|
|
174
|
+
booleanToggle('c.1-axis-y', 'Value Chain axis (Y)', YAxisIcon, 'showYAxis'),
|
|
175
|
+
booleanToggle('c.2-visibility-labels', 'Labels Visible / Invisible', VisibilityIcon, 'showVisibilityLabels'),
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
// Generate the auto-legend from the components present inside this
|
|
179
|
+
// background's perimeter (+ a gradient-meaning block for gradient variants).
|
|
180
|
+
{
|
|
181
|
+
id: 'd.legend',
|
|
182
|
+
tooltip: 'Generate the legend (components present)',
|
|
183
|
+
icon: wardleyLegendIcon,
|
|
184
|
+
run(ctx) {
|
|
185
|
+
const models = ctx.getSurfaceModelsByType(WardleyBackgroundElementModel);
|
|
186
|
+
const bg = models[0];
|
|
187
|
+
if (!bg)
|
|
188
|
+
return;
|
|
189
|
+
createWardleyLegend(ctx.std, bg);
|
|
190
|
+
ctx.std.getOptional(TelemetryProvider)?.track('FrameworkLegendCreated', {
|
|
191
|
+
framework: 'wardley',
|
|
192
|
+
element: 'legend',
|
|
193
|
+
page: 'whiteboard editor',
|
|
194
|
+
segment: 'element toolbar',
|
|
195
|
+
module: 'wardley toolbar',
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
when: ctx => ctx.getSurfaceModelsByType(WardleyBackgroundElementModel).length > 0,
|
|
201
|
+
};
|
|
202
|
+
export const wardleyToolbarExtension = ToolbarModuleExtension({
|
|
203
|
+
id: BlockFlavourIdentifier('affine:surface:wardley'),
|
|
204
|
+
config: wardleyToolbarConfig,
|
|
205
|
+
});
|
|
206
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Colored Wardley glyph (mockup proposal B) for the main toolbar button. */
|
|
2
|
+
export declare const wardleyToolbarIcon: import("lit-html").TemplateResult<2>;
|
|
3
|
+
/** Monochrome glyph for the "create background" menu item (uses currentColor). */
|
|
4
|
+
export declare const wardleyBackgroundIcon: import("lit-html").TemplateResult<2>;
|
|
5
|
+
/** Component node (validated COMP-C2): single circle. */
|
|
6
|
+
export declare const wardleyComponentIcon: import("lit-html").TemplateResult<2>;
|
|
7
|
+
/** Anchor (validated ANCH-B): person glyph inscribed in a circle. */
|
|
8
|
+
export declare const wardleyAnchorIcon: import("lit-html").TemplateResult<2>;
|
|
9
|
+
/** Dependency link (validated LINK-A3): two outline nodes joined by a line. */
|
|
10
|
+
export declare const wardleyLinkIcon: import("lit-html").TemplateResult<2>;
|
|
11
|
+
/** Evolution arrow (validated ARR-B): red dashed arrow. */
|
|
12
|
+
export declare const wardleyArrowIcon: import("lit-html").TemplateResult<2>;
|
|
13
|
+
/** Inertia (validated INER): black bar barring the red dashed arrow. */
|
|
14
|
+
export declare const wardleyInertiaIcon: import("lit-html").TemplateResult<2>;
|
|
15
|
+
/** Pipeline (validated PIPE-D): wide thin rect + square handle astride the top edge, thin borders. */
|
|
16
|
+
export declare const wardleyPipelineIcon: import("lit-html").TemplateResult<2>;
|
|
17
|
+
/** Market (validated MKT-B): thin outer circle + 3 thick-bordered nodes wired in a triangle. */
|
|
18
|
+
export declare const wardleyMarketIcon: import("lit-html").TemplateResult<2>;
|
|
19
|
+
/** Ecosystem (validated ECO-A): double border at the rim + hatching confined to the inner donut + hollow center. */
|
|
20
|
+
export declare const wardleyEcosystemIcon: import("lit-html").TemplateResult<2>;
|
|
21
|
+
/** Component + method (validated METH-A): component inscribed in a colored outer circle (default grey). */
|
|
22
|
+
export declare const wardleyMethodIcon: import("lit-html").TemplateResult<2>;
|
|
23
|
+
/** Legend: a bordered box with glyph + line rows. */
|
|
24
|
+
export declare const wardleyLegendIcon: import("lit-html").TemplateResult<2>;
|
|
25
|
+
/** Opportunity gradient background: axes + green differential hump + red operational bump. */
|
|
26
|
+
export declare const wardleyOpportunityIcon: import("lit-html").TemplateResult<2>;
|
|
27
|
+
/** Benefit/Investment gradient background: axes + zero line + green J-curve. */
|
|
28
|
+
export declare const wardleyBenefitIcon: import("lit-html").TemplateResult<2>;
|
|
29
|
+
/** Evolution-gradient background (Wardley's S-curve presentation): grey at both edges fading to white center. */
|
|
30
|
+
export declare const wardleyEvolutionGradientIcon: import("lit-html").TemplateResult<2>;
|
|
31
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { svg } from 'lit';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const wardleyToolbarIcon = svg`<svg width="100%" height="100%" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1
|
+
import { svg } from 'lit';
|
|
2
|
+
/** Colored Wardley glyph (mockup proposal B) for the main toolbar button. */
|
|
3
|
+
export const wardleyToolbarIcon = svg `<svg width="100%" height="100%" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
4
|
<defs>
|
|
6
5
|
<linearGradient id="wardley-evo" x1="0" y1="0" x2="0" y2="1">
|
|
7
6
|
<stop offset="0" stop-color="#ffffff" stop-opacity="0"/>
|
|
@@ -22,71 +21,61 @@ export const wardleyToolbarIcon = svg`<svg width="100%" height="100%" viewBox="0
|
|
|
22
21
|
<circle cx="27" cy="16.5" r="2.6" fill="#e2a32b"/>
|
|
23
22
|
<circle cx="24" cy="26" r="2.6" fill="#d6455d"/>
|
|
24
23
|
</svg>
|
|
25
|
-
</svg>`;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export const wardleyBackgroundIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
24
|
+
</svg>`;
|
|
25
|
+
/** Monochrome glyph for the "create background" menu item (uses currentColor). */
|
|
26
|
+
export const wardleyBackgroundIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
29
27
|
<path d="M6 4 V19 H21" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
30
28
|
<path d="M6 2.6 L3.8 6 H8.2 Z" fill="currentColor"/>
|
|
31
29
|
<path d="M22.4 19 L19 16.8 V21.2 Z" fill="currentColor"/>
|
|
32
30
|
<line x1="11" y1="6" x2="11" y2="19" stroke="currentColor" stroke-width="0.9" stroke-dasharray="1.8 1.8" opacity="0.6"/>
|
|
33
31
|
<line x1="16" y1="6" x2="16" y2="19" stroke="currentColor" stroke-width="0.9" stroke-dasharray="1.8 1.8" opacity="0.6"/>
|
|
34
|
-
</svg>`;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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">
|
|
32
|
+
</svg>`;
|
|
33
|
+
/** Wardley red — matches the renderer presets (consts WARDLEY_RED). */
|
|
34
|
+
const RED = '#d6455d';
|
|
35
|
+
/** Gradient green — matches gradient.ts GRADIENT_GREEN. */
|
|
36
|
+
const GREEN = '#1f9e4d';
|
|
37
|
+
/** Component node (validated COMP-C2): single circle. */
|
|
38
|
+
export const wardleyComponentIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
39
|
<circle cx="12" cy="12" r="6.3" fill="#fff" stroke="currentColor" stroke-width="1.5"/>
|
|
44
|
-
</svg>`;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export const wardleyAnchorIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
40
|
+
</svg>`;
|
|
41
|
+
/** Anchor (validated ANCH-B): person glyph inscribed in a circle. */
|
|
42
|
+
export const wardleyAnchorIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
48
43
|
<circle cx="12" cy="12" r="6" fill="#fff" stroke="currentColor" stroke-width="1.6"/>
|
|
49
44
|
<circle cx="12" cy="9.4" r="1.8" fill="none" stroke="currentColor" stroke-width="1.3"/>
|
|
50
45
|
<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"/>
|
|
51
|
-
</svg>`;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export const wardleyLinkIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
+
</svg>`;
|
|
47
|
+
/** Dependency link (validated LINK-A3): two outline nodes joined by a line. */
|
|
48
|
+
export const wardleyLinkIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
55
49
|
<line x1="5.5" y1="16" x2="18.5" y2="8" stroke="currentColor" stroke-width="1.8"/>
|
|
56
50
|
<circle cx="5.5" cy="16" r="2.2" fill="#fff" stroke="currentColor" stroke-width="1.5"/>
|
|
57
51
|
<circle cx="18.5" cy="8" r="2.2" fill="#fff" stroke="currentColor" stroke-width="1.5"/>
|
|
58
|
-
</svg>`;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export const wardleyArrowIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
52
|
+
</svg>`;
|
|
53
|
+
/** Evolution arrow (validated ARR-B): red dashed arrow. */
|
|
54
|
+
export const wardleyArrowIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
62
55
|
<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"/>
|
|
63
56
|
<path d="M14.5 7.8 L20 12 L14.5 16.2 Z" fill="${RED}"/>
|
|
64
|
-
</svg>`;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export const wardleyInertiaIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
57
|
+
</svg>`;
|
|
58
|
+
/** Inertia (validated INER): black bar barring the red dashed arrow. */
|
|
59
|
+
export const wardleyInertiaIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
68
60
|
<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"/>
|
|
69
61
|
<path d="M15 7.8 L20.5 12 L15 16.2 Z" fill="${RED}"/>
|
|
70
62
|
<rect x="9.6" y="5.4" width="2.9" height="13.2" rx="0.6" fill="currentColor"/>
|
|
71
|
-
</svg>`;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export const wardleyPipelineIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
63
|
+
</svg>`;
|
|
64
|
+
/** Pipeline (validated PIPE-D): wide thin rect + square handle astride the top edge, thin borders. */
|
|
65
|
+
export const wardleyPipelineIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
75
66
|
<rect x="3.5" y="11" width="17" height="7" rx="1" fill="#fff" stroke="currentColor" stroke-width="1.2"/>
|
|
76
67
|
<rect x="10" y="9" width="4" height="4" rx="0.6" fill="#fff" stroke="currentColor" stroke-width="1.2"/>
|
|
77
|
-
</svg>`;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
export const wardleyMarketIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
68
|
+
</svg>`;
|
|
69
|
+
/** Market (validated MKT-B): thin outer circle + 3 thick-bordered nodes wired in a triangle. */
|
|
70
|
+
export const wardleyMarketIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
81
71
|
<circle cx="12" cy="12" r="9.6" fill="#fff" stroke="currentColor" stroke-width="1.2"/>
|
|
82
72
|
<path d="M12 6.6 L7.3 14.7 H16.7 Z" fill="none" stroke="currentColor" stroke-width="1.1"/>
|
|
83
73
|
<circle cx="12" cy="6.6" r="2.3" fill="#fff" stroke="currentColor" stroke-width="2.1"/>
|
|
84
74
|
<circle cx="7.3" cy="14.7" r="2.3" fill="#fff" stroke="currentColor" stroke-width="2.1"/>
|
|
85
75
|
<circle cx="16.7" cy="14.7" r="2.3" fill="#fff" stroke="currentColor" stroke-width="2.1"/>
|
|
86
|
-
</svg>`;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
export const wardleyEcosystemIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
76
|
+
</svg>`;
|
|
77
|
+
/** Ecosystem (validated ECO-A): double border at the rim + hatching confined to the inner donut + hollow center. */
|
|
78
|
+
export const wardleyEcosystemIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
90
79
|
<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>
|
|
91
80
|
<circle cx="12" cy="12" r="9.8" fill="#fff" stroke="currentColor" stroke-width="1.2"/>
|
|
92
81
|
<g clip-path="url(#ecoHatch)" stroke="currentColor" stroke-width="0.6">
|
|
@@ -103,16 +92,14 @@ export const wardleyEcosystemIcon = svg`<svg width="24" height="24" viewBox="0 0
|
|
|
103
92
|
</g>
|
|
104
93
|
<circle cx="12" cy="12" r="8.5" fill="none" stroke="currentColor" stroke-width="0.8"/>
|
|
105
94
|
<circle cx="12" cy="12" r="4.2" fill="#fff" stroke="currentColor" stroke-width="1"/>
|
|
106
|
-
</svg>`;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
export const wardleyMethodIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
95
|
+
</svg>`;
|
|
96
|
+
/** Component + method (validated METH-A): component inscribed in a colored outer circle (default grey). */
|
|
97
|
+
export const wardleyMethodIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
110
98
|
<circle cx="12" cy="12" r="9.6" fill="#d9d9d9" stroke="#1f2328" stroke-width="1.2"/>
|
|
111
99
|
<circle cx="12" cy="12" r="4.6" fill="#fff" stroke="#1f2328" stroke-width="1.2"/>
|
|
112
|
-
</svg>`;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
export const wardleyLegendIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
100
|
+
</svg>`;
|
|
101
|
+
/** Legend: a bordered box with glyph + line rows. */
|
|
102
|
+
export const wardleyLegendIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
116
103
|
<rect x="3" y="4" width="18" height="16" rx="2" fill="none" stroke="currentColor" stroke-width="1.3"/>
|
|
117
104
|
<circle cx="6.6" cy="8" r="1.4" fill="currentColor"/>
|
|
118
105
|
<line x1="9.6" y1="8" x2="18" y2="8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
@@ -120,24 +107,21 @@ export const wardleyLegendIcon = svg`<svg width="24" height="24" viewBox="0 0 24
|
|
|
120
107
|
<line x1="9.6" y1="12" x2="18" y2="12" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
121
108
|
<circle cx="6.6" cy="16" r="1.4" fill="currentColor"/>
|
|
122
109
|
<line x1="9.6" y1="16" x2="15" y2="16" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
123
|
-
</svg>`;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
export const wardleyOpportunityIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
110
|
+
</svg>`;
|
|
111
|
+
/** Opportunity gradient background: axes + green differential hump + red operational bump. */
|
|
112
|
+
export const wardleyOpportunityIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
127
113
|
<path d="M4 20V4M4 20h16" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
|
128
114
|
<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"/>
|
|
129
115
|
<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"/>
|
|
130
|
-
</svg>`;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
export const wardleyBenefitIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
116
|
+
</svg>`;
|
|
117
|
+
/** Benefit/Investment gradient background: axes + zero line + green J-curve. */
|
|
118
|
+
export const wardleyBenefitIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
134
119
|
<path d="M4 20V4M4 20h16" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
|
135
120
|
<line x1="4" y1="14" x2="20" y2="14" stroke="currentColor" stroke-width="0.9" opacity="0.45"/>
|
|
136
121
|
<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"/>
|
|
137
|
-
</svg>`;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
export const wardleyEvolutionGradientIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
122
|
+
</svg>`;
|
|
123
|
+
/** Evolution-gradient background (Wardley's S-curve presentation): grey at both edges fading to white center. */
|
|
124
|
+
export const wardleyEvolutionGradientIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
141
125
|
<defs>
|
|
142
126
|
<linearGradient id="wardleyGreyU" x1="0" y1="0" x2="1" y2="0">
|
|
143
127
|
<stop offset="0" stop-color="#9aa0a6"/>
|
|
@@ -147,4 +131,5 @@ export const wardleyEvolutionGradientIcon = svg`<svg width="24" height="24" view
|
|
|
147
131
|
</linearGradient>
|
|
148
132
|
</defs>
|
|
149
133
|
<rect x="4" y="4.5" width="16" height="15" rx="2" fill="url(#wardleyGreyU)" stroke="currentColor" stroke-width="1.2"/>
|
|
150
|
-
</svg>`;
|
|
134
|
+
</svg>`;
|
|
135
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { shapeToolbarConfig } from '@formicoidea/labre-core/gfx/shape';
|
|
2
|
-
import {
|
|
3
|
-
type ToolbarModuleConfig,
|
|
4
|
-
ToolbarModuleExtension,
|
|
5
|
-
} from '@formicoidea/labre-core/shared/services';
|
|
2
|
+
import { ToolbarModuleExtension, } from '@formicoidea/labre-core/shared/services';
|
|
6
3
|
import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
|
|
7
|
-
|
|
8
4
|
/**
|
|
9
5
|
* Wardley nodes are {@link ShapeElementModel} subclasses, so the shape toolbar's
|
|
10
6
|
* actions (which target `getSurfaceModelsByType(ShapeElementModel)`) operate on
|
|
@@ -14,15 +10,12 @@ import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
|
|
|
14
10
|
* text, edit vertices) that don't make sense for a Wardley node.
|
|
15
11
|
*/
|
|
16
12
|
const KEEP_ACTION_IDS = new Set(['e.color', 'd.style']);
|
|
17
|
-
|
|
18
13
|
const wardleyNodeToolbarConfig = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
when: shapeToolbarConfig.when,
|
|
23
|
-
} as ToolbarModuleConfig;
|
|
24
|
-
|
|
14
|
+
actions: shapeToolbarConfig.actions.filter(action => KEEP_ACTION_IDS.has(action.id)),
|
|
15
|
+
when: shapeToolbarConfig.when,
|
|
16
|
+
};
|
|
25
17
|
export const wardleyNodeToolbarExtension = ToolbarModuleExtension({
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
id: BlockFlavourIdentifier('affine:surface:wardleyNode'),
|
|
19
|
+
config: wardleyNodeToolbarConfig,
|
|
28
20
|
});
|
|
21
|
+
//# sourceMappingURL=node-config.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SeniorToolExtension } from '@formicoidea/labre-core/widgets/edgeless-toolbar';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
-
|
|
4
3
|
export const wardleySeniorTool = SeniorToolExtension('wardley', ({ block }) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
return {
|
|
5
|
+
name: 'Wardley map',
|
|
6
|
+
content: html `<edgeless-wardley-senior-button
|
|
8
7
|
.edgeless=${block}
|
|
9
8
|
></edgeless-wardley-senior-button>`,
|
|
10
|
-
|
|
9
|
+
};
|
|
11
10
|
});
|
|
11
|
+
//# sourceMappingURL=senior-tool.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EmptyTool } from '@formicoidea/labre-core/gfx/pointer';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
declare const EdgelessWardleyMenu_base: typeof LitElement & import("@formicoidea/labre-core/global/utils").Constructor<import("@formicoidea/labre-core/widgets/edgeless-toolbar").EdgelessToolbarToolClass>;
|
|
4
|
+
/**
|
|
5
|
+
* The popover that opens above the toolbar for the Wardley toolbox. Each item
|
|
6
|
+
* creates a pre-formatted Wardley object. Nodes (component / anchor) are a
|
|
7
|
+
* native ellipse + a native text label, grouped together.
|
|
8
|
+
*/
|
|
9
|
+
export declare class EdgelessWardleyMenu extends EdgelessWardleyMenu_base {
|
|
10
|
+
static styles: import("lit").CSSResult;
|
|
11
|
+
type: typeof EmptyTool;
|
|
12
|
+
private _createBackground;
|
|
13
|
+
/** Add a native ellipse wardley node centred on (cx, cy). */
|
|
14
|
+
private _addEllipseNode;
|
|
15
|
+
/** Add a native free-text label (same Inter family as the axis labels). */
|
|
16
|
+
private _addLabel;
|
|
17
|
+
/** Group elements; returns the group id (or the first id if grouping failed). */
|
|
18
|
+
private _group;
|
|
19
|
+
/**
|
|
20
|
+
* Create a single-circle node (component / anchor / ecosystem / method):
|
|
21
|
+
* one connectable native ellipse + a label to its right, grouped so they
|
|
22
|
+
* move together (enter the group to reposition / edit the label).
|
|
23
|
+
*/
|
|
24
|
+
private _createNode;
|
|
25
|
+
private _createInertia;
|
|
26
|
+
/**
|
|
27
|
+
* Create a pipeline: a wide thin native rect body (white semi-transparent,
|
|
28
|
+
* NON-connectable) + a node-sized square handle straddling its top edge (the
|
|
29
|
+
* only connection point, center anchor) + a native text label. The handle and
|
|
30
|
+
* label are grouped, then grouped again with the body so the whole pipeline
|
|
31
|
+
* moves as one. Pure composition of native elements — no custom type / view.
|
|
32
|
+
*/
|
|
33
|
+
private _createPipeline;
|
|
34
|
+
/**
|
|
35
|
+
* Create a market: a large thin-bordered circle (the connectable market node)
|
|
36
|
+
* containing 3 small thick-bordered component nodes wired into a triangle by
|
|
37
|
+
* native attached connectors (thin, dark, no arrows — they auto-route between
|
|
38
|
+
* the node centers and follow on move/resize). A label sits to the right and
|
|
39
|
+
* everything is grouped into one object.
|
|
40
|
+
*/
|
|
41
|
+
private _createMarket;
|
|
42
|
+
/**
|
|
43
|
+
* Activate the native connector tool, pre-styled for a Wardley link (grey,
|
|
44
|
+
* solid, no arrow) or evolution arrow (red, dashed, FILLED triangle). The
|
|
45
|
+
* user then draws from one node to another (endpoints attach to centers).
|
|
46
|
+
*/
|
|
47
|
+
private _activateConnector;
|
|
48
|
+
private _finish;
|
|
49
|
+
private _track;
|
|
50
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=wardley-menu.d.ts.map
|