@symbiote-native/web-browser 0.3.0 → 1.0.0
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/README.md +30 -10
- package/package.json +26 -15
package/README.md
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
A wrapper package for [SymbioteNative](../../README.md) that makes
|
|
4
4
|
[`expo-web-browser`](https://github.com/expo/expo/tree/main/packages/expo-web-browser) — an in-app
|
|
5
5
|
browser (`SFSafariViewController` on iOS, Chrome Custom Tabs on Android) plus the OAuth
|
|
6
|
-
auth-session flow — usable from **every** adapter, React, Vue, and Angular, not just
|
|
7
|
-
the same way as [`@symbiote-native/secure-store`](../secure-store): an
|
|
8
|
-
wrapper (see the `symbiote-expo-native-module` project skill for the full
|
|
9
|
-
`expo-modules-core` is depended on directly and never the `expo` meta-package, why
|
|
10
|
-
is hand-ported into `core/` rather than imported, and how autolinking picks up the
|
|
6
|
+
auth-session flow — usable from **every** adapter, React, Vue, Svelte, Solid, and Angular, not just
|
|
7
|
+
React. Built the same way as [`@symbiote-native/secure-store`](../secure-store): an
|
|
8
|
+
`expo-modules-core`-based wrapper (see the `symbiote-expo-native-module` project skill for the full
|
|
9
|
+
mechanism — why `expo-modules-core` is depended on directly and never the `expo` meta-package, why
|
|
10
|
+
the upstream JS is hand-ported into `core/` rather than imported, and how autolinking picks up the
|
|
11
|
+
native module).
|
|
11
12
|
|
|
12
13
|
## Install
|
|
13
14
|
|
|
@@ -48,11 +49,11 @@ src/core/ the whole API: open/dismiss, the auth session, and the
|
|
|
48
49
|
src/angular/ @symbiote-native/web-browser/angular
|
|
49
50
|
```
|
|
50
51
|
|
|
51
|
-
`./react`, `./vue`, and `./
|
|
52
|
-
physical per-framework file. Every export is a stateless free function; the one
|
|
53
|
-
state — the Android auth-session polyfill's redirect subscription — belongs to a
|
|
54
|
-
promise inside the core and never surfaces as something a caller subscribes to or
|
|
55
|
-
there is nothing for a hook, composable, or service to wrap, the same reason
|
|
52
|
+
`./react`, `./vue`, `./svelte`, and `./solid` are `exports`-map aliases straight onto
|
|
53
|
+
`src/core/` — no physical per-framework file. Every export is a stateless free function; the one
|
|
54
|
+
piece of live state — the Android auth-session polyfill's redirect subscription — belongs to a
|
|
55
|
+
single in-flight promise inside the core and never surfaces as something a caller subscribes to or
|
|
56
|
+
tears down. So there is nothing for a hook, composable, or service to wrap, the same reason
|
|
56
57
|
[`@symbiote-native/secure-store`](../secure-store) does the same. `./angular` stays a physical
|
|
57
58
|
file/subpath since Angular ships through a separate `ngc`/AOT build (`build-ngc/`). Import from
|
|
58
59
|
`@symbiote-native/web-browser` directly if you don't care which adapter you're on; the per-adapter
|
|
@@ -66,6 +67,25 @@ import * as WebBrowser from '@symbiote-native/web-browser';
|
|
|
66
67
|
await WebBrowser.openBrowserAsync('https://example.com');
|
|
67
68
|
```
|
|
68
69
|
|
|
70
|
+
Every framework subpath re-exports the identical free functions — pick whichever import matches
|
|
71
|
+
the app's own adapter, or the bare package if you don't care:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
import { openBrowserAsync } from '@symbiote-native/web-browser/react';
|
|
75
|
+
import { openBrowserAsync } from '@symbiote-native/web-browser/vue';
|
|
76
|
+
import { openBrowserAsync } from '@symbiote-native/web-browser/svelte';
|
|
77
|
+
import { openBrowserAsync } from '@symbiote-native/web-browser/solid';
|
|
78
|
+
import { openBrowserAsync } from '@symbiote-native/web-browser/angular';
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
These mirror the real canary demo screens —
|
|
82
|
+
`examples/expo-react/screens/WebBrowserScreen.tsx`,
|
|
83
|
+
`examples/expo-vue-sfc/screens/WebBrowserScreen.vue`,
|
|
84
|
+
`examples/expo-vue-tsx/screens/WebBrowserScreen.tsx`,
|
|
85
|
+
`examples/expo-svelte/screens/WebBrowserScreen.svelte`,
|
|
86
|
+
`examples/expo-solid/screens/WebBrowserScreen.tsx`,
|
|
87
|
+
`examples/expo-angular/src/screens/WebBrowserScreen.ts`.
|
|
88
|
+
|
|
69
89
|
The in-app browser keeps the user inside the app, unlike `Linking.openURL`, which hands them off to
|
|
70
90
|
the system browser. iOS resolves once the browser closes (`{ type: 'cancel' }`, or
|
|
71
91
|
`{ type: 'dismiss' }` if you closed it yourself with `dismissBrowser()`); Android resolves with
|
package/package.json
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/web-browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "expo-web-browser wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. In-app browser (SFSafariViewController / Android Custom Tabs) and the OAuth auth-session flow.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react-native",
|
|
7
|
+
"symbiote-native",
|
|
8
|
+
"react",
|
|
9
|
+
"vue",
|
|
10
|
+
"svelte",
|
|
11
|
+
"solid",
|
|
12
|
+
"angular",
|
|
13
|
+
"in-app-browser",
|
|
14
|
+
"oauth"
|
|
15
|
+
],
|
|
5
16
|
"license": "MIT",
|
|
6
17
|
"repository": {
|
|
7
18
|
"type": "git",
|
|
@@ -61,19 +72,19 @@
|
|
|
61
72
|
"expo-modules-core": "57.0.5"
|
|
62
73
|
},
|
|
63
74
|
"peerDependencies": {
|
|
64
|
-
"@symbiote-native/angular": ">=0.6.2",
|
|
65
|
-
"@symbiote-native/engine": ">=0.1.7",
|
|
66
|
-
"@symbiote-native/react": ">=0.2.8",
|
|
67
|
-
"@symbiote-native/solid": ">=0.0.1",
|
|
68
|
-
"@symbiote-native/svelte": ">=0.1.0",
|
|
69
|
-
"@symbiote-native/vue": ">=0.3.8",
|
|
70
75
|
"@angular/core": ">=20",
|
|
71
76
|
"@vue/runtime-core": "^3.5.13",
|
|
72
77
|
"react": ">=19.0.0",
|
|
73
78
|
"react-native": ">=0.86",
|
|
74
79
|
"solid-js": ">=1.9.0",
|
|
75
80
|
"svelte": ">=5.56.0",
|
|
76
|
-
"vue": ">=3.5.0"
|
|
81
|
+
"vue": ">=3.5.0",
|
|
82
|
+
"@symbiote-native/angular": "^1.0.0",
|
|
83
|
+
"@symbiote-native/engine": "^0.4.0",
|
|
84
|
+
"@symbiote-native/react": "^1.0.0",
|
|
85
|
+
"@symbiote-native/svelte": "^1.0.0",
|
|
86
|
+
"@symbiote-native/solid": "^1.0.0",
|
|
87
|
+
"@symbiote-native/vue": "^1.0.0"
|
|
77
88
|
},
|
|
78
89
|
"peerDependenciesMeta": {
|
|
79
90
|
"@symbiote-native/angular": {
|
|
@@ -121,13 +132,13 @@
|
|
|
121
132
|
"solid-js": "^1.9.14",
|
|
122
133
|
"svelte": "^5.56.0",
|
|
123
134
|
"typescript": "~6.0.0",
|
|
124
|
-
"@symbiote-native/angular": "0.
|
|
125
|
-
"@symbiote-native/engine": "0.
|
|
126
|
-
"@symbiote-native/
|
|
127
|
-
"@symbiote-native/
|
|
128
|
-
"@symbiote-native/svelte": "0.
|
|
129
|
-
"@symbiote-native/test-utils": "0.
|
|
130
|
-
"@symbiote-native/vue": "0.
|
|
135
|
+
"@symbiote-native/angular": "1.0.0",
|
|
136
|
+
"@symbiote-native/engine": "0.4.0",
|
|
137
|
+
"@symbiote-native/react": "1.0.0",
|
|
138
|
+
"@symbiote-native/solid": "1.0.0",
|
|
139
|
+
"@symbiote-native/svelte": "1.0.0",
|
|
140
|
+
"@symbiote-native/test-utils": "0.3.0",
|
|
141
|
+
"@symbiote-native/vue": "1.0.0"
|
|
131
142
|
},
|
|
132
143
|
"scripts": {
|
|
133
144
|
"typecheck": "tsc --build",
|