koin.js 1.0.4 → 1.0.5
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/index.js +50 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -0
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +13 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7440,8 +7440,39 @@ function usePlayerPersistence(onSettingsChange) {
|
|
|
7440
7440
|
updateSettings
|
|
7441
7441
|
};
|
|
7442
7442
|
}
|
|
7443
|
+
|
|
7444
|
+
// src/lib/telemetry.ts
|
|
7445
|
+
var sendTelemetry = (eventName, params = {}) => {
|
|
7446
|
+
if (typeof window === "undefined") return;
|
|
7447
|
+
try {
|
|
7448
|
+
fetch("https://koin.theretrosaga.com/api/telemetry", {
|
|
7449
|
+
method: "POST",
|
|
7450
|
+
headers: {
|
|
7451
|
+
"Content-Type": "application/json"
|
|
7452
|
+
},
|
|
7453
|
+
body: JSON.stringify({
|
|
7454
|
+
event_name: eventName,
|
|
7455
|
+
params: {
|
|
7456
|
+
...params,
|
|
7457
|
+
url: window.location.href,
|
|
7458
|
+
referrer: document.referrer,
|
|
7459
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
7460
|
+
}
|
|
7461
|
+
})
|
|
7462
|
+
}).catch(() => {
|
|
7463
|
+
});
|
|
7464
|
+
} catch (e) {
|
|
7465
|
+
}
|
|
7466
|
+
};
|
|
7443
7467
|
var GamePlayer = React5.memo(function GamePlayer2(props) {
|
|
7444
7468
|
const { settings, updateSettings, isLoaded: settingsLoaded } = usePlayerPersistence();
|
|
7469
|
+
React5.useEffect(() => {
|
|
7470
|
+
sendTelemetry("game_start", {
|
|
7471
|
+
system: props.system,
|
|
7472
|
+
core: props.core,
|
|
7473
|
+
game: props.title || "unknown"
|
|
7474
|
+
});
|
|
7475
|
+
}, [props.system, props.core, props.title]);
|
|
7445
7476
|
const [biosModalOpen, setBiosModalOpen] = React5.useState(false);
|
|
7446
7477
|
const [showShortcutsModal, setShowShortcutsModal] = React5.useState(false);
|
|
7447
7478
|
const effectiveShader = props.shader !== void 0 ? props.shader : settings.shader;
|
|
@@ -7539,6 +7570,13 @@ var GamePlayer = React5.memo(function GamePlayer2(props) {
|
|
|
7539
7570
|
status,
|
|
7540
7571
|
isPerformanceMode
|
|
7541
7572
|
} = nostalgist;
|
|
7573
|
+
React5.useEffect(() => {
|
|
7574
|
+
if (status === "running") {
|
|
7575
|
+
console.log("[Koin Debug] Status:", status);
|
|
7576
|
+
console.log("[Koin Debug] isPerformanceMode:", isPerformanceMode);
|
|
7577
|
+
console.log("[Koin Debug] crossOriginIsolated:", typeof window !== "undefined" ? window.crossOriginIsolated : "N/A");
|
|
7578
|
+
}
|
|
7579
|
+
}, [status, isPerformanceMode]);
|
|
7542
7580
|
React5.useEffect(() => {
|
|
7543
7581
|
if (settingsLoaded) {
|
|
7544
7582
|
setVolume(settings.volume);
|
|
@@ -7732,6 +7770,18 @@ var GamePlayer = React5.memo(function GamePlayer2(props) {
|
|
|
7732
7770
|
]
|
|
7733
7771
|
}
|
|
7734
7772
|
),
|
|
7773
|
+
!isPerformanceMode && (status === "running" || status === "paused") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7774
|
+
"div",
|
|
7775
|
+
{
|
|
7776
|
+
className: "bg-red-900/80 backdrop-blur-md px-2 py-1 rounded border border-red-500/50 flex items-center gap-1.5",
|
|
7777
|
+
title: "Standard Mode (Single Threaded)",
|
|
7778
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] uppercase font-bold tracking-wider text-red-200", children: [
|
|
7779
|
+
"Standard (",
|
|
7780
|
+
typeof window !== "undefined" && window.crossOriginIsolated ? "Isolated" : "Not Isolated",
|
|
7781
|
+
")"
|
|
7782
|
+
] })
|
|
7783
|
+
}
|
|
7784
|
+
),
|
|
7735
7785
|
settings.showInputDisplay && (status === "running" || status === "paused") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7736
7786
|
InputDisplay_default,
|
|
7737
7787
|
{
|