@ericchen1990/pano-view 2.1.0 → 2.2.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/README.md +57 -15
- package/README.zh-CN.md +1111 -0
- package/dist/index.cjs +53 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +53 -84
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +340 -0
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @ericchen1990/pano-view
|
|
2
2
|
|
|
3
|
+
**English** | [简体中文](./README.zh-CN.md)
|
|
4
|
+
|
|
3
5
|
Composable React components for equirectangular and krpano-style multiresolution panorama viewers.
|
|
4
6
|
|
|
5
7
|
Try the components in the [live playground](https://pano-view-playground.vercel.app/).
|
|
@@ -17,29 +19,58 @@ not affiliated with krpano.
|
|
|
17
19
|
|
|
18
20
|
## Install
|
|
19
21
|
|
|
22
|
+
### Package
|
|
23
|
+
|
|
20
24
|
```bash
|
|
21
25
|
npm install @ericchen1990/pano-view
|
|
22
26
|
```
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
pnpm and Yarn work the same way (`pnpm add` / `yarn add`).
|
|
29
|
+
|
|
30
|
+
### Peer dependencies
|
|
31
|
+
|
|
32
|
+
These packages must be installed in the **host application**, not nested under
|
|
33
|
+
this library. npm 7+ and pnpm install them automatically; Yarn Classic and npm
|
|
34
|
+
6 do not, so install them explicitly.
|
|
35
|
+
|
|
36
|
+
| Package | Supported range |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `react` | `>=19.0.0 <19.3.0` |
|
|
39
|
+
| `react-dom` | `>=19.0.0 <19.3.0` |
|
|
40
|
+
| `three` | `^0.185.1` |
|
|
41
|
+
| `@react-three/fiber` | `^9.7.0` |
|
|
42
|
+
| `@react-three/drei` | `^10.0.0` |
|
|
43
|
+
| `@react-three/xr` | `^6.6.0` |
|
|
44
|
+
|
|
45
|
+
Keep a **single copy** of React, Three.js, and the React Three Fiber packages
|
|
46
|
+
in the host app. Duplicate `three` trees are a common cause of blank canvases
|
|
47
|
+
and context errors (`R3F: Hooks can only be used within the Canvas component`).
|
|
48
|
+
If that happens, check `npm ls three` / `pnpm why three` and dedupe.
|
|
49
|
+
|
|
50
|
+
React 19.3 and later are outside the supported range.
|
|
51
|
+
|
|
52
|
+
### Stylesheet (HTML chrome)
|
|
53
|
+
|
|
54
|
+
Import the shipped stylesheet once in the host app. The WebGL panorama
|
|
55
|
+
(`PanoViewer`, `Sphere`, `Tile`, 3D hotspots) renders without it. Built-in
|
|
56
|
+
**HTML** overlays do not: they use prefixed `pano-*` classes for layout.
|
|
28
57
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
58
|
+
Those overlays include video controls, captions, the default context menu,
|
|
59
|
+
hotspot tooltips, accessibility-only chrome, and WebVR session UI.
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import "@ericchen1990/pano-view/styles.css";
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Or from CSS:
|
|
33
66
|
|
|
34
67
|
```css
|
|
35
|
-
@import "
|
|
36
|
-
@source "../node_modules/@ericchen1990/pano-view";
|
|
68
|
+
@import "@ericchen1990/pano-view/styles.css";
|
|
37
69
|
```
|
|
38
70
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
component appearance props.
|
|
71
|
+
Skip this import only if you do not use those overlays, or if you restyle
|
|
72
|
+
them entirely through `className`, `style`, and appearance props. Without
|
|
73
|
+
the stylesheet, the overlays still mount, but they render unstyled.
|
|
43
74
|
|
|
44
75
|
## Exported components
|
|
45
76
|
|
|
@@ -94,6 +125,7 @@ Angles are public degrees. Positive yaw looks right and positive pitch looks up.
|
|
|
94
125
|
|
|
95
126
|
```tsx
|
|
96
127
|
import { useRef } from "react";
|
|
128
|
+
import "@ericchen1990/pano-view/styles.css";
|
|
97
129
|
import {
|
|
98
130
|
PanoViewer,
|
|
99
131
|
Sphere,
|
|
@@ -1322,4 +1354,14 @@ not load.
|
|
|
1322
1354
|
|
|
1323
1355
|
## Next.js and SSR
|
|
1324
1356
|
|
|
1325
|
-
The distributed entry is marked as a client module. Render it below a Client
|
|
1357
|
+
The distributed entry is marked as a client module. Render it below a Client
|
|
1358
|
+
Component boundary. Panorama resources are loaded in the browser; no API keys
|
|
1359
|
+
or server configuration are required.
|
|
1360
|
+
|
|
1361
|
+
Import the stylesheet once from a Client Component or a global CSS file:
|
|
1362
|
+
|
|
1363
|
+
```ts
|
|
1364
|
+
import "@ericchen1990/pano-view/styles.css";
|
|
1365
|
+
```
|
|
1366
|
+
|
|
1367
|
+
See [Stylesheet (HTML chrome)](#stylesheet-html-chrome).
|