@particle-academy/fancy-3d 0.6.0 → 0.7.1

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,62 @@ upgrading.
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.7.1] - 2026-11-28
19
+
20
+ ### Fixed
21
+
22
+ - **An agent's full-screen request no longer makes Chrome warn in the console.**
23
+ A request with no user gesture (an agent through a handle, a timer) still
24
+ called `requestFullscreen()`, which the browser refuses, and Chrome logged
25
+ "API can only be initiated by a user gesture" on every such request before
26
+ the view fell back to expanded. `useFullscreen` now checks
27
+ `navigator.userActivation.isActive` first (feature-detected) and goes
28
+ straight to expanded when there is no gesture. A real click still gets the
29
+ browser's native full screen, and a browser without `navigator.userActivation`
30
+ asks the API as before. Nothing to do on upgrade.
31
+
32
+ ## [0.7.0] - 2026-11-28
33
+
34
+ ### Added
35
+
36
+ - **Full screen for every viewer, in one place: `@particle-academy/fancy-3d/fullscreen`**
37
+ (also on the root entry). `useFullscreen(ref, options)` full-screens the
38
+ viewer's ROOT container, not the bare canvas, so the controls overlay,
39
+ labels, breadcrumbs and anything else rendered inside it come along. It uses
40
+ the Fullscreen API (and Safari's prefixed one), and where that is missing or
41
+ refused (iPhone Safari, an iframe without `allow="fullscreen"`, an agent
42
+ asking without a user gesture) an `"expanded"` mode: a fixed, full-viewport
43
+ box. Esc and the button both exit; the root's resize reaches every renderer
44
+ (a `resize` event is sent too); the canvas keeps keyboard focus across the
45
+ switch; a transparent root takes the page's background while full screen,
46
+ so the browser's black backdrop (or the page) never shows through. Controlled
47
+ with `fullscreen` / `onFullscreenChange(on, { source })`,
48
+ `setFullscreen` as the handle method, `data-fancy-3d-fullscreen` on the root
49
+ and `data-fancy-3d-fullscreen-button` on `<FullscreenButton>`. Also
50
+ `FullscreenContext`, `useFullscreenContext`, `nativeFullscreenSupported`.
51
+ `enabled: false` makes the hook inert, for a viewer nested in another that
52
+ owns full screen. It depends on React alone. fancy-3d-three, fancy-3d-babylon and fancy-graph use
53
+ it. See `docs/fullscreen.md`.
54
+ - **The DOM `<Canvas>` goes full screen**: `fullscreen`, `defaultFullscreen`,
55
+ `onFullscreenChange` and `fullscreenLabels` props, and `<Canvas.Controls>`
56
+ has a full-screen toggle (`showFullscreen`, default true). The minimap and the
57
+ controls stay inside.
58
+
59
+ ### Changed
60
+
61
+ - **`<Canvas.Controls>`'s Fit all button wears a `Scan` icon, not `Maximize`.**
62
+ `Maximize` is the full-screen icon, so the toolbar read as having a
63
+ full-screen button it did not have. **Nothing to do**, unless a test looked
64
+ for `.lucide-maximize`: select it by `aria-label="Fit all"` instead.
65
+ - The build splits shared code into chunks (`splitting: true`), so the root,
66
+ `./canvas` and `./fullscreen` entries share one `FullscreenContext` under
67
+ both ESM and CJS. **Nothing to do.**
68
+ - **`lucide-react` is now a declared dependency (`^0.511.0`, the range
69
+ react-fancy uses) and is no longer bundled.** `<Canvas.Controls>` imported
70
+ its icons without declaring the package, so the build inlined them by
71
+ accident. The dist now imports `lucide-react`, and your package manager
72
+ shares one copy with react-fancy. **Nothing to do.**
73
+
18
74
  ## [0.6.0] - 2026-11-28
19
75
 
20
76
  ### 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