@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.
- package/dist/core/index.js +1 -1
- package/dist/index/index.js +41 -70
- package/dist/leaderboard/index.js +42 -0
- package/dist/leaderboard/report.d.ts +12 -1
- package/dist/leaderboard.d.ts +2 -0
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
package/dist/index/index.js
CHANGED
|
@@ -1,73 +1,44 @@
|
|
|
1
|
-
import { DEFAULT_CONFIG as
|
|
2
|
-
import { A as
|
|
3
|
-
import { CameraAPI as
|
|
4
|
-
import { c as
|
|
5
|
-
import { a as
|
|
6
|
-
import { c as
|
|
7
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|