@ggui-ai/mcp-apps-react-native 0.24.0 → 0.25.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/package.json +4 -4
- package/src/theme/ThemeProvider.tsx +13 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/mcp-apps-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "React Native host helper for MCP Apps — components and hooks for embedding agent-generated UIs in mobile apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ggui",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@modelcontextprotocol/ext-apps": "^1.7.2",
|
|
61
|
-
"@ggui-ai/design": "0.
|
|
62
|
-
"@ggui-ai/
|
|
63
|
-
"@ggui-ai/
|
|
61
|
+
"@ggui-ai/design": "0.25.0",
|
|
62
|
+
"@ggui-ai/iframe-runtime": "0.25.0",
|
|
63
|
+
"@ggui-ai/protocol": "0.25.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@modelcontextprotocol/sdk": "^1.27.0",
|
|
@@ -93,6 +93,14 @@ export interface ThemeProviderProps {
|
|
|
93
93
|
children: ReactNode;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* What `useColorScheme()` can report across the supported React Native
|
|
98
|
+
* range: before 0.82 it is `'light' | 'dark' | null | undefined`, and from
|
|
99
|
+
* 0.82 it is `'light' | 'dark' | 'unspecified'`. Only `'light'` and
|
|
100
|
+
* `'dark'` name a scheme.
|
|
101
|
+
*/
|
|
102
|
+
type OsColorScheme = 'light' | 'dark' | 'unspecified' | null | undefined;
|
|
103
|
+
|
|
96
104
|
/**
|
|
97
105
|
* TERMINAL CONSUMER of the theme-mode ladder (adversarial-cycle
|
|
98
106
|
* ruling, ggui#598 leg 4): the RN provider paints the NATIVE chrome
|
|
@@ -102,7 +110,8 @@ export interface ThemeProviderProps {
|
|
|
102
110
|
* terminal-consumer default (the same posture as the design package's
|
|
103
111
|
* css-tokens terminal default), NOT a mid-ladder defaulting: it fires
|
|
104
112
|
* only after the embedder's explicit prop AND the OS scheme are both
|
|
105
|
-
* absent (`useColorScheme()` → null, rare
|
|
113
|
+
* absent (`useColorScheme()` → null, rare, or `'unspecified'`, which
|
|
114
|
+
* names no scheme). Mid-ladder code — anything
|
|
106
115
|
* with a layer below it — must never default; it delegates to
|
|
107
116
|
* `@ggui-ai/protocol/integrations/theme-binding` and lets absence
|
|
108
117
|
* propagate (the composition law).
|
|
@@ -112,9 +121,10 @@ export interface ThemeProviderProps {
|
|
|
112
121
|
*/
|
|
113
122
|
export function resolveNativeScheme(
|
|
114
123
|
prop: 'light' | 'dark' | undefined,
|
|
115
|
-
system:
|
|
124
|
+
system: OsColorScheme,
|
|
116
125
|
): 'light' | 'dark' {
|
|
117
|
-
|
|
126
|
+
const os = system === 'light' || system === 'dark' ? system : undefined;
|
|
127
|
+
return prop ?? os ?? 'light';
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
export function ThemeProvider({ colorScheme: colorSchemeProp, children }: ThemeProviderProps) {
|