@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.
Files changed (52) hide show
  1. package/dist/actions.d.ts +213 -0
  2. package/dist/actions.js +467 -0
  3. package/dist/background.d.ts +2 -0
  4. package/dist/background.js +158 -0
  5. package/dist/commands.d.ts +4 -0
  6. package/dist/commands.js +567 -0
  7. package/dist/consts.d.ts +157 -3
  8. package/dist/consts.js +192 -3
  9. package/dist/descriptor.d.ts +8 -3
  10. package/dist/descriptor.js +6 -3
  11. package/dist/element-renderer.d.ts +10 -4
  12. package/dist/element-renderer.js +14 -55
  13. package/dist/element-view.d.ts +100 -8
  14. package/dist/element-view.js +249 -30
  15. package/dist/export.d.ts +277 -0
  16. package/dist/export.js +1802 -0
  17. package/dist/facts.d.ts +48 -0
  18. package/dist/facts.js +127 -0
  19. package/dist/import.d.ts +44 -0
  20. package/dist/import.js +1440 -0
  21. package/dist/index.d.ts +14 -1
  22. package/dist/index.js +46 -1
  23. package/dist/interchange.d.ts +109 -0
  24. package/dist/interchange.js +191 -0
  25. package/dist/morph.d.ts +61 -0
  26. package/dist/morph.js +118 -0
  27. package/dist/node/node-renderer.d.ts +0 -9
  28. package/dist/node/node-renderer.js +294 -17
  29. package/dist/pool-hit.d.ts +98 -0
  30. package/dist/pool-hit.js +130 -0
  31. package/dist/presets.d.ts +114 -0
  32. package/dist/presets.js +232 -0
  33. package/dist/profiles.d.ts +2 -0
  34. package/dist/profiles.js +189 -0
  35. package/dist/roles.d.ts +96 -0
  36. package/dist/roles.js +410 -0
  37. package/dist/rules.d.ts +199 -0
  38. package/dist/rules.js +1539 -0
  39. package/dist/templates/index.js +116 -9
  40. package/dist/toolbar/bpmn-menu.d.ts +6 -21
  41. package/dist/toolbar/bpmn-menu.js +6 -173
  42. package/dist/toolbar/bpmn-senior-button.js +8 -2
  43. package/dist/toolbar/config.d.ts +27 -2
  44. package/dist/toolbar/config.js +86 -2
  45. package/dist/toolbar/icons.d.ts +67 -0
  46. package/dist/toolbar/icons.js +141 -0
  47. package/dist/toolbar/senior-tool.js +1 -0
  48. package/dist/translations.d.ts +16 -0
  49. package/dist/translations.js +20 -0
  50. package/dist/view.d.ts +18 -0
  51. package/dist/view.js +95 -7
  52. package/package.json +2 -2
@@ -0,0 +1,158 @@
1
+ import { POOL_BAND_FILL, POOL_BAND_WIDTH, POOL_CARD_FILL, POOL_CORNER_RADIUS, POOL_FONT_FAMILY, POOL_FRAME_COLOR, POOL_FRAME_WIDTH, POOL_LANE_BAND_WIDTH, POOL_LANE_NAME_FONT_SIZE, POOL_NAME_COLOR, POOL_NAME_FONT_SIZE, POOL_REF_HEIGHT, POOL_REF_WIDTH, } from './consts.js';
2
+ import { BPMN_ROLE } from './roles.js';
3
+ /**
4
+ * The BPMN pool, DECLARED (the `FrameworkBackgroundDef` primitive).
5
+ *
6
+ * This file is the whole of what makes a pool look like a pool. There is no
7
+ * BPMN drawing code left: the primitive paints this declaration, and would
8
+ * paint any other framework's the same way — what used to be ninety lines of
9
+ * `ctx.fillRect` / `ctx.arcTo` / `ctx.rotate` is now data a reviewer can read.
10
+ *
11
+ * Nothing here changes the DOCUMENT. The persisted element type is still
12
+ * `bpmnPool` and its props are untouched — `name`, `resizeEnabled`, `rotate`,
13
+ * `xywh` — they are simply named by the declaration instead of being read by
14
+ * hand-written drawing code. A pool authored before this file existed opens
15
+ * with the same frame, the same band and the same participant name.
16
+ *
17
+ * ## No frame of reference
18
+ *
19
+ * A pool declares no axis and no zone, and that is deliberate: a pool is a
20
+ * PARTICIPANT, not a chart. Nothing about where a task sits inside the lane
21
+ * means anything — left-to-right is the sequence flow's business, and the flow
22
+ * says so with an arrow. Declaring a time axis here would invent a semantic
23
+ * BPMN puts on the connectors, and then judge people against it.
24
+ *
25
+ * ## The band
26
+ *
27
+ * The left margin IS the name band: `margin.left` is both the room the flow
28
+ * area gives up and the width of the strip the participant name is written in
29
+ * (see `BackgroundSideBandDef`).
30
+ *
31
+ * ## The lanes
32
+ *
33
+ * A lane (couloir) is NOT a second element type, and it is not a band either:
34
+ * it is a slice of THIS pool's plot, so it is declared as an instance partition
35
+ * (`BackgroundInstanceZonesDef`) read off the pool's own `lanes` prop. How many
36
+ * there are, what they are called and how the height is shared between them is
37
+ * a property of this pool; that a pool CAN be sliced that way is the property
38
+ * of BPMN declared here.
39
+ *
40
+ * Which is also why the lanes are not zones: a `zones` entry is part of the
41
+ * framework and identical on every element of it, and no two pools have the
42
+ * same lanes.
43
+ *
44
+ * Each lane wears its own title band inside the pool's — a narrower strip, no
45
+ * fill, one divider, the name turned on its side, exactly as BPMN 2.0 draws it.
46
+ * The strip is CHROME inside the lane and not a smaller lane: a task dropped on
47
+ * a lane's title band is in that lane, because in BPMN the band belongs to it.
48
+ */
49
+ /** The colour code: every colour named once, never repeated as a hex. */
50
+ const PALETTE = {
51
+ card: POOL_CARD_FILL,
52
+ frame: POOL_FRAME_COLOR,
53
+ band: POOL_BAND_FILL,
54
+ name: POOL_NAME_COLOR,
55
+ };
56
+ export const BPMN_POOL_BACKGROUND = {
57
+ type: 'bpmnPool',
58
+ // The pool is a first-class role: rules frame against `bpmn:pool`, never
59
+ // against the `bpmnPool` element type. Same vocabulary the creation site
60
+ // stamps (`actions.ts`) and the templates ship, named once in `roles.ts`.
61
+ role: BPMN_ROLE.pool,
62
+ geometry: {
63
+ width: POOL_REF_WIDTH,
64
+ height: POOL_REF_HEIGHT,
65
+ // A lane is stretched in one direction all the time — long and thin as the
66
+ // process grows sideways, tall only when it has to hold more. Locking the
67
+ // proportion would fight the hand on every drag.
68
+ lockAspectRatio: false,
69
+ resizable: true,
70
+ margin: { top: 0, right: 0, bottom: 0, left: POOL_BAND_WIDTH },
71
+ },
72
+ instanceZones: {
73
+ prop: 'lanes',
74
+ // Horizontal bands, top to bottom in array order: a lane runs ALONG the
75
+ // flow, and the flow runs left to right.
76
+ stack: 'y',
77
+ // A namespace, so a lane the user calls `early` can never shadow a
78
+ // framework zone of that name. A pool declares no zones today; the
79
+ // separation is what makes that stay true if it ever does.
80
+ idPrefix: 'lane',
81
+ // The same stroke as the band divider — the two lines meet at the band's
82
+ // inner edge, and a lane separator that did not match would read as a
83
+ // different KIND of line rather than the same frame continued.
84
+ divider: { color: '@frame', width: POOL_FRAME_WIDTH },
85
+ label: {
86
+ // The BAND placement: a title strip at the lane's leading edge with the
87
+ // name turned on its side, which is how BPMN 2.0 draws a lane and how
88
+ // bpmn.io, Camunda and Visio all render one. The corner placement this
89
+ // used to declare put the name across the lane's top-left instead; the
90
+ // PO's visual recette (2026-08-26) settled it against the corner on
91
+ // notation rather than taste — a reader who knows BPMN reads a strip as a
92
+ // lane title and a floating corner word as a note.
93
+ //
94
+ // No fill: the strip is the participant band's subordinate, and a second
95
+ // grey gutter beside it would leave the flow area looking inset twice.
96
+ band: {
97
+ width: POOL_LANE_BAND_WIDTH,
98
+ // The frame's own line again, as the band divider is: every rule on a
99
+ // pool is the same stroke, so the lanes read as the frame continued.
100
+ divider: { color: '@frame', width: POOL_FRAME_WIDTH },
101
+ },
102
+ style: {
103
+ size: POOL_LANE_NAME_FONT_SIZE,
104
+ color: '@name',
105
+ weight: 600,
106
+ },
107
+ },
108
+ },
109
+ chrome: {
110
+ fontFamily: POOL_FONT_FAMILY,
111
+ palette: PALETTE,
112
+ // An opaque white card, like every other framework background (PO recette,
113
+ // 26/08/2026). The hand-written renderer left the pool transparent, on the
114
+ // reasoning that a lane is a frame you drop nodes INTO; the review settled
115
+ // it the other way, and settled it on identity: a pool is a map background,
116
+ // so it paints a card, and a board where one framework's backdrop is
117
+ // see-through and every other one is not reads as a bug.
118
+ //
119
+ // The consequence is the standard framework-background behaviour, not a
120
+ // pool quirk: dropping a pool over strokes already on the canvas covers
121
+ // them, exactly as dropping a Wardley map over them does. The user's answer
122
+ // is the same in both cases — send the background to the back.
123
+ surface: {
124
+ fill: '@card',
125
+ border: {
126
+ color: '@frame',
127
+ width: POOL_FRAME_WIDTH,
128
+ radius: POOL_CORNER_RADIUS,
129
+ },
130
+ },
131
+ sideBands: [
132
+ {
133
+ side: 'left',
134
+ fill: '@band',
135
+ divider: { color: '@frame', width: POOL_FRAME_WIDTH },
136
+ label: {
137
+ id: 'name',
138
+ // The user's own words, and only those: a participant is named by
139
+ // whoever draws the process, so there is no vocabulary to fall back
140
+ // to and no `labelKey` to declare.
141
+ prop: 'name',
142
+ // `x: 0` is the inner edge of the band; half a band width back from
143
+ // it is the middle of the strip.
144
+ anchor: { x: 0, y: 0.5, dx: -POOL_BAND_WIDTH / 2 },
145
+ style: {
146
+ size: POOL_NAME_FONT_SIZE,
147
+ weight: 600,
148
+ color: '@name',
149
+ // Centred ACROSS the band, not sitting on a baseline inside it.
150
+ baseline: 'middle',
151
+ },
152
+ // Read bottom-to-top, as the spec draws a vertical pool name.
153
+ vertical: true,
154
+ },
155
+ },
156
+ ],
157
+ },
158
+ };
@@ -0,0 +1,4 @@
1
+ import type { CommandDescriptor } from '@formicoidea/labre-core/std';
2
+ import type { TemplateResult } from 'lit';
3
+ export declare const bpmnCommands: CommandDescriptor[];
4
+ export declare const bpmnCommandIcons: Record<string, TemplateResult>;