@particle-academy/fancy-3d 0.6.0 → 0.7.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/AGENTS.md CHANGED
@@ -38,6 +38,7 @@ key; MCP id `fancy-ui`). This package's registry slugs (`package` = `fancy-3d`):
38
38
  | `@particle-academy/fancy-3d` | `Scene` types (`Scene`, `WidgetSpec`, `WidgetAdapter`), plus `Canvas` / `useCanvas` |
39
39
  | `@particle-academy/fancy-3d/canvas` | the engine-pluggable `<Canvas>` (`Canvas.Node`, `useCanvas`) |
40
40
  | `@particle-academy/fancy-3d/dom` | `domAdapter`: renders a `Scene` widget as react-fancy components |
41
+ | `@particle-academy/fancy-3d/fullscreen` | `useFullscreen(ref, opts)`, `FullscreenButton`, `FullscreenContext`: full screen for a viewer's root container, used by every fancy-3d viewer and by fancy-graph ([docs/fullscreen.md](./docs/fullscreen.md)). React only |
41
42
  | `@particle-academy/fancy-3d` (shared rendering contract) | `SCENE_PALETTES` / `resolveSceneTheme` (theme), `PX_PER_UNIT` / `sceneToWorld` (unit scale and layout), `fitZoom` / `frameScene` (camera framing), `paintWidget` (the card painter every WebGL adapter uses) |
42
43
 
43
44
  - **`<Canvas>` defaults to `engine="dom"`** (CSS-3D, no WebGL). Pass
package/CHANGELOG.md CHANGED
@@ -15,6 +15,48 @@ upgrading.
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.7.0] - 2026-11-28
19
+
20
+ ### Added
21
+
22
+ - **Full screen for every viewer, in one place: `@particle-academy/fancy-3d/fullscreen`**
23
+ (also on the root entry). `useFullscreen(ref, options)` full-screens the
24
+ viewer's ROOT container, not the bare canvas, so the controls overlay,
25
+ labels, breadcrumbs and anything else rendered inside it come along. It uses
26
+ the Fullscreen API (and Safari's prefixed one), and where that is missing or
27
+ refused (iPhone Safari, an iframe without `allow="fullscreen"`, an agent
28
+ asking without a user gesture) an `"expanded"` mode: a fixed, full-viewport
29
+ box. Esc and the button both exit; the root's resize reaches every renderer
30
+ (a `resize` event is sent too); the canvas keeps keyboard focus across the
31
+ switch; a transparent root takes the page's background while full screen,
32
+ so the browser's black backdrop (or the page) never shows through. Controlled
33
+ with `fullscreen` / `onFullscreenChange(on, { source })`,
34
+ `setFullscreen` as the handle method, `data-fancy-3d-fullscreen` on the root
35
+ and `data-fancy-3d-fullscreen-button` on `<FullscreenButton>`. Also
36
+ `FullscreenContext`, `useFullscreenContext`, `nativeFullscreenSupported`.
37
+ `enabled: false` makes the hook inert, for a viewer nested in another that
38
+ owns full screen. It depends on React alone. fancy-3d-three, fancy-3d-babylon and fancy-graph use
39
+ it. See `docs/fullscreen.md`.
40
+ - **The DOM `<Canvas>` goes full screen**: `fullscreen`, `defaultFullscreen`,
41
+ `onFullscreenChange` and `fullscreenLabels` props, and `<Canvas.Controls>`
42
+ has a full-screen toggle (`showFullscreen`, default true). The minimap and the
43
+ controls stay inside.
44
+
45
+ ### Changed
46
+
47
+ - **`<Canvas.Controls>`'s Fit all button wears a `Scan` icon, not `Maximize`.**
48
+ `Maximize` is the full-screen icon, so the toolbar read as having a
49
+ full-screen button it did not have. **Nothing to do**, unless a test looked
50
+ for `.lucide-maximize`: select it by `aria-label="Fit all"` instead.
51
+ - The build splits shared code into chunks (`splitting: true`), so the root,
52
+ `./canvas` and `./fullscreen` entries share one `FullscreenContext` under
53
+ both ESM and CJS. **Nothing to do.**
54
+ - **`lucide-react` is now a declared dependency (`^0.511.0`, the range
55
+ react-fancy uses) and is no longer bundled.** `<Canvas.Controls>` imported
56
+ its icons without declaring the package, so the build inlined them by
57
+ accident. The dist now imports `lucide-react`, and your package manager
58
+ shares one copy with react-fancy. **Nothing to do.**
59
+
18
60
  ## [0.6.0] - 2026-11-28
19
61
 
20
62
  ### Added
package/README.md CHANGED
@@ -16,6 +16,7 @@
16
16
  ## What's inside
17
17
 
18
18
  - **`<Canvas>`** — engine-pluggable 2D pan/zoom surface. **Defaults to `engine="dom"`** (CSS3D matrix projection, no WebGL dependency). Opt into a WebGL backend by passing an adapter engine — `babylonEngine` from `@particle-academy/fancy-3d-babylon/engine` or `threeEngine` from `@particle-academy/fancy-3d-three/engine` — or any object implementing `CanvasEngine` (native canvas / WebXR / your own). The 2D node graph and the 3D scene root live alongside each other; this is the foundation for hybrid 2D-in-3D and MR scenes.
19
+ - **Full screen for every viewer** (`@particle-academy/fancy-3d/fullscreen`) — `useFullscreen` + `FullscreenButton`: the viewer's root container goes full screen with its overlays, through the Fullscreen API or, where that is missing (iPhone Safari), a fixed full-viewport mode. The DOM `<Canvas>`, both adapters' `<Stage>` / `<SceneView>` and fancy-graph's views use it. See [`docs/fullscreen.md`](./docs/fullscreen.md).
19
20
  - **Shape primitives, layout helpers, JSON-friendly Scene types** — terse, agent-authorable scene descriptions; engine-agnostic.
20
21
  - **`<Stage>` / `<Monitor>`** — the React 3D scene components ship from the **adapter packages** (`@particle-academy/fancy-3d-babylon/react`, `@particle-academy/fancy-3d-three/react`), *not* from fancy-3d core, since they need a concrete WebGL engine. Extruded cards are a mesh primitive there (`createCard3D` from the adapter's root entry), not a React component. (`<Monitor>` was `<Screen>` before v0.3.0.)
21
22