@symbiote-native/brightness 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.
Files changed (2) hide show
  1. package/README.md +68 -61
  2. package/package.json +13 -13
package/README.md CHANGED
@@ -72,7 +72,6 @@ verbatim by every adapter.
72
72
  ```tsx
73
73
  // React — trimmed from examples/expo-react/screens/BrightnessScreen.tsx
74
74
  import { useEffect, useState } from 'react';
75
- import { Pressable, Text, View } from '@symbiote-native/react';
76
75
  import {
77
76
  addBrightnessListener,
78
77
  getBrightnessAsync,
@@ -94,18 +93,18 @@ function BrightnessScreen() {
94
93
  }, []);
95
94
 
96
95
  return (
97
- <View>
98
- <Text>
96
+ <view>
97
+ <text>
99
98
  {brightness === null ? 'checking…' : `${Math.round(brightness * 100)}%`}
100
- </Text>
101
- <Pressable onPress={() => setBrightnessAsync(0.5)}>
102
- <Text>Set to 50%</Text>
103
- </Pressable>
104
- <Text>{permissionStatus?.status ?? 'checking…'}</Text>
105
- <Pressable onPress={() => requestPermission()}>
106
- <Text>Request permission</Text>
107
- </Pressable>
108
- </View>
99
+ </text>
100
+ <pressable onPress={() => setBrightnessAsync(0.5)}>
101
+ <text>Set to 50%</text>
102
+ </pressable>
103
+ <text>{permissionStatus?.status ?? 'checking…'}</text>
104
+ <pressable onPress={() => requestPermission()}>
105
+ <text>Request permission</text>
106
+ </pressable>
107
+ </view>
109
108
  );
110
109
  }
111
110
  ```
@@ -114,7 +113,6 @@ function BrightnessScreen() {
114
113
  <!-- Vue — trimmed from examples/expo-vue-sfc/screens/BrightnessScreen.vue -->
115
114
  <script setup lang="ts">
116
115
  import { onMounted, onUnmounted, ref } from 'vue';
117
- import { Pressable, Text, View } from '@symbiote-native/vue';
118
116
  import {
119
117
  addBrightnessListener,
120
118
  getBrightnessAsync,
@@ -139,25 +137,24 @@ onUnmounted(() => subscription?.remove());
139
137
  </script>
140
138
 
141
139
  <template>
142
- <View>
143
- <Text>{{
140
+ <view>
141
+ <text>{{
144
142
  brightness === null ? 'checking…' : `${Math.round(brightness * 100)}%`
145
- }}</Text>
146
- <Pressable @press="setBrightnessAsync(0.5)">
147
- <Text>Set to 50%</Text>
148
- </Pressable>
149
- <Text>{{ permissionStatus?.status ?? 'checking…' }}</Text>
150
- <Pressable @press="requestPermission()">
151
- <Text>Request permission</Text>
152
- </Pressable>
153
- </View>
143
+ }}</text>
144
+ <pressable @press="setBrightnessAsync(0.5)">
145
+ <text>Set to 50%</text>
146
+ </pressable>
147
+ <text>{{ permissionStatus?.status ?? 'checking…' }}</text>
148
+ <pressable @press="requestPermission()">
149
+ <text>Request permission</text>
150
+ </pressable>
151
+ </view>
154
152
  </template>
155
153
  ```
156
154
 
157
155
  ```svelte
158
156
  <!-- Svelte — trimmed from examples/expo-svelte/screens/BrightnessScreen.svelte -->
159
157
  <script lang="ts">
160
- import { Pressable, Text, View } from '@symbiote-native/svelte';
161
158
  import {
162
159
  addBrightnessListener,
163
160
  getBrightnessAsync,
@@ -173,27 +170,32 @@ onUnmounted(() => subscription?.remove());
173
170
 
174
171
  $effect(() => {
175
172
  void getBrightnessAsync().then(value => (brightness = value));
176
- subscription = addBrightnessListener(event => (brightness = event.brightness));
173
+ subscription = addBrightnessListener(
174
+ event => (brightness = event.brightness),
175
+ );
177
176
  return () => subscription?.remove();
178
177
  });
179
178
  </script>
180
179
 
181
- <View>
182
- <Text>{brightness === null ? 'checking…' : `${Math.round(brightness * 100)}%`}</Text>
183
- <Pressable onPress={() => setBrightnessAsync(0.5)}>
184
- <Text>Set to 50%</Text>
185
- </Pressable>
186
- <Text>{permissions.status?.status ?? 'checking…'}</Text>
187
- <Pressable onPress={() => permissions.request()}>
188
- <Text>Request permission</Text>
189
- </Pressable>
190
- </View>
180
+ <view>
181
+ <text
182
+ >{brightness === null
183
+ ? 'checking…'
184
+ : `${Math.round(brightness * 100)}%`}</text
185
+ >
186
+ <pressable onPress={() => setBrightnessAsync(0.5)}>
187
+ <text>Set to 50%</text>
188
+ </pressable>
189
+ <text>{permissions.status?.status ?? 'checking…'}</text>
190
+ <pressable onPress={() => permissions.request()}>
191
+ <text>Request permission</text>
192
+ </pressable>
193
+ </view>
191
194
  ```
192
195
 
193
196
  ```tsx
194
197
  // Solid — trimmed from examples/expo-solid/screens/BrightnessScreen.tsx
195
198
  import { createSignal, onCleanup } from 'solid-js';
196
- import { Pressable, Text, View } from '@symbiote-native/solid';
197
199
  import {
198
200
  addBrightnessListener,
199
201
  getBrightnessAsync,
@@ -203,25 +205,30 @@ import { createPermissions } from '@symbiote-native/brightness/solid';
203
205
 
204
206
  function BrightnessScreen() {
205
207
  const [brightness, setBrightness] = createSignal<number | null>(null);
206
- const { status: permissionStatus, request: requestPermission } = createPermissions();
208
+ const { status: permissionStatus, request: requestPermission } =
209
+ createPermissions();
207
210
 
208
211
  getBrightnessAsync().then(setBrightness);
209
- const subscription = addBrightnessListener(event => setBrightness(event.brightness));
212
+ const subscription = addBrightnessListener(event =>
213
+ setBrightness(event.brightness),
214
+ );
210
215
  onCleanup(() => subscription.remove());
211
216
 
212
217
  return (
213
- <View>
214
- <Text>
215
- {brightness() === null ? 'checking…' : `${Math.round(brightness()! * 100)}%`}
216
- </Text>
217
- <Pressable onPress={() => setBrightnessAsync(0.5)}>
218
- <Text>Set to 50%</Text>
219
- </Pressable>
220
- <Text>{permissionStatus()?.status ?? 'checking…'}</Text>
221
- <Pressable onPress={() => requestPermission()}>
222
- <Text>Request permission</Text>
223
- </Pressable>
224
- </View>
218
+ <view>
219
+ <text>
220
+ {brightness() === null
221
+ ? 'checking…'
222
+ : `${Math.round(brightness()! * 100)}%`}
223
+ </text>
224
+ <pressable onPress={() => setBrightnessAsync(0.5)}>
225
+ <text>Set to 50%</text>
226
+ </pressable>
227
+ <text>{permissionStatus()?.status ?? 'checking…'}</text>
228
+ <pressable onPress={() => requestPermission()}>
229
+ <text>Request permission</text>
230
+ </pressable>
231
+ </view>
225
232
  );
226
233
  }
227
234
  ```
@@ -229,7 +236,7 @@ function BrightnessScreen() {
229
236
  ```ts
230
237
  // Angular — trimmed from examples/expo-angular/src/screens/BrightnessScreen.ts
231
238
  import { Component, inject, signal } from '@angular/core';
232
- import { Pressable, Text, View } from '@symbiote-native/angular';
239
+ import { SYMBIOTE_ELEMENTS } from '@symbiote-native/angular';
233
240
  import {
234
241
  PermissionsService,
235
242
  addBrightnessListener,
@@ -240,18 +247,18 @@ import {
240
247
  @Component({
241
248
  selector: 'BrightnessScreen',
242
249
  standalone: true,
243
- imports: [Pressable, Text, View],
250
+ imports: [SYMBIOTE_ELEMENTS],
244
251
  template: `
245
- <View>
246
- <Text>{{ brightnessLabel() }}</Text>
247
- <Pressable (press)="setBrightnessAsync(0.5)"
248
- ><Text>Set to 50%</Text></Pressable
252
+ <view>
253
+ <text>{{ brightnessLabel() }}</text>
254
+ <pressable (press)="setBrightnessAsync(0.5)"
255
+ ><text>Set to 50%</text></pressable
249
256
  >
250
- <Text>{{ permissionStatus()?.status ?? 'checking…' }}</Text>
251
- <Pressable (press)="permissionsService.request()"
252
- ><Text>Request permission</Text></Pressable
257
+ <text>{{ permissionStatus()?.status ?? 'checking…' }}</text>
258
+ <pressable (press)="permissionsService.request()"
259
+ ><text>Request permission</text></pressable
253
260
  >
254
- </View>
261
+ </view>
255
262
  `,
256
263
  })
257
264
  export class BrightnessScreen {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbiote-native/brightness",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "expo-brightness wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Screen brightness get/set, Android-only system-brightness-mode control, an iOS-only brightness-change listener, and permission get/request.",
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": "^1.0.0",
84
- "@symbiote-native/engine": "^0.4.0",
85
- "@symbiote-native/react": "^1.0.0",
86
- "@symbiote-native/solid": "^1.0.0",
87
- "@symbiote-native/svelte": "^1.0.0",
88
- "@symbiote-native/vue": "^1.0.0"
83
+ "@symbiote-native/angular": "^2.0.0",
84
+ "@symbiote-native/react": "^2.0.0",
85
+ "@symbiote-native/engine": "^0.5.0",
86
+ "@symbiote-native/svelte": "^2.0.0",
87
+ "@symbiote-native/solid": "^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": "1.0.0",
137
- "@symbiote-native/engine": "0.4.0",
138
- "@symbiote-native/react": "1.0.0",
139
- "@symbiote-native/solid": "1.0.0",
140
- "@symbiote-native/svelte": "1.0.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
141
  "@symbiote-native/test-utils": "0.3.0",
142
- "@symbiote-native/vue": "1.0.0"
142
+ "@symbiote-native/vue": "2.0.0"
143
143
  },
144
144
  "scripts": {
145
145
  "typecheck": "tsc --build",