shop-components 0.1.50 → 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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
export interface SlotItemProps {
|
|
3
3
|
name: string;
|
|
4
|
+
onRemove?: () => void;
|
|
4
5
|
}
|
|
5
6
|
export declare class SlotItem extends LitElement {
|
|
6
7
|
props: SlotItemProps;
|
|
@@ -19,6 +20,7 @@ export declare class SlotItem extends LitElement {
|
|
|
19
20
|
deviceName: string;
|
|
20
21
|
slot: any;
|
|
21
22
|
get hasMoreFunctions(): boolean;
|
|
23
|
+
removeDevice: () => void;
|
|
22
24
|
onClick(e: MouseEvent): void;
|
|
23
25
|
setSize(size?: number): void;
|
|
24
26
|
addFunction(f: string): void;
|
|
@@ -64,6 +64,7 @@ export declare class Slot extends CSS2DObject {
|
|
|
64
64
|
get functions(): string[];
|
|
65
65
|
addFunction(f: string): void;
|
|
66
66
|
removeFunction(f: string): void;
|
|
67
|
+
clearFunctions(): void;
|
|
67
68
|
addFunctions(fs: string[]): void;
|
|
68
69
|
changeName(name: string): void;
|
|
69
70
|
clearSlot(): void;
|
package/dist/shop-components.mjs
CHANGED
|
@@ -57272,7 +57272,7 @@ function Zc(n, A) {
|
|
|
57272
57272
|
} });
|
|
57273
57273
|
};
|
|
57274
57274
|
}
|
|
57275
|
-
const nj = '*{box-sizing:border-box}.slot-item-container .main{pointer-events:auto;cursor:pointer;font-size:12px;color:#fff;width:12px;height:12px;background:#fff0;border:1px solid #fff;border-radius:50%;transition:background .2s,width .14s,height .14s,border .14s}.slot-item-container .main.disable{cursor:not-allowed}.slot-item-container .main.drag-over{border-color:red}.slot-item-container .main.can-install{position:relative;width:34px;height:34px;background:#0066ff1a;border-color:#06f}.slot-item-container .main.filled{border-color:#00ff95}.slot-item-container .main.selected{border-width:4px}.slot-item-container .main.selected+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.has-error{border-color:red}.slot-item-container .main.hidden{display:none}.slot-item-container .main.hidden+.info{display:none}.slot-item-container .main:after{pointer-events:none;content:attr(data-name);transition:all .2s .3s;opacity:0;position:absolute;left:50%;bottom:100%;transform:translate3d(-50%,5px,0);white-space:nowrap;font-size:12px;color:#000;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .main:hover{background:#ffffff80}.slot-item-container .main:hover+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .name{position:relative}.slot-item-container .name-wrapper{margin-top:-10px;white-space:nowrap;font-size:12px;color:#444e69;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .functions-wrapper{z-index:20000;position:absolute;left:0;top:100%}.slot-item-container .functions-wrapper>.functions{min-width:100px;padding:6px 0;border-left:1px solid #00ff95;border-radius:0 2px 2px 0;background:#0003;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.slot-item-container .functions-wrapper>.functions .btn-add{cursor:pointer;padding:2px 0;margin:0 8px;display:flex;justify-content:center;align-content:center;align-items:center;border:1px dashed #
|
|
57275
|
+
const nj = '*{box-sizing:border-box}.slot-item-container .main{pointer-events:auto;cursor:pointer;font-size:12px;color:#fff;width:12px;height:12px;background:#fff0;border:1px solid #fff;border-radius:50%;transition:background .2s,width .14s,height .14s,border .14s}.slot-item-container .main.disable{cursor:not-allowed}.slot-item-container .main.drag-over{border-color:red}.slot-item-container .main.can-install{position:relative;width:34px;height:34px;background:#0066ff1a;border-color:#06f}.slot-item-container .main.filled{border-color:#00ff95}.slot-item-container .main.selected{border-width:4px}.slot-item-container .main.selected+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.has-error{border-color:red}.slot-item-container .main.hidden{display:none}.slot-item-container .main.hidden+.info{display:none}.slot-item-container .main:after{pointer-events:none;content:attr(data-name);transition:all .2s .3s;opacity:0;position:absolute;left:50%;bottom:100%;transform:translate3d(-50%,5px,0);white-space:nowrap;font-size:12px;color:#000;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .main:hover{background:#ffffff80}.slot-item-container .main:hover+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .name{position:relative}.slot-item-container .name-wrapper{margin-top:-10px;white-space:nowrap;font-size:12px;color:#444e69;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .functions-wrapper{z-index:20000;position:absolute;left:0;top:100%}.slot-item-container .functions-wrapper>.functions{display:inline-block;min-width:100px;padding:6px 0;border-left:1px solid #00ff95;border-radius:0 2px 2px 0;background:#0003;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.slot-item-container .functions-wrapper>.functions .btn-add{cursor:pointer;padding:2px 0;margin:0 8px;display:flex;justify-content:center;align-content:center;align-items:center;border:1px dashed #eee;font-size:12px;color:#eee;border-radius:2px;-webkit-backdrop-filter:none;backdrop-filter:none;background:#00050a80}.slot-item-container .functions-wrapper>.functions .btn-add.btn-not-allowed{cursor:not-allowed}.slot-item-container .functions-wrapper>.functions .function{display:flex;justify-content:space-between;white-space:nowrap;margin-bottom:6px;padding:0 8px;font-size:12px;color:#eaeeee}.slot-item-container .functions-wrapper>.functions .function span{margin-right:4px}.slot-item-container .functions-wrapper>.functions .function .btn-remove{pointer-events:none;opacity:0;cursor:pointer;align-self:center;margin-right:0;height:14px;width:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAACnSURBVEiJxZaxFcMgDETPTuUtWCWTM4pZAq5RojRpnOfEyEKxSnh3HySeBEhNjZJJTRgUG89GyZWilbKOgJCaKmWtFG2UvFnwQr56jYAcengg3dozELPGIjh96x6hu26/DIa9vD0jq/nUA3nikQEkAOW9nACUGbf7skxlX2mIj1Ob0jK76QdxbYpGFNlk3rPnNndDQltFaLMLbdehAyd8ZP5l6Ed+W17xG7oN9QkytAAAAABJRU5ErkJggg==) center no-repeat;background-size:10px 10px}.slot-item-container .functions-wrapper>.functions .function:hover .btn-remove{pointer-events:auto;opacity:1;transform:scale(1.2)}.slot-item-container .device-name{position:relative;margin:2px 0;display:flex;min-width:120px;align-items:center;align-content:center;justify-content:flex-start;white-space:nowrap;height:20px;padding:0 20px 0 8px;font-size:14px;font-weight:700;color:#444e69}.slot-item-container .device-name span{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:250px}.slot-item-container .device-name:hover .btn-close{opacity:1;pointer-events:auto}.slot-item-container .device-name .btn-close{opacity:0;pointer-events:none;cursor:pointer;position:absolute;right:2px;top:2px;height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAB4SURBVDiNpZPLEYAgDAUXe6MuoK4UpwdBwQkQJDcyb9+QnxORCOC9jyxE4Y78DiWxAIcmISKnxaSrtZhMNSOB+ZeacAS7ngl3k1JOBSBpk1INPib0YHjH+Du2S1DhlSZOYbPJ1iLtrLKrG2a9yJopYzTD8Jx+ArgAylOzjm1WpDwAAAAASUVORK5CYII=) center no-repeat;background-size:10px 10px}.slot-item-container .device-name:before{content:"";position:absolute;left:0;height:10px;width:3px;background:#00ff95}.slot-item-container .device-name.empty{height:6px}.slot-item-container .device-name.empty:before{height:0}.slot-item-container .all-functions{opacity:0;pointer-events:none;min-width:80px;position:absolute;left:-10px;margin-left:100%;bottom:0;padding:6px 0;background:#fff;border-radius:2px;transition:all .3s}.slot-item-container .all-functions.show{opacity:1;pointer-events:auto;left:16px}.slot-item-container .all-functions label{margin-left:8px;margin-bottom:20px;color:#444e69;font-size:14px}.slot-item-container .all-functions .btn-close{cursor:pointer;position:absolute;right:7px;top:7px;height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAB4SURBVDiNpZPLEYAgDAUXe6MuoK4UpwdBwQkQJDcyb9+QnxORCOC9jyxE4Y78DiWxAIcmISKnxaSrtZhMNSOB+ZeacAS7ngl3k1JOBSBpk1INPib0YHjH+Du2S1DhlSZOYbPJ1iLtrLKrG2a9yJopYzTD8Jx+ArgAylOzjm1WpDwAAAAASUVORK5CYII=) center no-repeat;background-size:10px 10px}.slot-item-container .all-functions .functions{display:inline-block;max-height:200px;overflow-x:hidden;overflow-y:auto}.slot-item-container .all-functions .functions::-webkit-scrollbar{width:4px}.slot-item-container .all-functions .functions::-webkit-scrollbar-track{background-color:#fff}.slot-item-container .all-functions .functions::-webkit-scrollbar-thumb{background:#787878;border-radius:25px}.slot-item-container .all-functions .function{display:flex;justify-content:space-between;white-space:nowrap;padding:5px 10px;font-size:12px;color:#787878}.slot-item-container .all-functions .function span{display:flex;align-content:center;align-items:center;margin-right:4px}.slot-item-container .all-functions .function:hover{background:#444e6933}.slot-item-container .all-functions .btn-add{cursor:pointer;width:16px;font-size:16px;text-align:center;font-style:normal}.slot-item-container .info{overflow:hidden;margin-left:-2px;margin-top:-19px;position:absolute;left:100%;top:50%;transform:translateY(-50%);width:0;display:flex;align-items:flex-start;transition:all .3s}.slot-item-container .info img{flex:0 0 auto;width:53px;height:29px}', rj = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAAA7CAYAAAB8MXT7AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGTSURBVHic7dxLbQNBEIThnigADGEhxAwcBoZgCIZgBoZgCIZgCIaQMIgZVC4daw/xXPLoqdX/3fbW0milUtfutMCdpCkiLhEx1U6CLkkvkt4k7atnQYekfR7US/Us6JB0yIOaqmfBA5JWks6SrhzUwCRN+TYdq2dBx+ygDtWzoEPSNg9qVz0LOmZBgsQ3sqUkvufqAf6SpFVEnCPiFhHr1tqteCR8hyBhYrY6OlTPgo5cHX1I2lbPgo6lBInFk3Rc+uroqXqAn8ogcc3H19bae+U8eIDEZ0LSJoMEZeHIWB2ZIPEZoCw0QVlogsRnYlYWsjoaGUHCRK6OOKiRfa2OMvWtqufBAwQJE5SFJmZl4aZ6FnSQ+Azk6mjxZeFv+/fycfbDWrTW1pSFgyLxmcjVEWXh6CgLTZD4DMzKwguro4ERJEywOjIhaUdZaIAgYYKy0ABloQkSnwlxKZUHcSmVBxKfgVwdnSgLB8d35iZIfCYoC01QFpog8Y3rftFWrotO+cilVKMiSJigLDSS30hQFhr4BEcKZN0LNhDxAAAAAElFTkSuQmCC";
|
|
57276
57276
|
var sj = Object.defineProperty, oj = Object.getOwnPropertyDescriptor, di = (n, A, e, t) => {
|
|
57277
57277
|
for (var i = t > 1 ? void 0 : t ? oj(A, e) : A, r = n.length - 1, s; r >= 0; r--)
|
|
57278
57278
|
(s = n[r]) && (i = (t ? s(A, e, i) : s(i)) || i);
|
|
@@ -57280,7 +57280,9 @@ var sj = Object.defineProperty, oj = Object.getOwnPropertyDescriptor, di = (n, A
|
|
|
57280
57280
|
};
|
|
57281
57281
|
let qt = class extends Yr {
|
|
57282
57282
|
constructor(n) {
|
|
57283
|
-
super(), this.props = n, this._size = 12, this._showDialog = !1, this.selected = !1, this.hasError = !1, this.canInstall = !1, this.hide = !1, this.disable = !1, this.filled = !1, this.allFunctions = [], this.functions = [], this.deviceName = ""
|
|
57283
|
+
super(), this.props = n, this._size = 12, this._showDialog = !1, this.selected = !1, this.hasError = !1, this.canInstall = !1, this.hide = !1, this.disable = !1, this.filled = !1, this.allFunctions = [], this.functions = [], this.deviceName = "", this.removeDevice = () => {
|
|
57284
|
+
this.props.onRemove && this.props.onRemove();
|
|
57285
|
+
};
|
|
57284
57286
|
}
|
|
57285
57287
|
get hasMoreFunctions() {
|
|
57286
57288
|
return this.allFunctions.length > this.functions.length;
|
|
@@ -57315,7 +57317,10 @@ let qt = class extends Yr {
|
|
|
57315
57317
|
|
|
57316
57318
|
${this.allFunctions.length ? Zi`
|
|
57317
57319
|
<div class="functions-wrapper">
|
|
57318
|
-
<div class="device-name ${!this.deviceName && "empty"}"
|
|
57320
|
+
<div class="device-name ${!this.deviceName && "empty"}">
|
|
57321
|
+
<span>${this.deviceName}</span>
|
|
57322
|
+
<i class="btn btn-close" @click=${this.removeDevice}></i>
|
|
57323
|
+
</div>
|
|
57319
57324
|
<div class="functions">
|
|
57320
57325
|
${this.functions.map((A) => Zi`
|
|
57321
57326
|
<div class="function"><span>${A}</span><i class="btn btn-remove"
|
|
@@ -57325,7 +57330,7 @@ let qt = class extends Yr {
|
|
|
57325
57330
|
</div>
|
|
57326
57331
|
`)}
|
|
57327
57332
|
${Zi`
|
|
57328
|
-
<div class="btn btn-add" @click=${() => {
|
|
57333
|
+
<div class="btn btn-add ${!this.hasMoreFunctions && "btn-not-allowed"}" @click=${() => {
|
|
57329
57334
|
this._showDialog = !this._showDialog;
|
|
57330
57335
|
}}>+添加
|
|
57331
57336
|
</div>`}
|
|
@@ -57411,7 +57416,12 @@ class lI extends Iv {
|
|
|
57411
57416
|
const e = document.createElement("div");
|
|
57412
57417
|
super(e), this.props = A, this._emitter = new Vr(), this._slotContainer = new St(), this._bracketSlots = [], this._hasError = !1, this.useBracket = !1, this.addEventListener = this._emitter.addListener.bind(this._emitter), this.removeEventListener = this._emitter.removeListener.bind(this._emitter), this._canInstall = !1, this._loading = !1, this._selected = !1, this._deviceSelected = !1, this._allFunctions = /* @__PURE__ */ new Set(), this._functions = /* @__PURE__ */ new Set(), this._timer = 0, this._parentPos = new O(), this._wrapper = new St(), this._showSlot = !0, this._preventDefaults = (t) => {
|
|
57413
57418
|
t.preventDefault(), t.stopPropagation();
|
|
57414
|
-
}, this.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), this._showSlot = typeof A.show == "boolean" ? A.show : !0, this.name = A.name, this._slotUI = new qt({
|
|
57419
|
+
}, this.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), this._showSlot = typeof A.show == "boolean" ? A.show : !0, this.name = A.name, this._slotUI = new qt({
|
|
57420
|
+
name: A.name,
|
|
57421
|
+
onRemove: () => {
|
|
57422
|
+
this.clearSlot();
|
|
57423
|
+
}
|
|
57424
|
+
}), this._slotUI.slot = this, this._slotUI.hide = !this._showSlot, e.append(this._slotUI), this._parentPos.copy(this.props.slot.position), this._slotUI.addEventListener("function-removed", ({ detail: t }) => {
|
|
57415
57425
|
this.removeFunction(t);
|
|
57416
57426
|
}), this._slotUI.addEventListener("function-added", ({ detail: t }) => {
|
|
57417
57427
|
this.addFunction(t);
|
|
@@ -57522,6 +57532,9 @@ class lI extends Iv {
|
|
|
57522
57532
|
removeFunction(A) {
|
|
57523
57533
|
this._functions.has(A) && (this._functions.delete(A), this._slotUI.functions = [...this.functions], this._emitter.emit(xi.ON_FUNCTION_REMOVED, A));
|
|
57524
57534
|
}
|
|
57535
|
+
clearFunctions() {
|
|
57536
|
+
this._functions.forEach((A) => this.removeFunction(A));
|
|
57537
|
+
}
|
|
57525
57538
|
addFunctions(A) {
|
|
57526
57539
|
A.forEach((e) => this.addFunction(e)), this._slotUI.functions = this.functions;
|
|
57527
57540
|
}
|
|
@@ -62475,7 +62488,7 @@ class MI extends Ie {
|
|
|
62475
62488
|
const aH = new hv();
|
|
62476
62489
|
class vK extends Ie {
|
|
62477
62490
|
constructor(A) {
|
|
62478
|
-
super(), this._props = A, this._emitter = new Vr(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new St(), this.sizeBox = new fK(), this._goodsSize = new bd(0, 0, 0), this._slots = [], this._logos = [], this._skins = [], this._levels = /* @__PURE__ */ new Map(), this._bodyOpacity = 1, this._masts = /* @__PURE__ */ new Map(), this._liftMaxHeight = 0, this._jackMaxHeight = 0, this._forkMaxHeight = 0, this.controllers = [], this.goods = [], this._breathLights = [], this._shelves = /* @__PURE__ */ new Map(), this._shelfMaxLevel = 1, this._shelveAnimateTimes = [], this._url = "", this._showController = !0, this._showSlots = !0, this._shapeKeys = /* @__PURE__ */ new Map(), this._materialsCache = /* @__PURE__ */ new Map(), this.opacityCache = void 0, this._url = A.url || "", this._url && this.load(this._url).then(), this.add(this._container), this._props.showSizeBox && this.add(this.sizeBox), this.showController = typeof A.showController == "boolean" ? A.showController : !0, this._showSlots = typeof A.showSlots == "boolean" ? A.showSlots : !0;
|
|
62491
|
+
super(), this._props = A, this._emitter = new Vr(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new St(), this.sizeBox = new fK(), this._goodsSize = new bd(0, 0, 0), this._slots = [], this._logos = [], this._skins = [], this._levels = /* @__PURE__ */ new Map(), this._bodyOpacity = 1, this._masts = /* @__PURE__ */ new Map(), this._liftMaxHeight = 0, this._jackMaxHeight = 0, this._forkMaxHeight = 0, this.controllers = [], this.goods = [], this._breathLights = [], this._shelves = /* @__PURE__ */ new Map(), this._shelfMaxLevel = 1, this._shelveAnimateTimes = [], this._url = "", this._showController = !0, this._showSlots = !0, this._shapeKeys = /* @__PURE__ */ new Map(), this._shapeKeyTimer = 0, this._materialsCache = /* @__PURE__ */ new Map(), this.opacityCache = void 0, this._url = A.url || "", this._url && this.load(this._url).then(), this.add(this._container), this._props.showSizeBox && this.add(this.sizeBox), this.showController = typeof A.showController == "boolean" ? A.showController : !0, this._showSlots = typeof A.showSlots == "boolean" ? A.showSlots : !0;
|
|
62479
62492
|
}
|
|
62480
62493
|
get shapeKeys() {
|
|
62481
62494
|
return this._shapeKeys;
|
|
@@ -62567,14 +62580,16 @@ class vK extends Ie {
|
|
|
62567
62580
|
));
|
|
62568
62581
|
}
|
|
62569
62582
|
setShapeKey(A, e) {
|
|
62570
|
-
this.
|
|
62571
|
-
|
|
62572
|
-
|
|
62573
|
-
|
|
62574
|
-
|
|
62575
|
-
|
|
62576
|
-
|
|
62577
|
-
|
|
62583
|
+
this._shapeKeyTimer && clearTimeout(this._shapeKeyTimer), this._shapeKeyTimer = window.setTimeout(() => {
|
|
62584
|
+
this._container.traverse((t) => {
|
|
62585
|
+
if (!Object.keys(t.morphTargetDictionary || {}).includes(A))
|
|
62586
|
+
return;
|
|
62587
|
+
let i = e;
|
|
62588
|
+
t.userData[`origin_${A}`] && (i -= t.userData[`origin_${A}`]);
|
|
62589
|
+
const r = t.morphTargetDictionary[A];
|
|
62590
|
+
t.morphTargetInfluences && (t.morphTargetInfluences[r] = i), t instanceof Pe && t.geometry.translate(0, 0, 1e-5);
|
|
62591
|
+
}), this._emitter.emit("shape-key-changed", A, e);
|
|
62592
|
+
}, 100);
|
|
62578
62593
|
}
|
|
62579
62594
|
_generateAmr(A) {
|
|
62580
62595
|
A.traverse((e) => {
|
|
@@ -65065,66 +65080,66 @@ class cH {
|
|
|
65065
65080
|
metalness: 0.6,
|
|
65066
65081
|
roughness: 0.3
|
|
65067
65082
|
})
|
|
65068
|
-
), this.addEventListener = this._emitter.on.bind(this._emitter), this.removeEventListener = this._emitter.on.bind(this._emitter), this._drag = (
|
|
65069
|
-
this._dragging = !0, this._pointermove(
|
|
65070
|
-
}, 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) => {
|
|
65071
65086
|
this._dragging = !1;
|
|
65072
|
-
}, this._pointermove = (
|
|
65087
|
+
}, this._pointermove = (i) => {
|
|
65073
65088
|
if (this._pointerDownTimeout)
|
|
65074
65089
|
return clearTimeout(this._pointerDownTimeout), this._pointerDownTimeout = 0;
|
|
65075
|
-
const { top:
|
|
65076
|
-
this.offset.set(
|
|
65077
|
-
(
|
|
65078
|
-
-((
|
|
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
|
|
65079
65094
|
), this._raycaster.setFromCamera(this.mouseCoord, this.camera);
|
|
65080
|
-
}, this._pointerdown = (
|
|
65081
|
-
const
|
|
65082
|
-
let
|
|
65083
|
-
this._outlinePass.selectedObjects = [], this.amr.slots.forEach((
|
|
65084
|
-
const
|
|
65085
|
-
|
|
65086
|
-
|
|
65087
|
-
|
|
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;
|
|
65088
65103
|
});
|
|
65089
65104
|
}), this._pointerDownTimeout = 0;
|
|
65090
65105
|
};
|
|
65091
|
-
this._pointerDownTimeout = window.setTimeout(
|
|
65106
|
+
this._pointerDownTimeout = window.setTimeout(r, 200);
|
|
65092
65107
|
}, this._detectTrackpad = () => {
|
|
65093
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)));
|
|
65094
65109
|
}, this.fit = () => {
|
|
65095
65110
|
new ve().setFromObject(this._container);
|
|
65096
|
-
const
|
|
65097
|
-
let
|
|
65098
|
-
const
|
|
65099
|
-
|
|
65100
|
-
const
|
|
65101
|
-
|
|
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(() => {
|
|
65102
65117
|
this.controls.enabled = !1;
|
|
65103
65118
|
}).onComplete(() => {
|
|
65104
65119
|
this.controls.enabled = !0;
|
|
65105
|
-
}).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));
|
|
65106
65121
|
}, this.resize = () => {
|
|
65107
|
-
var
|
|
65108
|
-
const
|
|
65109
|
-
if (!
|
|
65122
|
+
var l;
|
|
65123
|
+
const i = this.renderer.domElement.parentElement;
|
|
65124
|
+
if (!i)
|
|
65110
65125
|
return;
|
|
65111
|
-
|
|
65112
|
-
const
|
|
65113
|
-
this.size.set(
|
|
65114
|
-
const
|
|
65115
|
-
(
|
|
65116
|
-
const
|
|
65117
|
-
|
|
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);
|
|
65118
65133
|
}, this.ticker = () => {
|
|
65119
65134
|
this.stats.begin();
|
|
65120
|
-
const
|
|
65121
|
-
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) {
|
|
65122
65137
|
this.sampleCount < this.maxSample ? this.sampleCount++ : this.pathTracer.pausePathTracing = !0, this.pathTracer.renderSample();
|
|
65123
|
-
const
|
|
65124
|
-
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);
|
|
65125
65140
|
} else
|
|
65126
|
-
this.amr.slots.forEach((
|
|
65127
|
-
this._dragging ?
|
|
65141
|
+
this.amr.slots.forEach((r) => {
|
|
65142
|
+
this._dragging ? r.getCanInstall() && r.render(this) : r.render(this);
|
|
65128
65143
|
}), Ds.update(), this.controls.update(), this.css2dRenderer.render(this.scene, this.camera), this.updatePosition(), this.scene.overrideMaterial = null, this._composer.render();
|
|
65129
65144
|
this.stats.end();
|
|
65130
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(
|
|
@@ -65151,9 +65166,11 @@ class cH {
|
|
|
65151
65166
|
}`
|
|
65152
65167
|
), this.camera.position.set(10, 6, -10), this.camera.lookAt(new O());
|
|
65153
65168
|
const { tiles: e } = TR();
|
|
65154
|
-
this.pathTracer = new NO(this.renderer), this.pathTracer.filterGlossyFactor = 0.6
|
|
65155
|
-
|
|
65156
|
-
|
|
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());
|
|
65157
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);
|
|
65158
65175
|
}
|
|
65159
65176
|
get usePathTracing() {
|