@djangocfg/widget-diagram 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/widget-diagram",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Mermaid diagrams: typed builders that write the source, and a full-parser renderer that draws it",
5
5
  "keywords": [
6
6
  "mermaid",
@@ -43,18 +43,19 @@
43
43
  "scripts": {
44
44
  "check": "tsc --noEmit",
45
45
  "check-types": "tsc --noEmit",
46
+ "lint": "eslint .",
46
47
  "test": "vitest run",
47
48
  "test:watch": "vitest"
48
49
  },
49
50
  "peerDependencies": {
50
- "@djangocfg/ui-core": "^2.1.542",
51
+ "@djangocfg/ui-core": "^2.1.543",
51
52
  "lucide-react": "^0.545.0",
52
53
  "react": "^19.0.0",
53
54
  "react-dom": "^19.0.0"
54
55
  },
55
56
  "devDependencies": {
56
- "@djangocfg/typescript-config": "^2.1.542",
57
- "@djangocfg/ui-core": "^2.1.542",
57
+ "@djangocfg/typescript-config": "^2.1.543",
58
+ "@djangocfg/ui-core": "^2.1.543",
58
59
  "@storybook/react-vite": "^10.5.0",
59
60
  "@types/node": "^25.9.5",
60
61
  "@types/react": "19.2.15",
@@ -70,7 +71,7 @@
70
71
  "access": "public"
71
72
  },
72
73
  "dependencies": {
73
- "@djangocfg/widget-kit": "^0.1.1",
74
+ "@djangocfg/widget-kit": "^0.1.2",
74
75
  "mermaid": "^11.16.0",
75
76
  "react-zoom-pan-pinch": "^3.7.0"
76
77
  }
@@ -43,7 +43,12 @@ export interface FlowStyleClass {
43
43
 
44
44
  /**
45
45
  * Node builder interface - chainable API for creating nodes
46
+ *
47
+ * `Nodes` is phantom here — every method returns `void` — but it is kept so the
48
+ * builder family reads uniformly (`node(id: Nodes): NodeBuilder<Nodes>`) and so
49
+ * the exported type stays source-compatible for callers that write it out.
46
50
  */
51
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
47
52
  export interface NodeBuilder<Nodes extends string> {
48
53
  /** Create a rectangular node [label] */
49
54
  rect(label: string, subtitle?: string): void;
@@ -3,7 +3,7 @@
3
3
  * @module Mermaid/builders/SequenceDiagram/types
4
4
  */
5
5
 
6
- import type { ParticipantType, MessageArrowType } from '../core/types';
6
+ import type { ParticipantType } from '../core/types';
7
7
 
8
8
  /**
9
9
  * Participants definition object
@@ -317,6 +317,10 @@ export function useMermaidRenderer({
317
317
 
318
318
  return () => {
319
319
  // Invalidate any in-flight async render from this effect run.
320
+ // The counter must be bumped on the LIVE ref, not on a copy taken
321
+ // when the effect ran — a copy would leave the stale render free to
322
+ // overwrite the current diagram when it resolves.
323
+ // eslint-disable-next-line react-hooks/exhaustive-deps
320
324
  renderSeqRef.current++;
321
325
  if (renderTimerRef.current) {
322
326
  clearTimeout(renderTimerRef.current);