@lumiastream/ui 0.8.11 → 0.9.0

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.js CHANGED
@@ -5448,10 +5448,10 @@ var applyPingSink = (ctx, sinkId) => {
5448
5448
  return sinkCtx.setSinkId(sinkId).catch(() => {
5449
5449
  });
5450
5450
  };
5451
- var emitPingTone = (ctx) => {
5451
+ var emitPingTone = (ctx, volume = 1) => {
5452
5452
  const start = ctx.currentTime;
5453
5453
  const master = ctx.createGain();
5454
- master.gain.setValueAtTime(0.85, start);
5454
+ master.gain.setValueAtTime(0.85 * volume, start);
5455
5455
  master.connect(ctx.destination);
5456
5456
  for (const note of PING_NOTES) {
5457
5457
  const noteStart = start + note.at;
@@ -5477,13 +5477,14 @@ var playEventPing = (options) => {
5477
5477
  if (!ctx) {
5478
5478
  return;
5479
5479
  }
5480
+ const volume = options?.volume === void 0 ? 1 : Math.min(Math.max(options.volume, 0), 1);
5480
5481
  const run = () => {
5481
5482
  if (ctx.state === "suspended") {
5482
- ctx.resume().then(() => emitPingTone(ctx)).catch(() => {
5483
+ ctx.resume().then(() => emitPingTone(ctx, volume)).catch(() => {
5483
5484
  });
5484
5485
  return;
5485
5486
  }
5486
- emitPingTone(ctx);
5487
+ emitPingTone(ctx, volume);
5487
5488
  };
5488
5489
  const sinkApplied = applyPingSink(ctx, options?.sinkId);
5489
5490
  if (sinkApplied) {
package/dist/utils.d.ts CHANGED
@@ -115,6 +115,7 @@ type PingNote = {
115
115
  declare const PING_NOTES: PingNote[];
116
116
  declare const playEventPing: (options?: {
117
117
  sinkId?: string;
118
+ volume?: number;
118
119
  }) => void;
119
120
 
120
121
  export { PING_NOTES, type PingNote, codeMirrorlinterOptions, playEventPing, variableCompletionOptions };
package/dist/utils.js CHANGED
@@ -854,10 +854,10 @@ var applyPingSink = (ctx, sinkId) => {
854
854
  return sinkCtx.setSinkId(sinkId).catch(() => {
855
855
  });
856
856
  };
857
- var emitPingTone = (ctx) => {
857
+ var emitPingTone = (ctx, volume = 1) => {
858
858
  const start = ctx.currentTime;
859
859
  const master = ctx.createGain();
860
- master.gain.setValueAtTime(0.85, start);
860
+ master.gain.setValueAtTime(0.85 * volume, start);
861
861
  master.connect(ctx.destination);
862
862
  for (const note of PING_NOTES) {
863
863
  const noteStart = start + note.at;
@@ -883,13 +883,14 @@ var playEventPing = (options) => {
883
883
  if (!ctx) {
884
884
  return;
885
885
  }
886
+ const volume = options?.volume === void 0 ? 1 : Math.min(Math.max(options.volume, 0), 1);
886
887
  const run = () => {
887
888
  if (ctx.state === "suspended") {
888
- ctx.resume().then(() => emitPingTone(ctx)).catch(() => {
889
+ ctx.resume().then(() => emitPingTone(ctx, volume)).catch(() => {
889
890
  });
890
891
  return;
891
892
  }
892
- emitPingTone(ctx);
893
+ emitPingTone(ctx, volume);
893
894
  };
894
895
  const sinkApplied = applyPingSink(ctx, options?.sinkId);
895
896
  if (sinkApplied) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.8.11",
3
+ "version": "0.9.0",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",
@@ -196,8 +196,8 @@
196
196
  "vitest": "^4.1.6"
197
197
  },
198
198
  "dependencies": {
199
- "@lumiastream/lumia-translations": "1.18.5",
200
- "@lumiastream/lumia-types": "3.8.6",
199
+ "@lumiastream/lumia-translations": "1.19.1",
200
+ "@lumiastream/lumia-types": "3.8.9",
201
201
  "classnames": "^2.5.1",
202
202
  "globals": "^17.4.0",
203
203
  "nanoid": "^5.1.11",