@symbiote-native/battery 1.0.0 → 3.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 -15
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -16,6 +16,10 @@ depended on directly and never the `expo` meta-package, why the upstream JS is h
|
|
|
16
16
|
npm install @symbiote-native/battery
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
Scaffolding or extending a SymbioteNative app? `npx @symbiote-native/cli new --battery` (or
|
|
20
|
+
`add --battery` in an existing app) installs and wires this for you — see
|
|
21
|
+
[`@symbiote-native/cli`](../cli).
|
|
22
|
+
|
|
19
23
|
Depends on `expo-battery` and `expo-modules-core` directly (regular dependencies, pinned to exact
|
|
20
24
|
versions — never a caret range, since this package's `core/` is hand-ported against one specific
|
|
21
25
|
native API shape and a newer resolve could silently drift the two apart). Never install
|
|
@@ -89,11 +93,11 @@ function BatteryScreen() {
|
|
|
89
93
|
|
|
90
94
|
return (
|
|
91
95
|
<>
|
|
92
|
-
<
|
|
93
|
-
<
|
|
96
|
+
<text>{batteryLevelLabel}</text>
|
|
97
|
+
<text>
|
|
94
98
|
{batteryState === BatteryState.CHARGING ? 'Charging' : 'Not charging'}
|
|
95
|
-
</
|
|
96
|
-
<
|
|
99
|
+
</text>
|
|
100
|
+
<text>{lowPowerMode ? 'On' : 'Off'}</text>
|
|
97
101
|
</>
|
|
98
102
|
);
|
|
99
103
|
}
|
|
@@ -120,8 +124,8 @@ const batteryLevelText = computed(() =>
|
|
|
120
124
|
);
|
|
121
125
|
</script>
|
|
122
126
|
<template>
|
|
123
|
-
<
|
|
124
|
-
<
|
|
127
|
+
<text>{{ batteryLevelText }}</text>
|
|
128
|
+
<text>{{ lowPowerMode ? 'ON' : 'OFF' }}</text>
|
|
125
129
|
</template>
|
|
126
130
|
```
|
|
127
131
|
|
|
@@ -148,11 +152,11 @@ const batteryLevelText = computed(() =>
|
|
|
148
152
|
);
|
|
149
153
|
</script>
|
|
150
154
|
|
|
151
|
-
<
|
|
152
|
-
<
|
|
155
|
+
<text>{batteryLevelLabel}</text>
|
|
156
|
+
<text>
|
|
153
157
|
{batteryState.current === BatteryState.CHARGING ? 'Charging' : 'Not charging'}
|
|
154
|
-
</
|
|
155
|
-
<
|
|
158
|
+
</text>
|
|
159
|
+
<text>{lowPowerMode.current ? 'On' : 'Off'}</text>
|
|
156
160
|
```
|
|
157
161
|
|
|
158
162
|
```tsx
|
|
@@ -172,15 +176,15 @@ function BatteryScreen() {
|
|
|
172
176
|
|
|
173
177
|
return (
|
|
174
178
|
<>
|
|
175
|
-
<
|
|
179
|
+
<text>
|
|
176
180
|
{batteryLevel() < 0
|
|
177
181
|
? 'unknown'
|
|
178
182
|
: `${Math.round(batteryLevel() * 100)}%`}
|
|
179
|
-
</
|
|
180
|
-
<
|
|
183
|
+
</text>
|
|
184
|
+
<text>
|
|
181
185
|
{batteryState() === BatteryState.CHARGING ? 'Charging' : 'Not charging'}
|
|
182
|
-
</
|
|
183
|
-
<
|
|
186
|
+
</text>
|
|
187
|
+
<text>{lowPowerMode() ? 'On' : 'Off'}</text>
|
|
184
188
|
</>
|
|
185
189
|
);
|
|
186
190
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/battery",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "expo-battery wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Battery level and state (charging/full/unplugged/unknown), low-power-mode detection, plus event listeners for level and state changes.",
|
|
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": "^3.0.0",
|
|
84
|
+
"@symbiote-native/engine": "^1.0.0",
|
|
85
|
+
"@symbiote-native/react": "^3.0.0",
|
|
86
|
+
"@symbiote-native/solid": "^3.0.0",
|
|
87
|
+
"@symbiote-native/svelte": "^3.0.0",
|
|
88
|
+
"@symbiote-native/vue": "^3.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": "
|
|
141
|
-
"@symbiote-native/test-utils": "0.3.
|
|
142
|
-
"@symbiote-native/vue": "
|
|
136
|
+
"@symbiote-native/angular": "3.0.0",
|
|
137
|
+
"@symbiote-native/engine": "1.0.0",
|
|
138
|
+
"@symbiote-native/react": "3.0.0",
|
|
139
|
+
"@symbiote-native/solid": "3.0.0",
|
|
140
|
+
"@symbiote-native/svelte": "3.0.0",
|
|
141
|
+
"@symbiote-native/test-utils": "0.3.1",
|
|
142
|
+
"@symbiote-native/vue": "3.0.0"
|
|
143
143
|
},
|
|
144
144
|
"scripts": {
|
|
145
145
|
"typecheck": "tsc --build",
|