@miragon/wardley-renderer 0.0.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 (96) hide show
  1. package/dist/Modeler.d.ts +14 -0
  2. package/dist/Modeler.d.ts.map +1 -0
  3. package/dist/NavigatedViewer.d.ts +10 -0
  4. package/dist/NavigatedViewer.d.ts.map +1 -0
  5. package/dist/Viewer.d.ts +6 -0
  6. package/dist/Viewer.d.ts.map +1 -0
  7. package/dist/WardleyBaseViewer.d.ts +66 -0
  8. package/dist/WardleyBaseViewer.d.ts.map +1 -0
  9. package/dist/append/WardleyAppendBehavior.d.ts +15 -0
  10. package/dist/append/WardleyAppendBehavior.d.ts.map +1 -0
  11. package/dist/append/index.d.ts +9 -0
  12. package/dist/append/index.d.ts.map +1 -0
  13. package/dist/color-picker/WardleyColorPicker.d.ts +23 -0
  14. package/dist/color-picker/WardleyColorPicker.d.ts.map +1 -0
  15. package/dist/color-picker/index.d.ts +5 -0
  16. package/dist/color-picker/index.d.ts.map +1 -0
  17. package/dist/context-pad/WardleyContextPadProvider.d.ts +28 -0
  18. package/dist/context-pad/WardleyContextPadProvider.d.ts.map +1 -0
  19. package/dist/context-pad/index.d.ts +5 -0
  20. package/dist/context-pad/index.d.ts.map +1 -0
  21. package/dist/draw/WardleyRenderer.d.ts +23 -0
  22. package/dist/draw/WardleyRenderer.d.ts.map +1 -0
  23. package/dist/draw/icons.d.ts +70 -0
  24. package/dist/draw/icons.d.ts.map +1 -0
  25. package/dist/draw/index.d.ts +5 -0
  26. package/dist/draw/index.d.ts.map +1 -0
  27. package/dist/draw/palette-icons.d.ts +3 -0
  28. package/dist/draw/palette-icons.d.ts.map +1 -0
  29. package/dist/draw/styles.d.ts +108 -0
  30. package/dist/draw/styles.d.ts.map +1 -0
  31. package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts +16 -0
  32. package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts.map +1 -0
  33. package/dist/evolution-grid/EvolutionGrid.d.ts +39 -0
  34. package/dist/evolution-grid/EvolutionGrid.d.ts.map +1 -0
  35. package/dist/evolution-grid/index.d.ts +8 -0
  36. package/dist/evolution-grid/index.d.ts.map +1 -0
  37. package/dist/evolve/WardleyEvolveDragging.d.ts +21 -0
  38. package/dist/evolve/WardleyEvolveDragging.d.ts.map +1 -0
  39. package/dist/evolve/index.d.ts +4 -0
  40. package/dist/evolve/index.d.ts.map +1 -0
  41. package/dist/index.d.ts +28 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +1985 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/io/WardleyExporter.d.ts +19 -0
  46. package/dist/io/WardleyExporter.d.ts.map +1 -0
  47. package/dist/io/WardleyImporter.d.ts +27 -0
  48. package/dist/io/WardleyImporter.d.ts.map +1 -0
  49. package/dist/io/index.d.ts +8 -0
  50. package/dist/io/index.d.ts.map +1 -0
  51. package/dist/io/saveSvg.d.ts +10 -0
  52. package/dist/io/saveSvg.d.ts.map +1 -0
  53. package/dist/io/types.d.ts +13 -0
  54. package/dist/io/types.d.ts.map +1 -0
  55. package/dist/keyboard/WardleyKeyboard.d.ts +13 -0
  56. package/dist/keyboard/WardleyKeyboard.d.ts.map +1 -0
  57. package/dist/keyboard/index.d.ts +5 -0
  58. package/dist/keyboard/index.d.ts.map +1 -0
  59. package/dist/label-editing/WardleyLabelEditing.d.ts +22 -0
  60. package/dist/label-editing/WardleyLabelEditing.d.ts.map +1 -0
  61. package/dist/label-editing/index.d.ts +5 -0
  62. package/dist/label-editing/index.d.ts.map +1 -0
  63. package/dist/model/WardleyElementFactory.d.ts +46 -0
  64. package/dist/model/WardleyElementFactory.d.ts.map +1 -0
  65. package/dist/model/di-types.d.ts +47 -0
  66. package/dist/model/di-types.d.ts.map +1 -0
  67. package/dist/model/index.d.ts +6 -0
  68. package/dist/model/index.d.ts.map +1 -0
  69. package/dist/modeling/WardleyModeling.d.ts +27 -0
  70. package/dist/modeling/WardleyModeling.d.ts.map +1 -0
  71. package/dist/modeling/cmd/UpdatePropertiesHandler.d.ts +18 -0
  72. package/dist/modeling/cmd/UpdatePropertiesHandler.d.ts.map +1 -0
  73. package/dist/modeling/index.d.ts +6 -0
  74. package/dist/modeling/index.d.ts.map +1 -0
  75. package/dist/palette/WardleyPaletteProvider.d.ts +12 -0
  76. package/dist/palette/WardleyPaletteProvider.d.ts.map +1 -0
  77. package/dist/palette/index.d.ts +5 -0
  78. package/dist/palette/index.d.ts.map +1 -0
  79. package/dist/pan-constraint/PanConstraint.d.ts +18 -0
  80. package/dist/pan-constraint/PanConstraint.d.ts.map +1 -0
  81. package/dist/pan-constraint/index.d.ts +4 -0
  82. package/dist/pan-constraint/index.d.ts.map +1 -0
  83. package/dist/popup/WardleyElementSettingsProvider.d.ts +17 -0
  84. package/dist/popup/WardleyElementSettingsProvider.d.ts.map +1 -0
  85. package/dist/popup/index.d.ts +5 -0
  86. package/dist/popup/index.d.ts.map +1 -0
  87. package/dist/rules/WardleyRules.d.ts +13 -0
  88. package/dist/rules/WardleyRules.d.ts.map +1 -0
  89. package/dist/rules/index.d.ts +5 -0
  90. package/dist/rules/index.d.ts.map +1 -0
  91. package/dist/snapping/StageSnapping.d.ts +12 -0
  92. package/dist/snapping/StageSnapping.d.ts.map +1 -0
  93. package/dist/snapping/index.d.ts +5 -0
  94. package/dist/snapping/index.d.ts.map +1 -0
  95. package/dist/wardley.css +2 -0
  96. package/package.json +43 -0
@@ -0,0 +1,14 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ import { NavigatedViewer } from './NavigatedViewer.js';
3
+ /**
4
+ * Full Wardley editor: palette/create, move with EvolutionConstraint + stage snapping, connect with
5
+ * rules, context pad, inline label editing, undo/redo (concept doc §6.1, roadmap M3).
6
+ */
7
+ export declare class Modeler extends NavigatedViewer {
8
+ protected _getModules(): ModuleDeclaration[];
9
+ undo(): void;
10
+ redo(): void;
11
+ canUndo(): boolean;
12
+ canRedo(): boolean;
13
+ }
14
+ //# sourceMappingURL=Modeler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modeler.d.ts","sourceRoot":"","sources":["../src/Modeler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAc9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAcvD;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,eAAe;cACvB,WAAW,IAAI,iBAAiB,EAAE;IA4BrD,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;IAIZ,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,OAAO;CAGnB"}
@@ -0,0 +1,10 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ import { Viewer } from './Viewer.js';
3
+ /**
4
+ * `keyboard-move-selection` depends on `modeling` and therefore belongs in the (later) Modeler,
5
+ * not in the read-only NavigatedViewer.
6
+ */
7
+ export declare class NavigatedViewer extends Viewer {
8
+ protected _getModules(): ModuleDeclaration[];
9
+ }
10
+ //# sourceMappingURL=NavigatedViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigatedViewer.d.ts","sourceRoot":"","sources":["../src/NavigatedViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAK9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,MAAM;cACtB,WAAW,IAAI,iBAAiB,EAAE;CAUtD"}
@@ -0,0 +1,6 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ import { WardleyBaseViewer } from './WardleyBaseViewer.js';
3
+ export declare class Viewer extends WardleyBaseViewer {
4
+ protected _getModules(): ModuleDeclaration[];
5
+ }
6
+ //# sourceMappingURL=Viewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Viewer.d.ts","sourceRoot":"","sources":["../src/Viewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAM3D,qBAAa,MAAO,SAAQ,iBAAiB;IAC3C,SAAS,CAAC,WAAW,IAAI,iBAAiB,EAAE;CAG7C"}
@@ -0,0 +1,66 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ import { WardleyMap } from '@miragon/wardley-schema-model';
3
+ import { ImportWarning } from './io/types.js';
4
+ export interface WardleyViewerOptions {
5
+ /** Host element. If missing, a detached <div> is created (can be attached later via attachTo). */
6
+ container?: HTMLElement;
7
+ width?: number | string;
8
+ height?: number | string;
9
+ /** Concatenated to the end of the module list (extension point, §12). */
10
+ additionalModules?: ModuleDeclaration[];
11
+ }
12
+ export type EventCallback<T = unknown> = (event: T) => void;
13
+ /**
14
+ * Shared lifecycle & DI bootstrap for all Wardley viewers (analogous to bpmn-js BaseViewer, but OUR
15
+ * OWN code — no bpmn-js as a dependency, §3.3). Subclasses only override `_getModules()` (a method
16
+ * rather than a field, to sidestep the constructor/field initialization order). `attachTo`/`detach`
17
+ * are own implementations (not a diagram-js primitive, §6.1).
18
+ */
19
+ export declare abstract class WardleyBaseViewer {
20
+ protected abstract _getModules(): ModuleDeclaration[];
21
+ private _diagram;
22
+ private readonly _container;
23
+ private readonly _options;
24
+ constructor(options?: WardleyViewerOptions);
25
+ private _createContainer;
26
+ private _ensureDiagram;
27
+ get<T>(name: string): T;
28
+ on<T = unknown>(event: string, callback: EventCallback<T>, priority?: number): void;
29
+ off(event: string, callback: EventCallback): void;
30
+ /** Load a model into the canvas (replaces existing content). */
31
+ importMap(map: WardleyMap): Promise<{
32
+ warnings: ImportWarning[];
33
+ }>;
34
+ importDSL(text: string): Promise<{
35
+ warnings: ImportWarning[];
36
+ }>;
37
+ /** Current state as the canonical model (from the DI properties). */
38
+ exportMap(): WardleyMap;
39
+ /**
40
+ * Changes the map's logical plot size (in diagram-px) and re-projects all elements.
41
+ * Sets `config.size` and re-imports the current state (normalized coordinates stay the truth).
42
+ */
43
+ setMapSize(width: number, height: number): Promise<{
44
+ warnings: ImportWarning[];
45
+ }>;
46
+ /**
47
+ * Sets the four X-axis stage labels (`undefined` = default Genesis/Custom/Product/Commodity).
48
+ * Changes only the labeling, not the geometry: updates the map config in-place and re-renders only
49
+ * the axis background (no re-import -> no view jump, no selection loss). Fires
50
+ * `wardley.config.changed` for consumers' URL/persistence sync.
51
+ */
52
+ setEvolutionLabels(labels: readonly [string, string, string, string] | undefined): void;
53
+ exportDSL(): string;
54
+ /** Static, standalone SVG. */
55
+ saveSVG(): Promise<{
56
+ svg: string;
57
+ }>;
58
+ /** Own implementation (not a diagram-js primitive): attach the container to `target`. */
59
+ attachTo(target: HTMLElement): void;
60
+ /** Own implementation: detach the container from the DOM, keeping state. */
61
+ detach(): void;
62
+ clear(): void;
63
+ destroy(): void;
64
+ get container(): HTMLElement;
65
+ }
66
+ //# sourceMappingURL=WardleyBaseViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyBaseViewer.d.ts","sourceRoot":"","sources":["../src/WardleyBaseViewer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI9C,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAM3E,OAAO,EAAW,KAAK,aAAa,EAA2B,MAAM,eAAe,CAAC;AAErF,MAAM,WAAW,oBAAoB;IACnC,kGAAkG;IAClG,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AAM5D;;;;;GAKG;AACH,8BAAsB,iBAAiB;IACrC,SAAS,CAAC,QAAQ,CAAC,WAAW,IAAI,iBAAiB,EAAE;IAErD,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;gBAEpC,OAAO,GAAE,oBAAyB;IAK9C,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,cAAc;IAQtB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;IAIvB,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,QAAQ,SAAO,GAAG,IAAI;IAIjF,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI;IAIjD,gEAAgE;IAC1D,SAAS,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;IAUlE,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;IAQrE,qEAAqE;IACrE,SAAS,IAAI,UAAU;IAIvB;;;OAGG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;IAKvF;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI;IAqBvF,SAAS,IAAI,MAAM;IAInB,8BAA8B;IACxB,OAAO,IAAI,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAIzC,yFAAyF;IACzF,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAKnC,4EAA4E;IAC5E,MAAM,IAAI,IAAI;IAId,KAAK,IAAI,IAAI;IAIb,OAAO,IAAI,IAAI;IAQf,IAAI,SAAS,IAAI,WAAW,CAE3B;CACF"}
@@ -0,0 +1,15 @@
1
+ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
2
+ import { Injector } from 'didi';
3
+ /**
4
+ * Behavior for "append component" (`create.start` with `context.source`):
5
+ * 1. LIVE arrow preview from the source to the cursor (analogous to diagram-js ConnectPreview, but
6
+ * in the create flow) — requires the `connectionPreview` service (ConnectionPreviewModule).
7
+ * 2. After creation, automatically opens the new component's label editor so it can be named
8
+ * (uniquely) right away.
9
+ * Both only when `context.source` is set; ordinary palette-create stays untouched.
10
+ */
11
+ export default class WardleyAppendBehavior {
12
+ static $inject: string[];
13
+ constructor(injector: Injector, eventBus: EventBus);
14
+ }
15
+ //# sourceMappingURL=WardleyAppendBehavior.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyAppendBehavior.d.ts","sourceRoot":"","sources":["../../src/append/WardleyAppendBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAgCrC;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACxC,MAAM,CAAC,OAAO,WAA4B;gBAE9B,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ;CAyCnD"}
@@ -0,0 +1,9 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ /**
3
+ * "Append component": pulls in the `connectionPreview` service (thereby also enabling the connect
4
+ * tool's arrow preview) and registers the append behavior (live arrow preview + automatically
5
+ * opening the label editor after creation).
6
+ */
7
+ export declare const wardleyAppendModule: ModuleDeclaration;
8
+ export { default as WardleyAppendBehavior } from './WardleyAppendBehavior.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/append/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI9C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,iBAIjC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,23 @@
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 WardleyModeling } from '../modeling/WardleyModeling.js';
4
+ import { WardleyShape } from '../model/di-types.js';
5
+ /**
6
+ * Compact color picker (bpmn.io-style): a 3x3 grid of small color squares (no text), opened from a
7
+ * note's context pad. Uses its own popover (instead of diagram-js PopupMenu) so the swatch grid can
8
+ * be rendered exactly and without text. Sets the color via `wardleyModeling` (undo/redo). First
9
+ * cell = "no color".
10
+ */
11
+ export default class WardleyColorPicker {
12
+ private readonly canvas;
13
+ private readonly modeling;
14
+ static $inject: string[];
15
+ private popover;
16
+ private readonly onDocPointer;
17
+ private readonly onKey;
18
+ constructor(canvas: Canvas, eventBus: EventBus, modeling: WardleyModeling);
19
+ /** Opens the swatch grid for `shape` at the click position (viewport coordinates). */
20
+ open(shape: WardleyShape, clientX: number, clientY: number): void;
21
+ close(): void;
22
+ }
23
+ //# sourceMappingURL=WardleyColorPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyColorPicker.d.ts","sourceRoot":"","sources":["../../src/color-picker/WardleyColorPicker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IAanC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAd3B,MAAM,CAAC,OAAO,WAA6C;IAE3D,OAAO,CAAC,OAAO,CAA0B;IAEzC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAE3B;IACF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAEpB;gBAGiB,MAAM,EAAE,MAAM,EAC/B,QAAQ,EAAE,QAAQ,EACD,QAAQ,EAAE,eAAe;IAM5C,sFAAsF;IACtF,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IA+CjE,KAAK,IAAI,IAAI;CAOd"}
@@ -0,0 +1,5 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ /** Note color picker (3x3 swatch popover). */
3
+ export declare const wardleyColorPickerModule: ModuleDeclaration;
4
+ export { default as WardleyColorPicker } from './WardleyColorPicker.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/color-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,8CAA8C;AAC9C,eAAO,MAAM,wBAAwB,EAAE,iBAGtC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { default as ContextPad } from 'diagram-js/lib/features/context-pad/ContextPad';
2
+ import { default as Modeling } from 'diagram-js/lib/features/modeling/Modeling';
3
+ import { default as Connect } from 'diagram-js/lib/features/connect/Connect';
4
+ import { default as Create } from 'diagram-js/lib/features/create/Create';
5
+ import { default as PopupMenu } from 'diagram-js/lib/features/popup-menu/PopupMenu';
6
+ import { ContextPadEntries, default as ContextPadProvider } from 'diagram-js/lib/features/context-pad/ContextPadProvider';
7
+ import { Element } from 'diagram-js/lib/model/Types';
8
+ import { default as WardleyModeling } from '../modeling/WardleyModeling.js';
9
+ import { default as WardleyLabelEditing } from '../label-editing/WardleyLabelEditing.js';
10
+ import { default as WardleyEvolveDragging } from '../evolve/WardleyEvolveDragging.js';
11
+ import { default as WardleyElementFactory } from '../model/WardleyElementFactory.js';
12
+ import { default as WardleyColorPicker } from '../color-picker/WardleyColorPicker.js';
13
+ /** Context actions per element (concept doc §5.5). */
14
+ export default class WardleyContextPadProvider implements ContextPadProvider {
15
+ private readonly modeling;
16
+ private readonly connect;
17
+ private readonly create;
18
+ private readonly popupMenu;
19
+ private readonly wardleyModeling;
20
+ private readonly labelEditing;
21
+ private readonly evolveDragging;
22
+ private readonly factory;
23
+ private readonly colorPicker;
24
+ static $inject: string[];
25
+ constructor(contextPad: ContextPad, modeling: Modeling, connect: Connect, create: Create, popupMenu: PopupMenu, wardleyModeling: WardleyModeling, labelEditing: WardleyLabelEditing, evolveDragging: WardleyEvolveDragging, factory: WardleyElementFactory, colorPicker: WardleyColorPicker);
26
+ getContextPadEntries(element: Element): ContextPadEntries;
27
+ }
28
+ //# sourceMappingURL=WardleyContextPadProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyContextPadProvider.d.ts","sourceRoot":"","sources":["../../src/context-pad/WardleyContextPadProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,gDAAgD,CAAC;AAC7E,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AACtE,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AACnE,OAAO,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,OAAO,KAAK,EACV,iBAAiB,EACjB,OAAO,IAAI,kBAAkB,EAC9B,MAAM,wDAAwD,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,mBAAmB,MAAM,yCAAyC,CAAC;AAC/E,OAAO,KAAK,qBAAqB,MAAM,oCAAoC,CAAC;AAC5E,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,kBAAkB,MAAM,uCAAuC,CAAC;AAsB5E,sDAAsD;AACtD,MAAM,CAAC,OAAO,OAAO,yBAA0B,YAAW,kBAAkB;IAgBxE,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAvB9B,MAAM,CAAC,OAAO,WAWZ;gBAGA,UAAU,EAAE,UAAU,EACL,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,mBAAmB,EACjC,cAAc,EAAE,qBAAqB,EACrC,OAAO,EAAE,qBAAqB,EAC9B,WAAW,EAAE,kBAAkB;IAKlD,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB;CAiH1D"}
@@ -0,0 +1,5 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ /** Context actions per element. */
3
+ export declare const wardleyContextPadModule: ModuleDeclaration;
4
+ export { default as WardleyContextPadProvider } from './WardleyContextPadProvider.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context-pad/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,mCAAmC;AACnC,eAAO,MAAM,uBAAuB,EAAE,iBAGrC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { default as BaseRenderer } from 'diagram-js/lib/draw/BaseRenderer';
2
+ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
3
+ import { ElementLike, ShapeLike, ConnectionLike } from 'diagram-js/lib/model/Types';
4
+ import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
5
+ export default class WardleyRenderer extends BaseRenderer {
6
+ private readonly grid;
7
+ static $inject: string[];
8
+ constructor(eventBus: EventBus, grid: EvolutionGrid);
9
+ canRender(element: ElementLike): boolean;
10
+ drawShape(visuals: SVGElement, element: ShapeLike): SVGElement;
11
+ drawConnection(visuals: SVGElement, element: ConnectionLike): SVGElement;
12
+ getShapePath(shape: ShapeLike): string;
13
+ getConnectionPath(connection: ConnectionLike): string;
14
+ private drawComponent;
15
+ private drawAnchor;
16
+ private drawPipeline;
17
+ private drawNote;
18
+ private drawAttitude;
19
+ private drawAnnotation;
20
+ private drawAccelerator;
21
+ private drawSubmap;
22
+ }
23
+ //# sourceMappingURL=WardleyRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyRenderer.d.ts","sourceRoot":"","sources":["../../src/draw/WardleyRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAE5D,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAkBzF,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AAOpE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY;IAKrD,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJvB,MAAM,CAAC,OAAO,WAAiC;gBAG7C,QAAQ,EAAE,QAAQ,EACD,IAAI,EAAE,aAAa;IAK7B,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAIxC,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,UAAU;IAuB9D,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,GAAG,UAAU;IA+CxE,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAKtC,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM;IAM9D,OAAO,CAAC,aAAa;IAyFrB,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,QAAQ;IAsBhB,OAAO,CAAC,YAAY;IA4BpB,OAAO,CAAC,cAAc;IA4BtB,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,UAAU;CA+BnB"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Embedded icon paths from Google Material Icons (Apache-2.0, © Google).
3
+ * 24x24-viewBox paths. `drawIcon` renders them as SVG (renderer), `iconMarkup` as an HTML string
4
+ * (palette/context pad/buttons) with `fill: currentColor` (color controllable via CSS).
5
+ * Source: https://github.com/google/material-design-icons (Apache License 2.0).
6
+ */
7
+ export declare const ICON_PERSON = "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z";
8
+ export declare const ICON_GROUP = "M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z";
9
+ /** radio_button_unchecked — ring (component / event). */
10
+ export declare const ICON_CIRCLE = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z";
11
+ export declare const ICON_ARROW_FORWARD = "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z";
12
+ /** double_arrow — evolve. */
13
+ export declare const ICON_DOUBLE_ARROW = "M15.5 5H11l5 7-5 7h4.5l5-7zM8.5 5H4l5 7-5 7h4.5l5-7z";
14
+ /** block — inertia (resistance to change). */
15
+ export declare const ICON_BLOCK = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z";
16
+ export declare const ICON_EDIT = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z";
17
+ export declare const ICON_DELETE = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z";
18
+ /** close — remove evolve. */
19
+ export declare const ICON_CLOSE = "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z";
20
+ /** description — note. */
21
+ export declare const ICON_NOTE = "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z";
22
+ export declare const ICON_UNDO = "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z";
23
+ export declare const ICON_REDO = "M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z";
24
+ /** data_object — JSON. */
25
+ export declare const ICON_DATA_OBJECT = "M4 7v2c0 .55-.45 1-1 1H2v2h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h1v-2H7c-.55 0-1-.45-1-1v-2c0-.84-.35-1.61-.92-2.18L4.85 12l.23-.82C5.65 10.61 6 9.84 6 9V7c0-.55.45-1 1-1h1V4H7C5.35 4 4 5.35 4 7zm16 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-1v2h1c.55 0 1 .45 1 1v2c0 .84.35 1.61.92 2.18l.23.82-.23.82c-.57.57-.92 1.34-.92 2.18v2c0 .55-.45 1-1 1h-1v2h1c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-2h-1z";
26
+ /** code — DSL. */
27
+ export declare const ICON_CODE = "M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z";
28
+ /** download — Export. */
29
+ export declare const ICON_DOWNLOAD = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z";
30
+ /** share — share link. */
31
+ export declare const ICON_SHARE = "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z";
32
+ /** storefront — market decorator. */
33
+ export declare const ICON_STOREFRONT = "M21.9 8.89l-1.05-4.37c-.22-.9-1-1.52-1.91-1.52H5.05c-.9 0-1.69.63-1.9 1.52L2.1 8.89c-.24 1.02-.02 2.06.62 2.88.08.11.19.19.28.29V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6.94c.09-.09.2-.18.28-.28.64-.82.87-1.87.62-2.89zM13 5h1.96l.54 3.52c.09.62-.39 1.18-.99 1.18-.65 0-1.18-.55-1.18-1.18V5zm-5.5 0h1.5v3.52C9 9.32 8.45 10 7.7 10c-.62 0-1.13-.49-1.21-1.13L7.5 5zm-3 .49C5.42 5.36 5.53 5 5.89 5H7.5l-.5 3.69c-.08.6-.59 1.06-1.19 1.06-.66 0-1.18-.56-1.18-1.18l.07-.6L4.5 5.49zM19 19H5v-6.03c.08.01.15.03.23.03.85 0 1.62-.35 2.19-.91.58.57 1.36.91 2.24.91.85 0 1.61-.35 2.18-.89.58.55 1.36.89 2.24.89.81 0 1.59-.34 2.17-.9.58.56 1.35.9 2.2.9.08 0 .15-.02.23-.03V19z";
34
+ /** public — ecosystem decorator. */
35
+ export declare const ICON_PUBLIC = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.94-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z";
36
+ /** folder_open — open file. */
37
+ export declare const ICON_FOLDER_OPEN = "M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z";
38
+ /** image — PNG/image. */
39
+ export declare const ICON_IMAGE = "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z";
40
+ /** note_add — new / clear. */
41
+ export declare const ICON_NEW = "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3v2zm-3-7V3.5L18.5 9H13z";
42
+ /** settings — gear (element settings / popup). */
43
+ export declare const ICON_SETTINGS = "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z";
44
+ /** palette — note color. */
45
+ export declare const ICON_PALETTE = "M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z";
46
+ /** place — annotation (marker). */
47
+ export declare const ICON_PLACE = "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z";
48
+ /** fast_forward — Accelerator. */
49
+ export declare const ICON_FAST_FORWARD = "M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z";
50
+ /** fast_rewind — Deaccelerator. */
51
+ export declare const ICON_FAST_REWIND = "M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z";
52
+ /** crop_landscape — attitude band (PST). */
53
+ export declare const ICON_CROP_LANDSCAPE = "M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 12H5V7h14v10z";
54
+ /** layers — submap (nested map). */
55
+ export declare const ICON_LAYERS = "M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z";
56
+ /** autorenew — cycle procurement method (build/buy/outsource). */
57
+ export declare const ICON_AUTORENEW = "M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z";
58
+ /** aspect_ratio — map size. */
59
+ export declare const ICON_ASPECT_RATIO = "M19 12h-2v3h-3v2h5v-5zM7 9h3V7H5v5h2V9zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z";
60
+ /** menu — hamburger (main menu). */
61
+ export declare const ICON_MENU = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z";
62
+ /** add — append component. */
63
+ export declare const ICON_ADD = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z";
64
+ /** visibility — eye (show example). */
65
+ export declare const ICON_VISIBILITY = "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z";
66
+ /** Draws a 24x24 icon as an SVG group centered on (cx, cy), scaled to `size`. */
67
+ export declare function drawIcon(path: string, cx: number, cy: number, size: number, fill: string): SVGElement;
68
+ /** Returns an icon as an HTML SVG string (for palette/context pad/buttons), color = currentColor. */
69
+ export declare function iconMarkup(path: string, size?: number): string;
70
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/draw/icons.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,eAAO,MAAM,WAAW,kHACyF,CAAC;AAClH,eAAO,MAAM,UAAU,sSAC8Q,CAAC;AAEtS,yDAAyD;AACzD,eAAO,MAAM,WAAW,iIACwG,CAAC;AACjI,eAAO,MAAM,kBAAkB,8DAA8D,CAAC;AAC9F,6BAA6B;AAC7B,eAAO,MAAM,iBAAiB,yDAAyD,CAAC;AACxF,8CAA8C;AAC9C,eAAO,MAAM,UAAU,mPAC2N,CAAC;AACnP,eAAO,MAAM,SAAS,0JACmI,CAAC;AAC1J,eAAO,MAAM,WAAW,kFACyD,CAAC;AAClF,6BAA6B;AAC7B,eAAO,MAAM,UAAU,0GACkF,CAAC;AAC1G,0BAA0B;AAC1B,eAAO,MAAM,SAAS,mIAC4G,CAAC;AACnI,eAAO,MAAM,SAAS,mJAC4H,CAAC;AACnJ,eAAO,MAAM,SAAS,oJAC6H,CAAC;AACpJ,0BAA0B;AAC1B,eAAO,MAAM,gBAAgB,+YACiX,CAAC;AAC/Y,kBAAkB;AAClB,eAAO,MAAM,SAAS,+FACwE,CAAC;AAC/F,yBAAyB;AACzB,eAAO,MAAM,aAAa,8CAA8C,CAAC;AACzE,0BAA0B;AAC1B,eAAO,MAAM,UAAU,oWAC4U,CAAC;AACpW,qCAAqC;AACrC,eAAO,MAAM,eAAe,spBACynB,CAAC;AACtpB,oCAAoC;AACpC,eAAO,MAAM,WAAW,iTACwR,CAAC;AACjT,+BAA+B;AAC/B,eAAO,MAAM,gBAAgB,gHACkF,CAAC;AAChH,yBAAyB;AACzB,eAAO,MAAM,UAAU,6HACqG,CAAC;AAC7H,8BAA8B;AAC9B,eAAO,MAAM,QAAQ,yIACmH,CAAC;AACzI,kDAAkD;AAClD,eAAO,MAAM,aAAa,gsBACqqB,CAAC;AAChsB,4BAA4B;AAC5B,eAAO,MAAM,YAAY,ycAC+a,CAAC;AACzc,mCAAmC;AACnC,eAAO,MAAM,UAAU,+JACuI,CAAC;AAC/J,kCAAkC;AAClC,eAAO,MAAM,iBAAiB,4CAA4C,CAAC;AAC3E,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,gDAAgD,CAAC;AAC9E,4CAA4C;AAC5C,eAAO,MAAM,mBAAmB,iGACgE,CAAC;AACjG,oCAAoC;AACpC,eAAO,MAAM,WAAW,gHACuF,CAAC;AAChH,kEAAkE;AAClE,eAAO,MAAM,cAAc,2OAC+M,CAAC;AAC3O,+BAA+B;AAC/B,eAAO,MAAM,iBAAiB,iJACkH,CAAC;AACjJ,oCAAoC;AACpC,eAAO,MAAM,SAAS,kDAAkD,CAAC;AACzE,8BAA8B;AAC9B,eAAO,MAAM,QAAQ,wCAAwC,CAAC;AAC9D,uCAAuC;AACvC,eAAO,MAAM,eAAe,sNACyL,CAAC;AAEtN,iFAAiF;AACjF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,UAAU,CAUZ;AAED,qGAAqG;AACrG,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,5 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ /** SVG rendering of all Wardley types (BaseRenderer subclass, priority 1500). */
3
+ export declare const wardleyDrawModule: ModuleDeclaration;
4
+ export { default as WardleyRenderer } from './WardleyRenderer.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,EAAE,iBAG/B,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const PALETTE_ICONS: Record<string, string>;
2
+ export declare function attitudeIcon(kind: string): string;
3
+ //# sourceMappingURL=palette-icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"palette-icons.d.ts","sourceRoot":"","sources":["../../src/draw/palette-icons.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2BhD,CAAC;AAEF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD"}
@@ -0,0 +1,108 @@
1
+ /** Default plot area in diagram px (interior without axis margins). Changeable at runtime via config.size. */
2
+ export declare const PLOT: {
3
+ readonly width: 1080;
4
+ readonly height: 680;
5
+ readonly marginLeft: 66;
6
+ readonly marginTop: 38;
7
+ readonly marginRight: 44;
8
+ readonly marginBottom: 58;
9
+ };
10
+ export declare const PLOT_MIN: {
11
+ readonly width: 480;
12
+ readonly height: 320;
13
+ };
14
+ export declare const NODE_SIZE = 34;
15
+ export declare const COMPONENT_RADIUS = 15;
16
+ /** Inner ring for "evolving" (intermediate-event look). */
17
+ export declare const COMPONENT_INNER_RADIUS = 12;
18
+ export declare const ANCHOR_ICON_SIZE = 26;
19
+ export declare const PIPELINE_HEIGHT = 30;
20
+ export declare const NOTE_LINE_HEIGHT = 17;
21
+ /**
22
+ * Box dimensions of a note from its (possibly multi-line) text. The note shape grows as large as
23
+ * its text -> the move/click hitbox grows with it (instead of a fixed 34px). Minimum = NODE_SIZE.
24
+ */
25
+ export declare function noteMetrics(label: string): {
26
+ lines: string[];
27
+ width: number;
28
+ height: number;
29
+ };
30
+ export declare const COLORS: {
31
+ readonly paper: "#fbfaf7";
32
+ readonly ink: "#1b1b1a";
33
+ readonly inkSoft: "#3a3a37";
34
+ readonly axis: "#cdc7bb";
35
+ readonly axisText: "#8c8475";
36
+ readonly grid: "#ebe7de";
37
+ readonly band: "rgba(27,27,26,0.022)";
38
+ readonly stroke: "#1b1b1a";
39
+ readonly componentFill: "#ffffff";
40
+ readonly anchorFill: "#1b1b1a";
41
+ readonly dependency: "#a9a296";
42
+ readonly accent: "#0e7c74";
43
+ readonly accentSoft: "rgba(14,124,116,0.12)";
44
+ readonly flow: "#0e7c74";
45
+ readonly movement: "#bf2f2a";
46
+ readonly inertia: "#1b1b1a";
47
+ readonly noteText: "#4a4640";
48
+ readonly pipeline: "#1b1b1a";
49
+ };
50
+ /**
51
+ * Note color palette (bpmn.io-style mini picker; deliberately NOT a full color picker). Values are
52
+ * hex and are rendered 1:1 as CSS color, or serialized in the DSL as `(color …)`.
53
+ * Convention (also used in the Wardley-mapping skill): green = good, red = problem/risk,
54
+ * amber = watch, blue = info, purple = idea, slate = neutral.
55
+ */
56
+ export declare const NOTE_COLORS: readonly [{
57
+ readonly id: "green";
58
+ readonly name: "Green · good";
59
+ readonly value: "#15803d";
60
+ }, {
61
+ readonly id: "amber";
62
+ readonly name: "Amber · watch";
63
+ readonly value: "#b45309";
64
+ }, {
65
+ readonly id: "red";
66
+ readonly name: "Red · problem";
67
+ readonly value: "#b91c1c";
68
+ }, {
69
+ readonly id: "blue";
70
+ readonly name: "Blue · info";
71
+ readonly value: "#1d4ed8";
72
+ }, {
73
+ readonly id: "teal";
74
+ readonly name: "Teal";
75
+ readonly value: "#0e7c74";
76
+ }, {
77
+ readonly id: "purple";
78
+ readonly name: "Purple · idea";
79
+ readonly value: "#7e22ce";
80
+ }, {
81
+ readonly id: "pink";
82
+ readonly name: "Pink";
83
+ readonly value: "#be185d";
84
+ }, {
85
+ readonly id: "slate";
86
+ readonly name: "Slate · neutral";
87
+ readonly value: "#475569";
88
+ }];
89
+ /** Colors of the attitude regions per kind (shared by renderer + palette icons). */
90
+ export declare const ATTITUDE_COLORS: Record<string, {
91
+ fill: string;
92
+ stroke: string;
93
+ }>;
94
+ export declare const FONT: {
95
+ /**
96
+ * Set as the `font-family` attribute DIRECTLY on all SVG text elements (canvas labels,
97
+ * axis/stage text and consequently the SVG export too) – not inherited from a CSS container.
98
+ * In EVERY context it reaches for the self-hosted 'Spline Sans Variable' if the consumer provides
99
+ * it; otherwise (e.g. an export SVG opened standalone) it falls back safely to a system sans.
100
+ * The library does NOT ship the font – consumers must include it themselves
101
+ * (e.g. via @fontsource-variable/spline-sans), see README.
102
+ */
103
+ readonly family: "'Spline Sans Variable', 'Spline Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif";
104
+ readonly label: 13;
105
+ readonly axis: 12;
106
+ readonly stage: 12;
107
+ };
108
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/draw/styles.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,eAAO,MAAM,IAAI;;;;;;;CAOP,CAAC;AAEX,eAAO,MAAM,QAAQ;;;CAAuC,CAAC;AAE7D,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAQnC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQ7F;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;CAmBT,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASd,CAAC;AAEX,oFAAoF;AACpF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAI5E,CAAC;AAEF,eAAO,MAAM,IAAI;IACf;;;;;;;OAOG;;;;;CAMK,CAAC"}
@@ -0,0 +1,16 @@
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 EvolutionGrid } from './EvolutionGrid.js';
4
+ /**
5
+ * After every geometry change (move/create/resize), keeps the normalized Wardley coordinates
6
+ * in sync with the pixel geometry — in BOTH directions (postExecuted AND reverted), so that undo/redo
7
+ * stays consistent (concept doc §5.3). `EvolutionGrid` is the single source of math (P7).
8
+ */
9
+ export default class EvolutionConstraintBehavior extends CommandInterceptor {
10
+ private readonly grid;
11
+ static $inject: string[];
12
+ constructor(eventBus: EventBus, grid: EvolutionGrid);
13
+ private syncAll;
14
+ private syncFromGeometry;
15
+ }
16
+ //# sourceMappingURL=EvolutionConstraintBehavior.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EvolutionConstraintBehavior.d.ts","sourceRoot":"","sources":["../../src/evolution-grid/EvolutionConstraintBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,2CAA2C,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAgBpD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,kBAAkB;IAKvE,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJvB,OAAgB,OAAO,WAAiC;gBAGtD,QAAQ,EAAE,QAAQ,EACD,IAAI,EAAE,aAAa;IAQtC,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,gBAAgB;CAsBzB"}
@@ -0,0 +1,39 @@
1
+ import { Coordinate, EvolutionStage, MapConfig } from '@miragon/wardley-schema-model';
2
+ import { default as Canvas } from 'diagram-js/lib/core/Canvas';
3
+ import { Point } from 'diagram-js/lib/util/Types';
4
+ /**
5
+ * Holds the SINGLE pixel<->normalized transform (guiding principle P7) and renders the
6
+ * non-interactive axis/grid background into its own diagram-js layer (z below the
7
+ * elements). The plot size is changeable at runtime via `config.size` ("scale map").
8
+ */
9
+ export default class EvolutionGrid {
10
+ private readonly canvas;
11
+ static $inject: string[];
12
+ private boundaries;
13
+ private labels;
14
+ private yAxisLabel;
15
+ private plotWidth;
16
+ private plotHeight;
17
+ constructor(canvas: Canvas);
18
+ configure(config: MapConfig): void;
19
+ /** Normalized -> diagram px (center of the node). */
20
+ toCanvas(coord: Coordinate): Point;
21
+ /** diagram px -> normalized, clamped to [0,1]. */
22
+ fromCanvas(point: Point): Coordinate;
23
+ stageOf(evolution: number): EvolutionStage;
24
+ /** The three stage boundaries (evolution values) — for snapping. */
25
+ getBoundaries(): readonly [number, number, number];
26
+ getPlotSize(): {
27
+ width: number;
28
+ height: number;
29
+ };
30
+ /** Outer bounds including margins (for the initial viewbox). */
31
+ outerBounds(): {
32
+ x: number;
33
+ y: number;
34
+ width: number;
35
+ height: number;
36
+ };
37
+ render(): void;
38
+ }
39
+ //# sourceMappingURL=EvolutionGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EvolutionGrid.d.ts","sourceRoot":"","sources":["../../src/evolution-grid/EvolutionGrid.ts"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AASvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IASpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IARnC,MAAM,CAAC,OAAO,WAAc;IAE5B,OAAO,CAAC,UAAU,CAA+D;IACjF,OAAO,CAAC,MAAM,CAAuE;IACrF,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,UAAU,CAAuB;gBAEZ,MAAM,EAAE,MAAM;IAE3C,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAQlC,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK;IAOlC,kDAAkD;IAClD,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU;IAOpC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc;IAI1C,oEAAoE;IACpE,aAAa,IAAI,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAIlD,WAAW,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAIhD,gEAAgE;IAChE,WAAW,IAAI;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAStE,MAAM,IAAI,IAAI;CAkFf"}
@@ -0,0 +1,8 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ /** Axis background + single pixel<->normalized math (P7). */
3
+ export declare const evolutionGridModule: ModuleDeclaration;
4
+ /** Keeps normalized coordinates in sync with the geometry (editor-only). */
5
+ export declare const evolutionConstraintModule: ModuleDeclaration;
6
+ export { default as EvolutionGrid } from './EvolutionGrid.js';
7
+ export { default as EvolutionConstraintBehavior } from './EvolutionConstraintBehavior.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evolution-grid/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI9C,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,EAAE,iBAEjC,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,EAAE,iBAIvC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
2
+ import { default as Dragging } from 'diagram-js/lib/features/dragging/Dragging';
3
+ import { default as Canvas } from 'diagram-js/lib/core/Canvas';
4
+ import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
5
+ import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
6
+ import { default as WardleyModeling } from '../modeling/WardleyModeling.js';
7
+ import { WardleyShape } from '../model/di-types.js';
8
+ /**
9
+ * Sets a component's evolve target by dragging along the evolution axis (instead of a text field).
10
+ * During the drag a live preview (direct mutation + re-render); on release exactly ONE
11
+ * undoable commit via the commandStack (P4). ESC cancels and restores the original state.
12
+ */
13
+ export default class WardleyEvolveDragging {
14
+ private readonly dragging;
15
+ static $inject: string[];
16
+ constructor(eventBus: EventBus, dragging: Dragging, grid: EvolutionGrid, modeling: WardleyModeling, canvas: Canvas, elementRegistry: ElementRegistry);
17
+ /** Starts the evolve drag for `shape` (from the context pad): set the target by dragging along
18
+ * the axis, or move it afterwards, with live preview; commit on release. */
19
+ start(event: Event, shape: WardleyShape): void;
20
+ }
21
+ //# sourceMappingURL=WardleyEvolveDragging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyEvolveDragging.d.ts","sourceRoot":"","sources":["../../src/evolve/WardleyEvolveDragging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AACtE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AAEvE,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAkBzD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAYtC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAX3B,MAAM,CAAC,OAAO,WAOZ;gBAGA,QAAQ,EAAE,QAAQ,EACD,QAAQ,EAAE,QAAQ,EACnC,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe;IA6ElC;iFAC6E;IAC7E,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;CAO/C"}
@@ -0,0 +1,4 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ export declare const wardleyEvolveModule: ModuleDeclaration;
3
+ export { default as WardleyEvolveDragging } from './WardleyEvolveDragging.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evolve/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,eAAO,MAAM,mBAAmB,EAAE,iBAGjC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}