@formicoidea/labre-framework-uml 3.5.0 → 4.1.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.
@@ -22,7 +22,7 @@ export const umlCommandsManifest = [
22
22
  labelKey: 'com.labre.commands.uml.addDiagram',
23
23
  labelFallback: 'UML diagram',
24
24
  scope: 'edgeless',
25
- defaultKeys: { mac: [], other: [] },
25
+ defaultKeys: { mac: ['u', 'd'], other: ['u', 'd'] },
26
26
  },
27
27
  {
28
28
  id: 'uml.addClass',
@@ -30,7 +30,7 @@ export const umlCommandsManifest = [
30
30
  labelKey: 'com.labre.commands.uml.addClass',
31
31
  labelFallback: 'Class',
32
32
  scope: 'edgeless',
33
- defaultKeys: { mac: [], other: [] },
33
+ defaultKeys: { mac: ['u', 'c'], other: ['u', 'c'] },
34
34
  },
35
35
  {
36
36
  id: 'uml.addInterface',
@@ -38,7 +38,7 @@ export const umlCommandsManifest = [
38
38
  labelKey: 'com.labre.commands.uml.addInterface',
39
39
  labelFallback: 'Interface',
40
40
  scope: 'edgeless',
41
- defaultKeys: { mac: [], other: [] },
41
+ defaultKeys: { mac: ['u', 'i'], other: ['u', 'i'] },
42
42
  },
43
43
  {
44
44
  id: 'uml.addEnumeration',
@@ -46,7 +46,7 @@ export const umlCommandsManifest = [
46
46
  labelKey: 'com.labre.commands.uml.addEnumeration',
47
47
  labelFallback: 'Enumeration',
48
48
  scope: 'edgeless',
49
- defaultKeys: { mac: [], other: [] },
49
+ defaultKeys: { mac: ['u', 'e'], other: ['u', 'e'] },
50
50
  },
51
51
  {
52
52
  id: 'uml.addPackage',
@@ -54,7 +54,7 @@ export const umlCommandsManifest = [
54
54
  labelKey: 'com.labre.commands.uml.addPackage',
55
55
  labelFallback: 'Package',
56
56
  scope: 'edgeless',
57
- defaultKeys: { mac: [], other: [] },
57
+ defaultKeys: { mac: ['u', 'p'], other: ['u', 'p'] },
58
58
  },
59
59
  {
60
60
  id: 'uml.addActor',
@@ -62,7 +62,7 @@ export const umlCommandsManifest = [
62
62
  labelKey: 'com.labre.commands.uml.addActor',
63
63
  labelFallback: 'Actor',
64
64
  scope: 'edgeless',
65
- defaultKeys: { mac: [], other: [] },
65
+ defaultKeys: { mac: ['u', 'a'], other: ['u', 'a'] },
66
66
  },
67
67
  {
68
68
  id: 'uml.addUseCase',
@@ -70,7 +70,7 @@ export const umlCommandsManifest = [
70
70
  labelKey: 'com.labre.commands.uml.addUseCase',
71
71
  labelFallback: 'Use case',
72
72
  scope: 'edgeless',
73
- defaultKeys: { mac: [], other: [] },
73
+ defaultKeys: { mac: ['u', 'o'], other: ['u', 'o'] },
74
74
  },
75
75
  {
76
76
  id: 'uml.addSubject',
@@ -78,7 +78,7 @@ export const umlCommandsManifest = [
78
78
  labelKey: 'com.labre.commands.uml.addSubject',
79
79
  labelFallback: 'Subject',
80
80
  scope: 'edgeless',
81
- defaultKeys: { mac: [], other: [] },
81
+ defaultKeys: { mac: ['u', 's'], other: ['u', 's'] },
82
82
  },
83
83
  {
84
84
  id: 'uml.addObject',
package/dist/commands.js CHANGED
@@ -1,6 +1,13 @@
1
+ import { frameworkChord } from '@formicoidea/labre-core/shared/utils';
1
2
  import { activateUmlEdge, createUmlClassifier, createUmlDiagram, createUmlFragment, createUmlInteractionUse, createUmlNode, createUmlPartition, createUmlRegion, createUmlSubject, exportUmlPlantumlFile, exportUmlXmiFile, importUmlDrawioFile, importUmlPlantumlFile, importUmlXmiFile, umlDiagramsForExport, } from './actions.js';
2
3
  import { umlLegendEntry, UML_LEGEND_BOX } from './legend.js';
3
4
  import { umlExportPlantumlIcon, umlExportXmiIcon, umlImportDrawioIcon, umlImportPlantumlIcon, umlImportXmiIcon, umlToolbarIcon, UML_TOOLBOX_ICONS, } from './toolbar/icons.js';
5
+ /**
6
+ * The first keystroke of every UML chord (`u c` places a class). Spelled again
7
+ * as `FrameworkDescriptor.chordPrefix` in `@labre/affine`'s `frameworks.ts`;
8
+ * `chord-prefixes.unit.spec.ts` holds the two together (`docs/adr/0055`).
9
+ */
10
+ const UML_CHORD_PREFIX = 'u';
4
11
  const SPECS = [
5
12
  /* ── The cold row, authored in the order it paints ─────────────────── */
6
13
  // The first nineteen entries are authored in SUB-MENU order rather than
@@ -18,6 +25,7 @@ const SPECS = [
18
25
  // nominated fourteen, the rendered thirteen, and the nine sections.
19
26
  {
20
27
  id: 'addDiagram',
28
+ key: 'd',
21
29
  label: 'UML diagram',
22
30
  iconKey: 'uml.diagram',
23
31
  kind: 'artefact',
@@ -33,6 +41,7 @@ const SPECS = [
33
41
  },
34
42
  {
35
43
  id: 'addClass',
44
+ key: 'c',
36
45
  label: 'Class',
37
46
  iconKey: 'uml.class',
38
47
  kind: 'artefact',
@@ -43,6 +52,7 @@ const SPECS = [
43
52
  },
44
53
  {
45
54
  id: 'addInterface',
55
+ key: 'i',
46
56
  label: 'Interface',
47
57
  iconKey: 'uml.interface',
48
58
  kind: 'artefact',
@@ -53,6 +63,7 @@ const SPECS = [
53
63
  },
54
64
  {
55
65
  id: 'addEnumeration',
66
+ key: 'e',
56
67
  label: 'Enumeration',
57
68
  iconKey: 'uml.enumeration',
58
69
  kind: 'artefact',
@@ -63,6 +74,7 @@ const SPECS = [
63
74
  },
64
75
  {
65
76
  id: 'addPackage',
77
+ key: 'p',
66
78
  label: 'Package',
67
79
  iconKey: 'uml.package',
68
80
  kind: 'artefact',
@@ -73,6 +85,7 @@ const SPECS = [
73
85
  },
74
86
  {
75
87
  id: 'addActor',
88
+ key: 'a',
76
89
  label: 'Actor',
77
90
  iconKey: 'uml.actor',
78
91
  kind: 'artefact',
@@ -83,6 +96,7 @@ const SPECS = [
83
96
  },
84
97
  {
85
98
  id: 'addUseCase',
99
+ key: 'o',
86
100
  label: 'Use case',
87
101
  iconKey: 'uml.use-case',
88
102
  kind: 'artefact',
@@ -93,6 +107,7 @@ const SPECS = [
93
107
  },
94
108
  {
95
109
  id: 'addSubject',
110
+ key: 's',
96
111
  label: 'Subject',
97
112
  iconKey: 'uml.subject',
98
113
  kind: 'artefact',
@@ -749,11 +764,14 @@ const toolboxCommands = SPECS.map((spec, index) => ({
749
764
  // used to reserve slot 1 for the XMI import is gone with the reason for it.
750
765
  order: index,
751
766
  scope: 'edgeless',
752
- // Keyless by intent, and at sixty-nine commands there is no chord alphabet
753
- // that would not be arbitrary — still bindable from Settings › Shortcuts,
754
- // which is what `toShortcutDescriptor` being total buys.
755
- defaultKeys: { mac: [], other: [] },
756
- availability: 'always',
767
+ // Only the eight senior artefacts of the cold row carry a chord: at
768
+ // sixty-nine commands a letter for every one would be arbitrary, so the rest
769
+ // stay keyless by intent — still bindable from Settings › Shortcuts, which is
770
+ // what `toShortcutDescriptor` being total buys (`docs/adr/0055`).
771
+ defaultKeys: frameworkChord(UML_CHORD_PREFIX, spec.key),
772
+ // It WRITES: a read-only document is one it cannot run on, so no surface
773
+ // offers it there and no chord arms for it (`docs/adr/0055`).
774
+ availability: 'editable',
757
775
  run: spec.run,
758
776
  telemetry: { framework: 'uml', element: spec.element, board: spec.board },
759
777
  // The legend row this entry's artefact puts on the frame it is drawn on —
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-framework-uml",
3
3
  "description": "Labre uml framework for @formicoidea/labre-core.",
4
- "version": "3.5.0",
4
+ "version": "4.1.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -35,8 +35,8 @@
35
35
  "dist"
36
36
  ],
37
37
  "dependencies": {
38
- "@formicoidea/labre-core": "3.5.0",
39
- "@formicoidea/labre-ddd-shared": "3.5.0",
38
+ "@formicoidea/labre-core": "4.1.0",
39
+ "@formicoidea/labre-ddd-shared": "4.1.0",
40
40
  "lit": "^3.2.0"
41
41
  }
42
42
  }