@miragon/wardley-renderer 0.6.3 → 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.
Files changed (133) hide show
  1. package/README.md +37 -1
  2. package/dist/Modeler.d.ts +5 -0
  3. package/dist/Modeler.d.ts.map +1 -1
  4. package/dist/WardleyBaseViewer.d.ts +66 -8
  5. package/dist/WardleyBaseViewer.d.ts.map +1 -1
  6. package/dist/a11y/canvasFocus.d.ts +17 -0
  7. package/dist/a11y/canvasFocus.d.ts.map +1 -0
  8. package/dist/a11y/describeCanvas.d.ts +8 -0
  9. package/dist/a11y/describeCanvas.d.ts.map +1 -0
  10. package/dist/a11y/index.d.ts +5 -0
  11. package/dist/a11y/index.d.ts.map +1 -0
  12. package/dist/append/WardleyAppendBehavior.d.ts +7 -6
  13. package/dist/append/WardleyAppendBehavior.d.ts.map +1 -1
  14. package/dist/color-picker/WardleyColorPicker.d.ts +7 -2
  15. package/dist/color-picker/WardleyColorPicker.d.ts.map +1 -1
  16. package/dist/context-pad/WardleyContextPad.d.ts +30 -0
  17. package/dist/context-pad/WardleyContextPad.d.ts.map +1 -0
  18. package/dist/context-pad/WardleyContextPadProvider.d.ts +23 -1
  19. package/dist/context-pad/WardleyContextPadProvider.d.ts.map +1 -1
  20. package/dist/context-pad/index.d.ts +1 -0
  21. package/dist/context-pad/index.d.ts.map +1 -1
  22. package/dist/draw/WardleyRenderer.d.ts +8 -0
  23. package/dist/draw/WardleyRenderer.d.ts.map +1 -1
  24. package/dist/draw/icons.d.ts +9 -2
  25. package/dist/draw/icons.d.ts.map +1 -1
  26. package/dist/draw/index.d.ts +2 -1
  27. package/dist/draw/index.d.ts.map +1 -1
  28. package/dist/draw/label-layout.d.ts +59 -0
  29. package/dist/draw/label-layout.d.ts.map +1 -0
  30. package/dist/draw/palette-icons.d.ts +1 -0
  31. package/dist/draw/palette-icons.d.ts.map +1 -1
  32. package/dist/draw/styles.d.ts +16 -17
  33. package/dist/draw/styles.d.ts.map +1 -1
  34. package/dist/draw-tool/WardleyDrawTool.d.ts +12 -1
  35. package/dist/draw-tool/WardleyDrawTool.d.ts.map +1 -1
  36. package/dist/draw-tool/WardleyDrawingHandles.d.ts +1 -0
  37. package/dist/draw-tool/WardleyDrawingHandles.d.ts.map +1 -1
  38. package/dist/editor-state.d.ts +46 -0
  39. package/dist/editor-state.d.ts.map +1 -0
  40. package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts +58 -24
  41. package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts.map +1 -1
  42. package/dist/evolution-grid/EvolutionGrid.d.ts +2 -0
  43. package/dist/evolution-grid/EvolutionGrid.d.ts.map +1 -1
  44. package/dist/evolution-grid/index.d.ts.map +1 -1
  45. package/dist/evolve/WardleyEvolveDragging.d.ts.map +1 -1
  46. package/dist/evolve/constants.d.ts +3 -0
  47. package/dist/evolve/constants.d.ts.map +1 -0
  48. package/dist/evolve/index.d.ts +1 -0
  49. package/dist/evolve/index.d.ts.map +1 -1
  50. package/dist/index.d.ts +20 -3
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +4003 -1881
  53. package/dist/index.js.map +1 -1
  54. package/dist/io/WardleyExporter.d.ts +3 -1
  55. package/dist/io/WardleyExporter.d.ts.map +1 -1
  56. package/dist/io/WardleyImporter.d.ts.map +1 -1
  57. package/dist/io/WardleySourceOrder.d.ts +23 -0
  58. package/dist/io/WardleySourceOrder.d.ts.map +1 -0
  59. package/dist/io/exportBounds.d.ts +15 -0
  60. package/dist/io/exportBounds.d.ts.map +1 -0
  61. package/dist/io/index.d.ts +5 -0
  62. package/dist/io/index.d.ts.map +1 -1
  63. package/dist/io/rasterize.d.ts +25 -0
  64. package/dist/io/rasterize.d.ts.map +1 -0
  65. package/dist/io/saveSvg.d.ts +1 -1
  66. package/dist/io/saveSvg.d.ts.map +1 -1
  67. package/dist/io/types.d.ts +5 -0
  68. package/dist/io/types.d.ts.map +1 -1
  69. package/dist/keyboard/WardleyKeyboard.d.ts +44 -4
  70. package/dist/keyboard/WardleyKeyboard.d.ts.map +1 -1
  71. package/dist/label-drag/WardleyLabelDragging.d.ts +56 -0
  72. package/dist/label-drag/WardleyLabelDragging.d.ts.map +1 -0
  73. package/dist/label-drag/index.d.ts +5 -0
  74. package/dist/label-drag/index.d.ts.map +1 -0
  75. package/dist/label-editing/WardleyLabelEditing.d.ts +62 -6
  76. package/dist/label-editing/WardleyLabelEditing.d.ts.map +1 -1
  77. package/dist/label-editing/fieldError.d.ts +13 -0
  78. package/dist/label-editing/fieldError.d.ts.map +1 -0
  79. package/dist/label-editing/index.d.ts +1 -0
  80. package/dist/label-editing/index.d.ts.map +1 -1
  81. package/dist/link-editing/WardleyLinkEditing.d.ts +38 -0
  82. package/dist/link-editing/WardleyLinkEditing.d.ts.map +1 -0
  83. package/dist/link-editing/index.d.ts +6 -0
  84. package/dist/link-editing/index.d.ts.map +1 -0
  85. package/dist/link-editing/link-url.d.ts +14 -0
  86. package/dist/link-editing/link-url.d.ts.map +1 -0
  87. package/dist/map-resize/MapProjection.d.ts +84 -0
  88. package/dist/map-resize/MapProjection.d.ts.map +1 -0
  89. package/dist/map-resize/MapResizeHandles.d.ts +57 -0
  90. package/dist/map-resize/MapResizeHandles.d.ts.map +1 -0
  91. package/dist/map-resize/ResizeAwareAutoScroll.d.ts +15 -0
  92. package/dist/map-resize/ResizeAwareAutoScroll.d.ts.map +1 -0
  93. package/dist/map-resize/index.d.ts +14 -0
  94. package/dist/map-resize/index.d.ts.map +1 -0
  95. package/dist/model/WardleyElementFactory.d.ts +36 -2
  96. package/dist/model/WardleyElementFactory.d.ts.map +1 -1
  97. package/dist/modeling/WardleyCopyPaste.d.ts +9 -5
  98. package/dist/modeling/WardleyCopyPaste.d.ts.map +1 -1
  99. package/dist/modeling/WardleyModeling.d.ts +16 -2
  100. package/dist/modeling/WardleyModeling.d.ts.map +1 -1
  101. package/dist/modeling/cmd/ResizeMapHandler.d.ts +24 -0
  102. package/dist/modeling/cmd/ResizeMapHandler.d.ts.map +1 -0
  103. package/dist/modeling/cmd/UpdateConfigHandler.d.ts +42 -0
  104. package/dist/modeling/cmd/UpdateConfigHandler.d.ts.map +1 -0
  105. package/dist/modeling/index.d.ts +2 -0
  106. package/dist/modeling/index.d.ts.map +1 -1
  107. package/dist/ordering/WardleyOrderingProvider.d.ts +1 -1
  108. package/dist/ordering/WardleyOrderingProvider.d.ts.map +1 -1
  109. package/dist/palette/WardleyPaletteKeyboard.d.ts +24 -0
  110. package/dist/palette/WardleyPaletteKeyboard.d.ts.map +1 -0
  111. package/dist/palette/WardleyPaletteProvider.d.ts +16 -1
  112. package/dist/palette/WardleyPaletteProvider.d.ts.map +1 -1
  113. package/dist/palette/index.d.ts +2 -1
  114. package/dist/palette/index.d.ts.map +1 -1
  115. package/dist/pan-constraint/PanConstraint.d.ts +9 -1
  116. package/dist/pan-constraint/PanConstraint.d.ts.map +1 -1
  117. package/dist/pipeline/PipelineGroupBehavior.d.ts +24 -0
  118. package/dist/pipeline/PipelineGroupBehavior.d.ts.map +1 -0
  119. package/dist/pipeline/index.d.ts +6 -0
  120. package/dist/pipeline/index.d.ts.map +1 -0
  121. package/dist/pipeline/pipelineMembership.d.ts +23 -0
  122. package/dist/pipeline/pipelineMembership.d.ts.map +1 -0
  123. package/dist/popup/WardleyElementSettingsProvider.d.ts +2 -1
  124. package/dist/popup/WardleyElementSettingsProvider.d.ts.map +1 -1
  125. package/dist/rules/WardleyRules.d.ts.map +1 -1
  126. package/dist/snapping/StageSnapping.d.ts +6 -2
  127. package/dist/snapping/StageSnapping.d.ts.map +1 -1
  128. package/dist/theme/index.d.ts +1 -1
  129. package/dist/theme/index.d.ts.map +1 -1
  130. package/dist/theme/palette.d.ts +16 -3
  131. package/dist/theme/palette.d.ts.map +1 -1
  132. package/dist/wardley.css +1 -1
  133. package/package.json +7 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapProjection.d.ts","sourceRoot":"","sources":["../../src/map-resize/Map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,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,I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roll/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,aAAa,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AAGpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,oBAAoB,CAAC,EAAE,oBAAo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Y,CAAC,EAAE,EAAE,aAAa,GAAG,YAAY;IAI7C,aAAa,CAAC,EAAE,EAAE,cAAc,GAAG,YAAY;IAW/C;;;OAGG;IACH,eAAe,CAAC,EAAE,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS;IA4BzD,yFAAyF;IACzF,uBAAuB,CACrB,YAAY,EAAE,aAAa,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EACrD,KAAK,GAAE;QACL,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,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"}
@@ -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, elementRegistry: ElementRegistry, canvas: Canvas, create: Create, mouse: Mouse);
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,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO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AC;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 { Method } from '@miragon/wardley-schema-model';
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;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAY5E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAGtB,OAAO,CAAC,QAAQ,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andHandler';
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"}
@@ -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;AAM9C,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,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,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, connections in the middle, nodes on top. Without this,
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;CAiBzC"}
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
- constructor(palette: Palette, create: Create, factory: WardleyElementFactory, lassoTool: LassoTool, drawTool: WardleyDrawTool);
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,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,OAAO,KAAK,eAAe,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EACV,cAAc,EAEd,OAAO,IAAI,eAAe,EAC3B,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAkI3E,MAAM,CAAC,OAAO,OAAO,sBAAuB,YAAW,eAAe;IAKlE,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAP3B,MAAM,CAAC,OAAO,WAAkF;gBAG9F,OAAO,EAAE,OAAO,EACC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,eAAe;IAK5C,iBAAiB,IAAI,cAAc;CAsCpC"}
1
+ {"version":3,"file":"WardleyPaletteProvider.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyPaletteProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AACnE,OAAO,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,OAAO,KAAK,eAAe,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EACV,cAAc,EAEd,OAAO,IAAI,eAAe,EAC3B,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAO3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EAAkB,KAAK,YAAY,EAAyB,MAAM,sBAAsB,CAAC;AAoKhG,MAAM,CAAC,OAAO,OAAO,sBAAuB,YAAW,eAAe;IAelE,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAlB3B,MAAM,CAAC,OAAO,WAOZ;IAEF,qGAAqG;IACrG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;gBAGzC,OAAO,EAAE,OAAO,EACC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,eAAe,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"}
@@ -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;AAG9C,qCAAqC;AACrC,eAAO,MAAM,oBAAoB,EAAE,iBAGlC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,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
@@ -1 +1 @@
1
- {"version":3,"file":"PanConstraint.d.ts","sourceRoot":"","sources":["../../src/pan-constraint/PanConstraint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AAsBpE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IAO9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAPvB,MAAM,CAAC,OAAO,WAA2C;IAEzD,OAAO,CAAC,QAAQ,CAAS;gBAGvB,QAAQ,EAAE,QAAQ,EACD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,aAAa;IAQtC,OAAO,CAAC,SAAS;CAuClB"}
1
+ {"version":3,"file":"PanConstraint.d.ts","sourceRoot":"","sources":["../../src/pan-constraint/PanConstraint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AAmDpE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IAW9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAXvB,MAAM,CAAC,OAAO,WAA2C;IAEzD,OAAO,CAAC,QAAQ,CAAS;IACzB,wFAAwF;IACxF,OAAO,CAAC,aAAa,CAA4B;IACjD,iFAAiF;IACjF,OAAO,CAAC,qBAAqB,CAAS;gBAGpC,QAAQ,EAAE,QAAQ,EACD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,aAAa;IA2BtC,kFAAkF;IAClF,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,SAAS;CAwClB"}
@@ -0,0 +1,24 @@
1
+ import { default as CommandInterceptor } from 'diagram-js/lib/command/CommandInterceptor';
2
+ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
3
+ import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
4
+ import { default as Canvas } from 'diagram-js/lib/core/Canvas';
5
+ import { Injector } from 'didi';
6
+ export declare const DROP_TARGET_MARKER = "wardley-drop-target";
7
+ /**
8
+ * Makes a pipeline behave like a group (diagram-js AttachSupport pattern): dragging or nudging the
9
+ * box carries its member components and its anchor component, dragging the anchor component shows
10
+ * the box following vertically (the constraint behavior moves it on drop), and a dragged component
11
+ * highlights the pipeline it would join.
12
+ */
13
+ export default class PipelineGroupBehavior extends CommandInterceptor {
14
+ private readonly elementRegistry;
15
+ private readonly canvas;
16
+ static $inject: string[];
17
+ constructor(eventBus: EventBus, elementRegistry: ElementRegistry, canvas: Canvas, injector: Injector);
18
+ private withFollowers;
19
+ /** Pipelines (and their members) whose anchor component is dragged without them. */
20
+ private carriedVertically;
21
+ private dropTargetFor;
22
+ private markDropTarget;
23
+ }
24
+ //# sourceMappingURL=PipelineGroupBehavior.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PipelineGroupBehavior.d.ts","sourceRoot":"","sources":["../../src/pipeline/PipelineGroupBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,2CAA2C,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAiCrC,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AA2BxD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,kBAAkB;IAKjE,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,OAAgB,OAAO,WAAyD;gBAG9E,QAAQ,EAAE,QAAQ,EACD,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,EAC/B,QAAQ,EAAE,QAAQ;IAmFpB,OAAO,CAAC,aAAa;IASrB,oFAAoF;IACpF,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,cAAc;CAQvB"}
@@ -0,0 +1,6 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ /** Pipelines move as groups with their members and anchor component (editor-only). */
3
+ export declare const pipelineGroupModule: ModuleDeclaration;
4
+ export { default as PipelineGroupBehavior, DROP_TARGET_MARKER } from './PipelineGroupBehavior.js';
5
+ export { anchorComponentOf, centerOf, membersOf, pipelineAnchoredBy, pipelineAt, pipelineFollowers, } from './pipelineMembership.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,sFAAsF;AACtF,eAAO,MAAM,mBAAmB,EAAE,iBAGjC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,iBAAiB,GAClB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
2
+ import { WardleyShape } from '../model/di-types.js';
3
+ interface Point {
4
+ x: number;
5
+ y: number;
6
+ }
7
+ export declare function centerOf(shape: WardleyShape): Point;
8
+ export declare function pipelineContains(pipeline: WardleyShape, point: Point): boolean;
9
+ export declare function allPipelines(registry: ElementRegistry): WardleyShape[];
10
+ export declare function membersOf(registry: ElementRegistry, pipeline: WardleyShape): WardleyShape[];
11
+ /** The OWM anchor: the standalone component written under the pipeline's name. */
12
+ export declare function anchorComponentOf(registry: ElementRegistry, pipeline: WardleyShape): WardleyShape | undefined;
13
+ /** The pipeline a component anchors (same name, not one of its members). */
14
+ export declare function pipelineAnchoredBy(registry: ElementRegistry, component: WardleyShape): WardleyShape | undefined;
15
+ /** Everything that moves together with a pipeline box: its members and its anchor component. */
16
+ export declare function pipelineFollowers(registry: ElementRegistry, pipeline: WardleyShape): WardleyShape[];
17
+ /**
18
+ * The pipeline a component would join when its centre sits at `point`. The pipeline it anchors is
19
+ * never a candidate, and its current pipeline wins over overlapping boxes.
20
+ */
21
+ export declare function pipelineAt(registry: ElementRegistry, component: WardleyShape, point: Point, excluded?: ReadonlySet<unknown>): WardleyShape | undefined;
22
+ export {};
23
+ //# sourceMappingURL=pipelineMembership.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipelineMembership.d.ts","sourceRoot":"","sources":["../../src/pipeline/pipelineMembership.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAElF,UAAU,KAAK;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,CAEnD;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAO9E;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,eAAe,GAAG,YAAY,EAAE,CAEtE;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,GAAG,YAAY,EAAE,CAI3F;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,YAAY,GACrB,YAAY,GAAG,SAAS,CAK1B;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,YAAY,GACtB,YAAY,GAAG,SAAS,CAM1B;AAED,gGAAgG;AAChG,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,YAAY,GACrB,YAAY,EAAE,CAGhB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,YAAY,EACvB,KAAK,EAAE,KAAK,EACZ,QAAQ,GAAE,WAAW,CAAC,OAAO,CAAa,GACzC,YAAY,GAAG,SAAS,CAQ1B"}
@@ -1,3 +1,4 @@
1
+ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
1
2
  import { default as PopupMenu, PopupMenuTarget } from 'diagram-js/lib/features/popup-menu/PopupMenu';
2
3
  import { PopupMenuEntries, default as PopupMenuProvider } from 'diagram-js/lib/features/popup-menu/PopupMenuProvider';
3
4
  import { default as WardleyModeling } from '../modeling/WardleyModeling.js';
@@ -10,7 +11,7 @@ export declare const POPUP_PROVIDER_ID = "wardley-element-settings";
10
11
  export default class WardleyElementSettingsProvider implements PopupMenuProvider {
11
12
  private readonly modeling;
12
13
  static $inject: string[];
13
- constructor(popupMenu: PopupMenu, modeling: WardleyModeling);
14
+ constructor(popupMenu: PopupMenu, modeling: WardleyModeling, eventBus: EventBus);
14
15
  getPopupMenuEntries(target: PopupMenuTarget): PopupMenuEntries;
15
16
  private componentEntries;
16
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyElementSettingsProvider.d.ts","sourceRoot":"","sources":["../../src/popup/WardleyElementSettingsProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,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