@miragon/wardley-renderer 0.13.0 → 0.15.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 (95) hide show
  1. package/README.md +166 -32
  2. package/dist/Modeler.d.ts.map +1 -1
  3. package/dist/WardleyBaseViewer.d.ts.map +1 -1
  4. package/dist/a11y/canvasFocus.d.ts +28 -0
  5. package/dist/a11y/canvasFocus.d.ts.map +1 -1
  6. package/dist/a11y/index.d.ts +1 -1
  7. package/dist/a11y/index.d.ts.map +1 -1
  8. package/dist/appearance/index.d.ts +10 -0
  9. package/dist/appearance/index.d.ts.map +1 -0
  10. package/dist/appearance/index.js +5 -0
  11. package/dist/appearance/index.js.map +1 -0
  12. package/dist/append/WardleyAppendBehavior.d.ts.map +1 -1
  13. package/dist/collaborative/CollaborativeWardley.d.ts +5 -3
  14. package/dist/collaborative/CollaborativeWardley.d.ts.map +1 -1
  15. package/dist/color-picker/WardleyColorPicker.d.ts.map +1 -1
  16. package/dist/draw/WardleyRenderer.d.ts.map +1 -1
  17. package/dist/draw/index.d.ts +1 -1
  18. package/dist/draw/index.d.ts.map +1 -1
  19. package/dist/draw/label-layout.d.ts +13 -4
  20. package/dist/draw/label-layout.d.ts.map +1 -1
  21. package/dist/draw-tool/WardleyDrawTool.d.ts +23 -4
  22. package/dist/draw-tool/WardleyDrawTool.d.ts.map +1 -1
  23. package/dist/draw-tool/WardleyDrawingHandles.d.ts +17 -3
  24. package/dist/draw-tool/WardleyDrawingHandles.d.ts.map +1 -1
  25. package/dist/draw-tool/index.d.ts.map +1 -1
  26. package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts.map +1 -1
  27. package/dist/evolve/WardleyEvolveDragging.d.ts +10 -3
  28. package/dist/evolve/WardleyEvolveDragging.d.ts.map +1 -1
  29. package/dist/evolve/index.d.ts.map +1 -1
  30. package/dist/index.d.ts +8 -4
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +2066 -1502
  33. package/dist/index.js.map +1 -1
  34. package/dist/interaction/WardleyInteraction.d.ts +92 -0
  35. package/dist/interaction/WardleyInteraction.d.ts.map +1 -0
  36. package/dist/interaction/index.d.ts +5 -0
  37. package/dist/interaction/index.d.ts.map +1 -0
  38. package/dist/io/WardleyExporter.d.ts +12 -2
  39. package/dist/io/WardleyExporter.d.ts.map +1 -1
  40. package/dist/io/blobToBase64.d.ts +3 -0
  41. package/dist/io/blobToBase64.d.ts.map +1 -0
  42. package/dist/io/index.d.ts +1 -2
  43. package/dist/io/index.d.ts.map +1 -1
  44. package/dist/keyboard/WardleyKeyboard.d.ts +19 -1
  45. package/dist/keyboard/WardleyKeyboard.d.ts.map +1 -1
  46. package/dist/label-drag/WardleyLabelDragging.d.ts +9 -3
  47. package/dist/label-drag/WardleyLabelDragging.d.ts.map +1 -1
  48. package/dist/label-drag/index.d.ts.map +1 -1
  49. package/dist/label-editing/WardleyLabelEditing.d.ts.map +1 -1
  50. package/dist/label-editing/fieldError.d.ts +6 -0
  51. package/dist/label-editing/fieldError.d.ts.map +1 -1
  52. package/dist/label-editing/imeComposition.d.ts +7 -0
  53. package/dist/label-editing/imeComposition.d.ts.map +1 -0
  54. package/dist/label-editing/index.d.ts +2 -1
  55. package/dist/label-editing/index.d.ts.map +1 -1
  56. package/dist/lasso/WardleyLassoBehavior.d.ts +5 -1
  57. package/dist/lasso/WardleyLassoBehavior.d.ts.map +1 -1
  58. package/dist/lasso/index.d.ts +1 -1
  59. package/dist/lasso/index.d.ts.map +1 -1
  60. package/dist/link-editing/WardleyLinkEditing.d.ts.map +1 -1
  61. package/dist/live-preview/LivePreview.d.ts +18 -3
  62. package/dist/live-preview/LivePreview.d.ts.map +1 -1
  63. package/dist/live-preview/index.d.ts +1 -1
  64. package/dist/live-preview/index.d.ts.map +1 -1
  65. package/dist/map-menu/AxisLabelsPopover.d.ts.map +1 -1
  66. package/dist/map-menu/MapSizePopover.d.ts.map +1 -1
  67. package/dist/map-menu/TitleDialog.d.ts.map +1 -1
  68. package/dist/map-menu/index.d.ts +0 -2
  69. package/dist/map-menu/index.d.ts.map +1 -1
  70. package/dist/map-menu/popover.d.ts.map +1 -1
  71. package/dist/palette/WardleyHoverTooltipTeardown.d.ts +18 -0
  72. package/dist/palette/WardleyHoverTooltipTeardown.d.ts.map +1 -0
  73. package/dist/palette/WardleyPaletteArmedTool.d.ts +19 -0
  74. package/dist/palette/WardleyPaletteArmedTool.d.ts.map +1 -0
  75. package/dist/palette/WardleyPaletteKeyboard.d.ts +4 -2
  76. package/dist/palette/WardleyPaletteKeyboard.d.ts.map +1 -1
  77. package/dist/palette/WardleyPaletteProvider.d.ts +8 -3
  78. package/dist/palette/WardleyPaletteProvider.d.ts.map +1 -1
  79. package/dist/palette/WardleyPaletteReadOnly.d.ts +26 -0
  80. package/dist/palette/WardleyPaletteReadOnly.d.ts.map +1 -0
  81. package/dist/palette/WardleyPaletteTooltip.d.ts +52 -0
  82. package/dist/palette/WardleyPaletteTooltip.d.ts.map +1 -0
  83. package/dist/palette/index.d.ts +8 -1
  84. package/dist/palette/index.d.ts.map +1 -1
  85. package/dist/popup/WardleyElementSettingsProvider.d.ts.map +1 -1
  86. package/dist/read-only/WardleyReadOnly.d.ts +26 -4
  87. package/dist/read-only/WardleyReadOnly.d.ts.map +1 -1
  88. package/dist/read-only/index.d.ts +3 -0
  89. package/dist/read-only/index.d.ts.map +1 -1
  90. package/dist/wardley.css +1 -1
  91. package/package.json +8 -4
  92. package/dist/io/rasterize.d.ts +0 -25
  93. package/dist/io/rasterize.d.ts.map +0 -1
  94. package/dist/map-menu/ShortcutsDialog.d.ts +0 -14
  95. package/dist/map-menu/ShortcutsDialog.d.ts.map +0 -1
@@ -0,0 +1,92 @@
1
+ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
2
+ import { Injector } from 'didi';
3
+ /** Fired as `{ active }` each time a gesture starts or ends (`InteractionChangedEvent`). */
4
+ export declare const INTERACTION_CHANGED = "wardley.interaction.changed";
5
+ export interface InteractionChangedEvent {
6
+ active: boolean;
7
+ }
8
+ /**
9
+ * The drags of a palette tool that only waits for its next press (the lasso from the palette or
10
+ * `L`): no gesture yet. They hold no element of the map, so an import leaves such a tool armed, and
11
+ * the user's next press still draws a lasso instead of panning or moving the element under the
12
+ * pointer.
13
+ */
14
+ export declare const ARMED_TOOL_PREFIXES: ReadonlySet<string>;
15
+ /**
16
+ * Ahead of every other listener of a drag or a command, so that what a drop or a command runs finds
17
+ * the user's action marked.
18
+ */
19
+ export declare const ACTION_MARK_PRIORITY = 100000;
20
+ /**
21
+ * Whether the user holds a gesture on the canvas, the `interaction` of `@miragon/modeler-api`: a
22
+ * diagram-js drag past its threshold (a move, resize, connect, lasso, evolve or plot-corner drag, a
23
+ * create from the palette or the context pad, also while its preview is over the palette) or one of
24
+ * this renderer's own drags (a label, a point of a drawing, the evolve target), from its start until
25
+ * its drop or cancel. A tool that only waits for its next press is none, and neither is a pan.
26
+ *
27
+ * It also marks the user's actions, and `afterUserAction()` lets an import wait until the running
28
+ * one has finished, so that no step of it finds the map replaced under it (#248, #285, #305, #336):
29
+ * - a drop, from the release until the drop has ended and the follow-ups it deferred to a later task
30
+ * (the name editor of a create or an append with the pointer) have run;
31
+ * - every other command, an undo or a redo, from its start until the code that ran it has returned:
32
+ * a create without a pointer, the context pad's append with Enter, the save of a name editor, also
33
+ * the one a press on the canvas makes, a delete, an undo or a redo that deselects what it removes.
34
+ * Such an action defers no step: the next microtask ends it;
35
+ * - the activation of a diagram-js drag (a move, a connect or the evolve placement of the context pad
36
+ * past its threshold; a resize, a create from the palette, the context pad or a key, and a connect
37
+ * with the key A at once), from its start until diagram-js's `Dragging.move` has returned: it
38
+ * clears the selection after the start and goes on with the drag, so an import from the selection
39
+ * listener there would cancel the drag under it. The import then ends the drag, as it ends any
40
+ * running gesture. The next microtask ends this action too.
41
+ */
42
+ export default class WardleyInteraction {
43
+ private readonly eventBus;
44
+ static $inject: string[];
45
+ private gesture;
46
+ private dropsRunning;
47
+ private settling;
48
+ private handlerRunning;
49
+ /** From one of `HANDLER_GOES_ON_EVENTS` or a gesture's start or end until its handler returned. */
50
+ private handlerGoesOn;
51
+ private readonly waiting;
52
+ constructor(eventBus: EventBus, injector: Injector);
53
+ /** True from a gesture's start until its drop or cancel. */
54
+ isActive(): boolean;
55
+ /** One of the renderer's own drags passed its threshold. */
56
+ begin(gesture: object): void;
57
+ /** The gesture ended without a drop: Escape, or its element was removed. */
58
+ end(gesture: object): void;
59
+ /** The gesture's release: runs its drop, then ends it. */
60
+ drop(gesture: object, run: () => void): void;
61
+ /**
62
+ * Resolves once the user's running action has finished: a drop with the follow-ups it deferred to
63
+ * a later task, and the code that ran a command or activated a drag; `undefined` while no action
64
+ * runs.
65
+ */
66
+ afterUserAction(): Promise<void> | undefined;
67
+ /**
68
+ * Runs `teardown` (the modeler's destroy) at once, or, while the handler of the user's input goes
69
+ * on with the map, once that handler has returned. A host may destroy the modeler from any
70
+ * listener, and these handlers read the canvas after one: diagram-js's `Dragging.move` clears
71
+ * the selection after a drag's start and reads the drag again (#346), a drop's command runs
72
+ * inside `Dragging.end`, whose `SelectionBehavior` then selects the new shape and whose cleanup
73
+ * reads the canvas, a cancel cleans the drag up after the listeners of its `drag.cleanup` (#380),
74
+ * a create without a pointer selects its element and opens its name editor (#373), and the
75
+ * palette focuses the canvas after it started a create. The renderer's own drags (a label, a
76
+ * point of a drawing, the evolve target) read the canvas after they reported their start or end
77
+ * in the same way. The rest of the handler runs on the live map, which the teardown then takes
78
+ * down, together with a drag that still runs.
79
+ */
80
+ tearDownAfterHandler(teardown: () => void): void;
81
+ private actionRunning;
82
+ private followDragging;
83
+ private noteHandlerGoesOn;
84
+ private dropStarts;
85
+ private handlerRuns;
86
+ private endDrop;
87
+ private dropEnds;
88
+ private settleWhenIdle;
89
+ private settled;
90
+ private changed;
91
+ }
92
+ //# sourceMappingURL=WardleyInteraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyInteraction.d.ts","sourceRo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AG,IAAI;IAKhD,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,cAAc;IA8CtB,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,OAAO;CAIhB"}
@@ -0,0 +1,5 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ /** Whether the user holds a gesture on the canvas, and when the user's action has finished. */
3
+ export declare const wardleyInteractionModule: ModuleDeclaration;
4
+ export { default as WardleyInteraction, ACTION_MARK_PRIORITY, ARMED_TOOL_PREFIXES, INTERACTION_CHANGED, type InteractionChangedEvent, } from './WardleyInteraction.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,+FAA+F;AAC/F,eAAO,MAAM,wBAAwB,EAAE,iBAGtC,CAAC;AAEF,OAAO,EACL,OAAO,IAAI,kBAAkB,EAC7B,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,uBAAuB,GAC7B,MAAM,yBAAyB,CAAC"}
@@ -1,8 +1,14 @@
1
1
  import { default as Canvas } from 'diagram-js/lib/core/Canvas';
2
2
  import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
3
- import { WardleyMap } from '@miragon/wardley-schema-model';
3
+ import { LabelOffset, Movement, WardleyMap } from '@miragon/wardley-schema-model';
4
+ import { WardleyShape } from '../model/di-types.js';
4
5
  import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
5
6
  import { default as WardleySourceOrder } from './WardleySourceOrder.js';
7
+ /** A shape's evolve target and label offset as the document has them. */
8
+ export interface CommittedShapeFields {
9
+ readonly movement: Movement | undefined;
10
+ readonly labelOffset: LabelOffset | undefined;
11
+ }
6
12
  /**
7
13
  * Reconstructs a WardleyMap from the diagram-js runtime model. The source of truth for positions are
8
14
  * the DI properties `evolution`/`visibility`; editable fields (label, decorators, movement,
@@ -16,7 +22,11 @@ export default class WardleyExporter {
16
22
  private readonly sourceOrder;
17
23
  static $inject: string[];
18
24
  constructor(elementRegistry: ElementRegistry, canvas: Canvas, grid: EvolutionGrid, sourceOrder: WardleySourceOrder);
19
- export(): WardleyMap;
25
+ /**
26
+ * `committed` gives the evolve target and label offset the document has for each shape a drag
27
+ * previews on; the map takes them instead of the ones the canvas shows.
28
+ */
29
+ export(committed?: ReadonlyMap<WardleyShape, CommittedShapeFields>): WardleyMap;
20
30
  /** Builds a MapElement from the DI properties (common types) or the businessObject (the rest). */
21
31
  private buildElement;
22
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyExporter.d.ts","sourceRoot":"","sources":["../../src/io/WardleyExporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAcL,KAAK,UAAU,EAChB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAS9D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAIhC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAN9B,MAAM,CAAC,OAAO,WAAwE;gBAGnE,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,aAAa,EACnB,WAAW,EAAE,kBAAkB;IAGlD,MAAM,IAAI,UAAU;IA2DpB,kGAAkG;IAClG,OAAO,CAAC,YAAY;CA2HrB"}
1
+ {"version":3,"file":"WardleyExporter.d.ts","sourceRoot":"","sources":["../../src/io/WardleyExporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAQL,KAAK,WAAW,EAIhB,KAAK,QAAQ,EAIb,KAAK,UAAU,EAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAuC,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAS9D,yEAAyE;AACzE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;CAC/C;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAIhC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAN9B,MAAM,CAAC,OAAO,WAAwE;gBAGnE,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,aAAa,EACnB,WAAW,EAAE,kBAAkB;IAGlD;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,YAAY,EAAE,oBAAoB,CAAC,GAAG,UAAU;IA2D/E,kGAAkG;IAClG,OAAO,CAAC,YAAY;CA+HrB"}
@@ -0,0 +1,3 @@
1
+ /** Blob -> Base64 without the data-URL prefix, e.g. to post an export to a VS Code extension host. */
2
+ export declare function blobToBase64(blob: Blob): Promise<string>;
3
+ //# sourceMappingURL=blobToBase64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blobToBase64.d.ts","sourceRoot":"","sources":["../../src/io/blobToBase64.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxD"}
@@ -6,8 +6,7 @@ export { default as WardleySourceOrder } from './WardleySourceOrder.js';
6
6
  export { saveSVG } from './saveSvg.js';
7
7
  export type { SvgBounds } from './saveSvg.js';
8
8
  export { exportBounds, EXPORT_CONTENT_PADDING } from './exportBounds.js';
9
- export { svgToPng, blobToBase64 } from './rasterize.js';
10
- export type { SvgToPngOptions } from './rasterize.js';
9
+ export { blobToBase64 } from './blobToBase64.js';
11
10
  export { ROOT_ID } from './types.js';
12
11
  export type { ImportWarning, RootBusinessObject } from './types.js';
13
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAK9C,eAAO,MAAM,QAAQ,EAAE,iBAMtB,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAK9C,eAAO,MAAM,QAAQ,EAAE,iBAMtB,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
@@ -22,7 +22,11 @@ export interface WardleyKeyboardConfig {
22
22
  * Keyboard binding: undo/redo, delete, copy/paste/duplicate, arrow-key nudge, Escape (deselect),
23
23
  * Cmd/Ctrl+A (select all), the single-key tools C (component), U (user), N (note), P (pipeline),
24
24
  * L (lasso) and A (connect from the selected node), all only while the canvas has the focus.
25
- * Deliberately a DOM listener (no diagram-js keyboard-service binding needed).
25
+ * Deliberately a DOM listener (no diagram-js keyboard-service binding needed). While the draw tool
26
+ * holds the points of a line, the single-key tools and paste do nothing, and the canvas takes them:
27
+ * a paste attaches its copies to the pointer, where the next press belongs to the line. While a
28
+ * point of a drawing is dragged, the arrow keys, paste, duplicate and the single-key tools do
29
+ * nothing, and the canvas takes them; Escape ends that drag and Delete removes the drawing.
26
30
  */
27
31
  export default class WardleyKeyboard {
28
32
  private readonly canvas;
@@ -37,6 +41,8 @@ export default class WardleyKeyboard {
37
41
  private readonly labelEditing;
38
42
  private readonly grid;
39
43
  private readonly freeRect;
44
+ private readonly drawingHandles;
45
+ private readonly drawTool;
40
46
  constructor(canvas: Canvas, commandStack: CommandStack, selection: Selection, modeling: Modeling, copyPaste: WardleyCopyPaste, factory: WardleyElementFactory, create: Create, mouse: Mouse, lassoTool: LassoTool, eventBus: EventBus, elementRegistry: ElementRegistry, injector: Injector, config: WardleyKeyboardConfig | undefined);
41
47
  /**
42
48
  * With the pointer over the canvas the new node attaches to it (like palette create; placing it
@@ -48,6 +54,18 @@ export default class WardleyKeyboard {
48
54
  private visiblePlotCenter;
49
55
  private freeSpotNear;
50
56
  private singleSelectedShape;
57
+ /**
58
+ * A point drag owns Escape, and the keys that would act on its drawing or start a second gesture
59
+ * (#375): a nudge or a duplicate is a command, which ends the drag, and a paste or a tool would
60
+ * start a gesture that ends with the drag's release.
61
+ */
62
+ private pointDragged;
63
+ /**
64
+ * A line the draw tool holds and a point drag run on the canvas, which has the focus, so the
65
+ * single-key tools pressed meanwhile are the canvas's and go no further, though they start
66
+ * nothing (#404).
67
+ */
68
+ private takenByGesture;
51
69
  /** The real pointer event, or a synthetic one at `canvasPoint` when the pointer is elsewhere. */
52
70
  private pointerEventOr;
53
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyKeyboard.d.ts","sourceRoot":"","sources":["../../src/keyboard/WardleyKeyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,MAAM,MAAM,uCAAuC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IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAGtB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAlClC,MAAM,CAAC,OAAO,WAcZ;IAEF,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA+B;IAC9D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;gBAG/B,MAAM,EAAE,MAAM,EAC/B,YAAY,EAAE,YAAY,EACT,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EACnC,SAAS,EAAE,gBAAgB,EACV,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EAC7B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EACD,eAAe,EAAE,eAAe,EACjD,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,qBAAqB,GAAG,SAAS;IAgK3C;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,mBAAmB;IAK3B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAOtB,iGAAiG;IACjG,OAAO,CAAC,cAAc;CAUvB"}
@@ -6,12 +6,15 @@ import { default as Selection } from 'diagram-js/lib/features/selection/Selectio
6
6
  import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
7
7
  import { default as WardleyModeling } from '../modeling/WardleyModeling.js';
8
8
  import { WardleyShape } from '../model/di-types.js';
9
+ import { WardleyInteraction } from '../interaction/index.js';
10
+ import { LivePreview } from '../live-preview/index.js';
9
11
  /** Which offset a label writes: the node's own `label [dx, dy]` or its evolve line's. */
10
12
  export type LabelRole = "name" | "movement";
11
13
  /**
12
14
  * OWM-style draggable labels: drag a component/anchor name or an evolve target name to store an
13
- * OWM `label [dx, dy]` offset (integers, clamped to ±200px) as ONE undoable command. A press without
14
- * movement selects the owner; double-click still edits the name.
15
+ * OWM `label [dx, dy]` offset (integers, clamped to ±200px) as ONE undoable command; the export holds
16
+ * back the preview until then (`LivePreview`). A press without movement selects the owner;
17
+ * double-click still edits the name.
15
18
  *
16
19
  * Reset paths: Alt+double-click on a label, dropping it back onto its default slot, or
17
20
  * `resetLabelOffset(shape, role)`.
@@ -24,14 +27,17 @@ export default class WardleyLabelDragging {
24
27
  private readonly selection;
25
28
  private readonly grid;
26
29
  private readonly injector;
30
+ private readonly interaction;
31
+ private readonly livePreview;
27
32
  static $inject: string[];
28
33
  private active;
29
- constructor(eventBus: EventBus, canvas: Canvas, elementRegistry: ElementRegistry, modeling: WardleyModeling, selection: Selection, grid: EvolutionGrid, injector: Injector);
34
+ constructor(eventBus: EventBus, canvas: Canvas, elementRegistry: ElementRegistry, modeling: WardleyModeling, selection: Selection, grid: EvolutionGrid, injector: Injector, interaction: WardleyInteraction, livePreview: LivePreview);
30
35
  /** Puts a label back into its default slot (undoable). */
31
36
  resetLabelOffset(shape: WardleyShape, role?: LabelRole): void;
32
37
  private readonly onMouseDown;
33
38
  private readonly onMouseMove;
34
39
  private readonly onMouseUp;
40
+ private dropLabel;
35
41
  /** The click that ends a drag would toggle the owner's selection off again. */
36
42
  private suppressNextClick;
37
43
  private readonly onKeyDown;
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyLabelDragging.d.ts","sourceRoot":"","sources":["../../src/label-drag/WardleyLabelDragging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAA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version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/label-drag/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,EAAE,iBAGpC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/label-drag/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAK9C,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,EAAE,iBAIpC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyLabelEditing.d.ts","sourceRoot":"","sources":["../../src/label-editing/WardleyLabelEditing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAyB3E,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,6CAA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E;;;OAGG;IACH,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI;IAmFhF,sDAAsD;IACtD,MAAM,IAAI,IAAI;IAId,wGAAwG;IACxG,OAAO,CAAC,uBAAuB;IAS/B;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAIxB,4FAA4F;IAC5F,aAAa,IAAI,eAAe,GAAG,IAAI;IAWvC;;;OAGG;IACH,OAAO,CAAC,cAAc;IActB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,aAAa;CAuDtB"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Screen px from an inline editor's field to the first caption under it. The field's focus ring
3
+ * reaches 4px below it (5px in high contrast), and a caption at the same layer would cover it; the
4
+ * guide keeps the label editor's suggestions 8px from the field too.
5
+ */
6
+ export declare const FIELD_TO_CAPTION_GAP = 8;
1
7
  /**
2
8
  * A refused value in an inline editor: the field turns red and a caption under it says why. One look
3
9
  * and one accessible pattern (role=alert, aria-describedby) for every editor, also for keyboard and
@@ -1 +1 @@
1
- {"version":3,"file":"fieldError.d.ts","sourceRoot":"","sources":["../../src/label-editing/fieldError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,IAAI,IAAI,CAAC;IACd,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,gBAAgB,GAAG,mBAAmB,EAC7C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GACpC,UAAU,CA6BZ"}
1
+ {"version":3,"file":"fieldError.d.ts","sourceRoot":"","sources":["../../src/label-editing/fieldError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,IAAI,IAAI,CAAC;IACd,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,gBAAgB,GAAG,mBAAmB,EAC7C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GACpC,UAAU,CA6BZ"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Enter and Escape that confirm or cancel an IME candidate belong to the composition. `isComposing`
3
+ * alone misses Safari: it sends the confirming Enter after `compositionend`, with `isComposing`
4
+ * false and the `keyCode` 229 that every engine gives a key the IME took.
5
+ */
6
+ export declare function isImeCompositionKey(event: KeyboardEvent): boolean;
7
+ //# sourceMappingURL=imeComposition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imeComposition.d.ts","sourceRoot":"","sources":["../../src/label-editing/imeComposition.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAEjE"}
@@ -2,6 +2,7 @@ import { ModuleDeclaration } from 'didi';
2
2
  /** Custom inline label editing (HTML overlay). */
3
3
  export declare const labelEditingModule: ModuleDeclaration;
4
4
  export { default as WardleyLabelEditing } from './WardleyLabelEditing.js';
5
- export { createFieldError, type FieldError } from './fieldError.js';
5
+ export { createFieldError, FIELD_TO_CAPTION_GAP, type FieldError } from './fieldError.js';
6
6
  export { focusField, type FieldSelection } from './WardleyLabelEditing.js';
7
+ export { isImeCompositionKey } from './imeComposition.js';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/label-editing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,kDAAkD;AAClD,eAAO,MAAM,kBAAkB,EAAE,iBAGhC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/label-editing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,kDAAkD;AAClD,eAAO,MAAM,kBAAkB,EAAE,iBAGhC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,12 +1,16 @@
1
1
  import { default as EventBus } from 'diagram-js/lib/core/EventBus';
2
2
  import { default as Canvas } from 'diagram-js/lib/core/Canvas';
3
3
  import { default as LassoTool } from 'diagram-js/lib/features/lasso-tool/LassoTool';
4
+ import { default as ToolManager } from 'diagram-js/lib/features/tool-manager/ToolManager';
5
+ export declare const LASSO_SELECTION = "lasso.selection";
4
6
  /**
5
7
  * Activates the diagram-js lasso via Shift+drag on the empty canvas.
6
8
  * Plain drag stays canvas pan (MoveCanvas); Shift+click on elements stays multi-select.
9
+ * The lasso tool counts as active exactly while its drag holds it armed, so a palette's pressed
10
+ * state (`tool-manager.update`) follows it.
7
11
  */
8
12
  export default class WardleyLassoBehavior {
9
13
  static $inject: string[];
10
- constructor(eventBus: EventBus, canvas: Canvas, lassoTool: LassoTool);
14
+ constructor(eventBus: EventBus, canvas: Canvas, lassoTool: LassoTool, toolManager: ToolManager);
11
15
  }
12
16
  //# sourceMappingURL=WardleyLassoBehavior.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyLassoBehavior.d.ts","sourceRoot":"","sources":["../../src/lasso/WardleyLassoBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAO1E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,MAAM,CAAC,OAAO,WAAuC;gBAEzC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS;CAgBrE"}
1
+ {"version":3,"file":"WardleyLassoBehavior.d.ts","sourceRoot":"","sources":["../../src/lasso/WardleyLassoBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,OAAO,KAAK,WAAW,MAAM,kDAAkD,CAAC;AAShF,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,MAAM,CAAC,OAAO,WAAsD;gBAExD,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW;CAqB/F"}
@@ -1,5 +1,5 @@
1
1
  import { ModuleDeclaration } from 'didi';
2
2
  /** Lasso multi-select: diagram-js lasso-tool plus Shift+drag activation on an empty canvas. */
3
3
  export declare const wardleyLassoModule: ModuleDeclaration;
4
- export { default as WardleyLassoBehavior } from './WardleyLassoBehavior.js';
4
+ export { default as WardleyLassoBehavior, LASSO_SELECTION } from './WardleyLassoBehavior.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lasso/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI9C,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,EAAE,iBAIhC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lasso/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI9C,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,EAAE,iBAIhC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyLinkEditing.d.ts","sourceRoot":"","sources":["../../src/link-editing/WardleyLinkEditing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAuB9F,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,O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
2
2
  import { WardleyMap } from '@miragon/wardley-schema-model';
3
- import { default as WardleyExporter } from '../io/WardleyExporter.js';
3
+ import { default as WardleyExporter, CommittedShapeFields } from '../io/WardleyExporter.js';
4
+ import { WardleyShape } from '../model/di-types.js';
4
5
  /** The config fields a live preview changes: the plot size, the X-axis stage labels. */
5
6
  export type PreviewedField = "size" | "evolutionLabels";
6
7
  /**
@@ -12,14 +13,17 @@ export declare const COMMAND_START_EVENTS: string[];
12
13
  export declare const PUT_BACK_PRIORITY = 10000;
13
14
  /**
14
15
  * The document as it was committed while a live preview (a plot-resize drag, the size or the axis
15
- * labels being typed into a popover) shows something else on the canvas. A host autosaves the
16
- * export at any moment, also mid-drag, and must store the document, never the preview.
16
+ * labels being typed into a popover, the drag of an evolve target or a label) shows something else
17
+ * on the canvas. A host autosaves the export at any moment, also mid-drag, and must store the
18
+ * document, never the preview.
17
19
  */
18
20
  export default class LivePreview {
21
+ private readonly eventBus;
19
22
  private readonly exporter;
20
23
  static $inject: string[];
21
24
  private committed;
22
25
  private readonly previewed;
26
+ private readonly committedShapes;
23
27
  constructor(eventBus: EventBus, exporter: WardleyExporter);
24
28
  /** Before a preview changes `field` on the canvas: keeps the document as it is now. */
25
29
  begin(field: PreviewedField): void;
@@ -28,8 +32,19 @@ export default class LivePreview {
28
32
  * committed). The preview of the other field may still be open and keeps its committed value.
29
33
  */
30
34
  end(field: PreviewedField): void;
35
+ /**
36
+ * Before a drag previews an evolve target or a label offset on `shape`: keeps both as the
37
+ * document has them, from the first preview until `putBackShape`. Returns the kept ones, which
38
+ * the preview builds on.
39
+ */
40
+ beginShape(shape: WardleyShape): CommittedShapeFields;
41
+ /** Whether a drag previews on `shape`. */
42
+ previewsShape(shape: WardleyShape): boolean;
43
+ /** Shows `shape` as the document has it again, if a drag previews on it. */
44
+ putBackShape(shape: WardleyShape): void;
31
45
  /** The committed document while a preview is open, `undefined` while none is. */
32
46
  committedMap(): WardleyMap | undefined;
47
+ private exportCommitted;
33
48
  private endAll;
34
49
  private withCommittedFields;
35
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LivePreview.d.ts","sourceRoot":"","sources":["../../src/live-preview/LivePreview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAC;AAE5D,wFAAwF;AACxF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAIhC,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAQ5B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAP3B,MAAM,CAAC,OAAO,WAAmC;IAEjD,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;gBAGrD,QAAQ,EAAE,QAAQ,EACD,QAAQ,EAAE,eAAe;IAW5C,uFAAuF;IACvF,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAKlC;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAKhC,iFAAiF;IACjF,YAAY,IAAI,UAAU,GAAG,SAAS;IAItC,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,mBAAmB;CAS5B"}
1
+ {"version":3,"file":"LivePreview.d.ts","sourceRoot":"","sources":["../../src/live-preview/LivePreview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,wFAAwF;AACxF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAIhC,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAQ5B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,MAAM,CAAC,OAAO,WAAmC;IAEjD,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;IACvD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiD;gBAG9D,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,eAAe;IAW5C,uFAAuF;IACvF,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAKlC;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAKhC;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,oBAAoB;IASrD,0CAA0C;IAC1C,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAI3C,4EAA4E;IAC5E,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAWvC,iFAAiF;IACjF,YAAY,IAAI,UAAU,GAAG,SAAS;IAKtC,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,mBAAmB;CAS5B"}
@@ -1,5 +1,5 @@
1
1
  import { ModuleDeclaration } from 'didi';
2
- /** The committed document behind a live preview (map size, axis labels). */
2
+ /** The committed document behind a live preview (map size, axis labels, evolve targets, labels). */
3
3
  export declare const livePreviewModule: ModuleDeclaration;
4
4
  export { default as LivePreview, COMMAND_START_EVENTS, PUT_BACK_PRIORITY } from './LivePreview.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/live-preview/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,EAAE,iBAE/B,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/live-preview/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,oGAAoG;AACpG,eAAO,MAAM,iBAAiB,EAAE,iBAE/B,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AxisLabelsPopover.d.ts","sourceRoot":"","sources":["../../src/map-menu/AxisLabelsPopover.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAWtB;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,CAuF9F"}
1
+ {"version":3,"file":"AxisLabelsPopover.d.ts","sourceRoot":"","sources":["../../src/map-menu/AxisLabelsPopover.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAWtB;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,CA2F9F"}
@@ -1 +1 @@
1
- {"version":3,"file":"MapSizePopover.d.ts","sourceRoot":"","sources":["../../src/map-menu/MapSizePopover.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAI7C,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAiBtB;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,CA+F3F"}
1
+ {"version":3,"file":"MapSizePopover.d.ts","sourceRoot":"","sources":["../../src/map-menu/MapSizePopover.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAI7C,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAiBtB;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,CAkG3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"TitleDialog.d.ts","sourceRoot":"","sources":["../../src/map-menu/TitleDialog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAiC,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAG/F,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAC7C,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AAMpC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CA0D1F"}
1
+ {"version":3,"file":"TitleDialog.d.ts","sourceRoot":"","sources":["../../src/map-menu/TitleDialog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAiC,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAG/F,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAC7C,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AAMpC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CAiE1F"}
@@ -4,8 +4,6 @@ export { mapShortcuts } from './shortcuts.js';
4
4
  export type { MapShortcutOptions, ShortcutGroup, ShortcutKeyNames, ShortcutPlatform, ShortcutRow, ShortcutsChrome, } from './shortcuts.js';
5
5
  export { createMapDialog, dialogButton } from './dialog.js';
6
6
  export type { DialogChrome, MapDialog, MapDialogParts } from './dialog.js';
7
- export { createShortcutsDialog } from './ShortcutsDialog.js';
8
- export type { ShortcutsDialog, ShortcutsDialogChrome } from './ShortcutsDialog.js';
9
7
  export { createTitleDialog } from './TitleDialog.js';
10
8
  export type { TitleDialog, TitleDialogChrome } from './TitleDialog.js';
11
9
  export { createMapSizePopover } from './MapSizePopover.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/map-menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnD,YAAY,EACV,SAAS,EACT,UAAU,EACV,OAAO,EACP,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,E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IAAI,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACtE,+EAA+E;IAC/E,MAAM,IAAI,WAAW,GAAG,SAAS,CAAC;IAClC,8FAA8F;IAC9F,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B;AA0BD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,YAAY,GAClB,aAAa,GAAG;IAAE,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAAA;CAAE,CAgEhD;AAED,gGAAgG;AAChG,wBAAgB,KAAK,CACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,GAC5C;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,IAAI,IAAI,CAAA;CAAE,CA6BhF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,aAAa,GAAG;IAAE,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAAA;CAAE,GACtD,aAAa,CAiBf"}
@@ -0,0 +1,18 @@
1
+ import { ModuleDeclaration } from 'didi';
2
+ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
3
+ import { default as HoverTooltip } from 'diagram-js/lib/features/hover-tooltip/HoverTooltip';
4
+ /**
5
+ * diagram-js's palette brings its hover tooltip along, which `WardleyPaletteTooltip` does not use,
6
+ * but a host may (diagram-js's own palette tooltip, say). That tooltip (checked up to 15.28.1)
7
+ * shows 300ms after the pointer enters an entry and cancels that only when the pointer leaves,
8
+ * never on `diagram.destroy`: the timer then renders into the destroyed canvas and throws a
9
+ * TypeError in the host's page. HoverTooltip has no public way to cancel a show, so this clears its timer and the
10
+ * content it would render. A host that replaced the service with `null` has nothing to cancel.
11
+ */
12
+ export default class WardleyHoverTooltipTeardown {
13
+ static $inject: string[];
14
+ constructor(eventBus: EventBus, hoverTooltip: HoverTooltip | null);
15
+ }
16
+ /** Cancels a hover tooltip that waits to show when the modeler is destroyed. */
17
+ export declare const wardleyHoverTooltipTeardownModule: ModuleDeclaration;
18
+ //# sourceMappingURL=WardleyHoverTooltipTeardown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyHoverTooltipTeardown.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyHoverTooltipTeardown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,YAAY,MAAM,oDAAoD,CAAC;AAWnF;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAC9C,MAAM,CAAC,OAAO,WAAgC;gBAElC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;CASlE;AAED,gFAAgF;AAChF,eAAO,MAAM,iCAAiC,EAAE,iBAI/C,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
2
+ import { Injector } from 'didi';
3
+ /**
4
+ * `aria-pressed` on the tools of the renderer's own palette (lasso, draw), `"true"` on the armed one
5
+ * (guide §5.5, §5.14), for a host without the Miragon modeler shell, whose palette skin does the
6
+ * same. diagram-js marks the armed tool with its `highlighted-entry` class only, and after it rebuilt
7
+ * the entries that class no longer reaches them: diagram-js keeps the tools group it found first. So
8
+ * the armed tool comes from `tool-manager.update`, and every rebuild (`palette.changed`) gets the
9
+ * state again; `wardley.css` keys the armed ring on it. A palette any chrome skins
10
+ * (`data-chrome="palette"`) is left to that chrome.
11
+ */
12
+ export default class WardleyPaletteArmedTool {
13
+ static $inject: string[];
14
+ private container;
15
+ private armedTool;
16
+ constructor(eventBus: EventBus, injector: Injector);
17
+ private apply;
18
+ }
19
+ //# sourceMappingURL=WardleyPaletteArmedTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyPaletteArmedTool.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyPaletteArmedTool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAKrC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAuB;IAC1C,MAAM,CAAC,OAAO,WAA4B;IAE1C,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,SAAS,CAAuB;gBAE5B,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ;IAYlD,OAAO,CAAC,KAAK;CAUd"}
@@ -6,8 +6,9 @@ import { default as WardleyPaletteProvider } from './WardleyPaletteProvider.js';
6
6
  * Makes the palette a keyboard-operable toolbar (WAI-ARIA toolbar pattern): one Tab stop with a
7
7
  * roving tabindex, arrow keys / Home / End move between tools, Enter or Space activates the focused
8
8
  * one. A create tool has no pointer position to attach the new element to, so it is placed at the
9
- * centre of the free rectangle instead (see `WardleyPaletteProvider.createAtFreeCenter`). Only for
10
- * hosts without the Miragon modeler shell, which brings these keys itself.
9
+ * centre of the free rectangle instead (see `WardleyPaletteProvider.createAtFreeCenter`). The
10
+ * palette comes before the canvas in the tab order. Only for hosts without the Miragon modeler
11
+ * shell, which brings these keys and that order itself.
11
12
  */
12
13
  export default class WardleyPaletteKeyboard {
13
14
  private readonly palette;
@@ -16,6 +17,7 @@ export default class WardleyPaletteKeyboard {
16
17
  private container;
17
18
  private activeAction;
18
19
  constructor(eventBus: EventBus, palette: Palette, provider: WardleyPaletteProvider, injector: Injector);
20
+ private moveBeforeCanvas;
19
21
  private attach;
20
22
  private entries;
21
23
  private entryOf;
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyPaletteKeyboard.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyP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