@miragon/wardley-renderer 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +69 -30
  2. package/dist/WardleyBaseViewer.d.ts +19 -0
  3. package/dist/WardleyBaseViewer.d.ts.map +1 -1
  4. package/dist/collaborative/CollaborativeWardley.d.ts +8 -1
  5. package/dist/collaborative/CollaborativeWardley.d.ts.map +1 -1
  6. package/dist/context-pad/WardleyContextPadProvider.d.ts +10 -1
  7. package/dist/context-pad/WardleyContextPadProvider.d.ts.map +1 -1
  8. package/dist/draw/WardleyRenderer.d.ts +9 -1
  9. package/dist/draw/WardleyRenderer.d.ts.map +1 -1
  10. package/dist/draw/lucide.d.ts +2 -1
  11. package/dist/draw/lucide.d.ts.map +1 -1
  12. package/dist/draw/styles.d.ts +7 -0
  13. package/dist/draw/styles.d.ts.map +1 -1
  14. package/dist/draw-tool/WardleyDrawTool.d.ts +8 -1
  15. package/dist/draw-tool/WardleyDrawTool.d.ts.map +1 -1
  16. package/dist/index.d.ts +5 -4
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +1269 -1071
  19. package/dist/index.js.map +1 -1
  20. package/dist/io/blobToBase64.d.ts +3 -0
  21. package/dist/io/blobToBase64.d.ts.map +1 -0
  22. package/dist/io/index.d.ts +1 -2
  23. package/dist/io/index.d.ts.map +1 -1
  24. package/dist/io/saveSvg.d.ts.map +1 -1
  25. package/dist/keyboard/WardleyKeyboard.d.ts +2 -1
  26. package/dist/keyboard/WardleyKeyboard.d.ts.map +1 -1
  27. package/dist/lasso/WardleyLassoBehavior.d.ts +5 -1
  28. package/dist/lasso/WardleyLassoBehavior.d.ts.map +1 -1
  29. package/dist/lasso/index.d.ts +1 -1
  30. package/dist/lasso/index.d.ts.map +1 -1
  31. package/dist/link-editing/WardleyLinkOpener.d.ts +24 -0
  32. package/dist/link-editing/WardleyLinkOpener.d.ts.map +1 -0
  33. package/dist/link-editing/index.d.ts +4 -2
  34. package/dist/link-editing/index.d.ts.map +1 -1
  35. package/dist/link-editing/link-url.d.ts +14 -0
  36. package/dist/link-editing/link-url.d.ts.map +1 -1
  37. package/dist/map-menu/index.d.ts +0 -2
  38. package/dist/map-menu/index.d.ts.map +1 -1
  39. package/dist/map-menu/popover.d.ts.map +1 -1
  40. package/dist/palette/WardleyHoverTooltipTeardown.d.ts +6 -5
  41. package/dist/palette/WardleyHoverTooltipTeardown.d.ts.map +1 -1
  42. package/dist/palette/WardleyPaletteKeyboard.d.ts +4 -2
  43. package/dist/palette/WardleyPaletteKeyboard.d.ts.map +1 -1
  44. package/dist/palette/WardleyPaletteProvider.d.ts +8 -3
  45. package/dist/palette/WardleyPaletteProvider.d.ts.map +1 -1
  46. package/dist/palette/WardleyPaletteReadOnly.d.ts +26 -0
  47. package/dist/palette/WardleyPaletteReadOnly.d.ts.map +1 -0
  48. package/dist/palette/WardleyPaletteTooltip.d.ts +40 -16
  49. package/dist/palette/WardleyPaletteTooltip.d.ts.map +1 -1
  50. package/dist/palette/index.d.ts +1 -0
  51. package/dist/palette/index.d.ts.map +1 -1
  52. package/dist/read-only/WardleyReadOnly.d.ts +26 -4
  53. package/dist/read-only/WardleyReadOnly.d.ts.map +1 -1
  54. package/dist/read-only/index.d.ts +3 -0
  55. package/dist/read-only/index.d.ts.map +1 -1
  56. package/dist/wardley.css +1 -1
  57. package/package.json +2 -2
  58. package/dist/io/rasterize.d.ts +0 -31
  59. package/dist/io/rasterize.d.ts.map +0 -1
  60. package/dist/map-menu/ShortcutsDialog.d.ts +0 -24
  61. package/dist/map-menu/ShortcutsDialog.d.ts.map +0 -1
@@ -0,0 +1,3 @@
1
+ /** Blob -> Base64 without the data-URL prefix, e.g. to post an export to a VS Code extension host. */
2
+ export declare function blobToBase64(blob: Blob): Promise<string>;
3
+ //# sourceMappingURL=blobToBase64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blobToBase64.d.ts","sourceRoot":"","sources":["../../src/io/blobToBase64.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxD"}
@@ -6,8 +6,7 @@ export { default as WardleySourceOrder } from './WardleySourceOrder.js';
6
6
  export { saveSVG } from './saveSvg.js';
7
7
  export type { SvgBounds } from './saveSvg.js';
8
8
  export { exportBounds, EXPORT_CONTENT_PADDING } from './exportBounds.js';
9
- export { svgToPng, blobToBase64 } from './rasterize.js';
10
- export type { SvgToPngOptions } from './rasterize.js';
9
+ export { blobToBase64 } from './blobToBase64.js';
11
10
  export { ROOT_ID } from './types.js';
12
11
  export type { ImportWarning, RootBusinessObject } from './types.js';
13
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAK9C,eAAO,MAAM,QAAQ,EAAE,iBAMtB,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAK9C,eAAO,MAAM,QAAQ,EAAE,iBAMtB,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
@@ -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,CA0C3E"}
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,CA4C3E"}
@@ -23,7 +23,8 @@ export interface WardleyKeyboardConfig {
23
23
  * Cmd/Ctrl+A (select all), the single-key tools C (component), U (user), N (note), P (pipeline),
24
24
  * L (lasso) and A (connect from the selected node), all only while the canvas has the focus.
25
25
  * Deliberately a DOM listener (no diagram-js keyboard-service binding needed). While the draw tool
26
- * holds the points of a line, the single-key tools do nothing, and the canvas takes them. While a
26
+ * holds the points of a line, the single-key tools and paste do nothing, and the canvas takes them:
27
+ * a paste attaches its copies to the pointer, where the next press belongs to the line. While a
27
28
  * point of a drawing is dragged, the arrow keys, paste, duplicate and the single-key tools do
28
29
  * nothing, and the canvas takes them; Escape ends that drag and Delete removes the drawing.
29
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyKeyboard.d.ts","sourceRoot":"","sources":["../../src/keyboard/WardleyKeyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAEhE,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,qCAAqC,CAAC;AAG7D,OAAO,KAAK,SAAS,MAAM,6CAA6C,CAAC;AACzE,OAAO,KA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Q,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAGtB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAlClC,MAAM,CAAC,OAAO,WAcZ;IAEF,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA+B;IAC9D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;gBAG/B,MAAM,EAAE,MAAM,EAC/B,YAAY,EAAE,YAAY,EACT,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EACnC,SAAS,EAAE,gBAAgB,EACV,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EAC7B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EACD,eAAe,EAAE,eAAe,EACjD,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,qBAAqB,GAAG,SAAS;IAgK3C;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,mBAAmB;IAK3B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAOtB,iGAAiG;IACjG,OAAO,CAAC,cAAc;CAUvB"}
@@ -1,12 +1,16 @@
1
1
  import { default as EventBus } from 'diagram-js/lib/core/EventBus';
2
2
  import { default as Canvas } from 'diagram-js/lib/core/Canvas';
3
3
  import { default as LassoTool } from 'diagram-js/lib/features/lasso-tool/LassoTool';
4
+ import { default as ToolManager } from 'diagram-js/lib/features/tool-manager/ToolManager';
5
+ export declare const LASSO_SELECTION = "lasso.selection";
4
6
  /**
5
7
  * Activates the diagram-js lasso via Shift+drag on the empty canvas.
6
8
  * Plain drag stays canvas pan (MoveCanvas); Shift+click on elements stays multi-select.
9
+ * The lasso tool counts as active exactly while its drag holds it armed, so a palette's pressed
10
+ * state (`tool-manager.update`) follows it.
7
11
  */
8
12
  export default class WardleyLassoBehavior {
9
13
  static $inject: string[];
10
- constructor(eventBus: EventBus, canvas: Canvas, lassoTool: LassoTool);
14
+ constructor(eventBus: EventBus, canvas: Canvas, lassoTool: LassoTool, toolManager: ToolManager);
11
15
  }
12
16
  //# sourceMappingURL=WardleyLassoBehavior.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyLassoBehavior.d.ts","sourceRoot":"","sources":["../../src/lasso/WardleyLassoBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAO1E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,MAAM,CAAC,OAAO,WAAuC;gBAEzC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS;CAgBrE"}
1
+ {"version":3,"file":"WardleyLassoBehavior.d.ts","sourceRoot":"","sources":["../../src/lasso/WardleyLassoBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,OAAO,KAAK,WAAW,MAAM,kDAAkD,CAAC;AAShF,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,MAAM,CAAC,OAAO,WAAsD;gBAExD,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW;CAqB/F"}
@@ -1,5 +1,5 @@
1
1
  import { ModuleDeclaration } from 'didi';
2
2
  /** Lasso multi-select: diagram-js lasso-tool plus Shift+drag activation on an empty canvas. */
3
3
  export declare const wardleyLassoModule: ModuleDeclaration;
4
- export { default as WardleyLassoBehavior } from './WardleyLassoBehavior.js';
4
+ export { default as WardleyLassoBehavior, LASSO_SELECTION } from './WardleyLassoBehavior.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lasso/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI9C,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,EAAE,iBAIhC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lasso/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI9C,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,EAAE,iBAIhC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { WardleyShape } from '../model/di-types.js';
2
+ import { WardleyLinksConfig } from './link-url.js';
3
+ /**
4
+ * Which links of the map this editor can open, and how. The context pad offers "Open link" and the
5
+ * canvas marks the element for exactly these links, so the mark never promises what the pad can't
6
+ * do. Shared maps can carry any address, so only allowlisted ones ever open.
7
+ */
8
+ export default class WardleyLinkOpener {
9
+ private readonly config;
10
+ static $inject: string[];
11
+ constructor(config: WardleyLinksConfig | undefined);
12
+ /**
13
+ * The element's address when this editor can open it: an allowlisted address with a scheme, or a
14
+ * relative one when the host follows relative links, since the browser would resolve it against
15
+ * the page instead of the map's file.
16
+ */
17
+ openableLink(shape: WardleyShape): string | undefined;
18
+ /**
19
+ * Opens an address `openableLink` returned: a relative one through the host, any other in a new
20
+ * tab unless the host opens it itself.
21
+ */
22
+ open(address: string): void;
23
+ }
24
+ //# sourceMappingURL=WardleyLinkOpener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyLinkOpener.d.ts","sourceRoot":"","sources":["../../src/link-editing/WardleyLinkOpener.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAA+B,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAErF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAGxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,MAAM,CAAC,OAAO,WAA2B;gBAEZ,MAAM,EAAE,kBAAkB,GAAG,SAAS;IAEnE;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS;IAOrD;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAS5B"}
@@ -1,6 +1,8 @@
1
1
  import { ModuleDeclaration } from 'didi';
2
- /** Inline link (url) editing for components and submaps. */
2
+ /** Inline link (url) editing for components and submaps, and which links the editor opens. */
3
3
  export declare const linkEditingModule: ModuleDeclaration;
4
4
  export { default as WardleyLinkEditing, canHaveLink, linkOf } from './WardleyLinkEditing.js';
5
- export { sanitizeLinkUrl, isAllowedLinkUrl, safeLinkUrl } from './link-url.js';
5
+ export { default as WardleyLinkOpener } from './WardleyLinkOpener.js';
6
+ export { sanitizeLinkUrl, isAllowedLinkUrl, isRelativeLink, safeLinkUrl } from './link-url.js';
7
+ export type { WardleyLinksConfig } from './link-url.js';
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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;AAI9C,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,EAAE,iBAI/B,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/F,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Diagram config `wardleyLinks`: the host's link handlers (viewer options `openRelativeLink`,
3
+ * `openExternalLink` and `chooseLinkTarget`).
4
+ */
5
+ export interface WardleyLinksConfig {
6
+ openRelative?: ((address: string) => void) | undefined;
7
+ openExternal?: ((address: string) => void) | undefined;
8
+ chooseTarget?: (() => Promise<string | undefined>) | undefined;
9
+ }
1
10
  /**
2
11
  * Normalises user or file input into an address the OWM DSL can carry losslessly:
3
12
  * `url Name [address]` ends at `]`, and a line break would end the definition line.
@@ -9,6 +18,11 @@ export declare function sanitizeLinkUrl(raw: string): string;
9
18
  * `window.open`.
10
19
  */
11
20
  export declare function isAllowedLinkUrl(url: string): boolean;
21
+ /**
22
+ * Whether the address has no scheme, so it names a place relative to the map's file. Only the host
23
+ * knows that file; the browser would resolve the address against the page.
24
+ */
25
+ export declare function isRelativeLink(url: string): boolean;
12
26
  /** Sanitised address if it is non-empty and allowed, otherwise `undefined`. */
13
27
  export declare function safeLinkUrl(raw: string | undefined): string | undefined;
14
28
  //# sourceMappingURL=link-url.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"link-url.d.ts","sourceRoot":"","sources":["../../src/link-editing/link-url.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACvD,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACvD,YAAY,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC;CAChE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGrD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAIvE"}
@@ -4,8 +4,6 @@ export { mapShortcuts } from './shortcuts.js';
4
4
  export type { MapShortcutOptions, ShortcutGroup, ShortcutKeyNames, ShortcutPlatform, ShortcutRow, ShortcutsChrome, } from './shortcuts.js';
5
5
  export { createMapDialog, dialogButton } from './dialog.js';
6
6
  export type { DialogChrome, MapDialog, MapDialogParts } from './dialog.js';
7
- export { createShortcutsDialog } from './ShortcutsDialog.js';
8
- export type { ShortcutsDialog, ShortcutsDialogChrome } from './ShortcutsDialog.js';
9
7
  export { createTitleDialog } from './TitleDialog.js';
10
8
  export type { TitleDialog, TitleDialogChrome } from './TitleDialog.js';
11
9
  export { createMapSizePopover } from './MapSizePopover.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/map-menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnD,YAAY,EACV,SAAS,EACT,UAAU,EACV,OAAO,EACP,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,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;AA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AA0BD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,YAAY,GAClB,aAAa,GAAG;IAAE,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAAA;CAAE,CAgEhD;AAED,gGAAgG;AAChG,wBAAgB,KAAK,CACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,GAC5C;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,IAAI,IAAI,CAAA;CAAE,CA6BhF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,aAAa,GAAG;IAAE,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAAA;CAAE,GACtD,aAAa,CAiBf"}
@@ -2,16 +2,17 @@ import { ModuleDeclaration } from 'didi';
2
2
  import { default as EventBus } from 'diagram-js/lib/core/EventBus';
3
3
  import { default as HoverTooltip } from 'diagram-js/lib/features/hover-tooltip/HoverTooltip';
4
4
  /**
5
- * diagram-js's hover tooltip (checked up to 15.28.1) shows a palette entry's tooltip 300ms after
6
- * the pointer enters the entry and cancels that only when the pointer leaves, never on
7
- * `diagram.destroy`: the timer then renders into the destroyed canvas and throws a TypeError in the
8
- * host's page. HoverTooltip has no public way to cancel a show, so this clears its timer and the
5
+ * diagram-js's palette brings its hover tooltip along, which `WardleyPaletteTooltip` does not use,
6
+ * but a host may (diagram-js's own palette tooltip, say). That tooltip (checked up to 15.28.1)
7
+ * shows 300ms after the pointer enters an entry and cancels that only when the pointer leaves,
8
+ * never on `diagram.destroy`: the timer then renders into the destroyed canvas and throws a
9
+ * TypeError in the host's page. HoverTooltip has no public way to cancel a show, so this clears its timer and the
9
10
  * content it would render. A host that replaced the service with `null` has nothing to cancel.
10
11
  */
11
12
  export default class WardleyHoverTooltipTeardown {
12
13
  static $inject: string[];
13
14
  constructor(eventBus: EventBus, hoverTooltip: HoverTooltip | null);
14
15
  }
15
- /** Cancels the palette tooltip that waits to show when the modeler is destroyed. */
16
+ /** Cancels a hover tooltip that waits to show when the modeler is destroyed. */
16
17
  export declare const wardleyHoverTooltipTeardownModule: ModuleDeclaration;
17
18
  //# sourceMappingURL=WardleyHoverTooltipTeardown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyHoverTooltipTeardown.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyHoverTooltipTeardown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,YAAY,MAAM,oDAAoD,CAAC;AAWnF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAC9C,MAAM,CAAC,OAAO,WAAgC;gBAElC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;CASlE;AAED,oFAAoF;AACpF,eAAO,MAAM,iCAAiC,EAAE,iBAI/C,CAAC"}
1
+ {"version":3,"file":"WardleyHoverTooltipTeardown.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyHoverTooltipTeardown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,YAAY,MAAM,oDAAoD,CAAC;AAWnF;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAC9C,MAAM,CAAC,OAAO,WAAgC;gBAElC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;CASlE;AAED,gFAAgF;AAChF,eAAO,MAAM,iCAAiC,EAAE,iBAI/C,CAAC"}
@@ -6,8 +6,9 @@ import { default as WardleyPaletteProvider } from './WardleyPaletteProvider.js';
6
6
  * Makes the palette a keyboard-operable toolbar (WAI-ARIA toolbar pattern): one Tab stop with a
7
7
  * roving tabindex, arrow keys / Home / End move between tools, Enter or Space activates the focused
8
8
  * one. A create tool has no pointer position to attach the new element to, so it is placed at the
9
- * centre of the free rectangle instead (see `WardleyPaletteProvider.createAtFreeCenter`). Only for
10
- * hosts without the Miragon modeler shell, which brings these keys itself.
9
+ * centre of the free rectangle instead (see `WardleyPaletteProvider.createAtFreeCenter`). The
10
+ * palette comes before the canvas in the tab order. Only for hosts without the Miragon modeler
11
+ * shell, which brings these keys and that order itself.
11
12
  */
12
13
  export default class WardleyPaletteKeyboard {
13
14
  private readonly palette;
@@ -16,6 +17,7 @@ export default class WardleyPaletteKeyboard {
16
17
  private container;
17
18
  private activeAction;
18
19
  constructor(eventBus: EventBus, palette: Palette, provider: WardleyPaletteProvider, injector: Injector);
20
+ private moveBeforeCanvas;
19
21
  private attach;
20
22
  private entries;
21
23
  private entryOf;
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyPaletteKeyboard.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyPaletteKeyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AAQtE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAQvC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,MAAM,CAAC,OAAO,WAAiE;IAE/E,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,YAAY,CAAqB;gBAGvC,QAAQ,EAAE,QAAQ,EACD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,sBAAsB,EACjD,QAAQ,EAAE,QAAQ;IAapB,OAAO,CAAC,MAAM;IAkBd,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,SAAS;IA+BjB,OAAO,CAAC,QAAQ;CAYjB"}
1
+ {"version":3,"file":"WardleyPaletteKeyboard.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyPaletteKeyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AAQtE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAQvC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,MAAM,CAAC,OAAO,WAAiE;IAE/E,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,YAAY,CAAqB;gBAGvC,QAAQ,EAAE,QAAQ,EACD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,sBAAsB,EACjD,QAAQ,EAAE,QAAQ;IAuBpB,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,MAAM;IAkBd,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,SAAS;IA+BjB,OAAO,CAAC,QAAQ;CAYjB"}
@@ -14,8 +14,9 @@ export default class WardleyPaletteProvider implements PaletteProvider {
14
14
  private readonly injector;
15
15
  static $inject: string[];
16
16
  /**
17
- * diagram-js >= 15.28 renders `title` + `shortcut` as a styled tooltip, and the Miragon modeler
18
- * shell shows its chrome tooltip instead; only without either does an entry need a native title.
17
+ * The palette tooltip (`WardleyPaletteTooltip`, or one a host puts in its place) shows `title` and
18
+ * `shortcut`, and the Miragon modeler shell shows its chrome tooltip instead; only without either
19
+ * does an entry need a native title.
19
20
  */
20
21
  private readonly needsNativeTitle;
21
22
  constructor(palette: Palette, create: Create, factory: WardleyElementFactory, lassoTool: LassoTool, drawTool: WardleyDrawTool, injector: Injector);
@@ -24,7 +25,8 @@ export default class WardleyPaletteProvider implements PaletteProvider {
24
25
  * Keyboard path for a create entry (guide §5.5): places the new element in the centre of the
25
26
  * free rectangle (no pointer position to attach it to), 24px further diagonally while that spot
26
27
  * is taken, selects it and opens its label editor, or focuses the canvas where there is nothing
27
- * to name. Returns the created shape, or undefined for non-create entries.
28
+ * to name. Returns the created shape, or undefined for non-create entries and while the read-only
29
+ * lock holds the map, whose rules `modeling.createShape` does not ask.
28
30
  */
29
31
  createAtFreeCenter(entryId: string): WardleyShape | undefined;
30
32
  /**
@@ -33,6 +35,9 @@ export default class WardleyPaletteProvider implements PaletteProvider {
33
35
  * and Space leave it on the entry. The Miragon modeler shell does the same for its palette.
34
36
  */
35
37
  private focusCanvasAfterPointer;
38
+ /** Whether the lasso's drag waits for the next press on the canvas. */
39
+ private lassoArmed;
40
+ private putLassoDown;
36
41
  private createShapeFor;
37
42
  private freeCenterPosition;
38
43
  private describe;
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyPaletteProvider.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyPaletteProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AACnE,OAAO,KAAK,MAAM,MAAM,uCAAuC,CAAC;AAChE,OAAO,KAAK,SAAS,MAAM,8CAA8C,CAAC;AAC1E,OAAO,KAAK,eAAe,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EACV,cAAc,EAEd,OAAO,IAAI,eAAe,EAC3B,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,qBAAqB,MAAM,mCAAmC,CAAC;AAO3E,OAAO,KAAK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B,MAAM,mCAAmC,CAAC;AAO3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGrC,OAAO,EAAkB,KAAK,YAAY,EAAyB,MAAM,sBAAsB,CAAC;AAiLhG,MAAM,CAAC,OAAO,OAAO,sBAAuB,YAAW,eAAe;IAmBlE,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAtB3B,MAAM,CAAC,OAAO,WAOZ;IAEF;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;gBAGzC,OAAO,EAAE,OAAO,EACC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,QAAQ;IAUrC,iBAAiB,IAAI,cAAc;IA0DnC;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAwB7D;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAI/B,uEAAuE;IACvE,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,kBAAkB;IA+C1B,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,SAAS;CAQlB"}
@@ -0,0 +1,26 @@
1
+ import { default as EventBus } from 'diagram-js/lib/core/EventBus';
2
+ import { Injector } from 'didi';
3
+ /**
4
+ * Shows the read-only lock on the renderer's own palette, for a host without the Miragon modeler
5
+ * shell, whose palette skin does the same: every entry that would change the map, the draw tool
6
+ * too, is `aria-disabled="true"` while the lock shows, at once with it or after the lock's
7
+ * `delayMs`, and again after every rebuild of the entries; its click, drag or Enter does nothing
8
+ * from the lock on, and it stays focusable. The lasso stays active (guide §13.5). `wardley.css`
9
+ * mutes the marked entries. A palette any chrome skins (`data-chrome="palette"`) is left to that
10
+ * chrome.
11
+ */
12
+ export default class WardleyPaletteReadOnly {
13
+ private readonly injector;
14
+ static $inject: string[];
15
+ private container;
16
+ /** The `aria-disabled` an entry had before the lock marked it (`null`: none). */
17
+ private readonly ownMarks;
18
+ constructor(eventBus: EventBus, injector: Injector);
19
+ /** Whether `entry` does nothing while the lock holds, read from its element where there is one. */
20
+ isDisabled(entry: Element): boolean;
21
+ private ownsPalette;
22
+ private apply;
23
+ private vetoes;
24
+ private refuse;
25
+ }
26
+ //# sourceMappingURL=WardleyPaletteReadOnly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WardleyPaletteReadOnly.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyPaletteReadOnly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAgBrC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IASvC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,MAAM,CAAC,OAAO,WAA4B;IAE1C,OAAO,CAAC,SAAS,CAA0B;IAC3C,iFAAiF;IACjF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyC;gBAGhE,QAAQ,EAAE,QAAQ,EACD,QAAQ,EAAE,QAAQ;IAYrC,mGAAmG;IACnG,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAInC,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,KAAK;IAqBb,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,MAAM;CAKf"}
@@ -1,28 +1,52 @@
1
+ import { default as Canvas } from 'diagram-js/lib/core/Canvas';
1
2
  import { default as EventBus } from 'diagram-js/lib/core/EventBus';
2
3
  import { default as Palette } from 'diagram-js/lib/features/palette/Palette';
3
- import { default as HoverTooltip, HoverTooltipPosition } from 'diagram-js/lib/features/hover-tooltip/HoverTooltip';
4
- export declare const PALETTE_TOOLTIP_GAP = 8;
5
- export declare const PALETTE_TOOLTIP_PLACEMENT = "bottom";
6
4
  /**
7
- * Replaces diagram-js's stock `paletteTooltip`, which places the tooltip to the right of an entry,
8
- * made for its vertical palette: in this horizontal toolbar that covers the next tool. This one
9
- * hangs below the island, centred on its entry (guide §5.6). Its placement is one diagram-js's
10
- * stylesheet has no rule for, so a copy of that sheet a host loads later cannot move it back.
5
+ * The palette tooltip for a host without a chrome of its own; the Miragon modeler shell replaces it
6
+ * with its own. diagram-js's `paletteTooltip` stands right of the entry, made for a vertical
7
+ * palette, where it would cover the next tool of this horizontal one, and shows on hover only.
8
+ * This one is the chrome's tooltip of guide §5.6: 8px below the palette, centred on its entry and
9
+ * shifted to keep 12px from the sides of the canvas container, in the container's coordinates, so
10
+ * a map in a part of a wide page shows it at its entry, also with the palette in the second row of
11
+ * a narrow container (§5.15). It shows after 300ms of hover, at once on keyboard focus and at once
12
+ * for a neighbour while one is shown, never for touch, and hides on a press (a click, or Enter or
13
+ * Space on the focused entry), Escape, leaving and blur; `role="tooltip"`. A palette that scrolls
14
+ * sideways (guide §5.15) takes it along with its entry, and an entry scrolled out of view takes it
15
+ * away. Surface, type and key chip are §5.6 too (wardley.css). A palette a chrome skins
16
+ * (`data-chrome="palette"`) keeps diagram-js's place right of the entry.
11
17
  */
12
18
  export default class WardleyPaletteTooltip {
13
19
  private readonly palette;
14
- private readonly hoverTooltip;
20
+ private readonly canvas;
15
21
  static $inject: string[];
16
22
  private entries;
17
- constructor(eventBus: EventBus, palette: Palette, hoverTooltip: HoverTooltip | null);
23
+ private paletteContainer;
24
+ private readonly id;
25
+ private shown;
26
+ private pending;
27
+ private hovered;
28
+ private pressed;
29
+ private warmUntil;
30
+ constructor(eventBus: EventBus, palette: Palette, canvas: Canvas);
18
31
  private attachTo;
32
+ private detach;
19
33
  private refreshEntries;
20
- private contentFor;
34
+ private entryOf;
35
+ private readonly onPointerOver;
36
+ private readonly onPointerOut;
37
+ private readonly onFocusIn;
38
+ private readonly onFocusOut;
39
+ private readonly onPress;
40
+ private readonly onKeydown;
41
+ private readonly onPaletteScroll;
42
+ private pressesEntry;
43
+ private enter;
44
+ private leave;
45
+ private cancelPending;
46
+ private show;
47
+ private place;
48
+ private hide;
49
+ /** The middle of the tooltip's top edge in px from the canvas container's top left. */
50
+ private placeBelowPalette;
21
51
  }
22
- /**
23
- * Centred on the entry, 8px below the island (guide §5.6), not below the entry, which ends 4px above
24
- * the island's edge. A palette a chrome skins keeps its own layout, so the tooltip keeps to its entry
25
- * there.
26
- */
27
- export declare function positionBelow(target: HTMLElement): HoverTooltipPosition;
28
52
  //# sourceMappingURL=WardleyPaletteTooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyPaletteTooltip.d.ts","sourceRoot":"","sources":["../../src/palette/WardleyPaletteTooltip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AAEnE,OAAO,KAAK,YAAY,MAAM,oDAAoD,CAAC;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAO/F,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,yBAAyB,WAAW,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAOtC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAP/B,MAAM,CAAC,OAAO,WAA2C;IAEzD,OAAO,CAAC,OAAO,CAAsB;gBAGnC,QAAQ,EAAE,QAAQ,EACD,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,GAAG,IAAI;IASpD,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC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,CAExB;IAIF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAM9B;IAIF,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,IAAI;IAwBZ,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,IAAI;IAUZ,uFAAuF;IACvF,OAAO,CAAC,iBAAiB;CAc1B"}
@@ -9,4 +9,5 @@ export { default as WardleyPaletteProvider } from './WardleyPaletteProvider.js';
9
9
  export { default as WardleyPaletteKeyboard } from './WardleyPaletteKeyboard.js';
10
10
  export { default as WardleyPaletteArmedTool } from './WardleyPaletteArmedTool.js';
11
11
  export { default as WardleyPaletteTooltip } from './WardleyPaletteTooltip.js';
12
+ export { default as WardleyPaletteReadOnly } from './WardleyPaletteReadOnly.js';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/palette/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAQ9C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,iBAYlC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/palette/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAS9C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,iBAclC,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -2,24 +2,46 @@ import { default as RuleProvider } from 'diagram-js/lib/features/rules/RuleProvi
2
2
  import { default as Canvas } from 'diagram-js/lib/core/Canvas';
3
3
  import { default as EventBus } from 'diagram-js/lib/core/EventBus';
4
4
  import { Injector } from 'didi';
5
- /** Fired with `{ readOnly }` whenever the lock changes. */
5
+ /**
6
+ * Fired with `{ readOnly, shown }` whenever the lock changes, and once more when the marks of a lock
7
+ * set with `delayMs` show.
8
+ */
6
9
  export declare const READ_ONLY_CHANGED = "wardley.readOnly.changed";
10
+ export interface WardleyReadOnlyOptions {
11
+ /** How long the palette's marks of the lock wait (default 0); the lock itself holds at once. */
12
+ delayMs?: number | undefined;
13
+ }
7
14
  /**
8
15
  * Locks every edit on the canvas while a host cannot save what the canvas would change: an
9
16
  * invalid file in an IDE shows the last valid map read-only until the text is valid again (guide
10
17
  * §13.5). The rules veto move, resize, create, connect and delete; the context pad, the label,
11
18
  * link and colour editors, the evolve, label and drawing handles, the map-size handles, the draw
12
- * tool and the edit keys ask `isReadOnly()`. Selection, zoom, pan, copy and export stay.
19
+ * tool and the edit keys ask `isReadOnly()`. Selection, zoom, pan, copy and export stay. Guide
20
+ * §13.5 shows the lock of an invalid import only after 800ms without a valid one, so typing beside
21
+ * the canvas does not flicker: `delayMs` holds back the palette's marks (`isReadOnlyShown()`), as
22
+ * the shell's `setReadOnly` does.
13
23
  */
14
24
  export default class WardleyReadOnly extends RuleProvider {
25
+ private readonly bus;
15
26
  private readonly canvas;
16
27
  private readonly injector;
17
28
  static $inject: string[];
18
29
  private locked;
19
- constructor(eventBus: EventBus, canvas: Canvas, injector: Injector);
30
+ private shown;
31
+ private showTimer;
32
+ constructor(bus: EventBus, canvas: Canvas, injector: Injector);
20
33
  init(): void;
21
34
  isReadOnly(): boolean;
22
- setReadOnly(readOnly: boolean): void;
35
+ /** Whether the palette marks the lock: from `setReadOnly(true)` on, or once its `delayMs` passed. */
36
+ isReadOnlyShown(): boolean;
37
+ /**
38
+ * `true` locks at once and shows the palette's marks after `delayMs` (default 0); a call while the
39
+ * delay runs keeps its timer, as typing sends one invalid import after the other. `false` unlocks
40
+ * and takes the marks off at once.
41
+ */
42
+ setReadOnly(readOnly: boolean, options?: WardleyReadOnlyOptions): void;
43
+ private announce;
44
+ private stopShowTimer;
23
45
  /** Whatever is open or running would otherwise still change the map. */
24
46
  private endInteractions;
25
47
  private outerContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"WardleyReadOnly.d.ts","sourceRoot":"","sources":["../../src/read-only/WardleyReadOnly.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAiC5D;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY;IAOrD,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAP3B,OAAgB,OAAO,WAAsC;IAE7D,OAAO,CAAC,MAAM,CAAS;gBAGrB,QAAQ,EAAE,QAAQ,EACD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ;IAK5B,IAAI,IAAI,IAAI;IAKrB,UAAU,IAAI,OAAO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,cAAc;CAIvB"}
@@ -3,5 +3,8 @@ import { Injector, ModuleDeclaration } from 'didi';
3
3
  export declare const readOnlyModule: ModuleDeclaration;
4
4
  /** Whether the canvas is locked; false where the editor has no lock. */
5
5
  export declare function isReadOnly(injector: Injector): boolean;
6
+ /** Whether the palette marks the lock, at once or after its `delayMs`; false without a lock. */
7
+ export declare function isReadOnlyShown(injector: Injector): boolean;
6
8
  export { default as WardleyReadOnly, READ_ONLY_CHANGED } from './WardleyReadOnly.js';
9
+ export type { WardleyReadOnlyOptions } from './WardleyReadOnly.js';
7
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/read-only/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,qFAAqF;AACrF,eAAO,MAAM,cAAc,EAAE,iBAG5B,CAAC;AAEF,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEtD;AAED,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/read-only/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,qFAAqF;AACrF,eAAO,MAAM,cAAc,EAAE,iBAG5B,CAAC;AAEF,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEtD;AAED,gGAAgG;AAChG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE3D;AAED,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACrF,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC"}