@open-slot-ui/core 0.13.2 → 0.13.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.
package/dist/index.d.cts CHANGED
@@ -595,6 +595,9 @@ declare class SliderControl extends Control {
595
595
  setNormalized(v: number): void;
596
596
  beginDrag(): void;
597
597
  endDrag(): void;
598
+ /** Grey the slider out + block interaction (e.g. the volume sliders while sound is off). */
599
+ disable(): void;
600
+ enable(): void;
598
601
  }
599
602
 
600
603
  type PanelVariant = 'modal' | 'popover';
@@ -1421,7 +1424,6 @@ declare class OpenUI {
1421
1424
  * opts out. */
1422
1425
  autoplayInsufficientNotice: boolean;
1423
1426
  private sessionNet;
1424
- private prevVolumes;
1425
1427
  /** The frozen UISpec `createUI` built this from, if any — authored = run = tested. */
1426
1428
  spec?: Readonly<UISpec>;
1427
1429
  /** Typed convenience handles for the controls. */
@@ -1468,7 +1470,12 @@ declare class OpenUI {
1468
1470
  unlock(): void;
1469
1471
  /** Toggle master mute (music + sfx). */
1470
1472
  toggleMute(): void;
1471
- /** Mute/unmute music+sfx, remembering the levels to restore on unmute. */
1473
+ /**
1474
+ * Master mute/unmute. This ONLY flips the `muted` signal — the host silences audio off it
1475
+ * (and may grey the volume sliders). It does NOT drive the Music/Sound sliders to 0: doing so
1476
+ * would fire `valueChanged` and let a persistence layer save the transient 0, wiping the real
1477
+ * volume. The sliders keep showing the actual volume, just muted.
1478
+ */
1472
1479
  setMuted(m: boolean): void;
1473
1480
  /**
1474
1481
  * Report one completed round (major units): updates the net-position readout and,
package/dist/index.d.ts CHANGED
@@ -595,6 +595,9 @@ declare class SliderControl extends Control {
595
595
  setNormalized(v: number): void;
596
596
  beginDrag(): void;
597
597
  endDrag(): void;
598
+ /** Grey the slider out + block interaction (e.g. the volume sliders while sound is off). */
599
+ disable(): void;
600
+ enable(): void;
598
601
  }
599
602
 
600
603
  type PanelVariant = 'modal' | 'popover';
@@ -1421,7 +1424,6 @@ declare class OpenUI {
1421
1424
  * opts out. */
1422
1425
  autoplayInsufficientNotice: boolean;
1423
1426
  private sessionNet;
1424
- private prevVolumes;
1425
1427
  /** The frozen UISpec `createUI` built this from, if any — authored = run = tested. */
1426
1428
  spec?: Readonly<UISpec>;
1427
1429
  /** Typed convenience handles for the controls. */
@@ -1468,7 +1470,12 @@ declare class OpenUI {
1468
1470
  unlock(): void;
1469
1471
  /** Toggle master mute (music + sfx). */
1470
1472
  toggleMute(): void;
1471
- /** Mute/unmute music+sfx, remembering the levels to restore on unmute. */
1473
+ /**
1474
+ * Master mute/unmute. This ONLY flips the `muted` signal — the host silences audio off it
1475
+ * (and may grey the volume sliders). It does NOT drive the Music/Sound sliders to 0: doing so
1476
+ * would fire `valueChanged` and let a persistence layer save the transient 0, wiping the real
1477
+ * volume. The sliders keep showing the actual volume, just muted.
1478
+ */
1472
1479
  setMuted(m: boolean): void;
1473
1480
  /**
1474
1481
  * Report one completed round (major units): updates the net-position readout and,
package/dist/index.js CHANGED
@@ -668,7 +668,8 @@ var SliderControl = class extends Control {
668
668
  bus;
669
669
  states = {
670
670
  idle: { interactable: true },
671
- dragging: { interactable: true }
671
+ dragging: { interactable: true },
672
+ disabled: { interactable: false }
672
673
  };
673
674
  value = new Signal(0.5);
674
675
  label;
@@ -680,11 +681,20 @@ var SliderControl = class extends Control {
680
681
  this.bus?.emit("valueChanged", { id: this.id, value: c });
681
682
  }
682
683
  beginDrag() {
684
+ if (this.current === "disabled") return;
683
685
  this.setState("dragging");
684
686
  }
685
687
  endDrag() {
688
+ if (this.current === "disabled") return;
686
689
  this.setState("idle");
687
690
  }
691
+ /** Grey the slider out + block interaction (e.g. the volume sliders while sound is off). */
692
+ disable() {
693
+ this.setState("disabled");
694
+ }
695
+ enable() {
696
+ if (this.current === "disabled") this.setState("idle");
697
+ }
688
698
  };
689
699
 
690
700
  // src/controls/PanelControl.ts
@@ -2030,7 +2040,6 @@ var OpenUI = class {
2030
2040
  * opts out. */
2031
2041
  autoplayInsufficientNotice = true;
2032
2042
  sessionNet = 0;
2033
- prevVolumes = null;
2034
2043
  /** The frozen UISpec `createUI` built this from, if any — authored = run = tested. */
2035
2044
  spec;
2036
2045
  /** Typed convenience handles for the controls. */
@@ -2235,18 +2244,14 @@ var OpenUI = class {
2235
2244
  toggleMute() {
2236
2245
  this.setMuted(!this.muted.get());
2237
2246
  }
2238
- /** Mute/unmute music+sfx, remembering the levels to restore on unmute. */
2247
+ /**
2248
+ * Master mute/unmute. This ONLY flips the `muted` signal — the host silences audio off it
2249
+ * (and may grey the volume sliders). It does NOT drive the Music/Sound sliders to 0: doing so
2250
+ * would fire `valueChanged` and let a persistence layer save the transient 0, wiping the real
2251
+ * volume. The sliders keep showing the actual volume, just muted.
2252
+ */
2239
2253
  setMuted(m) {
2240
2254
  if (m === this.muted.get()) return;
2241
- if (m) {
2242
- this.prevVolumes = { music: this.musicSlider.value.get(), sfx: this.sfxSlider.value.get() };
2243
- this.musicSlider.setNormalized(0);
2244
- this.sfxSlider.setNormalized(0);
2245
- } else if (this.prevVolumes) {
2246
- this.musicSlider.setNormalized(this.prevVolumes.music);
2247
- this.sfxSlider.setNormalized(this.prevVolumes.sfx);
2248
- this.prevVolumes = null;
2249
- }
2250
2255
  this.muted.set(m);
2251
2256
  }
2252
2257
  /**