@splnlss/3d-story-viewer 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,14 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
4
+ };
2
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
6
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- var _a2;
7
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
8
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
9
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
+ var _a2, _destinationTileTimeout;
5
12
  import { S as ShaderChunk, M as Matrix4, V as Vector3, O as Object3D, a as Vector2, b as Mesh, P as PlaneGeometry, c as ShaderMaterial, R as Ray, E as EventDispatcher$1, d as Plane, e as Raycaster, C as Clock, Q as Quaternion, f as MathUtils, T as TrianglesDrawMode, g as TriangleFanDrawMode, h as TriangleStripDrawMode, L as Loader, i as LoaderUtils, F as FileLoader, j as MeshPhysicalMaterial, k as Color, l as LinearSRGBColorSpace, m as SRGBColorSpace, n as SpotLight, o as PointLight, D as DirectionalLight, I as InstancedMesh, p as InstancedBufferAttribute, B as BufferGeometry, q as TextureLoader, r as ImageBitmapLoader, s as BufferAttribute, t as InterleavedBuffer, u as LinearMipmapLinearFilter, N as NearestMipmapLinearFilter, v as LinearMipmapNearestFilter, w as NearestMipmapNearestFilter, x as LinearFilter, y as NearestFilter, z as RepeatWrapping, A as MirroredRepeatWrapping, G as ClampToEdgeWrapping, H as PointsMaterial, J as Material, K as LineBasicMaterial, U as MeshStandardMaterial, W as DoubleSide, X as MeshBasicMaterial, Y as PropertyBinding, Z as SkinnedMesh, _ as LineSegments, $ as Line, a0 as LineLoop, a1 as Points, a2 as Group$1, a3 as PerspectiveCamera, a4 as OrthographicCamera, a5 as Skeleton, a6 as AnimationClip, a7 as Bone, a8 as InterpolateDiscrete, a9 as InterpolateLinear, aa as InterleavedBufferAttribute, ab as Texture, ac as VectorKeyframeTrack, ad as NumberKeyframeTrack, ae as QuaternionKeyframeTrack, af as ColorManagement, ag as FrontSide, ah as Interpolant, ai as Box3, aj as Sphere, ak as Euler, al as Spherical, am as LoadingManager, an as Frustum, ao as DefaultLoadingManager, ap as Matrix3, aq as TextureUtils, ar as CompressedCubeTexture, as as CompressedArrayTexture, at as CompressedTexture, au as NoColorSpace, av as RGBA_PVRTC_2BPPV1_Format, aw as RGBA_PVRTC_4BPPV1_Format, ax as RGBA_BPTC_Format, ay as RED_GREEN_RGTC2_Format, az as SIGNED_RED_GREEN_RGTC2_Format, aA as RED_RGTC1_Format, aB as SIGNED_RED_RGTC1_Format, aC as RGBA_S3TC_DXT5_Format, aD as RGB_S3TC_DXT1_Format, aE as RGBA_S3TC_DXT1_Format, aF as RGBA_ASTC_6x6_Format, aG as RGBA_ASTC_4x4_Format, aH as SIGNED_RG11_EAC_Format, aI as RG11_EAC_Format, aJ as SIGNED_R11_EAC_Format, aK as R11_EAC_Format, aL as RGB_ETC2_Format, aM as RGBA_ETC2_EAC_Format, aN as RGBFormat, aO as RedFormat, aP as RGFormat, aQ as RGBAFormat, aR as UnsignedByteType, aS as HalfFloatType, aT as UnsignedInt101111Type, aU as UnsignedInt5999Type, aV as UnsignedShortType, aW as FloatType, aX as DataTexture, aY as Data3DTexture, aZ as RGB_PVRTC_4BPPV1_Format, a_ as RGB_ETC1_Format, a$ as RGB_BPTC_UNSIGNED_Format, b0 as REVISION, b1 as TextureSource, b2 as ImageUtils, b3 as Scene, b4 as ecefToGeodeticPosition, b5 as getEnuBasis, b6 as Float32BufferAttribute, b7 as LinearMipMapLinearFilter, b8 as Triangle, b9 as CanvasTexture, ba as WebGLRenderer, bb as WebGLRenderTarget, bc as OneFactor, bd as ZeroFactor, be as CustomBlending, bf as Box2, bg as Matrix2, bh as Vector4, bi as validateGeodeticPosition, bj as validateRotation, bk as geodeticToEcefPosition, bl as DataTextureLoader, bm as DataUtils, bn as BackSide, bo as BoxGeometry, bp as normalizeLayerOffset, bq as geodeticOffsetToEcefDelta, br as validateTuple, bs as validateScale, bt as enuToEcefDelta, bu as RingGeometry, bv as AgXToneMapping, bw as EquirectangularReflectionMapping, bx as requireFiniteNumber } from "./index-a8PLKOvo.js";
6
13
  var bayer_dither_hash_pars_default$1 = "#ifdef USE_HASH\nuniform float hashOpacity;varying float vCameraDistance;float bayerDitherPattern(vec2 p){float bayerMatrix[16];bayerMatrix[0]=0.0;bayerMatrix[1]=8.0;bayerMatrix[2]=2.0;bayerMatrix[3]=10.0;bayerMatrix[4]=12.0;bayerMatrix[5]=4.0;bayerMatrix[6]=14.0;bayerMatrix[7]=6.0;bayerMatrix[8]=3.0;bayerMatrix[9]=11.0;bayerMatrix[10]=1.0;bayerMatrix[11]=9.0;bayerMatrix[12]=15.0;bayerMatrix[13]=7.0;bayerMatrix[14]=13.0;bayerMatrix[15]=5.0;int x=int(mod(p.x,4.0));int y=int(mod(p.y,4.0));int index=x+y*4;return bayerMatrix[index]/16.0;}\n#endif\n";
7
14
  var bayer_dither_hash_default$1 = "#ifdef USE_HASH\nfloat hashAmount=smoothstep(5e4,1e2,vCameraDistance)*0.75+0.1;float ditherValue=bayerDitherPattern(gl_FragCoord.xy);if(hashAmount<ditherValue){discard;}\n#endif\n";
@@ -156,7 +163,7 @@ class CSS2DRenderer {
156
163
  }
157
164
  let sparkPromise = null;
158
165
  function loadSpark() {
159
- sparkPromise ?? (sparkPromise = import("./spark.module-CHPihKhu.js").catch((error) => {
166
+ sparkPromise ?? (sparkPromise = import("./spark.module-OeW1hboi.js").catch((error) => {
160
167
  sparkPromise = null;
161
168
  throw error;
162
169
  }));
@@ -6177,7 +6184,7 @@ class GlobeControls extends EnvironmentControls {
6177
6184
  }
6178
6185
  }
6179
6186
  _updateRotation(...args) {
6180
- if (this._rotationMode === 1 || this._isNearControls()) {
6187
+ if (this._rotationMode === 1 || this._isNearControls() || this.rotationSpeed !== 0 && this.pointerTracker.getPointerType() === "mouse" && this.pointerTracker.isRightClicked()) {
6181
6188
  this._rotationMode = 1;
6182
6189
  super._updateRotation(...args);
6183
6190
  } else {
@@ -13195,13 +13202,13 @@ function applyGrayscale(material) {
13195
13202
  class GlobeManager extends EventDispatcher {
13196
13203
  constructor(scene, camera, renderer, options = {}) {
13197
13204
  super();
13205
+ __privateAdd(this, _destinationTileTimeout, null);
13198
13206
  this.scene = scene;
13199
13207
  this.camera = camera;
13200
13208
  this.renderer = renderer;
13201
13209
  this.tiles = null;
13202
13210
  this.destinationTileCamera = null;
13203
13211
  this.destinationTileResolution = 0;
13204
- this.destinationTileTimeout = null;
13205
13212
  this.previousAutoDisableRendererCulling = null;
13206
13213
  this.dracoLoader = null;
13207
13214
  this.ownsDecoders = !options.decoders;
@@ -13275,7 +13282,7 @@ class GlobeManager extends EventDispatcher {
13275
13282
  this.destinationTileResolution = target.resolutionPixels;
13276
13283
  this.tiles.setCamera(camera);
13277
13284
  this.updateDestinationTileResolution();
13278
- this.destinationTileTimeout = setTimeout(() => this.clearDestinationTilePrefetch(), 12e3);
13285
+ __privateSet(this, _destinationTileTimeout, setTimeout(() => this.clearDestinationTilePrefetch(), 12e3));
13279
13286
  }
13280
13287
  updateDestinationTileResolution() {
13281
13288
  var _a3, _b2;
@@ -13287,8 +13294,8 @@ class GlobeManager extends EventDispatcher {
13287
13294
  this.tiles.setResolution(this.destinationTileCamera, pixels, pixels);
13288
13295
  }
13289
13296
  clearDestinationTilePrefetch() {
13290
- if (this.destinationTileTimeout !== null) clearTimeout(this.destinationTileTimeout);
13291
- this.destinationTileTimeout = null;
13297
+ if (__privateGet(this, _destinationTileTimeout) !== null) clearTimeout(__privateGet(this, _destinationTileTimeout));
13298
+ __privateSet(this, _destinationTileTimeout, null);
13292
13299
  if (this.destinationTileCamera && this.tiles) {
13293
13300
  this.tiles.deleteCamera(this.destinationTileCamera);
13294
13301
  this.tiles.autoDisableRendererCulling = this.previousAutoDisableRendererCulling;
@@ -13315,6 +13322,7 @@ class GlobeManager extends EventDispatcher {
13315
13322
  this.listeners = {};
13316
13323
  }
13317
13324
  }
13325
+ _destinationTileTimeout = new WeakMap();
13318
13326
  var Easing = Object.freeze({
13319
13327
  Linear: Object.freeze({
13320
13328
  None: function(amount) {