shop-components 0.1.40 → 0.1.41

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.
@@ -11,6 +11,7 @@ export declare const textureLoader: TextureLoader;
11
11
  export interface AmrProps {
12
12
  url?: string;
13
13
  showSizeBox: boolean;
14
+ showSlots?: boolean;
14
15
  showController?: boolean;
15
16
  }
16
17
  export declare class Amr extends Object3D {
@@ -43,6 +44,7 @@ export declare class Amr extends Object3D {
43
44
  private _shelveAnimateTimes;
44
45
  private _url;
45
46
  private _showController;
47
+ private _showSlots;
46
48
  private _shapeKeys;
47
49
  private _materialsCache;
48
50
  opacityCache: undefined | number;
@@ -9,6 +9,7 @@ export interface SlotProps {
9
9
  origin: number;
10
10
  }>;
11
11
  slot: Object3D;
12
+ show: boolean;
12
13
  }
13
14
  export interface DeviceInfo {
14
15
  name: string;
@@ -49,6 +50,7 @@ export declare class Slot extends CSS2DObject {
49
50
  get hasDevice(): boolean;
50
51
  deviceInfo: DeviceInfo | undefined;
51
52
  holeTarget: Object3D | undefined;
53
+ private _showSlot;
52
54
  constructor(props: SlotProps);
53
55
  shapeKeyChanged(key: string, value: number): void;
54
56
  loadGlb(sglb: string): Promise<Object3D<import("three").Object3DEventMap> | undefined>;
@@ -57306,44 +57306,44 @@ let qt = class extends Yr {
57306
57306
  <img alt="" src="${nj}">
57307
57307
  <div class="name">
57308
57308
  <div class="name-wrapper">${(n = this.slot) == null ? void 0 : n.name}</div>
57309
-
57309
+
57310
57310
  ${this.allFunctions.length ? Ji`
57311
- <div class="functions-wrapper">
57312
- <div class="device-name ${!this.deviceName && "empty"}">${this.deviceName}</div>
57313
- <div class="functions">
57314
- ${this.functions.map((A) => Ji`
57315
- <div class="function"><span>${A}</span><i class="btn btn-remove"
57316
- @click=${() => {
57311
+ <div class="functions-wrapper">
57312
+ <div class="device-name ${!this.deviceName && "empty"}">${this.deviceName}</div>
57313
+ <div class="functions">
57314
+ ${this.functions.map((A) => Ji`
57315
+ <div class="function"><span>${A}</span><i class="btn btn-remove"
57316
+ @click=${() => {
57317
57317
  this.dispatchEvent(new CustomEvent("function-removed", { detail: A }));
57318
57318
  }}></i>
57319
- </div>
57320
- `)}
57321
- ${Ji`
57322
- <div class="btn btn-add" @click=${() => {
57319
+ </div>
57320
+ `)}
57321
+ ${Ji`
57322
+ <div class="btn btn-add" @click=${() => {
57323
57323
  this._showDialog = !this._showDialog;
57324
57324
  }}>+添加
57325
- </div>`}
57325
+ </div>`}
57326
57326
 
57327
- </div>
57328
- ${this.hasMoreFunctions ? Ji`
57329
- <div class="all-functions ${this._showDialog && "show"}">
57330
- <label>添加功能
57331
- <i class="btn btn-close" @click=${() => {
57327
+ </div>
57328
+ ${this.hasMoreFunctions ? Ji`
57329
+ <div class="all-functions ${this._showDialog && "show"}">
57330
+ <label>添加功能
57331
+ <i class="btn btn-close" @click=${() => {
57332
57332
  this._showDialog = !1;
57333
57333
  }}></i>
57334
- </label>
57335
- <div class="functions">
57336
- ${this.allFunctions.map((A) => this.functions.includes(A) ? Ji`` : Ji`
57337
- <div class="function">
57338
- <span>${A}</span>
57339
- <i class="btn btn-add" @click=${() => this.addFunction(A)}>+</i>
57340
- </div>
57341
- `)}
57342
- </div>
57343
- </div>` : Ji``}
57344
- </div>
57345
- ` : Ji``}
57346
-
57334
+ </label>
57335
+ <div class="functions">
57336
+ ${this.allFunctions.map((A) => this.functions.includes(A) ? Ji`` : Ji`
57337
+ <div class="function">
57338
+ <span>${A}</span>
57339
+ <i class="btn btn-add" @click=${() => this.addFunction(A)}>+</i>
57340
+ </div>
57341
+ `)}
57342
+ </div>
57343
+ </div>` : Ji``}
57344
+ </div>
57345
+ ` : Ji``}
57346
+
57347
57347
  </div>
57348
57348
  </div>
57349
57349
  </div>
@@ -57403,7 +57403,7 @@ const xi = {
57403
57403
  class E0 extends bv {
57404
57404
  constructor(A) {
57405
57405
  const e = document.createElement("div");
57406
- 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.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), this.name = A.name, this._slotUI = new qt({ name: A.name }), this._slotUI.slot = this, e.append(this._slotUI), this._parentPos.copy(this.props.slot.position), this._slotUI.addEventListener("function-removed", ({ detail: t }) => {
57406
+ 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.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), this._showSlot = typeof A.show == "boolean" ? A.show : !0, this.name = A.name, this._slotUI = new qt({ name: A.name }), 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 }) => {
57407
57407
  this.removeFunction(t);
57408
57408
  }), this._slotUI.addEventListener("function-added", ({ detail: t }) => {
57409
57409
  this.addFunction(t);
@@ -62463,7 +62463,7 @@ class MI extends Ie {
62463
62463
  const oH = new uv();
62464
62464
  class mK extends Ie {
62465
62465
  constructor(A) {
62466
- super(), this._props = A, this._emitter = new Vr(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new St(), this.sizeBox = new uK(), 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._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;
62466
+ super(), this._props = A, this._emitter = new Vr(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new St(), this.sizeBox = new uK(), 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;
62467
62467
  }
62468
62468
  get shapeKeys() {
62469
62469
  return this._shapeKeys;
@@ -62837,7 +62837,8 @@ class mK extends Ie {
62837
62837
  const o = new E0({
62838
62838
  name: t,
62839
62839
  follows: s,
62840
- slot: A
62840
+ slot: A,
62841
+ show: this._showSlots
62841
62842
  });
62842
62843
  return o.holeTarget = r, o.addEventListener(xi.ON_DROP, (a) => {
62843
62844
  this._app && this._app.props.useSound && this._app.sound.play();