@symbiote-native/system-ui 0.0.1 → 0.2.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 CHANGED
@@ -90,9 +90,9 @@ export class RootComponent {
90
90
 
91
91
  There's no per-instance service to `inject()` in the Angular case — both functions are plain
92
92
  exports off the core package, called straight in the constructor or wherever the app's root is
93
- set up. These snippets are not yet demoed in a real canary screen — no `SystemUiScreen.*` exists
94
- yet in `examples/expo-*` — so treat them as realistic reference code, not a trimmed-down copy of
95
- a running demo.
93
+ set up. These snippets mirror the real canary demo screens —
94
+ `examples/expo-react/screens/SystemUiScreen.tsx`, `examples/expo-vue-sfc/screens/SystemUiScreen.vue`,
95
+ `examples/expo-vue-tsx/screens/SystemUiScreen.tsx`, `examples/expo-angular/src/screens/SystemUiScreen.ts`.
96
96
 
97
97
  ## API
98
98
 
@@ -1,4 +1,4 @@
1
1
  // @symbiote-native/system-ui/angular: the Angular entry over the framework-agnostic core.
2
2
  // Same reasoning as the React/Vue entries — no per-instance state or event stream to wrap in a
3
3
  // service, so this is a plain re-export.
4
- export * from '../core';
4
+ export * from '../core/index.js';
@@ -1 +1 @@
1
- export { getBackgroundColorAsync, setBackgroundColorAsync } from './system-ui';
1
+ export { getBackgroundColorAsync, setBackgroundColorAsync } from './system-ui.js';
@@ -1,5 +1,5 @@
1
1
  import { Platform, processColor } from 'react-native';
2
- import { expoSystemUI } from './native-module';
2
+ import { expoSystemUI } from './native-module.js';
3
3
  /**
4
4
  * Changes the root view background color. Call this outside of your component tree, e.g. in
5
5
  * the root file, since it affects the whole app.
@@ -3,4 +3,4 @@
3
3
  // @symbiote-native/sensors) — there is nothing for a hook to wrap, so this is a plain
4
4
  // re-export, mirroring how @symbiote-native/device's React entry passes its own free
5
5
  // functions through untouched.
6
- export * from '../core';
6
+ export * from '../core/index.js';
@@ -0,0 +1 @@
1
+ export * from '../core';
@@ -0,0 +1,6 @@
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';
@@ -1,4 +1,4 @@
1
1
  // @symbiote-native/system-ui/vue: the Vue entry over the framework-agnostic core. Same
2
2
  // reasoning as the React entry — no per-instance state or event stream to wire onto Vue's
3
3
  // reactivity, so this is a plain re-export.
4
- export * from '../core';
4
+ export * from '../core/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbiote-native/system-ui",
3
- "version": "0.0.1",
3
+ "version": "0.2.0",
4
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.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,6 +30,10 @@
30
30
  "types": "./build/react/index.d.ts",
31
31
  "default": "./build/react/index.js"
32
32
  },
33
+ "./svelte": {
34
+ "types": "./build/svelte/index.d.ts",
35
+ "default": "./build/svelte/index.js"
36
+ },
33
37
  "./angular": {
34
38
  "types": "./build-ngc/angular/index.d.ts",
35
39
  "react-native": "./build-ngc/angular/index.js",
@@ -40,7 +44,10 @@
40
44
  "src",
41
45
  "build",
42
46
  "build-ngc",
43
- "native-link.json"
47
+ "native-link.json",
48
+ "!src/**/*.test.*",
49
+ "!src/**/*.spec.*",
50
+ "!src/**/*.detox.*"
44
51
  ],
45
52
  "publishConfig": {
46
53
  "access": "public"
@@ -50,15 +57,17 @@
50
57
  "expo-modules-core": "57.0.5"
51
58
  },
52
59
  "peerDependencies": {
60
+ "@symbiote-native/angular": ">=0.6.2",
53
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",
54
65
  "@angular/core": ">=20",
55
66
  "@vue/runtime-core": "^3.5.13",
56
67
  "react": ">=19.0.0",
57
68
  "react-native": ">=0.86",
58
- "vue": ">=3.5.0",
59
- "@symbiote-native/angular": "0.6.1",
60
- "@symbiote-native/react": "0.2.8",
61
- "@symbiote-native/vue": "0.3.8"
69
+ "svelte": ">=5.56.0",
70
+ "vue": ">=3.5.0"
62
71
  },
63
72
  "peerDependenciesMeta": {
64
73
  "@symbiote-native/angular": {
@@ -67,6 +76,9 @@
67
76
  "@symbiote-native/react": {
68
77
  "optional": true
69
78
  },
79
+ "@symbiote-native/svelte": {
80
+ "optional": true
81
+ },
70
82
  "@symbiote-native/vue": {
71
83
  "optional": true
72
84
  },
@@ -79,24 +91,29 @@
79
91
  "react": {
80
92
  "optional": true
81
93
  },
94
+ "svelte": {
95
+ "optional": true
96
+ },
82
97
  "vue": {
83
98
  "optional": true
84
99
  }
85
100
  },
86
101
  "devDependencies": {
87
- "@angular/compiler": "^22",
88
- "@angular/compiler-cli": "^22",
89
- "@angular/core": "^22",
102
+ "@angular/compiler": "~22.0.8",
103
+ "@angular/compiler-cli": "~22.0.8",
104
+ "@angular/core": "~22.0.8",
90
105
  "@types/node": "^26.0.0",
91
106
  "@types/react": "^19.2.0",
92
107
  "@vue/runtime-core": "^3.5.13",
93
108
  "react": "19.2.3",
109
+ "svelte": "^5.56.0",
94
110
  "typescript": "~6.0.0",
95
- "@symbiote-native/angular": "0.6.1",
96
- "@symbiote-native/react": "0.2.8",
97
- "@symbiote-native/vue": "0.3.8",
111
+ "@symbiote-native/angular": "0.7.0",
112
+ "@symbiote-native/engine": "0.2.0",
113
+ "@symbiote-native/react": "0.3.0",
114
+ "@symbiote-native/svelte": "0.2.0",
98
115
  "@symbiote-native/test-utils": "0.1.6",
99
- "@symbiote-native/engine": "0.1.7"
116
+ "@symbiote-native/vue": "0.4.0"
100
117
  },
101
118
  "scripts": {
102
119
  "typecheck": "tsc --build",
@@ -0,0 +1,6 @@
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';
@@ -1,62 +0,0 @@
1
- import { afterEach, describe, expect, it, vi } from 'vitest';
2
-
3
- const FAKE_NATIVE_SYSTEM_UI = {
4
- setBackgroundColorAsync: vi.fn(async () => undefined),
5
- getBackgroundColorAsync: vi.fn(async () => '#000000'),
6
- };
7
-
8
- // The real ExpoSystemUI native module only exists on device — resolving it via
9
- // requireNativeModule() at import time would throw in this headless test run, so the
10
- // module-lookup file is faked in place of expo-modules-core's runtime resolution, the same
11
- // pattern packages/device/src/core/device.test.ts uses.
12
- vi.mock('./native-module', () => ({
13
- expoSystemUI: FAKE_NATIVE_SYSTEM_UI,
14
- }));
15
-
16
- // react-native's real Platform module reads native constants that don't exist in this headless
17
- // run; processColor is stubbed to a simple, observable transform so the two branches
18
- // (color == null / Platform.OS === 'web' / native processColor) are each independently provable.
19
- vi.mock('react-native', () => ({
20
- Platform: { OS: 'ios' },
21
- processColor: vi.fn((color: string) => `processed(${color})`),
22
- }));
23
-
24
- const { getBackgroundColorAsync, setBackgroundColorAsync } = await import('./system-ui');
25
- const { Platform, processColor } = await import('react-native');
26
-
27
- afterEach(() => {
28
- vi.clearAllMocks();
29
- Platform.OS = 'ios';
30
- });
31
-
32
- describe('setBackgroundColorAsync', () => {
33
- it('passes null straight through when color is null', async () => {
34
- await setBackgroundColorAsync(null);
35
-
36
- expect(processColor).not.toHaveBeenCalled();
37
- expect(FAKE_NATIVE_SYSTEM_UI.setBackgroundColorAsync).toHaveBeenCalledWith(null);
38
- });
39
-
40
- it('runs a non-null color through processColor on native platforms', async () => {
41
- await setBackgroundColorAsync('tomato');
42
-
43
- expect(processColor).toHaveBeenCalledWith('tomato');
44
- expect(FAKE_NATIVE_SYSTEM_UI.setBackgroundColorAsync).toHaveBeenCalledWith('processed(tomato)');
45
- });
46
-
47
- it('passes the raw color straight through on web, skipping processColor', async () => {
48
- Platform.OS = 'web';
49
-
50
- await setBackgroundColorAsync('tomato');
51
-
52
- expect(processColor).not.toHaveBeenCalled();
53
- expect(FAKE_NATIVE_SYSTEM_UI.setBackgroundColorAsync).toHaveBeenCalledWith('tomato');
54
- });
55
- });
56
-
57
- describe('getBackgroundColorAsync', () => {
58
- it('delegates to the native module', async () => {
59
- await expect(getBackgroundColorAsync()).resolves.toBe('#000000');
60
- expect(FAKE_NATIVE_SYSTEM_UI.getBackgroundColorAsync).toHaveBeenCalled();
61
- });
62
- });