shop-components 0.4.7 → 0.4.9

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.
@@ -10374,7 +10374,7 @@ class Ac extends Bt {
10374
10374
  return Promise.reject(new Error(`Action "${e}" not found or mixer not initialized.`));
10375
10375
  if (s.isRunning() && s === this._currentAction)
10376
10376
  return Promise.resolve();
10377
- const a = this._currentAction, n = a === s, c = n ? 0 : (t == null ? void 0 : t.fadeIn) ?? (t == null ? void 0 : t.fadeOut) ?? 0.3, u = a && !n && a.isRunning();
10377
+ const a = this._currentAction, n = a === s, c = n ? 0 : t != null && t.fadeIn ? t == null ? void 0 : t.fadeIn : 0.5, u = a && !n && a.isRunning();
10378
10378
  this._actionsMap.forEach((r) => {
10379
10379
  r !== s && r !== a && (r.stopFading(), r.setEffectiveWeight(0), r.stop());
10380
10380
  });
@@ -12734,8 +12734,11 @@ class nn extends k.ShaderMaterial {
12734
12734
  vertexShader: (
12735
12735
  /* glsl */
12736
12736
  `
12737
+ #include <morphtarget_pars_vertex>
12737
12738
  void main() {
12738
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
12739
+ vec3 transformed = position;
12740
+ #include <morphtarget_vertex>
12741
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( transformed, 1.0 );
12739
12742
  }
12740
12743
  `
12741
12744
  ),
@@ -12748,7 +12751,7 @@ class nn extends k.ShaderMaterial {
12748
12751
  }
12749
12752
  `
12750
12753
  )
12751
- });
12754
+ }), this.morphTargets = !0;
12752
12755
  }
12753
12756
  }
12754
12757
  class Fu extends k.ShaderMaterial {
@@ -12932,7 +12935,10 @@ class Bu {
12932
12935
  inside: !1,
12933
12936
  thickness: 30,
12934
12937
  color: new k.Color("#e91e63")
12935
- }, this._selectionLayer = 31, this._box = new k.Box3(), this._sphere = new k.Sphere(), this.renderer = e, this.scene = t, this.camera = i, (s == null ? void 0 : s.inside) !== void 0 && (this.params.inside = s.inside), (s == null ? void 0 : s.thickness) !== void 0 && (this.params.thickness = s.thickness), (s == null ? void 0 : s.color) !== void 0 && (this.params.color = new k.Color(s.color)), this.seedMaterial = new nn(), this.seedMaterial.side = k.DoubleSide, this.seedModelMaterial = new nn(), this.seedModelMaterial.side = k.DoubleSide, this.maskMaterial = new k.MeshBasicMaterial({ color: 16777215, side: k.DoubleSide }), this.targets = [
12938
+ }, this._selectionLayer = 31, this._box = new k.Box3(), this._sphere = new k.Sphere(), this.renderer = e, this.scene = t, this.camera = i, (s == null ? void 0 : s.inside) !== void 0 && (this.params.inside = s.inside), (s == null ? void 0 : s.thickness) !== void 0 && (this.params.thickness = s.thickness), (s == null ? void 0 : s.color) !== void 0 && (this.params.color = new k.Color(s.color)), this.seedMaterial = new nn(), this.seedMaterial.side = k.DoubleSide, this.seedModelMaterial = new nn(), this.seedModelMaterial.side = k.DoubleSide, this.maskMaterial = new k.MeshBasicMaterial({
12939
+ color: 16777215,
12940
+ side: k.DoubleSide
12941
+ }), this.maskMaterial.morphTargets = !0, this.targets = [
12936
12942
  new k.WebGLRenderTarget(1, 1, {
12937
12943
  format: k.RGBAFormat,
12938
12944
  type: k.FloatType,
@@ -13336,29 +13342,31 @@ class Lh {
13336
13342
  c.style.display = "flex", this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.flexGrow = "1";
13337
13343
  const u = c.clientWidth, f = c.clientHeight;
13338
13344
  this.size.set(u, f), this.camera.aspect = u / f, this.camera.updateProjectionMatrix(), this._amrRender.setSize(u, f), this._updateCamera(), this.css2dRenderer.setSize(u, f), this.renderer.getPixelRatio(), (d = this.pathTracer) == null || d.updateCamera(), this.sampleCount = 0, this.renderer.setSize(u, f), (r = this._jumpFlood) == null || r.setSize(u, f);
13339
- }, this.ticker = () => {
13345
+ }, this.ticker = (c) => {
13340
13346
  if (!this._destroyed) {
13341
- if (this.stats.begin(), this.renderer.domElement.dispatchEvent(new CustomEvent("ticker")), this._rafId = requestAnimationFrame(this.ticker), this.renderer.clear(), this.usePathTracing) {
13347
+ if (this.stats.begin(), this.renderer.domElement.dispatchEvent(new CustomEvent("ticker", {
13348
+ detail: c
13349
+ })), this._rafId = requestAnimationFrame(this.ticker), this.renderer.clear(), this.usePathTracing) {
13342
13350
  this.hideAmrUI(), this.sampleCount < this.maxSample ? this.sampleCount++ : this.pathTracer.pausePathTracing = !0, this.pathTracer.renderSample();
13343
- const c = this.renderer.autoClear;
13344
- this.renderer.autoClear = !1, this.scene.overrideMaterial = Nu, this.renderer.clearDepth(), this.renderer.render(this.scene, this.mainCamera), this.scene.overrideMaterial = null, this.renderer.render(this.overlayScene, this.mainCamera), this.renderer.autoClear = c;
13351
+ const u = this.renderer.autoClear;
13352
+ this.renderer.autoClear = !1, this.scene.overrideMaterial = Nu, this.renderer.clearDepth(), this.renderer.render(this.scene, this.mainCamera), this.scene.overrideMaterial = null, this.renderer.render(this.overlayScene, this.mainCamera), this.renderer.autoClear = u;
13345
13353
  } else {
13346
- this._clock.getElapsedTime() - this._uiHiddenTime > 0.15 ? this.showControls && this.amr.controllers.forEach((f) => f.show()) : this.amr.controllers.forEach((f) => f.hide());
13347
- const u = this.stats.fps();
13348
- if (this.usePathTracing || (this._fpsCache.length > this._fpsCacheMax && this._fpsCache.shift(), this._fpsCache.push(u)), this.amr.slots.forEach((f) => {
13349
- this._dragging ? f.getCanInstall() && f.render(this) : f.render(this);
13354
+ this._clock.getElapsedTime() - this._uiHiddenTime > 0.15 ? this.showControls && this.amr.controllers.forEach((d) => d.show()) : this.amr.controllers.forEach((d) => d.hide());
13355
+ const f = this.stats.fps();
13356
+ if (this.usePathTracing || (this._fpsCache.length > this._fpsCacheMax && this._fpsCache.shift(), this._fpsCache.push(f)), this.amr.slots.forEach((d) => {
13357
+ this._dragging ? d.getCanInstall() && d.render(this) : d.render(this);
13350
13358
  }), Je.update(), this.controls.update(), this._progressShadow.update(this.mainCamera), this.css2dRenderer.render(this.scene, this.mainCamera), this.updatePosition(), this.scene.overrideMaterial = null, this.renderer.render(this.scene, this.mainCamera), this._jumpFlood && this._selectedForOutline.length > 0) {
13351
- const f = this.scene.background;
13352
- this.scene.background = null, this._jumpFlood.render(this._selectedForOutline), this.scene.background = f;
13359
+ const d = this.scene.background;
13360
+ this.scene.background = null, this._jumpFlood.render(this._selectedForOutline), this.scene.background = d;
13353
13361
  }
13354
13362
  }
13355
13363
  this.stats.end();
13356
13364
  }
13357
13365
  }, this.stats.showPanel(0), this.hideState(), e.fov && (this.camera.fov = e.fov, this.camera.updateProjectionMatrix()), Rn(Ft, this.renderer), this._ground.visible = !1, this.controls = new yo(this.camera, this.renderer.domElement), this.controls.enablePan = !0, this.controls.rotateSpeed = this.props.isMobile ? 0.6 : 0.5, this.controls.dampingFactor = an, this.controls.enableDamping = !0, this.controls.maxDistance = 10, this.controls.minDistance = 1, this.controls.zoomSpeed = this.props.isMobile ? 0.3 : ec() ? 0.2 : 1, this._cameraPositionUI = new Eu(this.controls), this.renderer.setPixelRatio(window.devicePixelRatio || 1), this.renderer.autoClear = !0, this.renderer.toneMapping = vo, this.renderer.toneMappingExposure = 1.4, this.renderer.outputColorSpace = Bi, this.renderer.localClippingEnabled = !0, this.renderer.shadowMap.enabled = !0, this.css2dRenderer.domElement.style.pointerEvents = "none", this.css2dRenderer.domElement.style.position = "absolute", this.css2dRenderer.domElement.style.top = "0px", this.camera.position.set(10, -10, 5), this.camera.lookAt(new b());
13358
13366
  const { tiles: t } = rc();
13359
- this.pathTracer = new _l(this.renderer), this.pathTracer.filterGlossyFactor = 0.6;
13367
+ this.pathTracer = new _l(this.renderer), this.pathTracer.multipleImportanceSampling = !0, this.pathTracer.filterGlossyFactor = 0.6;
13360
13368
  let i = window.devicePixelRatio;
13361
- i < 2 && (i = 2), this.pathTracer.renderScale = this.props.isMobile ? 1 : i, this.pathTracer.bounces = this.props.isMobile ? 8 : 10, this.pathTracer.transmissiveBounces = this.props.isMobile ? 1 : 3, this.pathTracer.tiles.set(t, t), this.pathTracer.fadeDuration = 0;
13369
+ i < 2 && (i = 2), this.pathTracer.renderScale = this.props.isMobile ? 1 : i, this.pathTracer.bounces = this.props.isMobile ? 8 : 10, this.pathTracer.transmissiveBounces = this.props.isMobile ? 1 : 3, this.pathTracer.tiles.set(t, t), this.pathTracer.minSamples = 10, this.pathTracer.dynamicLowRes = !0, this.pathTracer.lowResScale = 0.5, this.pathTracer.fadeDuration = 0;
13362
13370
  const s = new Cu(e.workerUrl), a = typeof navigator < "u" ? navigator.hardwareConcurrency : 4;
13363
13371
  s.maxWorkerCount = a, this.pathTracer.setBVHWorker(s), this.orthographicCamera.left = -20, this.orthographicCamera.right = 20, this.orthographicCamera.top = -20, this.orthographicCamera.bottom = 20, this._lastTarget = this.controls.target.clone();
13364
13372
  const n = () => {
@@ -13806,7 +13814,7 @@ class Gu {
13806
13814
  return this.canvas || (this.canvas = document.createElement("canvas")), (this.canvas.width !== e || this.canvas.height !== t) && (this.canvas.width = e, this.canvas.height = t), this.canvas;
13807
13815
  }
13808
13816
  }
13809
- const qu = "shop-components", ju = "0.4.7", Qu = "Shop components", Yu = "dist/shop-components.umd.js", Zu = "dist/shop-components.mjs", Xu = "dist/main.d.ts", Ku = {
13817
+ const qu = "shop-components", ju = "0.4.8", Qu = "Shop components", Yu = "dist/shop-components.umd.js", Zu = "dist/shop-components.mjs", Xu = "dist/main.d.ts", Ku = {
13810
13818
  dts: "tsc --emitDeclarationOnly & tsc & storybook build -o dist",
13811
13819
  dev: "vite dev",
13812
13820
  build: "vite build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shop-components",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "description": "Shop components",
5
5
  "main": "dist/shop-components.umd.js",
6
6
  "module": "dist/shop-components.mjs",