@symbiote-native/cellular 0.3.0 → 2.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.
Files changed (2) hide show
  1. package/README.md +91 -20
  2. package/package.json +27 -15
package/README.md CHANGED
@@ -40,8 +40,8 @@ package with zero further changes:
40
40
 
41
41
  Full mechanics — the Podfile pieces that normally ship inside the `expo` package, the `expo`
42
42
  peer-dependency exclusion list, per-module permission strings — live in the
43
- `symbiote-expo-native-module` project skill. This wiring is already done for all four
44
- `examples/expo-*` canary apps (React, Vue SFC, Vue TSX, Angular).
43
+ `symbiote-expo-native-module` project skill. This wiring is already done for all six
44
+ `examples/expo-*` canary apps (React, Vue SFC, Vue TSX, Svelte, Solid, Angular).
45
45
 
46
46
  ## Shape
47
47
 
@@ -89,12 +89,12 @@ function CellularScreen() {
89
89
 
90
90
  return (
91
91
  <>
92
- <Text>
92
+ <text>
93
93
  {generation === null ? 'checking…' : CellularGeneration[generation]}
94
- </Text>
95
- <Text>{carrierName ?? 'checking…'}</Text>
96
- <Text>{status === null ? 'checking…' : status.status}</Text>
97
- <Button title="Request permission" onPress={() => requestPermission()} />
94
+ </text>
95
+ <text>{carrierName ?? 'checking…'}</text>
96
+ <text>{status === null ? 'checking…' : status.status}</text>
97
+ <button title="Request permission" onPress={() => requestPermission()} />
98
98
  </>
99
99
  );
100
100
  }
@@ -125,15 +125,85 @@ onMounted(() => {
125
125
  });
126
126
  </script>
127
127
  <template>
128
- <Text>{{
128
+ <text>{{
129
129
  generation === null ? 'checking…' : CellularGeneration[generation]
130
- }}</Text>
131
- <Text>{{ carrierName ?? 'checking…' }}</Text>
132
- <Text>{{ status === null ? 'checking…' : status.status }}</Text>
133
- <Button title="Request permission" :onPress="() => requestPermission()" />
130
+ }}</text>
131
+ <text>{{ carrierName ?? 'checking…' }}</text>
132
+ <text>{{ status === null ? 'checking…' : status.status }}</text>
133
+ <button title="Request permission" :onPress="() => requestPermission()" />
134
134
  </template>
135
135
  ```
136
136
 
137
+ ```svelte
138
+ <!-- Svelte -->
139
+ <script lang="ts">
140
+ import {
141
+ CellularGeneration,
142
+ getCarrierNameAsync,
143
+ getCellularGenerationAsync,
144
+ usePermissions,
145
+ } from '@symbiote-native/cellular/svelte';
146
+
147
+ let generation = $state<CellularGeneration | null>(null);
148
+ let carrierName = $state<string | null>(null);
149
+ const permissions = usePermissions(); // boxed getter: permissions.status / .request()
150
+
151
+ Promise.all([getCellularGenerationAsync(), getCarrierNameAsync()]).then(
152
+ ([gen, carrier]) => {
153
+ generation = gen;
154
+ carrierName = carrier;
155
+ },
156
+ );
157
+ </script>
158
+
159
+ <text>{generation === null ? 'checking…' : CellularGeneration[generation]}</text
160
+ >
161
+ <text>{carrierName ?? 'checking…'}</text>
162
+ <text
163
+ >{permissions.status === null ? 'checking…' : permissions.status.status}</text
164
+ >
165
+ <button title="Request permission" onPress={() => permissions.request()} />
166
+ ```
167
+
168
+ ```tsx
169
+ // Solid
170
+ import { createSignal } from 'solid-js';
171
+ import {
172
+ CellularGeneration,
173
+ getCarrierNameAsync,
174
+ getCellularGenerationAsync,
175
+ } from '@symbiote-native/cellular';
176
+ import { createPermissions } from '@symbiote-native/cellular/solid';
177
+
178
+ function CellularScreen() {
179
+ const [generation, setGeneration] = createSignal<CellularGeneration | null>(
180
+ null,
181
+ );
182
+ const [carrierName, setCarrierName] = createSignal<string | null>(null);
183
+ const { status, request: requestPermission } = createPermissions();
184
+
185
+ Promise.all([getCellularGenerationAsync(), getCarrierNameAsync()]).then(
186
+ ([gen, carrier]) => {
187
+ setGeneration(gen);
188
+ setCarrierName(carrier);
189
+ },
190
+ );
191
+
192
+ return (
193
+ <>
194
+ <text>
195
+ {generation() === null
196
+ ? 'checking…'
197
+ : CellularGeneration[generation()!]}
198
+ </text>
199
+ <text>{carrierName() ?? 'checking…'}</text>
200
+ <text>{status() === null ? 'checking…' : status()!.status}</text>
201
+ <button title="Request permission" onPress={() => requestPermission()} />
202
+ </>
203
+ );
204
+ }
205
+ ```
206
+
137
207
  ```ts
138
208
  // Angular
139
209
  import { Component, inject, signal } from '@angular/core';
@@ -147,15 +217,15 @@ import {
147
217
  @Component({
148
218
  selector: 'CellularScreen',
149
219
  template: `
150
- <Text>{{
220
+ <text>{{
151
221
  generation() === null ? 'checking…' : CellularGeneration[generation()!]
152
- }}</Text>
153
- <Text>{{ carrierName() ?? 'checking…' }}</Text>
154
- <Text>{{ permissionStatus()?.status ?? 'checking…' }}</Text>
155
- <Button
222
+ }}</text>
223
+ <text>{{ carrierName() ?? 'checking…' }}</text>
224
+ <text>{{ permissionStatus()?.status ?? 'checking…' }}</text>
225
+ <button
156
226
  title="Request permission"
157
227
  (press)="permissionsService.request()"
158
- ></Button>
228
+ ></button>
159
229
  `,
160
230
  })
161
231
  export class CellularScreen {
@@ -178,8 +248,9 @@ export class CellularScreen {
178
248
  ```
179
249
 
180
250
  Trimmed from the real demo screens — `examples/expo-react/screens/CellularScreen.tsx` and its
181
- Vue SFC, Vue TSX, and Angular twins (`examples/expo-vue-sfc/screens/CellularScreen.vue`,
182
- `examples/expo-vue-tsx/screens/CellularScreen.tsx`, `examples/expo-angular/src/screens/CellularScreen.ts`),
251
+ Vue SFC, Vue TSX, Svelte, Solid, and Angular twins (`examples/expo-vue-sfc/screens/CellularScreen.vue`,
252
+ `examples/expo-vue-tsx/screens/CellularScreen.tsx`, `examples/expo-svelte/screens/CellularScreen.svelte`,
253
+ `examples/expo-solid/screens/CellularScreen.tsx`, `examples/expo-angular/src/screens/CellularScreen.ts`),
183
254
  which also cover `allowsVoipAsync`/`getIsoCountryCodeAsync`/`getMobileCountryCodeAsync`/
184
255
  `getMobileNetworkCodeAsync` and gate the Android-only fields behind `Platform.OS === 'android'`.
185
256
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbiote-native/cellular",
3
- "version": "0.3.0",
3
+ "version": "2.0.0",
4
4
  "description": "expo-cellular wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Cellular generation (2G/3G/4G/5G), carrier/SIM info on Android (ISO country code, carrier name, MCC/MNC), VoIP-support detection, and the permission get/request pair gating carrier info on Android.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -13,6 +13,18 @@
13
13
  "url": "https://github.com/OneEyed1366/symbiote-native/issues"
14
14
  },
15
15
  "author": "Andrey Prokopenko <psevdoproger@gmail.com>",
16
+ "keywords": [
17
+ "react-native",
18
+ "symbiote-native",
19
+ "expo-cellular",
20
+ "react",
21
+ "vue",
22
+ "svelte",
23
+ "solid",
24
+ "angular",
25
+ "carrier-info",
26
+ "cellular-generation"
27
+ ],
16
28
  "type": "module",
17
29
  "main": "./build/core/index.js",
18
30
  "module": "./build/core/index.js",
@@ -61,19 +73,19 @@
61
73
  "expo-modules-core": "57.0.5"
62
74
  },
63
75
  "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
76
  "@angular/core": ">=20",
71
77
  "@vue/runtime-core": "^3.5.13",
72
78
  "react": ">=19.0.0",
73
79
  "react-native": ">=0.86",
74
80
  "solid-js": ">=1.9.0",
75
81
  "svelte": ">=5.56.0",
76
- "vue": ">=3.5.0"
82
+ "vue": ">=3.5.0",
83
+ "@symbiote-native/angular": "^2.0.0",
84
+ "@symbiote-native/engine": "^0.5.0",
85
+ "@symbiote-native/react": "^2.0.0",
86
+ "@symbiote-native/solid": "^2.0.0",
87
+ "@symbiote-native/svelte": "^2.0.0",
88
+ "@symbiote-native/vue": "^2.0.0"
77
89
  },
78
90
  "peerDependenciesMeta": {
79
91
  "@symbiote-native/angular": {
@@ -121,13 +133,13 @@
121
133
  "solid-js": "^1.9.14",
122
134
  "svelte": "^5.56.0",
123
135
  "typescript": "~6.0.0",
124
- "@symbiote-native/angular": "0.8.0",
125
- "@symbiote-native/engine": "0.3.0",
126
- "@symbiote-native/react": "0.4.0",
127
- "@symbiote-native/solid": "0.1.0",
128
- "@symbiote-native/svelte": "0.3.0",
129
- "@symbiote-native/test-utils": "0.2.0",
130
- "@symbiote-native/vue": "0.5.0"
136
+ "@symbiote-native/angular": "2.0.0",
137
+ "@symbiote-native/engine": "0.5.0",
138
+ "@symbiote-native/react": "2.0.0",
139
+ "@symbiote-native/solid": "2.0.0",
140
+ "@symbiote-native/svelte": "2.0.0",
141
+ "@symbiote-native/test-utils": "0.3.0",
142
+ "@symbiote-native/vue": "2.0.0"
131
143
  },
132
144
  "scripts": {
133
145
  "typecheck": "tsc --build",