@livx.cc/native-kit 0.45.24 → 0.45.25
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/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/modules/webview.ts +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livx.cc/native-kit",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.25",
|
|
4
4
|
"description": "Isomorphic native-capabilities kit for PWAs — same API in browser and in an appwrap native shell. Zero dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Elya Livshitz",
|
package/src/index.ts
CHANGED
|
@@ -43,7 +43,7 @@ export { isScanResult } from './modules/scanner';
|
|
|
43
43
|
export type { SpeechVoice, SpeakOptions, ListenOptions, SpeechPartial } from './modules/speech';
|
|
44
44
|
export type { CalendarEventOptions } from './modules/calendar';
|
|
45
45
|
export type { BrowserOptions } from './modules/browser';
|
|
46
|
-
export type { WebViewState, WebViewOpenOptions, WebViewNavOp, WebViewFabOptions } from './modules/webview';
|
|
46
|
+
export type { WebViewState, WebViewOpenOptions, WebViewNavOp, WebViewFabOptions, WebViewFloatOptions } from './modules/webview';
|
|
47
47
|
export type { OAuthAuthorizeParams, OAuthResult } from './modules/oauth';
|
|
48
48
|
export type { TrackingStatus } from './modules/tracking';
|
|
49
49
|
export type {
|
package/src/modules/webview.ts
CHANGED
|
@@ -30,6 +30,12 @@ export interface WebViewFabOptions {
|
|
|
30
30
|
label?: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
export interface WebViewFloatOptions {
|
|
34
|
+
on: boolean;
|
|
35
|
+
/** The app's touchable boxes over the page (CSS px from the app WebView's top-left). */
|
|
36
|
+
hit?: { x: number; y: number; w: number; h: number }[];
|
|
37
|
+
}
|
|
38
|
+
|
|
33
39
|
/** A cookie as data; `expires` = unix seconds, absent/null = session cookie. A leading-dot `domain` = domain cookie. */
|
|
34
40
|
export interface WebViewCookie {
|
|
35
41
|
name: string;
|
|
@@ -101,6 +107,14 @@ export class WebViewModule {
|
|
|
101
107
|
return this.kit.invoke('webview.fab', { ...opts });
|
|
102
108
|
}
|
|
103
109
|
|
|
110
|
+
/** Float the app's WebView OVER the overlay: it draws on top (transparent wherever the app's own page is — give the
|
|
111
|
+
* area over the overlay no background), so e.g. chat bubbles float over a shown page without resizing it. Touches
|
|
112
|
+
* inside `hit` (app CSS px, viewport coords) go to the app; everywhere else to the page. Call again to move the rects;
|
|
113
|
+
* `on:false` restores. iOS; elsewhere resolves `{floating:false}` — keep a fallback (e.g. inset the page). */
|
|
114
|
+
float(opts: WebViewFloatOptions): Promise<{ floating: boolean }> {
|
|
115
|
+
return this.kit.invoke('webview.float', { ...opts });
|
|
116
|
+
}
|
|
117
|
+
|
|
104
118
|
onFab(cb: () => void): Unsubscribe {
|
|
105
119
|
return this.kit.on('webview.fab', () => cb());
|
|
106
120
|
}
|