@formicoidea/labre-framework-ddd-event-storming 0.25.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/descriptor.d.ts +7 -0
- package/dist/descriptor.js +7 -0
- package/dist/effects.d.ts +9 -0
- package/dist/effects.js +11 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/templates.d.ts +6 -0
- package/dist/templates.js +6 -0
- package/dist/toolbar/event-storming-menu.d.ts +9 -0
- package/dist/toolbar/event-storming-menu.js +76 -0
- package/dist/toolbar/senior-button.d.ts +6 -0
- package/dist/toolbar/senior-button.js +9 -0
- package/dist/toolbar/senior-tool.d.ts +2 -0
- package/dist/toolbar/senior-tool.js +9 -0
- package/dist/view.d.ts +13 -0
- package/dist/view.js +26 -0
- package/package.json +34 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DddEventStormingViewExtension } from './view.js';
|
|
2
|
+
/** Host wiring for the ddd-event-storming framework. */
|
|
3
|
+
export declare const dddEventStormingFramework: {
|
|
4
|
+
readonly flag: "ddd-event-storming";
|
|
5
|
+
readonly telemetry: "ddd-event-storming";
|
|
6
|
+
readonly viewExtension: typeof DddEventStormingViewExtension;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DddEventStormingViewExtension } from './view.js';
|
|
2
|
+
/** Host wiring for the ddd-event-storming framework. */
|
|
3
|
+
export const dddEventStormingFramework = {
|
|
4
|
+
flag: 'ddd-event-storming',
|
|
5
|
+
telemetry: 'ddd-event-storming',
|
|
6
|
+
viewExtension: DddEventStormingViewExtension,
|
|
7
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EdgelessDddEventStormingMenu } from './toolbar/event-storming-menu';
|
|
2
|
+
import { EdgelessDddEventStormingSeniorButton } from './toolbar/senior-button';
|
|
3
|
+
export declare function eventStormingEffects(): void;
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'edgeless-ddd-event-storming-menu': EdgelessDddEventStormingMenu;
|
|
7
|
+
'edgeless-ddd-event-storming-senior-button': EdgelessDddEventStormingSeniorButton;
|
|
8
|
+
}
|
|
9
|
+
}
|
package/dist/effects.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EdgelessDddEventStormingMenu } from './toolbar/event-storming-menu';
|
|
2
|
+
import { EdgelessDddEventStormingSeniorButton } from './toolbar/senior-button';
|
|
3
|
+
/** Define a custom element once (each tool's effect may run more than once). */
|
|
4
|
+
function define(tag, ctor) {
|
|
5
|
+
if (!customElements.get(tag))
|
|
6
|
+
customElements.define(tag, ctor);
|
|
7
|
+
}
|
|
8
|
+
export function eventStormingEffects() {
|
|
9
|
+
define('edgeless-ddd-event-storming-menu', EdgelessDddEventStormingMenu);
|
|
10
|
+
define('edgeless-ddd-event-storming-senior-button', EdgelessDddEventStormingSeniorButton);
|
|
11
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { eventStormingTemplateCategory } from './templates.js';
|
|
2
|
+
export { eventStormingSeniorTool } from './toolbar/senior-tool.js';
|
|
3
|
+
export { EdgelessDddEventStormingSeniorButton } from './toolbar/senior-button.js';
|
|
4
|
+
export { DddEventStormingViewExtension } from './view.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { eventStormingTemplateCategory } from './templates.js';
|
|
2
|
+
export { eventStormingSeniorTool } from './toolbar/senior-tool.js';
|
|
3
|
+
export { EdgelessDddEventStormingSeniorButton } from './toolbar/senior-button.js';
|
|
4
|
+
export { DddEventStormingViewExtension } from './view.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
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';
|
|
@@ -0,0 +1,6 @@
|
|
|
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';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DddMenuBase } from '@formicoidea/labre-ddd-shared';
|
|
2
|
+
/** Event Storming palette: the colour-coded stickies, the hotspot, a flow arrow. */
|
|
3
|
+
export declare class EdgelessDddEventStormingMenu extends DddMenuBase {
|
|
4
|
+
protected framework: "event-storming";
|
|
5
|
+
private _createSticky;
|
|
6
|
+
private _createHotspot;
|
|
7
|
+
private _createFlow;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { addConnector, addSticky, DddMenuBase, ES_HOTSPOT, ES_STICKIES, } from '@formicoidea/labre-ddd-shared';
|
|
2
|
+
import { html, svg } from 'lit';
|
|
3
|
+
const squareSwatch = (color) => svg `<svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="3" fill="${color}"/></svg>`;
|
|
4
|
+
const diamondSwatch = (color) => svg `<svg viewBox="0 0 24 24"><rect x="6" y="6" width="12" height="12" transform="rotate(45 12 12)" fill="${color}"/></svg>`;
|
|
5
|
+
const flowSwatch = svg `<svg 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>`;
|
|
6
|
+
/** Event Storming palette: the colour-coded stickies, the hotspot, a flow arrow. */
|
|
7
|
+
export class EdgelessDddEventStormingMenu extends DddMenuBase {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.framework = 'event-storming';
|
|
11
|
+
}
|
|
12
|
+
_createSticky(preset) {
|
|
13
|
+
const surface = this.surface;
|
|
14
|
+
if (!surface)
|
|
15
|
+
return;
|
|
16
|
+
const { cx, cy } = this.center;
|
|
17
|
+
const id = addSticky(surface, this.edgeless.std, cx, cy, {
|
|
18
|
+
fill: preset.fill,
|
|
19
|
+
text: preset.text,
|
|
20
|
+
label: preset.label,
|
|
21
|
+
});
|
|
22
|
+
this.track('FrameworkElementAdded', `sticky:${preset.kind}`);
|
|
23
|
+
this.finish(id);
|
|
24
|
+
}
|
|
25
|
+
_createHotspot() {
|
|
26
|
+
const surface = this.surface;
|
|
27
|
+
if (!surface)
|
|
28
|
+
return;
|
|
29
|
+
const { cx, cy } = this.center;
|
|
30
|
+
const id = addSticky(surface, this.edgeless.std, cx, cy, {
|
|
31
|
+
fill: ES_HOTSPOT.fill,
|
|
32
|
+
text: ES_HOTSPOT.text,
|
|
33
|
+
label: ES_HOTSPOT.label,
|
|
34
|
+
shapeType: 'diamond',
|
|
35
|
+
});
|
|
36
|
+
this.track('FrameworkElementAdded', 'sticky:hotspot');
|
|
37
|
+
this.finish(id);
|
|
38
|
+
}
|
|
39
|
+
_createFlow() {
|
|
40
|
+
const surface = this.surface;
|
|
41
|
+
if (!surface)
|
|
42
|
+
return;
|
|
43
|
+
const { cx, cy } = this.center;
|
|
44
|
+
const id = addConnector(surface, cx - 110, cy, cx + 110, cy, { rearArrow: true });
|
|
45
|
+
this.track('FrameworkElementAdded', 'flow');
|
|
46
|
+
this.finish(id);
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
return html `
|
|
50
|
+
<edgeless-slide-menu>
|
|
51
|
+
<div class="menu-content">
|
|
52
|
+
<div class="button-group-container">
|
|
53
|
+
${ES_STICKIES.map(preset => html `<edgeless-tool-icon-button
|
|
54
|
+
.tooltip=${preset.label}
|
|
55
|
+
@click=${() => this._createSticky(preset)}
|
|
56
|
+
>
|
|
57
|
+
${squareSwatch(preset.fill)}
|
|
58
|
+
</edgeless-tool-icon-button>`)}
|
|
59
|
+
<edgeless-tool-icon-button
|
|
60
|
+
.tooltip=${ES_HOTSPOT.label}
|
|
61
|
+
@click=${() => this._createHotspot()}
|
|
62
|
+
>
|
|
63
|
+
${diamondSwatch(ES_HOTSPOT.fill)}
|
|
64
|
+
</edgeless-tool-icon-button>
|
|
65
|
+
<edgeless-tool-icon-button
|
|
66
|
+
.tooltip=${'Flow'}
|
|
67
|
+
@click=${() => this._createFlow()}
|
|
68
|
+
>
|
|
69
|
+
${flowSwatch}
|
|
70
|
+
</edgeless-tool-icon-button>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</edgeless-slide-menu>
|
|
74
|
+
`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DddSeniorButtonBase } from '@formicoidea/labre-ddd-shared';
|
|
2
|
+
export declare class EdgelessDddEventStormingSeniorButton extends DddSeniorButtonBase {
|
|
3
|
+
protected menuTag: "edgeless-ddd-event-storming-menu";
|
|
4
|
+
protected label: string;
|
|
5
|
+
protected icon: import("lit-html").TemplateResult<2>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DddSeniorButtonBase, eventStormingToolbarIcon, } from '@formicoidea/labre-ddd-shared';
|
|
2
|
+
export class EdgelessDddEventStormingSeniorButton extends DddSeniorButtonBase {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(...arguments);
|
|
5
|
+
this.menuTag = 'edgeless-ddd-event-storming-menu';
|
|
6
|
+
this.label = 'Event Storming';
|
|
7
|
+
this.icon = eventStormingToolbarIcon;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SeniorToolExtension } from '@formicoidea/labre-core/widgets/edgeless-toolbar';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
/** Independent senior tool — Event Storming. */
|
|
4
|
+
export const eventStormingSeniorTool = SeniorToolExtension('ddd-event-storming', ({ block }) => ({
|
|
5
|
+
name: 'Event Storming',
|
|
6
|
+
content: html `<edgeless-ddd-event-storming-senior-button
|
|
7
|
+
.edgeless=${block}
|
|
8
|
+
></edgeless-ddd-event-storming-senior-button>`,
|
|
9
|
+
}));
|
package/dist/view.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ViewExtensionContext, ViewExtensionProvider } from '@formicoidea/labre-core/ext-loader';
|
|
2
|
+
/**
|
|
3
|
+
* Event Storming — independently flag-gated (`ddd-event-storming`).
|
|
4
|
+
*
|
|
5
|
+
* Note: its Templates-panel category is registered by the aggregate package's
|
|
6
|
+
* {@link DddTemplatesViewExtension} (gated by `ddd-templates`), so templates
|
|
7
|
+
* stay available even when this senior button is disabled.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DddEventStormingViewExtension extends ViewExtensionProvider {
|
|
10
|
+
name: string;
|
|
11
|
+
effect(): void;
|
|
12
|
+
setup(context: ViewExtensionContext): void;
|
|
13
|
+
}
|
package/dist/view.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
|
|
2
|
+
import { eventStormingEffects } from './effects';
|
|
3
|
+
import { eventStormingSeniorTool } from './toolbar/senior-tool';
|
|
4
|
+
/**
|
|
5
|
+
* Event Storming — independently flag-gated (`ddd-event-storming`).
|
|
6
|
+
*
|
|
7
|
+
* Note: its Templates-panel category is registered by the aggregate package's
|
|
8
|
+
* {@link DddTemplatesViewExtension} (gated by `ddd-templates`), so templates
|
|
9
|
+
* stay available even when this senior button is disabled.
|
|
10
|
+
*/
|
|
11
|
+
export class DddEventStormingViewExtension extends ViewExtensionProvider {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.name = 'affine-ddd-event-storming-gfx';
|
|
15
|
+
}
|
|
16
|
+
effect() {
|
|
17
|
+
super.effect();
|
|
18
|
+
eventStormingEffects();
|
|
19
|
+
}
|
|
20
|
+
setup(context) {
|
|
21
|
+
super.setup(context);
|
|
22
|
+
if (this.isEdgeless(context.scope)) {
|
|
23
|
+
context.register(eventStormingSeniorTool);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@formicoidea/labre-framework-ddd-event-storming",
|
|
3
|
+
"description": "Labre ddd-event-storming framework for @formicoidea/labre-core.",
|
|
4
|
+
"version": "0.25.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"author": "lajola",
|
|
8
|
+
"contributors": [
|
|
9
|
+
"toeverything"
|
|
10
|
+
],
|
|
11
|
+
"license": "MPL-2.0",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./view": {
|
|
18
|
+
"types": "./dist/view.d.ts",
|
|
19
|
+
"import": "./dist/view.js"
|
|
20
|
+
},
|
|
21
|
+
"./descriptor": {
|
|
22
|
+
"types": "./dist/descriptor.d.ts",
|
|
23
|
+
"import": "./dist/descriptor.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@formicoidea/labre-core": "0.25.0",
|
|
31
|
+
"@formicoidea/labre-ddd-shared": "0.25.0",
|
|
32
|
+
"lit": "^3.2.0"
|
|
33
|
+
}
|
|
34
|
+
}
|