@miragon/wardley-renderer 0.6.2 → 0.7.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/README.md +37 -1
- package/dist/Modeler.d.ts +5 -0
- package/dist/Modeler.d.ts.map +1 -1
- package/dist/WardleyBaseViewer.d.ts +66 -8
- package/dist/WardleyBaseViewer.d.ts.map +1 -1
- package/dist/a11y/canvasFocus.d.ts +17 -0
- package/dist/a11y/canvasFocus.d.ts.map +1 -0
- package/dist/a11y/describeCanvas.d.ts +8 -0
- package/dist/a11y/describeCanvas.d.ts.map +1 -0
- package/dist/a11y/index.d.ts +5 -0
- package/dist/a11y/index.d.ts.map +1 -0
- package/dist/append/WardleyAppendBehavior.d.ts +7 -6
- package/dist/append/WardleyAppendBehavior.d.ts.map +1 -1
- package/dist/color-picker/WardleyColorPicker.d.ts +7 -2
- package/dist/color-picker/WardleyColorPicker.d.ts.map +1 -1
- package/dist/context-pad/WardleyContextPad.d.ts +30 -0
- package/dist/context-pad/WardleyContextPad.d.ts.map +1 -0
- package/dist/context-pad/WardleyContextPadProvider.d.ts +23 -1
- package/dist/context-pad/WardleyContextPadProvider.d.ts.map +1 -1
- package/dist/context-pad/index.d.ts +1 -0
- package/dist/context-pad/index.d.ts.map +1 -1
- package/dist/draw/WardleyRenderer.d.ts +8 -0
- package/dist/draw/WardleyRenderer.d.ts.map +1 -1
- package/dist/draw/icons.d.ts +9 -2
- package/dist/draw/icons.d.ts.map +1 -1
- package/dist/draw/index.d.ts +2 -1
- package/dist/draw/index.d.ts.map +1 -1
- package/dist/draw/label-layout.d.ts +59 -0
- package/dist/draw/label-layout.d.ts.map +1 -0
- package/dist/draw/palette-icons.d.ts +1 -0
- package/dist/draw/palette-icons.d.ts.map +1 -1
- package/dist/draw/styles.d.ts +16 -17
- package/dist/draw/styles.d.ts.map +1 -1
- package/dist/draw-tool/WardleyDrawTool.d.ts +12 -1
- package/dist/draw-tool/WardleyDrawTool.d.ts.map +1 -1
- package/dist/draw-tool/WardleyDrawingHandles.d.ts +1 -0
- package/dist/draw-tool/WardleyDrawingHandles.d.ts.map +1 -1
- package/dist/editor-state.d.ts +46 -0
- package/dist/editor-state.d.ts.map +1 -0
- package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts +60 -21
- package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts.map +1 -1
- package/dist/evolution-grid/EvolutionGrid.d.ts +2 -0
- package/dist/evolution-grid/EvolutionGrid.d.ts.map +1 -1
- package/dist/evolution-grid/index.d.ts.map +1 -1
- package/dist/evolve/WardleyEvolveDragging.d.ts.map +1 -1
- package/dist/evolve/constants.d.ts +3 -0
- package/dist/evolve/constants.d.ts.map +1 -0
- package/dist/evolve/index.d.ts +1 -0
- package/dist/evolve/index.d.ts.map +1 -1
- package/dist/index.d.ts +21 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4183 -2062
- package/dist/index.js.map +1 -1
- package/dist/io/WardleyExporter.d.ts +3 -1
- package/dist/io/WardleyExporter.d.ts.map +1 -1
- package/dist/io/WardleyImporter.d.ts.map +1 -1
- package/dist/io/WardleySourceOrder.d.ts +23 -0
- package/dist/io/WardleySourceOrder.d.ts.map +1 -0
- package/dist/io/exportBounds.d.ts +15 -0
- package/dist/io/exportBounds.d.ts.map +1 -0
- package/dist/io/index.d.ts +5 -0
- package/dist/io/index.d.ts.map +1 -1
- package/dist/io/rasterize.d.ts +25 -0
- package/dist/io/rasterize.d.ts.map +1 -0
- package/dist/io/saveSvg.d.ts +1 -1
- package/dist/io/saveSvg.d.ts.map +1 -1
- package/dist/io/types.d.ts +5 -0
- package/dist/io/types.d.ts.map +1 -1
- package/dist/keyboard/WardleyKeyboard.d.ts +44 -4
- package/dist/keyboard/WardleyKeyboard.d.ts.map +1 -1
- package/dist/label-drag/WardleyLabelDragging.d.ts +56 -0
- package/dist/label-drag/WardleyLabelDragging.d.ts.map +1 -0
- package/dist/label-drag/index.d.ts +5 -0
- package/dist/label-drag/index.d.ts.map +1 -0
- package/dist/label-editing/WardleyLabelEditing.d.ts +62 -6
- package/dist/label-editing/WardleyLabelEditing.d.ts.map +1 -1
- package/dist/label-editing/fieldError.d.ts +13 -0
- package/dist/label-editing/fieldError.d.ts.map +1 -0
- package/dist/label-editing/index.d.ts +1 -0
- package/dist/label-editing/index.d.ts.map +1 -1
- package/dist/layout/WardleyLayouter.d.ts +22 -0
- package/dist/layout/WardleyLayouter.d.ts.map +1 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/link-editing/WardleyLinkEditing.d.ts +38 -0
- package/dist/link-editing/WardleyLinkEditing.d.ts.map +1 -0
- package/dist/link-editing/index.d.ts +6 -0
- package/dist/link-editing/index.d.ts.map +1 -0
- package/dist/link-editing/link-url.d.ts +14 -0
- package/dist/link-editing/link-url.d.ts.map +1 -0
- package/dist/map-resize/MapProjection.d.ts +84 -0
- package/dist/map-resize/MapProjection.d.ts.map +1 -0
- package/dist/map-resize/MapResizeHandles.d.ts +57 -0
- package/dist/map-resize/MapResizeHandles.d.ts.map +1 -0
- package/dist/map-resize/ResizeAwareAutoScroll.d.ts +15 -0
- package/dist/map-resize/ResizeAwareAutoScroll.d.ts.map +1 -0
- package/dist/map-resize/index.d.ts +14 -0
- package/dist/map-resize/index.d.ts.map +1 -0
- package/dist/model/WardleyElementFactory.d.ts +36 -2
- package/dist/model/WardleyElementFactory.d.ts.map +1 -1
- package/dist/model/di-types.d.ts +4 -0
- package/dist/model/di-types.d.ts.map +1 -1
- package/dist/modeling/WardleyCopyPaste.d.ts +9 -5
- package/dist/modeling/WardleyCopyPaste.d.ts.map +1 -1
- package/dist/modeling/WardleyModeling.d.ts +16 -2
- package/dist/modeling/WardleyModeling.d.ts.map +1 -1
- package/dist/modeling/cmd/ResizeMapHandler.d.ts +24 -0
- package/dist/modeling/cmd/ResizeMapHandler.d.ts.map +1 -0
- package/dist/modeling/cmd/UpdateConfigHandler.d.ts +42 -0
- package/dist/modeling/cmd/UpdateConfigHandler.d.ts.map +1 -0
- package/dist/modeling/index.d.ts +2 -0
- package/dist/modeling/index.d.ts.map +1 -1
- package/dist/ordering/WardleyOrderingProvider.d.ts +1 -1
- package/dist/ordering/WardleyOrderingProvider.d.ts.map +1 -1
- package/dist/palette/WardleyPaletteKeyboard.d.ts +24 -0
- package/dist/palette/WardleyPaletteKeyboard.d.ts.map +1 -0
- package/dist/palette/WardleyPaletteProvider.d.ts +16 -1
- package/dist/palette/WardleyPaletteProvider.d.ts.map +1 -1
- package/dist/palette/index.d.ts +2 -1
- package/dist/palette/index.d.ts.map +1 -1
- package/dist/pan-constraint/PanConstraint.d.ts +9 -1
- package/dist/pan-constraint/PanConstraint.d.ts.map +1 -1
- package/dist/pipeline/PipelineGroupBehavior.d.ts +24 -0
- package/dist/pipeline/PipelineGroupBehavior.d.ts.map +1 -0
- package/dist/pipeline/index.d.ts +6 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/pipelineMembership.d.ts +23 -0
- package/dist/pipeline/pipelineMembership.d.ts.map +1 -0
- package/dist/popup/WardleyElementSettingsProvider.d.ts +2 -1
- package/dist/popup/WardleyElementSettingsProvider.d.ts.map +1 -1
- package/dist/rules/WardleyRules.d.ts.map +1 -1
- package/dist/snapping/StageSnapping.d.ts +6 -2
- package/dist/snapping/StageSnapping.d.ts.map +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/palette.d.ts +16 -3
- package/dist/theme/palette.d.ts.map +1 -1
- package/dist/wardley.css +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
|
+
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
3
|
+
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
4
|
+
import { default as BaseLayouter } from 'diagram-js/lib/layout/BaseLayouter';
|
|
5
|
+
import { Element, Root } from 'diagram-js/lib/model/Types';
|
|
6
|
+
import { Point } from 'diagram-js/lib/util/Types';
|
|
7
|
+
import { MapConfig, MapSize, WardleyMap } from '@miragon/wardley-schema-model';
|
|
8
|
+
import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
9
|
+
import { default as WardleyExporter } from '../io/WardleyExporter.js';
|
|
10
|
+
import { RootBusinessObject } from '../io/index.js';
|
|
11
|
+
import { default as WardleyElementFactory } from '../model/WardleyElementFactory.js';
|
|
12
|
+
export type WardleyRoot = Root & {
|
|
13
|
+
businessObject?: RootBusinessObject;
|
|
14
|
+
};
|
|
15
|
+
interface ShapeGeometry {
|
|
16
|
+
readonly x: number;
|
|
17
|
+
readonly y: number;
|
|
18
|
+
readonly width: number;
|
|
19
|
+
readonly height: number;
|
|
20
|
+
readonly drawingPoints?: Array<{
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
/** Exact pixel state of the map, to undo a live preview without any rounding or clamping. */
|
|
26
|
+
export interface ProjectionSnapshot {
|
|
27
|
+
readonly businessObject: RootBusinessObject;
|
|
28
|
+
readonly shapes: ReadonlyMap<string, ShapeGeometry>;
|
|
29
|
+
readonly waypoints: ReadonlyMap<string, Point[]>;
|
|
30
|
+
}
|
|
31
|
+
/** `config` with `size` set, or without the key when `size` is undefined. */
|
|
32
|
+
export declare function configWithSize(config: MapConfig, size: MapSize | undefined): MapConfig;
|
|
33
|
+
/**
|
|
34
|
+
* The imported Wardley root, or undefined before the first import. Unlike
|
|
35
|
+
* `canvas.getRootElement()` this never creates diagram-js's implicit root, which the next
|
|
36
|
+
* import's `clear()` would remove and so break `setRootElement`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function wardleyRootOf(canvas: Canvas): WardleyRoot | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* `rawPassthrough` without unreadable `size` statements: once the map writes a valid size, a kept
|
|
41
|
+
* one would be written after it, and OWM lets the last size line win. Comment text is never dropped.
|
|
42
|
+
*/
|
|
43
|
+
export declare function withoutRawSizeStatements(rawPassthrough: readonly string[] | undefined): readonly string[] | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Re-projects the live shapes onto a new plot size in place — no re-import, so the shape objects,
|
|
46
|
+
* the selection and the undo history survive. The normalized model is the truth; every element is
|
|
47
|
+
* placed by the same factory projection the importer uses (P7), so a resize looks exactly like a
|
|
48
|
+
* fresh import at the new size.
|
|
49
|
+
*/
|
|
50
|
+
export default class MapProjection {
|
|
51
|
+
private readonly canvas;
|
|
52
|
+
private readonly elementRegistry;
|
|
53
|
+
private readonly grid;
|
|
54
|
+
private readonly factory;
|
|
55
|
+
private readonly exporter;
|
|
56
|
+
private readonly layouter;
|
|
57
|
+
private readonly eventBus;
|
|
58
|
+
static $inject: string[];
|
|
59
|
+
constructor(canvas: Canvas, elementRegistry: ElementRegistry, grid: EvolutionGrid, factory: WardleyElementFactory, exporter: WardleyExporter, layouter: BaseLayouter, eventBus: EventBus);
|
|
60
|
+
/** The Wardley root, or undefined before the first import. */
|
|
61
|
+
root(): WardleyRoot | undefined;
|
|
62
|
+
/** The normalized truth, read under the CURRENT grid (drawings keep px-relative points). */
|
|
63
|
+
captureModel(): WardleyMap;
|
|
64
|
+
/**
|
|
65
|
+
* Stores `businessObject` on the root, redraws the grid for its config and re-projects every
|
|
66
|
+
* element of `model` onto it. Fires `wardley.config.changed`; returns the changed elements so
|
|
67
|
+
* the caller (command stack or live preview) can redraw them.
|
|
68
|
+
*/
|
|
69
|
+
apply(businessObject: RootBusinessObject, model?: WardleyMap, options?: {
|
|
70
|
+
transient?: boolean;
|
|
71
|
+
}): Element[];
|
|
72
|
+
snapshot(): ProjectionSnapshot | undefined;
|
|
73
|
+
/** Puts the map back exactly as it was when `snapshot` was taken. */
|
|
74
|
+
restore(snapshot: ProjectionSnapshot, options?: {
|
|
75
|
+
transient?: boolean;
|
|
76
|
+
}): Element[];
|
|
77
|
+
/** `transient` marks a live preview that is not part of the document (yet). */
|
|
78
|
+
private fireConfigChanged;
|
|
79
|
+
/** Redraws elements changed outside the command stack (the live preview). */
|
|
80
|
+
redraw(elements: readonly Element[]): void;
|
|
81
|
+
private layoutConnections;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=MapProjection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapProjection.d.ts","sourceRoot":"","sources":["../../src/map-resize/MapProjection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,YAAY,MAAM,oCAAoC,CAAC;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEpF,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAW,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAG3E,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG;IAAE,cAAc,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAEzE,UAAU,aAAa;IACrB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAA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IAC9D,IAAI,IAAI,WAAW,GAAG,SAAS;IAK/B,4FAA4F;IAC5F,YAAY,IAAI,UAAU;IAI1B;;;;OAIG;IACH,KAAK,CACH,cAAc,EAAE,kBAAkB,EAClC,KAAK,GAAE,UAAgC,EACvC,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAO,GACpC,OAAO,EAAE;IAqBZ,QAAQ,IAAI,kBAAkB,GAAG,SAAS;IA0B1C,qEAAqE;IACrE,OAAO,CAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,EAAE;IAuBvF,+EAA+E;IAC/E,OAAO,CAAC,iBAAiB;IAIzB,6EAA6E;IAC7E,MAAM,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI;IAI1C,OAAO,CAAC,iBAAiB;CAS1B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
|
+
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
3
|
+
import { default as Dragging } from 'diagram-js/lib/features/dragging/Dragging';
|
|
4
|
+
import { MapSize } from '@miragon/wardley-schema-model';
|
|
5
|
+
import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
6
|
+
import { default as MapProjection } from './MapProjection.js';
|
|
7
|
+
export declare const MAP_RESIZE_PREFIX = "wardley.mapResize";
|
|
8
|
+
export type ResizeAxis = 'x' | 'y' | 'xy';
|
|
9
|
+
interface ModifierKeys {
|
|
10
|
+
/** Keep the start aspect ratio. */
|
|
11
|
+
keepAspectRatio: boolean;
|
|
12
|
+
/** Free size: no 10px steps, no preset magnet. */
|
|
13
|
+
disableSnapping: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** The part of `wardleyModeling` the handles use (by DI name, to keep the features decoupled). */
|
|
16
|
+
interface MapResizeModeling {
|
|
17
|
+
resizeMap(size: MapSize | undefined): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The size a drag from `start` by (dx, dy) on `axis` asks for: 10px steps with a magnetic pull
|
|
21
|
+
* towards the presets, Shift keeps the start aspect ratio, always whole pixels within the limits.
|
|
22
|
+
*/
|
|
23
|
+
export declare function sizeForDrag(start: MapSize, axis: ResizeAxis, dx: number, dy: number, keys?: ModifierKeys): MapSize;
|
|
24
|
+
/** "1440 × 900 · Large" — the preset name only when the size matches one exactly. */
|
|
25
|
+
export declare function sizeLabel(size: MapSize): string;
|
|
26
|
+
/**
|
|
27
|
+
* Direct manipulation of the map size: handles on the plot's right edge, bottom edge and
|
|
28
|
+
* bottom-right corner. The drag previews live (grid and shapes re-projected, no command stack);
|
|
29
|
+
* on release the preview is undone and exactly ONE `wardley.map.resize` runs, so a drag is one
|
|
30
|
+
* undo step. Esc cancels; a double-click on the corner resets to the default size.
|
|
31
|
+
*/
|
|
32
|
+
export default class MapResizeHandles {
|
|
33
|
+
private readonly canvas;
|
|
34
|
+
private readonly grid;
|
|
35
|
+
private readonly dragging;
|
|
36
|
+
private readonly projection;
|
|
37
|
+
private readonly modeling;
|
|
38
|
+
static $inject: string[];
|
|
39
|
+
private readonly layer;
|
|
40
|
+
private readonly handles;
|
|
41
|
+
private badge;
|
|
42
|
+
private scale;
|
|
43
|
+
constructor(eventBus: EventBus, canvas: Canvas, grid: EvolutionGrid, dragging: Dragging, projection: MapProjection, modeling: MapResizeModeling);
|
|
44
|
+
/** Starts a resize drag on `axis` (also usable programmatically, e.g. from tests). */
|
|
45
|
+
start(event: MouseEvent, axis: ResizeAxis): void;
|
|
46
|
+
private createHandle;
|
|
47
|
+
private render;
|
|
48
|
+
private currentScale;
|
|
49
|
+
private onStart;
|
|
50
|
+
private onMove;
|
|
51
|
+
private onEnd;
|
|
52
|
+
private onCleanup;
|
|
53
|
+
private showBadge;
|
|
54
|
+
private hideBadge;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=MapResizeHandles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapResizeHandles.d.ts","sourceRoot":"","sources":["../../src/map-resize/MapResizeHandles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AACtE,OAAO,EAKL,KAAK,OAAO,EAEb,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAGpD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAcrD,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAwB1C,UAAU,YAAY;IACpB,mCAAmC;IACnC,eAAe,EAAE,OAAO,CAAC;IACzB,kDAAkD;IAClD,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,kGAAkG;AAClG,UAAU,iBAAiB;IACzB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;CAC5C;AA4BD;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,UAAU,EAChB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,YAAiE,GACtE,OAAO,CAkCT;AAED,qFAAqF;AACrF,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAK/C;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAiBjC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IApB3B,MAAM,CAAC,OAAO,WAOZ;IAEF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IACrD,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,KAAK,CAAqB;gBAGhC,QAAQ,EAAE,QAAQ,EACD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,aAAa,EACzB,QAAQ,EAAE,iBAAiB;IA6B9C,sFAAsF;IACtF,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAShD,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,MAAM;IA8Cd,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,MAAM;IAmBd,OAAO,CAAC,KAAK;IAYb,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,SAAS;IAiBjB,OAAO,CAAC,SAAS;CAGlB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as AutoScroll } from 'diagram-js/lib/features/auto-scroll/AutoScroll';
|
|
2
|
+
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
3
|
+
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
4
|
+
import { Injector } from 'didi';
|
|
5
|
+
/**
|
|
6
|
+
* diagram-js AutoScroll, except while the map is being resized: scrolling under a dragged plot
|
|
7
|
+
* corner detaches it from the pointer, and the size jumps on the next move.
|
|
8
|
+
*/
|
|
9
|
+
export default class ResizeAwareAutoScroll extends AutoScroll {
|
|
10
|
+
private readonly injector;
|
|
11
|
+
static $inject: string[];
|
|
12
|
+
constructor(config: unknown, eventBus: EventBus, canvas: Canvas, injector: Injector);
|
|
13
|
+
startScroll(point: Parameters<AutoScroll['startScroll']>[0]): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ResizeAwareAutoScroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResizeAwareAutoScroll.d.ts","sourceRoot":"","sources":["../../src/map-resize/ResizeAwareAutoScroll.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,gDAAgD,CAAC;AACxE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGrC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU;IAOzD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAN3B,OAAgB,OAAO,WAA2D;gBAGhF,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACG,QAAQ,EAAE,QAAQ;IAK5B,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;CAQ5E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModuleDeclaration } from 'didi';
|
|
2
|
+
/** In-place re-projection of all shapes onto a new plot size (used by `wardley.map.resize`). */
|
|
3
|
+
export declare const mapProjectionModule: ModuleDeclaration;
|
|
4
|
+
/**
|
|
5
|
+
* Plot edge/corner handles to resize the map by dragging (Modeler only). Needs the
|
|
6
|
+
* `wardleyModeling` service, i.e. load it together with `wardleyModelingModule`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const mapResizeModule: ModuleDeclaration;
|
|
9
|
+
export { default as MapResizeHandles, MAP_RESIZE_PREFIX, sizeForDrag, sizeLabel, } from './MapResizeHandles.js';
|
|
10
|
+
export type { ResizeAxis } from './MapResizeHandles.js';
|
|
11
|
+
export { default as MapProjection, configWithSize, withoutRawSizeStatements, wardleyRootOf, } from './MapProjection.js';
|
|
12
|
+
export type { ProjectionSnapshot, WardleyRoot } from './MapProjection.js';
|
|
13
|
+
export { default as ResizeAwareAutoScroll } from './ResizeAwareAutoScroll.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/map-resize/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAK9C,gGAAgG;AAChG,eAAO,MAAM,mBAAmB,EAAE,iBAEjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,iBAI7B,CAAC;AAEF,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,iBAAiB,EACjB,WAAW,EACX,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,OAAO,IAAI,aAAa,EACxB,cAAc,EACd,wBAAwB,EACxB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { default as ElementFactory } from 'diagram-js/lib/core/ElementFactory';
|
|
2
2
|
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
3
|
-
import { AcceleratorDirection, AcceleratorElement, AnchorElement, AnnotationElement, AttitudeElement, AttitudeKind, ComponentElement, DrawingElement, MapEdge, NoteElement, PipelineElement, SubmapElement } from '@miragon/wardley-schema-model';
|
|
3
|
+
import { AcceleratorDirection, AcceleratorElement, AnchorElement, AnnotationElement, AttitudeElement, AttitudeKind, ComponentElement, DrawingElement, MapEdge, MapElement, NoteElement, PipelineElement, SubmapElement } from '@miragon/wardley-schema-model';
|
|
4
4
|
import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
5
5
|
import { WardleyConnection, WardleyShape } from './di-types.js';
|
|
6
|
+
/**
|
|
7
|
+
* First label not in `taken`: `base` itself, otherwise the next counter. A base that already ends
|
|
8
|
+
* in a counter continues it ('Cup 2' -> 'Cup 3') instead of stacking ('Cup 2 2').
|
|
9
|
+
*/
|
|
10
|
+
export declare function nextFreeLabel(base: string, taken: ReadonlySet<string>): string;
|
|
6
11
|
export interface CreateNewExtra {
|
|
7
12
|
attitudeKind?: AttitudeKind;
|
|
8
13
|
acceleratorDirection?: AcceleratorDirection;
|
|
@@ -23,12 +28,36 @@ export default class WardleyElementFactory {
|
|
|
23
28
|
/**
|
|
24
29
|
* Returns a unique label: `base`, otherwise `base 2`, `base 3`, … Unique labels are mandatory
|
|
25
30
|
* because the OWM DSL references elements BY THEIR NAME — duplicate names would cause ID
|
|
26
|
-
* collisions on serialize/re-import and lose edges (lines).
|
|
31
|
+
* collisions on serialize/re-import and lose edges (lines). Only linkable elements count:
|
|
32
|
+
* notes and regions are never referenced, so their text must not force a suffix.
|
|
27
33
|
*
|
|
28
34
|
* @param excludeId optional ID of the element currently being renamed (does NOT count its own
|
|
29
35
|
* current name as a collision — otherwise every rename would add a suffix).
|
|
30
36
|
*/
|
|
31
37
|
uniqueLabel(base: string, excludeId?: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Batch variant for pasted copies: linkable labels unique against the map AND each other;
|
|
40
|
+
* everything else keeps its text.
|
|
41
|
+
*/
|
|
42
|
+
uniqueLabels(entries: ReadonlyArray<{
|
|
43
|
+
type: unknown;
|
|
44
|
+
label: string;
|
|
45
|
+
}>): string[];
|
|
46
|
+
/** Whether elements of `type` are referenced by name (and so need a unique label). */
|
|
47
|
+
isLinkable(type: unknown): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* @param pairableType elements of this type that still lack their OWM partner do not block a
|
|
50
|
+
* name: a standalone component may take the name of a pipeline without an anchor (and so
|
|
51
|
+
* anchor it), and such a pipeline may take the name of a free standalone component.
|
|
52
|
+
*/
|
|
53
|
+
private takenLinkableLabels;
|
|
54
|
+
/** Which partner type the element being renamed may share its new name with. */
|
|
55
|
+
private pairableTypeFor;
|
|
56
|
+
/**
|
|
57
|
+
* A pipeline without an anchor component, or a standalone (non-member) component that anchors
|
|
58
|
+
* no pipeline. Members never pair: they belong to their own pipeline.
|
|
59
|
+
*/
|
|
60
|
+
private isUnpaired;
|
|
32
61
|
/** Next free annotation number (max + 1) — palette annotations therefore never collide. */
|
|
33
62
|
private nextAnnotationNumber;
|
|
34
63
|
createComponent(el: ComponentElement): WardleyShape;
|
|
@@ -40,6 +69,11 @@ export default class WardleyElementFactory {
|
|
|
40
69
|
createAttitude(el: AttitudeElement): WardleyShape;
|
|
41
70
|
createSubmap(el: SubmapElement): WardleyShape;
|
|
42
71
|
createDrawing(el: DrawingElement): WardleyShape;
|
|
72
|
+
/**
|
|
73
|
+
* The shape for any model element, projected with the current grid. Shared by the importer and
|
|
74
|
+
* the in-place map resize, so both place every element type identically.
|
|
75
|
+
*/
|
|
76
|
+
createFromModel(el: MapElement): WardleyShape | undefined;
|
|
43
77
|
/** Builds a drawing shape from ABSOLUTE canvas points (bbox shape + relative points). */
|
|
44
78
|
drawingFromCanvasPoints(canvasPoints: ReadonlyArray<{
|
|
45
79
|
x: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyElementFactory.d.ts","sourceRoot":"","sources":["../../src/model/WardleyElementFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,WAAW,EACX,eAAe,EACf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AC,CAAC;QAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,cAAc,CAAC;KAC5B,GACL,YAAY;IA4Bf,SAAS,CACP,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,EACjC,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,cAAmB,GACzB,YAAY;IAsEf,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,GAAG,iBAAiB;IAI9F,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,GAAG,iBAAiB;IAKxF,OAAO,CAAC,IAAI;IA4BZ,OAAO,CAAC,UAAU;CAqBnB"}
|
package/dist/model/di-types.d.ts
CHANGED
|
@@ -59,6 +59,10 @@ export interface WardleyConnection extends Connection {
|
|
|
59
59
|
businessObject?: MapEdge;
|
|
60
60
|
}
|
|
61
61
|
export declare function isWardleyShape(el: unknown): el is WardleyShape;
|
|
62
|
+
/**
|
|
63
|
+
* Keyed on the type, not on `waypoints`: diagram-js lays out an interactively created connection only
|
|
64
|
+
* inside `connection.create`'s execute, so pre-execute hooks (e.g. ordering) see it without them.
|
|
65
|
+
*/
|
|
62
66
|
export declare function isWardleyConnection(el: unknown): el is WardleyConnection;
|
|
63
67
|
export declare function isComponent(el: unknown): el is WardleyShape;
|
|
64
68
|
export declare function isPipeline(el: unknown): el is WardleyShape;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di-types.d.ts","sourceRoot":"","sources":["../../src/model/di-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,OAAO,EACP,UAAU,EACV,QAAQ,EACT,MAAM,+BAA+B,CAA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E,OAAO,GAAG,EAAE,IAAI,YAAY,CAE1D;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,YAAY,CAE1D"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as ElementFactory } from 'diagram-js/lib/core/ElementFactory';
|
|
2
|
-
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
3
2
|
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
4
3
|
import { default as Create } from 'diagram-js/lib/features/create/Create';
|
|
5
4
|
import { default as Modeling } from 'diagram-js/lib/features/modeling/Modeling';
|
|
6
5
|
import { default as Mouse } from 'diagram-js/lib/features/mouse/Mouse';
|
|
7
6
|
import { default as Selection } from 'diagram-js/lib/features/selection/Selection';
|
|
7
|
+
import { default as WardleyElementFactory } from '../model/WardleyElementFactory.js';
|
|
8
8
|
/**
|
|
9
9
|
* Custom copy/paste for Wardley shapes: copies the selection including the connections BETWEEN
|
|
10
10
|
* selected shapes and assigns unique labels (the DSL references by name!).
|
|
@@ -16,14 +16,14 @@ export default class WardleyCopyPaste {
|
|
|
16
16
|
private readonly selection;
|
|
17
17
|
private readonly modeling;
|
|
18
18
|
private readonly elementFactory;
|
|
19
|
-
private readonly elementRegistry;
|
|
20
19
|
private readonly canvas;
|
|
21
20
|
private readonly create;
|
|
22
21
|
private readonly mouse;
|
|
22
|
+
private readonly wardleyElementFactory;
|
|
23
23
|
static $inject: string[];
|
|
24
24
|
private clipboard;
|
|
25
25
|
private pasteCount;
|
|
26
|
-
constructor(selection: Selection, modeling: Modeling, elementFactory: ElementFactory,
|
|
26
|
+
constructor(selection: Selection, modeling: Modeling, elementFactory: ElementFactory, canvas: Canvas, create: Create, mouse: Mouse, wardleyElementFactory: WardleyElementFactory);
|
|
27
27
|
/** Copies the current selection. Returns false if nothing copyable is selected. */
|
|
28
28
|
copy(): boolean;
|
|
29
29
|
/**
|
|
@@ -36,9 +36,13 @@ export default class WardleyCopyPaste {
|
|
|
36
36
|
duplicate(): boolean;
|
|
37
37
|
/** Builds fresh clone elements (unique labels, internal connections rewired). */
|
|
38
38
|
private buildClones;
|
|
39
|
+
/**
|
|
40
|
+
* Unique labels for the clones. A pipeline copied together with its anchor component (the
|
|
41
|
+
* component written under the pipeline's name) keeps that pairing: both get the same new name,
|
|
42
|
+
* otherwise the copy loses its anchor and the renamed component would join a box as a member.
|
|
43
|
+
*/
|
|
44
|
+
private cloneLabels;
|
|
39
45
|
/** One `elements.create` command = one undo step; position = group center + offset. */
|
|
40
46
|
private insertWithOffset;
|
|
41
|
-
/** Labels unique against the registry AND within the paste batch. */
|
|
42
|
-
private uniqueLabels;
|
|
43
47
|
}
|
|
44
48
|
//# sourceMappingURL=WardleyCopyPaste.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyCopyPaste.d.ts","sourceRoot":"","sources":["../../src/modeling/WardleyCopyPaste.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"WardleyCopyPaste.d.ts","sourceRoot":"","sources":["../../src/modeling/WardleyCopyPaste.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,qCAAqC,CAAC;AAC7D,OAAO,KAAK,SAAS,MAAM,6CAA6C,CAAC;AASzE,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAsD3E;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAejC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IApBxC,MAAM,CAAC,OAAO,WAQZ;IAEF,OAAO,CAAC,SAAS,CAA+E;IAChG,OAAO,CAAC,UAAU,CAAK;gBAGJ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB;IAG/D,mFAAmF;IACnF,IAAI,IAAI,OAAO;IAwCf;;;;OAIG;IACH,KAAK,IAAI,OAAO;IAchB,oFAAoF;IACpF,SAAS,IAAI,OAAO;IAKpB,iFAAiF;IACjF,OAAO,CAAC,WAAW;IAsCnB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IA8BnB,uFAAuF;IACvF,OAAO,CAAC,gBAAgB;CAYzB"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { default as CommandStack } from 'diagram-js/lib/command/CommandStack';
|
|
2
|
-
import {
|
|
2
|
+
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
3
|
+
import { MapSize, Method } from '@miragon/wardley-schema-model';
|
|
3
4
|
import { WardleyConnection, WardleyShape } from '../model/di-types.js';
|
|
5
|
+
import { MapConfigUpdate } from './cmd/UpdateConfigHandler.js';
|
|
6
|
+
export declare const RESIZE_MAP = "wardley.map.resize";
|
|
7
|
+
export declare const UPDATE_CONFIG = "wardley.config.update";
|
|
4
8
|
export interface EvolveOptions {
|
|
5
9
|
newLabel?: string;
|
|
6
10
|
method?: Method;
|
|
@@ -11,8 +15,18 @@ export interface EvolveOptions {
|
|
|
11
15
|
*/
|
|
12
16
|
export default class WardleyModeling {
|
|
13
17
|
private readonly commandStack;
|
|
18
|
+
private readonly canvas;
|
|
14
19
|
static $inject: string[];
|
|
15
|
-
constructor(commandStack: CommandStack);
|
|
20
|
+
constructor(commandStack: CommandStack, canvas: Canvas);
|
|
21
|
+
/**
|
|
22
|
+
* Sets the plot size (`undefined` removes the `size` line) as one undoable step that re-projects
|
|
23
|
+
* the shapes in place. Pass an already normalized size (see `normalizeMapSize`). Does nothing
|
|
24
|
+
* when the config would not change.
|
|
25
|
+
*/
|
|
26
|
+
resizeMap(size: MapSize | undefined): void;
|
|
27
|
+
/** Changes config fields (title, labels, …) as one undoable step; `undefined` removes a field. */
|
|
28
|
+
updateConfig(properties: MapConfigUpdate): void;
|
|
29
|
+
private currentConfig;
|
|
16
30
|
updateProperties(element: WardleyShape | WardleyConnection, properties: Record<string, unknown>): void;
|
|
17
31
|
updateLabel(element: WardleyShape, label: string): void;
|
|
18
32
|
evolveComponent(element: WardleyShape, targetEvolution: number, opts?: EvolveOptions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyModeling.d.ts","sourceRoot":"","sources":["../../src/modeling/WardleyModeling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"WardleyModeling.d.ts","sourceRoot":"","sources":["../../src/modeling/WardleyModeling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAK5E,OAA4B,EAAE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGzF,eAAO,MAAM,UAAU,uBAAuB,C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@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as CommandHandler } from 'diagram-js/lib/command/CommandHandler';
|
|
2
|
+
import { ElementLike } from 'diagram-js/lib/core/Types';
|
|
3
|
+
import { MapSize } from '@miragon/wardley-schema-model';
|
|
4
|
+
import { MapProjection } from '../../map-resize/index.js';
|
|
5
|
+
export interface ResizeMapContext {
|
|
6
|
+
/** New explicit size; `undefined` removes the `size` line (default plot). */
|
|
7
|
+
size: MapSize | undefined;
|
|
8
|
+
/** set internally by the handler (for revert). */
|
|
9
|
+
oldSize?: MapSize | undefined;
|
|
10
|
+
oldRawPassthrough?: readonly string[] | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Undoable map resize: changes `config.size` and re-projects the existing shapes in place from
|
|
14
|
+
* their normalized model. Only the size (and superseded raw `size` lines) is touched, so the DSL
|
|
15
|
+
* changes in exactly one line.
|
|
16
|
+
*/
|
|
17
|
+
export default class ResizeMapHandler implements CommandHandler {
|
|
18
|
+
private readonly projection;
|
|
19
|
+
static $inject: string[];
|
|
20
|
+
constructor(projection: MapProjection);
|
|
21
|
+
execute(context: ResizeMapContext): ElementLike[];
|
|
22
|
+
revert(context: ResizeMapContext): ElementLike[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=ResizeMapHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResizeMapHandler.d.ts","sourceRoot":"","sources":["../../../src/modeling/cmd/ResizeMapHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CACnD;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,cAAc;IAGjD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAFvC,MAAM,CAAC,OAAO,WAA4B;gBAEb,UAAU,EAAE,aAAa;IAEtD,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW,EAAE;IAejD,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW,EAAE;CAUjD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as CommandHandler } from 'diagram-js/lib/command/CommandHandler';
|
|
2
|
+
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
3
|
+
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
4
|
+
import { ElementLike } from 'diagram-js/lib/core/Types';
|
|
5
|
+
import { MapConfig } from '@miragon/wardley-schema-model';
|
|
6
|
+
import { default as EvolutionGrid } from '../../evolution-grid/EvolutionGrid.js';
|
|
7
|
+
/**
|
|
8
|
+
* Config fields a `wardley.config.update` may change; `undefined` removes the field. The size is
|
|
9
|
+
* excluded on purpose: it needs the re-projection of `wardley.map.resize`.
|
|
10
|
+
*/
|
|
11
|
+
export type MapConfigUpdate = {
|
|
12
|
+
-readonly [Key in Exclude<keyof MapConfig, 'size'>]?: MapConfig[Key] | undefined;
|
|
13
|
+
};
|
|
14
|
+
export interface UpdateConfigContext {
|
|
15
|
+
properties: MapConfigUpdate;
|
|
16
|
+
/** set internally by the handler (for revert). */
|
|
17
|
+
oldProperties?: MapConfigUpdate;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Writes `update` into the root's config (`undefined` removes a field; `size` is left alone, it
|
|
21
|
+
* needs the re-projection of `wardley.map.resize`), redraws the axes and fires
|
|
22
|
+
* `wardley.config.changed`. Returns the previous values of exactly the written fields. The one place
|
|
23
|
+
* a config changes in place: the undoable command and the viewers' direct path both use it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function applyConfigUpdate(canvas: Canvas, grid: EvolutionGrid, eventBus: EventBus, update: MapConfigUpdate, options?: {
|
|
26
|
+
transient?: boolean;
|
|
27
|
+
}): MapConfigUpdate;
|
|
28
|
+
/**
|
|
29
|
+
* Undoable change of map config fields (title, evolution labels, …). Only the given fields are
|
|
30
|
+
* swapped, so it composes with any other config change in the undo history.
|
|
31
|
+
*/
|
|
32
|
+
export default class UpdateConfigHandler implements CommandHandler {
|
|
33
|
+
private readonly canvas;
|
|
34
|
+
private readonly grid;
|
|
35
|
+
private readonly eventBus;
|
|
36
|
+
static $inject: string[];
|
|
37
|
+
constructor(canvas: Canvas, grid: EvolutionGrid, eventBus: EventBus);
|
|
38
|
+
execute(context: UpdateConfigContext): ElementLike[];
|
|
39
|
+
revert(context: UpdateConfigContext): ElementLike[];
|
|
40
|
+
private apply;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=UpdateConfigHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateConfigHandler.d.ts","sourceRoot":"","sources":["../../../src/modeling/cmd/UpdateConfigHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAC;AAGvE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,UAAU,GAAG,IAAI,OAAO,CAAC,MAAM,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,SAAS;CACjF,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,eAAe,CAAC;IAC5B,kDAAkD;IAClD,aAAa,CAAC,EAAE,eAAe,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,GACpC,eAAe,CAoBjB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,cAAc;IAI9D,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAL3B,MAAM,CAAC,OAAO,WAA2C;gBAGtC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,QAAQ;IAGrC,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,EAAE;IAKpD,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,EAAE;IAKnD,OAAO,CAAC,KAAK;CAGd"}
|
package/dist/modeling/index.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ import { ModuleDeclaration } from 'didi';
|
|
|
3
3
|
export declare const wardleyModelingModule: ModuleDeclaration;
|
|
4
4
|
export { default as WardleyModeling } from './WardleyModeling.js';
|
|
5
5
|
export { default as WardleyCopyPaste } from './WardleyCopyPaste.js';
|
|
6
|
+
export { RESIZE_MAP, UPDATE_CONFIG } from './WardleyModeling.js';
|
|
6
7
|
export type { EvolveOptions } from './WardleyModeling.js';
|
|
8
|
+
export type { MapConfigUpdate } from './cmd/UpdateConfigHandler.js';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modeling/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modeling/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAO9C,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,EAAE,iBAMnC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
|
3
3
|
import { ElementLike, ShapeLike } from 'diagram-js/lib/model/Types';
|
|
4
4
|
/**
|
|
5
5
|
* Keeps the z-order stable for INTERACTIVELY created/moved elements, matching the import order:
|
|
6
|
-
* frames (attitude/pipeline) at the back,
|
|
6
|
+
* frames (attitude/pipeline) at the back, then dependencies, then flows, nodes on top. Without this,
|
|
7
7
|
* connections drawn in the editor would land above the nodes (unlike imported ones).
|
|
8
8
|
*/
|
|
9
9
|
export default class WardleyOrderingProvider extends OrderingProvider {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyOrderingProvider.d.ts","sourceRoot":"","sources":["../../src/ordering/WardleyOrderingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,mDAAmD,CAAC;AACjF,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAYzE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,gBAAgB;IACnE,OAAgB,OAAO,WAAgB;gBAE3B,QAAQ,EAAE,QAAQ;IAIrB,WAAW,CAClB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,SAAS,GACnB;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;
|
|
1
|
+
{"version":3,"file":"WardleyOrderingProvider.d.ts","sourceRoot":"","sources":["../../src/ordering/WardleyOrderingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,mDAAmD,CAAC;AACjF,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAYzE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,gBAAgB;IACnE,OAAgB,OAAO,WAAgB;gBAE3B,QAAQ,EAAE,QAAQ;IAIrB,WAAW,CAClB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,SAAS,GACnB;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;CAqBzC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
2
|
+
import { default as Palette } from 'diagram-js/lib/features/palette/Palette';
|
|
3
|
+
import { default as WardleyPaletteProvider } from './WardleyPaletteProvider.js';
|
|
4
|
+
/**
|
|
5
|
+
* Makes the palette a keyboard-operable toolbar (WAI-ARIA toolbar pattern): one Tab stop with a
|
|
6
|
+
* roving tabindex, arrow keys / Home / End move between tools, Enter or Space activates the focused
|
|
7
|
+
* one. A create tool has no pointer position to attach the new element to, so it is placed at the
|
|
8
|
+
* centre of the visible plot instead (see `WardleyPaletteProvider.createAtVisibleCenter`).
|
|
9
|
+
*/
|
|
10
|
+
export default class WardleyPaletteKeyboard {
|
|
11
|
+
private readonly palette;
|
|
12
|
+
private readonly provider;
|
|
13
|
+
static $inject: string[];
|
|
14
|
+
private container;
|
|
15
|
+
private activeAction;
|
|
16
|
+
constructor(eventBus: EventBus, palette: Palette, provider: WardleyPaletteProvider);
|
|
17
|
+
private attach;
|
|
18
|
+
private entries;
|
|
19
|
+
private entryOf;
|
|
20
|
+
private updateTabStops;
|
|
21
|
+
private onKeydown;
|
|
22
|
+
private activate;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=WardleyPaletteKeyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WardleyPaletteKeyboard.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyPaletteKeyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AACnE,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AAQtE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAQvC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,MAAM,CAAC,OAAO,WAAqD;IAEnE,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,YAAY,CAAqB;gBAGvC,QAAQ,EAAE,QAAQ,EACD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,sBAAsB;IAUnD,OAAO,CAAC,MAAM;IAkBd,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,SAAS;IA2BjB,OAAO,CAAC,QAAQ;CAYjB"}
|
|
@@ -4,13 +4,28 @@ import { default as LassoTool } from 'diagram-js/lib/features/lasso-tool/LassoTo
|
|
|
4
4
|
import { default as WardleyDrawTool } from '../draw-tool/WardleyDrawTool.js';
|
|
5
5
|
import { PaletteEntries, default as PaletteProvider } from 'diagram-js/lib/features/palette/PaletteProvider';
|
|
6
6
|
import { default as WardleyElementFactory } from '../model/WardleyElementFactory.js';
|
|
7
|
+
import { Injector } from 'didi';
|
|
8
|
+
import { WardleyShape } from '../model/di-types.js';
|
|
7
9
|
export default class WardleyPaletteProvider implements PaletteProvider {
|
|
8
10
|
private readonly create;
|
|
9
11
|
private readonly factory;
|
|
10
12
|
private readonly lassoTool;
|
|
11
13
|
private readonly drawTool;
|
|
14
|
+
private readonly injector;
|
|
12
15
|
static $inject: string[];
|
|
13
|
-
|
|
16
|
+
/** diagram-js >= 15.28 renders `title` + `shortcut` as a styled tooltip; older ones need `title`. */
|
|
17
|
+
private readonly hasStyledTooltip;
|
|
18
|
+
constructor(palette: Palette, create: Create, factory: WardleyElementFactory, lassoTool: LassoTool, drawTool: WardleyDrawTool, injector: Injector);
|
|
14
19
|
getPaletteEntries(): PaletteEntries;
|
|
20
|
+
/**
|
|
21
|
+
* Keyboard path for a create entry: places the new element at the centre of the visible part of
|
|
22
|
+
* the plot (no pointer position to attach it to), selects it and opens its label editor.
|
|
23
|
+
* Returns the created shape, or undefined for non-create entries.
|
|
24
|
+
*/
|
|
25
|
+
createAtVisibleCenter(entryId: string): WardleyShape | undefined;
|
|
26
|
+
private createShapeFor;
|
|
27
|
+
private freeCenterPosition;
|
|
28
|
+
private describe;
|
|
29
|
+
private entryHtml;
|
|
15
30
|
}
|
|
16
31
|
//# sourceMappingURL=WardleyPaletteProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyPaletteProvider.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyPaletteProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AACnE,OAAO,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AAe,EACzB,QAAQ,EAAE,QAAQ;IASrC,iBAAiB,IAAI,cAAc;IAqCnC;;;;OAIG;IACH,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAuBhE,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,kBAAkB;IA6C1B,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,SAAS;CAQlB"}
|
package/dist/palette/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ModuleDeclaration } from 'didi';
|
|
2
|
-
/** Tool palette (drag-to-create). */
|
|
2
|
+
/** Tool palette (drag-to-create, keyboard-operable toolbar). */
|
|
3
3
|
export declare const wardleyPaletteModule: ModuleDeclaration;
|
|
4
4
|
export { default as WardleyPaletteProvider } from './WardleyPaletteProvider.js';
|
|
5
|
+
export { default as WardleyPaletteKeyboard } from './WardleyPaletteKeyboard.js';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/palette/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/palette/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI9C,gEAAgE;AAChE,eAAO,MAAM,oBAAoB,EAAE,iBAIlC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -5,14 +5,22 @@ import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
|
5
5
|
* Keeps the map in view while scrolling and zooming.
|
|
6
6
|
* Without this the user could scroll the map completely off-screen into empty space.
|
|
7
7
|
* After every move we pull the visible area back so it stays close to the map,
|
|
8
|
-
* leaving only a small margin of empty space around it.
|
|
8
|
+
* leaving only a small margin of empty space around it. "The map" is the plot plus any content
|
|
9
|
+
* reaching beyond it (long labels at the commodity edge, notes in the margin).
|
|
9
10
|
*/
|
|
10
11
|
export default class PanConstraint {
|
|
11
12
|
private readonly canvas;
|
|
12
13
|
private readonly grid;
|
|
13
14
|
static $inject: string[];
|
|
14
15
|
private applying;
|
|
16
|
+
/** Content bounds are measured lazily (getBBox), at most once per change of the map. */
|
|
17
|
+
private contentBounds;
|
|
18
|
+
/** A config change (resize) happened; re-check once its elements are redrawn. */
|
|
19
|
+
private constrainAfterCommand;
|
|
15
20
|
constructor(eventBus: EventBus, canvas: Canvas, grid: EvolutionGrid);
|
|
21
|
+
/** Plot (with axis margins) united with everything drawn on the element layer. */
|
|
22
|
+
private bounds;
|
|
23
|
+
private measureContent;
|
|
16
24
|
private constrain;
|
|
17
25
|
}
|
|
18
26
|
//# sourceMappingURL=PanConstraint.d.ts.map
|