@miragon/wardley-renderer 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -16
- package/dist/Modeler.d.ts.map +1 -1
- package/dist/NavigatedViewer.d.ts.map +1 -1
- package/dist/WardleyBaseViewer.d.ts +44 -9
- package/dist/WardleyBaseViewer.d.ts.map +1 -1
- package/dist/collaborative/CollaborativeWardley.d.ts +35 -0
- package/dist/collaborative/CollaborativeWardley.d.ts.map +1 -0
- package/dist/collaborative/index.d.ts +2 -0
- package/dist/collaborative/index.d.ts.map +1 -0
- package/dist/color-picker/WardleyColorPicker.d.ts +3 -1
- package/dist/color-picker/WardleyColorPicker.d.ts.map +1 -1
- package/dist/context-pad/WardleyContextPadProvider.d.ts.map +1 -1
- package/dist/draw/deprecated-icons.d.ts +35 -0
- package/dist/draw/deprecated-icons.d.ts.map +1 -0
- package/dist/draw/icons.d.ts +0 -24
- package/dist/draw/icons.d.ts.map +1 -1
- package/dist/draw/palette-icons.d.ts.map +1 -1
- package/dist/draw/styles.d.ts.map +1 -1
- package/dist/draw-tool/WardleyDrawTool.d.ts +3 -1
- package/dist/draw-tool/WardleyDrawTool.d.ts.map +1 -1
- package/dist/draw-tool/WardleyDrawingHandles.d.ts +3 -1
- package/dist/draw-tool/WardleyDrawingHandles.d.ts.map +1 -1
- package/dist/editor-state.d.ts +12 -2
- package/dist/editor-state.d.ts.map +1 -1
- package/dist/evolve/WardleyEvolveDragging.d.ts +3 -1
- package/dist/evolve/WardleyEvolveDragging.d.ts.map +1 -1
- package/dist/free-rect/FreeRect.d.ts +41 -0
- package/dist/free-rect/FreeRect.d.ts.map +1 -0
- package/dist/free-rect/index.d.ts +6 -0
- package/dist/free-rect/index.d.ts.map +1 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2301 -1205
- package/dist/index.js.map +1 -1
- package/dist/io/WardleyImporter.d.ts +15 -1
- package/dist/io/WardleyImporter.d.ts.map +1 -1
- package/dist/io/fitViewbox.d.ts +21 -0
- package/dist/io/fitViewbox.d.ts.map +1 -0
- package/dist/io/saveSvg.d.ts.map +1 -1
- package/dist/keyboard/WardleyKeyboard.d.ts +7 -4
- package/dist/keyboard/WardleyKeyboard.d.ts.map +1 -1
- package/dist/label-drag/WardleyLabelDragging.d.ts +3 -1
- package/dist/label-drag/WardleyLabelDragging.d.ts.map +1 -1
- package/dist/label-editing/WardleyLabelEditing.d.ts +4 -0
- package/dist/label-editing/WardleyLabelEditing.d.ts.map +1 -1
- package/dist/link-editing/WardleyLinkEditing.d.ts +6 -1
- package/dist/link-editing/WardleyLinkEditing.d.ts.map +1 -1
- package/dist/live-preview/LivePreview.d.ts +36 -0
- package/dist/live-preview/LivePreview.d.ts.map +1 -0
- package/dist/live-preview/index.d.ts +5 -0
- package/dist/live-preview/index.d.ts.map +1 -0
- package/dist/map-menu/AxisLabelsPopover.d.ts +10 -0
- package/dist/map-menu/AxisLabelsPopover.d.ts.map +1 -0
- package/dist/map-menu/MapSizePopover.d.ts +10 -0
- package/dist/map-menu/MapSizePopover.d.ts.map +1 -0
- package/dist/map-menu/ShortcutsDialog.d.ts +14 -0
- package/dist/map-menu/ShortcutsDialog.d.ts.map +1 -0
- package/dist/map-menu/TitleDialog.d.ts +12 -0
- package/dist/map-menu/TitleDialog.d.ts.map +1 -0
- package/dist/map-menu/dialog.d.ts +41 -0
- package/dist/map-menu/dialog.d.ts.map +1 -0
- package/dist/map-menu/dom.d.ts +9 -0
- package/dist/map-menu/dom.d.ts.map +1 -0
- package/dist/map-menu/index.d.ts +14 -0
- package/dist/map-menu/index.d.ts.map +1 -0
- package/dist/map-menu/menu.d.ts +68 -0
- package/dist/map-menu/menu.d.ts.map +1 -0
- package/dist/map-menu/popover.d.ts +52 -0
- package/dist/map-menu/popover.d.ts.map +1 -0
- package/dist/map-menu/shortcuts.d.ts +48 -0
- package/dist/map-menu/shortcuts.d.ts.map +1 -0
- package/dist/map-resize/MapProjection.d.ts +12 -2
- package/dist/map-resize/MapProjection.d.ts.map +1 -1
- package/dist/map-resize/MapResizeHandles.d.ts +4 -1
- package/dist/map-resize/MapResizeHandles.d.ts.map +1 -1
- package/dist/map-resize/index.d.ts.map +1 -1
- package/dist/palette/WardleyPaletteKeyboard.d.ts +4 -2
- package/dist/palette/WardleyPaletteKeyboard.d.ts.map +1 -1
- package/dist/palette/WardleyPaletteProvider.d.ts +10 -6
- package/dist/palette/WardleyPaletteProvider.d.ts.map +1 -1
- package/dist/pan-constraint/PanConstraint.d.ts +22 -6
- package/dist/pan-constraint/PanConstraint.d.ts.map +1 -1
- package/dist/read-only/WardleyReadOnly.d.ts +27 -0
- package/dist/read-only/WardleyReadOnly.d.ts.map +1 -0
- package/dist/read-only/index.d.ts +7 -0
- package/dist/read-only/index.d.ts.map +1 -0
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/palette.d.ts +22 -36
- package/dist/theme/palette.d.ts.map +1 -1
- package/dist/wardley.css +1 -1
- package/package.json +6 -5
|
@@ -2,10 +2,16 @@ import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
|
2
2
|
import { default as ElementFactory } from 'diagram-js/lib/core/ElementFactory';
|
|
3
3
|
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
4
4
|
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
5
|
+
import { Injector } from 'didi';
|
|
5
6
|
import { WardleyMap } from '@miragon/wardley-schema-model';
|
|
6
7
|
import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
7
8
|
import { default as WardleyElementFactory } from '../model/WardleyElementFactory.js';
|
|
8
9
|
import { ImportWarning } from './types.js';
|
|
10
|
+
/** Diagram config `wardleyImport` (viewer option `fitOnImport`). */
|
|
11
|
+
export interface WardleyImportConfig {
|
|
12
|
+
/** `false`: the host fits the view itself, the import leaves it alone. */
|
|
13
|
+
fit?: boolean;
|
|
14
|
+
}
|
|
9
15
|
/**
|
|
10
16
|
* Bridges the WardleyMap model into the diagram-js canvas.
|
|
11
17
|
* Uses `evolutionGrid` exclusively for the pixel projection (P7). Deliberately bypasses the
|
|
@@ -18,9 +24,17 @@ export default class WardleyImporter {
|
|
|
18
24
|
private readonly grid;
|
|
19
25
|
private readonly eventBus;
|
|
20
26
|
private readonly elementRegistry;
|
|
27
|
+
private readonly config;
|
|
21
28
|
static $inject: string[];
|
|
22
|
-
|
|
29
|
+
private readonly freeRect;
|
|
30
|
+
constructor(canvas: Canvas, elementFactory: ElementFactory, factory: WardleyElementFactory, grid: EvolutionGrid, eventBus: EventBus, elementRegistry: ElementRegistry, injector: Injector, config: WardleyImportConfig | undefined);
|
|
23
31
|
import(map: WardleyMap): ImportWarning[];
|
|
32
|
+
/**
|
|
33
|
+
* The plot with its axis margins, centred in the host's free rectangle, at most at 100 %: where
|
|
34
|
+
* the host's own fit puts it. With a free area the pan constraint leaves it there; without one
|
|
35
|
+
* it may still move a map smaller than the view to keep its own margins around it.
|
|
36
|
+
*/
|
|
37
|
+
private fitPlot;
|
|
24
38
|
private createShape;
|
|
25
39
|
clear(): void;
|
|
26
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyImporter.d.ts","sourceRoot":"","sources":["../../src/io/WardleyImporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,cAAc,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"WardleyImporter.d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AE,UAAU,GAAG,aAAa,EAAE;IAmGxC;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,WAAW;IAInB,KAAK,IAAI,IAAI;CAed"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FreeRectInsets } from '../free-rect/index.js';
|
|
2
|
+
/** An import never opens the map above 100 %, like the shell's fit and the other renderers. */
|
|
3
|
+
export declare const MAX_IMPORT_ZOOM = 1;
|
|
4
|
+
interface Box {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The viewbox that shows `bounds` centred in the free rectangle (`container` minus `insets`) at the
|
|
12
|
+
* largest scale that fits, never above `MAX_IMPORT_ZOOM`. The box has the container's aspect
|
|
13
|
+
* ratio, so `canvas.viewbox(box)` sets exactly this view. An axis the insets leave no room on
|
|
14
|
+
* centres in the whole container. `undefined` for a 0 × 0 container or empty bounds.
|
|
15
|
+
*/
|
|
16
|
+
export declare function fitViewbox(bounds: Box, container: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}, insets?: FreeRectInsets): Box | undefined;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=fitViewbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fitViewbox.d.ts","sourceRoot":"","sources":["../../src/io/fitViewbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,+FAA+F;AAC/F,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC,UAAU,GAAG;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAID;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,GAAG,EACX,SAAS,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC5C,MAAM,GAAE,cAA0B,GACjC,GAAG,GAAG,SAAS,CAiBjB"}
|
package/dist/io/saveSvg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveSvg.d.ts","sourceRoot":"","sources":["../../src/io/saveSvg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AAGrD,MAAM,WAAW,SAAS;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"saveSvg.d.ts","sourceRoot":"","sources":["../../src/io/saveSvg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AAGrD,MAAM,WAAW,SAAS;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CA0C3E"}
|
|
@@ -22,9 +22,11 @@ export interface WardleyKeyboardConfig {
|
|
|
22
22
|
* Decides whether a keydown belongs to the host page rather than the canvas. Canvas shortcuts
|
|
23
23
|
* only run when focus is on the canvas, the palette, or nowhere in particular (body) — so a
|
|
24
24
|
* focused host button or select never deletes or nudges map elements. A focused plain button
|
|
25
|
-
* (zoom, share, menu) still lets undo/redo and the single-key tools through
|
|
25
|
+
* (zoom, share, menu) still lets undo/redo and the single-key tools through, unless the host's
|
|
26
|
+
* chrome owns every key aimed at it (`canvasTargetsOnly`, the Miragon modeler shell: its zoom
|
|
27
|
+
* panel's buttons do not stop the keys they leave alone).
|
|
26
28
|
*/
|
|
27
|
-
export declare function shouldIgnoreKeyEvent(event: KeyboardEvent, canvasContainer: HTMLElement): boolean;
|
|
29
|
+
export declare function shouldIgnoreKeyEvent(event: KeyboardEvent, canvasContainer: HTMLElement, canvasTargetsOnly?: boolean): boolean;
|
|
28
30
|
/**
|
|
29
31
|
* Keyboard binding: undo/redo, delete, copy/paste/duplicate, arrow-key nudge, Escape (deselect),
|
|
30
32
|
* Cmd/Ctrl+A (select all), the single-key tools C (component), U (user), N (note), P (pipeline),
|
|
@@ -43,11 +45,12 @@ export default class WardleyKeyboard {
|
|
|
43
45
|
private pointerOverCanvas;
|
|
44
46
|
private readonly labelEditing;
|
|
45
47
|
private readonly grid;
|
|
48
|
+
private readonly freeRect;
|
|
46
49
|
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);
|
|
47
50
|
/**
|
|
48
51
|
* With the pointer over the canvas the new node attaches to it (like palette create; placing it
|
|
49
|
-
* opens the name editor). Without one — keyboard only — it lands
|
|
50
|
-
* the name editor opens right away.
|
|
52
|
+
* opens the name editor). Without one — keyboard only — it lands in the centre of the free
|
|
53
|
+
* rectangle (within the plot) and the name editor opens right away.
|
|
51
54
|
*/
|
|
52
55
|
private quickCreate;
|
|
53
56
|
private insetPlotBounds;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WardleyKeyboard.d.ts","sourceRoot":"","sources":["../../src/keyboard/WardleyKeyboard.ts"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BAAmB;IAK3B,iGAAiG;IACjG,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
|
+
import { Injector } from 'didi';
|
|
2
3
|
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
3
4
|
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
4
5
|
import { default as Selection } from 'diagram-js/lib/features/selection/Selection';
|
|
@@ -22,9 +23,10 @@ export default class WardleyLabelDragging {
|
|
|
22
23
|
private readonly modeling;
|
|
23
24
|
private readonly selection;
|
|
24
25
|
private readonly grid;
|
|
26
|
+
private readonly injector;
|
|
25
27
|
static $inject: string[];
|
|
26
28
|
private active;
|
|
27
|
-
constructor(eventBus: EventBus, canvas: Canvas, elementRegistry: ElementRegistry, modeling: WardleyModeling, selection: Selection, grid: EvolutionGrid);
|
|
29
|
+
constructor(eventBus: EventBus, canvas: Canvas, elementRegistry: ElementRegistry, modeling: WardleyModeling, selection: Selection, grid: EvolutionGrid, injector: Injector);
|
|
28
30
|
/** Puts a label back into its default slot (undoable). */
|
|
29
31
|
resetLabelOffset(shape: WardleyShape, role?: LabelRole): void;
|
|
30
32
|
private readonly onMouseDown;
|
|
@@ -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,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,SAAS,MAAM,6CAA6C,CAAC;AAEzE,OAAO,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,sBAA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ACnB,QAAQ,EAAE,QAAQ;IAmBrC,0DAA0D;IAC1D,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,GAAE,SAAkB,GAAG,IAAI;IAQrE,OAAO,CAAC,QAAQ,CAAC,WAAW,CA6B1B;IAEF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAe1B;IAEF,OAAO,CAAC,QAAQ,CAAC,SAAS,CAgBxB;IAEF,+EAA+E;IAC/E,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAIxB;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAO5B;IAEF,OAAO,CAAC,MAAM;IAId,gGAAgG;IAChG,OAAO,CAAC,MAAM;IAgBd,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,oBAAoB;IAS5B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAUtB,6EAA6E;IAC7E,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,WAAW;IAiBnB,+FAA+F;IAC/F,OAAO,CAAC,cAAc;CAIvB"}
|
|
@@ -47,8 +47,10 @@ export default class WardleyLabelEditing {
|
|
|
47
47
|
private readonly factory;
|
|
48
48
|
static $inject: string[];
|
|
49
49
|
private active;
|
|
50
|
+
private relayoutPending;
|
|
50
51
|
private readonly contextPad;
|
|
51
52
|
private readonly selection;
|
|
53
|
+
private readonly locked;
|
|
52
54
|
constructor(eventBus: EventBus, canvas: Canvas, modeling: WardleyModeling, factory: WardleyElementFactory, injector: Injector);
|
|
53
55
|
/** Opens the in-place name editor for `element` (no-op for regions and drawings). */
|
|
54
56
|
activate(element: WardleyShape, options?: ActivateOptions): void;
|
|
@@ -59,6 +61,8 @@ export default class WardleyLabelEditing {
|
|
|
59
61
|
activateConnection(conn: WardleyConnection, options?: ActivateOptions): void;
|
|
60
62
|
/** Discards the open edit (if any) without saving. */
|
|
61
63
|
cancel(): void;
|
|
64
|
+
/** `canvas.viewbox.changing` fires before the change, and `changed` waits 300ms under `deferUpdate`. */
|
|
65
|
+
private relayoutAfterViewChange;
|
|
62
66
|
/**
|
|
63
67
|
* Saves the open edit (if any) as if focus had left the field, e.g. before the host saves or
|
|
64
68
|
* exports the map, so the file contains the text the user sees.
|
|
@@ -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,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;
|
|
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,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,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,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI;IA+EhF,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;IAStB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,aAAa;CAoDtB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
|
+
import { Injector } from 'didi';
|
|
2
3
|
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
3
4
|
import { WardleyShape } from '../model/di-types.js';
|
|
4
5
|
import { default as WardleyModeling } from '../modeling/WardleyModeling.js';
|
|
@@ -14,9 +15,11 @@ export declare function linkOf(shape: WardleyShape): string | undefined;
|
|
|
14
15
|
export default class WardleyLinkEditing {
|
|
15
16
|
private readonly canvas;
|
|
16
17
|
private readonly modeling;
|
|
18
|
+
private readonly injector;
|
|
17
19
|
static $inject: string[];
|
|
18
20
|
private active;
|
|
19
|
-
|
|
21
|
+
private relayoutPending;
|
|
22
|
+
constructor(eventBus: EventBus, canvas: Canvas, modeling: WardleyModeling, injector: Injector);
|
|
20
23
|
/**
|
|
21
24
|
* Sets (or with an empty value removes) the link. Returns false when the address is not allowed.
|
|
22
25
|
* The exporter reads the link from the businessObject, which palette-created shapes do not have
|
|
@@ -28,6 +31,8 @@ export default class WardleyLinkEditing {
|
|
|
28
31
|
value?: string;
|
|
29
32
|
}): void;
|
|
30
33
|
cancel(): void;
|
|
34
|
+
/** `canvas.viewbox.changing` fires before the change, and `changed` waits 300ms under `deferUpdate`. */
|
|
35
|
+
private relayoutAfterViewChange;
|
|
31
36
|
/** Saves the open link edit (if any) as if focus had left the field; a rejected address is dropped. */
|
|
32
37
|
commitActiveEdit(): void;
|
|
33
38
|
getActiveEdit(): {
|
|
@@ -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,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;
|
|
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;AAwBlE,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAExD;AAED,sGAAsG;AACtG,wBAAgB,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAM9D;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IAQnC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAT3B,MAAM,CAAC,OAAO,WAAyD;IAEvE,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,eAAe,CAAS;gBAG9B,QAAQ,EAAE,QAAQ,EACD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,QAAQ;IAerC;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO;IA0BjE,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI;IAyFrE,MAAM,IAAI,IAAI;IAId,wGAAwG;IACxG,OAAO,CAAC,uBAAuB;IAS/B,uGAAuG;IACvG,gBAAgB,IAAI,IAAI;IAIxB,aAAa,IAAI;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAK7D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
2
|
+
import { WardleyMap } from '@miragon/wardley-schema-model';
|
|
3
|
+
import { default as WardleyExporter } from '../io/WardleyExporter.js';
|
|
4
|
+
/** The config fields a live preview changes: the plot size, the X-axis stage labels. */
|
|
5
|
+
export type PreviewedField = 'size' | 'evolutionLabels';
|
|
6
|
+
/**
|
|
7
|
+
* Fired before a command changes the document: `preExecute` for a command, `execute` for a redo
|
|
8
|
+
* (which skips `preExecute`), `revert` for an undo.
|
|
9
|
+
*/
|
|
10
|
+
export declare const COMMAND_START_EVENTS: string[];
|
|
11
|
+
/** Ahead of the other listeners of these events; the command's handler runs after all of them. */
|
|
12
|
+
export declare const PUT_BACK_PRIORITY = 10000;
|
|
13
|
+
/**
|
|
14
|
+
* 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.
|
|
17
|
+
*/
|
|
18
|
+
export default class LivePreview {
|
|
19
|
+
private readonly exporter;
|
|
20
|
+
static $inject: string[];
|
|
21
|
+
private committed;
|
|
22
|
+
private readonly previewed;
|
|
23
|
+
constructor(eventBus: EventBus, exporter: WardleyExporter);
|
|
24
|
+
/** Before a preview changes `field` on the canvas: keeps the document as it is now. */
|
|
25
|
+
begin(field: PreviewedField): void;
|
|
26
|
+
/**
|
|
27
|
+
* The canvas shows the committed `field` again (its preview was put back or is being
|
|
28
|
+
* committed). The preview of the other field may still be open and keeps its committed value.
|
|
29
|
+
*/
|
|
30
|
+
end(field: PreviewedField): void;
|
|
31
|
+
/** The committed document while a preview is open, `undefined` while none is. */
|
|
32
|
+
committedMap(): WardleyMap | undefined;
|
|
33
|
+
private endAll;
|
|
34
|
+
private withCommittedFields;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=LivePreview.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ModuleDeclaration } from 'didi';
|
|
2
|
+
/** The committed document behind a live preview (map size, axis labels). */
|
|
3
|
+
export declare const livePreviewModule: ModuleDeclaration;
|
|
4
|
+
export { default as LivePreview, COMMAND_START_EVENTS, PUT_BACK_PRIORITY } from './LivePreview.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Modeler } from '../Modeler.js';
|
|
2
|
+
import { PopoverChrome, PopoverHandle } from './popover.js';
|
|
3
|
+
/**
|
|
4
|
+
* "X-axis labels…" (guide §5.4): a preset or four free stage names. Typing previews on the axis
|
|
5
|
+
* without touching the document; closing commits ONE edit, so the document gets one change and
|
|
6
|
+
* an IDE one undo step per session. An import while it is open closes it without committing, and
|
|
7
|
+
* so does a canvas that turns read-only, after putting the previous labels back.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createAxisLabelsPopover(chrome: PopoverChrome, modeler: Modeler): PopoverHandle;
|
|
10
|
+
//# sourceMappingURL=AxisLabelsPopover.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Modeler } from '../Modeler.js';
|
|
2
|
+
import { PopoverChrome, PopoverHandle } from './popover.js';
|
|
3
|
+
/**
|
|
4
|
+
* "Map size…" (guide §5.4): presets, a custom width × height and a reset to the default size. Every
|
|
5
|
+
* choice is drawn at once as a preview without an undo step; closing writes ONE edit (none when the
|
|
6
|
+
* map ends at the size it had). An import while it is open closes it without writing, and so does
|
|
7
|
+
* a canvas that turns read-only, after putting the previous size back.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createMapSizePopover(chrome: PopoverChrome, modeler: Modeler): PopoverHandle;
|
|
10
|
+
//# sourceMappingURL=MapSizePopover.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DialogChrome, MapDialog } from './dialog.js';
|
|
2
|
+
import { MapShortcutOptions, ShortcutsChrome } from './shortcuts.js';
|
|
3
|
+
/** What the dialog needs of the chrome around the map; a `@miragon/modeler-shell` handle fits. */
|
|
4
|
+
export interface ShortcutsDialogChrome extends ShortcutsChrome, DialogChrome {
|
|
5
|
+
readonly messages: ShortcutsChrome['messages'] & DialogChrome['messages'];
|
|
6
|
+
}
|
|
7
|
+
export type ShortcutsDialog = MapDialog;
|
|
8
|
+
/**
|
|
9
|
+
* The "Keyboard shortcuts…" dialog of the Help group (guide §5.4, §8): one table per group, the
|
|
10
|
+
* keys as chips like the chrome tooltip's. A web app that binds keys of its own (Open…, the map
|
|
11
|
+
* file's export, `?`) passes them in `options`, so the dialog lists them as well.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createShortcutsDialog(chrome: ShortcutsDialogChrome, options?: MapShortcutOptions): ShortcutsDialog;
|
|
14
|
+
//# sourceMappingURL=ShortcutsDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShortcutsDialog.d.ts","sourceRoot":"","sources":["../../src/map-menu/ShortcutsDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAEjF,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAIxB,kGAAkG;AAClG,MAAM,WAAW,qBAAsB,SAAQ,eAAe,EAAE,YAAY;IAC1E,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;CAC3E;AAED,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;AAqBxC;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,qBAAqB,EAC7B,OAAO,GAAE,kBAAuB,GAC/B,eAAe,CAejB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Modeler } from '../Modeler.js';
|
|
2
|
+
import { DialogChrome, MapDialog } from './dialog.js';
|
|
3
|
+
export type TitleDialogChrome = DialogChrome;
|
|
4
|
+
export type TitleDialog = MapDialog;
|
|
5
|
+
/**
|
|
6
|
+
* The "Map title…" dialog of the Model group: guide §5.4 keeps form fields out of the menu, so the
|
|
7
|
+
* entry opens a dialog (§8) with the title field, Cancel and Apply. Enter applies, Escape and
|
|
8
|
+
* Cancel keep the title; an unchanged title writes nothing, so the map's history gets no empty
|
|
9
|
+
* step. A canvas that turns read-only closes it without writing, as it locks the entry.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createTitleDialog(chrome: TitleDialogChrome, modeler: Modeler): TitleDialog;
|
|
12
|
+
//# sourceMappingURL=TitleDialog.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** What a dialog needs of the chrome around the map; a `@miragon/modeler-shell` handle fits. */
|
|
2
|
+
export interface DialogChrome {
|
|
3
|
+
/** Where the dialog lives (the shell root), so it shares the chrome's mode and fonts. */
|
|
4
|
+
readonly root: HTMLElement;
|
|
5
|
+
readonly messages: {
|
|
6
|
+
readonly close: string;
|
|
7
|
+
};
|
|
8
|
+
/** The control the focus returns to once the dialog closes. */
|
|
9
|
+
readonly menu: {
|
|
10
|
+
readonly trigger: HTMLElement;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface MapDialog {
|
|
14
|
+
open(): void;
|
|
15
|
+
isOpen(): boolean;
|
|
16
|
+
close(): void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
19
|
+
export interface MapDialogParts {
|
|
20
|
+
/** Class of the `<dialog>` next to `wardley-dialog`, for the dialog's own rules. */
|
|
21
|
+
readonly className: string;
|
|
22
|
+
readonly title: string;
|
|
23
|
+
/** The parts below the header (body, footer), built once on the first open. */
|
|
24
|
+
content(close: () => void): Node[];
|
|
25
|
+
/** Runs before every open, while the dialog is still closed. */
|
|
26
|
+
beforeOpen?(): void;
|
|
27
|
+
/** Runs after every open, once the dialog shows and holds the focus. */
|
|
28
|
+
afterOpen?(): void;
|
|
29
|
+
/** Runs after every close, before the focus goes back. */
|
|
30
|
+
afterClose?(): void;
|
|
31
|
+
}
|
|
32
|
+
/** A footer button of guide §8: primary (the confirming action), secondary or ghost. */
|
|
33
|
+
export declare function dialogButton(label: string, variant: 'primary' | 'secondary' | 'ghost'): HTMLButtonElement;
|
|
34
|
+
/**
|
|
35
|
+
* A dialog of the map's chrome (guide §8, "Modeler dialogs" of the shell's API): a native modal
|
|
36
|
+
* <dialog> inside the chrome's root, so the browser keeps the focus inside it and closes it on
|
|
37
|
+
* Escape. Built on the first open and kept (closed) afterwards; `destroy()` removes it. The host
|
|
38
|
+
* calls it with the diagram's teardown, since the chrome removes only what it added itself.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createMapDialog(chrome: DialogChrome, parts: MapDialogParts): MapDialog;
|
|
41
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/map-menu/dialog.ts"],"names":[],"mappings":"AAEA,gGAAgG;AAChG,MAAM,WAAW,YAAY;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;KAAE,CAAC;CAClD;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,OAAO,CAAC;IAClB,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,OAAO,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,EAAE,CAAC;IACnC,gEAAgE;IAChE,UAAU,CAAC,IAAI,IAAI,CAAC;IACpB,wEAAwE;IACxE,SAAS,CAAC,IAAI,IAAI,CAAC;IACnB,0DAA0D;IAC1D,UAAU,CAAC,IAAI,IAAI,CAAC;CACrB;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GACzC,iBAAiB,CAKnB;AAoBD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,GAAG,SAAS,CA8CtF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*! @miragon/wardley-renderer icon geometry: x. Lucide (lucide-static 1.59.0) @license ISC
|
|
2
|
+
* Copyright (c) 2026 Lucide Icons and Contributors
|
|
3
|
+
* Derived from Feather @license MIT, Copyright (c) 2013-present Cole Bemis
|
|
4
|
+
* Full notices: README.md of @miragon/wardley-renderer */
|
|
5
|
+
/** Lucide `x` (lucide-static 1.59.0, ISC; derived from Feather, MIT) at the chrome size of §5.14. */
|
|
6
|
+
export declare const CLOSE_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>";
|
|
7
|
+
export declare function element<K extends keyof HTMLElementTagNameMap>(tag: K, className: string, text?: string): HTMLElementTagNameMap[K];
|
|
8
|
+
export declare function uniqueId(prefix: string): string;
|
|
9
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/map-menu/dom.ts"],"names":[],"mappings":"AAAA;;;0DAG0D;AAC1D,qGAAqG;AACrG,eAAO,MAAM,UAAU,6SAC2P,CAAC;AAEnR,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAC3D,GAAG,EAAE,CAAC,EACN,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,GACZ,qBAAqB,CAAC,CAAC,CAAC,CAK1B;AAID,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG/C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { mapMenu, EXPORT_LABELS } from './menu.js';
|
|
2
|
+
export type { MapExport, MapExports, MapMenu, MapMenuAction, MapMenuActions, MapMenuDialog, MapMenuEntry, MapMenuIcon, } from './menu.js';
|
|
3
|
+
export { mapShortcuts } from './shortcuts.js';
|
|
4
|
+
export type { MapShortcutOptions, ShortcutGroup, ShortcutKeyNames, ShortcutPlatform, ShortcutRow, ShortcutsChrome, } from './shortcuts.js';
|
|
5
|
+
export { createMapDialog, dialogButton } from './dialog.js';
|
|
6
|
+
export type { DialogChrome, MapDialog, MapDialogParts } from './dialog.js';
|
|
7
|
+
export { createShortcutsDialog } from './ShortcutsDialog.js';
|
|
8
|
+
export type { ShortcutsDialog, ShortcutsDialogChrome } from './ShortcutsDialog.js';
|
|
9
|
+
export { createTitleDialog } from './TitleDialog.js';
|
|
10
|
+
export type { TitleDialog, TitleDialogChrome } from './TitleDialog.js';
|
|
11
|
+
export { createMapSizePopover } from './MapSizePopover.js';
|
|
12
|
+
export { createAxisLabelsPopover } from './AxisLabelsPopover.js';
|
|
13
|
+
export type { PopoverChrome, PopoverHandle } from './popover.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** The icons the guide gives these entries (guide §5.14, the shell's common set). */
|
|
2
|
+
export type MapMenuIcon = 'file-image' | 'file-code-corner' | 'keyboard';
|
|
3
|
+
interface MapMenuItem {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly icon?: MapMenuIcon;
|
|
7
|
+
readonly keepEnabledWhenReadOnly?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface MapMenuAction extends MapMenuItem {
|
|
10
|
+
readonly kind: 'action';
|
|
11
|
+
readonly shortcut?: string;
|
|
12
|
+
onSelect(): void;
|
|
13
|
+
}
|
|
14
|
+
export interface MapMenuDialog extends MapMenuItem {
|
|
15
|
+
readonly kind: 'dialog';
|
|
16
|
+
/** The chip of a key that opens the dialog as well, e.g. "?". */
|
|
17
|
+
readonly shortcut?: string;
|
|
18
|
+
onSelect(): void;
|
|
19
|
+
}
|
|
20
|
+
export type MapMenuEntry = MapMenuAction | MapMenuDialog;
|
|
21
|
+
export interface MapMenu {
|
|
22
|
+
readonly model: readonly MapMenuEntry[];
|
|
23
|
+
readonly export: readonly MapMenuEntry[];
|
|
24
|
+
readonly help: readonly MapMenuEntry[];
|
|
25
|
+
}
|
|
26
|
+
export interface MapExport {
|
|
27
|
+
onSelect(): void;
|
|
28
|
+
/** The chip of an app key that runs the same export, e.g. "⌘S". */
|
|
29
|
+
readonly shortcut?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The exports a host offers, in the guide's order: PNG first (the more frequent target), then
|
|
33
|
+
* SVG, then the variants, then further formats. Only the web app adds the map file itself, which
|
|
34
|
+
* in VS Code is the document.
|
|
35
|
+
*/
|
|
36
|
+
export interface MapExports {
|
|
37
|
+
readonly png: MapExport;
|
|
38
|
+
readonly svg: MapExport;
|
|
39
|
+
readonly transparentPng?: MapExport | undefined;
|
|
40
|
+
readonly json?: MapExport | undefined;
|
|
41
|
+
readonly wmap?: MapExport | undefined;
|
|
42
|
+
}
|
|
43
|
+
export interface MapMenuActions {
|
|
44
|
+
/** Opens the "Map title…" dialog; without it the Model group has no title entry. */
|
|
45
|
+
mapTitle?: (() => void) | undefined;
|
|
46
|
+
/** Opens the "Map size…" popover. */
|
|
47
|
+
mapSize(): void;
|
|
48
|
+
/** Opens the "X-axis labels…" popover. */
|
|
49
|
+
axisLabels(): void;
|
|
50
|
+
readonly exports: MapExports;
|
|
51
|
+
showKeyboardShortcuts(): void;
|
|
52
|
+
}
|
|
53
|
+
/** The labels of the export entries, also used by the hosts' commands and notifications. */
|
|
54
|
+
export declare const EXPORT_LABELS: {
|
|
55
|
+
readonly png: "Export as PNG";
|
|
56
|
+
readonly svg: "Export as SVG";
|
|
57
|
+
readonly transparentPng: "Export as PNG (4×, transparent)";
|
|
58
|
+
readonly json: "Export as JSON";
|
|
59
|
+
readonly wmap: "Export as .wmap";
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The menu groups of a map (guide §5.4): Model with the title dialog where the host offers it and
|
|
63
|
+
* the two popovers (all three change the document, so a read-only canvas disables them), Export
|
|
64
|
+
* with PNG first, Help with the shortcuts dialog.
|
|
65
|
+
*/
|
|
66
|
+
export declare function mapMenu(actions: MapMenuActions): MapMenu;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/map-menu/menu.ts"],"names":[],"mappings":"AAMA,qFAAqF;AACrF,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,kBAAkB,GAAG,UAAU,CAAC;AAEzE,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,QA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OAAO,IAAI,IAAI,CAAC;IAChB,0CAA0C;IAC1C,UAAU,IAAI,IAAI,CAAC;IACnB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,qBAAqB,IAAI,IAAI,CAAC;CAC/B;AAED,4FAA4F;AAC5F,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAiCX;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CA6BxD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Modeler } from '../Modeler.js';
|
|
2
|
+
/** What a popover needs of the chrome around the map; a `@miragon/modeler-shell` handle fits. */
|
|
3
|
+
export interface PopoverChrome {
|
|
4
|
+
/** Where the popover lives (the shell root): it anchors at the dropdown's place there. */
|
|
5
|
+
readonly root: HTMLElement;
|
|
6
|
+
/** The control the focus returns to after Escape or Done. */
|
|
7
|
+
readonly menu: {
|
|
8
|
+
readonly trigger: HTMLElement;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** Why a popover closes: the user is done, an import replaced the map, or the canvas locked. */
|
|
12
|
+
export type PopoverEnd = 'done' | 'import' | 'cancel';
|
|
13
|
+
export interface PopoverHandle {
|
|
14
|
+
open(): void;
|
|
15
|
+
isOpen(): boolean;
|
|
16
|
+
/** Closes as if the user were done: the previewed change becomes one edit. */
|
|
17
|
+
close(): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
20
|
+
export interface PopoverParts {
|
|
21
|
+
readonly className: string;
|
|
22
|
+
readonly title: string;
|
|
23
|
+
/** Fills the body (fields) and the footer (buttons) once; `done` closes like Done. */
|
|
24
|
+
build(body: HTMLElement, footer: HTMLElement, done: () => void): void;
|
|
25
|
+
/** Reads the map into the fields on every open; returns the field to focus. */
|
|
26
|
+
opened(): HTMLElement | undefined;
|
|
27
|
+
/** Commits the preview (`done`) or drops it (`import`: the map is gone, `cancel`: revert). */
|
|
28
|
+
closed(end: PopoverEnd): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A popover of guide §5.4: a menu entry that needs the canvas preview opens it at the dropdown's
|
|
32
|
+
* place, without a backdrop, as a non-modal `role="dialog"` labelled by its title. Escape and a
|
|
33
|
+
* click outside close it; the focus returns to the menu trigger after Escape and Done, while a
|
|
34
|
+
* click outside leaves it on what was clicked.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createPopover(chrome: PopoverChrome, parts: PopoverParts): PopoverHandle & {
|
|
37
|
+
end(end: PopoverEnd): void;
|
|
38
|
+
};
|
|
39
|
+
/** A labelled field of guide §8: the label above, 4px apart, an error below it when refused. */
|
|
40
|
+
export declare function field(label: string, control: HTMLInputElement | HTMLSelectElement): {
|
|
41
|
+
wrapper: HTMLElement;
|
|
42
|
+
showError(message: string): void;
|
|
43
|
+
clearError(): void;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Closes `popover` without committing when the map is replaced (an import: the preview went with
|
|
47
|
+
* the old map) or turns read-only (the preview is put back), and stops listening on destroy.
|
|
48
|
+
*/
|
|
49
|
+
export declare function withMapListeners(modeler: Modeler, popover: PopoverHandle & {
|
|
50
|
+
end(end: PopoverEnd): void;
|
|
51
|
+
}): PopoverHandle;
|
|
52
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/map-menu/popover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAI7C,iGAAiG;AACjG,MAAM,WAAW,aAAa;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;KAAE,CAAC;CAClD;AAED,gGAAgG;AAChG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAA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
|
3
|
+
readonly ctrl: string;
|
|
4
|
+
readonly shift: string;
|
|
5
|
+
readonly plus: string;
|
|
6
|
+
readonly minus: string;
|
|
7
|
+
}
|
|
8
|
+
/** What the shortcuts need of the chrome around the map. */
|
|
9
|
+
export interface ShortcutsChrome {
|
|
10
|
+
readonly platform: ShortcutPlatform;
|
|
11
|
+
/** The tool's UI language, for the percentage in "Zoom to 100%". */
|
|
12
|
+
readonly lang: string;
|
|
13
|
+
readonly messages: {
|
|
14
|
+
readonly zoomIn: string;
|
|
15
|
+
readonly zoomOut: string;
|
|
16
|
+
zoomToActual(percent: string): string;
|
|
17
|
+
readonly fit: string;
|
|
18
|
+
/** The File group's "Open…" (the shell's `messages.openFile`); default "Open…". */
|
|
19
|
+
readonly openFile?: string | undefined;
|
|
20
|
+
readonly keyNames: ShortcutKeyNames;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Keys a web app binds itself, next to the canvas's and the chrome's. */
|
|
24
|
+
export interface MapShortcutOptions {
|
|
25
|
+
/**
|
|
26
|
+
* Cmd/Ctrl+O opens a file, Cmd/Ctrl+S exports the .wmap file and Cmd/Ctrl+V opens OWM text or a
|
|
27
|
+
* share link pasted onto the canvas: a File group comes first.
|
|
28
|
+
*/
|
|
29
|
+
readonly fileKeys?: boolean | undefined;
|
|
30
|
+
/** The key that opens the dialog itself, e.g. "?", listed in the View group. */
|
|
31
|
+
readonly shortcutsKey?: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface ShortcutRow {
|
|
34
|
+
readonly action: string;
|
|
35
|
+
/** Alternative keys or gestures, each shown as its own chip. */
|
|
36
|
+
readonly keys: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
export interface ShortcutGroup {
|
|
39
|
+
readonly title: string;
|
|
40
|
+
readonly rows: readonly ShortcutRow[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Every shortcut of a map, grouped as guide §5.4 asks: View (the chrome's zoom keys), Edit, the
|
|
44
|
+
* notation's tools and the gestures on the map itself, after the web app's File keys where it
|
|
45
|
+
* binds them.
|
|
46
|
+
*/
|
|
47
|
+
export declare function mapShortcuts(chrome: ShortcutsChrome, options?: MapShortcutOptions): ShortcutGroup[];
|
|
48
|
+
//# sourceMappingURL=shortcuts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcuts.d.ts","sourceRoot":"","sources":["../../src/map-menu/shortcuts.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,4DAA4D;AAC5D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;QACtC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,mFAAmF;QACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACvC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;KACrC,CAAC;CACH;AAED,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,gFAAgF;IAChF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAA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