@formicoidea/labre-framework-ddd-event-storming 0.41.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 ADDED
@@ -0,0 +1,384 @@
1
+ # Mozilla Public License Version 2.0
2
+
3
+ Copyright (c) TOEVERYTHING PTE. LTD. and its affiliates.
4
+
5
+ 1. Definitions
6
+
7
+ ---
8
+
9
+ 1.1. "Contributor"
10
+ means each individual or legal entity that creates, contributes to
11
+ the creation of, or owns Covered Software.
12
+
13
+ 1.2. "Contributor Version"
14
+ means the combination of the Contributions of others (if any) used
15
+ by a Contributor and that particular Contributor's Contribution.
16
+
17
+ 1.3. "Contribution"
18
+ means Covered Software of a particular Contributor.
19
+
20
+ 1.4. "Covered Software"
21
+ means Source Code Form to which the initial Contributor has attached
22
+ the notice in Exhibit A, the Executable Form of such Source Code
23
+ Form, and Modifications of such Source Code Form, in each case
24
+ including portions thereof.
25
+
26
+ 1.5. "Incompatible With Secondary Licenses"
27
+ means
28
+
29
+ (a) that the initial Contributor has attached the notice described
30
+ in Exhibit B to the Covered Software; or
31
+
32
+ (b) that the Covered Software was made available under the terms of
33
+ version 1.1 or earlier of the License, but not also under the
34
+ terms of a Secondary License.
35
+
36
+ 1.6. "Executable Form"
37
+ means any form of the work other than Source Code Form.
38
+
39
+ 1.7. "Larger Work"
40
+ means a work that combines Covered Software with other material, in
41
+ a separate file or files, that is not Covered Software.
42
+
43
+ 1.8. "License"
44
+ means this document.
45
+
46
+ 1.9. "Licensable"
47
+ means having the right to grant, to the maximum extent possible,
48
+ whether at the time of the initial grant or subsequently, any and
49
+ all of the rights conveyed by this License.
50
+
51
+ 1.10. "Modifications"
52
+ means any of the following:
53
+
54
+ (a) any file in Source Code Form that results from an addition to,
55
+ deletion from, or modification of the contents of Covered
56
+ Software; or
57
+
58
+ (b) any new file in Source Code Form that contains any Covered
59
+ Software.
60
+
61
+ 1.11. "Patent Claims" of a Contributor
62
+ means any patent claim(s), including without limitation, method,
63
+ process, and apparatus claims, in any patent Licensable by such
64
+ Contributor that would be infringed, but for the grant of the
65
+ License, by the making, using, selling, offering for sale, having
66
+ made, import, or transfer of either its Contributions or its
67
+ Contributor Version.
68
+
69
+ 1.12. "Secondary License"
70
+ means either the GNU General Public License, Version 2.0, the GNU
71
+ Lesser General Public License, Version 2.1, the GNU Affero General
72
+ Public License, Version 3.0, or any later versions of those
73
+ licenses.
74
+
75
+ 1.13. "Source Code Form"
76
+ means the form of the work preferred for making modifications.
77
+
78
+ 1.14. "You" (or "Your")
79
+ means an individual or a legal entity exercising rights under this
80
+ License. For legal entities, "You" includes any entity that
81
+ controls, is controlled by, or is under common control with You. For
82
+ purposes of this definition, "control" means (a) the power, direct
83
+ or indirect, to cause the direction or management of such entity,
84
+ whether by contract or otherwise, or (b) ownership of more than
85
+ fifty percent (50%) of the outstanding shares or beneficial
86
+ ownership of such entity.
87
+
88
+ 2. License Grants and Conditions
89
+
90
+ ---
91
+
92
+ 2.1. Grants
93
+
94
+ Each Contributor hereby grants You a world-wide, royalty-free,
95
+ non-exclusive license:
96
+
97
+ (a) under intellectual property rights (other than patent or trademark)
98
+ Licensable by such Contributor to use, reproduce, make available,
99
+ modify, display, perform, distribute, and otherwise exploit its
100
+ Contributions, either on an unmodified basis, with Modifications, or
101
+ as part of a Larger Work; and
102
+
103
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
104
+ for sale, have made, import, and otherwise transfer either its
105
+ Contributions or its Contributor Version.
106
+
107
+ 2.2. Effective Date
108
+
109
+ The licenses granted in Section 2.1 with respect to any Contribution
110
+ become effective for each Contribution on the date the Contributor first
111
+ distributes such Contribution.
112
+
113
+ 2.3. Limitations on Grant Scope
114
+
115
+ The licenses granted in this Section 2 are the only rights granted under
116
+ this License. No additional rights or licenses will be implied from the
117
+ distribution or licensing of Covered Software under this License.
118
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
119
+ Contributor:
120
+
121
+ (a) for any code that a Contributor has removed from Covered Software;
122
+ or
123
+
124
+ (b) for infringements caused by: (i) Your and any other third party's
125
+ modifications of Covered Software, or (ii) the combination of its
126
+ Contributions with other software (except as part of its Contributor
127
+ Version); or
128
+
129
+ (c) under Patent Claims infringed by Covered Software in the absence of
130
+ its Contributions.
131
+
132
+ This License does not grant any rights in the trademarks, service marks,
133
+ or logos of any Contributor (except as may be necessary to comply with
134
+ the notice requirements in Section 3.4).
135
+
136
+ 2.4. Subsequent Licenses
137
+
138
+ No Contributor makes additional grants as a result of Your choice to
139
+ distribute the Covered Software under a subsequent version of this
140
+ License (see Section 10.2) or under the terms of a Secondary License (if
141
+ permitted under the terms of Section 3.3).
142
+
143
+ 2.5. Representation
144
+
145
+ Each Contributor represents that the Contributor believes its
146
+ Contributions are its original creation(s) or it has sufficient rights
147
+ to grant the rights to its Contributions conveyed by this License.
148
+
149
+ 2.6. Fair Use
150
+
151
+ This License is not intended to limit any rights You have under
152
+ applicable copyright doctrines of fair use, fair dealing, or other
153
+ equivalents.
154
+
155
+ 2.7. Conditions
156
+
157
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
158
+ in Section 2.1.
159
+
160
+ 3. Responsibilities
161
+
162
+ ---
163
+
164
+ 3.1. Distribution of Source Form
165
+
166
+ All distribution of Covered Software in Source Code Form, including any
167
+ Modifications that You create or to which You contribute, must be under
168
+ the terms of this License. You must inform recipients that the Source
169
+ Code Form of the Covered Software is governed by the terms of this
170
+ License, and how they can obtain a copy of this License. You may not
171
+ attempt to alter or restrict the recipients' rights in the Source Code
172
+ Form.
173
+
174
+ 3.2. Distribution of Executable Form
175
+
176
+ If You distribute Covered Software in Executable Form then:
177
+
178
+ (a) such Covered Software must also be made available in Source Code
179
+ Form, as described in Section 3.1, and You must inform recipients of
180
+ the Executable Form how they can obtain a copy of such Source Code
181
+ Form by reasonable means in a timely manner, at a charge no more
182
+ than the cost of distribution to the recipient; and
183
+
184
+ (b) You may distribute such Executable Form under the terms of this
185
+ License, or sublicense it under different terms, provided that the
186
+ license for the Executable Form does not attempt to limit or alter
187
+ the recipients' rights in the Source Code Form under this License.
188
+
189
+ 3.3. Distribution of a Larger Work
190
+
191
+ You may create and distribute a Larger Work under terms of Your choice,
192
+ provided that You also comply with the requirements of this License for
193
+ the Covered Software. If the Larger Work is a combination of Covered
194
+ Software with a work governed by one or more Secondary Licenses, and the
195
+ Covered Software is not Incompatible With Secondary Licenses, this
196
+ License permits You to additionally distribute such Covered Software
197
+ under the terms of such Secondary License(s), so that the recipient of
198
+ the Larger Work may, at their option, further distribute the Covered
199
+ Software under the terms of either this License or such Secondary
200
+ License(s).
201
+
202
+ 3.4. Notices
203
+
204
+ You may not remove or alter the substance of any license notices
205
+ (including copyright notices, patent notices, disclaimers of warranty,
206
+ or limitations of liability) contained within the Source Code Form of
207
+ the Covered Software, except that You may alter any license notices to
208
+ the extent required to remedy known factual inaccuracies.
209
+
210
+ 3.5. Application of Additional Terms
211
+
212
+ You may choose to offer, and to charge a fee for, warranty, support,
213
+ indemnity or liability obligations to one or more recipients of Covered
214
+ Software. However, You may do so only on Your own behalf, and not on
215
+ behalf of any Contributor. You must make it absolutely clear that any
216
+ such warranty, support, indemnity, or liability obligation is offered by
217
+ You alone, and You hereby agree to indemnify every Contributor for any
218
+ liability incurred by such Contributor as a result of warranty, support,
219
+ indemnity or liability terms You offer. You may include additional
220
+ disclaimers of warranty and limitations of liability specific to any
221
+ jurisdiction.
222
+
223
+ 4. Inability to Comply Due to Statute or Regulation
224
+
225
+ ---
226
+
227
+ If it is impossible for You to comply with any of the terms of this
228
+ License with respect to some or all of the Covered Software due to
229
+ statute, judicial order, or regulation then You must: (a) comply with
230
+ the terms of this License to the maximum extent possible; and (b)
231
+ describe the limitations and the code they affect. Such description must
232
+ be placed in a text file included with all distributions of the Covered
233
+ Software under this License. Except to the extent prohibited by statute
234
+ or regulation, such description must be sufficiently detailed for a
235
+ recipient of ordinary skill to be able to understand it.
236
+
237
+ 5. Termination
238
+
239
+ ---
240
+
241
+ 5.1. The rights granted under this License will terminate automatically
242
+ if You fail to comply with any of its terms. However, if You become
243
+ compliant, then the rights granted under this License from a particular
244
+ Contributor are reinstated (a) provisionally, unless and until such
245
+ Contributor explicitly and finally terminates Your grants, and (b) on an
246
+ ongoing basis, if such Contributor fails to notify You of the
247
+ non-compliance by some reasonable means prior to 60 days after You have
248
+ come back into compliance. Moreover, Your grants from a particular
249
+ Contributor are reinstated on an ongoing basis if such Contributor
250
+ notifies You of the non-compliance by some reasonable means, this is the
251
+ first time You have received notice of non-compliance with this License
252
+ from such Contributor, and You become compliant prior to 30 days after
253
+ Your receipt of the notice.
254
+
255
+ 5.2. If You initiate litigation against any entity by asserting a patent
256
+ infringement claim (excluding declaratory judgment actions,
257
+ counter-claims, and cross-claims) alleging that a Contributor Version
258
+ directly or indirectly infringes any patent, then the rights granted to
259
+ You by any and all Contributors for the Covered Software under Section
260
+ 2.1 of this License shall terminate.
261
+
262
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
263
+ end user license agreements (excluding distributors and resellers) which
264
+ have been validly granted by You or Your distributors under this License
265
+ prior to termination shall survive termination.
266
+
267
+ ---
268
+
269
+ - *
270
+ - 6. Disclaimer of Warranty \*
271
+ - ------------------------- \*
272
+ - *
273
+ - Covered Software is provided under this License on an "as is" \*
274
+ - basis, without warranty of any kind, either expressed, implied, or \*
275
+ - statutory, including, without limitation, warranties that the \*
276
+ - Covered Software is free of defects, merchantable, fit for a \*
277
+ - particular purpose or non-infringing. The entire risk as to the \*
278
+ - quality and performance of the Covered Software is with You. \*
279
+ - Should any Covered Software prove defective in any respect, You \*
280
+ - (not any Contributor) assume the cost of any necessary servicing, \*
281
+ - repair, or correction. This disclaimer of warranty constitutes an \*
282
+ - essential part of this License. No use of any Covered Software is \*
283
+ - authorized under this License except under this disclaimer. \*
284
+ - *
285
+
286
+ ---
287
+
288
+ ---
289
+
290
+ - *
291
+ - 7. Limitation of Liability \*
292
+ - -------------------------- \*
293
+ - *
294
+ - Under no circumstances and under no legal theory, whether tort \*
295
+ - (including negligence), contract, or otherwise, shall any \*
296
+ - Contributor, or anyone who distributes Covered Software as \*
297
+ - permitted above, be liable to You for any direct, indirect, \*
298
+ - special, incidental, or consequential damages of any character \*
299
+ - including, without limitation, damages for lost profits, loss of \*
300
+ - goodwill, work stoppage, computer failure or malfunction, or any \*
301
+ - and all other commercial damages or losses, even if such party \*
302
+ - shall have been informed of the possibility of such damages. This \*
303
+ - limitation of liability shall not apply to liability for death or \*
304
+ - personal injury resulting from such party's negligence to the \*
305
+ - extent applicable law prohibits such limitation. Some \*
306
+ - jurisdictions do not allow the exclusion or limitation of \*
307
+ - incidental or consequential damages, so this exclusion and \*
308
+ - limitation may not apply to You. \*
309
+ - *
310
+
311
+ ---
312
+
313
+ 8. Litigation
314
+
315
+ ---
316
+
317
+ Any litigation relating to this License may be brought only in the
318
+ courts of a jurisdiction where the defendant maintains its principal
319
+ place of business and such litigation shall be governed by laws of that
320
+ jurisdiction, without reference to its conflict-of-law provisions.
321
+ Nothing in this Section shall prevent a party's ability to bring
322
+ cross-claims or counter-claims.
323
+
324
+ 9. Miscellaneous
325
+
326
+ ---
327
+
328
+ This License represents the complete agreement concerning the subject
329
+ matter hereof. If any provision of this License is held to be
330
+ unenforceable, such provision shall be reformed only to the extent
331
+ necessary to make it enforceable. Any law or regulation which provides
332
+ that the language of a contract shall be construed against the drafter
333
+ shall not be used to construe this License against a Contributor.
334
+
335
+ 10. Versions of the License
336
+
337
+ ---
338
+
339
+ 10.1. New Versions
340
+
341
+ Mozilla Foundation is the license steward. Except as provided in Section
342
+ 10.3, no one other than the license steward has the right to modify or
343
+ publish new versions of this License. Each version will be given a
344
+ distinguishing version number.
345
+
346
+ 10.2. Effect of New Versions
347
+
348
+ You may distribute the Covered Software under the terms of the version
349
+ of the License under which You originally received the Covered Software,
350
+ or under the terms of any subsequent version published by the license
351
+ steward.
352
+
353
+ 10.3. Modified Versions
354
+
355
+ If you create software not governed by this License, and you want to
356
+ create a new license for such software, you may create and use a
357
+ modified version of this License if you rename the license and remove
358
+ any references to the name of the license steward (except to note that
359
+ such modified license differs from this License).
360
+
361
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
362
+ Licenses
363
+
364
+ If You choose to distribute Source Code Form that is Incompatible With
365
+ Secondary Licenses under the terms of this version of the License, the
366
+ notice described in Exhibit B of this License must be attached.
367
+
368
+ ## Exhibit A - Source Code Form License Notice
369
+
370
+ This Source Code Form is subject to the terms of the Mozilla Public
371
+ License, v. 2.0. If a copy of the MPL was not distributed with this
372
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
373
+
374
+ If it is not possible or desirable to put the notice in a particular
375
+ file, then You may include the notice in a location (such as a LICENSE
376
+ file in a relevant directory) where a recipient would be likely to look
377
+ for such a notice.
378
+
379
+ You may add additional accurate notices of copyright ownership.
380
+
381
+ ## Exhibit B - "Incompatible With Secondary Licenses" Notice
382
+
383
+ This Source Code Form is "Incompatible With Secondary Licenses", as
384
+ defined by the Mozilla Public License, v. 2.0.
@@ -120,6 +120,10 @@ export const EVENT_STORMING_BACKGROUND = {
120
120
  stroke: { color: '@axis', width: 6 },
121
121
  title: {
122
122
  id: 'timeAxisTitle',
123
+ // Renamable in place (issue #355): a workshop that storms a release
124
+ // rather than a day writes its own word under the arrow, and the
125
+ // catalogue keeps serving "Time" to every board that has not.
126
+ prop: 'timeAxisTitle',
123
127
  labelKey: 'com.labre.event-storming.background.axis.time',
124
128
  fallback: 'Time',
125
129
  // Pushed down with the SIZE, not just with the stroke.
@@ -1,4 +1,18 @@
1
+ import { type ChromeWording } from '@formicoidea/labre-core/shared/services';
1
2
  import type { CommandDescriptor } from '@formicoidea/labre-core/std';
2
3
  import { type TemplateResult } from 'lit';
4
+ /**
5
+ * The automatic legend's own section titles — text stamped onto the board the
6
+ * moment the legend is built, like any other seed, and declared HERE because
7
+ * the rows that file themselves under them are subscribed by the commands
8
+ * below. The box title itself is not one of them: it says the shared word
9
+ * "Legend" and reuses `BOARD_LEGEND_TITLE`.
10
+ *
11
+ * Two sub-titles for a framework whose eleven commands all sit in ONE category:
12
+ * `section` is what keeps the Flow — a line, not a post-it — out of the
13
+ * stickies where the category would file it (`docs/adr/0026`).
14
+ */
15
+ export declare const ES_SEED_LEGEND_STICKIES: ChromeWording;
16
+ export declare const ES_SEED_LEGEND_FLOW: ChromeWording;
3
17
  export declare const eventStormingCommands: CommandDescriptor[];
4
18
  export declare const eventStormingCommandIcons: Record<string, TemplateResult>;
package/dist/commands.js CHANGED
@@ -1,10 +1,29 @@
1
- import { addSticky, esStickySeedKey, ES_HOTSPOT, ES_STICKIES, placeDddElement, STICKY_SIZE, } from '@formicoidea/labre-ddd-shared';
1
+ import { addSticky, esStickySeedKey, ES_HOTSPOT, ES_STICKIES, eventStormingToolbarIcon, LABEL_COLOR, placeDddElement, STICKY_SIZE, } from '@formicoidea/labre-ddd-shared';
2
2
  import { NOTATION_NEUTRALS } from '@formicoidea/labre-core/shared/consts';
3
- import { translateKey } from '@formicoidea/labre-core/shared/services';
3
+ import { translateKey, } from '@formicoidea/labre-core/shared/services';
4
4
  import { GfxControllerIdentifier } from '@formicoidea/labre-core/std/gfx';
5
5
  import { svg } from 'lit';
6
6
  import { activateEventStormingFlow, createEventStormingBoard } from './actions.js';
7
- import { ES_STICKY_ROLE } from './roles.js';
7
+ import { ES_ROLE, ES_STICKY_ROLE } from './roles.js';
8
+ /**
9
+ * The automatic legend's own section titles — text stamped onto the board the
10
+ * moment the legend is built, like any other seed, and declared HERE because
11
+ * the rows that file themselves under them are subscribed by the commands
12
+ * below. The box title itself is not one of them: it says the shared word
13
+ * "Legend" and reuses `BOARD_LEGEND_TITLE`.
14
+ *
15
+ * Two sub-titles for a framework whose eleven commands all sit in ONE category:
16
+ * `section` is what keeps the Flow — a line, not a post-it — out of the
17
+ * stickies where the category would file it (`docs/adr/0026`).
18
+ */
19
+ export const ES_SEED_LEGEND_STICKIES = [
20
+ 'com.labre.ddd-event-storming.seed.legend-stickies',
21
+ 'Stickies',
22
+ ];
23
+ export const ES_SEED_LEGEND_FLOW = [
24
+ 'com.labre.ddd-event-storming.seed.legend-flow',
25
+ 'Flow',
26
+ ];
8
27
  /**
9
28
  * The Event Storming palette as commands: the board, the eight colour-coded
10
29
  * stickies, the hotspot and the flow. Declared once and read by the sub-menu,
@@ -51,7 +70,7 @@ const SPECS = [
51
70
  fill: preset.fill,
52
71
  text: preset.text,
53
72
  // Translated HERE and once: the caption is document content the
54
- // moment it lands (ADR 0016), so the host's catalogue is asked at
73
+ // moment it lands (ADR 0023), so the host's catalogue is asked at
55
74
  // placement and never again.
56
75
  label: translateKey(std, esStickySeedKey(preset.kind), preset.label),
57
76
  size: preset.kind === 'aggregate' ? AGGREGATE_SIZE : STICKY_SIZE,
@@ -61,6 +80,14 @@ const SPECS = [
61
80
  // (promesse #71).
62
81
  role: ES_STICKY_ROLE[preset.kind],
63
82
  })),
83
+ // Row and command out of the SAME preset, so the colour ladder the legend
84
+ // shows is by construction the colour ladder on the wall — and a tenth
85
+ // sticky kind gets its row with no edit.
86
+ legend: {
87
+ role: ES_STICKY_ROLE[preset.kind],
88
+ section: ES_SEED_LEGEND_STICKIES,
89
+ row: { swatch: 'square', color: preset.fill },
90
+ },
64
91
  })),
65
92
  {
66
93
  id: 'addHotspot',
@@ -71,30 +98,45 @@ const SPECS = [
71
98
  run: std => placeDddElement(std, (surface, cx, cy) => addSticky(surface, std, cx, cy, {
72
99
  fill: ES_HOTSPOT.fill,
73
100
  text: ES_HOTSPOT.text,
74
- // Translated HERE and once, like every sticky above (ADR 0016).
101
+ // Translated HERE and once, like every sticky above (ADR 0023).
75
102
  label: translateKey(std, esStickySeedKey('hotspot'), ES_HOTSPOT.label),
76
103
  shapeType: 'diamond',
77
104
  // Typed like the rest, and cited by no grammar triplet on purpose —
78
105
  // an arc onto a hotspot is a question being parked. See `rules.ts`.
79
106
  role: ES_STICKY_ROLE.hotspot,
80
107
  })),
108
+ // In its own preset, a diamond rather than a square, and therefore its own
109
+ // row — appended after the eight by its `order` rather than by hand.
110
+ legend: {
111
+ role: ES_STICKY_ROLE.hotspot,
112
+ section: ES_SEED_LEGEND_STICKIES,
113
+ row: { swatch: 'square', color: ES_HOTSPOT.fill },
114
+ },
81
115
  },
82
116
  {
83
117
  id: 'addFlow',
84
118
  label: 'Flow',
85
119
  iconKey: 'ddd-event-storming.flow',
86
120
  element: 'flow',
121
+ kind: 'tool',
87
122
  icon: flowSwatch,
88
123
  // No longer a placement: the entry arms the connector tool and the user
89
124
  // DRAWS the flow between two stickies. See `activateEventStormingFlow` for
90
125
  // why the free-floating arrow had to go. The telemetry value is untouched.
91
126
  run: std => activateEventStormingFlow(std.get(GfxControllerIdentifier)),
127
+ legend: {
128
+ role: ES_ROLE.flow,
129
+ section: ES_SEED_LEGEND_FLOW,
130
+ // The style `activateEventStormingFlow` arms the connector tool with: a
131
+ // solid line in the label colour.
132
+ row: { swatch: 'line', color: LABEL_COLOR },
133
+ },
92
134
  },
93
135
  ];
94
136
  export const eventStormingCommands = SPECS.map((spec, order) => ({
95
137
  id: `ddd-event-storming.${spec.id}`,
96
138
  owner: 'ddd-event-storming',
97
- kind: 'artefact',
139
+ kind: spec.kind ?? 'artefact',
98
140
  labelKey: `com.labre.commands.ddd-event-storming.${spec.id}`,
99
141
  labelFallback: spec.label,
100
142
  category: 'stickies',
@@ -110,5 +152,11 @@ export const eventStormingCommands = SPECS.map((spec, order) => ({
110
152
  element: spec.element,
111
153
  board: spec.board,
112
154
  },
155
+ legend: spec.legend,
113
156
  }));
114
- export const eventStormingCommandIcons = Object.fromEntries(SPECS.map(spec => [spec.iconKey, spec.icon]));
157
+ export const eventStormingCommandIcons = {
158
+ ...Object.fromEntries(SPECS.map(spec => [spec.iconKey, spec.icon])),
159
+ // The senior button's 56×56 glyph, so `FrameworkDescriptor.iconKey` resolves
160
+ // through `getCommandIcon`.
161
+ 'ddd-event-storming.toolbar': eventStormingToolbarIcon,
162
+ };
@@ -1,15 +1,19 @@
1
+ import type { FrameworkBackgroundDef } from '@formicoidea/labre-core/blocks/surface';
2
+ import { DeclaredBackgroundView } from '@formicoidea/labre-core/blocks/surface';
1
3
  import type { EventStormingBoardElementModel } from '@formicoidea/labre-core/model';
2
- import { GfxElementModelView } from '@formicoidea/labre-core/std/gfx';
3
4
  /**
4
5
  * View for the Event Storming board. Registering it ensures `gfx.view.get(model)`
5
6
  * returns a view (required so move / select interactions work).
6
7
  *
7
- * No double-click label editor, unlike the Wardley map: the only text on the
8
- * card is the axis word, which the declaration owns and the model carries no
9
- * prop for — there is nothing here the user edits in place.
8
+ * Extends {@link DeclaredBackgroundView}, so the one word the board writes on
9
+ * itself — the time axis title — is renamed in place by a double-click, like
10
+ * every other framework background (issue #355). This file used to say the
11
+ * board had nothing to edit because the declaration bound no prop; binding one
12
+ * is the fix, and the gesture then comes for free.
10
13
  */
11
- export declare class EventStormingView extends GfxElementModelView<EventStormingBoardElementModel> {
14
+ export declare class EventStormingView extends DeclaredBackgroundView<EventStormingBoardElementModel> {
12
15
  static type: string;
16
+ protected get def(): FrameworkBackgroundDef;
13
17
  }
14
18
  /**
15
19
  * Resize gating, from the primitive: the handles follow `resizeEnabled`, which
@@ -1,16 +1,20 @@
1
- import { FrameworkBackgroundInteractionExtension } from '@formicoidea/labre-core/blocks/surface';
2
- import { GfxElementModelView } from '@formicoidea/labre-core/std/gfx';
1
+ import { DeclaredBackgroundView, FrameworkBackgroundInteractionExtension, } from '@formicoidea/labre-core/blocks/surface';
3
2
  import { EVENT_STORMING_BACKGROUND } from './background.js';
4
3
  /**
5
4
  * View for the Event Storming board. Registering it ensures `gfx.view.get(model)`
6
5
  * returns a view (required so move / select interactions work).
7
6
  *
8
- * No double-click label editor, unlike the Wardley map: the only text on the
9
- * card is the axis word, which the declaration owns and the model carries no
10
- * prop for — there is nothing here the user edits in place.
7
+ * Extends {@link DeclaredBackgroundView}, so the one word the board writes on
8
+ * itself — the time axis title — is renamed in place by a double-click, like
9
+ * every other framework background (issue #355). This file used to say the
10
+ * board had nothing to edit because the declaration bound no prop; binding one
11
+ * is the fix, and the gesture then comes for free.
11
12
  */
12
- export class EventStormingView extends GfxElementModelView {
13
+ export class EventStormingView extends DeclaredBackgroundView {
13
14
  static { this.type = 'eventStorming'; }
15
+ get def() {
16
+ return EVENT_STORMING_BACKGROUND;
17
+ }
14
18
  }
15
19
  /**
16
20
  * Resize gating, from the primitive: the handles follow `resizeEnabled`, which
@@ -1,15 +1,14 @@
1
- import { type ToolbarContext } from '@formicoidea/labre-core/shared/services';
1
+ import { type ToolbarContext, type ToolbarModuleConfig } from '@formicoidea/labre-core/shared/services';
2
2
  /**
3
- * The selected board's contextual toolbar: the resize toggle, and the automatic
4
- * legend of the sticky kinds actually stuck to the board. Registered ALWAYS-ON
5
- * (`DddEventStormingRenderViewExtension`) — a stored board must stay usable with
6
- * the Event Storming button switched off (`docs/adr/0009`), legend included: a
7
- * legend is real editable elements, so generating one is authoring a document,
8
- * not tooling that a flag may take away.
3
+ * The selected board's ALWAYS-ON row: the resize toggle, and nothing else. A
4
+ * stored board must stay usable with the Event Storming button switched off
5
+ * (`docs/adr/0009`) — it keeps its handles, and everything already stuck to it,
6
+ * legend boxes included, keeps being painted.
9
7
  *
10
- * This is the module's ONLY legend gesture: the Event Storming palette never had
11
- * a static Legend entry, and a wall of colour-coded stickies is exactly the
12
- * board a reader needs one for.
8
+ * The legend BUTTON moved out of here to
9
+ * {@link eventStormingBoardToolingToolbarConfig} (`docs/adr/0026`): generating
10
+ * one is a gesture the flag may take away, even though what it writes is
11
+ * document content.
13
12
  */
14
13
  export declare const eventStormingBoardToolbarConfig: {
15
14
  readonly actions: [{
@@ -18,12 +17,25 @@ export declare const eventStormingBoardToolbarConfig: {
18
17
  readonly icon: import("lit-html").TemplateResult<1>;
19
18
  readonly active: (ctx: ToolbarContext) => boolean;
20
19
  readonly run: (ctx: ToolbarContext) => void;
21
- }, {
22
- readonly id: "b.legend";
23
- readonly tooltipWording: import("@formicoidea/labre-core/shared/services").ChromeWording;
24
- readonly icon: import("lit-html").TemplateResult<1>;
25
- readonly run: (ctx: ToolbarContext) => void;
26
20
  }];
27
21
  readonly when: (ctx: ToolbarContext) => boolean;
28
22
  };
29
23
  export declare const eventStormingBoardToolbarExtension: import("@formicoidea/labre-core/store").ExtensionType;
24
+ /**
25
+ * The board's FLAG-GATED row, whole: the legend button and the Validation
26
+ * dropdown, in one module.
27
+ *
28
+ * They cannot be two, and that is a hard constraint rather than a preference:
29
+ * `ToolbarModuleExtension` binds by DI variant, so a second module claiming
30
+ * `custom:affine:surface:eventStorming` throws
31
+ * `DuplicateServiceDefinitionError` before the editor finishes setting up. The
32
+ * C4 board's own row was merged this way first
33
+ * (`c4BoardToolingToolbarConfig`).
34
+ *
35
+ * Both entries go with the `ddd-event-storming` flag for the same reason:
36
+ * turning it off takes away the gesture that GENERATES legend elements and the
37
+ * choice of how hard to check the board, and leaves the stored board its handles
38
+ * and everything already stuck to it. The legend rows themselves are derived
39
+ * from `eventStormingCommands` — the module writes no table (`docs/adr/0026`).
40
+ */
41
+ export declare const eventStormingBoardToolingToolbarConfig: ToolbarModuleConfig;
@@ -1,10 +1,8 @@
1
- import { EdgelessCRUDIdentifier } from '@formicoidea/labre-core/blocks/surface';
2
- import { createAutoLegend, dddLegendIcon } from '@formicoidea/labre-ddd-shared';
1
+ import { EdgelessCRUDIdentifier, legendToolbarAction, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
3
2
  import { EventStormingBoardElementModel } from '@formicoidea/labre-core/model';
4
- import { BOARD_LEGEND_NOTATION, BOARD_RESIZE_TOGGLE, TelemetryProvider, ToolbarModuleExtension, } from '@formicoidea/labre-core/shared/services';
3
+ import { BOARD_RESIZE_TOGGLE, ToolbarModuleExtension, } from '@formicoidea/labre-core/shared/services';
5
4
  import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
6
5
  import { html } from 'lit';
7
- import { EVENT_STORMING_AUTO_LEGEND } from '../legend.js';
8
6
  const ResizeIcon = html `<svg
9
7
  width="24"
10
8
  height="24"
@@ -19,16 +17,15 @@ const ResizeIcon = html `<svg
19
17
  <path d="M5 5l6 6M19 19l-6-6" />
20
18
  </svg>`;
21
19
  /**
22
- * The selected board's contextual toolbar: the resize toggle, and the automatic
23
- * legend of the sticky kinds actually stuck to the board. Registered ALWAYS-ON
24
- * (`DddEventStormingRenderViewExtension`) — a stored board must stay usable with
25
- * the Event Storming button switched off (`docs/adr/0009`), legend included: a
26
- * legend is real editable elements, so generating one is authoring a document,
27
- * not tooling that a flag may take away.
20
+ * The selected board's ALWAYS-ON row: the resize toggle, and nothing else. A
21
+ * stored board must stay usable with the Event Storming button switched off
22
+ * (`docs/adr/0009`) — it keeps its handles, and everything already stuck to it,
23
+ * legend boxes included, keeps being painted.
28
24
  *
29
- * This is the module's ONLY legend gesture: the Event Storming palette never had
30
- * a static Legend entry, and a wall of colour-coded stickies is exactly the
31
- * board a reader needs one for.
25
+ * The legend BUTTON moved out of here to
26
+ * {@link eventStormingBoardToolingToolbarConfig} (`docs/adr/0026`): generating
27
+ * one is a gesture the flag may take away, even though what it writes is
28
+ * document content.
32
29
  */
33
30
  export const eventStormingBoardToolbarConfig = {
34
31
  actions: [
@@ -52,31 +49,6 @@ export const eventStormingBoardToolbarConfig = {
52
49
  }
53
50
  },
54
51
  },
55
- {
56
- id: 'b.legend',
57
- tooltipWording: BOARD_LEGEND_NOTATION,
58
- icon: dddLegendIcon,
59
- run(ctx) {
60
- const board = ctx.getSurfaceModelsByType(EventStormingBoardElementModel)[0];
61
- if (!board)
62
- return;
63
- createAutoLegend(ctx.std, board, EVENT_STORMING_AUTO_LEGEND);
64
- ctx.std
65
- .getOptional(TelemetryProvider)
66
- ?.track('FrameworkLegendCreated', {
67
- // The WIRE value, which is not the module id: the framework is
68
- // `ddd-event-storming` in code and `event-storming` in PostHog
69
- // (`frameworks.ts` `telemetryKey`, and the only value
70
- // `FrameworkElementEvent` accepts). Same convention as Wardley's own
71
- // legend button, so the two are comparable.
72
- framework: 'event-storming',
73
- element: 'legend',
74
- page: 'whiteboard editor',
75
- segment: 'element toolbar',
76
- module: 'event-storming toolbar',
77
- });
78
- },
79
- },
80
52
  ],
81
53
  when: (ctx) => ctx.getSurfaceModelsByType(EventStormingBoardElementModel).length > 0,
82
54
  };
@@ -84,3 +56,38 @@ export const eventStormingBoardToolbarExtension = ToolbarModuleExtension({
84
56
  id: BlockFlavourIdentifier('affine:surface:eventStorming'),
85
57
  config: eventStormingBoardToolbarConfig,
86
58
  });
59
+ /**
60
+ * The board's FLAG-GATED row, whole: the legend button and the Validation
61
+ * dropdown, in one module.
62
+ *
63
+ * They cannot be two, and that is a hard constraint rather than a preference:
64
+ * `ToolbarModuleExtension` binds by DI variant, so a second module claiming
65
+ * `custom:affine:surface:eventStorming` throws
66
+ * `DuplicateServiceDefinitionError` before the editor finishes setting up. The
67
+ * C4 board's own row was merged this way first
68
+ * (`c4BoardToolingToolbarConfig`).
69
+ *
70
+ * Both entries go with the `ddd-event-storming` flag for the same reason:
71
+ * turning it off takes away the gesture that GENERATES legend elements and the
72
+ * choice of how hard to check the board, and leaves the stored board its handles
73
+ * and everything already stuck to it. The legend rows themselves are derived
74
+ * from `eventStormingCommands` — the module writes no table (`docs/adr/0026`).
75
+ */
76
+ export const eventStormingBoardToolingToolbarConfig = {
77
+ actions: [
78
+ legendToolbarAction({
79
+ Model: EventStormingBoardElementModel,
80
+ owner: 'ddd-event-storming',
81
+ // The WIRE value, which is not the module id: the framework is
82
+ // `ddd-event-storming` in code and `event-storming` in PostHog
83
+ // (`frameworks.ts` `telemetryKey`). Unchanged by the button becoming
84
+ // shared.
85
+ framework: 'event-storming',
86
+ }),
87
+ // The generic dropdown, not an Event Storming variant of it: the config
88
+ // names no framework — it reads the registered rules and profiles — so this
89
+ // is the very same object c4, wardley and bpmn register.
90
+ ...validationToolbarConfig.actions,
91
+ ],
92
+ when: eventStormingBoardToolbarConfig.when,
93
+ };
@@ -0,0 +1,36 @@
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 Event Storming swatches' own names, resolved by `resolvePaletteLabel`
5
+ * (`@labre/affine-components/color-picker`) through each swatch's own
6
+ * {@link NamedPalette.labelWording} — the mechanism `WARDLEY_PALETTE_WORDINGS`
7
+ * established, reused here without either package naming the other.
8
+ *
9
+ * Exported so `../translations.ts` can list them under source `chrome`: a
10
+ * swatch's name is toolbar chrome, re-rendered on every locale switch, never
11
+ * seeded into a document. They are this framework's OWN keys even though the
12
+ * colours come from `ddd-shared` — the shared file declares no `com.labre.*`
13
+ * key of its own, by design (see its header).
14
+ */
15
+ export declare const ES_PALETTE_WORDING_DOMAIN_EVENT: ChromeWording;
16
+ export declare const ES_PALETTE_WORDING_COMMAND: ChromeWording;
17
+ export declare const ES_PALETTE_WORDING_AGGREGATE: ChromeWording;
18
+ export declare const ES_PALETTE_WORDING_ACTOR: ChromeWording;
19
+ export declare const ES_PALETTE_WORDING_CONSTRAINT: ChromeWording;
20
+ export declare const ES_PALETTE_WORDING_POLICY: ChromeWording;
21
+ export declare const ES_PALETTE_WORDING_READ_MODEL: ChromeWording;
22
+ export declare const ES_PALETTE_WORDING_SYSTEM: ChromeWording;
23
+ export declare const ES_PALETTE_WORDING_HOTSPOT: ChromeWording;
24
+ export declare const ES_PALETTE_WORDINGS: readonly ChromeWording[];
25
+ /**
26
+ * From the default editor palette we keep ONLY the neutrals — the historical
27
+ * colours say nothing in this notation.
28
+ */
29
+ export declare const ES_PALETTE_LIST: NamedPalette[];
30
+ /**
31
+ * Event Storming's page of the colour pickers' carousel (`docs/adr/0027`).
32
+ * Registered from the FLAG-GATED view extension, because offering hues is
33
+ * TOOLING: a board drawn while the flag was on keeps every colour it was
34
+ * painted with when the flag goes off (`docs/adr/0009`).
35
+ */
36
+ export declare const EVENT_STORMING_FRAMEWORK_PALETTE: FrameworkPalette;
@@ -0,0 +1,145 @@
1
+ import { ES_HOTSPOT, ES_STICKIES } from '@formicoidea/labre-ddd-shared';
2
+ import { neutralPalettes } from '@formicoidea/labre-core/gfx/shape';
3
+ /**
4
+ * The Event Storming swatches' own names, resolved by `resolvePaletteLabel`
5
+ * (`@labre/affine-components/color-picker`) through each swatch's own
6
+ * {@link NamedPalette.labelWording} — the mechanism `WARDLEY_PALETTE_WORDINGS`
7
+ * established, reused here without either package naming the other.
8
+ *
9
+ * Exported so `../translations.ts` can list them under source `chrome`: a
10
+ * swatch's name is toolbar chrome, re-rendered on every locale switch, never
11
+ * seeded into a document. They are this framework's OWN keys even though the
12
+ * colours come from `ddd-shared` — the shared file declares no `com.labre.*`
13
+ * key of its own, by design (see its header).
14
+ */
15
+ export const ES_PALETTE_WORDING_DOMAIN_EVENT = [
16
+ 'com.labre.ddd-event-storming.palette.domain-event-orange',
17
+ 'Domain event orange',
18
+ ];
19
+ export const ES_PALETTE_WORDING_COMMAND = [
20
+ 'com.labre.ddd-event-storming.palette.command-blue',
21
+ 'Command blue',
22
+ ];
23
+ export const ES_PALETTE_WORDING_AGGREGATE = [
24
+ 'com.labre.ddd-event-storming.palette.aggregate-cream',
25
+ 'Aggregate cream',
26
+ ];
27
+ export const ES_PALETTE_WORDING_ACTOR = [
28
+ 'com.labre.ddd-event-storming.palette.actor-yellow',
29
+ 'Actor yellow',
30
+ ];
31
+ export const ES_PALETTE_WORDING_CONSTRAINT = [
32
+ 'com.labre.ddd-event-storming.palette.constraint-yellow',
33
+ 'Constraint yellow',
34
+ ];
35
+ export const ES_PALETTE_WORDING_POLICY = [
36
+ 'com.labre.ddd-event-storming.palette.policy-lilac',
37
+ 'Policy lilac',
38
+ ];
39
+ export const ES_PALETTE_WORDING_READ_MODEL = [
40
+ 'com.labre.ddd-event-storming.palette.read-model-green',
41
+ 'Read model green',
42
+ ];
43
+ export const ES_PALETTE_WORDING_SYSTEM = [
44
+ 'com.labre.ddd-event-storming.palette.external-system-pink',
45
+ 'External system pink',
46
+ ];
47
+ export const ES_PALETTE_WORDING_HOTSPOT = [
48
+ 'com.labre.ddd-event-storming.palette.hotspot-magenta',
49
+ 'Hotspot magenta',
50
+ ];
51
+ export const ES_PALETTE_WORDINGS = [
52
+ ES_PALETTE_WORDING_DOMAIN_EVENT,
53
+ ES_PALETTE_WORDING_COMMAND,
54
+ ES_PALETTE_WORDING_AGGREGATE,
55
+ ES_PALETTE_WORDING_ACTOR,
56
+ ES_PALETTE_WORDING_CONSTRAINT,
57
+ ES_PALETTE_WORDING_POLICY,
58
+ ES_PALETTE_WORDING_READ_MODEL,
59
+ ES_PALETTE_WORDING_SYSTEM,
60
+ ES_PALETTE_WORDING_HOTSPOT,
61
+ ];
62
+ /**
63
+ * The sticky fills, by kind — derived from {@link ES_STICKIES} rather than
64
+ * restated, so a hue changed in the shared table changes the shelf with it.
65
+ */
66
+ const ES_FILL = Object.fromEntries(ES_STICKIES.map(sticky => [sticky.kind, sticky.fill]));
67
+ /**
68
+ * The DDD Crew / Brandolini **colour code**, surfaced as ready-made swatches.
69
+ *
70
+ * Event Storming is the one notation here where the colour IS the vocabulary:
71
+ * an orange sticky is a domain event and a blue one a command, and that holds
72
+ * on a wall, in a book and on this canvas. The shelf is therefore the sticky
73
+ * table itself, in the order the grammar reads it (`ES_STICKIES`: an actor
74
+ * issues a command, a command lands on an aggregate, an aggregate raises an
75
+ * event), with the hotspot's neon diamond last.
76
+ *
77
+ * They are SHORTCUTS, never constraints: a sticky's KIND is written in its
78
+ * role, not read off its fill, so nothing breaks when an author repaints one.
79
+ */
80
+ const ES_PALETTES = [
81
+ {
82
+ key: 'Domain event orange',
83
+ value: ES_FILL.domainEvent,
84
+ labelWording: ES_PALETTE_WORDING_DOMAIN_EVENT,
85
+ },
86
+ {
87
+ key: 'Command blue',
88
+ value: ES_FILL.command,
89
+ labelWording: ES_PALETTE_WORDING_COMMAND,
90
+ },
91
+ {
92
+ key: 'Aggregate cream',
93
+ value: ES_FILL.aggregate,
94
+ labelWording: ES_PALETTE_WORDING_AGGREGATE,
95
+ },
96
+ {
97
+ key: 'Actor yellow',
98
+ value: ES_FILL.actor,
99
+ labelWording: ES_PALETTE_WORDING_ACTOR,
100
+ },
101
+ {
102
+ key: 'Constraint yellow',
103
+ value: ES_FILL.constraint,
104
+ labelWording: ES_PALETTE_WORDING_CONSTRAINT,
105
+ },
106
+ {
107
+ key: 'Policy lilac',
108
+ value: ES_FILL.policy,
109
+ labelWording: ES_PALETTE_WORDING_POLICY,
110
+ },
111
+ {
112
+ key: 'Read model green',
113
+ value: ES_FILL.readModel,
114
+ labelWording: ES_PALETTE_WORDING_READ_MODEL,
115
+ },
116
+ {
117
+ key: 'External system pink',
118
+ value: ES_FILL.system,
119
+ labelWording: ES_PALETTE_WORDING_SYSTEM,
120
+ },
121
+ {
122
+ key: 'Hotspot magenta',
123
+ value: ES_HOTSPOT.fill,
124
+ labelWording: ES_PALETTE_WORDING_HOTSPOT,
125
+ },
126
+ ];
127
+ /**
128
+ * From the default editor palette we keep ONLY the neutrals — the historical
129
+ * colours say nothing in this notation.
130
+ */
131
+ export const ES_PALETTE_LIST = [
132
+ ...ES_PALETTES,
133
+ ...neutralPalettes(),
134
+ ];
135
+ /**
136
+ * Event Storming's page of the colour pickers' carousel (`docs/adr/0027`).
137
+ * Registered from the FLAG-GATED view extension, because offering hues is
138
+ * TOOLING: a board drawn while the flag was on keeps every colour it was
139
+ * painted with when the flag goes off (`docs/adr/0009`).
140
+ */
141
+ export const EVENT_STORMING_FRAMEWORK_PALETTE = {
142
+ framework: 'ddd-event-storming',
143
+ labelWording: ['com.labre.framework.ddd-event-storming', 'Event Storming'],
144
+ palettes: ES_PALETTE_LIST,
145
+ };
@@ -4,4 +4,5 @@ export declare class EdgelessDddEventStormingSeniorButton extends DddSeniorButto
4
4
  protected label: string;
5
5
  protected labelKey: string;
6
6
  protected icon: import("lit-html").TemplateResult<2>;
7
+ protected owner: "ddd-event-storming";
7
8
  }
@@ -6,5 +6,6 @@ export class EdgelessDddEventStormingSeniorButton extends DddSeniorButtonBase {
6
6
  this.label = 'Event Storming';
7
7
  this.labelKey = 'com.labre.framework.ddd-event-storming';
8
8
  this.icon = eventStormingToolbarIcon;
9
+ this.owner = 'ddd-event-storming';
9
10
  }
10
11
  }
@@ -1,14 +1,4 @@
1
- import type { ChromeWording } from '@formicoidea/labre-core/shared/services';
2
1
  import { type TranslationKeyManifestEntry } from '@formicoidea/labre-core/std';
3
- /**
4
- * The automatic legend's own section titles (`legend.ts`) — text stamped onto
5
- * the board the moment the legend is built (`createAutoLegend`), like any
6
- * other seed. The box title itself is NOT here: it says the shared word
7
- * "Legend", so it reuses `BOARD_LEGEND_TITLE`
8
- * (`@labre/affine-shared/services`) instead of a key of its own.
9
- */
10
- export declare const ES_SEED_LEGEND_STICKIES: ChromeWording;
11
- export declare const ES_SEED_LEGEND_FLOW: ChromeWording;
12
2
  /**
13
3
  * THIS framework's contribution to the translation-key manifest — every
14
4
  * `com.labre.*` key Event Storming can hand to `TranslationProvider.t`,
@@ -1,27 +1,13 @@
1
1
  import { dddSharedTranslationEntries } from '@formicoidea/labre-ddd-shared';
2
2
  import { collectTranslationKeys, commandCategoryTranslationEntries, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
3
3
  import { EVENT_STORMING_BACKGROUND } from './background.js';
4
- import { eventStormingCommands } from './commands.js';
4
+ import { ES_SEED_LEGEND_FLOW, ES_SEED_LEGEND_STICKIES, eventStormingCommands, } from './commands.js';
5
5
  import { EVENT_STORMING_NUDGES } from './nudges.js';
6
6
  import { EVENT_STORMING_PROFILES } from './profiles.js';
7
7
  import { EVENT_STORMING_READING } from './reading.js';
8
8
  import { EVENT_STORMING_ROLES } from './roles.js';
9
9
  import { EVENT_STORMING_RULES } from './rules.js';
10
- /**
11
- * The automatic legend's own section titles (`legend.ts`) — text stamped onto
12
- * the board the moment the legend is built (`createAutoLegend`), like any
13
- * other seed. The box title itself is NOT here: it says the shared word
14
- * "Legend", so it reuses `BOARD_LEGEND_TITLE`
15
- * (`@labre/affine-shared/services`) instead of a key of its own.
16
- */
17
- export const ES_SEED_LEGEND_STICKIES = [
18
- 'com.labre.ddd-event-storming.seed.legend-stickies',
19
- 'Stickies',
20
- ];
21
- export const ES_SEED_LEGEND_FLOW = [
22
- 'com.labre.ddd-event-storming.seed.legend-flow',
23
- 'Flow',
24
- ];
10
+ import { ES_PALETTE_WORDINGS } from './toolbar/palette.js';
25
11
  /**
26
12
  * THIS framework's contribution to the translation-key manifest — every
27
13
  * `com.labre.*` key Event Storming can hand to `TranslationProvider.t`,
@@ -56,4 +42,12 @@ dddSharedTranslationEntries, [ES_SEED_LEGEND_STICKIES, ES_SEED_LEGEND_FLOW].map(
56
42
  key,
57
43
  fallback,
58
44
  source: 'seed',
45
+ })),
46
+ // The carousel swatches' own names (`toolbar/palette.ts`) — chrome,
47
+ // re-rendered by the colour picker on every locale switch, never seeded
48
+ // into a document. Same treatment as Wardley's and EDGY's.
49
+ ES_PALETTE_WORDINGS.map(([key, fallback]) => ({
50
+ key,
51
+ fallback,
52
+ source: 'chrome',
59
53
  })));
package/dist/view.js CHANGED
@@ -1,4 +1,5 @@
1
- import { morphToolbarConfig, QualityNudgeExtension, ReadingProfileExtension, validationToolbarConfig, ValidationProfileExtension, ValidationRuleExtension, } from '@formicoidea/labre-core/blocks/surface';
1
+ import { morphToolbarConfig, QualityNudgeExtension, ReadingProfileExtension, ValidationProfileExtension, ValidationRuleExtension, } 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 { ToolbarModuleExtension, toolbarModuleKey, } from '@formicoidea/labre-core/shared/services';
4
5
  import { TemplateCategoryExtension } from '@formicoidea/labre-core/gfx/template';
@@ -15,7 +16,8 @@ import { EVENT_STORMING_PROFILES } from './profiles.js';
15
16
  import { EVENT_STORMING_READING } from './reading.js';
16
17
  import { EVENT_STORMING_ROLES } from './roles.js';
17
18
  import { EVENT_STORMING_RULES } from './rules.js';
18
- import { eventStormingBoardToolbarExtension } from './toolbar/board-config.js';
19
+ import { eventStormingBoardToolbarExtension, eventStormingBoardToolingToolbarConfig, } from './toolbar/board-config.js';
20
+ import { EVENT_STORMING_FRAMEWORK_PALETTE } from './toolbar/palette.js';
19
21
  import { eventStormingSeniorTool } from './toolbar/senior-tool.js';
20
22
  /**
21
23
  * Event Storming rendering — ALWAYS registered, independent of any flag.
@@ -71,16 +73,16 @@ export class DddEventStormingViewExtension extends ViewExtensionProvider {
71
73
  context.register(ValidationRuleExtension(EVENT_STORMING_RULES));
72
74
  context.register(ValidationProfileExtension(EVENT_STORMING_PROFILES));
73
75
  context.register(QualityNudgeExtension(EVENT_STORMING_NUDGES));
74
- // The Validation dropdown on a selected board's contextual toolbar. A
75
- // SECOND module on the same element, through the `custom:` flavour slot:
76
- // `eventStormingBoardToolbarExtension` is registered always-on because a
77
- // stored board must keep its resize toggle, while choosing how hard to
78
- // check it is tooling and belongs here. The config names no framework —
79
- // it reads roles and profiles — so it is the very same object Wardley
80
- // registers on its own flavour.
76
+ // The board's gated row — the Legend button and the Validation dropdown,
77
+ // merged into ONE module because a flavour may carry exactly one
78
+ // (`board-config.ts`). A SECOND module on the same element, through the
79
+ // `custom:` flavour slot: `eventStormingBoardToolbarExtension` is
80
+ // registered always-on because a stored board must keep its resize
81
+ // toggle, while generating a legend and choosing how hard to check the
82
+ // board are tooling and belong here.
81
83
  context.register(ToolbarModuleExtension({
82
84
  id: BlockFlavourIdentifier('custom:affine:surface:eventStorming'),
83
- config: validationToolbarConfig,
85
+ config: eventStormingBoardToolingToolbarConfig,
84
86
  }));
85
87
  // The reversed reading (MF3): what the board says about a sticky, on
86
88
  // demand. One declaration — the roles and the flow edge, both already
@@ -89,6 +91,11 @@ export class DddEventStormingViewExtension extends ViewExtensionProvider {
89
91
  // profile, so it goes with the flag without either side naming the other.
90
92
  context.register(ReadingProfileExtension(EVENT_STORMING_READING));
91
93
  context.register(eventStormingSeniorTool);
94
+ // Event Storming's page of the colour pickers' carousel
95
+ // (`docs/adr/0027`). Here, beside the senior tool, because offering hues
96
+ // is TOOLING — the colours already painted on a stored board are content
97
+ // and do not move (`docs/adr/0009`).
98
+ context.register(FrameworkPaletteExtension(EVENT_STORMING_FRAMEWORK_PALETTE));
92
99
  // The Templates-panel category, gated by this framework's own flag like
93
100
  // every other framework's: a template is tooling (`docs/adr/0009`), and it
94
101
  // is DERIVED from this package's commands, so it registers where they do.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-framework-ddd-event-storming",
3
3
  "description": "Labre ddd-event-storming framework for @formicoidea/labre-core.",
4
- "version": "0.41.0",
4
+ "version": "0.42.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -31,8 +31,8 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@formicoidea/labre-core": "0.41.0",
35
- "@formicoidea/labre-ddd-shared": "0.41.0",
34
+ "@formicoidea/labre-core": "0.42.0",
35
+ "@formicoidea/labre-ddd-shared": "0.42.0",
36
36
  "lit": "^3.2.0"
37
37
  }
38
38
  }
package/dist/legend.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import { type AutoLegendSpec } from '@formicoidea/labre-ddd-shared';
2
- /**
3
- * What the Event Storming board's automatic legend can say — a TABLE, and
4
- * nothing else: the scan, the placement and the box are `createAutoLegend`'s
5
- * job.
6
- *
7
- * Every row is DERIVED from the palette the stickies are drawn with
8
- * ({@link ES_STICKIES}, {@link ES_HOTSPOT}) and from the role vocabulary's own
9
- * labels, never restated — so the colour ladder the legend shows is by
10
- * construction the colour ladder on the wall, and a tenth sticky kind added to
11
- * `ES_STICKIES` gets its legend row with no edit.
12
- *
13
- * The hotspot is appended for the same reason `roles.ts` appends it: it lives in
14
- * its own preset (a diamond, not a square) rather than in the table.
15
- */
16
- export declare const EVENT_STORMING_AUTO_LEGEND: AutoLegendSpec;
package/dist/legend.js DELETED
@@ -1,63 +0,0 @@
1
- import { ES_HOTSPOT, ES_STICKIES, LABEL_COLOR, roleLabel, } from '@formicoidea/labre-ddd-shared';
2
- import { BOARD_LEGEND_TITLE } from '@formicoidea/labre-core/shared/services';
3
- import { ES_ROLE, ES_STICKY_ROLE, EVENT_STORMING_ROLES } from './roles.js';
4
- import { ES_SEED_LEGEND_FLOW, ES_SEED_LEGEND_STICKIES } from './translations.js';
5
- /**
6
- * What the Event Storming board's automatic legend can say — a TABLE, and
7
- * nothing else: the scan, the placement and the box are `createAutoLegend`'s
8
- * job.
9
- *
10
- * Every row is DERIVED from the palette the stickies are drawn with
11
- * ({@link ES_STICKIES}, {@link ES_HOTSPOT}) and from the role vocabulary's own
12
- * labels, never restated — so the colour ladder the legend shows is by
13
- * construction the colour ladder on the wall, and a tenth sticky kind added to
14
- * `ES_STICKIES` gets its legend row with no edit.
15
- *
16
- * The hotspot is appended for the same reason `roles.ts` appends it: it lives in
17
- * its own preset (a diamond, not a square) rather than in the table.
18
- */
19
- export const EVENT_STORMING_AUTO_LEGEND = {
20
- title: BOARD_LEGEND_TITLE[1],
21
- titleKey: BOARD_LEGEND_TITLE[0],
22
- roles: EVENT_STORMING_ROLES,
23
- sections: [
24
- {
25
- title: ES_SEED_LEGEND_STICKIES[1],
26
- titleKey: ES_SEED_LEGEND_STICKIES[0],
27
- entries: [
28
- ...ES_STICKIES.map(preset => ({
29
- role: ES_STICKY_ROLE[preset.kind],
30
- row: {
31
- swatch: 'square',
32
- color: preset.fill,
33
- label: preset.label,
34
- },
35
- })),
36
- {
37
- role: ES_STICKY_ROLE.hotspot,
38
- row: {
39
- swatch: 'square',
40
- color: ES_HOTSPOT.fill,
41
- label: ES_HOTSPOT.label,
42
- },
43
- },
44
- ],
45
- },
46
- {
47
- title: ES_SEED_LEGEND_FLOW[1],
48
- titleKey: ES_SEED_LEGEND_FLOW[0],
49
- entries: [
50
- {
51
- role: ES_ROLE.flow,
52
- row: {
53
- swatch: 'line',
54
- // The style `activateEventStormingFlow` arms the connector tool
55
- // with: a solid line in the label colour.
56
- color: LABEL_COLOR,
57
- label: roleLabel(EVENT_STORMING_ROLES, ES_ROLE.flow),
58
- },
59
- },
60
- ],
61
- },
62
- ],
63
- };