edododraw 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +71 -0
  3. package/dist-lib/chunks/EdodoDraw-CUf224RG.js +5432 -0
  4. package/dist-lib/chunks/EdodoDraw-CUf224RG.js.map +1 -0
  5. package/dist-lib/engine/annotate/interact.d.ts +69 -0
  6. package/dist-lib/engine/annotate/interact.d.ts.map +1 -0
  7. package/dist-lib/engine/annotate/layer.d.ts +34 -0
  8. package/dist-lib/engine/annotate/layer.d.ts.map +1 -0
  9. package/dist-lib/engine/camera/controller.d.ts +42 -0
  10. package/dist-lib/engine/camera/controller.d.ts.map +1 -0
  11. package/dist-lib/engine/camera/easing.d.ts +9 -0
  12. package/dist-lib/engine/camera/easing.d.ts.map +1 -0
  13. package/dist-lib/engine/camera/fit.d.ts +21 -0
  14. package/dist-lib/engine/camera/fit.d.ts.map +1 -0
  15. package/dist-lib/engine/dsl/ast.d.ts +266 -0
  16. package/dist-lib/engine/dsl/ast.d.ts.map +1 -0
  17. package/dist-lib/engine/dsl/compile.d.ts +18 -0
  18. package/dist-lib/engine/dsl/compile.d.ts.map +1 -0
  19. package/dist-lib/engine/dsl/diagnostics.d.ts +42 -0
  20. package/dist-lib/engine/dsl/diagnostics.d.ts.map +1 -0
  21. package/dist-lib/engine/dsl/index.d.ts +19 -0
  22. package/dist-lib/engine/dsl/index.d.ts.map +1 -0
  23. package/dist-lib/engine/dsl/lexer.d.ts +8 -0
  24. package/dist-lib/engine/dsl/lexer.d.ts.map +1 -0
  25. package/dist-lib/engine/dsl/lower.d.ts +35 -0
  26. package/dist-lib/engine/dsl/lower.d.ts.map +1 -0
  27. package/dist-lib/engine/dsl/parser.d.ts +19 -0
  28. package/dist-lib/engine/dsl/parser.d.ts.map +1 -0
  29. package/dist-lib/engine/dsl/tokens.d.ts +66 -0
  30. package/dist-lib/engine/dsl/tokens.d.ts.map +1 -0
  31. package/dist-lib/engine/export.d.ts +22 -0
  32. package/dist-lib/engine/export.d.ts.map +1 -0
  33. package/dist-lib/engine/geometry.d.ts +55 -0
  34. package/dist-lib/engine/geometry.d.ts.map +1 -0
  35. package/dist-lib/engine/import/mermaid.d.ts +25 -0
  36. package/dist-lib/engine/import/mermaid.d.ts.map +1 -0
  37. package/dist-lib/engine/index.d.ts +32 -0
  38. package/dist-lib/engine/index.d.ts.map +1 -0
  39. package/dist-lib/engine/layout/dag.d.ts +29 -0
  40. package/dist-lib/engine/layout/dag.d.ts.map +1 -0
  41. package/dist-lib/engine/layout/grid.d.ts +12 -0
  42. package/dist-lib/engine/layout/grid.d.ts.map +1 -0
  43. package/dist-lib/engine/layout/index.d.ts +30 -0
  44. package/dist-lib/engine/layout/index.d.ts.map +1 -0
  45. package/dist-lib/engine/layout/radial.d.ts +18 -0
  46. package/dist-lib/engine/layout/radial.d.ts.map +1 -0
  47. package/dist-lib/engine/plugins/builtins.d.ts +10 -0
  48. package/dist-lib/engine/plugins/builtins.d.ts.map +1 -0
  49. package/dist-lib/engine/plugins/registry.d.ts +19 -0
  50. package/dist-lib/engine/plugins/registry.d.ts.map +1 -0
  51. package/dist-lib/engine/render/edges.d.ts +42 -0
  52. package/dist-lib/engine/render/edges.d.ts.map +1 -0
  53. package/dist-lib/engine/render/fontData.d.ts +8 -0
  54. package/dist-lib/engine/render/fontData.d.ts.map +1 -0
  55. package/dist-lib/engine/render/shapes.d.ts +26 -0
  56. package/dist-lib/engine/render/shapes.d.ts.map +1 -0
  57. package/dist-lib/engine/render/svgRenderer.d.ts +56 -0
  58. package/dist-lib/engine/render/svgRenderer.d.ts.map +1 -0
  59. package/dist-lib/engine/render/theme.css.d.ts +16 -0
  60. package/dist-lib/engine/render/theme.css.d.ts.map +1 -0
  61. package/dist-lib/engine/scene/anchors.d.ts +20 -0
  62. package/dist-lib/engine/scene/anchors.d.ts.map +1 -0
  63. package/dist-lib/engine/scene/defaults.d.ts +47 -0
  64. package/dist-lib/engine/scene/defaults.d.ts.map +1 -0
  65. package/dist-lib/engine/scene/palette.d.ts +71 -0
  66. package/dist-lib/engine/scene/palette.d.ts.map +1 -0
  67. package/dist-lib/engine/scene/query.d.ts +25 -0
  68. package/dist-lib/engine/scene/query.d.ts.map +1 -0
  69. package/dist-lib/engine/scene/types.d.ts +203 -0
  70. package/dist-lib/engine/scene/types.d.ts.map +1 -0
  71. package/dist-lib/engine/timeline/player.d.ts +44 -0
  72. package/dist-lib/engine/timeline/player.d.ts.map +1 -0
  73. package/dist-lib/fonts/CascadiaCode-Regular.woff2 +0 -0
  74. package/dist-lib/fonts/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2 +0 -0
  75. package/dist-lib/fonts/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2 +0 -0
  76. package/dist-lib/fonts/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2 +0 -0
  77. package/dist-lib/fonts/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2 +0 -0
  78. package/dist-lib/fonts/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2 +0 -0
  79. package/dist-lib/fonts/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2 +0 -0
  80. package/dist-lib/fonts/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2 +0 -0
  81. package/dist-lib/fonts/Nunito-Regular.woff2 +0 -0
  82. package/dist-lib/fonts/Virgil-Regular.woff2 +0 -0
  83. package/dist-lib/index.js +76 -0
  84. package/dist-lib/index.js.map +1 -0
  85. package/dist-lib/lib/EdodoDraw.d.ts +96 -0
  86. package/dist-lib/lib/EdodoDraw.d.ts.map +1 -0
  87. package/dist-lib/lib/index.d.ts +17 -0
  88. package/dist-lib/lib/index.d.ts.map +1 -0
  89. package/dist-lib/lib/react.d.ts +25 -0
  90. package/dist-lib/lib/react.d.ts.map +1 -0
  91. package/dist-lib/react.js +29 -0
  92. package/dist-lib/react.js.map +1 -0
  93. package/package.json +99 -0
@@ -0,0 +1,69 @@
1
+ /**
2
+ * LiveAnnotationController — real-time interactive annotation editing.
3
+ *
4
+ * Tools:
5
+ * select — pick / move / delete existing live annotations
6
+ * highlight — click an element to marker-highlight it
7
+ * underline — click an element to underline it
8
+ * box — click an element to draw a box around it
9
+ * circle — click an element to ring it
10
+ * arrow — drag to draw a pointer arrow (endpoints snap to elements)
11
+ * text — click to drop a sticky note (then type)
12
+ *
13
+ * Live annotations live in the renderer's 'live' world layer, so they track the
14
+ * camera and their anchored elements automatically. Everything is undoable and
15
+ * serializable back to EDodoDraw code (commit-to-code).
16
+ */
17
+ import type { Point } from "../geometry.js";
18
+ import type { Annotation, Scene } from "../scene/types.js";
19
+ import type { SvgRenderer } from "../render/svgRenderer.js";
20
+ export type Tool = "select" | "highlight" | "underline" | "box" | "circle" | "arrow" | "text";
21
+ export interface LiveState {
22
+ tool: Tool;
23
+ count: number;
24
+ canUndo: boolean;
25
+ canRedo: boolean;
26
+ selected: string | null;
27
+ }
28
+ export declare class LiveAnnotationController {
29
+ private renderer;
30
+ private getScene;
31
+ private layer;
32
+ private live;
33
+ private tool;
34
+ private selected;
35
+ private draft;
36
+ private undoStack;
37
+ private redoStack;
38
+ private seq;
39
+ private dragging;
40
+ onChange?: (s: LiveState) => void;
41
+ onRequestText?: (id: string, world: Point) => void;
42
+ constructor(renderer: SvgRenderer, getScene: () => Scene);
43
+ private emit;
44
+ setTool(t: Tool): void;
45
+ getTool(): Tool;
46
+ getAnnotations(): Annotation[];
47
+ private snapshot;
48
+ private id;
49
+ render(): void;
50
+ private drawSelection;
51
+ private anchorBBox;
52
+ /** returns true if the controller handled the event (skip camera pan). */
53
+ pointerDown(world: Point, _screen: Point): boolean;
54
+ pointerMove(world: Point): void;
55
+ pointerUp(world: Point): void;
56
+ private liveWith;
57
+ private hitLive;
58
+ handleKey(e: KeyboardEvent): boolean;
59
+ setText(id: string, text: string): void;
60
+ deleteSelected(): void;
61
+ undo(): void;
62
+ redo(): void;
63
+ clear(): void;
64
+ /** Serialize live annotations back into an EDodoDraw `annotate { … }` block. */
65
+ commitToCode(): string;
66
+ private serialize;
67
+ private cardinalBetween;
68
+ }
69
+ //# sourceMappingURL=interact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interact.d.ts","sourceRoot":"","sources":["../../../src/engine/annotate/interact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK5D,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9F,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AASD,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,IAAI,CAAkB;IAC9B,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,QAAQ,CAA+D;IAE/E,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IAClC,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;gBAEvC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,KAAK;IAOxD,OAAO,CAAC,IAAI;IAUZ,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI;IAQtB,OAAO,IAAI,IAAI;IAIf,cAAc,IAAI,UAAU,EAAE;IAI9B,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,EAAE;IAKV,MAAM,IAAI,IAAI;IAOd,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,UAAU;IAYlB,0EAA0E;IAC1E,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO;IA4ElD,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IA4B/B,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IA2B7B,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,OAAO;IAYf,SAAS,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO;IAcpC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAOvC,cAAc,IAAI,IAAI;IAStB,IAAI,IAAI,IAAI;IAUZ,IAAI,IAAI,IAAI;IASZ,KAAK,IAAI,IAAI;IAUb,gFAAgF;IAChF,YAAY,IAAI,MAAM;IAWtB,OAAO,CAAC,SAAS;IA8BjB,OAAO,CAAC,eAAe;CAgBxB"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * AnnotationLayer — renders annotations (scripted or live) into the renderer's
3
+ * world-space annotation layer so they track the camera and the elements they
4
+ * anchor to. Hand-drawn via rough.js to match the aesthetic.
5
+ *
6
+ * The same layer serves M3 (scripted timeline annotations) and M4 (real-time
7
+ * user annotations) — both are just `Annotation` records.
8
+ */
9
+ import type { Annotation, Scene } from "../scene/types.js";
10
+ import type { SvgRenderer } from "../render/svgRenderer.js";
11
+ export declare class AnnotationLayer {
12
+ private renderer;
13
+ private rc;
14
+ private root;
15
+ constructor(renderer: SvgRenderer, layer?: "annotations" | "live");
16
+ clear(): void;
17
+ /** Render a set of annotations (replaces current). */
18
+ render(scene: Scene, annotations: Annotation[], animate?: boolean): void;
19
+ private targetBBox;
20
+ private draw;
21
+ private drawHighlight;
22
+ private drawUnderline;
23
+ private drawStrike;
24
+ private drawBox;
25
+ private drawCircle;
26
+ private drawPointAt;
27
+ private drawCallout;
28
+ private drawNoteMarker;
29
+ private drawSpotlight;
30
+ private drawConnector;
31
+ private drawSticky;
32
+ private label;
33
+ }
34
+ //# sourceMappingURL=layer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../../../src/engine/annotate/layer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK5D,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,EAAE,CAAoC;IAC9C,OAAO,CAAC,IAAI,CAAc;gBAEd,QAAQ,EAAE,WAAW,EAAE,KAAK,GAAE,aAAa,GAAG,MAAsB;IAMhF,KAAK,IAAI,IAAI;IAIb,sDAAsD;IACtD,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,UAAO,GAAG,IAAI;IAiBrE,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,IAAI;IAwDZ,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,WAAW;IA+BnB,OAAO,CAAC,WAAW;IAuBnB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,aAAa;IA0CrB,OAAO,CAAC,UAAU;IAoBlB,OAAO,CAAC,KAAK;CAkBd"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * CameraController — drives the SvgRenderer's camera with interruptible,
3
+ * retargetable rAF tweens ("magic move"). Zoom is interpolated in log space so
4
+ * fast/slow zooms feel natural; position is eased linearly.
5
+ */
6
+ import type { BBox, Point } from "../geometry.js";
7
+ import type { EasingName, Scene } from "../scene/types.js";
8
+ import type { CameraTransform, SvgRenderer } from "../render/svgRenderer.js";
9
+ export interface MoveOptions {
10
+ durationMs?: number;
11
+ easing?: EasingName;
12
+ padding?: number;
13
+ }
14
+ export declare class CameraController {
15
+ private renderer;
16
+ private tween;
17
+ private raf;
18
+ /** notified every applied frame (for grid/overlay sync). */
19
+ onFrame?: (cam: CameraTransform) => void;
20
+ constructor(renderer: SvgRenderer);
21
+ get current(): CameraTransform;
22
+ /** Snap immediately (used by user pan/zoom). Cancels any tween. */
23
+ setImmediate(cam: CameraTransform): void;
24
+ stop(): void;
25
+ /** Animate to a target camera, retargeting smoothly if already animating. */
26
+ animateTo(to: CameraTransform, opts?: MoveOptions): Promise<void>;
27
+ private frame;
28
+ /** Duration heuristic: further travel + bigger zoom change => longer. */
29
+ private autoDuration;
30
+ fitAll(scene: Scene, opts?: MoveOptions): Promise<void>;
31
+ focus(scene: Scene, ids: string[], opts?: MoveOptions & {
32
+ zoom?: number;
33
+ }): Promise<void>;
34
+ focusBBox(box: BBox, opts?: MoveOptions & {
35
+ zoom?: number;
36
+ }): Promise<void>;
37
+ /** Zoom by a factor around a screen anchor (default: viewport center). */
38
+ zoomBy(factor: number, anchorScreen?: Point): void;
39
+ /** Pan by a screen-space delta. */
40
+ panByScreen(dx: number, dy: number): void;
41
+ }
42
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceR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AE,IAAI,EAAE,IAAI,GAAE,WAAW,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAM/E,0EAA0E;IAC1E,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI;IAYlD,mCAAmC;IACnC,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;CAI1C"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Easing catalog for camera magic-move and annotation reveals.
3
+ * All functions map t in [0,1] -> eased value (usually [0,1], some overshoot).
4
+ */
5
+ import type { EasingName } from "../scene/types.js";
6
+ export type EasingFn = (t: number) => number;
7
+ export declare const EASINGS: Record<EasingName, EasingFn>;
8
+ export declare function easingByName(name: EasingName | undefined): EasingFn;
9
+ //# sourceMappingURL=easing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"easing.d.ts","sourceRoot":"","sources":["../../../src/engine/camera/easing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAK7C,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,QAAQ,CAkBhD,CAAC;AAEF,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,CAEnE"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Pure camera math: compute the { cx, cy, zoom } that frames a bbox (or the
3
+ * whole scene) inside a viewport with padding. Shared by fitAll/focus and the
4
+ * animated CameraController (M3).
5
+ */
6
+ import type { BBox, Size } from "../geometry.js";
7
+ import type { CameraTransform } from "../render/svgRenderer.js";
8
+ export interface FitOptions {
9
+ /** Screen-space padding around the target, in px. */
10
+ padding?: number;
11
+ minZoom?: number;
12
+ maxZoom?: number;
13
+ }
14
+ /** Camera that frames `bbox` within `viewport`. */
15
+ export declare function cameraForBBox(bbox: BBox, viewport: Size, opts?: FitOptions): CameraTransform;
16
+ /** Camera that centers a target zoomed to an explicit factor. */
17
+ export declare function cameraForCenter(center: {
18
+ x: number;
19
+ y: number;
20
+ }, zoom: number): CameraTransform;
21
+ //# sourceMappingURL=fit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit.d.ts","sourceRoot":"","sources":["../../../src/engine/camera/fit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,WAAW,UAAU;IACzB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAE,UAAe,GAAG,eAAe,CAchG;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,CAE/F"}
@@ -0,0 +1,266 @@
1
+ /**
2
+ * AST for the EDodoDraw DSL. A pragmatic, compile-oriented tree: it captures
3
+ * everything the compiler needs to emit a Scene IR (structure + annotations +
4
+ * timeline steps) while staying close to the surface grammar.
5
+ */
6
+ export interface Span {
7
+ start: number;
8
+ end: number;
9
+ line: number;
10
+ col: number;
11
+ }
12
+ export type Value = {
13
+ t: "str";
14
+ v: string;
15
+ } | {
16
+ t: "num";
17
+ v: number;
18
+ unit: string | null;
19
+ } | {
20
+ t: "color";
21
+ v: string;
22
+ } | {
23
+ t: "bool";
24
+ v: boolean;
25
+ } | {
26
+ t: "ident";
27
+ v: string;
28
+ } | {
29
+ t: "token";
30
+ v: string;
31
+ } | {
32
+ t: "class";
33
+ v: string;
34
+ } | {
35
+ t: "tuple";
36
+ v: Value[];
37
+ } | {
38
+ t: "list";
39
+ v: Value[];
40
+ } | {
41
+ t: "call";
42
+ name: string;
43
+ args: Value[];
44
+ } | {
45
+ t: "styled";
46
+ name: string;
47
+ block: Attr[];
48
+ } | {
49
+ t: "ref";
50
+ id: string;
51
+ sub?: string;
52
+ uv?: [number, number];
53
+ };
54
+ export interface Attr {
55
+ key: string;
56
+ value: Value;
57
+ span: Span;
58
+ }
59
+ export type AttrBlock = Attr[];
60
+ export declare function attr(block: AttrBlock, key: string): Value | undefined;
61
+ export interface Endpoint {
62
+ id: string;
63
+ sub?: string;
64
+ uv?: [number, number];
65
+ /** inline-declared node (e.g. `a --> b[New]`). */
66
+ inline?: NodeDecl;
67
+ span: Span;
68
+ }
69
+ export interface AnchorDecl {
70
+ type: "anchor";
71
+ name: string;
72
+ on?: string;
73
+ spec: AnchorSpecAst;
74
+ span: Span;
75
+ }
76
+ export type AnchorSpecAst = {
77
+ kind: "cardinal";
78
+ v: string;
79
+ } | {
80
+ kind: "side";
81
+ side: string;
82
+ frac: number;
83
+ } | {
84
+ kind: "uv";
85
+ u: number;
86
+ v: number;
87
+ };
88
+ export interface NodeDecl {
89
+ type: "node";
90
+ id: string;
91
+ label?: string;
92
+ shape?: string;
93
+ classes: string[];
94
+ attrs: AttrBlock;
95
+ anchors: AnchorDecl[];
96
+ span: Span;
97
+ }
98
+ export interface EdgeOpInfo {
99
+ glyph: string;
100
+ midLabel?: string;
101
+ }
102
+ export interface EdgeDecl {
103
+ type: "edge";
104
+ id?: string;
105
+ /** fan groups connected by ops: groups[0] --op0--> groups[1] --op1--> ... */
106
+ groups: Endpoint[][];
107
+ ops: EdgeOpInfo[];
108
+ label?: string;
109
+ attrs: AttrBlock;
110
+ span: Span;
111
+ }
112
+ export interface GroupDecl {
113
+ type: "group";
114
+ id: string;
115
+ label?: string;
116
+ attrs: AttrBlock;
117
+ layout?: LayoutDecl;
118
+ items: SceneStmt[];
119
+ span: Span;
120
+ }
121
+ export interface LayoutDecl {
122
+ type: "layout";
123
+ kind: string;
124
+ attrs: AttrBlock;
125
+ span: Span;
126
+ }
127
+ export interface UseStmt {
128
+ type: "use";
129
+ what: "theme" | "class" | "macro";
130
+ name: string;
131
+ args?: Value[];
132
+ span: Span;
133
+ }
134
+ export interface ClassApplyStmt {
135
+ type: "classapply";
136
+ id: string;
137
+ classes: string[];
138
+ span: Span;
139
+ }
140
+ export interface MermaidDecl {
141
+ type: "mermaid";
142
+ body: string;
143
+ span: Span;
144
+ }
145
+ export type SceneStmt = NodeDecl | EdgeDecl | GroupDecl | LayoutDecl | AnchorDecl | UseStmt | StyleDecl | AnnotateDecl | MermaidDecl | ClassApplyStmt;
146
+ export interface AnnotationCmd {
147
+ type: "annotcmd";
148
+ kind: string;
149
+ target?: Endpoint;
150
+ targetList?: Value;
151
+ text?: string;
152
+ attrs: AttrBlock;
153
+ span: Span;
154
+ }
155
+ export interface AnnotateDecl {
156
+ type: "annotate";
157
+ name?: string;
158
+ commands: AnnotationCmd[];
159
+ span: Span;
160
+ }
161
+ export interface CameraStmt {
162
+ type: "camera";
163
+ op?: string;
164
+ targets?: Value[];
165
+ zoom?: number;
166
+ over?: number;
167
+ ease?: Value;
168
+ pad?: number;
169
+ pan?: [number, number];
170
+ attrs: AttrBlock;
171
+ span: Span;
172
+ }
173
+ export interface RevealCmd {
174
+ type: "revealcmd";
175
+ verb: string;
176
+ targets: Value[];
177
+ with?: string;
178
+ attrs: AttrBlock;
179
+ span: Span;
180
+ }
181
+ export interface RevealBlock {
182
+ type: "reveal";
183
+ commands: RevealCmd[];
184
+ span: Span;
185
+ }
186
+ export interface StaggerStmt {
187
+ type: "stagger";
188
+ delayMs: number;
189
+ commands: (RevealCmd | AnnotationCmd)[];
190
+ span: Span;
191
+ }
192
+ export interface Prop {
193
+ type: "prop";
194
+ key: string;
195
+ value: Value;
196
+ span: Span;
197
+ }
198
+ export type BeatItem = CameraStmt | AnnotateDecl | RevealBlock | StaggerStmt | AnnotationCmd | RevealCmd | Prop;
199
+ export interface BeatDecl {
200
+ type: "beat";
201
+ id: string;
202
+ title?: string;
203
+ items: BeatItem[];
204
+ span: Span;
205
+ }
206
+ export interface TimelineDecl {
207
+ type: "timeline";
208
+ name?: string;
209
+ props: Prop[];
210
+ beats: BeatDecl[];
211
+ span: Span;
212
+ }
213
+ export interface MetaDecl {
214
+ type: "meta";
215
+ attrs: AttrBlock;
216
+ span: Span;
217
+ }
218
+ export interface ThemeDecl {
219
+ type: "theme";
220
+ name: string;
221
+ extends?: string;
222
+ tokens: {
223
+ name: string;
224
+ value: Value;
225
+ }[];
226
+ props: AttrBlock;
227
+ span: Span;
228
+ }
229
+ export interface StyleDecl {
230
+ type: "style";
231
+ name: string;
232
+ extends?: string;
233
+ attrs: AttrBlock;
234
+ span: Span;
235
+ }
236
+ export interface DefaultsDecl {
237
+ type: "defaults";
238
+ rules: {
239
+ target: string;
240
+ attrs: AttrBlock;
241
+ }[];
242
+ span: Span;
243
+ }
244
+ export interface SceneDecl {
245
+ type: "scene";
246
+ name?: string;
247
+ statements: SceneStmt[];
248
+ span: Span;
249
+ }
250
+ export interface VersionDecl {
251
+ type: "version";
252
+ value: number;
253
+ span: Span;
254
+ }
255
+ export interface ImportDecl {
256
+ type: "import";
257
+ path: string;
258
+ as?: string;
259
+ span: Span;
260
+ }
261
+ export type TopStmt = VersionDecl | MetaDecl | ImportDecl | ThemeDecl | StyleDecl | DefaultsDecl | SceneDecl | TimelineDecl | AnnotateDecl | MermaidDecl;
262
+ export interface Program {
263
+ type: "program";
264
+ statements: TopStmt[];
265
+ }
266
+ //# sourceMappingURL=ast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,OAAO,EAAE,CAAC;CACvB"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Compiler: EDodoDraw AST -> Scene IR. Applies the style cascade (theme tokens
3
+ * -> defaults -> classes -> inline), expands edge chains/fan-outs, lifts
4
+ * annotate blocks and timeline beats into the IR, then runs auto-layout.
5
+ */
6
+ import type { Annotation, Scene } from "../scene/types.js";
7
+ import type { AnnotationCmd, Program, Value } from "./ast.js";
8
+ import { DiagnosticBag } from "./diagnostics.js";
9
+ export interface CompileOptions {
10
+ diagnostics?: DiagnosticBag;
11
+ }
12
+ export interface CompileResult {
13
+ scene: Scene;
14
+ diagnostics: DiagnosticBag;
15
+ }
16
+ export declare function compileProgram(program: Program, opts?: CompileOptions): CompileResult;
17
+ export declare function annotationFromCmd(cmd: AnnotationCmd, tokens: Map<string, Value>, origin: "script" | "live"): Annotation | null;
18
+ //# sourceMappingURL=compile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/engine/dsl/compile.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EACV,UAAU,EAOV,KAAK,EAGN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,aAAa,EAOb,OAAO,EAEP,KAAK,EACN,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBjD,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;CAC5B;AAUD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAE,cAAmB,GAAG,aAAa,CAmRzF;AA0UD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,CA0B9H"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Diagnostics — structured, multi-error, with source spans and fix hints
3
+ * (language spec §12.8). The parser and resolver accumulate these; none of them
4
+ * abort the pipeline (except a total lexer failure, which can't happen since the
5
+ * lexer is permissive).
6
+ */
7
+ export type Severity = "error" | "warning" | "info";
8
+ export interface Diagnostic {
9
+ severity: Severity;
10
+ code: string;
11
+ message: string;
12
+ line: number;
13
+ col: number;
14
+ start: number;
15
+ end: number;
16
+ expected?: string;
17
+ found?: string;
18
+ hint?: string;
19
+ }
20
+ export declare class DiagnosticBag {
21
+ readonly items: Diagnostic[];
22
+ add(d: Diagnostic): void;
23
+ error(code: string, message: string, at: {
24
+ line: number;
25
+ col: number;
26
+ start: number;
27
+ end: number;
28
+ }, extra?: Partial<Diagnostic>): void;
29
+ warn(code: string, message: string, at: {
30
+ line: number;
31
+ col: number;
32
+ start: number;
33
+ end: number;
34
+ }, extra?: Partial<Diagnostic>): void;
35
+ get hasErrors(): boolean;
36
+ get errors(): Diagnostic[];
37
+ }
38
+ /** Nearest match from a closed menu (Levenshtein) — for "did you mean" hints. */
39
+ export declare function nearest(word: string, menu: Iterable<string>): string | null;
40
+ /** Human-readable formatting of a diagnostic against the source (spec §12.8). */
41
+ export declare function formatDiagnostic(d: Diagnostic, source: string, file?: string): string;
42
+ //# sourceMappingURL=diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/engine/dsl/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MA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SAAc,GAAG,MAAM,CAQ1F"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Public DSL entrypoint: source text -> { scene, diagnostics }.
3
+ * This is the "100% code -> diagram" contract.
4
+ */
5
+ import { DiagnosticBag } from "./diagnostics.js";
6
+ import type { Scene } from "../scene/types.js";
7
+ export interface CompileEddResult {
8
+ scene: Scene;
9
+ diagnostics: DiagnosticBag;
10
+ /** Formatted, human-readable diagnostics (one block each). */
11
+ report: string[];
12
+ }
13
+ export declare function compileEdd(source: string): CompileEddResult;
14
+ export { parse } from "./parser.js";
15
+ export { compileProgram } from "./compile.js";
16
+ export { lex } from "./lexer.js";
17
+ export { DiagnosticBag, formatDiagnostic } from "./diagnostics.js";
18
+ export type { Diagnostic } from "./diagnostics.js";
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/engine/dsl/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAoB,MAAM,kBAAkB,CAAC;AAEnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,8DAA8D;IAC9D,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAK3D;AAED,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Lexer for the EDodoDraw DSL. Permissive (never throws), position-tracking,
3
+ * maximal-munch for edge operators. See tokens.ts for the token model and the
4
+ * language spec §3/§12 for rules.
5
+ */
6
+ import { type Token } from "./tokens.js";
7
+ export declare function lex(source: string): Token[];
8
+ //# sourceMappingURL=lexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexer.d.ts","sourceRoot":"","sources":["../../../src/engine/dsl/lexer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAUzD,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAoP3C"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Lowering helpers: map DSL surface enums/glyphs onto Scene IR values.
3
+ * Kept separate from the parser so the same tables document the language and
4
+ * drive the compiler.
5
+ */
6
+ import type { ArrowAnimationKind, ArrowheadKind, EdgeRouting, EasingName, FillStyle, ShapeKind, StrokeStyle } from "../scene/types.js";
7
+ import type { Value } from "./ast.js";
8
+ /** DSL shape name -> renderable ShapeKind. */
9
+ export declare const SHAPE_MAP: Record<string, ShapeKind>;
10
+ export declare function mapShape(name: string | undefined): ShapeKind;
11
+ export interface GlyphLowering {
12
+ strokeStyle: StrokeStyle;
13
+ startArrowhead: ArrowheadKind;
14
+ endArrowhead: ArrowheadKind;
15
+ animation?: ArrowAnimationKind;
16
+ strokeWidthMul?: number;
17
+ routing?: EdgeRouting;
18
+ }
19
+ /** Edge glyph -> default styling (spec §6.2). Overridable by the trailing block. */
20
+ export declare function lowerGlyph(glyph: string): GlyphLowering;
21
+ export declare function mapStrokeWidth(v: Value): number | undefined;
22
+ export declare function mapRoughness(v: Value): number | undefined;
23
+ export declare function mapFillStyle(v: Value): FillStyle | undefined;
24
+ export declare function mapStrokeStyle(v: Value): StrokeStyle | undefined;
25
+ export declare function mapRouting(v: Value): EdgeRouting | undefined;
26
+ export declare function mapArrowhead(v: Value): ArrowheadKind | undefined;
27
+ export declare function mapAnimation(v: Value): {
28
+ kind: ArrowAnimationKind;
29
+ speed?: number;
30
+ } | undefined;
31
+ export declare function mapEasing(v: Value | undefined): EasingName;
32
+ /** Resolve a color-ish value to a hex/CSS string, following $token indirection. */
33
+ export declare function resolveColor(v: Value, tokens: Map<string, Value>, kind: "stroke" | "fill", depth?: number): string | null;
34
+ export declare function numberOf(v: Value | undefined): number | undefined;
35
+ //# sourceMappingURL=lower.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lower.d.ts","sourceRoot":"","sources":["../../../src/engine/dsl/lower.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,8CAA8C;AAC9C,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CA4B/C,CAAC;AAEF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAI5D;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,aAAa,CAAC;IAC9B,YAAY,EAAE,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAkCvD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAM3D;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAMzD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAI5D;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,SAAS,CAGhE;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,SAAS,CAY5D;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,GAAG,aAAa,GAAG,SAAS,CAGhE;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAe/F;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,UAAU,CAa1D;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,KAAK,SAAI,GAAG,MAAM,GAAG,IAAI,CAiBpH;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEjE"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Recursive-descent parser for the EDodoDraw DSL.
3
+ *
4
+ * Strategy (spec §12.1): keyword-dispatched, LL(2). Two lookahead spots need
5
+ * care: node-vs-edge (§12.3) and brace-role D1 (§12.4). Shape sugar (`[Label]`,
6
+ * `((Label))`, `{Label}` …) is captured RAW from the source by offset, so the
7
+ * permissive lexer never has to understand label contents.
8
+ *
9
+ * Errors are recovered at statement/block boundaries and accumulated; the
10
+ * parser returns a best-effort AST plus a DiagnosticBag.
11
+ */
12
+ import { DiagnosticBag } from "./diagnostics.js";
13
+ import type { Program } from "./ast.js";
14
+ export interface ParseResult {
15
+ program: Program;
16
+ diagnostics: DiagnosticBag;
17
+ }
18
+ export declare function parse(source: string): ParseResult;
19
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/engine/dsl/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,KAAK,EAmBV,OAAO,EAcR,MAAM,UAAU,CAAC;AAiBlB,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,aAAa,CAAC;CAC5B;AAED,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAIjD"}