@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.
- package/README.md +3 -1
- package/iso-editor.js +230 -193
- package/iso-remotion.js +353 -0
- package/iso-render.js +184 -147
- package/iso-systems.js +183 -146
- package/isometric-diagram.js +389 -0
- package/js/iso-core/arimo.js +5 -0
- package/js/iso-core/arimo.json +1 -0
- package/js/iso-core/index.js +8 -2
- package/js/iso-core/kernel.js +13 -2
- package/js/iso-core/mono.js +242 -0
- package/js/iso-editor/ui/canvas.js +23 -1
- package/js/iso-objects/ants.js +1 -1
- package/js/iso-objects/index.js +10 -2
- package/js/iso-objects/mono-paint.js +96 -0
- package/js/iso-objects/motion-doc.js +0 -79
- package/js/iso-objects/motion-entry.js +4 -2
- package/js/iso-objects/motion-schema.js +83 -0
- package/js/iso-objects/motion.js +9 -4
- package/js/iso-objects/timeline.js +60 -16
- package/js/iso-systems/compile.js +34 -3
- package/js/iso-systems/render.js +1 -1
- package/js/iso-systems/schema.json +1 -0
- package/js/iso-viewer/index.js +6 -0
- package/js/iso-viewer/page.js +40 -17
- package/js/iso-viewer/play.js +340 -0
- package/js/iso-viewer/player.js +147 -162
- package/js/iso-viewer/transport.js +289 -0
- package/package.json +61 -2
- package/src/iso-core/arimo.json +1 -0
- package/src/iso-core/arimo.ts +6 -0
- package/src/iso-core/index.ts +2 -1
- package/src/iso-core/kernel.ts +11 -1
- package/src/iso-core/mono.ts +306 -0
- package/src/iso-core/theme.ts +2 -1
- package/src/iso-editor/ui/canvas.ts +14 -1
- package/src/iso-objects/ants.ts +2 -2
- package/src/iso-objects/index.ts +5 -3
- package/src/iso-objects/mono-paint.ts +97 -0
- package/src/iso-objects/motion-doc.ts +0 -52
- package/src/iso-objects/motion-entry.ts +4 -3
- package/src/iso-objects/motion-schema.ts +55 -0
- package/src/iso-objects/motion.ts +6 -5
- package/src/iso-objects/scene.ts +3 -0
- package/src/iso-objects/timeline.ts +71 -15
- package/src/iso-objects/types.ts +2 -0
- package/src/iso-systems/compile.ts +37 -4
- package/src/iso-systems/render.ts +5 -1
- package/src/iso-systems/schema.json +1 -0
- package/src/iso-viewer/index.ts +4 -0
- package/src/iso-viewer/page.ts +28 -12
- package/src/iso-viewer/play.ts +280 -0
- package/src/iso-viewer/player.ts +133 -134
- package/src/iso-viewer/transport.ts +272 -0
- package/types/iso-core/arimo.d.ts +2 -0
- package/types/iso-core/index.d.ts +2 -1
- package/types/iso-core/kernel.d.ts +9 -0
- package/types/iso-core/mono.d.ts +61 -0
- package/types/iso-core/theme.d.ts +2 -0
- package/types/iso-objects/ants.d.ts +1 -0
- package/types/iso-objects/index.d.ts +5 -3
- package/types/iso-objects/mono-paint.d.ts +20 -0
- package/types/iso-objects/motion-doc.d.ts +0 -594
- package/types/iso-objects/motion-entry.d.ts +4 -3
- package/types/iso-objects/motion-schema.d.ts +594 -0
- package/types/iso-objects/motion.d.ts +4 -2
- package/types/iso-objects/scene.d.ts +3 -0
- package/types/iso-objects/timeline.d.ts +26 -3
- package/types/iso-objects/types.d.ts +2 -0
- package/types/iso-systems/compile.d.ts +8 -0
- package/types/iso-systems/render.d.ts +4 -0
- package/types/iso-viewer/index.d.ts +4 -0
- package/types/iso-viewer/play.d.ts +37 -0
- package/types/iso-viewer/transport.d.ts +73 -0
- package/types/player/isometric-diagram.d.ts +24 -0
- package/types/remotion/entry.d.ts +2 -0
- package/types/remotion/frames.d.ts +70 -0
- package/types/remotion/index.d.ts +39 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Diag } from '../iso-core/errors.js';
|
|
2
2
|
import { type Compiled } from '../iso-objects/compile.js';
|
|
3
3
|
import { type ThemeMode } from '../iso-objects/resolve.js';
|
|
4
|
+
import type { MonoTable } from '../iso-core/mono.js';
|
|
5
|
+
import { type FontTable } from '../iso-core/kernel.js';
|
|
4
6
|
export type { Compiled, CompiledScene } from '../iso-objects/compile.js';
|
|
5
7
|
export interface CompileOptions {
|
|
6
8
|
/** overrides every scene's grid snap (the editor's snap control) */
|
|
@@ -10,6 +12,12 @@ export interface CompileOptions {
|
|
|
10
12
|
/** (0.15.0) self-contained drawings: each scene's SVG has its colours and text styles on its elements, in `mode`: no
|
|
11
13
|
* stylesheet, no custom properties, no hsl() or color-mix() (svgAt's frames too) */
|
|
12
14
|
resolveVars?: boolean;
|
|
15
|
+
/** (0.16.0) a self-contained drawing in black and white, in either mode: greys, patterns and line rhythms, and no hue */
|
|
16
|
+
treatment?: 'mono' | 'none';
|
|
17
|
+
/** a host's own table, over the treatment's */
|
|
18
|
+
mono?: MonoTable;
|
|
19
|
+
/** (0.17.0) a self-contained drawing laid out with another font's widths (Arimo's: modules/iso-core/arimo), and asking for it. The host loads the font */
|
|
20
|
+
font?: FontTable;
|
|
13
21
|
/** a file with an error draws nothing: `scenes` is empty (true), or it throws ('throw'). Default: what could be laid
|
|
14
22
|
* out is in `scenes` all the same, with `ok` false */
|
|
15
23
|
strict?: boolean | 'throw';
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { type AntsOptions } from '../iso-objects/ants.js';
|
|
2
2
|
import type { MotionDoc } from '../iso-objects/motion-doc.js';
|
|
3
|
+
import type { MonoTable } from '../iso-core/mono.js';
|
|
3
4
|
import type { ThemeMode } from '../iso-objects/resolve.js';
|
|
4
5
|
export interface RenderSvgOptions {
|
|
5
6
|
/** the theme's text */
|
|
6
7
|
theme: string;
|
|
7
8
|
mode?: ThemeMode;
|
|
9
|
+
/** black and white, in either mode, and a host's own table for it */
|
|
10
|
+
treatment?: 'mono' | 'none';
|
|
11
|
+
mono?: MonoTable;
|
|
8
12
|
/** which scene: its id or its place (default: the first) */
|
|
9
13
|
scene?: string | number;
|
|
10
14
|
/** a moment of its motion, ms: the still without it */
|
|
@@ -8,6 +8,10 @@ export { n, node, rewrite, prune, cls, attr, extent, unite, fitWithOverlay } fro
|
|
|
8
8
|
export { isoVars, scopeSelector, scope } from './view-css.js';
|
|
9
9
|
export { md, stepData, legend, renderPage } from './page.js';
|
|
10
10
|
export type { PageOpts } from './page.js';
|
|
11
|
+
export { transport, pageClock } from './transport.js';
|
|
12
|
+
export type { Transport, TransportClock, TransportEvents, TransportOptions } from './transport.js';
|
|
13
|
+
export { mountPlayer, PLAY_CSS } from './play.js';
|
|
14
|
+
export type { Player, PlayerOptions } from './play.js';
|
|
11
15
|
export { h } from './dom.js';
|
|
12
16
|
export { TIMELINE_VERSION, SEGMENT_NAME, SEVERITIES, BINS, BIN_MS, scopePattern } from './timeline-contract.js';
|
|
13
17
|
export type { TimelineTypes, AnyTimeline, Scope, Severity, AttrValue, TimelineEvent, Bin, MetricPoint, MetricRollup, EventBin, Match, AstTerm, SearchAst, Days, Retention, SeriesInfo, KindInfo, SourceInfo, EffectiveRetention, ScopeName, Catalog, Filters, Query, Row, Result, Batch, View as TimelineView, Recording, TimelineSource, TimelineCatalog } from './timeline-contract.js';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CompiledScene } from '../iso-objects/compile.js';
|
|
2
|
+
import type { Timeline } from '../iso-objects/timeline.js';
|
|
3
|
+
import { type Transport, type TransportClock } from './transport.js';
|
|
4
|
+
export interface PlayerOptions {
|
|
5
|
+
scene: Pick<CompiledScene, 'rendered' | 'id'>;
|
|
6
|
+
/** none: the drawing alone, with nothing to play */
|
|
7
|
+
timeline?: Timeline;
|
|
8
|
+
/** what a screen reader calls it */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** the controls and the commentary (default true): without them, the drawing alone */
|
|
11
|
+
controls?: boolean;
|
|
12
|
+
/** start at once, or each time most of it is in view (default: neither) */
|
|
13
|
+
autoplay?: boolean | 'visible';
|
|
14
|
+
loop?: boolean;
|
|
15
|
+
rate?: number;
|
|
16
|
+
ambient?: 'on' | 'off';
|
|
17
|
+
/** a reader who asked for less motion (default 'ignore': motion plays). 'respect': the last state, everything lit, the ambient off, until they press Play */
|
|
18
|
+
reducedMotion?: 'ignore' | 'respect';
|
|
19
|
+
mode?: 'light' | 'dark';
|
|
20
|
+
/** the timeline is the drawing's own steps (motionOfSteps): its callouts and marks show at their step, and the other steps' numbers dim */
|
|
21
|
+
steps?: boolean;
|
|
22
|
+
clock?: TransportClock;
|
|
23
|
+
}
|
|
24
|
+
export interface Player {
|
|
25
|
+
readonly root: HTMLElement;
|
|
26
|
+
readonly transport: Transport;
|
|
27
|
+
/** another drawing, or another document: the place is kept (transport's rebind). Faults are refused, and what plays goes on */
|
|
28
|
+
set(scene: Pick<CompiledScene, 'rendered' | 'id'>, timeline?: Timeline, mode?: 'light' | 'dark'): boolean;
|
|
29
|
+
/** show one moment, still: no clock, no controls (a screenshot, a link) */
|
|
30
|
+
freeze(ms: number): void;
|
|
31
|
+
/** to a beat and through it, stopping before the next */
|
|
32
|
+
step(beat: number): void;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
export declare function mountPlayer(host: HTMLElement | ShadowRoot, o: PlayerOptions): Player;
|
|
36
|
+
/** The player's stylesheet: its own, under one class; the colours are custom properties a host may set. */
|
|
37
|
+
export declare const PLAY_CSS = "\n.iso-play{--ip-ink:#1c2026;--ip-muted:#68707c;--ip-line:#dfe3e8;--ip-bg:#fff;--ip-code:#f2f4f7;--ip-focus:#2a64d6;container:iso-play/inline-size;display:block;color:var(--ip-ink);background:var(--ip-bg);font:14px/1.5 system-ui,-apple-system,\"Segoe UI\",sans-serif;border-radius:10px}\n.iso-play[data-mode=\"dark\"]{--ip-ink:#e6e9ee;--ip-muted:#98a1ae;--ip-line:#333a44;--ip-bg:#15181d;--ip-code:#1f242b;--ip-focus:#7aa7ff;color-scheme:dark}\n.iso-play:focus-visible,.iso-play button:focus-visible,.iso-play input:focus-visible,.iso-play summary:focus-visible{outline:2px solid var(--ip-focus);outline-offset:2px}\n.iso-play [hidden]{display:none}\n.iso-play-stage svg{display:block;width:100%;height:auto}\n.iso-play-stage [data-go]{cursor:pointer}\n.iso-play-row{display:flex;align-items:center;gap:6px;padding:8px 12px 4px}\n.iso-play-btn{font:inherit;min-width:32px;height:32px;padding:0 8px;border:1px solid var(--ip-line);border-radius:8px;background:none;color:inherit;cursor:pointer}\n.iso-play-btn:hover{border-color:var(--ip-muted)}\n.iso-play-btn.play{background:var(--ip-ink);color:var(--ip-bg);border-color:var(--ip-ink);min-width:44px}\n.iso-play-btn.ambient[aria-pressed=\"false\"]{color:var(--ip-muted);text-decoration:line-through}\n.iso-play-bar{flex:1 1 60px;min-width:0;accent-color:var(--ip-ink)}\n.iso-play-time{color:var(--ip-muted);font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}\n.iso-play-dots{display:flex;flex-wrap:wrap;gap:4px 12px;padding:2px 12px}\n.iso-play-group{display:inline-flex;gap:0}\n.iso-play-dot{width:24px;height:24px;padding:0;border:0;background:none;cursor:pointer;display:grid;place-items:center}\n.iso-play-dot::before{content:\"\";width:9px;height:9px;border-radius:50%;background:var(--ip-line)}\n.iso-play-dot.done::before{background:var(--ip-muted)}\n.iso-play-dot.on::before{background:var(--ip-ink);width:11px;height:11px}\n.iso-play-say{padding:4px 12px 10px;min-height:5.2em}\n.iso-play-head{display:flex;align-items:baseline;gap:8px;font-weight:700}\n.iso-play-num{flex:none;display:inline-grid;place-items:center;min-width:22px;height:22px;border-radius:11px;background:var(--ip-ink);color:var(--ip-bg);font-size:11px;align-self:center}\n.iso-play-chapter,.iso-play-count{color:var(--ip-muted);font-size:12px;font-weight:500}\n.iso-play-count{margin-left:auto;white-space:nowrap}\n.iso-play-text{max-width:80ch}\n.iso-play-text a{color:inherit}\n.iso-play-code{margin:6px 0 0;padding:6px 10px;border-radius:8px;background:var(--ip-code);font:12px/1.5 ui-monospace,Menlo,monospace;white-space:pre-wrap;overflow-wrap:anywhere}\n.iso-play-facts{display:flex;flex-wrap:wrap;gap:2px 16px;margin:6px 0 0;font-size:12px}\n.iso-play-facts dt{color:var(--ip-muted)}\n.iso-play-facts dd{margin:0 8px 0 -10px;font-weight:600}\n.iso-play-list{padding:0 12px 10px;font-size:13px}\n.iso-play-list summary{color:var(--ip-muted);cursor:pointer}\n.iso-play.frozen>:not(.iso-play-stage){display:none}\n@container iso-play (max-width:420px){.iso-play-time{display:none}.iso-play-row{flex-wrap:wrap}.iso-play-bar{flex-basis:100%;order:9}}\n";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { BeatInfo, Cue, Timeline } from '../iso-objects/timeline.js';
|
|
2
|
+
import type { SceneState } from '../iso-objects/motion.js';
|
|
3
|
+
export interface TransportClock {
|
|
4
|
+
/** ms, going only forward */
|
|
5
|
+
now(): number;
|
|
6
|
+
/** call f soon, once: the next frame; returns what cancel takes */
|
|
7
|
+
next(f: () => void): unknown;
|
|
8
|
+
cancel(id: unknown): void;
|
|
9
|
+
}
|
|
10
|
+
export interface TransportOptions {
|
|
11
|
+
/** start again at the end (default false) */
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
/** how fast (default 1) */
|
|
14
|
+
rate?: number;
|
|
15
|
+
/** default: the document's own */
|
|
16
|
+
ambient?: 'on' | 'off';
|
|
17
|
+
clock?: TransportClock;
|
|
18
|
+
}
|
|
19
|
+
export interface TransportEvents {
|
|
20
|
+
/** the drawing is to be painted again: T (ms), and why */
|
|
21
|
+
time: (ms: number, why: 'play' | 'ambient' | 'seek' | 'rebind') => void;
|
|
22
|
+
play: () => void;
|
|
23
|
+
pause: () => void;
|
|
24
|
+
/** it came to its end and stopped (not at each turn of a loop: that is 'loop') */
|
|
25
|
+
end: () => void;
|
|
26
|
+
loop: () => void;
|
|
27
|
+
/** 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 */
|
|
28
|
+
beat: (beat: BeatInfo, how: 'play' | 'seek' | 'rebind') => void;
|
|
29
|
+
ambient: (on: boolean) => void;
|
|
30
|
+
rate: (rate: number) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface Transport {
|
|
33
|
+
readonly timeline: Timeline;
|
|
34
|
+
readonly duration: number;
|
|
35
|
+
/** T, ms */
|
|
36
|
+
readonly time: number;
|
|
37
|
+
/** A, ms, or 'off' when it never ran: what at()'s `ambient` takes */
|
|
38
|
+
readonly ambientTime: number | 'off';
|
|
39
|
+
readonly playing: boolean;
|
|
40
|
+
readonly beat: BeatInfo | undefined;
|
|
41
|
+
readonly cue: Cue | undefined;
|
|
42
|
+
rate: number;
|
|
43
|
+
loop: boolean;
|
|
44
|
+
ambient: boolean;
|
|
45
|
+
/** whether the host shows it now (default true): while false neither clock moves, playing or not */
|
|
46
|
+
active: boolean;
|
|
47
|
+
/** what the drawing looks like now */
|
|
48
|
+
state(): SceneState;
|
|
49
|
+
/** until: pause there (a time still ahead) */
|
|
50
|
+
play(o?: {
|
|
51
|
+
until?: number;
|
|
52
|
+
}): void;
|
|
53
|
+
pause(): void;
|
|
54
|
+
toggle(): void;
|
|
55
|
+
/** join: the ambient clock at that time too (a step taken: what loops starts with it), where the ambient is on */
|
|
56
|
+
seek(ms: number, o?: {
|
|
57
|
+
join?: boolean;
|
|
58
|
+
}): void;
|
|
59
|
+
/** to a beat's start, by its name or its index; whether there is one */
|
|
60
|
+
seekBeat(beat: string | number): boolean;
|
|
61
|
+
/** to the next beat's start, or the end; to this beat's start, or the one before when nearly there */
|
|
62
|
+
next(): void;
|
|
63
|
+
prev(): void;
|
|
64
|
+
restart(): void;
|
|
65
|
+
/** 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 */
|
|
66
|
+
rebind(tl: Timeline): boolean;
|
|
67
|
+
/** returns how to stop listening */
|
|
68
|
+
on<K extends keyof TransportEvents>(event: K, f: TransportEvents[K]): () => void;
|
|
69
|
+
dispose(): void;
|
|
70
|
+
}
|
|
71
|
+
/** the page's clock: frames, and a timer behind them, so it also goes on where no frames are drawn (a page not shown) */
|
|
72
|
+
export declare function pageClock(): TransportClock;
|
|
73
|
+
export declare function transport(tl0: Timeline, o?: TransportOptions): Transport;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MotionDoc } from '../iso-objects/motion-doc.js';
|
|
2
|
+
import type { Transport } from '../iso-viewer/transport.js';
|
|
3
|
+
/** a page with no DOM (a server that imports this) has no elements: the class is there, and does nothing */
|
|
4
|
+
declare const Base: typeof HTMLElement;
|
|
5
|
+
export declare class IsometricDiagram extends Base {
|
|
6
|
+
#private;
|
|
7
|
+
static readonly observedAttributes: string[];
|
|
8
|
+
/** the drawing's text: the property when set, else what is written in the element */
|
|
9
|
+
get source(): string;
|
|
10
|
+
set source(v: string);
|
|
11
|
+
/** the theme's text (default: the engine's) */
|
|
12
|
+
get theme(): string;
|
|
13
|
+
set theme(v: string | undefined);
|
|
14
|
+
/** the motion (default: the scene's own in the file, or its steps) */
|
|
15
|
+
get motion(): MotionDoc | undefined;
|
|
16
|
+
set motion(v: MotionDoc | undefined);
|
|
17
|
+
/** once drawn: play, pause, seek, beats, the ambient switch */
|
|
18
|
+
get transport(): Transport | undefined;
|
|
19
|
+
connectedCallback(): void;
|
|
20
|
+
disconnectedCallback(): void;
|
|
21
|
+
attributeChangedCallback(name: string, was: string | null, now: string | null): void;
|
|
22
|
+
}
|
|
23
|
+
export { mountPlayer, PLAY_CSS } from '../iso-viewer/play.js';
|
|
24
|
+
export type { Player, PlayerOptions } from '../iso-viewer/play.js';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type Compiled, type CompiledScene } from '../iso-systems/compile.js';
|
|
2
|
+
import { type Cue, type Timeline } from '../iso-objects/timeline.js';
|
|
3
|
+
import { type MotionDoc, type Transition } from '../iso-objects/motion-doc.js';
|
|
4
|
+
export interface DrawingProps {
|
|
5
|
+
/** the drawing's text */
|
|
6
|
+
src: string;
|
|
7
|
+
/** the theme's text */
|
|
8
|
+
theme: string;
|
|
9
|
+
/** default: the scene's own motion, else its steps */
|
|
10
|
+
motion?: MotionDoc;
|
|
11
|
+
/** the scene's id (default: the first) */
|
|
12
|
+
scene?: string;
|
|
13
|
+
mode?: 'light' | 'dark';
|
|
14
|
+
treatment?: 'mono' | 'none';
|
|
15
|
+
/** lay the text out with Arimo's widths, and ask for it (default: the system's). The video loads the font itself: isometricFonts */
|
|
16
|
+
font?: 'arimo';
|
|
17
|
+
/** the ambient clock: with the video (default), or 'off' */
|
|
18
|
+
ambient?: 'off';
|
|
19
|
+
}
|
|
20
|
+
export interface Drawing {
|
|
21
|
+
compiled: Compiled;
|
|
22
|
+
scene: CompiledScene;
|
|
23
|
+
timeline: Timeline;
|
|
24
|
+
}
|
|
25
|
+
/** Throws, with every fault, when the drawing or its motion has one: a video of half a drawing is worse than none. */
|
|
26
|
+
export declare function drawingOf(p: DrawingProps): Drawing;
|
|
27
|
+
/** a frame's moment, ms: its start. Fractional frames too (a playback rate gives them). */
|
|
28
|
+
export declare const timeOf: (frame: number, fps: number) => number;
|
|
29
|
+
/** how many frames show all of it: the last one is at its end or past it */
|
|
30
|
+
export declare const framesOf: (ms: number, fps: number) => number;
|
|
31
|
+
/** A frame's SVG, its ids with a prefix of this instance's own (a transition mounts two at once). */
|
|
32
|
+
export declare function frameSvg(d: Drawing, frame: number, fps: number, o?: {
|
|
33
|
+
prefix?: string;
|
|
34
|
+
ambient?: 'off';
|
|
35
|
+
}): string;
|
|
36
|
+
export declare const cueAt: (d: Drawing, frame: number, fps: number) => Cue | undefined;
|
|
37
|
+
/** Remotion's calculateMetadata: the video is as long as the drawing's motion. */
|
|
38
|
+
export declare const isometricMetadata: (o: {
|
|
39
|
+
fps: number;
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}) => ({ props }: {
|
|
43
|
+
props: DrawingProps;
|
|
44
|
+
}) => {
|
|
45
|
+
fps: number;
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
durationInFrames: number;
|
|
49
|
+
};
|
|
50
|
+
/** What loadFont of Remotion's fonts package takes, for a font file of the host's own: `loadFont(isometricFonts({ url: staticFile('Arimo-wght.ttf') }))`.
|
|
51
|
+
* The package has no font file. */
|
|
52
|
+
export declare function isometricFonts(o: {
|
|
53
|
+
url: string;
|
|
54
|
+
format?: 'woff2' | 'woff' | 'opentype' | 'truetype';
|
|
55
|
+
}): {
|
|
56
|
+
family: string;
|
|
57
|
+
url: string;
|
|
58
|
+
weight: string;
|
|
59
|
+
format?: 'woff2' | 'woff' | 'opentype' | 'truetype';
|
|
60
|
+
};
|
|
61
|
+
/** A timing as the document's transitions have it: `{ linear: 400 }`, `{ linear: '12f' }`, `{ spring: { damping: 200 } }`. */
|
|
62
|
+
export declare function isometricTiming(timing: Transition['timing']): {
|
|
63
|
+
getDurationInFrames(o: {
|
|
64
|
+
fps: number;
|
|
65
|
+
}): number;
|
|
66
|
+
getProgress(o: {
|
|
67
|
+
frame: number;
|
|
68
|
+
fps: number;
|
|
69
|
+
}): number;
|
|
70
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import type { BeatInfo, Cue } from '../iso-objects/timeline.js';
|
|
3
|
+
import { type DrawingProps } from './frames.js';
|
|
4
|
+
export { cueAt, drawingOf, frameSvg, framesOf, isometricFonts, isometricMetadata, isometricTiming, timeOf } from './frames.js';
|
|
5
|
+
export type { Drawing, DrawingProps } from './frames.js';
|
|
6
|
+
export interface IsometricSceneProps extends DrawingProps {
|
|
7
|
+
width?: number | string;
|
|
8
|
+
height?: number | string;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
/** what its ids begin with (default: this instance's own): a transition mounts two copies at once */
|
|
12
|
+
prefix?: string;
|
|
13
|
+
}
|
|
14
|
+
/** the props a presentation's component is given by Remotion's transitions */
|
|
15
|
+
interface PresentationProps {
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
presentationDirection: 'entering' | 'exiting';
|
|
18
|
+
presentationProgress: number;
|
|
19
|
+
presentationDurationInFrames?: number;
|
|
20
|
+
passedProps: IsometricPresentationProps;
|
|
21
|
+
}
|
|
22
|
+
export interface IsometricPresentationProps extends Record<string, unknown> {
|
|
23
|
+
/** what the scene going out does: fades too (default: a drawing has no ground of its own, so it would show through), or stays */
|
|
24
|
+
exiting?: 'fade' | 'stay';
|
|
25
|
+
}
|
|
26
|
+
/** The document's 'fade', between two scenes of a TransitionSeries: `presentation={isometricPresentation()}`. */
|
|
27
|
+
export declare function isometricPresentation(props?: IsometricPresentationProps): {
|
|
28
|
+
component: (p: PresentationProps) => ReactElement;
|
|
29
|
+
props: IsometricPresentationProps;
|
|
30
|
+
};
|
|
31
|
+
/** The drawing at the current frame (a Sequence's own, inside one). */
|
|
32
|
+
export declare function IsometricScene(p: IsometricSceneProps): ReactElement;
|
|
33
|
+
/** The commentary now: for a caption of the host's own. */
|
|
34
|
+
export declare function useIsometricCues(p: DrawingProps): Cue | undefined;
|
|
35
|
+
export interface IsometricSequencesProps extends DrawingProps {
|
|
36
|
+
children: (beat: BeatInfo) => ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/** A Remotion Sequence for each beat, by its name (so Studio's timeline shows them), with what the host puts in it. */
|
|
39
|
+
export declare function IsometricSequences(p: IsometricSequencesProps): ReactElement;
|