@alia.onl/sdk 7.2.8 → 7.2.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @alia.onl/sdk
2
2
 
3
+ ## 7.2.9
4
+
5
+ ### The full-screen chat clears the gesture bar and the keyboard
6
+
7
+ `AliaChatScreen` padded only the top safe-area inset, so on edge-to-edge
8
+ Android its composer sat under the gesture bar (OxyHQ/Mention#1140). It now pads
9
+ the bottom inset too, and wraps the chat in a keyboard-avoiding view that
10
+ measures its own position in the window (keyboard-controller's
11
+ `automaticOffset`): the composer rises onto the keyboard, and because that view
12
+ already ends above the inset, the inset is not added on top of the keyboard. The
13
+ avoiding view `PromptInput` carries measured its parent-relative layout and so
14
+ never lifted inside the screen. The web `KeyboardAvoidingView` accepts and
15
+ ignores `automaticOffset`.
16
+
17
+ `AliaChatScreen` is a full-screen route: render it where no tab bar or other
18
+ bottom chrome is drawn. Its keyboard lift needs the app wrapped in
19
+ keyboard-controller's `KeyboardProvider` (re-exported by this package).
20
+
3
21
  ## 7.2.8
4
22
 
5
23
  ### One Oxy runtime and a native-only notifications boundary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alia.onl/sdk",
3
- "version": "7.2.8",
3
+ "version": "7.2.9",
4
4
  "description": "Alia AI chat SDK — reusable chat UI, voice, and streaming components for Oxy apps",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -20,6 +20,7 @@
20
20
  import React from 'react';
21
21
  import { View, Text, TouchableOpacity } from 'react-native';
22
22
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
23
+ import { KeyboardAvoidingView } from '../lib/keyboard';
23
24
  import { AliaChatContent } from './AliaChatContent';
24
25
  import { IdentityMark } from './IdentityMark';
25
26
  import type { WelcomeSuggestion } from './AliaWelcomeMessage';
@@ -65,36 +66,51 @@ export function AliaChatScreen({
65
66
  }: AliaChatScreenProps) {
66
67
  const insets = useSafeAreaInsets();
67
68
 
69
+ // The screen owns the whole window, so it keeps its composer out of both
70
+ // system bars: the top inset clears the status bar, the bottom one the
71
+ // gesture bar or home indicator an edge-to-edge app draws over.
72
+ //
73
+ // The keyboard is handled INSIDE the bottom inset. The avoiding view measures
74
+ // its own frame in the window (`automaticOffset`), and that frame already
75
+ // ends `insets.bottom` above the window's edge, so the padding it adds is the
76
+ // keyboard's height minus the inset: the composer sits on the keyboard, not
77
+ // one inset above it. (Its parent-relative layout would read as zero overlap
78
+ // this deep in a host's tree, which is why the offset is measured.)
68
79
  return (
69
- <View className="flex-1 bg-background" style={{ paddingTop: insets.top }}>
70
- <AliaChatContent
71
- clientContext={clientContext}
72
- model={model}
73
- apiUrl={apiUrl}
74
- welcomeGreeting={welcomeGreeting}
75
- welcomeSubtitle={welcomeSubtitle}
76
- welcomeSuggestions={welcomeSuggestions}
77
- primaryColor={primaryColor}
78
- isDarkMode={isDarkMode}
79
- voiceSession={voiceSession}
80
- header={({ markState, hasMessages, clear }) => (
81
- <View className="flex-row items-center justify-between px-4 py-3">
82
- <View className="flex-row items-center gap-2.5">
83
- {headerLeft}
84
- <IdentityMark size={28} state={markState} spinOnPress />
85
- <Text className="text-lg font-semibold text-foreground">Alia</Text>
80
+ <View
81
+ className="flex-1 bg-background"
82
+ style={{ paddingTop: insets.top, paddingBottom: insets.bottom }}
83
+ >
84
+ <KeyboardAvoidingView behavior="padding" automaticOffset style={{ flex: 1 }}>
85
+ <AliaChatContent
86
+ clientContext={clientContext}
87
+ model={model}
88
+ apiUrl={apiUrl}
89
+ welcomeGreeting={welcomeGreeting}
90
+ welcomeSubtitle={welcomeSubtitle}
91
+ welcomeSuggestions={welcomeSuggestions}
92
+ primaryColor={primaryColor}
93
+ isDarkMode={isDarkMode}
94
+ voiceSession={voiceSession}
95
+ header={({ markState, hasMessages, clear }) => (
96
+ <View className="flex-row items-center justify-between px-4 py-3">
97
+ <View className="flex-row items-center gap-2.5">
98
+ {headerLeft}
99
+ <IdentityMark size={28} state={markState} spinOnPress />
100
+ <Text className="text-lg font-semibold text-foreground">Alia</Text>
101
+ </View>
102
+ <View className="flex-row items-center gap-2">
103
+ {hasMessages && (
104
+ <TouchableOpacity onPress={clear} className="px-2.5 py-1.5">
105
+ <Text className="text-sm text-muted-foreground">Clear</Text>
106
+ </TouchableOpacity>
107
+ )}
108
+ {headerRight}
109
+ </View>
86
110
  </View>
87
- <View className="flex-row items-center gap-2">
88
- {hasMessages && (
89
- <TouchableOpacity onPress={clear} className="px-2.5 py-1.5">
90
- <Text className="text-sm text-muted-foreground">Clear</Text>
91
- </TouchableOpacity>
92
- )}
93
- {headerRight}
94
- </View>
95
- </View>
96
- )}
97
- />
111
+ )}
112
+ />
113
+ </KeyboardAvoidingView>
98
114
  </View>
99
115
  );
100
116
  }
@@ -1,6 +1,11 @@
1
1
  // Web: re-export React Native built-in components as keyboard-controller substitutes
2
2
  import React from 'react';
3
- import { ScrollView, type ScrollViewProps, KeyboardAvoidingView } from 'react-native';
3
+ import {
4
+ ScrollView,
5
+ type ScrollViewProps,
6
+ KeyboardAvoidingView as RNKeyboardAvoidingView,
7
+ type KeyboardAvoidingViewProps as RNKeyboardAvoidingViewProps,
8
+ } from 'react-native';
4
9
 
5
10
  // Accept native-only props so shared components don't cause TS errors
6
11
  type KeyboardAwareScrollViewProps = ScrollViewProps & {
@@ -17,6 +22,19 @@ const KeyboardAwareScrollView = React.forwardRef<ScrollView, KeyboardAwareScroll
17
22
  );
18
23
  KeyboardAwareScrollView.displayName = 'KeyboardAwareScrollView';
19
24
 
25
+ // `automaticOffset` is keyboard-controller's: measure the view's position in
26
+ // the window instead of trusting its parent-relative layout. The browser moves
27
+ // its own viewport for the keyboard, so on web it has nothing to do.
28
+ type KeyboardAvoidingViewProps = RNKeyboardAvoidingViewProps & {
29
+ automaticOffset?: boolean;
30
+ };
31
+
32
+ const KeyboardAvoidingView = React.forwardRef<
33
+ React.ComponentRef<typeof RNKeyboardAvoidingView>,
34
+ KeyboardAvoidingViewProps
35
+ >(({ automaticOffset, ...props }, ref) => <RNKeyboardAvoidingView ref={ref} {...props} />);
36
+ KeyboardAvoidingView.displayName = 'KeyboardAvoidingView';
37
+
20
38
  export { KeyboardAwareScrollView, KeyboardAvoidingView };
21
39
 
22
40
  // No-op provider on web — keyboard-controller is native-only