Skip to content

Commit 5d86af3

Browse files
committed
Update PhotoSphereViewer library version and add new prop
1 parent 2d48980 commit 5d86af3

File tree

1 file changed

+51
-47
lines changed

1 file changed

+51
-47
lines changed

README.md

Lines changed: 51 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ npm install react-photo-sphere-viewer
99
```
1010

1111
## Library Version
12-
Original Wrapped Library: [PhotoSphereViewer](https://github.com/mistic100/Photo-Sphere-Viewer) Version: 5.4.4 [<font color="green">**NEW**</font>]
13-
Now the component version is composed by the semantic version of the wrapper and the version of the original library. For example, the current version is 4.0.2-psv5.4.4. This means that the wrapper is in version 4.0.2 and the original library [psv](https://github.com/mistic100/Photo-Sphere-Viewer) is in version 5.4.4.
12+
Original Wrapped Library: [PhotoSphereViewer](https://github.com/mistic100/Photo-Sphere-Viewer) Version: 5.5.2 [<font color="green">**NEW**</font>]
13+
Now the component version is composed by the semantic version of the wrapper and the version of the original library. For example, the current version is 4.1.0-psv5.5.2. This means that the wrapper is in version 4.1.0 and the original library [psv](https://github.com/mistic100/Photo-Sphere-Viewer) is in version 5.5.2.
1414

1515
## Description
1616

@@ -97,6 +97,7 @@ type standardProps = {
9797
width?: number;
9898
containerClass?: string; // The class name of the div that wrap the component.
9999
littlePlanet?: boolean; // Display the panorama like a little planet.
100+
hideNavbarButton?: boolean; // Hide the navbar button.
100101
}
101102
```
102103
#### Original props
@@ -110,8 +111,9 @@ Currently all options of the original library are supported and exported as prop
110111
type ViewerConfig = {
111112
container: HTMLElement | string;
112113
panorama?: any;
114+
/** @deprecated Use the `overlay` plugin instead */
113115
overlay?: any;
114-
/** @default 1 */
116+
/** @deprecated Use the `overlay` plugin instead */
115117
overlayOpacity?: number;
116118
/** @default equirectangular */
117119
adapter?: AdapterConstructor | [AdapterConstructor, any];
@@ -123,6 +125,8 @@ type ViewerConfig = {
123125
/** @default null */
124126
downloadUrl?: string;
125127
/** @default null */
128+
downloadName?: string;
129+
/** @default null */
126130
loadingImg?: string;
127131
/** @default 'Loading...' */
128132
loadingTxt?: string;
@@ -136,10 +140,6 @@ type ViewerConfig = {
136140
maxFov?: number;
137141
/** @default 50 */
138142
defaultZoomLvl?: number;
139-
/** @deprecated use `defaultYaw` */
140-
defaultLong?: number;
141-
/** @deprecated use `defaultPitch` */
142-
defaultLat?: number;
143143
/** @default 0 */
144144
defaultYaw?: number | string;
145145
/** @default 0 */
@@ -150,16 +150,6 @@ type ViewerConfig = {
150150
moveSpeed?: number;
151151
/** @default 1 */
152152
zoomSpeed?: number;
153-
/** @deprecated use the 'autorotate' plugin */
154-
autorotateDelay?: number | null;
155-
/** @deprecated use the 'autorotate' plugin */
156-
autorotateIdle?: boolean;
157-
/** @deprecated use the 'autorotate' plugin */
158-
autorotateSpeed?: string | number;
159-
/** @deprecated use the 'autorotate' plugin */
160-
autorotateLat?: number;
161-
/** @deprecated use the 'autorotate' plugin */
162-
autorotateZoomLvl?: number;
163153
/** @default true */
164154
moveInertia?: boolean;
165155
/** @default true */
@@ -170,15 +160,17 @@ type ViewerConfig = {
170160
mousewheelCtrlKey?: boolean;
171161
/** @default false */
172162
touchmoveTwoFingers?: boolean;
173-
/** @default true */
163+
/** @deprecated configure `useXmpData` on EquirectangularAdapter */
174164
useXmpData?: boolean;
175165
panoData?: PanoData | PanoDataProvider;
176166
requestHeaders?: Record<string, string> | ((url: string) => Record<string, string>);
177-
/** @default '#000' */
167+
/** @deprecated configure `backgroundColor` on EquirectangularAdapter */
178168
canvasBackground?: string;
169+
/** @default '{ alpha: true, antialias: true }' */
170+
rendererParameters?: WebGLRendererParameters;
179171
/** @default false */
180172
withCredentials?: boolean;
181-
/** @default 'autorotate zoom move download description caption fullscreen' */
173+
/** @default 'zoom move download description caption fullscreen' */
182174
navbar?: boolean | string | Array<string | NavbarCustomButton>;
183175
lang?: {
184176
zoom: string;
@@ -195,9 +187,12 @@ type ViewerConfig = {
195187
twoFingers: string;
196188
ctrlZoom: string;
197189
loadError: string;
190+
littlePlanetButton: string;
191+
littlePlanetIcon: string;
198192
[K: string]: string;
199193
};
200-
keyboard?: boolean | Record<string, ACTIONS>;
194+
keyboard?: boolean | 'always' | 'fullscreen' | Record<string, ACTIONS | ((viewer: Viewer) => void)>;
195+
keyboardActions?: Record<string, ACTIONS | ((viewer: Viewer) => void)>;
201196
};
202197
```
203198
> This code is generated from the original library. Click [here](http://photo-sphere-viewer.js.org/guide/config.html) to see documentation.
@@ -358,32 +353,41 @@ And then:
358353
<ReactPhotoSphereViewer ref={photoSphereRef} src="Test_Pano.jpg"></ReactPhotoSphereViewer>
359354
```
360355
Currently managed methods are:
361-
- animate(options: AnimateOptions)
362-
- destroy()
363-
- rotate(options: { x: number, y: number })
364-
- setOption(option: keyof ViewerOptions, value: any)
365-
- setOptions(options: ViewerOptions)
366-
- zoom(value: number)
367-
- zoomIn()
368-
- zoomOut()
369-
- resize(size: CssSize)
370-
- enterFullscreen()
371-
- exitFullscreen()
372-
- toggleFullscreen()
373-
- isFullscreenEnabled()
374-
- getPlugin(pluginName: string)
375-
- getPosition()
376-
- getZoomLevel()
377-
- getSize()
378-
- needsUpdate()
379-
- autoSize()
380-
- setPanorama(path: string, options?: object)
381-
- setOverlay(path: string, opacity?: number)
382-
- toggleAutorotate()
383-
- showError(message: string)
384-
- hideError()
385-
- startKeyboardControl()
386-
- stopKeyboardControl()
356+
- animate(options: AnimateOptions): utils.Animation<any>;
357+
- destroy(): void;
358+
- createTooltip(config: TooltipConfig): Tooltip;
359+
- needsContinuousUpdate(enabled: boolean): void;
360+
- observeObjects(userDataKey: string): void;
361+
- unobserveObjects(userDataKey: string): void;
362+
- setCursor(cursor: string): void;
363+
- stopAnimation(): PromiseLike<any>;
364+
- rotate(position: ExtendedPosition): void;
365+
- setOption(option: keyof UpdatableViewerConfig, value: unknown): void;
366+
- setOptions(options: Partial<UpdatableViewerConfig>): void;
367+
- getCurrentNavbar(): (string | object)[] | void;
368+
- zoom(value: number): void;
369+
- zoomIn(step: number): void;
370+
- zoomOut(step: number): void;
371+
- resize(size: CssSize): void;
372+
- enterFullscreen(): void;
373+
- exitFullscreen(): void;
374+
- toggleFullscreen(): void;
375+
- isFullscreenEnabled(): boolean | void;
376+
- startAutoRotate(): void;
377+
- stopAutoRotate(): void;
378+
- getPlugin<T>(pluginId: string | PluginConstructor): T;
379+
- getPosition(): Position; // Specify the return type
380+
- getZoomLevel(): number; // Specify the return type
381+
- getSize(): Size; // Specify the return type
382+
- needsUpdate(): void;
383+
- autoSize(): void;
384+
- setPanorama(path: any, options?: PanoramaOptions): Promise<boolean>;
385+
- setOverlay(path: any, opacity?: number): Promise<void>;
386+
- toggleAutorotate(): void;
387+
- showError(message: string): void;
388+
- hideError(): void;
389+
- startKeyboardControl(): void;
390+
- stopKeyboardControl(): void;
387391

388392
> To see the original methods, click [here](http://photo-sphere-viewer.js.org/guide/methods.html).
389393

0 commit comments

Comments
 (0)