docmedown 0.1.2 → 0.1.4

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.
@@ -32,6 +32,18 @@ export interface DiagramSize {
32
32
  width: number;
33
33
  height: number;
34
34
  }
35
+ export interface DiagramCamera {
36
+ x: number;
37
+ y: number;
38
+ }
39
+ export interface DiagramCameraBounds {
40
+ x: number;
41
+ y: number;
42
+ }
43
+ export interface DiagramPanResult {
44
+ camera: DiagramCamera;
45
+ remainder: DiagramCamera;
46
+ }
35
47
  export interface DiagramSubgraph {
36
48
  id: string;
37
49
  label: string;
@@ -46,6 +58,13 @@ export interface DiagramSubgraph {
46
58
  export declare function readDiagramSize(svg: string): DiagramSize | null;
47
59
  /** Returns the largest scale that contains the entire diagram in a viewport. */
48
60
  export declare function calculateDiagramFit(diagram: DiagramSize, viewport: DiagramSize, allowUpscale?: boolean): number;
61
+ /** Returns the camera travel available on each axis around a centered diagram. */
62
+ export declare function calculateDiagramCameraBounds(diagram: DiagramSize, viewport: DiagramSize): DiagramCameraBounds;
63
+ /**
64
+ * Applies a camera-space pan delta and returns any movement left after reaching
65
+ * a bound. The caller can hand the vertical remainder to document scrolling.
66
+ */
67
+ export declare function panDiagramCamera(current: DiagramCamera, delta: DiagramCamera, bounds: DiagramCameraBounds): DiagramPanResult;
49
68
  /** Wraps a raw Mermaid definition in a portable Markdown fence. */
50
69
  export declare function formatDiagramMarkdown(source: string): string;
51
70
  /** Extracts complete Mermaid `subgraph ... end` blocks, including nested blocks. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docmedown",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "The simplest MarkDown documenter yet. CLI & Web Script React SPA documentation engine.",
5
5
  "main": "./dist/docmedown.cjs",
6
6
  "module": "./dist/docmedown.mjs",