@symbiote-native/brightness 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.
Files changed (2) hide show
  1. package/README.md +72 -61
  2. package/package.json +14 -14
package/README.md CHANGED
@@ -20,6 +20,10 @@ depended on directly and never the `expo` meta-package, why the upstream JS is h
20
20
  npm install @symbiote-native/brightness
21
21
  ```
22
22
 
23
+ Scaffolding or extending a SymbioteNative app? `npx @symbiote-native/cli new --brightness` (or
24
+ `add --brightness` in an existing app) installs and wires this for you — see
25
+ [`@symbiote-native/cli`](../cli).
26
+
23
27
  `expo-brightness` and `expo-modules-core` come along as regular, pinned dependencies — never
24
28
  install either yourself, and never add the `expo` meta-package to this project (it bundles its own
25
29
  Metro/Babel pipeline that conflicts with this project's own).
@@ -72,7 +76,6 @@ verbatim by every adapter.
72
76
  ```tsx
73
77
  // React — trimmed from examples/expo-react/screens/BrightnessScreen.tsx
74
78
  import { useEffect, useState } from 'react';
75
- import { Pressable, Text, View } from '@symbiote-native/react';
76
79
  import {
77
80
  addBrightnessListener,
78
81
  getBrightnessAsync,
@@ -94,18 +97,18 @@ function BrightnessScreen() {
94
97
  }, []);
95
98
 
96
99
  return (
97
- <View>
98
- <Text>
100
+ <view>
101
+ <text>
99
102
  {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>
103
+ </text>
104
+ <pressable onPress={() => setBrightnessAsync(0.5)}>
105
+ <text>Set to 50%</text>
106
+ </pressable>
107
+ <text>{permissionStatus?.status ?? 'checking…'}</text>
108
+ <pressable onPress={() => requestPermission()}>
109
+ <text>Request permission</text>
110
+ </pressable>
111
+ </view>
109
112
  );
110
113
  }
111
114
  ```
@@ -114,7 +117,6 @@ function BrightnessScreen() {
114
117
  <!-- Vue — trimmed from examples/expo-vue-sfc/screens/BrightnessScreen.vue -->
115
118
  <script setup lang="ts">
116
119
  import { onMounted, onUnmounted, ref } from 'vue';
117
- import { Pressable, Text, View } from '@symbiote-native/vue';
118
120
  import {
119
121
  addBrightnessListener,
120
122
  getBrightnessAsync,
@@ -139,25 +141,24 @@ onUnmounted(() => subscription?.remove());
139
141
  </script>
140
142
 
141
143
  <template>
142
- <View>
143
- <Text>{{
144
+ <view>
145
+ <text>{{
144
146
  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>
147
+ }}</text>
148
+ <pressable @press="setBrightnessAsync(0.5)">
149
+ <text>Set to 50%</text>
150
+ </pressable>
151
+ <text>{{ permissionStatus?.status ?? 'checking…' }}</text>
152
+ <pressable @press="requestPermission()">
153
+ <text>Request permission</text>
154
+ </pressable>
155
+ </view>
154
156
  </template>
155
157
  ```
156
158
 
157
159
  ```svelte
158
160
  <!-- Svelte — trimmed from examples/expo-svelte/screens/BrightnessScreen.svelte -->
159
161
  <script lang="ts">
160
- import { Pressable, Text, View } from '@symbiote-native/svelte';
161
162
  import {
162
163
  addBrightnessListener,
163
164
  getBrightnessAsync,
@@ -173,27 +174,32 @@ onUnmounted(() => subscription?.remove());
173
174
 
174
175
  $effect(() => {
175
176
  void getBrightnessAsync().then(value => (brightness = value));
176
- subscription = addBrightnessListener(event => (brightness = event.brightness));
177
+ subscription = addBrightnessListener(
178
+ event => (brightness = event.brightness),
179
+ );
177
180
  return () => subscription?.remove();
178
181
  });
179
182
  </script>
180
183
 
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>
184
+ <view>
185
+ <text
186
+ >{brightness === null
187
+ ? 'checking…'
188
+ : `${Math.round(brightness * 100)}%`}</text
189
+ >
190
+ <pressable onPress={() => setBrightnessAsync(0.5)}>
191
+ <text>Set to 50%</text>
192
+ </pressable>
193
+ <text>{permissions.status?.status ?? 'checking…'}</text>
194
+ <pressable onPress={() => permissions.request()}>
195
+ <text>Request permission</text>
196
+ </pressable>
197
+ </view>
191
198
  ```
192
199
 
193
200
  ```tsx
194
201
  // Solid — trimmed from examples/expo-solid/screens/BrightnessScreen.tsx
195
202
  import { createSignal, onCleanup } from 'solid-js';
196
- import { Pressable, Text, View } from '@symbiote-native/solid';
197
203
  import {
198
204
  addBrightnessListener,
199
205
  getBrightnessAsync,
@@ -203,25 +209,30 @@ import { createPermissions } from '@symbiote-native/brightness/solid';
203
209
 
204
210
  function BrightnessScreen() {
205
211
  const [brightness, setBrightness] = createSignal<number | null>(null);
206
- const { status: permissionStatus, request: requestPermission } = createPermissions();
212
+ const { status: permissionStatus, request: requestPermission } =
213
+ createPermissions();
207
214
 
208
215
  getBrightnessAsync().then(setBrightness);
209
- const subscription = addBrightnessListener(event => setBrightness(event.brightness));
216
+ const subscription = addBrightnessListener(event =>
217
+ setBrightness(event.brightness),
218
+ );
210
219
  onCleanup(() => subscription.remove());
211
220
 
212
221
  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>
222
+ <view>
223
+ <text>
224
+ {brightness() === null
225
+ ? 'checking…'
226
+ : `${Math.round(brightness()! * 100)}%`}
227
+ </text>
228
+ <pressable onPress={() => setBrightnessAsync(0.5)}>
229
+ <text>Set to 50%</text>
230
+ </pressable>
231
+ <text>{permissionStatus()?.status ?? 'checking…'}</text>
232
+ <pressable onPress={() => requestPermission()}>
233
+ <text>Request permission</text>
234
+ </pressable>
235
+ </view>
225
236
  );
226
237
  }
227
238
  ```
@@ -229,7 +240,7 @@ function BrightnessScreen() {
229
240
  ```ts
230
241
  // Angular — trimmed from examples/expo-angular/src/screens/BrightnessScreen.ts
231
242
  import { Component, inject, signal } from '@angular/core';
232
- import { Pressable, Text, View } from '@symbiote-native/angular';
243
+ import { SYMBIOTE_ELEMENTS } from '@symbiote-native/angular';
233
244
  import {
234
245
  PermissionsService,
235
246
  addBrightnessListener,
@@ -240,18 +251,18 @@ import {
240
251
  @Component({
241
252
  selector: 'BrightnessScreen',
242
253
  standalone: true,
243
- imports: [Pressable, Text, View],
254
+ imports: [SYMBIOTE_ELEMENTS],
244
255
  template: `
245
- <View>
246
- <Text>{{ brightnessLabel() }}</Text>
247
- <Pressable (press)="setBrightnessAsync(0.5)"
248
- ><Text>Set to 50%</Text></Pressable
256
+ <view>
257
+ <text>{{ brightnessLabel() }}</text>
258
+ <pressable (press)="setBrightnessAsync(0.5)"
259
+ ><text>Set to 50%</text></pressable
249
260
  >
250
- <Text>{{ permissionStatus()?.status ?? 'checking…' }}</Text>
251
- <Pressable (press)="permissionsService.request()"
252
- ><Text>Request permission</Text></Pressable
261
+ <text>{{ permissionStatus()?.status ?? 'checking…' }}</text>
262
+ <pressable (press)="permissionsService.request()"
263
+ ><text>Request permission</text></pressable
253
264
  >
254
- </View>
265
+ </view>
255
266
  `,
256
267
  })
257
268
  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": "3.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": "^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": "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",
141
- "@symbiote-native/test-utils": "0.3.0",
142
- "@symbiote-native/vue": "1.0.0"
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",