@aippy/runtime 0.2.3-dev.0 → 0.2.3-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.
@@ -22,7 +22,7 @@ function a(e) {
22
22
  }
23
23
  };
24
24
  }
25
- const s = "0.2.3-dev.0", t = {
25
+ const s = "0.2.3-dev.1", t = {
26
26
  version: s
27
27
  }, i = t.version, c = "@aippy/runtime";
28
28
  function p() {
@@ -1,73 +1,44 @@
1
- import { DEFAULT_CONFIG as p, SDK_NAME as d, VERSION as m, getConfigFromEnv as c, getVersionInfo as f, mergeConfig as l } from "../core/index.js";
2
- import { A as g, E as w, c as A } from "../errors-CDEBaBxB.js";
3
- import { CameraAPI as u, FileSystemAPI as S, GeolocationAPI as x, SensorsAPI as b, camera as I, fileSystem as P, geolocation as v, sensors as C, vibrate as M } from "../device/index.js";
4
- import { c as O, a as R, P as D, b as F, p as _, d as G } from "../pwa-8DGmPqLV.js";
5
- import { a as k, b as H } from "../useTweaks-QxMRmg7i.js";
6
- import { c as h, a as T, i as U, b as $, p as J, u as K } from "../useAudioContext-BKgy28A1.js";
7
- function r(e) {
8
- try {
9
- if (window.parent && window.parent !== window) {
10
- const a = {
11
- __aippyGame: !0,
12
- payload: e
13
- };
14
- window.parent.postMessage(a, "*");
15
- }
16
- const o = window.webkit?.messageHandlers?.aippyListener;
17
- o && o.postMessage({
18
- command: "game.event",
19
- parameters: JSON.stringify(e)
20
- });
21
- } catch (o) {
22
- console.warn("[Aippy Leaderboard] Failed to send game event:", o);
23
- }
24
- }
25
- function t(e) {
26
- r({
27
- type: "score",
28
- score: e
29
- }), console.log(`[Aippy Leaderboard] Score reported: ${e}`);
30
- }
31
- function s(e, o) {
32
- const a = {
33
- type: e,
34
- ...o
35
- };
36
- r(a), console.log(`[Aippy Leaderboard] Event sent: ${e}`, o);
37
- }
1
+ import { DEFAULT_CONFIG as r, SDK_NAME as a, VERSION as t, getConfigFromEnv as s, getVersionInfo as i, mergeConfig as n } from "../core/index.js";
2
+ import { A as m, E as c, c as f } from "../errors-CDEBaBxB.js";
3
+ import { CameraAPI as A, FileSystemAPI as E, GeolocationAPI as S, SensorsAPI as l, camera as u, fileSystem as x, geolocation as I, sensors as P, vibrate as C } from "../device/index.js";
4
+ import { c as R, a as y, P as D, b as M, p as O, d as b } from "../pwa-8DGmPqLV.js";
5
+ import { a as F, b as w } from "../useTweaks-QxMRmg7i.js";
6
+ import { c as T, a as V, i as _, b as k, p as G, u as H } from "../useAudioContext-BKgy28A1.js";
7
+ import { reportScore as h, sendEvent as K, updateScore as L } from "../leaderboard/index.js";
38
8
  export {
39
- g as AippyRuntimeError,
40
- u as CameraAPI,
41
- p as DEFAULT_CONFIG,
42
- w as ERROR_CODES,
43
- S as FileSystemAPI,
44
- x as GeolocationAPI,
45
- O as PWAUtils,
46
- R as PerformanceMonitor,
9
+ m as AippyRuntimeError,
10
+ A as CameraAPI,
11
+ r as DEFAULT_CONFIG,
12
+ c as ERROR_CODES,
13
+ E as FileSystemAPI,
14
+ S as GeolocationAPI,
15
+ R as PWAUtils,
16
+ y as PerformanceMonitor,
47
17
  D as PlatformDetector,
48
- d as SDK_NAME,
49
- b as SensorsAPI,
50
- m as VERSION,
51
- k as aippyTweaks,
52
- H as aippyTweaksRuntime,
53
- I as camera,
54
- A as createError,
55
- h as createHiddenMediaElement,
56
- T as createHiddenVideoElement,
57
- P as fileSystem,
58
- v as geolocation,
59
- c as getConfigFromEnv,
60
- f as getVersionInfo,
61
- U as isIOSDevice,
62
- $ as isMediaStreamAudioSupported,
63
- l as mergeConfig,
64
- J as patchAudioContext,
65
- F as performanceMonitor,
66
- _ as platform,
67
- G as pwa,
68
- t as reportScore,
69
- s as sendEvent,
70
- C as sensors,
71
- K as useAudioContext,
72
- M as vibrate
18
+ a as SDK_NAME,
19
+ l as SensorsAPI,
20
+ t as VERSION,
21
+ F as aippyTweaks,
22
+ w as aippyTweaksRuntime,
23
+ u as camera,
24
+ f as createError,
25
+ T as createHiddenMediaElement,
26
+ V as createHiddenVideoElement,
27
+ x as fileSystem,
28
+ I as geolocation,
29
+ s as getConfigFromEnv,
30
+ i as getVersionInfo,
31
+ _ as isIOSDevice,
32
+ k as isMediaStreamAudioSupported,
33
+ n as mergeConfig,
34
+ G as patchAudioContext,
35
+ M as performanceMonitor,
36
+ O as platform,
37
+ b as pwa,
38
+ h as reportScore,
39
+ K as sendEvent,
40
+ P as sensors,
41
+ L as updateScore,
42
+ H as useAudioContext,
43
+ C as vibrate
73
44
  };
@@ -0,0 +1,42 @@
1
+ function r(e, o) {
2
+ try {
3
+ if (window.parent && window.parent !== window) {
4
+ const n = {
5
+ __aippyGame: !0,
6
+ payload: e
7
+ };
8
+ window.parent.postMessage(n, "*");
9
+ }
10
+ const a = window.webkit?.messageHandlers?.aippyListener;
11
+ a && a.postMessage({
12
+ command: o,
13
+ parameters: JSON.stringify(e)
14
+ });
15
+ } catch (a) {
16
+ console.warn("[Aippy Leaderboard] Failed to send game event:", a);
17
+ }
18
+ }
19
+ function t(e) {
20
+ r({
21
+ type: "score",
22
+ score: e
23
+ }, "leaderboard.reportScore"), console.log(`[Aippy Leaderboard] Score reported: ${e}`);
24
+ }
25
+ function p(e) {
26
+ r({
27
+ type: "score",
28
+ score: e
29
+ }, "leaderboard.updateScore"), console.log(`[Aippy Leaderboard] Score updated: ${e}`);
30
+ }
31
+ function d(e, o) {
32
+ const a = {
33
+ type: e,
34
+ ...o
35
+ };
36
+ r(a, "leaderboard.event"), console.log(`[Aippy Leaderboard] Event sent: ${e}`, o);
37
+ }
38
+ export {
39
+ t as reportScore,
40
+ d as sendEvent,
41
+ p as updateScore
42
+ };
@@ -2,7 +2,7 @@
2
2
  * Leaderboard reporting functionality for score submission and game events
3
3
  */
4
4
  /**
5
- * Report game score to parent window or iOS app
5
+ * Report final game score to parent window or iOS app (used when game ends)
6
6
  * @param score - The score value to report
7
7
  *
8
8
  * @example
@@ -12,6 +12,17 @@
12
12
  * ```
13
13
  */
14
14
  export declare function reportScore(score: number): void;
15
+ /**
16
+ * Update current game score to parent window or iOS app (used during gameplay)
17
+ * @param score - The current score value to update
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * updateScore(50);
22
+ * updateScore(currentScore);
23
+ * ```
24
+ */
25
+ export declare function updateScore(score: number): void;
15
26
  /**
16
27
  * Send a custom game event
17
28
  * @param eventType - The event type
@@ -0,0 +1,2 @@
1
+ export * from './leaderboard/index'
2
+ export {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aippy/runtime",
3
- "version": "0.2.3-dev.0",
3
+ "version": "0.2.3-dev.1",
4
4
  "description": "Aippy Runtime SDK - Runtime SDK for Aippy projects",
5
5
  "private": false,
6
6
  "type": "module",