@formicoidea/labre-framework-uml 0.42.0 → 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/actions.d.ts +0 -23
- package/dist/actions.js +3 -30
- package/dist/drawio-import.js +7 -0
- package/dist/element-renderer.d.ts +5 -5
- package/dist/filename.d.ts +3 -11
- package/dist/filename.js +5 -19
- package/dist/import.js +3 -1
- package/dist/node/node-renderer.d.ts +8 -2
- package/dist/node/node-renderer.js +23 -9
- package/dist/presets.d.ts +19 -1
- package/dist/presets.js +21 -1
- package/dist/toolbar/config.d.ts +6 -6
- package/dist/toolbar/senior-tool.d.ts +1 -1
- package/package.json +3 -3
package/dist/actions.d.ts
CHANGED
|
@@ -293,29 +293,6 @@ export declare function activateUmlEdge(std: BlockStdScope, role: UmlEdgeRole):
|
|
|
293
293
|
* document is for.
|
|
294
294
|
*/
|
|
295
295
|
export declare function umlDiagramsSelected(std: BlockStdScope): UmlDiagramElementModel[];
|
|
296
|
-
/**
|
|
297
|
-
* Draw the legend of what is actually on the selected frame, bottom-left of it.
|
|
298
|
-
*
|
|
299
|
-
* The FIRST selected frame and no other: a legend is placed relative to one
|
|
300
|
-
* background, and two of them would put two boxes on top of whatever sits in
|
|
301
|
-
* that corner. Everything about the gesture — the scan, the placement, the box —
|
|
302
|
-
* is `createBoardLegend`'s; UML contributes nothing but the rows its own
|
|
303
|
-
* commands subscribe (`commands.ts`, `docs/adr/0026`).
|
|
304
|
-
*
|
|
305
|
-
* The one action in this file with no command behind it, exactly as in C4: the
|
|
306
|
-
* legend is reached from the selected frame's contextual toolbar and from
|
|
307
|
-
* nowhere else (PO arbitration, 27/08/2026 — see `toolbar/config.ts`). It is a
|
|
308
|
-
* legend OF something you have in front of you, not an artefact to pick off a
|
|
309
|
-
* palette. Kept here beside its siblings all the same, because it is the same
|
|
310
|
-
* kind of thing — a gesture that writes elements — and because a unit test can
|
|
311
|
-
* drive it without a toolbar.
|
|
312
|
-
*
|
|
313
|
-
* A legend earns its place in UML more than in most packs: the notation's dozen
|
|
314
|
-
* relationships differ by a diamond's fill and a triangle's outline, and a
|
|
315
|
-
* reader who is not fluent in §11.5.4 cannot tell a shared aggregation from a
|
|
316
|
-
* composition without a key on the sheet.
|
|
317
|
-
*/
|
|
318
|
-
export declare function createUmlLegend(std: BlockStdScope): void;
|
|
319
296
|
/**
|
|
320
297
|
* The diagrams the export speaks about: the SELECTED ones, or every diagram on
|
|
321
298
|
* the surface when nothing is selected.
|
package/dist/actions.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DefaultTool, runInterchangeImportFile, } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { ConnectorTool } from '@formicoidea/labre-core/gfx/connector';
|
|
3
3
|
import { ConnectorMode, TextAlign, UmlDiagramElementModel, } from '@formicoidea/labre-core/model';
|
|
4
4
|
import { translateKey } from '@formicoidea/labre-core/shared/services';
|
|
@@ -12,7 +12,7 @@ import { UML_EDGE_STYLE } from './edge-styles.js';
|
|
|
12
12
|
import { umlSafeFilename } from './filename.js';
|
|
13
13
|
import { UML_DRAWIO_IMPORT, UML_PLANTUML_EXPORT, UML_PLANTUML_IMPORT, UML_XMI_EXPORT, UML_XMI_IMPORT, } from './interchange.js';
|
|
14
14
|
import { UML_ATTRIBUTES_SEED, UML_ATTRIBUTES_SEED_KEY, UML_NAME_SEED, UML_OPERATIONS_SEED, UML_OPERATIONS_SEED_KEY, UML_SLOTS_SEED, UML_SLOTS_SEED_KEY, UML_UNLABELLED_KINDS, umlSeedKey, } from './keywords.js';
|
|
15
|
-
import { umlNodeProps, umlTextProps } from './presets.js';
|
|
15
|
+
import { umlNameDecoration, umlNodeProps, umlTextProps } from './presets.js';
|
|
16
16
|
import { UML_ROLE, umlDiagramRoleKey, umlRoleKey, umlSubjectRoleKey, } from './roles.js';
|
|
17
17
|
/**
|
|
18
18
|
* Standalone creation/activation actions for the UML toolbox — the same shape
|
|
@@ -477,6 +477,7 @@ export function createUmlClassifier(std, kind) {
|
|
|
477
477
|
fontSize: UML_NAME_FONT_SIZE,
|
|
478
478
|
align: TextAlign.Center,
|
|
479
479
|
bold: true,
|
|
480
|
+
decoration: umlNameDecoration(kind),
|
|
480
481
|
})] = true;
|
|
481
482
|
if (boxes.attributes) {
|
|
482
483
|
const [bodyKey, bodyText] = BODY_SEED[kind] ?? [
|
|
@@ -548,34 +549,6 @@ export function umlDiagramsSelected(std) {
|
|
|
548
549
|
return [];
|
|
549
550
|
return gfxOf(std).selection.selectedElements.filter((model) => model instanceof UmlDiagramElementModel);
|
|
550
551
|
}
|
|
551
|
-
/**
|
|
552
|
-
* Draw the legend of what is actually on the selected frame, bottom-left of it.
|
|
553
|
-
*
|
|
554
|
-
* The FIRST selected frame and no other: a legend is placed relative to one
|
|
555
|
-
* background, and two of them would put two boxes on top of whatever sits in
|
|
556
|
-
* that corner. Everything about the gesture — the scan, the placement, the box —
|
|
557
|
-
* is `createBoardLegend`'s; UML contributes nothing but the rows its own
|
|
558
|
-
* commands subscribe (`commands.ts`, `docs/adr/0026`).
|
|
559
|
-
*
|
|
560
|
-
* The one action in this file with no command behind it, exactly as in C4: the
|
|
561
|
-
* legend is reached from the selected frame's contextual toolbar and from
|
|
562
|
-
* nowhere else (PO arbitration, 27/08/2026 — see `toolbar/config.ts`). It is a
|
|
563
|
-
* legend OF something you have in front of you, not an artefact to pick off a
|
|
564
|
-
* palette. Kept here beside its siblings all the same, because it is the same
|
|
565
|
-
* kind of thing — a gesture that writes elements — and because a unit test can
|
|
566
|
-
* drive it without a toolbar.
|
|
567
|
-
*
|
|
568
|
-
* A legend earns its place in UML more than in most packs: the notation's dozen
|
|
569
|
-
* relationships differ by a diamond's fill and a triangle's outline, and a
|
|
570
|
-
* reader who is not fluent in §11.5.4 cannot tell a shared aggregation from a
|
|
571
|
-
* composition without a key on the sheet.
|
|
572
|
-
*/
|
|
573
|
-
export function createUmlLegend(std) {
|
|
574
|
-
const diagram = umlDiagramsSelected(std)[0];
|
|
575
|
-
if (!diagram)
|
|
576
|
-
return;
|
|
577
|
-
createBoardLegend(std, diagram, 'uml');
|
|
578
|
-
}
|
|
579
552
|
/* ── Export (PlantUML, XMI 2.5.1) ──────────────────────────────────────── */
|
|
580
553
|
/**
|
|
581
554
|
* The diagrams the export speaks about: the SELECTED ones, or every diagram on
|
package/dist/drawio-import.js
CHANGED
|
@@ -741,6 +741,11 @@ export function importDrawio(xml, options = {}) {
|
|
|
741
741
|
? [
|
|
742
742
|
{
|
|
743
743
|
id: UML_DRAWIO_FORMAT_ID,
|
|
744
|
+
// The LAST resort, reached only by a headless call that names
|
|
745
|
+
// nothing: the editor's own import resolves
|
|
746
|
+
// `com.labre.interchange.import.default-name` and passes it as
|
|
747
|
+
// `options.name` (#390), so this reader stays pure and the two
|
|
748
|
+
// spellings are the same English text on purpose.
|
|
744
749
|
name: sheetName?.trim() || 'Imported diagram',
|
|
745
750
|
lifelines,
|
|
746
751
|
messages,
|
|
@@ -858,6 +863,8 @@ function emptyModel(name,
|
|
|
858
863
|
// nowhere else, so a drawing that holds one is an `sd` sheet and saying so
|
|
859
864
|
// costs the author a retag they would otherwise have to make.
|
|
860
865
|
kind = DIAGRAM_KIND) {
|
|
866
|
+
// Same last resort as in `readSequence`: the editor's import resolves
|
|
867
|
+
// `com.labre.interchange.import.default-name` and hands it over as `name`.
|
|
861
868
|
const label = name?.trim() || 'Imported diagram';
|
|
862
869
|
return {
|
|
863
870
|
diagram: {
|
|
@@ -13,20 +13,20 @@ import type { UmlDiagramElementModel, UmlFragmentElementModel, UmlPartitionEleme
|
|
|
13
13
|
* them directly with a canvas stub.
|
|
14
14
|
*/
|
|
15
15
|
export declare const umlDiagram: ElementRenderer<UmlDiagramElementModel>;
|
|
16
|
-
export declare const UmlDiagramRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
16
|
+
export declare const UmlDiagramRendererExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType & {
|
|
17
17
|
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlDiagramElementModel>>;
|
|
18
18
|
};
|
|
19
19
|
export declare const umlSubject: ElementRenderer<UmlSubjectElementModel>;
|
|
20
|
-
export declare const UmlSubjectRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
20
|
+
export declare const UmlSubjectRendererExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType & {
|
|
21
21
|
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlSubjectElementModel>>;
|
|
22
22
|
};
|
|
23
23
|
export declare const umlPartition: ElementRenderer<UmlPartitionElementModel>;
|
|
24
|
-
export declare const UmlPartitionRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
24
|
+
export declare const UmlPartitionRendererExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType & {
|
|
25
25
|
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlPartitionElementModel>>;
|
|
26
26
|
};
|
|
27
27
|
/** The composite state (§14.2.4) — one declaration, no orientation to turn. */
|
|
28
28
|
export declare const umlRegion: ElementRenderer<UmlRegionElementModel>;
|
|
29
|
-
export declare const UmlRegionRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
29
|
+
export declare const UmlRegionRendererExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType & {
|
|
30
30
|
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlRegionElementModel>>;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
@@ -59,6 +59,6 @@ export declare const UmlRegionRendererExtension: import("@formicoidea/labre-core
|
|
|
59
59
|
*/
|
|
60
60
|
export declare function umlFragmentAsPainted(model: UmlFragmentElementModel): UmlFragmentElementModel;
|
|
61
61
|
export declare const umlFragment: ElementRenderer<UmlFragmentElementModel>;
|
|
62
|
-
export declare const UmlFragmentRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
62
|
+
export declare const UmlFragmentRendererExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType & {
|
|
63
63
|
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlFragmentElementModel>>;
|
|
64
64
|
};
|
package/dist/filename.d.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A name a file system will accept, minus the extension
|
|
2
|
+
* A name a file system will accept, minus the extension: the shared
|
|
3
|
+
* `safeFilename`, held to it by `safe-filename-parity.unit.spec.ts`.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
* for the same reasons — reserved characters become `-`, whitespace runs
|
|
6
|
-
* collapse, the result is capped, and the Windows tail of dots and spaces is
|
|
7
|
-
* trimmed AFTER the cap so the extension is not the thing that gets eaten.
|
|
8
|
-
*
|
|
9
|
-
* Duplicated rather than imported, which is the trade the two packs before this
|
|
10
|
-
* one made explicitly: a filename rule is not API, and coupling three frameworks
|
|
11
|
-
* so they can share eight lines buys nothing and costs a shared thing to break.
|
|
12
|
-
*
|
|
13
|
-
* `fallback` is a parameter here where the other two hard-code theirs, because
|
|
5
|
+
* `fallback` is a parameter here where the other frameworks hard-code theirs, because
|
|
14
6
|
* UML writes two formats out of one pack and the word a nameless document should
|
|
15
7
|
* take is the FORMAT's rather than the framework's.
|
|
16
8
|
*/
|
package/dist/filename.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
+
import { safeFilename } from '@formicoidea/labre-core/shared/utils';
|
|
1
2
|
/**
|
|
2
|
-
* A name a file system will accept, minus the extension
|
|
3
|
+
* A name a file system will accept, minus the extension: the shared
|
|
4
|
+
* `safeFilename`, held to it by `safe-filename-parity.unit.spec.ts`.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
* for the same reasons — reserved characters become `-`, whitespace runs
|
|
6
|
-
* collapse, the result is capped, and the Windows tail of dots and spaces is
|
|
7
|
-
* trimmed AFTER the cap so the extension is not the thing that gets eaten.
|
|
8
|
-
*
|
|
9
|
-
* Duplicated rather than imported, which is the trade the two packs before this
|
|
10
|
-
* one made explicitly: a filename rule is not API, and coupling three frameworks
|
|
11
|
-
* so they can share eight lines buys nothing and costs a shared thing to break.
|
|
12
|
-
*
|
|
13
|
-
* `fallback` is a parameter here where the other two hard-code theirs, because
|
|
6
|
+
* `fallback` is a parameter here where the other frameworks hard-code theirs, because
|
|
14
7
|
* UML writes two formats out of one pack and the word a nameless document should
|
|
15
8
|
* take is the FORMAT's rather than the framework's.
|
|
16
9
|
*/
|
|
17
10
|
export function umlSafeFilename(raw, fallback = 'diagram') {
|
|
18
|
-
|
|
19
|
-
.trim()
|
|
20
|
-
.replaceAll(/[\\/:*?"<>|]/g, '-')
|
|
21
|
-
.replaceAll(/\s+/g, ' ')
|
|
22
|
-
.trim()
|
|
23
|
-
.slice(0, 120)
|
|
24
|
-
.replace(/[. ]+$/, '');
|
|
25
|
-
return safe || fallback;
|
|
11
|
+
return safeFilename(raw, fallback);
|
|
26
12
|
}
|
package/dist/import.js
CHANGED
|
@@ -6,7 +6,7 @@ import { UML_EDGE_STYLE } from './edge-styles.js';
|
|
|
6
6
|
import { formatActivityEdgeLabel, formatEndLabel, formatTransitionLabel, } from './grammar.js';
|
|
7
7
|
import { guillemets, UML_UNLABELLED_KINDS } from './keywords.js';
|
|
8
8
|
import { umlGuardText, } from './model.js';
|
|
9
|
-
import { umlNodeProps, umlTextProps } from './presets.js';
|
|
9
|
+
import { umlNameDecoration, umlNodeProps, umlTextProps } from './presets.js';
|
|
10
10
|
import { UML_ROLE } from './roles.js';
|
|
11
11
|
/**
|
|
12
12
|
* The **one materializer** every UML importer ends on — a model in, the
|
|
@@ -1006,6 +1006,8 @@ export function umlElementsFromModel(models, options) {
|
|
|
1006
1006
|
// The classifier's name is the heading of a divided box; a
|
|
1007
1007
|
// glyph's one word is not.
|
|
1008
1008
|
...(compartmented ? { bold: true } : {}),
|
|
1009
|
+
// The toolbox's own preset: an instance's name is underlined.
|
|
1010
|
+
decoration: umlNameDecoration(kind),
|
|
1009
1011
|
}),
|
|
1010
1012
|
id: tierId,
|
|
1011
1013
|
text: tiers.name,
|
|
@@ -9,7 +9,13 @@ import { type UmlCompartmentBoxes } from '../component.js';
|
|
|
9
9
|
* they are already on the canvas — so a renderer holding them would be holding a
|
|
10
10
|
* second opinion about where words it does not draw ought to be.
|
|
11
11
|
*/
|
|
12
|
-
type UmlSeparators = Pick<UmlCompartmentBoxes, 'name' | 'splits'
|
|
12
|
+
type UmlSeparators = Pick<UmlCompartmentBoxes, 'name' | 'splits'> & {
|
|
13
|
+
/**
|
|
14
|
+
* Whether the name tier carries a `textDecoration` of its own, whatever its
|
|
15
|
+
* value: the text then owns the instance underline (ADR 0030 §4).
|
|
16
|
+
*/
|
|
17
|
+
nameDecorated?: boolean;
|
|
18
|
+
};
|
|
13
19
|
/**
|
|
14
20
|
* The compartment layout to stroke this node's separators from: the one its
|
|
15
21
|
* TIERS describe if they can be reached, and the default stack otherwise.
|
|
@@ -43,7 +49,7 @@ type UmlSeparators = Pick<UmlCompartmentBoxes, 'name' | 'splits'>;
|
|
|
43
49
|
*/
|
|
44
50
|
export declare function umlNodeCompartments(model: UmlNodeElementModel, w: number, h: number): UmlSeparators;
|
|
45
51
|
export declare const umlNode: ElementRenderer<UmlNodeElementModel>;
|
|
46
|
-
export declare const UmlNodeRendererExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType & {
|
|
52
|
+
export declare const UmlNodeRendererExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType & {
|
|
47
53
|
identifier: import("@formicoidea/labre-core/_pkgs/global/di/types.js").ServiceIdentifier<ElementRenderer<UmlNodeElementModel>>;
|
|
48
54
|
};
|
|
49
55
|
export {};
|
|
@@ -179,10 +179,15 @@ function paintGlyph(kind, ctx, w, h, inset, boxes) {
|
|
|
179
179
|
line(ctx, x0, split, x1, split);
|
|
180
180
|
}
|
|
181
181
|
// An instance's name is UNDERLINED (§9.8.4) — the one mark that tells a
|
|
182
|
-
// reader an object from the class it is an instance of.
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
|
|
182
|
+
// reader an object from the class it is an instance of. Since ADR 0030 the
|
|
183
|
+
// name is CREATED underlined and the text renderer draws the line under the
|
|
184
|
+
// words; this rule under the NAME box is the paint-time fallback for a name
|
|
185
|
+
// that never carried the field (an object drawn before, or by an older
|
|
186
|
+
// client). Any stored value — `none` included — hands the line to the text.
|
|
187
|
+
// ponytail: an old object keeps this box-wide rule until its author touches
|
|
188
|
+
// the decoration toggle once; a deliberate "normalise decorations" command
|
|
189
|
+
// is the upgrade, if ever asked — never a migration on open.
|
|
190
|
+
if (kind === 'object' && !boxes.nameDecorated) {
|
|
186
191
|
const { name } = boxes;
|
|
187
192
|
const under = name.y + name.h;
|
|
188
193
|
if (under > y0 && under < y1 && name.w > 0) {
|
|
@@ -551,27 +556,36 @@ export function umlNodeCompartments(model, w, h) {
|
|
|
551
556
|
const group = model.group;
|
|
552
557
|
// No splits at all is a kind that is a PICTURE (a package, an actor, a cube):
|
|
553
558
|
// there are no compartments to read off, and nothing below would mean
|
|
554
|
-
// anything.
|
|
555
|
-
if (defaults.splits.length === 0 ||
|
|
559
|
+
// anything.
|
|
560
|
+
if (defaults.splits.length === 0 || !group)
|
|
556
561
|
return defaults;
|
|
557
562
|
const children = group.childElements;
|
|
558
563
|
const component = umlComponentSiblings({ id: group.id, childIds: group.childIds }, children);
|
|
564
|
+
const name = children.find(child => child.id === component.name?.id);
|
|
565
|
+
// Read before any fallback below, so a rotated or displaced node never draws
|
|
566
|
+
// the legacy rule under a name that already decorates itself.
|
|
567
|
+
const nameDecorated = name?.textDecoration !==
|
|
568
|
+
undefined;
|
|
569
|
+
const fallback = { ...defaults, nameDecorated };
|
|
570
|
+
// A rotated shape is the documented ceiling above.
|
|
571
|
+
if (model.rotate)
|
|
572
|
+
return fallback;
|
|
559
573
|
// The BODY tier is what both separators hang off: the line above it is where
|
|
560
574
|
// the name compartment stops, the line below it where the operations start.
|
|
561
575
|
// Its role is `uml:attributes` on all seven compartmented kinds — a slot list,
|
|
562
576
|
// a component's parts, a state's activities included (`component.ts`).
|
|
563
577
|
const body = children.find(child => child.id === component.attributes?.id);
|
|
564
578
|
if (!body)
|
|
565
|
-
return
|
|
579
|
+
return fallback;
|
|
566
580
|
const [nodeX, nodeY] = model.deserializedXYWH;
|
|
567
581
|
const top = body.y - nodeY;
|
|
568
582
|
const bottom = top + body.h;
|
|
569
583
|
// A tier dragged clean off its node says nothing useful about where a line
|
|
570
584
|
// INSIDE the node goes.
|
|
571
585
|
if (!(top > 0) || !(bottom > top))
|
|
572
|
-
return
|
|
573
|
-
const name = children.find(child => child.id === component.name?.id);
|
|
586
|
+
return fallback;
|
|
574
587
|
return {
|
|
588
|
+
nameDecorated,
|
|
575
589
|
// The name box is read for the one thing it is used for: the rule under an
|
|
576
590
|
// INSTANCE's name (§9.8.4), which has to stay under the words once a
|
|
577
591
|
// two-line name has pushed them down.
|
package/dist/presets.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextAlign, type UmlNodeKind } from '@formicoidea/labre-core/model';
|
|
1
|
+
import { TextAlign, TextDecoration, type UmlNodeKind } from '@formicoidea/labre-core/model';
|
|
2
2
|
import type { UmlBox } from './component.js';
|
|
3
3
|
/**
|
|
4
4
|
* What a UML shape IS, as props — the ONE description the creation site, the
|
|
@@ -139,11 +139,29 @@ export declare function umlMorphClears(kind: UmlNodeKind): readonly string[];
|
|
|
139
139
|
* by size alone. Everything else is Regular, because UML reserves its type
|
|
140
140
|
* variations for meanings the grammar reads (italics for abstract, §9.2.4) and
|
|
141
141
|
* a decorative weight would compete with them.
|
|
142
|
+
*
|
|
143
|
+
* `decoration` is written only when given — see {@link umlNameDecoration}. A
|
|
144
|
+
* decoration is not a remembered style, so `applyLastProps` has none to merge
|
|
145
|
+
* and its absence is the plain text every other tier is.
|
|
142
146
|
*/
|
|
143
147
|
export declare function umlTextProps(role: string, box: UmlBox, options: {
|
|
144
148
|
fontSize: number;
|
|
145
149
|
align: TextAlign;
|
|
146
150
|
bold?: boolean;
|
|
151
|
+
decoration?: TextDecoration;
|
|
147
152
|
}): Record<string, unknown> & {
|
|
148
153
|
type: string;
|
|
149
154
|
};
|
|
155
|
+
/**
|
|
156
|
+
* The decoration a kind's NAME tier is created with: an instance's name is
|
|
157
|
+
* underlined (§9.8.4), every other name is left undecided — no key at all, so
|
|
158
|
+
* it stores what it stored before ADR 0030.
|
|
159
|
+
*
|
|
160
|
+
* One preset, read by every creation site (the toolbox, the importers, and the
|
|
161
|
+
* templates that record the toolbox), so none restates the notation. The
|
|
162
|
+
* underline lives on the TEXT since ADR 0030 §4: it runs under the words, not
|
|
163
|
+
* across the compartment, and the author can restyle it from the text toolbar.
|
|
164
|
+
* The glyph's old rule survives only as a paint-time fallback for a name that
|
|
165
|
+
* never carried the field (`node/node-renderer.ts`).
|
|
166
|
+
*/
|
|
167
|
+
export declare function umlNameDecoration(kind: UmlNodeKind): TextDecoration | undefined;
|
package/dist/presets.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FontFamily, FontStyle, FontWeight, ShapeStyle, StrokeStyle, TextAlign, } from '@formicoidea/labre-core/model';
|
|
1
|
+
import { FontFamily, FontStyle, FontWeight, ShapeStyle, StrokeStyle, TextAlign, TextDecoration, } from '@formicoidea/labre-core/model';
|
|
2
2
|
import { Bound } from '@formicoidea/labre-core/global/gfx';
|
|
3
3
|
import { UML_CARD, UML_INK, UML_NAME_FONT_SIZE, UML_NODE_BOX, UML_NODE_RADIUS, UML_NODE_STROKE_WIDTH, } from './consts.js';
|
|
4
4
|
import { UML_ROLE_OF_KIND } from './roles.js';
|
|
@@ -285,6 +285,10 @@ export function umlMorphClears(kind) {
|
|
|
285
285
|
* by size alone. Everything else is Regular, because UML reserves its type
|
|
286
286
|
* variations for meanings the grammar reads (italics for abstract, §9.2.4) and
|
|
287
287
|
* a decorative weight would compete with them.
|
|
288
|
+
*
|
|
289
|
+
* `decoration` is written only when given — see {@link umlNameDecoration}. A
|
|
290
|
+
* decoration is not a remembered style, so `applyLastProps` has none to merge
|
|
291
|
+
* and its absence is the plain text every other tier is.
|
|
288
292
|
*/
|
|
289
293
|
export function umlTextProps(role, box, options) {
|
|
290
294
|
return {
|
|
@@ -298,5 +302,21 @@ export function umlTextProps(role, box, options) {
|
|
|
298
302
|
textAlign: options.align,
|
|
299
303
|
hasMaxWidth: true,
|
|
300
304
|
xywh: new Bound(box.x, box.y, box.w, box.h).serialize(),
|
|
305
|
+
...(options.decoration ? { textDecoration: options.decoration } : {}),
|
|
301
306
|
};
|
|
302
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* The decoration a kind's NAME tier is created with: an instance's name is
|
|
310
|
+
* underlined (§9.8.4), every other name is left undecided — no key at all, so
|
|
311
|
+
* it stores what it stored before ADR 0030.
|
|
312
|
+
*
|
|
313
|
+
* One preset, read by every creation site (the toolbox, the importers, and the
|
|
314
|
+
* templates that record the toolbox), so none restates the notation. The
|
|
315
|
+
* underline lives on the TEXT since ADR 0030 §4: it runs under the words, not
|
|
316
|
+
* across the compartment, and the author can restyle it from the text toolbar.
|
|
317
|
+
* The glyph's old rule survives only as a paint-time fallback for a name that
|
|
318
|
+
* never carried the field (`node/node-renderer.ts`).
|
|
319
|
+
*/
|
|
320
|
+
export function umlNameDecoration(kind) {
|
|
321
|
+
return kind === 'object' ? TextDecoration.Underline : undefined;
|
|
322
|
+
}
|
package/dist/toolbar/config.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare const umlDiagramToolbarConfig: {
|
|
|
45
45
|
}, import("@formicoidea/labre-core/shared/services").ToolbarActionGenerator, import("@formicoidea/labre-core/shared/services").ToolbarActionGenerator];
|
|
46
46
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
47
47
|
};
|
|
48
|
-
export declare const umlDiagramToolbarExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType;
|
|
48
|
+
export declare const umlDiagramToolbarExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType;
|
|
49
49
|
/**
|
|
50
50
|
* The legend button — the flag-gated half of the row.
|
|
51
51
|
*
|
|
@@ -97,7 +97,7 @@ export declare const umlLegendToolbarConfig: {
|
|
|
97
97
|
* modules were registered in.
|
|
98
98
|
*/
|
|
99
99
|
export declare const umlDiagramToolingToolbarConfig: ToolbarModuleConfig;
|
|
100
|
-
export declare const umlDiagramToolingToolbarExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType;
|
|
100
|
+
export declare const umlDiagramToolingToolbarExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType;
|
|
101
101
|
/**
|
|
102
102
|
* The ACTIVITY PARTITION's row: the resize toggle, and the one thing a swimlane
|
|
103
103
|
* can be said differently — which way its bands run.
|
|
@@ -153,7 +153,7 @@ export declare const umlPartitionToolbarConfig: {
|
|
|
153
153
|
}];
|
|
154
154
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
155
155
|
};
|
|
156
|
-
export declare const umlPartitionToolbarExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType;
|
|
156
|
+
export declare const umlPartitionToolbarExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType;
|
|
157
157
|
/**
|
|
158
158
|
* The REGION's row: the resize toggle, and nothing else.
|
|
159
159
|
*
|
|
@@ -177,7 +177,7 @@ export declare const umlRegionToolbarConfig: {
|
|
|
177
177
|
}];
|
|
178
178
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
179
179
|
};
|
|
180
|
-
export declare const umlRegionToolbarExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType;
|
|
180
|
+
export declare const umlRegionToolbarExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType;
|
|
181
181
|
/**
|
|
182
182
|
* The COMBINED FRAGMENT's always-on row: the resize toggle, and nothing else.
|
|
183
183
|
*
|
|
@@ -196,7 +196,7 @@ export declare const umlFragmentToolbarConfig: {
|
|
|
196
196
|
}];
|
|
197
197
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
198
198
|
};
|
|
199
|
-
export declare const umlFragmentToolbarExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType;
|
|
199
|
+
export declare const umlFragmentToolbarExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType;
|
|
200
200
|
/**
|
|
201
201
|
* The fragment's FLAG-GATED row: add an operand, pick the operator, and the
|
|
202
202
|
* generic Validation dropdown.
|
|
@@ -225,4 +225,4 @@ export declare const umlFragmentToolbarExtension: import("@formicoidea/labre-cor
|
|
|
225
225
|
* all, so one module is the honest grouping rather than a workaround.
|
|
226
226
|
*/
|
|
227
227
|
export declare const umlFragmentToolingToolbarConfig: ToolbarModuleConfig;
|
|
228
|
-
export declare const umlFragmentToolingToolbarExtension: import("@formicoidea/labre-core/store/index.js").ExtensionType;
|
|
228
|
+
export declare const umlFragmentToolingToolbarExtension: import("@formicoidea/labre-core/_pkgs/store/index.js").ExtensionType;
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
* `all/src/__tests__/toolbar/senior-row-order.unit.spec.ts`, which reads this
|
|
9
9
|
* very file.
|
|
10
10
|
*/
|
|
11
|
-
export declare const umlSeniorTool: import("@formicoidea/labre-core/store").ExtensionType;
|
|
11
|
+
export declare const umlSeniorTool: import("@formicoidea/labre-core/_pkgs/store").ExtensionType;
|
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": "0.
|
|
4
|
+
"version": "0.45.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@formicoidea/labre-core": "0.
|
|
35
|
-
"@formicoidea/labre-ddd-shared": "0.
|
|
34
|
+
"@formicoidea/labre-core": "0.45.0",
|
|
35
|
+
"@formicoidea/labre-ddd-shared": "0.45.0",
|
|
36
36
|
"lit": "^3.2.0"
|
|
37
37
|
}
|
|
38
38
|
}
|