photo-sphere-viewer
Advanced tools
Comparing version 4.7.3 to 4.8.0
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -355,10 +353,12 @@ } | ||
_this.loader = new three.ImageLoader(); | ||
_this.loader = null; | ||
if (_this.psv.config.withCredentials) { | ||
_this.loader.setWithCredentials(true); | ||
} | ||
if (_this.psv.config.requestHeaders) { | ||
photoSphereViewer.utils.logWarn('CubemapTilesAdapter fallbacks to file loader because "requestHeaders" where provided. ' + 'Consider removing "requestHeaders" if you experience performances issues.'); | ||
} else { | ||
_this.loader = new three.ImageLoader(); | ||
if (_this.psv.config.requestHeaders && typeof _this.psv.config.requestHeaders === 'object') { | ||
_this.loader.setRequestHeader(_this.psv.config.requestHeaders); | ||
if (_this.psv.config.withCredentials) { | ||
_this.loader.setWithCredentials(true); | ||
} | ||
} | ||
@@ -704,10 +704,3 @@ | ||
var url = panorama.tileUrl(cubemap.CUBE_HASHMAP[tile.face], col, row); | ||
if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'function') { | ||
this.loader.setRequestHeader(this.psv.config.requestHeaders(url)); | ||
} | ||
return new Promise(function (resolve, reject) { | ||
_this5.loader.load(url, resolve, undefined, reject); | ||
}).then(function (image) { | ||
return this.__loadImage(url).then(function (image) { | ||
if (!task.isCancelled()) { | ||
@@ -735,2 +728,18 @@ var material = new three.MeshBasicMaterial({ | ||
/** | ||
* @private | ||
*/ | ||
; | ||
_proto.__loadImage = function __loadImage(url) { | ||
var _this6 = this; | ||
if (this.loader) { | ||
return new Promise(function (resolve, reject) { | ||
_this6.loader.load(url, resolve, undefined, reject); | ||
}); | ||
} else { | ||
return this.psv.textureLoader.loadImage(url); | ||
} | ||
} | ||
/** | ||
* @summary Applies a new texture to the faces | ||
@@ -746,3 +755,3 @@ * @param {int} face | ||
_proto.__swapMaterial = function __swapMaterial(face, col, row, material) { | ||
var _this6 = this; | ||
var _this7 = this; | ||
@@ -754,19 +763,19 @@ var uvs = this.prop.geom.getAttribute(ATTR_UV); | ||
// position of the face (two triangles of the same square) | ||
var faceCol = col * _this6.prop.facesByTile + c; | ||
var faceRow = row * _this6.prop.facesByTile + r; // first vertex for this face (6 vertices in total) | ||
var faceCol = col * _this7.prop.facesByTile + c; | ||
var faceRow = row * _this7.prop.facesByTile + r; // first vertex for this face (6 vertices in total) | ||
var firstVertex = NB_VERTICES_BY_PLANE * face + 6 * (CUBE_SEGMENTS * faceRow + faceCol); // swap material | ||
var matIndex = _this6.prop.geom.groups.find(function (g) { | ||
var matIndex = _this7.prop.geom.groups.find(function (g) { | ||
return g.start === firstVertex; | ||
}).materialIndex; | ||
_this6.prop.materials[matIndex] = material; // define new uvs | ||
_this7.prop.materials[matIndex] = material; // define new uvs | ||
var top = 1 - r / _this6.prop.facesByTile; | ||
var bottom = 1 - (r + 1) / _this6.prop.facesByTile; | ||
var left = c / _this6.prop.facesByTile; | ||
var right = (c + 1) / _this6.prop.facesByTile; | ||
var top = 1 - r / _this7.prop.facesByTile; | ||
var bottom = 1 - (r + 1) / _this7.prop.facesByTile; | ||
var left = c / _this7.prop.facesByTile; | ||
var right = (c + 1) / _this7.prop.facesByTile; | ||
if (_this6.config.flipTopBottom && (face === 2 || face === 3)) { | ||
if (_this7.config.flipTopBottom && (face === 2 || face === 3)) { | ||
top = 1 - top; | ||
@@ -773,0 +782,0 @@ bottom = 1 - bottom; |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -48,0 +46,0 @@ } |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -48,0 +46,0 @@ } |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -394,10 +392,12 @@ } | ||
_this.loader = new three.ImageLoader(); | ||
_this.loader = null; | ||
if (_this.psv.config.withCredentials) { | ||
_this.loader.setWithCredentials(true); | ||
} | ||
if (_this.psv.config.requestHeaders) { | ||
photoSphereViewer.utils.logWarn('EquirectangularTilesAdapter fallbacks to file loader because "requestHeaders" where provided. ' + 'Consider removing "requestHeaders" if you experience performances issues.'); | ||
} else { | ||
_this.loader = new three.ImageLoader(); | ||
if (_this.psv.config.requestHeaders && typeof _this.psv.config.requestHeaders === 'object') { | ||
_this.loader.setRequestHeader(_this.psv.config.requestHeaders); | ||
if (_this.psv.config.withCredentials) { | ||
_this.loader.setWithCredentials(true); | ||
} | ||
} | ||
@@ -827,10 +827,3 @@ | ||
var url = panorama.tileUrl(tile.col, tile.row); | ||
if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'function') { | ||
this.loader.setRequestHeader(this.psv.config.requestHeaders(url)); | ||
} | ||
return new Promise(function (resolve, reject) { | ||
_this5.loader.load(url, resolve, undefined, reject); | ||
}).then(function (image) { | ||
return this.__loadImage(url).then(function (image) { | ||
if (!task.isCancelled()) { | ||
@@ -858,2 +851,18 @@ var material = new three.MeshBasicMaterial({ | ||
/** | ||
* @private | ||
*/ | ||
; | ||
_proto.__loadImage = function __loadImage(url) { | ||
var _this6 = this; | ||
if (this.loader) { | ||
return new Promise(function (resolve, reject) { | ||
_this6.loader.load(url, resolve, undefined, reject); | ||
}); | ||
} else { | ||
return this.psv.textureLoader.loadImage(url); | ||
} | ||
} | ||
/** | ||
* @summary Applies a new texture to the faces | ||
@@ -868,3 +877,3 @@ * @param {int} col | ||
_proto.__swapMaterial = function __swapMaterial(col, row, material) { | ||
var _this6 = this; | ||
var _this7 = this; | ||
@@ -876,6 +885,6 @@ var uvs = this.prop.geom.getAttribute(ATTR_UV); | ||
// position of the face (two triangles of the same square) | ||
var faceCol = col * _this6.prop.facesByCol + c; | ||
var faceRow = row * _this6.prop.facesByRow + r; | ||
var faceCol = col * _this7.prop.facesByCol + c; | ||
var faceRow = row * _this7.prop.facesByRow + r; | ||
var isFirstRow = faceRow === 0; | ||
var isLastRow = faceRow === _this6.SPHERE_HORIZONTAL_SEGMENTS - 1; // first vertex for this face (3 or 6 vertices in total) | ||
var isLastRow = faceRow === _this7.SPHERE_HORIZONTAL_SEGMENTS - 1; // first vertex for this face (3 or 6 vertices in total) | ||
@@ -885,20 +894,20 @@ var firstVertex = void 0; | ||
if (isFirstRow) { | ||
firstVertex = faceCol * _this6.NB_VERTICES_BY_SMALL_FACE; | ||
firstVertex = faceCol * _this7.NB_VERTICES_BY_SMALL_FACE; | ||
} else if (isLastRow) { | ||
firstVertex = _this6.NB_VERTICES - _this6.SPHERE_SEGMENTS * _this6.NB_VERTICES_BY_SMALL_FACE + faceCol * _this6.NB_VERTICES_BY_SMALL_FACE; | ||
firstVertex = _this7.NB_VERTICES - _this7.SPHERE_SEGMENTS * _this7.NB_VERTICES_BY_SMALL_FACE + faceCol * _this7.NB_VERTICES_BY_SMALL_FACE; | ||
} else { | ||
firstVertex = _this6.SPHERE_SEGMENTS * _this6.NB_VERTICES_BY_SMALL_FACE + (faceRow - 1) * _this6.SPHERE_SEGMENTS * _this6.NB_VERTICES_BY_FACE + faceCol * _this6.NB_VERTICES_BY_FACE; | ||
firstVertex = _this7.SPHERE_SEGMENTS * _this7.NB_VERTICES_BY_SMALL_FACE + (faceRow - 1) * _this7.SPHERE_SEGMENTS * _this7.NB_VERTICES_BY_FACE + faceCol * _this7.NB_VERTICES_BY_FACE; | ||
} // swap material | ||
var matIndex = _this6.prop.geom.groups.find(function (g) { | ||
var matIndex = _this7.prop.geom.groups.find(function (g) { | ||
return g.start === firstVertex; | ||
}).materialIndex; | ||
_this6.prop.materials[matIndex] = material; // define new uvs | ||
_this7.prop.materials[matIndex] = material; // define new uvs | ||
var top = 1 - r / _this6.prop.facesByRow; | ||
var bottom = 1 - (r + 1) / _this6.prop.facesByRow; | ||
var left = c / _this6.prop.facesByCol; | ||
var right = (c + 1) / _this6.prop.facesByCol; | ||
var top = 1 - r / _this7.prop.facesByRow; | ||
var bottom = 1 - (r + 1) / _this7.prop.facesByRow; | ||
var left = c / _this7.prop.facesByCol; | ||
var right = (c + 1) / _this7.prop.facesByCol; | ||
@@ -905,0 +914,0 @@ if (isFirstRow) { |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -48,0 +46,0 @@ } |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -21,7 +21,6 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -28,0 +27,0 @@ } |
@@ -434,7 +434,4 @@ import { Texture, Vector3, Euler, Intersection, Mesh } from 'three'; | ||
* @summary Parse a CSS-like position into an array of position keywords among top, bottom, left, right and center | ||
* @param {string | string[]} value | ||
* @param {string} defaultValue | ||
* @param {boolean} [allowCenter=true] | ||
*/ | ||
declare function cleanPosition(value: string | string[], defaultValue: string, allowCenter?): string[]; | ||
declare function cleanPosition(value: string | string[], options?: { allowCenter: boolean, cssOrder: boolean }): string[]; | ||
@@ -594,3 +591,3 @@ /** | ||
*/ | ||
toggle(); | ||
toggle(visible?: boolean); | ||
@@ -1446,2 +1443,2 @@ /** | ||
export { AbstractAdapter, AbstractButton, AbstractComponent, AbstractPlugin, AdapterConstructor, AnimateOptions, Animation, AnimationOptions, constants_d as CONSTANTS, ClickData, CssSize, DEFAULTS, DataHelper, EquirectangularAdapter, EquirectangularAdapterOptions, ExtendedPosition, Loader, Navbar, NavbarCustomButton, Notification, NotificationOptions, Overlay, OverlayOptions, PSVError, Panel, PanelOptions, PanoData, PanoDataProvider, PanoramaOptions, PluginConstructor, Point, Position, SYSTEM, Size, SphereCorrection, TextureData, TextureLoader, Tooltip, TooltipOptions, TooltipPosition, TooltipRenderer, Viewer, ViewerOptions, ViewerProps, registerButton, index_d as utils }; | ||
export { AbstractAdapter, AbstractButton, AbstractComponent, AbstractPlugin, AdapterConstructor, AnimateOptions, constants_d as CONSTANTS, ClickData, CssSize, DEFAULTS, DataHelper, EquirectangularAdapter, EquirectangularAdapterOptions, ExtendedPosition, Loader, Navbar, NavbarCustomButton, Notification, NotificationOptions, Overlay, OverlayOptions, PSVError, Panel, PanelOptions, PanoData, PanoDataProvider, PanoramaOptions, PluginConstructor, Point, Position, SYSTEM, Size, SphereCorrection, TextureData, TextureLoader, Tooltip, TooltipOptions, TooltipPosition, TooltipRenderer, Viewer, ViewerOptions, ViewerProps, registerButton, index_d as utils }; |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -48,0 +46,0 @@ } |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -102,3 +100,2 @@ } | ||
size: '120px', | ||
position: 'top left', | ||
backgroundSvg: compass, | ||
@@ -109,4 +106,8 @@ coneColor: 'rgba(255, 255, 255, 0.5)', | ||
hotspotColor: 'rgba(0, 0, 0, 0.5)' | ||
}, options); | ||
_this.config.position = photoSphereViewer.utils.cleanPosition(_this.config.position, 'top left'); | ||
}, options, { | ||
position: photoSphereViewer.utils.cleanPosition(options.position, { | ||
allowCenter: true, | ||
cssOrder: true | ||
}) || ['top', 'left'] | ||
}); | ||
/** | ||
@@ -113,0 +114,0 @@ * @private |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -164,2 +162,4 @@ } | ||
function GalleryButton(navbar) { | ||
var _this$plugin; | ||
var _this; | ||
@@ -182,2 +182,6 @@ | ||
if (!((_this$plugin = _this.plugin) != null && _this$plugin.items.length)) { | ||
_this.hide(); | ||
} | ||
return _this; | ||
@@ -598,3 +602,7 @@ } | ||
_proto.toggle = function toggle() { | ||
return this.gallery.toggle(); | ||
if (this.gallery.isVisible()) { | ||
this.hide(); | ||
} else { | ||
this.show(); | ||
} | ||
} | ||
@@ -609,3 +617,3 @@ /** | ||
_proto.setItems = function setItems(items, handler) { | ||
var _items; | ||
var _items, _this$psv$navbar$getB; | ||
@@ -632,3 +640,4 @@ if (!((_items = items) != null && _items.length)) { | ||
}); | ||
this.gallery.setItems(items); | ||
this.gallery.setItems(this.items); | ||
(_this$psv$navbar$getB = this.psv.navbar.getButton(GalleryButton.id, false)) == null ? void 0 : _this$psv$navbar$getB.toggle(this.items.length > 0); | ||
} | ||
@@ -635,0 +644,0 @@ /** |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -48,0 +46,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { ExtendedPosition, AbstractPlugin, Viewer, Animation } from 'photo-sphere-viewer'; | ||
import { ExtendedPosition, AbstractPlugin, Viewer, utils } from 'photo-sphere-viewer'; | ||
import { Event } from 'uevent'; | ||
@@ -39,3 +39,3 @@ | ||
orientation?: 'front' | 'horizontal' | 'vertical-left' | 'vertical-right'; | ||
scale?: number | [number, number] | { zoom?: [number, number], longitude?: [number, number] }; | ||
scale?: [number, number] | { zoom?: [number, number], longitude?: [number, number] }; | ||
opacity?: number; | ||
@@ -46,5 +46,7 @@ className?: string; | ||
anchor?: string; | ||
zoomLvl?: number; | ||
visible?: boolean; | ||
tooltip?: string | { content: string, position?: string, className?: string, trigger?: 'hover' | 'click' }; | ||
content?: string; | ||
listContent?: string; | ||
hideList?: boolean; | ||
@@ -217,3 +219,3 @@ data?: any; | ||
*/ | ||
gotoMarker(markerId: string, speed: string | number): Animation<any>; | ||
gotoMarker(markerId: string, speed: string | number): utils.Animation<any>; | ||
@@ -220,0 +222,0 @@ /** |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -48,0 +46,0 @@ } |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -48,0 +46,0 @@ } |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -21,7 +21,6 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -28,0 +27,0 @@ } |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -48,0 +46,0 @@ } |
@@ -39,6 +39,2 @@ import { Event } from 'uevent'; | ||
outlineColor?: number; | ||
/** | ||
* @deprecated | ||
*/ | ||
opacity?: number; | ||
scale?: [number, number]; | ||
@@ -67,6 +63,2 @@ }; | ||
getNode?: (nodeId: string) => VirtualTourNode | Promise<VirtualTourNode>; | ||
/** | ||
* @deprecated | ||
*/ | ||
getLinks?: (nodeId: string) => VirtualTourNodeLink[] | Promise<VirtualTourNodeLink[]>; | ||
startNodeId?: string; | ||
@@ -89,3 +81,2 @@ preload?: boolean | ((node: VirtualTourNode, link: VirtualTourNodeLink) => boolean); | ||
NODE_CHANGED: 'node-changed', | ||
RENDER_NODES_LIST: 'render-nodes-list', | ||
}; | ||
@@ -127,17 +118,2 @@ | ||
/** | ||
* @summary Toggles the visibility of the list of nodes | ||
*/ | ||
toggleNodesList(); | ||
/** | ||
* @summary Opens side panel with the list of nodes | ||
*/ | ||
showNodesList(); | ||
/** | ||
* @summary Closes side panel if it contains the list of nodes | ||
*/ | ||
hideNodesList(); | ||
/** | ||
* @summary Triggered when the current node changes | ||
@@ -144,0 +120,0 @@ */ |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,18 +40,9 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
} | ||
function _assertThisInitialized(self) { | ||
if (self === void 0) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
} | ||
return self; | ||
} | ||
/** | ||
@@ -91,13 +81,2 @@ * @memberOf PSV.plugins.VirtualTourPlugin | ||
throw new photoSphereViewer.PSVError('loadNode not implemented'); | ||
} | ||
/** | ||
* @summary Loades nodes linked to another node | ||
* @param {string} nodeId | ||
* @return {Promise<void>} | ||
*/ | ||
; | ||
_proto.loadLinkedNodes = function loadLinkedNodes(nodeId) { | ||
// eslint-disable-line no-unused-vars | ||
throw new photoSphereViewer.PSVError('loadLinkedNodes not implemented'); | ||
}; | ||
@@ -146,2 +125,6 @@ | ||
} | ||
if (isGps && !link.position) { | ||
throw new photoSphereViewer.PSVError("No GPS position provided for link " + link.nodeId + " of node " + node.id); | ||
} | ||
} | ||
@@ -210,10 +193,2 @@ /** | ||
_proto.loadLinkedNodes = function loadLinkedNodes(nodeId) { | ||
if (!this.nodes[nodeId]) { | ||
return Promise.reject(new photoSphereViewer.PSVError("Node " + nodeId + " not found")); | ||
} else { | ||
return Promise.resolve(); | ||
} | ||
}; | ||
_proto.setNodes = function setNodes(rawNodes) { | ||
@@ -237,3 +212,3 @@ var _this = this; | ||
photoSphereViewer.utils.logWarn("Node " + node.id + " has no links"); | ||
nodes.links = []; | ||
node.links = []; | ||
} | ||
@@ -245,4 +220,2 @@ | ||
node.links.forEach(function (link) { | ||
checkLink(node, link, _this.plugin.isGps()); | ||
if (!nodes[link.nodeId]) { | ||
@@ -255,2 +228,3 @@ throw new photoSphereViewer.PSVError("Target node " + link.nodeId + " of node " + node.id + " does not exists"); | ||
link.name = link.name || nodes[link.nodeId].name; | ||
checkLink(node, link, _this.plugin.isGps()); | ||
linkedNodes[link.nodeId] = true; | ||
@@ -276,4 +250,2 @@ }); | ||
var nodesList = "<svg viewBox=\"0 0 700 700\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"currentColor\" d=\"M113.2 198.6v305l-62 15.5A41.2 41.2 0 0 1 0 479v-256a41.2 41.2 0 0 1 51.2-40zm473.6 305v-305l62-15.5a41.2 41.2 0 0 1 51.2 40v256a41.2 41.2 0 0 1-51.2 40zm-349.3 43h-42c-18 0-33.3-11.6-38.9-27.8l91-97 56 56zm57 0 178.7-186 72.4 78.3v66.6a41.2 41.2 0 0 1-41.2 41.2zm251-168.4-56.8-61.6c-8-8.8-21.8-8.9-30-.3L332 448.2l-70.5-70.5c-8.2-8.2-21.6-8-29.6.5L154.4 461V196.7a41.2 41.2 0 0 1 41.2-41.2h308.8a41.2 41.2 0 0 1 41.2 41.2zm-298.4-58a61.8 61.8 0 1 0 0-123.5 61.8 61.8 0 0 0 0 123.5zm0-41.2a20.6 20.6 0 1 1 0-41.1 20.6 20.6 0 0 1 0 41.1z\"/><!-- Created by Andrejs Kirm from the Noun Project --></svg>\n"; | ||
/** | ||
@@ -341,12 +313,3 @@ * @summary In client mode all the nodes are provided in the config or with the `setNodes` method | ||
*/ | ||
NODE_CHANGED: 'node-changed', | ||
/** | ||
* @event filter:render-nodes-list | ||
* @memberof PSV.plugins.VirtualTourPlugin | ||
* @summary Used to alter the list of nodes displayed on the side-panel | ||
* @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes | ||
* @returns {PSV.plugins.VirtualTourPlugin.Node[]} | ||
*/ | ||
RENDER_NODES_LIST: 'render-nodes-list' | ||
NODE_CHANGED: 'node-changed' | ||
}; | ||
@@ -416,109 +379,4 @@ /** | ||
ARROW_OUTLINE_GEOM = _ref.ARROW_OUTLINE_GEOM; | ||
var ID_PANEL_NODES_LIST = 'virtualTourNodesList'; | ||
/** | ||
* @summary Nodes list template | ||
* @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes | ||
* @param {string} title | ||
* @param {string} currentNodeId | ||
* @returns {string} | ||
* @constant | ||
* @private | ||
*/ | ||
var NODES_LIST_TEMPLATE = function NODES_LIST_TEMPLATE(nodes, title, currentNodeId) { | ||
return "\n<div class=\"psv-panel-menu psv-panel-menu--stripped psv-virtual-tour__menu\">\n <h1 class=\"psv-panel-menu-title\">" + nodesList + " " + title + "</h1>\n <ul class=\"psv-panel-menu-list\">\n " + nodes.map(function (node) { | ||
return "\n <li data-node-id=\"" + node.id + "\" tabindex=\"0\"\n class=\"psv-panel-menu-item " + (currentNodeId === node.id ? 'psv-panel-menu-item--active' : '') + "\">\n " + (node.thumbnail ? "<span class=\"psv-panel-menu-item-icon\"><img src=\"" + node.thumbnail + "\"/></span>" : '') + "\n <span class=\"psv-panel-menu-item-label\">" + (node.caption || node.name) + "</span>\n </li>\n "; | ||
}).join('') + "\n </ul>\n</div>\n"; | ||
}; | ||
/** | ||
* @summary Navigation bar markers list button class | ||
* @extends PSV.buttons.AbstractButton | ||
* @memberof PSV.buttons | ||
*/ | ||
var NodesListButton = /*#__PURE__*/function (_AbstractButton) { | ||
_inheritsLoose(NodesListButton, _AbstractButton); | ||
/** | ||
* @param {PSV.components.Navbar} navbar | ||
*/ | ||
function NodesListButton(navbar) { | ||
var _this; | ||
_this = _AbstractButton.call(this, navbar, 'psv-button--hover-scale psv-nodes-list-button', true) || this; | ||
/** | ||
* @type {PSV.plugins.VirtualTourPlugin} | ||
*/ | ||
_this.plugin = _this.psv.getPlugin('virtual-tour'); | ||
if (_this.plugin) { | ||
_this.psv.on(photoSphereViewer.CONSTANTS.EVENTS.OPEN_PANEL, _assertThisInitialized(_this)); | ||
_this.psv.on(photoSphereViewer.CONSTANTS.EVENTS.CLOSE_PANEL, _assertThisInitialized(_this)); | ||
} | ||
return _this; | ||
} | ||
/** | ||
* @override | ||
*/ | ||
var _proto = NodesListButton.prototype; | ||
_proto.destroy = function destroy() { | ||
this.psv.off(photoSphereViewer.CONSTANTS.EVENTS.OPEN_PANEL, this); | ||
this.psv.off(photoSphereViewer.CONSTANTS.EVENTS.CLOSE_PANEL, this); | ||
_AbstractButton.prototype.destroy.call(this); | ||
} | ||
/** | ||
* @override | ||
*/ | ||
; | ||
_proto.isSupported = function isSupported() { | ||
return !!this.plugin && !this.plugin.isServerSide() && !this.plugin.gallery; | ||
} | ||
/** | ||
* @summary Handles events | ||
* @param {Event} e | ||
* @private | ||
*/ | ||
; | ||
_proto.handleEvent = function handleEvent(e) { | ||
/* eslint-disable */ | ||
switch (e.type) { | ||
// @formatter:off | ||
case photoSphereViewer.CONSTANTS.EVENTS.OPEN_PANEL: | ||
this.toggleActive(e.args[0] === ID_PANEL_NODES_LIST); | ||
break; | ||
case photoSphereViewer.CONSTANTS.EVENTS.CLOSE_PANEL: | ||
this.toggleActive(false); | ||
break; | ||
// @formatter:on | ||
} | ||
/* eslint-enable */ | ||
} | ||
/** | ||
* @override | ||
* @description Toggles nodes list | ||
*/ | ||
; | ||
_proto.onClick = function onClick() { | ||
this.plugin.toggleNodesList(); | ||
}; | ||
return NodesListButton; | ||
}(photoSphereViewer.AbstractButton); | ||
NodesListButton.id = 'nodesList'; | ||
NodesListButton.icon = nodesList; | ||
/** | ||
* @memberOf PSV.plugins.VirtualTourPlugin | ||
@@ -541,3 +399,2 @@ * @private | ||
_this.nodeResolver = plugin.config.getNode; | ||
_this.linksResolver = plugin.config.getLinks; | ||
return _this; | ||
@@ -556,40 +413,19 @@ } | ||
checkNode(node, _this2.plugin.isGps()); | ||
_this2.nodes[nodeId] = node; | ||
return node; | ||
}); | ||
} | ||
}; | ||
_proto.loadLinkedNodes = function loadLinkedNodes(nodeId) { | ||
var _this3 = this; | ||
if (!node.links) { | ||
photoSphereViewer.utils.logWarn("Node " + node.id + " has no links"); | ||
node.links = []; | ||
} | ||
if (!this.nodes[nodeId]) { | ||
return Promise.reject(new photoSphereViewer.PSVError("Node " + nodeId + " not found")); | ||
} else if (this.nodes[nodeId].links) { | ||
return Promise.resolve(); | ||
} else { | ||
if (!this.linksResolver) { | ||
this.nodes[nodeId].links = []; | ||
return Promise.resolve(); | ||
} | ||
photoSphereViewer.utils.logWarn("getLinks() option is deprecated, instead make getNode() also return the node' links."); | ||
return Promise.resolve(this.linksResolver(nodeId)).then(function (links) { | ||
return links || []; | ||
}).then(function (links) { | ||
var node = _this3.nodes[nodeId]; | ||
links.forEach(function (link) { | ||
checkLink(node, link, _this3.plugin.isGps()); // copy essential data | ||
if (_this3.nodes[link.nodeId]) { | ||
link.position = link.position || _this3.nodes[link.nodeId].position; | ||
link.name = link.name || _this3.nodes[link.nodeId].name; | ||
node.links.forEach(function (link) { | ||
// copy essential data | ||
if (_this2.nodes[link.nodeId]) { | ||
link.position = link.position || _this2.nodes[link.nodeId].position; | ||
link.name = link.name || _this2.nodes[link.nodeId].name; | ||
} | ||
if (_this3.plugin.isGps() && !link.position) { | ||
throw new photoSphereViewer.PSVError("No GPS position provided for link " + link.nodeId + " of node " + node.id); | ||
} | ||
}); // store links | ||
node.links = links; | ||
checkLink(node, link, _this2.plugin.isGps()); | ||
}); | ||
_this2.nodes[nodeId] = node; | ||
return node; | ||
}); | ||
@@ -603,93 +439,2 @@ } | ||
/** | ||
* @callback GetNode | ||
* @summary Function to load a node | ||
* @memberOf PSV.plugins.VirtualTourPlugin | ||
* @param {string} nodeId | ||
* @returns {PSV.plugins.VirtualTourPlugin.Node|Promise<PSV.plugins.VirtualTourPlugin.Node>} | ||
*/ | ||
/** | ||
* @callback GetLinks | ||
* @summary Function to load the links of a node | ||
* @deprecated `getNode` must directly return the links of each node | ||
* @memberOf PSV.plugins.VirtualTourPlugin | ||
* @param {string} nodeId | ||
* @returns {PSV.plugins.VirtualTourPlugin.NodeLink[]|Promise<PSV.plugins.VirtualTourPlugin.NodeLink[]>} | ||
*/ | ||
/** | ||
* @callback Preload | ||
* @summary Function to determine if a link must be preloaded | ||
* @memberOf PSV.plugins.VirtualTourPlugin | ||
* @param {PSV.plugins.VirtualTourPlugin.Node} node | ||
* @param {PSV.plugins.VirtualTourPlugin.NodeLink} link | ||
* @returns {boolean} | ||
*/ | ||
/** | ||
* @typedef {Object} PSV.plugins.VirtualTourPlugin.Node | ||
* @summary Definition of a single node in the tour | ||
* @property {string} id - unique identifier of the node | ||
* @property {*} panorama | ||
* @property {PSV.plugins.VirtualTourPlugin.NodeLink[]} [links] - links to other nodes | ||
* @property {number[]} [position] - GPS position (longitude, latitude, optional altitude) | ||
* @property {PSV.PanoData | PSV.PanoDataProvider} [panoData] - data used for this panorama | ||
* @property {PSV.SphereCorrection} [sphereCorrection] - sphere correction to apply to this panorama | ||
* @property {string} [name] - short name of the node | ||
* @property {string} [caption] - caption visible in the navbar | ||
* @property {string} [description] - description visible in the side panel | ||
* @property {string} [thumbnail] - thumbnail for the nodes list in the side panel | ||
* @property {PSV.plugins.MarkersPlugin.Properties[]} [markers] - additional markers to use on this node | ||
*/ | ||
/** | ||
* @typedef {PSV.ExtendedPosition} PSV.plugins.VirtualTourPlugin.NodeLink | ||
* @summary Definition of a link between two nodes | ||
* @property {string} nodeId - identifier of the target node | ||
* @property {string} [name] - override the name of the node (tooltip) | ||
* @property {number[]} [position] - override the GPS position of the node | ||
* @property {PSV.plugins.MarkersPlugin.Properties} [markerStyle] - override global marker style | ||
* @property {PSV.plugins.VirtualTourPlugin.ArrowStyle} [arrowStyle] - override global arrow style | ||
*/ | ||
/** | ||
* @typedef {Object} PSV.plugins.VirtualTourPlugin.ArrowStyle | ||
* @summary Style of the arrow in 3D mode | ||
* @property {string} [color=0xaaaaaa] | ||
* @property {string} [hoverColor=0xaa5500] | ||
* @property {number} [outlineColor=0x000000] | ||
* @property {number[]} [scale=[0.5,2]] | ||
*/ | ||
/** | ||
* @typedef {Object} PSV.plugins.VirtualTourPlugin.Options | ||
* @property {'client'|'server'} [dataMode='client'] - configure data mode | ||
* @property {'manual'|'gps'} [positionMode='manual'] - configure positioning mode | ||
* @property {'markers'|'3d'} [renderMode='3d'] - configure rendering mode of links | ||
* @property {PSV.plugins.VirtualTourPlugin.Node[]} [nodes] - initial nodes | ||
* @property {PSV.plugins.VirtualTourPlugin.GetNode} [getNode] | ||
* @property {PSV.plugins.VirtualTourPlugin.GetLinks} [getLinks] - Deprecated: `getNode` must directly return the links of each node | ||
* @property {string} [startNodeId] - id of the initial node, if not defined the first node will be used | ||
* @property {boolean|PSV.plugins.VirtualTourPlugin.Preload} [preload=false] - preload linked panoramas | ||
* @property {boolean|string|number} [rotateSpeed='20rpm'] - speed of rotation when clicking on a link, if 'false' the viewer won't rotate at all | ||
* @property {boolean|number} [transition=1500] - duration of the transition between nodes | ||
* @property {boolean} [linksOnCompass] - if the Compass plugin is enabled, displays the links on the compass, defaults to `true` on in markers render mode | ||
* @property {PSV.plugins.MarkersPlugin.Properties} [markerStyle] - global marker style | ||
* @property {PSV.plugins.VirtualTourPlugin.ArrowStyle} [arrowStyle] - global arrow style | ||
* @property {number} [markerLatOffset=-0.1] - (GPS & Markers mode) latitude offset applied to link markers, to compensate for viewer height | ||
* @property {'top'|'bottom'} [arrowPosition='bottom'] - (3D mode) arrows vertical position | ||
*/ | ||
/** | ||
* @typedef {Object} PSV.plugins.VirtualTourPlugin.NodeChangedData | ||
* @summary Data associated to the "node-changed" event | ||
* @type {PSV.plugins.VirtualTourPlugin.Node} [fromNode] - The previous node | ||
* @type {PSV.plugins.VirtualTourPlugin.NodeLink} [fromLink] - The link that was clicked in the previous node | ||
* @type {PSV.Position} [fromLinkPosition] - The position of the link on the previous node | ||
*/ | ||
// add markers buttons | ||
photoSphereViewer.DEFAULTS.lang[NodesListButton.id] = 'Locations'; | ||
photoSphereViewer.registerButton(NodesListButton, 'caption:left'); | ||
/** | ||
* @summary Create virtual tours by linking multiple panoramas | ||
@@ -751,10 +496,2 @@ * @extends PSV.plugins.AbstractPlugin | ||
}); | ||
if ((options == null ? void 0 : options.listButton) === false) { | ||
photoSphereViewer.utils.logWarn('VirtualTourPlugin: listButton option is deprecated. ' + 'Please define the global navbar options according to your needs.'); | ||
} | ||
if ((options == null ? void 0 : options.listButton) === true && _this.config.dataMode === MODE_SERVER) { | ||
photoSphereViewer.utils.logWarn('VirtualTourPlugin: the list button is not supported in server mode.'); | ||
} | ||
/** | ||
@@ -765,3 +502,2 @@ * @type {PSV.plugins.MarkersPlugin} | ||
_this.markers = null; | ||
@@ -1081,3 +817,3 @@ /** | ||
(_this4$compass = _this4.compass) == null ? void 0 : _this4$compass.clearHotspots(); | ||
return Promise.all([_this4.psv.setPanorama(node.panorama, { | ||
return _this4.psv.setPanorama(node.panorama, { | ||
transition: _this4.config.transition, | ||
@@ -1092,3 +828,3 @@ caption: node.caption, | ||
} | ||
}), _this4.datasource.loadLinkedNodes(nodeId)]); | ||
}); | ||
}).then(function () { | ||
@@ -1340,49 +1076,2 @@ if (_this4.prop.loadingNode !== nodeId) { | ||
}); | ||
} | ||
/** | ||
* @summary Toggles the visibility of the list of nodes | ||
*/ | ||
; | ||
_proto.toggleNodesList = function toggleNodesList() { | ||
if (this.psv.panel.prop.contentId === ID_PANEL_NODES_LIST) { | ||
this.hideNodesList(); | ||
} else { | ||
this.showNodesList(); | ||
} | ||
} | ||
/** | ||
* @summary Opens side panel with the list of nodes | ||
*/ | ||
; | ||
_proto.showNodesList = function showNodesList() { | ||
var _this$prop$currentNod2, | ||
_this7 = this; | ||
photoSphereViewer.utils.logWarn("Starting from next version, the VirtualTourPlugin will require the GalleryPlugin to display the list of nodes."); | ||
var nodes = this.change(EVENTS.RENDER_NODES_LIST, Object.values(this.datasource.nodes)); | ||
this.psv.panel.show({ | ||
id: ID_PANEL_NODES_LIST, | ||
content: NODES_LIST_TEMPLATE(nodes, this.psv.config.lang[NodesListButton.id], (_this$prop$currentNod2 = this.prop.currentNode) == null ? void 0 : _this$prop$currentNod2.id), | ||
noMargin: true, | ||
clickHandler: function clickHandler(e) { | ||
var li = e.target ? photoSphereViewer.utils.getClosest(e.target, 'li') : undefined; | ||
var nodeId = li ? li.dataset.nodeId : undefined; | ||
if (nodeId) { | ||
_this7.setCurrentNode(nodeId); | ||
_this7.hideNodesList(); | ||
} | ||
} | ||
}); | ||
} | ||
/** | ||
* @summary Closes side panel if it contains the list of nodes | ||
*/ | ||
; | ||
_proto.hideNodesList = function hideNodesList() { | ||
this.psv.panel.hide(ID_PANEL_NODES_LIST); | ||
}; | ||
@@ -1389,0 +1078,0 @@ |
/*! | ||
* Photo Sphere Viewer 4.7.3 | ||
* Photo Sphere Viewer 4.8.0 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -14,3 +14,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
@@ -28,3 +28,2 @@ var source = arguments[i]; | ||
}; | ||
return _extends.apply(this, arguments); | ||
@@ -41,7 +40,6 @@ } | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -48,0 +46,0 @@ } |
{ | ||
"name": "photo-sphere-viewer", | ||
"version": "4.7.3", | ||
"version": "4.8.0", | ||
"description": "A JavaScript library to display Photo Sphere panoramas", | ||
@@ -36,3 +36,3 @@ "homepage": "https://photo-sphere-viewer.js.org", | ||
"dependencies": { | ||
"three": "^0.144.0", | ||
"three": "^0.146.0", | ||
"uevent": "^2.1.1" | ||
@@ -49,5 +49,5 @@ }, | ||
"@pixi/jsdoc-template": "^2.5.1", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"@rollup/plugin-babel": "^6.0.0", | ||
"@rollup/plugin-json": "^5.0.0", | ||
"@rollup/plugin-replace": "^5.0.0", | ||
"@vuepress/plugin-active-header-links": "^1.8.2", | ||
@@ -57,3 +57,3 @@ "@vuepress/plugin-back-to-top": "^1.8.2", | ||
"autoprefixer": "^10.3.3", | ||
"axios": "^0.27.0", | ||
"axios": "^1.0.0", | ||
"cpx2": "^4.1.2", | ||
@@ -60,0 +60,0 @@ "date-fns": "^2.23.0", |
@@ -135,8 +135,13 @@ import { | ||
*/ | ||
this.loader = new ImageLoader(); | ||
if (this.psv.config.withCredentials) { | ||
this.loader.setWithCredentials(true); | ||
this.loader = null; | ||
if (this.psv.config.requestHeaders) { | ||
utils.logWarn('CubemapTilesAdapter fallbacks to file loader because "requestHeaders" where provided. ' | ||
+ 'Consider removing "requestHeaders" if you experience performances issues.'); | ||
} | ||
if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'object') { | ||
this.loader.setRequestHeader(this.psv.config.requestHeaders); | ||
else { | ||
this.loader = new ImageLoader(); | ||
if (this.psv.config.withCredentials) { | ||
this.loader.setWithCredentials(true); | ||
} | ||
} | ||
@@ -451,9 +456,3 @@ | ||
if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'function') { | ||
this.loader.setRequestHeader(this.psv.config.requestHeaders(url)); | ||
} | ||
return new Promise((resolve, reject) => { | ||
this.loader.load(url, resolve, undefined, reject); | ||
}) | ||
return this.__loadImage(url) | ||
.then((image) => { | ||
@@ -478,2 +477,16 @@ if (!task.isCancelled()) { | ||
/** | ||
* @private | ||
*/ | ||
__loadImage(url) { | ||
if (this.loader) { | ||
return new Promise((resolve, reject) => { | ||
this.loader.load(url, resolve, undefined, reject); | ||
}); | ||
} | ||
else { | ||
return this.psv.textureLoader.loadImage(url); | ||
} | ||
} | ||
/** | ||
* @summary Applies a new texture to the faces | ||
@@ -480,0 +493,0 @@ * @param {int} face |
@@ -164,8 +164,13 @@ import { Frustum, ImageLoader, MathUtils, Matrix4, Mesh, MeshBasicMaterial, SphereGeometry, Vector3 } from 'three'; | ||
*/ | ||
this.loader = new ImageLoader(); | ||
if (this.psv.config.withCredentials) { | ||
this.loader.setWithCredentials(true); | ||
this.loader = null; | ||
if (this.psv.config.requestHeaders) { | ||
utils.logWarn('EquirectangularTilesAdapter fallbacks to file loader because "requestHeaders" where provided. ' | ||
+ 'Consider removing "requestHeaders" if you experience performances issues.'); | ||
} | ||
if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'object') { | ||
this.loader.setRequestHeader(this.psv.config.requestHeaders); | ||
else { | ||
this.loader = new ImageLoader(); | ||
if (this.psv.config.withCredentials) { | ||
this.loader.setWithCredentials(true); | ||
} | ||
} | ||
@@ -583,9 +588,3 @@ | ||
if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'function') { | ||
this.loader.setRequestHeader(this.psv.config.requestHeaders(url)); | ||
} | ||
return new Promise((resolve, reject) => { | ||
this.loader.load(url, resolve, undefined, reject); | ||
}) | ||
return this.__loadImage(url) | ||
.then((image) => { | ||
@@ -610,2 +609,16 @@ if (!task.isCancelled()) { | ||
/** | ||
* @private | ||
*/ | ||
__loadImage(url) { | ||
if (this.loader) { | ||
return new Promise((resolve, reject) => { | ||
this.loader.load(url, resolve, undefined, reject); | ||
}); | ||
} | ||
else { | ||
return this.psv.textureLoader.loadImage(url); | ||
} | ||
} | ||
/** | ||
* @summary Applies a new texture to the faces | ||
@@ -612,0 +625,0 @@ * @param {int} col |
@@ -122,8 +122,3 @@ import { AbstractComponent } from '../components/AbstractComponent'; | ||
this.prop.supported = supported; | ||
if (!supported) { | ||
this.hide(); | ||
} | ||
else { | ||
this.show(); | ||
} | ||
this.toggle(supported); | ||
}); | ||
@@ -130,0 +125,0 @@ } |
@@ -93,8 +93,9 @@ /** | ||
* @summary Displays or hides the component | ||
* @param {boolean} [visible] - forced state | ||
*/ | ||
toggle() { | ||
if (this.isVisible()) { | ||
toggle(visible) { | ||
if (visible === false || visible === undefined && this.isVisible()) { | ||
this.hide(); | ||
} | ||
else { | ||
else if (visible === true || visible === undefined && !this.isVisible()) { | ||
this.show(); | ||
@@ -101,0 +102,0 @@ } |
@@ -72,9 +72,3 @@ import { DescriptionButton } from '../buttons/DescriptionButton'; | ||
refreshUi() { | ||
const availableWidth = this.container.offsetWidth; | ||
if (availableWidth >= this.prop.contentWidth) { | ||
this.show(); | ||
} | ||
else if (availableWidth < this.prop.contentWidth) { | ||
this.hide(); | ||
} | ||
this.toggle(this.container.offsetWidth >= this.prop.contentWidth); | ||
this.__refreshButton(); | ||
@@ -81,0 +75,0 @@ } |
import { EVENTS } from '../data/constants'; | ||
import { PSVError } from '../PSVError'; | ||
import { addClasses, cleanPosition } from '../utils'; | ||
import { addClasses, cleanPosition, positionIsOrdered } from '../utils'; | ||
import { AbstractComponent } from './AbstractComponent'; | ||
@@ -38,3 +38,3 @@ | ||
* @param {PSV.Viewer} psv | ||
* @param {{arrow: number, offset: number}} size | ||
* @param {{arrow: number, border: number}} size | ||
*/ | ||
@@ -47,3 +47,3 @@ constructor(psv, size) { | ||
* @property {number} arrow | ||
* @property {number} offset | ||
* @property {number} border | ||
* @property {number} width | ||
@@ -174,2 +174,9 @@ * @property {number} height | ||
if (!config.box) { | ||
config.box = { | ||
width : 0, | ||
height: 0, | ||
}; | ||
} | ||
this.config = config; | ||
@@ -182,3 +189,3 @@ | ||
const style = { | ||
posClass : config.position ? cleanPosition(config.position, false) : ['top', 'center'], | ||
posClass : cleanPosition(config.position, { allowCenter: false, cssOrder: false }) || ['top', 'center'], | ||
width : this.prop.width, | ||
@@ -196,20 +203,24 @@ height : this.prop.height, | ||
// correct position if overflow | ||
let refresh = false; | ||
if (style.top < this.prop.offset) { | ||
style.posClass[0] = 'bottom'; | ||
refresh = true; | ||
let swapY = null; | ||
let swapX = null; | ||
if (style.top < 0) { | ||
swapY = 'bottom'; | ||
} | ||
else if (style.top + style.height > this.psv.prop.size.height - this.prop.offset) { | ||
style.posClass[0] = 'top'; | ||
refresh = true; | ||
else if (style.top + style.height > this.psv.prop.size.height) { | ||
swapY = 'top'; | ||
} | ||
if (style.left < this.prop.offset) { | ||
style.posClass[1] = 'right'; | ||
refresh = true; | ||
if (style.left < 0) { | ||
swapX = 'right'; | ||
} | ||
else if (style.left + style.width > this.psv.prop.size.width - this.prop.offset) { | ||
style.posClass[1] = 'left'; | ||
refresh = true; | ||
else if (style.left + style.width > this.psv.prop.size.width) { | ||
swapX = 'left'; | ||
} | ||
if (refresh) { | ||
if (swapX || swapY) { | ||
const ordered = positionIsOrdered(style.posClass); | ||
if (swapY) { | ||
style.posClass[ordered ? 0 : 1] = swapY; | ||
} | ||
if (swapX) { | ||
style.posClass[ordered ? 1 : 0] = swapX; | ||
} | ||
this.__computeTooltipPosition(style, config); | ||
@@ -276,59 +287,84 @@ } | ||
__computeTooltipPosition(style, config) { | ||
let topBottom = false; | ||
const arrow = this.prop.arrow; | ||
const top = config.top; | ||
const height = style.height; | ||
const left = config.left; | ||
const width = style.width; | ||
const offsetSide = arrow + this.prop.border; | ||
const offsetX = config.box.width / 2 + arrow * 2; | ||
const offsetY = config.box.height / 2 + arrow * 2; | ||
if (!config.box) { | ||
config.box = { | ||
width : 0, | ||
height: 0, | ||
}; | ||
} | ||
switch (style.posClass[0]) { | ||
case 'bottom': | ||
style.top = config.top + config.box.height + this.prop.offset + this.prop.arrow; | ||
style.arrowTop = -this.prop.arrow * 2; | ||
topBottom = true; | ||
switch (style.posClass.join('-')) { | ||
case 'top-left': | ||
style.top = top - offsetY - height; | ||
style.left = left + offsetSide - width; | ||
style.arrowTop = height; | ||
style.arrowLeft = width - offsetSide - arrow; | ||
break; | ||
case 'center': | ||
style.top = config.top + config.box.height / 2 - style.height / 2; | ||
style.arrowTop = style.height / 2 - this.prop.arrow; | ||
case 'top-center': | ||
style.top = top - offsetY - height; | ||
style.left = left - width / 2; | ||
style.arrowTop = height; | ||
style.arrowLeft = width / 2 - arrow; | ||
break; | ||
case 'top': | ||
style.top = config.top - style.height - this.prop.offset - this.prop.arrow; | ||
style.arrowTop = style.height; | ||
topBottom = true; | ||
case 'top-right': | ||
style.top = top - offsetY - height; | ||
style.left = left - offsetSide; | ||
style.arrowTop = height; | ||
style.arrowLeft = arrow; | ||
break; | ||
// no default | ||
} | ||
switch (style.posClass[1]) { | ||
case 'right': | ||
if (topBottom) { | ||
style.left = config.left + config.box.width / 2 - this.prop.offset - this.prop.arrow; | ||
style.arrowLeft = this.prop.offset; | ||
} | ||
else { | ||
style.left = config.left + config.box.width + this.prop.offset + this.prop.arrow; | ||
style.arrowLeft = -this.prop.arrow * 2; | ||
} | ||
case 'bottom-left': | ||
style.top = top + offsetY; | ||
style.left = left + offsetSide - width; | ||
style.arrowTop = -arrow * 2; | ||
style.arrowLeft = width - offsetSide - arrow; | ||
break; | ||
case 'center': | ||
style.left = config.left + config.box.width / 2 - style.width / 2; | ||
style.arrowLeft = style.width / 2 - this.prop.arrow; | ||
case 'bottom-center': | ||
style.top = top + offsetY; | ||
style.left = left - width / 2; | ||
style.arrowTop = -arrow * 2; | ||
style.arrowLeft = width / 2 - arrow; | ||
break; | ||
case 'left': | ||
if (topBottom) { | ||
style.left = config.left - style.width + config.box.width / 2 + this.prop.offset + this.prop.arrow; | ||
style.arrowLeft = style.width - this.prop.offset - this.prop.arrow * 2; | ||
} | ||
else { | ||
style.left = config.left - style.width - this.prop.offset - this.prop.arrow; | ||
style.arrowLeft = style.width; | ||
} | ||
case 'bottom-right': | ||
style.top = top + offsetY; | ||
style.left = left - offsetSide; | ||
style.arrowTop = -arrow * 2; | ||
style.arrowLeft = arrow; | ||
break; | ||
case 'left-top': | ||
style.top = top + offsetSide - height; | ||
style.left = left - offsetX - width; | ||
style.arrowTop = height - offsetSide - arrow; | ||
style.arrowLeft = width; | ||
break; | ||
case 'center-left': | ||
style.top = top - height / 2; | ||
style.left = left - offsetX - width; | ||
style.arrowTop = height / 2 - arrow; | ||
style.arrowLeft = width; | ||
break; | ||
case 'left-bottom': | ||
style.top = top - offsetSide; | ||
style.left = left - offsetX - width; | ||
style.arrowTop = arrow; | ||
style.arrowLeft = width; | ||
break; | ||
case 'right-top': | ||
style.top = top + offsetSide - height; | ||
style.left = left + offsetX; | ||
style.arrowTop = height - offsetSide - arrow; | ||
style.arrowLeft = -arrow * 2; | ||
break; | ||
case 'center-right': | ||
style.top = top - height / 2; | ||
style.left = left + offsetX; | ||
style.arrowTop = height / 2 - arrow; | ||
style.arrowLeft = -arrow * 2; | ||
break; | ||
case 'right-bottom': | ||
style.top = top - offsetSide; | ||
style.left = left + offsetX; | ||
style.arrowTop = arrow; | ||
style.arrowLeft = -arrow * 2; | ||
break; | ||
@@ -335,0 +371,0 @@ // no default |
@@ -104,6 +104,3 @@ import { MathUtils } from 'three'; | ||
export const DEPRECATED_OPTIONS = { | ||
zoomButtonIncrement : 'zoomButtonIncrement is deprecated, use zoomSpeed', | ||
mousewheelSpeed : 'mousewheelSpeed is deprecated, use zoomSpeed', | ||
sphereCorrectionReorder: 'sphereCorrectionReorder is deprecated', | ||
captureCursor : 'captureCursor is deprecated', | ||
captureCursor: 'captureCursor is deprecated', | ||
}; | ||
@@ -110,0 +107,0 @@ |
@@ -13,3 +13,2 @@ import { AbstractAdapter } from './adapters/AbstractAdapter'; | ||
import * as utils from './utils'; | ||
import { Animation } from './utils/Animation'; | ||
import { Viewer } from './Viewer'; | ||
@@ -23,6 +22,2 @@ import './styles/index.scss'; | ||
AbstractPlugin, | ||
/** | ||
* @deprecated use `utils.Animation` | ||
*/ | ||
Animation, | ||
CONSTANTS, | ||
@@ -29,0 +24,0 @@ DEFAULTS, |
@@ -50,3 +50,2 @@ import { MathUtils } from 'three'; | ||
size : '120px', | ||
position : 'top left', | ||
backgroundSvg : compass, | ||
@@ -58,4 +57,4 @@ coneColor : 'rgba(255, 255, 255, 0.5)', | ||
...options, | ||
position : utils.cleanPosition(options.position, { allowCenter: true, cssOrder: true }) || ['top', 'left'], | ||
}; | ||
this.config.position = utils.cleanPosition(this.config.position, 'top left'); | ||
@@ -62,0 +61,0 @@ /** |
@@ -32,2 +32,6 @@ import { AbstractButton } from '../..'; | ||
} | ||
if (!this.plugin?.items.length) { | ||
this.hide(); | ||
} | ||
} | ||
@@ -34,0 +38,0 @@ |
@@ -155,3 +155,8 @@ import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from '../..'; | ||
toggle() { | ||
return this.gallery.toggle(); | ||
if (this.gallery.isVisible()) { | ||
this.hide(); | ||
} | ||
else { | ||
this.show(); | ||
} | ||
} | ||
@@ -185,3 +190,5 @@ | ||
this.gallery.setItems(items); | ||
this.gallery.setItems(this.items); | ||
this.psv.navbar.getButton(GalleryButton.id, false)?.toggle(this.items.length > 0); | ||
} | ||
@@ -188,0 +195,0 @@ |
@@ -88,7 +88,2 @@ import { Vector3 } from 'three'; | ||
if (options?.listButton === false || options?.hideButton === false) { | ||
utils.logWarn('MarkersPlugin: listButton and hideButton options are deprecated. ' | ||
+ 'Please define the global navbar options according to your needs.'); | ||
} | ||
/** | ||
@@ -445,3 +440,3 @@ * @member {HTMLElement} | ||
* @fires PSV.plugins.MarkersPlugin.goto-marker-done | ||
* @return {PSV.Animation} A promise that will be resolved when the animation finishes | ||
* @return {PSV.utils.Animation} A promise that will be resolved when the animation finishes | ||
*/ | ||
@@ -453,3 +448,4 @@ gotoMarker(markerId, speed) { | ||
...marker.props.position, | ||
speed, | ||
zoom : marker.config.zoomLvl, | ||
speed: speed, | ||
}) | ||
@@ -983,9 +979,4 @@ .then(() => { | ||
const nbMarkers = Object.values(this.markers).filter(m => !m.config.hideList).length; | ||
const markersButton = this.psv.navbar.getButton(MarkersButton.id, false); | ||
const markersListButton = this.psv.navbar.getButton(MarkersListButton.id, false); | ||
if (nbMarkers === 0) { | ||
markersButton?.hide(); | ||
markersListButton?.hide(); | ||
if (this.psv.panel.isVisible(ID_PANEL_MARKERS_LIST)) { | ||
@@ -999,5 +990,3 @@ this.psv.panel.hide(); | ||
else { | ||
markersButton?.show(); | ||
markersListButton?.show(); | ||
// eslint-disable-next-line no-lonely-if | ||
if (this.psv.panel.isVisible(ID_PANEL_MARKERS_LIST)) { | ||
@@ -1010,2 +999,5 @@ this.showMarkersList(); | ||
} | ||
this.psv.navbar.getButton(MarkersButton.id, false)?.toggle(nbMarkers > 0); | ||
this.psv.navbar.getButton(MarkersListButton.id, false)?.toggle(nbMarkers > 0); | ||
} | ||
@@ -1012,0 +1004,0 @@ |
@@ -315,11 +315,10 @@ import { Group, MathUtils, Mesh, MeshBasicMaterial, PlaneGeometry, TextureLoader } from 'three'; | ||
if (this.isPoly()) { | ||
config.box = { // separate the tooltip from the cursor | ||
width : this.psv.tooltip.size.arrow * 2, | ||
height: this.psv.tooltip.size.arrow * 2, | ||
}; | ||
if (mousePosition) { | ||
const viewerPos = utils.getPosition(this.psv.container); | ||
config.top = mousePosition.clientY - viewerPos.top - this.psv.tooltip.size.arrow / 2; | ||
config.left = mousePosition.clientX - viewerPos.left - this.psv.tooltip.size.arrow; | ||
config.top = mousePosition.clientY - viewerPos.top; | ||
config.left = mousePosition.clientX - viewerPos.left; | ||
config.box = { // separate the tooltip from the cursor | ||
width : 20, | ||
height: 20, | ||
}; | ||
} | ||
@@ -332,4 +331,4 @@ else { | ||
else { | ||
config.top = this.props.position2D.y; | ||
config.left = this.props.position2D.x; | ||
config.top = this.props.position2D.y + this.props.height / 2; | ||
config.left = this.props.position2D.x + this.props.width / 2; | ||
config.box = { | ||
@@ -427,10 +426,4 @@ width : this.props.width, | ||
// clean scale | ||
if (this.config.scale) { | ||
if (typeof this.config.scale === 'number') { | ||
utils.logWarn('Single value marker scale is deprecated, please use an array of two values.'); | ||
this.config.scale = { zoom: [0, this.config.scale] }; | ||
} | ||
if (Array.isArray(this.config.scale)) { | ||
this.config.scale = { zoom: this.config.scale }; | ||
} | ||
if (this.config.scale && Array.isArray(this.config.scale)) { | ||
this.config.scale = { zoom: this.config.scale }; | ||
} | ||
@@ -437,0 +430,0 @@ |
@@ -34,11 +34,2 @@ import { PSVError } from 'photo-sphere-viewer'; | ||
/** | ||
* @summary Loades nodes linked to another node | ||
* @param {string} nodeId | ||
* @return {Promise<void>} | ||
*/ | ||
loadLinkedNodes(nodeId) { // eslint-disable-line no-unused-vars | ||
throw new PSVError('loadLinkedNodes not implemented'); | ||
} | ||
} |
@@ -20,11 +20,2 @@ import { PSVError, utils } from 'photo-sphere-viewer'; | ||
loadLinkedNodes(nodeId) { | ||
if (!this.nodes[nodeId]) { | ||
return Promise.reject(new PSVError(`Node ${nodeId} not found`)); | ||
} | ||
else { | ||
return Promise.resolve(); | ||
} | ||
} | ||
setNodes(rawNodes) { | ||
@@ -46,3 +37,3 @@ if (!rawNodes?.length) { | ||
utils.logWarn(`Node ${node.id} has no links`); | ||
nodes.links = []; | ||
node.links = []; | ||
} | ||
@@ -55,4 +46,2 @@ | ||
node.links.forEach((link) => { | ||
checkLink(node, link, this.plugin.isGps()); | ||
if (!nodes[link.nodeId]) { | ||
@@ -66,2 +55,4 @@ throw new PSVError(`Target node ${link.nodeId} of node ${node.id} does not exists`); | ||
checkLink(node, link, this.plugin.isGps()); | ||
linkedNodes[link.nodeId] = true; | ||
@@ -68,0 +59,0 @@ }); |
@@ -5,3 +5,2 @@ import { ObjectLoader } from 'three'; | ||
import arrowOutlineGeometryJson from './arrow_outline.json'; | ||
import nodesList from './nodes-list.svg'; | ||
@@ -70,10 +69,2 @@ /** | ||
NODE_CHANGED : 'node-changed', | ||
/** | ||
* @event filter:render-nodes-list | ||
* @memberof PSV.plugins.VirtualTourPlugin | ||
* @summary Used to alter the list of nodes displayed on the side-panel | ||
* @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes | ||
* @returns {PSV.plugins.VirtualTourPlugin.Node[]} | ||
*/ | ||
RENDER_NODES_LIST: 'render-nodes-list', | ||
}; | ||
@@ -138,33 +129,1 @@ | ||
})(); | ||
/** | ||
* @summary Panel identifier for nodes list | ||
* @type {string} | ||
* @constant | ||
* @private | ||
*/ | ||
export const ID_PANEL_NODES_LIST = 'virtualTourNodesList'; | ||
/** | ||
* @summary Nodes list template | ||
* @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes | ||
* @param {string} title | ||
* @param {string} currentNodeId | ||
* @returns {string} | ||
* @constant | ||
* @private | ||
*/ | ||
export const NODES_LIST_TEMPLATE = (nodes, title, currentNodeId) => ` | ||
<div class="psv-panel-menu psv-panel-menu--stripped psv-virtual-tour__menu"> | ||
<h1 class="psv-panel-menu-title">${nodesList} ${title}</h1> | ||
<ul class="psv-panel-menu-list"> | ||
${nodes.map(node => ` | ||
<li data-node-id="${node.id}" tabindex="0" | ||
class="psv-panel-menu-item ${currentNodeId === node.id ? 'psv-panel-menu-item--active' : ''}"> | ||
${node.thumbnail ? `<span class="psv-panel-menu-item-icon"><img src="${node.thumbnail}"/></span>` : ''} | ||
<span class="psv-panel-menu-item-label">${node.caption || node.name}</span> | ||
</li> | ||
`).join('')} | ||
</ul> | ||
</div> | ||
`; |
@@ -11,3 +11,3 @@ import { | ||
} from 'three'; | ||
import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from '../..'; | ||
import { AbstractPlugin, CONSTANTS, PSVError, utils } from '../..'; | ||
import { ClientSideDatasource } from './ClientSideDatasource'; | ||
@@ -20,3 +20,2 @@ import { | ||
EVENTS, | ||
ID_PANEL_NODES_LIST, | ||
LINK_DATA, | ||
@@ -28,6 +27,4 @@ MODE_3D, | ||
MODE_MARKERS, | ||
MODE_SERVER, | ||
NODES_LIST_TEMPLATE | ||
MODE_SERVER | ||
} from './constants'; | ||
import { NodesListButton } from './NodesListButton'; | ||
import { ServerSideDatasource } from './ServerSideDatasource'; | ||
@@ -47,11 +44,2 @@ import './style.scss'; | ||
/** | ||
* @callback GetLinks | ||
* @summary Function to load the links of a node | ||
* @deprecated `getNode` must directly return the links of each node | ||
* @memberOf PSV.plugins.VirtualTourPlugin | ||
* @param {string} nodeId | ||
* @returns {PSV.plugins.VirtualTourPlugin.NodeLink[]|Promise<PSV.plugins.VirtualTourPlugin.NodeLink[]>} | ||
*/ | ||
/** | ||
* @callback Preload | ||
@@ -77,3 +65,3 @@ * @summary Function to determine if a link must be preloaded | ||
* @property {string} [description] - description visible in the side panel | ||
* @property {string} [thumbnail] - thumbnail for the nodes list in the side panel | ||
* @property {string} [thumbnail] - thumbnail for the gallery | ||
* @property {PSV.plugins.MarkersPlugin.Properties[]} [markers] - additional markers to use on this node | ||
@@ -108,3 +96,2 @@ */ | ||
* @property {PSV.plugins.VirtualTourPlugin.GetNode} [getNode] | ||
* @property {PSV.plugins.VirtualTourPlugin.GetLinks} [getLinks] - Deprecated: `getNode` must directly return the links of each node | ||
* @property {string} [startNodeId] - id of the initial node, if not defined the first node will be used | ||
@@ -129,7 +116,3 @@ * @property {boolean|PSV.plugins.VirtualTourPlugin.Preload} [preload=false] - preload linked panoramas | ||
// add markers buttons | ||
DEFAULTS.lang[NodesListButton.id] = 'Locations'; | ||
registerButton(NodesListButton, 'caption:left'); | ||
export { EVENTS, MODE_3D, MODE_CLIENT, MODE_GPS, MODE_MANUAL, MODE_MARKERS, MODE_SERVER } from './constants'; | ||
@@ -198,7 +181,7 @@ | ||
...options, | ||
markerStyle : { | ||
markerStyle: { | ||
...DEFAULT_MARKER, | ||
...options?.markerStyle, | ||
}, | ||
arrowStyle : { | ||
arrowStyle : { | ||
...DEFAULT_ARROW, | ||
@@ -209,10 +192,2 @@ ...options?.arrowStyle, | ||
if (options?.listButton === false) { | ||
utils.logWarn('VirtualTourPlugin: listButton option is deprecated. ' | ||
+ 'Please define the global navbar options according to your needs.'); | ||
} | ||
if (options?.listButton === true && this.config.dataMode === MODE_SERVER) { | ||
utils.logWarn('VirtualTourPlugin: the list button is not supported in server mode.'); | ||
} | ||
/** | ||
@@ -501,17 +476,14 @@ * @type {PSV.plugins.MarkersPlugin} | ||
return Promise.all([ | ||
this.psv.setPanorama(node.panorama, { | ||
transition : this.config.transition, | ||
caption : node.caption, | ||
description : node.description, | ||
panoData : node.panoData, | ||
sphereCorrection: node.sphereCorrection, | ||
}) | ||
.then((completed) => { | ||
if (!completed) { | ||
throw utils.getAbortError(); | ||
} | ||
}), | ||
this.datasource.loadLinkedNodes(nodeId), | ||
]); | ||
return this.psv.setPanorama(node.panorama, { | ||
transition : this.config.transition, | ||
caption : node.caption, | ||
description : node.description, | ||
panoData : node.panoData, | ||
sphereCorrection: node.sphereCorrection, | ||
}) | ||
.then((completed) => { | ||
if (!completed) { | ||
throw utils.getAbortError(); | ||
} | ||
}); | ||
}) | ||
@@ -758,49 +730,2 @@ .then(() => { | ||
/** | ||
* @summary Toggles the visibility of the list of nodes | ||
*/ | ||
toggleNodesList() { | ||
if (this.psv.panel.prop.contentId === ID_PANEL_NODES_LIST) { | ||
this.hideNodesList(); | ||
} | ||
else { | ||
this.showNodesList(); | ||
} | ||
} | ||
/** | ||
* @summary Opens side panel with the list of nodes | ||
*/ | ||
showNodesList() { | ||
utils.logWarn(`Starting from next version, the VirtualTourPlugin will require the GalleryPlugin to display the list of nodes.`); | ||
const nodes = this.change(EVENTS.RENDER_NODES_LIST, Object.values(this.datasource.nodes)); | ||
this.psv.panel.show({ | ||
id : ID_PANEL_NODES_LIST, | ||
content : NODES_LIST_TEMPLATE( | ||
nodes, | ||
this.psv.config.lang[NodesListButton.id], | ||
this.prop.currentNode?.id | ||
), | ||
noMargin : true, | ||
clickHandler: (e) => { | ||
const li = e.target ? utils.getClosest(e.target, 'li') : undefined; | ||
const nodeId = li ? li.dataset.nodeId : undefined; | ||
if (nodeId) { | ||
this.setCurrentNode(nodeId); | ||
this.hideNodesList(); | ||
} | ||
}, | ||
}); | ||
} | ||
/** | ||
* @summary Closes side panel if it contains the list of nodes | ||
*/ | ||
hideNodesList() { | ||
this.psv.panel.hide(ID_PANEL_NODES_LIST); | ||
} | ||
} |
@@ -19,3 +19,2 @@ import { PSVError, utils } from 'photo-sphere-viewer'; | ||
this.nodeResolver = plugin.config.getNode; | ||
this.linksResolver = plugin.config.getLinks; | ||
} | ||
@@ -31,31 +30,8 @@ | ||
checkNode(node, this.plugin.isGps()); | ||
this.nodes[nodeId] = node; | ||
return node; | ||
}); | ||
} | ||
} | ||
if (!node.links) { | ||
utils.logWarn(`Node ${node.id} has no links`); | ||
node.links = []; | ||
} | ||
loadLinkedNodes(nodeId) { | ||
if (!this.nodes[nodeId]) { | ||
return Promise.reject(new PSVError(`Node ${nodeId} not found`)); | ||
} | ||
else if (this.nodes[nodeId].links) { | ||
return Promise.resolve(); | ||
} | ||
else { | ||
if (!this.linksResolver) { | ||
this.nodes[nodeId].links = []; | ||
return Promise.resolve(); | ||
} | ||
utils.logWarn(`getLinks() option is deprecated, instead make getNode() also return the node' links.`); | ||
return Promise.resolve(this.linksResolver(nodeId)) | ||
.then(links => links || []) | ||
.then((links) => { | ||
const node = this.nodes[nodeId]; | ||
links.forEach((link) => { | ||
checkLink(node, link, this.plugin.isGps()); | ||
node.links.forEach((link) => { | ||
// copy essential data | ||
@@ -67,9 +43,7 @@ if (this.nodes[link.nodeId]) { | ||
if (this.plugin.isGps() && !link.position) { | ||
throw new PSVError(`No GPS position provided for link ${link.nodeId} of node ${node.id}`); | ||
} | ||
checkLink(node, link, this.plugin.isGps()); | ||
}); | ||
// store links | ||
node.links = links; | ||
this.nodes[nodeId] = node; | ||
return node; | ||
}); | ||
@@ -76,0 +50,0 @@ } |
@@ -35,2 +35,5 @@ import { PSVError, utils } from 'photo-sphere-viewer'; | ||
} | ||
if (isGps && !link.position) { | ||
throw new PSVError(`No GPS position provided for link ${link.nodeId} of node ${node.id}`); | ||
} | ||
} | ||
@@ -37,0 +40,0 @@ |
@@ -433,3 +433,2 @@ import { MathUtils, SplineCurve, Vector2 } from 'three'; | ||
else { | ||
evt.preventDefault(); | ||
this.__moveZoom(evt); | ||
@@ -761,2 +760,4 @@ this.__cancelTwoFingersOverlay(); | ||
if (this.state.step === MOVING) { | ||
evt.preventDefault(); | ||
const p1 = { x: evt.touches[0].clientX, y: evt.touches[0].clientY }; | ||
@@ -763,0 +764,0 @@ const p2 = { x: evt.touches[1].clientX, y: evt.touches[1].clientY }; |
import { Group, PerspectiveCamera, Raycaster, Scene, Vector3, WebGLRenderer } from 'three'; | ||
import { EVENTS, MESH_USER_DATA, SPHERE_RADIUS } from '../data/constants'; | ||
import { SYSTEM } from '../data/system'; | ||
import { each, isExtendedPosition } from '../utils'; | ||
import { Animation } from '../utils/Animation'; | ||
import { Animation, each, isExtendedPosition } from '../utils'; | ||
import { AbstractService } from './AbstractService'; | ||
@@ -303,3 +302,3 @@ | ||
* @param {PSV.PanoramaOptions} options | ||
* @returns {PSV.Animation} | ||
* @returns {PSV.utils.Animation} | ||
* @package | ||
@@ -306,0 +305,0 @@ */ |
@@ -41,15 +41,2 @@ import { FileLoader } from 'three'; | ||
/** | ||
* @summary Loads the panorama texture(s) | ||
* @param {*} panorama | ||
* @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData] | ||
* @returns {Promise.<PSV.TextureData>} | ||
* @throws {PSV.PSVError} when the image cannot be loaded | ||
* @package | ||
* @deprecated | ||
*/ | ||
loadTexture(panorama, newPanoData) { | ||
return this.psv.adapter.loadTexture(panorama, newPanoData); | ||
} | ||
/** | ||
* @summary Cancels current HTTP requests | ||
@@ -75,3 +62,3 @@ * @package | ||
let progress = 0; | ||
onProgress && onProgress(progress); | ||
onProgress?.(progress); | ||
@@ -82,3 +69,3 @@ this.loader.load( | ||
progress = 100; | ||
onProgress && onProgress(progress); | ||
onProgress?.(progress); | ||
resolve(result); | ||
@@ -91,3 +78,3 @@ }, | ||
progress = newProgress; | ||
onProgress && onProgress(progress); | ||
onProgress?.(progress); | ||
} | ||
@@ -94,0 +81,0 @@ } |
@@ -18,3 +18,3 @@ import { Tooltip } from '../components/Tooltip'; | ||
const testTooltip = new Tooltip(this.psv); | ||
const testTooltip = new Tooltip(this.psv, { arrow: 0, border: 0 }); | ||
@@ -25,8 +25,8 @@ /** | ||
* @package | ||
* @property {number} arrowSize | ||
* @property {number} offset | ||
* @property {number} arrow | ||
* @property {number} border | ||
*/ | ||
this.size = { | ||
arrow : parseInt(getStyle(testTooltip.arrow, 'borderTopWidth'), 10), | ||
offset: parseInt(getStyle(testTooltip.container, 'outlineWidth'), 10), | ||
border: parseInt(getStyle(testTooltip.container, 'borderTopLeftRadius'), 10), | ||
}; | ||
@@ -33,0 +33,0 @@ |
@@ -155,3 +155,3 @@ import { LinearFilter, MathUtils, Quaternion, Texture } from 'three'; | ||
*/ | ||
const LEFT_MAP = { 0: 'left', 0.5: 'center', 1: 'right' }; | ||
const X_VALUES = ['left', 'center', 'right']; | ||
/** | ||
@@ -161,3 +161,13 @@ * @readonly | ||
*/ | ||
const TOP_MAP = { 0: 'top', 0.5: 'center', 1: 'bottom' }; | ||
const Y_VALUES = ['top', 'center', 'bottom']; | ||
/** | ||
* @readonly | ||
* @private | ||
*/ | ||
const POS_VALUES = [...X_VALUES, ...Y_VALUES]; | ||
/** | ||
* @readonly | ||
* @private | ||
*/ | ||
const CENTER = 'center'; | ||
@@ -168,20 +178,48 @@ /** | ||
* @param {string | string[]} value | ||
* @param {boolean} [allowCenter=true] | ||
* @param {object} [options] | ||
* @param {boolean} [options.allowCenter=true] allow "center center" | ||
* @param {boolean} [options.cssOrder=true] force CSS order (y axis then x axis) | ||
* @return {string[]} | ||
*/ | ||
export function cleanPosition(value, allowCenter = true) { | ||
export function cleanPosition(value, { allowCenter, cssOrder } = { allowCenter: true, cssOrder: true }) { | ||
if (!value) { | ||
return null; | ||
} | ||
if (typeof value === 'string') { | ||
const tempPos = parsePosition(value); | ||
value = value.split(' '); | ||
} | ||
if (!(tempPos.x in LEFT_MAP) || !(tempPos.y in TOP_MAP)) { | ||
throw new PSVError(`Unable to parse position "${value}"`); | ||
if (value.length === 1) { | ||
if (value[0] === CENTER) { | ||
value = [CENTER, CENTER]; | ||
} | ||
else if (X_VALUES.indexOf(value[0]) !== -1) { | ||
value = [CENTER, value[0]]; | ||
} | ||
else if (Y_VALUES.indexOf(value[0]) !== -1) { | ||
value = [value[0], CENTER]; | ||
} | ||
} | ||
value = [TOP_MAP[tempPos.y], LEFT_MAP[tempPos.x]]; | ||
if (value.length !== 2 || POS_VALUES.indexOf(value[0]) === -1 || POS_VALUES.indexOf(value[1]) === -1) { | ||
logWarn(`Unparsable position ${value}`); | ||
return null; | ||
} | ||
if (!allowCenter && value[0] === 'center' && value[1] === 'center') { | ||
throw new PSVError('Unable to parse position "center center"'); | ||
if (!allowCenter && value[0] === CENTER && value[1] === CENTER) { | ||
logWarn(`Invalid position center center`); | ||
return null; | ||
} | ||
if (cssOrder && !positionIsOrdered(value)) { | ||
value = [value[1], value[0]]; | ||
} | ||
if (value[1] === CENTER && X_VALUES.indexOf(value[0]) !== -1) { | ||
value = [CENTER, value[0]]; | ||
} | ||
if (value[0] === CENTER && Y_VALUES.indexOf(value[1]) !== -1) { | ||
value = [value[1], CENTER]; | ||
} | ||
return value; | ||
@@ -191,2 +229,11 @@ } | ||
/** | ||
* @summary Checks if an array of two positions is ordered (y axis then x axis) | ||
* @param {string[]} value | ||
* @return {boolean} | ||
*/ | ||
export function positionIsOrdered(value) { | ||
return Y_VALUES.indexOf(value[0]) !== -1 && X_VALUES.indexOf(value[1]) !== -1; | ||
} | ||
/** | ||
* @summary Parses an speed | ||
@@ -193,0 +240,0 @@ * @memberOf PSV.utils |
import assert from 'assert'; | ||
import { parseAngle, parsePosition, parseSpeed, getXMPValue, cleanPosition } from './psv'; | ||
import { cleanPosition, getXMPValue, parseAngle, parsePosition, parseSpeed } from './psv'; | ||
@@ -323,18 +323,32 @@ describe('utils:psv:parseAngle', () => { | ||
assert.deepStrictEqual(cleanPosition('right top'), ['top', 'right']); | ||
assert.deepStrictEqual(cleanPosition(['top', 'right']), ['top', 'right']); | ||
}); | ||
it('should add missing center', () => { | ||
assert.deepStrictEqual(cleanPosition('top'), ['top', 'center']); | ||
assert.deepStrictEqual(cleanPosition('left'), ['center', 'left']); | ||
assert.deepStrictEqual(cleanPosition(['top', 'right']), ['top', 'right']); | ||
assert.deepStrictEqual(cleanPosition('center'), ['center', 'center']); | ||
}); | ||
it('should dissallow center', () => { | ||
assert.deepStrictEqual(cleanPosition('top center', false), ['top', 'center']); | ||
it('should dissallow all center', () => { | ||
assert.strictEqual(cleanPosition('center center', { allowCenter: false }), null); | ||
assert.strictEqual(cleanPosition('center', { allowCenter: false }), null); | ||
}); | ||
assert.throws(() => { | ||
cleanPosition('center center', false); | ||
}); | ||
it('should return null on unparsable values', () => { | ||
assert.strictEqual(cleanPosition('foo bar'), null); | ||
assert.strictEqual(cleanPosition('TOP CENTER'), null); | ||
assert.strictEqual(cleanPosition(''), null); | ||
assert.strictEqual(cleanPosition(undefined), null); | ||
}); | ||
it('should not fail on unparsable values', () => { | ||
assert.deepStrictEqual(cleanPosition('foo bar'), ['center', 'center']); | ||
it('should allow XY order', () => { | ||
assert.deepStrictEqual(cleanPosition('right top', { cssOrder: false }), ['right', 'top']); | ||
assert.deepStrictEqual(cleanPosition(['top', 'right'], { cssOrder: false }), ['top', 'right']); | ||
}); | ||
it('should always order with center', () => { | ||
assert.deepStrictEqual(cleanPosition('center top'), ['top', 'center']); | ||
assert.deepStrictEqual(cleanPosition('left center'), ['center', 'left']); | ||
}); | ||
}); |
@@ -80,3 +80,3 @@ import { Cache, MathUtils, Vector3 } from 'three'; | ||
* @property {boolean} autorotateEnabled - automatic rotation is enabled | ||
* @property {PSV.Animation} animationPromise - promise of the current animation | ||
* @property {PSV.utils.Animation} animationPromise - promise of the current animation | ||
* @property {Promise} loadingPromise - promise of the setPanorama method | ||
@@ -830,3 +830,3 @@ * @property {boolean} littlePlanet - special tweaks for LittlePlanetAdapter | ||
* @param {PSV.AnimateOptions} options - position and/or zoom level | ||
* @returns {PSV.Animation} | ||
* @returns {PSV.utils.Animation} | ||
*/ | ||
@@ -837,3 +837,3 @@ animate(options) { | ||
const positionProvided = isExtendedPosition(options); | ||
const zoomProvided = 'zoom' in options; | ||
const zoomProvided = options.zoom !== undefined; | ||
@@ -840,0 +840,0 @@ const animProperties = {}; |
@@ -23,3 +23,3 @@ import { Viewer } from '../Viewer'; | ||
*/ | ||
toggle(); | ||
toggle(visible?: boolean); | ||
@@ -26,0 +26,0 @@ /** |
@@ -22,7 +22,3 @@ import * as CONSTANTS from './data/constants'; | ||
export * from './services/TooltipRenderer'; | ||
/** | ||
* @deprecated use `utils.Animation` | ||
*/ | ||
export * from './utils/Animation'; | ||
export * from './Viewer'; | ||
export { CONSTANTS, utils }; |
@@ -1,2 +0,2 @@ | ||
import { AbstractPlugin, Animation, ExtendedPosition, Viewer } from '../..'; | ||
import { AbstractPlugin, ExtendedPosition, utils, Viewer } from '../..'; | ||
import { Event } from 'uevent'; | ||
@@ -39,3 +39,3 @@ | ||
orientation?: 'front' | 'horizontal' | 'vertical-left' | 'vertical-right'; | ||
scale?: number | [number, number] | { zoom?: [number, number], longitude?: [number, number] }; | ||
scale?: [number, number] | { zoom?: [number, number], longitude?: [number, number] }; | ||
opacity?: number; | ||
@@ -46,5 +46,7 @@ className?: string; | ||
anchor?: string; | ||
zoomLvl?: number; | ||
visible?: boolean; | ||
tooltip?: string | { content: string, position?: string, className?: string, trigger?: 'hover' | 'click' }; | ||
content?: string; | ||
listContent?: string; | ||
hideList?: boolean; | ||
@@ -217,3 +219,3 @@ data?: any; | ||
*/ | ||
gotoMarker(markerId: string, speed: string | number): Animation<any>; | ||
gotoMarker(markerId: string, speed: string | number): utils.Animation<any>; | ||
@@ -220,0 +222,0 @@ /** |
@@ -39,6 +39,2 @@ import { Event } from 'uevent'; | ||
outlineColor?: number; | ||
/** | ||
* @deprecated | ||
*/ | ||
opacity?: number; | ||
scale?: [number, number]; | ||
@@ -67,6 +63,2 @@ }; | ||
getNode?: (nodeId: string) => VirtualTourNode | Promise<VirtualTourNode>; | ||
/** | ||
* @deprecated | ||
*/ | ||
getLinks?: (nodeId: string) => VirtualTourNodeLink[] | Promise<VirtualTourNodeLink[]>; | ||
startNodeId?: string; | ||
@@ -89,3 +81,2 @@ preload?: boolean | ((node: VirtualTourNode, link: VirtualTourNodeLink) => boolean); | ||
NODE_CHANGED: 'node-changed', | ||
RENDER_NODES_LIST: 'render-nodes-list', | ||
}; | ||
@@ -127,17 +118,2 @@ | ||
/** | ||
* @summary Toggles the visibility of the list of nodes | ||
*/ | ||
toggleNodesList(); | ||
/** | ||
* @summary Opens side panel with the list of nodes | ||
*/ | ||
showNodesList(); | ||
/** | ||
* @summary Closes side panel if it contains the list of nodes | ||
*/ | ||
hideNodesList(); | ||
/** | ||
* @summary Triggered when the current node changes | ||
@@ -144,0 +120,0 @@ */ |
@@ -28,7 +28,4 @@ import { Euler, Texture, Vector3 } from 'three'; | ||
* @summary Parse a CSS-like position into an array of position keywords among top, bottom, left, right and center | ||
* @param {string | string[]} value | ||
* @param {string} defaultValue | ||
* @param {boolean} [allowCenter=true] | ||
*/ | ||
export function cleanPosition(value: string | string[], defaultValue: string, allowCenter?): string[]; | ||
export function cleanPosition(value: string | string[], options?: { allowCenter: boolean, cssOrder: boolean }): string[]; | ||
@@ -35,0 +32,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2553191
271
41298
+ Addedthree@0.146.0(transitive)
- Removedthree@0.144.0(transitive)
Updatedthree@^0.146.0