@formicoidea/labre-framework-ddd-core-domain 0.40.0 → 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.
- package/dist/commands.js +11 -3
- package/dist/core-domain/legend.js +10 -4
- package/dist/templates.js +6 -1
- package/dist/translations.d.ts +11 -0
- package/dist/translations.js +30 -1
- package/package.json +3 -3
package/dist/commands.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { addDot, addMarker, CD_SUBDOMAINS, MOVEMENT_COLOR, placeDddElement, TEAM_TOPOLOGIES, } from '@formicoidea/labre-ddd-shared';
|
|
1
|
+
import { addDot, addMarker, cdSubdomainSeedKey, CD_SUBDOMAINS, MOVEMENT_COLOR, placeDddElement, teamTopologySeedKey, TEAM_TOPOLOGIES, } 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
4
|
import { svg } from 'lit';
|
|
4
5
|
import { activateMovement, createCoreDomainChart } from './actions.js';
|
|
5
6
|
import { markerRole, subdomainRole } from './roles.js';
|
|
@@ -29,7 +30,11 @@ const SPECS = [
|
|
|
29
30
|
iconKey: `ddd-core-domain.subdomain.${preset.kind}`,
|
|
30
31
|
element: `subdomain:${preset.kind}`,
|
|
31
32
|
icon: dotSwatch(preset.fill),
|
|
32
|
-
run: std => placeDddElement(std, (surface, cx, cy) => addDot(surface, std, cx, cy, preset.fill,
|
|
33
|
+
run: std => placeDddElement(std, (surface, cx, cy) => addDot(surface, std, cx, cy, preset.fill,
|
|
34
|
+
// Translated HERE and once: the caption is document content the
|
|
35
|
+
// moment it lands (ADR 0016), so the host's catalogue is asked at
|
|
36
|
+
// placement and never again.
|
|
37
|
+
translateKey(std, cdSubdomainSeedKey(preset.kind), preset.label),
|
|
33
38
|
// The dot IS the sub-domain: the role rides on the ellipse, so a
|
|
34
39
|
// rule about where a sub-domain sits measures the artefact and not
|
|
35
40
|
// the group that also holds its name.
|
|
@@ -44,7 +49,10 @@ const SPECS = [
|
|
|
44
49
|
run: std => placeDddElement(std, (surface, cx, cy) => addMarker(surface, std, cx, cy, {
|
|
45
50
|
fill: preset.fill,
|
|
46
51
|
letter: preset.letter,
|
|
47
|
-
|
|
52
|
+
// Translated HERE and once: the caption is document content the
|
|
53
|
+
// moment it lands (ADR 0016), so the host's catalogue is asked at
|
|
54
|
+
// placement and never again.
|
|
55
|
+
label: translateKey(std, teamTopologySeedKey(preset.kind), preset.label),
|
|
48
56
|
// The square IS the marker, so the role rides on it and not on the
|
|
49
57
|
// group that also holds its caption — the same call as the dot.
|
|
50
58
|
// Without this the automatic legend, which detects by role and only
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { CD_SUBDOMAINS, MOVEMENT_COLOR, roleLabel, TEAM_TOPOLOGIES, } from '@formicoidea/labre-ddd-shared';
|
|
2
|
+
import { BOARD_LEGEND_TITLE } from '@formicoidea/labre-core/shared/services';
|
|
2
3
|
import { CORE_DOMAIN_ROLE, CORE_DOMAIN_ROLES } from '../roles.js';
|
|
4
|
+
import { CORE_DOMAIN_SEED_LEGEND_MOVEMENT, CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS, CORE_DOMAIN_SEED_LEGEND_TEAM_MODES, } from '../translations.js';
|
|
3
5
|
/**
|
|
4
6
|
* What the Core Domain Chart's automatic legend can say — a TABLE, and nothing
|
|
5
7
|
* else: the scan, the placement and the box are `createAutoLegend`'s job.
|
|
@@ -28,11 +30,13 @@ import { CORE_DOMAIN_ROLE, CORE_DOMAIN_ROLES } from '../roles.js';
|
|
|
28
30
|
* role.
|
|
29
31
|
*/
|
|
30
32
|
export const CORE_DOMAIN_AUTO_LEGEND = {
|
|
31
|
-
title:
|
|
33
|
+
title: BOARD_LEGEND_TITLE[1],
|
|
34
|
+
titleKey: BOARD_LEGEND_TITLE[0],
|
|
32
35
|
roles: CORE_DOMAIN_ROLES,
|
|
33
36
|
sections: [
|
|
34
37
|
{
|
|
35
|
-
title:
|
|
38
|
+
title: CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS[1],
|
|
39
|
+
titleKey: CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS[0],
|
|
36
40
|
entries: CD_SUBDOMAINS.map(preset => ({
|
|
37
41
|
role: CORE_DOMAIN_ROLE[preset.kind],
|
|
38
42
|
row: {
|
|
@@ -47,7 +51,8 @@ export const CORE_DOMAIN_AUTO_LEGEND = {
|
|
|
47
51
|
// three colours a reader has no key to — so the legend shows the same
|
|
48
52
|
// square with the same letter in it, which is what `LegendRow.letter`
|
|
49
53
|
// exists for.
|
|
50
|
-
title:
|
|
54
|
+
title: CORE_DOMAIN_SEED_LEGEND_TEAM_MODES[1],
|
|
55
|
+
titleKey: CORE_DOMAIN_SEED_LEGEND_TEAM_MODES[0],
|
|
51
56
|
entries: TEAM_TOPOLOGIES.map(preset => ({
|
|
52
57
|
role: CORE_DOMAIN_ROLE[preset.kind],
|
|
53
58
|
row: {
|
|
@@ -59,7 +64,8 @@ export const CORE_DOMAIN_AUTO_LEGEND = {
|
|
|
59
64
|
})),
|
|
60
65
|
},
|
|
61
66
|
{
|
|
62
|
-
title:
|
|
67
|
+
title: CORE_DOMAIN_SEED_LEGEND_MOVEMENT[1],
|
|
68
|
+
titleKey: CORE_DOMAIN_SEED_LEGEND_MOVEMENT[0],
|
|
63
69
|
entries: [
|
|
64
70
|
{
|
|
65
71
|
role: CORE_DOMAIN_ROLE.movement,
|
package/dist/templates.js
CHANGED
|
@@ -30,8 +30,13 @@ const mk = (c, l) => `<svg ${ATTRS}><rect x="48" y="20" width="40" height="40" r
|
|
|
30
30
|
const CHART_PREVIEW = `<svg ${ATTRS} fill="none"><rect x="10" y="6" width="115" height="62" fill="#4d9900" fill-opacity="0.5"/><rect x="10" y="6" width="22" height="62" fill="#9933ff" fill-opacity="0.5"/><path d="M10 68 V6 M10 68 H125" stroke="${NOTATION_NEUTRALS.frameInk}" stroke-width="1.6"/></svg>`;
|
|
31
31
|
export const coreDomainTemplateCategory = {
|
|
32
32
|
name: 'Core Domain Chart',
|
|
33
|
+
// Reuses the senior button's own key — see `TemplateCategory.nameKey`.
|
|
34
|
+
nameKey: 'com.labre.framework.ddd-core-domain',
|
|
33
35
|
templates: [
|
|
34
|
-
|
|
36
|
+
// No name override: it would only restate the command's own
|
|
37
|
+
// `labelFallback` as a second literal the panel could not translate — see
|
|
38
|
+
// `resolveTemplateName`, which reads the command's `labelKey` instead.
|
|
39
|
+
templateFromCommand(byLabel('Core Domain Chart'), CHART_PREVIEW),
|
|
35
40
|
...CD_SUBDOMAINS.map(preset => templateFromCommand(byLabel(preset.label), circ(preset.fill), `Core Domain — ${preset.label}`)),
|
|
36
41
|
...TEAM_TOPOLOGIES.map(preset => templateFromCommand(byLabel(preset.label), mk(preset.fill, preset.letter), `Team topology — ${preset.label}`)),
|
|
37
42
|
],
|
package/dist/translations.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
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 (`core-domain/legend.ts`) — text
|
|
5
|
+
* stamped onto the chart the moment the legend is built
|
|
6
|
+
* (`createAutoLegend`), like any other seed. The box title itself is NOT
|
|
7
|
+
* here: it says the shared word "Legend", so it reuses `BOARD_LEGEND_TITLE`
|
|
8
|
+
* (`@labre/affine-shared/services`) instead of a key of its own.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS: ChromeWording;
|
|
11
|
+
export declare const CORE_DOMAIN_SEED_LEGEND_TEAM_MODES: ChromeWording;
|
|
12
|
+
export declare const CORE_DOMAIN_SEED_LEGEND_MOVEMENT: ChromeWording;
|
|
2
13
|
/**
|
|
3
14
|
* THIS framework's contribution to the translation-key manifest — every
|
|
4
15
|
* `com.labre.*` key the Core Domain Chart can hand to `TranslationProvider.t`,
|
package/dist/translations.js
CHANGED
|
@@ -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 { coreDomainCommands } from './commands.js';
|
|
3
4
|
import { CORE_DOMAIN_BACKGROUND } from './core-domain/background.js';
|
|
@@ -6,6 +7,25 @@ import { CORE_DOMAIN_PROFILES } from './profiles.js';
|
|
|
6
7
|
import { CORE_DOMAIN_READINGS } from './reading.js';
|
|
7
8
|
import { CORE_DOMAIN_ROLES } from './roles.js';
|
|
8
9
|
import { CORE_DOMAIN_RULES } from './rules.js';
|
|
10
|
+
/**
|
|
11
|
+
* The automatic legend's own section titles (`core-domain/legend.ts`) — text
|
|
12
|
+
* stamped onto the chart the moment the legend is built
|
|
13
|
+
* (`createAutoLegend`), like any other seed. The box title itself is NOT
|
|
14
|
+
* here: it says the shared word "Legend", so it reuses `BOARD_LEGEND_TITLE`
|
|
15
|
+
* (`@labre/affine-shared/services`) instead of a key of its own.
|
|
16
|
+
*/
|
|
17
|
+
export const CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS = [
|
|
18
|
+
'com.labre.ddd-core-domain.seed.legend-subdomains',
|
|
19
|
+
'Sub-domains',
|
|
20
|
+
];
|
|
21
|
+
export const CORE_DOMAIN_SEED_LEGEND_TEAM_MODES = [
|
|
22
|
+
'com.labre.ddd-core-domain.seed.legend-team-modes',
|
|
23
|
+
'Team interaction modes',
|
|
24
|
+
];
|
|
25
|
+
export const CORE_DOMAIN_SEED_LEGEND_MOVEMENT = [
|
|
26
|
+
'com.labre.ddd-core-domain.seed.legend-movement',
|
|
27
|
+
'Movement',
|
|
28
|
+
];
|
|
9
29
|
/**
|
|
10
30
|
* THIS framework's contribution to the translation-key manifest — every
|
|
11
31
|
* `com.labre.*` key the Core Domain Chart can hand to `TranslationProvider.t`,
|
|
@@ -29,4 +49,13 @@ commandCategoryTranslationEntries(coreDomainCommands), collectTranslationKeys('r
|
|
|
29
49
|
// framework's own `roles`, so walking it reaches every role key the `role`
|
|
30
50
|
// line above already named. `mergeTranslationEntries` keeps the FIRST
|
|
31
51
|
// occurrence, which is what makes each key report the source it comes from.
|
|
32
|
-
collectTranslationKeys('reading', CORE_DOMAIN_READINGS)
|
|
52
|
+
collectTranslationKeys('reading', CORE_DOMAIN_READINGS),
|
|
53
|
+
// The seeds baked into a placed dot / marker (`commands.ts`), derived from
|
|
54
|
+
// the shared tables in `ddd-shared` rather than restated — spread whole
|
|
55
|
+
// rather than imported from a sibling DDD framework (never allowed), and
|
|
56
|
+
// de-duplicated with whatever this framework already listed.
|
|
57
|
+
dddSharedTranslationEntries, [
|
|
58
|
+
CORE_DOMAIN_SEED_LEGEND_SUBDOMAINS,
|
|
59
|
+
CORE_DOMAIN_SEED_LEGEND_TEAM_MODES,
|
|
60
|
+
CORE_DOMAIN_SEED_LEGEND_MOVEMENT,
|
|
61
|
+
].map(([key, fallback]) => ({ key, fallback, source: 'seed' })));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-ddd-core-domain",
|
|
3
3
|
"description": "Labre ddd-core-domain framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
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.
|
|
35
|
-
"@formicoidea/labre-ddd-shared": "0.
|
|
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
|
}
|