@motionscript/react 0.0.0-stage → 0.1.0-alpha.10

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.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The playhead, held outside React.
3
+ *
4
+ * A frame number written at clock rate through `useState` re-renders whoever
5
+ * owns the player, and on a high-refresh display that is faster than the
6
+ * project's own frame rate. Nothing in a render depends on it: the controller
7
+ * paints straight onto the canvas and React is not involved. So the number
8
+ * lives here, and only the components that actually display it subscribe.
9
+ */
10
+ export interface PlayheadStore {
11
+ subscribe(onChange: () => void): () => void;
12
+ getSnapshot(): number;
13
+ /** @internal — written by the player that owns this store. */
14
+ set(frame: number): void;
15
+ }
16
+ export declare function createPlayheadStore(): PlayheadStore;
17
+ /**
18
+ * Subscribe *this* component to the playhead.
19
+ *
20
+ * Typed structurally rather than against `Player` so the store and the hook
21
+ * that reads it don't import each other.
22
+ */
23
+ export declare function usePlayhead(player: {
24
+ playhead: PlayheadStore;
25
+ }): number;
26
+ //# sourceMappingURL=playhead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playhead.d.ts","sourceRoot":"","sources":["../../src/ui/playhead.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC1B,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,WAAW,IAAI,MAAM,CAAC;IACtB,8DAA8D;IAC9D,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,mBAAmB,IAAI,aAAa,CAiBnD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,aAAa,CAAA;CAAE,GAAG,MAAM,CAGvE"}
@@ -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 GPU 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,EAAqB,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAsBrE,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,+BAqJlB"}
@@ -0,0 +1,39 @@
1
+ import { DependencyList } from 'react';
2
+ import { Engine } from '@motionscript/core';
3
+ export interface UseEngineOptions {
4
+ /**
5
+ * Rebuild the engine when any of these change, compared the way
6
+ * `useEffect` compares its own. The default, `[]`, builds it once.
7
+ *
8
+ * Not for the factory's closure: the latest `create` is always the one
9
+ * called, so an inline arrow does not rebuild anything. List only what
10
+ * makes a *different* engine, such as the node types or the wasm URL.
11
+ */
12
+ deps?: DependencyList;
13
+ /** Called when `create` rejects or throws. Defaults to `console.error`. */
14
+ onError?: (error: unknown) => void;
15
+ }
16
+ /**
17
+ * Builds an engine once, hands it to you when it is ready, and disposes it
18
+ * when it is no longer wanted.
19
+ *
20
+ * ```tsx
21
+ * const engine = useEngine(() => createBrowserEngine());
22
+ * const player = useMotionPlayer({ engine, document: doc });
23
+ * ```
24
+ *
25
+ * `null` until it arrives, which {@link useMotionPlayer} accepts. Nothing in
26
+ * this package imports a platform, so what to build is the factory's job: the
27
+ * browser's `createBrowserEngine`, a headless one, or a test double.
28
+ *
29
+ * Disposal covers the cases a hand-written effect gets wrong: an unmount while
30
+ * the wasm was still loading (StrictMode does this on every mount in
31
+ * development) frees the engine the moment it lands, and a change in `deps`
32
+ * disposes the old one and returns `null` until the new one is ready.
33
+ *
34
+ * Call it once and hand the engine down. A second call is a second wasm module
35
+ * and a second GL stack. Anything that must be true before a player sees the
36
+ * engine, such as `setManifest`, belongs in `create`, not in an effect beside it.
37
+ */
38
+ export declare function useEngine<E extends Engine = Engine>(create: () => E | Promise<E>, options?: UseEngineOptions): E | null;
39
+ //# sourceMappingURL=use-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-engine.d.ts","sourceRoot":"","sources":["../../src/ui/use-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC7B;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAC/C,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC5B,OAAO,GAAE,gBAAqB,GAC/B,CAAC,GAAG,IAAI,CAsCV"}
@@ -0,0 +1,178 @@
1
+ import { BuildError, Engine, NodeBox, NodeHandle, Node3DFrame, NodeOverride, NodeState, NodeTextLayout, ProjectDocument, ReparentPlacement, VisualDocument, 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
+ /** @internal Whether `session` was disposed by a player. Not exported from the package. */
18
+ export declare function isSessionDisposed(session: Session): boolean;
19
+ export interface MotionPlayerOptions {
20
+ /**
21
+ * The engine this player opens its session on.
22
+ *
23
+ * Nullable on purpose: building one is asynchronous
24
+ * (`await createBrowserEngine(...)`), so a host gets it from {@link useEngine}
25
+ * and it is `null` for the first render or two. The player no-ops until it
26
+ * arrives, which is what keeps the hook out of a conditional.
27
+ *
28
+ * **Create it once, and share it.** It holds the renderer and the exporter, so
29
+ * a fresh one per render rebuilds the WebGL surface behind every player on
30
+ * it. Identity-compared: a different engine is a different renderer, and so
31
+ * a full rebuild.
32
+ */
33
+ engine: Engine | null | undefined;
34
+ /**
35
+ * What to play. Nothing opens until there is one.
36
+ *
37
+ * A **project** document is the whole answer: it carries its own viewport,
38
+ * fps, theme and tracks. A **scene** document (still or composition) is one
39
+ * clip and carries none of that, so `viewport` and `fps` must come from here
40
+ * or from the engine.
41
+ *
42
+ * Content-diffed, with identity as the fast path: a new document is reconciled
43
+ * onto the running session, each track's built tree patched in place and
44
+ * rebuilt only when its change cannot be patched. Treat documents as
45
+ * immutable — an edit made in place to one the player already holds is not
46
+ * seen.
47
+ *
48
+ * A new document keeps the player's place: the playhead stays where it was
49
+ * (clamped when the timeline got shorter), and playback carries on if it was
50
+ * running. Seek or pause yourself when a swap means "start over".
51
+ */
52
+ document?: ProjectDocument | VisualDocument;
53
+ /** Overrides the engine's, for a source that carries none. */
54
+ viewport?: Size2D;
55
+ /** Overrides the engine's, for a source that carries none. */
56
+ fps?: number;
57
+ /** Initial playback rate. Change it later with {@link Player.setSpeed}. */
58
+ speed?: number;
59
+ /** Initial mute state. Change it later with {@link Player.setMuted}. */
60
+ muted?: boolean;
61
+ /** Initial loop state. Change it later with {@link Player.setLoop}. */
62
+ loop?: boolean;
63
+ /**
64
+ * Called **synchronously**, on the same task as the draw, each time a frame
65
+ * has been painted — whether by the clock, a seek, or a document swap.
66
+ *
67
+ * Not the playhead, which reports where the *clock* is. A seek is
68
+ * asynchronous, so between the two there is a window in which the number has
69
+ * moved and the canvas has not. Reach for this to keep an overlay — a
70
+ * selection box, a caret, a handle — in step with the pixels, and keep the
71
+ * listener cheap: it runs on the render loop, before the browser has had a
72
+ * chance to composite.
73
+ *
74
+ * Read through a ref, so changing it costs nothing.
75
+ */
76
+ onFramePainted?: (frame: number) => void;
77
+ }
78
+ /**
79
+ * One document, its transport, and the session driving it. No DOM.
80
+ *
81
+ * Hand it to a {@link MotionStage} to put pixels on screen. Two calls to
82
+ * {@link useMotionPlayer} produce two of these with nothing shared but the
83
+ * engine — separate playheads, clocks, audio devices and transports.
84
+ */
85
+ export interface Player {
86
+ /** The live session, or `null` before the engine and a document arrive. */
87
+ readonly session: Session | null;
88
+ /** The playhead, read with `usePlayhead(player)`. Stable for the hook's life. */
89
+ readonly playhead: PlayheadStore;
90
+ /** Resolved from the document, else the engine, else 1920×1080. */
91
+ readonly viewport: Size2D;
92
+ /** Resolved from the document, else the engine, else 60. */
93
+ readonly fps: number;
94
+ readonly isPlaying: boolean;
95
+ readonly speed: number;
96
+ readonly muted: boolean;
97
+ readonly loop: boolean;
98
+ /** True while a seek or a document swap is in flight. */
99
+ readonly loading: boolean;
100
+ /** The project's length, known from the document before any track is discovered. */
101
+ readonly duration: number;
102
+ /** {@link duration} in frames, floored at 1. */
103
+ readonly totalFrames: number;
104
+ readonly errors: BuildError[];
105
+ readonly precomp: PrecompProgress;
106
+ play(): void;
107
+ pause(): void;
108
+ toggle(): void;
109
+ /** Seek while paused. Clamped to the timeline. */
110
+ seek(frame: number): void;
111
+ /** Seek relative to where the playhead is now. */
112
+ step(delta: number): void;
113
+ /** Seek without interrupting playback. */
114
+ seekWhilePlaying(frame: number): void;
115
+ setSpeed(speed: number): void;
116
+ setMuted(muted: boolean): void;
117
+ setLoop(loop: boolean): void;
118
+ screenshot(): Promise<string | undefined>;
119
+ /** Re-layout and repaint the current frame — no re-evaluation. */
120
+ repaint(): void;
121
+ getTreeState(): TreeState | null;
122
+ getNodeProps(nodeId: string): NodeState | null;
123
+ /** The node's props before any command has acted on it: the same at every frame, and answered while it is off screen. */
124
+ getNodeInitialProps(nodeId: string): NodeState["properties"] | null;
125
+ /** Where each track sits on the timeline, in document order. */
126
+ getTrackSpans(): readonly TrackSpan[];
127
+ /**
128
+ * Resolves once the paint a document swap scheduled has landed. The swap
129
+ * does not paint before its assets have loaded, so await this before
130
+ * screenshotting or reading the tree.
131
+ */
132
+ whenReplaced(): Promise<void>;
133
+ getNodeBox(path: string): NodeBox | null;
134
+ getNodePropsAt(path: string): NodeState["properties"] | null;
135
+ getNodeBoxes(): NodeBox[];
136
+ projectNode3D(path: string, parentPoints: readonly Vector3[], localPoints: readonly Vector3[]): Node3DFrame | null;
137
+ /**
138
+ * Where `point` lands on the plane the node at `path` is positioned in, in
139
+ * that plane's own y-up frame. Two answers differ by the `x`/`y` change that
140
+ * moves the node between them — which a screen delta no longer is once the
141
+ * node sits in a 2.5D space.
142
+ */
143
+ parentPlanePoint(path: string, point: Vector2): Vector2 | null;
144
+ /**
145
+ * Where `point` lands in the coordinates the node at `path` positions its
146
+ * children in (a graph's units), or `null` when those are pixels: the
147
+ * `x`/`y` to give a node dropped or pasted there.
148
+ */
149
+ childPlanePoint(path: string, point: Vector2): Vector2 | null;
150
+ /**
151
+ * What keeps the node at `path` looking as it does once it moves under the
152
+ * node at `parentPath`: `offsets` (`x`/`y` values it takes under its parent
153
+ * now) as the ones that put it at the same place there, and the turn to add
154
+ * and the factor to scale by. `null` when that parent arranges its children
155
+ * itself.
156
+ */
157
+ reparentPlacement(path: string, parentPath: string, offsets: readonly Vector2[]): ReparentPlacement | null;
158
+ /** The points an editor may drag on the node at `path` (an arrow's ends), in viewport space. */
159
+ nodeHandles(path: string): NodeHandle[] | null;
160
+ /** The value of `prop` that puts its handle under `point`, or `null`. */
161
+ handleValue(path: string, prop: string, point: Vector2): Vector2 | null;
162
+ getTextLayout(path: string): NodeTextLayout | null;
163
+ /** `tolerance` is grab-slop in scene units. */
164
+ pickNode(point: Vector2, tolerance?: number): NodeBox | null;
165
+ /** Layer transient props over a node without rebuilding its track. */
166
+ setNodeOverride(path: string, props: NodeOverride): void;
167
+ clearNodeOverrides(path?: string): void;
168
+ }
169
+ /**
170
+ * Opens a session on `engine` and gives you the transport for it.
171
+ *
172
+ * ```tsx
173
+ * const player = useMotionPlayer({ engine, document: doc, loop: true });
174
+ * <MotionStage player={player} />
175
+ * ```
176
+ */
177
+ export declare function useMotionPlayer(options: MotionPlayerOptions): Player;
178
+ //# 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,UAAU,EACV,WAAW,EACX,YAAY,EACZ,SAAS,EACT,cAAc,EAGd,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,EACP,OAAO,EACV,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;GAKG;AACH,MAA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AAgB,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAiVpE"}
package/package.json CHANGED
@@ -1,6 +1,72 @@
1
1
  {
2
2
  "name": "@motionscript/react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-alpha.10",
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
+ "author": "Motionscript",
17
+ "sideEffects": false,
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "files": [
22
+ "NOTICE",
23
+ "dist",
24
+ "CHANGELOG.md",
25
+ "!dist/**/*.tsbuildinfo"
26
+ ],
27
+ "module": "./dist/motionscript-react.js",
28
+ "types": "./dist/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/motionscript-react.js"
33
+ }
34
+ },
35
+ "peerDependencies": {
36
+ "react": "^18.2.0 || ^19.0.0",
37
+ "react-dom": "^18.2.0 || ^19.0.0",
38
+ "@motionscript/core": "^0.1.0-alpha.10"
39
+ },
40
+ "devDependencies": {
41
+ "@eslint/js": "^9.39.1",
42
+ "@types/node": "^25.6.2",
43
+ "@types/react": "^19.2.3",
44
+ "@types/react-dom": "^19.2.3",
45
+ "@vitejs/plugin-react": "^6.0.1",
46
+ "@vitest/browser": "4.1.7",
47
+ "@vitest/browser-playwright": "^4.1.7",
48
+ "eslint": "^9.39.4",
49
+ "eslint-plugin-react-hooks": "^7.0.1",
50
+ "eslint-plugin-react-refresh": "^0.4.24",
51
+ "react": "^19.2.3",
52
+ "globals": "^16.5.0",
53
+ "react-dom": "^19.2.3",
54
+ "typescript": "^6.0.3",
55
+ "playwright": "^1.60.0",
56
+ "typescript-eslint": "^8.48.0",
57
+ "vite": "^8.0.11",
58
+ "vite-plugin-dts": "5.0.0",
59
+ "vitest": "^4.1.5",
60
+ "@motionscript/core": "0.1.0-alpha.10",
61
+ "@motionscript/browser": "0.1.0-alpha.10"
62
+ },
63
+ "scripts": {
64
+ "dev": "vite",
65
+ "build": "eslint . && tsc -p tsconfig.build.json && vite build && node ../../scripts/build-browser.mjs",
66
+ "lint": "eslint .",
67
+ "typecheck": "tsc -b --noEmit",
68
+ "clean": "rimraf --glob dist .turbo *.tsbuildinfo",
69
+ "preview": "vite preview",
70
+ "test": "vitest run"
71
+ }
6
72
  }