@formicoidea/labre-framework-ddd-event-storming 0.39.3 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { ES_STICKIES, FONT_FAMILY } from '@formicoidea/labre-ddd-shared';
2
+ import { NOTATION_NEUTRALS } from '@formicoidea/labre-core/shared/consts';
2
3
  import { ES_ROLE } from './roles.js';
3
4
  /**
4
5
  * The Event Storming board, DECLARED (the `FrameworkBackgroundDef` primitive).
@@ -33,9 +34,12 @@ import { ES_ROLE } from './roles.js';
33
34
  * own colours" the answer is already written down, in one place, beside the
34
35
  * card it belongs to.
35
36
  */
36
- /** Ink for the frame itself: the axis line and the word beside it. */
37
- const AXIS_COLOR = '#6d6e71';
38
- const CARD_BORDER = '#d5d9e0';
37
+ /**
38
+ * Ink for the frame itself: the axis line and the word beside it. The card, its
39
+ * border and this ink are the shared notation scale's, painted at render time.
40
+ */
41
+ const AXIS_COLOR = NOTATION_NEUTRALS.frameInk;
42
+ const CARD_BORDER = NOTATION_NEUTRALS.cardBorder;
39
43
  /**
40
44
  * The one word this board writes on itself, and it is written BIG: 64 units
41
45
  * (PO recette, 26/08/2026).
@@ -81,7 +85,7 @@ export const EVENT_STORMING_BACKGROUND = {
81
85
  chrome: {
82
86
  fontFamily: FONT_FAMILY,
83
87
  palette: {
84
- card: '#ffffff',
88
+ card: NOTATION_NEUTRALS.cardFill,
85
89
  cardBorder: CARD_BORDER,
86
90
  axis: AXIS_COLOR,
87
91
  ...STICKY_PALETTE,
package/dist/commands.js CHANGED
@@ -1,4 +1,6 @@
1
- import { addSticky, ES_HOTSPOT, ES_STICKIES, placeDddElement, STICKY_SIZE, } from '@formicoidea/labre-ddd-shared';
1
+ import { addSticky, esStickySeedKey, ES_HOTSPOT, ES_STICKIES, placeDddElement, STICKY_SIZE, } from '@formicoidea/labre-ddd-shared';
2
+ import { NOTATION_NEUTRALS } from '@formicoidea/labre-core/shared/consts';
3
+ import { translateKey } from '@formicoidea/labre-core/shared/services';
2
4
  import { GfxControllerIdentifier } from '@formicoidea/labre-core/std/gfx';
3
5
  import { svg } from 'lit';
4
6
  import { activateEventStormingFlow, createEventStormingBoard } from './actions.js';
@@ -16,7 +18,7 @@ import { ES_STICKY_ROLE } from './roles.js';
16
18
  const squareSwatch = (color) => svg `<svg width="24" height="24" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="3" fill="${color}"/></svg>`;
17
19
  const diamondSwatch = (color) => svg `<svg width="24" height="24" viewBox="0 0 24 24"><rect x="6" y="6" width="12" height="12" transform="rotate(45 12 12)" fill="${color}"/></svg>`;
18
20
  const flowSwatch = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M4 12 H18" stroke="currentColor" stroke-width="2"/><path d="M16 8 L20 12 L16 16" stroke="currentColor" stroke-width="2" fill="none"/></svg>`;
19
- const boardSwatch = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><rect x="2.5" y="4" width="19" height="16" rx="2" fill="#ffffff" stroke="currentColor" stroke-width="1.6"/><rect x="5" y="7.5" width="4" height="4" rx="1" fill="#F5963B"/><rect x="10.5" y="7.5" width="4" height="4" rx="1" fill="#5BA3DB"/><rect x="16" y="7.5" width="4" height="4" rx="1" fill="#FAF2C9" stroke="#c9bd7f" stroke-width="0.6"/><path d="M4.5 16.5 H19.5" stroke="currentColor" stroke-width="1.2"/><path d="M17.5 14.8 L19.8 16.5 L17.5 18.2" stroke="currentColor" stroke-width="1.2"/></svg>`;
21
+ const boardSwatch = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><rect x="2.5" y="4" width="19" height="16" rx="2" fill="${NOTATION_NEUTRALS.cardFill}" stroke="currentColor" stroke-width="1.6"/><rect x="5" y="7.5" width="4" height="4" rx="1" fill="#F5963B"/><rect x="10.5" y="7.5" width="4" height="4" rx="1" fill="#5BA3DB"/><rect x="16" y="7.5" width="4" height="4" rx="1" fill="#FAF2C9" stroke="#c9bd7f" stroke-width="0.6"/><path d="M4.5 16.5 H19.5" stroke="currentColor" stroke-width="1.2"/><path d="M17.5 14.8 L19.8 16.5 L17.5 18.2" stroke="currentColor" stroke-width="1.2"/></svg>`;
20
22
  /**
21
23
  * The aggregate is created BIG — 160 against the standard 120.
22
24
  *
@@ -48,7 +50,10 @@ const SPECS = [
48
50
  run: std => placeDddElement(std, (surface, cx, cy) => addSticky(surface, std, cx, cy, {
49
51
  fill: preset.fill,
50
52
  text: preset.text,
51
- label: preset.label,
53
+ // Translated HERE and once: the caption is document content the
54
+ // moment it lands (ADR 0016), so the host's catalogue is asked at
55
+ // placement and never again.
56
+ label: translateKey(std, esStickySeedKey(preset.kind), preset.label),
52
57
  size: preset.kind === 'aggregate' ? AGGREGATE_SIZE : STICKY_SIZE,
53
58
  // The role is what makes a sticky a domain EVENT rather than an
54
59
  // orange square: every rule in `rules.ts` reads it, and a sticky
@@ -66,7 +71,8 @@ const SPECS = [
66
71
  run: std => placeDddElement(std, (surface, cx, cy) => addSticky(surface, std, cx, cy, {
67
72
  fill: ES_HOTSPOT.fill,
68
73
  text: ES_HOTSPOT.text,
69
- label: ES_HOTSPOT.label,
74
+ // Translated HERE and once, like every sticky above (ADR 0016).
75
+ label: translateKey(std, esStickySeedKey('hotspot'), ES_HOTSPOT.label),
70
76
  shapeType: 'diamond',
71
77
  // Typed like the rest, and cited by no grammar triplet on purpose —
72
78
  // an arc onto a hotspot is a question being parked. See `rules.ts`.
package/dist/legend.js CHANGED
@@ -1,5 +1,7 @@
1
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';
2
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';
3
5
  /**
4
6
  * What the Event Storming board's automatic legend can say — a TABLE, and
5
7
  * nothing else: the scan, the placement and the box are `createAutoLegend`'s
@@ -15,11 +17,13 @@ import { ES_ROLE, ES_STICKY_ROLE, EVENT_STORMING_ROLES } from './roles.js';
15
17
  * its own preset (a diamond, not a square) rather than in the table.
16
18
  */
17
19
  export const EVENT_STORMING_AUTO_LEGEND = {
18
- title: 'Legend',
20
+ title: BOARD_LEGEND_TITLE[1],
21
+ titleKey: BOARD_LEGEND_TITLE[0],
19
22
  roles: EVENT_STORMING_ROLES,
20
23
  sections: [
21
24
  {
22
- title: 'Stickies',
25
+ title: ES_SEED_LEGEND_STICKIES[1],
26
+ titleKey: ES_SEED_LEGEND_STICKIES[0],
23
27
  entries: [
24
28
  ...ES_STICKIES.map(preset => ({
25
29
  role: ES_STICKY_ROLE[preset.kind],
@@ -40,7 +44,8 @@ export const EVENT_STORMING_AUTO_LEGEND = {
40
44
  ],
41
45
  },
42
46
  {
43
- title: 'Flow',
47
+ title: ES_SEED_LEGEND_FLOW[1],
48
+ titleKey: ES_SEED_LEGEND_FLOW[0],
44
49
  entries: [
45
50
  {
46
51
  role: ES_ROLE.flow,
package/dist/templates.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ES_HOTSPOT, ES_STICKIES } from '@formicoidea/labre-ddd-shared';
2
2
  import { templateFromCommand, } from '@formicoidea/labre-core/gfx/template';
3
+ import { NOTATION_NEUTRALS } from '@formicoidea/labre-core/shared/consts';
3
4
  import { eventStormingCommands } from './commands.js';
4
5
  /**
5
6
  * The Event Storming palette — DERIVED from the toolbox, one template per
@@ -27,11 +28,16 @@ const ATTRS = 'width="100%" height="100%" viewBox="0 0 135 80" xmlns="http://www
27
28
  const sq = (c) => `<svg ${ATTRS}><rect x="38" y="13" width="60" height="54" rx="5" fill="${c}"/></svg>`;
28
29
  const dia = (c) => `<svg ${ATTRS}><rect x="48" y="20" width="40" height="40" transform="rotate(45 68 40)" fill="${c}"/></svg>`;
29
30
  /** The roll, in miniature: a white card, a few stickies, and the one axis. */
30
- const BOARD_PREVIEW = `<svg ${ATTRS} fill="none"><rect x="4" y="6" width="127" height="68" rx="6" fill="#ffffff" stroke="#d5d9e0" stroke-width="1.5"/><rect x="14" y="18" width="18" height="18" rx="3" fill="${ES_STICKIES[0].fill}"/><rect x="38" y="18" width="18" height="18" rx="3" fill="${ES_STICKIES[1].fill}"/><rect x="62" y="18" width="18" height="18" rx="3" fill="${ES_STICKIES[2].fill}"/><rect x="86" y="18" width="18" height="18" rx="3" fill="${ES_STICKIES[3].fill}"/><path d="M12 58 H114" stroke="#6d6e71" stroke-width="3"/><path d="M112 53 L122 58 L112 63 Z" fill="#6d6e71"/></svg>`;
31
+ const BOARD_PREVIEW = `<svg ${ATTRS} fill="none"><rect x="4" y="6" width="127" height="68" rx="6" fill="${NOTATION_NEUTRALS.cardFill}" stroke="${NOTATION_NEUTRALS.cardBorder}" stroke-width="1.5"/><rect x="14" y="18" width="18" height="18" rx="3" fill="${ES_STICKIES[0].fill}"/><rect x="38" y="18" width="18" height="18" rx="3" fill="${ES_STICKIES[1].fill}"/><rect x="62" y="18" width="18" height="18" rx="3" fill="${ES_STICKIES[2].fill}"/><rect x="86" y="18" width="18" height="18" rx="3" fill="${ES_STICKIES[3].fill}"/><path d="M12 58 H114" stroke="${NOTATION_NEUTRALS.frameInk}" stroke-width="3"/><path d="M112 53 L122 58 L112 63 Z" fill="${NOTATION_NEUTRALS.frameInk}"/></svg>`;
31
32
  export const eventStormingTemplateCategory = {
32
33
  name: 'Event Storming',
34
+ // Reuses the senior button's own key — see `TemplateCategory.nameKey`.
35
+ nameKey: 'com.labre.framework.ddd-event-storming',
33
36
  templates: [
34
- templateFromCommand(byLabel('Event Storming board'), BOARD_PREVIEW, 'Event Storming board'),
37
+ // No name override: it would only restate the command's own
38
+ // `labelFallback` as a second literal the panel could not translate — see
39
+ // `resolveTemplateName`, which reads the command's `labelKey` instead.
40
+ templateFromCommand(byLabel('Event Storming board'), BOARD_PREVIEW),
35
41
  ...ES_STICKIES.map(preset => templateFromCommand(byLabel(preset.label), sq(preset.fill), `Event Storming — ${preset.label}`)),
36
42
  templateFromCommand(byLabel(ES_HOTSPOT.label), dia(ES_HOTSPOT.fill), `Event Storming — ${ES_HOTSPOT.label}`),
37
43
  ],
@@ -1,4 +1,14 @@
1
+ import type { ChromeWording } from '@formicoidea/labre-core/shared/services';
1
2
  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;
2
12
  /**
3
13
  * THIS framework's contribution to the translation-key manifest — every
4
14
  * `com.labre.*` key Event Storming can hand to `TranslationProvider.t`,
@@ -1,3 +1,4 @@
1
+ import { dddSharedTranslationEntries } from '@formicoidea/labre-ddd-shared';
1
2
  import { collectTranslationKeys, commandCategoryTranslationEntries, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
2
3
  import { EVENT_STORMING_BACKGROUND } from './background.js';
3
4
  import { eventStormingCommands } from './commands.js';
@@ -6,6 +7,21 @@ import { EVENT_STORMING_PROFILES } from './profiles.js';
6
7
  import { EVENT_STORMING_READING } from './reading.js';
7
8
  import { EVENT_STORMING_ROLES } from './roles.js';
8
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
+ ];
9
25
  /**
10
26
  * THIS framework's contribution to the translation-key manifest — every
11
27
  * `com.labre.*` key Event Storming can hand to `TranslationProvider.t`,
@@ -31,4 +47,13 @@ commandCategoryTranslationEntries(eventStormingCommands), collectTranslationKeys
31
47
  // framework's own `roles`, so walking it reaches every role key the `role`
32
48
  // line above already named. `mergeTranslationEntries` keeps the FIRST
33
49
  // occurrence, which is what makes each key report the source it comes from.
34
- collectTranslationKeys('reading', EVENT_STORMING_READING));
50
+ collectTranslationKeys('reading', EVENT_STORMING_READING),
51
+ // The seeds baked into a placed sticky (`commands.ts`), derived from the
52
+ // shared palette in `ddd-shared` rather than restated — spread whole
53
+ // rather than imported from a sibling DDD framework (never allowed), and
54
+ // de-duplicated with whatever this framework already listed.
55
+ dddSharedTranslationEntries, [ES_SEED_LEGEND_STICKIES, ES_SEED_LEGEND_FLOW].map(([key, fallback]) => ({
56
+ key,
57
+ fallback,
58
+ source: 'seed',
59
+ })));
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.39.3",
4
+ "version": "0.41.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.39.3",
35
- "@formicoidea/labre-ddd-shared": "0.39.3",
34
+ "@formicoidea/labre-core": "0.41.0",
35
+ "@formicoidea/labre-ddd-shared": "0.41.0",
36
36
  "lit": "^3.2.0"
37
37
  }
38
38
  }