@formicoidea/labre-framework-ddd-core-domain 0.37.0 → 0.38.2
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/templates.d.ts +2 -6
- package/dist/templates.js +35 -4
- package/dist/view.d.ts +1 -2
- package/dist/view.js +7 -2
- package/package.json +3 -3
package/dist/templates.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { coreDomainTemplateCategory } from '@formicoidea/labre-ddd-shared';
|
|
1
|
+
import { type TemplateCategory } from '@formicoidea/labre-core/gfx/template';
|
|
2
|
+
export declare const coreDomainTemplateCategory: TemplateCategory;
|
package/dist/templates.js
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
|
+
import { CD_SUBDOMAINS, TEAM_TOPOLOGIES } from '@formicoidea/labre-ddd-shared';
|
|
2
|
+
import { templateFromCommand, } from '@formicoidea/labre-core/gfx/template';
|
|
3
|
+
import { coreDomainCommands } from './commands.js';
|
|
1
4
|
/**
|
|
2
|
-
* Core Domain Chart
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
+
* The Core Domain Chart 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: the chart background had lost `role: core-domain:chart` (so the
|
|
10
|
+
* validation engine never saw a templated chart as a chart at all), the dots
|
|
11
|
+
* were bare ellipses with neither role, name nor group, and the markers were a
|
|
12
|
+
* single square instead of the square + glyph + caption the prefab groups.
|
|
13
|
+
* Derived, none of that can happen again.
|
|
14
|
+
*
|
|
15
|
+
* "Movement over time" has no template on purpose: it arms the connector tool
|
|
16
|
+
* and draws nothing (`docs/adr/0010`) — the movement is a pair the user draws.
|
|
5
17
|
*/
|
|
6
|
-
|
|
18
|
+
/** The command a derived template is the picture of. Throws rather than skips. */
|
|
19
|
+
function byLabel(label) {
|
|
20
|
+
const command = coreDomainCommands.find(entry => entry.labelFallback === label);
|
|
21
|
+
if (!command) {
|
|
22
|
+
throw new Error(`[ddd-core-domain] 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 circ = (c) => `<svg ${ATTRS}><circle cx="68" cy="40" r="22" fill="${c}" stroke="#1f2328" stroke-width="1.5"/></svg>`;
|
|
28
|
+
const mk = (c, l) => `<svg ${ATTRS}><rect x="48" y="20" width="40" height="40" rx="5" fill="${c}" stroke="#1f2328" stroke-width="1.5"/><text x="68" y="47" text-anchor="middle" font-size="20" fill="#1f2328">${l}</text></svg>`;
|
|
29
|
+
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="#1f2328" stroke-width="1.6"/></svg>`;
|
|
30
|
+
export const coreDomainTemplateCategory = {
|
|
31
|
+
name: 'Core Domain Chart',
|
|
32
|
+
templates: [
|
|
33
|
+
templateFromCommand(byLabel('Core Domain Chart'), CHART_PREVIEW, 'Core Domain Chart'),
|
|
34
|
+
...CD_SUBDOMAINS.map(preset => templateFromCommand(byLabel(preset.label), circ(preset.fill), `Core Domain — ${preset.label}`)),
|
|
35
|
+
...TEAM_TOPOLOGIES.map(preset => templateFromCommand(byLabel(preset.label), mk(preset.fill, preset.letter), `Team topology — ${preset.label}`)),
|
|
36
|
+
],
|
|
37
|
+
};
|
package/dist/view.d.ts
CHANGED
|
@@ -16,8 +16,7 @@ export declare class DddCoreDomainRenderViewExtension extends ViewExtensionProvi
|
|
|
16
16
|
* work-quality checklist.
|
|
17
17
|
*
|
|
18
18
|
* Note: its Templates-panel category is registered by the aggregate package's
|
|
19
|
-
*
|
|
20
|
-
* stay available even when this senior button is disabled.
|
|
19
|
+
* The Templates-panel category is registered here too (see `effect`).
|
|
21
20
|
*/
|
|
22
21
|
export declare class DddCoreDomainViewExtension extends ViewExtensionProvider {
|
|
23
22
|
name: string;
|
package/dist/view.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
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 { coreDomainCommandIcons, coreDomainCommands } from './commands.js';
|
|
8
|
+
import { coreDomainTemplateCategory } from './templates.js';
|
|
7
9
|
import { CoreDomainRendererExtension } from './core-domain/element-renderer.js';
|
|
8
10
|
import { CoreDomainInteraction, CoreDomainView, } from './core-domain/element-view.js';
|
|
9
11
|
import { coreDomainToolbarExtension } from './core-domain/toolbar-config.js';
|
|
@@ -50,8 +52,7 @@ export class DddCoreDomainRenderViewExtension extends ViewExtensionProvider {
|
|
|
50
52
|
* work-quality checklist.
|
|
51
53
|
*
|
|
52
54
|
* Note: its Templates-panel category is registered by the aggregate package's
|
|
53
|
-
*
|
|
54
|
-
* stay available even when this senior button is disabled.
|
|
55
|
+
* The Templates-panel category is registered here too (see `effect`).
|
|
55
56
|
*/
|
|
56
57
|
export class DddCoreDomainViewExtension extends ViewExtensionProvider {
|
|
57
58
|
constructor() {
|
|
@@ -61,6 +62,10 @@ export class DddCoreDomainViewExtension extends ViewExtensionProvider {
|
|
|
61
62
|
effect() {
|
|
62
63
|
super.effect();
|
|
63
64
|
coreDomainEffects();
|
|
65
|
+
// The Templates-panel category, gated by this framework's own flag like
|
|
66
|
+
// every other framework's: a template is tooling (`docs/adr/0009`), and it
|
|
67
|
+
// is DERIVED from this package's commands, so it registers where they do.
|
|
68
|
+
extendTemplateCategory(coreDomainTemplateCategory);
|
|
64
69
|
}
|
|
65
70
|
setup(context) {
|
|
66
71
|
super.setup(context);
|
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.38.2",
|
|
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.38.2",
|
|
35
|
+
"@formicoidea/labre-ddd-shared": "0.38.2",
|
|
36
36
|
"lit": "^3.2.0"
|
|
37
37
|
}
|
|
38
38
|
}
|