@johnoscott/isometric-engine 0.15.0 → 0.17.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 (78) hide show
  1. package/README.md +3 -1
  2. package/iso-editor.js +230 -193
  3. package/iso-remotion.js +353 -0
  4. package/iso-render.js +184 -147
  5. package/iso-systems.js +183 -146
  6. package/isometric-diagram.js +389 -0
  7. package/js/iso-core/arimo.js +5 -0
  8. package/js/iso-core/arimo.json +1 -0
  9. package/js/iso-core/index.js +8 -2
  10. package/js/iso-core/kernel.js +13 -2
  11. package/js/iso-core/mono.js +242 -0
  12. package/js/iso-editor/ui/canvas.js +23 -1
  13. package/js/iso-objects/ants.js +1 -1
  14. package/js/iso-objects/index.js +10 -2
  15. package/js/iso-objects/mono-paint.js +96 -0
  16. package/js/iso-objects/motion-doc.js +0 -79
  17. package/js/iso-objects/motion-entry.js +4 -2
  18. package/js/iso-objects/motion-schema.js +83 -0
  19. package/js/iso-objects/motion.js +9 -4
  20. package/js/iso-objects/timeline.js +60 -16
  21. package/js/iso-systems/compile.js +34 -3
  22. package/js/iso-systems/render.js +1 -1
  23. package/js/iso-systems/schema.json +1 -0
  24. package/js/iso-viewer/index.js +6 -0
  25. package/js/iso-viewer/page.js +40 -17
  26. package/js/iso-viewer/play.js +340 -0
  27. package/js/iso-viewer/player.js +147 -162
  28. package/js/iso-viewer/transport.js +289 -0
  29. package/package.json +61 -2
  30. package/src/iso-core/arimo.json +1 -0
  31. package/src/iso-core/arimo.ts +6 -0
  32. package/src/iso-core/index.ts +2 -1
  33. package/src/iso-core/kernel.ts +11 -1
  34. package/src/iso-core/mono.ts +306 -0
  35. package/src/iso-core/theme.ts +2 -1
  36. package/src/iso-editor/ui/canvas.ts +14 -1
  37. package/src/iso-objects/ants.ts +2 -2
  38. package/src/iso-objects/index.ts +5 -3
  39. package/src/iso-objects/mono-paint.ts +97 -0
  40. package/src/iso-objects/motion-doc.ts +0 -52
  41. package/src/iso-objects/motion-entry.ts +4 -3
  42. package/src/iso-objects/motion-schema.ts +55 -0
  43. package/src/iso-objects/motion.ts +6 -5
  44. package/src/iso-objects/scene.ts +3 -0
  45. package/src/iso-objects/timeline.ts +71 -15
  46. package/src/iso-objects/types.ts +2 -0
  47. package/src/iso-systems/compile.ts +37 -4
  48. package/src/iso-systems/render.ts +5 -1
  49. package/src/iso-systems/schema.json +1 -0
  50. package/src/iso-viewer/index.ts +4 -0
  51. package/src/iso-viewer/page.ts +28 -12
  52. package/src/iso-viewer/play.ts +280 -0
  53. package/src/iso-viewer/player.ts +133 -134
  54. package/src/iso-viewer/transport.ts +272 -0
  55. package/types/iso-core/arimo.d.ts +2 -0
  56. package/types/iso-core/index.d.ts +2 -1
  57. package/types/iso-core/kernel.d.ts +9 -0
  58. package/types/iso-core/mono.d.ts +61 -0
  59. package/types/iso-core/theme.d.ts +2 -0
  60. package/types/iso-objects/ants.d.ts +1 -0
  61. package/types/iso-objects/index.d.ts +5 -3
  62. package/types/iso-objects/mono-paint.d.ts +20 -0
  63. package/types/iso-objects/motion-doc.d.ts +0 -594
  64. package/types/iso-objects/motion-entry.d.ts +4 -3
  65. package/types/iso-objects/motion-schema.d.ts +594 -0
  66. package/types/iso-objects/motion.d.ts +4 -2
  67. package/types/iso-objects/scene.d.ts +3 -0
  68. package/types/iso-objects/timeline.d.ts +26 -3
  69. package/types/iso-objects/types.d.ts +2 -0
  70. package/types/iso-systems/compile.d.ts +8 -0
  71. package/types/iso-systems/render.d.ts +4 -0
  72. package/types/iso-viewer/index.d.ts +4 -0
  73. package/types/iso-viewer/play.d.ts +37 -0
  74. package/types/iso-viewer/transport.d.ts +73 -0
  75. package/types/player/isometric-diagram.d.ts +24 -0
  76. package/types/remotion/entry.d.ts +2 -0
  77. package/types/remotion/frames.d.ts +70 -0
  78. package/types/remotion/index.d.ts +39 -0
@@ -0,0 +1,272 @@
1
+ // A Timeline's transport (docs/design/MOTION.md, 6.3): play, pause, seek, rate, loop, the ambient switch, beats, and rebinding to a
2
+ // changed document. Headless: no DOM. It is the only place in the motion code that owns a clock, and the clock can be given (tests,
3
+ // and hosts with a clock of their own). A Timeline stays a pure function; this says which two times to ask it for.
4
+ //
5
+ // Two clocks (3.4): T, the timeline's, and A, the ambient one. Playing moves both; paused with the ambient on, A goes on alone (so ants
6
+ // march while the story waits); a seek moves both by the same; a restart, or a loop coming round, makes A equal T again. With the
7
+ // ambient off A stands through all of it, and on again it carries on from where it stood.
8
+
9
+ import type { BeatInfo, Cue, Timeline } from '../iso-objects/timeline.ts';
10
+ import type { SceneState } from '../iso-objects/motion.ts';
11
+
12
+ export interface TransportClock {
13
+ /** ms, going only forward */
14
+ now(): number;
15
+ /** call f soon, once: the next frame; returns what cancel takes */
16
+ next(f: () => void): unknown;
17
+ cancel(id: unknown): void;
18
+ }
19
+ export interface TransportOptions {
20
+ /** start again at the end (default false) */
21
+ loop?: boolean;
22
+ /** how fast (default 1) */
23
+ rate?: number;
24
+ /** default: the document's own */
25
+ ambient?: 'on' | 'off';
26
+ clock?: TransportClock;
27
+ }
28
+ export interface TransportEvents {
29
+ /** the drawing is to be painted again: T (ms), and why */
30
+ time: (ms: number, why: 'play' | 'ambient' | 'seek' | 'rebind') => void;
31
+ play: () => void;
32
+ pause: () => void;
33
+ /** it came to its end and stopped (not at each turn of a loop: that is 'loop') */
34
+ end: () => void;
35
+ loop: () => void;
36
+ /** a beat begins: each one passed, in order, while playing; the one landed in, after a seek or a rebind. `at`: where in the timeline it starts, ms */
37
+ beat: (beat: BeatInfo, how: 'play' | 'seek' | 'rebind') => void;
38
+ ambient: (on: boolean) => void;
39
+ rate: (rate: number) => void;
40
+ }
41
+ export interface Transport {
42
+ readonly timeline: Timeline;
43
+ readonly duration: number;
44
+ /** T, ms */
45
+ readonly time: number;
46
+ /** A, ms, or 'off' when it never ran: what at()'s `ambient` takes */
47
+ readonly ambientTime: number | 'off';
48
+ readonly playing: boolean;
49
+ readonly beat: BeatInfo | undefined;
50
+ readonly cue: Cue | undefined;
51
+ rate: number;
52
+ loop: boolean;
53
+ ambient: boolean;
54
+ /** whether the host shows it now (default true): while false neither clock moves, playing or not */
55
+ active: boolean;
56
+ /** what the drawing looks like now */
57
+ state(): SceneState;
58
+ /** until: pause there (a time still ahead) */
59
+ play(o?: { until?: number }): void;
60
+ pause(): void;
61
+ toggle(): void;
62
+ /** join: the ambient clock at that time too (a step taken: what loops starts with it), where the ambient is on */
63
+ seek(ms: number, o?: { join?: boolean }): void;
64
+ /** to a beat's start, by its name or its index; whether there is one */
65
+ seekBeat(beat: string | number): boolean;
66
+ /** to the next beat's start, or the end; to this beat's start, or the one before when nearly there */
67
+ next(): void;
68
+ prev(): void;
69
+ restart(): void;
70
+ /** the document or the drawing changed: the place is kept by beat and how far in it. A Timeline with faults (ok: false) is refused, and the last good one goes on */
71
+ rebind(tl: Timeline): boolean;
72
+ /** returns how to stop listening */
73
+ on<K extends keyof TransportEvents>(event: K, f: TransportEvents[K]): () => void;
74
+ dispose(): void;
75
+ }
76
+
77
+ /** the page's clock: frames, and a timer behind them, so it also goes on where no frames are drawn (a page not shown) */
78
+ export function pageClock(): TransportClock {
79
+ const g = globalThis as unknown as { requestAnimationFrame?: (f: () => void) => number; cancelAnimationFrame?: (id: number) => void };
80
+ return {
81
+ now: () => performance.now(),
82
+ next(f) {
83
+ const id: { raf?: number; timer?: ReturnType<typeof setTimeout> } = {};
84
+ const once = () => { if (id.raf !== undefined) g.cancelAnimationFrame?.(id.raf); clearTimeout(id.timer); f(); };
85
+ id.raf = g.requestAnimationFrame?.(once);
86
+ id.timer = setTimeout(once, id.raf === undefined ? 16 : 100);
87
+ return id;
88
+ },
89
+ cancel(id) { const x = id as { raf?: number; timer?: ReturnType<typeof setTimeout> }; if (x.raf !== undefined) g.cancelAnimationFrame?.(x.raf); clearTimeout(x.timer); },
90
+ };
91
+ }
92
+
93
+ /** pressing back this soon after a beat began goes to the one before, ms */
94
+ const BACK_WITHIN = 400;
95
+
96
+ export function transport(tl0: Timeline, o: TransportOptions = {}): Transport {
97
+ const clock = o.clock ?? pageClock();
98
+ let tl = tl0, T = 0, rate = good(o.rate ?? 1), loop = o.loop ?? false, playing = false, active = true, gone = false;
99
+ let on = (o.ambient ?? tl.ambient) === 'on';
100
+ /** A; 'off': never ran */
101
+ let A: number | 'off' = on ? 0 : 'off';
102
+ // turn: counts what a listener may do inside an event (seek, pause, rebind, …), after which that tick's own news is old
103
+ let pending: unknown, last = 0, beat = tl.beatAt(0), told = false, turn = 0, until: number | undefined;
104
+ const subs: { [K in keyof TransportEvents]?: Set<TransportEvents[K]> } = {};
105
+
106
+ function good(r: number) { if (!(Number.isFinite(r) && r > 0)) throw new Error('rate is a number over 0'); return r; }
107
+ const clamp = (ms: number) => Math.max(0, Math.min(tl.duration, ms));
108
+ function emit<K extends keyof TransportEvents>(k: K, ...a: Parameters<TransportEvents[K]>) {
109
+ for (const f of [...(subs[k] ?? [])]) (f as (...x: Parameters<TransportEvents[K]>) => void)(...a);
110
+ }
111
+ const moves = () => active && !gone && (playing || (on && tl.loops));
112
+ /** ask for a frame while something moves */
113
+ function arm() {
114
+ if (moves()) { if (pending === undefined) { last = clock.now(); pending = clock.next(tick); } }
115
+ else if (pending !== undefined) { clock.cancel(pending); pending = undefined; }
116
+ }
117
+ /** the beats that begin after `from`, up to `to`: each said once */
118
+ function passed(from: number, to: number) {
119
+ const mine = turn;
120
+ for (const b of tl.beats) {
121
+ if (b.start <= from || b.start > to || b.index === beat?.index) continue;
122
+ beat = b; told = true; emit('beat', b, 'play');
123
+ if (turn !== mine) return false;
124
+ }
125
+ return true;
126
+ }
127
+ function play1(dt: number) {
128
+ if (!playing) { emit('time', T, 'ambient'); return; }
129
+ const was = T, to = T + dt, mine = turn;
130
+ if (until !== undefined && to >= until) {
131
+ T = until;
132
+ if (!passed(was, T)) return;
133
+ until = undefined; playing = false;
134
+ emit('time', T, 'play');
135
+ if (turn === mine) emit('pause');
136
+ return;
137
+ }
138
+ if (to < tl.duration) {
139
+ T = to;
140
+ if (passed(was, T)) emit('time', T, 'play');
141
+ return;
142
+ }
143
+ if (loop) {
144
+ // (the beats left in this turn; whole turns missed while no frames came are not played one by one)
145
+ if (!passed(was, tl.duration)) return;
146
+ T = to % tl.duration;
147
+ if (on) A = T;
148
+ beat = undefined;
149
+ emit('loop');
150
+ if (turn !== mine) return;
151
+ const first = tl.beatAt(0);
152
+ if (first) { beat = first; emit('beat', first, 'play'); if (turn !== mine || !passed(first.start, T)) return; }
153
+ emit('time', T, 'play');
154
+ return;
155
+ }
156
+ T = tl.duration;
157
+ if (!passed(was, T)) return;
158
+ playing = false;
159
+ emit('time', T, 'play');
160
+ if (turn !== mine) return;
161
+ emit('pause');
162
+ if (turn !== mine) return;
163
+ emit('end');
164
+ }
165
+ function tick() {
166
+ pending = undefined;
167
+ const now = clock.now(), dt = Math.max(0, now - last) * rate;
168
+ last = now;
169
+ if (on && A !== 'off') A += dt;
170
+ play1(dt);
171
+ if (pending === undefined) { if (moves()) pending = clock.next(tick); }
172
+ }
173
+ function land(how: 'seek' | 'rebind', again = false) {
174
+ const b = tl.beatAt(T);
175
+ turn++;
176
+ const mine = turn, other = b?.name !== beat?.name || b?.index !== beat?.index;
177
+ beat = b;
178
+ if (b && (other || again)) { told = true; emit('beat', b, how); if (turn !== mine) return; }
179
+ emit('time', T, how);
180
+ }
181
+ function seek(ms: number, o: { join?: boolean } = {}) {
182
+ if (gone || !Number.isFinite(ms)) return;
183
+ const to = clamp(ms);
184
+ if (on && A !== 'off') A = o.join ? to : A + to - T;
185
+ T = to; last = clock.now();
186
+ if (until !== undefined && T >= until) until = undefined;
187
+ land('seek');
188
+ arm();
189
+ }
190
+ function restart() {
191
+ if (gone) return;
192
+ T = 0; if (on) A = 0;
193
+ until = undefined;
194
+ last = clock.now();
195
+ land('seek', true);
196
+ arm();
197
+ }
198
+ const api: Transport = {
199
+ get timeline() { return tl; },
200
+ get duration() { return tl.duration; },
201
+ get time() { return T; },
202
+ get ambientTime() { return A; },
203
+ get playing() { return playing; },
204
+ get beat() { return beat; },
205
+ get cue() { return tl.cues(T); },
206
+ get rate() { return rate; },
207
+ set rate(r) { const v = good(r); if (v === rate) return; rate = v; emit('rate', v); },
208
+ get loop() { return loop; },
209
+ set loop(v) { loop = v; },
210
+ get ambient() { return on; },
211
+ set ambient(v) {
212
+ if (gone || v === on) return;
213
+ on = v;
214
+ // never ran: it starts where this beat's loops stand, at their start
215
+ if (on && A === 'off') A = beat?.start ?? 0;
216
+ arm();
217
+ emit('ambient', on);
218
+ emit('time', T, 'ambient');
219
+ },
220
+ get active() { return active; },
221
+ set active(v) { if (v === active) return; active = v; arm(); },
222
+ state: () => tl.at(T, { ambient: A }),
223
+ play(p = {}) {
224
+ if (gone || playing || tl.duration <= 0) return;
225
+ if (T >= tl.duration && p.until === undefined) restart();
226
+ until = p.until !== undefined && p.until > T && p.until <= tl.duration ? p.until : undefined;
227
+ if (p.until !== undefined && until === undefined) return;
228
+ playing = true; last = clock.now();
229
+ arm();
230
+ emit('play');
231
+ // the beat it starts in, if nobody has been told of it
232
+ if (playing && !told && beat) { told = true; emit('beat', beat, 'play'); }
233
+ },
234
+ pause() { if (!playing) return; playing = false; until = undefined; turn++; arm(); emit('pause'); },
235
+ toggle() { if (playing) api.pause(); else api.play(); },
236
+ seek,
237
+ seekBeat(b) {
238
+ const ms = typeof b === 'number' ? tl.beats[b]?.start : tl.beats.find(x => x.name === b)?.start;
239
+ if (ms === undefined) return false;
240
+ seek(ms);
241
+ return true;
242
+ },
243
+ next() { const n = tl.beats.find(b => b.start > T); seek(n ? n.start : tl.duration); },
244
+ prev() { const back = [...tl.beats].reverse().find(b => b.start < T - BACK_WITHIN); seek(back ? back.start : 0); },
245
+ restart,
246
+ rebind(next) {
247
+ if (gone || !next.ok) return false;
248
+ until = undefined;
249
+ const was = tl.beatAt(T), frac = was ? (T - was.start) / Math.max(1, was.end - was.start) : 0, d = A === 'off' ? 0 : A - T, before = tl;
250
+ tl = next;
251
+ if (was) {
252
+ const same = next.beats.find(b => b.name === was.name);
253
+ if (same) T = same.start + frac * (same.end - same.start);
254
+ else {
255
+ // it went away: the nearest before it that is still there, at its end
256
+ const near = before.beats.filter(b => b.index < was.index).reverse().map(b => next.beats.find(x => x.name === b.name)).find(Boolean);
257
+ T = near ? near.start : 0;
258
+ }
259
+ }
260
+ T = clamp(T);
261
+ if (on && A !== 'off') A = T + d;
262
+ last = clock.now();
263
+ land('rebind');
264
+ arm();
265
+ return true;
266
+ },
267
+ on(k, f) { const set = (subs[k] ??= new Set() as never) as Set<typeof f>; set.add(f); return () => { set.delete(f); }; },
268
+ dispose() { gone = true; turn++; playing = false; if (pending !== undefined) clock.cancel(pending); pending = undefined; for (const k of Object.keys(subs) as (keyof TransportEvents)[]) subs[k]!.clear(); },
269
+ };
270
+ arm();
271
+ return api;
272
+ }
@@ -0,0 +1,2 @@
1
+ import type { FontTable } from './kernel.js';
2
+ export declare const ARIMO: FontTable;
@@ -1,4 +1,4 @@
1
- export { S, C, iso, n1, pt, esc, tag, FONTS, textWidth, apply, matStr, faceFrame, Bounds, Kernel, center } from './kernel.js';
1
+ export { S, C, iso, n1, pt, esc, tag, FONTS, textWidth, withFont, apply, matStr, faceFrame, Bounds, Kernel, center } from './kernel.js';
2
2
  export type { P2, P3, Box, Attrs, FontKey, Font, Mat, Face, TextRect } from './kernel.js';
3
3
  export { termLines, envelope, bubble, fileLines, keyGlyph, socketGlyph, screenFaces, screenGlass, placeholderFace } from './glyphs.js';
4
4
  export type { FacePainter } from './glyphs.js';
@@ -15,3 +15,4 @@ export type { SvgNode } from './svg-dom.js';
15
15
  export { VEl, vdoc, serialize } from './vdom.js';
16
16
  export type { VNode } from './vdom.js';
17
17
  export { createHash, sha256Hex } from './shims/crypto.js';
18
+ export { MONO, greyOf, contrast, monoOf, type MonoLook, type MonoTable, type MonoPattern } from './mono.js';
@@ -63,6 +63,15 @@ export declare const FONTS: {
63
63
  size: number;
64
64
  };
65
65
  };
66
+ /** Another font's widths, by its name: never the default, and a drawing laid out with it says so. What it has no table for is the default's. */
67
+ export interface FontTable {
68
+ name: string; /** its font-family, with what stands in for it */
69
+ sans: string; /** the mono text's, when it has one */
70
+ mono?: string;
71
+ widths: Partial<Record<FontKey, Record<string, number>>>;
72
+ }
73
+ /** runs `fn` (now: it may not wait for anything) with its text measured as that font's */
74
+ export declare function withFont<T>(f: FontTable | undefined, fn: () => T): T;
66
75
  export declare function textWidth(str: string, f: Font): number;
67
76
  /** [a b c d e f] as in SVG matrix(): x' = a x + c y + e, y' = b x + d y + f */
68
77
  export type Mat = [number, number, number, number, number, number];
@@ -0,0 +1,61 @@
1
+ import type { Theme } from './theme.js';
2
+ export type MonoPattern = 'none' | 'hatch' | 'hatch-wide' | 'dots';
3
+ export type MonoStep = 0 | 1 | 2 | 3;
4
+ export interface MonoFace {
5
+ top: string;
6
+ left: string;
7
+ right: string;
8
+ edge: string;
9
+ }
10
+ export interface MonoRhythm {
11
+ dash: number[];
12
+ width: number;
13
+ }
14
+ export interface MonoRoleLook extends MonoFace {
15
+ step: MonoStep;
16
+ pattern: MonoPattern;
17
+ }
18
+ export interface MonoLook {
19
+ mode: 'light' | 'dark';
20
+ paper: string;
21
+ ink: string;
22
+ roles: Record<string, MonoRoleLook>;
23
+ kinds: Record<string, MonoRhythm>;
24
+ warnings: string[];
25
+ }
26
+ export interface MonoTable {
27
+ roles?: Record<string, {
28
+ step?: MonoStep;
29
+ pattern?: MonoPattern;
30
+ }>;
31
+ kinds?: Record<string, {
32
+ dash?: number[];
33
+ width?: number;
34
+ }>;
35
+ }
36
+ export declare const MONO: {
37
+ light: {
38
+ paper: string;
39
+ ink: string;
40
+ steps: readonly [MonoFace, MonoFace, MonoFace, MonoFace];
41
+ };
42
+ dark: {
43
+ paper: string;
44
+ ink: string;
45
+ steps: readonly [MonoFace, MonoFace, MonoFace, MonoFace];
46
+ };
47
+ patterns: readonly MonoPattern[];
48
+ rhythms: readonly MonoRhythm[];
49
+ kindOrder: readonly ["send", "reply", "token", "blocked", "user", "event", "control", "planned"];
50
+ thresholds: readonly [86, 81, 76];
51
+ darkWidthAdd: number;
52
+ };
53
+ /** CIE lightness L* (0 to 100) of a #rgb, #rrggbb or hsl(h s% l%) colour. */
54
+ export declare function greyOf(color: string): number;
55
+ /** WCAG 2.1 contrast ratio between two colours (1 to 21). */
56
+ export declare function contrast(a: string, b: string): number;
57
+ /** Map a theme's roles and kinds into deterministic monochrome steps, patterns and line rhythms. */
58
+ export declare function monoOf(theme: Theme, mode: 'light' | 'dark', use?: {
59
+ roles?: string[];
60
+ kinds?: string[];
61
+ }, own?: MonoTable): MonoLook;
@@ -17,10 +17,12 @@ export interface Theme {
17
17
  name: string;
18
18
  light: Record<string, string>;
19
19
  dark: Record<string, string>;
20
+ /** ants: the dash its connectors march with, where it isn't its dash's own */
20
21
  kinds: Record<string, {
21
22
  color: string;
22
23
  dash: 'solid' | 'dashed' | 'dotted';
23
24
  legend: string;
25
+ ants?: [number, number];
24
26
  }>;
25
27
  roles: Record<string, RawRole>;
26
28
  }
@@ -13,6 +13,7 @@ export interface AntsOptions {
13
13
  /** the connectors' dashes, by kind: the theme's `kinds` (a dashed kind marches with its own dash) */
14
14
  kinds?: Record<string, {
15
15
  dash?: 'solid' | 'dashed' | 'dotted';
16
+ ants?: [number, number];
16
17
  }>;
17
18
  /** kinds whose connectors stand still (default: blocked, planned) */
18
19
  still?: string[];
@@ -18,11 +18,13 @@ export { withAnts, antsOf, antDash, ANTS_CSS, ANT_SPEED, ANT_DASH, ANT_STILL } f
18
18
  export type { AntsOptions } from './ants.js';
19
19
  export { motion, MotionBuilder, SeriesBuilder, NodesBuilder } from './motion-builder.js';
20
20
  export type { SequenceOptions, Timing, CameraVerbs, Ids as MotionIds } from './motion-builder.js';
21
- export { bindMotion, motionOfSteps } from './timeline.js';
22
- export type { Timeline, BindOptions, BeatInfo, Cue } from './timeline.js';
23
- export { MOTION_SCHEMA, EASING_NAMES, EXTRAPOLATE, checkMotion, msOf, readMs, easeOf, curveAt, springAt, bezier } from './motion-doc.js';
21
+ export { bindMotion, motionOfSteps, motionSource } from './timeline.js';
22
+ export type { Timeline, BindOptions, BeatInfo, Cue, MotionSource } from './timeline.js';
23
+ export { MOTION_SCHEMA } from './motion-schema.js';
24
+ export { EASING_NAMES, EXTRAPOLATE, checkMotion, msOf, readMs, easeOf, curveAt, springAt, bezier } from './motion-doc.js';
24
25
  export type { MotionDoc, MotionNode, MotionTime, MotionEase, EasingName, Extrapolate, SpringConfig, Curve, Say as MotionSay, Focus, ReadTime, Sequence, SeriesItem, Transition, MotionDiag } from './motion-doc.js';
25
26
  export { resolveSvg, FONT_STACKS } from './resolve.js';
27
+ export { monoOfDrawing, monoTheme, monoCss, paintMono, usedIn } from './mono-paint.js';
26
28
  export type { ResolveOptions, ThemeMode } from './resolve.js';
27
29
  export { durationFor, resolveSteps, midpoint } from './steps.js';
28
30
  export type { RawStep, Token, StepData, Say, Mark, Badge, Steps } from './steps.js';
@@ -0,0 +1,20 @@
1
+ import { type Theme } from '../iso-core/theme.js';
2
+ import { type MonoLook, type MonoTable } from '../iso-core/mono.js';
3
+ import type { ThemeMode } from './resolve.js';
4
+ /** the roles and connector kinds a drawing uses */
5
+ export declare function usedIn(svg: string, theme: Theme, kinds: string[]): {
6
+ roles: string[];
7
+ kinds: string[];
8
+ };
9
+ /** the theme in greys, its tokens by the same names, so that everything that names one is grey too */
10
+ export declare function monoTheme(theme: Theme, look: MonoLook): Theme;
11
+ /** what is each role's and each kind's own: the faces' lightnesses, the connectors' rhythms */
12
+ export declare function monoCss(look: MonoLook): string;
13
+ /** The resolved drawing with its patterns, and no hue in it. `id`: the drawing's own (its patterns' ids begin with it). */
14
+ export declare function paintMono(svg: string, look: MonoLook, id: string): string;
15
+ /** Everything a compile needs for the treatment: the look, its theme and its rules. */
16
+ export declare function monoOfDrawing(svg: string, theme: Theme, mode: ThemeMode, kinds: string[], own?: MonoTable): {
17
+ look: MonoLook;
18
+ theme: Theme;
19
+ css: string;
20
+ };