@formicoidea/labre-framework-bpmn 0.43.1 → 0.45.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/view.js CHANGED
@@ -2,14 +2,14 @@ import { FrameworkBackgroundInteractionExtension, InterchangeExtension, morphToo
2
2
  import { FrameworkPaletteExtension } from '@formicoidea/labre-core/components/color-picker';
3
3
  import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
4
4
  import { TemplateCategoryExtension } from '@formicoidea/labre-core/gfx/template';
5
- import { ToolbarModuleExtension } from '@formicoidea/labre-core/shared/services';
5
+ import { ToolbarModuleExtension, toolbarModuleKey, } from '@formicoidea/labre-core/shared/services';
6
6
  import { BlockFlavourIdentifier, CommandExtension } from '@formicoidea/labre-core/std';
7
7
  import { RoleVocabularyExtension } from '@formicoidea/labre-core/std/gfx';
8
8
  import { BPMN_POOL_BACKGROUND } from './background.js';
9
9
  import { bpmnCommandIcons, bpmnCommands } from './commands.js';
10
10
  import { effects } from './effects.js';
11
11
  import { BPMN_INTERCHANGE } from './interchange.js';
12
- import { BPMN_MORPH_SPEC } from './morph.js';
12
+ import { BPMN_GROUP_MORPH_SPEC, BPMN_MORPH_SPEC } from './morph.js';
13
13
  import { BPMN_PROFILES } from './profiles.js';
14
14
  import { BPMN_READINGS } from './reading.js';
15
15
  import { BPMN_ROLES } from './roles.js';
@@ -20,6 +20,7 @@ import { BpmnPoolView } from './element-view.js';
20
20
  import { BpmnNodeRendererExtension } from './node/node-renderer.js';
21
21
  import { BpmnNodeView } from './node/node-view.js';
22
22
  import { bpmnPoolToolbarExtension, bpmnPoolToolingToolbarExtension, } from './toolbar/config.js';
23
+ import { bpmnNodeToolbarExtension } from './toolbar/node-config.js';
23
24
  import { BPMN_FRAMEWORK_PALETTE } from './toolbar/palette.js';
24
25
  import { bpmnSeniorTool } from './toolbar/senior-tool.js';
25
26
  /**
@@ -51,6 +52,11 @@ export class BpmnRenderViewExtension extends ViewExtensionProvider {
51
52
  // otherwise, and the toolbar toggle is what writes it.
52
53
  context.register(FrameworkBackgroundInteractionExtension(BPMN_POOL_BACKGROUND));
53
54
  context.register(bpmnPoolToolbarExtension);
55
+ // The base shape features on a selected NODE — colours, stroke, text
56
+ // style — on the BARE `affine:surface:bpmnNode` key, like Wardley's and
57
+ // EDGY's node modules. Always on: recolouring a stored element is editing
58
+ // content, not tooling (`docs/adr/0009`).
59
+ context.register(bpmnNodeToolbarExtension);
54
60
  }
55
61
  }
56
62
  }
@@ -94,25 +100,41 @@ export class BpmnViewExtension extends ViewExtensionProvider {
94
100
  // The "Change type" dropdown on a selected NODE's contextual toolbar —
95
101
  // the generic module, parameterized by BPMN's own families table.
96
102
  //
97
- // `affine:surface:bpmnNode` is a FREE slot, and class inheritance has
98
- // nothing to do with it: `renderToolbar` merges by flavour KEY — the
99
- // element's own, its `custom:` twin and the `affine:surface:*` wildcards
100
- // — so `shapeToolbarExtension`, which binds `affine:surface:shape`, never
103
+ // ## Why the key carries an owner
104
+ //
105
+ // `renderToolbar` merges by flavour KEY — the element's own, its
106
+ // `custom:` twin and the `affine:surface:*` wildcards — so
107
+ // `shapeToolbarExtension`, which binds `affine:surface:shape`, never
101
108
  // reaches a bpmn node however much of `ShapeElementModel` the class
102
- // inherits. Nothing claimed this key before, so the registration is purely
103
- // additive: it joins the wildcard entries (tags, validation) that a node
104
- // already gets, and a second module claiming the same key would throw
105
- // `DuplicateServiceDefinitionError` before the editor finished setting up.
109
+ // inherits. The bare `affine:surface:bpmnNode` key is now taken by the
110
+ // always-on `bpmnNodeToolbarExtension` (the shape's base features), and
111
+ // a second module on it would throw `DuplicateServiceDefinitionError`
112
+ // at setup. `toolbarModuleKey` lifts that ceiling: the morph is the
113
+ // DISTINCT variant `affine:surface:bpmnNode#bpmn-morph`, and the
114
+ // registry hands it to the same row.
106
115
  //
107
- // Registered HERE, in the flag-gated half, because a morph is TOOLING: a
108
- // node drawn while the flag was on keeps its kind, its role, its glyph
109
- // and its place in every rule when the flag goes off — it just stops
110
- // being something the toolbar offers to say more precisely
111
- // (`docs/adr/0009`).
116
+ // ## Why here
117
+ //
118
+ // In the flag-gated half, because a morph is TOOLING: a node drawn while
119
+ // the flag was on keeps its kind, its role, its glyph and its place in
120
+ // every rule when the flag goes off — it just stops being something the
121
+ // toolbar offers to say more precisely (`docs/adr/0009`).
112
122
  context.register(ToolbarModuleExtension({
113
- id: BlockFlavourIdentifier('affine:surface:bpmnNode'),
123
+ id: BlockFlavourIdentifier(toolbarModuleKey('affine:surface:bpmnNode', 'bpmn-morph')),
114
124
  config: morphToolbarConfig(BPMN_MORPH_SPEC),
115
125
  }));
126
+ // The same dropdown on the GROUP row. An event, a gateway or a data
127
+ // shape is born as a native group of the symbol and its gravitating
128
+ // label (R38), and a click selects the group — so, exactly as Wardley,
129
+ // C4 and UML do for their composites, the morph is also registered on
130
+ // `custom:affine:surface:group` under an owner, and
131
+ // `BPMN_GROUP_MORPH_SPEC` resolves the node inside (refusing any group
132
+ // that is not one BPMN external-label artefact). Flag-gated for the
133
+ // same reason as the node row.
134
+ context.register(ToolbarModuleExtension({
135
+ id: BlockFlavourIdentifier(toolbarModuleKey('custom:affine:surface:group', 'bpmn-morph')),
136
+ config: morphToolbarConfig(BPMN_GROUP_MORPH_SPEC),
137
+ }));
116
138
  // The reversed reading (MF3): what the process says about an artefact, on
117
139
  // demand. Four profiles because BPMN has four parent-less node families
118
140
  // (`reading.ts` says why the notation refuses a common root). The CLICK
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.43.1",
4
+ "version": "0.45.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -31,7 +31,7 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@formicoidea/labre-core": "0.43.1",
34
+ "@formicoidea/labre-core": "0.45.0",
35
35
  "lit": "^3.2.0"
36
36
  }
37
37
  }