@ascii-fx/react-three 0.2.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/LICENSE +21 -0
- package/README.md +24 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +128 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Amir Abushanab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @ascii-fx/react-three
|
|
2
|
+
|
|
3
|
+
React Three Fiber bindings (kept separate from `@ascii-fx/react` so plain React apps never pull Three). Requires an R3F v9 `<Canvas>` running `THREE.WebGPURenderer`.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Canvas } from '@react-three/fiber'
|
|
7
|
+
import * as THREE from 'three/webgpu'
|
|
8
|
+
import { AsciiEffect } from '@ascii-fx/react-three'
|
|
9
|
+
|
|
10
|
+
;<Canvas
|
|
11
|
+
gl={async (props) => {
|
|
12
|
+
const renderer = new THREE.WebGPURenderer(props as never)
|
|
13
|
+
await renderer.init()
|
|
14
|
+
return renderer
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<mesh>{/* your scene */}</mesh>
|
|
18
|
+
<AsciiEffect profile={profileRef} columns={180} interaction="reveal" />
|
|
19
|
+
</Canvas>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`<AsciiEffect>` takes over the render loop while mounted (AsciiPass under the hood), auto-wires the R3F pointer, and resizes with the canvas. `useAsciiEffect(options)` returns the pass for imperative control (`captureFrame`, `set`).
|
|
23
|
+
|
|
24
|
+
`<AsciiGlyphs profile={profile} columns={80} rows={45} frame={frame} />` renders the instanced 3D glyph field from a matched frame.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AsciiFrame, AsciiProfile, ProfileSource } from '@ascii-fx/core';
|
|
2
|
+
import type { FitMode, InteractionOptions, InteractionType, StreamMatchOptions } from '@ascii-fx/gpu';
|
|
3
|
+
import { AsciiPass } from '@ascii-fx/three';
|
|
4
|
+
export interface UseAsciiEffectOptions extends StreamMatchOptions {
|
|
5
|
+
profile: ProfileSource;
|
|
6
|
+
fit?: FitMode;
|
|
7
|
+
clearColor?: readonly [number, number, number, number];
|
|
8
|
+
/** Interaction preset name or full options (spec §2: interaction="reveal"). */
|
|
9
|
+
interaction?: InteractionType | InteractionOptions | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* AsciiPass lifecycle inside an R3F canvas. Requires the Canvas to run a
|
|
13
|
+
* THREE.WebGPURenderer (`gl` factory returning WebGPURenderer in R3F v9).
|
|
14
|
+
* Takes over the render loop while mounted; pointer is wired automatically.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useAsciiEffect(options: UseAsciiEffectOptions): AsciiPass | null;
|
|
17
|
+
export interface AsciiEffectProps extends UseAsciiEffectOptions {
|
|
18
|
+
}
|
|
19
|
+
/** Declarative AsciiPass (spec §2): `<AsciiEffect profile={p} columns={180} interaction="reveal" />` */
|
|
20
|
+
export declare function AsciiEffect(props: AsciiEffectProps): null;
|
|
21
|
+
export interface AsciiGlyphsProps {
|
|
22
|
+
profile: AsciiProfile;
|
|
23
|
+
columns: number;
|
|
24
|
+
rows: number;
|
|
25
|
+
cellSize?: number;
|
|
26
|
+
/** Matched frame to display (from captureFrame() or matchFrame()). */
|
|
27
|
+
frame?: AsciiFrame | null;
|
|
28
|
+
}
|
|
29
|
+
/** Instanced glyph field as an R3F element. */
|
|
30
|
+
export declare function AsciiGlyphs(props: AsciiGlyphsProps): React.JSX.Element;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// src/index.tsx
|
|
4
|
+
import { useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { useFrame, useThree } from "@react-three/fiber";
|
|
6
|
+
import { loadProfile } from "@ascii-fx/core";
|
|
7
|
+
import { AsciiGlyphs as AsciiGlyphsImpl, AsciiPass } from "@ascii-fx/three";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var normalizeInteraction = (interaction) => interaction == null ? null : typeof interaction === "string" ? { type: interaction } : interaction;
|
|
10
|
+
var binaryIds = /* @__PURE__ */ new WeakMap();
|
|
11
|
+
var nextBinaryId = 1;
|
|
12
|
+
var profileSourceKey = (source) => {
|
|
13
|
+
if (typeof source === "string") return `url:${source}`;
|
|
14
|
+
if (source instanceof URL) return `url:${source.href}`;
|
|
15
|
+
if (source instanceof Uint8Array || source instanceof ArrayBuffer) {
|
|
16
|
+
let id = binaryIds.get(source);
|
|
17
|
+
if (id === void 0) {
|
|
18
|
+
id = nextBinaryId++;
|
|
19
|
+
binaryIds.set(source, id);
|
|
20
|
+
}
|
|
21
|
+
return `bytes:${id}`;
|
|
22
|
+
}
|
|
23
|
+
if ("url" in source && !("glyphs" in source)) return `url:${source.url}`;
|
|
24
|
+
return `profile:${source.fingerprint}`;
|
|
25
|
+
};
|
|
26
|
+
function useAsciiEffect(options) {
|
|
27
|
+
const gl = useThree((s) => s.gl);
|
|
28
|
+
const size = useThree((s) => s.size);
|
|
29
|
+
const [pass, setPass] = useState(null);
|
|
30
|
+
const [profile, setProfile] = useState(null);
|
|
31
|
+
const { profile: profileSource, interaction, fit, clearColor, ...match } = options;
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
let live = true;
|
|
34
|
+
loadProfile(profileSource).then((p) => {
|
|
35
|
+
if (live) setProfile(p);
|
|
36
|
+
}).catch((err) => console.error("[ascii-fx] profile load failed:", err));
|
|
37
|
+
return () => {
|
|
38
|
+
live = false;
|
|
39
|
+
};
|
|
40
|
+
}, [profileSourceKey(profileSource)]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!profile) return;
|
|
43
|
+
const renderer = gl;
|
|
44
|
+
if (!renderer.isWebGPURenderer) {
|
|
45
|
+
console.error(
|
|
46
|
+
"[ascii-fx] <AsciiEffect> requires a THREE.WebGPURenderer \u2014 pass `gl` accordingly to <Canvas>. WebGL renderers are unsupported (spec \xA730)."
|
|
47
|
+
);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let live = true;
|
|
51
|
+
const created = new AsciiPass({ profile, renderer, fit, clearColor });
|
|
52
|
+
void created.init().then(() => {
|
|
53
|
+
if (!live) {
|
|
54
|
+
created.dispose();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
setPass(created);
|
|
58
|
+
}).catch((err) => {
|
|
59
|
+
created.dispose();
|
|
60
|
+
if (live) console.error("[ascii-fx] AsciiPass init failed:", err);
|
|
61
|
+
});
|
|
62
|
+
return () => {
|
|
63
|
+
live = false;
|
|
64
|
+
created.dispose();
|
|
65
|
+
setPass(null);
|
|
66
|
+
};
|
|
67
|
+
}, [gl, profile]);
|
|
68
|
+
const matchKey = JSON.stringify([
|
|
69
|
+
match.columns,
|
|
70
|
+
match.rows,
|
|
71
|
+
match.color,
|
|
72
|
+
match.alpha,
|
|
73
|
+
match.foreground,
|
|
74
|
+
match.background,
|
|
75
|
+
match.flatThreshold,
|
|
76
|
+
match.srgbEncode,
|
|
77
|
+
match.temporal,
|
|
78
|
+
match.matcher,
|
|
79
|
+
match.hysteresis,
|
|
80
|
+
fit,
|
|
81
|
+
clearColor
|
|
82
|
+
]);
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
pass?.set({ ...match, fit, clearColor });
|
|
85
|
+
}, [pass, matchKey]);
|
|
86
|
+
const interactionKey = JSON.stringify(interaction ?? null);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
pass?.setInteraction(normalizeInteraction(interaction));
|
|
89
|
+
}, [pass, interactionKey]);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (!pass) return;
|
|
92
|
+
const renderer = gl;
|
|
93
|
+
const dpr = renderer.getPixelRatio();
|
|
94
|
+
pass.setSize(
|
|
95
|
+
Math.max(1, Math.round(size.width * dpr)),
|
|
96
|
+
Math.max(1, Math.round(size.height * dpr))
|
|
97
|
+
);
|
|
98
|
+
}, [pass, size, gl]);
|
|
99
|
+
useFrame((state) => {
|
|
100
|
+
if (!pass) return;
|
|
101
|
+
pass.pointer.set((state.pointer.x + 1) / 2, (1 - state.pointer.y) / 2);
|
|
102
|
+
pass.render(state.scene, state.camera);
|
|
103
|
+
}, 1);
|
|
104
|
+
return pass;
|
|
105
|
+
}
|
|
106
|
+
function AsciiEffect(props) {
|
|
107
|
+
useAsciiEffect(props);
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
function AsciiGlyphs(props) {
|
|
111
|
+
const { profile, columns, rows, cellSize, frame } = props;
|
|
112
|
+
const glyphs = useMemo(
|
|
113
|
+
() => new AsciiGlyphsImpl({ profile, columns, rows, cellSize }),
|
|
114
|
+
[profile, columns, rows, cellSize]
|
|
115
|
+
);
|
|
116
|
+
useEffect(() => () => glyphs.dispose(), [glyphs]);
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (!frame || frame.columns !== columns || frame.rows !== rows) return;
|
|
119
|
+
glyphs.updateFromFrame(frame);
|
|
120
|
+
}, [glyphs, frame, columns, rows]);
|
|
121
|
+
return /* @__PURE__ */ jsx("primitive", { object: glyphs.mesh });
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
AsciiEffect,
|
|
125
|
+
AsciiGlyphs,
|
|
126
|
+
useAsciiEffect
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react'\nimport { useFrame, useThree } from '@react-three/fiber'\nimport type { WebGPURenderer } from 'three/webgpu'\nimport type { AsciiFrame, AsciiProfile, ProfileSource } from '@ascii-fx/core'\nimport { loadProfile } from '@ascii-fx/core'\nimport type {\n FitMode,\n InteractionOptions,\n InteractionType,\n StreamMatchOptions,\n} from '@ascii-fx/gpu'\nimport { AsciiGlyphs as AsciiGlyphsImpl, AsciiPass } from '@ascii-fx/three'\n\nexport interface UseAsciiEffectOptions extends StreamMatchOptions {\n profile: ProfileSource\n fit?: FitMode\n clearColor?: readonly [number, number, number, number]\n /** Interaction preset name or full options (spec §2: interaction=\"reveal\"). */\n interaction?: InteractionType | InteractionOptions | null\n}\n\nconst normalizeInteraction = (\n interaction: InteractionType | InteractionOptions | null | undefined,\n): InteractionOptions | null =>\n interaction == null ? null : typeof interaction === 'string' ? { type: interaction } : interaction\n\nconst binaryIds = new WeakMap<ArrayBuffer | Uint8Array, number>()\nlet nextBinaryId = 1\n\n/**\n * Stable for semantic sources, identity-based for mutable binary inputs\n * (mirrors @ascii-fx/react's hookKeys). Keying the load effect by object\n * identity instead re-decoded — and rebuilt the whole AsciiPass, WGSL\n * recompile included — on every parent re-render for inline sources.\n */\nconst profileSourceKey = (source: ProfileSource): string => {\n if (typeof source === 'string') return `url:${source}`\n if (source instanceof URL) return `url:${source.href}`\n if (source instanceof Uint8Array || source instanceof ArrayBuffer) {\n let id = binaryIds.get(source)\n if (id === undefined) {\n id = nextBinaryId++\n binaryIds.set(source, id)\n }\n return `bytes:${id}`\n }\n if ('url' in source && !('glyphs' in source)) return `url:${(source as { url: string }).url}`\n return `profile:${(source as AsciiProfile).fingerprint}`\n}\n\n/**\n * AsciiPass lifecycle inside an R3F canvas. Requires the Canvas to run a\n * THREE.WebGPURenderer (`gl` factory returning WebGPURenderer in R3F v9).\n * Takes over the render loop while mounted; pointer is wired automatically.\n */\nexport function useAsciiEffect(options: UseAsciiEffectOptions): AsciiPass | null {\n const gl = useThree((s) => s.gl)\n const size = useThree((s) => s.size)\n const [pass, setPass] = useState<AsciiPass | null>(null)\n const [profile, setProfile] = useState<AsciiProfile | null>(null)\n const { profile: profileSource, interaction, fit, clearColor, ...match } = options\n\n useEffect(() => {\n let live = true\n loadProfile(profileSource)\n .then((p) => {\n if (live) setProfile(p)\n })\n .catch((err: unknown) => console.error('[ascii-fx] profile load failed:', err))\n return () => {\n live = false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [profileSourceKey(profileSource)])\n\n useEffect(() => {\n if (!profile) return\n const renderer = gl as unknown as WebGPURenderer & { isWebGPURenderer?: boolean }\n if (!renderer.isWebGPURenderer) {\n console.error(\n '[ascii-fx] <AsciiEffect> requires a THREE.WebGPURenderer — pass `gl` accordingly to <Canvas>. ' +\n 'WebGL renderers are unsupported (spec §30).',\n )\n return\n }\n let live = true\n const created = new AsciiPass({ profile, renderer, fit, clearColor })\n void created\n .init()\n .then(() => {\n if (!live) {\n created.dispose()\n return\n }\n setPass(created)\n })\n .catch((err: unknown) => {\n created.dispose()\n if (live) console.error('[ascii-fx] AsciiPass init failed:', err)\n })\n return () => {\n live = false\n created.dispose()\n setPass(null)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [gl, profile])\n\n const matchKey = JSON.stringify([\n match.columns,\n match.rows,\n match.color,\n match.alpha,\n match.foreground,\n match.background,\n match.flatThreshold,\n match.srgbEncode,\n match.temporal,\n match.matcher,\n match.hysteresis,\n fit,\n clearColor,\n ])\n useEffect(() => {\n pass?.set({ ...match, fit, clearColor })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pass, matchKey])\n\n const interactionKey = JSON.stringify(interaction ?? null)\n useEffect(() => {\n pass?.setInteraction(normalizeInteraction(interaction))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pass, interactionKey])\n\n useEffect(() => {\n if (!pass) return\n const renderer = gl as unknown as WebGPURenderer\n const dpr = renderer.getPixelRatio()\n pass.setSize(\n Math.max(1, Math.round(size.width * dpr)),\n Math.max(1, Math.round(size.height * dpr)),\n )\n }, [pass, size, gl])\n\n useFrame((state) => {\n if (!pass) return\n pass.pointer.set((state.pointer.x + 1) / 2, (1 - state.pointer.y) / 2)\n pass.render(state.scene, state.camera)\n }, 1)\n\n return pass\n}\n\nexport interface AsciiEffectProps extends UseAsciiEffectOptions {}\n\n/** Declarative AsciiPass (spec §2): `<AsciiEffect profile={p} columns={180} interaction=\"reveal\" />` */\nexport function AsciiEffect(props: AsciiEffectProps): null {\n useAsciiEffect(props)\n return null\n}\n\nexport interface AsciiGlyphsProps {\n profile: AsciiProfile\n columns: number\n rows: number\n cellSize?: number\n /** Matched frame to display (from captureFrame() or matchFrame()). */\n frame?: AsciiFrame | null\n}\n\n/** Instanced glyph field as an R3F element. */\nexport function AsciiGlyphs(props: AsciiGlyphsProps): React.JSX.Element {\n const { profile, columns, rows, cellSize, frame } = props\n const glyphs = useMemo(\n () => new AsciiGlyphsImpl({ profile, columns, rows, cellSize }),\n [profile, columns, rows, cellSize],\n )\n useEffect(() => () => glyphs.dispose(), [glyphs])\n useEffect(() => {\n // A grid prop change rebuilds `glyphs` in the same render, while `frame`\n // state may still hold the previous grid's match for a beat — forwarding\n // it would throw from updateFromFrame into the nearest error boundary.\n // Skip mismatched frames; the caller's next capture fits the new grid.\n if (!frame || frame.columns !== columns || frame.rows !== rows) return\n glyphs.updateFromFrame(frame)\n }, [glyphs, frame, columns, rows])\n return <primitive object={glyphs.mesh} />\n}\n"],"mappings":";;;AAAA,SAAS,WAAW,SAAS,gBAAgB;AAC7C,SAAS,UAAU,gBAAgB;AAGnC,SAAS,mBAAmB;AAO5B,SAAS,eAAe,iBAAiB,iBAAiB;AA+KjD;AArKT,IAAM,uBAAuB,CAC3B,gBAEA,eAAe,OAAO,OAAO,OAAO,gBAAgB,WAAW,EAAE,MAAM,YAAY,IAAI;AAEzF,IAAM,YAAY,oBAAI,QAA0C;AAChE,IAAI,eAAe;AAQnB,IAAM,mBAAmB,CAAC,WAAkC;AAC1D,MAAI,OAAO,WAAW,SAAU,QAAO,OAAO,MAAM;AACpD,MAAI,kBAAkB,IAAK,QAAO,OAAO,OAAO,IAAI;AACpD,MAAI,kBAAkB,cAAc,kBAAkB,aAAa;AACjE,QAAI,KAAK,UAAU,IAAI,MAAM;AAC7B,QAAI,OAAO,QAAW;AACpB,WAAK;AACL,gBAAU,IAAI,QAAQ,EAAE;AAAA,IAC1B;AACA,WAAO,SAAS,EAAE;AAAA,EACpB;AACA,MAAI,SAAS,UAAU,EAAE,YAAY,QAAS,QAAO,OAAQ,OAA2B,GAAG;AAC3F,SAAO,WAAY,OAAwB,WAAW;AACxD;AAOO,SAAS,eAAe,SAAkD;AAC/E,QAAM,KAAK,SAAS,CAAC,MAAM,EAAE,EAAE;AAC/B,QAAM,OAAO,SAAS,CAAC,MAAM,EAAE,IAAI;AACnC,QAAM,CAAC,MAAM,OAAO,IAAI,SAA2B,IAAI;AACvD,QAAM,C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C,QAAQ,OAAO,SAAS,IAAI,CAAC;AACjC,SAAO,oBAAC,eAAU,QAAQ,OAAO,MAAM;AACzC;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ascii-fx/react-three",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "React Three Fiber bindings for ASCII FX: <AsciiEffect>, <AsciiGlyphs>, useAsciiEffect (WebGPURenderer only).",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ascii",
|
|
7
|
+
"ascii-art",
|
|
8
|
+
"ascii-fx",
|
|
9
|
+
"postprocessing",
|
|
10
|
+
"react",
|
|
11
|
+
"react-three-fiber",
|
|
12
|
+
"three",
|
|
13
|
+
"threejs",
|
|
14
|
+
"webgpu"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://github.com/Amir-Abushanab/ascii-fx#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/Amir-Abushanab/ascii-fx/issues"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "Amir Abushanab (https://github.com/Amir-Abushanab)",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/Amir-Abushanab/ascii-fx.git",
|
|
25
|
+
"directory": "packages/react-three"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@ascii-fx/three": "0.2.0",
|
|
43
|
+
"@ascii-fx/gpu": "0.2.0",
|
|
44
|
+
"@ascii-fx/core": "0.2.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@react-three/fiber": "^9.7.0",
|
|
48
|
+
"@types/react": "^19.2.18",
|
|
49
|
+
"@types/three": "0.185.4",
|
|
50
|
+
"@webgpu/types": "^0.1.71",
|
|
51
|
+
"react": "^19.2.8",
|
|
52
|
+
"three": "0.185.1",
|
|
53
|
+
"tsup": "^8.5.1",
|
|
54
|
+
"typescript": "^7.0.2"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"@react-three/fiber": "^9.0.0",
|
|
58
|
+
"react": "^19.0.0",
|
|
59
|
+
"three": ">=0.170.0"
|
|
60
|
+
},
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=22"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"build": "tsup && tsc -p tsconfig.build.json",
|
|
66
|
+
"typecheck": "tsc --noEmit"
|
|
67
|
+
}
|
|
68
|
+
}
|