@webview-bridge/web 1.4.3-nightly.0 → 1.4.4

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.
@@ -199,6 +199,15 @@ var linkBridgeStore = (initialState = {}) => {
199
199
  emitter.on("bridgeStateChange", (data) => {
200
200
  setState(data);
201
201
  });
202
+ document.addEventListener("visibilitychange", () => {
203
+ if (document.visibilityState === "visible") {
204
+ window.ReactNativeWebView?.postMessage(
205
+ JSON.stringify({
206
+ type: "getBridgeState"
207
+ })
208
+ );
209
+ }
210
+ });
202
211
  window.ReactNativeWebView?.postMessage(
203
212
  JSON.stringify({
204
213
  type: "getBridgeState"
@@ -169,6 +169,15 @@ var linkBridgeStore = (initialState = {}) => {
169
169
  emitter.on("bridgeStateChange", (data) => {
170
170
  setState(data);
171
171
  });
172
+ document.addEventListener("visibilitychange", () => {
173
+ if (document.visibilityState === "visible") {
174
+ window.ReactNativeWebView?.postMessage(
175
+ JSON.stringify({
176
+ type: "getBridgeState"
177
+ })
178
+ );
179
+ }
180
+ });
172
181
  window.ReactNativeWebView?.postMessage(
173
182
  JSON.stringify({
174
183
  type: "getBridgeState"
@@ -3,4 +3,5 @@ export * from "./createRandomId";
3
3
  export * from "./equals";
4
4
  export * from "./noop";
5
5
  export * from "./removeUndefinedKeys";
6
+ export * from "./stack";
6
7
  export * from "./timeout";
@@ -0,0 +1,9 @@
1
+ export declare class Stack<T> {
2
+ private items;
3
+ push(element: T): void;
4
+ pop(): T | undefined;
5
+ top(): T | undefined;
6
+ isEmpty(): boolean;
7
+ size(): number;
8
+ clear(): void;
9
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webview-bridge/web",
3
3
  "type": "module",
4
- "version": "1.4.3-nightly.0",
4
+ "version": "1.4.4",
5
5
  "description": "Fully Type-Safe Integration for React Native WebView and Web",
6
6
  "publishConfig": {
7
7
  "access": "public"