@adminide-stack/clock-tik-mobile 0.0.0-stage → 12.0.37-alpha.1
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 +41 -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 +45 -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 +27 -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 +2715 -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 +188 -0
- package/src/__tests__/choresList.test.ts +100 -0
- package/src/__tests__/connectLink.test.ts +21 -0
- package/src/__tests__/content.test.ts +54 -0
- package/src/__tests__/dictation.test.ts +186 -0
- package/src/__tests__/envConfig.test.ts +14 -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 +75 -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 +50 -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 +2776 -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,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace Lucy works in, as Yantra's Account > Workspace (its OrgProjectSwitcher): the person's default
|
|
3
|
+
* organization, project and environment (`account.default.*`), read and written on the same backend Lucy's token is
|
|
4
|
+
* minted on (auth.ts), so a switch here is the workspace the next chat, chore and connector runs in.
|
|
5
|
+
*/
|
|
6
|
+
import {
|
|
7
|
+
accountSettingsUri,
|
|
8
|
+
agentBackendUrl,
|
|
9
|
+
auth0Token,
|
|
10
|
+
currentUserId,
|
|
11
|
+
gql,
|
|
12
|
+
readWorkspaceDefaults,
|
|
13
|
+
workspaceChanged,
|
|
14
|
+
type WorkspaceDefaults,
|
|
15
|
+
} from './auth';
|
|
16
|
+
|
|
17
|
+
export interface OrgOption {
|
|
18
|
+
name: string;
|
|
19
|
+
title: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ProjectOption {
|
|
22
|
+
/** The project's document id (environment tags key on it). */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Its public UUID (what the settings hold). */
|
|
25
|
+
projectId: string;
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
|
28
|
+
export interface EnvironmentOption {
|
|
29
|
+
/** '' is Production. */
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Production's root tag: every project has it; '' already means it. */
|
|
35
|
+
const PRODUCTION_TAG_ID = 'aa0e8400e29b41d4a7164464';
|
|
36
|
+
const DEFAULT_PROJECT_NAME = 'DEFAULT_YANTRA_PROJECT';
|
|
37
|
+
/** common's ConfigurationTarget.USER and ContributionSchemaId.Configuration. */
|
|
38
|
+
const TARGET_USER = 1;
|
|
39
|
+
const SCHEMA_CONFIGURATION = 'configuration';
|
|
40
|
+
|
|
41
|
+
async function session(): Promise<{ url: string; bearer: string }> {
|
|
42
|
+
const [url, bearer] = await Promise.all([agentBackendUrl(), auth0Token()]);
|
|
43
|
+
return { url, bearer };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** A project's name as a person reads it: the one the shell created is "Default project". */
|
|
47
|
+
export function projectDisplayName(name?: string | null): string {
|
|
48
|
+
const value = name?.trim() ?? '';
|
|
49
|
+
return value === DEFAULT_PROJECT_NAME ? 'Default project' : value || 'Untitled project';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function environmentDisplayName(name?: string | null): string {
|
|
53
|
+
const v = name?.trim() ?? '';
|
|
54
|
+
return v ? v.charAt(0).toUpperCase() + v.slice(1).toLowerCase() : v;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export async function loadDefaults(): Promise<WorkspaceDefaults> {
|
|
58
|
+
const { url, bearer } = await session();
|
|
59
|
+
const saved = await readWorkspaceDefaults(url, bearer);
|
|
60
|
+
return { ...saved, environment: saved.environment === PRODUCTION_TAG_ID ? '' : (saved.environment ?? '') };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The person's active organizations. */
|
|
64
|
+
export async function listOrganizations(): Promise<OrgOption[]> {
|
|
65
|
+
const { url, bearer } = await session();
|
|
66
|
+
const d = await gql<{
|
|
67
|
+
getUserOrganizationsWithRole?: ({ name?: string; title?: string; status?: string } | null)[];
|
|
68
|
+
}>(url, bearer, 'query { getUserOrganizationsWithRole { name title status } }');
|
|
69
|
+
return (d.getUserOrganizationsWithRole ?? [])
|
|
70
|
+
.filter((o): o is { name: string; title?: string; status?: string } => !!o?.name && o.status === 'ACTIVE')
|
|
71
|
+
.map((o) => ({ name: o.name, title: o.title?.trim() || o.name }));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export async function listProjects(orgName: string): Promise<ProjectOption[]> {
|
|
75
|
+
const { url, bearer } = await session();
|
|
76
|
+
const d = await gql<{ getProjects?: { data?: ({ id?: string; projectId?: string; name?: string } | null)[] } }>(
|
|
77
|
+
url,
|
|
78
|
+
bearer,
|
|
79
|
+
'query GetProjects($orgName: String!, $limit: Int) { getProjects(orgName: $orgName, limit: $limit) { data { id projectId name } } }',
|
|
80
|
+
{ orgName, limit: 100 },
|
|
81
|
+
);
|
|
82
|
+
return (d.getProjects?.data ?? [])
|
|
83
|
+
.filter((p): p is { id: string; projectId: string; name?: string } => !!p?.id && !!p.projectId)
|
|
84
|
+
.map((p) => ({ id: p.id, projectId: p.projectId, name: projectDisplayName(p.name) }));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Production first, then the project's other environments. */
|
|
88
|
+
export async function listEnvironments(projectDocId: string): Promise<EnvironmentOption[]> {
|
|
89
|
+
const { url, bearer } = await session();
|
|
90
|
+
const d = await gql<{ getEnvironmentTags?: ({ id?: string; name?: string } | null)[] }>(
|
|
91
|
+
url,
|
|
92
|
+
bearer,
|
|
93
|
+
'query GetEnvironmentTags($projectId: ID) { getEnvironmentTags(projectId: $projectId) { id name } }',
|
|
94
|
+
{ projectId: projectDocId },
|
|
95
|
+
);
|
|
96
|
+
const others = (d.getEnvironmentTags ?? [])
|
|
97
|
+
.filter(
|
|
98
|
+
(t): t is { id: string; name?: string } =>
|
|
99
|
+
!!t?.id && t.id !== PRODUCTION_TAG_ID && t.name?.toUpperCase() !== 'PRODUCTION',
|
|
100
|
+
)
|
|
101
|
+
.map((t) => ({ id: t.id, name: environmentDisplayName(t.name) }));
|
|
102
|
+
return [{ id: '', name: 'Production' }, ...others];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Save the three together (as the web does), then have Lucy sign in again for the new workspace. */
|
|
106
|
+
export async function saveWorkspace(next: { organization: string; project: string; environment: string }) {
|
|
107
|
+
const { url, bearer } = await session();
|
|
108
|
+
const userId = await currentUserId(url, bearer);
|
|
109
|
+
if (!userId) throw new Error('We couldn’t find your account. Sign in again and retry.');
|
|
110
|
+
await gql(
|
|
111
|
+
url,
|
|
112
|
+
bearer,
|
|
113
|
+
'mutation WriteSettings($editingUri: URI, $settings: AnyObject, $target: Int, $schemaId: String, $extensionName: String) { writeSettings(editingUri: $editingUri, settings: $settings, target: $target, schemaId: $schemaId, extensionName: $extensionName) { __typename } }',
|
|
114
|
+
{
|
|
115
|
+
editingUri: accountSettingsUri(userId),
|
|
116
|
+
settings: {
|
|
117
|
+
'account.default.organization': next.organization,
|
|
118
|
+
'account.default.project': next.project,
|
|
119
|
+
'account.default.environment': next.environment,
|
|
120
|
+
},
|
|
121
|
+
target: TARGET_USER,
|
|
122
|
+
schemaId: SCHEMA_CONFIGURATION,
|
|
123
|
+
extensionName: 'account',
|
|
124
|
+
},
|
|
125
|
+
);
|
|
126
|
+
await workspaceChanged();
|
|
127
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/ChatSheets.tsx","success":true,"timestamp":1794314724824,"sessionId":null}
|
|
2
|
+
{"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/screens/Account/index.tsx","success":true,"timestamp":1794315237305,"sessionId":null}
|
|
3
|
+
{"type":"edit","file":"/Applications/MAMP/htdocs/cdmbase-projects/cdmbase-github/clockbook/feature-mobile-app/clock-tik/packages-modules/clock-tik/mobile/src/components/CustomDrawer.tsx","success":true,"timestamp":1794321207148,"sessionId":null}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The finished chore at the top of each "What it handles" card (the web's AreaShots.tsx): what handing that corner
|
|
3
|
+
* of home life to Lucy looks like once it is done - a bill going down, a membership cancelled, the week's dinners
|
|
4
|
+
* planned, the dentist booked, a plumber on the way, a refund coming back. A slip of real-looking UI rather than an
|
|
5
|
+
* icon. Drawn, not real (names and numbers are made up, like the reels'), and decorative.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
9
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
10
|
+
import { lift, ui } from '../theme/muse';
|
|
11
|
+
|
|
12
|
+
type Tone = 'ok' | 'muted' | 'warm';
|
|
13
|
+
const TONES: Record<Tone, { bg: string; fg: string }> = {
|
|
14
|
+
ok: { bg: '#E2F3E9', fg: '#17784A' },
|
|
15
|
+
muted: { bg: '#F1ECE7', fg: ui.muted },
|
|
16
|
+
warm: { bg: ui.accentSoft, fg: ui.accentText },
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function Pill({ tone, children }: { tone: Tone; children: string }) {
|
|
20
|
+
return (
|
|
21
|
+
<View style={[st.pill, { backgroundColor: TONES[tone].bg }]}>
|
|
22
|
+
<Text style={[st.pillText, { color: TONES[tone].fg }]}>{children}</Text>
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const Row = ({ children }: { children: React.ReactNode }) => <View style={st.row}>{children}</View>;
|
|
28
|
+
const B = ({ children }: { children: React.ReactNode }) => <Text style={st.b}>{children}</Text>;
|
|
29
|
+
const Small = ({ children }: { children: React.ReactNode }) => <Text style={st.small}>{children}</Text>;
|
|
30
|
+
const Plain = ({ children, gone }: { children: React.ReactNode; gone?: boolean }) => (
|
|
31
|
+
<Text style={[st.plain, gone && st.gone]}>{children}</Text>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
function BillsShot() {
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<Row>
|
|
38
|
+
<B>Internet bill</B>
|
|
39
|
+
<Text style={st.price}>
|
|
40
|
+
<Text style={st.was}>$89 </Text>$54<Text style={st.small}>/mo</Text>
|
|
41
|
+
</Text>
|
|
42
|
+
</Row>
|
|
43
|
+
<Row>
|
|
44
|
+
<Small>Lucy called</Small>
|
|
45
|
+
<Pill tone="ok">$35 a month less</Pill>
|
|
46
|
+
</Row>
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function SubscriptionsShot() {
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<Row>
|
|
55
|
+
<Plain>Streaming</Plain>
|
|
56
|
+
<Small>$15.99</Small>
|
|
57
|
+
</Row>
|
|
58
|
+
<Row>
|
|
59
|
+
<Plain gone>Gym membership</Plain>
|
|
60
|
+
<Pill tone="muted">Cancelled</Pill>
|
|
61
|
+
</Row>
|
|
62
|
+
<Row>
|
|
63
|
+
<Plain>Cloud storage</Plain>
|
|
64
|
+
<Small>$2.99</Small>
|
|
65
|
+
</Row>
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function GroceriesShot() {
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
<Row>
|
|
74
|
+
<B>Dinners this week</B>
|
|
75
|
+
<Pill tone="warm">List ready</Pill>
|
|
76
|
+
</Row>
|
|
77
|
+
<View style={st.day}>
|
|
78
|
+
<Text style={[st.small, st.dayName]}>Mon</Text>
|
|
79
|
+
<Plain>Chicken tacos</Plain>
|
|
80
|
+
</View>
|
|
81
|
+
<View style={st.day}>
|
|
82
|
+
<Text style={[st.small, st.dayName]}>Tue</Text>
|
|
83
|
+
<Plain>Lemon pasta</Plain>
|
|
84
|
+
</View>
|
|
85
|
+
</>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function When({
|
|
90
|
+
day,
|
|
91
|
+
date,
|
|
92
|
+
title,
|
|
93
|
+
detail,
|
|
94
|
+
pill,
|
|
95
|
+
}: {
|
|
96
|
+
day: string;
|
|
97
|
+
date: string;
|
|
98
|
+
title: string;
|
|
99
|
+
detail: string;
|
|
100
|
+
pill: string;
|
|
101
|
+
}) {
|
|
102
|
+
return (
|
|
103
|
+
<View style={st.when}>
|
|
104
|
+
<View style={st.date}>
|
|
105
|
+
<Text style={st.dateDay}>{day}</Text>
|
|
106
|
+
<Text style={st.dateNum}>{date}</Text>
|
|
107
|
+
</View>
|
|
108
|
+
<View style={{ flex: 1, minWidth: 0 }}>
|
|
109
|
+
<B>{title}</B>
|
|
110
|
+
<Text style={st.small} numberOfLines={1}>
|
|
111
|
+
{detail}
|
|
112
|
+
</Text>
|
|
113
|
+
</View>
|
|
114
|
+
<Pill tone="ok">{pill}</Pill>
|
|
115
|
+
</View>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function FamilyShot() {
|
|
120
|
+
return (
|
|
121
|
+
<>
|
|
122
|
+
<When day="Tue" date="12" title="Dentist, Maya" detail="3:30 pm, after school" pill="Booked" />
|
|
123
|
+
<When day="Thu" date="14" title="School trip form" detail="Signed and sent" pill="Done" />
|
|
124
|
+
</>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function HomeShot() {
|
|
129
|
+
return (
|
|
130
|
+
<>
|
|
131
|
+
<Row>
|
|
132
|
+
<Text style={st.plain} numberOfLines={1}>
|
|
133
|
+
<Text style={st.b}>Plumber</Text> <Text style={st.small}>Wed, 9 to 11 am</Text>
|
|
134
|
+
</Text>
|
|
135
|
+
<Pill tone="ok">Booked</Pill>
|
|
136
|
+
</Row>
|
|
137
|
+
<Row>
|
|
138
|
+
<Text style={st.plain} numberOfLines={1}>
|
|
139
|
+
<Text style={st.b}>Dishwasher</Text> <Text style={st.small}>under warranty</Text>
|
|
140
|
+
</Text>
|
|
141
|
+
<Pill tone="warm">Claim filed</Pill>
|
|
142
|
+
</Row>
|
|
143
|
+
</>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function TravelShot() {
|
|
148
|
+
return (
|
|
149
|
+
<>
|
|
150
|
+
<Row>
|
|
151
|
+
<View style={st.route}>
|
|
152
|
+
<B>SFO</B>
|
|
153
|
+
<Ionicons name="airplane" size={13} color={ui.accentText} />
|
|
154
|
+
<B>LIS</B>
|
|
155
|
+
</View>
|
|
156
|
+
<Pill tone="muted">Cancelled</Pill>
|
|
157
|
+
</Row>
|
|
158
|
+
<Row>
|
|
159
|
+
<Text style={[st.small, { flex: 1 }]} numberOfLines={2}>
|
|
160
|
+
Refund to your card, not a voucher
|
|
161
|
+
</Text>
|
|
162
|
+
<Pill tone="ok">$412 back</Pill>
|
|
163
|
+
</Row>
|
|
164
|
+
</>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const SHOTS: Record<string, () => React.ReactElement> = {
|
|
169
|
+
bills: BillsShot,
|
|
170
|
+
subscriptions: SubscriptionsShot,
|
|
171
|
+
groceries: GroceriesShot,
|
|
172
|
+
family: FamilyShot,
|
|
173
|
+
home: HomeShot,
|
|
174
|
+
travel: TravelShot,
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export function AreaShot({ area }: { area: string }) {
|
|
178
|
+
const Shot = SHOTS[area];
|
|
179
|
+
if (!Shot) return null;
|
|
180
|
+
return (
|
|
181
|
+
<View style={st.frame} accessibilityElementsHidden importantForAccessibility="no-hide-descendants">
|
|
182
|
+
<View style={st.shot}>
|
|
183
|
+
<Shot />
|
|
184
|
+
</View>
|
|
185
|
+
</View>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const st = StyleSheet.create({
|
|
190
|
+
frame: {
|
|
191
|
+
height: 136,
|
|
192
|
+
justifyContent: 'center',
|
|
193
|
+
padding: 14,
|
|
194
|
+
borderRadius: 18,
|
|
195
|
+
backgroundColor: ui.fill,
|
|
196
|
+
borderWidth: 1,
|
|
197
|
+
borderColor: 'transparent',
|
|
198
|
+
marginBottom: 14,
|
|
199
|
+
},
|
|
200
|
+
shot: {
|
|
201
|
+
gap: 8,
|
|
202
|
+
paddingVertical: 11,
|
|
203
|
+
paddingHorizontal: 13,
|
|
204
|
+
borderRadius: 13,
|
|
205
|
+
borderWidth: 1,
|
|
206
|
+
borderColor: ui.hairline,
|
|
207
|
+
backgroundColor: ui.surface,
|
|
208
|
+
...lift,
|
|
209
|
+
},
|
|
210
|
+
row: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 10 },
|
|
211
|
+
b: { fontWeight: '600', fontSize: 12.5, color: ui.ink },
|
|
212
|
+
small: { fontWeight: '400', fontSize: 11.5, color: ui.muted },
|
|
213
|
+
plain: { flexShrink: 1, fontWeight: '400', fontSize: 12.5, color: ui.ink },
|
|
214
|
+
gone: { color: ui.muted, textDecorationLine: 'line-through' },
|
|
215
|
+
price: { fontWeight: '600', fontSize: 12.5, color: ui.ink, fontVariant: ['tabular-nums'] },
|
|
216
|
+
was: { fontWeight: '500', color: '#A39890', textDecorationLine: 'line-through' },
|
|
217
|
+
pill: { paddingVertical: 2, paddingHorizontal: 8, borderRadius: 999 },
|
|
218
|
+
pillText: { fontWeight: '600', fontSize: 11 },
|
|
219
|
+
day: { flexDirection: 'row', alignItems: 'center', gap: 10 },
|
|
220
|
+
dayName: { width: 30 },
|
|
221
|
+
when: { flexDirection: 'row', alignItems: 'center', gap: 10 },
|
|
222
|
+
date: {
|
|
223
|
+
width: 34,
|
|
224
|
+
height: 36,
|
|
225
|
+
borderRadius: 9,
|
|
226
|
+
backgroundColor: ui.fill,
|
|
227
|
+
alignItems: 'center',
|
|
228
|
+
justifyContent: 'center',
|
|
229
|
+
},
|
|
230
|
+
dateDay: {
|
|
231
|
+
fontWeight: '600',
|
|
232
|
+
fontSize: 9.5,
|
|
233
|
+
letterSpacing: 0.4,
|
|
234
|
+
color: ui.accentText,
|
|
235
|
+
textTransform: 'uppercase',
|
|
236
|
+
},
|
|
237
|
+
dateNum: { fontWeight: '700', fontSize: 14, color: ui.ink, lineHeight: 16 },
|
|
238
|
+
route: { flexDirection: 'row', alignItems: 'center', gap: 7 },
|
|
239
|
+
});
|