@aippy/runtime 0.4.1-dev.0 → 0.4.1-dev.1

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/ai/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as i, d as A, e as r, c as n, U as C, a as I, b as f, h as g, g as _, l as p, n as E, p as T, r as U, f as t, s as l, v as D } from "../helper-Cw67btub.js";
1
+ import { D as i, d as A, e as r, c as n, U as C, a as I, b as f, h as g, g as _, l as p, n as E, p as T, r as U, f as t, s as l, v as D } from "../helper-CZqFi-QF.js";
2
2
  import "react";
3
3
  import "../bridge-CtB9L5kL.js";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { c as i, b as s, i as t, p as d, u as o, a as u } from "../useSound-jHl7rkaq.js";
1
+ import { c as i, b as s, i as t, p as d, u as o, a as u } from "../useSound-z_eIn0KH.js";
2
2
  export {
3
3
  i as createHiddenMediaElement,
4
4
  s as isIOSDevice,
@@ -14,6 +14,7 @@ export interface UseSoundOptions extends UseAudioContextOptions {
14
14
  export interface PlayOptions {
15
15
  loop?: boolean;
16
16
  volume?: number;
17
+ pitch?: number;
17
18
  }
18
19
  export interface UseSoundReturn {
19
20
  /**
@@ -1,6 +1,6 @@
1
1
  import "react";
2
2
  import { g as a } from "./bridge-CtB9L5kL.js";
3
- const r = "0.4.1-dev.0", i = {
3
+ const r = "0.4.1-dev.1", i = {
4
4
  version: r
5
5
  }, o = i.version, c = "@aippy/runtime";
6
6
  function w() {
@@ -1,7 +1,7 @@
1
1
  import { D as r, g as s, m as o } from "../config-B0A7gHQM.js";
2
2
  import { _ as t, r as i } from "../bridge-CtB9L5kL.js";
3
3
  import { A as R, a as E, E as c, b as m, c as A } from "../errors-B3bDbQbD.js";
4
- import { S as f, V as g, c as l, a as y, g as _, s as d } from "../container-message-DZYnuAQg.js";
4
+ import { S as f, V as g, c as l, a as y, g as _, s as d } from "../container-message-KgL1paGV.js";
5
5
  import { A as D, C as O, R as F, a as I, p as S } from "../runtime-CmoG3v2m.js";
6
6
  export {
7
7
  D as AippyRuntime,
@@ -1,6 +1,6 @@
1
1
  import { createOpenAICompatible as d } from "@ai-sdk/openai-compatible";
2
2
  import { r as f } from "./bridge-CtB9L5kL.js";
3
- import { s as m, a as b } from "./container-message-DZYnuAQg.js";
3
+ import { s as m, a as b } from "./container-message-KgL1paGV.js";
4
4
  import { AISDKError as c, DefaultChatTransport as h } from "ai";
5
5
  import { E as g, b as p, a as u } from "./errors-B3bDbQbD.js";
6
6
  import { j as A } from "./url-c26cuIpu.js";
@@ -1,16 +1,16 @@
1
1
  import { D as r, g as s, m as o } from "../config-B0A7gHQM.js";
2
2
  import { _ as i, g as n, r as p } from "../bridge-CtB9L5kL.js";
3
3
  import { A as m, a as f, E as c, b as u, c as C } from "../errors-B3bDbQbD.js";
4
- import { S as g, V as I, c as d, a as E, g as S, s as x } from "../container-message-DZYnuAQg.js";
4
+ import { S as g, V as I, c as d, a as E, g as S, s as x } from "../container-message-KgL1paGV.js";
5
5
  import { A as U, C as _, R as T, a as D, p as v } from "../runtime-CmoG3v2m.js";
6
6
  import { CameraAPI as F, FileSystemAPI as P, GeolocationAPI as h, SensorsAPI as M, camera as O, fileSystem as b, geolocation as L, isMotionSupported as w, isOrientationSupported as H, requestMotionPermission as N, sensors as V, vibrate as B, watchMotion as k, watchOrientation as q } from "../device/index.js";
7
7
  import { P as G, a as z, c as K, b as W, g as X, i as Y, p as J, r as Q, s as Z } from "../app-version-checker-Bz7FrEZz.js";
8
8
  import { a as ee, P as ae, p as re, b as se } from "../pwa-C5nXU0DN.js";
9
9
  import { j as te } from "../url-c26cuIpu.js";
10
10
  import { a as ne, b as pe } from "../useTweaks-v5wEZGGm.js";
11
- import { c as me, b as fe, i as ce, p as ue, u as Ce, a as le } from "../useSound-jHl7rkaq.js";
11
+ import { c as me, b as fe, i as ce, p as ue, u as Ce, a as le } from "../useSound-z_eIn0KH.js";
12
12
  import { reportScore as Ie, sendEvent as de, updateScore as Ee } from "../leaderboard/index.js";
13
- import { D as xe, d as Re, e as Ue, c as _e, U as Te, a as De, b as ve, h as ye, g as Fe, l as Pe, n as he, p as Me, r as Oe, f as be, s as Le, v as we } from "../helper-Cw67btub.js";
13
+ import { D as xe, d as Re, e as Ue, c as _e, U as Te, a as De, b as ve, h as ye, g as Fe, l as Pe, n as he, p as Me, r as Oe, f as be, s as Le, v as we } from "../helper-CZqFi-QF.js";
14
14
  import { c as Ne, u as Ve } from "../hooks-D5lkty5r.js";
15
15
  import { hasNativeBridge as ke } from "../native-bridge-BnvipFJc.js";
16
16
  export {
@@ -1,7 +1,7 @@
1
1
  var U = Object.defineProperty;
2
2
  var j = (e, t, s) => t in e ? U(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var h = (e, t, s) => j(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { useState as C, useRef as L, useEffect as P, useCallback as T } from "react";
4
+ import { useState as O, useRef as L, useEffect as P, useCallback as T } from "react";
5
5
  function _() {
6
6
  const e = navigator.userAgent;
7
7
  return !!(/iPad|iPhone|iPod/.test(e) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
@@ -20,7 +20,7 @@ function F(e = "video", t = !1) {
20
20
  const s = document.createElement(e);
21
21
  return s.muted = !1, s.autoplay = !0, e === "video" && (s.playsInline = !0), t ? s.style.cssText = "position:fixed;bottom:10px;right:10px;width:200px;background:#ff0000;z-index:9999;" : s.style.cssText = "position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;", s;
22
22
  }
23
- class N {
23
+ class R {
24
24
  constructor(t, s, a, m = !1) {
25
25
  h(this, "analyser");
26
26
  h(this, "dataArray");
@@ -98,7 +98,7 @@ class N {
98
98
  }
99
99
  }
100
100
  const E = /* @__PURE__ */ new WeakSet();
101
- function R(e, t = {}) {
101
+ function N(e, t = {}) {
102
102
  if (E.has(e))
103
103
  return e;
104
104
  const {
@@ -125,12 +125,12 @@ function R(e, t = {}) {
125
125
  let y = [];
126
126
  function S() {
127
127
  const n = () => {
128
- const O = e.state;
129
- (O === "interrupted" || O === "suspended") && (l = !1);
128
+ const x = e.state;
129
+ (x === "interrupted" || x === "suspended") && (l = !1);
130
130
  };
131
131
  e.addEventListener("statechange", n);
132
- const d = (O) => {
133
- O.persisted && (l = !1);
132
+ const d = (x) => {
133
+ x.persisted && (l = !1);
134
134
  };
135
135
  window.addEventListener("pageshow", d);
136
136
  const M = () => {
@@ -141,7 +141,7 @@ function R(e, t = {}) {
141
141
  l = !1;
142
142
  };
143
143
  window.addEventListener("pagehide", M);
144
- const x = () => {
144
+ const C = () => {
145
145
  if (document.visibilityState === "hidden") {
146
146
  try {
147
147
  e.suspend();
@@ -150,11 +150,11 @@ function R(e, t = {}) {
150
150
  l = !1;
151
151
  }
152
152
  };
153
- document.addEventListener("visibilitychange", x), y = [
153
+ document.addEventListener("visibilitychange", C), y = [
154
154
  () => e.removeEventListener("statechange", n),
155
155
  () => window.removeEventListener("pageshow", d),
156
156
  () => window.removeEventListener("pagehide", M),
157
- () => document.removeEventListener("visibilitychange", x)
157
+ () => document.removeEventListener("visibilitychange", C)
158
158
  ];
159
159
  }
160
160
  function D() {
@@ -202,7 +202,7 @@ function R(e, t = {}) {
202
202
  const r = F(g, m);
203
203
  r.srcObject = I.stream, document.body.appendChild(r);
204
204
  let i = null;
205
- u.enabled && (i = new N(
205
+ u.enabled && (i = new R(
206
206
  e,
207
207
  r,
208
208
  u,
@@ -242,9 +242,9 @@ function R(e, t = {}) {
242
242
  return o(k), S(), E.add(e), k;
243
243
  }
244
244
  function q(e = {}) {
245
- const { autoUnlock: t = !0, ...s } = e, [a, m] = C(null), [g, f] = C(!1), u = L(null);
245
+ const { autoUnlock: t = !0, ...s } = e, [a, m] = O(null), [g, f] = O(!1), u = L(null);
246
246
  P(() => {
247
- const o = new AudioContext(), c = R(o, s);
247
+ const o = new AudioContext(), c = N(o, s);
248
248
  return u.current = c, m(c), () => {
249
249
  u.current = null, c.cleanup(), c.close();
250
250
  };
@@ -339,7 +339,7 @@ function H(e, t = {}) {
339
339
  }
340
340
  A(r);
341
341
  const n = p.createBufferSource();
342
- n.buffer = k, n.loop = i?.loop ?? !1;
342
+ n.buffer = k, n.loop = i?.loop ?? !1, n.playbackRate.value = i?.pitch ?? 1;
343
343
  const d = p.createGain();
344
344
  return d.gain.value = (i?.volume ?? 1) * S.current, n.connect(d), d.connect(p.destination), n.start(), c.current.set(r, { source: n, gain: d }), n.onended = () => {
345
345
  c.current.get(r)?.source === n && c.current.delete(r);
@@ -375,6 +375,6 @@ export {
375
375
  _ as b,
376
376
  F as c,
377
377
  B as i,
378
- R as p,
378
+ N as p,
379
379
  q as u
380
380
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aippy/runtime",
3
- "version": "0.4.1-dev.0",
3
+ "version": "0.4.1-dev.1",
4
4
  "description": "Aippy Runtime SDK - Runtime SDK for Aippy projects",
5
5
  "private": false,
6
6
  "type": "module",