@combos-fun/engine 0.1.21 → 0.1.22
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/engine.cjs.js +22 -6
- package/dist/engine.cjs.js.map +1 -1
- package/dist/engine.cjs.prod.js +1 -1
- package/dist/engine.d.ts +6 -4
- package/dist/engine.esm.js +22 -6
- package/dist/engine.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/engine.cjs.js
CHANGED
|
@@ -891,11 +891,12 @@ class Scene extends GameObject {
|
|
|
891
891
|
}
|
|
892
892
|
|
|
893
893
|
/** Generated at build from package.json */
|
|
894
|
-
const version = "0.1.
|
|
894
|
+
const version = "0.1.22";
|
|
895
895
|
|
|
896
896
|
/**
|
|
897
|
-
* Sent
|
|
898
|
-
*
|
|
897
|
+
* Sent after each `System.init` completes during `Game.addSystem`.
|
|
898
|
+
* An iframe posts to `window.parent`. A top-level page hands the same payload
|
|
899
|
+
* to the native runtime bridge as a string.
|
|
899
900
|
*/
|
|
900
901
|
const COMBOS_GAME_PLUGIN_INIT_SUCCESS = "combos-game:plugin-init-success";
|
|
901
902
|
/**
|
|
@@ -934,13 +935,28 @@ function setParentNotifyTargetOrigin(targetOrigin) {
|
|
|
934
935
|
function postToParent(payload, targetOrigin) {
|
|
935
936
|
if (typeof window === "undefined")
|
|
936
937
|
return;
|
|
937
|
-
|
|
938
|
+
const parent = window.parent;
|
|
939
|
+
if (parent && parent !== window) {
|
|
940
|
+
try {
|
|
941
|
+
parent.postMessage(payload, targetOrigin);
|
|
942
|
+
}
|
|
943
|
+
catch {
|
|
944
|
+
/* ignore cross-origin or detached frame */
|
|
945
|
+
}
|
|
938
946
|
return;
|
|
947
|
+
}
|
|
939
948
|
try {
|
|
940
|
-
|
|
949
|
+
const body = JSON.stringify(payload);
|
|
950
|
+
const host = window;
|
|
951
|
+
const bridge = host.CombosRuntimeBridge;
|
|
952
|
+
if (typeof bridge?.postMessage === "function") {
|
|
953
|
+
bridge.postMessage(body);
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
host.webkit?.messageHandlers?.combosRuntime?.postMessage(body);
|
|
941
957
|
}
|
|
942
958
|
catch {
|
|
943
|
-
/*
|
|
959
|
+
/* no native bridge */
|
|
944
960
|
}
|
|
945
961
|
}
|
|
946
962
|
/**
|