@formicoidea/labre-framework-ddd-event-storming 0.36.0 → 0.38.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/index.d.ts CHANGED
@@ -10,3 +10,4 @@ export { eventStormingTemplateCategory } from './templates.js';
10
10
  export { eventStormingSeniorTool } from './toolbar/senior-tool.js';
11
11
  export { EdgelessDddEventStormingSeniorButton } from './toolbar/senior-button.js';
12
12
  export { DddEventStormingRenderViewExtension, DddEventStormingViewExtension, } from './view.js';
13
+ export { EVENT_STORMING_READING } from './reading.js';
package/dist/index.js CHANGED
@@ -13,3 +13,4 @@ export { eventStormingTemplateCategory } from './templates.js';
13
13
  export { eventStormingSeniorTool } from './toolbar/senior-tool.js';
14
14
  export { EdgelessDddEventStormingSeniorButton } from './toolbar/senior-button.js';
15
15
  export { DddEventStormingRenderViewExtension, DddEventStormingViewExtension, } from './view.js';
16
+ export { EVENT_STORMING_READING } from './reading.js';
@@ -0,0 +1,33 @@
1
+ import type { ReadingProfile } from '@formicoidea/labre-core/blocks/surface';
2
+ /**
3
+ * What an Event Storming board lets the tool read of a sticky (MF3, the
4
+ * reversed reading).
5
+ *
6
+ * DATA, like the rules and the profiles beside it: the engine
7
+ * (`@labre/affine-block-surface`) knows how to read a role and a typed edge — it
8
+ * knows nothing about Event Storming. Everything below is already stated in
9
+ * `roles.ts` and is merely POINTED AT here.
10
+ *
11
+ * Registered from the FLAG-GATED view extension: reading a board is tooling, so
12
+ * a roll whose flag is off keeps every sticky it has and simply stops being read
13
+ * (ADR 0009).
14
+ *
15
+ * ## One subject, nine kinds
16
+ *
17
+ * `es:sticky` is the parent of all nine, so one profile reads them all and the
18
+ * panel's type line says which ("Domain event › Sticky"). The board is the
19
+ * FRAME and specialises nothing, exactly so that what is written about the
20
+ * stickies never falls on the roll they are stuck to.
21
+ *
22
+ * The two kinds outside the grammar — the hotspot and the constraint — are read
23
+ * like the other seven, and deliberately: being outside `es.forbidden-arc`'s
24
+ * alphabet means no rule judges them, not that nobody may ask what they are.
25
+ *
26
+ * ## No nature, no phase
27
+ *
28
+ * The framework ships no type-3 tag pack: the nine kinds ARE the roles. And the
29
+ * roll's timeline is a direction the FLOW states, not a set of declared zones a
30
+ * position could be read against — `es.against-timeline` reads the edge, and so
31
+ * does the section below.
32
+ */
33
+ export declare const EVENT_STORMING_READING: ReadingProfile;
@@ -0,0 +1,54 @@
1
+ import { ES_ROLE, EVENT_STORMING_ROLES } from './roles.js';
2
+ /**
3
+ * What an Event Storming board lets the tool read of a sticky (MF3, the
4
+ * reversed reading).
5
+ *
6
+ * DATA, like the rules and the profiles beside it: the engine
7
+ * (`@labre/affine-block-surface`) knows how to read a role and a typed edge — it
8
+ * knows nothing about Event Storming. Everything below is already stated in
9
+ * `roles.ts` and is merely POINTED AT here.
10
+ *
11
+ * Registered from the FLAG-GATED view extension: reading a board is tooling, so
12
+ * a roll whose flag is off keeps every sticky it has and simply stops being read
13
+ * (ADR 0009).
14
+ *
15
+ * ## One subject, nine kinds
16
+ *
17
+ * `es:sticky` is the parent of all nine, so one profile reads them all and the
18
+ * panel's type line says which ("Domain event › Sticky"). The board is the
19
+ * FRAME and specialises nothing, exactly so that what is written about the
20
+ * stickies never falls on the roll they are stuck to.
21
+ *
22
+ * The two kinds outside the grammar — the hotspot and the constraint — are read
23
+ * like the other seven, and deliberately: being outside `es.forbidden-arc`'s
24
+ * alphabet means no rule judges them, not that nobody may ask what they are.
25
+ *
26
+ * ## No nature, no phase
27
+ *
28
+ * The framework ships no type-3 tag pack: the nine kinds ARE the roles. And the
29
+ * roll's timeline is a direction the FLOW states, not a set of declared zones a
30
+ * position could be read against — `es.against-timeline` reads the edge, and so
31
+ * does the section below.
32
+ */
33
+ export const EVENT_STORMING_READING = {
34
+ id: 'event-storming',
35
+ framework: 'ddd-event-storming',
36
+ roles: EVENT_STORMING_ROLES,
37
+ appliesTo: ES_ROLE.sticky,
38
+ relation: {
39
+ edgeRole: ES_ROLE.flow,
40
+ // ADR 0010 tier 2 on this role: the verb is "leads to", so the SOURCE is
41
+ // what happens FIRST. An edge leaving the subject names what follows it,
42
+ // one arriving names what it follows.
43
+ sides: {
44
+ consumer: {
45
+ labelKey: 'com.labre.event-storming.reading.relations.consumer',
46
+ labelFallback: 'Follows',
47
+ },
48
+ supplier: {
49
+ labelKey: 'com.labre.event-storming.reading.relations.supplier',
50
+ labelFallback: 'Leads to',
51
+ },
52
+ },
53
+ },
54
+ };
@@ -1,6 +1,2 @@
1
- /**
2
- * Event Storming Templates-panel category. The builder lives in the shared
3
- * package so the aggregate package can register all DDD categories under the
4
- * single `ddd-templates` flag; re-exported here for a stable per-package API.
5
- */
6
- export { eventStormingTemplateCategory } from '@formicoidea/labre-ddd-shared';
1
+ import { type TemplateCategory } from '@formicoidea/labre-core/gfx/template';
2
+ export declare const eventStormingTemplateCategory: TemplateCategory;
package/dist/templates.js CHANGED
@@ -1,6 +1,38 @@
1
+ import { ES_HOTSPOT, ES_STICKIES } from '@formicoidea/labre-ddd-shared';
2
+ import { templateFromCommand, } from '@formicoidea/labre-core/gfx/template';
3
+ import { eventStormingCommands } from './commands.js';
1
4
  /**
2
- * Event Storming Templates-panel category. The builder lives in the shared
3
- * package so the aggregate package can register all DDD categories under the
4
- * single `ddd-templates` flag; re-exported here for a stable per-package API.
5
+ * The Event Storming palette — DERIVED from the toolbox, one template per
6
+ * placement command.
7
+ *
8
+ * It used to be hand-written surface JSON in `ddd-shared`, untouched since
9
+ * 2026-06-21 while the toolbox kept moving: a sticky was one flat rect instead
10
+ * of the shadow + face the prefab groups, it carried neither
11
+ * `textFitMode: Contained` nor the `es:*` role every rule reads, and there was
12
+ * no board template at all. Derived, none of that can happen again — and
13
+ * `__tests__/templates-parity.unit.spec.ts` re-runs each command and compares.
14
+ *
15
+ * The Flow entry has no template on purpose: it arms the connector tool and
16
+ * draws nothing (`docs/adr/0010`) — the user draws the arc.
5
17
  */
6
- export { eventStormingTemplateCategory } from '@formicoidea/labre-ddd-shared';
18
+ /** The command a derived template is the picture of. Throws rather than skips. */
19
+ function byLabel(label) {
20
+ const command = eventStormingCommands.find(entry => entry.labelFallback === label);
21
+ if (!command) {
22
+ throw new Error(`[ddd-event-storming] templates: no command "${label}"`);
23
+ }
24
+ return command;
25
+ }
26
+ const ATTRS = 'width="100%" height="100%" viewBox="0 0 135 80" xmlns="http://www.w3.org/2000/svg"';
27
+ const sq = (c) => `<svg ${ATTRS}><rect x="38" y="13" width="60" height="54" rx="5" fill="${c}"/></svg>`;
28
+ const dia = (c) => `<svg ${ATTRS}><rect x="48" y="20" width="40" height="40" transform="rotate(45 68 40)" fill="${c}"/></svg>`;
29
+ /** 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
+ export const eventStormingTemplateCategory = {
32
+ name: 'Event Storming',
33
+ templates: [
34
+ templateFromCommand(byLabel('Event Storming board'), BOARD_PREVIEW, 'Event Storming board'),
35
+ ...ES_STICKIES.map(preset => templateFromCommand(byLabel(preset.label), sq(preset.fill), `Event Storming — ${preset.label}`)),
36
+ templateFromCommand(byLabel(ES_HOTSPOT.label), dia(ES_HOTSPOT.fill), `Event Storming — ${ES_HOTSPOT.label}`),
37
+ ],
38
+ };
@@ -3,6 +3,7 @@ import { EVENT_STORMING_BACKGROUND } from './background.js';
3
3
  import { eventStormingCommands } from './commands.js';
4
4
  import { EVENT_STORMING_NUDGES } from './nudges.js';
5
5
  import { EVENT_STORMING_PROFILES } from './profiles.js';
6
+ import { EVENT_STORMING_READING } from './reading.js';
6
7
  import { EVENT_STORMING_ROLES } from './roles.js';
7
8
  import { EVENT_STORMING_RULES } from './rules.js';
8
9
  /**
@@ -25,4 +26,9 @@ export const eventStormingTranslationEntries = mergeTranslationEntries(commandTr
25
26
  // registry names no framework category in the bundled distribution, so a
26
27
  // host that composed core's manifest alone drew translated entries under
27
28
  // English headers (#183).
28
- commandCategoryTranslationEntries(eventStormingCommands), collectTranslationKeys('role', EVENT_STORMING_ROLES), collectTranslationKeys('background', EVENT_STORMING_BACKGROUND), collectTranslationKeys('rule', EVENT_STORMING_RULES), collectTranslationKeys('nudge', EVENT_STORMING_NUDGES), collectTranslationKeys('profile', EVENT_STORMING_PROFILES));
29
+ commandCategoryTranslationEntries(eventStormingCommands), collectTranslationKeys('role', EVENT_STORMING_ROLES), collectTranslationKeys('background', EVENT_STORMING_BACKGROUND), collectTranslationKeys('rule', EVENT_STORMING_RULES), collectTranslationKeys('nudge', EVENT_STORMING_NUDGES), collectTranslationKeys('profile', EVENT_STORMING_PROFILES),
30
+ // LAST, and the order is load-bearing: a reading profile carries the
31
+ // framework's own `roles`, so walking it reaches every role key the `role`
32
+ // line above already named. `mergeTranslationEntries` keeps the FIRST
33
+ // occurrence, which is what makes each key report the source it comes from.
34
+ collectTranslationKeys('reading', EVENT_STORMING_READING));
package/dist/view.d.ts CHANGED
@@ -19,8 +19,7 @@ export declare class DddEventStormingRenderViewExtension extends ViewExtensionPr
19
19
  * until the flag comes back.
20
20
  *
21
21
  * Note: its Templates-panel category is registered by the aggregate package's
22
- * {@link DddTemplatesViewExtension} (gated by `ddd-templates`), so templates
23
- * stay available even when this senior button is disabled.
22
+ * The Templates-panel category is registered here too (see `effect`).
24
23
  */
25
24
  export declare class DddEventStormingViewExtension extends ViewExtensionProvider {
26
25
  name: string;
package/dist/view.js CHANGED
@@ -1,15 +1,18 @@
1
- import { morphToolbarConfig, QualityNudgeExtension, validationToolbarConfig, ValidationProfileExtension, ValidationRuleExtension, } from '@formicoidea/labre-core/blocks/surface';
1
+ import { morphToolbarConfig, QualityNudgeExtension, ReadingProfileExtension, validationToolbarConfig, ValidationProfileExtension, ValidationRuleExtension, } from '@formicoidea/labre-core/blocks/surface';
2
2
  import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
3
3
  import { ToolbarModuleExtension, toolbarModuleKey, } from '@formicoidea/labre-core/shared/services';
4
+ import { extendTemplateCategory } from '@formicoidea/labre-core/gfx/template';
4
5
  import { BlockFlavourIdentifier, CommandExtension } from '@formicoidea/labre-core/std';
5
6
  import { RoleVocabularyExtension } from '@formicoidea/labre-core/std/gfx';
6
7
  import { eventStormingCommandIcons, eventStormingCommands } from './commands.js';
8
+ import { eventStormingTemplateCategory } from './templates.js';
7
9
  import { eventStormingEffects } from './effects.js';
8
10
  import { EventStormingRendererExtension } from './element-renderer.js';
9
11
  import { EventStormingInteraction, EventStormingView } from './element-view.js';
10
12
  import { EVENT_STORMING_MORPH_SPEC } from './morph.js';
11
13
  import { EVENT_STORMING_NUDGES } from './nudges.js';
12
14
  import { EVENT_STORMING_PROFILES } from './profiles.js';
15
+ import { EVENT_STORMING_READING } from './reading.js';
13
16
  import { EVENT_STORMING_ROLES } from './roles.js';
14
17
  import { EVENT_STORMING_RULES } from './rules.js';
15
18
  import { eventStormingBoardToolbarExtension } from './toolbar/board-config.js';
@@ -52,8 +55,7 @@ export class DddEventStormingRenderViewExtension extends ViewExtensionProvider {
52
55
  * until the flag comes back.
53
56
  *
54
57
  * Note: its Templates-panel category is registered by the aggregate package's
55
- * {@link DddTemplatesViewExtension} (gated by `ddd-templates`), so templates
56
- * stay available even when this senior button is disabled.
58
+ * The Templates-panel category is registered here too (see `effect`).
57
59
  */
58
60
  export class DddEventStormingViewExtension extends ViewExtensionProvider {
59
61
  constructor() {
@@ -63,6 +65,10 @@ export class DddEventStormingViewExtension extends ViewExtensionProvider {
63
65
  effect() {
64
66
  super.effect();
65
67
  eventStormingEffects();
68
+ // The Templates-panel category, gated by this framework's own flag like
69
+ // every other framework's: a template is tooling (`docs/adr/0009`), and it
70
+ // is DERIVED from this package's commands, so it registers where they do.
71
+ extendTemplateCategory(eventStormingTemplateCategory);
66
72
  }
67
73
  setup(context) {
68
74
  super.setup(context);
@@ -81,6 +87,12 @@ export class DddEventStormingViewExtension extends ViewExtensionProvider {
81
87
  id: BlockFlavourIdentifier('custom:affine:surface:eventStorming'),
82
88
  config: validationToolbarConfig,
83
89
  }));
90
+ // The reversed reading (MF3): what the board says about a sticky, on
91
+ // demand. One declaration — the roles and the flow edge, both already
92
+ // stated elsewhere in this framework. The CLICK that triggers it is
93
+ // registered once by the surface and gated by the presence of this
94
+ // profile, so it goes with the flag without either side naming the other.
95
+ context.register(ReadingProfileExtension(EVENT_STORMING_READING));
84
96
  context.register(eventStormingSeniorTool);
85
97
  context.register(CommandExtension(eventStormingCommands, eventStormingCommandIcons));
86
98
  // The "Change type" dropdown on a selected STICKY's contextual toolbar —
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.36.0",
4
+ "version": "0.38.1",
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.36.0",
35
- "@formicoidea/labre-ddd-shared": "0.36.0",
34
+ "@formicoidea/labre-core": "0.38.1",
35
+ "@formicoidea/labre-ddd-shared": "0.38.1",
36
36
  "lit": "^3.2.0"
37
37
  }
38
38
  }