@thewhateverapp/tile-sdk 0.18.1 → 0.18.3
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/bridge/TileBridge.d.ts +46 -0
- package/dist/bridge/TileBridge.d.ts.map +1 -1
- package/dist/bridge/TileBridge.js +106 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react/useViewport.d.ts +4 -6
- package/dist/react/useViewport.d.ts.map +1 -1
- package/dist/react/useViewport.js +63 -6
- package/dist/spec/schema.d.ts +50 -50
- package/package.json +1 -1
|
@@ -33,6 +33,15 @@ export interface KeyboardState {
|
|
|
33
33
|
visible: boolean;
|
|
34
34
|
height: number;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Safe area insets from parent (for iframes that don't have access to env() values)
|
|
38
|
+
*/
|
|
39
|
+
export interface SafeAreaInsets {
|
|
40
|
+
top: number;
|
|
41
|
+
right: number;
|
|
42
|
+
bottom: number;
|
|
43
|
+
left: number;
|
|
44
|
+
}
|
|
36
45
|
/**
|
|
37
46
|
* Visibility state from parent (for TikTok-style feeds where tiles are preloaded)
|
|
38
47
|
* Includes muted state for atomic updates to prevent race conditions
|
|
@@ -58,7 +67,11 @@ export declare class TileBridge {
|
|
|
58
67
|
private currentToken;
|
|
59
68
|
private tokenExpiresAt;
|
|
60
69
|
private keyboardState;
|
|
70
|
+
private lastParentKeyboardAt;
|
|
71
|
+
private hasVisualViewport;
|
|
61
72
|
private visibilityState;
|
|
73
|
+
private safeAreaInsets;
|
|
74
|
+
private receivedSafeAreaMessage;
|
|
62
75
|
private receivedVisibilityMessage;
|
|
63
76
|
private mediaOriginalMutedState;
|
|
64
77
|
private trackedAudioContexts;
|
|
@@ -107,6 +120,17 @@ export declare class TileBridge {
|
|
|
107
120
|
* Handle keyboard state message from parent (mobile app)
|
|
108
121
|
*/
|
|
109
122
|
private handleKeyboard;
|
|
123
|
+
/**
|
|
124
|
+
* Handle safe area insets message from parent
|
|
125
|
+
* Iframes don't have access to CSS env(safe-area-inset-*) values,
|
|
126
|
+
* so the parent reads them and sends them to us
|
|
127
|
+
*/
|
|
128
|
+
private handleSafeAreaInsets;
|
|
129
|
+
/**
|
|
130
|
+
* Update keyboard state from internal detection (VisualViewport/focus) as a fallback
|
|
131
|
+
* Only applies in React Native WebView contexts and if parent hasn't sent recent updates
|
|
132
|
+
*/
|
|
133
|
+
private updateKeyboardStateFromInternal;
|
|
110
134
|
/**
|
|
111
135
|
* Handle audio status request from parent
|
|
112
136
|
* Returns actual muted state of all media for verification
|
|
@@ -366,6 +390,28 @@ export declare class TileBridge {
|
|
|
366
390
|
* @returns Unsubscribe function
|
|
367
391
|
*/
|
|
368
392
|
onVisibilityChange(handler: (state: VisibilityState) => void): () => void;
|
|
393
|
+
/**
|
|
394
|
+
* Get the current safe area insets
|
|
395
|
+
* Returns { top: 0, right: 0, bottom: 0, left: 0 } if no insets have been received from parent
|
|
396
|
+
* In iframes, CSS env() values return 0, so parent must send these values via bridge
|
|
397
|
+
*/
|
|
398
|
+
getSafeAreaInsets(): SafeAreaInsets;
|
|
399
|
+
/**
|
|
400
|
+
* Check if safe area insets have been received from parent
|
|
401
|
+
* Useful to know if you're running standalone (env() works) or in iframe (bridge provides values)
|
|
402
|
+
*/
|
|
403
|
+
hasSafeAreaInsets(): boolean;
|
|
404
|
+
/**
|
|
405
|
+
* Subscribe to safe area insets updates
|
|
406
|
+
* Called when parent sends updated insets (e.g., on orientation change)
|
|
407
|
+
*
|
|
408
|
+
* IMPORTANT: If insets have already been received from the parent,
|
|
409
|
+
* the handler is immediately called with the current state.
|
|
410
|
+
*
|
|
411
|
+
* @param handler Callback receiving { top, right, bottom, left }
|
|
412
|
+
* @returns Unsubscribe function
|
|
413
|
+
*/
|
|
414
|
+
onSafeAreaInsetsChange(handler: (insets: SafeAreaInsets) => void): () => void;
|
|
369
415
|
/**
|
|
370
416
|
* Register an AudioContext for mandatory muting when tile goes off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AiB,CAAA;SAAE,CAAC,CAAC;QACnD,QAAQ,EAAE,OAAO,CAAC;QAClB,QAAQ,EAAE,OAAO,CAAC;KACnB;IAyCD;;;OAGG;IACI,mBAAmB,IAAI,IAAI;IASlC;;;;;OAKG;IACU,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC;IAuBhD,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,aAAa;CAoDtB;AAKD,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,CAQ7D"}
|
|
@@ -15,11 +15,17 @@ export class TileBridge {
|
|
|
15
15
|
this.tokenExpiresAt = null;
|
|
16
16
|
// Keyboard state from parent (mobile app)
|
|
17
17
|
this.keyboardState = { visible: false, height: 0 };
|
|
18
|
+
// Track last keyboard update from native parent to allow fallback in RN WebView
|
|
19
|
+
this.lastParentKeyboardAt = 0;
|
|
20
|
+
this.hasVisualViewport = false;
|
|
18
21
|
// Visibility state from parent (for TikTok-style feeds)
|
|
19
22
|
// Includes muted state for atomic updates to prevent race conditions
|
|
20
23
|
// FAIL-SAFE: Default to muted=true until parent explicitly says otherwise
|
|
21
24
|
// This prevents audio leakage if visibility message is delayed or never arrives
|
|
22
25
|
this.visibilityState = { visible: true, muted: true };
|
|
26
|
+
// Safe area insets from parent (iframes don't have access to env() values)
|
|
27
|
+
this.safeAreaInsets = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
28
|
+
this.receivedSafeAreaMessage = false;
|
|
23
29
|
// Track whether we've received at least one visibility message from parent
|
|
24
30
|
this.receivedVisibilityMessage = false;
|
|
25
31
|
// Store original muted state of media elements to restore when unmuting
|
|
@@ -122,6 +128,7 @@ export class TileBridge {
|
|
|
122
128
|
// ==================== PLAN A: VisualViewport Detection ====================
|
|
123
129
|
// Use VisualViewport API to detect keyboard by monitoring viewport height changes
|
|
124
130
|
const vv = window.visualViewport;
|
|
131
|
+
this.hasVisualViewport = !!vv;
|
|
125
132
|
if (vv) {
|
|
126
133
|
// Set baseline height (full viewport without keyboard)
|
|
127
134
|
this.baselineViewportHeight = vv.height;
|
|
@@ -180,6 +187,8 @@ export class TileBridge {
|
|
|
180
187
|
currentHeight,
|
|
181
188
|
});
|
|
182
189
|
}
|
|
190
|
+
// Update local state as a fallback when parent doesn't send updates
|
|
191
|
+
this.updateKeyboardStateFromInternal({ visible: keyboardVisible, height: keyboardHeight }, 'viewport');
|
|
183
192
|
// Send keyboard state to parent (React Native)
|
|
184
193
|
this.sendToParent({
|
|
185
194
|
type: 'tile:keyboard',
|
|
@@ -223,6 +232,10 @@ export class TileBridge {
|
|
|
223
232
|
id: target.id || null,
|
|
224
233
|
},
|
|
225
234
|
});
|
|
235
|
+
// Fallback when VisualViewport isn't available
|
|
236
|
+
if (!this.hasVisualViewport) {
|
|
237
|
+
this.updateKeyboardStateFromInternal({ visible: true, height: 0 }, 'focus');
|
|
238
|
+
}
|
|
226
239
|
}
|
|
227
240
|
}
|
|
228
241
|
/**
|
|
@@ -251,6 +264,10 @@ export class TileBridge {
|
|
|
251
264
|
type: 'tile:input-blurred',
|
|
252
265
|
payload: {},
|
|
253
266
|
});
|
|
267
|
+
// Fallback when VisualViewport isn't available
|
|
268
|
+
if (!this.hasVisualViewport) {
|
|
269
|
+
this.updateKeyboardStateFromInternal({ visible: false, height: 0 }, 'focus');
|
|
270
|
+
}
|
|
254
271
|
}
|
|
255
272
|
}, 10);
|
|
256
273
|
}
|
|
@@ -329,6 +346,9 @@ export class TileBridge {
|
|
|
329
346
|
case 'parent:force-audio-sync':
|
|
330
347
|
this.forceSyncAudioState();
|
|
331
348
|
break;
|
|
349
|
+
case 'parent:safeAreaInsets':
|
|
350
|
+
this.handleSafeAreaInsets(message.payload);
|
|
351
|
+
break;
|
|
332
352
|
case 'parent:navigateToPage':
|
|
333
353
|
this.handleParentNavigate({ target: 'page' });
|
|
334
354
|
break;
|
|
@@ -424,11 +444,62 @@ export class TileBridge {
|
|
|
424
444
|
visible: !!payload.visible,
|
|
425
445
|
height: payload.height || 0,
|
|
426
446
|
};
|
|
447
|
+
this.lastParentKeyboardAt = Date.now();
|
|
427
448
|
// Always log keyboard state changes (helpful for debugging mobile issues)
|
|
428
449
|
console.log('[TileBridge] ⌨️ Received keyboard state', this.keyboardState);
|
|
429
450
|
// Emit keyboard update event for listeners
|
|
430
451
|
this.emitEvent('keyboard:update', this.keyboardState);
|
|
431
452
|
}
|
|
453
|
+
/**
|
|
454
|
+
* Handle safe area insets message from parent
|
|
455
|
+
* Iframes don't have access to CSS env(safe-area-inset-*) values,
|
|
456
|
+
* so the parent reads them and sends them to us
|
|
457
|
+
*/
|
|
458
|
+
handleSafeAreaInsets(payload) {
|
|
459
|
+
if (!payload || typeof payload.top !== 'number') {
|
|
460
|
+
console.warn('[TileBridge] Invalid safe area insets payload received');
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
this.receivedSafeAreaMessage = true;
|
|
464
|
+
this.safeAreaInsets = {
|
|
465
|
+
top: payload.top || 0,
|
|
466
|
+
right: payload.right || 0,
|
|
467
|
+
bottom: payload.bottom || 0,
|
|
468
|
+
left: payload.left || 0,
|
|
469
|
+
};
|
|
470
|
+
if (this.isDevelopment() || this.isPreview()) {
|
|
471
|
+
console.log('[TileBridge] 📐 Received safe area insets', this.safeAreaInsets);
|
|
472
|
+
}
|
|
473
|
+
// Emit safe area update event for listeners
|
|
474
|
+
this.emitEvent('safeAreaInsets:update', this.safeAreaInsets);
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Update keyboard state from internal detection (VisualViewport/focus) as a fallback
|
|
478
|
+
* Only applies in React Native WebView contexts and if parent hasn't sent recent updates
|
|
479
|
+
*/
|
|
480
|
+
updateKeyboardStateFromInternal(state, source) {
|
|
481
|
+
if (typeof window === 'undefined')
|
|
482
|
+
return;
|
|
483
|
+
if (!window.ReactNativeWebView)
|
|
484
|
+
return;
|
|
485
|
+
const now = Date.now();
|
|
486
|
+
if (now - this.lastParentKeyboardAt < 500) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
const nextState = {
|
|
490
|
+
visible: !!state.visible,
|
|
491
|
+
height: state.visible ? (state.height || 0) : 0,
|
|
492
|
+
};
|
|
493
|
+
if (this.keyboardState.visible === nextState.visible &&
|
|
494
|
+
Math.abs(this.keyboardState.height - nextState.height) <= 10) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
this.keyboardState = nextState;
|
|
498
|
+
if (this.isDevelopment() || this.isPreview()) {
|
|
499
|
+
console.log('[TileBridge] ⌨️ Fallback keyboard state', { ...nextState, source });
|
|
500
|
+
}
|
|
501
|
+
this.emitEvent('keyboard:update', this.keyboardState);
|
|
502
|
+
}
|
|
432
503
|
/**
|
|
433
504
|
* Handle audio status request from parent
|
|
434
505
|
* Returns actual muted state of all media for verification
|
|
@@ -1508,6 +1579,41 @@ export class TileBridge {
|
|
|
1508
1579
|
}
|
|
1509
1580
|
return this.on('visibility:update', handler);
|
|
1510
1581
|
}
|
|
1582
|
+
// ============= SAFE AREA INSETS API =============
|
|
1583
|
+
// For tiles in iframes that don't have access to CSS env(safe-area-inset-*) values
|
|
1584
|
+
/**
|
|
1585
|
+
* Get the current safe area insets
|
|
1586
|
+
* Returns { top: 0, right: 0, bottom: 0, left: 0 } if no insets have been received from parent
|
|
1587
|
+
* In iframes, CSS env() values return 0, so parent must send these values via bridge
|
|
1588
|
+
*/
|
|
1589
|
+
getSafeAreaInsets() {
|
|
1590
|
+
return { ...this.safeAreaInsets };
|
|
1591
|
+
}
|
|
1592
|
+
/**
|
|
1593
|
+
* Check if safe area insets have been received from parent
|
|
1594
|
+
* Useful to know if you're running standalone (env() works) or in iframe (bridge provides values)
|
|
1595
|
+
*/
|
|
1596
|
+
hasSafeAreaInsets() {
|
|
1597
|
+
return this.receivedSafeAreaMessage;
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* Subscribe to safe area insets updates
|
|
1601
|
+
* Called when parent sends updated insets (e.g., on orientation change)
|
|
1602
|
+
*
|
|
1603
|
+
* IMPORTANT: If insets have already been received from the parent,
|
|
1604
|
+
* the handler is immediately called with the current state.
|
|
1605
|
+
*
|
|
1606
|
+
* @param handler Callback receiving { top, right, bottom, left }
|
|
1607
|
+
* @returns Unsubscribe function
|
|
1608
|
+
*/
|
|
1609
|
+
onSafeAreaInsetsChange(handler) {
|
|
1610
|
+
// If we've already received insets from parent, immediately call handler
|
|
1611
|
+
if (this.receivedSafeAreaMessage) {
|
|
1612
|
+
console.log('[TileBridge] 📐 Replaying current safe area insets to new listener:', this.safeAreaInsets);
|
|
1613
|
+
setTimeout(() => handler(this.safeAreaInsets), 0);
|
|
1614
|
+
}
|
|
1615
|
+
return this.on('safeAreaInsets:update', handler);
|
|
1616
|
+
}
|
|
1511
1617
|
// ============= AUDIOCONTEXT REGISTRATION API =============
|
|
1512
1618
|
// Tiles with custom audio (WASM/Emscripten) MUST register their AudioContexts
|
|
1513
1619
|
// to be automatically suspended/resumed when the tile goes offscreen.
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type { VideoState, VideoControls, VideoContextValue, VideoPlayerProps, Cu
|
|
|
13
13
|
export { confetti } from './react/confetti.js';
|
|
14
14
|
export type { ConfettiOptions } from './react/confetti.js';
|
|
15
15
|
export { getTileBridge, TileBridge } from './bridge/TileBridge.js';
|
|
16
|
-
export type { TileMessage, TileConfig, TileTokenData, KeyboardState, VisibilityState } from './bridge/TileBridge.js';
|
|
16
|
+
export type { TileMessage, TileConfig, TileTokenData, KeyboardState, VisibilityState, SafeAreaInsets } from './bridge/TileBridge.js';
|
|
17
17
|
export { StateClient } from './state/StateClient.js';
|
|
18
18
|
export type { TileStats, ViewResponse } from './state/StateClient.js';
|
|
19
19
|
export * from './tools/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
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Y,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtE,cAAc,kBAAkB,CAAC;AAGjC,cAAc,YAAY,CAAC;AAG3B,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
right: number;
|
|
4
|
-
bottom: number;
|
|
5
|
-
left: number;
|
|
6
|
-
}
|
|
1
|
+
import { type SafeAreaInsets as BridgeSafeAreaInsets } from '../bridge/TileBridge.js';
|
|
2
|
+
export type SafeAreaInsets = BridgeSafeAreaInsets;
|
|
7
3
|
export interface ViewportInfo {
|
|
8
4
|
width: number;
|
|
9
5
|
height: number;
|
|
10
6
|
safeAreaInsets: SafeAreaInsets;
|
|
11
7
|
isVisualViewport: boolean;
|
|
8
|
+
/** True if safe area insets came from parent via bridge (iframe mode) */
|
|
9
|
+
safeAreaFromBridge: boolean;
|
|
12
10
|
}
|
|
13
11
|
export declare function useViewport(): ViewportInfo;
|
|
14
12
|
//# sourceMappingURL=useViewport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewport.d.ts","sourceRoot":"","sources":["../../src/react/useViewport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useViewport.d.ts","sourceRoot":"","sources":["../../src/react/useViewport.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,cAAc,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAGrG,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,yEAAyE;IACzE,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAmGD,wBAAgB,WAAW,IAAI,YAAY,CAuC1C"}
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { useEffect, useState, useCallback } from 'react';
|
|
2
|
+
import { getTileBridge } from '../bridge/TileBridge.js';
|
|
2
3
|
const defaultInsets = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Check if we're running in an iframe
|
|
6
|
+
*/
|
|
7
|
+
function isInIframe() {
|
|
8
|
+
if (typeof window === 'undefined')
|
|
9
|
+
return false;
|
|
10
|
+
// Traditional iframe check
|
|
11
|
+
if (window.self !== window.top)
|
|
12
|
+
return true;
|
|
13
|
+
// React Native WebView check
|
|
14
|
+
if (window.ReactNativeWebView)
|
|
15
|
+
return true;
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Read safe area insets from CSS env() values
|
|
20
|
+
* NOTE: This only works in the top-level document, not in iframes
|
|
21
|
+
*/
|
|
22
|
+
function readSafeAreaInsetsFromCSS() {
|
|
4
23
|
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
5
24
|
return defaultInsets;
|
|
6
25
|
}
|
|
@@ -32,38 +51,76 @@ function readSafeAreaInsets() {
|
|
|
32
51
|
document.body.removeChild(probe);
|
|
33
52
|
return insets;
|
|
34
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Get safe area insets - from bridge (iframe) or CSS (standalone)
|
|
56
|
+
*/
|
|
57
|
+
function getSafeAreaInsets() {
|
|
58
|
+
if (typeof window === 'undefined') {
|
|
59
|
+
return { insets: defaultInsets, fromBridge: false };
|
|
60
|
+
}
|
|
61
|
+
// In iframe context, prefer bridge-provided values (CSS env() returns 0 in iframes)
|
|
62
|
+
if (isInIframe()) {
|
|
63
|
+
try {
|
|
64
|
+
const bridge = getTileBridge();
|
|
65
|
+
if (bridge.hasSafeAreaInsets()) {
|
|
66
|
+
return { insets: bridge.getSafeAreaInsets(), fromBridge: true };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
// Bridge not available, fall back to CSS
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Standalone mode or bridge hasn't received values yet - read from CSS
|
|
74
|
+
return { insets: readSafeAreaInsetsFromCSS(), fromBridge: false };
|
|
75
|
+
}
|
|
35
76
|
function getViewportInfo() {
|
|
36
77
|
if (typeof window === 'undefined') {
|
|
37
|
-
return { width: 0, height: 0, safeAreaInsets: defaultInsets, isVisualViewport: false };
|
|
78
|
+
return { width: 0, height: 0, safeAreaInsets: defaultInsets, isVisualViewport: false, safeAreaFromBridge: false };
|
|
38
79
|
}
|
|
39
80
|
const visual = window.visualViewport;
|
|
40
81
|
const width = visual?.width ?? window.innerWidth;
|
|
41
82
|
const height = visual?.height ?? window.innerHeight;
|
|
83
|
+
const { insets, fromBridge } = getSafeAreaInsets();
|
|
42
84
|
return {
|
|
43
85
|
width,
|
|
44
86
|
height,
|
|
45
|
-
safeAreaInsets:
|
|
87
|
+
safeAreaInsets: insets,
|
|
46
88
|
isVisualViewport: Boolean(visual),
|
|
89
|
+
safeAreaFromBridge: fromBridge,
|
|
47
90
|
};
|
|
48
91
|
}
|
|
49
92
|
export function useViewport() {
|
|
50
93
|
const [info, setInfo] = useState(() => getViewportInfo());
|
|
94
|
+
const update = useCallback(() => setInfo(getViewportInfo()), []);
|
|
51
95
|
useEffect(() => {
|
|
52
96
|
if (typeof window === 'undefined')
|
|
53
97
|
return;
|
|
54
|
-
const update = () => setInfo(getViewportInfo());
|
|
55
98
|
const visual = window.visualViewport;
|
|
56
99
|
update();
|
|
57
100
|
window.addEventListener('resize', update);
|
|
58
101
|
window.addEventListener('orientationchange', update);
|
|
59
102
|
visual?.addEventListener('resize', update);
|
|
60
103
|
visual?.addEventListener('scroll', update);
|
|
104
|
+
// Subscribe to bridge safe area updates (for iframes)
|
|
105
|
+
let unsubscribe;
|
|
106
|
+
if (isInIframe()) {
|
|
107
|
+
try {
|
|
108
|
+
const bridge = getTileBridge();
|
|
109
|
+
unsubscribe = bridge.onSafeAreaInsetsChange(() => {
|
|
110
|
+
update();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
// Bridge not available
|
|
115
|
+
}
|
|
116
|
+
}
|
|
61
117
|
return () => {
|
|
62
118
|
window.removeEventListener('resize', update);
|
|
63
119
|
window.removeEventListener('orientationchange', update);
|
|
64
120
|
visual?.removeEventListener('resize', update);
|
|
65
121
|
visual?.removeEventListener('scroll', update);
|
|
122
|
+
unsubscribe?.();
|
|
66
123
|
};
|
|
67
|
-
}, []);
|
|
124
|
+
}, [update]);
|
|
68
125
|
return info;
|
|
69
126
|
}
|
package/dist/spec/schema.d.ts
CHANGED
|
@@ -139,28 +139,28 @@ declare const PlacementSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
139
139
|
}>>;
|
|
140
140
|
}, "strip", z.ZodTypeAny, {
|
|
141
141
|
type: "inset" | "fullscreen" | "positioned";
|
|
142
|
-
position?: {
|
|
143
|
-
x: string | number;
|
|
144
|
-
y: string | number;
|
|
145
|
-
} | undefined;
|
|
146
142
|
insets?: {
|
|
147
143
|
left?: number | undefined;
|
|
148
144
|
right?: number | undefined;
|
|
149
145
|
bottom?: number | undefined;
|
|
150
146
|
top?: number | undefined;
|
|
151
147
|
} | undefined;
|
|
152
|
-
}, {
|
|
153
|
-
type: "inset" | "fullscreen" | "positioned";
|
|
154
148
|
position?: {
|
|
155
149
|
x: string | number;
|
|
156
150
|
y: string | number;
|
|
157
151
|
} | undefined;
|
|
152
|
+
}, {
|
|
153
|
+
type: "inset" | "fullscreen" | "positioned";
|
|
158
154
|
insets?: {
|
|
159
155
|
left?: number | undefined;
|
|
160
156
|
right?: number | undefined;
|
|
161
157
|
bottom?: number | undefined;
|
|
162
158
|
top?: number | undefined;
|
|
163
159
|
} | undefined;
|
|
160
|
+
position?: {
|
|
161
|
+
x: string | number;
|
|
162
|
+
y: string | number;
|
|
163
|
+
} | undefined;
|
|
164
164
|
}>]>;
|
|
165
165
|
declare const OverlayCueSchema: z.ZodObject<{
|
|
166
166
|
id: z.ZodString;
|
|
@@ -217,28 +217,28 @@ declare const OverlayCueSchema: z.ZodObject<{
|
|
|
217
217
|
}>>;
|
|
218
218
|
}, "strip", z.ZodTypeAny, {
|
|
219
219
|
type: "inset" | "fullscreen" | "positioned";
|
|
220
|
-
position?: {
|
|
221
|
-
x: string | number;
|
|
222
|
-
y: string | number;
|
|
223
|
-
} | undefined;
|
|
224
220
|
insets?: {
|
|
225
221
|
left?: number | undefined;
|
|
226
222
|
right?: number | undefined;
|
|
227
223
|
bottom?: number | undefined;
|
|
228
224
|
top?: number | undefined;
|
|
229
225
|
} | undefined;
|
|
230
|
-
}, {
|
|
231
|
-
type: "inset" | "fullscreen" | "positioned";
|
|
232
226
|
position?: {
|
|
233
227
|
x: string | number;
|
|
234
228
|
y: string | number;
|
|
235
229
|
} | undefined;
|
|
230
|
+
}, {
|
|
231
|
+
type: "inset" | "fullscreen" | "positioned";
|
|
236
232
|
insets?: {
|
|
237
233
|
left?: number | undefined;
|
|
238
234
|
right?: number | undefined;
|
|
239
235
|
bottom?: number | undefined;
|
|
240
236
|
top?: number | undefined;
|
|
241
237
|
} | undefined;
|
|
238
|
+
position?: {
|
|
239
|
+
x: string | number;
|
|
240
|
+
y: string | number;
|
|
241
|
+
} | undefined;
|
|
242
242
|
}>]>;
|
|
243
243
|
dismiss: z.ZodOptional<z.ZodObject<{
|
|
244
244
|
on: z.ZodArray<z.ZodEnum<["tap-outside", "swipe-down", "timeout", "action", "time-window-end"]>, "many">;
|
|
@@ -268,16 +268,16 @@ declare const OverlayCueSchema: z.ZodObject<{
|
|
|
268
268
|
inset?: number | undefined;
|
|
269
269
|
} | {
|
|
270
270
|
type: "inset" | "fullscreen" | "positioned";
|
|
271
|
-
position?: {
|
|
272
|
-
x: string | number;
|
|
273
|
-
y: string | number;
|
|
274
|
-
} | undefined;
|
|
275
271
|
insets?: {
|
|
276
272
|
left?: number | undefined;
|
|
277
273
|
right?: number | undefined;
|
|
278
274
|
bottom?: number | undefined;
|
|
279
275
|
top?: number | undefined;
|
|
280
276
|
} | undefined;
|
|
277
|
+
position?: {
|
|
278
|
+
x: string | number;
|
|
279
|
+
y: string | number;
|
|
280
|
+
} | undefined;
|
|
281
281
|
};
|
|
282
282
|
zIndex?: number | undefined;
|
|
283
283
|
dismiss?: {
|
|
@@ -299,16 +299,16 @@ declare const OverlayCueSchema: z.ZodObject<{
|
|
|
299
299
|
inset?: number | undefined;
|
|
300
300
|
} | {
|
|
301
301
|
type: "inset" | "fullscreen" | "positioned";
|
|
302
|
-
position?: {
|
|
303
|
-
x: string | number;
|
|
304
|
-
y: string | number;
|
|
305
|
-
} | undefined;
|
|
306
302
|
insets?: {
|
|
307
303
|
left?: number | undefined;
|
|
308
304
|
right?: number | undefined;
|
|
309
305
|
bottom?: number | undefined;
|
|
310
306
|
top?: number | undefined;
|
|
311
307
|
} | undefined;
|
|
308
|
+
position?: {
|
|
309
|
+
x: string | number;
|
|
310
|
+
y: string | number;
|
|
311
|
+
} | undefined;
|
|
312
312
|
};
|
|
313
313
|
zIndex?: number | undefined;
|
|
314
314
|
dismiss?: {
|
|
@@ -498,28 +498,28 @@ export declare const OverlaySpecSchema: z.ZodObject<{
|
|
|
498
498
|
}>>;
|
|
499
499
|
}, "strip", z.ZodTypeAny, {
|
|
500
500
|
type: "inset" | "fullscreen" | "positioned";
|
|
501
|
-
position?: {
|
|
502
|
-
x: string | number;
|
|
503
|
-
y: string | number;
|
|
504
|
-
} | undefined;
|
|
505
501
|
insets?: {
|
|
506
502
|
left?: number | undefined;
|
|
507
503
|
right?: number | undefined;
|
|
508
504
|
bottom?: number | undefined;
|
|
509
505
|
top?: number | undefined;
|
|
510
506
|
} | undefined;
|
|
511
|
-
}, {
|
|
512
|
-
type: "inset" | "fullscreen" | "positioned";
|
|
513
507
|
position?: {
|
|
514
508
|
x: string | number;
|
|
515
509
|
y: string | number;
|
|
516
510
|
} | undefined;
|
|
511
|
+
}, {
|
|
512
|
+
type: "inset" | "fullscreen" | "positioned";
|
|
517
513
|
insets?: {
|
|
518
514
|
left?: number | undefined;
|
|
519
515
|
right?: number | undefined;
|
|
520
516
|
bottom?: number | undefined;
|
|
521
517
|
top?: number | undefined;
|
|
522
518
|
} | undefined;
|
|
519
|
+
position?: {
|
|
520
|
+
x: string | number;
|
|
521
|
+
y: string | number;
|
|
522
|
+
} | undefined;
|
|
523
523
|
}>]>;
|
|
524
524
|
dismiss: z.ZodOptional<z.ZodObject<{
|
|
525
525
|
on: z.ZodArray<z.ZodEnum<["tap-outside", "swipe-down", "timeout", "action", "time-window-end"]>, "many">;
|
|
@@ -549,16 +549,16 @@ export declare const OverlaySpecSchema: z.ZodObject<{
|
|
|
549
549
|
inset?: number | undefined;
|
|
550
550
|
} | {
|
|
551
551
|
type: "inset" | "fullscreen" | "positioned";
|
|
552
|
-
position?: {
|
|
553
|
-
x: string | number;
|
|
554
|
-
y: string | number;
|
|
555
|
-
} | undefined;
|
|
556
552
|
insets?: {
|
|
557
553
|
left?: number | undefined;
|
|
558
554
|
right?: number | undefined;
|
|
559
555
|
bottom?: number | undefined;
|
|
560
556
|
top?: number | undefined;
|
|
561
557
|
} | undefined;
|
|
558
|
+
position?: {
|
|
559
|
+
x: string | number;
|
|
560
|
+
y: string | number;
|
|
561
|
+
} | undefined;
|
|
562
562
|
};
|
|
563
563
|
zIndex?: number | undefined;
|
|
564
564
|
dismiss?: {
|
|
@@ -580,16 +580,16 @@ export declare const OverlaySpecSchema: z.ZodObject<{
|
|
|
580
580
|
inset?: number | undefined;
|
|
581
581
|
} | {
|
|
582
582
|
type: "inset" | "fullscreen" | "positioned";
|
|
583
|
-
position?: {
|
|
584
|
-
x: string | number;
|
|
585
|
-
y: string | number;
|
|
586
|
-
} | undefined;
|
|
587
583
|
insets?: {
|
|
588
584
|
left?: number | undefined;
|
|
589
585
|
right?: number | undefined;
|
|
590
586
|
bottom?: number | undefined;
|
|
591
587
|
top?: number | undefined;
|
|
592
588
|
} | undefined;
|
|
589
|
+
position?: {
|
|
590
|
+
x: string | number;
|
|
591
|
+
y: string | number;
|
|
592
|
+
} | undefined;
|
|
593
593
|
};
|
|
594
594
|
zIndex?: number | undefined;
|
|
595
595
|
dismiss?: {
|
|
@@ -613,16 +613,16 @@ export declare const OverlaySpecSchema: z.ZodObject<{
|
|
|
613
613
|
inset?: number | undefined;
|
|
614
614
|
} | {
|
|
615
615
|
type: "inset" | "fullscreen" | "positioned";
|
|
616
|
-
position?: {
|
|
617
|
-
x: string | number;
|
|
618
|
-
y: string | number;
|
|
619
|
-
} | undefined;
|
|
620
616
|
insets?: {
|
|
621
617
|
left?: number | undefined;
|
|
622
618
|
right?: number | undefined;
|
|
623
619
|
bottom?: number | undefined;
|
|
624
620
|
top?: number | undefined;
|
|
625
621
|
} | undefined;
|
|
622
|
+
position?: {
|
|
623
|
+
x: string | number;
|
|
624
|
+
y: string | number;
|
|
625
|
+
} | undefined;
|
|
626
626
|
};
|
|
627
627
|
zIndex?: number | undefined;
|
|
628
628
|
dismiss?: {
|
|
@@ -660,16 +660,16 @@ export declare const OverlaySpecSchema: z.ZodObject<{
|
|
|
660
660
|
inset?: number | undefined;
|
|
661
661
|
} | {
|
|
662
662
|
type: "inset" | "fullscreen" | "positioned";
|
|
663
|
-
position?: {
|
|
664
|
-
x: string | number;
|
|
665
|
-
y: string | number;
|
|
666
|
-
} | undefined;
|
|
667
663
|
insets?: {
|
|
668
664
|
left?: number | undefined;
|
|
669
665
|
right?: number | undefined;
|
|
670
666
|
bottom?: number | undefined;
|
|
671
667
|
top?: number | undefined;
|
|
672
668
|
} | undefined;
|
|
669
|
+
position?: {
|
|
670
|
+
x: string | number;
|
|
671
|
+
y: string | number;
|
|
672
|
+
} | undefined;
|
|
673
673
|
};
|
|
674
674
|
zIndex?: number | undefined;
|
|
675
675
|
dismiss?: {
|
|
@@ -745,16 +745,16 @@ export declare const OverlaySpecSchema: z.ZodObject<{
|
|
|
745
745
|
inset?: number | undefined;
|
|
746
746
|
} | {
|
|
747
747
|
type: "inset" | "fullscreen" | "positioned";
|
|
748
|
-
position?: {
|
|
749
|
-
x: string | number;
|
|
750
|
-
y: string | number;
|
|
751
|
-
} | undefined;
|
|
752
748
|
insets?: {
|
|
753
749
|
left?: number | undefined;
|
|
754
750
|
right?: number | undefined;
|
|
755
751
|
bottom?: number | undefined;
|
|
756
752
|
top?: number | undefined;
|
|
757
753
|
} | undefined;
|
|
754
|
+
position?: {
|
|
755
|
+
x: string | number;
|
|
756
|
+
y: string | number;
|
|
757
|
+
} | undefined;
|
|
758
758
|
};
|
|
759
759
|
zIndex?: number | undefined;
|
|
760
760
|
dismiss?: {
|
|
@@ -824,16 +824,16 @@ export declare const OverlaySpecSchema: z.ZodObject<{
|
|
|
824
824
|
inset?: number | undefined;
|
|
825
825
|
} | {
|
|
826
826
|
type: "inset" | "fullscreen" | "positioned";
|
|
827
|
-
position?: {
|
|
828
|
-
x: string | number;
|
|
829
|
-
y: string | number;
|
|
830
|
-
} | undefined;
|
|
831
827
|
insets?: {
|
|
832
828
|
left?: number | undefined;
|
|
833
829
|
right?: number | undefined;
|
|
834
830
|
bottom?: number | undefined;
|
|
835
831
|
top?: number | undefined;
|
|
836
832
|
} | undefined;
|
|
833
|
+
position?: {
|
|
834
|
+
x: string | number;
|
|
835
|
+
y: string | number;
|
|
836
|
+
} | undefined;
|
|
837
837
|
};
|
|
838
838
|
zIndex?: number | undefined;
|
|
839
839
|
dismiss?: {
|