@miragon/team-topologies-renderer 0.6.0 → 0.7.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,6 +1,8 @@
1
- /** Shared rendering constants (typography, accent, priorities) — Miragon corporate identity.
1
+ /**
2
+ * Shared rendering constants (typography, accent, priorities) — Miragon corporate identity.
2
3
  * Colours are derived from the single source of truth in `theme/palette.ts` (`MIRAGON`), which
3
- * mirrors the vendored `--cd-*` brand tokens. */
4
+ * mirrors the vendored `--cd-*` brand tokens.
5
+ */
4
6
  /** BaseRenderer default priority is 1000; 1500 wins the render.shape/connection event. */
5
7
  export declare const TT_RENDER_PRIORITY = 1500;
6
8
  /** Selection / hover accent (Miragon blue — kept in sync with the app theme via the shared palette). */
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/draw/styles.ts"],"names":[],"mappings":"AAAA;;kDAEkD;AAIlD,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,wGAAwG;AACxG,eAAO,MAAM,MAAM,WAAe,CAAC;AAEnC,eAAO,MAAM,GAAG,WAAkB,CAAC;AACnC,eAAO,MAAM,QAAQ,YAAY,CAAC;AAElC,eAAO,MAAM,IAAI;IACf;;;;;;;OAOG;;;;CAKK,CAAC;AAEX,6EAA6E;AAC7E,eAAO,MAAM,KAAK,WAAgB,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/draw/styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,wGAAwG;AACxG,eAAO,MAAM,MAAM,WAAe,CAAC;AAEnC,eAAO,MAAM,GAAG,WAAkB,CAAC;AACnC,eAAO,MAAM,QAAQ,YAAY,CAAC;AAElC,eAAO,MAAM,IAAI;IACf;;;;;;;OAOG;;;;CAKK,CAAC;AAEX,6EAA6E;AAC7E,eAAO,MAAM,KAAK,WAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ function C(e, t) {
46
46
  r = Math.min(r, t.x), i = Math.min(i, t.y), a = Math.max(a, t.x + t.width), o = Math.max(o, t.y + t.height);
47
47
  }
48
48
  Number.isFinite(r) || (r = 0, i = 0, a = 100, o = 100);
49
- let s = r - S, c = i - S, l = a - r + S * 2, u = o - i + S * 2, d = n.cloneNode(!0);
49
+ let s = r - S, c = i - S, l = a - r + 80, u = o - i + 80, d = n.cloneNode(!0);
50
50
  d.setAttribute("xmlns", "http://www.w3.org/2000/svg"), d.setAttribute("viewBox", `${s} ${c} ${l} ${u}`), d.setAttribute("width", String(Math.round(l))), d.setAttribute("height", String(Math.round(u)));
51
51
  let f = d.querySelector(".viewport");
52
52
  return f && f.removeAttribute("transform"), { svg: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + new XMLSerializer().serializeToString(d) };
@@ -126,7 +126,7 @@ var E = class {
126
126
  let n = this.get("canvas"), r = this.get("elementRegistry"), i = Infinity, a = Infinity, o = -Infinity, s = -Infinity;
127
127
  for (let e of r.getAll()) {
128
128
  let t = e;
129
- typeof t.x != "number" || typeof t.y != "number" || typeof t.width != "number" || typeof t.height != "number" || (i = Math.min(i, t.x), a = Math.min(a, t.y), o = Math.max(o, t.x + t.width), s = Math.max(s, t.y + t.height));
129
+ typeof t.x == "number" && typeof t.y == "number" && typeof t.width == "number" && typeof t.height == "number" && (i = Math.min(i, t.x), a = Math.min(a, t.y), o = Math.max(o, t.x + t.width), s = Math.max(s, t.y + t.height));
130
130
  }
131
131
  if (!Number.isFinite(i)) return;
132
132
  let c = this._container.getBoundingClientRect(), l = c.width, u = c.height, d = Math.max(o - i, 1), f = Math.max(s - a, 1);
@@ -578,7 +578,7 @@ var ge = class {
578
578
  }, V = {
579
579
  __init__: ["ttModeling"],
580
580
  ttModeling: ["type", B]
581
- }, _e = class extends ie {
581
+ }, H = class extends ie {
582
582
  static $inject = ["eventBus"];
583
583
  constructor(e) {
584
584
  super(e);
@@ -586,20 +586,20 @@ var ge = class {
586
586
  init() {
587
587
  this.addRule(["shape.move", "elements.move"], (e) => e.target && e.target.parent ? null : !0), this.addRule("shape.create", () => !0), this.addRule("shape.resize", () => !0), this.addRule("element.copy", () => !0);
588
588
  }
589
- }, H = {
589
+ }, U = {
590
590
  __depends__: [re],
591
591
  __init__: ["ttRules"],
592
- ttRules: ["type", _e]
593
- }, U = class extends ae {
592
+ ttRules: ["type", H]
593
+ }, W = class extends ae {
594
594
  static $inject = ["eventBus", "canvas"];
595
595
  constructor(e, t) {
596
596
  super(e), this.preExecute(["shape.create", "elements.create"], (e) => {
597
597
  e.parent = t.getRootElement();
598
598
  }, !0);
599
599
  }
600
- }, W = {
600
+ }, _e = {
601
601
  __init__: ["ttFlatModelBehavior"],
602
- ttFlatModelBehavior: ["type", U]
602
+ ttFlatModelBehavior: ["type", W]
603
603
  };
604
604
  //#endregion
605
605
  //#region src/draw/palette-icons.ts
@@ -693,7 +693,7 @@ function Ce(e, t = 18) {
693
693
  function Q(e, t) {
694
694
  return `<div class="entry tt-cp-entry" title="${t}">${Ce(e)}</div>`;
695
695
  }
696
- var $ = class {
696
+ var we = class {
697
697
  modeling;
698
698
  labelEditing;
699
699
  static $inject = [
@@ -720,11 +720,11 @@ var $ = class {
720
720
  }
721
721
  } : {};
722
722
  }
723
- }, we = {
723
+ }, Te = {
724
724
  __depends__: [ce],
725
725
  __init__: ["ttContextPadProvider"],
726
- ttContextPadProvider: ["type", $]
727
- }, Te = class {
726
+ ttContextPadProvider: ["type", we]
727
+ }, Ee = class {
728
728
  canvas;
729
729
  modeling;
730
730
  static $inject = [
@@ -744,7 +744,7 @@ var $ = class {
744
744
  }
745
745
  activate(e) {
746
746
  this.active?.commit();
747
- let t = this.canvas.getContainer(), n = this.canvas.zoom(), r = this.canvas.viewbox(), i = e.x + e.width / 2, a = e.y + e.height / 2, o = (i - r.x) * n - 170 / 2, s = (a - r.y) * n - 14, c = document.createElement("input");
747
+ let t = this.canvas.getContainer(), n = this.canvas.zoom(), r = this.canvas.viewbox(), i = e.x + e.width / 2, a = e.y + e.height / 2, o = (i - r.x) * n - 85, s = (a - r.y) * n - 14, c = document.createElement("input");
748
748
  c.type = "text", c.className = "tt-label-input", c.value = e.ttLabel ?? "", c.style.position = "absolute", c.style.left = `${o}px`, c.style.top = `${s}px`, c.style.width = "170px", t.appendChild(c), c.focus(), c.select();
749
749
  let l = !1, u = () => {
750
750
  l || (l = !0, c.removeEventListener("keydown", f), c.removeEventListener("blur", p), c.remove(), this.active = null);
@@ -763,17 +763,17 @@ var $ = class {
763
763
  cancel() {
764
764
  this.active?.cleanup();
765
765
  }
766
- }, Ee = {
766
+ }, De = {
767
767
  __init__: ["ttLabelEditing"],
768
- ttLabelEditing: ["type", Te]
768
+ ttLabelEditing: ["type", Ee]
769
769
  };
770
770
  //#endregion
771
771
  //#region src/keyboard/TtKeyboard.ts
772
- function De(e) {
772
+ function Oe(e) {
773
773
  let t = e;
774
774
  return t ? t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" || t.isContentEditable : !1;
775
775
  }
776
- var Oe = class {
776
+ var ke = class {
777
777
  static $inject = [
778
778
  "canvas",
779
779
  "commandStack",
@@ -783,7 +783,7 @@ var Oe = class {
783
783
  ];
784
784
  constructor(e, t, n, r, i) {
785
785
  (e.getContainer().ownerDocument ?? document).addEventListener("keydown", (e) => {
786
- if (De(e.target)) return;
786
+ if (Oe(e.target)) return;
787
787
  let a = e.ctrlKey || e.metaKey, o = e.key.toLowerCase();
788
788
  if (a && o === "z" && !e.shiftKey) e.preventDefault(), t.canUndo() && t.undo();
789
789
  else if (a && o === "z" && e.shiftKey || a && o === "y") e.preventDefault(), t.canRedo() && t.redo();
@@ -796,13 +796,13 @@ var Oe = class {
796
796
  } else a && o === "v" && (e.preventDefault(), i.paste());
797
797
  });
798
798
  }
799
- }, ke = {
799
+ }, Ae = {
800
800
  __init__: ["ttKeyboard"],
801
- ttKeyboard: ["type", Oe]
801
+ ttKeyboard: ["type", ke]
802
802
  };
803
803
  //#endregion
804
804
  //#region src/copy-paste/TtCopyPaste.ts
805
- function Ae(e) {
805
+ function je(e) {
806
806
  switch (e) {
807
807
  case "team": return "team";
808
808
  case "interaction": return "int";
@@ -810,7 +810,7 @@ function Ae(e) {
810
810
  default: return;
811
811
  }
812
812
  }
813
- var je = class extends ue {
813
+ var Me = class extends ue {
814
814
  elementFactory;
815
815
  static $inject = [
816
816
  "canvas",
@@ -826,13 +826,13 @@ var je = class extends ue {
826
826
  super(e, t, n, r, i, a, o, s), this.elementFactory = r;
827
827
  }
828
828
  createShape(e) {
829
- let t = Ae(e.ttKind);
829
+ let t = je(e.ttKind);
830
830
  return t ? this.elementFactory.createShape({
831
831
  ...e,
832
832
  id: c(t)
833
833
  }) : super.createShape(e);
834
834
  }
835
- }, Me = [
835
+ }, Ne = [
836
836
  "ttKind",
837
837
  "teamType",
838
838
  "mode",
@@ -840,10 +840,10 @@ var je = class extends ue {
840
840
  "description",
841
841
  "fill",
842
842
  "stroke"
843
- ], Ne = {
843
+ ], Pe = {
844
844
  __depends__: [le],
845
845
  __init__: ["ttCopyPasteProps"],
846
- copyPaste: ["type", je],
846
+ copyPaste: ["type", Me],
847
847
  ttCopyPasteProps: ["type", class {
848
848
  static $inject = ["eventBus"];
849
849
  constructor(e) {
@@ -851,17 +851,17 @@ var je = class extends ue {
851
851
  let { descriptor: t, element: n } = e;
852
852
  if (!v(n)) return;
853
853
  let r = n;
854
- for (let e of Me) r[e] !== void 0 && (t[e] = r[e]);
854
+ for (let e of Ne) r[e] !== void 0 && (t[e] = r[e]);
855
855
  });
856
856
  }
857
857
  }]
858
858
  };
859
859
  //#endregion
860
860
  //#region src/zorder/TtZOrder.ts
861
- function Pe(e) {
861
+ function Fe(e) {
862
862
  return x(e) ? 0 : y(e) ? e.teamType === "enabling" ? 3 : e.teamType === "complicated-subsystem" ? 2 : 1 : b(e) ? 4 : 1;
863
863
  }
864
- var Fe = class {
864
+ var Ie = class {
865
865
  canvas;
866
866
  elementRegistry;
867
867
  static $inject = [
@@ -880,15 +880,15 @@ var Fe = class {
880
880
  });
881
881
  }
882
882
  reorder() {
883
- let e = this.elementRegistry.getAll().filter(v).sort((e, t) => Pe(e) - Pe(t));
883
+ let e = this.elementRegistry.getAll().filter(v).sort((e, t) => Fe(e) - Fe(t));
884
884
  for (let t of e) {
885
885
  let e = this.canvas.getGraphics(t)?.parentNode, n = e?.parentNode;
886
886
  e && n && n.appendChild(e);
887
887
  }
888
888
  }
889
- }, Ie = {
889
+ }, $ = {
890
890
  __init__: ["ttZOrder"],
891
- ttZOrder: ["type", Fe]
891
+ ttZOrder: ["type", Ie]
892
892
  }, Le = class extends L {
893
893
  _getModules() {
894
894
  return [
@@ -898,14 +898,14 @@ var Fe = class {
898
898
  te,
899
899
  ne,
900
900
  V,
901
- H,
902
- W,
901
+ U,
902
+ _e,
903
903
  Z,
904
- we,
905
- Ee,
906
- ke,
907
- Ne,
908
- Ie
904
+ Te,
905
+ De,
906
+ Ae,
907
+ Pe,
908
+ $
909
909
  ];
910
910
  }
911
911
  undo() {
@@ -922,6 +922,6 @@ var Fe = class {
922
922
  }
923
923
  };
924
924
  //#endregion
925
- export { Le as Modeler, L as NavigatedViewer, w as ROOT_ID, j as TeamTopologiesRenderer, E as TtBaseViewer, $ as TtContextPadProvider, D as TtElementFactory, P as TtExporter, U as TtFlatModelBehavior, N as TtImporter, Oe as TtKeyboard, Te as TtLabelEditing, B as TtModeling, X as TtPaletteProvider, _e as TtRules, Fe as TtZOrder, I as Viewer, q as flowIconSvg, J as interactionIconSvg, F as ioModule, v as isTtElement, x as isTtFlow, b as isTtInteraction, y as isTtTeam, C as saveSVG, K as teamIconSvg, W as ttBehaviorsModule, we as ttContextPadModule, M as ttDrawModule, ke as ttKeyboardModule, Ee as ttLabelEditingModule, O as ttModelModule, V as ttModelingModule, Z as ttPaletteModule, H as ttRulesModule, Ie as ttZOrderModule };
925
+ export { Le as Modeler, L as NavigatedViewer, w as ROOT_ID, j as TeamTopologiesRenderer, E as TtBaseViewer, we as TtContextPadProvider, D as TtElementFactory, P as TtExporter, W as TtFlatModelBehavior, N as TtImporter, ke as TtKeyboard, Ee as TtLabelEditing, B as TtModeling, X as TtPaletteProvider, H as TtRules, Ie as TtZOrder, I as Viewer, q as flowIconSvg, J as interactionIconSvg, F as ioModule, v as isTtElement, x as isTtFlow, b as isTtInteraction, y as isTtTeam, C as saveSVG, K as teamIconSvg, _e as ttBehaviorsModule, Te as ttContextPadModule, M as ttDrawModule, Ae as ttKeyboardModule, De as ttLabelEditingModule, O as ttModelModule, V as ttModelingModule, Z as ttPaletteModule, U as ttRulesModule, $ as ttZOrderModule };
926
926
 
927
927
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/model/di-types.ts","../src/io/saveSvg.ts","../src/io/types.ts","../src/TtBaseViewer.ts","../src/model/TtElementFactory.ts","../src/model/index.ts","../src/theme/palette.ts","../src/draw/styles.ts","../src/draw/TeamTopologiesRenderer.ts","../src/draw/index.ts","../src/io/TtImporter.ts","../src/io/TtExporter.ts","../src/io/index.ts","../src/Viewer.ts","../src/NavigatedViewer.ts","../src/modeling/cmd/UpdatePropertiesHandler.ts","../src/modeling/TtModeling.ts","../src/modeling/index.ts","../src/rules/TtRules.ts","../src/rules/index.ts","../src/behaviors/TtFlatModelBehavior.ts","../src/behaviors/index.ts","../src/draw/palette-icons.ts","../src/palette/TtPaletteProvider.ts","../src/palette/index.ts","../src/draw/icons.ts","../src/context-pad/TtContextPadProvider.ts","../src/context-pad/index.ts","../src/label-editing/TtLabelEditing.ts","../src/label-editing/index.ts","../src/keyboard/TtKeyboard.ts","../src/keyboard/index.ts","../src/copy-paste/TtCopyPaste.ts","../src/copy-paste/TtCopyPasteProps.ts","../src/copy-paste/index.ts","../src/zorder/TtZOrder.ts","../src/zorder/index.ts","../src/Modeler.ts"],"sourcesContent":["/**\n * diagram-js runtime model for the Team Topologies notation. Every element is a\n * placed, resizable SHAPE discriminated by `ttKind`:\n * - `team` — one of the four team types (label inside the box)\n * - `interaction` — a mode glyph (parallelogram / triangle / circle), 50%\n * transparent, overlaid on the boundary between teams\n * - `flow` — the \"flow of change\" arrow guide\n *\n * These runtime properties are the source of truth while editing; the exporter\n * rebuilds the canonical `TtDocument` from them.\n */\n\nimport type { Shape } from \"diagram-js/lib/model/Types\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\n\nexport type TtKind = \"team\" | \"interaction\" | \"flow\";\n\nexport interface TtTeam extends Shape {\n ttKind: \"team\";\n teamType: TeamType;\n /** Display name (separate from diagram-js `label`). */\n ttLabel?: string;\n description?: string;\n fill?: string;\n stroke?: string;\n}\n\nexport interface TtInteraction extends Shape {\n ttKind: \"interaction\";\n mode: InteractionMode;\n ttLabel?: string;\n fill?: string;\n stroke?: string;\n}\n\nexport interface TtFlow extends Shape {\n ttKind: \"flow\";\n ttLabel?: string;\n}\n\nexport type TtElement = TtTeam | TtInteraction | TtFlow;\n\nfunction kindOf(el: unknown): string | undefined {\n return typeof el === \"object\" && el !== null\n ? ((el as { ttKind?: unknown }).ttKind as string | undefined)\n : undefined;\n}\n\nexport function isTtElement(el: unknown): el is TtElement {\n return typeof kindOf(el) === \"string\";\n}\n\nexport function isTtTeam(el: unknown): el is TtTeam {\n return kindOf(el) === \"team\";\n}\n\nexport function isTtInteraction(el: unknown): el is TtInteraction {\n return kindOf(el) === \"interaction\";\n}\n\nexport function isTtFlow(el: unknown): el is TtFlow {\n return kindOf(el) === \"flow\";\n}\n","/**\n * Serialises the current canvas into a standalone SVG (snapshot / export),\n * fitted to the content bounds and independent of the current zoom / scroll.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport { isTtElement } from \"../model/di-types.js\";\n\nconst MARGIN = 40;\n\nexport function saveSVG(canvas: Canvas, elementRegistry: ElementRegistry): { svg: string } {\n const container = canvas.getContainer();\n const source = container.querySelector(\"svg\");\n if (!source) throw new Error(\"No SVG found in the canvas container.\");\n\n // Content bounds from the team shapes (interactions sit between them).\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const el of elementRegistry.getAll()) {\n if (!isTtElement(el)) continue;\n const s = el as unknown as { x: number; y: number; width: number; height: number };\n minX = Math.min(minX, s.x);\n minY = Math.min(minY, s.y);\n maxX = Math.max(maxX, s.x + s.width);\n maxY = Math.max(maxY, s.y + s.height);\n }\n if (!Number.isFinite(minX)) {\n minX = 0;\n minY = 0;\n maxX = 100;\n maxY = 100;\n }\n\n const x = minX - MARGIN;\n const y = minY - MARGIN;\n const width = maxX - minX + MARGIN * 2;\n const height = maxY - minY + MARGIN * 2;\n\n const clone = source.cloneNode(true) as SVGSVGElement;\n clone.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n clone.setAttribute(\"viewBox\", `${x} ${y} ${width} ${height}`);\n clone.setAttribute(\"width\", String(Math.round(width)));\n clone.setAttribute(\"height\", String(Math.round(height)));\n\n // Neutralise pan/zoom: let the viewBox (above) drive the geometry.\n const viewport = clone.querySelector<SVGGElement>(\".viewport\");\n if (viewport) viewport.removeAttribute(\"transform\");\n\n const svg = new XMLSerializer().serializeToString(clone);\n return { svg: '<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n' + svg };\n}\n","/** ID of the diagram-js root element holding the Team Topologies diagram. */\nexport const ROOT_ID = \"tt-root\";\n\nexport interface ImportWarning {\n readonly message: string;\n readonly elementId?: string;\n}\n\n/** Diagram-level metadata stashed on the root element. */\nexport interface RootBusinessObject {\n title: string;\n}\n","/**\n * Shared lifecycle & DI bootstrap for every Team Topologies viewer. Subclasses\n * only override `_getModules()`. The renderer\n * is framework-agnostic — mount it into any element (e.g. a VS Code webview).\n */\n\nimport Diagram from \"diagram-js/lib/Diagram\";\nimport type { ModuleDeclaration } from \"didi\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport type { TtDocument } from \"@miragon/team-topologies-schema-model\";\nimport { saveSVG } from \"./io/saveSvg.js\";\nimport type TtImporter from \"./io/TtImporter.js\";\nimport type TtExporter from \"./io/TtExporter.js\";\nimport { ROOT_ID, type ImportWarning, type RootBusinessObject } from \"./io/types.js\";\n\nexport interface TtViewerOptions {\n /** Host element. When absent, a detached <div> is created (attach later). */\n container?: HTMLElement;\n width?: number | string;\n height?: number | string;\n /** Appended to the module list (extension point). */\n additionalModules?: ModuleDeclaration[];\n}\n\nexport type EventCallback<T = unknown> = (event: T) => void;\n\ntype RootWithMeta = Root & { businessObject?: RootBusinessObject };\n\nfunction sizeToCss(value: number | string): string {\n return typeof value === \"number\" ? `${value}px` : value;\n}\n\nexport abstract class TtBaseViewer {\n protected abstract _getModules(): ModuleDeclaration[];\n\n private _diagram: Diagram | undefined;\n private readonly _container: HTMLElement;\n private readonly _options: TtViewerOptions;\n\n constructor(options: TtViewerOptions = {}) {\n this._options = options;\n this._container = this._createContainer(options);\n }\n\n private _createContainer(options: TtViewerOptions): HTMLElement {\n const container = options.container ?? document.createElement(\"div\");\n container.classList.add(\"tt-djs-container\");\n container.style.width = sizeToCss(options.width ?? \"100%\");\n container.style.height = sizeToCss(options.height ?? (options.container ? \"100%\" : \"600px\"));\n return container;\n }\n\n private _ensureDiagram(): Diagram {\n if (!this._diagram) {\n const modules = [...this._getModules(), ...(this._options.additionalModules ?? [])];\n this._diagram = new Diagram({ canvas: { container: this._container }, modules });\n }\n return this._diagram;\n }\n\n /** Resolve a diagram-js service from the didi injector. */\n get<T>(name: string): T {\n return this._ensureDiagram().get<T>(name);\n }\n\n on<T = unknown>(event: string, callback: EventCallback<T>, priority = 1000): void {\n this.get<EventBus>(\"eventBus\").on(event, priority, callback as EventCallback);\n }\n\n off(event: string, callback: EventCallback): void {\n this.get<EventBus>(\"eventBus\").off(event, callback);\n }\n\n /** Load a document into the canvas (replaces existing content). */\n importDocument(doc: TtDocument): { warnings: ImportWarning[] } {\n const diagram = this._ensureDiagram();\n const eventBus = diagram.get<EventBus>(\"eventBus\");\n const importer = diagram.get<TtImporter>(\"ttImporter\");\n importer.clear();\n const warnings = importer.import(doc);\n this._fit();\n eventBus.fire(\"import.done\", { warnings });\n return { warnings };\n }\n\n /** Current canvas state as a canonical document. */\n exportDocument(): TtDocument {\n return this.get<TtExporter>(\"ttExporter\").export();\n }\n\n /** Update diagram-level metadata (title / flow-of-change) on the root. */\n setMeta(partial: Partial<RootBusinessObject>): void {\n const canvas = this.get<Canvas>(\"canvas\");\n let root: RootWithMeta | undefined;\n try {\n root = canvas.getRootElement() as RootWithMeta;\n } catch {\n return;\n }\n if (!root || root.id !== ROOT_ID) return;\n const current = root.businessObject ?? { title: \"Untitled team topology\" };\n root.businessObject = { ...current, ...partial };\n }\n\n /** Read diagram-level metadata (title / flow-of-change) from the root. */\n getMeta(): RootBusinessObject | undefined {\n try {\n const root = this.get<Canvas>(\"canvas\").getRootElement() as RootWithMeta;\n return root.businessObject;\n } catch {\n return undefined;\n }\n }\n\n /** Standalone, self-contained SVG snapshot. */\n saveSVG(): { svg: string } {\n return saveSVG(this.get<Canvas>(\"canvas\"), this.get<ElementRegistry>(\"elementRegistry\"));\n }\n\n /** Fit the content into the viewport, leaving room at the top for the palette. */\n private _fit(topInset = 84, pad = 56): void {\n const canvas = this.get<Canvas>(\"canvas\");\n const registry = this.get<ElementRegistry>(\"elementRegistry\");\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const el of registry.getAll()) {\n const e = el as { x?: number; y?: number; width?: number; height?: number };\n if (\n typeof e.x !== \"number\" ||\n typeof e.y !== \"number\" ||\n typeof e.width !== \"number\" ||\n typeof e.height !== \"number\"\n ) {\n continue;\n }\n minX = Math.min(minX, e.x);\n minY = Math.min(minY, e.y);\n maxX = Math.max(maxX, e.x + e.width);\n maxY = Math.max(maxY, e.y + e.height);\n }\n if (!Number.isFinite(minX)) return;\n\n const rect = this._container.getBoundingClientRect();\n const W = rect.width;\n const H = rect.height;\n const cw = Math.max(maxX - minX, 1);\n const ch = Math.max(maxY - minY, 1);\n if (!W || !H) {\n canvas.zoom(\"fit-viewport\");\n return;\n }\n const s = Math.min((W - 2 * pad) / cw, (H - topInset - pad) / ch, 1.25);\n canvas.viewbox({\n x: minX + cw / 2 - W / 2 / s,\n y: minY - topInset / s,\n width: W / s,\n height: H / s,\n });\n }\n\n /** Attach the container into `target`. */\n attachTo(target: HTMLElement): void {\n target.appendChild(this._container);\n this.get<Canvas>(\"canvas\").resized();\n }\n\n /** Detach the container from the DOM, preserving state. */\n detach(): void {\n this._container.remove();\n }\n\n clear(): void {\n this._ensureDiagram().clear();\n }\n\n destroy(): void {\n if (this._diagram) {\n this._diagram.destroy();\n this._diagram = undefined;\n }\n this._container.remove();\n }\n\n get container(): HTMLElement {\n return this._container;\n }\n}\n","/**\n * Creates diagram-js runtime shapes carrying Team Topologies markers, from\n * canonical document elements (import) or from scratch (palette drag-to-create).\n * Everything is a shape — teams, interaction glyphs and the flow arrow.\n */\n\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport {\n FLOW_SPEC,\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n newId,\n} from \"@miragon/team-topologies-schema-model\";\nimport type {\n FlowShape,\n InteractionMode,\n InteractionShape,\n TeamNode,\n TeamType,\n} from \"@miragon/team-topologies-schema-model\";\nimport type { TtFlow, TtInteraction, TtTeam } from \"./di-types.js\";\n\nexport default class TtElementFactory {\n static $inject = [\"elementFactory\"];\n\n constructor(private readonly elementFactory: ElementFactory) {}\n\n // --- from canonical document elements (import) -------------------------\n\n createTeam(node: TeamNode): TtTeam {\n return this.elementFactory.createShape({\n id: node.id,\n x: node.position.x,\n y: node.position.y,\n width: node.size.width,\n height: node.size.height,\n ttKind: \"team\",\n teamType: node.type,\n ttLabel: node.label,\n ...(node.description ? { description: node.description } : {}),\n ...(node.fill ? { fill: node.fill } : {}),\n ...(node.stroke ? { stroke: node.stroke } : {}),\n } as Partial<TtTeam>) as unknown as TtTeam;\n }\n\n createInteraction(shape: InteractionShape): TtInteraction {\n return this.elementFactory.createShape({\n id: shape.id,\n x: shape.position.x,\n y: shape.position.y,\n width: shape.size.width,\n height: shape.size.height,\n ttKind: \"interaction\",\n mode: shape.mode,\n ...(shape.label ? { ttLabel: shape.label } : {}),\n ...(shape.fill ? { fill: shape.fill } : {}),\n ...(shape.stroke ? { stroke: shape.stroke } : {}),\n } as Partial<TtInteraction>) as unknown as TtInteraction;\n }\n\n createFlow(shape: FlowShape): TtFlow {\n return this.elementFactory.createShape({\n id: shape.id,\n x: shape.position.x,\n y: shape.position.y,\n width: shape.size.width,\n height: shape.size.height,\n ttKind: \"flow\",\n ...(shape.label ? { ttLabel: shape.label } : {}),\n } as Partial<TtFlow>) as unknown as TtFlow;\n }\n\n // --- fresh, not-yet-placed shapes (palette / context-pad create) -------\n //\n // These set an explicit model-style id (`team_…`/`int_…`/`flow_…`, matching\n // the model package's factory). We must NOT fall back to diagram-js' own\n // auto-id: its counter starts at `shape_12` and is not advanced past ids that\n // come in via import, so a re-imported `shape_N` (an element created in a\n // previous session, then autosaved) collides with the next palette create —\n // the first placement after a reload then throws \"element already exists\".\n\n createNewTeam(type: TeamType, label?: string): TtTeam {\n const spec = TEAM_TYPE_SPECS[type];\n return this.elementFactory.createShape({\n id: newId(\"team\"),\n width: spec.defaultSize.width,\n height: spec.defaultSize.height,\n ttKind: \"team\",\n teamType: type,\n ttLabel: label ?? spec.label,\n } as Partial<TtTeam>) as unknown as TtTeam;\n }\n\n createNewInteraction(mode: InteractionMode): TtInteraction {\n const spec = INTERACTION_MODE_SPECS[mode];\n return this.elementFactory.createShape({\n id: newId(\"int\"),\n width: spec.defaultSize.width,\n height: spec.defaultSize.height,\n ttKind: \"interaction\",\n mode,\n } as Partial<TtInteraction>) as unknown as TtInteraction;\n }\n\n createNewFlow(): TtFlow {\n return this.elementFactory.createShape({\n id: newId(\"flow\"),\n width: FLOW_SPEC.defaultSize.width,\n height: FLOW_SPEC.defaultSize.height,\n ttKind: \"flow\",\n ttLabel: FLOW_SPEC.label,\n } as Partial<TtFlow>) as unknown as TtFlow;\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtElementFactory from \"./TtElementFactory.js\";\n\n/** Element factory with Team Topologies defaults. */\nexport const ttModelModule: ModuleDeclaration = {\n ttElementFactory: [\"type\", TtElementFactory],\n};\n\nexport { default as TtElementFactory } from \"./TtElementFactory.js\";\nexport * from \"./di-types.js\";\n","/**\n * Miragon design tokens — the single source of truth for every non-notation colour in the renderer.\n *\n * Values mirror the Miragon corporate identity: the `miragon-brand:modeler-tool-design` skill in\n * `Miragon/corporate-identity`, whose vendored `cd-tokens.generated.css` (next to this file) defines\n * the `--cd-*` custom properties, generated from `brand/tokens.json`. Re-copy that CSS from the skill\n * to update; never fork the hex values by hand. `test/theme.sync.test.ts` fails if this mirror drifts\n * from the vendored CSS.\n *\n * Pure data — no DOM, no imports — so it stays inside the P1 DOM-free discipline and can be consumed\n * by the SVG-drawing constants in `draw/styles.ts`.\n *\n * Brand rule: blue leads (`blau` — surfaces, buttons, links, selection), green accents (`gruen` — key\n * visual, highlights; a fill, never body text on white). The four Team Topologies team-type and\n * interaction colours are the official notation and live in `schema-model/notation.ts` — they are NOT\n * part of this brand ramp.\n */\n\n/** Raw Miragon brand ramp + functional layer — exact `--cd-*` values. */\nexport const MIRAGON = {\n /** Primary: surfaces, buttons, links, selection, backgrounds. */\n blau: \"#335DE5\",\n /** Deeper blue for links / accent text on white (WCAG AA, ~5.5:1). */\n blauLink: \"#2B50D4\",\n /** Lightened blue for accents on dark surfaces (unused here — the canvas is light-only). */\n blauHell: \"#6B8AFF\",\n /** Accent: key visual, highlights, the brand gradient. Bright — a fill, never text on white. */\n gruen: \"#00E676\",\n /** Calm neutral surface (warm off-white) — the paper surround. */\n grau: \"#F9F7F7\",\n /** Text on light; not pure black. */\n schwarz: \"#1D1D1D\",\n weiss: \"#FFFFFF\",\n /** Functional / status layer (own layer beside the brand palette; AA as text on white). */\n success: \"#0B7A55\",\n warning: \"#92610A\",\n danger: \"#C92A2A\",\n info: \"#2B50D4\",\n /** Signature brand gradient — brand moments only. Use verbatim. */\n gradientBrand: \"linear-gradient(120deg, #335DE5 30%, #00E676)\",\n} as const;\n\n/**\n * Every `--cd-*` token this repo depends on, mapped to the value it MUST hold. The drift test parses\n * `cd-tokens.generated.css` and asserts each entry matches, so re-copying the vendored CSS with a\n * changed value fails CI until this mirror (and `MIRAGON`) is updated too.\n */\nexport const CD_TOKENS: Record<string, string> = {\n \"--cd-blau\": MIRAGON.blau,\n \"--cd-gruen\": MIRAGON.gruen,\n \"--cd-grau\": MIRAGON.grau,\n \"--cd-schwarz\": MIRAGON.schwarz,\n \"--cd-weiss\": MIRAGON.weiss,\n \"--cd-blau-link\": MIRAGON.blauLink,\n \"--cd-blau-hell\": MIRAGON.blauHell,\n \"--cd-success\": MIRAGON.success,\n \"--cd-success-soft\": \"rgba(11, 122, 85, 0.12)\",\n \"--cd-warning\": MIRAGON.warning,\n \"--cd-warning-soft\": \"rgba(146, 97, 10, 0.12)\",\n \"--cd-danger\": MIRAGON.danger,\n \"--cd-danger-soft\": \"rgba(201, 42, 42, 0.12)\",\n \"--cd-info\": MIRAGON.info,\n \"--cd-info-soft\": \"rgba(43, 80, 212, 0.12)\",\n \"--cd-gradient-brand\": MIRAGON.gradientBrand,\n};\n","/** Shared rendering constants (typography, accent, priorities) — Miragon corporate identity.\n * Colours are derived from the single source of truth in `theme/palette.ts` (`MIRAGON`), which\n * mirrors the vendored `--cd-*` brand tokens. */\n\nimport { MIRAGON } from \"../theme/index.js\";\n\n/** BaseRenderer default priority is 1000; 1500 wins the render.shape/connection event. */\nexport const TT_RENDER_PRIORITY = 1500;\n\n/** Selection / hover accent (Miragon blue — kept in sync with the app theme via the shared palette). */\nexport const ACCENT = MIRAGON.blau;\n\nexport const INK = MIRAGON.schwarz;\nexport const INK_SOFT = \"#5B5B5B\";\n\nexport const FONT = {\n /**\n * Set directly as the `font-family` attribute on every SVG <text> (canvas\n * labels and therefore the SVG export too) — not inherited from a CSS\n * container. Prefers the self-hosted Miragon typeface Geist (registered as\n * 'Geist Variable' by @fontsource-variable/geist, with 'Geist' as a fallback\n * name), and falls back to a system sans when the host hasn't loaded it (e.g.\n * an exported SVG opened standalone).\n */\n family:\n \"'Geist Variable', 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif\",\n label: 13.5,\n small: 11,\n} as const;\n\n/** Paper colour used for the label halo so text stays legible over lines. */\nexport const PAPER = MIRAGON.weiss;\n","/**\n * SVG rendering of the Team Topologies notation (BaseRenderer subclass).\n * Everything is a placed shape:\n * - teams: SOLID resizable boxes (label wrapped inside), distinguished by shape\n * as well as colour;\n * - interactions: DASHED, 50%-transparent glyphs (collaboration = parallelogram,\n * x-as-a-service = triangle, facilitating = circle) laid over team boundaries;\n * - flow: a dashed \"flow of change\" arrow.\n *\n * Colours/shapes come from the single notation source (`@miragon/team-topologies-schema-model`).\n */\n\nimport BaseRenderer from \"diagram-js/lib/draw/BaseRenderer\";\nimport { append as svgAppend, create as svgCreate, attr as svgAttr } from \"tiny-svg\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { ElementLike, ShapeLike } from \"diagram-js/lib/model/Types\";\nimport {\n FLOW_SPEC,\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n dashArray,\n} from \"@miragon/team-topologies-schema-model\";\nimport { FONT, INK, INK_SOFT } from \"./styles.js\";\nimport { TT_RENDER_PRIORITY } from \"./styles.js\";\nimport {\n isTtElement,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtFlow,\n type TtInteraction,\n type TtTeam,\n} from \"../model/di-types.js\";\n\ntype Attrs = Record<string, string | number>;\n\nexport default class TeamTopologiesRenderer extends BaseRenderer {\n static $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n super(eventBus, TT_RENDER_PRIORITY);\n }\n\n override canRender(element: ElementLike): boolean {\n return isTtElement(element);\n }\n\n override drawShape(visuals: SVGElement, element: ShapeLike): SVGElement {\n if (isTtTeam(element)) return this.drawTeam(visuals, element);\n if (isTtInteraction(element)) return this.drawInteraction(visuals, element);\n if (isTtFlow(element)) return this.drawFlow(visuals, element);\n const rect = svgAttr(svgCreate(\"rect\"), {\n width: element.width,\n height: element.height,\n fill: \"#eee\",\n });\n svgAppend(visuals, rect);\n return rect;\n }\n\n override getShapePath(shape: ShapeLike): string {\n const { x, y, width, height } = shape;\n return `M${x},${y}l${width},0l0,${height}l${-width},0z`;\n }\n\n // --- teams ---------------------------------------------------------------\n\n private drawTeam(visuals: SVGElement, team: TtTeam): SVGElement {\n const spec = TEAM_TYPE_SPECS[team.teamType] ?? TEAM_TYPE_SPECS[\"stream-aligned\"];\n const w = Math.max(team.width, 1);\n const h = Math.max(team.height, 1);\n const sw = spec.strokeWidth;\n const dash = dashArray(spec.strokeStyle, sw);\n const outline = this.teamOutline(spec.shape, w, h, sw, {\n fill: team.fill ?? spec.fill,\n stroke: team.stroke ?? spec.stroke,\n \"stroke-width\": sw,\n ...(dash ? { \"stroke-dasharray\": dash } : {}),\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, outline);\n this.appendLabel(visuals, team.ttLabel ?? \"\", w, h, { \"font-weight\": \"640\" });\n return outline;\n }\n\n private teamOutline(kind: string, w: number, h: number, sw: number, attrs: Attrs): SVGElement {\n const i = sw / 2;\n const iw = w - sw;\n const ih = h - sw;\n if (kind === \"octagon\") {\n const c = Math.min(iw, ih) * 0.29;\n return svgAttr(svgCreate(\"polygon\"), { points: octagon(i, iw, ih, c), ...attrs });\n }\n const rx = kind === \"rect\" ? 4 : Math.min(20, ih / 2, iw / 2);\n return svgAttr(svgCreate(\"rect\"), { x: i, y: i, width: iw, height: ih, rx, ry: rx, ...attrs });\n }\n\n // --- interactions --------------------------------------------------------\n\n private drawInteraction(visuals: SVGElement, el: TtInteraction): SVGElement {\n const spec = INTERACTION_MODE_SPECS[el.mode] ?? INTERACTION_MODE_SPECS.collaboration;\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = 2;\n const i = sw / 2;\n const common: Attrs = {\n fill: el.fill ?? spec.fill,\n \"fill-opacity\": spec.opacity,\n stroke: el.stroke ?? spec.stroke,\n \"stroke-width\": sw,\n \"stroke-dasharray\": dashArray(spec.strokeStyle, sw) || \"6 4\",\n \"stroke-linejoin\": \"round\",\n };\n\n let glyph: SVGElement;\n if (spec.shape === \"circle\") {\n glyph = svgAttr(svgCreate(\"ellipse\"), {\n cx: w / 2,\n cy: h / 2,\n rx: (w - sw) / 2,\n ry: (h - sw) / 2,\n ...common,\n });\n } else if (spec.shape === \"triangle\") {\n // Point up — the tip indicates the direction the service is provided.\n const pts = `${w / 2},${i} ${w - i},${h - i} ${i},${h - i}`;\n glyph = svgAttr(svgCreate(\"polygon\"), { points: pts, ...common });\n } else {\n const skew = Math.min(w * 0.26, h * 0.85);\n const pts = `${i + skew},${i} ${w - i},${i} ${w - i - skew},${h - i} ${i},${h - i}`;\n glyph = svgAttr(svgCreate(\"polygon\"), { points: pts, ...common });\n }\n svgAppend(visuals, glyph);\n\n if (el.ttLabel) {\n this.appendLabel(visuals, el.ttLabel, w, h, {\n \"font-size\": FONT.small,\n \"font-weight\": \"600\",\n });\n }\n return glyph;\n }\n\n // --- flow of change ------------------------------------------------------\n\n private drawFlow(visuals: SVGElement, el: TtFlow): SVGElement {\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = FLOW_SPEC.strokeWidth;\n const i = sw / 2;\n const head = Math.min(w * 0.16, h * 1.1);\n const shaft = h * 0.5;\n const top = (h - shaft) / 2;\n const bot = top + shaft;\n const pts = [\n [i, top],\n [w - head, top],\n [w - head, i],\n [w - i, h / 2],\n [w - head, h - i],\n [w - head, bot],\n [i, bot],\n ]\n .map((p) => p.join(\",\"))\n .join(\" \");\n const arrow = svgAttr(svgCreate(\"polygon\"), {\n points: pts,\n fill: \"none\",\n stroke: FLOW_SPEC.stroke,\n \"stroke-width\": sw,\n \"stroke-dasharray\": dashArray(FLOW_SPEC.strokeStyle, sw) || \"6 4\",\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, arrow);\n if (el.ttLabel) {\n this.appendLabel(visuals, el.ttLabel, w - head, h, {\n \"font-size\": FONT.small,\n \"font-weight\": \"650\",\n \"letter-spacing\": \"0.06em\",\n fill: INK_SOFT,\n });\n }\n return arrow;\n }\n\n // --- shared label rendering (wrapped, centred, no halo) ------------------\n\n private appendLabel(visuals: SVGElement, text: string, w: number, h: number, attrs: Attrs): void {\n const fontSize =\n typeof attrs[\"font-size\"] === \"number\" ? (attrs[\"font-size\"] as number) : FONT.label;\n const lines = wrapLabel(text, w - 20, fontSize);\n const lineHeight = fontSize * 1.2;\n const startY = h / 2 - ((lines.length - 1) * lineHeight) / 2;\n lines.forEach((ln, idx) => {\n const t = svgAttr(svgCreate(\"text\"), {\n x: w / 2,\n y: startY + idx * lineHeight,\n \"font-family\": FONT.family,\n \"font-size\": fontSize,\n fill: INK,\n \"text-anchor\": \"middle\",\n \"dominant-baseline\": \"central\",\n ...attrs,\n });\n t.textContent = ln;\n svgAppend(visuals, t);\n });\n }\n}\n\n// --- helpers ---------------------------------------------------------------\n\nfunction octagon(i: number, w: number, h: number, c: number): string {\n return [\n [i + c, i],\n [i + w - c, i],\n [i + w, i + c],\n [i + w, i + h - c],\n [i + w - c, i + h],\n [i + c, i + h],\n [i, i + h - c],\n [i, i + c],\n ]\n .map((p) => p.join(\",\"))\n .join(\" \");\n}\n\n/** Greedy word-wrap into lines that roughly fit `maxWidth` at the font size. */\nfunction wrapLabel(text: string, maxWidth: number, fontSize: number): string[] {\n const maxChars = Math.max(4, Math.floor(maxWidth / (fontSize * 0.58)));\n const words = text.split(/\\s+/).filter(Boolean);\n if (words.length === 0) return [];\n const lines: string[] = [];\n let cur = \"\";\n for (const word of words) {\n const candidate = cur ? `${cur} ${word}` : word;\n if (candidate.length > maxChars && cur) {\n lines.push(cur);\n cur = word;\n } else {\n cur = candidate;\n }\n }\n if (cur) lines.push(cur);\n return lines;\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TeamTopologiesRenderer from \"./TeamTopologiesRenderer.js\";\n\n/** SVG rendering of all Team Topologies element types (BaseRenderer, priority 1500). */\nexport const ttDrawModule: ModuleDeclaration = {\n __init__: [\"ttRenderer\"],\n ttRenderer: [\"type\", TeamTopologiesRenderer],\n};\n\nexport { default as TeamTopologiesRenderer } from \"./TeamTopologiesRenderer.js\";\n","/**\n * Bridges the canonical `TtDocument` into the diagram-js canvas. Everything is a\n * shape; stacking order (back → front) is flows, teams, interactions, so the\n * translucent interaction glyphs read on top of the team boxes they overlay.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport type { TtDocument } from \"@miragon/team-topologies-schema-model\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\nimport { ROOT_ID, type ImportWarning, type RootBusinessObject } from \"./types.js\";\n\ntype RootWithMeta = Root & { businessObject?: RootBusinessObject };\n\nexport default class TtImporter {\n static $inject = [\"canvas\", \"elementFactory\", \"ttElementFactory\", \"eventBus\", \"elementRegistry\"];\n\n constructor(\n private readonly canvas: Canvas,\n private readonly elementFactory: ElementFactory,\n private readonly factory: TtElementFactory,\n private readonly eventBus: EventBus,\n private readonly elementRegistry: ElementRegistry,\n ) {}\n\n import(doc: TtDocument): ImportWarning[] {\n const warnings: ImportWarning[] = [];\n this.eventBus.fire(\"import.render.start\", { document: doc });\n\n let existing: RootWithMeta | undefined;\n try {\n existing = this.canvas.getRootElement() as RootWithMeta;\n } catch {\n existing = undefined;\n }\n let root: RootWithMeta;\n if (existing && existing.id === ROOT_ID) {\n root = existing;\n } else {\n root = this.elementFactory.createRoot({ id: ROOT_ID }) as RootWithMeta;\n this.canvas.setRootElement(root);\n }\n root.businessObject = { title: doc.title };\n\n // Back → front: flows, teams, interactions.\n for (const flow of doc.flows) {\n this.canvas.addShape(this.factory.createFlow(flow), root);\n }\n for (const node of doc.nodes) {\n this.canvas.addShape(this.factory.createTeam(node), root);\n }\n for (const interaction of doc.interactions) {\n this.canvas.addShape(this.factory.createInteraction(interaction), root);\n }\n\n this.eventBus.fire(\"import.render.done\", { warnings });\n return warnings;\n }\n\n /** Removes every element (for re-import). */\n clear(): void {\n for (const el of [...this.elementRegistry.getAll()]) {\n if (el.id === ROOT_ID) continue;\n try {\n this.canvas.removeShape(el.id);\n } catch {\n // already removed — ignore\n }\n }\n }\n}\n","/**\n * Rebuilds a canonical `TtDocument` from the diagram-js runtime model. Position\n * and size truth are the live `x/y/width/height`; editable fields (label, type,\n * mode, colours) are read from the runtime properties.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport { DOCUMENT_VERSION } from \"@miragon/team-topologies-schema-model\";\nimport type {\n FlowShape,\n InteractionShape,\n TeamNode,\n TtDocument,\n} from \"@miragon/team-topologies-schema-model\";\nimport { isTtFlow, isTtInteraction, isTtTeam } from \"../model/di-types.js\";\nimport { ROOT_ID, type RootBusinessObject } from \"./types.js\";\n\nexport default class TtExporter {\n static $inject = [\"elementRegistry\", \"canvas\"];\n\n constructor(\n private readonly elementRegistry: ElementRegistry,\n private readonly canvas: Canvas,\n ) {}\n\n export(): TtDocument {\n let meta: RootBusinessObject | undefined;\n try {\n const root = this.canvas.getRootElement() as Root & {\n businessObject?: RootBusinessObject;\n };\n meta = root.businessObject;\n } catch {\n meta = undefined;\n }\n\n const nodes: TeamNode[] = [];\n const interactions: InteractionShape[] = [];\n const flows: FlowShape[] = [];\n\n for (const el of this.elementRegistry.getAll()) {\n if (el.id === ROOT_ID) continue;\n const geom = el as unknown as { x: number; y: number; width: number; height: number };\n const position = { x: geom.x, y: geom.y };\n const size = { width: geom.width, height: geom.height };\n\n if (isTtTeam(el)) {\n nodes.push({\n id: el.id,\n type: el.teamType,\n label: el.ttLabel ?? \"\",\n position,\n size,\n ...(el.description ? { description: el.description } : {}),\n ...(el.fill ? { fill: el.fill } : {}),\n ...(el.stroke ? { stroke: el.stroke } : {}),\n });\n } else if (isTtInteraction(el)) {\n interactions.push({\n id: el.id,\n mode: el.mode,\n position,\n size,\n ...(el.ttLabel ? { label: el.ttLabel } : {}),\n ...(el.fill ? { fill: el.fill } : {}),\n ...(el.stroke ? { stroke: el.stroke } : {}),\n });\n } else if (isTtFlow(el)) {\n flows.push({\n id: el.id,\n position,\n size,\n ...(el.ttLabel ? { label: el.ttLabel } : {}),\n });\n }\n }\n\n return {\n version: DOCUMENT_VERSION,\n title: meta?.title ?? \"Untitled team topology\",\n nodes,\n interactions,\n flows,\n };\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtImporter from \"./TtImporter.js\";\nimport TtExporter from \"./TtExporter.js\";\n\n/** Document <-> diagram-js bridge (import / export). */\nexport const ioModule: ModuleDeclaration = {\n ttImporter: [\"type\", TtImporter],\n ttExporter: [\"type\", TtExporter],\n};\n\nexport { default as TtImporter } from \"./TtImporter.js\";\nexport { default as TtExporter } from \"./TtExporter.js\";\nexport { saveSVG } from \"./saveSvg.js\";\nexport { ROOT_ID } from \"./types.js\";\nexport type { ImportWarning, RootBusinessObject } from \"./types.js\";\n","import type { ModuleDeclaration } from \"didi\";\nimport { TtBaseViewer } from \"./TtBaseViewer.js\";\nimport { ttModelModule } from \"./model/index.js\";\nimport { ttDrawModule } from \"./draw/index.js\";\nimport { ioModule } from \"./io/index.js\";\n\n/** Read-only renderer: draws a Team Topologies diagram with no interaction. */\nexport class Viewer extends TtBaseViewer {\n protected _getModules(): ModuleDeclaration[] {\n return [ttModelModule, ttDrawModule, ioModule];\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport SelectionModule from \"diagram-js/lib/features/selection\";\nimport ZoomScrollModule from \"diagram-js/lib/navigation/zoomscroll\";\nimport MoveCanvasModule from \"diagram-js/lib/navigation/movecanvas\";\nimport { Viewer } from \"./Viewer.js\";\n\n/** Read-only + navigation: zoom (scroll), pan (drag), selection. */\nexport class NavigatedViewer extends Viewer {\n protected override _getModules(): ModuleDeclaration[] {\n return [...super._getModules(), SelectionModule, ZoomScrollModule, MoveCanvasModule];\n }\n}\n","/**\n * Generic, undo-able command that sets arbitrary Team Topologies properties\n * (ttLabel, teamType, mode, fill, stroke, description). Returns the changed\n * element so the CommandStack fires `elements.changed` → re-render.\n */\n\nimport type { ElementLike } from \"diagram-js/lib/core/Types\";\nimport type CommandHandler from \"diagram-js/lib/command/CommandHandler\";\n\nexport interface UpdatePropertiesContext {\n element: ElementLike & Record<string, unknown>;\n properties: Record<string, unknown>;\n /** set internally by the handler (for revert). */\n oldProperties?: Record<string, unknown>;\n}\n\nfunction setOrDelete(obj: Record<string, unknown>, key: string, value: unknown): void {\n if (value === undefined) delete obj[key];\n else obj[key] = value;\n}\n\nexport default class UpdatePropertiesHandler implements CommandHandler {\n execute(context: UpdatePropertiesContext): ElementLike[] {\n const { element, properties } = context;\n const target = element as unknown as Record<string, unknown>;\n const old: Record<string, unknown> = {};\n for (const key of Object.keys(properties)) {\n old[key] = target[key];\n setOrDelete(target, key, properties[key]);\n }\n context.oldProperties = old;\n return [element];\n }\n\n revert(context: UpdatePropertiesContext): ElementLike[] {\n const { element, oldProperties } = context;\n const target = element as unknown as Record<string, unknown>;\n if (oldProperties) {\n for (const key of Object.keys(oldProperties)) setOrDelete(target, key, oldProperties[key]);\n }\n return [element];\n }\n}\n","/**\n * High-level Team Topologies mutations that go through the command stack\n * (undo/redo). Registers the generic property command handler.\n */\n\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\nimport type { TtElement, TtInteraction, TtTeam } from \"../model/di-types.js\";\nimport UpdatePropertiesHandler from \"./cmd/UpdatePropertiesHandler.js\";\n\nconst UPDATE_PROPERTIES = \"element.updateProperties\";\n\nexport default class TtModeling {\n static $inject = [\"commandStack\"];\n\n constructor(private readonly commandStack: CommandStack) {\n commandStack.registerHandler(UPDATE_PROPERTIES, UpdatePropertiesHandler);\n }\n\n updateProperties(element: TtElement, properties: Record<string, unknown>): void {\n this.commandStack.execute(UPDATE_PROPERTIES, { element, properties });\n }\n\n /** Rename / relabel any element. */\n updateLabel(element: TtElement, label: string): void {\n this.updateProperties(element, { ttLabel: label || undefined });\n }\n\n setTeamType(team: TtTeam, teamType: TeamType): void {\n this.updateProperties(team, { teamType });\n }\n\n setInteractionMode(interaction: TtInteraction, mode: InteractionMode): void {\n this.updateProperties(interaction, { mode });\n }\n\n /** Set or clear per-element colour overrides (`undefined` reverts to default). */\n setColors(\n element: TtTeam | TtInteraction,\n fill: string | undefined,\n stroke: string | undefined,\n ): void {\n this.updateProperties(element, { fill, stroke });\n }\n\n setDescription(team: TtTeam, description: string | undefined): void {\n this.updateProperties(team, { description });\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtModeling from \"./TtModeling.js\";\n\n/** High-level Team Topologies mutations + registration of the command handlers. */\nexport const ttModelingModule: ModuleDeclaration = {\n __init__: [\"ttModeling\"],\n ttModeling: [\"type\", TtModeling],\n};\n\nexport { default as TtModeling } from \"./TtModeling.js\";\n","/**\n * Allowed editing operations. Every Team Topologies element is a free, placed\n * shape — movable, creatable and resizable. There are no connections (the\n * official notation models interactions as overlapping shapes, not lines).\n */\n\nimport RuleProvider from \"diagram-js/lib/features/rules/RuleProvider\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\n\ninterface MoveContext {\n target?: { parent?: unknown } | null;\n}\n\nexport default class TtRules extends RuleProvider {\n static override $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n super(eventBus);\n }\n\n override init(): void {\n this.addRule([\"shape.move\", \"elements.move\"], (context: MoveContext) =>\n context.target && context.target.parent ? null : true,\n );\n this.addRule(\"shape.create\", () => true);\n this.addRule(\"shape.resize\", () => true);\n this.addRule(\"element.copy\", () => true);\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport RulesModule from \"diagram-js/lib/features/rules\";\nimport TtRules from \"./TtRules.js\";\n\n/** Team Topologies editing rules (connect, move, create, resize). */\nexport const ttRulesModule: ModuleDeclaration = {\n __depends__: [RulesModule],\n __init__: [\"ttRules\"],\n ttRules: [\"type\", TtRules],\n};\n\nexport { default as TtRules } from \"./TtRules.js\";\n","/**\n * Keeps the diagram flat: Team Topologies shapes overlap but never nest.\n *\n * diagram-js parents a newly created shape to whatever element it is dropped on\n * (`context.parent` defaults to the drop target). Interaction glyphs are meant\n * to be placed *over* the teams they relate to, so the natural workflow would\n * otherwise nest the interaction inside a team — gluing it so it moves along\n * with the team. Force every created shape onto the diagram root instead.\n *\n * Re-parenting on *move* is prevented separately in TtRules.\n */\n\nimport CommandInterceptor from \"diagram-js/lib/command/CommandInterceptor\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\n\nexport default class TtFlatModelBehavior extends CommandInterceptor {\n static override $inject = [\"eventBus\", \"canvas\"];\n\n constructor(eventBus: EventBus, canvas: Canvas) {\n super(eventBus);\n\n this.preExecute(\n [\"shape.create\", \"elements.create\"],\n (context: { parent?: unknown }) => {\n context.parent = canvas.getRootElement();\n },\n true,\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtFlatModelBehavior from \"./TtFlatModelBehavior.js\";\n\n/** Editing behaviors that keep the Team Topologies model flat (no nesting). */\nexport const ttBehaviorsModule: ModuleDeclaration = {\n __init__: [\"ttFlatModelBehavior\"],\n ttFlatModelBehavior: [\"type\", TtFlatModelBehavior],\n};\n\nexport { default as TtFlatModelBehavior } from \"./TtFlatModelBehavior.js\";\n","/**\n * Tiny inline-SVG glyphs for the palette entries — the same shapes the canvas\n * draws (so the palette is a faithful preview of each team type / interaction\n * mode). Returned as HTML strings for diagram-js palette `html`.\n */\n\nimport {\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n dashArray,\n} from \"@miragon/team-topologies-schema-model\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\n\nfunction svg(inner: string): string {\n return `<svg class=\"tt-palette-svg\" width=\"24\" height=\"24\" viewBox=\"0 0 26 26\" aria-hidden=\"true\">${inner}</svg>`;\n}\n\nexport function teamIconSvg(type: TeamType): string {\n const s = TEAM_TYPE_SPECS[type];\n const dash = dashArray(s.strokeStyle, 1.5);\n const common =\n `fill=\"${s.fill}\" stroke=\"${s.stroke}\" stroke-width=\"1.5\"` +\n (dash ? ` stroke-dasharray=\"${dash}\"` : \"\");\n switch (s.shape) {\n case \"octagon\":\n return svg(`<polygon points=\"8,3 18,3 23,8 23,18 18,23 8,23 3,18 3,8\" ${common}/>`);\n case \"rounded-rect-vertical\":\n return svg(`<rect x=\"8\" y=\"3\" width=\"10\" height=\"20\" rx=\"4\" ${common}/>`);\n case \"rect\":\n return svg(`<rect x=\"3\" y=\"7\" width=\"20\" height=\"12\" rx=\"1.5\" ${common}/>`);\n default:\n return svg(`<rect x=\"3\" y=\"8\" width=\"20\" height=\"10\" rx=\"5\" ${common}/>`);\n }\n}\n\nexport function flowIconSvg(): string {\n return svg(\n `<g fill=\"none\" stroke=\"#6b6459\" stroke-width=\"1.5\" stroke-linejoin=\"round\" stroke-dasharray=\"3 2\">` +\n `<polygon points=\"3,9 16,9 16,5 23,13 16,21 16,17 3,17\"/></g>`,\n );\n}\n\nexport function interactionIconSvg(mode: InteractionMode): string {\n const s = INTERACTION_MODE_SPECS[mode];\n const dash = dashArray(s.strokeStyle, 1.5);\n const common =\n `fill=\"${s.fill}\" fill-opacity=\"${s.opacity}\" stroke=\"${s.stroke}\" stroke-width=\"1.5\"` +\n (dash ? ` stroke-dasharray=\"${dash}\"` : \"\");\n switch (s.shape) {\n case \"circle\":\n return svg(`<circle cx=\"13\" cy=\"13\" r=\"9\" ${common}/>`);\n case \"triangle\":\n return svg(`<polygon points=\"5,6 22,13 5,20\" ${common}/>`);\n default:\n return svg(`<polygon points=\"9,6 23,6 17,20 3,20\" ${common}/>`);\n }\n}\n","/**\n * The floating tool palette (styled top-centre, Excalidraw style). Every entry\n * is drag-to-create: the four team types, the three interaction-mode glyphs\n * (placed over team boundaries), and the flow-of-change arrow.\n */\n\nimport type Palette from \"diagram-js/lib/features/palette/Palette\";\nimport type Create from \"diagram-js/lib/features/create/Create\";\nimport type {\n PaletteEntries,\n default as PaletteProvider,\n} from \"diagram-js/lib/features/palette/PaletteProvider\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\nimport {\n ALL_INTERACTION_SPECS,\n ALL_TEAM_SPECS,\n FLOW_SPEC,\n} from \"@miragon/team-topologies-schema-model\";\nimport { flowIconSvg, interactionIconSvg, teamIconSvg } from \"../draw/palette-icons.js\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\n\nconst GROUP_TEAMS = \"tt-1-teams\";\nconst GROUP_MODES = \"tt-2-modes\";\nconst GROUP_FLOW = \"tt-3-flow\";\n\nfunction entryHtml(icon: string, title: string): string {\n return `<div class=\"entry tt-palette-entry\" draggable=\"true\" title=\"${title}\">${icon}</div>`;\n}\n\nexport default class TtPaletteProvider implements PaletteProvider {\n static $inject = [\"palette\", \"create\", \"ttElementFactory\"];\n\n constructor(\n palette: Palette,\n private readonly create: Create,\n private readonly factory: TtElementFactory,\n ) {\n palette.registerProvider(this);\n }\n\n getPaletteEntries(): PaletteEntries {\n const entries: PaletteEntries = {};\n\n for (const spec of ALL_TEAM_SPECS) {\n const start = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewTeam(spec.type, spec.label) as unknown as Element,\n );\n entries[`team.${spec.type}`] = {\n group: GROUP_TEAMS,\n title: `${spec.label} team — ${spec.description}`,\n html: entryHtml(teamIconSvg(spec.type), `${spec.label} team — ${spec.description}`),\n action: { dragstart: start, click: start },\n };\n }\n\n for (const spec of ALL_INTERACTION_SPECS) {\n const start = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewInteraction(spec.mode) as unknown as Element,\n );\n entries[`mode.${spec.mode}`] = {\n group: GROUP_MODES,\n title: `${spec.label} — ${spec.description} (place over the teams it relates to)`,\n html: entryHtml(interactionIconSvg(spec.mode), `${spec.label} — ${spec.description}`),\n action: { dragstart: start, click: start },\n };\n }\n\n const startFlow = (event: Event) =>\n this.create.start(event as MouseEvent, this.factory.createNewFlow() as unknown as Element);\n entries[\"flow\"] = {\n group: GROUP_FLOW,\n title: `${FLOW_SPEC.label} — the implied left-to-right flow`,\n html: entryHtml(flowIconSvg(), FLOW_SPEC.label),\n action: { dragstart: startFlow, click: startFlow },\n };\n\n return entries;\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport PaletteModule from \"diagram-js/lib/features/palette\";\nimport CreateModule from \"diagram-js/lib/features/create\";\nimport TtPaletteProvider from \"./TtPaletteProvider.js\";\n\n/** Tool palette (drag-to-create teams, pick interaction mode). */\nexport const ttPaletteModule: ModuleDeclaration = {\n __depends__: [PaletteModule, CreateModule],\n __init__: [\"ttPaletteProvider\"],\n ttPaletteProvider: [\"type\", TtPaletteProvider],\n};\n\nexport { default as TtPaletteProvider } from \"./TtPaletteProvider.js\";\n","/**\n * A handful of Material-style icon paths (Apache-2.0) used by the context pad,\n * exposed as HTML markup. Reusable by host chrome too.\n */\n\nexport const ICON_ARROW_FORWARD = \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\";\nexport const ICON_EDIT =\n \"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\";\nexport const ICON_DELETE =\n \"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z\";\nexport const ICON_SWAP = \"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z\";\n\nexport function iconMarkup(path: string, size = 18): string {\n return `<svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"${path}\"/></svg>`;\n}\n","/**\n * Context-pad actions: rename and delete. Every Team Topologies element is a\n * free shape, so the actions are uniform (no connect — interactions are placed,\n * not wired).\n */\n\nimport type ContextPad from \"diagram-js/lib/features/context-pad/ContextPad\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type {\n ContextPadEntries,\n default as ContextPadProvider,\n} from \"diagram-js/lib/features/context-pad/ContextPadProvider\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\nimport { isTtElement } from \"../model/di-types.js\";\nimport type TtLabelEditing from \"../label-editing/TtLabelEditing.js\";\nimport { ICON_DELETE, ICON_EDIT, iconMarkup } from \"../draw/icons.js\";\n\nfunction cpHtml(path: string, title: string): string {\n return `<div class=\"entry tt-cp-entry\" title=\"${title}\">${iconMarkup(path)}</div>`;\n}\n\nexport default class TtContextPadProvider implements ContextPadProvider {\n static $inject = [\"contextPad\", \"modeling\", \"ttLabelEditing\"];\n\n constructor(\n contextPad: ContextPad,\n private readonly modeling: Modeling,\n private readonly labelEditing: TtLabelEditing,\n ) {\n contextPad.registerProvider(this);\n }\n\n getContextPadEntries(element: Element): ContextPadEntries {\n if (!isTtElement(element)) return {};\n return {\n \"edit-label\": {\n group: \"edit\",\n title: \"Rename\",\n html: cpHtml(ICON_EDIT, \"Rename\"),\n action: { click: () => this.labelEditing.activate(element) },\n },\n delete: {\n group: \"edit\",\n title: \"Delete\",\n html: cpHtml(ICON_DELETE, \"Delete\"),\n action: { click: () => this.modeling.removeElements([element]) },\n },\n };\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport ContextPadModule from \"diagram-js/lib/features/context-pad\";\nimport TtContextPadProvider from \"./TtContextPadProvider.js\";\n\n/** Per-element context actions (rename, delete). */\nexport const ttContextPadModule: ModuleDeclaration = {\n __depends__: [ContextPadModule],\n __init__: [\"ttContextPadProvider\"],\n ttContextPadProvider: [\"type\", TtContextPadProvider],\n};\n\nexport { default as TtContextPadProvider } from \"./TtContextPadProvider.js\";\n","/**\n * Inline label editing as an HTML overlay (an <input> centred over the element).\n * Commit goes through `ttModeling.updateLabel` → command stack (undoable).\n * Double-click any element (team / interaction / flow) to (re)label it.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtElement, type TtElement } from \"../model/di-types.js\";\nimport type TtModeling from \"../modeling/TtModeling.js\";\n\ninterface ActiveEdit {\n commit: () => void;\n cleanup: () => void;\n}\n\nexport default class TtLabelEditing {\n static $inject = [\"eventBus\", \"canvas\", \"ttModeling\"];\n\n private active: ActiveEdit | null = null;\n\n constructor(\n eventBus: EventBus,\n private readonly canvas: Canvas,\n private readonly modeling: TtModeling,\n ) {\n eventBus.on(\"element.dblclick\", (event: { element?: unknown }) => {\n if (isTtElement(event.element)) this.activate(event.element);\n });\n // Any click/drag/pan outside the input commits (only Escape discards).\n eventBus.on([\"element.mousedown\", \"drag.init\", \"canvas.viewbox.changing\"], () =>\n this.active?.commit(),\n );\n }\n\n activate(element: TtElement): void {\n this.active?.commit();\n\n const container = this.canvas.getContainer();\n const scale = this.canvas.zoom();\n const vb = this.canvas.viewbox();\n const cx = element.x + element.width / 2;\n const cy = element.y + element.height / 2;\n const width = 170;\n const left = (cx - vb.x) * scale - width / 2;\n const top = (cy - vb.y) * scale - 14;\n\n const input = document.createElement(\"input\");\n input.type = \"text\";\n input.className = \"tt-label-input\";\n input.value = element.ttLabel ?? \"\";\n input.style.position = \"absolute\";\n input.style.left = `${left}px`;\n input.style.top = `${top}px`;\n input.style.width = `${width}px`;\n container.appendChild(input);\n input.focus();\n input.select();\n\n let done = false;\n const cleanup = () => {\n if (done) return;\n done = true;\n input.removeEventListener(\"keydown\", onKey);\n input.removeEventListener(\"blur\", onBlur);\n input.remove();\n this.active = null;\n };\n const commit = () => {\n if (done) return;\n const value = input.value.trim();\n const changed = value !== (element.ttLabel ?? \"\");\n cleanup();\n if (changed) this.modeling.updateLabel(element, value);\n };\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n commit();\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n cleanup();\n }\n };\n const onBlur = () => commit();\n input.addEventListener(\"keydown\", onKey);\n input.addEventListener(\"blur\", onBlur);\n\n this.active = { commit, cleanup };\n }\n\n cancel(): void {\n this.active?.cleanup();\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtLabelEditing from \"./TtLabelEditing.js\";\n\n/** Inline label editing (double-click a team to rename). */\nexport const ttLabelEditingModule: ModuleDeclaration = {\n __init__: [\"ttLabelEditing\"],\n ttLabelEditing: [\"type\", TtLabelEditing],\n};\n\nexport { default as TtLabelEditing } from \"./TtLabelEditing.js\";\n","/**\n * Keyboard shortcuts: undo / redo / delete-selection / copy / paste. Bound to\n * the document so they work without first clicking (focusing) the canvas —\n * typing inside form fields is left untouched. No container `tabindex`, so the\n * canvas never shows a focus ring.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\nimport type Selection from \"diagram-js/lib/features/selection/Selection\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type CopyPaste from \"diagram-js/lib/features/copy-paste/CopyPaste\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\n\nfunction isTypingTarget(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null;\n if (!el) return false;\n return (\n el.tagName === \"INPUT\" ||\n el.tagName === \"TEXTAREA\" ||\n el.tagName === \"SELECT\" ||\n el.isContentEditable\n );\n}\n\nexport default class TtKeyboard {\n static $inject = [\"canvas\", \"commandStack\", \"selection\", \"modeling\", \"copyPaste\"];\n\n constructor(\n canvas: Canvas,\n commandStack: CommandStack,\n selection: Selection,\n modeling: Modeling,\n copyPaste: CopyPaste,\n ) {\n const doc = canvas.getContainer().ownerDocument ?? document;\n\n doc.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (isTypingTarget(e.target)) return;\n const cmd = e.ctrlKey || e.metaKey;\n const key = e.key.toLowerCase();\n\n if (cmd && key === \"z\" && !e.shiftKey) {\n e.preventDefault();\n if (commandStack.canUndo()) commandStack.undo();\n } else if ((cmd && key === \"z\" && e.shiftKey) || (cmd && key === \"y\")) {\n e.preventDefault();\n if (commandStack.canRedo()) commandStack.redo();\n } else if (key === \"delete\" || key === \"backspace\") {\n const sel = selection.get() as Element[];\n if (sel.length) {\n e.preventDefault();\n modeling.removeElements([...sel]);\n }\n } else if (cmd && key === \"c\") {\n const sel = selection.get() as Element[];\n if (sel.length) {\n e.preventDefault();\n copyPaste.copy(sel);\n }\n } else if (cmd && key === \"v\") {\n e.preventDefault();\n copyPaste.paste();\n }\n });\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtKeyboard from \"./TtKeyboard.js\";\n\n/** Undo/redo + delete-selection on the canvas container. */\nexport const ttKeyboardModule: ModuleDeclaration = {\n __init__: [\"ttKeyboard\"],\n ttKeyboard: [\"type\", TtKeyboard],\n};\n\nexport { default as TtKeyboard } from \"./TtKeyboard.js\";\n","/**\n * Copy-paste for Team Topologies shapes, built on the stock diagram-js\n * CopyPaste feature. Only the id handling differs: the stock `createShape`\n * drops the descriptor id and lets diagram-js auto-assign a `shape_N` id, which\n * is the very collision hazard `TtElementFactory` avoids (its counter is not\n * advanced past ids that arrive via import). So we mint a fresh, scheme-correct\n * `team_/int_/flow_` id instead — the custom `tt*` props are already on the\n * descriptor (added by `TtCopyPasteProps`) and pass straight through.\n */\n\nimport CopyPaste from \"diagram-js/lib/features/copy-paste/CopyPaste.js\";\nimport { newId } from \"@miragon/team-topologies-schema-model\";\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type Create from \"diagram-js/lib/features/create/Create\";\nimport type Clipboard from \"diagram-js/lib/features/clipboard/Clipboard\";\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type Mouse from \"diagram-js/lib/features/mouse/Mouse\";\nimport type Rules from \"diagram-js/lib/features/rules/Rules\";\nimport type { Shape } from \"diagram-js/lib/model/Types\";\n\n/** Maps a `ttKind` to the id prefix the model package's factory uses. */\nfunction pasteIdPrefix(ttKind: unknown): string | undefined {\n switch (ttKind) {\n case \"team\":\n return \"team\";\n case \"interaction\":\n return \"int\";\n case \"flow\":\n return \"flow\";\n default:\n return undefined;\n }\n}\n\nexport default class TtCopyPaste extends CopyPaste {\n static override $inject = [\n \"canvas\",\n \"create\",\n \"clipboard\",\n \"elementFactory\",\n \"eventBus\",\n \"modeling\",\n \"mouse\",\n \"rules\",\n ];\n\n constructor(\n canvas: Canvas,\n create: Create,\n clipboard: Clipboard,\n private readonly elementFactory: ElementFactory,\n eventBus: EventBus,\n modeling: Modeling,\n mouse: Mouse,\n rules: Rules,\n ) {\n super(canvas, create, clipboard, elementFactory, eventBus, modeling, mouse, rules);\n }\n\n override createShape(attrs: Record<string, unknown>): Shape {\n const prefix = pasteIdPrefix(attrs.ttKind);\n if (!prefix) {\n return super.createShape(attrs);\n }\n // Keep the id (unlike stock `createShape`, which strips it): a fresh\n // model-style id avoids \"element already exists\" on the next create.\n return this.elementFactory.createShape({ ...attrs, id: newId(prefix) }) as Shape;\n }\n}\n","/**\n * Carries the Team Topologies props across a copy-paste. diagram-js stores each\n * copied element as a plain descriptor whose built-in listener only records\n * geometry (`id/x/y/width/height/…`). Our domain data lives as flat attributes\n * on the shape (not a moddle businessObject), so without this the pasted copy\n * would lose its type, label, description and colours. This listener copies\n * those fields onto the descriptor; they then flow through to the new shape.\n */\n\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtElement } from \"../model/di-types.js\";\n\n/** Flat props that define a Team Topologies shape, beyond geometry. */\nconst TT_PROPS = [\n \"ttKind\",\n \"teamType\",\n \"mode\",\n \"ttLabel\",\n \"description\",\n \"fill\",\n \"stroke\",\n] as const;\n\nexport default class TtCopyPasteProps {\n static $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n eventBus.on(\n \"copyPaste.copyElement\",\n (event: { descriptor: Record<string, unknown>; element: unknown }) => {\n const { descriptor, element } = event;\n if (!isTtElement(element)) return;\n const source = element as Record<string, unknown>;\n for (const prop of TT_PROPS) {\n if (source[prop] !== undefined) descriptor[prop] = source[prop];\n }\n },\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport CopyPasteModule from \"diagram-js/lib/features/copy-paste\";\nimport TtCopyPaste from \"./TtCopyPaste.js\";\nimport TtCopyPasteProps from \"./TtCopyPasteProps.js\";\n\n/**\n * Copy-paste of Team Topologies shapes: the stock diagram-js feature (clipboard,\n * cursor-follow placement) with `copyPaste` overridden to mint model-style ids\n * and a listener that preserves the flat `tt*` props across the round-trip.\n */\nexport const ttCopyPasteModule: ModuleDeclaration = {\n __depends__: [CopyPasteModule],\n __init__: [\"ttCopyPasteProps\"],\n copyPaste: [\"type\", TtCopyPaste],\n ttCopyPasteProps: [\"type\", TtCopyPasteProps],\n};\n\nexport { default as TtCopyPaste } from \"./TtCopyPaste.js\";\n","/**\n * Enforces a fixed stacking order regardless of creation order, by reordering\n * the element graphics within the canvas layer. Back → front:\n *\n * flow < stream-aligned / platform < complicated-subsystem < enabling < interactions\n *\n * So interaction glyphs always read on top; enabling teams sit above the\n * complicated-subsystem teams, which in turn sit above the stream-aligned /\n * platform base teams they overlap.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport {\n isTtElement,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtElement,\n} from \"../model/di-types.js\";\n\n/** Lower = further back. */\nfunction tier(el: TtElement): number {\n if (isTtFlow(el)) return 0;\n if (isTtTeam(el)) {\n if (el.teamType === \"enabling\") return 3;\n if (el.teamType === \"complicated-subsystem\") return 2;\n return 1; // stream-aligned, platform\n }\n if (isTtInteraction(el)) return 4;\n return 1;\n}\n\nexport default class TtZOrder {\n static $inject = [\"eventBus\", \"canvas\", \"elementRegistry\"];\n\n private importing = false;\n\n constructor(\n eventBus: EventBus,\n private readonly canvas: Canvas,\n private readonly elementRegistry: ElementRegistry,\n ) {\n eventBus.on(\"import.render.start\", () => {\n this.importing = true;\n });\n eventBus.on(\"import.render.done\", () => {\n this.importing = false;\n this.reorder();\n });\n // Covers create + team-type changes (and harmlessly re-runs on move/resize).\n eventBus.on(\"commandStack.changed\", () => {\n if (!this.importing) this.reorder();\n });\n }\n\n /** Re-append each element's graphics group in ascending tier order (back → front). */\n reorder(): void {\n const ordered = (this.elementRegistry.getAll().filter(isTtElement) as TtElement[]).sort(\n (a, b) => tier(a) - tier(b),\n );\n for (const el of ordered) {\n const gfx = this.canvas.getGraphics(el) as SVGElement | undefined;\n const wrapper = gfx?.parentNode as (Node & ChildNode) | null;\n const layer = wrapper?.parentNode as (Node & { appendChild(n: Node): Node }) | null;\n if (wrapper && layer) layer.appendChild(wrapper);\n }\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtZOrder from \"./TtZOrder.js\";\n\n/** Keeps the fixed stacking order (interactions on top, base teams at the back). */\nexport const ttZOrderModule: ModuleDeclaration = {\n __init__: [\"ttZOrder\"],\n ttZOrder: [\"type\", TtZOrder],\n};\n\nexport { default as TtZOrder } from \"./TtZOrder.js\";\n","import type { ModuleDeclaration } from \"didi\";\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\n\nimport ModelingModule from \"diagram-js/lib/features/modeling\";\nimport MoveModule from \"diagram-js/lib/features/move\";\nimport OutlineModule from \"diagram-js/lib/features/outline\";\nimport ResizeModule from \"diagram-js/lib/features/resize\";\n\nimport { NavigatedViewer } from \"./NavigatedViewer.js\";\nimport { ttModelingModule } from \"./modeling/index.js\";\nimport { ttRulesModule } from \"./rules/index.js\";\nimport { ttBehaviorsModule } from \"./behaviors/index.js\";\nimport { ttPaletteModule } from \"./palette/index.js\";\nimport { ttContextPadModule } from \"./context-pad/index.js\";\nimport { ttLabelEditingModule } from \"./label-editing/index.js\";\nimport { ttKeyboardModule } from \"./keyboard/index.js\";\nimport { ttCopyPasteModule } from \"./copy-paste/index.js\";\nimport { ttZOrderModule } from \"./zorder/index.js\";\n\n/**\n * Full Team Topologies editor: palette/create, move, resize, connect with\n * rules, context pad, inline label editing, undo/redo.\n */\nexport class Modeler extends NavigatedViewer {\n protected override _getModules(): ModuleDeclaration[] {\n return [\n ...super._getModules(),\n // diagram-js stock\n ModelingModule,\n MoveModule,\n OutlineModule,\n ResizeModule,\n // Team Topologies editor\n ttModelingModule,\n ttRulesModule,\n ttBehaviorsModule,\n ttPaletteModule,\n ttContextPadModule,\n ttLabelEditingModule,\n ttKeyboardModule,\n ttCopyPasteModule,\n ttZOrderModule,\n ];\n }\n\n undo(): void {\n this.get<CommandStack>(\"commandStack\").undo();\n }\n\n redo(): void {\n this.get<CommandStack>(\"commandStack\").redo();\n }\n\n canUndo(): boolean {\n return this.get<CommandStack>(\"commandStack\").canUndo();\n }\n\n canRedo(): boolean {\n return this.get<CommandStack>(\"commandStack\").canRedo();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;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Y,CAAO;EACjD;CACF;AACF,GCjEa,KAAoC;CAC/C,UAAU,CAAC,UAAU;CACrB,UAAU,CAAC,QAAQ,EAAQ;AAC7B,GCgBa,KAAb,cAA6B,EAAgB;CAC3C,cAAsD;EACpD,OAAO;GACL,GAAG,MAAM,YAAY;GAErB;GACA;GACA;GACA;GAEA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CAEA,OAAa;EACX,KAAK,IAAkB,cAAc,CAAC,CAAC,KAAK;CAC9C;CAEA,OAAa;EACX,KAAK,IAAkB,cAAc,CAAC,CAAC,KAAK;CAC9C;CAEA,UAAmB;EACjB,OAAO,KAAK,IAAkB,cAAc,CAAC,CAAC,QAAQ;CACxD;CAEA,UAAmB;EACjB,OAAO,KAAK,IAAkB,cAAc,CAAC,CAAC,QAAQ;CACxD;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/model/di-types.ts","../src/io/saveSvg.ts","../src/io/types.ts","../src/TtBaseViewer.ts","../src/model/TtElementFactory.ts","../src/model/index.ts","../src/theme/palette.ts","../src/draw/styles.ts","../src/draw/TeamTopologiesRenderer.ts","../src/draw/index.ts","../src/io/TtImporter.ts","../src/io/TtExporter.ts","../src/io/index.ts","../src/Viewer.ts","../src/NavigatedViewer.ts","../src/modeling/cmd/UpdatePropertiesHandler.ts","../src/modeling/TtModeling.ts","../src/modeling/index.ts","../src/rules/TtRules.ts","../src/rules/index.ts","../src/behaviors/TtFlatModelBehavior.ts","../src/behaviors/index.ts","../src/draw/palette-icons.ts","../src/palette/TtPaletteProvider.ts","../src/palette/index.ts","../src/draw/icons.ts","../src/context-pad/TtContextPadProvider.ts","../src/context-pad/index.ts","../src/label-editing/TtLabelEditing.ts","../src/label-editing/index.ts","../src/keyboard/TtKeyboard.ts","../src/keyboard/index.ts","../src/copy-paste/TtCopyPaste.ts","../src/copy-paste/TtCopyPasteProps.ts","../src/copy-paste/index.ts","../src/zorder/TtZOrder.ts","../src/zorder/index.ts","../src/Modeler.ts"],"sourcesContent":["/**\n * diagram-js runtime model for the Team Topologies notation. Every element is a\n * placed, resizable SHAPE discriminated by `ttKind`:\n * - `team` — one of the four team types (label inside the box)\n * - `interaction` — a mode glyph (parallelogram / triangle / circle), 50%\n * transparent, overlaid on the boundary between teams\n * - `flow` — the \"flow of change\" arrow guide\n *\n * These runtime properties are the source of truth while editing; the exporter\n * rebuilds the canonical `TtDocument` from them.\n */\n\nimport type { Shape } from \"diagram-js/lib/model/Types\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\n\nexport type TtKind = \"team\" | \"interaction\" | \"flow\";\n\nexport interface TtTeam extends Shape {\n ttKind: \"team\";\n teamType: TeamType;\n /** Display name (separate from diagram-js `label`). */\n ttLabel?: string;\n description?: string;\n fill?: string;\n stroke?: string;\n}\n\nexport interface TtInteraction extends Shape {\n ttKind: \"interaction\";\n mode: InteractionMode;\n ttLabel?: string;\n fill?: string;\n stroke?: string;\n}\n\nexport interface TtFlow extends Shape {\n ttKind: \"flow\";\n ttLabel?: string;\n}\n\nexport type TtElement = TtTeam | TtInteraction | TtFlow;\n\nfunction kindOf(el: unknown): string | undefined {\n return typeof el === \"object\" && el !== null\n ? ((el as { ttKind?: unknown }).ttKind as string | undefined)\n : undefined;\n}\n\nexport function isTtElement(el: unknown): el is TtElement {\n return typeof kindOf(el) === \"string\";\n}\n\nexport function isTtTeam(el: unknown): el is TtTeam {\n return kindOf(el) === \"team\";\n}\n\nexport function isTtInteraction(el: unknown): el is TtInteraction {\n return kindOf(el) === \"interaction\";\n}\n\nexport function isTtFlow(el: unknown): el is TtFlow {\n return kindOf(el) === \"flow\";\n}\n","/**\n * Serialises the current canvas into a standalone SVG (snapshot / export),\n * fitted to the content bounds and independent of the current zoom / scroll.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport { isTtElement } from \"../model/di-types.js\";\n\nconst MARGIN = 40;\n\nexport function saveSVG(canvas: Canvas, elementRegistry: ElementRegistry): { svg: string } {\n const container = canvas.getContainer();\n const source = container.querySelector(\"svg\");\n if (!source) throw new Error(\"No SVG found in the canvas container.\");\n\n // Content bounds from the team shapes (interactions sit between them).\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const el of elementRegistry.getAll()) {\n if (!isTtElement(el)) continue;\n const s = el as unknown as { x: number; y: number; width: number; height: number };\n minX = Math.min(minX, s.x);\n minY = Math.min(minY, s.y);\n maxX = Math.max(maxX, s.x + s.width);\n maxY = Math.max(maxY, s.y + s.height);\n }\n if (!Number.isFinite(minX)) {\n minX = 0;\n minY = 0;\n maxX = 100;\n maxY = 100;\n }\n\n const x = minX - MARGIN;\n const y = minY - MARGIN;\n const width = maxX - minX + MARGIN * 2;\n const height = maxY - minY + MARGIN * 2;\n\n const clone = source.cloneNode(true) as SVGSVGElement;\n clone.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n clone.setAttribute(\"viewBox\", `${x} ${y} ${width} ${height}`);\n clone.setAttribute(\"width\", String(Math.round(width)));\n clone.setAttribute(\"height\", String(Math.round(height)));\n\n // Neutralise pan/zoom: let the viewBox (above) drive the geometry.\n const viewport = clone.querySelector<SVGGElement>(\".viewport\");\n if (viewport) viewport.removeAttribute(\"transform\");\n\n const svg = new XMLSerializer().serializeToString(clone);\n return { svg: '<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n' + svg };\n}\n","/** ID of the diagram-js root element holding the Team Topologies diagram. */\nexport const ROOT_ID = \"tt-root\";\n\nexport interface ImportWarning {\n readonly message: string;\n readonly elementId?: string;\n}\n\n/** Diagram-level metadata stashed on the root element. */\nexport interface RootBusinessObject {\n title: string;\n}\n","/**\n * Shared lifecycle & DI bootstrap for every Team Topologies viewer. Subclasses\n * only override `_getModules()`. The renderer\n * is framework-agnostic — mount it into any element (e.g. a VS Code webview).\n */\n\nimport Diagram from \"diagram-js/lib/Diagram\";\nimport type { ModuleDeclaration } from \"didi\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport type { TtDocument } from \"@miragon/team-topologies-schema-model\";\nimport { saveSVG } from \"./io/saveSvg.js\";\nimport type TtImporter from \"./io/TtImporter.js\";\nimport type TtExporter from \"./io/TtExporter.js\";\nimport { ROOT_ID, type ImportWarning, type RootBusinessObject } from \"./io/types.js\";\n\nexport interface TtViewerOptions {\n /** Host element. When absent, a detached <div> is created (attach later). */\n container?: HTMLElement;\n width?: number | string;\n height?: number | string;\n /** Appended to the module list (extension point). */\n additionalModules?: ModuleDeclaration[];\n}\n\nexport type EventCallback<T = unknown> = (event: T) => void;\n\ntype RootWithMeta = Root & { businessObject?: RootBusinessObject };\n\nfunction sizeToCss(value: number | string): string {\n return typeof value === \"number\" ? `${value}px` : value;\n}\n\nexport abstract class TtBaseViewer {\n protected abstract _getModules(): ModuleDeclaration[];\n\n private _diagram: Diagram | undefined;\n private readonly _container: HTMLElement;\n private readonly _options: TtViewerOptions;\n\n constructor(options: TtViewerOptions = {}) {\n this._options = options;\n this._container = this._createContainer(options);\n }\n\n private _createContainer(options: TtViewerOptions): HTMLElement {\n const container = options.container ?? document.createElement(\"div\");\n container.classList.add(\"tt-djs-container\");\n container.style.width = sizeToCss(options.width ?? \"100%\");\n container.style.height = sizeToCss(options.height ?? (options.container ? \"100%\" : \"600px\"));\n return container;\n }\n\n private _ensureDiagram(): Diagram {\n if (!this._diagram) {\n const modules = [...this._getModules(), ...(this._options.additionalModules ?? [])];\n this._diagram = new Diagram({ canvas: { container: this._container }, modules });\n }\n return this._diagram;\n }\n\n /** Resolve a diagram-js service from the didi injector. */\n get<T>(name: string): T {\n return this._ensureDiagram().get<T>(name);\n }\n\n on<T = unknown>(event: string, callback: EventCallback<T>, priority = 1000): void {\n this.get<EventBus>(\"eventBus\").on(event, priority, callback as EventCallback);\n }\n\n off(event: string, callback: EventCallback): void {\n this.get<EventBus>(\"eventBus\").off(event, callback);\n }\n\n /** Load a document into the canvas (replaces existing content). */\n importDocument(doc: TtDocument): { warnings: ImportWarning[] } {\n const diagram = this._ensureDiagram();\n const eventBus = diagram.get<EventBus>(\"eventBus\");\n const importer = diagram.get<TtImporter>(\"ttImporter\");\n importer.clear();\n const warnings = importer.import(doc);\n this._fit();\n eventBus.fire(\"import.done\", { warnings });\n return { warnings };\n }\n\n /** Current canvas state as a canonical document. */\n exportDocument(): TtDocument {\n return this.get<TtExporter>(\"ttExporter\").export();\n }\n\n /** Update diagram-level metadata (title / flow-of-change) on the root. */\n setMeta(partial: Partial<RootBusinessObject>): void {\n const canvas = this.get<Canvas>(\"canvas\");\n let root: RootWithMeta | undefined;\n try {\n root = canvas.getRootElement() as RootWithMeta;\n } catch {\n return;\n }\n if (!root || root.id !== ROOT_ID) return;\n const current = root.businessObject ?? { title: \"Untitled team topology\" };\n root.businessObject = { ...current, ...partial };\n }\n\n /** Read diagram-level metadata (title / flow-of-change) from the root. */\n getMeta(): RootBusinessObject | undefined {\n try {\n const root = this.get<Canvas>(\"canvas\").getRootElement() as RootWithMeta;\n return root.businessObject;\n } catch {\n return undefined;\n }\n }\n\n /** Standalone, self-contained SVG snapshot. */\n saveSVG(): { svg: string } {\n return saveSVG(this.get<Canvas>(\"canvas\"), this.get<ElementRegistry>(\"elementRegistry\"));\n }\n\n /** Fit the content into the viewport, leaving room at the top for the palette. */\n private _fit(topInset = 84, pad = 56): void {\n const canvas = this.get<Canvas>(\"canvas\");\n const registry = this.get<ElementRegistry>(\"elementRegistry\");\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const el of registry.getAll()) {\n const e = el as { x?: number; y?: number; width?: number; height?: number };\n if (\n typeof e.x !== \"number\" ||\n typeof e.y !== \"number\" ||\n typeof e.width !== \"number\" ||\n typeof e.height !== \"number\"\n ) {\n continue;\n }\n minX = Math.min(minX, e.x);\n minY = Math.min(minY, e.y);\n maxX = Math.max(maxX, e.x + e.width);\n maxY = Math.max(maxY, e.y + e.height);\n }\n if (!Number.isFinite(minX)) return;\n\n const rect = this._container.getBoundingClientRect();\n const W = rect.width;\n const H = rect.height;\n const cw = Math.max(maxX - minX, 1);\n const ch = Math.max(maxY - minY, 1);\n if (!W || !H) {\n canvas.zoom(\"fit-viewport\");\n return;\n }\n const s = Math.min((W - 2 * pad) / cw, (H - topInset - pad) / ch, 1.25);\n canvas.viewbox({\n x: minX + cw / 2 - W / 2 / s,\n y: minY - topInset / s,\n width: W / s,\n height: H / s,\n });\n }\n\n /** Attach the container into `target`. */\n attachTo(target: HTMLElement): void {\n target.appendChild(this._container);\n this.get<Canvas>(\"canvas\").resized();\n }\n\n /** Detach the container from the DOM, preserving state. */\n detach(): void {\n this._container.remove();\n }\n\n clear(): void {\n this._ensureDiagram().clear();\n }\n\n destroy(): void {\n if (this._diagram) {\n this._diagram.destroy();\n this._diagram = undefined;\n }\n this._container.remove();\n }\n\n get container(): HTMLElement {\n return this._container;\n }\n}\n","/**\n * Creates diagram-js runtime shapes carrying Team Topologies markers, from\n * canonical document elements (import) or from scratch (palette drag-to-create).\n * Everything is a shape — teams, interaction glyphs and the flow arrow.\n */\n\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport {\n FLOW_SPEC,\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n newId,\n} from \"@miragon/team-topologies-schema-model\";\nimport type {\n FlowShape,\n InteractionMode,\n InteractionShape,\n TeamNode,\n TeamType,\n} from \"@miragon/team-topologies-schema-model\";\nimport type { TtFlow, TtInteraction, TtTeam } from \"./di-types.js\";\n\nexport default class TtElementFactory {\n static $inject = [\"elementFactory\"];\n\n constructor(private readonly elementFactory: ElementFactory) {}\n\n // --- from canonical document elements (import) -------------------------\n\n createTeam(node: TeamNode): TtTeam {\n return this.elementFactory.createShape({\n id: node.id,\n x: node.position.x,\n y: node.position.y,\n width: node.size.width,\n height: node.size.height,\n ttKind: \"team\",\n teamType: node.type,\n ttLabel: node.label,\n ...(node.description ? { description: node.description } : {}),\n ...(node.fill ? { fill: node.fill } : {}),\n ...(node.stroke ? { stroke: node.stroke } : {}),\n } as Partial<TtTeam>) as unknown as TtTeam;\n }\n\n createInteraction(shape: InteractionShape): TtInteraction {\n return this.elementFactory.createShape({\n id: shape.id,\n x: shape.position.x,\n y: shape.position.y,\n width: shape.size.width,\n height: shape.size.height,\n ttKind: \"interaction\",\n mode: shape.mode,\n ...(shape.label ? { ttLabel: shape.label } : {}),\n ...(shape.fill ? { fill: shape.fill } : {}),\n ...(shape.stroke ? { stroke: shape.stroke } : {}),\n } as Partial<TtInteraction>) as unknown as TtInteraction;\n }\n\n createFlow(shape: FlowShape): TtFlow {\n return this.elementFactory.createShape({\n id: shape.id,\n x: shape.position.x,\n y: shape.position.y,\n width: shape.size.width,\n height: shape.size.height,\n ttKind: \"flow\",\n ...(shape.label ? { ttLabel: shape.label } : {}),\n } as Partial<TtFlow>) as unknown as TtFlow;\n }\n\n // --- fresh, not-yet-placed shapes (palette / context-pad create) -------\n //\n // These set an explicit model-style id (`team_…`/`int_…`/`flow_…`, matching\n // the model package's factory). We must NOT fall back to diagram-js' own\n // auto-id: its counter starts at `shape_12` and is not advanced past ids that\n // come in via import, so a re-imported `shape_N` (an element created in a\n // previous session, then autosaved) collides with the next palette create —\n // the first placement after a reload then throws \"element already exists\".\n\n createNewTeam(type: TeamType, label?: string): TtTeam {\n const spec = TEAM_TYPE_SPECS[type];\n return this.elementFactory.createShape({\n id: newId(\"team\"),\n width: spec.defaultSize.width,\n height: spec.defaultSize.height,\n ttKind: \"team\",\n teamType: type,\n ttLabel: label ?? spec.label,\n } as Partial<TtTeam>) as unknown as TtTeam;\n }\n\n createNewInteraction(mode: InteractionMode): TtInteraction {\n const spec = INTERACTION_MODE_SPECS[mode];\n return this.elementFactory.createShape({\n id: newId(\"int\"),\n width: spec.defaultSize.width,\n height: spec.defaultSize.height,\n ttKind: \"interaction\",\n mode,\n } as Partial<TtInteraction>) as unknown as TtInteraction;\n }\n\n createNewFlow(): TtFlow {\n return this.elementFactory.createShape({\n id: newId(\"flow\"),\n width: FLOW_SPEC.defaultSize.width,\n height: FLOW_SPEC.defaultSize.height,\n ttKind: \"flow\",\n ttLabel: FLOW_SPEC.label,\n } as Partial<TtFlow>) as unknown as TtFlow;\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtElementFactory from \"./TtElementFactory.js\";\n\n/** Element factory with Team Topologies defaults. */\nexport const ttModelModule: ModuleDeclaration = {\n ttElementFactory: [\"type\", TtElementFactory],\n};\n\nexport { default as TtElementFactory } from \"./TtElementFactory.js\";\nexport * from \"./di-types.js\";\n","/**\n * Miragon design tokens — the single source of truth for every non-notation colour in the renderer.\n *\n * Values mirror the Miragon corporate identity: the `miragon-brand:modeler-tool-design` skill in\n * `Miragon/corporate-identity`, whose vendored `cd-tokens.generated.css` (next to this file) defines\n * the `--cd-*` custom properties, generated from `brand/tokens.json`. Re-copy that CSS from the skill\n * to update; never fork the hex values by hand. `test/theme.sync.test.ts` fails if this mirror drifts\n * from the vendored CSS.\n *\n * Pure data — no DOM, no imports — so it stays inside the P1 DOM-free discipline and can be consumed\n * by the SVG-drawing constants in `draw/styles.ts`.\n *\n * Brand rule: blue leads (`blau` — surfaces, buttons, links, selection), green accents (`gruen` — key\n * visual, highlights; a fill, never body text on white). The four Team Topologies team-type and\n * interaction colours are the official notation and live in `schema-model/notation.ts` — they are NOT\n * part of this brand ramp.\n */\n\n/** Raw Miragon brand ramp + functional layer — exact `--cd-*` values. */\nexport const MIRAGON = {\n /** Primary: surfaces, buttons, links, selection, backgrounds. */\n blau: \"#335DE5\",\n /** Deeper blue for links / accent text on white (WCAG AA, ~5.5:1). */\n blauLink: \"#2B50D4\",\n /** Lightened blue for accents on dark surfaces (unused here — the canvas is light-only). */\n blauHell: \"#6B8AFF\",\n /** Accent: key visual, highlights, the brand gradient. Bright — a fill, never text on white. */\n gruen: \"#00E676\",\n /** Calm neutral surface (warm off-white) — the paper surround. */\n grau: \"#F9F7F7\",\n /** Text on light; not pure black. */\n schwarz: \"#1D1D1D\",\n weiss: \"#FFFFFF\",\n /** Functional / status layer (own layer beside the brand palette; AA as text on white). */\n success: \"#0B7A55\",\n warning: \"#92610A\",\n danger: \"#C92A2A\",\n info: \"#2B50D4\",\n /** Signature brand gradient — brand moments only. Use verbatim. */\n gradientBrand: \"linear-gradient(120deg, #335DE5 30%, #00E676)\",\n} as const;\n\n/**\n * Every `--cd-*` token this repo depends on, mapped to the value it MUST hold. The drift test parses\n * `cd-tokens.generated.css` and asserts each entry matches, so re-copying the vendored CSS with a\n * changed value fails CI until this mirror (and `MIRAGON`) is updated too.\n */\nexport const CD_TOKENS: Record<string, string> = {\n \"--cd-blau\": MIRAGON.blau,\n \"--cd-gruen\": MIRAGON.gruen,\n \"--cd-grau\": MIRAGON.grau,\n \"--cd-schwarz\": MIRAGON.schwarz,\n \"--cd-weiss\": MIRAGON.weiss,\n \"--cd-blau-link\": MIRAGON.blauLink,\n \"--cd-blau-hell\": MIRAGON.blauHell,\n \"--cd-success\": MIRAGON.success,\n \"--cd-success-soft\": \"rgba(11, 122, 85, 0.12)\",\n \"--cd-warning\": MIRAGON.warning,\n \"--cd-warning-soft\": \"rgba(146, 97, 10, 0.12)\",\n \"--cd-danger\": MIRAGON.danger,\n \"--cd-danger-soft\": \"rgba(201, 42, 42, 0.12)\",\n \"--cd-info\": MIRAGON.info,\n \"--cd-info-soft\": \"rgba(43, 80, 212, 0.12)\",\n \"--cd-gradient-brand\": MIRAGON.gradientBrand,\n};\n","/**\n * Shared rendering constants (typography, accent, priorities) — Miragon corporate identity.\n * Colours are derived from the single source of truth in `theme/palette.ts` (`MIRAGON`), which\n * mirrors the vendored `--cd-*` brand tokens.\n */\n\nimport { MIRAGON } from \"../theme/index.js\";\n\n/** BaseRenderer default priority is 1000; 1500 wins the render.shape/connection event. */\nexport const TT_RENDER_PRIORITY = 1500;\n\n/** Selection / hover accent (Miragon blue — kept in sync with the app theme via the shared palette). */\nexport const ACCENT = MIRAGON.blau;\n\nexport const INK = MIRAGON.schwarz;\nexport const INK_SOFT = \"#5B5B5B\";\n\nexport const FONT = {\n /**\n * Set directly as the `font-family` attribute on every SVG <text> (canvas\n * labels and therefore the SVG export too) — not inherited from a CSS\n * container. Prefers the self-hosted Miragon typeface Geist (registered as\n * 'Geist Variable' by @fontsource-variable/geist, with 'Geist' as a fallback\n * name), and falls back to a system sans when the host hasn't loaded it (e.g.\n * an exported SVG opened standalone).\n */\n family:\n \"'Geist Variable', 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif\",\n label: 13.5,\n small: 11,\n} as const;\n\n/** Paper colour used for the label halo so text stays legible over lines. */\nexport const PAPER = MIRAGON.weiss;\n","/**\n * SVG rendering of the Team Topologies notation (BaseRenderer subclass).\n * Everything is a placed shape:\n * - teams: SOLID resizable boxes (label wrapped inside), distinguished by shape\n * as well as colour;\n * - interactions: DASHED, 50%-transparent glyphs (collaboration = parallelogram,\n * x-as-a-service = triangle, facilitating = circle) laid over team boundaries;\n * - flow: a dashed \"flow of change\" arrow.\n *\n * Colours/shapes come from the single notation source (`@miragon/team-topologies-schema-model`).\n */\n\nimport BaseRenderer from \"diagram-js/lib/draw/BaseRenderer\";\nimport { append as svgAppend, create as svgCreate, attr as svgAttr } from \"tiny-svg\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { ElementLike, ShapeLike } from \"diagram-js/lib/model/Types\";\nimport {\n FLOW_SPEC,\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n dashArray,\n} from \"@miragon/team-topologies-schema-model\";\nimport { FONT, INK, INK_SOFT } from \"./styles.js\";\nimport { TT_RENDER_PRIORITY } from \"./styles.js\";\nimport {\n isTtElement,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtFlow,\n type TtInteraction,\n type TtTeam,\n} from \"../model/di-types.js\";\n\ntype Attrs = Record<string, string | number>;\n\nexport default class TeamTopologiesRenderer extends BaseRenderer {\n static $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n super(eventBus, TT_RENDER_PRIORITY);\n }\n\n override canRender(element: ElementLike): boolean {\n return isTtElement(element);\n }\n\n override drawShape(visuals: SVGElement, element: ShapeLike): SVGElement {\n if (isTtTeam(element)) return this.drawTeam(visuals, element);\n if (isTtInteraction(element)) return this.drawInteraction(visuals, element);\n if (isTtFlow(element)) return this.drawFlow(visuals, element);\n const rect = svgAttr(svgCreate(\"rect\"), {\n width: element.width,\n height: element.height,\n fill: \"#eee\",\n });\n svgAppend(visuals, rect);\n return rect;\n }\n\n override getShapePath(shape: ShapeLike): string {\n const { x, y, width, height } = shape;\n return `M${x},${y}l${width},0l0,${height}l${-width},0z`;\n }\n\n // --- teams ---------------------------------------------------------------\n\n private drawTeam(visuals: SVGElement, team: TtTeam): SVGElement {\n const spec = TEAM_TYPE_SPECS[team.teamType] ?? TEAM_TYPE_SPECS[\"stream-aligned\"];\n const w = Math.max(team.width, 1);\n const h = Math.max(team.height, 1);\n const sw = spec.strokeWidth;\n const dash = dashArray(spec.strokeStyle, sw);\n const outline = this.teamOutline(spec.shape, w, h, sw, {\n fill: team.fill ?? spec.fill,\n stroke: team.stroke ?? spec.stroke,\n \"stroke-width\": sw,\n ...(dash ? { \"stroke-dasharray\": dash } : {}),\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, outline);\n this.appendLabel(visuals, team.ttLabel ?? \"\", w, h, { \"font-weight\": \"640\" });\n return outline;\n }\n\n private teamOutline(kind: string, w: number, h: number, sw: number, attrs: Attrs): SVGElement {\n const i = sw / 2;\n const iw = w - sw;\n const ih = h - sw;\n if (kind === \"octagon\") {\n const c = Math.min(iw, ih) * 0.29;\n return svgAttr(svgCreate(\"polygon\"), { points: octagon(i, iw, ih, c), ...attrs });\n }\n const rx = kind === \"rect\" ? 4 : Math.min(20, ih / 2, iw / 2);\n return svgAttr(svgCreate(\"rect\"), { x: i, y: i, width: iw, height: ih, rx, ry: rx, ...attrs });\n }\n\n // --- interactions --------------------------------------------------------\n\n private drawInteraction(visuals: SVGElement, el: TtInteraction): SVGElement {\n const spec = INTERACTION_MODE_SPECS[el.mode] ?? INTERACTION_MODE_SPECS.collaboration;\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = 2;\n const i = sw / 2;\n const common: Attrs = {\n fill: el.fill ?? spec.fill,\n \"fill-opacity\": spec.opacity,\n stroke: el.stroke ?? spec.stroke,\n \"stroke-width\": sw,\n \"stroke-dasharray\": dashArray(spec.strokeStyle, sw) || \"6 4\",\n \"stroke-linejoin\": \"round\",\n };\n\n let glyph: SVGElement;\n if (spec.shape === \"circle\") {\n glyph = svgAttr(svgCreate(\"ellipse\"), {\n cx: w / 2,\n cy: h / 2,\n rx: (w - sw) / 2,\n ry: (h - sw) / 2,\n ...common,\n });\n } else if (spec.shape === \"triangle\") {\n // Point up — the tip indicates the direction the service is provided.\n const pts = `${w / 2},${i} ${w - i},${h - i} ${i},${h - i}`;\n glyph = svgAttr(svgCreate(\"polygon\"), { points: pts, ...common });\n } else {\n const skew = Math.min(w * 0.26, h * 0.85);\n const pts = `${i + skew},${i} ${w - i},${i} ${w - i - skew},${h - i} ${i},${h - i}`;\n glyph = svgAttr(svgCreate(\"polygon\"), { points: pts, ...common });\n }\n svgAppend(visuals, glyph);\n\n if (el.ttLabel) {\n this.appendLabel(visuals, el.ttLabel, w, h, {\n \"font-size\": FONT.small,\n \"font-weight\": \"600\",\n });\n }\n return glyph;\n }\n\n // --- flow of change ------------------------------------------------------\n\n private drawFlow(visuals: SVGElement, el: TtFlow): SVGElement {\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = FLOW_SPEC.strokeWidth;\n const i = sw / 2;\n const head = Math.min(w * 0.16, h * 1.1);\n const shaft = h * 0.5;\n const top = (h - shaft) / 2;\n const bot = top + shaft;\n const pts = [\n [i, top],\n [w - head, top],\n [w - head, i],\n [w - i, h / 2],\n [w - head, h - i],\n [w - head, bot],\n [i, bot],\n ]\n .map((p) => p.join(\",\"))\n .join(\" \");\n const arrow = svgAttr(svgCreate(\"polygon\"), {\n points: pts,\n fill: \"none\",\n stroke: FLOW_SPEC.stroke,\n \"stroke-width\": sw,\n \"stroke-dasharray\": dashArray(FLOW_SPEC.strokeStyle, sw) || \"6 4\",\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, arrow);\n if (el.ttLabel) {\n this.appendLabel(visuals, el.ttLabel, w - head, h, {\n \"font-size\": FONT.small,\n \"font-weight\": \"650\",\n \"letter-spacing\": \"0.06em\",\n fill: INK_SOFT,\n });\n }\n return arrow;\n }\n\n // --- shared label rendering (wrapped, centred, no halo) ------------------\n\n private appendLabel(visuals: SVGElement, text: string, w: number, h: number, attrs: Attrs): void {\n const fontSize =\n typeof attrs[\"font-size\"] === \"number\" ? (attrs[\"font-size\"] as number) : FONT.label;\n const lines = wrapLabel(text, w - 20, fontSize);\n const lineHeight = fontSize * 1.2;\n const startY = h / 2 - ((lines.length - 1) * lineHeight) / 2;\n lines.forEach((ln, idx) => {\n const t = svgAttr(svgCreate(\"text\"), {\n x: w / 2,\n y: startY + idx * lineHeight,\n \"font-family\": FONT.family,\n \"font-size\": fontSize,\n fill: INK,\n \"text-anchor\": \"middle\",\n \"dominant-baseline\": \"central\",\n ...attrs,\n });\n t.textContent = ln;\n svgAppend(visuals, t);\n });\n }\n}\n\n// --- helpers ---------------------------------------------------------------\n\nfunction octagon(i: number, w: number, h: number, c: number): string {\n return [\n [i + c, i],\n [i + w - c, i],\n [i + w, i + c],\n [i + w, i + h - c],\n [i + w - c, i + h],\n [i + c, i + h],\n [i, i + h - c],\n [i, i + c],\n ]\n .map((p) => p.join(\",\"))\n .join(\" \");\n}\n\n/** Greedy word-wrap into lines that roughly fit `maxWidth` at the font size. */\nfunction wrapLabel(text: string, maxWidth: number, fontSize: number): string[] {\n const maxChars = Math.max(4, Math.floor(maxWidth / (fontSize * 0.58)));\n const words = text.split(/\\s+/).filter(Boolean);\n if (words.length === 0) return [];\n const lines: string[] = [];\n let cur = \"\";\n for (const word of words) {\n const candidate = cur ? `${cur} ${word}` : word;\n if (candidate.length > maxChars && cur) {\n lines.push(cur);\n cur = word;\n } else {\n cur = candidate;\n }\n }\n if (cur) lines.push(cur);\n return lines;\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TeamTopologiesRenderer from \"./TeamTopologiesRenderer.js\";\n\n/** SVG rendering of all Team Topologies element types (BaseRenderer, priority 1500). */\nexport const ttDrawModule: ModuleDeclaration = {\n __init__: [\"ttRenderer\"],\n ttRenderer: [\"type\", TeamTopologiesRenderer],\n};\n\nexport { default as TeamTopologiesRenderer } from \"./TeamTopologiesRenderer.js\";\n","/**\n * Bridges the canonical `TtDocument` into the diagram-js canvas. Everything is a\n * shape; stacking order (back → front) is flows, teams, interactions, so the\n * translucent interaction glyphs read on top of the team boxes they overlay.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport type { TtDocument } from \"@miragon/team-topologies-schema-model\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\nimport { ROOT_ID, type ImportWarning, type RootBusinessObject } from \"./types.js\";\n\ntype RootWithMeta = Root & { businessObject?: RootBusinessObject };\n\nexport default class TtImporter {\n static $inject = [\"canvas\", \"elementFactory\", \"ttElementFactory\", \"eventBus\", \"elementRegistry\"];\n\n constructor(\n private readonly canvas: Canvas,\n private readonly elementFactory: ElementFactory,\n private readonly factory: TtElementFactory,\n private readonly eventBus: EventBus,\n private readonly elementRegistry: ElementRegistry,\n ) {}\n\n import(doc: TtDocument): ImportWarning[] {\n const warnings: ImportWarning[] = [];\n this.eventBus.fire(\"import.render.start\", { document: doc });\n\n let existing: RootWithMeta | undefined;\n try {\n existing = this.canvas.getRootElement() as RootWithMeta;\n } catch {\n existing = undefined;\n }\n let root: RootWithMeta;\n if (existing && existing.id === ROOT_ID) {\n root = existing;\n } else {\n root = this.elementFactory.createRoot({ id: ROOT_ID }) as RootWithMeta;\n this.canvas.setRootElement(root);\n }\n root.businessObject = { title: doc.title };\n\n // Back → front: flows, teams, interactions.\n for (const flow of doc.flows) {\n this.canvas.addShape(this.factory.createFlow(flow), root);\n }\n for (const node of doc.nodes) {\n this.canvas.addShape(this.factory.createTeam(node), root);\n }\n for (const interaction of doc.interactions) {\n this.canvas.addShape(this.factory.createInteraction(interaction), root);\n }\n\n this.eventBus.fire(\"import.render.done\", { warnings });\n return warnings;\n }\n\n /** Removes every element (for re-import). */\n clear(): void {\n for (const el of [...this.elementRegistry.getAll()]) {\n if (el.id === ROOT_ID) continue;\n try {\n this.canvas.removeShape(el.id);\n } catch {\n // already removed — ignore\n }\n }\n }\n}\n","/**\n * Rebuilds a canonical `TtDocument` from the diagram-js runtime model. Position\n * and size truth are the live `x/y/width/height`; editable fields (label, type,\n * mode, colours) are read from the runtime properties.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport { DOCUMENT_VERSION } from \"@miragon/team-topologies-schema-model\";\nimport type {\n FlowShape,\n InteractionShape,\n TeamNode,\n TtDocument,\n} from \"@miragon/team-topologies-schema-model\";\nimport { isTtFlow, isTtInteraction, isTtTeam } from \"../model/di-types.js\";\nimport { ROOT_ID, type RootBusinessObject } from \"./types.js\";\n\nexport default class TtExporter {\n static $inject = [\"elementRegistry\", \"canvas\"];\n\n constructor(\n private readonly elementRegistry: ElementRegistry,\n private readonly canvas: Canvas,\n ) {}\n\n export(): TtDocument {\n let meta: RootBusinessObject | undefined;\n try {\n const root = this.canvas.getRootElement() as Root & {\n businessObject?: RootBusinessObject;\n };\n meta = root.businessObject;\n } catch {\n meta = undefined;\n }\n\n const nodes: TeamNode[] = [];\n const interactions: InteractionShape[] = [];\n const flows: FlowShape[] = [];\n\n for (const el of this.elementRegistry.getAll()) {\n if (el.id === ROOT_ID) continue;\n const geom = el as unknown as { x: number; y: number; width: number; height: number };\n const position = { x: geom.x, y: geom.y };\n const size = { width: geom.width, height: geom.height };\n\n if (isTtTeam(el)) {\n nodes.push({\n id: el.id,\n type: el.teamType,\n label: el.ttLabel ?? \"\",\n position,\n size,\n ...(el.description ? { description: el.description } : {}),\n ...(el.fill ? { fill: el.fill } : {}),\n ...(el.stroke ? { stroke: el.stroke } : {}),\n });\n } else if (isTtInteraction(el)) {\n interactions.push({\n id: el.id,\n mode: el.mode,\n position,\n size,\n ...(el.ttLabel ? { label: el.ttLabel } : {}),\n ...(el.fill ? { fill: el.fill } : {}),\n ...(el.stroke ? { stroke: el.stroke } : {}),\n });\n } else if (isTtFlow(el)) {\n flows.push({\n id: el.id,\n position,\n size,\n ...(el.ttLabel ? { label: el.ttLabel } : {}),\n });\n }\n }\n\n return {\n version: DOCUMENT_VERSION,\n title: meta?.title ?? \"Untitled team topology\",\n nodes,\n interactions,\n flows,\n };\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtImporter from \"./TtImporter.js\";\nimport TtExporter from \"./TtExporter.js\";\n\n/** Document <-> diagram-js bridge (import / export). */\nexport const ioModule: ModuleDeclaration = {\n ttImporter: [\"type\", TtImporter],\n ttExporter: [\"type\", TtExporter],\n};\n\nexport { default as TtImporter } from \"./TtImporter.js\";\nexport { default as TtExporter } from \"./TtExporter.js\";\nexport { saveSVG } from \"./saveSvg.js\";\nexport { ROOT_ID } from \"./types.js\";\nexport type { ImportWarning, RootBusinessObject } from \"./types.js\";\n","import type { ModuleDeclaration } from \"didi\";\nimport { TtBaseViewer } from \"./TtBaseViewer.js\";\nimport { ttModelModule } from \"./model/index.js\";\nimport { ttDrawModule } from \"./draw/index.js\";\nimport { ioModule } from \"./io/index.js\";\n\n/** Read-only renderer: draws a Team Topologies diagram with no interaction. */\nexport class Viewer extends TtBaseViewer {\n protected _getModules(): ModuleDeclaration[] {\n return [ttModelModule, ttDrawModule, ioModule];\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport SelectionModule from \"diagram-js/lib/features/selection\";\nimport ZoomScrollModule from \"diagram-js/lib/navigation/zoomscroll\";\nimport MoveCanvasModule from \"diagram-js/lib/navigation/movecanvas\";\nimport { Viewer } from \"./Viewer.js\";\n\n/** Read-only + navigation: zoom (scroll), pan (drag), selection. */\nexport class NavigatedViewer extends Viewer {\n protected override _getModules(): ModuleDeclaration[] {\n return [...super._getModules(), SelectionModule, ZoomScrollModule, MoveCanvasModule];\n }\n}\n","/**\n * Generic, undo-able command that sets arbitrary Team Topologies properties\n * (ttLabel, teamType, mode, fill, stroke, description). Returns the changed\n * element so the CommandStack fires `elements.changed` → re-render.\n */\n\nimport type { ElementLike } from \"diagram-js/lib/core/Types\";\nimport type CommandHandler from \"diagram-js/lib/command/CommandHandler\";\n\nexport interface UpdatePropertiesContext {\n element: ElementLike & Record<string, unknown>;\n properties: Record<string, unknown>;\n /** set internally by the handler (for revert). */\n oldProperties?: Record<string, unknown>;\n}\n\nfunction setOrDelete(obj: Record<string, unknown>, key: string, value: unknown): void {\n if (value === undefined) delete obj[key];\n else obj[key] = value;\n}\n\nexport default class UpdatePropertiesHandler implements CommandHandler {\n execute(context: UpdatePropertiesContext): ElementLike[] {\n const { element, properties } = context;\n const target = element as unknown as Record<string, unknown>;\n const old: Record<string, unknown> = {};\n for (const key of Object.keys(properties)) {\n old[key] = target[key];\n setOrDelete(target, key, properties[key]);\n }\n context.oldProperties = old;\n return [element];\n }\n\n revert(context: UpdatePropertiesContext): ElementLike[] {\n const { element, oldProperties } = context;\n const target = element as unknown as Record<string, unknown>;\n if (oldProperties) {\n for (const key of Object.keys(oldProperties)) setOrDelete(target, key, oldProperties[key]);\n }\n return [element];\n }\n}\n","/**\n * High-level Team Topologies mutations that go through the command stack\n * (undo/redo). Registers the generic property command handler.\n */\n\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\nimport type { TtElement, TtInteraction, TtTeam } from \"../model/di-types.js\";\nimport UpdatePropertiesHandler from \"./cmd/UpdatePropertiesHandler.js\";\n\nconst UPDATE_PROPERTIES = \"element.updateProperties\";\n\nexport default class TtModeling {\n static $inject = [\"commandStack\"];\n\n constructor(private readonly commandStack: CommandStack) {\n commandStack.registerHandler(UPDATE_PROPERTIES, UpdatePropertiesHandler);\n }\n\n updateProperties(element: TtElement, properties: Record<string, unknown>): void {\n this.commandStack.execute(UPDATE_PROPERTIES, { element, properties });\n }\n\n /** Rename / relabel any element. */\n updateLabel(element: TtElement, label: string): void {\n this.updateProperties(element, { ttLabel: label || undefined });\n }\n\n setTeamType(team: TtTeam, teamType: TeamType): void {\n this.updateProperties(team, { teamType });\n }\n\n setInteractionMode(interaction: TtInteraction, mode: InteractionMode): void {\n this.updateProperties(interaction, { mode });\n }\n\n /** Set or clear per-element colour overrides (`undefined` reverts to default). */\n setColors(\n element: TtTeam | TtInteraction,\n fill: string | undefined,\n stroke: string | undefined,\n ): void {\n this.updateProperties(element, { fill, stroke });\n }\n\n setDescription(team: TtTeam, description: string | undefined): void {\n this.updateProperties(team, { description });\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtModeling from \"./TtModeling.js\";\n\n/** High-level Team Topologies mutations + registration of the command handlers. */\nexport const ttModelingModule: ModuleDeclaration = {\n __init__: [\"ttModeling\"],\n ttModeling: [\"type\", TtModeling],\n};\n\nexport { default as TtModeling } from \"./TtModeling.js\";\n","/**\n * Allowed editing operations. Every Team Topologies element is a free, placed\n * shape — movable, creatable and resizable. There are no connections (the\n * official notation models interactions as overlapping shapes, not lines).\n */\n\nimport RuleProvider from \"diagram-js/lib/features/rules/RuleProvider\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\n\ninterface MoveContext {\n target?: { parent?: unknown } | null;\n}\n\nexport default class TtRules extends RuleProvider {\n static override $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n super(eventBus);\n }\n\n override init(): void {\n this.addRule([\"shape.move\", \"elements.move\"], (context: MoveContext) =>\n context.target && context.target.parent ? null : true,\n );\n this.addRule(\"shape.create\", () => true);\n this.addRule(\"shape.resize\", () => true);\n this.addRule(\"element.copy\", () => true);\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport RulesModule from \"diagram-js/lib/features/rules\";\nimport TtRules from \"./TtRules.js\";\n\n/** Team Topologies editing rules (connect, move, create, resize). */\nexport const ttRulesModule: ModuleDeclaration = {\n __depends__: [RulesModule],\n __init__: [\"ttRules\"],\n ttRules: [\"type\", TtRules],\n};\n\nexport { default as TtRules } from \"./TtRules.js\";\n","/**\n * Keeps the diagram flat: Team Topologies shapes overlap but never nest.\n *\n * diagram-js parents a newly created shape to whatever element it is dropped on\n * (`context.parent` defaults to the drop target). Interaction glyphs are meant\n * to be placed *over* the teams they relate to, so the natural workflow would\n * otherwise nest the interaction inside a team — gluing it so it moves along\n * with the team. Force every created shape onto the diagram root instead.\n *\n * Re-parenting on *move* is prevented separately in TtRules.\n */\n\nimport CommandInterceptor from \"diagram-js/lib/command/CommandInterceptor\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\n\nexport default class TtFlatModelBehavior extends CommandInterceptor {\n static override $inject = [\"eventBus\", \"canvas\"];\n\n constructor(eventBus: EventBus, canvas: Canvas) {\n super(eventBus);\n\n this.preExecute(\n [\"shape.create\", \"elements.create\"],\n (context: { parent?: unknown }) => {\n context.parent = canvas.getRootElement();\n },\n true,\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtFlatModelBehavior from \"./TtFlatModelBehavior.js\";\n\n/** Editing behaviors that keep the Team Topologies model flat (no nesting). */\nexport const ttBehaviorsModule: ModuleDeclaration = {\n __init__: [\"ttFlatModelBehavior\"],\n ttFlatModelBehavior: [\"type\", TtFlatModelBehavior],\n};\n\nexport { default as TtFlatModelBehavior } from \"./TtFlatModelBehavior.js\";\n","/**\n * Tiny inline-SVG glyphs for the palette entries — the same shapes the canvas\n * draws (so the palette is a faithful preview of each team type / interaction\n * mode). Returned as HTML strings for diagram-js palette `html`.\n */\n\nimport {\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n dashArray,\n} from \"@miragon/team-topologies-schema-model\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\n\nfunction svg(inner: string): string {\n return `<svg class=\"tt-palette-svg\" width=\"24\" height=\"24\" viewBox=\"0 0 26 26\" aria-hidden=\"true\">${inner}</svg>`;\n}\n\nexport function teamIconSvg(type: TeamType): string {\n const s = TEAM_TYPE_SPECS[type];\n const dash = dashArray(s.strokeStyle, 1.5);\n const common =\n `fill=\"${s.fill}\" stroke=\"${s.stroke}\" stroke-width=\"1.5\"` +\n (dash ? ` stroke-dasharray=\"${dash}\"` : \"\");\n switch (s.shape) {\n case \"octagon\":\n return svg(`<polygon points=\"8,3 18,3 23,8 23,18 18,23 8,23 3,18 3,8\" ${common}/>`);\n case \"rounded-rect-vertical\":\n return svg(`<rect x=\"8\" y=\"3\" width=\"10\" height=\"20\" rx=\"4\" ${common}/>`);\n case \"rect\":\n return svg(`<rect x=\"3\" y=\"7\" width=\"20\" height=\"12\" rx=\"1.5\" ${common}/>`);\n default:\n return svg(`<rect x=\"3\" y=\"8\" width=\"20\" height=\"10\" rx=\"5\" ${common}/>`);\n }\n}\n\nexport function flowIconSvg(): string {\n return svg(\n `<g fill=\"none\" stroke=\"#6b6459\" stroke-width=\"1.5\" stroke-linejoin=\"round\" stroke-dasharray=\"3 2\">` +\n `<polygon points=\"3,9 16,9 16,5 23,13 16,21 16,17 3,17\"/></g>`,\n );\n}\n\nexport function interactionIconSvg(mode: InteractionMode): string {\n const s = INTERACTION_MODE_SPECS[mode];\n const dash = dashArray(s.strokeStyle, 1.5);\n const common =\n `fill=\"${s.fill}\" fill-opacity=\"${s.opacity}\" stroke=\"${s.stroke}\" stroke-width=\"1.5\"` +\n (dash ? ` stroke-dasharray=\"${dash}\"` : \"\");\n switch (s.shape) {\n case \"circle\":\n return svg(`<circle cx=\"13\" cy=\"13\" r=\"9\" ${common}/>`);\n case \"triangle\":\n return svg(`<polygon points=\"5,6 22,13 5,20\" ${common}/>`);\n default:\n return svg(`<polygon points=\"9,6 23,6 17,20 3,20\" ${common}/>`);\n }\n}\n","/**\n * The floating tool palette (styled top-centre, Excalidraw style). Every entry\n * is drag-to-create: the four team types, the three interaction-mode glyphs\n * (placed over team boundaries), and the flow-of-change arrow.\n */\n\nimport type Palette from \"diagram-js/lib/features/palette/Palette\";\nimport type Create from \"diagram-js/lib/features/create/Create\";\nimport type {\n PaletteEntries,\n default as PaletteProvider,\n} from \"diagram-js/lib/features/palette/PaletteProvider\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\nimport {\n ALL_INTERACTION_SPECS,\n ALL_TEAM_SPECS,\n FLOW_SPEC,\n} from \"@miragon/team-topologies-schema-model\";\nimport { flowIconSvg, interactionIconSvg, teamIconSvg } from \"../draw/palette-icons.js\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\n\nconst GROUP_TEAMS = \"tt-1-teams\";\nconst GROUP_MODES = \"tt-2-modes\";\nconst GROUP_FLOW = \"tt-3-flow\";\n\nfunction entryHtml(icon: string, title: string): string {\n return `<div class=\"entry tt-palette-entry\" draggable=\"true\" title=\"${title}\">${icon}</div>`;\n}\n\nexport default class TtPaletteProvider implements PaletteProvider {\n static $inject = [\"palette\", \"create\", \"ttElementFactory\"];\n\n constructor(\n palette: Palette,\n private readonly create: Create,\n private readonly factory: TtElementFactory,\n ) {\n palette.registerProvider(this);\n }\n\n getPaletteEntries(): PaletteEntries {\n const entries: PaletteEntries = {};\n\n for (const spec of ALL_TEAM_SPECS) {\n const start = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewTeam(spec.type, spec.label) as unknown as Element,\n );\n entries[`team.${spec.type}`] = {\n group: GROUP_TEAMS,\n title: `${spec.label} team — ${spec.description}`,\n html: entryHtml(teamIconSvg(spec.type), `${spec.label} team — ${spec.description}`),\n action: { dragstart: start, click: start },\n };\n }\n\n for (const spec of ALL_INTERACTION_SPECS) {\n const start = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewInteraction(spec.mode) as unknown as Element,\n );\n entries[`mode.${spec.mode}`] = {\n group: GROUP_MODES,\n title: `${spec.label} — ${spec.description} (place over the teams it relates to)`,\n html: entryHtml(interactionIconSvg(spec.mode), `${spec.label} — ${spec.description}`),\n action: { dragstart: start, click: start },\n };\n }\n\n const startFlow = (event: Event) =>\n this.create.start(event as MouseEvent, this.factory.createNewFlow() as unknown as Element);\n entries[\"flow\"] = {\n group: GROUP_FLOW,\n title: `${FLOW_SPEC.label} — the implied left-to-right flow`,\n html: entryHtml(flowIconSvg(), FLOW_SPEC.label),\n action: { dragstart: startFlow, click: startFlow },\n };\n\n return entries;\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport PaletteModule from \"diagram-js/lib/features/palette\";\nimport CreateModule from \"diagram-js/lib/features/create\";\nimport TtPaletteProvider from \"./TtPaletteProvider.js\";\n\n/** Tool palette (drag-to-create teams, pick interaction mode). */\nexport const ttPaletteModule: ModuleDeclaration = {\n __depends__: [PaletteModule, CreateModule],\n __init__: [\"ttPaletteProvider\"],\n ttPaletteProvider: [\"type\", TtPaletteProvider],\n};\n\nexport { default as TtPaletteProvider } from \"./TtPaletteProvider.js\";\n","/**\n * A handful of Material-style icon paths (Apache-2.0) used by the context pad,\n * exposed as HTML markup. Reusable by host chrome too.\n */\n\nexport const ICON_ARROW_FORWARD = \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\";\nexport const ICON_EDIT =\n \"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\";\nexport const ICON_DELETE =\n \"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z\";\nexport const ICON_SWAP = \"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z\";\n\nexport function iconMarkup(path: string, size = 18): string {\n return `<svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"${path}\"/></svg>`;\n}\n","/**\n * Context-pad actions: rename and delete. Every Team Topologies element is a\n * free shape, so the actions are uniform (no connect — interactions are placed,\n * not wired).\n */\n\nimport type ContextPad from \"diagram-js/lib/features/context-pad/ContextPad\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type {\n ContextPadEntries,\n default as ContextPadProvider,\n} from \"diagram-js/lib/features/context-pad/ContextPadProvider\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\nimport { isTtElement } from \"../model/di-types.js\";\nimport type TtLabelEditing from \"../label-editing/TtLabelEditing.js\";\nimport { ICON_DELETE, ICON_EDIT, iconMarkup } from \"../draw/icons.js\";\n\nfunction cpHtml(path: string, title: string): string {\n return `<div class=\"entry tt-cp-entry\" title=\"${title}\">${iconMarkup(path)}</div>`;\n}\n\nexport default class TtContextPadProvider implements ContextPadProvider {\n static $inject = [\"contextPad\", \"modeling\", \"ttLabelEditing\"];\n\n constructor(\n contextPad: ContextPad,\n private readonly modeling: Modeling,\n private readonly labelEditing: TtLabelEditing,\n ) {\n contextPad.registerProvider(this);\n }\n\n getContextPadEntries(element: Element): ContextPadEntries {\n if (!isTtElement(element)) return {};\n return {\n \"edit-label\": {\n group: \"edit\",\n title: \"Rename\",\n html: cpHtml(ICON_EDIT, \"Rename\"),\n action: { click: () => this.labelEditing.activate(element) },\n },\n delete: {\n group: \"edit\",\n title: \"Delete\",\n html: cpHtml(ICON_DELETE, \"Delete\"),\n action: { click: () => this.modeling.removeElements([element]) },\n },\n };\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport ContextPadModule from \"diagram-js/lib/features/context-pad\";\nimport TtContextPadProvider from \"./TtContextPadProvider.js\";\n\n/** Per-element context actions (rename, delete). */\nexport const ttContextPadModule: ModuleDeclaration = {\n __depends__: [ContextPadModule],\n __init__: [\"ttContextPadProvider\"],\n ttContextPadProvider: [\"type\", TtContextPadProvider],\n};\n\nexport { default as TtContextPadProvider } from \"./TtContextPadProvider.js\";\n","/**\n * Inline label editing as an HTML overlay (an <input> centred over the element).\n * Commit goes through `ttModeling.updateLabel` → command stack (undoable).\n * Double-click any element (team / interaction / flow) to (re)label it.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtElement, type TtElement } from \"../model/di-types.js\";\nimport type TtModeling from \"../modeling/TtModeling.js\";\n\ninterface ActiveEdit {\n commit: () => void;\n cleanup: () => void;\n}\n\nexport default class TtLabelEditing {\n static $inject = [\"eventBus\", \"canvas\", \"ttModeling\"];\n\n private active: ActiveEdit | null = null;\n\n constructor(\n eventBus: EventBus,\n private readonly canvas: Canvas,\n private readonly modeling: TtModeling,\n ) {\n eventBus.on(\"element.dblclick\", (event: { element?: unknown }) => {\n if (isTtElement(event.element)) this.activate(event.element);\n });\n // Any click/drag/pan outside the input commits (only Escape discards).\n eventBus.on([\"element.mousedown\", \"drag.init\", \"canvas.viewbox.changing\"], () =>\n this.active?.commit(),\n );\n }\n\n activate(element: TtElement): void {\n this.active?.commit();\n\n const container = this.canvas.getContainer();\n const scale = this.canvas.zoom();\n const vb = this.canvas.viewbox();\n const cx = element.x + element.width / 2;\n const cy = element.y + element.height / 2;\n const width = 170;\n const left = (cx - vb.x) * scale - width / 2;\n const top = (cy - vb.y) * scale - 14;\n\n const input = document.createElement(\"input\");\n input.type = \"text\";\n input.className = \"tt-label-input\";\n input.value = element.ttLabel ?? \"\";\n input.style.position = \"absolute\";\n input.style.left = `${left}px`;\n input.style.top = `${top}px`;\n input.style.width = `${width}px`;\n container.appendChild(input);\n input.focus();\n input.select();\n\n let done = false;\n const cleanup = () => {\n if (done) return;\n done = true;\n input.removeEventListener(\"keydown\", onKey);\n input.removeEventListener(\"blur\", onBlur);\n input.remove();\n this.active = null;\n };\n const commit = () => {\n if (done) return;\n const value = input.value.trim();\n const changed = value !== (element.ttLabel ?? \"\");\n cleanup();\n if (changed) this.modeling.updateLabel(element, value);\n };\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n commit();\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n cleanup();\n }\n };\n const onBlur = () => commit();\n input.addEventListener(\"keydown\", onKey);\n input.addEventListener(\"blur\", onBlur);\n\n this.active = { commit, cleanup };\n }\n\n cancel(): void {\n this.active?.cleanup();\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtLabelEditing from \"./TtLabelEditing.js\";\n\n/** Inline label editing (double-click a team to rename). */\nexport const ttLabelEditingModule: ModuleDeclaration = {\n __init__: [\"ttLabelEditing\"],\n ttLabelEditing: [\"type\", TtLabelEditing],\n};\n\nexport { default as TtLabelEditing } from \"./TtLabelEditing.js\";\n","/**\n * Keyboard shortcuts: undo / redo / delete-selection / copy / paste. Bound to\n * the document so they work without first clicking (focusing) the canvas —\n * typing inside form fields is left untouched. No container `tabindex`, so the\n * canvas never shows a focus ring.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\nimport type Selection from \"diagram-js/lib/features/selection/Selection\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type CopyPaste from \"diagram-js/lib/features/copy-paste/CopyPaste\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\n\nfunction isTypingTarget(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null;\n if (!el) return false;\n return (\n el.tagName === \"INPUT\" ||\n el.tagName === \"TEXTAREA\" ||\n el.tagName === \"SELECT\" ||\n el.isContentEditable\n );\n}\n\nexport default class TtKeyboard {\n static $inject = [\"canvas\", \"commandStack\", \"selection\", \"modeling\", \"copyPaste\"];\n\n constructor(\n canvas: Canvas,\n commandStack: CommandStack,\n selection: Selection,\n modeling: Modeling,\n copyPaste: CopyPaste,\n ) {\n const doc = canvas.getContainer().ownerDocument ?? document;\n\n doc.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (isTypingTarget(e.target)) return;\n const cmd = e.ctrlKey || e.metaKey;\n const key = e.key.toLowerCase();\n\n if (cmd && key === \"z\" && !e.shiftKey) {\n e.preventDefault();\n if (commandStack.canUndo()) commandStack.undo();\n } else if ((cmd && key === \"z\" && e.shiftKey) || (cmd && key === \"y\")) {\n e.preventDefault();\n if (commandStack.canRedo()) commandStack.redo();\n } else if (key === \"delete\" || key === \"backspace\") {\n const sel = selection.get() as Element[];\n if (sel.length) {\n e.preventDefault();\n modeling.removeElements([...sel]);\n }\n } else if (cmd && key === \"c\") {\n const sel = selection.get() as Element[];\n if (sel.length) {\n e.preventDefault();\n copyPaste.copy(sel);\n }\n } else if (cmd && key === \"v\") {\n e.preventDefault();\n copyPaste.paste();\n }\n });\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtKeyboard from \"./TtKeyboard.js\";\n\n/** Undo/redo + delete-selection on the canvas container. */\nexport const ttKeyboardModule: ModuleDeclaration = {\n __init__: [\"ttKeyboard\"],\n ttKeyboard: [\"type\", TtKeyboard],\n};\n\nexport { default as TtKeyboard } from \"./TtKeyboard.js\";\n","/**\n * Copy-paste for Team Topologies shapes, built on the stock diagram-js\n * CopyPaste feature. Only the id handling differs: the stock `createShape`\n * drops the descriptor id and lets diagram-js auto-assign a `shape_N` id, which\n * is the very collision hazard `TtElementFactory` avoids (its counter is not\n * advanced past ids that arrive via import). So we mint a fresh, scheme-correct\n * `team_/int_/flow_` id instead — the custom `tt*` props are already on the\n * descriptor (added by `TtCopyPasteProps`) and pass straight through.\n */\n\nimport CopyPaste from \"diagram-js/lib/features/copy-paste/CopyPaste.js\";\nimport { newId } from \"@miragon/team-topologies-schema-model\";\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type Create from \"diagram-js/lib/features/create/Create\";\nimport type Clipboard from \"diagram-js/lib/features/clipboard/Clipboard\";\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type Mouse from \"diagram-js/lib/features/mouse/Mouse\";\nimport type Rules from \"diagram-js/lib/features/rules/Rules\";\nimport type { Shape } from \"diagram-js/lib/model/Types\";\n\n/** Maps a `ttKind` to the id prefix the model package's factory uses. */\nfunction pasteIdPrefix(ttKind: unknown): string | undefined {\n switch (ttKind) {\n case \"team\":\n return \"team\";\n case \"interaction\":\n return \"int\";\n case \"flow\":\n return \"flow\";\n default:\n return undefined;\n }\n}\n\nexport default class TtCopyPaste extends CopyPaste {\n static override $inject = [\n \"canvas\",\n \"create\",\n \"clipboard\",\n \"elementFactory\",\n \"eventBus\",\n \"modeling\",\n \"mouse\",\n \"rules\",\n ];\n\n constructor(\n canvas: Canvas,\n create: Create,\n clipboard: Clipboard,\n private readonly elementFactory: ElementFactory,\n eventBus: EventBus,\n modeling: Modeling,\n mouse: Mouse,\n rules: Rules,\n ) {\n super(canvas, create, clipboard, elementFactory, eventBus, modeling, mouse, rules);\n }\n\n override createShape(attrs: Record<string, unknown>): Shape {\n const prefix = pasteIdPrefix(attrs.ttKind);\n if (!prefix) {\n return super.createShape(attrs);\n }\n // Keep the id (unlike stock `createShape`, which strips it): a fresh\n // model-style id avoids \"element already exists\" on the next create.\n return this.elementFactory.createShape({ ...attrs, id: newId(prefix) }) as Shape;\n }\n}\n","/**\n * Carries the Team Topologies props across a copy-paste. diagram-js stores each\n * copied element as a plain descriptor whose built-in listener only records\n * geometry (`id/x/y/width/height/…`). Our domain data lives as flat attributes\n * on the shape (not a moddle businessObject), so without this the pasted copy\n * would lose its type, label, description and colours. This listener copies\n * those fields onto the descriptor; they then flow through to the new shape.\n */\n\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtElement } from \"../model/di-types.js\";\n\n/** Flat props that define a Team Topologies shape, beyond geometry. */\nconst TT_PROPS = [\n \"ttKind\",\n \"teamType\",\n \"mode\",\n \"ttLabel\",\n \"description\",\n \"fill\",\n \"stroke\",\n] as const;\n\nexport default class TtCopyPasteProps {\n static $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n eventBus.on(\n \"copyPaste.copyElement\",\n (event: { descriptor: Record<string, unknown>; element: unknown }) => {\n const { descriptor, element } = event;\n if (!isTtElement(element)) return;\n const source = element as Record<string, unknown>;\n for (const prop of TT_PROPS) {\n if (source[prop] !== undefined) descriptor[prop] = source[prop];\n }\n },\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport CopyPasteModule from \"diagram-js/lib/features/copy-paste\";\nimport TtCopyPaste from \"./TtCopyPaste.js\";\nimport TtCopyPasteProps from \"./TtCopyPasteProps.js\";\n\n/**\n * Copy-paste of Team Topologies shapes: the stock diagram-js feature (clipboard,\n * cursor-follow placement) with `copyPaste` overridden to mint model-style ids\n * and a listener that preserves the flat `tt*` props across the round-trip.\n */\nexport const ttCopyPasteModule: ModuleDeclaration = {\n __depends__: [CopyPasteModule],\n __init__: [\"ttCopyPasteProps\"],\n copyPaste: [\"type\", TtCopyPaste],\n ttCopyPasteProps: [\"type\", TtCopyPasteProps],\n};\n\nexport { default as TtCopyPaste } from \"./TtCopyPaste.js\";\n","/**\n * Enforces a fixed stacking order regardless of creation order, by reordering\n * the element graphics within the canvas layer. Back → front:\n *\n * flow < stream-aligned / platform < complicated-subsystem < enabling < interactions\n *\n * So interaction glyphs always read on top; enabling teams sit above the\n * complicated-subsystem teams, which in turn sit above the stream-aligned /\n * platform base teams they overlap.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport {\n isTtElement,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtElement,\n} from \"../model/di-types.js\";\n\n/** Lower = further back. */\nfunction tier(el: TtElement): number {\n if (isTtFlow(el)) return 0;\n if (isTtTeam(el)) {\n if (el.teamType === \"enabling\") return 3;\n if (el.teamType === \"complicated-subsystem\") return 2;\n return 1; // stream-aligned, platform\n }\n if (isTtInteraction(el)) return 4;\n return 1;\n}\n\nexport default class TtZOrder {\n static $inject = [\"eventBus\", \"canvas\", \"elementRegistry\"];\n\n private importing = false;\n\n constructor(\n eventBus: EventBus,\n private readonly canvas: Canvas,\n private readonly elementRegistry: ElementRegistry,\n ) {\n eventBus.on(\"import.render.start\", () => {\n this.importing = true;\n });\n eventBus.on(\"import.render.done\", () => {\n this.importing = false;\n this.reorder();\n });\n // Covers create + team-type changes (and harmlessly re-runs on move/resize).\n eventBus.on(\"commandStack.changed\", () => {\n if (!this.importing) this.reorder();\n });\n }\n\n /** Re-append each element's graphics group in ascending tier order (back → front). */\n reorder(): void {\n const ordered = (this.elementRegistry.getAll().filter(isTtElement) as TtElement[]).sort(\n (a, b) => tier(a) - tier(b),\n );\n for (const el of ordered) {\n const gfx = this.canvas.getGraphics(el) as SVGElement | undefined;\n const wrapper = gfx?.parentNode as (Node & ChildNode) | null;\n const layer = wrapper?.parentNode as (Node & { appendChild(n: Node): Node }) | null;\n if (wrapper && layer) layer.appendChild(wrapper);\n }\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtZOrder from \"./TtZOrder.js\";\n\n/** Keeps the fixed stacking order (interactions on top, base teams at the back). */\nexport const ttZOrderModule: ModuleDeclaration = {\n __init__: [\"ttZOrder\"],\n ttZOrder: [\"type\", TtZOrder],\n};\n\nexport { default as TtZOrder } from \"./TtZOrder.js\";\n","import type { ModuleDeclaration } from \"didi\";\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\n\nimport ModelingModule from \"diagram-js/lib/features/modeling\";\nimport MoveModule from \"diagram-js/lib/features/move\";\nimport OutlineModule from \"diagram-js/lib/features/outline\";\nimport ResizeModule from \"diagram-js/lib/features/resize\";\n\nimport { NavigatedViewer } from \"./NavigatedViewer.js\";\nimport { ttModelingModule } from \"./modeling/index.js\";\nimport { ttRulesModule } from \"./rules/index.js\";\nimport { ttBehaviorsModule } from \"./behaviors/index.js\";\nimport { ttPaletteModule } from \"./palette/index.js\";\nimport { ttContextPadModule } from \"./context-pad/index.js\";\nimport { ttLabelEditingModule } from \"./label-editing/index.js\";\nimport { ttKeyboardModule } from \"./keyboard/index.js\";\nimport { ttCopyPasteModule } from \"./copy-paste/index.js\";\nimport { ttZOrderModule } from \"./zorder/index.js\";\n\n/**\n * Full Team Topologies editor: palette/create, move, resize, connect with\n * rules, context pad, inline label editing, undo/redo.\n */\nexport class Modeler extends NavigatedViewer {\n protected override _getModules(): ModuleDeclaration[] {\n return [\n ...super._getModules(),\n // diagram-js stock\n ModelingModule,\n MoveModule,\n OutlineModule,\n ResizeModule,\n // Team Topologies editor\n ttModelingModule,\n ttRulesModule,\n ttBehaviorsModule,\n ttPaletteModule,\n ttContextPadModule,\n ttLabelEditingModule,\n ttKeyboardModule,\n ttCopyPasteModule,\n ttZOrderModule,\n ];\n }\n\n undo(): void {\n this.get<CommandStack>(\"commandStack\").undo();\n }\n\n redo(): void {\n this.get<CommandStack>(\"commandStack\").redo();\n }\n\n canUndo(): boolean {\n return this.get<CommandStack>(\"commandStack\").canUndo();\n }\n\n canRedo(): boolean {\n return this.get<CommandStack>(\"commandStack\").canRedo();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;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F,GCjEa,IAAoC;CAC/C,UAAU,CAAC,UAAU;CACrB,UAAU,CAAC,QAAQ,EAAQ;AAC7B,GCgBa,KAAb,cAA6B,EAAgB;CAC3C,cAAsD;EACpD,OAAO;GACL,GAAG,MAAM,YAAY;GAErB;GACA;GACA;GACA;GAEA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CAEA,OAAa;EACX,KAAK,IAAkB,cAAc,CAAC,CAAC,KAAK;CAC9C;CAEA,OAAa;EACX,KAAK,IAAkB,cAAc,CAAC,CAAC,KAAK;CAC9C;CAEA,UAAmB;EACjB,OAAO,KAAK,IAAkB,cAAc,CAAC,CAAC,QAAQ;CACxD;CAEA,UAAmB;EACjB,OAAO,KAAK,IAAkB,cAAc,CAAC,CAAC,QAAQ;CACxD;AACF"}
@@ -1,2 +1,2 @@
1
- .djs-parent{--color-grey-225-10-15:#22242a;--color-grey-225-10-35:#505562;--color-grey-225-10-55:#818798;--color-grey-225-10-75:#b9bcc6;--color-grey-225-10-80:#c7c9d1;--color-grey-225-10-85:#d5d7dd;--color-grey-225-10-90:#e3e4e8;--color-grey-225-10-95:#f1f2f4;--color-grey-225-10-97:#f7f7f8;--color-blue-205-100-45:#0086e6;--color-blue-205-100-45-opacity-30:#0086e64d;--color-blue-205-100-50:#0095ff;--color-blue-205-100-50-opacity-15:#0095ff26;--color-blue-205-100-70:#80caff;--color-blue-205-100-95:#e6f4ff;--color-green-150-86-44:#10d170;--color-red-360-100-40:#c00;--color-red-360-100-45:#e60000;--color-red-360-100-92:#ffd6d6;--color-red-360-100-97:#fff0f0;--color-white:#fff;--color-black:#000;--color-black-opacity-10:#0000001a;--color-black-opacity-30:#0000004d;--canvas-fill-color:var(--color-white);--bendpoint-fill-color:var(--color-blue-205-100-45);--bendpoint-stroke-color:var(--canvas-fill-color);--context-pad-entry-background-color:var(--color-white);--context-pad-entry-hover-background-color:var(--color-grey-225-10-95);--element-dragger-color:var(--color-blue-205-100-50);--element-hover-outline-fill-color:var(--color-blue-205-100-45);--element-selected-outline-stroke-color:var(--color-blue-205-100-50);--element-selected-outline-secondary-stroke-color:var(--color-blue-205-100-70);--lasso-fill-color:var(--color-blue-205-100-50-opacity-15);--lasso-stroke-color:var(--element-selected-outline-stroke-color);--palette-entry-color:var(--color-grey-225-10-15);--palette-entry-hover-color:var(--color-blue-205-100-45);--palette-entry-selected-color:var(--color-blue-205-100-50);--palette-separator-color:var(--color-grey-225-10-75);--palette-toggle-hover-background-color:var(--color-grey-225-10-55);--palette-background-color:var(--color-grey-225-10-97);--palette-border-color:var(--color-grey-225-10-75);--popup-font-family:"IBM Plex Sans", sans-serif;--popup-font-size:14px;--popup-secondary-font-size:.9em;--popup-header-entry-selected-color:var(--color-blue-205-100-50);--popup-header-font-weight:bolder;--popup-header-group-divider-color:var(--color-grey-225-10-75);--popup-background-color:var(--color-white);--popup-border-color:transparent;--popup-shadow-color:var(--color-black-opacity-30);--popup-disabled-color:var(--color-grey-225-10-35);--popup-description-color:var(--color-grey-225-10-35);--popup-no-results-color:var(--color-grey-225-10-55);--popup-entry-title-color:var(--color-grey-225-10-55);--popup-entry-hover-color:var(--color-grey-225-10-95);--popup-search-border-color:var(--color-grey-225-10-75);--popup-search-focus-border-color:var(--color-blue-205-100-50);--popup-search-focus-background-color:var(--color-blue-205-100-95);--resizer-fill-color:var(--color-blue-205-100-45);--resizer-stroke-color:var(--canvas-fill-color);--search-font-family:"IBM Plex Sans", sans-serif;--search-font-size:14px;--search-container-background-color:var(--color-white);--search-shadow-color:var(--color-black-opacity-30);--search-input-border-color:var(--color-grey-225-10-75);--search-input-focus-border-color:var(--color-blue-205-100-50);--search-input-focus-background-color:var(--color-blue-205-100-95);--search-result-hover-background-color:var(--color-grey-225-10-95);--search-result-secondary-color:var(--color-grey-225-10-55);--search-preselected-background-color:var(--color-blue-205-100-50-opacity-15);--shape-attach-allowed-stroke-color:var(--color-blue-205-100-50);--shape-connect-allowed-fill-color:var(--color-grey-225-10-97);--shape-drop-allowed-fill-color:var(--color-grey-225-10-97);--shape-drop-not-allowed-fill-color:var(--color-red-360-100-97);--shape-resize-preview-stroke-color:var(--color-blue-205-100-50);--snap-line-stroke-color:var(--color-blue-205-100-45-opacity-30);--space-tool-crosshair-stroke-color:var(--color-black);--tooltip-error-background-color:var(--color-red-360-100-97);--tooltip-error-border-color:var(--color-red-360-100-45);--tooltip-error-color:var(--color-red-360-100-45)}.djs-container svg.drop-not-ok{background:var(--shape-drop-not-allowed-fill-color)!important}.djs-container svg.new-parent{background:var(--shape-drop-allowed-fill-color)!important}.djs-container svg:focus{outline-offset:-1px}.djs-outline,.djs-selection-outline{fill:none;shape-rendering:geometricprecision;stroke-width:2px}.djs-outline{visibility:hidden}.djs-selection-outline{stroke:var(--element-selected-outline-stroke-color)}.djs-element.selected .djs-outline{visibility:visible;stroke:var(--element-selected-outline-stroke-color)}.djs-connection.selected .djs-outline{display:none}.djs-multi-select .djs-element.selected .djs-outline,.djs-dragging-active-lasso .djs-element.selected .djs-outline{stroke:var(--element-selected-outline-secondary-stroke-color);display:block}.djs-shape.connect-ok .djs-visual>:first-child{fill:var(--shape-connect-allowed-fill-color)!important}.djs-shape.connect-not-ok .djs-visual>:first-child,.djs-shape.drop-not-ok .djs-visual>:first-child{fill:var(--shape-drop-not-allowed-fill-color)!important}.djs-shape.new-parent .djs-visual>:first-child{fill:var(--shape-drop-allowed-fill-color)!important}.drop-not-ok,.connect-not-ok,.drop-not-ok *,.connect-not-ok *{cursor:not-allowed!important}.drop-ok,.connect-ok,.drop-ok *,.connect-ok *{cursor:default!important}.djs-element.attach-ok .djs-visual>:first-child{stroke-width:5px!important;stroke:var(--shape-attach-allowed-stroke-color)!important}.djs-frame.connect-not-ok .djs-visual>:first-child,.djs-frame.drop-not-ok .djs-visual>:first-child{stroke-width:3px!important;stroke:var(--shape-drop-not-allowed-fill-color)!important;fill:none!important}.djs-lasso-overlay{fill:var(--lasso-fill-color);stroke:var(--lasso-stroke-color);stroke-width:2px;shape-rendering:geometricprecision;pointer-events:none}.djs-resize-overlay{fill:none;stroke-dasharray:5 1 3 1;stroke:var(--shape-resize-preview-stroke-color);pointer-events:none}.djs-resizer-hit{fill:none;pointer-events:all}.djs-resizer-visual{fill:var(--resizer-fill-color);stroke-width:1px;stroke:var(--resizer-stroke-color);shape-rendering:geometricprecision}.djs-resizer:hover .djs-resizer-visual{stroke:var(--resizer-stroke-color);stroke-opacity:1}.djs-cursor-resize-ns,.djs-resizer-n,.djs-resizer-s{cursor:ns-resize}.djs-cursor-resize-ew,.djs-resizer-e,.djs-resizer-w{cursor:ew-resize}.djs-cursor-resize-nwse,.djs-resizer-nw,.djs-resizer-se{cursor:nwse-resize}.djs-cursor-resize-nesw,.djs-resizer-ne,.djs-resizer-sw{cursor:nesw-resize}.djs-shape.djs-resizing>.djs-outline{visibility:hidden!important}.djs-shape.djs-resizing>.djs-resizer,.djs-dragger>.djs-resizer{visibility:hidden}.djs-dragger *{fill:none!important;stroke:var(--element-dragger-color)!important}.djs-dragger tspan,.djs-dragger text,.djs-dragger marker circle,.djs-dragger marker path,.djs-dragger marker polygon,.djs-dragger marker polyline,.djs-dragger marker rect{fill:var(--element-dragger-color)!important;stroke:none!important}.djs-dragger marker text,.djs-dragger marker tspan{fill:none!important;stroke:var(--element-dragger-color)!important}.djs-dragging,.djs-dragging>*{opacity:.3!important;pointer-events:none!important}.djs-visual,.djs-outline{pointer-events:none}.djs-element.attach-ok .djs-hit{stroke-width:60px!important}.djs-element>.djs-hit-all,.djs-element>.djs-hit-no-move{pointer-events:all}.djs-element>.djs-hit-stroke,.djs-element>.djs-hit-click-stroke{pointer-events:stroke}.djs-connection .djs-visual{stroke-width:2px;fill:none}.djs-cursor-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.djs-cursor-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.djs-cursor-crosshair{cursor:crosshair}.djs-cursor-move{cursor:move}.djs-cursor-resize-ns{cursor:ns-resize}.djs-cursor-resize-ew{cursor:ew-resize}.djs-snap-line{stroke:var(--snap-line-stroke-color);stroke-linecap:round;stroke-width:2px;pointer-events:none}.djs-crosshair{stroke:var(--space-tool-crosshair-stroke-color);stroke-linecap:round;stroke-width:1px;pointer-events:none;shape-rendering:geometricprecision;stroke-dasharray:5 5}.djs-palette{box-sizing:border-box;width:48px;position:absolute;top:20px;left:20px}.djs-palette .separator{border:none;border-bottom:solid 1px var(--palette-separator-color);clear:both;margin:5px;padding-top:5px}.djs-palette .entry:before{vertical-align:initial}.djs-palette .djs-palette-toggle{cursor:pointer}.djs-palette .entry,.djs-palette .djs-palette-toggle{color:var(--palette-entry-color);text-align:center;font-size:30px}.djs-palette .entry{float:left}.djs-palette .entry img{max-width:100%}.djs-palette .djs-palette-entries:after{content:"";clear:both;display:table}.djs-palette .djs-palette-toggle:hover{background:var(--palette-toggle-hover-background-color)}.djs-palette .entry:hover{color:var(--palette-entry-hover-color)}.djs-palette .highlighted-entry{color:var(--palette-entry-selected-color)!important}.djs-palette .entry,.djs-palette .djs-palette-toggle{cursor:default;width:46px;height:46px;line-height:46px}.djs-palette.two-column.open{width:94px}.djs-palette:not(.open) .djs-palette-entries{display:none}.djs-palette:not(.open){overflow:hidden}.djs-palette.open .djs-palette-toggle{display:none}.djs-context-pad{pointer-events:none;z-index:100;width:72px;line-height:1;display:none;position:absolute}.djs-context-pad .entry{text-align:center;cursor:default;background-color:var(--context-pad-entry-background-color);width:22px;height:22px;box-shadow:0 0 2px 1px var(--context-pad-entry-background-color);pointer-events:all;vertical-align:middle;border-radius:3px;margin:0 2px 2px 0;font-size:22px;display:inline-block}.djs-context-pad .entry:hover{background:var(--context-pad-entry-hover-background-color)}.djs-context-pad.open{display:block}.djs-popup{box-sizing:border-box;background:var(--popup-background-color);z-index:200;box-shadow:0px 2px 6px var(--popup-shadow-color);border:solid 1px var(--popup-border-color);min-width:120px;max-width:300px;line-height:1;font-size:var(--popup-font-size);font-family:var(--popup-font-family);outline:none;position:fixed;overflow:hidden}.djs-popup-search input{box-sizing:border-box;width:100%;font-size:var(--popup-font-size);border:solid 1px var(--popup-search-border-color);border-radius:2px;padding:3px 6px 3px 28px;line-height:21px}.djs-popup-search input:focus{background-color:var(--popup-search-focus-background-color);border:solid 1px var(--popup-search-focus-border-color);outline:none}.djs-popup-header{align-items:stretch;margin:10px 12px;line-height:20px;display:flex}.djs-popup-header .entry{border-radius:2px}.djs-popup button.entry{background:0 0;border:0;padding:0}.djs-popup-header .entry.active{color:var(--popup-header-entry-selected-color)}.djs-popup-header .entry.disabled{color:inherit}.djs-popup-header-group{flex-direction:row;align-items:center;margin:0;padding:0;list-style:none;display:flex}.djs-popup-header-group .entry{flex-direction:row;align-items:center;display:flex}.djs-popup-header-group+.djs-popup-header-group:before{content:"";background:var(--popup-header-group-divider-color);width:1px;height:20px;margin:0 5px}.djs-popup-search{width:auto;margin:10px 12px;position:relative}.djs-popup-title{font-size:var(--popup-font-size);font-weight:var(--popup-header-font-weight);flex:1;margin:0}.djs-popup-breadcrumbs{margin:10px 12px;line-height:20px;display:flex}.djs-popup-breadcrumbs-item{appearance:none;min-width:0;color:var(--popup-description-color);font:inherit;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;outline:none;margin:0;padding:0;display:inline-flex;overflow:hidden}.djs-popup-breadcrumbs-item--separator:before{content:"/";color:var(--popup-description-color);margin:0 4px;display:inline-block}.djs-popup-breadcrumbs-item:hover{color:inherit;text-decoration:underline}.djs-popup-breadcrumbs-item:focus-visible{outline:1px solid var(--popup-search-focus-border-color);outline-offset:2px}.djs-popup-breadcrumbs-item--back{border:1px solid var(--popup-search-border-color);border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;margin-right:6px;padding:2px 3px}.djs-popup-breadcrumbs-item--back:hover{background:#f2f3f5}.djs-popup-breadcrumbs-item--current{font-weight:var(--popup-header-font-weight);color:inherit;cursor:default}.djs-popup-breadcrumbs-item--current:hover{text-decoration:none}.djs-popup-entry-chevron{color:var(--popup-description-color);align-items:center;margin-left:6px;display:flex}.djs-popup-search-icon{position:absolute;top:7px;left:8px}.djs-popup-search-count{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);margin:0 12px}.djs-popup-results{max-height:280px;margin:7px 3px 7px 12px;padding-right:9px;list-style:none;overflow:auto}.djs-popup-results:focus{outline:none}.djs-popup-group{width:100%;margin:0;padding:0}.djs-popup-body .entry,.djs-popup-body .entry-header{cursor:default;border-radius:4px;padding:5px 7px}.djs-popup-body .entry-header{font-weight:var(--popup-header-font-weight);color:var(--popup-entry-title-color);padding-left:0}.djs-popup [class*=icon] .djs-popup-label,.djs-popup-label:not(:first-child){margin-left:.5em}.djs-popup [class*=icon]:before,.djs-popup-entry-icon{vertical-align:middle;width:1em;height:1em;font-size:1.4em;display:inline-block}.djs-popup-body .entry-header:not(:first-child){margin-top:8px;margin-bottom:2px}.djs-popup-body .entry{flex-direction:row;align-items:stretch;height:min-content;display:flex}.djs-popup .entry.selected{background-color:var(--popup-entry-hover-color)}.djs-popup .entry.disabled{color:var(--popup-disabled-color);cursor:not-allowed}.djs-popup-body .entry:not(:first-child){margin-top:2px}.djs-popup-entry-content{flex-direction:column;flex:1;display:flex}.djs-popup-entry-description{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);margin-top:.25em}.djs-popup-label,.djs-popup-entry-description{line-height:1.4em}.djs-popup .entry,.djs-popup .entry-header{margin:1px}.djs-popup-body{flex-direction:column;width:auto}.djs-popup ::-webkit-scrollbar{width:6px}.djs-popup ::-webkit-scrollbar-thumb{background-color:#0003;border-radius:3px}.djs-popup ::-webkit-scrollbar-track{box-shadow:none;background:0 0;margin:0;padding:5px}.djs-popup-no-results{color:var(--popup-no-results-color);padding:0 12px 12px}.djs-popup-footer{border-top:solid 1px var(--popup-border-color);padding:5px 12px 7px;display:flex}.djs-popup-results:hover~.djs-popup-footer{display:none}.djs-popup-entry-docs{color:var(--popup-description-color);margin-left:3px;display:none}.djs-popup-body .entry:hover .djs-popup-entry-docs{display:inline}.djs-popup-entry-docs svg{vertical-align:middle;margin:2px}.djs-popup-footer-docs{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);align-items:center;gap:3px;text-decoration:none;display:inline-flex}.djs-popup-footer-docs:hover{text-decoration:underline}.djs-popup-footer-docs svg{vertical-align:middle;margin:2px}.djs-palette{background:var(--palette-background-color);border:solid 1px var(--palette-border-color);border-radius:2px}.djs-segment-dragger,.djs-bendpoint{display:none}.djs-segment-dragger .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-width:1px;stroke-opacity:1;display:none}.djs-segment-dragger:hover .djs-visual{display:block}.djs-bendpoint .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-width:1px}.djs-segment-dragger:hover,.djs-bendpoints.hover .djs-segment-dragger,.djs-bendpoints.selected .djs-segment-dragger,.djs-bendpoint:hover,.djs-bendpoints.hover .djs-bendpoint,.djs-bendpoints.selected .djs-bendpoint{display:block}.djs-drag-active .djs-bendpoints *,.djs-bendpoints:not(.hover) .floating,.djs-bendpoint.floating:not(.positioned){display:none}.djs-segment-dragger:hover .djs-visual,.djs-segment-dragger.djs-dragging .djs-visual,.djs-bendpoint:hover .djs-visual,.djs-bendpoint.floating .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-opacity:1}.djs-bendpoint.floating .djs-hit{pointer-events:none}.djs-segment-dragger .djs-hit,.djs-bendpoint .djs-hit{fill:none;pointer-events:all}.djs-segment-dragger.horizontal .djs-hit{cursor:ns-resize}.djs-segment-dragger.vertical .djs-hit{cursor:ew-resize}.djs-segment-dragger.djs-dragging .djs-hit{pointer-events:none}.djs-updating,.djs-updating>*{pointer-events:none!important}.djs-updating .djs-context-pad,.djs-updating .djs-outline,.djs-updating .djs-bendpoint,.djs-multi-select .djs-bendpoint,.djs-multi-select .djs-segment-dragger,.connect-ok .djs-bendpoint,.connect-not-ok .djs-bendpoint,.drop-ok .djs-bendpoint,.drop-not-ok .djs-bendpoint{display:none!important}.djs-segment-dragger.djs-dragging,.djs-bendpoint.djs-dragging{opacity:1;display:block}.djs-tooltip-error{background:var(--tooltip-error-background-color);border:solid 1px var(--tooltip-error-border-color);width:160px;color:var(--tooltip-error-color);opacity:.75;border-radius:2px;padding:6px;font-size:12px;line-height:16px}.djs-tooltip-error:hover{opacity:1}.djs-search-open .djs-context-pad{display:none}.djs-search-open .djs-connection.selected .djs-outline{display:block}.djs-search-container{z-index:10;width:25%;min-width:300px;max-width:400px;font-family:var(--search-font-family);font-size:var(--search-font-size);box-shadow:0px 2px 6px var(--search-shadow-color);border-radius:2px;margin-left:auto;margin-right:auto;position:absolute;top:20px;left:0;right:0}.djs-search-container:not(.open){display:none}.djs-search-input{position:relative}.djs-search-input svg{position:absolute;top:7px;left:8px}.djs-search-input input{font-size:var(--search-font-size);border:1px solid var(--search-input-border-color);box-sizing:border-box;border-radius:2px;width:100%;padding:3px 6px 3px 28px;line-height:21px}.djs-search-input input:focus{background-color:var(--search-input-focus-background-color);border:solid 1px var(--search-input-focus-border-color);outline:none}.djs-search-results{background:var(--search-container-background-color);max-height:200px;position:relative;overflow-y:auto}.djs-search-result{padding:6px 8px}.djs-search-result-primary{text-overflow:ellipsis;white-space:nowrap;margin:0 0 3px;overflow:hidden}.djs-search-result-secondary{text-overflow:ellipsis;white-space:nowrap;color:var(--search-result-secondary-color);margin:0;font-family:monospace;overflow:hidden}.djs-search-result:hover,.djs-search-result-selected,.djs-search-result-selected:hover{background:var(--search-result-hover-background-color)}.djs-search-open .djs-element .djs-outline{fill:var(--search-preselected-background-color)!important}.djs-element-hidden,.djs-element-hidden .djs-hit,.djs-element-hidden .djs-outline,.djs-label-hidden .djs-label{display:none!important}.djs-element .djs-hit-stroke,.djs-element .djs-hit-click-stroke,.djs-element .djs-hit-all{cursor:move}:root{--cd-blau:#335de5;--cd-gruen:#00e676;--cd-grau:#f9f7f7;--cd-schwarz:#1d1d1d;--cd-weiss:#fff;--cd-blau-link:#2b50d4;--cd-blau-hell:#6b8aff;--cd-success:#0b7a55;--cd-success-soft:#0b7a551f;--cd-warning:#92610a;--cd-warning-soft:#92610a1f;--cd-danger:#c92a2a;--cd-danger-soft:#c92a2a1f;--cd-info:#2b50d4;--cd-info-soft:#2b50d41f;--cd-gradient-brand:linear-gradient(120deg, #335de5 30%, #00e676);--cd-gradient-format:linear-gradient(135deg, #335de5 0%, #00e676 140%);--cd-space-1:4px;--cd-space-2:8px;--cd-space-3:16px;--cd-space-4:24px;--cd-space-5:32px;--cd-space-6:48px;--cd-space-7:64px;--cd-space-8:96px;--cd-radius-sm:6px;--cd-radius-md:12px;--cd-radius-lg:16px;--cd-radius-pill:999px;--cd-shadow-1:0 1px 2px #1d1d1d0f, 0 1px 3px #1d1d1d1a;--cd-shadow-2:0 4px 12px #1d1d1d1a;--cd-shadow-3:0 12px 32px #1d1d1d29;--cd-motion-fast:.15s;--cd-motion-base:.25s;--cd-motion-slow:.4s;--cd-ease:cubic-bezier(.4, 0, .2, 1);--cd-ease-out:cubic-bezier(0, 0, .2, 1)}.tt-djs-container{--tt-accent:var(--cd-blau);--tt-accent-soft:#335de51f;--tt-line:#e6e2e2;--tt-ink:var(--cd-schwarz);background-color:var(--cd-grau);background-image:radial-gradient(#1d1d1d0f .6px,#0000 .6px);background-size:22px 22px;width:100%;height:100%;font-family:Geist Variable,Geist,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;position:relative;overflow:hidden}.tt-djs-container:focus,.tt-djs-container:focus-visible,.tt-djs-container svg:focus{outline:none}.tt-djs-container .djs-element text{-webkit-user-select:none;user-select:none}.tt-djs-container .djs-element.hover .djs-visual>:first-child:not(text),.tt-djs-container .djs-element.selected .djs-visual>:first-child:not(text){stroke:var(--tt-accent)!important}.tt-djs-container .djs-outline{stroke:var(--tt-accent);stroke-dasharray:3 3}.tt-djs-container .djs-resizer-visual{fill:var(--cd-weiss);stroke:var(--tt-accent)}.tt-djs-container .djs-resizer-hit{fill:none}.djs-palette{background:var(--cd-weiss);border:1px solid var(--tt-line);border-radius:var(--cd-radius-md);width:auto;box-shadow:var(--cd-shadow-2);align-items:center;padding:5px 6px;display:flex;top:12px;left:50%;transform:translate(-50%)}.djs-palette .djs-palette-entries,.djs-palette .group{flex-direction:row;align-items:center;gap:2px;display:flex}.djs-palette .entry{float:none;border-radius:var(--cd-radius-sm);width:40px;height:40px;color:var(--tt-ink);line-height:normal;transition:background .12s,color .12s,box-shadow .12s;position:relative}.djs-palette .entry:hover{background:var(--tt-accent-soft);color:var(--tt-accent)}.djs-palette .group+.group{margin-left:9px;padding-left:9px;position:relative}.djs-palette .group+.group:before{content:"";background:var(--tt-line);width:1px;position:absolute;top:6px;bottom:6px;left:0}.tt-palette-entry{justify-content:center;align-items:center;width:100%;min-width:24px;height:100%;min-height:24px;line-height:1;display:flex}.tt-palette-svg{pointer-events:none;display:block}.tt-mode-entry.is-active{background:var(--tt-accent-soft);box-shadow:inset 0 0 0 1.5px var(--tt-accent)}.tt-djs-container .tt-cp-entry{width:100%;min-width:22px;height:100%;min-height:22px;color:var(--tt-ink);justify-content:center;align-items:center;display:flex}.tt-djs-container .djs-context-pad .entry{border-radius:var(--cd-radius-sm);box-shadow:var(--cd-shadow-1);background:var(--cd-weiss);transition:background .12s,color .12s}.tt-djs-container .djs-context-pad .entry:hover{background:var(--tt-accent-soft);color:var(--tt-accent)}.tt-djs-container .tt-label-input{text-align:center;border:1.5px solid var(--tt-accent);border-radius:var(--cd-radius-sm);background:var(--cd-weiss);color:var(--tt-ink);z-index:100;outline:none;padding:3px 6px;font-family:inherit;font-size:13.5px;font-weight:600;box-shadow:0 4px 14px #335de533}
1
+ .djs-parent{--color-grey-225-10-15:#22242a;--color-grey-225-10-35:#505562;--color-grey-225-10-55:#818798;--color-grey-225-10-75:#b9bcc6;--color-grey-225-10-80:#c7c9d1;--color-grey-225-10-85:#d5d7dd;--color-grey-225-10-90:#e3e4e8;--color-grey-225-10-95:#f1f2f4;--color-grey-225-10-97:#f7f7f8;--color-blue-205-100-40:#07c;--color-blue-205-100-45:#0086e6;--color-blue-205-100-45-opacity-30:#0086e64d;--color-blue-205-100-50:#0095ff;--color-blue-205-100-50-opacity-15:#0095ff26;--color-blue-205-100-70:#80caff;--color-blue-205-100-95:#e6f4ff;--color-green-150-86-44:#10d170;--color-red-360-100-40:#c00;--color-red-360-100-45:#e60000;--color-red-360-100-92:#ffd6d6;--color-red-360-100-97:#fff0f0;--color-white:#fff;--color-black:#000;--color-black-opacity-10:#0000001a;--color-black-opacity-30:#0000004d;--canvas-fill-color:var(--color-white);--accent-color:var(--color-blue-205-100-40);--bendpoint-fill-color:var(--color-blue-205-100-45);--bendpoint-stroke-color:var(--canvas-fill-color);--context-pad-entry-background-color:var(--color-white);--context-pad-entry-hover-background-color:var(--color-grey-225-10-95);--element-dragger-color:var(--accent-color);--element-hover-outline-fill-color:var(--color-blue-205-100-45);--element-selected-outline-stroke-color:var(--accent-color);--element-selected-outline-secondary-stroke-color:var(--color-blue-205-100-70);--lasso-fill-color:var(--color-blue-205-100-50-opacity-15);--lasso-stroke-color:var(--element-selected-outline-stroke-color);--palette-entry-color:var(--color-grey-225-10-15);--palette-entry-hover-color:var(--color-blue-205-100-45);--palette-entry-selected-color:var(--accent-color);--palette-separator-color:var(--color-grey-225-10-75);--palette-toggle-hover-background-color:var(--color-grey-225-10-55);--palette-background-color:var(--color-grey-225-10-97);--palette-border-color:var(--color-grey-225-10-75);--popup-font-family:"IBM Plex Sans", sans-serif;--popup-font-size:14px;--popup-secondary-font-size:.9em;--popup-header-entry-selected-color:var(--accent-color);--popup-header-font-weight:bolder;--popup-header-group-divider-color:var(--color-grey-225-10-75);--popup-background-color:var(--color-white);--popup-border-color:transparent;--popup-shadow-color:var(--color-black-opacity-30);--popup-disabled-color:var(--color-grey-225-10-35);--popup-description-color:var(--color-grey-225-10-35);--popup-no-results-color:var(--color-grey-225-10-55);--popup-entry-title-color:var(--color-grey-225-10-55);--popup-entry-hover-color:var(--color-grey-225-10-95);--popup-search-border-color:var(--color-grey-225-10-75);--popup-search-focus-border-color:var(--accent-color);--popup-search-focus-background-color:var(--color-blue-205-100-95);--popup-tab-color:var(--color-grey-225-10-55);--popup-tab-hover-color:var(--color-grey-225-10-15);--popup-tab-active-color:var(--color-grey-225-10-15);--popup-tab-active-border-color:var(--accent-color);--popup-tab-strip-border-color:var(--color-grey-225-10-90);--popup-tab-focus-border-color:var(--accent-color);--resizer-fill-color:var(--color-blue-205-100-45);--resizer-stroke-color:var(--canvas-fill-color);--search-font-family:"IBM Plex Sans", sans-serif;--search-font-size:14px;--search-container-background-color:var(--color-white);--search-shadow-color:var(--color-black-opacity-30);--search-input-border-color:var(--color-grey-225-10-75);--search-input-focus-border-color:var(--accent-color);--search-input-focus-background-color:var(--color-blue-205-100-95);--search-result-hover-background-color:var(--color-grey-225-10-95);--search-result-secondary-color:var(--color-grey-225-10-55);--search-preselected-background-color:var(--color-blue-205-100-50-opacity-15);--shape-attach-allowed-stroke-color:var(--accent-color);--shape-connect-allowed-fill-color:var(--color-grey-225-10-97);--shape-drop-allowed-fill-color:var(--color-grey-225-10-97);--shape-drop-not-allowed-fill-color:var(--color-red-360-100-97);--shape-resize-preview-stroke-color:var(--accent-color);--snap-line-stroke-color:var(--color-blue-205-100-45-opacity-30);--space-tool-crosshair-stroke-color:var(--color-black);--tooltip-error-background-color:var(--color-red-360-100-97);--tooltip-error-border-color:var(--color-red-360-100-45);--tooltip-error-color:var(--color-red-360-100-45);--hover-tooltip-font-family:"IBM Plex Sans", sans-serif;--hover-tooltip-font-size:12px;--hover-tooltip-secondary-font-size:11px;--hover-tooltip-background-color:var(--color-grey-225-10-15);--hover-tooltip-color:var(--color-white);--hover-tooltip-shadow-color:var(--color-black-opacity-10);--palette-tooltip-shortcut-background-color:var(--color-grey-225-10-35)}.djs-container svg.drop-not-ok{background:var(--shape-drop-not-allowed-fill-color)!important}.djs-container svg.new-parent{background:var(--shape-drop-allowed-fill-color)!important}.djs-container svg:focus{outline-offset:-1px}.djs-outline,.djs-selection-outline{fill:none;shape-rendering:geometricprecision;stroke-width:2px}.djs-outline{visibility:hidden}.djs-selection-outline{stroke:var(--element-selected-outline-stroke-color)}.djs-element.selected .djs-outline{visibility:visible;stroke:var(--element-selected-outline-stroke-color)}.djs-connection.selected .djs-outline{display:none}.djs-multi-select .djs-element.selected .djs-outline,.djs-dragging-active-lasso .djs-element.selected .djs-outline{stroke:var(--element-selected-outline-secondary-stroke-color);display:block}.djs-outline-hidden .djs-outline{display:none!important}.djs-shape.connect-ok .djs-visual>:first-child{fill:var(--shape-connect-allowed-fill-color)!important}.djs-shape.connect-not-ok .djs-visual>:first-child,.djs-shape.drop-not-ok .djs-visual>:first-child{fill:var(--shape-drop-not-allowed-fill-color)!important}.djs-shape.new-parent .djs-visual>:first-child{fill:var(--shape-drop-allowed-fill-color)!important}.drop-not-ok,.connect-not-ok,.drop-not-ok *,.connect-not-ok *{cursor:not-allowed!important}.drop-ok,.connect-ok,.drop-ok *,.connect-ok *{cursor:default!important}.djs-element.attach-ok .djs-visual>:first-child{stroke-width:5px!important;stroke:var(--shape-attach-allowed-stroke-color)!important}.djs-frame.connect-not-ok .djs-visual>:first-child,.djs-frame.drop-not-ok .djs-visual>:first-child{stroke-width:3px!important;stroke:var(--shape-drop-not-allowed-fill-color)!important;fill:none!important}.djs-lasso-overlay{fill:var(--lasso-fill-color);stroke:var(--lasso-stroke-color);stroke-width:2px;shape-rendering:geometricprecision;pointer-events:none}.djs-resize-overlay{fill:none;stroke-dasharray:5 1 3 1;stroke:var(--shape-resize-preview-stroke-color);pointer-events:none}.djs-resizer-hit{fill:none;pointer-events:all}.djs-resizer-visual{fill:var(--resizer-fill-color);stroke-width:1px;stroke:var(--resizer-stroke-color);shape-rendering:geometricprecision}.djs-resizer:hover .djs-resizer-visual{stroke:var(--resizer-stroke-color);stroke-opacity:1}.djs-cursor-resize-ns,.djs-resizer-n,.djs-resizer-s{cursor:ns-resize}.djs-cursor-resize-ew,.djs-resizer-e,.djs-resizer-w{cursor:ew-resize}.djs-cursor-resize-nwse,.djs-resizer-nw,.djs-resizer-se{cursor:nwse-resize}.djs-cursor-resize-nesw,.djs-resizer-ne,.djs-resizer-sw{cursor:nesw-resize}.djs-shape.djs-resizing>.djs-outline{visibility:hidden!important}.djs-shape.djs-resizing>.djs-resizer,.djs-dragger>.djs-resizer{visibility:hidden}.djs-dragger *{fill:none!important;stroke:var(--element-dragger-color)!important}.djs-dragger tspan,.djs-dragger text,.djs-dragger marker circle,.djs-dragger marker path,.djs-dragger marker polygon,.djs-dragger marker polyline,.djs-dragger marker rect{fill:var(--element-dragger-color)!important;stroke:none!important}.djs-dragger marker text,.djs-dragger marker tspan{fill:none!important;stroke:var(--element-dragger-color)!important}.djs-dragging,.djs-dragging>*{opacity:.3!important;pointer-events:none!important}.djs-visual,.djs-outline{pointer-events:none}.djs-element.attach-ok .djs-hit{stroke-width:60px!important}.djs-element>.djs-hit-all,.djs-element>.djs-hit-no-move{pointer-events:all}.djs-element>.djs-hit-stroke,.djs-element>.djs-hit-click-stroke{pointer-events:stroke}.djs-connection .djs-visual{stroke-width:2px;fill:none}.djs-cursor-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.djs-cursor-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.djs-cursor-crosshair{cursor:crosshair}.djs-cursor-move{cursor:move}.djs-cursor-resize-ns{cursor:ns-resize}.djs-cursor-resize-ew{cursor:ew-resize}.djs-snap-line{stroke:var(--snap-line-stroke-color);stroke-linecap:round;stroke-width:2px;pointer-events:none}.djs-crosshair{stroke:var(--space-tool-crosshair-stroke-color);stroke-linecap:round;stroke-width:1px;pointer-events:none;shape-rendering:geometricprecision;stroke-dasharray:5 5}.djs-palette{box-sizing:border-box;width:48px;position:absolute;top:20px;left:20px}.djs-palette .separator{border:none;border-bottom:solid 1px var(--palette-separator-color);clear:both;margin:5px;padding-top:5px}.djs-palette .entry:before{vertical-align:initial}.djs-palette .djs-palette-toggle{cursor:pointer}.djs-palette .entry,.djs-palette .djs-palette-toggle{color:var(--palette-entry-color);text-align:center;font-size:30px}.djs-palette .entry{float:left}.djs-palette .entry img{max-width:100%}.djs-palette .djs-palette-entries:after{content:"";clear:both;display:table}.djs-palette .djs-palette-toggle:hover{background:var(--palette-toggle-hover-background-color)}.djs-palette .entry:hover{color:var(--palette-entry-hover-color)}.djs-palette .highlighted-entry{color:var(--palette-entry-selected-color)!important}.djs-palette .entry,.djs-palette .djs-palette-toggle{cursor:default;width:46px;height:46px;line-height:46px}.djs-palette.two-column.open{width:94px}.djs-palette:not(.open) .djs-palette-entries{display:none}.djs-palette:not(.open){overflow:hidden}.djs-palette.open .djs-palette-toggle{display:none}.djs-hover-tooltip{z-index:1000;background-color:var(--hover-tooltip-background-color);color:var(--hover-tooltip-color);font-family:var(--hover-tooltip-font-family);font-size:var(--hover-tooltip-font-size);white-space:nowrap;pointer-events:none;box-shadow:0 1px 4px var(--hover-tooltip-shadow-color);border-radius:4px;align-items:center;gap:6px;padding:6px 10px;line-height:1.2;display:flex;position:fixed}.djs-hover-tooltip--right{transform:translateY(-50%)}.djs-hover-tooltip--top{transform:translate(-50%,-100%)}.djs-palette-tooltip-shortcut{background-color:var(--palette-tooltip-shortcut-background-color);font-family:monospace;font-size:var(--hover-tooltip-secondary-font-size);border-radius:3px;padding:1px 5px;line-height:1.2}.djs-context-pad{pointer-events:none;z-index:100;width:72px;line-height:1;display:none;position:absolute}.djs-context-pad .entry{text-align:center;cursor:default;background-color:var(--context-pad-entry-background-color);width:22px;height:22px;box-shadow:0 0 2px 1px var(--context-pad-entry-background-color);pointer-events:all;vertical-align:middle;border-radius:3px;margin:0 2px 2px 0;font-size:22px;display:inline-block}.djs-context-pad .entry:hover{background:var(--context-pad-entry-hover-background-color)}.djs-context-pad.open{display:block}.djs-popup{box-sizing:border-box;background:var(--popup-background-color);z-index:200;box-shadow:0px 2px 6px var(--popup-shadow-color);border:solid 1px var(--popup-border-color);min-width:120px;max-width:300px;line-height:1;font-size:var(--popup-font-size);font-family:var(--popup-font-family);outline:none;position:fixed;overflow:hidden}.djs-popup-search input{box-sizing:border-box;width:100%;font-size:var(--popup-font-size);border:solid 1px var(--popup-search-border-color);border-radius:2px;padding:3px 6px 3px 28px;line-height:21px}.djs-popup-search input:focus{background-color:var(--popup-search-focus-background-color);border:solid 1px var(--popup-search-focus-border-color);outline:none}.djs-popup-header{align-items:stretch;margin:10px 12px;line-height:20px;display:flex}.djs-popup-header .entry{border-radius:2px}.djs-popup button.entry{background:0 0;border:0;padding:0}.djs-popup-header .entry.active{color:var(--popup-header-entry-selected-color)}.djs-popup-header .entry.disabled{color:inherit}.djs-popup-header-group{flex-direction:row;align-items:center;margin:0;padding:0;list-style:none;display:flex}.djs-popup-header-group .entry{flex-direction:row;align-items:center;display:flex}.djs-popup-header-group+.djs-popup-header-group:before{content:"";background:var(--popup-header-group-divider-color);width:1px;height:20px;margin:0 5px}.djs-popup-search{width:auto;margin:10px 12px;position:relative}.djs-popup-tabs-container{border-bottom:solid 1px var(--popup-tab-strip-border-color);position:relative}.djs-popup-tabs-scroll{appearance:none;width:28px;color:var(--popup-tab-color);cursor:pointer;border:none;border-radius:0;align-items:center;padding:0;display:flex;position:absolute;top:0;bottom:1px}.djs-popup-tabs-scroll:hover{color:var(--popup-tab-hover-color)}.djs-popup-tabs-scroll-start{background:linear-gradient(to left, transparent, var(--popup-background-color) 60%);justify-content:flex-start;left:0}.djs-popup-tabs-scroll-end{background:linear-gradient(to right, transparent, var(--popup-background-color) 60%);justify-content:flex-end;right:0}.djs-popup-tabs-scroll-start svg{transform:rotate(180deg)}.djs-popup-tabs{scrollbar-width:none;flex-wrap:nowrap;gap:2px;padding:0 12px;scroll-padding:0 28px;display:flex;overflow:auto hidden}.djs-popup-tabs::-webkit-scrollbar{display:none}.djs-popup-tab{appearance:none;font:inherit;font-size:var(--popup-font-size);color:var(--popup-tab-color);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-bottom:2px solid #0000;border-radius:0;flex:none;padding:6px 10px}.djs-popup-tab:hover{color:var(--popup-tab-hover-color)}.djs-popup-tab:focus-visible{outline:solid 1px var(--popup-tab-focus-border-color);outline-offset:-2px}.djs-popup-tab[aria-selected=true]{color:var(--popup-tab-active-color);border-bottom-color:var(--popup-tab-active-border-color);font-weight:var(--popup-header-font-weight)}.djs-popup-title{font-size:var(--popup-font-size);font-weight:var(--popup-header-font-weight);flex:1;margin:0}.djs-popup-breadcrumbs{margin:10px 12px;line-height:20px;display:flex}.djs-popup-breadcrumbs-item{appearance:none;min-width:0;color:var(--popup-description-color);font:inherit;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;outline:none;margin:0;padding:0;display:inline-flex;overflow:hidden}.djs-popup-breadcrumbs-item--separator:before{content:"/";color:var(--popup-description-color);margin:0 4px;display:inline-block}.djs-popup-breadcrumbs-item:hover{color:inherit;text-decoration:underline}.djs-popup-breadcrumbs-item:focus-visible{outline:1px solid var(--popup-search-focus-border-color);outline-offset:2px}.djs-popup-breadcrumbs-item--back{border:1px solid var(--popup-search-border-color);border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;margin-right:6px;padding:2px 3px}.djs-popup-breadcrumbs-item--back:hover{background:#f2f3f5}.djs-popup-breadcrumbs-item--current{font-weight:var(--popup-header-font-weight);color:inherit;cursor:default}.djs-popup-breadcrumbs-item--current:hover{text-decoration:none}.djs-popup-entry-actions{flex-shrink:0;align-items:center;gap:6px;margin-left:6px;display:flex}.djs-popup-entry-chevron{color:var(--popup-description-color);align-items:center;display:flex}.djs-popup-search-icon{position:absolute;top:7px;left:8px}.djs-popup-search-count{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);margin:0 12px}.djs-popup-results{max-height:280px;margin:7px 3px 7px 12px;padding-right:9px;list-style:none;overflow:auto}.djs-popup-results:focus{outline:none}.djs-popup-group{width:100%;margin:0;padding:0}.djs-popup-body .entry,.djs-popup-body .entry-header{cursor:default;border-radius:4px;padding:5px 7px}.djs-popup-body .entry-header{font-weight:var(--popup-header-font-weight);color:var(--popup-entry-title-color);padding-left:0}.djs-popup [class*=icon] .djs-popup-label,.djs-popup-label:not(:first-child){margin-left:.5em}.djs-popup [class*=icon]:before,.djs-popup-entry-icon{vertical-align:middle;width:1em;height:1em;font-size:1.4em;display:inline-block}.djs-popup-body .entry-header:not(:first-child){margin-top:8px;margin-bottom:2px}.djs-popup-body .entry{flex-direction:row;align-items:stretch;height:min-content;display:flex}.djs-popup .entry.selected{background-color:var(--popup-entry-hover-color)}.djs-popup .entry.disabled{color:var(--popup-disabled-color);cursor:not-allowed}.djs-popup-body .entry:not(:first-child){margin-top:2px}.djs-popup-entry-content{flex-direction:column;flex:1;display:flex}.djs-popup-entry-description{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);margin-top:.25em}.djs-popup-label,.djs-popup-entry-description{line-height:1.4em}.djs-popup .entry,.djs-popup .entry-header{margin:1px}.djs-popup-body{flex-direction:column;width:auto}.djs-popup ::-webkit-scrollbar{width:6px}.djs-popup ::-webkit-scrollbar-thumb{background-color:#0003;border-radius:3px}.djs-popup ::-webkit-scrollbar-track{box-shadow:none;background:0 0;margin:0;padding:5px}.djs-popup-no-results{color:var(--popup-no-results-color);padding:0 12px 12px}.djs-popup-footer{border-top:solid 1px var(--popup-border-color);padding:5px 12px 7px;display:flex}.djs-popup-results:hover~.djs-popup-footer{display:none}.djs-popup-entry-docs{visibility:hidden;color:var(--popup-description-color);border:1px solid var(--popup-search-border-color);cursor:pointer;background:#fff;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;padding:2px 3px;transition:background-color .12s,border-color .12s,color .12s;display:flex}.djs-popup-body .entry:hover .djs-popup-entry-docs{visibility:visible}.djs-popup-body .entry .djs-popup-entry-docs:hover{background:#f2f3f5}.djs-popup-entry-docs svg{vertical-align:middle}.djs-popup-footer-docs{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);align-items:center;gap:3px;text-decoration:none;display:inline-flex}.djs-popup-footer-docs:hover{text-decoration:underline}.djs-popup-footer-docs svg{vertical-align:middle;margin:2px}.djs-palette{background:var(--palette-background-color);border:solid 1px var(--palette-border-color);border-radius:2px}.djs-segment-dragger,.djs-bendpoint{display:none}.djs-segment-dragger .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-width:1px;stroke-opacity:1;display:none}.djs-segment-dragger:hover .djs-visual{display:block}.djs-bendpoint .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-width:1px}.djs-segment-dragger:hover,.djs-bendpoints.hover .djs-segment-dragger,.djs-bendpoints.selected .djs-segment-dragger,.djs-bendpoint:hover,.djs-bendpoints.hover .djs-bendpoint,.djs-bendpoints.selected .djs-bendpoint{display:block}.djs-drag-active .djs-bendpoints *,.djs-bendpoints:not(.hover) .floating,.djs-bendpoint.floating:not(.positioned){display:none}.djs-segment-dragger:hover .djs-visual,.djs-segment-dragger.djs-dragging .djs-visual,.djs-bendpoint:hover .djs-visual,.djs-bendpoint.floating .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-opacity:1}.djs-bendpoint.floating .djs-hit{pointer-events:none}.djs-segment-dragger .djs-hit,.djs-bendpoint .djs-hit{fill:none;pointer-events:all}.djs-segment-dragger.horizontal .djs-hit{cursor:ns-resize}.djs-segment-dragger.vertical .djs-hit{cursor:ew-resize}.djs-segment-dragger.djs-dragging .djs-hit{pointer-events:none}.djs-updating,.djs-updating>*{pointer-events:none!important}.djs-updating .djs-context-pad,.djs-updating .djs-outline,.djs-updating .djs-bendpoint,.djs-multi-select .djs-bendpoint,.djs-multi-select .djs-segment-dragger,.connect-ok .djs-bendpoint,.connect-not-ok .djs-bendpoint,.drop-ok .djs-bendpoint,.drop-not-ok .djs-bendpoint{display:none!important}.djs-segment-dragger.djs-dragging,.djs-bendpoint.djs-dragging{opacity:1;display:block}.djs-tooltip-error{background:var(--tooltip-error-background-color);border:solid 1px var(--tooltip-error-border-color);width:160px;color:var(--tooltip-error-color);opacity:.75;border-radius:2px;padding:6px;font-size:12px;line-height:16px}.djs-tooltip-error:hover{opacity:1}.djs-search-open .djs-context-pad{display:none}.djs-search-open .djs-connection.selected .djs-outline{display:block}.djs-search-container{z-index:10;width:25%;min-width:300px;max-width:400px;font-family:var(--search-font-family);font-size:var(--search-font-size);box-shadow:0px 2px 6px var(--search-shadow-color);border-radius:2px;margin-left:auto;margin-right:auto;position:absolute;top:20px;left:0;right:0}.djs-search-container:not(.open){display:none}.djs-search-input{position:relative}.djs-search-input svg{position:absolute;top:7px;left:8px}.djs-search-input input{font-size:var(--search-font-size);border:1px solid var(--search-input-border-color);box-sizing:border-box;border-radius:2px;width:100%;padding:3px 6px 3px 28px;line-height:21px}.djs-search-input input:focus{background-color:var(--search-input-focus-background-color);border:solid 1px var(--search-input-focus-border-color);outline:none}.djs-search-results{background:var(--search-container-background-color);max-height:200px;position:relative;overflow-y:auto}.djs-search-result{padding:6px 8px}.djs-search-result-primary{text-overflow:ellipsis;white-space:nowrap;margin:0 0 3px;overflow:hidden}.djs-search-result-secondary{text-overflow:ellipsis;white-space:nowrap;color:var(--search-result-secondary-color);margin:0;font-family:monospace;overflow:hidden}.djs-search-result:hover,.djs-search-result-selected,.djs-search-result-selected:hover{background:var(--search-result-hover-background-color)}.djs-search-open .djs-element .djs-outline{fill:var(--search-preselected-background-color)!important}.djs-element-hidden,.djs-element-hidden .djs-hit,.djs-element-hidden .djs-outline,.djs-label-hidden .djs-label{display:none!important}.djs-element .djs-hit-stroke,.djs-element .djs-hit-click-stroke,.djs-element .djs-hit-all{cursor:move}:root{--cd-blau:#335de5;--cd-gruen:#00e676;--cd-grau:#f9f7f7;--cd-schwarz:#1d1d1d;--cd-weiss:#fff;--cd-blau-link:#2b50d4;--cd-blau-hell:#6b8aff;--cd-success:#0b7a55;--cd-success-soft:#0b7a551f;--cd-warning:#92610a;--cd-warning-soft:#92610a1f;--cd-danger:#c92a2a;--cd-danger-soft:#c92a2a1f;--cd-info:#2b50d4;--cd-info-soft:#2b50d41f;--cd-gradient-brand:linear-gradient(120deg, #335de5 30%, #00e676);--cd-gradient-format:linear-gradient(135deg, #335de5 0%, #00e676 140%);--cd-space-1:4px;--cd-space-2:8px;--cd-space-3:16px;--cd-space-4:24px;--cd-space-5:32px;--cd-space-6:48px;--cd-space-7:64px;--cd-space-8:96px;--cd-radius-sm:6px;--cd-radius-md:12px;--cd-radius-lg:16px;--cd-radius-pill:999px;--cd-shadow-1:0 1px 2px #1d1d1d0f, 0 1px 3px #1d1d1d1a;--cd-shadow-2:0 4px 12px #1d1d1d1a;--cd-shadow-3:0 12px 32px #1d1d1d29;--cd-motion-fast:.15s;--cd-motion-base:.25s;--cd-motion-slow:.4s;--cd-ease:cubic-bezier(.4, 0, .2, 1);--cd-ease-out:cubic-bezier(0, 0, .2, 1)}.tt-djs-container{--tt-accent:var(--cd-blau);--tt-accent-soft:#335de51f;--tt-line:#e6e2e2;--tt-ink:var(--cd-schwarz);background-color:var(--cd-grau);background-image:radial-gradient(#1d1d1d0f .6px,#0000 .6px);background-size:22px 22px;width:100%;height:100%;font-family:Geist Variable,Geist,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;position:relative;overflow:hidden}.tt-djs-container:focus,.tt-djs-container:focus-visible,.tt-djs-container svg:focus{outline:none}.tt-djs-container .djs-element text{-webkit-user-select:none;user-select:none}.tt-djs-container .djs-element.hover .djs-visual>:first-child:not(text),.tt-djs-container .djs-element.selected .djs-visual>:first-child:not(text){stroke:var(--tt-accent)!important}.tt-djs-container .djs-outline{stroke:var(--tt-accent);stroke-dasharray:3 3}.tt-djs-container .djs-resizer-visual{fill:var(--cd-weiss);stroke:var(--tt-accent)}.tt-djs-container .djs-resizer-hit{fill:none}.djs-palette{background:var(--cd-weiss);border:1px solid var(--tt-line);border-radius:var(--cd-radius-md);width:auto;box-shadow:var(--cd-shadow-2);align-items:center;padding:5px 6px;display:flex;top:12px;left:50%;transform:translate(-50%)}.djs-palette .djs-palette-entries,.djs-palette .group{flex-direction:row;align-items:center;gap:2px;display:flex}.djs-palette .entry{float:none;border-radius:var(--cd-radius-sm);width:40px;height:40px;color:var(--tt-ink);line-height:normal;transition:background .12s,color .12s,box-shadow .12s;position:relative}.djs-palette .entry:hover{background:var(--tt-accent-soft);color:var(--tt-accent)}.djs-palette .group+.group{margin-left:9px;padding-left:9px;position:relative}.djs-palette .group+.group:before{content:"";background:var(--tt-line);width:1px;position:absolute;top:6px;bottom:6px;left:0}.tt-palette-entry{justify-content:center;align-items:center;width:100%;min-width:24px;height:100%;min-height:24px;line-height:1;display:flex}.tt-palette-svg{pointer-events:none;display:block}.tt-mode-entry.is-active{background:var(--tt-accent-soft);box-shadow:inset 0 0 0 1.5px var(--tt-accent)}.tt-djs-container .tt-cp-entry{width:100%;min-width:22px;height:100%;min-height:22px;color:var(--tt-ink);justify-content:center;align-items:center;display:flex}.tt-djs-container .djs-context-pad .entry{border-radius:var(--cd-radius-sm);box-shadow:var(--cd-shadow-1);background:var(--cd-weiss);transition:background .12s,color .12s}.tt-djs-container .djs-context-pad .entry:hover{background:var(--tt-accent-soft);color:var(--tt-accent)}.tt-djs-container .tt-label-input{text-align:center;border:1.5px solid var(--tt-accent);border-radius:var(--cd-radius-sm);background:var(--cd-weiss);color:var(--tt-ink);z-index:100;outline:none;padding:3px 6px;font-family:inherit;font-size:13.5px;font-weight:600;box-shadow:0 4px 14px #335de533}
2
2
  /*$vite$:1*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miragon/team-topologies-renderer",
3
- "version": "0.6.0",
3
+ "version": "0.7.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,15 +37,15 @@
37
37
  "test:browser": "npm --prefix ../.. run test:browser"
38
38
  },
39
39
  "dependencies": {
40
- "@miragon/team-topologies-schema-model": "0.6.0",
41
- "diagram-js": "15.22.0",
40
+ "@miragon/team-topologies-schema-model": "0.7.0",
41
+ "diagram-js": "15.26.0",
42
42
  "didi": "11.0.0",
43
43
  "tiny-svg": "4.1.4"
44
44
  },
45
45
  "devDependencies": {
46
46
  "typescript": "6.0.3",
47
- "vite": "8.1.4",
48
- "vite-plugin-dts": "5.0.3",
49
- "vitest": "4.1.10"
47
+ "vite": "8.3.0",
48
+ "vite-plugin-dts": "5.1.0",
49
+ "vitest": "5.0.1"
50
50
  }
51
51
  }