shop-components 0.1.51 → 0.1.52
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.
- package/dist/shop-components.mjs +46 -44
- package/dist/shop-components.umd.js +2 -2
- package/package.json +1 -1
package/dist/shop-components.mjs
CHANGED
|
@@ -62580,7 +62580,7 @@ class vK extends Ie {
|
|
|
62580
62580
|
));
|
|
62581
62581
|
}
|
|
62582
62582
|
setShapeKey(A, e) {
|
|
62583
|
-
this._shapeKeyTimer && clearTimeout(this._shapeKeyTimer), this._shapeKeyTimer = setTimeout(() => {
|
|
62583
|
+
this._shapeKeyTimer && clearTimeout(this._shapeKeyTimer), this._shapeKeyTimer = window.setTimeout(() => {
|
|
62584
62584
|
this._container.traverse((t) => {
|
|
62585
62585
|
if (!Object.keys(t.morphTargetDictionary || {}).includes(A))
|
|
62586
62586
|
return;
|
|
@@ -65080,66 +65080,66 @@ class cH {
|
|
|
65080
65080
|
metalness: 0.6,
|
|
65081
65081
|
roughness: 0.3
|
|
65082
65082
|
})
|
|
65083
|
-
), this.addEventListener = this._emitter.on.bind(this._emitter), this.removeEventListener = this._emitter.on.bind(this._emitter), this._drag = (
|
|
65084
|
-
this._dragging = !0, this._pointermove(
|
|
65085
|
-
}, this._dragend = (
|
|
65083
|
+
), this.addEventListener = this._emitter.on.bind(this._emitter), this.removeEventListener = this._emitter.on.bind(this._emitter), this._drag = (i) => {
|
|
65084
|
+
this._dragging = !0, this._pointermove(i);
|
|
65085
|
+
}, this._dragend = (i) => {
|
|
65086
65086
|
this._dragging = !1;
|
|
65087
|
-
}, this._pointermove = (
|
|
65087
|
+
}, this._pointermove = (i) => {
|
|
65088
65088
|
if (this._pointerDownTimeout)
|
|
65089
65089
|
return clearTimeout(this._pointerDownTimeout), this._pointerDownTimeout = 0;
|
|
65090
|
-
const { top:
|
|
65091
|
-
this.offset.set(
|
|
65092
|
-
(
|
|
65093
|
-
-((
|
|
65090
|
+
const { top: r, left: s } = this.renderer.domElement.getBoundingClientRect();
|
|
65091
|
+
this.offset.set(s, r), this.mousePos.set(i.clientX - s, i.clientY - r), this.mouseCoord.set(
|
|
65092
|
+
(i.clientX - s) / this.size.x * 2 - 1,
|
|
65093
|
+
-((i.clientY - r) / this.size.y) * 2 + 1
|
|
65094
65094
|
), this._raycaster.setFromCamera(this.mouseCoord, this.camera);
|
|
65095
|
-
}, this._pointerdown = (
|
|
65096
|
-
const
|
|
65097
|
-
let
|
|
65098
|
-
this._outlinePass.selectedObjects = [], this.amr.slots.forEach((
|
|
65099
|
-
const
|
|
65100
|
-
|
|
65101
|
-
|
|
65102
|
-
|
|
65095
|
+
}, this._pointerdown = (i) => {
|
|
65096
|
+
const r = () => {
|
|
65097
|
+
let s = [...this._outlinePass.selectedObjects];
|
|
65098
|
+
this._outlinePass.selectedObjects = [], this.amr.slots.forEach((l) => l.selected = !1);
|
|
65099
|
+
const a = this._raycaster.intersectObjects(this.amr.slots, !0)[0];
|
|
65100
|
+
a && this.amr.slots.forEach((l) => {
|
|
65101
|
+
l.traverse((u) => {
|
|
65102
|
+
u == a.object ? s != null && s.includes(l) ? (s = void 0, l.deviceSelected = !1) : (this._outlinePass.selectedObjects = [l], l.deviceSelected = !0) : l.deviceSelected = !1;
|
|
65103
65103
|
});
|
|
65104
65104
|
}), this._pointerDownTimeout = 0;
|
|
65105
65105
|
};
|
|
65106
|
-
this._pointerDownTimeout = window.setTimeout(
|
|
65106
|
+
this._pointerDownTimeout = window.setTimeout(r, 200);
|
|
65107
65107
|
}, this._detectTrackpad = () => {
|
|
65108
65108
|
la || typeof la < "u" || (vf === 0 && (U0 = performance.now()), vf++, performance.now() - U0 > 66 && (vf > 5 ? la = !0 : la = !1, la ? this.controls.zoomSpeed = 0.2 : this.controls.zoomSpeed = 1, setTimeout(jF, 2e3)));
|
|
65109
65109
|
}, this.fit = () => {
|
|
65110
65110
|
new ve().setFromObject(this._container);
|
|
65111
|
-
const
|
|
65112
|
-
let
|
|
65113
|
-
const
|
|
65114
|
-
|
|
65115
|
-
const
|
|
65116
|
-
|
|
65111
|
+
const r = this.amr.sizeBox.size.getSize(new O()), s = r.clone().multiplyScalar(0.5);
|
|
65112
|
+
let o = Math.max(r.x, r.y, r.z) + Math.max(r.x, r.y);
|
|
65113
|
+
const a = _R(this.camera.fov, 0.8) * 3 - 1.2;
|
|
65114
|
+
o += a;
|
|
65115
|
+
const l = Math.min(r.x, r.y, r.z) + 0.5, c = this.camera.position.clone().normalize().multiplyScalar(o);
|
|
65116
|
+
c.setY(o * Math.sin(30 / 180 * Math.PI)), this._fitAnimation = new fd(this.camera.position).to(c, 600).easing(Ds.Easing.Quintic.InOut).onStart(() => {
|
|
65117
65117
|
this.controls.enabled = !1;
|
|
65118
65118
|
}).onComplete(() => {
|
|
65119
65119
|
this.controls.enabled = !0;
|
|
65120
|
-
}).start(), this.controls.minDistance =
|
|
65120
|
+
}).start(), this.controls.minDistance = l, this.controls.maxDistance = o * 2.5, !s.equals(new O()) && (s.setZ(0), this.controls.target.setY(s.y));
|
|
65121
65121
|
}, this.resize = () => {
|
|
65122
|
-
var
|
|
65123
|
-
const
|
|
65124
|
-
if (!
|
|
65122
|
+
var l;
|
|
65123
|
+
const i = this.renderer.domElement.parentElement;
|
|
65124
|
+
if (!i)
|
|
65125
65125
|
return;
|
|
65126
|
-
|
|
65127
|
-
const
|
|
65128
|
-
this.size.set(
|
|
65129
|
-
const
|
|
65130
|
-
(
|
|
65131
|
-
const
|
|
65132
|
-
|
|
65126
|
+
i.style.display = "flex", this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.flexGrow = "1";
|
|
65127
|
+
const r = i.clientWidth, s = i.clientHeight;
|
|
65128
|
+
this.size.set(r, s), this.camera.aspect = r / s, this.camera.updateProjectionMatrix(), this.css2dRenderer.setSize(r, s);
|
|
65129
|
+
const o = this.renderer.getPixelRatio();
|
|
65130
|
+
(l = this.pathTracer) == null || l.updateCamera(), this.sampleCount = 0, this.renderer.setSize(r, s), this._composer.setSize(r, s), this._composer.passes.forEach((u) => u.setSize(r, s));
|
|
65131
|
+
const a = this._fxaaPass.material.uniforms;
|
|
65132
|
+
a.resolution.value.x = 1 / (r * o), a.resolution.value.y = 1 / (s * o);
|
|
65133
65133
|
}, this.ticker = () => {
|
|
65134
65134
|
this.stats.begin();
|
|
65135
|
-
const
|
|
65136
|
-
if (this.usePathTracing || (this._fpsCache.length > this._fpsCacheMax && this._fpsCache.shift(), this._fpsCache.push(
|
|
65135
|
+
const i = this.stats.fps();
|
|
65136
|
+
if (this.usePathTracing || (this._fpsCache.length > this._fpsCacheMax && this._fpsCache.shift(), this._fpsCache.push(i)), this.renderer.domElement.dispatchEvent(new CustomEvent("ticker")), requestAnimationFrame(this.ticker), this.renderer.autoClear = !1, this.renderer.clear(), this.usePathTracing) {
|
|
65137
65137
|
this.sampleCount < this.maxSample ? this.sampleCount++ : this.pathTracer.pausePathTracing = !0, this.pathTracer.renderSample();
|
|
65138
|
-
const
|
|
65139
|
-
this.renderer.autoClear = !1, this.scene.overrideMaterial = KF, this.renderer.clearDepth(), this.renderer.render(this.scene, this.camera), this.scene.overrideMaterial = null, this.renderer.render(this.overlayScene, this.camera), this.renderer.autoClear =
|
|
65138
|
+
const r = this.renderer.autoClear;
|
|
65139
|
+
this.renderer.autoClear = !1, this.scene.overrideMaterial = KF, this.renderer.clearDepth(), this.renderer.render(this.scene, this.camera), this.scene.overrideMaterial = null, this.renderer.render(this.overlayScene, this.camera), this.renderer.autoClear = r, this.renderer.render(this.overlayScene, this.camera);
|
|
65140
65140
|
} else
|
|
65141
|
-
this.amr.slots.forEach((
|
|
65142
|
-
this._dragging ?
|
|
65141
|
+
this.amr.slots.forEach((r) => {
|
|
65142
|
+
this._dragging ? r.getCanInstall() && r.render(this) : r.render(this);
|
|
65143
65143
|
}), Ds.update(), this.controls.update(), this.css2dRenderer.render(this.scene, this.camera), this.updatePosition(), this.scene.overrideMaterial = null, this._composer.render();
|
|
65144
65144
|
this.stats.end();
|
|
65145
65145
|
}, this.stats.showPanel(0), this.hideState(), A.fov && (this.camera.fov = A.fov, this.camera.updateProjectionMatrix()), this._ground.visible = !1, this.controls = new GE(this.camera, this.renderer.domElement), this.controls.enablePan = !1, this.controls.rotateSpeed = 0.5, this.controls.dampingFactor = t2, this.controls.enableDamping = !0, this.controls.maxDistance = 5, this.controls.minDistance = 1, this.controls.zoomSpeed = bR() ? 0.2 : 1, this.renderer.setPixelRatio(window.devicePixelRatio || 1), this.renderer.autoClear = !0, this.renderer.toneMapping = W0, this.renderer.toneMappingExposure = 1.2, this.renderer.outputColorSpace = ke, this.renderer.localClippingEnabled = !0, this.css2dRenderer.domElement.style.pointerEvents = "none", this.css2dRenderer.domElement.style.position = "absolute", this.css2dRenderer.domElement.style.top = "0px", ae.tonemapping_pars_fragment = ae.tonemapping_pars_fragment.replace(
|
|
@@ -65166,9 +65166,11 @@ class cH {
|
|
|
65166
65166
|
}`
|
|
65167
65167
|
), this.camera.position.set(10, 6, -10), this.camera.lookAt(new O());
|
|
65168
65168
|
const { tiles: e } = TR();
|
|
65169
|
-
this.pathTracer = new NO(this.renderer), this.pathTracer.filterGlossyFactor = 0.6
|
|
65170
|
-
|
|
65171
|
-
|
|
65169
|
+
this.pathTracer = new NO(this.renderer), this.pathTracer.filterGlossyFactor = 0.6;
|
|
65170
|
+
let t = window.devicePixelRatio;
|
|
65171
|
+
t < 2 && (t = 2), this.pathTracer.renderScale = t, this.pathTracer.bounces = 10, this.pathTracer.transmissiveBounces = 3, this.pathTracer.tiles.set(e, e), this.pathTracer.fadeDuration = 0, this.pathTracer.setBVHWorker(new CF()), this.controls.addEventListener("change", () => {
|
|
65172
|
+
var i;
|
|
65173
|
+
this.sampleCount = 0, this.usePathTracing && (this.pathTracer.pausePathTracing = !1, (i = this.pathTracer) == null || i.updateCamera());
|
|
65172
65174
|
}), this._composer = new zO(this.renderer), this._composer.setPixelRatio(window.devicePixelRatio), this._composer.addPass(new jE(this.scene, this.camera)), this._composer.addPass(new YE()), this._outlinePass = new Zn(new uA(window.innerWidth, window.innerHeight), this.scene, this.camera), this._outlinePass.visibleEdgeColor.set(26367), this._outlinePass.edgeThickness = 0.5, this._outlinePass.hiddenEdgeColor.set(26367), this._outlinePass.edgeStrength = 3, this._outlinePass.edgeGlow = 0, this._composer.addPass(this._outlinePass), this._outlinePassError = new Zn(new uA(window.innerWidth, window.innerHeight), this.scene, this.camera), this._outlinePassError.visibleEdgeColor.set(16711680), this._outlinePassError.edgeThickness = 0.5, this._outlinePassError.hiddenEdgeColor.set(16711680), this._outlinePassError.edgeStrength = 3, this._outlinePassError.edgeGlow = 0, this._composer.addPass(this._outlinePassError), this._composer.renderTarget1.texture.colorSpace = ke, this._composer.renderTarget2.texture.colorSpace = ke, this._fxaaPass = new V2(KE), this._composer.addPass(this._fxaaPass), this._container.add(this.amr), this.scene.add(this._container), this.ticker(), this._loadEnv(), this._initEvents(), this._ground.rotateX(-Math.PI / 2), this.scene.add(this._ground);
|
|
65173
65175
|
}
|
|
65174
65176
|
get usePathTracing() {
|