@alia.onl/sdk 7.2.7 → 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 +27 -0
- package/package.json +1 -1
- package/src/components/AliaChatScreen.tsx +44 -28
- package/src/lib/keyboard.tsx +19 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
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
|
+
|
|
21
|
+
## 7.2.8
|
|
22
|
+
|
|
23
|
+
### One Oxy runtime and a native-only notifications boundary
|
|
24
|
+
|
|
25
|
+
The Alia app now consumes the canonical `@oxy.so/*` packages throughout, so
|
|
26
|
+
the provider and SDK hooks resolve the same Services context. Its notification
|
|
27
|
+
setup also loads `expo-notifications` only after confirming a native platform;
|
|
28
|
+
web no longer evaluates Expo's unsupported device push-token listener.
|
|
29
|
+
|
|
3
30
|
## 7.2.7
|
|
4
31
|
|
|
5
32
|
### Compatible Oxy 1.0 peers
|
package/package.json
CHANGED
|
@@ -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
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
}
|
package/src/lib/keyboard.tsx
CHANGED
|
@@ -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 {
|
|
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
|