@symbiote-native/system-ui 0.2.0 → 1.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 +48 -20
- package/build-ngc/core/native-module.js.map +1 -1
- package/build-ngc/core/system-ui.js.map +1 -1
- package/package.json +45 -20
- package/src/core/native-module.ts +3 -1
- package/src/core/system-ui.ts +3 -1
- package/build/react/index.d.ts +0 -1
- package/build/react/index.js +0 -6
- package/build/svelte/index.d.ts +0 -1
- package/build/svelte/index.js +0 -6
- package/build/vue/index.d.ts +0 -1
- package/build/vue/index.js +0 -4
- package/src/react/index.ts +0 -6
- package/src/svelte/index.ts +0 -6
- package/src/vue/index.ts +0 -4
package/README.md
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
A wrapper package for [SymbioteNative](../../README.md) that makes
|
|
4
4
|
[`expo-system-ui`](https://github.com/expo/expo/tree/main/packages/expo-system-ui)
|
|
5
5
|
— setting and reading the root view's background color — usable from **every** adapter,
|
|
6
|
-
React, Vue, and Angular, not just React. Like
|
|
6
|
+
React, Vue, Svelte, Solid, and Angular, not just React. Like
|
|
7
7
|
[`@symbiote-native/device`](../device) and [`@symbiote-native/local-auth`](../local-auth) and
|
|
8
8
|
unlike this repo's stateful Expo wrapper ([`@symbiote-native/sensors`](../sensors), an
|
|
9
9
|
`EventEmitter` + live-subscription surface), both exports here are one-shot async calls with no
|
|
10
|
-
per-instance state, so there is no hook/composable/service to wrap — the React, Vue, and
|
|
11
|
-
|
|
10
|
+
per-instance state, so there is no hook/composable/service to wrap — the React, Vue, Svelte, and
|
|
11
|
+
Solid entry points are plain re-exports of the same `core`.
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
@@ -27,12 +27,12 @@ Unlike a plain RN native module, `expo-system-ui`'s native code is discovered by
|
|
|
27
27
|
into the native host app **once**, covering this package and every other `expo-modules-core`
|
|
28
28
|
package with zero further changes:
|
|
29
29
|
|
|
30
|
-
| Platform | Touches
|
|
31
|
-
|
|
32
|
-
| iOS
|
|
33
|
-
| iOS
|
|
34
|
-
| Android
|
|
35
|
-
| Android
|
|
30
|
+
| Platform | Touches |
|
|
31
|
+
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
32
|
+
| iOS | `ios/Podfile` — add `use_expo_modules!` |
|
|
33
|
+
| iOS | `AppDelegate.swift` — Expo's runtime-bootstrap hook |
|
|
34
|
+
| Android | `settings.gradle` / `app/build.gradle` — resolve and include the Expo Gradle projects |
|
|
35
|
+
| Android | `MainApplication.kt` — Expo's bootstrap hook, plus a hand-written native-module name map (there's no `expo` meta-package here to auto-generate one) |
|
|
36
36
|
|
|
37
37
|
Full mechanics live in the `symbiote-expo-native-module` project skill. Reference
|
|
38
38
|
implementation: `examples/expo-react/ios/Podfile` and
|
|
@@ -46,13 +46,13 @@ background color, nothing gated by a permission prompt.
|
|
|
46
46
|
```
|
|
47
47
|
src/core/ setBackgroundColorAsync / getBackgroundColorAsync. native-module.ts resolves the
|
|
48
48
|
native module via expo-modules-core's requireNativeModule.
|
|
49
|
-
src/react/ @symbiote-native/system-ui/react — export * from '../core'
|
|
50
|
-
src/vue/ @symbiote-native/system-ui/vue — export * from '../core'
|
|
51
49
|
src/angular/ @symbiote-native/system-ui/angular — export * from '../core'
|
|
52
50
|
```
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
`./react`, `./vue`, `./svelte`, and `./solid` are `exports`-map aliases straight onto
|
|
53
|
+
`src/core/` — no physical per-framework file, since there's nothing to subscribe to or clean up.
|
|
54
|
+
`./angular` stays a physical file/subpath since Angular ships through a separate `ngc`/AOT build
|
|
55
|
+
(`build-ngc/`).
|
|
56
56
|
|
|
57
57
|
## Use it
|
|
58
58
|
|
|
@@ -75,6 +75,27 @@ onMounted(() => {
|
|
|
75
75
|
</script>
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
```svelte
|
|
79
|
+
<!-- Svelte -->
|
|
80
|
+
<script lang="ts">
|
|
81
|
+
import { setBackgroundColorAsync } from '@symbiote-native/system-ui/svelte';
|
|
82
|
+
|
|
83
|
+
$effect(() => {
|
|
84
|
+
void setBackgroundColorAsync('black');
|
|
85
|
+
});
|
|
86
|
+
</script>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
// Solid
|
|
91
|
+
import { onMount } from 'solid-js';
|
|
92
|
+
import { setBackgroundColorAsync } from '@symbiote-native/system-ui/solid';
|
|
93
|
+
|
|
94
|
+
onMount(() => {
|
|
95
|
+
void setBackgroundColorAsync('black');
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
78
99
|
```ts
|
|
79
100
|
// Angular
|
|
80
101
|
import { Component } from '@angular/core';
|
|
@@ -92,7 +113,8 @@ There's no per-instance service to `inject()` in the Angular case — both funct
|
|
|
92
113
|
exports off the core package, called straight in the constructor or wherever the app's root is
|
|
93
114
|
set up. These snippets mirror the real canary demo screens —
|
|
94
115
|
`examples/expo-react/screens/SystemUiScreen.tsx`, `examples/expo-vue-sfc/screens/SystemUiScreen.vue`,
|
|
95
|
-
`examples/expo-vue-tsx/screens/SystemUiScreen.tsx`, `examples/expo-
|
|
116
|
+
`examples/expo-vue-tsx/screens/SystemUiScreen.tsx`, `examples/expo-svelte/screens/SystemUiScreen.svelte`,
|
|
117
|
+
`examples/expo-solid/screens/SystemUiScreen.tsx`, `examples/expo-angular/src/screens/SystemUiScreen.ts`.
|
|
96
118
|
|
|
97
119
|
## API
|
|
98
120
|
|
|
@@ -105,10 +127,15 @@ getBackgroundColorAsync(): Promise<ColorValue | null>
|
|
|
105
127
|
```
|
|
106
128
|
|
|
107
129
|
```ts
|
|
108
|
-
import {
|
|
130
|
+
import {
|
|
131
|
+
getBackgroundColorAsync,
|
|
132
|
+
setBackgroundColorAsync,
|
|
133
|
+
} from '@symbiote-native/system-ui';
|
|
109
134
|
// or the framework-scoped entry points — identical surface, re-exported verbatim:
|
|
110
135
|
import { setBackgroundColorAsync } from '@symbiote-native/system-ui/react';
|
|
111
136
|
import { setBackgroundColorAsync } from '@symbiote-native/system-ui/vue';
|
|
137
|
+
import { setBackgroundColorAsync } from '@symbiote-native/system-ui/svelte';
|
|
138
|
+
import { setBackgroundColorAsync } from '@symbiote-native/system-ui/solid';
|
|
112
139
|
import { setBackgroundColorAsync } from '@symbiote-native/system-ui/angular';
|
|
113
140
|
```
|
|
114
141
|
|
|
@@ -130,9 +157,10 @@ per-instance state. Tests inject a fake native-module object in place of the rea
|
|
|
130
157
|
no ViewConfig. Native rendering itself is verified on-device (see the parent
|
|
131
158
|
[README](../../README.md) for the project's testing model).
|
|
132
159
|
|
|
133
|
-
Native autolinking wiring for `expo-modules-core` packages is already done in
|
|
160
|
+
Native autolinking wiring for `expo-modules-core` packages is already done in all six Expo
|
|
134
161
|
canary apps (`examples/expo-react`, `examples/expo-vue-sfc`, `examples/expo-vue-tsx`,
|
|
135
|
-
`examples/expo-
|
|
136
|
-
package reuses that same wiring
|
|
137
|
-
|
|
138
|
-
`
|
|
162
|
+
`examples/expo-svelte`, `examples/expo-solid`, `examples/expo-angular`) via
|
|
163
|
+
`@symbiote-native/local-auth`/`@symbiote-native/sensors` — this package reuses that same wiring
|
|
164
|
+
with zero further app-side changes, since `expo-modules-autolinking` discovers any
|
|
165
|
+
`expo-modules-core` package already present in `node_modules`. Each canary carries its own
|
|
166
|
+
`SystemUiScreen` demo.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAYlD,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAYlD,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAC7C,0BAA0B,CAC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-ui.js","sourceRoot":"","sources":["../../src/core/system-ui.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,
|
|
1
|
+
{"version":3,"file":"system-ui.js","sourceRoot":"","sources":["../../src/core/system-ui.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,KAAwB;IAExB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,MAAM,YAAY,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;SAAM,CAAC;QACN,MAAM,WAAW,GAAG,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACxE,OAAO,MAAM,YAAY,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAC3C,OAAO,MAAM,YAAY,CAAC,uBAAuB,EAAE,CAAC;AACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/system-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "expo-system-ui wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, and Angular adapters. Sets and reads the root view's background color.",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "expo-system-ui wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Sets and reads the root view's background color.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react-native",
|
|
7
|
+
"symbiote-native",
|
|
8
|
+
"react",
|
|
9
|
+
"vue",
|
|
10
|
+
"svelte",
|
|
11
|
+
"solid",
|
|
12
|
+
"angular",
|
|
13
|
+
"system-ui",
|
|
14
|
+
"background-color"
|
|
15
|
+
],
|
|
5
16
|
"license": "MIT",
|
|
6
17
|
"repository": {
|
|
7
18
|
"type": "git",
|
|
@@ -23,16 +34,20 @@
|
|
|
23
34
|
"default": "./build/core/index.js"
|
|
24
35
|
},
|
|
25
36
|
"./vue": {
|
|
26
|
-
"types": "./build/
|
|
27
|
-
"default": "./build/
|
|
37
|
+
"types": "./build/core/index.d.ts",
|
|
38
|
+
"default": "./build/core/index.js"
|
|
28
39
|
},
|
|
29
40
|
"./react": {
|
|
30
|
-
"types": "./build/
|
|
31
|
-
"default": "./build/
|
|
41
|
+
"types": "./build/core/index.d.ts",
|
|
42
|
+
"default": "./build/core/index.js"
|
|
32
43
|
},
|
|
33
44
|
"./svelte": {
|
|
34
|
-
"types": "./build/
|
|
35
|
-
"default": "./build/
|
|
45
|
+
"types": "./build/core/index.d.ts",
|
|
46
|
+
"default": "./build/core/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./solid": {
|
|
49
|
+
"types": "./build/core/index.d.ts",
|
|
50
|
+
"default": "./build/core/index.js"
|
|
36
51
|
},
|
|
37
52
|
"./angular": {
|
|
38
53
|
"types": "./build-ngc/angular/index.d.ts",
|
|
@@ -57,17 +72,19 @@
|
|
|
57
72
|
"expo-modules-core": "57.0.5"
|
|
58
73
|
},
|
|
59
74
|
"peerDependencies": {
|
|
60
|
-
"@symbiote-native/angular": ">=0.6.2",
|
|
61
|
-
"@symbiote-native/engine": ">=0.1.7",
|
|
62
|
-
"@symbiote-native/react": ">=0.2.8",
|
|
63
|
-
"@symbiote-native/svelte": ">=0.1.0",
|
|
64
|
-
"@symbiote-native/vue": ">=0.3.8",
|
|
65
75
|
"@angular/core": ">=20",
|
|
66
76
|
"@vue/runtime-core": "^3.5.13",
|
|
67
77
|
"react": ">=19.0.0",
|
|
68
78
|
"react-native": ">=0.86",
|
|
79
|
+
"solid-js": ">=1.9.0",
|
|
69
80
|
"svelte": ">=5.56.0",
|
|
70
|
-
"vue": ">=3.5.0"
|
|
81
|
+
"vue": ">=3.5.0",
|
|
82
|
+
"@symbiote-native/angular": "^1.0.0",
|
|
83
|
+
"@symbiote-native/engine": "^0.4.0",
|
|
84
|
+
"@symbiote-native/react": "^1.0.0",
|
|
85
|
+
"@symbiote-native/solid": "^1.0.0",
|
|
86
|
+
"@symbiote-native/svelte": "^1.0.0",
|
|
87
|
+
"@symbiote-native/vue": "^1.0.0"
|
|
71
88
|
},
|
|
72
89
|
"peerDependenciesMeta": {
|
|
73
90
|
"@symbiote-native/angular": {
|
|
@@ -76,6 +93,9 @@
|
|
|
76
93
|
"@symbiote-native/react": {
|
|
77
94
|
"optional": true
|
|
78
95
|
},
|
|
96
|
+
"@symbiote-native/solid": {
|
|
97
|
+
"optional": true
|
|
98
|
+
},
|
|
79
99
|
"@symbiote-native/svelte": {
|
|
80
100
|
"optional": true
|
|
81
101
|
},
|
|
@@ -91,6 +111,9 @@
|
|
|
91
111
|
"react": {
|
|
92
112
|
"optional": true
|
|
93
113
|
},
|
|
114
|
+
"solid-js": {
|
|
115
|
+
"optional": true
|
|
116
|
+
},
|
|
94
117
|
"svelte": {
|
|
95
118
|
"optional": true
|
|
96
119
|
},
|
|
@@ -106,14 +129,16 @@
|
|
|
106
129
|
"@types/react": "^19.2.0",
|
|
107
130
|
"@vue/runtime-core": "^3.5.13",
|
|
108
131
|
"react": "19.2.3",
|
|
132
|
+
"solid-js": "^1.9.14",
|
|
109
133
|
"svelte": "^5.56.0",
|
|
110
134
|
"typescript": "~6.0.0",
|
|
111
|
-
"@symbiote-native/angular": "0.
|
|
112
|
-
"@symbiote-native/engine": "0.
|
|
113
|
-
"@symbiote-native/react": "0.
|
|
114
|
-
"@symbiote-native/
|
|
115
|
-
"@symbiote-native/
|
|
116
|
-
"@symbiote-native/
|
|
135
|
+
"@symbiote-native/angular": "1.0.0",
|
|
136
|
+
"@symbiote-native/engine": "0.4.0",
|
|
137
|
+
"@symbiote-native/react": "1.0.0",
|
|
138
|
+
"@symbiote-native/solid": "1.0.0",
|
|
139
|
+
"@symbiote-native/svelte": "1.0.0",
|
|
140
|
+
"@symbiote-native/test-utils": "0.3.0",
|
|
141
|
+
"@symbiote-native/vue": "1.0.0"
|
|
117
142
|
},
|
|
118
143
|
"scripts": {
|
|
119
144
|
"typecheck": "tsc --build",
|
|
@@ -13,4 +13,6 @@ export type INativeSystemUIModule = {
|
|
|
13
13
|
getBackgroundColorAsync(): Promise<ColorValue | null>;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export const expoSystemUI = requireNativeModule<INativeSystemUIModule>(
|
|
16
|
+
export const expoSystemUI = requireNativeModule<INativeSystemUIModule>(
|
|
17
|
+
EXPO_SYSTEM_UI_MODULE_NAME,
|
|
18
|
+
);
|
package/src/core/system-ui.ts
CHANGED
|
@@ -17,7 +17,9 @@ import { expoSystemUI } from './native-module';
|
|
|
17
17
|
* @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color), or
|
|
18
18
|
* `null` to clear the override.
|
|
19
19
|
*/
|
|
20
|
-
export async function setBackgroundColorAsync(
|
|
20
|
+
export async function setBackgroundColorAsync(
|
|
21
|
+
color: ColorValue | null,
|
|
22
|
+
): Promise<void> {
|
|
21
23
|
if (color == null) {
|
|
22
24
|
return await expoSystemUI.setBackgroundColorAsync(null);
|
|
23
25
|
} else {
|
package/build/react/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/react/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/system-ui/react: the React entry over the framework-agnostic core. Both
|
|
2
|
-
// exports are plain async functions with no per-instance state and no event stream (unlike
|
|
3
|
-
// @symbiote-native/sensors) — there is nothing for a hook to wrap, so this is a plain
|
|
4
|
-
// re-export, mirroring how @symbiote-native/device's React entry passes its own free
|
|
5
|
-
// functions through untouched.
|
|
6
|
-
export * from '../core/index.js';
|
package/build/svelte/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/svelte/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/system-ui/svelte: the Svelte entry over the framework-agnostic core. Both
|
|
2
|
-
// exports are plain async functions with no per-instance state and no event stream (unlike
|
|
3
|
-
// @symbiote-native/sensors) — there is nothing for a rune to wrap, so this is a plain re-export.
|
|
4
|
-
// Svelte's lifecycle bucket is `runes/` (adapters/svelte/src/runes — never React's `hooks` or
|
|
5
|
-
// Vue's `composables`), and this package has none to fill.
|
|
6
|
-
export * from '../core/index.js';
|
package/build/vue/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/vue/index.js
DELETED
package/src/react/index.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/system-ui/react: the React entry over the framework-agnostic core. Both
|
|
2
|
-
// exports are plain async functions with no per-instance state and no event stream (unlike
|
|
3
|
-
// @symbiote-native/sensors) — there is nothing for a hook to wrap, so this is a plain
|
|
4
|
-
// re-export, mirroring how @symbiote-native/device's React entry passes its own free
|
|
5
|
-
// functions through untouched.
|
|
6
|
-
export * from '../core';
|
package/src/svelte/index.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/system-ui/svelte: the Svelte entry over the framework-agnostic core. Both
|
|
2
|
-
// exports are plain async functions with no per-instance state and no event stream (unlike
|
|
3
|
-
// @symbiote-native/sensors) — there is nothing for a rune to wrap, so this is a plain re-export.
|
|
4
|
-
// Svelte's lifecycle bucket is `runes/` (adapters/svelte/src/runes — never React's `hooks` or
|
|
5
|
-
// Vue's `composables`), and this package has none to fill.
|
|
6
|
-
export * from '../core';
|
package/src/vue/index.ts
DELETED