@miragon/wardley-renderer 0.6.3 → 0.8.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 +131 -1
- package/dist/Modeler.d.ts +5 -0
- package/dist/Modeler.d.ts.map +1 -1
- package/dist/NavigatedViewer.d.ts.map +1 -1
- package/dist/WardleyBaseViewer.d.ts +90 -12
- package/dist/WardleyBaseViewer.d.ts.map +1 -1
- package/dist/a11y/canvasFocus.d.ts +17 -0
- package/dist/a11y/canvasFocus.d.ts.map +1 -0
- package/dist/a11y/describeCanvas.d.ts +8 -0
- package/dist/a11y/describeCanvas.d.ts.map +1 -0
- package/dist/a11y/index.d.ts +5 -0
- package/dist/a11y/index.d.ts.map +1 -0
- package/dist/append/WardleyAppendBehavior.d.ts +7 -6
- package/dist/append/WardleyAppendBehavior.d.ts.map +1 -1
- package/dist/collaborative/CollaborativeWardley.d.ts +27 -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 +10 -3
- package/dist/color-picker/WardleyColorPicker.d.ts.map +1 -1
- package/dist/context-pad/WardleyContextPad.d.ts +30 -0
- package/dist/context-pad/WardleyContextPad.d.ts.map +1 -0
- package/dist/context-pad/WardleyContextPadProvider.d.ts +23 -1
- package/dist/context-pad/WardleyContextPadProvider.d.ts.map +1 -1
- package/dist/context-pad/index.d.ts +1 -0
- package/dist/context-pad/index.d.ts.map +1 -1
- package/dist/draw/WardleyRenderer.d.ts +8 -0
- package/dist/draw/WardleyRenderer.d.ts.map +1 -1
- package/dist/draw/deprecated-icons.d.ts +35 -0
- package/dist/draw/deprecated-icons.d.ts.map +1 -0
- package/dist/draw/icons.d.ts +9 -26
- package/dist/draw/icons.d.ts.map +1 -1
- package/dist/draw/index.d.ts +2 -1
- package/dist/draw/index.d.ts.map +1 -1
- package/dist/draw/label-layout.d.ts +59 -0
- package/dist/draw/label-layout.d.ts.map +1 -0
- package/dist/draw/palette-icons.d.ts +1 -0
- package/dist/draw/palette-icons.d.ts.map +1 -1
- package/dist/draw/styles.d.ts +16 -17
- package/dist/draw/styles.d.ts.map +1 -1
- package/dist/draw-tool/WardleyDrawTool.d.ts +14 -1
- package/dist/draw-tool/WardleyDrawTool.d.ts.map +1 -1
- package/dist/draw-tool/WardleyDrawingHandles.d.ts +4 -1
- package/dist/draw-tool/WardleyDrawingHandles.d.ts.map +1 -1
- package/dist/editor-state.d.ts +56 -0
- package/dist/editor-state.d.ts.map +1 -0
- package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts +58 -24
- package/dist/evolution-grid/EvolutionConstraintBehavior.d.ts.map +1 -1
- package/dist/evolution-grid/EvolutionGrid.d.ts +2 -0
- package/dist/evolution-grid/EvolutionGrid.d.ts.map +1 -1
- package/dist/evolution-grid/index.d.ts.map +1 -1
- package/dist/evolve/WardleyEvolveDragging.d.ts +3 -1
- package/dist/evolve/WardleyEvolveDragging.d.ts.map +1 -1
- package/dist/evolve/constants.d.ts +3 -0
- package/dist/evolve/constants.d.ts.map +1 -0
- package/dist/evolve/index.d.ts +1 -0
- package/dist/evolve/index.d.ts.map +1 -1
- package/dist/free-rect/FreeRect.d.ts +34 -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 +28 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4967 -1941
- package/dist/index.js.map +1 -1
- package/dist/io/WardleyExporter.d.ts +3 -1
- package/dist/io/WardleyExporter.d.ts.map +1 -1
- package/dist/io/WardleyImporter.d.ts.map +1 -1
- package/dist/io/WardleySourceOrder.d.ts +23 -0
- package/dist/io/WardleySourceOrder.d.ts.map +1 -0
- package/dist/io/exportBounds.d.ts +15 -0
- package/dist/io/exportBounds.d.ts.map +1 -0
- package/dist/io/index.d.ts +5 -0
- package/dist/io/index.d.ts.map +1 -1
- package/dist/io/rasterize.d.ts +25 -0
- package/dist/io/rasterize.d.ts.map +1 -0
- package/dist/io/saveSvg.d.ts +1 -1
- package/dist/io/saveSvg.d.ts.map +1 -1
- package/dist/io/types.d.ts +5 -0
- package/dist/io/types.d.ts.map +1 -1
- package/dist/keyboard/WardleyKeyboard.d.ts +47 -4
- package/dist/keyboard/WardleyKeyboard.d.ts.map +1 -1
- package/dist/label-drag/WardleyLabelDragging.d.ts +58 -0
- package/dist/label-drag/WardleyLabelDragging.d.ts.map +1 -0
- package/dist/label-drag/index.d.ts +5 -0
- package/dist/label-drag/index.d.ts.map +1 -0
- package/dist/label-editing/WardleyLabelEditing.d.ts +63 -6
- package/dist/label-editing/WardleyLabelEditing.d.ts.map +1 -1
- package/dist/label-editing/fieldError.d.ts +13 -0
- package/dist/label-editing/fieldError.d.ts.map +1 -0
- package/dist/label-editing/index.d.ts +1 -0
- package/dist/label-editing/index.d.ts.map +1 -1
- package/dist/link-editing/WardleyLinkEditing.d.ts +40 -0
- package/dist/link-editing/WardleyLinkEditing.d.ts.map +1 -0
- package/dist/link-editing/index.d.ts +6 -0
- package/dist/link-editing/index.d.ts.map +1 -0
- package/dist/link-editing/link-url.d.ts +14 -0
- package/dist/link-editing/link-url.d.ts.map +1 -0
- package/dist/map-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 +84 -0
- package/dist/map-resize/MapProjection.d.ts.map +1 -0
- package/dist/map-resize/MapResizeHandles.d.ts +59 -0
- package/dist/map-resize/MapResizeHandles.d.ts.map +1 -0
- package/dist/map-resize/ResizeAwareAutoScroll.d.ts +15 -0
- package/dist/map-resize/ResizeAwareAutoScroll.d.ts.map +1 -0
- package/dist/map-resize/index.d.ts +14 -0
- package/dist/map-resize/index.d.ts.map +1 -0
- package/dist/model/WardleyElementFactory.d.ts +36 -2
- package/dist/model/WardleyElementFactory.d.ts.map +1 -1
- package/dist/modeling/WardleyCopyPaste.d.ts +9 -5
- package/dist/modeling/WardleyCopyPaste.d.ts.map +1 -1
- package/dist/modeling/WardleyModeling.d.ts +16 -2
- package/dist/modeling/WardleyModeling.d.ts.map +1 -1
- package/dist/modeling/cmd/ResizeMapHandler.d.ts +24 -0
- package/dist/modeling/cmd/ResizeMapHandler.d.ts.map +1 -0
- package/dist/modeling/cmd/UpdateConfigHandler.d.ts +42 -0
- package/dist/modeling/cmd/UpdateConfigHandler.d.ts.map +1 -0
- package/dist/modeling/index.d.ts +2 -0
- package/dist/modeling/index.d.ts.map +1 -1
- package/dist/ordering/WardleyOrderingProvider.d.ts +1 -1
- package/dist/ordering/WardleyOrderingProvider.d.ts.map +1 -1
- package/dist/palette/WardleyPaletteKeyboard.d.ts +26 -0
- package/dist/palette/WardleyPaletteKeyboard.d.ts.map +1 -0
- package/dist/palette/WardleyPaletteProvider.d.ts +20 -1
- package/dist/palette/WardleyPaletteProvider.d.ts.map +1 -1
- package/dist/palette/index.d.ts +2 -1
- package/dist/palette/index.d.ts.map +1 -1
- package/dist/pan-constraint/PanConstraint.d.ts +24 -2
- package/dist/pan-constraint/PanConstraint.d.ts.map +1 -1
- package/dist/pipeline/PipelineGroupBehavior.d.ts +24 -0
- package/dist/pipeline/PipelineGroupBehavior.d.ts.map +1 -0
- package/dist/pipeline/index.d.ts +6 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/pipelineMembership.d.ts +23 -0
- package/dist/pipeline/pipelineMembership.d.ts.map +1 -0
- package/dist/popup/WardleyElementSettingsProvider.d.ts +2 -1
- package/dist/popup/WardleyElementSettingsProvider.d.ts.map +1 -1
- package/dist/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/rules/WardleyRules.d.ts.map +1 -1
- package/dist/snapping/StageSnapping.d.ts +6 -2
- package/dist/snapping/StageSnapping.d.ts.map +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/palette.d.ts +28 -29
- package/dist/theme/palette.d.ts.map +1 -1
- package/dist/wardley.css +1 -1
- package/package.json +10 -9
|
@@ -2,6 +2,7 @@ import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
|
2
2
|
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
3
3
|
import { WardleyMap } from '@miragon/wardley-schema-model';
|
|
4
4
|
import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
5
|
+
import { default as WardleySourceOrder } from './WardleySourceOrder.js';
|
|
5
6
|
/**
|
|
6
7
|
* Reconstructs a WardleyMap from the diagram-js runtime model. The source of truth for positions are
|
|
7
8
|
* the DI properties `evolution`/`visibility`; editable fields (label, decorators, movement,
|
|
@@ -12,8 +13,9 @@ export default class WardleyExporter {
|
|
|
12
13
|
private readonly elementRegistry;
|
|
13
14
|
private readonly canvas;
|
|
14
15
|
private readonly grid;
|
|
16
|
+
private readonly sourceOrder;
|
|
15
17
|
static $inject: string[];
|
|
16
|
-
constructor(elementRegistry: ElementRegistry, canvas: Canvas, grid: EvolutionGrid);
|
|
18
|
+
constructor(elementRegistry: ElementRegistry, canvas: Canvas, grid: EvolutionGrid, sourceOrder: WardleySourceOrder);
|
|
17
19
|
export(): WardleyMap;
|
|
18
20
|
/** Builds a MapElement from the DI properties (common types) or the businessObject (the rest). */
|
|
19
21
|
private buildElement;
|
|
@@ -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,
|
|
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 +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,
|
|
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;AAE3E,OAAO,EAAW,KAAK,aAAa,EAA2B,MAAM,YAAY,CAAC;AAiBlF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAWhC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAflC,MAAM,CAAC,OAAO,WAOZ;gBAGiB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,qBAAqB,EAC9B,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe;IAGnD,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,aAAa,EAAE;IAmGxC,OAAO,CAAC,WAAW;IAInB,KAAK,IAAI,IAAI;CAed"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
2
|
+
import { WardleyMap } from '@miragon/wardley-schema-model';
|
|
3
|
+
interface Identified {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Remembers the order in which elements and edges appeared in the imported map, so the export can
|
|
8
|
+
* write them back in that order. The registry/DOM order cannot serve: it is the z-order (frames,
|
|
9
|
+
* connections, nodes), and exporting in it reshuffles every hand-written file on the first edit.
|
|
10
|
+
*/
|
|
11
|
+
export default class WardleySourceOrder {
|
|
12
|
+
static $inject: string[];
|
|
13
|
+
private elementIndex;
|
|
14
|
+
private edgeIndex;
|
|
15
|
+
constructor(eventBus: EventBus);
|
|
16
|
+
remember(map: Pick<WardleyMap, 'elements' | 'edges'>): void;
|
|
17
|
+
/** Imported elements in source order, followed by the rest in their given (creation) order. */
|
|
18
|
+
sortElements<T extends Identified>(elements: readonly T[]): T[];
|
|
19
|
+
/** Imported edges in source order, followed by the rest in their given (creation) order. */
|
|
20
|
+
sortEdges<T extends Identified>(edges: readonly T[]): T[];
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=WardleySourceOrder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WardleySourceOrder.d.ts","sourceRoot":"","sources":["../../src/io/WardleySourceOrder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,UAAU,UAAU;IAClB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IACrC,MAAM,CAAC,OAAO,WAAgB;IAE9B,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,SAAS,CAA6B;gBAElC,QAAQ,EAAE,QAAQ;IAK9B,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,IAAI;IAK3D,+FAA+F;IAC/F,YAAY,CAAC,CAAC,SAAS,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE;IAI/D,4FAA4F;IAC5F,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE;CAG1D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
|
+
import { SvgBounds } from './saveSvg.js';
|
|
3
|
+
/** Covers what getBBox ignores, chiefly the label halo stroke. */
|
|
4
|
+
export declare const EXPORT_CONTENT_PADDING = 12;
|
|
5
|
+
interface OuterBoundsSource {
|
|
6
|
+
outerBounds(): SvgBounds;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The area an image export must cover: the plot frame plus everything drawn on the element layer
|
|
10
|
+
* and the axes. Labels of commodity components (evolution near 1) and notes run past the plot's
|
|
11
|
+
* right edge, so exporting only the plot frame crops them.
|
|
12
|
+
*/
|
|
13
|
+
export declare function exportBounds(canvas: Canvas, grid: OuterBoundsSource, padding?: number): SvgBounds;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=exportBounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exportBounds.d.ts","sourceRoot":"","sources":["../../src/io/exportBounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAQ9C,kEAAkE;AAClE,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,UAAU,iBAAiB;IACzB,WAAW,IAAI,SAAS,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,EACvB,OAAO,SAAyB,GAC/B,SAAS,CA0BX"}
|
package/dist/io/index.d.ts
CHANGED
|
@@ -2,7 +2,12 @@ import { ModuleDeclaration } from 'didi';
|
|
|
2
2
|
export declare const ioModule: ModuleDeclaration;
|
|
3
3
|
export { default as WardleyImporter } from './WardleyImporter.js';
|
|
4
4
|
export { default as WardleyExporter } from './WardleyExporter.js';
|
|
5
|
+
export { default as WardleySourceOrder } from './WardleySourceOrder.js';
|
|
5
6
|
export { saveSVG } from './saveSvg.js';
|
|
7
|
+
export type { SvgBounds } from './saveSvg.js';
|
|
8
|
+
export { exportBounds, EXPORT_CONTENT_PADDING } from './exportBounds.js';
|
|
9
|
+
export { svgToPng, blobToBase64 } from './rasterize.js';
|
|
10
|
+
export type { SvgToPngOptions } from './rasterize.js';
|
|
6
11
|
export { ROOT_ID } from './types.js';
|
|
7
12
|
export type { ImportWarning, RootBusinessObject } from './types.js';
|
|
8
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/io/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface SvgToPngOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Pixel density factor relative to the SVG's own size (default 2). Lowered automatically where
|
|
4
|
+
* the PNG would exceed the browser's canvas size limits.
|
|
5
|
+
*/
|
|
6
|
+
readonly scale?: number;
|
|
7
|
+
/** Leave the background transparent instead of filling it with the paper colour (slides, docs). */
|
|
8
|
+
readonly transparent?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Rasterizes a standalone SVG (e.g. from `saveSVG()`) into a PNG picture. Browser-only: needs
|
|
12
|
+
* `Image`, `<canvas>` and object URLs. The PNG carries no embedded map source.
|
|
13
|
+
*/
|
|
14
|
+
export declare function svgToPng(svg: string, options?: SvgToPngOptions): Promise<Blob>;
|
|
15
|
+
/**
|
|
16
|
+
* Pixel size of the PNG: the SVG size times `scale`, reduced proportionally where it would exceed
|
|
17
|
+
* the browser's canvas limits, so a huge map still exports, just at a lower density.
|
|
18
|
+
*/
|
|
19
|
+
export declare function rasterSize(width: number, height: number, scale: number): {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
/** Blob -> Base64 without the data-URL prefix, e.g. to post an export to a VS Code extension host. */
|
|
24
|
+
export declare function blobToBase64(blob: Blob): Promise<string>;
|
|
25
|
+
//# sourceMappingURL=rasterize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rasterize.d.ts","sourceRoot":"","sources":["../../src/io/rasterize.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,mGAAmG;IACnG,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAYD;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCxF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAWnC;AAED,sGAAsG;AACtG,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxD"}
|
package/dist/io/saveSvg.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface SvgBounds {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Serializes the current canvas into standalone SVG (snapshot/export).
|
|
10
|
-
* `bounds` is the outer plot boundary (typically `
|
|
10
|
+
* `bounds` is the outer plot boundary (typically `exportBounds(canvas, grid)`), so that
|
|
11
11
|
* maps enlarged via `config.size` are exported completely; if omitted, the default plot
|
|
12
12
|
* area is used. Independent of the current zoom/scroll.
|
|
13
13
|
*/
|
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"}
|
package/dist/io/types.d.ts
CHANGED
|
@@ -2,8 +2,13 @@ import { MapConfig } from '@miragon/wardley-schema-model';
|
|
|
2
2
|
/** ID of the diagram-js root element of the Wardley map. */
|
|
3
3
|
export declare const ROOT_ID = "wardley-root";
|
|
4
4
|
export interface ImportWarning {
|
|
5
|
+
/** Human-readable, already including the line and source text for DSL findings. */
|
|
5
6
|
readonly message: string;
|
|
6
7
|
readonly elementId?: string;
|
|
8
|
+
/** 1-based line of the DSL finding, for listing or jumping to the offending line. */
|
|
9
|
+
readonly line?: number;
|
|
10
|
+
/** The offending DSL source line as written. */
|
|
11
|
+
readonly source?: string;
|
|
7
12
|
}
|
|
8
13
|
/** Map metadata stored on the root element (config + lossless passthrough). */
|
|
9
14
|
export interface RootBusinessObject {
|
package/dist/io/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/io/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,4DAA4D;AAC5D,eAAO,MAAM,OAAO,iBAAiB,CAAC;AAEtC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/io/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,4DAA4D;AAC5D,eAAO,MAAM,OAAO,iBAAiB,CAAC;AAEtC,MAAM,WAAW,aAAa;IAC5B,mFAAmF;IACnF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C"}
|
|
@@ -1,20 +1,63 @@
|
|
|
1
1
|
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
2
|
import { default as CommandStack } from 'diagram-js/lib/command/CommandStack';
|
|
3
|
+
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
3
4
|
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
4
5
|
import { default as Create } from 'diagram-js/lib/features/create/Create';
|
|
5
6
|
import { default as LassoTool } from 'diagram-js/lib/features/lasso-tool/LassoTool';
|
|
6
7
|
import { default as Mouse } from 'diagram-js/lib/features/mouse/Mouse';
|
|
7
8
|
import { default as Selection } from 'diagram-js/lib/features/selection/Selection';
|
|
8
9
|
import { default as Modeling } from 'diagram-js/lib/features/modeling/Modeling';
|
|
10
|
+
import { Injector } from 'didi';
|
|
9
11
|
import { default as WardleyCopyPaste } from '../modeling/WardleyCopyPaste.js';
|
|
10
12
|
import { default as WardleyElementFactory } from '../model/WardleyElementFactory.js';
|
|
13
|
+
/** Diagram config `wardleyKeyboard` (Modeler option `keyboard`). */
|
|
14
|
+
export interface WardleyKeyboardConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Handle Cmd/Ctrl+Z, Cmd/Ctrl+Shift+Z and Cmd/Ctrl+Y on the canvas (default true). Hosts that own
|
|
17
|
+
* undo themselves (VS Code custom editors) set this to false and receive the keys untouched.
|
|
18
|
+
*/
|
|
19
|
+
undoRedo?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Decides whether a keydown belongs to the host page rather than the canvas. Canvas shortcuts
|
|
23
|
+
* only run when focus is on the canvas, the palette, or nowhere in particular (body) — so a
|
|
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, 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).
|
|
28
|
+
*/
|
|
29
|
+
export declare function shouldIgnoreKeyEvent(event: KeyboardEvent, canvasContainer: HTMLElement, canvasTargetsOnly?: boolean): boolean;
|
|
11
30
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* L (lasso). Deliberately a DOM listener (no diagram-js
|
|
31
|
+
* Keyboard binding: undo/redo, delete, copy/paste/duplicate, arrow-key nudge, Escape (deselect),
|
|
32
|
+
* Cmd/Ctrl+A (select all), the single-key tools C (component), U (user), N (note), P (pipeline),
|
|
33
|
+
* L (lasso) and A (connect from the selected node). Deliberately a DOM listener (no diagram-js
|
|
34
|
+
* keyboard-service binding needed).
|
|
15
35
|
*/
|
|
16
36
|
export default class WardleyKeyboard {
|
|
37
|
+
private readonly canvas;
|
|
38
|
+
private readonly selection;
|
|
39
|
+
private readonly modeling;
|
|
40
|
+
private readonly factory;
|
|
41
|
+
private readonly create;
|
|
42
|
+
private readonly mouse;
|
|
43
|
+
private readonly elementRegistry;
|
|
17
44
|
static $inject: string[];
|
|
18
|
-
|
|
45
|
+
private pointerOverCanvas;
|
|
46
|
+
private readonly labelEditing;
|
|
47
|
+
private readonly grid;
|
|
48
|
+
private readonly freeRect;
|
|
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);
|
|
50
|
+
/**
|
|
51
|
+
* With the pointer over the canvas the new node attaches to it (like palette create; placing it
|
|
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.
|
|
54
|
+
*/
|
|
55
|
+
private quickCreate;
|
|
56
|
+
private insetPlotBounds;
|
|
57
|
+
private visiblePlotCenter;
|
|
58
|
+
private freeSpotNear;
|
|
59
|
+
private singleSelectedShape;
|
|
60
|
+
/** The real pointer event, or a synthetic one at `canvasPoint` when the pointer is elsewhere. */
|
|
61
|
+
private pointerEventOr;
|
|
19
62
|
}
|
|
20
63
|
//# sourceMappingURL=WardleyKeyboard.d.ts.map
|
|
@@ -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,QAAQ,MAAM,8BAA8B,CAAC;
|
|
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,CAAC;AAEhE,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,qCAAqC,CAAC;AAG7D,OAAO,KAAK,SAAS,MAAM,6CAA6C,CAAC;AACzE,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,gBAAgB,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAa3E,oEAAoE;AACpE,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAsED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,EACpB,eAAe,EAAE,WAAW,EAC5B,iBAAiB,UAAQ,GACxB,OAAO,CAYT;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAuBhC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAGtB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAhClC,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;gBAGxB,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;IAwJ3C;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,mBAAmB;IAK3B,iGAAiG;IACjG,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
|
+
import { Injector } from 'didi';
|
|
3
|
+
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
4
|
+
import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
|
|
5
|
+
import { default as Selection } from 'diagram-js/lib/features/selection/Selection';
|
|
6
|
+
import { default as EvolutionGrid } from '../evolution-grid/EvolutionGrid.js';
|
|
7
|
+
import { default as WardleyModeling } from '../modeling/WardleyModeling.js';
|
|
8
|
+
import { WardleyShape } from '../model/di-types.js';
|
|
9
|
+
/** Which offset a label writes: the node's own `label [dx, dy]` or its evolve line's. */
|
|
10
|
+
export type LabelRole = 'name' | 'movement';
|
|
11
|
+
/**
|
|
12
|
+
* 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
|
+
*
|
|
16
|
+
* Reset paths: Alt+double-click on a label, dropping it back onto its default slot, or
|
|
17
|
+
* `resetLabelOffset(shape, role)`.
|
|
18
|
+
*/
|
|
19
|
+
export default class WardleyLabelDragging {
|
|
20
|
+
private readonly eventBus;
|
|
21
|
+
private readonly canvas;
|
|
22
|
+
private readonly elementRegistry;
|
|
23
|
+
private readonly modeling;
|
|
24
|
+
private readonly selection;
|
|
25
|
+
private readonly grid;
|
|
26
|
+
private readonly injector;
|
|
27
|
+
static $inject: string[];
|
|
28
|
+
private active;
|
|
29
|
+
constructor(eventBus: EventBus, canvas: Canvas, elementRegistry: ElementRegistry, modeling: WardleyModeling, selection: Selection, grid: EvolutionGrid, injector: Injector);
|
|
30
|
+
/** Puts a label back into its default slot (undoable). */
|
|
31
|
+
resetLabelOffset(shape: WardleyShape, role?: LabelRole): void;
|
|
32
|
+
private readonly onMouseDown;
|
|
33
|
+
private readonly onMouseMove;
|
|
34
|
+
private readonly onMouseUp;
|
|
35
|
+
/** The click that ends a drag would toggle the owner's selection off again. */
|
|
36
|
+
private suppressNextClick;
|
|
37
|
+
private readonly onKeyDown;
|
|
38
|
+
private readonly onDoubleClick;
|
|
39
|
+
private cancel;
|
|
40
|
+
/** Ends the gesture and restores the pre-drag state (commits run through the command stack). */
|
|
41
|
+
private finish;
|
|
42
|
+
private preview;
|
|
43
|
+
private snapHome;
|
|
44
|
+
private commitNameOffset;
|
|
45
|
+
private commitMovementOffset;
|
|
46
|
+
/**
|
|
47
|
+
* The offset that reproduces the label exactly where it is drawn now, in the OWM frame (relative to
|
|
48
|
+
* the canonical slot). Automatic placements (left of the circle, inertia shift) are converted so
|
|
49
|
+
* the first drag doesn't make the label jump.
|
|
50
|
+
*/
|
|
51
|
+
private renderedOffset;
|
|
52
|
+
/** The offset (OWM frame) of the label's automatic, offset-free position. */
|
|
53
|
+
private defaultOffset;
|
|
54
|
+
private labelTarget;
|
|
55
|
+
/** The `.wardley-container` the viewer mounts into (diagram-js renders into a child of it). */
|
|
56
|
+
private outerContainer;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=WardleyLabelDragging.d.ts.map
|
|
@@ -0,0 +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,CAAC;AAErC,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,sBAAsB,CAAC;AAczE,yFAAyF;AACzF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAsB5C;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAoB;IAcrC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAnB3B,MAAM,CAAC,OAAO,WAQZ;IAEF,OAAO,CAAC,MAAM,CAA0B;gBAGrB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,aAAa,EACnB,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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ModuleDeclaration } from 'didi';
|
|
2
|
+
/** OWM-style draggable labels persisted as `label [dx, dy]` (undoable). */
|
|
3
|
+
export declare const wardleyLabelDragModule: ModuleDeclaration;
|
|
4
|
+
export { default as WardleyLabelDragging, type LabelRole } from './WardleyLabelDragging.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAG9C,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,EAAE,iBAGpC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,27 +1,84 @@
|
|
|
1
1
|
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
2
|
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
3
|
+
import { Injector } from 'didi';
|
|
3
4
|
import { WardleyConnection, WardleyShape } from '../model/di-types.js';
|
|
4
5
|
import { default as WardleyModeling } from '../modeling/WardleyModeling.js';
|
|
5
6
|
import { default as WardleyElementFactory } from '../model/WardleyElementFactory.js';
|
|
7
|
+
/** Text selection (caret when start = end) inside an editor field. */
|
|
8
|
+
export interface FieldSelection {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
}
|
|
12
|
+
/** Snapshot of an open name editor (hosts use it to survive a re-import). */
|
|
13
|
+
export interface ActiveLabelEdit {
|
|
14
|
+
elementId: string;
|
|
15
|
+
value: string;
|
|
16
|
+
/** Where the caret or text selection was. */
|
|
17
|
+
selection?: FieldSelection;
|
|
18
|
+
/** A link annotation or flow value editor instead of a name editor. */
|
|
19
|
+
connection?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ActivateOptions {
|
|
22
|
+
/** Initial field content instead of the element's current label (e.g. restoring an edit). */
|
|
23
|
+
value?: string;
|
|
24
|
+
/** Caret or selection to restore; without it the whole text is selected. */
|
|
25
|
+
selection?: FieldSelection;
|
|
26
|
+
}
|
|
27
|
+
/** Fired when a name was changed to a free variant because the requested one is taken. */
|
|
28
|
+
export interface LabelDeduplicatedEvent {
|
|
29
|
+
element: WardleyShape;
|
|
30
|
+
requested: string;
|
|
31
|
+
applied: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const NOTE_EDIT_HINT = "Cmd/Ctrl+Enter to save \u00B7 Esc to cancel";
|
|
34
|
+
export declare function duplicateNameMessage(name: string): string;
|
|
6
35
|
/**
|
|
7
36
|
* Custom inline label editing as an HTML overlay (deliberately not diagram-js direct-editing, §8.5).
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
37
|
+
* The field sits exactly over the label it replaces (which is hidden meanwhile), scales with the
|
|
38
|
+
* zoom and grows with its content. Commit goes through `wardleyModeling.updateLabel` ->
|
|
39
|
+
* commandStack (undo, P4). Notes are edited in a `<textarea>` over the note itself (multiline:
|
|
40
|
+
* Enter = line break, Cmd/Ctrl+Enter or click outside = save); everything else in an `<input>`
|
|
41
|
+
* (Enter = save). Escape always discards.
|
|
11
42
|
*/
|
|
12
43
|
export default class WardleyLabelEditing {
|
|
44
|
+
private readonly eventBus;
|
|
13
45
|
private readonly canvas;
|
|
14
46
|
private readonly modeling;
|
|
15
47
|
private readonly factory;
|
|
16
48
|
static $inject: string[];
|
|
17
49
|
private active;
|
|
18
|
-
|
|
19
|
-
|
|
50
|
+
private readonly contextPad;
|
|
51
|
+
private readonly selection;
|
|
52
|
+
private readonly locked;
|
|
53
|
+
constructor(eventBus: EventBus, canvas: Canvas, modeling: WardleyModeling, factory: WardleyElementFactory, injector: Injector);
|
|
54
|
+
/** Opens the in-place name editor for `element` (no-op for regions and drawings). */
|
|
55
|
+
activate(element: WardleyShape, options?: ActivateOptions): void;
|
|
20
56
|
/**
|
|
21
57
|
* Inline editing for connections: a flow edits its value (`+'value'>`), a dependency its
|
|
22
58
|
* `; annotation` text. An empty input clears the field. Undo-safe via updateProperties.
|
|
23
59
|
*/
|
|
24
|
-
activateConnection(conn: WardleyConnection): void;
|
|
60
|
+
activateConnection(conn: WardleyConnection, options?: ActivateOptions): void;
|
|
61
|
+
/** Discards the open edit (if any) without saving. */
|
|
25
62
|
cancel(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Saves the open edit (if any) as if focus had left the field, e.g. before the host saves or
|
|
65
|
+
* exports the map, so the file contains the text the user sees.
|
|
66
|
+
*/
|
|
67
|
+
commitActiveEdit(): void;
|
|
68
|
+
/** The open editor's element and current (unsaved) text, or null when nothing is edited. */
|
|
69
|
+
getActiveEdit(): ActiveLabelEdit | null;
|
|
70
|
+
/**
|
|
71
|
+
* After Enter/Escape the removed field leaves focus on <body>; hand it back to the canvas so
|
|
72
|
+
* keyboard users keep their place, and bring back the context pad the editor had closed.
|
|
73
|
+
*/
|
|
74
|
+
private returnToCanvas;
|
|
75
|
+
/**
|
|
76
|
+
* The <text> nodes showing the element's name. Falls back to matching by content when the
|
|
77
|
+
* renderer does not mark them; the LAST match skips a component's movement target label, which
|
|
78
|
+
* is drawn first and may repeat the name. Fallback matches carry the class only while editing so
|
|
79
|
+
* the CSS hides them.
|
|
80
|
+
*/
|
|
81
|
+
private nameLabelElements;
|
|
82
|
+
private labelGeometry;
|
|
26
83
|
}
|
|
27
84
|
//# sourceMappingURL=WardleyLabelEditing.d.ts.map
|
|
@@ -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;
|
|
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;AAuB3E,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,6CAA6C;IAC7C,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,uEAAuE;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,6FAA6F;IAC7F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;AAeD,0FAA0F;AAC1F,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAkBD,eAAO,MAAM,cAAc,gDAA2C,CAAC;AAEvE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAsCD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAmB;IASpC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX1B,MAAM,CAAC,OAAO,WAAkF;IAEhG,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;IAC/C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;gBAGpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,qBAAqB,EAC/C,QAAQ,EAAE,QAAQ;IAsBpB,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI;IAiIpE;;;OAGG;IACH,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI;IAuEhF,sDAAsD;IACtD,MAAM,IAAI,IAAI;IAId;;;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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A refused value in an inline editor: the field turns red and a caption under it says why. One look
|
|
3
|
+
* and one accessible pattern (role=alert, aria-describedby) for every editor, also for keyboard and
|
|
4
|
+
* touch users who never see a tooltip.
|
|
5
|
+
*/
|
|
6
|
+
export interface FieldError {
|
|
7
|
+
show(message: string): void;
|
|
8
|
+
clear(): void;
|
|
9
|
+
/** The caption while shown, for hosts that lay out further captions below it. */
|
|
10
|
+
readonly caption: HTMLElement | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function createFieldError(container: HTMLElement, field: HTMLInputElement | HTMLTextAreaElement, id: string, place: (caption: HTMLElement) => void): FieldError;
|
|
13
|
+
//# sourceMappingURL=fieldError.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -2,4 +2,5 @@ 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
6
|
//# 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"}
|
|
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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
|
+
import { Injector } from 'didi';
|
|
3
|
+
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
4
|
+
import { WardleyShape } from '../model/di-types.js';
|
|
5
|
+
import { default as WardleyModeling } from '../modeling/WardleyModeling.js';
|
|
6
|
+
/** Element types that carry an OWM `url(...)` reference. */
|
|
7
|
+
export declare function canHaveLink(shape: WardleyShape): boolean;
|
|
8
|
+
/** The stored address: `url` on components, `urlRef` on submaps (both live on the businessObject). */
|
|
9
|
+
export declare function linkOf(shape: WardleyShape): string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Inline editor for the link of a component or submap (OWM `url Name [address]` + `url(Name)`).
|
|
12
|
+
* Commits exactly one undoable `updateProperties`; addresses outside the allowlist (http, https,
|
|
13
|
+
* mailto, relative) are rejected and the field stays open marked invalid.
|
|
14
|
+
*/
|
|
15
|
+
export default class WardleyLinkEditing {
|
|
16
|
+
private readonly canvas;
|
|
17
|
+
private readonly modeling;
|
|
18
|
+
private readonly injector;
|
|
19
|
+
static $inject: string[];
|
|
20
|
+
private active;
|
|
21
|
+
constructor(eventBus: EventBus, canvas: Canvas, modeling: WardleyModeling, injector: Injector);
|
|
22
|
+
/**
|
|
23
|
+
* Sets (or with an empty value removes) the link. Returns false when the address is not allowed.
|
|
24
|
+
* The exporter reads the link from the businessObject, which palette-created shapes do not have
|
|
25
|
+
* yet — so a minimal one is built from the shape.
|
|
26
|
+
*/
|
|
27
|
+
setLink(shape: WardleyShape, rawUrl: string | undefined): boolean;
|
|
28
|
+
/** @param options.value field content to restore instead of the current link (re-import). */
|
|
29
|
+
activate(shape: WardleyShape, options?: {
|
|
30
|
+
value?: string;
|
|
31
|
+
}): void;
|
|
32
|
+
cancel(): void;
|
|
33
|
+
/** Saves the open link edit (if any) as if focus had left the field; a rejected address is dropped. */
|
|
34
|
+
commitActiveEdit(): void;
|
|
35
|
+
getActiveEdit(): {
|
|
36
|
+
elementId: string;
|
|
37
|
+
value: string;
|
|
38
|
+
} | null;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=WardleyLinkEditing.d.ts.map
|
|
@@ -0,0 +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;AAmBlE,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;IAOnC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,MAAM,CAAC,OAAO,WAAyD;IAEvE,OAAO,CAAC,MAAM,CAA+B;gBAG3C,QAAQ,EAAE,QAAQ,EACD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,QAAQ;IAQrC;;;;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;IAgFrE,MAAM,IAAI,IAAI;IAId,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,6 @@
|
|
|
1
|
+
import { ModuleDeclaration } from 'didi';
|
|
2
|
+
/** Inline link (url) editing for components and submaps. */
|
|
3
|
+
export declare const linkEditingModule: ModuleDeclaration;
|
|
4
|
+
export { default as WardleyLinkEditing, canHaveLink, linkOf } from './WardleyLinkEditing.js';
|
|
5
|
+
export { sanitizeLinkUrl, isAllowedLinkUrl, safeLinkUrl } from './link-url.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/link-editing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,4DAA4D;AAC5D,eAAO,MAAM,iBAAiB,EAAE,iBAG/B,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalises user or file input into an address the OWM DSL can carry losslessly:
|
|
3
|
+
* `url Name [address]` ends at `]`, and a line break would end the definition line.
|
|
4
|
+
*/
|
|
5
|
+
export declare function sanitizeLinkUrl(raw: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Allowlist for addresses the modeler stores or opens: http(s), mailto, or a relative reference.
|
|
8
|
+
* Shared maps arrive through URLs and files, so a `javascript:` or `data:` address must never reach
|
|
9
|
+
* `window.open`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isAllowedLinkUrl(url: string): boolean;
|
|
12
|
+
/** Sanitised address if it is non-empty and allowed, otherwise `undefined`. */
|
|
13
|
+
export declare function safeLinkUrl(raw: string | undefined): string | undefined;
|
|
14
|
+
//# sourceMappingURL=link-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-url.d.ts","sourceRoot":"","sources":["../../src/link-editing/link-url.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGrD;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAIvE"}
|
|
@@ -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"}
|