react-photo-sphere-viewer
Advanced tools
Comparing version 3.1.2-psv5.0.2 to 3.2.0-psv5.0.2
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
import { __assign, __spreadArray } from './node_modules/tslib/tslib.es6.js'; | ||
import React, { forwardRef, createRef, useState, useEffect, useImperativeHandle } from 'react'; | ||
import React, { forwardRef, createRef, useRef, useState, useEffect, useImperativeHandle } from 'react'; | ||
import { Viewer } from './node_modules/@photo-sphere-viewer/core/index.module.js'; | ||
@@ -68,5 +68,3 @@ export { AbstractAdapter, AbstractPlugin } from './node_modules/@photo-sphere-viewer/core/index.module.js'; | ||
var sphereElementRef = /*#__PURE__*/createRef(); | ||
var _a = useState(), | ||
spherePlayerInstance = _a[0], | ||
setSpherePlayerInstance = _a[1]; | ||
var spherePlayerInstance = useRef(null); | ||
var LITTLEPLANET_MAX_ZOOM = 130; | ||
@@ -76,5 +74,5 @@ var LITTLEPLANET_DEF_LAT = useState(-90)[0]; | ||
var LITTLEPLANET_DEF_ZOOM = useState(0)[0]; | ||
var _b = useState(defaultNavbar), | ||
currentNavbar = _b[0], | ||
setCurrentNavbar = _b[1]; | ||
var _a = useState(defaultNavbar), | ||
currentNavbar = _a[0], | ||
setCurrentNavbar = _a[1]; | ||
useEffect(function () { | ||
@@ -96,3 +94,3 @@ function handleResize() { | ||
var littlePlanetEnabled = true; | ||
if (sphereElementRef.current && !spherePlayerInstance) { | ||
if (sphereElementRef.current && !spherePlayerInstance.current) { | ||
var _c_1 = new Viewer(__assign(__assign({}, adaptOptions(options)), { | ||
@@ -249,3 +247,3 @@ container: sphereElementRef.current, | ||
}); | ||
setSpherePlayerInstance(_c_1); | ||
spherePlayerInstance.current = _c_1; | ||
} | ||
@@ -272,3 +270,4 @@ }, [sphereElementRef, options]); | ||
setOptions: function setOptions(options) { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.setOptions(options); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.setOptions(options); | ||
}, | ||
@@ -288,15 +287,20 @@ getCurrentNavbar: function getCurrentNavbar() { | ||
resize: function resize(size) { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.resize(size); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.resize(size); | ||
}, | ||
enterFullscreen: function enterFullscreen() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.enterFullscreen(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.enterFullscreen(); | ||
}, | ||
exitFullscreen: function exitFullscreen() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.exitFullscreen(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.exitFullscreen(); | ||
}, | ||
toggleFullscreen: function toggleFullscreen() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.toggleFullscreen(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.toggleFullscreen(); | ||
}, | ||
isFullscreenEnabled: function isFullscreenEnabled() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.isFullscreenEnabled(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.isFullscreenEnabled(); | ||
}, | ||
@@ -310,24 +314,32 @@ startAutoRotate: function startAutoRotate() { | ||
getPlugin: function getPlugin(pluginName) { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.getPlugin(pluginName); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.getPlugin(pluginName); | ||
}, | ||
getPosition: function getPosition() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.getPosition(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.getPosition(); | ||
}, | ||
getZoomLevel: function getZoomLevel() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.getZoomLevel(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.getZoomLevel(); | ||
}, | ||
getSize: function getSize() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.getSize(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.getSize(); | ||
}, | ||
needsUpdate: function needsUpdate() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.needsUpdate(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.needsUpdate(); | ||
}, | ||
autoSize: function autoSize() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.autoSize(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.autoSize(); | ||
}, | ||
setPanorama: function setPanorama(path, options) { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.setPanorama(path, options); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.setPanorama(path, options); | ||
}, | ||
setOverlay: function setOverlay(path, opacity) { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.setOverlay(path, opacity); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.setOverlay(path, opacity); | ||
}, | ||
@@ -338,15 +350,19 @@ toggleAutorotate: function toggleAutorotate() { | ||
showError: function showError(message) { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.showError(message); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.showError(message); | ||
}, | ||
hideError: function hideError() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.hideError(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.hideError(); | ||
}, | ||
startKeyboardControl: function startKeyboardControl() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.startKeyboardControl(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.startKeyboardControl(); | ||
}, | ||
stopKeyboardControl: function stopKeyboardControl() { | ||
return spherePlayerInstance === null || spherePlayerInstance === void 0 ? void 0 : spherePlayerInstance.stopKeyboardControl(); | ||
var _a; | ||
return (_a = spherePlayerInstance.current) === null || _a === void 0 ? void 0 : _a.stopKeyboardControl(); | ||
} | ||
}; | ||
}, [spherePlayerInstance, sphereElementRef, options, ref]); | ||
}, [spherePlayerInstance.current, sphereElementRef, options, ref]); | ||
return /*#__PURE__*/React.createElement("div", { | ||
@@ -353,0 +369,0 @@ className: options.containerClass || "view-container", |
{ | ||
"name": "react-photo-sphere-viewer", | ||
"version": "3.1.2-psv5.0.2", | ||
"version": "3.2.0-psv5.0.2", | ||
"description": "Photosphere Viewer for React.JS, wrapper of photo-sphere-viewer.js", | ||
@@ -5,0 +5,0 @@ "author": "Elius94", |
@@ -13,3 +13,3 @@ # react-photo-sphere-viewer | ||
Original Wrapped Library: [PhotoSphereViewer](https://github.com/mistic100/Photo-Sphere-Viewer) Version: 5.0.2 [<font color="green">**NEW**</font>] | ||
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 3.1.1-psv5.0.2. This means that the wrapper is in version 3.1.1 and the original library [psv](https://github.com/mistic100/Photo-Sphere-Viewer) is in version 5.0.2. | ||
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 3.2.0-psv5.0.2. This means that the wrapper is in version 3.2.0 and the original library [psv](https://github.com/mistic100/Photo-Sphere-Viewer) is in version 5.0.2. | ||
@@ -16,0 +16,0 @@ ## Description |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20215
4971836