@particle-academy/fancy-3d 0.1.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 +84 -0
- package/dist/babylon.cjs +773 -0
- package/dist/babylon.cjs.map +1 -0
- package/dist/babylon.d.cts +229 -0
- package/dist/babylon.d.ts +229 -0
- package/dist/babylon.js +754 -0
- package/dist/babylon.js.map +1 -0
- package/dist/dom.cjs +225 -0
- package/dist/dom.cjs.map +1 -0
- package/dist/dom.d.cts +16 -0
- package/dist/dom.d.ts +16 -0
- package/dist/dom.js +223 -0
- package/dist/dom.js.map +1 -0
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +188 -0
- package/dist/index.d.ts +188 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/react.cjs +311 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +60 -0
- package/dist/react.d.ts +60 -0
- package/dist/react.js +307 -0
- package/dist/react.js.map +1 -0
- package/docs/babylon-adapter.md +127 -0
- package/docs/dom-adapter.md +97 -0
- package/docs/primitives.md +168 -0
- package/docs/scene.md +122 -0
- package/docs/screen.md +97 -0
- package/package.json +104 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Primitives
|
|
2
|
+
|
|
3
|
+
3D shape factories that take a `SurfaceContent` (color, paint callback, or any fancy-3d `WidgetSpec`) and return a Babylon `Mesh`. Same painters power both Canvas Studio in DOM mode and 3D billboards — drop a fancy widget onto any 3D shape with one call.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import {
|
|
9
|
+
createPanel,
|
|
10
|
+
createBillboard,
|
|
11
|
+
createBuilding,
|
|
12
|
+
createPillar,
|
|
13
|
+
createCylinder,
|
|
14
|
+
createCurvedPanel,
|
|
15
|
+
createWidgetTexture,
|
|
16
|
+
type SurfaceContent,
|
|
17
|
+
type PaintFn,
|
|
18
|
+
type BoxFace,
|
|
19
|
+
} from "@particle-academy/fancy-3d/babylon";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Peer dependency:** `@babylonjs/core` (optional).
|
|
23
|
+
|
|
24
|
+
## SurfaceContent
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
type SurfaceContent =
|
|
28
|
+
| { type: "color"; color: string }
|
|
29
|
+
| { type: "paint"; paint: PaintFn; pixelWidth?: number; pixelHeight?: number; transparent?: boolean }
|
|
30
|
+
| { type: "widget"; widget: WidgetSpec; pixelWidth?: number; pixelHeight?: number; selected?: boolean };
|
|
31
|
+
|
|
32
|
+
type PaintFn = (ctx: CanvasRenderingContext2D, width: number, height: number) => void;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
| Type | Use |
|
|
36
|
+
|------|-----|
|
|
37
|
+
| `color` | Solid CSS-color material — fastest, no texture |
|
|
38
|
+
| `paint` | Freeform 2D drawing onto a `DynamicTexture`. Set `transparent: true` if you want non-painted regions to show through |
|
|
39
|
+
| `widget` | Render any fancy-3d `WidgetSpec` with the same painters used in 3D scenes |
|
|
40
|
+
|
|
41
|
+
For `paint` and `widget`, `pixelWidth`/`pixelHeight` are optional — every primitive auto-derives the texture size from its world dimensions (default density: 120 px per world unit, clamped to 1024 max axis). Override only when you need finer control.
|
|
42
|
+
|
|
43
|
+
## createPanel
|
|
44
|
+
|
|
45
|
+
A flat single-faced plane.
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
const panel = createPanel({
|
|
49
|
+
scene,
|
|
50
|
+
width: 2, // world units
|
|
51
|
+
height: 1.2,
|
|
52
|
+
surface: { type: "widget", widget: kpiWidget },
|
|
53
|
+
});
|
|
54
|
+
panel.position.set(0, 1, 0);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
| Option | Type | Description |
|
|
58
|
+
|--------|------|-------------|
|
|
59
|
+
| scene | `Scene` | Babylon scene to add the mesh to |
|
|
60
|
+
| name | `string` | Optional mesh name (default `"panel"`) |
|
|
61
|
+
| width / height | `number` | World-unit dimensions |
|
|
62
|
+
| surface | `SurfaceContent` | What to render on the panel |
|
|
63
|
+
|
|
64
|
+
## createBillboard
|
|
65
|
+
|
|
66
|
+
Same as `createPanel` plus the option to always face the camera.
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
const ad = createBillboard({
|
|
70
|
+
scene,
|
|
71
|
+
width: 6, height: 4,
|
|
72
|
+
surface: { type: "widget", widget: demoTile },
|
|
73
|
+
faceCamera: true, // mesh.billboardMode = ALL
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
| Option | Type | Description |
|
|
78
|
+
|--------|------|-------------|
|
|
79
|
+
| ...PanelOpts | | All `createPanel` options |
|
|
80
|
+
| faceCamera | `boolean` | When true, the mesh's billboardMode is set so it always faces the camera |
|
|
81
|
+
|
|
82
|
+
## createBuilding
|
|
83
|
+
|
|
84
|
+
A box. Pass either `surface` (one texture wrapped on every face) or `faces` (per-face surfaces, composited into a UV atlas).
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
// Cheap path — one texture all around
|
|
88
|
+
const tower = createBuilding({
|
|
89
|
+
scene,
|
|
90
|
+
width: 4, height: 8, depth: 4,
|
|
91
|
+
surface: { type: "color", color: "#1e293b" },
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// Per-face path — windows on every wall, AC unit on the roof
|
|
95
|
+
const office = createBuilding({
|
|
96
|
+
scene,
|
|
97
|
+
width: 5, height: 6, depth: 3,
|
|
98
|
+
faces: {
|
|
99
|
+
front: { type: "paint", paint: paintWindowGrid },
|
|
100
|
+
back: { type: "paint", paint: paintWindowGrid },
|
|
101
|
+
left: { type: "paint", paint: paintWindowGrid },
|
|
102
|
+
right: { type: "paint", paint: paintWindowGrid },
|
|
103
|
+
top: { type: "paint", paint: paintRoof },
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
| Option | Type | Description |
|
|
109
|
+
|--------|------|-------------|
|
|
110
|
+
| scene | `Scene` | Babylon scene |
|
|
111
|
+
| width / height / depth | `number` | World-unit dimensions |
|
|
112
|
+
| surface | `SurfaceContent?` | Fallback surface used by any face not in `faces` |
|
|
113
|
+
| faces | `Partial<Record<BoxFace, SurfaceContent>>` | Per-face overrides. Faces are `'front' \| 'back' \| 'right' \| 'left' \| 'top' \| 'bottom'` |
|
|
114
|
+
|
|
115
|
+
When `faces` is set, all six faces share one composite texture sized 768×512 px (3×2 atlas of 256×256 face cells).
|
|
116
|
+
|
|
117
|
+
## createPillar
|
|
118
|
+
|
|
119
|
+
Convenience for a tall narrow `createBuilding`.
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
const post = createPillar({ scene, thickness: 0.2, height: 6, surface: { type: "color", color: "#0b0f17" } });
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## createCylinder
|
|
126
|
+
|
|
127
|
+
A capped cylinder.
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
const drum = createCylinder({
|
|
131
|
+
scene,
|
|
132
|
+
radius: 1.2, height: 2.4,
|
|
133
|
+
surface: { type: "paint", paint: paintBranding },
|
|
134
|
+
tessellation: 64, // optional, default 48
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## createCurvedPanel
|
|
139
|
+
|
|
140
|
+
A partial cylinder section — a curved wraparound panel.
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
const wrap = createCurvedPanel({
|
|
144
|
+
scene,
|
|
145
|
+
width: 4, // arc length
|
|
146
|
+
height: 2,
|
|
147
|
+
arc: Math.PI / 2, // 90° wrap
|
|
148
|
+
surface: { type: "widget", widget: chartWidget },
|
|
149
|
+
});
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## createWidgetTexture
|
|
153
|
+
|
|
154
|
+
Lower-level helper — paint any `WidgetSpec` onto a fresh `DynamicTexture` for use on a custom mesh.
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
const tex = createWidgetTexture(scene, "settings-tex", formWidget, 360, 240, false);
|
|
158
|
+
const myMesh = MeshBuilder.CreatePlane("custom", { width: 2, height: 1.5 }, scene);
|
|
159
|
+
const mat = new StandardMaterial("custom-mat", scene);
|
|
160
|
+
mat.diffuseTexture = tex;
|
|
161
|
+
mat.emissiveTexture = tex;
|
|
162
|
+
mat.emissiveColor = new Color3(1, 1, 1);
|
|
163
|
+
myMesh.material = mat;
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Auto-sizing
|
|
167
|
+
|
|
168
|
+
Every primitive auto-derives texture pixel size from its world dimensions. A 6m × 3.9m billboard becomes a 720 × 468 px texture; the painters scale every coordinate against that canvas so layouts look right at any pixel size. If you want a specific resolution, pass `pixelWidth`/`pixelHeight` on the surface.
|
package/docs/scene.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Scene types
|
|
2
|
+
|
|
3
|
+
Engine-agnostic data structures that every adapter consumes. A scene is plain JSON-serializable data; consumers describe what to render, adapters decide how.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import type {
|
|
9
|
+
Scene,
|
|
10
|
+
SceneNode,
|
|
11
|
+
SceneEdge,
|
|
12
|
+
WidgetSpec,
|
|
13
|
+
WidgetAdapter,
|
|
14
|
+
AdapterContext,
|
|
15
|
+
} from "@particle-academy/fancy-3d";
|
|
16
|
+
|
|
17
|
+
import { renderScene, nextId } from "@particle-academy/fancy-3d";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Scene
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
interface Scene {
|
|
24
|
+
nodes: SceneNode[];
|
|
25
|
+
edges: SceneEdge[];
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
| Field | Type | Description |
|
|
30
|
+
|------|------|-------------|
|
|
31
|
+
| nodes | `SceneNode[]` | One render output per node (mesh / React element / `Object3D` / etc.) |
|
|
32
|
+
| edges | `SceneEdge[]` | Connectors between nodes — bezier, step, or straight |
|
|
33
|
+
|
|
34
|
+
## SceneNode
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
interface SceneNode {
|
|
38
|
+
id: string;
|
|
39
|
+
position: { x: number; y: number; z?: number };
|
|
40
|
+
size?: { w: number; h: number };
|
|
41
|
+
widget: WidgetSpec;
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
| Field | Type | Description |
|
|
46
|
+
|------|------|-------------|
|
|
47
|
+
| id | `string` | Unique node identifier |
|
|
48
|
+
| position | `{ x, y, z? }` | 2D position in pixel space (or 3D if z given) |
|
|
49
|
+
| size | `{ w, h }` | Display size — adapters may use this for texture sizing or layout |
|
|
50
|
+
| widget | `WidgetSpec` | Discriminated union describing the content |
|
|
51
|
+
|
|
52
|
+
## SceneEdge
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
interface SceneEdge {
|
|
56
|
+
id: string;
|
|
57
|
+
from: string; // source node id
|
|
58
|
+
to: string; // target node id
|
|
59
|
+
label?: string;
|
|
60
|
+
curve?: "bezier" | "step" | "straight";
|
|
61
|
+
animated?: boolean;
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## WidgetSpec
|
|
66
|
+
|
|
67
|
+
A discriminated union — each kind maps to one painter / renderer in every adapter.
|
|
68
|
+
|
|
69
|
+
| Kind | Use |
|
|
70
|
+
|------|-----|
|
|
71
|
+
| `kpi` | Big-number stat with optional delta and trend |
|
|
72
|
+
| `chart` | Line / bar / area sparkline |
|
|
73
|
+
| `kanban` | Multi-column board with cards |
|
|
74
|
+
| `table` | Header + rows |
|
|
75
|
+
| `profile` | Avatar + name + role |
|
|
76
|
+
| `callout` | Tone-coded notice (info / success / warning / danger) |
|
|
77
|
+
| `form` | Title + labelled fields (text / number / switch) |
|
|
78
|
+
| `action` | Title + button row (primary / secondary / ghost) |
|
|
79
|
+
| `timeline` | Title + chronological events |
|
|
80
|
+
| `code` | Code snippet with language tag |
|
|
81
|
+
| `image` | Image with optional caption |
|
|
82
|
+
| `text` | Free-form heading + body |
|
|
83
|
+
| `demoPage` | Marketing-style tile with accent header, title, description, CTA |
|
|
84
|
+
| `screen` | 3D-native screen with bezel, power LED, optional `paint(ctx)` callback — see [Screen widget](./screen.md) |
|
|
85
|
+
|
|
86
|
+
Each kind has a TypeScript spec interface (`KpiSpec`, `ChartSpec`, etc.) re-exported from the package root.
|
|
87
|
+
|
|
88
|
+
## WidgetAdapter
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
interface WidgetAdapter<T> {
|
|
92
|
+
render(spec: WidgetSpec, ctx: AdapterContext): T;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface AdapterContext {
|
|
96
|
+
nodeId: string;
|
|
97
|
+
selected: boolean;
|
|
98
|
+
onSelect?: (id: string) => void;
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
A `WidgetAdapter<T>` renders one `WidgetSpec` to `T` — a `ReactNode` for the DOM adapter, a Babylon `Mesh` for the Babylon adapter, an `Object3D` for a hypothetical three.js adapter, etc. Drop in a new adapter and the scene description does not change.
|
|
103
|
+
|
|
104
|
+
## renderScene
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
function renderScene<T>(
|
|
108
|
+
scene: Scene,
|
|
109
|
+
adapter: WidgetAdapter<T>,
|
|
110
|
+
ctxFor: (node: SceneNode) => AdapterContext
|
|
111
|
+
): { node: SceneNode; rendered: T }[];
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Walks `scene.nodes` and calls the adapter on each one. Engine-agnostic — every adapter can reuse it. The host is responsible for placing the returned render results inside its scene graph.
|
|
115
|
+
|
|
116
|
+
## nextId
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
function nextId(prefix: string): string;
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Convenience monotonic id generator — useful when you spawn nodes at runtime and need a fresh `SceneNode.id`.
|
package/docs/screen.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Screen widget
|
|
2
|
+
|
|
3
|
+
A 3D-native widget shaped like a hardware display: bezel frame, power LED, brightness, and an inner surface that hosts label text, an image, or arbitrary 2D content via a `paint(ctx)` callback. Use it whenever you want a "monitor" or "device screen" inside a 3D scene.
|
|
4
|
+
|
|
5
|
+
## Why it lives in fancy-3d
|
|
6
|
+
|
|
7
|
+
`Screen` only makes sense in spatial UIs — it has no meaning in a flat 2D dashboard. That's why it's a fancy-3d widget kind, not a `react-fancy` component. Both the DOM adapter and the Babylon adapter render it; the DOM adapter shows it as a styled card with an inner canvas, the Babylon adapter paints it onto a `DynamicTexture`.
|
|
8
|
+
|
|
9
|
+
## ScreenSpec
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
interface ScreenSpec {
|
|
13
|
+
kind: "screen";
|
|
14
|
+
content:
|
|
15
|
+
| { type: "label"; title: string; subtitle?: string }
|
|
16
|
+
| { type: "image"; src: string; alt?: string }
|
|
17
|
+
| { type: "paint"; paint: (ctx: CanvasRenderingContext2D, w: number, h: number) => void };
|
|
18
|
+
bezel?: string; // CSS hex; default "#0b0f17"
|
|
19
|
+
bezelThickness?: number; // px; default 14
|
|
20
|
+
on?: boolean; // default true
|
|
21
|
+
background?: string; // CSS hex; default "#020617"
|
|
22
|
+
brightness?: number; // 0..1; default 1 when on, 0.06 when off
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Field | Description |
|
|
27
|
+
|------|-------------|
|
|
28
|
+
| content.label | Big centered title with optional subtitle — easiest case |
|
|
29
|
+
| content.image | Image source + alt text (Babylon currently shows alt text as a placeholder; supply a `paint` if you need real image rendering on a mesh) |
|
|
30
|
+
| content.paint | Freeform 2D — draw charts, animation frames, text, anything |
|
|
31
|
+
| bezel | Frame color around the screen |
|
|
32
|
+
| bezelThickness | How thick the frame is in canvas pixels |
|
|
33
|
+
| on | Toggles the power LED color and the brightness ramp |
|
|
34
|
+
| background | Inner screen background when `paint` doesn't fill the canvas |
|
|
35
|
+
| brightness | Multiplied via `globalAlpha` on the inner content — useful for "screen powered down" looks |
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
### As a Scene widget (DOM or Babylon)
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const display: SceneNode = {
|
|
43
|
+
id: "monitor",
|
|
44
|
+
position: { x: 0, y: 0 },
|
|
45
|
+
size: { w: 320, h: 200 },
|
|
46
|
+
widget: {
|
|
47
|
+
kind: "screen",
|
|
48
|
+
content: { type: "label", title: "OK", subtitle: "All systems healthy" },
|
|
49
|
+
bezel: "#1f2937",
|
|
50
|
+
on: true,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The DOM adapter renders this as a `<div>` with bezel styling around an inner canvas. The Babylon adapter paints it onto a plane mesh with the bezel + power LED + glass-reflection sheen as part of the texture.
|
|
56
|
+
|
|
57
|
+
### Live drawing with `paint`
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
const liveScreen: ScreenSpec = {
|
|
61
|
+
kind: "screen",
|
|
62
|
+
content: {
|
|
63
|
+
type: "paint",
|
|
64
|
+
paint: (ctx, w, h) => {
|
|
65
|
+
ctx.fillStyle = "#0ea5e9";
|
|
66
|
+
ctx.font = `bold ${h * 0.2}px ui-monospace, monospace`;
|
|
67
|
+
ctx.textAlign = "center";
|
|
68
|
+
ctx.fillText(new Date().toLocaleTimeString(), w / 2, h / 2);
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The DOM adapter calls `paint` once on mount and again whenever the `content` reference changes. To animate, wrap the spec in `useMemo` keyed on a tick or change the spec reference each frame.
|
|
75
|
+
|
|
76
|
+
### Mounted on a primitive
|
|
77
|
+
|
|
78
|
+
`Screen` is a widget kind, so it works as the `surface` of any primitive:
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { createBillboard } from "@particle-academy/fancy-3d/babylon";
|
|
82
|
+
|
|
83
|
+
const tv = createBillboard({
|
|
84
|
+
scene,
|
|
85
|
+
width: 4, height: 2.5,
|
|
86
|
+
surface: { type: "widget", widget: liveScreen },
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Power LED
|
|
91
|
+
|
|
92
|
+
A small dot in the bottom-right corner of the bezel:
|
|
93
|
+
|
|
94
|
+
- `on: true` → emerald LED, full brightness
|
|
95
|
+
- `on: false` → slate LED, dimmed inner content (`brightness ≈ 0.06`)
|
|
96
|
+
|
|
97
|
+
Override `brightness` directly to fade between states for "powering on" animations.
|
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@particle-academy/fancy-3d",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Bring Particle Academy's fancy components into 3D — engine-agnostic scene types, a BabylonJS adapter, and 3D-native components like Screen.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Particle-Academy/fancy-3d.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/Particle-Academy/fancy-3d#readme",
|
|
10
|
+
"bugs": "https://github.com/Particle-Academy/fancy-3d/issues",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"require": {
|
|
22
|
+
"types": "./dist/index.d.cts",
|
|
23
|
+
"default": "./dist/index.cjs"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"./babylon": {
|
|
27
|
+
"import": {
|
|
28
|
+
"types": "./dist/babylon.d.ts",
|
|
29
|
+
"default": "./dist/babylon.js"
|
|
30
|
+
},
|
|
31
|
+
"require": {
|
|
32
|
+
"types": "./dist/babylon.d.cts",
|
|
33
|
+
"default": "./dist/babylon.cjs"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"./dom": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./dist/dom.d.ts",
|
|
39
|
+
"default": "./dist/dom.js"
|
|
40
|
+
},
|
|
41
|
+
"require": {
|
|
42
|
+
"types": "./dist/dom.d.cts",
|
|
43
|
+
"default": "./dist/dom.cjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"./react": {
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./dist/react.d.ts",
|
|
49
|
+
"default": "./dist/react.js"
|
|
50
|
+
},
|
|
51
|
+
"require": {
|
|
52
|
+
"types": "./dist/react.d.cts",
|
|
53
|
+
"default": "./dist/react.cjs"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"dist",
|
|
59
|
+
"docs",
|
|
60
|
+
"README.md"
|
|
61
|
+
],
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsup",
|
|
64
|
+
"dev": "tsup --watch",
|
|
65
|
+
"lint": "tsc --noEmit",
|
|
66
|
+
"clean": "rm -rf dist",
|
|
67
|
+
"prepublishOnly": "tsup"
|
|
68
|
+
},
|
|
69
|
+
"keywords": [
|
|
70
|
+
"react",
|
|
71
|
+
"3d",
|
|
72
|
+
"babylonjs",
|
|
73
|
+
"scene",
|
|
74
|
+
"ui",
|
|
75
|
+
"spatial"
|
|
76
|
+
],
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"@babylonjs/core": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
79
|
+
"@particle-academy/react-fancy": "*",
|
|
80
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
81
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
82
|
+
},
|
|
83
|
+
"peerDependenciesMeta": {
|
|
84
|
+
"@babylonjs/core": {
|
|
85
|
+
"optional": true
|
|
86
|
+
},
|
|
87
|
+
"@particle-academy/react-fancy": {
|
|
88
|
+
"optional": true
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"@babylonjs/core": "^9.0.0",
|
|
93
|
+
"@types/react": "^19.0.0",
|
|
94
|
+
"@types/react-dom": "^19.0.0",
|
|
95
|
+
"react": "^19.0.0",
|
|
96
|
+
"react-dom": "^19.0.0",
|
|
97
|
+
"tsup": "^8.5.0",
|
|
98
|
+
"typescript": "^5.8.0"
|
|
99
|
+
},
|
|
100
|
+
"publishConfig": {
|
|
101
|
+
"access": "public"
|
|
102
|
+
},
|
|
103
|
+
"license": "MIT"
|
|
104
|
+
}
|