@formicoidea/labre-framework-ddd-context-map 0.35.0 → 0.37.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/dist/commands.js CHANGED
@@ -29,6 +29,7 @@ const SPECS = [
29
29
  // A NEW telemetry value, and the only one in this file: every other entry
30
30
  // below keeps the `element` string it has emitted since ADR 0008.
31
31
  element: 'board',
32
+ board: true,
32
33
  icon: boardSwatch,
33
34
  run: std => createContextMapBoard(std.get(GfxControllerIdentifier)),
34
35
  },
@@ -79,6 +80,10 @@ export const contextMapCommands = SPECS.map((spec, order) => ({
79
80
  defaultKeys: { mac: [], other: [] },
80
81
  availability: 'always',
81
82
  run: spec.run,
82
- telemetry: { framework: 'ddd-context-map', element: spec.element },
83
+ telemetry: {
84
+ framework: 'ddd-context-map',
85
+ element: spec.element,
86
+ board: spec.board,
87
+ },
83
88
  }));
84
89
  export const contextMapCommandIcons = Object.fromEntries(SPECS.map(spec => [spec.iconKey, spec.icon]));
package/dist/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export { contextMapTemplateCategory } from './templates.js';
9
9
  export { contextMapSeniorTool } from './toolbar/senior-tool.js';
10
10
  export { EdgelessDddContextMapSeniorButton } from './toolbar/senior-button.js';
11
11
  export { DddContextMapRenderViewExtension, DddContextMapViewExtension, } from './view.js';
12
+ export { CONTEXT_MAP_READING } from './reading.js';
package/dist/index.js CHANGED
@@ -9,3 +9,4 @@ export { contextMapTemplateCategory } from './templates.js';
9
9
  export { contextMapSeniorTool } from './toolbar/senior-tool.js';
10
10
  export { EdgelessDddContextMapSeniorButton } from './toolbar/senior-button.js';
11
11
  export { DddContextMapRenderViewExtension, DddContextMapViewExtension, } from './view.js';
12
+ export { CONTEXT_MAP_READING } from './reading.js';
@@ -0,0 +1,36 @@
1
+ import type { ReadingProfile } from '@formicoidea/labre-core/blocks/surface';
2
+ /**
3
+ * What a Context Map lets the tool read of a bounded context (MF3, the reversed
4
+ * 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 context mapping. 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 map is tooling, so a
12
+ * board whose flag is off keeps every element it has and simply stops being read
13
+ * (ADR 0009).
14
+ *
15
+ * ## One subject, and the board is not it
16
+ *
17
+ * `context-map:context` is the only artefact this notation places; the board is
18
+ * the FRAME and specialises nothing, exactly so that what is written about the
19
+ * contexts never falls on the card they sit on.
20
+ *
21
+ * ## The nine patterns are read through their parent
22
+ *
23
+ * `appliesTo` on the relation is `context-map:relationship`, and the nine DDD
24
+ * Crew patterns specialise it — so `roleIsA` reaches every one of them without
25
+ * this file naming a single pattern. The four SYMMETRIC ones (Partnership,
26
+ * Shared Kernel, Separate Ways, Big Ball of Mud) declare no `direction`, and the
27
+ * panel still lists them under whichever side the drawing put them on: that is
28
+ * not a claim about upstream and downstream, it is where the link happens to
29
+ * start. The asymmetry is the notation's, and `roles.ts` is where it is argued.
30
+ *
31
+ * ## No nature, no phase
32
+ *
33
+ * The framework ships no type-3 tag pack, and the board declares no zones a
34
+ * position could be read against.
35
+ */
36
+ export declare const CONTEXT_MAP_READING: ReadingProfile;
@@ -0,0 +1,57 @@
1
+ import { CONTEXT_MAP_ROLE, CONTEXT_MAP_ROLES } from './roles.js';
2
+ /**
3
+ * What a Context Map lets the tool read of a bounded context (MF3, the reversed
4
+ * 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 context mapping. 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 map is tooling, so a
12
+ * board whose flag is off keeps every element it has and simply stops being read
13
+ * (ADR 0009).
14
+ *
15
+ * ## One subject, and the board is not it
16
+ *
17
+ * `context-map:context` is the only artefact this notation places; the board is
18
+ * the FRAME and specialises nothing, exactly so that what is written about the
19
+ * contexts never falls on the card they sit on.
20
+ *
21
+ * ## The nine patterns are read through their parent
22
+ *
23
+ * `appliesTo` on the relation is `context-map:relationship`, and the nine DDD
24
+ * Crew patterns specialise it — so `roleIsA` reaches every one of them without
25
+ * this file naming a single pattern. The four SYMMETRIC ones (Partnership,
26
+ * Shared Kernel, Separate Ways, Big Ball of Mud) declare no `direction`, and the
27
+ * panel still lists them under whichever side the drawing put them on: that is
28
+ * not a claim about upstream and downstream, it is where the link happens to
29
+ * start. The asymmetry is the notation's, and `roles.ts` is where it is argued.
30
+ *
31
+ * ## No nature, no phase
32
+ *
33
+ * The framework ships no type-3 tag pack, and the board declares no zones a
34
+ * position could be read against.
35
+ */
36
+ export const CONTEXT_MAP_READING = {
37
+ id: 'context-map',
38
+ framework: 'ddd-context-map',
39
+ roles: CONTEXT_MAP_ROLES,
40
+ appliesTo: CONTEXT_MAP_ROLE.context,
41
+ relation: {
42
+ edgeRole: CONTEXT_MAP_ROLE.relationship,
43
+ // The DDD Crew wording, verbatim, and the direction `roles.ts` declares:
44
+ // the SOURCE is the upstream context. So an edge leaving the subject names
45
+ // what is downstream of it, and one arriving names what it is downstream of.
46
+ sides: {
47
+ consumer: {
48
+ labelKey: 'com.labre.ddd-context-map.reading.relations.consumer',
49
+ labelFallback: 'Upstream',
50
+ },
51
+ supplier: {
52
+ labelKey: 'com.labre.ddd-context-map.reading.relations.supplier',
53
+ labelFallback: 'Downstream',
54
+ },
55
+ },
56
+ },
57
+ };
@@ -3,6 +3,7 @@ import { CONTEXT_MAP_BACKGROUND } from './background.js';
3
3
  import { contextMapCommands } from './commands.js';
4
4
  import { CONTEXT_MAP_NUDGES } from './nudges.js';
5
5
  import { CONTEXT_MAP_PROFILES } from './profiles.js';
6
+ import { CONTEXT_MAP_READING } from './reading.js';
6
7
  import { CONTEXT_MAP_ROLES } from './roles.js';
7
8
  import { CONTEXT_MAP_RULES } from './rules.js';
8
9
  /**
@@ -23,4 +24,9 @@ export const contextMapTranslationEntries = mergeTranslationEntries(commandTrans
23
24
  // registry names no framework category in the bundled distribution, so a
24
25
  // host that composed core's manifest alone drew translated entries under
25
26
  // English headers (#183).
26
- commandCategoryTranslationEntries(contextMapCommands), collectTranslationKeys('role', CONTEXT_MAP_ROLES), collectTranslationKeys('background', CONTEXT_MAP_BACKGROUND), collectTranslationKeys('rule', CONTEXT_MAP_RULES), collectTranslationKeys('nudge', CONTEXT_MAP_NUDGES), collectTranslationKeys('profile', CONTEXT_MAP_PROFILES));
27
+ commandCategoryTranslationEntries(contextMapCommands), collectTranslationKeys('role', CONTEXT_MAP_ROLES), collectTranslationKeys('background', CONTEXT_MAP_BACKGROUND), collectTranslationKeys('rule', CONTEXT_MAP_RULES), collectTranslationKeys('nudge', CONTEXT_MAP_NUDGES), collectTranslationKeys('profile', CONTEXT_MAP_PROFILES),
28
+ // LAST, and the order is load-bearing: a reading profile carries the
29
+ // framework's own `roles`, so walking it reaches every role key the `role`
30
+ // line above already named. `mergeTranslationEntries` keeps the FIRST
31
+ // occurrence, which is what makes each key report the source it comes from.
32
+ collectTranslationKeys('reading', CONTEXT_MAP_READING));
package/dist/view.js CHANGED
@@ -1,4 +1,4 @@
1
- import { QualityNudgeExtension, validationToolbarConfig, ValidationProfileExtension, ValidationRuleExtension, } from '@formicoidea/labre-core/blocks/surface';
1
+ import { 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 } from '@formicoidea/labre-core/shared/services';
4
4
  import { BlockFlavourIdentifier, CommandExtension } from '@formicoidea/labre-core/std';
@@ -9,6 +9,7 @@ import { ContextMapRendererExtension } from './element-renderer.js';
9
9
  import { ContextMapInteraction, ContextMapView } from './element-view.js';
10
10
  import { CONTEXT_MAP_NUDGES } from './nudges.js';
11
11
  import { CONTEXT_MAP_PROFILES } from './profiles.js';
12
+ import { CONTEXT_MAP_READING } from './reading.js';
12
13
  import { CONTEXT_MAP_ROLES } from './roles.js';
13
14
  import { CONTEXT_MAP_RULES } from './rules.js';
14
15
  import { contextMapBoardToolbarExtension } from './toolbar/board-config.js';
@@ -80,6 +81,12 @@ export class DddContextMapViewExtension extends ViewExtensionProvider {
80
81
  id: BlockFlavourIdentifier('custom:affine:surface:contextMap'),
81
82
  config: validationToolbarConfig,
82
83
  }));
84
+ // The reversed reading (MF3): what the map says about a bounded context,
85
+ // on demand. One declaration — the roles and the relationship edge, both
86
+ // already stated elsewhere in this framework. The CLICK that triggers it
87
+ // is registered once by the surface and gated by the presence of this
88
+ // profile, so it goes with the flag without either side naming the other.
89
+ context.register(ReadingProfileExtension(CONTEXT_MAP_READING));
83
90
  context.register(contextMapSeniorTool);
84
91
  context.register(CommandExtension(contextMapCommands, contextMapCommandIcons));
85
92
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-framework-ddd-context-map",
3
3
  "description": "Labre ddd-context-map framework for @formicoidea/labre-core.",
4
- "version": "0.35.0",
4
+ "version": "0.37.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.35.0",
35
- "@formicoidea/labre-ddd-shared": "0.35.0",
34
+ "@formicoidea/labre-core": "0.37.0",
35
+ "@formicoidea/labre-ddd-shared": "0.37.0",
36
36
  "lit": "^3.2.0"
37
37
  }
38
38
  }