@formicoidea/labre-framework-bpmn 0.31.0 → 0.33.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/actions.d.ts +213 -0
- package/dist/actions.js +467 -0
- package/dist/background.d.ts +2 -0
- package/dist/background.js +158 -0
- package/dist/commands.d.ts +4 -0
- package/dist/commands.js +567 -0
- package/dist/consts.d.ts +157 -3
- package/dist/consts.js +192 -3
- package/dist/descriptor.d.ts +8 -3
- package/dist/descriptor.js +6 -3
- package/dist/element-renderer.d.ts +10 -4
- package/dist/element-renderer.js +14 -55
- package/dist/element-view.d.ts +100 -8
- package/dist/element-view.js +249 -30
- package/dist/export.d.ts +277 -0
- package/dist/export.js +1802 -0
- package/dist/facts.d.ts +48 -0
- package/dist/facts.js +127 -0
- package/dist/import.d.ts +44 -0
- package/dist/import.js +1440 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +46 -1
- package/dist/interchange.d.ts +109 -0
- package/dist/interchange.js +191 -0
- package/dist/morph.d.ts +61 -0
- package/dist/morph.js +118 -0
- package/dist/node/node-renderer.d.ts +0 -9
- package/dist/node/node-renderer.js +294 -17
- package/dist/pool-hit.d.ts +98 -0
- package/dist/pool-hit.js +130 -0
- package/dist/presets.d.ts +114 -0
- package/dist/presets.js +232 -0
- package/dist/profiles.d.ts +2 -0
- package/dist/profiles.js +189 -0
- package/dist/roles.d.ts +96 -0
- package/dist/roles.js +410 -0
- package/dist/rules.d.ts +199 -0
- package/dist/rules.js +1539 -0
- package/dist/templates/index.js +116 -9
- package/dist/toolbar/bpmn-menu.d.ts +6 -21
- package/dist/toolbar/bpmn-menu.js +6 -173
- package/dist/toolbar/bpmn-senior-button.js +8 -2
- package/dist/toolbar/config.d.ts +27 -2
- package/dist/toolbar/config.js +86 -2
- package/dist/toolbar/icons.d.ts +67 -0
- package/dist/toolbar/icons.js +141 -0
- package/dist/toolbar/senior-tool.js +1 -0
- package/dist/translations.d.ts +16 -0
- package/dist/translations.js +20 -0
- package/dist/view.d.ts +18 -0
- package/dist/view.js +95 -7
- package/package.json +2 -2
package/dist/toolbar/icons.d.ts
CHANGED
|
@@ -1,15 +1,82 @@
|
|
|
1
1
|
/** Colored BPMN glyph for the main toolbar button: a pool (green name band) with
|
|
2
2
|
* a single activity inside. */
|
|
3
3
|
export declare const bpmnToolbarIcon: import("lit-html").TemplateResult<2>;
|
|
4
|
+
/** Export BPMN XML — a document with an arrow leaving it. */
|
|
5
|
+
export declare const bpmnExportXmlIcon: import("lit-html").TemplateResult<2>;
|
|
6
|
+
/**
|
|
7
|
+
* Import BPMN XML — the export's document, with the arrow coming back IN.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately the same page and the same arrow, mirrored: the two commands are
|
|
10
|
+
* one subject in two directions, and a reader who has met one should recognise
|
|
11
|
+
* the other without reading its label.
|
|
12
|
+
*/
|
|
13
|
+
export declare const bpmnImportXmlIcon: import("lit-html").TemplateResult<2>;
|
|
14
|
+
/**
|
|
15
|
+
* Import an SVG sketch — the import page again, with the picture frame that
|
|
16
|
+
* says "this arrives as a drawing" rather than as a process.
|
|
17
|
+
*
|
|
18
|
+
* Kept a sibling of {@link bpmnImportXmlIcon} on purpose: they are the same
|
|
19
|
+
* gesture (a file becomes a board) and the difference between them is the TIER,
|
|
20
|
+
* which is what the mountain-in-a-frame glyph is for.
|
|
21
|
+
*/
|
|
22
|
+
export declare const bpmnImportSvgIcon: import("lit-html").TemplateResult<2>;
|
|
4
23
|
/** Start event — thin green ring. */
|
|
5
24
|
export declare const bpmnStartIcon: import("lit-html").TemplateResult<2>;
|
|
6
25
|
/** End event — thick red ring. */
|
|
7
26
|
export declare const bpmnEndIcon: import("lit-html").TemplateResult<2>;
|
|
27
|
+
/** Message start event — thin green ring, envelope inside. */
|
|
28
|
+
export declare const bpmnStartMessageIcon: import("lit-html").TemplateResult<2>;
|
|
29
|
+
/** Timer start event — thin green ring, clock inside (rim + two hands). */
|
|
30
|
+
export declare const bpmnStartTimerIcon: import("lit-html").TemplateResult<2>;
|
|
31
|
+
/** Message end event — thick red ring, envelope inside. */
|
|
32
|
+
export declare const bpmnEndMessageIcon: import("lit-html").TemplateResult<2>;
|
|
33
|
+
/** Terminate end event — thick red ring, solid disc inside. */
|
|
34
|
+
export declare const bpmnEndTerminateIcon: import("lit-html").TemplateResult<2>;
|
|
8
35
|
/** Task — rounded rectangle. */
|
|
9
36
|
export declare const bpmnTaskIcon: import("lit-html").TemplateResult<2>;
|
|
37
|
+
/** User task — the rectangle with a person in its top-left corner. */
|
|
38
|
+
export declare const bpmnTaskUserIcon: import("lit-html").TemplateResult<2>;
|
|
39
|
+
/** Service task — the rectangle with a gear in its top-left corner. */
|
|
40
|
+
export declare const bpmnTaskServiceIcon: import("lit-html").TemplateResult<2>;
|
|
41
|
+
/** Sub-process — the rectangle with the collapsed [+] marker on its bottom edge. */
|
|
42
|
+
export declare const bpmnSubProcessIcon: import("lit-html").TemplateResult<2>;
|
|
43
|
+
/** Call activity — the same [+] marker, on the notation's THICKEST border. */
|
|
44
|
+
export declare const bpmnCallActivityIcon: import("lit-html").TemplateResult<2>;
|
|
10
45
|
/** Exclusive gateway — diamond with an X. */
|
|
11
46
|
export declare const bpmnGatewayIcon: import("lit-html").TemplateResult<2>;
|
|
47
|
+
/** Parallel gateway — diamond with a +. */
|
|
48
|
+
export declare const bpmnGatewayParallelIcon: import("lit-html").TemplateResult<2>;
|
|
49
|
+
/** Data object — a page with its top-right corner turned down. */
|
|
50
|
+
export declare const bpmnDataObjectIcon: import("lit-html").TemplateResult<2>;
|
|
51
|
+
/** Data store — a cylinder. */
|
|
52
|
+
export declare const bpmnDataStoreIcon: import("lit-html").TemplateResult<2>;
|
|
53
|
+
/** Text annotation — an open bracket down the leading edge, and a note beside it. */
|
|
54
|
+
export declare const bpmnTextAnnotationIcon: import("lit-html").TemplateResult<2>;
|
|
12
55
|
/** Sequence flow — solid arrow with a filled head. */
|
|
13
56
|
export declare const bpmnSequenceIcon: import("lit-html").TemplateResult<2>;
|
|
57
|
+
/** Group — a dashed, generously rounded rectangle drawn AROUND things. */
|
|
58
|
+
export declare const bpmnGroupIcon: import("lit-html").TemplateResult<2>;
|
|
59
|
+
/**
|
|
60
|
+
* Message flow — dashed line, disc at the source, open head at the target.
|
|
61
|
+
*
|
|
62
|
+
* The source terminator is drawn FILLED because that is what the canvas paints:
|
|
63
|
+
* `renderCircle` fills with the connector's `fillColor` before stroking it. The
|
|
64
|
+
* norm asks for a hollow ring, and the shared connector renderer is where that
|
|
65
|
+
* would be fixed; until then an icon promising a ring would be advertising a
|
|
66
|
+
* shape the tool does not draw.
|
|
67
|
+
*/
|
|
68
|
+
export declare const bpmnMessageIcon: import("lit-html").TemplateResult<2>;
|
|
69
|
+
/**
|
|
70
|
+
* Association — a dashed line with no head at either end.
|
|
71
|
+
*
|
|
72
|
+
* Same weight as the message flow's line, because on canvas it IS the same
|
|
73
|
+
* weight: both are `strokeWidth: 2`. A thinner icon would hint at a distinction
|
|
74
|
+
* the tool cannot draw (`ASSOCIATION_WIDTH` in `../consts.ts` says why).
|
|
75
|
+
*/
|
|
76
|
+
export declare const bpmnAssociationIcon: import("lit-html").TemplateResult<2>;
|
|
14
77
|
/** Pool — rectangle with a left name band. */
|
|
15
78
|
export declare const bpmnPoolIcon: import("lit-html").TemplateResult<2>;
|
|
79
|
+
/** Add lane — the pool, cut in two, with a plus on the new band. */
|
|
80
|
+
export declare const bpmnLaneAddIcon: import("lit-html").TemplateResult<2>;
|
|
81
|
+
/** Remove lane — the same pool, with a minus on the band that goes. */
|
|
82
|
+
export declare const bpmnLaneRemoveIcon: import("lit-html").TemplateResult<2>;
|
package/dist/toolbar/icons.js
CHANGED
|
@@ -7,6 +7,37 @@ export const bpmnToolbarIcon = svg `<svg width="100%" height="100%" viewBox="0 0
|
|
|
7
7
|
<line x1="11" y1="13" x2="11" y2="43" stroke="#262626" stroke-width="1.8"/>
|
|
8
8
|
<rect x="20" y="20" width="24" height="16" rx="3.5" fill="#ffffff" stroke="#262626" stroke-width="2.2"/>
|
|
9
9
|
</svg>`;
|
|
10
|
+
/** Export BPMN XML — a document with an arrow leaving it. */
|
|
11
|
+
export const bpmnExportXmlIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
+
<path d="M13.5 3.5H7a1.5 1.5 0 0 0-1.5 1.5v14A1.5 1.5 0 0 0 7 20.5h3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
13
|
+
<path d="M13.5 3.5 18.5 8.5V12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
14
|
+
<path d="M16 20.5v-6M13.5 18l2.5 2.5 2.5-2.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
15
|
+
</svg>`;
|
|
16
|
+
/**
|
|
17
|
+
* Import BPMN XML — the export's document, with the arrow coming back IN.
|
|
18
|
+
*
|
|
19
|
+
* Deliberately the same page and the same arrow, mirrored: the two commands are
|
|
20
|
+
* one subject in two directions, and a reader who has met one should recognise
|
|
21
|
+
* the other without reading its label.
|
|
22
|
+
*/
|
|
23
|
+
export const bpmnImportXmlIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
24
|
+
<path d="M13.5 3.5H7a1.5 1.5 0 0 0-1.5 1.5v14A1.5 1.5 0 0 0 7 20.5h3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
25
|
+
<path d="M13.5 3.5 18.5 8.5V12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
26
|
+
<path d="M16 14.5v6M13.5 17l2.5-2.5 2.5 2.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
27
|
+
</svg>`;
|
|
28
|
+
/**
|
|
29
|
+
* Import an SVG sketch — the import page again, with the picture frame that
|
|
30
|
+
* says "this arrives as a drawing" rather than as a process.
|
|
31
|
+
*
|
|
32
|
+
* Kept a sibling of {@link bpmnImportXmlIcon} on purpose: they are the same
|
|
33
|
+
* gesture (a file becomes a board) and the difference between them is the TIER,
|
|
34
|
+
* which is what the mountain-in-a-frame glyph is for.
|
|
35
|
+
*/
|
|
36
|
+
export const bpmnImportSvgIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
37
|
+
<rect x="3" y="5" width="14" height="11" rx="1.5" stroke="currentColor" stroke-width="1.5"/>
|
|
38
|
+
<path d="M3.5 13 7 9.5l3 3 2-2 3.5 3.5" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
39
|
+
<path d="M19 14.5v6M16.5 17l2.5-2.5 2.5 2.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
40
|
+
</svg>`;
|
|
10
41
|
/** Start event — thin green ring. */
|
|
11
42
|
export const bpmnStartIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
12
43
|
<circle cx="12" cy="12" r="8" stroke="#43a06b" stroke-width="2"/>
|
|
@@ -15,22 +46,132 @@ export const bpmnStartIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24
|
|
|
15
46
|
export const bpmnEndIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
16
47
|
<circle cx="12" cy="12" r="8" stroke="#cf5648" stroke-width="3.5"/>
|
|
17
48
|
</svg>`;
|
|
49
|
+
/** Message start event — thin green ring, envelope inside. */
|
|
50
|
+
export const bpmnStartMessageIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
51
|
+
<circle cx="12" cy="12" r="8" stroke="#43a06b" stroke-width="2"/>
|
|
52
|
+
<rect x="8" y="9.5" width="8" height="5.5" stroke="currentColor" stroke-width="1.1"/>
|
|
53
|
+
<path d="M8 9.5 L12 13 L16 9.5" stroke="currentColor" stroke-width="1.1" stroke-linejoin="round"/>
|
|
54
|
+
</svg>`;
|
|
55
|
+
/** Timer start event — thin green ring, clock inside (rim + two hands). */
|
|
56
|
+
export const bpmnStartTimerIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
57
|
+
<circle cx="12" cy="12" r="8" stroke="#43a06b" stroke-width="2"/>
|
|
58
|
+
<circle cx="12" cy="12" r="4.2" stroke="currentColor" stroke-width="1.1"/>
|
|
59
|
+
<path d="M12 12 V8.8 M12 12 L14.2 13.6" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/>
|
|
60
|
+
</svg>`;
|
|
61
|
+
/** Message end event — thick red ring, envelope inside. */
|
|
62
|
+
export const bpmnEndMessageIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
63
|
+
<circle cx="12" cy="12" r="8" stroke="#cf5648" stroke-width="3.5"/>
|
|
64
|
+
<rect x="8.5" y="9.8" width="7" height="4.8" stroke="currentColor" stroke-width="1.1"/>
|
|
65
|
+
<path d="M8.5 9.8 L12 12.8 L15.5 9.8" stroke="currentColor" stroke-width="1.1" stroke-linejoin="round"/>
|
|
66
|
+
</svg>`;
|
|
67
|
+
/** Terminate end event — thick red ring, solid disc inside. */
|
|
68
|
+
export const bpmnEndTerminateIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
69
|
+
<circle cx="12" cy="12" r="8" stroke="#cf5648" stroke-width="3.5"/>
|
|
70
|
+
<circle cx="12" cy="12" r="3.6" fill="currentColor"/>
|
|
71
|
+
</svg>`;
|
|
18
72
|
/** Task — rounded rectangle. */
|
|
19
73
|
export const bpmnTaskIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
20
74
|
<rect x="3.5" y="6.5" width="17" height="11" rx="2.5" stroke="currentColor" stroke-width="1.6"/>
|
|
21
75
|
</svg>`;
|
|
76
|
+
/** User task — the rectangle with a person in its top-left corner. */
|
|
77
|
+
export const bpmnTaskUserIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
78
|
+
<rect x="3.5" y="6.5" width="17" height="11" rx="2.5" stroke="currentColor" stroke-width="1.6"/>
|
|
79
|
+
<circle cx="7.4" cy="9.9" r="1.15" stroke="currentColor" stroke-width="1"/>
|
|
80
|
+
<path d="M5.7 13.3 A1.7 1.7 0 0 1 9.1 13.3" stroke="currentColor" stroke-width="1"/>
|
|
81
|
+
</svg>`;
|
|
82
|
+
/** Service task — the rectangle with a gear in its top-left corner. */
|
|
83
|
+
export const bpmnTaskServiceIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
84
|
+
<rect x="3.5" y="6.5" width="17" height="11" rx="2.5" stroke="currentColor" stroke-width="1.6"/>
|
|
85
|
+
<circle cx="7.6" cy="11" r="1.7" stroke="currentColor" stroke-width="1"/>
|
|
86
|
+
<circle cx="7.6" cy="11" r="0.5" stroke="currentColor" stroke-width="0.8"/>
|
|
87
|
+
<path d="M7.6 8.9 V9.3 M7.6 12.7 V13.1 M5.5 11 H5.9 M9.3 11 H9.7 M6.1 9.5 L6.4 9.8 M8.8 12.2 L9.1 12.5 M9.1 9.5 L8.8 9.8 M6.4 12.2 L6.1 12.5" stroke="currentColor" stroke-width="1" stroke-linecap="round"/>
|
|
88
|
+
</svg>`;
|
|
89
|
+
/** Sub-process — the rectangle with the collapsed [+] marker on its bottom edge. */
|
|
90
|
+
export const bpmnSubProcessIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
91
|
+
<rect x="3.5" y="6.5" width="17" height="11" rx="2.5" stroke="currentColor" stroke-width="1.6"/>
|
|
92
|
+
<rect x="9.6" y="12.6" width="4.8" height="4.8" stroke="currentColor" stroke-width="1.1"/>
|
|
93
|
+
<path d="M12 13.8 V16.2 M10.8 15 H13.2" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/>
|
|
94
|
+
</svg>`;
|
|
95
|
+
/** Call activity — the same [+] marker, on the notation's THICKEST border. */
|
|
96
|
+
export const bpmnCallActivityIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
97
|
+
<rect x="4" y="7" width="16" height="10" rx="2.5" stroke="currentColor" stroke-width="3"/>
|
|
98
|
+
<rect x="9.6" y="12.2" width="4.8" height="4.8" stroke="currentColor" stroke-width="1.1"/>
|
|
99
|
+
<path d="M12 13.4 V15.8 M10.8 14.6 H13.2" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/>
|
|
100
|
+
</svg>`;
|
|
22
101
|
/** Exclusive gateway — diamond with an X. */
|
|
23
102
|
export const bpmnGatewayIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
24
103
|
<path d="M12 3 L21 12 L12 21 L3 12 Z" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
|
|
25
104
|
<path d="M9 9 L15 15 M15 9 L9 15" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
|
26
105
|
</svg>`;
|
|
106
|
+
/** Parallel gateway — diamond with a +. */
|
|
107
|
+
export const bpmnGatewayParallelIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
108
|
+
<path d="M12 3 L21 12 L12 21 L3 12 Z" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
|
|
109
|
+
<path d="M12 8 V16 M8 12 H16" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
|
110
|
+
</svg>`;
|
|
111
|
+
/** Data object — a page with its top-right corner turned down. */
|
|
112
|
+
export const bpmnDataObjectIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
113
|
+
<path d="M6 3.5 H14 L18 7.5 V20.5 H6 Z" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
|
|
114
|
+
<path d="M14 3.5 V7.5 H18" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/>
|
|
115
|
+
</svg>`;
|
|
116
|
+
/** Data store — a cylinder. */
|
|
117
|
+
export const bpmnDataStoreIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
118
|
+
<path d="M4.5 7 V17 C4.5 18.4 8 19.5 12 19.5 C16 19.5 19.5 18.4 19.5 17 V7" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
|
|
119
|
+
<ellipse cx="12" cy="7" rx="7.5" ry="2.5" stroke="currentColor" stroke-width="1.6"/>
|
|
120
|
+
</svg>`;
|
|
121
|
+
/** Text annotation — an open bracket down the leading edge, and a note beside it. */
|
|
122
|
+
export const bpmnTextAnnotationIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
123
|
+
<path d="M9 5 H5.5 V19 H9" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
124
|
+
<path d="M11.5 9 H18.5 M11.5 12 H18.5 M11.5 15 H16" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
|
125
|
+
</svg>`;
|
|
27
126
|
/** Sequence flow — solid arrow with a filled head. */
|
|
28
127
|
export const bpmnSequenceIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
29
128
|
<path d="M3 12 H17" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
|
|
30
129
|
<path d="M15 8 L21 12 L15 16 Z" fill="currentColor"/>
|
|
31
130
|
</svg>`;
|
|
131
|
+
/** Group — a dashed, generously rounded rectangle drawn AROUND things. */
|
|
132
|
+
export const bpmnGroupIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
133
|
+
<rect x="3.5" y="5.5" width="17" height="13" rx="4" stroke="currentColor" stroke-width="1.6" stroke-dasharray="3.4 2.6"/>
|
|
134
|
+
</svg>`;
|
|
135
|
+
/**
|
|
136
|
+
* Message flow — dashed line, disc at the source, open head at the target.
|
|
137
|
+
*
|
|
138
|
+
* The source terminator is drawn FILLED because that is what the canvas paints:
|
|
139
|
+
* `renderCircle` fills with the connector's `fillColor` before stroking it. The
|
|
140
|
+
* norm asks for a hollow ring, and the shared connector renderer is where that
|
|
141
|
+
* would be fixed; until then an icon promising a ring would be advertising a
|
|
142
|
+
* shape the tool does not draw.
|
|
143
|
+
*/
|
|
144
|
+
export const bpmnMessageIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
145
|
+
<circle cx="4.8" cy="12" r="2.2" fill="currentColor"/>
|
|
146
|
+
<path d="M7.4 12 H17.5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-dasharray="3 2.6"/>
|
|
147
|
+
<path d="M15.6 8.6 L20 12 L15.6 15.4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
148
|
+
</svg>`;
|
|
149
|
+
/**
|
|
150
|
+
* Association — a dashed line with no head at either end.
|
|
151
|
+
*
|
|
152
|
+
* Same weight as the message flow's line, because on canvas it IS the same
|
|
153
|
+
* weight: both are `strokeWidth: 2`. A thinner icon would hint at a distinction
|
|
154
|
+
* the tool cannot draw (`ASSOCIATION_WIDTH` in `../consts.ts` says why).
|
|
155
|
+
*/
|
|
156
|
+
export const bpmnAssociationIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
157
|
+
<path d="M3.5 17 L20.5 7" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-dasharray="2.4 2.4"/>
|
|
158
|
+
</svg>`;
|
|
32
159
|
/** Pool — rectangle with a left name band. */
|
|
33
160
|
export const bpmnPoolIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
34
161
|
<rect x="3.5" y="5.5" width="17" height="13" rx="1.5" stroke="currentColor" stroke-width="1.6"/>
|
|
35
162
|
<path d="M8 5.5 V18.5" stroke="currentColor" stroke-width="1.6"/>
|
|
36
163
|
</svg>`;
|
|
164
|
+
/** Add lane — the pool, cut in two, with a plus on the new band. */
|
|
165
|
+
export const bpmnLaneAddIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
166
|
+
<rect x="3.5" y="5.5" width="17" height="13" rx="1.5" stroke="currentColor" stroke-width="1.6"/>
|
|
167
|
+
<path d="M8 5.5 V18.5" stroke="currentColor" stroke-width="1.6"/>
|
|
168
|
+
<path d="M8 12 H20.5" stroke="currentColor" stroke-width="1.6"/>
|
|
169
|
+
<path d="M14.25 13.25 V17 M12.4 15.1 H16.1" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
|
170
|
+
</svg>`;
|
|
171
|
+
/** Remove lane — the same pool, with a minus on the band that goes. */
|
|
172
|
+
export const bpmnLaneRemoveIcon = svg `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
173
|
+
<rect x="3.5" y="5.5" width="17" height="13" rx="1.5" stroke="currentColor" stroke-width="1.6"/>
|
|
174
|
+
<path d="M8 5.5 V18.5" stroke="currentColor" stroke-width="1.6"/>
|
|
175
|
+
<path d="M8 12 H20.5" stroke="currentColor" stroke-width="1.6"/>
|
|
176
|
+
<path d="M12.4 15.1 H16.1" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
|
177
|
+
</svg>`;
|
|
@@ -3,6 +3,7 @@ import { html } from 'lit';
|
|
|
3
3
|
export const bpmnSeniorTool = SeniorToolExtension('bpmn', ({ block }) => {
|
|
4
4
|
return {
|
|
5
5
|
name: 'BPMN',
|
|
6
|
+
labelKey: 'com.labre.framework.bpmn',
|
|
6
7
|
content: html `<edgeless-bpmn-senior-button
|
|
7
8
|
.edgeless=${block}
|
|
8
9
|
></edgeless-bpmn-senior-button>`,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type TranslationKeyManifestEntry } from '@formicoidea/labre-core/std';
|
|
2
|
+
/**
|
|
3
|
+
* THIS framework's contribution to the translation-key manifest — every
|
|
4
|
+
* `com.labre.*` key BPMN can hand to `TranslationProvider.t`, derived from the
|
|
5
|
+
* very declarations the editor registers (never restated).
|
|
6
|
+
*
|
|
7
|
+
* Its command labels and descriptions are built from a TEMPLATE, so the
|
|
8
|
+
* concrete keys exist nowhere but in the declarations themselves and the
|
|
9
|
+
* core manifest could not restate them even if it wanted to. The
|
|
10
|
+
* contribution therefore ships WITH the framework: in the bundled
|
|
11
|
+
* distribution `@formicoidea/labre-framework-bpmn` carries it, and a host
|
|
12
|
+
* composes it into its catalogue exactly as it already composes
|
|
13
|
+
* `bpmnCommands` into the command registry. See
|
|
14
|
+
* `packages/affine/all/src/translations.ts`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const bpmnTranslationEntries: TranslationKeyManifestEntry[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { collectTranslationKeys, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
|
|
2
|
+
import { bpmnCommands } from './commands.js';
|
|
3
|
+
import { BPMN_PROFILES } from './profiles.js';
|
|
4
|
+
import { BPMN_ROLES } from './roles.js';
|
|
5
|
+
import { BPMN_RULES } from './rules.js';
|
|
6
|
+
/**
|
|
7
|
+
* THIS framework's contribution to the translation-key manifest — every
|
|
8
|
+
* `com.labre.*` key BPMN can hand to `TranslationProvider.t`, derived from the
|
|
9
|
+
* very declarations the editor registers (never restated).
|
|
10
|
+
*
|
|
11
|
+
* Its command labels and descriptions are built from a TEMPLATE, so the
|
|
12
|
+
* concrete keys exist nowhere but in the declarations themselves and the
|
|
13
|
+
* core manifest could not restate them even if it wanted to. The
|
|
14
|
+
* contribution therefore ships WITH the framework: in the bundled
|
|
15
|
+
* distribution `@formicoidea/labre-framework-bpmn` carries it, and a host
|
|
16
|
+
* composes it into its catalogue exactly as it already composes
|
|
17
|
+
* `bpmnCommands` into the command registry. See
|
|
18
|
+
* `packages/affine/all/src/translations.ts`.
|
|
19
|
+
*/
|
|
20
|
+
export const bpmnTranslationEntries = mergeTranslationEntries(commandTranslationEntries(bpmnCommands), collectTranslationKeys('role', BPMN_ROLES), collectTranslationKeys('rule', BPMN_RULES), collectTranslationKeys('profile', BPMN_PROFILES));
|
package/dist/view.d.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { type ViewExtensionContext, ViewExtensionProvider } from '@formicoidea/labre-core/ext-loader';
|
|
2
|
+
/**
|
|
3
|
+
* BPMN rendering — ALWAYS registered, independent of any flag. Disabling `bpmn`
|
|
4
|
+
* hides only the creation tooling (see {@link BpmnViewExtension}); pools and
|
|
5
|
+
* nodes already drawn must still paint, stay selectable, stay editable and keep
|
|
6
|
+
* their contextual toolbar. See `docs/adr/0009`.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BpmnRenderViewExtension extends ViewExtensionProvider {
|
|
9
|
+
name: string;
|
|
10
|
+
setup(context: ViewExtensionContext): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* BPMN creation tooling — flag-gated (`bpmn`): the senior toolbar button, its
|
|
14
|
+
* templates category, the validation rules and profiles, and the interchange
|
|
15
|
+
* capabilities. All of it is tooling: a process drawn while the flag was on
|
|
16
|
+
* keeps rendering when it goes off, it just stops being checked — the profile
|
|
17
|
+
* its pool was put on stays written, unread, until the flag comes back, and so
|
|
18
|
+
* does anything an import wrote (`docs/adr/0009`, `docs/adr/0012`).
|
|
19
|
+
*/
|
|
2
20
|
export declare class BpmnViewExtension extends ViewExtensionProvider {
|
|
3
21
|
name: string;
|
|
4
22
|
effect(): void;
|
package/dist/view.js
CHANGED
|
@@ -1,13 +1,64 @@
|
|
|
1
|
+
import { FrameworkBackgroundInteractionExtension, InterchangeExtension, morphToolbarConfig, ValidationProfileExtension, ValidationRuleExtension, validationToolbarConfig, } from '@formicoidea/labre-core/blocks/surface';
|
|
1
2
|
import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
|
|
2
3
|
import { extendTemplateCategory } from '@formicoidea/labre-core/gfx/template';
|
|
4
|
+
import { ToolbarModuleExtension } from '@formicoidea/labre-core/shared/services';
|
|
5
|
+
import { BlockFlavourIdentifier, CommandExtension } from '@formicoidea/labre-core/std';
|
|
6
|
+
import { RoleVocabularyExtension } from '@formicoidea/labre-core/std/gfx';
|
|
7
|
+
import { BPMN_POOL_BACKGROUND } from './background.js';
|
|
8
|
+
import { bpmnCommandIcons, bpmnCommands } from './commands.js';
|
|
3
9
|
import { effects } from './effects.js';
|
|
10
|
+
import { BPMN_INTERCHANGE } from './interchange.js';
|
|
11
|
+
import { BPMN_MORPH_SPEC } from './morph.js';
|
|
12
|
+
import { BPMN_PROFILES } from './profiles.js';
|
|
13
|
+
import { BPMN_ROLES } from './roles.js';
|
|
14
|
+
import { BPMN_RULES } from './rules.js';
|
|
4
15
|
import { bpmnTemplateCategory } from './templates/index.js';
|
|
5
16
|
import { BpmnPoolRendererExtension } from './element-renderer.js';
|
|
6
|
-
import {
|
|
17
|
+
import { BpmnPoolView } from './element-view.js';
|
|
7
18
|
import { BpmnNodeRendererExtension } from './node/node-renderer.js';
|
|
8
19
|
import { BpmnNodeView } from './node/node-view.js';
|
|
9
20
|
import { bpmnPoolToolbarExtension } from './toolbar/config.js';
|
|
10
21
|
import { bpmnSeniorTool } from './toolbar/senior-tool.js';
|
|
22
|
+
/**
|
|
23
|
+
* BPMN rendering — ALWAYS registered, independent of any flag. Disabling `bpmn`
|
|
24
|
+
* hides only the creation tooling (see {@link BpmnViewExtension}); pools and
|
|
25
|
+
* nodes already drawn must still paint, stay selectable, stay editable and keep
|
|
26
|
+
* their contextual toolbar. See `docs/adr/0009`.
|
|
27
|
+
*/
|
|
28
|
+
export class BpmnRenderViewExtension extends ViewExtensionProvider {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
this.name = 'affine-bpmn-render-gfx';
|
|
32
|
+
}
|
|
33
|
+
setup(context) {
|
|
34
|
+
super.setup(context);
|
|
35
|
+
context.register(BpmnPoolView);
|
|
36
|
+
context.register(BpmnPoolRendererExtension);
|
|
37
|
+
context.register(BpmnNodeView);
|
|
38
|
+
context.register(BpmnNodeRendererExtension);
|
|
39
|
+
// The role VOCABULARY, always on. A role is written in the document, not in
|
|
40
|
+
// the tooling: the direction reveal of the sequence flow, the inversion
|
|
41
|
+
// command and the toolbar entry that must not lie about a typed edge all
|
|
42
|
+
// read this, and they have to keep working on a process drawn while the flag
|
|
43
|
+
// was on and opened while it is off (`docs/adr/0009`, `docs/adr/0010`).
|
|
44
|
+
context.register(RoleVocabularyExtension(BPMN_ROLES));
|
|
45
|
+
if (this.isEdgeless(context.scope)) {
|
|
46
|
+
// Resize gating, driven by the declaration like every other framework
|
|
47
|
+
// background: the handles stay hidden until `resizeEnabled` says
|
|
48
|
+
// otherwise, and the toolbar toggle is what writes it.
|
|
49
|
+
context.register(FrameworkBackgroundInteractionExtension(BPMN_POOL_BACKGROUND));
|
|
50
|
+
context.register(bpmnPoolToolbarExtension);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* BPMN creation tooling — flag-gated (`bpmn`): the senior toolbar button, its
|
|
56
|
+
* templates category, the validation rules and profiles, and the interchange
|
|
57
|
+
* capabilities. All of it is tooling: a process drawn while the flag was on
|
|
58
|
+
* keeps rendering when it goes off, it just stops being checked — the profile
|
|
59
|
+
* its pool was put on stays written, unread, until the flag comes back, and so
|
|
60
|
+
* does anything an import wrote (`docs/adr/0009`, `docs/adr/0012`).
|
|
61
|
+
*/
|
|
11
62
|
export class BpmnViewExtension extends ViewExtensionProvider {
|
|
12
63
|
constructor() {
|
|
13
64
|
super(...arguments);
|
|
@@ -15,19 +66,56 @@ export class BpmnViewExtension extends ViewExtensionProvider {
|
|
|
15
66
|
}
|
|
16
67
|
effect() {
|
|
17
68
|
super.effect();
|
|
69
|
+
// Defines the senior button and its menu — tooling-only custom elements.
|
|
18
70
|
effects();
|
|
19
71
|
extendTemplateCategory(bpmnTemplateCategory);
|
|
20
72
|
}
|
|
21
73
|
setup(context) {
|
|
22
74
|
super.setup(context);
|
|
23
|
-
context.register(BpmnPoolView);
|
|
24
|
-
context.register(BpmnPoolRendererExtension);
|
|
25
|
-
context.register(BpmnNodeView);
|
|
26
|
-
context.register(BpmnNodeRendererExtension);
|
|
27
75
|
if (this.isEdgeless(context.scope)) {
|
|
28
|
-
context.register(
|
|
76
|
+
context.register(ValidationRuleExtension(BPMN_RULES));
|
|
77
|
+
context.register(ValidationProfileExtension(BPMN_PROFILES));
|
|
78
|
+
// Reading and writing `.bpmn` files, declared rather than assumed
|
|
79
|
+
// (`docs/adr/0012`). Tooling like the rest of this class: with the flag
|
|
80
|
+
// off there is nothing to export WITH, while a board a past import wrote
|
|
81
|
+
// keeps every element and every byte it was given (`docs/adr/0009`).
|
|
82
|
+
context.register(InterchangeExtension(BPMN_INTERCHANGE));
|
|
83
|
+
// The Validation dropdown on a selected pool's contextual toolbar. A
|
|
84
|
+
// SECOND module on the same element, through the `custom:` flavour slot,
|
|
85
|
+
// exactly as wardley and the context map register it on theirs:
|
|
86
|
+
// `bpmnPoolToolbarExtension` is registered always-on because a stored pool
|
|
87
|
+
// must keep its lanes and its resize toggle, while choosing how hard to
|
|
88
|
+
// check the process is tooling and belongs here. The config names no
|
|
89
|
+
// framework — it reads roles and profiles — so it is the very same object
|
|
90
|
+
// the other two register.
|
|
91
|
+
context.register(ToolbarModuleExtension({
|
|
92
|
+
id: BlockFlavourIdentifier('custom:affine:surface:bpmnPool'),
|
|
93
|
+
config: validationToolbarConfig,
|
|
94
|
+
}));
|
|
95
|
+
// The "Change type" dropdown on a selected NODE's contextual toolbar —
|
|
96
|
+
// the generic module, parameterized by BPMN's own families table.
|
|
97
|
+
//
|
|
98
|
+
// `affine:surface:bpmnNode` is a FREE slot, and class inheritance has
|
|
99
|
+
// nothing to do with it: `renderToolbar` merges by flavour KEY — the
|
|
100
|
+
// element's own, its `custom:` twin and the `affine:surface:*` wildcards
|
|
101
|
+
// — so `shapeToolbarExtension`, which binds `affine:surface:shape`, never
|
|
102
|
+
// reaches a bpmn node however much of `ShapeElementModel` the class
|
|
103
|
+
// inherits. Nothing claimed this key before, so the registration is purely
|
|
104
|
+
// additive: it joins the wildcard entries (tags, validation) that a node
|
|
105
|
+
// already gets, and a second module claiming the same key would throw
|
|
106
|
+
// `DuplicateServiceDefinitionError` before the editor finished setting up.
|
|
107
|
+
//
|
|
108
|
+
// Registered HERE, in the flag-gated half, because a morph is TOOLING: a
|
|
109
|
+
// node drawn while the flag was on keeps its kind, its role, its glyph
|
|
110
|
+
// and its place in every rule when the flag goes off — it just stops
|
|
111
|
+
// being something the toolbar offers to say more precisely
|
|
112
|
+
// (`docs/adr/0009`).
|
|
113
|
+
context.register(ToolbarModuleExtension({
|
|
114
|
+
id: BlockFlavourIdentifier('affine:surface:bpmnNode'),
|
|
115
|
+
config: morphToolbarConfig(BPMN_MORPH_SPEC),
|
|
116
|
+
}));
|
|
29
117
|
context.register(bpmnSeniorTool);
|
|
30
|
-
context.register(
|
|
118
|
+
context.register(CommandExtension(bpmnCommands, bpmnCommandIcons));
|
|
31
119
|
}
|
|
32
120
|
}
|
|
33
121
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-bpmn",
|
|
3
3
|
"description": "Labre bpmn framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.33.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@formicoidea/labre-core": "0.
|
|
30
|
+
"@formicoidea/labre-core": "0.33.0",
|
|
31
31
|
"lit": "^3.2.0"
|
|
32
32
|
}
|
|
33
33
|
}
|