ssovee-os-web-ui 0.1.35 → 0.1.36

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.
Binary file
Binary file
package/dist/index.cjs CHANGED
@@ -3240,17 +3240,43 @@ var useDeviceSupport = () => {
3240
3240
  }, []);
3241
3241
  return isSupported;
3242
3242
  };
3243
+
3244
+ // src/assets/sounds/click-tone.wav
3245
+ var click_tone_default = "./click-tone-GOELVSMY.wav";
3246
+
3247
+ // src/assets/sounds/error-tone.wav
3248
+ var error_tone_default = "./error-tone-YKNRLRXF.wav";
3249
+
3250
+ // src/assets/sounds/notification-tone.wav
3251
+ var notification_tone_default = "./notification-tone-7O3KFZG5.wav";
3252
+
3253
+ // src/assets/sounds/success-tone.wav
3254
+ var success_tone_default = "./success-tone-YKPPMCXK.wav";
3255
+
3256
+ // src/assets/sounds/swipe-tone.wav
3257
+ var swipe_tone_default = "./swipe-tone-UCF4T5MF.wav";
3258
+
3259
+ // src/hooks/useSound.tsx
3243
3260
  var soundMap = {
3244
- click: new URL("../assets/sounds/click-tone.wav", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).href,
3245
- alert: new URL("../assets/sounds/error-tone.wav", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).href,
3246
- notification: new URL("../assets/sounds/notification-tone.wav", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).href,
3247
- error: new URL("../assets/sounds/error-tone.wav", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).href,
3248
- success: new URL("../assets/sounds/success-tone.wav", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).href,
3249
- swipe: new URL("../assets/sounds/swipe-tone.wav", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).href
3261
+ click: click_tone_default,
3262
+ alert: error_tone_default,
3263
+ notification: notification_tone_default,
3264
+ error: error_tone_default,
3265
+ success: success_tone_default,
3266
+ swipe: swipe_tone_default
3250
3267
  };
3251
3268
  var pendingPlaybackQueue = [];
3252
3269
  var interactionListenersBound = false;
3253
3270
  var clampVolume = (value) => Math.min(1, Math.max(0, value));
3271
+ var getAssetUrl = (asset) => {
3272
+ if (typeof asset === "string") return asset;
3273
+ if (asset && typeof asset === "object") {
3274
+ const record = asset;
3275
+ const candidate = record.default ?? record.src ?? record.url ?? record.href;
3276
+ if (typeof candidate === "string") return candidate;
3277
+ }
3278
+ return "";
3279
+ };
3254
3280
  var resolveSoundSrc = (soundSrc) => {
3255
3281
  if (!soundSrc) return soundSrc;
3256
3282
  if (soundSrc.startsWith("http://") || soundSrc.startsWith("https://") || soundSrc.startsWith("data:") || soundSrc.startsWith("blob:")) {
@@ -3272,7 +3298,7 @@ var playNativeAudio = async (type, options) => {
3272
3298
  if (typeof window === "undefined" || typeof window.Audio === "undefined") {
3273
3299
  return false;
3274
3300
  }
3275
- const soundSrc = soundMap[type];
3301
+ const soundSrc = getAssetUrl(soundMap[type]);
3276
3302
  const audio = new window.Audio(resolveSoundSrc(soundSrc));
3277
3303
  audio.preload = "auto";
3278
3304
  audio.volume = clampVolume(options?.volume ?? 1);