@adminide-stack/clock-tik-mobile 0.0.0-stage → 12.0.37-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/.claude-flow/data/pending-insights.jsonl +43 -0
- package/.claude-flow/sessions/session-1794323376548.json +14 -0
- package/CHANGELOG.md +31 -0
- package/jest.config.cjs +22 -0
- package/lib/assets/home/loop-day.jpg +0 -0
- package/lib/assets/home/loop-day.mp4 +0 -0
- package/lib/assets/home/loop-time-back.jpg +0 -0
- package/lib/assets/home/loop-time-back.mp4 +0 -0
- package/lib/assets/home/loop-where.jpg +0 -0
- package/lib/assets/home/loop-where.mp4 +0 -0
- package/lib/assets/home/reel-gym.jpg +0 -0
- package/lib/assets/home/reel-gym.mp4 +0 -0
- package/lib/assets/home/reel-internet.jpg +0 -0
- package/lib/assets/home/reel-internet.mp4 +0 -0
- package/lib/assets/icon.png +0 -0
- package/lib/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
- package/lib/assets/lottie/lucy-mark-calendar.json +1827 -0
- package/lib/assets/lottie/lucy-mark-call.json +1470 -0
- package/lib/assets/lottie/lucy-mark-connect.json +2552 -0
- package/lib/assets/lottie/lucy-mark-details.json +1735 -0
- package/lib/assets/lottie/lucy-mark-email.json +1363 -0
- package/lib/assets/lottie/lucy-mark-message.json +1154 -0
- package/lib/assets/lottie/lucy-mark-search.json +1067 -0
- package/lib/assets/lottie/lucy-mark-think.json +1253 -0
- package/lib/assets/lottie/lucy-mark-write.json +1532 -0
- package/lib/assets/lottie/time-back.json +16458 -0
- package/lib/assets/lottie/where-lucy-works-chat.json +6170 -0
- package/lib/assets/lottie/where-lucy-works-cloud.json +10066 -0
- package/lib/assets/lottie/where-lucy-works-mine-none.json +2478 -0
- package/lib/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
- package/lib/assets/lottie/where-lucy-works-mine-online.json +7881 -0
- package/lib/assets/sounds/hours-back.m4a +0 -0
- package/lib/assets/sounds/meet-lucy.m4a +0 -0
- package/lib/assets/sounds/power-on.m4a +0 -0
- package/lib/assets/sounds/wind-back.m4a +0 -0
- package/lib/assets/sounds/youre-in.m4a +0 -0
- package/lib/chat/agent.js +358 -0
- package/lib/chat/agent.js.map +1 -0
- package/lib/chat/appFront.js +32 -0
- package/lib/chat/appFront.js.map +1 -0
- package/lib/chat/auth.js +370 -0
- package/lib/chat/auth.js.map +1 -0
- package/lib/chat/chores.js +360 -0
- package/lib/chat/chores.js.map +1 -0
- package/lib/chat/connectors.js +42 -0
- package/lib/chat/connectors.js.map +1 -0
- package/lib/chat/jobs.js +223 -0
- package/lib/chat/jobs.js.map +1 -0
- package/lib/chat/lucyMotion.js +6 -0
- package/lib/chat/lucyMotion.js.map +1 -0
- package/lib/chat/protocol.js +111 -0
- package/lib/chat/protocol.js.map +1 -0
- package/lib/chat/results.js +133 -0
- package/lib/chat/results.js.map +1 -0
- package/lib/chat/store.js +81 -0
- package/lib/chat/store.js.map +1 -0
- package/lib/chat/useDictation.js +168 -0
- package/lib/chat/useDictation.js.map +1 -0
- package/lib/chat/useLucyChat.js +451 -0
- package/lib/chat/useLucyChat.js.map +1 -0
- package/lib/chat/useMyComputer.js +32 -0
- package/lib/chat/useMyComputer.js.map +1 -0
- package/lib/chat/whereLucyWorks.js +52 -0
- package/lib/chat/whereLucyWorks.js.map +1 -0
- package/lib/chat/workspace.js +124 -0
- package/lib/chat/workspace.js.map +1 -0
- package/lib/components/AreaShot.js +289 -0
- package/lib/components/AreaShot.js.map +1 -0
- package/lib/components/Backdrops.js +262 -0
- package/lib/components/Backdrops.js.map +1 -0
- package/lib/components/BottomSheet.js +61 -0
- package/lib/components/BottomSheet.js.map +1 -0
- package/lib/components/ChatSheets.js +429 -0
- package/lib/components/ChatSheets.js.map +1 -0
- package/lib/components/ConnectorLogo.js +91 -0
- package/lib/components/ConnectorLogo.js.map +1 -0
- package/lib/components/CustomDrawer.js +534 -0
- package/lib/components/CustomDrawer.js.map +1 -0
- package/lib/components/IdeasPane.js +394 -0
- package/lib/components/IdeasPane.js.map +1 -0
- package/lib/components/ImessageSheet.js +261 -0
- package/lib/components/ImessageSheet.js.map +1 -0
- package/lib/components/KeyboardAvoider.js +29 -0
- package/lib/components/KeyboardAvoider.js.map +1 -0
- package/lib/components/Logo.js +81 -0
- package/lib/components/Logo.js.map +1 -0
- package/lib/components/LucyWorking.js +67 -0
- package/lib/components/LucyWorking.js.map +1 -0
- package/lib/components/Markdown.js +260 -0
- package/lib/components/Markdown.js.map +1 -0
- package/lib/components/Media.js +93 -0
- package/lib/components/Media.js.map +1 -0
- package/lib/components/MessagesAppIcon.js +23 -0
- package/lib/components/MessagesAppIcon.js.map +1 -0
- package/lib/components/MicButton.js +71 -0
- package/lib/components/MicButton.js.map +1 -0
- package/lib/components/ResultCards.js +974 -0
- package/lib/components/ResultCards.js.map +1 -0
- package/lib/components/SignInPrompt.js +148 -0
- package/lib/components/SignInPrompt.js.map +1 -0
- package/lib/components/SignedOut.js +38 -0
- package/lib/components/SignedOut.js.map +1 -0
- package/lib/components/TalkToLucyHero.js +487 -0
- package/lib/components/TalkToLucyHero.js.map +1 -0
- package/lib/components/TalkToLucySheet.js +182 -0
- package/lib/components/TalkToLucySheet.js.map +1 -0
- package/lib/components/WhereLucyWorks.js +277 -0
- package/lib/components/WhereLucyWorks.js.map +1 -0
- package/lib/components/WorkspaceSection.js +271 -0
- package/lib/components/WorkspaceSection.js.map +1 -0
- package/lib/components/YantraMark.js +13 -0
- package/lib/components/YantraMark.js.map +1 -0
- package/lib/components/drawerHeader.js +38 -0
- package/lib/components/drawerHeader.js.map +1 -0
- package/lib/components/lottieInstalled.js +6 -0
- package/lib/components/lottieInstalled.js.map +1 -0
- package/lib/components/ui.js +550 -0
- package/lib/components/ui.js.map +1 -0
- package/lib/components/useSignOut.js +7 -0
- package/lib/components/useSignOut.js.map +1 -0
- package/lib/components/viewport.js +121 -0
- package/lib/components/viewport.js.map +1 -0
- package/lib/components/voiceDial.js +10 -0
- package/lib/components/voiceDial.js.map +1 -0
- package/lib/compute.js +157 -0
- package/lib/compute.js.map +1 -0
- package/lib/config/env-config.js +21 -0
- package/lib/config/env-config.js.map +1 -0
- package/lib/config/routes.js +15 -0
- package/lib/config/routes.js.map +1 -0
- package/lib/content.js +25 -0
- package/lib/content.js.map +1 -0
- package/lib/hooks/keyboardCover.js +39 -0
- package/lib/hooks/keyboardCover.js.map +1 -0
- package/lib/hooks/useKeyboard.js +121 -0
- package/lib/hooks/useKeyboard.js.map +1 -0
- package/lib/hooks/useReducedMotion.js +13 -0
- package/lib/hooks/useReducedMotion.js.map +1 -0
- package/lib/imessage/openMessages.js +25 -0
- package/lib/imessage/openMessages.js.map +1 -0
- package/lib/imessage/platform.js +12 -0
- package/lib/imessage/platform.js.map +1 -0
- package/lib/imessage/textLink.js +262 -0
- package/lib/imessage/textLink.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -0
- package/lib/live/card.js +28 -0
- package/lib/live/card.js.map +1 -0
- package/lib/live/liveActivity.js +144 -0
- package/lib/live/liveActivity.js.map +1 -0
- package/lib/module.js +3 -0
- package/lib/module.js.map +1 -0
- package/lib/offer/BlackFridayOffer.js +378 -0
- package/lib/offer/BlackFridayOffer.js.map +1 -0
- package/lib/offer/blackFriday.js +78 -0
- package/lib/offer/blackFriday.js.map +1 -0
- package/lib/offer/parts.js +624 -0
- package/lib/offer/parts.js.map +1 -0
- package/lib/offer/state.js +63 -0
- package/lib/offer/state.js.map +1 -0
- package/lib/push/push.js +142 -0
- package/lib/push/push.js.map +1 -0
- package/lib/push/usePushNotifications.js +39 -0
- package/lib/push/usePushNotifications.js.map +1 -0
- package/lib/routes.json +175 -0
- package/lib/screens/Account/index.js +209 -0
- package/lib/screens/Account/index.js.map +1 -0
- package/lib/screens/Chat/index.js +710 -0
- package/lib/screens/Chat/index.js.map +1 -0
- package/lib/screens/Chores/index.js +18 -0
- package/lib/screens/Chores/index.js.map +1 -0
- package/lib/screens/Connectors/index.js +17 -0
- package/lib/screens/Connectors/index.js.map +1 -0
- package/lib/screens/History/index.js +380 -0
- package/lib/screens/History/index.js.map +1 -0
- package/lib/screens/Home/index.js +2711 -0
- package/lib/screens/Home/index.js.map +1 -0
- package/lib/screens/Home/media.js +25 -0
- package/lib/screens/Home/media.js.map +1 -0
- package/lib/screens/Welcome/index.js +1066 -0
- package/lib/screens/Welcome/index.js.map +1 -0
- package/lib/talk/talkToLucy.js +139 -0
- package/lib/talk/talkToLucy.js.map +1 -0
- package/lib/theme/colors.js +29 -0
- package/lib/theme/colors.js.map +1 -0
- package/lib/theme/fonts.js +17 -0
- package/lib/theme/fonts.js.map +1 -0
- package/lib/theme/muse.js +134 -0
- package/lib/theme/muse.js.map +1 -0
- package/lib/utils/links.js +54 -0
- package/lib/utils/links.js.map +1 -0
- package/lib/utils/yantraLinks.js +68 -0
- package/lib/utils/yantraLinks.js.map +1 -0
- package/lib/welcome/flow.js +375 -0
- package/lib/welcome/flow.js.map +1 -0
- package/lib/welcome/haptics.js +125 -0
- package/lib/welcome/haptics.js.map +1 -0
- package/lib/welcome/parts.js +1996 -0
- package/lib/welcome/parts.js.map +1 -0
- package/lib/welcome/powerOn.js +29 -0
- package/lib/welcome/powerOn.js.map +1 -0
- package/lib/welcome/seen.js +41 -0
- package/lib/welcome/seen.js.map +1 -0
- package/lib/welcome/sound.js +110 -0
- package/lib/welcome/sound.js.map +1 -0
- package/package.json +66 -5
- package/rollup.config.mjs +42 -0
- package/src/.claude-flow/data/pending-insights.jsonl +19 -0
- package/src/.claude-flow/sessions/session-1795013028422.json +14 -0
- package/src/__tests__/auth.test.ts +94 -0
- package/src/__tests__/blackFriday.test.ts +75 -0
- package/src/__tests__/cardTokens.test.ts +77 -0
- package/src/__tests__/chores.test.ts +179 -0
- package/src/__tests__/choresList.test.ts +100 -0
- package/src/__tests__/content.test.ts +54 -0
- package/src/__tests__/dictation.test.ts +186 -0
- package/src/__tests__/haptics.test.ts +202 -0
- package/src/__tests__/jobs.test.ts +130 -0
- package/src/__tests__/keyboardCover.test.ts +84 -0
- package/src/__tests__/liveCard.test.ts +39 -0
- package/src/__tests__/lockedPhone.test.ts +355 -0
- package/src/__tests__/lucyMotion.test.ts +34 -0
- package/src/__tests__/platform.test.ts +32 -0
- package/src/__tests__/powerOn.test.ts +62 -0
- package/src/__tests__/protocol.test.ts +125 -0
- package/src/__tests__/push.test.ts +111 -0
- package/src/__tests__/results.test.ts +256 -0
- package/src/__tests__/sound.test.ts +248 -0
- package/src/__tests__/talkToLucy.test.ts +205 -0
- package/src/__tests__/textLink.test.ts +91 -0
- package/src/__tests__/voiceDial.test.ts +53 -0
- package/src/__tests__/welcomeFlow.test.ts +157 -0
- package/src/__tests__/whereLucyWorks.test.ts +81 -0
- package/src/__tests__/yantraLinks.test.ts +96 -0
- package/src/assets/home/loop-day.jpg +0 -0
- package/src/assets/home/loop-day.mp4 +0 -0
- package/src/assets/home/loop-time-back.jpg +0 -0
- package/src/assets/home/loop-time-back.mp4 +0 -0
- package/src/assets/home/loop-where.jpg +0 -0
- package/src/assets/home/loop-where.mp4 +0 -0
- package/src/assets/home/reel-gym.jpg +0 -0
- package/src/assets/home/reel-gym.mp4 +0 -0
- package/src/assets/home/reel-internet.jpg +0 -0
- package/src/assets/home/reel-internet.mp4 +0 -0
- package/src/assets/icon.png +0 -0
- package/src/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
- package/src/assets/lottie/lucy-mark-calendar.json +1827 -0
- package/src/assets/lottie/lucy-mark-call.json +1470 -0
- package/src/assets/lottie/lucy-mark-connect.json +2552 -0
- package/src/assets/lottie/lucy-mark-details.json +1735 -0
- package/src/assets/lottie/lucy-mark-email.json +1363 -0
- package/src/assets/lottie/lucy-mark-message.json +1154 -0
- package/src/assets/lottie/lucy-mark-search.json +1067 -0
- package/src/assets/lottie/lucy-mark-think.json +1253 -0
- package/src/assets/lottie/lucy-mark-write.json +1532 -0
- package/src/assets/lottie/time-back.json +16458 -0
- package/src/assets/lottie/where-lucy-works-chat.json +6170 -0
- package/src/assets/lottie/where-lucy-works-cloud.json +10066 -0
- package/src/assets/lottie/where-lucy-works-mine-none.json +2478 -0
- package/src/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
- package/src/assets/lottie/where-lucy-works-mine-online.json +7881 -0
- package/src/assets/sounds/hours-back.m4a +0 -0
- package/src/assets/sounds/meet-lucy.m4a +0 -0
- package/src/assets/sounds/power-on.m4a +0 -0
- package/src/assets/sounds/wind-back.m4a +0 -0
- package/src/assets/sounds/youre-in.m4a +0 -0
- package/src/chat/.claude-flow/data/pending-insights.jsonl +1 -0
- package/src/chat/agent.ts +376 -0
- package/src/chat/appFront.ts +39 -0
- package/src/chat/auth.ts +433 -0
- package/src/chat/chores.ts +394 -0
- package/src/chat/connectors.ts +65 -0
- package/src/chat/jobs.ts +228 -0
- package/src/chat/lucyMotion.ts +33 -0
- package/src/chat/protocol.ts +192 -0
- package/src/chat/results.ts +224 -0
- package/src/chat/store.ts +87 -0
- package/src/chat/useDictation.ts +201 -0
- package/src/chat/useLucyChat.ts +458 -0
- package/src/chat/useMyComputer.ts +41 -0
- package/src/chat/whereLucyWorks.ts +97 -0
- package/src/chat/workspace.ts +127 -0
- package/src/components/.claude-flow/data/pending-insights.jsonl +3 -0
- package/src/components/AreaShot.tsx +239 -0
- package/src/components/Backdrops.tsx +323 -0
- package/src/components/BottomSheet.tsx +96 -0
- package/src/components/ChatSheets.tsx +565 -0
- package/src/components/ConnectorLogo.tsx +116 -0
- package/src/components/CustomDrawer.tsx +526 -0
- package/src/components/IdeasPane.tsx +318 -0
- package/src/components/ImessageSheet.tsx +280 -0
- package/src/components/KeyboardAvoider.tsx +45 -0
- package/src/components/Logo.tsx +97 -0
- package/src/components/LucyWorking.tsx +122 -0
- package/src/components/Markdown.tsx +219 -0
- package/src/components/Media.tsx +173 -0
- package/src/components/MessagesAppIcon.tsx +51 -0
- package/src/components/MicButton.tsx +92 -0
- package/src/components/ResultCards.tsx +1067 -0
- package/src/components/SignInPrompt.tsx +182 -0
- package/src/components/SignedOut.tsx +47 -0
- package/src/components/TalkToLucyHero.tsx +540 -0
- package/src/components/TalkToLucySheet.tsx +208 -0
- package/src/components/VoiceOrb.tsx +364 -0
- package/src/components/WhereLucyWorks.tsx +261 -0
- package/src/components/WorkspaceSection.tsx +307 -0
- package/src/components/YantraMark.tsx +30 -0
- package/src/components/drawerHeader.tsx +46 -0
- package/src/components/kit.tsx +309 -0
- package/src/components/lottieInstalled.ts +7 -0
- package/src/components/ui.tsx +700 -0
- package/src/components/useSignOut.ts +21 -0
- package/src/components/viewport.tsx +166 -0
- package/src/components/voiceDial.ts +45 -0
- package/src/compute.ts +168 -0
- package/src/config/env-config.ts +37 -0
- package/src/config/routes.ts +28 -0
- package/src/content.ts +217 -0
- package/src/hooks/keyboardCover.ts +70 -0
- package/src/hooks/useKeyboard.ts +135 -0
- package/src/hooks/useReducedMotion.ts +19 -0
- package/src/imessage/openMessages.ts +53 -0
- package/src/imessage/platform.ts +32 -0
- package/src/imessage/textLink.ts +307 -0
- package/src/index.ts +24 -0
- package/src/live/card.ts +62 -0
- package/src/live/liveActivity.ts +192 -0
- package/src/module.ts +8 -0
- package/src/offer/BlackFridayOffer.tsx +394 -0
- package/src/offer/blackFriday.ts +109 -0
- package/src/offer/parts.tsx +650 -0
- package/src/offer/state.ts +78 -0
- package/src/push/push.ts +171 -0
- package/src/push/usePushNotifications.ts +47 -0
- package/src/screens/Account/index.tsx +310 -0
- package/src/screens/Chat/.claude-flow/data/pending-insights.jsonl +4 -0
- package/src/screens/Chat/index.tsx +891 -0
- package/src/screens/Chores/index.tsx +35 -0
- package/src/screens/Connectors/index.tsx +35 -0
- package/src/screens/History/index.tsx +346 -0
- package/src/screens/Home/index.tsx +2773 -0
- package/src/screens/Home/media.ts +31 -0
- package/src/screens/Welcome/index.tsx +1182 -0
- package/src/talk/talkToLucy.ts +187 -0
- package/src/theme/colors.ts +38 -0
- package/src/theme/fonts.ts +30 -0
- package/src/theme/muse.ts +86 -0
- package/src/utils/links.ts +84 -0
- package/src/utils/yantraLinks.ts +94 -0
- package/src/welcome/flow.ts +418 -0
- package/src/welcome/haptics.ts +179 -0
- package/src/welcome/parts.tsx +2160 -0
- package/src/welcome/powerOn.ts +84 -0
- package/src/welcome/seen.ts +68 -0
- package/src/welcome/sound.ts +173 -0
- package/tools/lottie/chat.motion +0 -0
- package/tools/lottie/cloud.motion +0 -0
- package/tools/lottie/generate.mjs +1209 -0
- package/tools/lottie/inter-glyphs.json +4416 -0
- package/tools/lottie/lucy-mark-calendar.motion +0 -0
- package/tools/lottie/lucy-mark-call.motion +0 -0
- package/tools/lottie/lucy-mark-connect.motion +0 -0
- package/tools/lottie/lucy-mark-details.motion +0 -0
- package/tools/lottie/lucy-mark-email.motion +0 -0
- package/tools/lottie/lucy-mark-message.motion +0 -0
- package/tools/lottie/lucy-mark-search.motion +0 -0
- package/tools/lottie/lucy-mark-think.motion +0 -0
- package/tools/lottie/lucy-mark-write.motion +0 -0
- package/tools/lottie/mark.json +1 -0
- package/tools/lottie/mine-none.motion +0 -0
- package/tools/lottie/mine-offline.motion +0 -0
- package/tools/lottie/mine-online.motion +0 -0
- package/tools/lottie/time-back.mjs +604 -0
- package/tools/sounds/render.mjs +730 -0
- package/tsconfig.json +17 -0
- package/README.md +0 -3
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useEffect,useRef,useMemo}from'react';import {Keyboard,Platform,StyleSheet,View,Text,FlatList,ScrollView,Pressable,TextInput}from'react-native';import {useNavigation,useRoute,useIsFocused,DrawerActions}from'@react-navigation/native';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {Ionicons}from'@expo/vector-icons';import {CHAT_STARTERS}from'@adminide-stack/clock-tik-browser/lib/pages/Home/content.js';import {AuthMobileNavigationRoutesEnum}from'@adminide-stack/user-auth0-client';import {LucyWorking}from'../../components/LucyWorking.js';import {BottomSheet}from'../../components/BottomSheet.js';import {KeyboardAvoider}from'../../components/KeyboardAvoider.js';import {ConnectorStack}from'../../components/ConnectorLogo.js';import {Markdown}from'../../components/Markdown.js';import {WhereLucyWorks}from'../../components/WhereLucyWorks.js';import {ImessageSheet}from'../../components/ImessageSheet.js';import {MessagesAppIcon}from'../../components/MessagesAppIcon.js';import {useChoreCount,ChoresPane,ConnectorsPane,HelpSheet}from'../../components/ChatSheets.js';import {IdeasPane}from'../../components/IdeasPane.js';import {FloatingButton,LucyBadge,HeaderCapsule,LargeTitle,Button,Bubble,TabBar,GroupLabel,IdeaRow,Group,GroupRow}from'../../components/ui.js';import {motionFor}from'../../chat/lucyMotion.js';import {useLucyChat,pendingAsk}from'../../chat/useLucyChat.js';import {useMyComputer}from'../../chat/useMyComputer.js';import {useDictation}from'../../chat/useDictation.js';import {MicButton,dictationProblem}from'../../components/MicButton.js';import {formatAskAnswers,displayText}from'../../chat/protocol.js';import {laterWords}from'../../chat/results.js';import {ResultCards}from'../../components/ResultCards.js';import {yantraAppUrl,PROMPT_MAX}from'../../utils/links.js';import {TEXT_LUCY}from'../../imessage/platform.js';import {CLOCKBOOK_ROUTES}from'../../config/routes.js';import {useClockbookFonts}from'../../theme/fonts.js';import {setChatOnScreen}from'../../push/push.js';import {type,PAD,ui,radius,field,float,lift}from'../../theme/muse.js';import {takeResults}from'@adminide-stack/clock-tik-browser/lib/pages/Home/chat/results.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
function greeting(now = new Date()) {
|
|
21
|
+
const h = now.getHours();
|
|
22
|
+
if (h < 5)
|
|
23
|
+
return "Up late";
|
|
24
|
+
if (h < 12)
|
|
25
|
+
return "Good morning";
|
|
26
|
+
if (h < 17)
|
|
27
|
+
return "Good afternoon";
|
|
28
|
+
if (h < 21)
|
|
29
|
+
return "Good evening";
|
|
30
|
+
return "Working late";
|
|
31
|
+
}
|
|
32
|
+
function starterEmoji(label) {
|
|
33
|
+
const l = label.toLowerCase();
|
|
34
|
+
if (l.includes("reschedule"))
|
|
35
|
+
return "\u{1F4DE}";
|
|
36
|
+
if (l.includes("schedule") || l.includes("book"))
|
|
37
|
+
return "\u{1F4C5}";
|
|
38
|
+
if (l.includes("remind"))
|
|
39
|
+
return "\u23F0";
|
|
40
|
+
if (l.includes("bill") || l.includes("internet"))
|
|
41
|
+
return "\u{1F4B8}";
|
|
42
|
+
if (l.includes("cancel"))
|
|
43
|
+
return "\u2702\uFE0F";
|
|
44
|
+
return "\u2728";
|
|
45
|
+
}
|
|
46
|
+
function WayPill({
|
|
47
|
+
leading,
|
|
48
|
+
lead,
|
|
49
|
+
label,
|
|
50
|
+
onPress
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: lead ? `${lead} ${label}` : label, onPress, style: ({
|
|
53
|
+
pressed
|
|
54
|
+
}) => [c.way, pressed && {
|
|
55
|
+
backgroundColor: ui.fill
|
|
56
|
+
}], children: [
|
|
57
|
+
leading,
|
|
58
|
+
/* @__PURE__ */ jsxs(Text, { style: c.wayText, numberOfLines: 1, adjustsFontSizeToFit: true, minimumFontScale: 0.85, children: [
|
|
59
|
+
lead ? /* @__PURE__ */ jsxs(Text, { style: c.wayLead, children: [
|
|
60
|
+
lead,
|
|
61
|
+
" "
|
|
62
|
+
] }) : null,
|
|
63
|
+
label
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "arrow-forward", size: 17, color: ui.ink })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
function Empty({
|
|
69
|
+
onStart,
|
|
70
|
+
onText,
|
|
71
|
+
onConnect
|
|
72
|
+
}) {
|
|
73
|
+
const computer = useMyComputer();
|
|
74
|
+
return /* @__PURE__ */ jsxs(ScrollView, { contentContainerStyle: c.empty, keyboardShouldPersistTaps: "handled", children: [
|
|
75
|
+
/* @__PURE__ */ jsxs(View, { style: c.hello, children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Text, { style: type.subhead, children: greeting() }),
|
|
77
|
+
/* @__PURE__ */ jsxs(Text, { style: [type.largeTitle, {
|
|
78
|
+
marginTop: 4
|
|
79
|
+
}], accessibilityRole: "header", children: [
|
|
80
|
+
"What should Lucy take off your ",
|
|
81
|
+
/* @__PURE__ */ jsx(Text, { style: {
|
|
82
|
+
color: ui.accentText
|
|
83
|
+
}, children: "plate?" })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ jsx(Text, { style: [type.callout, {
|
|
86
|
+
marginTop: 8
|
|
87
|
+
}], children: "She makes the calls, books the time and keeps track. You approve what matters." })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ jsx(View, { style: c.where, children: /* @__PURE__ */ jsx(WhereLucyWorks, { computer, desktopLink: yantraAppUrl() }) }),
|
|
90
|
+
/* @__PURE__ */ jsx(GroupLabel, { children: "Try one of these" }),
|
|
91
|
+
CHAT_STARTERS.map((st, i) => /* @__PURE__ */ jsx(IdeaRow, { emoji: starterEmoji(st.label), title: st.label, body: st.prompt, onPress: () => onStart(st.prompt), last: i === CHAT_STARTERS.length - 1 }, st.label)),
|
|
92
|
+
/* @__PURE__ */ jsxs(View, { style: c.ways, children: [
|
|
93
|
+
/* @__PURE__ */ jsx(WayPill, { leading: /* @__PURE__ */ jsx(ConnectorStack, { ids: ["google-calendar", "google-gmail", "site-login"] }), label: "Connect your apps", onPress: onConnect }),
|
|
94
|
+
/* @__PURE__ */ jsx(WayPill, { leading: /* @__PURE__ */ jsx(MessagesAppIcon, { size: 26 }), lead: "Prefer texting?", label: TEXT_LUCY, onPress: onText })
|
|
95
|
+
] })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
function AskCard({
|
|
99
|
+
ask,
|
|
100
|
+
onAnswer,
|
|
101
|
+
disabled
|
|
102
|
+
}) {
|
|
103
|
+
const [answers, setAnswers] = useState({});
|
|
104
|
+
const get = (id) => {
|
|
105
|
+
var _a;
|
|
106
|
+
return (_a = answers[id]) != null ? _a : {
|
|
107
|
+
picked: [],
|
|
108
|
+
text: ""
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const set = (id, a) => setAnswers((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
112
|
+
[id]: a
|
|
113
|
+
}));
|
|
114
|
+
const message = formatAskAnswers(ask, answers);
|
|
115
|
+
const single = ask.questions.length === 1 && !ask.questions[0].multiSelect;
|
|
116
|
+
return /* @__PURE__ */ jsxs(View, { style: c.ask, children: [
|
|
117
|
+
ask.questions.map((q) => {
|
|
118
|
+
const a = get(q.id);
|
|
119
|
+
return /* @__PURE__ */ jsxs(View, { style: {
|
|
120
|
+
gap: 12
|
|
121
|
+
}, children: [
|
|
122
|
+
/* @__PURE__ */ jsxs(View, { style: c.askHead, children: [
|
|
123
|
+
/* @__PURE__ */ jsx(View, { style: c.askIcon, children: /* @__PURE__ */ jsx(Ionicons, { name: "help-circle-outline", size: 20, color: ui.accentText }) }),
|
|
124
|
+
/* @__PURE__ */ jsxs(View, { style: {
|
|
125
|
+
flex: 1
|
|
126
|
+
}, children: [
|
|
127
|
+
q.header ? /* @__PURE__ */ jsx(Text, { style: type.caption, children: q.header }) : null,
|
|
128
|
+
/* @__PURE__ */ jsx(Text, { style: type.headline, children: q.title })
|
|
129
|
+
] })
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ jsx(View, { style: {
|
|
132
|
+
gap: 8
|
|
133
|
+
}, children: q.options.map((o) => {
|
|
134
|
+
const on = a.picked.includes(o.label);
|
|
135
|
+
return /* @__PURE__ */ jsxs(Pressable, { disabled, accessibilityRole: q.multiSelect ? "checkbox" : "radio", accessibilityState: {
|
|
136
|
+
checked: on,
|
|
137
|
+
disabled
|
|
138
|
+
}, onPress: () => {
|
|
139
|
+
if (single) {
|
|
140
|
+
onAnswer(formatAskAnswers(ask, {
|
|
141
|
+
[q.id]: {
|
|
142
|
+
picked: [o.label],
|
|
143
|
+
text: ""
|
|
144
|
+
}
|
|
145
|
+
}));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const picked = q.multiSelect ? on ? a.picked.filter((p) => p !== o.label) : [...a.picked, o.label] : [o.label];
|
|
149
|
+
set(q.id, __spreadProps(__spreadValues({}, a), {
|
|
150
|
+
picked
|
|
151
|
+
}));
|
|
152
|
+
}, style: ({
|
|
153
|
+
pressed
|
|
154
|
+
}) => [c.option, on && c.optionOn, pressed && {
|
|
155
|
+
backgroundColor: on ? ui.accentSoft : "#E5E2DD"
|
|
156
|
+
}], children: [
|
|
157
|
+
/* @__PURE__ */ jsxs(View, { style: {
|
|
158
|
+
flex: 1
|
|
159
|
+
}, children: [
|
|
160
|
+
/* @__PURE__ */ jsx(Text, { style: [c.optionLabel, on && {
|
|
161
|
+
color: ui.accentText
|
|
162
|
+
}], children: o.label }),
|
|
163
|
+
o.detail ? /* @__PURE__ */ jsx(Text, { style: [type.footnote, {
|
|
164
|
+
marginTop: 2
|
|
165
|
+
}], children: o.detail }) : null
|
|
166
|
+
] }),
|
|
167
|
+
single ? null : /* @__PURE__ */ jsx(Ionicons, { name: on ? "checkmark-circle" : "ellipse-outline", size: 21, color: on ? ui.accent : ui.faint })
|
|
168
|
+
] }, o.id);
|
|
169
|
+
}) }),
|
|
170
|
+
q.allowText ? /* @__PURE__ */ jsx(TextInput, { editable: !disabled, value: a.text, onChangeText: (text) => set(q.id, __spreadProps(__spreadValues({}, a), {
|
|
171
|
+
text
|
|
172
|
+
})), placeholder: q.textPlaceholder || (q.options.length ? "Or type your own answer" : "Type your answer"), placeholderTextColor: ui.faint, style: c.askInput, multiline: true }) : null
|
|
173
|
+
] }, q.id);
|
|
174
|
+
}),
|
|
175
|
+
!single || ask.questions[0].allowText ? /* @__PURE__ */ jsx(Button, { label: "Send answer", icon: "arrow-up", disabled: disabled || !message, onPress: () => onAnswer(message) }) : null
|
|
176
|
+
] });
|
|
177
|
+
}
|
|
178
|
+
const NO_WORDS = [];
|
|
179
|
+
function MessageRow(props) {
|
|
180
|
+
if (props.m.role === "user") {
|
|
181
|
+
return /* @__PURE__ */ jsx(Bubble, { from: "you", children: props.m.content.replace(/\*\*([^*]+)\*\*/g, "$1") });
|
|
182
|
+
}
|
|
183
|
+
return /* @__PURE__ */ jsx(LucyRow, __spreadValues({}, props));
|
|
184
|
+
}
|
|
185
|
+
function LucyRow({
|
|
186
|
+
m,
|
|
187
|
+
index,
|
|
188
|
+
thread,
|
|
189
|
+
last,
|
|
190
|
+
activity,
|
|
191
|
+
streaming,
|
|
192
|
+
onRetry,
|
|
193
|
+
onReply
|
|
194
|
+
}) {
|
|
195
|
+
const taken = useMemo(() => takeResults(m.content, m.id), [m.content, m.id]);
|
|
196
|
+
const text = displayText(taken.content);
|
|
197
|
+
const later = useMemo(() => taken.cards.length ? laterWords(thread, index) : NO_WORDS, [taken.cards.length, thread, index]);
|
|
198
|
+
const working = last && streaming;
|
|
199
|
+
const words = activity != null ? activity : "Writing";
|
|
200
|
+
return /* @__PURE__ */ jsxs(View, { style: {
|
|
201
|
+
gap: 8
|
|
202
|
+
}, children: [
|
|
203
|
+
text ? /* @__PURE__ */ jsx(Bubble, { from: "lucy", children: /* @__PURE__ */ jsx(Markdown, { children: text }) }) : null,
|
|
204
|
+
taken.cards.length ? /* @__PURE__ */ jsx(ResultCards, { cards: taken.cards, later, busy: streaming, onReply }) : null,
|
|
205
|
+
working ? /* @__PURE__ */ jsxs(View, { style: c.workingRow, accessible: true, accessibilityLabel: activity != null ? activity : "Lucy is writing", children: [
|
|
206
|
+
/* @__PURE__ */ jsx(LucyWorking, { size: 24, motion: motionFor(words) }),
|
|
207
|
+
activity ? /* @__PURE__ */ jsx(Text, { style: type.footnote, numberOfLines: 1, children: activity }) : null
|
|
208
|
+
] }) : null,
|
|
209
|
+
m.error ? /* @__PURE__ */ jsxs(View, { style: c.error, children: [
|
|
210
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "alert-circle-outline", size: 18, color: ui.danger }),
|
|
211
|
+
/* @__PURE__ */ jsx(Text, { style: c.errorText, children: m.error }),
|
|
212
|
+
last ? /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: onRetry, hitSlop: 6, children: /* @__PURE__ */ jsx(Text, { style: c.errorRetry, children: "Try again" }) }) : null
|
|
213
|
+
] }) : null
|
|
214
|
+
] });
|
|
215
|
+
}
|
|
216
|
+
function Composer({
|
|
217
|
+
streaming,
|
|
218
|
+
onSend,
|
|
219
|
+
onStop,
|
|
220
|
+
onPlus,
|
|
221
|
+
draft
|
|
222
|
+
}) {
|
|
223
|
+
const [text, setText] = useState("");
|
|
224
|
+
const ready = text.trim().length > 0;
|
|
225
|
+
const input = useRef(null);
|
|
226
|
+
useEffect(() => {
|
|
227
|
+
if (!draft)
|
|
228
|
+
return;
|
|
229
|
+
setText(draft.text);
|
|
230
|
+
const t = setTimeout(() => {
|
|
231
|
+
var _a;
|
|
232
|
+
return (_a = input.current) == null ? void 0 : _a.focus();
|
|
233
|
+
}, 250);
|
|
234
|
+
return () => clearTimeout(t);
|
|
235
|
+
}, [draft]);
|
|
236
|
+
const [keyboardHint, setKeyboardHint] = useState(false);
|
|
237
|
+
const dictation = useDictation({
|
|
238
|
+
onText: setText,
|
|
239
|
+
onProblem: (problem, detail) => {
|
|
240
|
+
var _a;
|
|
241
|
+
if (problem === "unavailable") {
|
|
242
|
+
setKeyboardHint(true);
|
|
243
|
+
(_a = input.current) == null ? void 0 : _a.focus();
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
dictationProblem(problem, detail);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
const send = () => {
|
|
250
|
+
if (!ready)
|
|
251
|
+
return;
|
|
252
|
+
if (dictation.listening)
|
|
253
|
+
dictation.cancel();
|
|
254
|
+
onSend(text);
|
|
255
|
+
setText("");
|
|
256
|
+
};
|
|
257
|
+
const mic = () => dictation.listening ? dictation.stop() : dictation.start(text);
|
|
258
|
+
return /* @__PURE__ */ jsxs(View, { style: c.dock, children: [
|
|
259
|
+
/* @__PURE__ */ jsxs(View, { style: c.composer, children: [
|
|
260
|
+
/* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "More ways to hand over", onPress: onPlus, hitSlop: 6, style: ({
|
|
261
|
+
pressed
|
|
262
|
+
}) => [c.plus, pressed && {
|
|
263
|
+
backgroundColor: ui.bubbleYou
|
|
264
|
+
}], children: /* @__PURE__ */ jsx(Ionicons, { name: "add", size: 22, color: ui.ink }) }),
|
|
265
|
+
/* @__PURE__ */ jsx(TextInput, { ref: input, value: text, onChangeText: setText, onBlur: () => setKeyboardHint(false), maxLength: PROMPT_MAX * 4, placeholder: dictation.listening ? "Listening\u2026" : "Message Lucy", placeholderTextColor: dictation.listening ? ui.accentText : ui.faint, style: c.input, multiline: true, accessibilityLabel: "Message Lucy" }),
|
|
266
|
+
!ready || dictation.listening ? /* @__PURE__ */ jsx(MicButton, { listening: dictation.listening, onPress: mic }) : null,
|
|
267
|
+
streaming && !ready ? /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Stop Lucy", onPress: onStop, hitSlop: 8, style: [c.send, {
|
|
268
|
+
backgroundColor: ui.ink
|
|
269
|
+
}], children: /* @__PURE__ */ jsx(Ionicons, { name: "stop", size: 15, color: ui.surface }) }) : !ready ? null : /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: streaming ? "Send after this reply" : "Send", accessibilityState: {
|
|
270
|
+
disabled: !ready
|
|
271
|
+
}, disabled: !ready, onPress: send, hitSlop: 8, style: ({
|
|
272
|
+
pressed
|
|
273
|
+
}) => [c.send, {
|
|
274
|
+
backgroundColor: ready ? pressed ? ui.accentPressed : ui.accent : ui.fill
|
|
275
|
+
}], children: /* @__PURE__ */ jsx(Ionicons, { name: "arrow-up", size: 19, color: ready ? ui.surface : ui.faint }) })
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ jsx(Text, { style: [type.caption, c.dockNote, keyboardHint && {
|
|
278
|
+
color: ui.accentText
|
|
279
|
+
}], children: keyboardHint ? "Tap the mic on your keyboard to speak." : "Lucy asks before she pays or changes an account." })
|
|
280
|
+
] });
|
|
281
|
+
}
|
|
282
|
+
function MoreMenu({
|
|
283
|
+
visible,
|
|
284
|
+
onClose,
|
|
285
|
+
onText,
|
|
286
|
+
onConnect,
|
|
287
|
+
onHelp
|
|
288
|
+
}) {
|
|
289
|
+
const insets = useSafeAreaInsets();
|
|
290
|
+
const rows = [{
|
|
291
|
+
leading: /* @__PURE__ */ jsx(View, { style: {
|
|
292
|
+
marginRight: 12
|
|
293
|
+
}, children: /* @__PURE__ */ jsx(MessagesAppIcon, { size: 30 }) }),
|
|
294
|
+
label: TEXT_LUCY,
|
|
295
|
+
on: onText
|
|
296
|
+
}, {
|
|
297
|
+
icon: "apps-outline",
|
|
298
|
+
label: "Connect your apps",
|
|
299
|
+
on: onConnect
|
|
300
|
+
}, {
|
|
301
|
+
icon: "help-circle-outline",
|
|
302
|
+
label: "How Lucy works",
|
|
303
|
+
on: onHelp
|
|
304
|
+
}];
|
|
305
|
+
return /* @__PURE__ */ jsxs(BottomSheet, { visible, onClose, style: [c.menu, {
|
|
306
|
+
paddingBottom: Math.max(insets.bottom, 12)
|
|
307
|
+
}], children: [
|
|
308
|
+
/* @__PURE__ */ jsx(View, { style: c.grabber }),
|
|
309
|
+
/* @__PURE__ */ jsx(Group, { style: {
|
|
310
|
+
marginHorizontal: 0
|
|
311
|
+
}, children: rows.map((r, i) => /* @__PURE__ */ jsx(GroupRow, { icon: r.icon, leading: r.leading, label: r.label, onPress: r.on, last: i === rows.length - 1 }, r.label)) }),
|
|
312
|
+
/* @__PURE__ */ jsx(Button, { label: "Cancel", variant: "secondary", onPress: onClose, style: {
|
|
313
|
+
marginTop: 10
|
|
314
|
+
} })
|
|
315
|
+
] });
|
|
316
|
+
}
|
|
317
|
+
function ChatScreen() {
|
|
318
|
+
var _a, _b, _c;
|
|
319
|
+
useClockbookFonts();
|
|
320
|
+
const navigation = useNavigation();
|
|
321
|
+
const route = useRoute();
|
|
322
|
+
const insets = useSafeAreaInsets();
|
|
323
|
+
const chat = useLucyChat(true);
|
|
324
|
+
const [imessageOpen, setImessageOpen] = useState(false);
|
|
325
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
326
|
+
const [helpOpen, setHelpOpen] = useState(false);
|
|
327
|
+
const [tab, setTab] = useState("chat");
|
|
328
|
+
const choreCount = useChoreCount(chat.phase === "ready");
|
|
329
|
+
const focused = useIsFocused();
|
|
330
|
+
useEffect(() => {
|
|
331
|
+
setChatOnScreen(focused && tab === "chat");
|
|
332
|
+
return () => setChatOnScreen(false);
|
|
333
|
+
}, [focused, tab]);
|
|
334
|
+
const [typing, setTyping] = useState(false);
|
|
335
|
+
useEffect(() => {
|
|
336
|
+
const show = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow", () => setTyping(true));
|
|
337
|
+
const hide = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide", () => setTyping(false));
|
|
338
|
+
return () => {
|
|
339
|
+
show.remove();
|
|
340
|
+
hide.remove();
|
|
341
|
+
};
|
|
342
|
+
}, []);
|
|
343
|
+
const tabs = [{
|
|
344
|
+
key: "chat",
|
|
345
|
+
icon: "chatbubble-outline",
|
|
346
|
+
iconOn: "chatbubble",
|
|
347
|
+
label: "Chat"
|
|
348
|
+
}, {
|
|
349
|
+
key: "ideas",
|
|
350
|
+
icon: "bulb-outline",
|
|
351
|
+
iconOn: "bulb",
|
|
352
|
+
label: "Ideas"
|
|
353
|
+
}, {
|
|
354
|
+
key: "chores",
|
|
355
|
+
icon: "checkbox-outline",
|
|
356
|
+
iconOn: "checkbox",
|
|
357
|
+
label: "Chores",
|
|
358
|
+
badge: choreCount.working || void 0
|
|
359
|
+
}, {
|
|
360
|
+
key: "apps",
|
|
361
|
+
icon: "apps-outline",
|
|
362
|
+
iconOn: "apps",
|
|
363
|
+
label: "Apps"
|
|
364
|
+
}];
|
|
365
|
+
const [draft, setDraft] = useState(null);
|
|
366
|
+
const editIdea = (prompt2) => {
|
|
367
|
+
setTab("chat");
|
|
368
|
+
setDraft({
|
|
369
|
+
text: prompt2,
|
|
370
|
+
at: Date.now()
|
|
371
|
+
});
|
|
372
|
+
};
|
|
373
|
+
const startIdea = (prompt2) => {
|
|
374
|
+
setTab("chat");
|
|
375
|
+
chat.send(prompt2);
|
|
376
|
+
};
|
|
377
|
+
const paneBottom = 96 + insets.bottom;
|
|
378
|
+
const list = useRef(null);
|
|
379
|
+
const sentAt = useRef(null);
|
|
380
|
+
const {
|
|
381
|
+
prompt,
|
|
382
|
+
open,
|
|
383
|
+
fresh,
|
|
384
|
+
at
|
|
385
|
+
} = (_a = route.params) != null ? _a : {};
|
|
386
|
+
useEffect(() => {
|
|
387
|
+
if (chat.phase !== "ready" || !prompt || !at || sentAt.current === at)
|
|
388
|
+
return;
|
|
389
|
+
sentAt.current = at;
|
|
390
|
+
chat.send(prompt);
|
|
391
|
+
}, [chat.phase, prompt, at, chat]);
|
|
392
|
+
const openedAt = useRef(null);
|
|
393
|
+
useEffect(() => {
|
|
394
|
+
if (chat.phase !== "ready" || !open || !at || openedAt.current === at)
|
|
395
|
+
return;
|
|
396
|
+
openedAt.current = at;
|
|
397
|
+
setTab("chat");
|
|
398
|
+
chat.openChat(open);
|
|
399
|
+
}, [chat.phase, open, at, chat]);
|
|
400
|
+
const freshAt = useRef(null);
|
|
401
|
+
useEffect(() => {
|
|
402
|
+
if (chat.phase !== "ready" || !fresh || freshAt.current === fresh)
|
|
403
|
+
return;
|
|
404
|
+
freshAt.current = fresh;
|
|
405
|
+
setTab("chat");
|
|
406
|
+
chat.newChat();
|
|
407
|
+
}, [chat.phase, fresh, chat]);
|
|
408
|
+
const ask = useMemo(() => pendingAsk(chat.messages), [chat.messages]);
|
|
409
|
+
const lastId = (_b = chat.messages[chat.messages.length - 1]) == null ? void 0 : _b.id;
|
|
410
|
+
const openMenu = () => navigation.dispatch(DrawerActions.openDrawer());
|
|
411
|
+
const fromMenu = (open2) => {
|
|
412
|
+
setMenuOpen(false);
|
|
413
|
+
setTimeout(open2, 350);
|
|
414
|
+
};
|
|
415
|
+
const status = chat.streaming ? (_c = chat.activity) != null ? _c : "Writing\u2026" : chat.phase === "connecting" ? "Connecting\u2026" : null;
|
|
416
|
+
return /* @__PURE__ */ jsxs(SafeAreaView, { style: c.page, edges: ["top", "left", "right"], children: [
|
|
417
|
+
/* @__PURE__ */ jsxs(View, { style: c.header, children: [
|
|
418
|
+
/* @__PURE__ */ jsx(View, { style: c.headerSide, children: /* @__PURE__ */ jsx(FloatingButton, { icon: "menu", label: "Menu", onPress: openMenu }) }),
|
|
419
|
+
/* @__PURE__ */ jsx(LucyBadge, { status: tab === "chat" ? status : null }),
|
|
420
|
+
/* @__PURE__ */ jsx(View, { style: [c.headerSide, {
|
|
421
|
+
alignItems: "flex-end"
|
|
422
|
+
}], children: /* @__PURE__ */ jsx(HeaderCapsule, { actions: [{
|
|
423
|
+
node: /* @__PURE__ */ jsx(MessagesAppIcon, { size: 24 }),
|
|
424
|
+
label: TEXT_LUCY,
|
|
425
|
+
onPress: () => setImessageOpen(true)
|
|
426
|
+
}, {
|
|
427
|
+
icon: "time-outline",
|
|
428
|
+
label: "History",
|
|
429
|
+
onPress: () => navigation.navigate(CLOCKBOOK_ROUTES.HISTORY)
|
|
430
|
+
}, {
|
|
431
|
+
icon: "create-outline",
|
|
432
|
+
label: "New chat",
|
|
433
|
+
onPress: () => {
|
|
434
|
+
setTab("chat");
|
|
435
|
+
chat.newChat();
|
|
436
|
+
}
|
|
437
|
+
}] }) })
|
|
438
|
+
] }),
|
|
439
|
+
/* @__PURE__ */ jsxs(KeyboardAvoider, { style: {
|
|
440
|
+
flex: 1
|
|
441
|
+
}, children: [
|
|
442
|
+
tab === "ideas" ? /* @__PURE__ */ jsx(IdeasPane, { onSend: startIdea, onEdit: editIdea, bottom: paneBottom }) : tab === "chores" ? /* @__PURE__ */ jsx(ChoresPane, { active: true, header: /* @__PURE__ */ jsx(LargeTitle, { children: "Chores" }), bottom: paneBottom }) : tab === "apps" ? /* @__PURE__ */ jsx(ConnectorsPane, { header: /* @__PURE__ */ jsx(LargeTitle, { children: "Apps" }), bottom: paneBottom }) : chat.phase === "connecting" ? /* @__PURE__ */ jsxs(View, { style: c.center, children: [
|
|
443
|
+
/* @__PURE__ */ jsx(LucyWorking, { size: 72, motion: "connect" }),
|
|
444
|
+
/* @__PURE__ */ jsx(Text, { style: c.centerText, children: "Connecting to Lucy\u2026" })
|
|
445
|
+
] }) : chat.phase === "unavailable" ? /* @__PURE__ */ jsxs(View, { style: c.center, children: [
|
|
446
|
+
/* @__PURE__ */ jsx(Text, { style: [type.title, {
|
|
447
|
+
textAlign: "center"
|
|
448
|
+
}], children: "Lucy can\u2019t chat right now" }),
|
|
449
|
+
/* @__PURE__ */ jsx(Text, { style: c.centerText, children: chat.problem }),
|
|
450
|
+
/* @__PURE__ */ jsx(Button, { label: "Try again", icon: "refresh", onPress: chat.reconnect })
|
|
451
|
+
] }) : chat.messages.length === 0 ? /* @__PURE__ */ jsx(Empty, { onStart: chat.send, onText: () => setImessageOpen(true), onConnect: () => setTab("apps") }) : /* @__PURE__ */ jsx(FlatList, { ref: list, data: chat.messages, keyExtractor: (m) => m.id, contentContainerStyle: c.thread, keyboardShouldPersistTaps: "handled", keyboardDismissMode: "interactive", onContentSizeChange: () => {
|
|
452
|
+
var _a2;
|
|
453
|
+
return (_a2 = list.current) == null ? void 0 : _a2.scrollToEnd({
|
|
454
|
+
animated: true
|
|
455
|
+
});
|
|
456
|
+
}, renderItem: ({
|
|
457
|
+
item,
|
|
458
|
+
index
|
|
459
|
+
}) => /* @__PURE__ */ jsx(MessageRow, { m: item, index, thread: chat.messages, last: index === chat.messages.length - 1, activity: chat.activity, streaming: chat.streaming, onRetry: chat.retryLast, onReply: chat.send }), ListFooterComponent: /* @__PURE__ */ jsxs(View, { style: {
|
|
460
|
+
gap: 12
|
|
461
|
+
}, children: [
|
|
462
|
+
ask ? /* @__PURE__ */ jsx(AskCard, { ask, onAnswer: chat.answer }, lastId) : null,
|
|
463
|
+
chat.queued.map((q) => /* @__PURE__ */ jsxs(View, { style: {
|
|
464
|
+
alignItems: "flex-end",
|
|
465
|
+
opacity: 0.55
|
|
466
|
+
}, children: [
|
|
467
|
+
/* @__PURE__ */ jsx(Bubble, { from: "you", children: q }),
|
|
468
|
+
/* @__PURE__ */ jsx(Text, { style: [type.caption, {
|
|
469
|
+
marginTop: 4
|
|
470
|
+
}], children: "Sends after this reply" })
|
|
471
|
+
] }, q))
|
|
472
|
+
] }) }),
|
|
473
|
+
tab === "chat" && chat.phase === "ready" ? /* @__PURE__ */ jsx(Composer, { streaming: chat.streaming, onSend: chat.send, onStop: chat.stop, onPlus: () => setMenuOpen(true), draft }) : null,
|
|
474
|
+
typing ? /* @__PURE__ */ jsx(View, { style: {
|
|
475
|
+
height: 8
|
|
476
|
+
} }) : /* @__PURE__ */ jsx(View, { style: [c.tabDock, {
|
|
477
|
+
paddingBottom: Math.max(insets.bottom, 10)
|
|
478
|
+
}], children: /* @__PURE__ */ jsx(TabBar, { tabs, value: tab, onChange: (k) => {
|
|
479
|
+
setTab(k);
|
|
480
|
+
if (k === "chores")
|
|
481
|
+
choreCount.refresh();
|
|
482
|
+
} }) })
|
|
483
|
+
] }),
|
|
484
|
+
/* @__PURE__ */ jsx(MoreMenu, { visible: menuOpen, onClose: () => setMenuOpen(false), onText: () => fromMenu(() => setImessageOpen(true)), onConnect: () => {
|
|
485
|
+
setMenuOpen(false);
|
|
486
|
+
setTab("apps");
|
|
487
|
+
}, onHelp: () => fromMenu(() => setHelpOpen(true)) }),
|
|
488
|
+
/* @__PURE__ */ jsx(HelpSheet, { visible: helpOpen, onClose: () => setHelpOpen(false) }),
|
|
489
|
+
/* @__PURE__ */ jsx(ImessageSheet, { visible: imessageOpen, onClose: () => setImessageOpen(false), onChatHere: () => setImessageOpen(false), onSignIn: () => {
|
|
490
|
+
setImessageOpen(false);
|
|
491
|
+
navigation.navigate(AuthMobileNavigationRoutesEnum.Login, {
|
|
492
|
+
redirect: "back"
|
|
493
|
+
});
|
|
494
|
+
} })
|
|
495
|
+
] });
|
|
496
|
+
}
|
|
497
|
+
const c = StyleSheet.create({
|
|
498
|
+
page: {
|
|
499
|
+
flex: 1,
|
|
500
|
+
backgroundColor: ui.bg
|
|
501
|
+
},
|
|
502
|
+
header: {
|
|
503
|
+
flexDirection: "row",
|
|
504
|
+
alignItems: "center",
|
|
505
|
+
justifyContent: "space-between",
|
|
506
|
+
paddingHorizontal: PAD,
|
|
507
|
+
paddingTop: Platform.OS === "android" ? 13 : 3,
|
|
508
|
+
paddingBottom: 8
|
|
509
|
+
},
|
|
510
|
+
headerSide: {
|
|
511
|
+
width: 116
|
|
512
|
+
},
|
|
513
|
+
empty: {
|
|
514
|
+
paddingTop: 8,
|
|
515
|
+
paddingBottom: 20
|
|
516
|
+
},
|
|
517
|
+
where: {
|
|
518
|
+
paddingHorizontal: PAD,
|
|
519
|
+
marginTop: 18
|
|
520
|
+
},
|
|
521
|
+
hello: {
|
|
522
|
+
paddingHorizontal: PAD + 4
|
|
523
|
+
},
|
|
524
|
+
ideasTitle: {
|
|
525
|
+
paddingHorizontal: PAD + 4,
|
|
526
|
+
marginTop: 28,
|
|
527
|
+
marginBottom: 2
|
|
528
|
+
},
|
|
529
|
+
ways: {
|
|
530
|
+
paddingHorizontal: PAD,
|
|
531
|
+
marginTop: 22,
|
|
532
|
+
gap: 10
|
|
533
|
+
},
|
|
534
|
+
way: __spreadValues({
|
|
535
|
+
flexDirection: "row",
|
|
536
|
+
alignItems: "center",
|
|
537
|
+
gap: 10,
|
|
538
|
+
minHeight: 52,
|
|
539
|
+
paddingLeft: 12,
|
|
540
|
+
paddingRight: 16,
|
|
541
|
+
borderRadius: radius.pill,
|
|
542
|
+
backgroundColor: ui.surface,
|
|
543
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
544
|
+
borderColor: ui.hairline
|
|
545
|
+
}, lift),
|
|
546
|
+
wayText: {
|
|
547
|
+
flex: 1,
|
|
548
|
+
fontSize: 15.5,
|
|
549
|
+
fontWeight: "600",
|
|
550
|
+
color: ui.ink
|
|
551
|
+
},
|
|
552
|
+
wayLead: {
|
|
553
|
+
fontWeight: "400",
|
|
554
|
+
color: ui.muted
|
|
555
|
+
},
|
|
556
|
+
thread: {
|
|
557
|
+
paddingHorizontal: PAD,
|
|
558
|
+
paddingTop: 12,
|
|
559
|
+
paddingBottom: 16,
|
|
560
|
+
gap: 12
|
|
561
|
+
},
|
|
562
|
+
workingRow: {
|
|
563
|
+
flexDirection: "row",
|
|
564
|
+
alignItems: "center",
|
|
565
|
+
gap: 10
|
|
566
|
+
},
|
|
567
|
+
error: {
|
|
568
|
+
flexDirection: "row",
|
|
569
|
+
alignItems: "center",
|
|
570
|
+
flexWrap: "wrap",
|
|
571
|
+
gap: 8,
|
|
572
|
+
padding: 12,
|
|
573
|
+
borderRadius: radius.button,
|
|
574
|
+
backgroundColor: ui.dangerSoft
|
|
575
|
+
},
|
|
576
|
+
errorText: {
|
|
577
|
+
flex: 1,
|
|
578
|
+
fontSize: 14,
|
|
579
|
+
lineHeight: 20,
|
|
580
|
+
color: "#7A271A"
|
|
581
|
+
},
|
|
582
|
+
errorRetry: {
|
|
583
|
+
fontSize: 14,
|
|
584
|
+
fontWeight: "600",
|
|
585
|
+
color: ui.danger
|
|
586
|
+
},
|
|
587
|
+
ask: __spreadValues({
|
|
588
|
+
padding: 16,
|
|
589
|
+
gap: 16,
|
|
590
|
+
borderRadius: radius.card,
|
|
591
|
+
backgroundColor: ui.surface
|
|
592
|
+
}, lift),
|
|
593
|
+
askHead: {
|
|
594
|
+
flexDirection: "row",
|
|
595
|
+
alignItems: "flex-start",
|
|
596
|
+
gap: 12
|
|
597
|
+
},
|
|
598
|
+
askIcon: {
|
|
599
|
+
width: 34,
|
|
600
|
+
height: 34,
|
|
601
|
+
borderRadius: 10,
|
|
602
|
+
backgroundColor: ui.accentSoft,
|
|
603
|
+
alignItems: "center",
|
|
604
|
+
justifyContent: "center"
|
|
605
|
+
},
|
|
606
|
+
option: {
|
|
607
|
+
flexDirection: "row",
|
|
608
|
+
alignItems: "center",
|
|
609
|
+
gap: 10,
|
|
610
|
+
minHeight: 48,
|
|
611
|
+
paddingVertical: 12,
|
|
612
|
+
paddingHorizontal: 16,
|
|
613
|
+
borderRadius: radius.button,
|
|
614
|
+
backgroundColor: ui.fill,
|
|
615
|
+
borderWidth: 1,
|
|
616
|
+
borderColor: "transparent"
|
|
617
|
+
},
|
|
618
|
+
optionOn: {
|
|
619
|
+
borderColor: ui.accent,
|
|
620
|
+
backgroundColor: ui.accentSoft
|
|
621
|
+
},
|
|
622
|
+
optionLabel: {
|
|
623
|
+
fontSize: 16,
|
|
624
|
+
fontWeight: "500",
|
|
625
|
+
color: ui.ink
|
|
626
|
+
},
|
|
627
|
+
askInput: {
|
|
628
|
+
fontSize: 16,
|
|
629
|
+
color: ui.ink,
|
|
630
|
+
minHeight: 46,
|
|
631
|
+
paddingHorizontal: 14,
|
|
632
|
+
paddingVertical: 12,
|
|
633
|
+
borderRadius: radius.button,
|
|
634
|
+
backgroundColor: ui.fill
|
|
635
|
+
},
|
|
636
|
+
center: {
|
|
637
|
+
flex: 1,
|
|
638
|
+
alignItems: "center",
|
|
639
|
+
justifyContent: "center",
|
|
640
|
+
gap: 14,
|
|
641
|
+
paddingHorizontal: 32
|
|
642
|
+
},
|
|
643
|
+
centerText: __spreadProps(__spreadValues({}, type.callout), {
|
|
644
|
+
color: ui.muted,
|
|
645
|
+
textAlign: "center"
|
|
646
|
+
}),
|
|
647
|
+
dock: {
|
|
648
|
+
paddingHorizontal: PAD - 4,
|
|
649
|
+
paddingTop: 6
|
|
650
|
+
},
|
|
651
|
+
tabDock: {
|
|
652
|
+
paddingHorizontal: PAD + 8,
|
|
653
|
+
paddingTop: 10
|
|
654
|
+
},
|
|
655
|
+
plus: {
|
|
656
|
+
width: 38,
|
|
657
|
+
height: 38,
|
|
658
|
+
borderRadius: 19,
|
|
659
|
+
backgroundColor: ui.accentSoft,
|
|
660
|
+
alignItems: "center",
|
|
661
|
+
justifyContent: "center"
|
|
662
|
+
},
|
|
663
|
+
composer: __spreadValues({
|
|
664
|
+
flexDirection: "row",
|
|
665
|
+
alignItems: "flex-end",
|
|
666
|
+
gap: 8,
|
|
667
|
+
minHeight: 52,
|
|
668
|
+
paddingLeft: 7,
|
|
669
|
+
paddingRight: 7,
|
|
670
|
+
paddingVertical: 7,
|
|
671
|
+
borderRadius: 28,
|
|
672
|
+
backgroundColor: ui.surface
|
|
673
|
+
}, float),
|
|
674
|
+
input: __spreadValues({
|
|
675
|
+
flex: 1,
|
|
676
|
+
fontSize: 15.5,
|
|
677
|
+
lineHeight: 20,
|
|
678
|
+
color: ui.ink,
|
|
679
|
+
maxHeight: 130,
|
|
680
|
+
minHeight: 38,
|
|
681
|
+
paddingTop: 9,
|
|
682
|
+
paddingBottom: 9
|
|
683
|
+
}, field),
|
|
684
|
+
send: {
|
|
685
|
+
width: 38,
|
|
686
|
+
height: 38,
|
|
687
|
+
borderRadius: 19,
|
|
688
|
+
alignItems: "center",
|
|
689
|
+
justifyContent: "center"
|
|
690
|
+
},
|
|
691
|
+
dockNote: {
|
|
692
|
+
textAlign: "center",
|
|
693
|
+
marginTop: 6
|
|
694
|
+
},
|
|
695
|
+
menu: {
|
|
696
|
+
backgroundColor: ui.bg,
|
|
697
|
+
borderTopLeftRadius: 22,
|
|
698
|
+
borderTopRightRadius: 22,
|
|
699
|
+
paddingHorizontal: PAD,
|
|
700
|
+
paddingTop: 8
|
|
701
|
+
},
|
|
702
|
+
grabber: {
|
|
703
|
+
alignSelf: "center",
|
|
704
|
+
width: 36,
|
|
705
|
+
height: 5,
|
|
706
|
+
borderRadius: 3,
|
|
707
|
+
backgroundColor: "rgba(28,26,24,0.15)",
|
|
708
|
+
marginBottom: 14
|
|
709
|
+
}
|
|
710
|
+
});export{ChatScreen as default};//# sourceMappingURL=index.js.map
|