@johnoscott/isometric-engine 0.14.1 → 0.16.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 +1 -1
- package/iso-editor.js +249 -203
- package/iso-render.js +200 -154
- package/iso-systems.js +210 -162
- package/isometric-diagram.js +389 -0
- package/js/iso-core/index.js +5 -0
- package/js/iso-core/mono.js +242 -0
- package/js/iso-editor/ui/canvas.js +23 -1
- package/js/iso-objects/ants.js +36 -0
- package/js/iso-objects/index.js +55 -1
- package/js/iso-objects/looks.js +25 -0
- package/js/iso-objects/mono-paint.js +96 -0
- package/js/iso-objects/motion-builder.js +130 -0
- package/js/iso-objects/motion-doc.js +421 -0
- package/js/iso-objects/motion-entry.js +34 -0
- package/js/iso-objects/motion-schema.js +83 -0
- package/js/iso-objects/motion.js +640 -0
- package/js/iso-objects/resolve.js +238 -0
- package/js/iso-objects/scene.js +15 -13
- package/js/iso-objects/timeline.js +593 -0
- package/js/iso-systems/compile.js +83 -1
- package/js/iso-systems/index.js +4 -1
- package/js/iso-systems/render.js +20 -0
- package/js/iso-systems/schema.json +40 -0
- package/js/iso-viewer/index.js +6 -0
- package/js/iso-viewer/page.js +40 -16
- package/js/iso-viewer/play.js +340 -0
- package/js/iso-viewer/player.js +149 -175
- package/js/iso-viewer/transport.js +289 -0
- package/package.json +84 -2
- package/src/iso-core/index.ts +1 -0
- 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 +53 -0
- package/src/iso-objects/compile.ts +4 -1
- package/src/iso-objects/index.ts +16 -1
- package/src/iso-objects/looks.ts +21 -0
- package/src/iso-objects/mono-paint.ts +97 -0
- package/src/iso-objects/motion-builder.ts +79 -0
- package/src/iso-objects/motion-doc.ts +309 -0
- package/src/iso-objects/motion-entry.ts +13 -0
- package/src/iso-objects/motion-schema.ts +55 -0
- package/src/iso-objects/motion.ts +617 -0
- package/src/iso-objects/resolve.ts +196 -0
- package/src/iso-objects/scene.ts +32 -13
- package/src/iso-objects/timeline.ts +493 -0
- package/src/iso-objects/types.ts +22 -2
- package/src/iso-systems/compile.ts +86 -4
- package/src/iso-systems/index.ts +4 -1
- package/src/iso-systems/render.ts +45 -0
- package/src/iso-systems/schema.json +40 -0
- package/src/iso-viewer/index.ts +4 -0
- package/src/iso-viewer/page.ts +28 -11
- package/src/iso-viewer/play.ts +280 -0
- package/src/iso-viewer/player.ts +132 -150
- package/src/iso-viewer/transport.ts +272 -0
- package/types/iso-core/index.d.ts +1 -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 +34 -0
- package/types/iso-objects/compile.d.ts +3 -0
- package/types/iso-objects/index.d.ts +16 -1
- package/types/iso-objects/looks.d.ts +4 -0
- package/types/iso-objects/mono-paint.d.ts +20 -0
- package/types/iso-objects/motion-builder.d.ts +105 -0
- package/types/iso-objects/motion-doc.d.ts +193 -0
- package/types/iso-objects/motion-entry.d.ts +11 -0
- package/types/iso-objects/motion-schema.d.ts +594 -0
- package/types/iso-objects/motion.d.ts +202 -0
- package/types/iso-objects/resolve.d.ts +20 -0
- package/types/iso-objects/scene.d.ts +14 -0
- package/types/iso-objects/timeline.d.ts +66 -0
- package/types/iso-objects/types.d.ts +34 -0
- package/types/iso-systems/compile.d.ts +25 -3
- package/types/iso-systems/index.d.ts +4 -1
- package/types/iso-systems/render.d.ts +25 -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
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { type PlanOptions } from './motion.js';
|
|
2
|
+
/** ms, or "1.2s", "450ms", "30f" (frames, at the document's fps) */
|
|
3
|
+
export type MotionTime = number | string;
|
|
4
|
+
export declare const EASING_NAMES: readonly ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'settle', 'bounce'];
|
|
5
|
+
export type EasingName = typeof EASING_NAMES[number];
|
|
6
|
+
export interface SpringConfig {
|
|
7
|
+
mass?: number;
|
|
8
|
+
damping?: number;
|
|
9
|
+
stiffness?: number;
|
|
10
|
+
overshootClamping?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export type MotionEase = EasingName | {
|
|
13
|
+
bezier: [number, number, number, number];
|
|
14
|
+
} | {
|
|
15
|
+
spring: SpringConfig;
|
|
16
|
+
};
|
|
17
|
+
export declare const EXTRAPOLATE: readonly ['extend', 'clamp', 'wrap', 'identity'];
|
|
18
|
+
export type Extrapolate = typeof EXTRAPOLATE[number];
|
|
19
|
+
/** a value over time: Remotion's interpolate, with ms for frames */
|
|
20
|
+
export interface Curve {
|
|
21
|
+
times: MotionTime[];
|
|
22
|
+
values: number[];
|
|
23
|
+
easing?: MotionEase;
|
|
24
|
+
extrapolateLeft?: Extrapolate;
|
|
25
|
+
extrapolateRight?: Extrapolate;
|
|
26
|
+
}
|
|
27
|
+
/** the commentary of a beat */
|
|
28
|
+
export interface Say {
|
|
29
|
+
chapter?: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
text?: string;
|
|
32
|
+
code?: string;
|
|
33
|
+
facts?: [string, string][];
|
|
34
|
+
color?: string;
|
|
35
|
+
}
|
|
36
|
+
/** what a beat's focus dims: everything else, or the connectors and notes only */
|
|
37
|
+
export interface Focus {
|
|
38
|
+
lit: string[];
|
|
39
|
+
scope?: 'all' | 'links';
|
|
40
|
+
level?: number;
|
|
41
|
+
always?: string[];
|
|
42
|
+
}
|
|
43
|
+
/** as long as it takes to read it: base + perChar × the text's length, between min and max */
|
|
44
|
+
export interface ReadTime {
|
|
45
|
+
read: true | {
|
|
46
|
+
base?: number;
|
|
47
|
+
perChar?: number;
|
|
48
|
+
min?: number;
|
|
49
|
+
max?: number;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
interface ChildTiming {
|
|
53
|
+
from?: MotionTime;
|
|
54
|
+
duration?: MotionTime;
|
|
55
|
+
easing?: MotionEase;
|
|
56
|
+
}
|
|
57
|
+
export interface Sequence {
|
|
58
|
+
name?: string;
|
|
59
|
+
from?: MotionTime;
|
|
60
|
+
duration?: MotionTime | ReadTime;
|
|
61
|
+
loop?: boolean | number;
|
|
62
|
+
playbackRate?: number;
|
|
63
|
+
trimBefore?: MotionTime;
|
|
64
|
+
/** in a series: later (or, negative, earlier) than the end of the one before; those after it move too */
|
|
65
|
+
offset?: MotionTime;
|
|
66
|
+
say?: Say;
|
|
67
|
+
/** cumulative: what is there is the fold of every beat to here */
|
|
68
|
+
show?: string[];
|
|
69
|
+
hide?: string[];
|
|
70
|
+
focus?: Focus;
|
|
71
|
+
/** things ringed while the beat lasts */
|
|
72
|
+
highlight?: string[];
|
|
73
|
+
/** how much of a thing or a connector is there in this beat (0 to 1), as a phase has it; with `*`, every one not named */
|
|
74
|
+
levels?: Record<string, number>;
|
|
75
|
+
/** which of its looks a thing has from this beat on (cumulative, as show is); "" is its own */
|
|
76
|
+
variants?: Record<string, string>;
|
|
77
|
+
/** the ramp from the beat before (what a CSS transition would do) */
|
|
78
|
+
enter?: {
|
|
79
|
+
fade: MotionTime;
|
|
80
|
+
easing?: MotionEase;
|
|
81
|
+
};
|
|
82
|
+
/** marching dashes: every connector shown, or these; a beat's own */
|
|
83
|
+
ants?: boolean | string[];
|
|
84
|
+
children?: MotionNode[];
|
|
85
|
+
layers?: MotionNode[];
|
|
86
|
+
series?: SeriesItem[];
|
|
87
|
+
}
|
|
88
|
+
export interface Transition {
|
|
89
|
+
presentation: 'fade' | 'none';
|
|
90
|
+
timing: {
|
|
91
|
+
linear: MotionTime;
|
|
92
|
+
} | {
|
|
93
|
+
spring: SpringConfig & {
|
|
94
|
+
duration?: MotionTime;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export type SeriesItem = {
|
|
99
|
+
sequence: Sequence;
|
|
100
|
+
} | {
|
|
101
|
+
transition: Transition;
|
|
102
|
+
};
|
|
103
|
+
export type MotionNode = {
|
|
104
|
+
sequence: Sequence;
|
|
105
|
+
} | {
|
|
106
|
+
series: SeriesItem[];
|
|
107
|
+
} | {
|
|
108
|
+
layers: MotionNode[];
|
|
109
|
+
} | ({
|
|
110
|
+
assemble: Omit<PlanOptions, 'duration'>;
|
|
111
|
+
} & ChildTiming) | ({
|
|
112
|
+
disassemble: Omit<PlanOptions, 'duration'>;
|
|
113
|
+
} & ChildTiming)
|
|
114
|
+
/** tokens along connectors: in sequence; a nested array is in parallel; "id:kind" colours one by a kind */
|
|
115
|
+
| ({
|
|
116
|
+
travel: (string | string[])[];
|
|
117
|
+
each?: MotionTime;
|
|
118
|
+
hold?: MotionTime;
|
|
119
|
+
loop?: boolean;
|
|
120
|
+
} & ChildTiming) | ({
|
|
121
|
+
pulse: string[];
|
|
122
|
+
loop?: boolean;
|
|
123
|
+
} & ChildTiming) | ({
|
|
124
|
+
ants: true | string[];
|
|
125
|
+
speed?: number;
|
|
126
|
+
dash?: [number, number];
|
|
127
|
+
} & ChildTiming) | ({
|
|
128
|
+
draw: string[];
|
|
129
|
+
by?: 'stroke' | 'grow';
|
|
130
|
+
stagger?: MotionTime;
|
|
131
|
+
} & ChildTiming) | ({
|
|
132
|
+
type: string[];
|
|
133
|
+
} & ChildTiming) | ({
|
|
134
|
+
move: string;
|
|
135
|
+
x?: Curve;
|
|
136
|
+
y?: Curve;
|
|
137
|
+
scale?: Curve;
|
|
138
|
+
opacity?: Curve;
|
|
139
|
+
} & {
|
|
140
|
+
from?: MotionTime;
|
|
141
|
+
})
|
|
142
|
+
/** `opacity`: over each thing's own time, from its own start (a slab that appears as it rises) */
|
|
143
|
+
| ({
|
|
144
|
+
lift: string[];
|
|
145
|
+
by: number;
|
|
146
|
+
stagger?: MotionTime;
|
|
147
|
+
to?: 'up' | 'down';
|
|
148
|
+
opacity?: Curve;
|
|
149
|
+
} & ChildTiming)
|
|
150
|
+
/** `fade`: how long it comes in and goes out over (250) */
|
|
151
|
+
| ({
|
|
152
|
+
focus: Focus;
|
|
153
|
+
fade?: MotionTime;
|
|
154
|
+
} & ChildTiming) | ({
|
|
155
|
+
highlight: string[];
|
|
156
|
+
fade?: MotionTime;
|
|
157
|
+
} & ChildTiming) | ({
|
|
158
|
+
camera: {
|
|
159
|
+
focus: string | string[] | [number, number, number, number];
|
|
160
|
+
zoom?: number;
|
|
161
|
+
margin?: number;
|
|
162
|
+
} | 'fit';
|
|
163
|
+
} & ChildTiming);
|
|
164
|
+
export interface MotionDoc {
|
|
165
|
+
isomotion: 1;
|
|
166
|
+
fps?: number;
|
|
167
|
+
seed?: number;
|
|
168
|
+
ambient?: 'on' | 'off';
|
|
169
|
+
series?: SeriesItem[];
|
|
170
|
+
layers?: MotionNode[];
|
|
171
|
+
/** named moments: ms, or "beat+1200" */
|
|
172
|
+
markers?: Record<string, MotionTime>;
|
|
173
|
+
}
|
|
174
|
+
export interface MotionDiag {
|
|
175
|
+
severity: 'error' | 'warning';
|
|
176
|
+
path: string;
|
|
177
|
+
message: string;
|
|
178
|
+
hint?: string;
|
|
179
|
+
}
|
|
180
|
+
/** a time in ms, or undefined when it isn't one */
|
|
181
|
+
export declare function msOf(t: unknown, fps?: number): number | undefined;
|
|
182
|
+
/** how long a beat's words take to read */
|
|
183
|
+
export declare function readMs(say: Say | undefined, r: ReadTime['read']): number;
|
|
184
|
+
export declare const bezier: (x1: number, y1: number, x2: number, y2: number) => (x: number) => number;
|
|
185
|
+
/** A damped spring from 0 to 1, t ms after it is let go: the closed form, no steps. */
|
|
186
|
+
export declare function springAt(t: number, c?: SpringConfig): number;
|
|
187
|
+
/** An easing as a function of the share of its time done; a spring is given the time's length too. */
|
|
188
|
+
export declare function easeOf(e: MotionEase | undefined, duration: number, otherwise?: EasingName): (f: number) => number;
|
|
189
|
+
/** Remotion's interpolate, for a checked curve: piecewise, the easing in each piece, the ends as asked (extend by default). */
|
|
190
|
+
export declare function curveAt(c: Curve, t: number, fps?: number): number;
|
|
191
|
+
/** What is wrong with a document's shape, each with its place (a JSON pointer). Its ids are bindMotion's to check. */
|
|
192
|
+
export declare function checkMotion(doc: unknown): MotionDiag[];
|
|
193
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './motion.js';
|
|
2
|
+
export { bindMotion, motionOfSteps, motionSource } from './timeline.js';
|
|
3
|
+
export type { Timeline, BindOptions, BeatInfo, Cue, MotionSource } from './timeline.js';
|
|
4
|
+
export { motion, MotionBuilder, SeriesBuilder, NodesBuilder } from './motion-builder.js';
|
|
5
|
+
export type { SequenceOptions, Timing, CameraVerbs, Ids as MotionIds } from './motion-builder.js';
|
|
6
|
+
export { MOTION_SCHEMA } from './motion-schema.js';
|
|
7
|
+
export { EASING_NAMES, EXTRAPOLATE, checkMotion, msOf, readMs, easeOf, curveAt, springAt, bezier } from './motion-doc.js';
|
|
8
|
+
export type { MotionDoc, MotionNode, MotionTime, MotionEase, EasingName, Extrapolate, SpringConfig, Curve, Say as MotionSay, Focus, ReadTime, Sequence, SeriesItem, Transition, MotionDiag } from './motion-doc.js';
|
|
9
|
+
export { withAnts, antsOf, antDash, ANTS_CSS, ANT_SPEED, ANT_DASH, ANT_STILL } from './ants.js';
|
|
10
|
+
export type { AntsOptions } from './ants.js';
|
|
11
|
+
export { drawLooks } from './looks.js';
|