@wvdsh/sdk-js 0.0.34 → 0.0.35

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5075,7 +5075,8 @@ var WavedashSDK = (() => {
5075
5075
  GET_SDK_CONFIG: "GetSDKConfig",
5076
5076
  PROGRESS_UPDATE: "ProgressUpdate",
5077
5077
  LOADING_COMPLETE: "LoadingComplete",
5078
- TOGGLE_OVERLAY: "ToggleOverlay"
5078
+ TOGGLE_OVERLAY: "ToggleOverlay",
5079
+ TAKE_FOCUS: "TakeFocus"
5079
5080
  };
5080
5081
 
5081
5082
  // node_modules/convex/dist/esm/server/pagination.js
@@ -7449,6 +7450,23 @@ var WavedashSDK = (() => {
7449
7450
  this.pendingRequests.delete(event.data.requestId);
7450
7451
  pending.resolve(event.data.data);
7451
7452
  }
7453
+ } else if (event.data?.type === IFRAME_MESSAGE_TYPE.TAKE_FOCUS) {
7454
+ console.log("[IFRAME MESSENGER] Taking focus");
7455
+ if (typeof document !== "undefined") {
7456
+ const gameFocusTargets = document.getElementsByClassName("game-focus-target");
7457
+ if (gameFocusTargets.length > 0) {
7458
+ console.log("[IFRAME MESSENGER] Focusing on game focus target");
7459
+ gameFocusTargets[0].focus();
7460
+ } else {
7461
+ const focusableElement = document.querySelector(
7462
+ "canvas, input, button, [tabindex]:not([tabindex='-1'])"
7463
+ );
7464
+ if (focusableElement) {
7465
+ console.log("[IFRAME MESSENGER] Focusing on fallback target");
7466
+ focusableElement.focus();
7467
+ }
7468
+ }
7469
+ }
7452
7470
  }
7453
7471
  };
7454
7472
  this.pendingRequests = /* @__PURE__ */ new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wvdsh/sdk-js",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "Wavedash JavaScript SDK",
5
5
  "main": "./dist/index.js",
6
6
  "files": [