@motionscript/react 0.0.0-stage → 0.1.0-alpha.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/CHANGELOG.md +5 -0
- package/LICENSE +201 -0
- package/README.md +104 -3
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/browser/manifest.json +13 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/motionscript-react.js +452 -0
- package/dist/motionscript-react.js.map +1 -0
- package/dist/ui/playhead.d.ts +26 -0
- package/dist/ui/playhead.d.ts.map +1 -0
- package/dist/ui/stage.d.ts +98 -0
- package/dist/ui/stage.d.ts.map +1 -0
- package/dist/ui/use-motion-player.d.ts +156 -0
- package/dist/ui/use-motion-player.d.ts.map +1 -0
- package/package.json +63 -3
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { Size2D } from '@motionscript/core';
|
|
3
|
+
import { Player } from './use-motion-player';
|
|
4
|
+
export interface MotionStageProps {
|
|
5
|
+
/** The player whose session this stage draws. */
|
|
6
|
+
player: Player;
|
|
7
|
+
/**
|
|
8
|
+
* Device pixels to rasterize per viewport unit. Defaults to `1`.
|
|
9
|
+
*
|
|
10
|
+
* **Not a zoom and not a crop.** The viewport stays the scene's logical
|
|
11
|
+
* coordinate space; this only changes how many real pixels that space is
|
|
12
|
+
* drawn into, and CSS scales the canvas back up to fill its box.
|
|
13
|
+
*
|
|
14
|
+
* The lever exists because a preview is usually displayed far smaller than
|
|
15
|
+
* the project's output size: a 1920×1080 project in a 700px-wide panel
|
|
16
|
+
* rasterizes roughly seven times the pixels anyone can see. `0.5` there is a
|
|
17
|
+
* quarter of the fill, the shader work and the effect offscreens.
|
|
18
|
+
*
|
|
19
|
+
* Two things to know before animating it:
|
|
20
|
+
*
|
|
21
|
+
* - **Every change re-creates the Skia surface**, which drops the storage
|
|
22
|
+
* adapter's texture-backed images (decoded video frames, 3D composites;
|
|
23
|
+
* still images survive) and asks for a fresh GL context. Quantize to a few
|
|
24
|
+
* steps and let it settle — never drive it from a resize observer.
|
|
25
|
+
* - **Prefer scales that keep both dimensions whole.** `pixelRatio` is one
|
|
26
|
+
* uniform number, so a scale that rounds differently on each axis shifts
|
|
27
|
+
* the frame's centre by up to half a device pixel.
|
|
28
|
+
*
|
|
29
|
+
* A snapshot from `player.screenshot()` comes back at the surface's size, so
|
|
30
|
+
* it is scaled too — render at `1` if you need full resolution out of it.
|
|
31
|
+
*/
|
|
32
|
+
renderScale?: number;
|
|
33
|
+
/**
|
|
34
|
+
* The canvas's own size in CSS pixels, when it is **not** the frame.
|
|
35
|
+
*
|
|
36
|
+
* Omitted — the default — the canvas is the frame: sized `viewport ×
|
|
37
|
+
* renderScale` and stretched over its box by CSS, which is what every
|
|
38
|
+
* export, thumbnail and plain player wants.
|
|
39
|
+
*
|
|
40
|
+
* Supplied, together with {@link view}, the canvas becomes a *window* onto
|
|
41
|
+
* the frame: it takes the size of the area it is shown in, `renderScale`
|
|
42
|
+
* stops meaning "fraction of the project's resolution" and starts meaning
|
|
43
|
+
* device pixels per CSS pixel, and only what is on screen is rasterized.
|
|
44
|
+
* That is what lets an editor zoom in without going soft or paying for the
|
|
45
|
+
* whole frame at the zoomed resolution.
|
|
46
|
+
*
|
|
47
|
+
* It re-creates the surface exactly as `renderScale` does, and wants the
|
|
48
|
+
* same treatment: quantize it and let it settle.
|
|
49
|
+
*/
|
|
50
|
+
surfaceSize?: Size2D;
|
|
51
|
+
/**
|
|
52
|
+
* A pan and zoom applied to the render itself. Requires {@link surfaceSize}.
|
|
53
|
+
*
|
|
54
|
+
* `zoom` multiplies scene units; `x`/`y` offset the frame's centre in CSS
|
|
55
|
+
* pixels, positive `y` downwards — the same sign convention as a CSS
|
|
56
|
+
* translate, so a preview can hand over the pan it was already computing.
|
|
57
|
+
*
|
|
58
|
+
* Changing it costs a repaint and nothing else: no surface, no textures, no
|
|
59
|
+
* precomp. That is the point of it living here rather than in a CSS
|
|
60
|
+
* transform, which cannot add resolution it was not rasterized with.
|
|
61
|
+
*/
|
|
62
|
+
view?: {
|
|
63
|
+
zoom: number;
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Whether the frame's edge bounds what draws, rather than only where its own
|
|
69
|
+
* backdrop goes. Requires {@link surfaceSize} and {@link view}. Defaults to
|
|
70
|
+
* `true`.
|
|
71
|
+
*
|
|
72
|
+
* Off lets a node parked past the frame's edge rasterize into the rest of
|
|
73
|
+
* the surface instead of being discarded — for a host that wants to show,
|
|
74
|
+
* faded, what a node placed there while animating in or out.
|
|
75
|
+
*/
|
|
76
|
+
clipToFrame?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* What the frame's backdrop is painted with. Defaults to `"black"`.
|
|
79
|
+
*
|
|
80
|
+
* `"transparent"` leaves the frame unpainted where nothing was drawn, so
|
|
81
|
+
* whatever the host renders behind the canvas shows through — a
|
|
82
|
+
* checkerboard, for an editor that has to distinguish "no scene covers this"
|
|
83
|
+
* from "a scene covers it in black". Requires {@link surfaceSize} and
|
|
84
|
+
* {@link view}, the same way {@link clipToFrame} does.
|
|
85
|
+
*/
|
|
86
|
+
frameBackground?: "black" | "transparent";
|
|
87
|
+
className?: string;
|
|
88
|
+
style?: CSSProperties;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A canvas bound to a {@link Player}'s session.
|
|
92
|
+
*
|
|
93
|
+
* The stage owns how the frame is rasterized — resolution, view, clipping — and
|
|
94
|
+
* nothing about what is in it or when. A session drives **one** surface, so one
|
|
95
|
+
* stage per player: a second would take the surface from the first.
|
|
96
|
+
*/
|
|
97
|
+
export declare function MotionStage({ player, renderScale, surfaceSize, view, clipToFrame, frameBackground, className, style, }: MotionStageProps): import("react").JSX.Element;
|
|
98
|
+
//# sourceMappingURL=stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/ui/stage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAuB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAsBlD,MAAM,WAAW,gBAAgB;IAC7B,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;;;;;OAgBG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EACxB,MAAM,EACN,WAAe,EACf,WAAW,EACX,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,KAAK,GACR,EAAE,gBAAgB,+BAgJlB"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { BuildError, Engine, NodeBox, Node3DFrame, NodeOverride, NodeState, NodeTextLayout, ProjectDocument, SceneDocument, Session, Size2D, TrackSpan, TreeState, Vector2, Vector3 } from '@motionscript/core';
|
|
2
|
+
import { PlayheadStore } from './playhead';
|
|
3
|
+
/**
|
|
4
|
+
* How far background discovery has got. Only the tracks on frame 0 are
|
|
5
|
+
* discovered before the player mounts; the rest stream in behind it (see
|
|
6
|
+
* `AssetTimeline.runAsync`). The timeline's length never waits on it — every track
|
|
7
|
+
* declares its own.
|
|
8
|
+
*/
|
|
9
|
+
export interface PrecompProgress {
|
|
10
|
+
/** Tracks discovered so far. */
|
|
11
|
+
discoveredTracks: number;
|
|
12
|
+
/** Tracks in the project. */
|
|
13
|
+
totalTracks: number;
|
|
14
|
+
/** True once every track has been discovered. */
|
|
15
|
+
complete: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface MotionPlayerOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The engine this player opens its session on.
|
|
20
|
+
*
|
|
21
|
+
* Nullable on purpose: building one is asynchronous
|
|
22
|
+
* (`await createBrowserEngine(...)`), so a host holds it in state and it is
|
|
23
|
+
* `null` for the first render or two. The player no-ops until it arrives,
|
|
24
|
+
* which is what keeps the hook out of a conditional.
|
|
25
|
+
*
|
|
26
|
+
* **Create it once, and share it.** It holds CanvasKit and the exporter, so
|
|
27
|
+
* a fresh one per render rebuilds the WebGL surface behind every player on
|
|
28
|
+
* it. Identity-compared: a different engine is a different CanvasKit, and so
|
|
29
|
+
* a full rebuild.
|
|
30
|
+
*/
|
|
31
|
+
engine: Engine | null | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* What to play. Nothing opens until there is one.
|
|
34
|
+
*
|
|
35
|
+
* A **project** document is the whole answer: it carries its own viewport,
|
|
36
|
+
* fps, theme and tracks. A **scene** document (still or composition) is one
|
|
37
|
+
* clip and carries none of that, so `viewport` and `fps` must come from here
|
|
38
|
+
* or from the engine.
|
|
39
|
+
*
|
|
40
|
+
* Content-diffed, with identity as the fast path: a new document is reconciled
|
|
41
|
+
* onto the running session, each track's built tree patched in place and
|
|
42
|
+
* rebuilt only when its change cannot be patched. Treat documents as
|
|
43
|
+
* immutable — an edit made in place to one the player already holds is not
|
|
44
|
+
* seen.
|
|
45
|
+
*
|
|
46
|
+
* A new document keeps the player's place: the playhead stays where it was
|
|
47
|
+
* (clamped when the timeline got shorter), and playback carries on if it was
|
|
48
|
+
* running. Seek or pause yourself when a swap means "start over".
|
|
49
|
+
*/
|
|
50
|
+
document?: ProjectDocument | SceneDocument;
|
|
51
|
+
/** Overrides the engine's, for a source that carries none. */
|
|
52
|
+
viewport?: Size2D;
|
|
53
|
+
/** Overrides the engine's, for a source that carries none. */
|
|
54
|
+
fps?: number;
|
|
55
|
+
/** Initial playback rate. Change it later with {@link Player.setSpeed}. */
|
|
56
|
+
speed?: number;
|
|
57
|
+
/** Initial mute state. Change it later with {@link Player.setMuted}. */
|
|
58
|
+
muted?: boolean;
|
|
59
|
+
/** Initial loop state. Change it later with {@link Player.setLoop}. */
|
|
60
|
+
loop?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Called **synchronously**, on the same task as the draw, each time a frame
|
|
63
|
+
* has been painted — whether by the clock, a seek, or a document swap.
|
|
64
|
+
*
|
|
65
|
+
* Not the playhead, which reports where the *clock* is. A seek is
|
|
66
|
+
* asynchronous, so between the two there is a window in which the number has
|
|
67
|
+
* moved and the canvas has not. Reach for this to keep an overlay — a
|
|
68
|
+
* selection box, a caret, a handle — in step with the pixels, and keep the
|
|
69
|
+
* listener cheap: it runs on the render loop, before the browser has had a
|
|
70
|
+
* chance to composite.
|
|
71
|
+
*
|
|
72
|
+
* Read through a ref, so changing it costs nothing.
|
|
73
|
+
*/
|
|
74
|
+
onFramePainted?: (frame: number) => void;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* One document, its transport, and the session driving it. No DOM.
|
|
78
|
+
*
|
|
79
|
+
* Hand it to a {@link MotionStage} to put pixels on screen. Two calls to
|
|
80
|
+
* {@link useMotionPlayer} produce two of these with nothing shared but the
|
|
81
|
+
* engine — separate playheads, clocks, audio devices and transports.
|
|
82
|
+
*/
|
|
83
|
+
export interface Player {
|
|
84
|
+
/** The live session, or `null` before the engine and a document arrive. */
|
|
85
|
+
readonly session: Session | null;
|
|
86
|
+
/** The playhead, read with `usePlayhead(player)`. Stable for the hook's life. */
|
|
87
|
+
readonly playhead: PlayheadStore;
|
|
88
|
+
/** Resolved from the document, else the engine, else 1920×1080. */
|
|
89
|
+
readonly viewport: Size2D;
|
|
90
|
+
/** Resolved from the document, else the engine, else 60. */
|
|
91
|
+
readonly fps: number;
|
|
92
|
+
readonly isPlaying: boolean;
|
|
93
|
+
readonly speed: number;
|
|
94
|
+
readonly muted: boolean;
|
|
95
|
+
readonly loop: boolean;
|
|
96
|
+
/** True while a seek or a document swap is in flight. */
|
|
97
|
+
readonly loading: boolean;
|
|
98
|
+
/** The project's length, known from the document before any track is discovered. */
|
|
99
|
+
readonly duration: number;
|
|
100
|
+
/** {@link duration} in frames, floored at 1. */
|
|
101
|
+
readonly totalFrames: number;
|
|
102
|
+
readonly errors: BuildError[];
|
|
103
|
+
readonly precomp: PrecompProgress;
|
|
104
|
+
play(): void;
|
|
105
|
+
pause(): void;
|
|
106
|
+
toggle(): void;
|
|
107
|
+
/** Seek while paused. Clamped to the timeline. */
|
|
108
|
+
seek(frame: number): void;
|
|
109
|
+
/** Seek relative to where the playhead is now. */
|
|
110
|
+
step(delta: number): void;
|
|
111
|
+
/** Seek without interrupting playback. */
|
|
112
|
+
seekWhilePlaying(frame: number): void;
|
|
113
|
+
setSpeed(speed: number): void;
|
|
114
|
+
setMuted(muted: boolean): void;
|
|
115
|
+
setLoop(loop: boolean): void;
|
|
116
|
+
screenshot(): Promise<string | undefined>;
|
|
117
|
+
/** Re-layout and repaint the current frame — no re-evaluation. */
|
|
118
|
+
repaint(): void;
|
|
119
|
+
getTreeState(): TreeState | null;
|
|
120
|
+
getNodeProps(nodeId: string): NodeState | null;
|
|
121
|
+
/** Where each track sits on the timeline, in document order. */
|
|
122
|
+
getTrackSpans(): readonly TrackSpan[];
|
|
123
|
+
/**
|
|
124
|
+
* Resolves once the paint a document swap scheduled has landed. The swap
|
|
125
|
+
* does not paint before its assets have loaded, so await this before
|
|
126
|
+
* screenshotting or reading the tree.
|
|
127
|
+
*/
|
|
128
|
+
whenReplaced(): Promise<void>;
|
|
129
|
+
getNodeBox(path: string): NodeBox | null;
|
|
130
|
+
getNodePropsAt(path: string): NodeState["properties"] | null;
|
|
131
|
+
getNodeBoxes(): NodeBox[];
|
|
132
|
+
projectNode3D(path: string, parentPoints: readonly Vector3[], localPoints: readonly Vector3[]): Node3DFrame | null;
|
|
133
|
+
/**
|
|
134
|
+
* Where `point` lands on the plane the node at `path` is positioned in, in
|
|
135
|
+
* that plane's own y-up frame. Two answers differ by the `x`/`y` change that
|
|
136
|
+
* moves the node between them — which a screen delta no longer is once the
|
|
137
|
+
* node sits in a 2.5D space.
|
|
138
|
+
*/
|
|
139
|
+
parentPlanePoint(path: string, point: Vector2): Vector2 | null;
|
|
140
|
+
getTextLayout(path: string): NodeTextLayout | null;
|
|
141
|
+
/** `tolerance` is grab-slop in scene units. */
|
|
142
|
+
pickNode(point: Vector2, tolerance?: number): NodeBox | null;
|
|
143
|
+
/** Layer transient props over a node without rebuilding its track. */
|
|
144
|
+
setNodeOverride(path: string, props: NodeOverride): void;
|
|
145
|
+
clearNodeOverrides(path?: string): void;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Opens a session on `engine` and gives you the transport for it.
|
|
149
|
+
*
|
|
150
|
+
* ```tsx
|
|
151
|
+
* const player = useMotionPlayer({ engine, document: doc, loop: true });
|
|
152
|
+
* <MotionStage player={player} />
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
export declare function useMotionPlayer(options: MotionPlayerOptions): Player;
|
|
156
|
+
//# sourceMappingURL=use-motion-player.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-motion-player.d.ts","sourceRoot":"","sources":["../../src/ui/use-motion-player.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,UAAU,EACV,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,EACZ,SAAS,EACT,cAAc,EAGd,eAAe,EACf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O,GAAG,IAAI,CAAC;IACzC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAC7D,YAAY,IAAI,OAAO,EAAE,CAAC;IAC1B,aAAa,CACT,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,SAAS,OAAO,EAAE,EAChC,WAAW,EAAE,SAAS,OAAO,EAAE,GAChC,WAAW,GAAG,IAAI,CAAC;IACtB;;;;;OAKG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;IAC/D,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC;IACnD,+CAA+C;IAC/C,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC7D,sEAAsE;IACtE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACzD,kBAAkB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CA4RpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motionscript/react",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "React bindings for Motion Script.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/motionscript-dev/motionscript.git",
|
|
9
|
+
"directory": "packages/react"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://motionscript.dev",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/motionscript-dev/motionscript/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"CHANGELOG.md",
|
|
23
|
+
"!dist/**/*.tsbuildinfo"
|
|
24
|
+
],
|
|
25
|
+
"module": "./dist/motionscript-react.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/motionscript-react.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "^19.2.3",
|
|
35
|
+
"react-dom": "^19.2.3",
|
|
36
|
+
"@motionscript/core": "^0.1.0-alpha.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@eslint/js": "^9.39.1",
|
|
40
|
+
"@types/node": "^25.6.2",
|
|
41
|
+
"@types/react": "^19.2.3",
|
|
42
|
+
"@types/react-dom": "^19.2.3",
|
|
43
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
44
|
+
"eslint": "^9.39.4",
|
|
45
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
46
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
47
|
+
"react": "^19.2.3",
|
|
48
|
+
"globals": "^16.5.0",
|
|
49
|
+
"react-dom": "^19.2.3",
|
|
50
|
+
"typescript": "^6.0.3",
|
|
51
|
+
"typescript-eslint": "^8.48.0",
|
|
52
|
+
"vite": "^8.0.11",
|
|
53
|
+
"vite-plugin-dts": "5.0.0",
|
|
54
|
+
"@motionscript/core": "0.1.0-alpha.0",
|
|
55
|
+
"@motionscript/browser": "0.1.0-alpha.0",
|
|
56
|
+
"@motionscript/canvaskit": "0.1.0-alpha.0"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"dev": "vite",
|
|
60
|
+
"build": "eslint . && tsc -p tsconfig.build.json && vite build && node ../../scripts/build-browser.mjs",
|
|
61
|
+
"lint": "eslint .",
|
|
62
|
+
"typecheck": "tsc -b --noEmit",
|
|
63
|
+
"clean": "rimraf --glob dist .turbo *.tsbuildinfo",
|
|
64
|
+
"preview": "vite preview"
|
|
65
|
+
}
|
|
6
66
|
}
|