@symbiote-native/network 1.0.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.
- package/README.md +19 -20
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -95,13 +95,13 @@ function NetworkScreen() {
|
|
|
95
95
|
|
|
96
96
|
return (
|
|
97
97
|
<>
|
|
98
|
-
<
|
|
98
|
+
<text>
|
|
99
99
|
{networkState.isConnected
|
|
100
100
|
? `Connected via ${networkState.type}`
|
|
101
101
|
: 'Offline'}
|
|
102
|
-
</
|
|
103
|
-
<
|
|
104
|
-
<
|
|
102
|
+
</text>
|
|
103
|
+
<text>{ipAddress ?? 'checking…'}</text>
|
|
104
|
+
<text>{isAirplaneMode ? 'Airplane mode: On' : 'Airplane mode: Off'}</text>
|
|
105
105
|
</>
|
|
106
106
|
);
|
|
107
107
|
}
|
|
@@ -111,7 +111,6 @@ function NetworkScreen() {
|
|
|
111
111
|
<!-- Vue — examples/expo-vue-sfc/screens/NetworkScreen.vue -->
|
|
112
112
|
<script setup lang="ts">
|
|
113
113
|
import { ref, watch } from 'vue';
|
|
114
|
-
import { Text } from '@symbiote-native/vue';
|
|
115
114
|
import {
|
|
116
115
|
getIpAddressAsync,
|
|
117
116
|
isAirplaneModeEnabledAsync,
|
|
@@ -136,10 +135,10 @@ watch(
|
|
|
136
135
|
);
|
|
137
136
|
</script>
|
|
138
137
|
<template>
|
|
139
|
-
<
|
|
138
|
+
<text>{{
|
|
140
139
|
networkState.isConnected ? `Connected via ${networkState.type}` : 'Offline'
|
|
141
|
-
}}</
|
|
142
|
-
<
|
|
140
|
+
}}</text>
|
|
141
|
+
<text>{{ ipAddress ?? 'checking…' }}</text>
|
|
143
142
|
</template>
|
|
144
143
|
```
|
|
145
144
|
|
|
@@ -166,18 +165,19 @@ watch(
|
|
|
166
165
|
);
|
|
167
166
|
});
|
|
168
167
|
</script>
|
|
169
|
-
|
|
168
|
+
|
|
169
|
+
<text>
|
|
170
170
|
{networkState.current.isConnected
|
|
171
171
|
? `Connected via ${networkState.current.type}`
|
|
172
172
|
: 'Offline'}
|
|
173
|
-
</
|
|
174
|
-
<
|
|
173
|
+
</text>
|
|
174
|
+
<text>{ipAddress ?? 'checking…'}</text>
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
```ts
|
|
178
178
|
// Angular — examples/expo-angular/src/screens/NetworkScreen.ts
|
|
179
179
|
import { Component, effect, inject, signal } from '@angular/core';
|
|
180
|
-
import {
|
|
180
|
+
import { SYMBIOTE_ELEMENTS } from '@symbiote-native/angular';
|
|
181
181
|
import {
|
|
182
182
|
NetworkStateService,
|
|
183
183
|
getIpAddressAsync,
|
|
@@ -186,8 +186,8 @@ import {
|
|
|
186
186
|
|
|
187
187
|
@Component({
|
|
188
188
|
standalone: true,
|
|
189
|
-
imports: [
|
|
190
|
-
template: `<
|
|
189
|
+
imports: [SYMBIOTE_ELEMENTS],
|
|
190
|
+
template: `<text>{{ ipAddress() }}</text>`,
|
|
191
191
|
})
|
|
192
192
|
export class NetworkScreen {
|
|
193
193
|
readonly networkState = inject(NetworkStateService).connect(); // Signal<NetworkState>
|
|
@@ -209,7 +209,6 @@ export class NetworkScreen {
|
|
|
209
209
|
```tsx
|
|
210
210
|
// Solid — the accessor is CALLED; a Solid component body runs once, so a snapshot would freeze.
|
|
211
211
|
import { createSignal, onMount } from 'solid-js';
|
|
212
|
-
import { Text } from '@symbiote-native/solid';
|
|
213
212
|
import {
|
|
214
213
|
getIpAddressAsync,
|
|
215
214
|
isAirplaneModeEnabledAsync,
|
|
@@ -234,15 +233,15 @@ function NetworkScreen() {
|
|
|
234
233
|
|
|
235
234
|
return (
|
|
236
235
|
<>
|
|
237
|
-
<
|
|
236
|
+
<text>
|
|
238
237
|
{networkState().isConnected
|
|
239
238
|
? `Connected via ${networkState().type}`
|
|
240
239
|
: 'Offline'}
|
|
241
|
-
</
|
|
242
|
-
<
|
|
243
|
-
<
|
|
240
|
+
</text>
|
|
241
|
+
<text>{ipAddress() ?? 'checking…'}</text>
|
|
242
|
+
<text>
|
|
244
243
|
{isAirplaneMode() ? 'Airplane mode: On' : 'Airplane mode: Off'}
|
|
245
|
-
</
|
|
244
|
+
</text>
|
|
246
245
|
</>
|
|
247
246
|
);
|
|
248
247
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/network",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "expo-network wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Network state (type/connected/internet-reachable) with a change listener, device IP address, and airplane-mode detection.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
"solid-js": ">=1.9.0",
|
|
81
81
|
"svelte": ">=5.56.0",
|
|
82
82
|
"vue": ">=3.5.0",
|
|
83
|
-
"@symbiote-native/angular": "^
|
|
84
|
-
"@symbiote-native/engine": "^0.
|
|
85
|
-
"@symbiote-native/react": "^
|
|
86
|
-
"@symbiote-native/solid": "^
|
|
87
|
-
"@symbiote-native/svelte": "^
|
|
88
|
-
"@symbiote-native/vue": "^
|
|
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"
|
|
89
89
|
},
|
|
90
90
|
"peerDependenciesMeta": {
|
|
91
91
|
"@symbiote-native/angular": {
|
|
@@ -133,13 +133,13 @@
|
|
|
133
133
|
"solid-js": "^1.9.14",
|
|
134
134
|
"svelte": "^5.56.0",
|
|
135
135
|
"typescript": "~6.0.0",
|
|
136
|
-
"@symbiote-native/angular": "
|
|
137
|
-
"@symbiote-native/engine": "0.
|
|
138
|
-
"@symbiote-native/react": "
|
|
139
|
-
"@symbiote-native/solid": "
|
|
140
|
-
"@symbiote-native/svelte": "
|
|
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
141
|
"@symbiote-native/test-utils": "0.3.0",
|
|
142
|
-
"@symbiote-native/vue": "
|
|
142
|
+
"@symbiote-native/vue": "2.0.0"
|
|
143
143
|
},
|
|
144
144
|
"scripts": {
|
|
145
145
|
"typecheck": "tsc --build",
|