edododraw 0.1.3 → 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.
- package/dist-lib/chunks/{EdodoDraw-BCfKu4Q3.js → EdodoDraw-BdJowisU.js} +82 -30
- package/dist-lib/chunks/EdodoDraw-BdJowisU.js.map +1 -0
- package/dist-lib/engine/dsl/compile.d.ts +6 -0
- package/dist-lib/engine/dsl/compile.d.ts.map +1 -1
- package/dist-lib/engine/dsl/index.d.ts +5 -1
- package/dist-lib/engine/dsl/index.d.ts.map +1 -1
- package/dist-lib/engine/render/svgRenderer.d.ts.map +1 -1
- package/dist-lib/engine/scene/palette.d.ts +8 -0
- package/dist-lib/engine/scene/palette.d.ts.map +1 -1
- package/dist-lib/index.js +22 -21
- package/dist-lib/lib/EdodoDraw.d.ts +11 -0
- package/dist-lib/lib/EdodoDraw.d.ts.map +1 -1
- package/dist-lib/lib/react.d.ts +6 -1
- package/dist-lib/lib/react.d.ts.map +1 -1
- package/dist-lib/llms-full.txt +66 -14
- package/dist-lib/react.js +6 -2
- package/dist-lib/react.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/chunks/EdodoDraw-BCfKu4Q3.js.map +0 -1
|
@@ -8,6 +8,12 @@ import type { AnnotationCmd, Program, Value } from "./ast.js";
|
|
|
8
8
|
import { DiagnosticBag } from "./diagnostics.js";
|
|
9
9
|
export interface CompileOptions {
|
|
10
10
|
diagnostics?: DiagnosticBag;
|
|
11
|
+
/**
|
|
12
|
+
* Force the render mode, overriding the mode derived from the active theme
|
|
13
|
+
* name. Used by the app/embedder's light/dark toggle so any diagram can be
|
|
14
|
+
* viewed dark without editing its source. `undefined` = derive from the DSL.
|
|
15
|
+
*/
|
|
16
|
+
mode?: "light" | "dark";
|
|
11
17
|
}
|
|
12
18
|
export interface CompileResult {
|
|
13
19
|
scene: Scene;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/engine/dsl/compile.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,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;
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/engine/dsl/compile.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,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;IAC5B;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACzB;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,CA+RzF;AAoWD,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"}
|
|
@@ -10,7 +10,11 @@ export interface CompileEddResult {
|
|
|
10
10
|
/** Formatted, human-readable diagnostics (one block each). */
|
|
11
11
|
report: string[];
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export interface CompileEddOptions {
|
|
14
|
+
/** Force light/dark render mode, overriding the DSL's declared theme. */
|
|
15
|
+
mode?: "light" | "dark";
|
|
16
|
+
}
|
|
17
|
+
export declare function compileEdd(source: string, opts?: CompileEddOptions): CompileEddResult;
|
|
14
18
|
export { parse } from "./parser.js";
|
|
15
19
|
export { compileProgram } from "./compile.js";
|
|
16
20
|
export { lex } from "./lexer.js";
|
|
@@ -1 +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,
|
|
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,MAAM,WAAW,iBAAiB;IAChC,yEAAyE;IACzE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACzB;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAsB,GAAG,gBAAgB,CAKzF;AA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C,MAAM,CAA8C;IAC5D,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,KAAK,CAAsB;gBAEvB,SAAS,EAAE,WAAW;IAIlC,KAAK,IAAI,IAAI;IAkDb,OAAO,IAAI,IAAI;IAIf,OAAO,CAAC,UAAU;IAelB,uDAAuD;IACvD,OAAO,IAAI;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAMnC,eAAe,IAAI;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAI3C,SAAS,IAAI,eAAe;IAI5B,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAOvC,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK;IAQ9B,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK;IAQ9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,WAAW;IAI3F,6EAA6E;IAC7E,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI;IAS1C;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI;IAcxD,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IA6C1B,OAAO,CAAC,UAAU;IAmBlB,OAAO,CAAC,SAAS;IA+BjB,OAAO,CAAC,SAAS;IAuBjB,OAAO,CAAC,gBAAgB;CA6BzB"}
|
|
@@ -42,6 +42,14 @@ export declare const FILL_PALETTE: {
|
|
|
42
42
|
readonly white: "#ffffff";
|
|
43
43
|
};
|
|
44
44
|
export type ColorName = keyof typeof STROKE_PALETTE;
|
|
45
|
+
/**
|
|
46
|
+
* Perceived-luminance test for a color, used to pick a contrasting "ink"
|
|
47
|
+
* (stroke/text) in dark mode: a light fill wants dark ink, a dark (or absent)
|
|
48
|
+
* fill wants light ink. Only hex is measured precisely; named/rgb() colors —
|
|
49
|
+
* which in this engine are almost always the light Open-Colors pastels — default
|
|
50
|
+
* to "light" so their ink stays dark and readable.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isLightColor(color: string | null | undefined): boolean;
|
|
45
53
|
/**
|
|
46
54
|
* Resolve a color token to a hex string.
|
|
47
55
|
* - Named strokes: "green" -> #2f9e44
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../../src/engine/scene/palette.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;CAgBjB,CAAC;AAEX,uEAAuE;AACvE,eAAO,MAAM,YAAY;0BACF,MAAM,GAAG,IAAI;mBACpB,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;CAgBnB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,cAAc,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQjF;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAOpE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAKhF;AAED,oEAAoE;AACpE,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC;AAEX,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,YAAwB,GAAG,MAAM,CAMjG"}
|
|
1
|
+
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../../src/engine/scene/palette.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;CAgBjB,CAAC;AAEX,uEAAuE;AACvE,eAAO,MAAM,YAAY;0BACF,MAAM,GAAG,IAAI;mBACpB,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;CAgBnB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,cAAc,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAWtE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQjF;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAOpE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAKhF;AAED,oEAAoE;AACpE,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC;AAEX,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,YAAwB,GAAG,MAAM,CAMjG"}
|
package/dist-lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, C, D, a, E, b, c, F, d, L, e, M, S, f, T, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, B, G, H, I, J, K, N, O, P, Q, R, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap } from "./chunks/EdodoDraw-
|
|
1
|
+
import { A, C, D, a, E, b, c, F, d, L, e, M, S, f, T, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, B, G, H, I, J, K, N, O, P, Q, R, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq } from "./chunks/EdodoDraw-BdJowisU.js";
|
|
2
2
|
export {
|
|
3
3
|
A as AnnotationLayer,
|
|
4
4
|
C as CameraController,
|
|
@@ -60,25 +60,26 @@ export {
|
|
|
60
60
|
a3 as hitTestNode,
|
|
61
61
|
a4 as injectMermaid,
|
|
62
62
|
a5 as isEmptyBBox,
|
|
63
|
-
a6 as
|
|
64
|
-
a7 as
|
|
65
|
-
a8 as
|
|
66
|
-
a9 as
|
|
67
|
-
aa as
|
|
68
|
-
ab as
|
|
69
|
-
ac as
|
|
70
|
-
ad as
|
|
71
|
-
ae as
|
|
72
|
-
af as
|
|
73
|
-
ag as
|
|
74
|
-
ah as
|
|
75
|
-
ai as
|
|
76
|
-
aj as
|
|
77
|
-
ak as
|
|
78
|
-
al as
|
|
79
|
-
am as
|
|
80
|
-
an as
|
|
81
|
-
ao as
|
|
82
|
-
ap as
|
|
63
|
+
a6 as isLightColor,
|
|
64
|
+
a7 as lerp,
|
|
65
|
+
a8 as listShapePlugins,
|
|
66
|
+
a9 as makeEdge,
|
|
67
|
+
aa as makeNode,
|
|
68
|
+
ab as nodeBBox,
|
|
69
|
+
ac as nodeRect,
|
|
70
|
+
ad as nodeRectOf,
|
|
71
|
+
ae as pairedStrokeForFill,
|
|
72
|
+
af as pointInRect,
|
|
73
|
+
ag as rectCenter,
|
|
74
|
+
ah as rectToBBox,
|
|
75
|
+
ai as registerShape,
|
|
76
|
+
aj as renameNode,
|
|
77
|
+
ak as resolveAnchor,
|
|
78
|
+
al as resolveFill,
|
|
79
|
+
am as resolveMarker,
|
|
80
|
+
an as resolveStroke,
|
|
81
|
+
ao as sceneBBox,
|
|
82
|
+
ap as styleNode,
|
|
83
|
+
aq as writeOverrides
|
|
83
84
|
};
|
|
84
85
|
//# sourceMappingURL=index.js.map
|
|
@@ -49,6 +49,8 @@ export declare class EdodoDraw {
|
|
|
49
49
|
private listeners;
|
|
50
50
|
private textInput;
|
|
51
51
|
private closeInput;
|
|
52
|
+
private colorScheme;
|
|
53
|
+
private hasRendered;
|
|
52
54
|
private cleanup;
|
|
53
55
|
constructor(container: HTMLElement, options?: EdodoDrawOptions);
|
|
54
56
|
private onCameraFrame;
|
|
@@ -70,6 +72,15 @@ export declare class EdodoDraw {
|
|
|
70
72
|
render(source: string): Promise<RenderResult>;
|
|
71
73
|
getScene(): Scene;
|
|
72
74
|
getSource(): string;
|
|
75
|
+
/**
|
|
76
|
+
* Force light/dark rendering, overriding the diagram's declared theme. Affects
|
|
77
|
+
* the canvas background, the dotted grid, and the diagram's default ink
|
|
78
|
+
* (strokes/text adapt for contrast on the dark canvas; explicit colors are
|
|
79
|
+
* kept). Pass `null` to fall back to the DSL's own theme. Re-renders the
|
|
80
|
+
* current source. Cheap and idempotent — no-ops if the scheme is unchanged.
|
|
81
|
+
*/
|
|
82
|
+
setColorScheme(mode: "light" | "dark" | null): void;
|
|
83
|
+
getColorScheme(): "light" | "dark" | null;
|
|
73
84
|
fit(animate?: boolean): void;
|
|
74
85
|
focus(ids: string[], opts?: {
|
|
75
86
|
zoom?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdodoDraw.d.ts","sourceRoot":"","sources":["../../src/lib/EdodoDraw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,wBAAwB,EAAE,KAAK,SAAS,EAAa,MAAM,gCAAgC,CAAC;AACrG,OAAO,EAAE,cAAc,EAAE,KAAK,SAAS,EAAiB,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAM/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,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OAAO,CAAC,eAAe;CAuDxB"}
|
package/dist-lib/lib/react.d.ts
CHANGED
|
@@ -14,12 +14,17 @@ export interface EdodoDrawViewProps extends EdodoDrawOptions {
|
|
|
14
14
|
source: string;
|
|
15
15
|
className?: string;
|
|
16
16
|
style?: CSSProperties;
|
|
17
|
+
/**
|
|
18
|
+
* Force light/dark rendering, overriding the diagram's declared theme.
|
|
19
|
+
* `null`/omitted follows the DSL's own theme. See `EdodoDraw.setColorScheme`.
|
|
20
|
+
*/
|
|
21
|
+
colorScheme?: "light" | "dark" | null;
|
|
17
22
|
/** Called once with the imperative instance after mount. */
|
|
18
23
|
onReady?: (edd: EdodoDraw) => void;
|
|
19
24
|
onDiagnostics?: (diags: Diagnostic[]) => void;
|
|
20
25
|
onState?: (state: PlayerState) => void;
|
|
21
26
|
}
|
|
22
|
-
export declare function EdodoDrawView({ source, className, style, onReady, onDiagnostics, onState, ...opts }: EdodoDrawViewProps): import("react").JSX.Element;
|
|
27
|
+
export declare function EdodoDrawView({ source, className, style, colorScheme, onReady, onDiagnostics, onState, ...opts }: EdodoDrawViewProps): import("react").JSX.Element;
|
|
23
28
|
export { EdodoDraw } from "./EdodoDraw.js";
|
|
24
29
|
export type { EdodoDrawOptions } from "./EdodoDraw.js";
|
|
25
30
|
//# sourceMappingURL=react.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/lib/react.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,mEAA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EAAE,WAAW,KAAK,IAAI,CAAC;CACxC;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,+BA8BpI;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist-lib/llms-full.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# EDodoDraw — complete documentation (v0.1.
|
|
1
|
+
# EDodoDraw — complete documentation (v0.1.4)
|
|
2
2
|
|
|
3
3
|
> A 100% code/syntax-to-diagram engine with the Excalidraw hand-drawn aesthetic, magic-move camera, scriptable + real-time annotations, animated arrows, and first-class Mermaid import.
|
|
4
4
|
>
|
|
@@ -76,6 +76,8 @@ Everything else is optional layering on top.
|
|
|
76
76
|
| `overrides { id at (x, y) [size (w, h)] … }` | Pinned positions/sizes (usually machine-written by direct editing — see §11). |
|
|
77
77
|
| `mermaid """ … """` | Import a raw Mermaid diagram (see IMPORT_AND_EXPORT_GUIDE.md). |
|
|
78
78
|
|
|
79
|
+
A theme whose **name contains `dark`** renders in dark mode (near‑black canvas, light default ink, dark grid). An embedder can override the diagram's declared theme at the view level — `EdodoDraw.setColorScheme("dark")`, `<EdodoDrawView colorScheme>`, or `compileEdd(src, { mode })` — so the same source follows a host app's light/dark toggle (see INTEGRATION_GUIDE.md). Colors you set explicitly are always kept; only *default* ink adapts for contrast.
|
|
80
|
+
|
|
79
81
|
Comments: `// line`, `%% line` (Mermaid-style), `/* block */` (nestable).
|
|
80
82
|
|
|
81
83
|
---
|
|
@@ -310,16 +312,32 @@ timeline story {
|
|
|
310
312
|
| Pan | `camera pan (x, y)` | `camera { pan: (x,y) }` |
|
|
311
313
|
| Reset | `camera reset` | — |
|
|
312
314
|
|
|
313
|
-
Shared modifiers: `zoom N` · `over <ms|s>` · `ease <easing>` · `pad N`.
|
|
314
|
-
Easings: `linear ease ease-in ease-out ease-in-out back-out anticipate spring` — plus `magic` (
|
|
315
|
+
Shared modifiers: `zoom N` · `over <ms|s>` (alias `duration`) · `ease <easing>` · `pad N`. Op aliases: `fit <target>` / `center <target>` / `follow <target>` all normalize to `focus`; `reset` → `fit-all`. `pan (x,y)` also accepts `pan to (x,y)` / `pan by (x,y)`.
|
|
316
|
+
Easings: `linear ease ease-in ease-out ease-in-out back-out anticipate spring` — plus `magic` / `bounce` (aliases for the tuned spring). `spring(…)` is accepted and animates with the tuned spring; `cubic-bezier(…)` is accepted syntax but currently falls back to the default `ease-in-out` (parameters for both are reserved for a future release).
|
|
317
|
+
An **explicit `zoom N` is applied uncapped** (a beat can zoom past the interactive limits); wheel/gesture zoom is clamped to 0.05–8×. Numeric contracts (fit padding/maxZoom, auto-duration) are in [CAMERA_AND_TIMELINE_GUIDE.md](CAMERA_AND_TIMELINE_GUIDE.md).
|
|
318
|
+
|
|
319
|
+
### Reveal / hide (with entrance effects)
|
|
320
|
+
|
|
321
|
+
`reveal { show <targets> }` reveals nodes/edges; `reveal { hide <targets> }` hides them. Visibility is **sticky** across beats until changed. Add an entrance animation with `with <effect>`, replayed each time the beat is entered:
|
|
322
|
+
|
|
323
|
+
| Effect | `with …` | Also as a verb | Motion |
|
|
324
|
+
|---|---|---|---|
|
|
325
|
+
| Fade | `with fade-in` (alias `fade`) | `fade-in <t>` | opacity 0→1 (~0.4s) |
|
|
326
|
+
| Pop | `with pop` (alias `emphasize`) | `pop <t>` | scale-bounce in (~0.45s) |
|
|
327
|
+
| Draw-on | `with draw-on` (aliases `draw`, `sweep`) | `draw-on <t>` | left-to-right marker sweep (~0.5s) |
|
|
315
328
|
|
|
316
|
-
|
|
329
|
+
```edd
|
|
330
|
+
reveal { show all with fade-in } // whole diagram fades in
|
|
331
|
+
reveal { show [db, cache] with pop } // pop just these two
|
|
332
|
+
reveal { draw-on [gw] } // effect-verb form
|
|
333
|
+
reveal { show legacy } // no `with` -> instant (no animation)
|
|
334
|
+
```
|
|
317
335
|
|
|
318
|
-
|
|
336
|
+
A plain `show`/`hide` with no effect is instant. Effects honor `prefers-reduced-motion`. Beat annotations are cleared at the start of each beat (unless in the always-on `annotate` block).
|
|
319
337
|
|
|
320
|
-
### Beat properties
|
|
338
|
+
### Beat & timeline properties
|
|
321
339
|
|
|
322
|
-
`narrate: "caption"` (speaker note shown under the diagram), `hold: 2s` (dwell before auto-advance during Play).
|
|
340
|
+
`narrate: "caption"` (speaker note shown under the diagram), `hold: 2s` (dwell before auto-advance during Play; alias `wait:`). At the `timeline { … }` level, `defaultEase: <easing>` sets the fallback easing for every beat that doesn't specify its own `ease`.
|
|
323
341
|
|
|
324
342
|
---
|
|
325
343
|
|
|
@@ -387,14 +405,29 @@ translate(vw/2, vh/2) · scale(zoom) · translate(-cx, -cy)
|
|
|
387
405
|
|
|
388
406
|
```ts
|
|
389
407
|
const controller = new CameraController(renderer);
|
|
390
|
-
await controller.fitAll(scene, { padding: 80 });
|
|
408
|
+
await controller.fitAll(scene, { padding: 80 }); // frame everything
|
|
391
409
|
await controller.focus(scene, ["db", "cache"], { zoom: 1.7, easing: "spring" });
|
|
392
|
-
controller.
|
|
410
|
+
await controller.focusBBox({ minX, minY, maxX, maxY }, { zoom: 2 }); // frame an arbitrary world box
|
|
411
|
+
controller.zoomBy(1.2, screenPoint); // wheel zoom around cursor (relative)
|
|
393
412
|
controller.panByScreen(dx, dy); // drag pan
|
|
394
413
|
```
|
|
395
414
|
|
|
396
415
|
Mid-flight `animateTo` retargets smoothly from the current interpolated state — no snap.
|
|
397
416
|
|
|
417
|
+
### Numeric contracts
|
|
418
|
+
|
|
419
|
+
The behaviors an author or embedder can rely on (all from `controller.ts` / `fit.ts`):
|
|
420
|
+
|
|
421
|
+
| Contract | Value |
|
|
422
|
+
|---|---|
|
|
423
|
+
| Zoom = scale factor | `1.0` = 100% (1 world unit = 1 screen px); `zoom: 1.7` = 170%. |
|
|
424
|
+
| Wheel / `zoomBy` clamp | **0.05–8×** (5%–800%). |
|
|
425
|
+
| Fit clamp | `fitAll`/`focusBBox` cap at **2.5×**; `focus`'s *computed* framing caps at **4×**. |
|
|
426
|
+
| Explicit `zoom` | **Bypasses all clamps** — a passed `zoom` (DSL `camera … zoom N`, or `focus(..,{zoom})`) is applied as-is, so a beat can exceed the interactive limits. |
|
|
427
|
+
| Auto-duration | When `over`/`durationMs` is omitted: `clamp(420 + dist·0.12 + |ln(zoomTo/zoomFrom)|·320, 420, 1300)` ms. |
|
|
428
|
+
| Padding defaults | `fitAll` 80px, `focus`/`focusBBox` 90px, bare `cameraForBBox` 64px. |
|
|
429
|
+
| Default easing | Compiled DSL beats default to **`ease-in-out`** (via `mapEasing`); a raw programmatic `animateTo` with no `easing` defaults to **`spring`**. |
|
|
430
|
+
|
|
398
431
|
## Interaction (built into the canvas)
|
|
399
432
|
|
|
400
433
|
- **Wheel** → zoom around the cursor.
|
|
@@ -409,9 +442,10 @@ Mid-flight `animateTo` retargets smoothly from the current interpolated state
|
|
|
409
442
|
|---|---|
|
|
410
443
|
| Camera | **Sticky** — a beat with no `camera` keeps the current one. |
|
|
411
444
|
| Visibility (`show`/`hide`) | **Sticky** until changed. |
|
|
445
|
+
| Reveal effect (`with fade-in`/`pop`/`draw-on`) | **Beat-scoped** — replayed each time the beat is entered (only when animating). |
|
|
412
446
|
| Annotations | **Beat-scoped** — replaced each beat (always-on `annotate` block persists underneath). |
|
|
413
447
|
|
|
414
|
-
API: `player.load(scene)`, `play()`, `pause()`, `next()`, `prev()`, `restart()`, `goto(i)`. It emits `PlayerState { index, total, caption, stepName, playing }` for the UI. Auto-advance uses each beat's `hold:` (default 3.2s).
|
|
448
|
+
API: `player.load(scene)`, `play()`, `pause()`, `next()`, `prev()`, `restart()`, `goto(i)`. It emits `PlayerState { index, total, caption, stepName, playing }` for the UI. **`index === -1`** is the home/overview state (before any beat; `stepName` is `"Overview"`) — `prev()` from beat 0 returns there and re-fits. Auto-advance uses each beat's `hold:` (default 3.2s).
|
|
415
449
|
|
|
416
450
|
```edd
|
|
417
451
|
timeline story {
|
|
@@ -637,6 +671,10 @@ new EdodoDraw(container: HTMLElement, options?: EdodoDrawOptions)
|
|
|
637
671
|
| `render` | `(source: string) => Promise<RenderResult>` | Compile + render. `RenderResult = { scene: Scene; diagnostics: Diagnostic[] }`. |
|
|
638
672
|
| `getScene` | `() => Scene` | The current rendered scene (Scene IR). |
|
|
639
673
|
| `getSource` | `() => string` | The last source string passed to `render`. |
|
|
674
|
+
| `setColorScheme` | `(mode: "light" \| "dark" \| null) => void` | Force light/dark rendering, overriding the diagram's declared theme. Re-themes the canvas background, the dotted grid, and the diagram's default ink (strokes/text adapt for contrast on the dark canvas; **explicit** colors are kept). `null` falls back to the DSL's own theme. Idempotent + re-renders the current source. |
|
|
675
|
+
| `getColorScheme` | `() => "light" \| "dark" \| null` | The current forced scheme (`null` = follow the DSL). |
|
|
676
|
+
|
|
677
|
+
**Light / dark theming.** A diagram's theme comes from the DSL (`theme dark { … }` / `use theme …`); `setColorScheme` / the `colorScheme` prop *override* it for the view, so you can wire EDodoDraw straight to your app's theme toggle. In dark mode the canvas goes near‑black, the dotted grid follows `theme.gridColor`, and **default** ink flips to light for contrast — but any color **you** set (`fill: green`, `stroke: red`, `textColor:`) is preserved. One nuance: because the default fill style is hand‑drawn *hachure* (the dark canvas shows through), labels on unfilled and hachure‑filled nodes use light ink; only a **solid** light fill (`fillStyle: solid`) keeps dark ink. Forcing a scheme also re‑themes exports (`downloadSVG`/`PNG`) — you export what you see.
|
|
640
678
|
|
|
641
679
|
### Camera
|
|
642
680
|
|
|
@@ -723,7 +761,7 @@ event — see below), keeping the code the single source of truth:
|
|
|
723
761
|
|---|---|---|
|
|
724
762
|
| `"render"` | `RenderResult` `{ scene, diagnostics }` | After each successful `render()`. |
|
|
725
763
|
| `"diagnostics"` | `Diagnostic[]` | After each `render()`, with compile diagnostics. |
|
|
726
|
-
| `"state"` | `PlayerState` `{ index, total, caption, playing, stepName }` | Timeline position/playing changes. |
|
|
764
|
+
| `"state"` | `PlayerState` `{ index, total, caption, playing, stepName }` | Timeline position/playing changes. `index === -1` is the home/overview state (before any beat; `stepName` is `"Overview"`). |
|
|
727
765
|
| `"live"` | `LiveState` `{ tool, count, canUndo, canRedo, selected }` | Live-annotation tool/selection/undo state changes. |
|
|
728
766
|
| `"edit"` | `source: string` | A direct-manipulation edit patched the source. Re-render with this new source (and mirror it into your code editor). |
|
|
729
767
|
| `"editstate"` | `EditState` `{ tool, selected }` | Edit-mode tool or node selection changes (drive a property panel / toolbar highlight). |
|
|
@@ -737,7 +775,7 @@ const off = edd.on("diagnostics", (diags) => {
|
|
|
737
775
|
if (errors.length) console.warn(errors.map((d) => `${d.code}: ${d.message}`).join("\n"));
|
|
738
776
|
});
|
|
739
777
|
// later: off(); // unsubscribe
|
|
740
|
-
edd.on("state", (s) => console.log(`beat ${s.index + 1}/${s.total} — ${s.stepName}`));
|
|
778
|
+
edd.on("state", (s) => console.log(s.index < 0 ? "Overview" : `beat ${s.index + 1}/${s.total} — ${s.stepName}`));
|
|
741
779
|
|
|
742
780
|
// Direct-edit round-trip: the diagram is editable, and edits flow back to code.
|
|
743
781
|
let source = "scene { rect a \"A\"\n a --> b }";
|
|
@@ -786,14 +824,20 @@ export function Diagram() {
|
|
|
786
824
|
| `source` | `string` (required) | EDodoDraw source. Re-renders whenever it changes. |
|
|
787
825
|
| `className` | `string` | On the host `<div>`. |
|
|
788
826
|
| `style` | `CSSProperties` | Merged onto the host (which defaults to `width/height: 100%`). |
|
|
827
|
+
| `colorScheme` | `"light" \| "dark" \| null` | Force light/dark rendering (see `setColorScheme`). Reactive — flip it to follow your app's theme. Omit/`null` follows the DSL's own theme. |
|
|
789
828
|
| `onReady` | `(edd: EdodoDraw) => void` | Called **once** after mount with the imperative instance — use it to subscribe to events or grab a ref for camera/export. |
|
|
790
829
|
| `onDiagnostics` | `(diags: Diagnostic[]) => void` | Wired to the `"diagnostics"` event. |
|
|
791
830
|
| `onState` | `(state: PlayerState) => void` | Wired to the `"state"` event. |
|
|
792
831
|
|
|
793
832
|
The host `<div>` fills its parent (`width/height: 100%`), so wrap it in a **sized**
|
|
794
833
|
element. Note the `EdodoDrawOptions` props (`interactive`, `grid`, …) are read
|
|
795
|
-
**once at mount**;
|
|
796
|
-
(e.g. via a React `key`).
|
|
834
|
+
**once at mount**; `source` and `colorScheme` are reactive. To change other options
|
|
835
|
+
at runtime, remount (e.g. via a React `key`).
|
|
836
|
+
|
|
837
|
+
```tsx
|
|
838
|
+
// follow the host app's theme (e.g. a "dark" boolean from your own toggle)
|
|
839
|
+
<EdodoDrawView source={code} colorScheme={dark ? "dark" : "light"} />
|
|
840
|
+
```
|
|
797
841
|
|
|
798
842
|
---
|
|
799
843
|
|
|
@@ -811,6 +855,11 @@ const { scene, diagnostics, report } = compileEdd(`scene { a -> b -> c }`);
|
|
|
811
855
|
// report : string[] — human-readable, source-annotated diagnostic blocks
|
|
812
856
|
|
|
813
857
|
if (diagnostics.hasErrors) throw new Error(report.join("\n\n"));
|
|
858
|
+
|
|
859
|
+
// Force a render mode (overrides the DSL's declared theme). Same knob the
|
|
860
|
+
// facade's setColorScheme / <EdodoDrawView colorScheme> use under the hood:
|
|
861
|
+
const dark = compileEdd(`scene { a -> b }`, { mode: "dark" });
|
|
862
|
+
// dark.scene.theme.mode === "dark"; background + gridColor + default ink adapt.
|
|
814
863
|
```
|
|
815
864
|
|
|
816
865
|
> `compileEdd` returns `diagnostics` as a **`DiagnosticBag`** (use `.items`,
|
|
@@ -1663,6 +1712,7 @@ timeline story {
|
|
|
1663
1712
|
|
|
1664
1713
|
beat ingress "Traffic enters at the edge" {
|
|
1665
1714
|
camera focus [client, cdn, gw] zoom 1.5 ease spring
|
|
1715
|
+
reveal { show [client, cdn, gw] with pop } // pop the entry path into focus
|
|
1666
1716
|
annotate {
|
|
1667
1717
|
point-at gw "single entry point" { from: ne, color: $accent }
|
|
1668
1718
|
highlight cdn { color: yellow }
|
|
@@ -1671,6 +1721,7 @@ timeline story {
|
|
|
1671
1721
|
|
|
1672
1722
|
beat services "Inside the app tier" {
|
|
1673
1723
|
camera focus services zoom 1.6
|
|
1724
|
+
reveal { show [auth, api, worker] with pop }
|
|
1674
1725
|
annotate {
|
|
1675
1726
|
spotlight services { dim: 0.72 }
|
|
1676
1727
|
underline api "the hot path" { color: $accent }
|
|
@@ -1680,6 +1731,7 @@ timeline story {
|
|
|
1680
1731
|
|
|
1681
1732
|
beat data "Where state lives" {
|
|
1682
1733
|
camera focus data zoom 1.7 ease ease-in-out
|
|
1734
|
+
reveal { draw-on [db, cache, queue] } // sweep the data stores in
|
|
1683
1735
|
annotate {
|
|
1684
1736
|
callout db "primary of record" { placement: right }
|
|
1685
1737
|
circle-mark queue "retry here"
|
package/dist-lib/react.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useEffect } from "react";
|
|
3
|
-
import { c as EdodoDraw } from "./chunks/EdodoDraw-
|
|
4
|
-
function EdodoDrawView({ source, className, style, onReady, onDiagnostics, onState, ...opts }) {
|
|
3
|
+
import { c as EdodoDraw } from "./chunks/EdodoDraw-BdJowisU.js";
|
|
4
|
+
function EdodoDrawView({ source, className, style, colorScheme, onReady, onDiagnostics, onState, ...opts }) {
|
|
5
5
|
const hostRef = useRef(null);
|
|
6
6
|
const eddRef = useRef(null);
|
|
7
7
|
useEffect(() => {
|
|
@@ -9,6 +9,7 @@ function EdodoDrawView({ source, className, style, onReady, onDiagnostics, onSta
|
|
|
9
9
|
if (!host) return;
|
|
10
10
|
const edd = new EdodoDraw(host, opts);
|
|
11
11
|
eddRef.current = edd;
|
|
12
|
+
if (colorScheme !== void 0) edd.setColorScheme(colorScheme);
|
|
12
13
|
if (onDiagnostics) edd.on("diagnostics", onDiagnostics);
|
|
13
14
|
if (onState) edd.on("state", onState);
|
|
14
15
|
onReady?.(edd);
|
|
@@ -20,6 +21,9 @@ function EdodoDrawView({ source, className, style, onReady, onDiagnostics, onSta
|
|
|
20
21
|
useEffect(() => {
|
|
21
22
|
void eddRef.current?.render(source);
|
|
22
23
|
}, [source]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
eddRef.current?.setColorScheme(colorScheme ?? null);
|
|
26
|
+
}, [colorScheme]);
|
|
23
27
|
return /* @__PURE__ */ jsx("div", { ref: hostRef, className, style: { width: "100%", height: "100%", ...style } });
|
|
24
28
|
}
|
|
25
29
|
export {
|
package/dist-lib/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":["../src/lib/react.tsx"],"sourcesContent":["/**\n * `edododraw/react` — a thin React wrapper over the EdodoDraw facade.\n *\n * <EdodoDrawView source={code} interactive onReady={(edd) => …} />\n *\n * React is a peer dependency; nothing here is imported by the core entry.\n */\n\nimport { useEffect, useRef } from \"react\";\nimport type { CSSProperties } from \"react\";\nimport { EdodoDraw, type EdodoDrawOptions } from \"./EdodoDraw.js\";\nimport type { Diagnostic } from \"../engine/dsl/diagnostics.js\";\nimport type { PlayerState } from \"../engine/timeline/player.js\";\n\nexport interface EdodoDrawViewProps extends EdodoDrawOptions {\n /** EDodoDraw source to render (re-renders whenever it changes). */\n source: string;\n className?: string;\n style?: CSSProperties;\n /** Called once with the imperative instance after mount. */\n onReady?: (edd: EdodoDraw) => void;\n onDiagnostics?: (diags: Diagnostic[]) => void;\n onState?: (state: PlayerState) => void;\n}\n\nexport function EdodoDrawView({ source, className, style, onReady, onDiagnostics, onState, ...opts }: EdodoDrawViewProps) {\n const hostRef = useRef<HTMLDivElement | null>(null);\n const eddRef = useRef<EdodoDraw | null>(null);\n\n useEffect(() => {\n const host = hostRef.current;\n if (!host) return;\n const edd = new EdodoDraw(host, opts);\n eddRef.current = edd;\n if (onDiagnostics) edd.on(\"diagnostics\", onDiagnostics);\n if (onState) edd.on(\"state\", onState);\n onReady?.(edd);\n return () => {\n edd.destroy();\n eddRef.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n void eddRef.current?.render(source);\n }, [source]);\n\n return <div ref={hostRef} className={className} style={{ width: \"100%\", height: \"100%\", ...style }} />;\n}\n\nexport { EdodoDraw } from \"./EdodoDraw.js\";\nexport type { EdodoDrawOptions } from \"./EdodoDraw.js\";\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../src/lib/react.tsx"],"sourcesContent":["/**\n * `edododraw/react` — a thin React wrapper over the EdodoDraw facade.\n *\n * <EdodoDrawView source={code} interactive onReady={(edd) => …} />\n *\n * React is a peer dependency; nothing here is imported by the core entry.\n */\n\nimport { useEffect, useRef } from \"react\";\nimport type { CSSProperties } from \"react\";\nimport { EdodoDraw, type EdodoDrawOptions } from \"./EdodoDraw.js\";\nimport type { Diagnostic } from \"../engine/dsl/diagnostics.js\";\nimport type { PlayerState } from \"../engine/timeline/player.js\";\n\nexport interface EdodoDrawViewProps extends EdodoDrawOptions {\n /** EDodoDraw source to render (re-renders whenever it changes). */\n source: string;\n className?: string;\n style?: CSSProperties;\n /**\n * Force light/dark rendering, overriding the diagram's declared theme.\n * `null`/omitted follows the DSL's own theme. See `EdodoDraw.setColorScheme`.\n */\n colorScheme?: \"light\" | \"dark\" | null;\n /** Called once with the imperative instance after mount. */\n onReady?: (edd: EdodoDraw) => void;\n onDiagnostics?: (diags: Diagnostic[]) => void;\n onState?: (state: PlayerState) => void;\n}\n\nexport function EdodoDrawView({ source, className, style, colorScheme, onReady, onDiagnostics, onState, ...opts }: EdodoDrawViewProps) {\n const hostRef = useRef<HTMLDivElement | null>(null);\n const eddRef = useRef<EdodoDraw | null>(null);\n\n useEffect(() => {\n const host = hostRef.current;\n if (!host) return;\n const edd = new EdodoDraw(host, opts);\n eddRef.current = edd;\n if (colorScheme !== undefined) edd.setColorScheme(colorScheme); // before first render → no flash\n if (onDiagnostics) edd.on(\"diagnostics\", onDiagnostics);\n if (onState) edd.on(\"state\", onState);\n onReady?.(edd);\n return () => {\n edd.destroy();\n eddRef.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n void eddRef.current?.render(source);\n }, [source]);\n\n useEffect(() => {\n // `undefined` and `null` both mean \"follow the DSL theme\" — revert either way.\n eddRef.current?.setColorScheme(colorScheme ?? null);\n }, [colorScheme]);\n\n return <div ref={hostRef} className={className} style={{ width: \"100%\", height: \"100%\", ...style }} />;\n}\n\nexport { EdodoDraw } from \"./EdodoDraw.js\";\nexport type { EdodoDrawOptions } from \"./EdodoDraw.js\";\n"],"names":[],"mappings":";;;AA8BO,SAAS,cAAc,EAAE,QAAQ,WAAW,OAAO,aAAa,SAAS,eAAe,SAAS,GAAG,QAA4B;AACrI,QAAM,UAAU,OAA8B,IAAI;AAClD,QAAM,SAAS,OAAyB,IAAI;AAE5C,YAAU,MAAM;AACd,UAAM,OAAO,QAAQ;AACrB,QAAI,CAAC,KAAM;AACX,UAAM,MAAM,IAAI,UAAU,MAAM,IAAI;AACpC,WAAO,UAAU;AACjB,QAAI,gBAAgB,OAAW,KAAI,eAAe,WAAW;AAC7D,QAAI,cAAe,KAAI,GAAG,eAAe,aAAa;AACtD,QAAI,QAAS,KAAI,GAAG,SAAS,OAAO;AACpC,cAAU,GAAG;AACb,WAAO,MAAM;AACX,UAAI,QAAA;AACJ,aAAO,UAAU;AAAA,IACnB;AAAA,EAEF,GAAG,CAAA,CAAE;AAEL,YAAU,MAAM;AACd,SAAK,OAAO,SAAS,OAAO,MAAM;AAAA,EACpC,GAAG,CAAC,MAAM,CAAC;AAEX,YAAU,MAAM;AAEd,WAAO,SAAS,eAAe,eAAe,IAAI;AAAA,EACpD,GAAG,CAAC,WAAW,CAAC;AAEhB,SAAO,oBAAC,OAAA,EAAI,KAAK,SAAS,WAAsB,OAAO,EAAE,OAAO,QAAQ,QAAQ,QAAQ,GAAG,QAAM,CAAG;AACtG;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edododraw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A 100% code/syntax-to-diagram engine with the Excalidraw hand-drawn aesthetic, magic-move camera, scriptable + real-time annotations, animated arrows, and first-class Mermaid import.",
|
|
6
6
|
"license": "MIT",
|