@lumiastream/ui 0.8.10 → 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/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.10",
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",