@miragon/team-topologies-renderer 0.12.0 → 0.13.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.
@@ -1,11 +1,22 @@
1
1
  import { default as Canvas } from 'diagram-js/lib/core/Canvas';
2
2
  import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
3
+ export interface ContentBounds {
4
+ minX: number;
5
+ minY: number;
6
+ maxX: number;
7
+ maxY: number;
8
+ }
3
9
  export default class TtViewport {
4
10
  private readonly canvas;
5
11
  private readonly elementRegistry;
6
12
  static $inject: string[];
7
13
  constructor(canvas: Canvas, elementRegistry: ElementRegistry);
8
- /** Fit every element into view, zooming in no further than 100 %. */
14
+ /**
15
+ * Fit every element into view, zooming in no further than 100 %.
16
+ *
17
+ * @deprecated Host chrome fits the diagram (the modeler shell's viewport, with the insets of the
18
+ * chrome that is open and never above 100 %); kept for hosts without it.
19
+ */
9
20
  fit(): void;
10
21
  /**
11
22
  * On a narrow (portrait) canvas the content is centred in the free band below the palette: the
@@ -14,6 +25,12 @@ export default class TtViewport {
14
25
  * corner tends to hold an overlay of their own, such as a legend.
15
26
  */
16
27
  private viewboxTop;
17
- private contentBounds;
28
+ /**
29
+ * The tight box around every element and its label text in diagram coordinates, `undefined`
30
+ * while the canvas holds none. Read from the elements' geometry and the label layout rather than
31
+ * measured on the SVG, so zoom and scroll, at which a browser lays text out differently, never
32
+ * change it.
33
+ */
34
+ contentBounds(): ContentBounds | undefined;
18
35
  }
19
36
  //# sourceMappingURL=TtViewport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TtViewport.d.ts","sourceRoot":"","sources":["../../src/io/TtViewport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AAmBvE,MAAM,CAAC,OAAO,OAAO,UAAU;IAI3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAJlC,MAAM,CAAC,OAAO,WAAiC;gBAG5B,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe;IAGnD,qEAAqE;IACrE,GAAG,IAAI,IAAI;IAkCX;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,aAAa;CAsBtB"}
1
+ {"version":3,"file":"TtViewport.d.ts","sourceRoot":"","sources":["../../src/io/TtViewport.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AAcvE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,OAAO,UAAU;IAI3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAJlC,MAAM,CAAC,OAAO,WAAiC;gBAG5B,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe;IAGnD;;;;;OAKG;IACH,GAAG,IAAI,IAAI;IAkCX;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAclB;;;;;OAKG;IACH,aAAa,IAAI,aAAa,GAAG,SAAS;CA2B3C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miragon/team-topologies-renderer",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Render and edit Team Topologies diagrams in the browser, with a framework-agnostic viewer and modeler built on diagram-js.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,8 +37,8 @@
37
37
  "test:browser": "npm --prefix ../.. run test:browser"
38
38
  },
39
39
  "dependencies": {
40
- "@miragon/modeler-api": "1.2.0",
41
- "@miragon/team-topologies-schema-model": "0.12.0"
40
+ "@miragon/modeler-api": "1.3.0",
41
+ "@miragon/team-topologies-schema-model": "0.13.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "diagram-js": "^15.28.0",
@@ -53,7 +53,7 @@
53
53
  "typescript": "6.0.3",
54
54
  "vite": "8.3.4",
55
55
  "vite-plugin-dts": "5.1.2",
56
- "vitest": "5.0.4",
56
+ "vitest": "5.0.5",
57
57
  "zod": "4.6.7"
58
58
  }
59
59
  }