@adminide-stack/yantra-mobile 12.0.186 → 12.0.187-alpha.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/lib/components/KeyboardComposerDock.js +44 -32
- package/lib/components/KeyboardComposerDock.js.map +1 -1
- package/lib/components/iosKeysCoverage.js +5 -0
- package/lib/components/iosKeysCoverage.js.map +1 -0
- package/lib/features/chat/oneTimeCode.js.map +1 -1
- package/lib/features/job-search/cvText.js.map +1 -1
- package/lib/features/resume/ResumeEditor.js.map +1 -1
- package/lib/graphql/typePolicies.js.map +1 -1
- package/lib/hooks/useChatApi.js.map +1 -1
- package/lib/hooks/useHostChatSteering.js +6 -2
- package/lib/hooks/useHostChatSteering.js.map +1 -1
- package/lib/utils/keyboardController.js +11 -3
- package/lib/utils/keyboardController.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsx,jsxs}from'react/jsx-runtime';import {useRef,useState,useEffect}from'react';import {StyleSheet,View,PanResponder,Platform,Keyboard,LayoutAnimation}from'react-native';import Animated,{useAnimatedStyle}from'react-native-reanimated';import {isKeyboardControllerAvailable,dismissKeyboard}from'../utils/keyboardController.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import {useRef,useState,useEffect}from'react';import {StyleSheet,View,PanResponder,Platform,Keyboard,Dimensions,LayoutAnimation}from'react-native';import Animated,{useAnimatedStyle}from'react-native-reanimated';import {keyboardControllerModule,isKeyboardControllerAvailable,dismissKeyboard}from'../utils/keyboardController.js';import {iosKeysCoverage}from'./iosKeysCoverage.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -23,35 +23,29 @@ function KeyboardAwareScreen({
|
|
|
23
23
|
style,
|
|
24
24
|
testID
|
|
25
25
|
}) {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const controller = keyboardControllerModule();
|
|
27
|
+
if (controller) {
|
|
28
|
+
const {
|
|
29
|
+
KeyboardGestureArea
|
|
30
|
+
} = controller;
|
|
28
31
|
return /* @__PURE__ */ jsx(KeyboardGestureArea, { style: [styles.flex, style], interpolator: "ios", showOnSwipeUp: true, enableSwipeToDismiss: true, textInputNativeID: COMPOSER_INPUT_NATIVE_ID, testID, children });
|
|
29
32
|
}
|
|
30
33
|
return /* @__PURE__ */ jsx(View, { style: [styles.flex, style], testID, children });
|
|
31
34
|
}
|
|
32
|
-
function
|
|
33
|
-
return Platform.OS === "android"
|
|
35
|
+
function androidLiftController() {
|
|
36
|
+
return Platform.OS === "android" ? keyboardControllerModule() : null;
|
|
34
37
|
}
|
|
35
|
-
function AndroidKeyboardSpacer(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = require("react-native-keyboard-controller");
|
|
38
|
+
function AndroidKeyboardSpacer({
|
|
39
|
+
controller
|
|
40
|
+
}) {
|
|
39
41
|
const {
|
|
40
42
|
height
|
|
41
|
-
} = useReanimatedKeyboardAnimation();
|
|
43
|
+
} = controller.useReanimatedKeyboardAnimation();
|
|
42
44
|
const style = useAnimatedStyle(() => ({
|
|
43
45
|
height: Math.max(0, -height.value)
|
|
44
46
|
}));
|
|
45
47
|
return /* @__PURE__ */ jsx(Animated.View, { style, pointerEvents: "none" });
|
|
46
48
|
}
|
|
47
|
-
function KeyboardLiftSpacer() {
|
|
48
|
-
const height = useKeyboardLiftHeight();
|
|
49
|
-
if (androidNeedsLift()) return /* @__PURE__ */ jsx(AndroidKeyboardSpacer, {});
|
|
50
|
-
if (Platform.OS !== "ios" || height <= 0) return null;
|
|
51
|
-
return /* @__PURE__ */ jsx(View, { style: {
|
|
52
|
-
height
|
|
53
|
-
}, pointerEvents: "none" });
|
|
54
|
-
}
|
|
55
49
|
function configureKeyboardLayout(duration) {
|
|
56
50
|
if (Platform.OS !== "ios") return;
|
|
57
51
|
LayoutAnimation.configureNext({
|
|
@@ -62,19 +56,17 @@ function configureKeyboardLayout(duration) {
|
|
|
62
56
|
});
|
|
63
57
|
}
|
|
64
58
|
function listenKeyboardController(onHeight) {
|
|
65
|
-
|
|
59
|
+
var _a;
|
|
60
|
+
const KeyboardEvents = (_a = keyboardControllerModule()) == null ? void 0 : _a.KeyboardEvents;
|
|
61
|
+
if (!(KeyboardEvents == null ? void 0 : KeyboardEvents.addListener)) return null;
|
|
66
62
|
try {
|
|
67
|
-
const {
|
|
68
|
-
KeyboardEvents
|
|
69
|
-
} = require("react-native-keyboard-controller");
|
|
70
|
-
if (!(KeyboardEvents == null ? void 0 : KeyboardEvents.addListener)) return null;
|
|
71
63
|
const show = KeyboardEvents.addListener("keyboardWillShow", (e) => {
|
|
72
|
-
var
|
|
73
|
-
onHeight((
|
|
64
|
+
var _a2;
|
|
65
|
+
onHeight((_a2 = e == null ? void 0 : e.height) != null ? _a2 : 0, e == null ? void 0 : e.duration);
|
|
74
66
|
});
|
|
75
67
|
const shown = KeyboardEvents.addListener("keyboardDidShow", (e) => {
|
|
76
|
-
var
|
|
77
|
-
onHeight((
|
|
68
|
+
var _a2;
|
|
69
|
+
onHeight((_a2 = e == null ? void 0 : e.height) != null ? _a2 : 0, e == null ? void 0 : e.duration);
|
|
78
70
|
});
|
|
79
71
|
const hide = KeyboardEvents.addListener("keyboardWillHide", (e) => {
|
|
80
72
|
onHeight(0, e == null ? void 0 : e.duration);
|
|
@@ -97,15 +89,25 @@ function listenKeyboardController(onHeight) {
|
|
|
97
89
|
function useKeyboardLiftHeight() {
|
|
98
90
|
const [height, setHeight] = useState(0);
|
|
99
91
|
useEffect(() => {
|
|
92
|
+
let current = 0;
|
|
100
93
|
const apply = (next, duration) => {
|
|
94
|
+
const lift = next > 0 ? next : 0;
|
|
95
|
+
if (lift === current) return;
|
|
96
|
+
current = lift;
|
|
101
97
|
configureKeyboardLayout(duration);
|
|
102
|
-
setHeight(
|
|
98
|
+
setHeight(lift);
|
|
103
99
|
};
|
|
104
|
-
|
|
100
|
+
if (Platform.OS === "ios") {
|
|
101
|
+
const frame = Keyboard.addListener("keyboardWillChangeFrame", (e) => {
|
|
102
|
+
apply(iosKeysCoverage(e.endCoordinates, Dimensions.get("screen").height), e.duration);
|
|
103
|
+
});
|
|
104
|
+
return () => frame.remove();
|
|
105
|
+
}
|
|
106
|
+
const show = Keyboard.addListener("keyboardDidShow", (e) => {
|
|
105
107
|
var _a, _b;
|
|
106
108
|
apply((_b = (_a = e.endCoordinates) == null ? void 0 : _a.height) != null ? _b : 0, e.duration);
|
|
107
109
|
});
|
|
108
|
-
const hide = Keyboard.addListener(
|
|
110
|
+
const hide = Keyboard.addListener("keyboardDidHide", (e) => {
|
|
109
111
|
apply(0, e.duration);
|
|
110
112
|
});
|
|
111
113
|
const controller = listenKeyboardController(apply);
|
|
@@ -115,7 +117,16 @@ function useKeyboardLiftHeight() {
|
|
|
115
117
|
controller == null ? void 0 : controller.remove();
|
|
116
118
|
};
|
|
117
119
|
}, []);
|
|
118
|
-
return Platform.OS === "android" && !
|
|
120
|
+
return Platform.OS === "android" && !androidLiftController() ? 0 : height;
|
|
121
|
+
}
|
|
122
|
+
function KeyboardLiftSpacer() {
|
|
123
|
+
const height = useKeyboardLiftHeight();
|
|
124
|
+
const androidController = androidLiftController();
|
|
125
|
+
if (androidController) return /* @__PURE__ */ jsx(AndroidKeyboardSpacer, { controller: androidController });
|
|
126
|
+
if (Platform.OS !== "ios" || height <= 0) return null;
|
|
127
|
+
return /* @__PURE__ */ jsx(View, { style: {
|
|
128
|
+
height
|
|
129
|
+
}, pointerEvents: "none" });
|
|
119
130
|
}
|
|
120
131
|
function KeyboardComposerDock({
|
|
121
132
|
children,
|
|
@@ -125,6 +136,7 @@ function KeyboardComposerDock({
|
|
|
125
136
|
const keyboardHeight = useKeyboardLiftHeight();
|
|
126
137
|
const closedPadding = Math.max(closedInset, 0);
|
|
127
138
|
const useNativeSwipe = isKeyboardControllerAvailable();
|
|
139
|
+
const androidController = androidLiftController();
|
|
128
140
|
const onSwipeUpRef = useRef(onSwipeUp);
|
|
129
141
|
onSwipeUpRef.current = onSwipeUp;
|
|
130
142
|
const fallbackGestures = useRef(PanResponder.create({
|
|
@@ -142,7 +154,7 @@ function KeyboardComposerDock({
|
|
|
142
154
|
Platform.OS === "ios" ? /* @__PURE__ */ jsx(View, { style: {
|
|
143
155
|
height: keyboardHeight
|
|
144
156
|
}, pointerEvents: "none" }) : null,
|
|
145
|
-
|
|
157
|
+
androidController ? /* @__PURE__ */ jsx(AndroidKeyboardSpacer, { controller: androidController }) : null
|
|
146
158
|
] }));
|
|
147
159
|
}
|
|
148
160
|
const styles = StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardComposerDock.js","sources":["../../src/components/KeyboardComposerDock.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport {\n Keyboard,\n LayoutAnimation,\n PanResponder,\n Platform,\n StyleSheet,\n View,\n type StyleProp,\n type ViewStyle,\n} from 'react-native';\nimport Animated, { useAnimatedStyle } from 'react-native-reanimated';\nimport { dismissKeyboard, isKeyboardControllerAvailable } from '../utils/keyboardController';\n\nexport const COMPOSER_INPUT_NATIVE_ID = 'yantra-composer';\n\nexport type KeyboardComposerDockProps = {\n children: React.ReactNode;\n /** Home-indicator inset when the keyboard is closed. */\n closedInset: number;\n keyboardVisible?: boolean;\n /** Expo Go: swipe up on the composer focuses this field (opens the keyboard). */\n onSwipeUp?: () => void;\n};\n\n/**\n * Native swipe region when keyboard-controller is linked: swipe up opens the\n * keyboard, swipe down closes it and the keys follow the finger (iOS interpolator).\n */\nexport function KeyboardAwareScreen({\n children,\n style,\n testID,\n}: {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}) {\n if (isKeyboardControllerAvailable()) {\n const KeyboardGestureArea = require('react-native-keyboard-controller')\n .KeyboardGestureArea as React.ComponentType<{\n style?: StyleProp<ViewStyle>;\n interpolator?: 'ios' | 'linear';\n showOnSwipeUp?: boolean;\n enableSwipeToDismiss?: boolean;\n textInputNativeID?: string;\n testID?: string;\n children?: React.ReactNode;\n }>;\n return (\n <KeyboardGestureArea\n style={[styles.flex, style]}\n interpolator=\"ios\"\n showOnSwipeUp\n enableSwipeToDismiss\n textInputNativeID={COMPOSER_INPUT_NATIVE_ID}\n testID={testID}\n >\n {children}\n </KeyboardGestureArea>\n );\n }\n return (\n <View style={[styles.flex, style]} testID={testID}>\n {children}\n </View>\n );\n}\n\n/**\n * Android under KeyboardProvider: keyboard-controller draws the window edge to\n * edge, so `softwareKeyboardLayoutMode: resize` no longer shrinks it and the\n * keys cover whatever sits at the bottom (the composer vanished behind them).\n * Lift in JS there, like iOS. Expo Go has no controller and still resizes.\n */\nfunction androidNeedsLift(): boolean {\n return Platform.OS === 'android' && isKeyboardControllerAvailable();\n}\n\n/** Android spacer that follows the keys frame by frame on the UI thread. */\nfunction AndroidKeyboardSpacer() {\n const { useReanimatedKeyboardAnimation } = require('react-native-keyboard-controller') as {\n useReanimatedKeyboardAnimation: () => { height: { value: number } };\n };\n const { height } = useReanimatedKeyboardAnimation();\n // `height` runs 0 -> -keyboardHeight.\n const style = useAnimatedStyle(() => ({ height: Math.max(0, -height.value) }));\n return <Animated.View style={style} pointerEvents=\"none\" />;\n}\n\n/** In-flow spacer so a flex sibling (stage/canvas) shrinks above the keys. */\nexport function KeyboardLiftSpacer() {\n const height = useKeyboardLiftHeight();\n if (androidNeedsLift()) return <AndroidKeyboardSpacer />;\n if (Platform.OS !== 'ios' || height <= 0) return null;\n return <View style={{ height }} pointerEvents=\"none\" />;\n}\n\nfunction configureKeyboardLayout(duration?: number) {\n if (Platform.OS !== 'ios') return;\n LayoutAnimation.configureNext({\n duration: duration && duration > 0 ? duration : 250,\n update: {\n type: LayoutAnimation.Types.keyboard,\n },\n });\n}\n\ntype KeyboardHeightListener = { remove: () => void };\n\nfunction listenKeyboardController(\n onHeight: (height: number, duration?: number) => void,\n): KeyboardHeightListener | null {\n if (!isKeyboardControllerAvailable()) return null;\n try {\n const { KeyboardEvents } = require('react-native-keyboard-controller') as {\n KeyboardEvents?: {\n addListener: (\n event: string,\n cb: (e: { height?: number; duration?: number }) => void,\n ) => {\n remove: () => void;\n };\n };\n };\n if (!KeyboardEvents?.addListener) return null;\n const show = KeyboardEvents.addListener('keyboardWillShow', (e) => {\n onHeight(e?.height ?? 0, e?.duration);\n });\n const shown = KeyboardEvents.addListener('keyboardDidShow', (e) => {\n onHeight(e?.height ?? 0, e?.duration);\n });\n const hide = KeyboardEvents.addListener('keyboardWillHide', (e) => {\n onHeight(0, e?.duration);\n });\n const hidden = KeyboardEvents.addListener('keyboardDidHide', (e) => {\n onHeight(0, e?.duration);\n });\n return {\n remove: () => {\n show.remove();\n shown.remove();\n hide.remove();\n hidden.remove();\n },\n };\n } catch {\n return null;\n }\n}\n\n/** Keyboard height used by the dock spacer. Chat reads this so it scrolls after the list shrinks. */\nexport function useKeyboardLiftHeight(): number {\n const [height, setHeight] = useState(0);\n\n useEffect(() => {\n const apply = (next: number, duration?: number) => {\n configureKeyboardLayout(duration);\n setHeight(next);\n };\n const show = Keyboard.addListener(Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow', (e) => {\n apply(e.endCoordinates?.height ?? 0, e.duration);\n });\n const hide = Keyboard.addListener(Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide', (e) => {\n apply(0, e.duration);\n });\n // KeyboardProvider swallows RN Keyboard events on staging binaries, so\n // Create image / video inputs sat under the keys. Mirror height from\n // keyboard-controller when it is linked.\n const controller = listenKeyboardController(apply);\n return () => {\n show.remove();\n hide.remove();\n controller?.remove();\n };\n }, []);\n\n return Platform.OS === 'android' && !androidNeedsLift() ? 0 : height;\n}\n\n/**\n * In-flow spacer = full keyboard height so the composer docks on the keys.\n * Native swipe lives on KeyboardAwareScreen; Expo Go uses a composer pan.\n */\nexport function KeyboardComposerDock({ children, closedInset, onSwipeUp }: KeyboardComposerDockProps) {\n const keyboardHeight = useKeyboardLiftHeight();\n const closedPadding = Math.max(closedInset, 0);\n const useNativeSwipe = isKeyboardControllerAvailable();\n const onSwipeUpRef = useRef(onSwipeUp);\n onSwipeUpRef.current = onSwipeUp;\n const fallbackGestures = useRef(\n PanResponder.create({\n onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dy) > 12 && Math.abs(g.dy) > Math.abs(g.dx) * 1.2,\n onPanResponderRelease: (_, g) => {\n if (g.dy < -28 || g.vy < -0.55) onSwipeUpRef.current?.();\n else if (g.dy > 28 || g.vy > 0.55) dismissKeyboard();\n },\n }),\n ).current;\n\n return (\n <View style={styles.dockWrap} {...(useNativeSwipe ? null : fallbackGestures.panHandlers)}>\n <View style={[styles.dock, { paddingBottom: Math.max(0, closedPadding - keyboardHeight) }]}>\n {children}\n </View>\n {Platform.OS === 'ios' ? <View style={{ height: keyboardHeight }} pointerEvents=\"none\" /> : null}\n {androidNeedsLift() ? <AndroidKeyboardSpacer /> : null}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n // Pin composer + keyboard spacer to the bottom of the column. Without this,\n // a short sibling (collapsed stage, chips) top-aligns the field and the\n // leftover reads as a hole above the keys.\n dockWrap: {\n marginTop: 'auto',\n width: '100%',\n flexGrow: 0,\n flexShrink: 0,\n },\n dock: {\n width: '100%',\n alignItems: 'center',\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAIO,MAAM,wBAA2B,GAAA;AAcjC,SAAS,mBAAoB,CAAA;AAAA,EAClC,QAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAIG,EAAA;AACD,EAAA,IAAI,+BAAiC,EAAA;AACnC,IAAM,MAAA,mBAAA,GAAsB,OAAQ,CAAA,kCAAkC,CAAE,CAAA,mBAAA;AASxE,IAAA,2BAAQ,mBAAoB,EAAA,EAAA,KAAA,EAAO,CA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EAAA,IAAM,CAAE,CAAA,EAAA,GAAK,MAAsB,eAAA,EAAA;AAAA;AAC9G,GACD,CAAC,CAAE,CAAA,OAAA;AACJ,EAAO,uBAAA,IAAA,CAAC,qCAAK,KAAO,EAAA,MAAA,CAAO,YAAc,cAAiB,GAAA,IAAA,GAAO,gBAAiB,CAAA,WAAA,CAAA,EAA1E,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,KAAA,EAAO,CAAC,MAAA,CAAO,IAAM,EAAA;AAAA,MACjC,aAAe,EAAA,IAAA,CAAK,GAAI,CAAA,CAAA,EAAG,gBAAgB,cAAc;AAAA,KAC1D,GACY,QACL,EAAA,CAAA;AAAA,IACC,QAAS,CAAA,EAAA,KAAO,KAAQ,mBAAA,GAAA,CAAC,QAAK,KAAO,EAAA;AAAA,MAC5C,MAAQ,EAAA;AAAA,KACV,EAAG,aAAc,EAAA,MAAA,EAAO,CAAK,GAAA,IAAA;AAAA,IACpB,gBAAiB,EAAA,mBAAK,GAAA,CAAA,qBAAA,EAAA,EAAsB,CAAK,GAAA;AAAA,GACtD,EAAA,CAAA,CAAA;AACR;AACA,MAAM,MAAA,GAAS,WAAW,MAAO,CAAA;AAAA,EAC/B,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,QAAU,EAAA;AAAA,IACR,SAAW,EAAA,MAAA;AAAA,IACX,KAAO,EAAA,MAAA;AAAA,IACP,QAAU,EAAA,CAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,UAAY,EAAA;AAAA;AAEhB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"KeyboardComposerDock.js","sources":["../../src/components/KeyboardComposerDock.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport {\n Dimensions,\n Keyboard,\n LayoutAnimation,\n PanResponder,\n Platform,\n StyleSheet,\n View,\n type StyleProp,\n type ViewStyle,\n} from 'react-native';\nimport Animated, { useAnimatedStyle } from 'react-native-reanimated';\nimport {\n dismissKeyboard,\n isKeyboardControllerAvailable,\n keyboardControllerModule,\n type KeyboardControllerModule,\n} from '../utils/keyboardController';\nimport { iosKeysCoverage } from './iosKeysCoverage';\n\nexport const COMPOSER_INPUT_NATIVE_ID = 'yantra-composer';\n\nexport type KeyboardComposerDockProps = {\n children: React.ReactNode;\n /** Home-indicator inset when the keyboard is closed. */\n closedInset: number;\n keyboardVisible?: boolean;\n /** Expo Go: swipe up on the composer focuses this field (opens the keyboard). */\n onSwipeUp?: () => void;\n};\n\n/**\n * Native swipe region when keyboard-controller is linked: swipe up opens the\n * keyboard, swipe down closes it and the keys follow the finger (iOS interpolator).\n */\nexport function KeyboardAwareScreen({\n children,\n style,\n testID,\n}: {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}) {\n const controller = keyboardControllerModule();\n if (controller) {\n const { KeyboardGestureArea } = controller;\n return (\n <KeyboardGestureArea\n style={[styles.flex, style]}\n interpolator=\"ios\"\n showOnSwipeUp\n enableSwipeToDismiss\n textInputNativeID={COMPOSER_INPUT_NATIVE_ID}\n testID={testID}\n >\n {children}\n </KeyboardGestureArea>\n );\n }\n return (\n <View style={[styles.flex, style]} testID={testID}>\n {children}\n </View>\n );\n}\n\n/**\n * Android under KeyboardProvider: keyboard-controller draws the window edge to\n * edge, so `softwareKeyboardLayoutMode: resize` no longer shrinks it and the\n * keys cover whatever sits at the bottom (the composer vanished behind them).\n * Lift in JS there, like iOS. Expo Go has no controller and still resizes.\n */\nfunction androidLiftController(): KeyboardControllerModule | null {\n return Platform.OS === 'android' ? keyboardControllerModule() : null;\n}\n\n/** Android spacer that follows the keys frame by frame on the UI thread. */\nfunction AndroidKeyboardSpacer({ controller }: { controller: KeyboardControllerModule }) {\n const { height } = controller.useReanimatedKeyboardAnimation();\n // `height` runs 0 -> -keyboardHeight.\n const style = useAnimatedStyle(() => ({ height: Math.max(0, -height.value) }));\n return <Animated.View style={style} pointerEvents=\"none\" />;\n}\n\nfunction configureKeyboardLayout(duration?: number) {\n if (Platform.OS !== 'ios') return;\n LayoutAnimation.configureNext({\n duration: duration && duration > 0 ? duration : 250,\n update: {\n type: LayoutAnimation.Types.keyboard,\n },\n });\n}\n\ntype KeyboardHeightListener = { remove: () => void };\n\nfunction listenKeyboardController(\n onHeight: (height: number, duration?: number) => void,\n): KeyboardHeightListener | null {\n const KeyboardEvents = keyboardControllerModule()?.KeyboardEvents;\n if (!KeyboardEvents?.addListener) return null;\n try {\n const show = KeyboardEvents.addListener('keyboardWillShow', (e) => {\n onHeight(e?.height ?? 0, e?.duration);\n });\n const shown = KeyboardEvents.addListener('keyboardDidShow', (e) => {\n onHeight(e?.height ?? 0, e?.duration);\n });\n const hide = KeyboardEvents.addListener('keyboardWillHide', (e) => {\n onHeight(0, e?.duration);\n });\n const hidden = KeyboardEvents.addListener('keyboardDidHide', (e) => {\n onHeight(0, e?.duration);\n });\n return {\n remove: () => {\n show.remove();\n shown.remove();\n hide.remove();\n hidden.remove();\n },\n };\n } catch {\n return null;\n }\n}\n\n/**\n * Keyboard height used by the dock spacer. Chat reads this so it scrolls after the list shrinks.\n *\n * iOS reads one source: UIKit's own end frame, which React Native passes on with\n * `keyboardWillChangeFrame` (it fires for show, hide and every resize, before the\n * keys move). keyboard-controller is deliberately not read there. Its iOS\n * `keyboardDidShow` reports the keyboard view's live position whenever the event\n * lands before the animation's deadline, and it caches that view until the window\n * count changes. Around a system picker (photo library, files, camera) it reported\n * 0 and then -209 with the keys up; as the last event of the burst it won, and the\n * composer stayed under the keys from then on.\n */\nexport function useKeyboardLiftHeight(): number {\n const [height, setHeight] = useState(0);\n\n useEffect(() => {\n let current = 0;\n const apply = (next: number, duration?: number) => {\n const lift = next > 0 ? next : 0;\n // Only animate a real change: configureNext applies to whatever commits next.\n if (lift === current) return;\n current = lift;\n configureKeyboardLayout(duration);\n setHeight(lift);\n };\n if (Platform.OS === 'ios') {\n const frame = Keyboard.addListener('keyboardWillChangeFrame', (e) => {\n apply(iosKeysCoverage(e.endCoordinates, Dimensions.get('screen').height), e.duration);\n });\n return () => frame.remove();\n }\n const show = Keyboard.addListener('keyboardDidShow', (e) => {\n apply(e.endCoordinates?.height ?? 0, e.duration);\n });\n const hide = Keyboard.addListener('keyboardDidHide', (e) => {\n apply(0, e.duration);\n });\n // Android under KeyboardProvider: the window no longer resizes for the\n // keys and staging binaries missed React Native's own events (Create\n // image / video inputs sat under the keys), so mirror keyboard-controller.\n const controller = listenKeyboardController(apply);\n return () => {\n show.remove();\n hide.remove();\n controller?.remove();\n };\n }, []);\n\n return Platform.OS === 'android' && !androidLiftController() ? 0 : height;\n}\n\n/** In-flow spacer so a flex sibling (stage/canvas) shrinks above the keys. */\nexport function KeyboardLiftSpacer() {\n const height = useKeyboardLiftHeight();\n const androidController = androidLiftController();\n if (androidController) return <AndroidKeyboardSpacer controller={androidController} />;\n if (Platform.OS !== 'ios' || height <= 0) return null;\n return <View style={{ height }} pointerEvents=\"none\" />;\n}\n\n/**\n * In-flow spacer = full keyboard height so the composer docks on the keys.\n * Native swipe lives on KeyboardAwareScreen; Expo Go uses a composer pan.\n */\nexport function KeyboardComposerDock({ children, closedInset, onSwipeUp }: KeyboardComposerDockProps) {\n const keyboardHeight = useKeyboardLiftHeight();\n const closedPadding = Math.max(closedInset, 0);\n const useNativeSwipe = isKeyboardControllerAvailable();\n const androidController = androidLiftController();\n const onSwipeUpRef = useRef(onSwipeUp);\n onSwipeUpRef.current = onSwipeUp;\n const fallbackGestures = useRef(\n PanResponder.create({\n onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dy) > 12 && Math.abs(g.dy) > Math.abs(g.dx) * 1.2,\n onPanResponderRelease: (_, g) => {\n if (g.dy < -28 || g.vy < -0.55) onSwipeUpRef.current?.();\n else if (g.dy > 28 || g.vy > 0.55) dismissKeyboard();\n },\n }),\n ).current;\n\n return (\n <View style={styles.dockWrap} {...(useNativeSwipe ? null : fallbackGestures.panHandlers)}>\n <View style={[styles.dock, { paddingBottom: Math.max(0, closedPadding - keyboardHeight) }]}>\n {children}\n </View>\n {Platform.OS === 'ios' ? <View style={{ height: keyboardHeight }} pointerEvents=\"none\" /> : null}\n {androidController ? <AndroidKeyboardSpacer controller={androidController} /> : null}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n // Pin composer + keyboard spacer to the bottom of the column. Without this,\n // a short sibling (collapsed stage, chips) top-aligns the field and the\n // leftover reads as a hole above the keys.\n dockWrap: {\n marginTop: 'auto',\n width: '100%',\n flexGrow: 0,\n flexShrink: 0,\n },\n dock: {\n width: '100%',\n alignItems: 'center',\n },\n});\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;AAKO,MAAM,wBAA2B,GAAA;AAcjC,SAAS,mBAAoB,CAAA;AAAA,EAClC,QAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAIG,EAAA;AACD,EAAA,MAAM,aAAa,wBAAyB,EAAA;AAC5C,EAAA,IAAI,UAAY,EAAA;AACd,IAAM,MAAA;AAAA,MACJ;AAAA,KACE,GAAA,UAAA;AACJ,IAAA,2BAAQ,mBAAoB,EAAA,EAAA,KAAA,EAAO,CAAC,MAAA,CAAO,MAAM,KAAK,CAAA,EAAG,YAAa,EAAA,KAAA,EAAM,eAAa,IAAC,EAAA,oBAAA,EAAoB,MAAC,iBAAmB,EAAA,wBAAA,EAA0B,QAC/I,QACL,EAAA,CAAA;AAAA;AAEV,EAAO,uBAAA,GAAA,CAAC,QAAK,KAAO,EAAA,CAAC,OAAO,IAAM,EAAA,KAAK,CAAG,EAAA,MAAA,EAC/B,QACL,EAAA,CAAA;AACR;AAQA,SAAS,qBAAyD,GAAA;AAChE,EAAA,OAAO,QAAS,CAAA,EAAA,KAAO,SAAY,GAAA,wBAAA,EAA6B,GAAA,IAAA;AAClE;AAGA,SAAS,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@@
|
|
|
1
|
+
{"version":3,"file":"iosKeysCoverage.js","sources":["../../src/components/iosKeysCoverage.ts"],"sourcesContent":["/** UIKit's keyboard end frame as React Native passes it on (`endCoordinates`), in screen points. */\nexport type KeyboardEndFrame = {\n screenY: number;\n height: number;\n};\n\n/**\n * How much of the bottom of the screen the iOS keyboard covers, read from the\n * end frame UIKit puts on its keyboard notifications.\n *\n * That is the distance from the keys' top edge down to the bottom of the\n * screen, never more than the keyboard is tall:\n * - keys going down, or parked below the screen while a hardware keyboard is\n * connected (the frame still has a height there): 0;\n * - the shortcut bar a hardware keyboard leaves on screen: the bar's height;\n * - docked keys: their height.\n */\nexport function iosKeysCoverage(end: KeyboardEndFrame | null | undefined, screenHeight: number): number {\n if (!end) return 0;\n const covered = Math.min(end.height, screenHeight - end.screenY);\n return Number.isFinite(covered) && covered > 0 ? covered : 0;\n}\n"],"names":[],"mappings":"AAiBgB,SAAA,eAAA,CAAgB,KAA0C,YAA8B,EAAA;AACtG,EAAI,IAAA,CAAC,KAAY,OAAA,CAAA;AACjB,EAAA,MAAM,UAAU,IAAK,CAAA,GAAA,CAAI,IAAI,MAAQ,EAAA,YAAA,GAAe,IAAI,OAAO,CAAA;AAC/D,EAAA,OAAO,OAAO,QAAS,CAAA,OAAO,CAAK,IAAA,OAAA,GAAU,IAAI,OAAU,GAAA,CAAA;AAC7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oneTimeCode.js","sources":["../../../src/features/chat/oneTimeCode.ts"],"sourcesContent":["/**\n * The `one-time-code` connect request, phone side: a site sent the person a\n * code (an email or text OTP, a 2-step code) and their Computer is parked on\n * the page that asks for it.\n *\n * The request and the calls that enter the code come from common's\n * CONNECTOR_CONNECT_PROTOCOL (isOneTimeCodeRequest, oneTimeCodeEntry), the same\n * module the web card reads, so both type the code the same way: one\n * YANTRA_COMPUTER_ACT that first proves the page is still on the site the code\n * was sent for, then types it and presses the button the agent named (Enter\n * when it named none). This file holds what is specific to the phone: the\n * card's copy, how a failure reads to the person, and where \"Open my Computer\"\n * goes.\n *\n * The code itself only ever goes to the Computer: never into the chat, a URL,\n * or a log line. Nothing here keeps it.\n */\nimport { cleanOneTimeCode, oneTimeCodeEntry, type ConnectorConnectForm, type ConnectorConnectPayload } from 'common';\nimport { COMPUTER_CONNECTOR } from './toolActivity';\n\n/** The connector action that types and submits, and the keypress that submits when the page has no button. */\nexport const ONE_TIME_CODE_ACT = 'YANTRA_COMPUTER_ACT';\nexport const ONE_TIME_CODE_INPUT = 'YANTRA_COMPUTER_INPUT';\n\n/**\n * Budget for one call: the ACT waits on the page (typing, the submit's navigation, reading the page after), and a\n * Computer that went to sleep while the person fetched the code adds its wake-up. Same as the web card.\n */\nexport const ONE_TIME_CODE_TIMEOUT_MS = 90_000;\n\n/** Runs one yantra-computer action as the signed-in person; resolves the connector's result, throws when it failed. */\nexport type ComputerAction = (action: string, params: Record<string, unknown>) => Promise<unknown>;\n\n/** The card's title: the agent's (\"Amazon.in email OTP\"), else what it is. */\nexport function oneTimeCodeTitle(payload: Pick<ConnectorConnectPayload, 'title'>): string {\n return payload.title?.trim() || 'Verification code';\n}\n\n/**\n * Whether the card can type the code for the person. A request without the page coordinates (the site, the code\n * box) cannot be: the Computer is then the only way to finish.\n */\nexport function canEnterOneTimeCode(form: ConnectorConnectForm | undefined): boolean {\n return oneTimeCodeEntry(form, '0') !== null;\n}\n\n/** What the Continue button may send: nothing until what was typed is a code. */\nexport function oneTimeCodeReady(raw: string, form: ConnectorConnectForm | undefined): boolean {\n return cleanOneTimeCode(raw, form?.digits) !== '';\n}\n\n/** The fine print under the card: where the code goes, and where it never goes. */\nexport function oneTimeCodeHint(form: ConnectorConnectForm | undefined): string {\n if (!canEnterOneTimeCode(form)) return 'Type it on the page yourself - it never goes into the chat';\n return `Goes straight to ${form?.site ?? 'the page'} on your Computer, never into the chat`;\n}\n\n/**\n * The failure a connector result reports, or null when it worked. The agent's exec lane answers with the\n * connector's envelope (`{ successful, data, error }`, older ones `{ success, ... }`), and a page step can report\n * its own failure as a value (`data.ok === false`).\n */\nexport function connectorResultFailure(result: unknown): string | null {\n if (!result || typeof result !== 'object') return null;\n const envelope = result as { successful?: boolean; success?: boolean; error?: unknown; data?: unknown };\n if (envelope.successful === false || envelope.success === false) {\n return String(envelope.error ?? 'The Computer did not answer.');\n }\n const data = envelope.data as { ok?: boolean; error?: unknown } | null | undefined;\n if (data && typeof data === 'object' && data.ok === false) {\n return String(data.error ?? 'The page did not take the code.');\n }\n return null;\n}\n\n/**\n * What the person reads when the code could not be entered. The connector's own words name a selector or a CDP\n * step; what matters to them is whether the page moved on, and that their Computer is where to finish. The raw\n * text is never shown: it is the connector's, and it can quote what was sent.\n */\nexport function oneTimeCodeProblem(raw: string, site: string | undefined): string {\n const where = site ?? 'the page';\n // The site guard's own sentence (\"The page is not on amazon.in any more\"), minus the transport's prefix.\n if (/is not on .+ any more/i.test(raw)) {\n return `Your Computer is not on ${where} any more. Open your Computer to finish there.`;\n }\n if (/no element|not found|matched|selector|no such/i.test(raw)) {\n return `The code box is no longer on ${where}. Open your Computer to finish there.`;\n }\n if (/timed? ?out|timeout|ETIMEDOUT/i.test(raw)) return 'Your Computer took too long to answer. Try again.';\n if (/HTTP 401|authenticat|unauthori[sz]ed|session expired/i.test(raw)) {\n return 'Could not sign in to your Computer. Try again in a moment.';\n }\n if (/network request failed|failed to fetch|network/i.test(raw)) {\n return 'Could not reach your Computer. Check your connection, then try again.';\n }\n return 'Could not enter the code on your Computer. Try again, or open your Computer to finish there.';\n}\n\n/**\n * Type `code` into the page on the person's Computer: the ACT that checks the site, types and clicks, then Enter\n * when the request named no button. Resolves null once the code is on the page, else what the card shows; never\n * throws, and never echoes the code.\n */\nexport async function enterOneTimeCode(\n run: ComputerAction,\n form: ConnectorConnectForm | undefined,\n code: string,\n): Promise<string | null> {\n const entry = oneTimeCodeEntry(form, code);\n if (!entry) return 'Type the code first.';\n try {\n let failure = connectorResultFailure(await run(ONE_TIME_CODE_ACT, entry.act));\n if (!failure && entry.pressEnter) {\n failure = connectorResultFailure(await run(ONE_TIME_CODE_INPUT, entry.pressEnter));\n }\n return failure ? oneTimeCodeProblem(failure, form?.site) : null;\n } catch (error) {\n const raw = error instanceof Error ? error.message : String(error);\n return oneTimeCodeProblem(raw, form?.site);\n }\n}\n\n/** The Computer surface's slug: `computer-surface.<env>` through SURFACE_URL_TEMPLATE. */\nexport const COMPUTER_SURFACE_SLUG = 'computer';\n\n/** The banner the Computer opens with when the person goes there to finish. */\nexport const ONE_TIME_CODE_HANDOFF_REASON = 'Type the code on the page, then come back to the chat.';\n\n/**\n * Where \"Open my Computer\" goes: the Computer surface in its phone handoff layout (the live page, control already\n * on, the reason as a banner), opened in the app's surface screen, which signs the page in with this device's\n * session - the same identity the agent drives the Computer with. Null when the template has no `{slug}`, which\n * would point at some other surface.\n */\nexport function computerHandoffUrl(surfaceUrlTemplate: string | undefined, reason: string): string | null {\n const template = surfaceUrlTemplate?.trim();\n if (!template || !template.includes('{slug}')) return null;\n const base = template.replace(/\\{slug\\}/g, COMPUTER_SURFACE_SLUG);\n const sep = base.includes('?') ? '&' : '?';\n return `${base}${sep}view=mobile&mode=handoff&reason=${encodeURIComponent(reason)}`;\n}\n\nexport { COMPUTER_CONNECTOR };\n"],"names":[],"mappings":"uDAqBO,MAAM,iBAAoB,GAAA;AAC1B,MAAM,mBAAsB,GAAA;AAM5B,MAAM,wBAA2B,GAAA;AAMjC,SAAS,iBAAiB,OAAyD,EAAA;AAlC1F,EAAA,IAAA,EAAA;AAmCE,EAAO,OAAA,CAAA,CAAA,EAAA,GAAA,OAAA,CAAQ,KAAR,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAe,IAAU,EAAA,KAAA,mBAAA;AAClC;AAMO,SAAS,oBAAoB,IAAiD,EAAA;AACnF,EAAO,OAAA,gBAAA,CAAiB,IAAM,EAAA,GAAG,CAAM,KAAA,IAAA;AACzC;AAGgB,SAAA,gBAAA,CAAiB,KAAa,IAA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IAAO,OAAA,kBAAA,CAAmB,GAAK,EAAA,IAAA,IAAA,IAAA,GAAA,MAAA,GAAA,IAAA,CAAM,IAAI,CAAA;AAAA;AAE7C;AAGO,MAAM,qBAAwB,GAAA;AAG9B,MAAM,4BAA+B,GAAA;AAQ5B,SAAA,kBAAA,CAAmB,oBAAwC,MAA+B,EAAA;AACxG,EAAA,MAAM,WAAW,kBAAoB,IAAA,IAAA,GAAA,MAAA,GAAA,kBAAA,CAAA,IAAA,EAAA;AACrC,EAAA,IAAI,CAAC,QAAY,IAAA,CAAC,SAAS,QAAS,CAAA,QAAQ,GAAU,OAAA,IAAA;AACtD,EAAA,MAAM,IAAO,GAAA,QAAA,CAAS,OAAQ,CAAA,WAAA,EAAa,qBAAqB,CAAA;AAChE,EAAA,MAAM,GAAM,GAAA,IAAA,CAAK,QAAS,CAAA,GAAG,IAAI,GAAM,GAAA,GAAA;AACvC,EAAA,OAAO,GAAG,IAAI,CAAA,EAAG,GAAG,CAAmC,gCAAA,EAAA,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACnF"}
|
|
1
|
+
{"version":3,"file":"oneTimeCode.js","sources":["../../../src/features/chat/oneTimeCode.ts"],"sourcesContent":["/**\n * The `one-time-code` connect request, phone side: a site sent the person a\n * code (an email or text OTP, a 2-step code) and their Computer is parked on\n * the page that asks for it.\n *\n * The request and the calls that enter the code come from common's\n * CONNECTOR_CONNECT_PROTOCOL (isOneTimeCodeRequest, oneTimeCodeEntry), the same\n * module the web card reads, so both type the code the same way: one\n * YANTRA_COMPUTER_ACT that first proves the page is still on the site the code\n * was sent for, then types it and presses the button the agent named (Enter\n * when it named none). This file holds what is specific to the phone: the\n * card's copy, how a failure reads to the person, and where \"Open my Computer\"\n * goes.\n *\n * The code itself only ever goes to the Computer: never into the chat, a URL,\n * or a log line. Nothing here keeps it.\n */\nimport { cleanOneTimeCode, oneTimeCodeEntry, type ConnectorConnectForm, type ConnectorConnectPayload } from 'common';\nimport { COMPUTER_CONNECTOR } from './toolActivity';\n\n/** The connector action that types and submits, and the keypress that submits when the page has no button. */\nexport const ONE_TIME_CODE_ACT = 'YANTRA_COMPUTER_ACT';\nexport const ONE_TIME_CODE_INPUT = 'YANTRA_COMPUTER_INPUT';\n\n/**\n * Budget for one call: the ACT waits on the page (typing, the submit's navigation, reading the page after), and a\n * Computer that went to sleep while the person fetched the code adds its wake-up. Same as the web card.\n */\nexport const ONE_TIME_CODE_TIMEOUT_MS = 90_000;\n\n/** Runs one yantra-computer action as the signed-in person; resolves the connector's result, throws when it failed. */\nexport type ComputerAction = (action: string, params: Record<string, unknown>) => Promise<unknown>;\n\n/** The card's title: the agent's (\"Amazon.in email OTP\"), else what it is. */\nexport function oneTimeCodeTitle(payload: Pick<ConnectorConnectPayload, 'title'>): string {\n return payload.title?.trim() || 'Verification code';\n}\n\n/**\n * Whether the card can type the code for the person. A request without the page coordinates (the site, the code\n * box) cannot be: the Computer is then the only way to finish.\n */\nexport function canEnterOneTimeCode(form: ConnectorConnectForm | undefined): boolean {\n return oneTimeCodeEntry(form, '0') !== null;\n}\n\n/** What the Continue button may send: nothing until what was typed is a code. */\nexport function oneTimeCodeReady(raw: string, form: ConnectorConnectForm | undefined): boolean {\n return cleanOneTimeCode(raw, form?.digits) !== '';\n}\n\n/** The fine print under the card: where the code goes, and where it never goes. */\nexport function oneTimeCodeHint(form: ConnectorConnectForm | undefined): string {\n if (!canEnterOneTimeCode(form)) return 'Type it on the page yourself - it never goes into the chat';\n return `Goes straight to ${form?.site ?? 'the page'} on your Computer, never into the chat`;\n}\n\n/**\n * The failure a connector result reports, or null when it worked. The agent's exec lane answers with the\n * connector's envelope (`{ successful, data, error }`, older ones `{ success, ... }`), and a page step can report\n * its own failure as a value (`data.ok === false`).\n */\nexport function connectorResultFailure(result: unknown): string | null {\n if (!result || typeof result !== 'object') return null;\n const envelope = result as { successful?: boolean; success?: boolean; error?: unknown; data?: unknown };\n if (envelope.successful === false || envelope.success === false) {\n return String(envelope.error ?? 'The Computer did not answer.');\n }\n const data = envelope.data as { ok?: boolean; error?: unknown } | null | undefined;\n if (data && typeof data === 'object' && data.ok === false) {\n return String(data.error ?? 'The page did not take the code.');\n }\n return null;\n}\n\n/**\n * What the person reads when the code could not be entered. The connector's own words name a selector or a CDP\n * step; what matters to them is whether the page moved on, and that their Computer is where to finish. The raw\n * text is never shown: it is the connector's, and it can quote what was sent.\n */\nexport function oneTimeCodeProblem(raw: string, site: string | undefined): string {\n const where = site ?? 'the page';\n // The site guard's own sentence (\"The page is not on amazon.in any more\"), minus the transport's prefix.\n if (/is not on .+ any more/i.test(raw)) {\n return `Your Computer is not on ${where} any more. Open your Computer to finish there.`;\n }\n if (/no element|not found|matched|selector|no such/i.test(raw)) {\n return `The code box is no longer on ${where}. Open your Computer to finish there.`;\n }\n if (/timed? ?out|timeout|ETIMEDOUT/i.test(raw)) return 'Your Computer took too long to answer. Try again.';\n if (/HTTP 401|authenticat|unauthori[sz]ed|session expired/i.test(raw)) {\n return 'Could not sign in to your Computer. Try again in a moment.';\n }\n if (/network request failed|failed to fetch|network/i.test(raw)) {\n return 'Could not reach your Computer. Check your connection, then try again.';\n }\n return 'Could not enter the code on your Computer. Try again, or open your Computer to finish there.';\n}\n\n/**\n * Type `code` into the page on the person's Computer: the ACT that checks the site, types and clicks, then Enter\n * when the request named no button. Resolves null once the code is on the page, else what the card shows; never\n * throws, and never echoes the code.\n */\nexport async function enterOneTimeCode(\n run: ComputerAction,\n form: ConnectorConnectForm | undefined,\n code: string,\n): Promise<string | null> {\n const entry = oneTimeCodeEntry(form, code);\n if (!entry) return 'Type the code first.';\n try {\n let failure = connectorResultFailure(await run(ONE_TIME_CODE_ACT, entry.act));\n if (!failure && entry.pressEnter) {\n failure = connectorResultFailure(await run(ONE_TIME_CODE_INPUT, entry.pressEnter));\n }\n return failure ? oneTimeCodeProblem(failure, form?.site) : null;\n } catch (error) {\n const raw = error instanceof Error ? error.message : String(error);\n return oneTimeCodeProblem(raw, form?.site);\n }\n}\n\n/** The Computer surface's slug: `computer-surface.<env>` through SURFACE_URL_TEMPLATE. */\nexport const COMPUTER_SURFACE_SLUG = 'computer';\n\n/** The banner the Computer opens with when the person goes there to finish. */\nexport const ONE_TIME_CODE_HANDOFF_REASON = 'Type the code on the page, then come back to the chat.';\n\n/**\n * Where \"Open my Computer\" goes: the Computer surface's phone handoff link (the live page, control already on, the\n * reason as a banner). openSurfaceInApp opens it on the native Computer screen, on that handoff with its reason.\n * Null when the template has no `{slug}`, which would point at some other surface.\n */\nexport function computerHandoffUrl(surfaceUrlTemplate: string | undefined, reason: string): string | null {\n const template = surfaceUrlTemplate?.trim();\n if (!template || !template.includes('{slug}')) return null;\n const base = template.replace(/\\{slug\\}/g, COMPUTER_SURFACE_SLUG);\n const sep = base.includes('?') ? '&' : '?';\n return `${base}${sep}view=mobile&mode=handoff&reason=${encodeURIComponent(reason)}`;\n}\n\nexport { COMPUTER_CONNECTOR };\n"],"names":[],"mappings":"uDAqBO,MAAM,iBAAoB,GAAA;AAC1B,MAAM,mBAAsB,GAAA;AAM5B,MAAM,wBAA2B,GAAA;AAMjC,SAAS,iBAAiB,OAAyD,EAAA;AAlC1F,EAAA,IAAA,EAAA;AAmCE,EAAO,OAAA,CAAA,CAAA,EAAA,GAAA,OAAA,CAAQ,KAAR,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAe,IAAU,EAAA,KAAA,mBAAA;AAClC;AAMO,SAAS,oBAAoB,IAAiD,EAAA;AACnF,EAAO,OAAA,gBAAA,CAAiB,IAAM,EAAA,GAAG,CAAM,KAAA,IAAA;AACzC;AAGgB,SAAA,gBAAA,CAAiB,KAAa,IAAiD,EAAA;AAC7F,EAAA,OAAO,gBAAiB,CAAA,GAAA,EAAK,IAAM,IAAA,IAAA,GAAA,MAAA,GAAA,IAAA,CAAA,MAAM,CAAM,KAAA,EAAA;AACjD;AAGO,SAAS,gBAAgB,IAAgD,EAAA;AApDhF,EAAA,IAAA,EAAA;AAqDE,EAAA,IAAI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AAA;AACxG,EAAA,MAAM,WAAW,kBAAoB,IAAA,IAAA,GAAA,MAAA,GAAA,kBAAA,CAAA,IAAA,EAAA;AACrC,EAAA,IAAI,CAAC,QAAY,IAAA,CAAC,SAAS,QAAS,CAAA,QAAQ,GAAU,OAAA,IAAA;AACtD,EAAA,MAAM,IAAO,GAAA,QAAA,CAAS,OAAQ,CAAA,WAAA,EAAa,qBAAqB,CAAA;AAChE,EAAA,MAAM,GAAM,GAAA,IAAA,CAAK,QAAS,CAAA,GAAG,IAAI,GAAM,GAAA,GAAA;AACvC,EAAA,OAAO,GAAG,IAAI,CAAA,EAAG,GAAG,CAAmC,gCAAA,EAAA,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cvText.js","sources":["../../../src/features/job-search/cvText.ts"],"sourcesContent":["/**\n * CV file → plain text on native (twin of web services/cvText.ts).\n * Text formats are read on-device. PDF/DOCX ask the user to paste (no pdfjs/mammoth in the mobile remote).\n */\nexport type CvFormat = 'text' | 'pdf' | 'docx';\n\nconst TEXT_EXTENSIONS = ['.txt', '.md', '.markdown', '.json', '.rtf'];\n\nexport const CV_FORMATS_LABEL = 'PDF, DOCX, TXT, MD or RTF';\n\nexport const CV_PICKER_TYPES = [\n 'application/pdf',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'text/plain',\n 'text/markdown',\n 'text/rtf',\n 'application/json',\n 'application/msword',\n];\n\nfunction formatOf(name: string): CvFormat | null {\n const lower = name.toLowerCase();\n if (lower.endsWith('.pdf')) return 'pdf';\n if (lower.endsWith('.docx')) return 'docx';\n if (TEXT_EXTENSIONS.some((ext) => lower.endsWith(ext))) return 'text';\n return null;\n}\n\nfunction rejectionFor(name: string): string {\n const lower = name.toLowerCase();\n if (lower.endsWith('.doc')) {\n return 'Legacy .doc files are not readable here - re-save it as .docx or PDF (Word: File > Save As) and try again.';\n }\n if (lower.endsWith('.pages')) {\n return 'Apple Pages files are not readable here - export it as PDF or DOCX and try again.';\n }\n return `That file type is not supported. Use ${CV_FORMATS_LABEL}, or paste the CV text instead.`;\n}\n\nfunction stripRtf(raw: string): string {\n if (!raw.startsWith('{\\\\rtf')) return raw;\n return raw\n .replace(/\\{\\\\\\*?[^{}]*\\}/g, ' ')\n .replace(/\\\\'[0-9a-fA-F]{2}/g, ' ')\n .replace(/\\\\[a-zA-Z]+-?\\d* ?/g, ' ')\n .replace(/[{}]/g, ' ')\n .replace(/[ \\t]+/g, ' ')\n .replace(/\\n{3,}/g, '\\n\\n')\n .trim();\n}\n\
|
|
1
|
+
{"version":3,"file":"cvText.js","sources":["../../../src/features/job-search/cvText.ts"],"sourcesContent":["/**\n * CV file → plain text on native (twin of web services/cvText.ts).\n * Text formats are read on-device. PDF/DOCX ask the user to paste (no pdfjs/mammoth in the mobile remote).\n */\nexport type CvFormat = 'text' | 'pdf' | 'docx';\n\nconst TEXT_EXTENSIONS = ['.txt', '.md', '.markdown', '.json', '.rtf'];\n\nexport const CV_FORMATS_LABEL = 'PDF, DOCX, TXT, MD or RTF';\n\nexport const CV_PICKER_TYPES = [\n 'application/pdf',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'text/plain',\n 'text/markdown',\n 'text/rtf',\n 'application/json',\n 'application/msword',\n];\n\nfunction formatOf(name: string): CvFormat | null {\n const lower = name.toLowerCase();\n if (lower.endsWith('.pdf')) return 'pdf';\n if (lower.endsWith('.docx')) return 'docx';\n if (TEXT_EXTENSIONS.some((ext) => lower.endsWith(ext))) return 'text';\n return null;\n}\n\nfunction rejectionFor(name: string): string {\n const lower = name.toLowerCase();\n if (lower.endsWith('.doc')) {\n return 'Legacy .doc files are not readable here - re-save it as .docx or PDF (Word: File > Save As) and try again.';\n }\n if (lower.endsWith('.pages')) {\n return 'Apple Pages files are not readable here - export it as PDF or DOCX and try again.';\n }\n return `That file type is not supported. Use ${CV_FORMATS_LABEL}, or paste the CV text instead.`;\n}\n\nfunction stripRtf(raw: string): string {\n if (!raw.startsWith('{\\\\rtf')) return raw;\n return raw\n .replace(/\\{\\\\\\*?[^{}]*\\}/g, ' ')\n .replace(/\\\\'[0-9a-fA-F]{2}/g, ' ')\n .replace(/\\\\[a-zA-Z]+-?\\d* ?/g, ' ')\n .replace(/[{}]/g, ' ')\n .replace(/[ \\t]+/g, ' ')\n .replace(/\\n{3,}/g, '\\n\\n')\n .trim();\n}\n\n/** What the CV import needs of expo-document-picker; its native module answers the same call. */\ninterface DocumentPicker {\n getDocumentAsync: (options: {\n type?: string | string[];\n multiple?: boolean;\n copyToCacheDirectory?: boolean;\n }) => Promise<{\n canceled?: boolean;\n type?: string;\n uri?: string;\n name?: string;\n mimeType?: string;\n assets?: Array<{ uri?: string; name?: string; mimeType?: string }>;\n }>;\n}\n\nfunction loadDocumentPicker(): DocumentPicker {\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, global-require\n const core = require('expo-modules-core') as {\n requireOptionalNativeModule?: (name: string) => Partial<DocumentPicker> | null;\n };\n const native = core.requireOptionalNativeModule?.('ExpoDocumentPicker');\n if (native?.getDocumentAsync) {\n return {\n getDocumentAsync: (options) =>\n native.getDocumentAsync({\n type: Array.isArray(options.type) ? options.type : [options.type ?? '*/*'],\n multiple: false,\n copyToCacheDirectory: true,\n }),\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, global-require\n return require('expo-document-picker') as typeof import('expo-document-picker');\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err ?? '');\n if (/Cannot find native module|ExpoDocumentPicker|Cannot find module/i.test(msg)) {\n throw new Error(\n 'File picker is not included in this app build. Paste the CV text instead, or use a build with expo-document-picker.',\n );\n }\n throw err;\n }\n}\n\nfunction loadFileSystem() {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, global-require\n return require('expo-file-system') as {\n readAsStringAsync?: (uri: string, options?: { encoding?: string }) => Promise<string>;\n EncodingType?: { UTF8?: string };\n };\n}\n\n/**\n * Open the system file picker, read one CV to plain text, return null if cancelled.\n */\nexport async function pickAndReadCvFile(): Promise<string | null> {\n const picker = loadDocumentPicker();\n const result = await picker.getDocumentAsync({\n type: CV_PICKER_TYPES,\n multiple: false,\n copyToCacheDirectory: true,\n });\n if (!result || result.canceled || result.type === 'cancel') return null;\n\n const asset = result.assets?.[0];\n const uri = (asset?.uri ?? result.uri)?.trim();\n const name = (asset?.name ?? result.name ?? 'cv').trim();\n if (!uri) throw new Error('No file was selected.');\n\n const format = formatOf(name);\n if (!format) throw new Error(rejectionFor(name));\n\n if (format === 'pdf' || format === 'docx') {\n throw new Error(\n `${name}: on mobile, paste the CV text (or export as TXT/MD). PDF/DOCX text extraction runs in the browser surface.`,\n );\n }\n\n const fs = loadFileSystem();\n if (typeof fs.readAsStringAsync !== 'function') {\n throw new Error('Could not read the file on this device — paste the CV text instead.');\n }\n const encoding = fs.EncodingType?.UTF8 ?? 'utf8';\n let text: string;\n try {\n text = stripRtf(await fs.readAsStringAsync(uri, { encoding }));\n } catch (err) {\n const detail = err instanceof Error ? err.message : String(err);\n throw new Error(`Could not read ${name}: ${detail}`);\n }\n\n const clean = text.replace(/\\u00a0/g, ' ').trim();\n if (clean.length < 40) {\n throw new Error(`${name} looks empty - paste the CV text instead.`);\n }\n return clean;\n}\n"],"names":["_a"],"mappings":"AAKA,MAAM,kBAAkB,CAAC,MAAA,EAAQ,KAAO,EAAA,WAAA,EAAa,SAAS,MAAM,CAAA;AAC7D,MAAM,gBAAmB,GAAA;AACnB,MAAA,eAAA,GAAkB,CAAC,iBAAmB,EAAA,yEAAA,EAA2E,cAAc,eAAiB,EAAA,UAAA,EAAY,oBAAoB,oBAAoB;AACjN,SAAS,SAAS,IAA+B,EAAA;AAC/C,EAAM,MAAA,KAAA,GAAQ,KAAK,WAAY,EAAA;AAC/B,EAAA,IAAI,KAAM,CAAA,QAAA,CAAS,MAAM,CAAA,EAAU,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