@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.
Files changed (376) hide show
  1. package/.claude-flow/data/pending-insights.jsonl +43 -0
  2. package/.claude-flow/sessions/session-1794323376548.json +14 -0
  3. package/CHANGELOG.md +31 -0
  4. package/jest.config.cjs +22 -0
  5. package/lib/assets/home/loop-day.jpg +0 -0
  6. package/lib/assets/home/loop-day.mp4 +0 -0
  7. package/lib/assets/home/loop-time-back.jpg +0 -0
  8. package/lib/assets/home/loop-time-back.mp4 +0 -0
  9. package/lib/assets/home/loop-where.jpg +0 -0
  10. package/lib/assets/home/loop-where.mp4 +0 -0
  11. package/lib/assets/home/reel-gym.jpg +0 -0
  12. package/lib/assets/home/reel-gym.mp4 +0 -0
  13. package/lib/assets/home/reel-internet.jpg +0 -0
  14. package/lib/assets/home/reel-internet.mp4 +0 -0
  15. package/lib/assets/icon.png +0 -0
  16. package/lib/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
  17. package/lib/assets/lottie/lucy-mark-calendar.json +1827 -0
  18. package/lib/assets/lottie/lucy-mark-call.json +1470 -0
  19. package/lib/assets/lottie/lucy-mark-connect.json +2552 -0
  20. package/lib/assets/lottie/lucy-mark-details.json +1735 -0
  21. package/lib/assets/lottie/lucy-mark-email.json +1363 -0
  22. package/lib/assets/lottie/lucy-mark-message.json +1154 -0
  23. package/lib/assets/lottie/lucy-mark-search.json +1067 -0
  24. package/lib/assets/lottie/lucy-mark-think.json +1253 -0
  25. package/lib/assets/lottie/lucy-mark-write.json +1532 -0
  26. package/lib/assets/lottie/time-back.json +16458 -0
  27. package/lib/assets/lottie/where-lucy-works-chat.json +6170 -0
  28. package/lib/assets/lottie/where-lucy-works-cloud.json +10066 -0
  29. package/lib/assets/lottie/where-lucy-works-mine-none.json +2478 -0
  30. package/lib/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
  31. package/lib/assets/lottie/where-lucy-works-mine-online.json +7881 -0
  32. package/lib/assets/sounds/hours-back.m4a +0 -0
  33. package/lib/assets/sounds/meet-lucy.m4a +0 -0
  34. package/lib/assets/sounds/power-on.m4a +0 -0
  35. package/lib/assets/sounds/wind-back.m4a +0 -0
  36. package/lib/assets/sounds/youre-in.m4a +0 -0
  37. package/lib/chat/agent.js +358 -0
  38. package/lib/chat/agent.js.map +1 -0
  39. package/lib/chat/appFront.js +32 -0
  40. package/lib/chat/appFront.js.map +1 -0
  41. package/lib/chat/auth.js +370 -0
  42. package/lib/chat/auth.js.map +1 -0
  43. package/lib/chat/chores.js +360 -0
  44. package/lib/chat/chores.js.map +1 -0
  45. package/lib/chat/connectors.js +42 -0
  46. package/lib/chat/connectors.js.map +1 -0
  47. package/lib/chat/jobs.js +223 -0
  48. package/lib/chat/jobs.js.map +1 -0
  49. package/lib/chat/lucyMotion.js +6 -0
  50. package/lib/chat/lucyMotion.js.map +1 -0
  51. package/lib/chat/protocol.js +111 -0
  52. package/lib/chat/protocol.js.map +1 -0
  53. package/lib/chat/results.js +133 -0
  54. package/lib/chat/results.js.map +1 -0
  55. package/lib/chat/store.js +81 -0
  56. package/lib/chat/store.js.map +1 -0
  57. package/lib/chat/useDictation.js +168 -0
  58. package/lib/chat/useDictation.js.map +1 -0
  59. package/lib/chat/useLucyChat.js +451 -0
  60. package/lib/chat/useLucyChat.js.map +1 -0
  61. package/lib/chat/useMyComputer.js +32 -0
  62. package/lib/chat/useMyComputer.js.map +1 -0
  63. package/lib/chat/whereLucyWorks.js +52 -0
  64. package/lib/chat/whereLucyWorks.js.map +1 -0
  65. package/lib/chat/workspace.js +124 -0
  66. package/lib/chat/workspace.js.map +1 -0
  67. package/lib/components/AreaShot.js +289 -0
  68. package/lib/components/AreaShot.js.map +1 -0
  69. package/lib/components/Backdrops.js +262 -0
  70. package/lib/components/Backdrops.js.map +1 -0
  71. package/lib/components/BottomSheet.js +61 -0
  72. package/lib/components/BottomSheet.js.map +1 -0
  73. package/lib/components/ChatSheets.js +429 -0
  74. package/lib/components/ChatSheets.js.map +1 -0
  75. package/lib/components/ConnectorLogo.js +91 -0
  76. package/lib/components/ConnectorLogo.js.map +1 -0
  77. package/lib/components/CustomDrawer.js +534 -0
  78. package/lib/components/CustomDrawer.js.map +1 -0
  79. package/lib/components/IdeasPane.js +394 -0
  80. package/lib/components/IdeasPane.js.map +1 -0
  81. package/lib/components/ImessageSheet.js +261 -0
  82. package/lib/components/ImessageSheet.js.map +1 -0
  83. package/lib/components/KeyboardAvoider.js +29 -0
  84. package/lib/components/KeyboardAvoider.js.map +1 -0
  85. package/lib/components/Logo.js +81 -0
  86. package/lib/components/Logo.js.map +1 -0
  87. package/lib/components/LucyWorking.js +67 -0
  88. package/lib/components/LucyWorking.js.map +1 -0
  89. package/lib/components/Markdown.js +260 -0
  90. package/lib/components/Markdown.js.map +1 -0
  91. package/lib/components/Media.js +93 -0
  92. package/lib/components/Media.js.map +1 -0
  93. package/lib/components/MessagesAppIcon.js +23 -0
  94. package/lib/components/MessagesAppIcon.js.map +1 -0
  95. package/lib/components/MicButton.js +71 -0
  96. package/lib/components/MicButton.js.map +1 -0
  97. package/lib/components/ResultCards.js +974 -0
  98. package/lib/components/ResultCards.js.map +1 -0
  99. package/lib/components/SignInPrompt.js +148 -0
  100. package/lib/components/SignInPrompt.js.map +1 -0
  101. package/lib/components/SignedOut.js +38 -0
  102. package/lib/components/SignedOut.js.map +1 -0
  103. package/lib/components/TalkToLucyHero.js +487 -0
  104. package/lib/components/TalkToLucyHero.js.map +1 -0
  105. package/lib/components/TalkToLucySheet.js +182 -0
  106. package/lib/components/TalkToLucySheet.js.map +1 -0
  107. package/lib/components/WhereLucyWorks.js +277 -0
  108. package/lib/components/WhereLucyWorks.js.map +1 -0
  109. package/lib/components/WorkspaceSection.js +271 -0
  110. package/lib/components/WorkspaceSection.js.map +1 -0
  111. package/lib/components/YantraMark.js +13 -0
  112. package/lib/components/YantraMark.js.map +1 -0
  113. package/lib/components/drawerHeader.js +38 -0
  114. package/lib/components/drawerHeader.js.map +1 -0
  115. package/lib/components/lottieInstalled.js +6 -0
  116. package/lib/components/lottieInstalled.js.map +1 -0
  117. package/lib/components/ui.js +550 -0
  118. package/lib/components/ui.js.map +1 -0
  119. package/lib/components/useSignOut.js +7 -0
  120. package/lib/components/useSignOut.js.map +1 -0
  121. package/lib/components/viewport.js +121 -0
  122. package/lib/components/viewport.js.map +1 -0
  123. package/lib/components/voiceDial.js +10 -0
  124. package/lib/components/voiceDial.js.map +1 -0
  125. package/lib/compute.js +157 -0
  126. package/lib/compute.js.map +1 -0
  127. package/lib/config/env-config.js +21 -0
  128. package/lib/config/env-config.js.map +1 -0
  129. package/lib/config/routes.js +15 -0
  130. package/lib/config/routes.js.map +1 -0
  131. package/lib/content.js +25 -0
  132. package/lib/content.js.map +1 -0
  133. package/lib/hooks/keyboardCover.js +39 -0
  134. package/lib/hooks/keyboardCover.js.map +1 -0
  135. package/lib/hooks/useKeyboard.js +121 -0
  136. package/lib/hooks/useKeyboard.js.map +1 -0
  137. package/lib/hooks/useReducedMotion.js +13 -0
  138. package/lib/hooks/useReducedMotion.js.map +1 -0
  139. package/lib/imessage/openMessages.js +25 -0
  140. package/lib/imessage/openMessages.js.map +1 -0
  141. package/lib/imessage/platform.js +12 -0
  142. package/lib/imessage/platform.js.map +1 -0
  143. package/lib/imessage/textLink.js +262 -0
  144. package/lib/imessage/textLink.js.map +1 -0
  145. package/lib/index.js +1 -0
  146. package/lib/index.js.map +1 -0
  147. package/lib/live/card.js +28 -0
  148. package/lib/live/card.js.map +1 -0
  149. package/lib/live/liveActivity.js +144 -0
  150. package/lib/live/liveActivity.js.map +1 -0
  151. package/lib/module.js +3 -0
  152. package/lib/module.js.map +1 -0
  153. package/lib/offer/BlackFridayOffer.js +378 -0
  154. package/lib/offer/BlackFridayOffer.js.map +1 -0
  155. package/lib/offer/blackFriday.js +78 -0
  156. package/lib/offer/blackFriday.js.map +1 -0
  157. package/lib/offer/parts.js +624 -0
  158. package/lib/offer/parts.js.map +1 -0
  159. package/lib/offer/state.js +63 -0
  160. package/lib/offer/state.js.map +1 -0
  161. package/lib/push/push.js +142 -0
  162. package/lib/push/push.js.map +1 -0
  163. package/lib/push/usePushNotifications.js +39 -0
  164. package/lib/push/usePushNotifications.js.map +1 -0
  165. package/lib/routes.json +175 -0
  166. package/lib/screens/Account/index.js +209 -0
  167. package/lib/screens/Account/index.js.map +1 -0
  168. package/lib/screens/Chat/index.js +710 -0
  169. package/lib/screens/Chat/index.js.map +1 -0
  170. package/lib/screens/Chores/index.js +18 -0
  171. package/lib/screens/Chores/index.js.map +1 -0
  172. package/lib/screens/Connectors/index.js +17 -0
  173. package/lib/screens/Connectors/index.js.map +1 -0
  174. package/lib/screens/History/index.js +380 -0
  175. package/lib/screens/History/index.js.map +1 -0
  176. package/lib/screens/Home/index.js +2711 -0
  177. package/lib/screens/Home/index.js.map +1 -0
  178. package/lib/screens/Home/media.js +25 -0
  179. package/lib/screens/Home/media.js.map +1 -0
  180. package/lib/screens/Welcome/index.js +1066 -0
  181. package/lib/screens/Welcome/index.js.map +1 -0
  182. package/lib/talk/talkToLucy.js +139 -0
  183. package/lib/talk/talkToLucy.js.map +1 -0
  184. package/lib/theme/colors.js +29 -0
  185. package/lib/theme/colors.js.map +1 -0
  186. package/lib/theme/fonts.js +17 -0
  187. package/lib/theme/fonts.js.map +1 -0
  188. package/lib/theme/muse.js +134 -0
  189. package/lib/theme/muse.js.map +1 -0
  190. package/lib/utils/links.js +54 -0
  191. package/lib/utils/links.js.map +1 -0
  192. package/lib/utils/yantraLinks.js +68 -0
  193. package/lib/utils/yantraLinks.js.map +1 -0
  194. package/lib/welcome/flow.js +375 -0
  195. package/lib/welcome/flow.js.map +1 -0
  196. package/lib/welcome/haptics.js +125 -0
  197. package/lib/welcome/haptics.js.map +1 -0
  198. package/lib/welcome/parts.js +1996 -0
  199. package/lib/welcome/parts.js.map +1 -0
  200. package/lib/welcome/powerOn.js +29 -0
  201. package/lib/welcome/powerOn.js.map +1 -0
  202. package/lib/welcome/seen.js +41 -0
  203. package/lib/welcome/seen.js.map +1 -0
  204. package/lib/welcome/sound.js +110 -0
  205. package/lib/welcome/sound.js.map +1 -0
  206. package/package.json +66 -5
  207. package/rollup.config.mjs +42 -0
  208. package/src/.claude-flow/data/pending-insights.jsonl +19 -0
  209. package/src/.claude-flow/sessions/session-1795013028422.json +14 -0
  210. package/src/__tests__/auth.test.ts +94 -0
  211. package/src/__tests__/blackFriday.test.ts +75 -0
  212. package/src/__tests__/cardTokens.test.ts +77 -0
  213. package/src/__tests__/chores.test.ts +179 -0
  214. package/src/__tests__/choresList.test.ts +100 -0
  215. package/src/__tests__/content.test.ts +54 -0
  216. package/src/__tests__/dictation.test.ts +186 -0
  217. package/src/__tests__/haptics.test.ts +202 -0
  218. package/src/__tests__/jobs.test.ts +130 -0
  219. package/src/__tests__/keyboardCover.test.ts +84 -0
  220. package/src/__tests__/liveCard.test.ts +39 -0
  221. package/src/__tests__/lockedPhone.test.ts +355 -0
  222. package/src/__tests__/lucyMotion.test.ts +34 -0
  223. package/src/__tests__/platform.test.ts +32 -0
  224. package/src/__tests__/powerOn.test.ts +62 -0
  225. package/src/__tests__/protocol.test.ts +125 -0
  226. package/src/__tests__/push.test.ts +111 -0
  227. package/src/__tests__/results.test.ts +256 -0
  228. package/src/__tests__/sound.test.ts +248 -0
  229. package/src/__tests__/talkToLucy.test.ts +205 -0
  230. package/src/__tests__/textLink.test.ts +91 -0
  231. package/src/__tests__/voiceDial.test.ts +53 -0
  232. package/src/__tests__/welcomeFlow.test.ts +157 -0
  233. package/src/__tests__/whereLucyWorks.test.ts +81 -0
  234. package/src/__tests__/yantraLinks.test.ts +96 -0
  235. package/src/assets/home/loop-day.jpg +0 -0
  236. package/src/assets/home/loop-day.mp4 +0 -0
  237. package/src/assets/home/loop-time-back.jpg +0 -0
  238. package/src/assets/home/loop-time-back.mp4 +0 -0
  239. package/src/assets/home/loop-where.jpg +0 -0
  240. package/src/assets/home/loop-where.mp4 +0 -0
  241. package/src/assets/home/reel-gym.jpg +0 -0
  242. package/src/assets/home/reel-gym.mp4 +0 -0
  243. package/src/assets/home/reel-internet.jpg +0 -0
  244. package/src/assets/home/reel-internet.mp4 +0 -0
  245. package/src/assets/icon.png +0 -0
  246. package/src/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
  247. package/src/assets/lottie/lucy-mark-calendar.json +1827 -0
  248. package/src/assets/lottie/lucy-mark-call.json +1470 -0
  249. package/src/assets/lottie/lucy-mark-connect.json +2552 -0
  250. package/src/assets/lottie/lucy-mark-details.json +1735 -0
  251. package/src/assets/lottie/lucy-mark-email.json +1363 -0
  252. package/src/assets/lottie/lucy-mark-message.json +1154 -0
  253. package/src/assets/lottie/lucy-mark-search.json +1067 -0
  254. package/src/assets/lottie/lucy-mark-think.json +1253 -0
  255. package/src/assets/lottie/lucy-mark-write.json +1532 -0
  256. package/src/assets/lottie/time-back.json +16458 -0
  257. package/src/assets/lottie/where-lucy-works-chat.json +6170 -0
  258. package/src/assets/lottie/where-lucy-works-cloud.json +10066 -0
  259. package/src/assets/lottie/where-lucy-works-mine-none.json +2478 -0
  260. package/src/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
  261. package/src/assets/lottie/where-lucy-works-mine-online.json +7881 -0
  262. package/src/assets/sounds/hours-back.m4a +0 -0
  263. package/src/assets/sounds/meet-lucy.m4a +0 -0
  264. package/src/assets/sounds/power-on.m4a +0 -0
  265. package/src/assets/sounds/wind-back.m4a +0 -0
  266. package/src/assets/sounds/youre-in.m4a +0 -0
  267. package/src/chat/.claude-flow/data/pending-insights.jsonl +1 -0
  268. package/src/chat/agent.ts +376 -0
  269. package/src/chat/appFront.ts +39 -0
  270. package/src/chat/auth.ts +433 -0
  271. package/src/chat/chores.ts +394 -0
  272. package/src/chat/connectors.ts +65 -0
  273. package/src/chat/jobs.ts +228 -0
  274. package/src/chat/lucyMotion.ts +33 -0
  275. package/src/chat/protocol.ts +192 -0
  276. package/src/chat/results.ts +224 -0
  277. package/src/chat/store.ts +87 -0
  278. package/src/chat/useDictation.ts +201 -0
  279. package/src/chat/useLucyChat.ts +458 -0
  280. package/src/chat/useMyComputer.ts +41 -0
  281. package/src/chat/whereLucyWorks.ts +97 -0
  282. package/src/chat/workspace.ts +127 -0
  283. package/src/components/.claude-flow/data/pending-insights.jsonl +3 -0
  284. package/src/components/AreaShot.tsx +239 -0
  285. package/src/components/Backdrops.tsx +323 -0
  286. package/src/components/BottomSheet.tsx +96 -0
  287. package/src/components/ChatSheets.tsx +565 -0
  288. package/src/components/ConnectorLogo.tsx +116 -0
  289. package/src/components/CustomDrawer.tsx +526 -0
  290. package/src/components/IdeasPane.tsx +318 -0
  291. package/src/components/ImessageSheet.tsx +280 -0
  292. package/src/components/KeyboardAvoider.tsx +45 -0
  293. package/src/components/Logo.tsx +97 -0
  294. package/src/components/LucyWorking.tsx +122 -0
  295. package/src/components/Markdown.tsx +219 -0
  296. package/src/components/Media.tsx +173 -0
  297. package/src/components/MessagesAppIcon.tsx +51 -0
  298. package/src/components/MicButton.tsx +92 -0
  299. package/src/components/ResultCards.tsx +1067 -0
  300. package/src/components/SignInPrompt.tsx +182 -0
  301. package/src/components/SignedOut.tsx +47 -0
  302. package/src/components/TalkToLucyHero.tsx +540 -0
  303. package/src/components/TalkToLucySheet.tsx +208 -0
  304. package/src/components/VoiceOrb.tsx +364 -0
  305. package/src/components/WhereLucyWorks.tsx +261 -0
  306. package/src/components/WorkspaceSection.tsx +307 -0
  307. package/src/components/YantraMark.tsx +30 -0
  308. package/src/components/drawerHeader.tsx +46 -0
  309. package/src/components/kit.tsx +309 -0
  310. package/src/components/lottieInstalled.ts +7 -0
  311. package/src/components/ui.tsx +700 -0
  312. package/src/components/useSignOut.ts +21 -0
  313. package/src/components/viewport.tsx +166 -0
  314. package/src/components/voiceDial.ts +45 -0
  315. package/src/compute.ts +168 -0
  316. package/src/config/env-config.ts +37 -0
  317. package/src/config/routes.ts +28 -0
  318. package/src/content.ts +217 -0
  319. package/src/hooks/keyboardCover.ts +70 -0
  320. package/src/hooks/useKeyboard.ts +135 -0
  321. package/src/hooks/useReducedMotion.ts +19 -0
  322. package/src/imessage/openMessages.ts +53 -0
  323. package/src/imessage/platform.ts +32 -0
  324. package/src/imessage/textLink.ts +307 -0
  325. package/src/index.ts +24 -0
  326. package/src/live/card.ts +62 -0
  327. package/src/live/liveActivity.ts +192 -0
  328. package/src/module.ts +8 -0
  329. package/src/offer/BlackFridayOffer.tsx +394 -0
  330. package/src/offer/blackFriday.ts +109 -0
  331. package/src/offer/parts.tsx +650 -0
  332. package/src/offer/state.ts +78 -0
  333. package/src/push/push.ts +171 -0
  334. package/src/push/usePushNotifications.ts +47 -0
  335. package/src/screens/Account/index.tsx +310 -0
  336. package/src/screens/Chat/.claude-flow/data/pending-insights.jsonl +4 -0
  337. package/src/screens/Chat/index.tsx +891 -0
  338. package/src/screens/Chores/index.tsx +35 -0
  339. package/src/screens/Connectors/index.tsx +35 -0
  340. package/src/screens/History/index.tsx +346 -0
  341. package/src/screens/Home/index.tsx +2773 -0
  342. package/src/screens/Home/media.ts +31 -0
  343. package/src/screens/Welcome/index.tsx +1182 -0
  344. package/src/talk/talkToLucy.ts +187 -0
  345. package/src/theme/colors.ts +38 -0
  346. package/src/theme/fonts.ts +30 -0
  347. package/src/theme/muse.ts +86 -0
  348. package/src/utils/links.ts +84 -0
  349. package/src/utils/yantraLinks.ts +94 -0
  350. package/src/welcome/flow.ts +418 -0
  351. package/src/welcome/haptics.ts +179 -0
  352. package/src/welcome/parts.tsx +2160 -0
  353. package/src/welcome/powerOn.ts +84 -0
  354. package/src/welcome/seen.ts +68 -0
  355. package/src/welcome/sound.ts +173 -0
  356. package/tools/lottie/chat.motion +0 -0
  357. package/tools/lottie/cloud.motion +0 -0
  358. package/tools/lottie/generate.mjs +1209 -0
  359. package/tools/lottie/inter-glyphs.json +4416 -0
  360. package/tools/lottie/lucy-mark-calendar.motion +0 -0
  361. package/tools/lottie/lucy-mark-call.motion +0 -0
  362. package/tools/lottie/lucy-mark-connect.motion +0 -0
  363. package/tools/lottie/lucy-mark-details.motion +0 -0
  364. package/tools/lottie/lucy-mark-email.motion +0 -0
  365. package/tools/lottie/lucy-mark-message.motion +0 -0
  366. package/tools/lottie/lucy-mark-search.motion +0 -0
  367. package/tools/lottie/lucy-mark-think.motion +0 -0
  368. package/tools/lottie/lucy-mark-write.motion +0 -0
  369. package/tools/lottie/mark.json +1 -0
  370. package/tools/lottie/mine-none.motion +0 -0
  371. package/tools/lottie/mine-offline.motion +0 -0
  372. package/tools/lottie/mine-online.motion +0 -0
  373. package/tools/lottie/time-back.mjs +604 -0
  374. package/tools/sounds/render.mjs +730 -0
  375. package/tsconfig.json +17 -0
  376. package/README.md +0 -3
@@ -0,0 +1,121 @@
1
+ import {jsx}from'react/jsx-runtime';import {useRef,useCallback,useMemo,useEffect,createContext,useContext,useState}from'react';const ViewportContext = createContext(null);
2
+ function useViewportController() {
3
+ const contentRef = useRef(null);
4
+ const y = useRef(0);
5
+ const h = useRef(0);
6
+ const listeners = useRef(/* @__PURE__ */ new Set()).current;
7
+ const layoutListeners = useRef(/* @__PURE__ */ new Set()).current;
8
+ const frame = useRef(null);
9
+ const notify = useCallback(() => {
10
+ if (frame.current !== null)
11
+ return;
12
+ frame.current = requestAnimationFrame(() => {
13
+ frame.current = null;
14
+ listeners.forEach((l) => l());
15
+ });
16
+ }, [listeners]);
17
+ const viewport = useMemo(() => ({
18
+ contentRef,
19
+ scrollY: () => y.current,
20
+ height: () => h.current,
21
+ subscribe: (l) => {
22
+ listeners.add(l);
23
+ return () => listeners.delete(l);
24
+ },
25
+ subscribeLayout: (l) => {
26
+ layoutListeners.add(l);
27
+ return () => layoutListeners.delete(l);
28
+ }
29
+ }), [listeners, layoutListeners]);
30
+ useEffect(() => () => {
31
+ if (frame.current !== null)
32
+ cancelAnimationFrame(frame.current);
33
+ }, []);
34
+ const handlers = useMemo(() => ({
35
+ scrollEventThrottle: 32,
36
+ onScroll: (e) => {
37
+ y.current = e.nativeEvent.contentOffset.y;
38
+ notify();
39
+ },
40
+ onLayout: (e) => {
41
+ h.current = e.nativeEvent.layout.height;
42
+ notify();
43
+ },
44
+ onContentSizeChange: () => {
45
+ layoutListeners.forEach((l) => l());
46
+ }
47
+ }), [notify, layoutListeners]);
48
+ return {
49
+ viewport,
50
+ handlers,
51
+ contentRef
52
+ };
53
+ }
54
+ function ViewportProvider({
55
+ value,
56
+ children
57
+ }) {
58
+ return /* @__PURE__ */ jsx(ViewportContext.Provider, { value, children });
59
+ }
60
+ function useInView(ref, {
61
+ enabled = true,
62
+ minFraction = 1 / 3,
63
+ edge,
64
+ once = false
65
+ } = {}) {
66
+ const viewport = useContext(ViewportContext);
67
+ const [inView, setInView] = useState(viewport ? void 0 : true);
68
+ const pos = useRef(null);
69
+ const done = useRef(false);
70
+ useEffect(() => {
71
+ if (!viewport)
72
+ return void 0;
73
+ if (!enabled) {
74
+ setInView(false);
75
+ return void 0;
76
+ }
77
+ let alive = true;
78
+ const check = () => {
79
+ const p = pos.current;
80
+ const vh = viewport.height();
81
+ if (!p || !vh || done.current)
82
+ return;
83
+ const top = viewport.scrollY();
84
+ let next;
85
+ if (edge !== void 0) {
86
+ next = p.top < top + vh * edge && p.top + p.height > top;
87
+ } else {
88
+ const visible = Math.min(p.top + p.height, top + vh) - Math.max(p.top, top);
89
+ next = p.height > 0 && visible >= Math.min(p.height, vh) * minFraction;
90
+ }
91
+ setInView((prev) => prev === next ? prev : next);
92
+ if (next && once)
93
+ done.current = true;
94
+ };
95
+ const measure = () => {
96
+ const node = ref.current;
97
+ const content = viewport.contentRef.current;
98
+ if (!node || !content)
99
+ return;
100
+ node.measureLayout(content, (_x, y, _w, height) => {
101
+ if (!alive)
102
+ return;
103
+ pos.current = {
104
+ top: y,
105
+ height
106
+ };
107
+ check();
108
+ }, () => void 0);
109
+ };
110
+ const first = requestAnimationFrame(measure);
111
+ const offScroll = viewport.subscribe(check);
112
+ const offLayout = viewport.subscribeLayout(measure);
113
+ return () => {
114
+ alive = false;
115
+ cancelAnimationFrame(first);
116
+ offScroll();
117
+ offLayout();
118
+ };
119
+ }, [viewport, ref, enabled, minFraction, edge, once]);
120
+ return inView;
121
+ }export{ViewportProvider,useInView,useViewportController};//# sourceMappingURL=viewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.js","sources":["../../src/components/viewport.tsx"],"sourcesContent":["/**\n * What part of a scrolling page is on screen, without asking the native side while it scrolls.\n *\n * A view measures where it sits on the page once (measureLayout against the page's content, on mount and whenever\n * the content resizes); from then on \"is it on screen\" is arithmetic on the scroll offset the ScrollView reports.\n * This replaced per-component measureInWindow polling (15 timers, ~40 native calls a second), which is what made\n * Home stutter on Android.\n */\nimport React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport type { LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent, View } from 'react-native';\n\ntype Listener = () => void;\n\ninterface Viewport {\n /** The page's content, every tracked view is measured against it. */\n contentRef: React.RefObject<View | null>;\n scrollY: () => number;\n height: () => number;\n /** Fires after a scroll moved or the page resized (coalesced to one per frame). */\n subscribe: (listener: Listener) => () => void;\n /** Fires when the content's size changed, so positions must be measured again. */\n subscribeLayout: (listener: Listener) => () => void;\n}\n\nconst ViewportContext = createContext<Viewport | null>(null);\n\n/** Owns the page's scroll position; spread `handlers` on the ScrollView and wrap its children in `contentRef`. */\nexport function useViewportController() {\n const contentRef = useRef<View>(null);\n const y = useRef(0);\n const h = useRef(0);\n const listeners = useRef(new Set<Listener>()).current;\n const layoutListeners = useRef(new Set<Listener>()).current;\n const frame = useRef<number | null>(null);\n\n const notify = useCallback(() => {\n if (frame.current !== null) return;\n frame.current = requestAnimationFrame(() => {\n frame.current = null;\n listeners.forEach((l) => l());\n });\n }, [listeners]);\n\n const viewport = useMemo<Viewport>(\n () => ({\n contentRef,\n scrollY: () => y.current,\n height: () => h.current,\n subscribe: (l) => {\n listeners.add(l);\n return () => listeners.delete(l);\n },\n subscribeLayout: (l) => {\n layoutListeners.add(l);\n return () => layoutListeners.delete(l);\n },\n }),\n [listeners, layoutListeners],\n );\n\n useEffect(\n () => () => {\n if (frame.current !== null) cancelAnimationFrame(frame.current);\n },\n [],\n );\n\n const handlers = useMemo(\n () => ({\n scrollEventThrottle: 32,\n onScroll: (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n y.current = e.nativeEvent.contentOffset.y;\n notify();\n },\n onLayout: (e: LayoutChangeEvent) => {\n h.current = e.nativeEvent.layout.height;\n notify();\n },\n onContentSizeChange: () => {\n layoutListeners.forEach((l) => l());\n },\n }),\n [notify, layoutListeners],\n );\n\n return { viewport, handlers, contentRef };\n}\n\nexport function ViewportProvider({ value, children }: { value: Viewport; children: React.ReactNode }) {\n return <ViewportContext.Provider value={value}>{children}</ViewportContext.Provider>;\n}\n\n/**\n * Whether `ref` is on screen: at least `minFraction` of it inside the viewport (or, with `edge`, its top above that\n * fraction of the screen's height). `undefined` until it has been measured. Outside a ViewportProvider it is always\n * on screen. With `once`, it stops listening after the first time it is on screen.\n */\nexport function useInView(\n ref: React.RefObject<View | null>,\n {\n enabled = true,\n minFraction = 1 / 3,\n edge,\n once = false,\n }: {\n enabled?: boolean;\n minFraction?: number;\n edge?: number;\n once?: boolean;\n } = {},\n): boolean | undefined {\n const viewport = useContext(ViewportContext);\n const [inView, setInView] = useState<boolean | undefined>(viewport ? undefined : true);\n const pos = useRef<{ top: number; height: number } | null>(null);\n const done = useRef(false);\n\n useEffect(() => {\n if (!viewport) return undefined;\n if (!enabled) {\n setInView(false);\n return undefined;\n }\n let alive = true;\n const check = () => {\n const p = pos.current;\n const vh = viewport.height();\n if (!p || !vh || done.current) return;\n const top = viewport.scrollY();\n let next: boolean;\n if (edge !== undefined) {\n next = p.top < top + vh * edge && p.top + p.height > top;\n } else {\n const visible = Math.min(p.top + p.height, top + vh) - Math.max(p.top, top);\n next = p.height > 0 && visible >= Math.min(p.height, vh) * minFraction;\n }\n setInView((prev) => (prev === next ? prev : next));\n if (next && once) done.current = true;\n };\n const measure = () => {\n const node = ref.current;\n const content = viewport.contentRef.current;\n if (!node || !content) return;\n node.measureLayout(\n content as never,\n (_x, y, _w, height) => {\n if (!alive) return;\n pos.current = { top: y, height };\n check();\n },\n () => undefined,\n );\n };\n // After this frame's layout.\n const first = requestAnimationFrame(measure);\n const offScroll = viewport.subscribe(check);\n const offLayout = viewport.subscribeLayout(measure);\n return () => {\n alive = false;\n cancelAnimationFrame(first);\n offScroll();\n offLayout();\n };\n }, [viewport, ref, enabled, minFraction, edge, once]);\n\n return inView;\n}\n"],"names":[],"mappings":"+HAqBA,MAAM,eAAA,GAAkB,cAA+B,IAAI,CAAA;AAGpD,SAAS,qBAAwB,GAAA;AACtC,EAAM,MAAA,UAAA,GAAa,OAAa,IAAI,CAAA;AACpC,EAAM,MAAA,CAAA,GAAI,OAAO,CAAC,CAAA;AAClB,EAAM,MAAA,CAAA,GAAI,OAAO,CAAC,CAAA;AAClB,EAAA,MAAM,SAAY,GAAA,MAAA,iBAAW,IAAA,GAAA,EAAe,CAAE,CAAA,OAAA;AAC9C,EAAA,MAAM,eAAkB,GAAA,MAAA,iBAAW,IAAA,GAAA,EAAe,CAAE,CAAA,OAAA;AACpD,EAAM,MAAA,KAAA,GAAQ,OAAsB,IAAI,CAAA;AACxC,EAAM,MAAA,MAAA,GAAS,YAAY,MAAM;AAC/B,IAAA,IAAI,MAAM,OAAY,KAAA,IAAA;AAAM,MAAA;AAC5B,IAAM,KAAA,CAAA,OAAA,GAAU,sBAAsB,MAAM;AAC1C,MAAA,KAAA,CAAM,OAAU,GAAA,IAAA;AAChB,MAAU,SAAA,CAAA,OAAA,CAAQ,CAAK,CAAA,KAAA,CAAA,EAAG,CAAA;AAAA,KAC3B,CAAA;AAAA,GACH,EAAG,CAAC,SAAS,CAAC,CAAA;AACd,EAAM,MAAA,QAAA,GAAW,QAAkB,OAAO;AA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AACX,MAAQ,KAAA,GAAA,KAAA;AACR,MAAA,oBAAA,CAAqB,KAAK,CAAA;AAC1B,MAAU,SAAA,EAAA;AACV,MAAU,SAAA,EAAA;AAAA,KACZ;AAAA,GACF,EAAG,CAAC,QAAU,EAAA,GAAA,EAAK,SAAS,WAAa,EAAA,IAAA,EAAM,IAAI,CAAC,CAAA;AACpD,EAAO,OAAA,MAAA;AACT"}
@@ -0,0 +1,10 @@
1
+ const TICKS = 60;
2
+ function dialTicks(count = TICKS) {
3
+ return Array.from({
4
+ length: count
5
+ }, (_, i) => ({
6
+ i,
7
+ deg: 360 / count * i,
8
+ major: i % 5 === 0
9
+ }));
10
+ }export{TICKS,dialTicks};//# sourceMappingURL=voiceDial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voiceDial.js","sources":["../../src/components/voiceDial.ts"],"sourcesContent":["/**\n * The arithmetic of Home's voice orb (components/VoiceOrb.tsx): its dial of sixty ticks, and the light that runs round\n * them while Lucy listens. Kept apart from the drawing so it can be tested.\n */\n\nexport const TICKS = 60;\n/** How far behind the running light's head its tail still glows, as a share of the dial. */\nexport const TAIL = 0.28;\n\nexport interface DialTick {\n i: number;\n /** Clockwise from twelve. */\n deg: number;\n /** Every fifth tick, as a clock marks its hours. */\n major: boolean;\n}\n\nexport function dialTicks(count = TICKS): DialTick[] {\n return Array.from({ length: count }, (_, i) => ({ i, deg: (360 / count) * i, major: i % 5 === 0 }));\n}\n\n/** How bright tick `i` is while the light's head is at `phase` (0 to 1, clockwise from twelve). */\nexport function tailAt(i: number, phase: number, count = TICKS, tail = TAIL): number {\n const behind = (((phase - i / count) % 1) + 1) % 1;\n return behind <= tail ? 1 - behind / tail : 0;\n}\n\n/**\n * tailAt as an Animated interpolation's ranges, for one tick: dark until the head reaches it, full as it passes, out by\n * the tail's end. A tail that runs on past twelve is still glowing as the next lap begins.\n */\nexport function tailRange(i: number, count = TICKS, tail = TAIL): { inputRange: number[]; outputRange: number[] } {\n const p = i / count;\n const e = 1e-4;\n const points: [number, number][] = [];\n if (p + tail <= 1) {\n if (p > 0) points.push([0, 0], [p - e, 0]);\n points.push([p, 1], [p + tail, 0]);\n if (p + tail < 1) points.push([1, 0]);\n } else {\n const atTwelve = 1 - (1 - p) / tail;\n points.push([0, atTwelve], [p + tail - 1, 0], [p - e, 0], [p, 1], [1, atTwelve]);\n }\n return { inputRange: points.map(([x]) => x), outputRange: points.map(([, y]) => y) };\n}\n"],"names":[],"mappings":"AAKO,MAAM,KAAQ,GAAA;AAUL,SAAA,SAAA,CAAU,QAAQ,KAAmB,EAAA;AACnD,EAAA,OAAO,MAAM,IAAK,CAAA;AAAA,IAChB,MAAQ,EAAA;AAAA,GACV,EAAG,CAAC,CAAA,EAAG,CAAO,MAAA;AAAA,IACZ,CAAA;AAAA,IACA,GAAA,EAAK,MAAM,KAAQ,GAAA,CAAA;AAAA,IACnB,KAAA,EAAO,IAAI,CAAM,KAAA;AAAA,GACjB,CAAA,CAAA;AACJ"}
package/lib/compute.js ADDED
@@ -0,0 +1,157 @@
1
+ import { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';
2
+ const clockbookMobilePageStore = [{
3
+ key: "home",
4
+ path: "/l/home",
5
+ name: "Home",
6
+ exact: true,
7
+ index: true,
8
+ priority: 1,
9
+ auth: false,
10
+ menu_position: "side",
11
+ props: {
12
+ initialParams: {},
13
+ options: {
14
+ title: "Clockbook",
15
+ drawerLabel: "Home",
16
+ headerTintColor: "#1A1714",
17
+ headerTitleStyle: {
18
+ fontWeight: "bold"
19
+ },
20
+ headerTitleAlign: "left",
21
+ headerStyle: {
22
+ backgroundColor: "#FFFAF5"
23
+ },
24
+ headerShadowVisible: false,
25
+ gestureEnabled: false,
26
+ animation: "fade",
27
+ freezeOnBlur: true
28
+ }
29
+ },
30
+ componentPath: "@adminide-stack/clock-tik-mobile/lib/screens/Home/index.js",
31
+ hasComponent: true
32
+ }, {
33
+ key: "chores",
34
+ path: "/l/chores",
35
+ name: "Chores",
36
+ exact: true,
37
+ priority: 4,
38
+ auth: false,
39
+ menu_position: "side",
40
+ props: {
41
+ initialParams: {},
42
+ options: {
43
+ title: "Lucy\u2019s chores",
44
+ drawerLabel: "Lucy\u2019s chores",
45
+ headerStyle: {
46
+ backgroundColor: "#FFFAF5"
47
+ },
48
+ headerShadowVisible: false,
49
+ gestureEnabled: false,
50
+ animation: "fade",
51
+ freezeOnBlur: true
52
+ }
53
+ },
54
+ componentPath: "@adminide-stack/clock-tik-mobile/lib/screens/Chores/index.js",
55
+ hasComponent: true
56
+ }, {
57
+ key: "connectors",
58
+ path: "/l/connectors",
59
+ name: "Connectors",
60
+ exact: true,
61
+ priority: 5,
62
+ auth: false,
63
+ menu_position: "side",
64
+ props: {
65
+ initialParams: {},
66
+ options: {
67
+ title: "Connectors",
68
+ drawerLabel: "Connectors",
69
+ headerStyle: {
70
+ backgroundColor: "#FFFAF5"
71
+ },
72
+ headerShadowVisible: false,
73
+ gestureEnabled: false,
74
+ animation: "fade",
75
+ freezeOnBlur: true
76
+ }
77
+ },
78
+ componentPath: "@adminide-stack/clock-tik-mobile/lib/screens/Connectors/index.js",
79
+ hasComponent: true
80
+ }, {
81
+ key: "chat",
82
+ path: "/l/chat",
83
+ name: "Chat",
84
+ exact: true,
85
+ priority: 2,
86
+ auth: false,
87
+ menu_position: "side",
88
+ props: {
89
+ initialParams: {},
90
+ options: {
91
+ title: "Lucy",
92
+ drawerLabel: "Chat",
93
+ headerShown: false,
94
+ gestureEnabled: false,
95
+ animation: "fade"
96
+ }
97
+ },
98
+ componentPath: "@adminide-stack/clock-tik-mobile/lib/screens/Chat/index.js",
99
+ hasComponent: true
100
+ }, {
101
+ key: "account",
102
+ path: "/account",
103
+ name: "Account",
104
+ exact: true,
105
+ priority: 3,
106
+ auth: false,
107
+ props: {
108
+ initialParams: {},
109
+ options: {
110
+ title: "Account",
111
+ headerShown: false,
112
+ gestureEnabled: true,
113
+ animation: "slide_from_right"
114
+ }
115
+ },
116
+ componentPath: "@adminide-stack/clock-tik-mobile/lib/screens/Account/index.js",
117
+ hasComponent: true
118
+ }, {
119
+ key: "history",
120
+ path: "/history",
121
+ name: "History",
122
+ exact: true,
123
+ priority: 6,
124
+ auth: false,
125
+ props: {
126
+ initialParams: {},
127
+ options: {
128
+ title: "History",
129
+ headerShown: false,
130
+ gestureEnabled: true,
131
+ animation: "slide_from_right"
132
+ }
133
+ },
134
+ componentPath: "@adminide-stack/clock-tik-mobile/lib/screens/History/index.js",
135
+ hasComponent: true
136
+ }, {
137
+ key: "welcome",
138
+ path: "/welcome",
139
+ name: "Welcome",
140
+ exact: true,
141
+ priority: 7,
142
+ auth: false,
143
+ props: {
144
+ initialParams: {},
145
+ options: {
146
+ title: "Welcome",
147
+ headerShown: false,
148
+ gestureEnabled: false,
149
+ animation: "fade"
150
+ }
151
+ },
152
+ componentPath: "@adminide-stack/clock-tik-mobile/lib/screens/Welcome/index.js",
153
+ hasComponent: true
154
+ }];
155
+ const selectedRoutes = ["home", "chores", "connectors", "chat", "account", "history", "welcome"];
156
+ const filteredRoutes = getFilteredRoutes(clockbookMobilePageStore, selectedRoutes);
157
+ export { clockbookMobilePageStore, filteredRoutes }; //# sourceMappingURL=compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute.js","sources":["../src/compute.ts"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nimport { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';\nimport type { IRouteModule } from '@common-stack/core';\n\n/**\n * Clockbook's screens. Home mirrors the web home page (browser src/pages/Home, the `/` route).\n * Paths under `/l/` go into the drawer layout (MainStack.Layout.<Name>); the rest into the root\n * stack (MainStack.<Name>). Navigator names are listed in config/routes.ts; keep both in step.\n */\nexport const clockbookMobilePageStore: IRouteModule[] = [\n {\n key: 'home',\n path: '/l/home',\n name: 'Home',\n exact: true,\n index: true,\n priority: 1,\n auth: false,\n menu_position: 'side',\n component: () => import('./screens/Home'),\n props: {\n initialParams: {},\n options: {\n title: 'Clockbook',\n drawerLabel: 'Home',\n headerTintColor: '#1A1714',\n headerTitleStyle: { fontWeight: 'bold' },\n headerTitleAlign: 'left',\n headerStyle: { backgroundColor: '#FFFAF5' },\n headerShadowVisible: false,\n gestureEnabled: false,\n animation: 'fade',\n freezeOnBlur: true,\n },\n },\n },\n {\n // Lucy's chores, in the drawer.\n key: 'chores',\n path: '/l/chores',\n name: 'Chores',\n exact: true,\n priority: 4,\n auth: false,\n menu_position: 'side',\n component: () => import('./screens/Chores'),\n props: {\n initialParams: {},\n options: {\n title: 'Lucy’s chores',\n drawerLabel: 'Lucy’s chores',\n headerStyle: { backgroundColor: '#FFFAF5' },\n headerShadowVisible: false,\n gestureEnabled: false,\n animation: 'fade',\n freezeOnBlur: true,\n },\n },\n },\n {\n // The apps Lucy can use, in the drawer.\n key: 'connectors',\n path: '/l/connectors',\n name: 'Connectors',\n exact: true,\n priority: 5,\n auth: false,\n menu_position: 'side',\n component: () => import('./screens/Connectors'),\n props: {\n initialParams: {},\n options: {\n title: 'Connectors',\n drawerLabel: 'Connectors',\n headerStyle: { backgroundColor: '#FFFAF5' },\n headerShadowVisible: false,\n gestureEnabled: false,\n animation: 'fade',\n freezeOnBlur: true,\n },\n },\n },\n {\n // Lucy's chat, a drawer screen (it draws its own header, with the menu button).\n key: 'chat',\n path: '/l/chat',\n name: 'Chat',\n exact: true,\n priority: 2,\n auth: false,\n menu_position: 'side',\n component: () => import('./screens/Chat'),\n props: {\n initialParams: {},\n options: {\n title: 'Lucy',\n drawerLabel: 'Chat',\n headerShown: false,\n gestureEnabled: false,\n animation: 'fade',\n },\n },\n },\n {\n // Who is signed in and what they have with Lucy; opened from the drawer's profile card.\n key: 'account',\n path: '/account',\n name: 'Account',\n exact: true,\n priority: 3,\n auth: false,\n component: () => import('./screens/Account'),\n props: {\n initialParams: {},\n options: {\n title: 'Account',\n headerShown: false,\n gestureEnabled: true,\n animation: 'slide_from_right',\n },\n },\n },\n {\n // Lucy's past chats; opened from the chat's header.\n key: 'history',\n path: '/history',\n name: 'History',\n exact: true,\n priority: 6,\n auth: false,\n component: () => import('./screens/History'),\n props: {\n initialParams: {},\n options: {\n title: 'History',\n headerShown: false,\n gestureEnabled: true,\n animation: 'slide_from_right',\n },\n },\n },\n {\n // The welcome, once per phone: Home opens it on first launch (welcome/seen.ts remembers it was seen).\n key: 'welcome',\n path: '/welcome',\n name: 'Welcome',\n exact: true,\n priority: 7,\n auth: false,\n component: () => import('./screens/Welcome'),\n props: {\n initialParams: {},\n options: {\n title: 'Welcome',\n headerShown: false,\n gestureEnabled: false,\n animation: 'fade',\n },\n },\n },\n];\n\nconst selectedRoutes = ['home', 'chores', 'connectors', 'chat', 'account', 'history', 'welcome'];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst filteredRoutes = getFilteredRoutes(clockbookMobilePageStore as any, selectedRoutes);\n\nexport { filteredRoutes };\n"],"names":[],"mappings":"uFASO,MAAM,2BAA2C,CAAC;AAAA,EACvD,GAAK,EAAA,MAAA;AAAA,EACL,IAAM,EAAA,SAAA;AAAA,EACN,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,IAAA;AAAA,EACP,KAAO,EAAA,IAAA;AAAA,EACP,QAAU,EAAA,CAAA;AAAA,EACV,IAAM,EAAA,KAAA;AAAA,EACN,aAAe,EAAA,MAAA;AAAA,EACf,SAAA,EAAW,MAAM,OAAO,yBAAA,CAAA;AAAA,EACxB,KAAO,EAAA;AAAA,IACL,eAAe,EAAC;AAAA,IAChB,OAAS,EAAA;AAAA,MACP,KAAO,EAAA,WAAA;AAAA,MACP,WAAa,EAAA,MAAA;AAAA,MACb,eAAiB,EAAA,SAAA;AAAA,MACjB,gBAAkB,EAAA;AAAA,QAChB,UAAY,EAAA;AAAA,OACd;AAAA,MACA,gBAAkB,EAAA,MAAA;AAAA,MAClB,WAAa,EAAA;AAAA,QACX,eAAiB,EAAA;AAAA,OACnB;AAAA,MACA,mBAAqB,EAAA,KAAA;A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IACL,eAAe,EAAC;AAAA,IAChB,OAAS,EAAA;AAAA,MACP,KAAO,EAAA,SAAA;AAAA,MACP,WAAa,EAAA,KAAA;AAAA,MACb,cAAgB,EAAA,IAAA;AAAA,MAChB,SAAW,EAAA;AAAA;AACb;AAEJ,CAAG,EAAA;AAAA,EAED,GAAK,EAAA,SAAA;AAAA,EACL,IAAM,EAAA,UAAA;AAAA,EACN,IAAM,EAAA,SAAA;AAAA,EACN,KAAO,EAAA,IAAA;AAAA,EACP,QAAU,EAAA,CAAA;AAAA,EACV,IAAM,EAAA,KAAA;AAAA,EACN,SAAA,EAAW,MAAM,OAAO,4BAAA,CAAA;AAAA,EACxB,KAAO,EAAA;AAAA,IACL,eAAe,EAAC;AAAA,IAChB,OAAS,EAAA;AAAA,MACP,KAAO,EAAA,SAAA;AAAA,MACP,WAAa,EAAA,KAAA;AAAA,MACb,cAAgB,EAAA,KAAA;AAAA,MAChB,SAAW,EAAA;AAAA;AACb;AAEJ,CAAC;AACD,MAAM,cAAA,GAAiB,CAAC,MAAQ,EAAA,QAAA,EAAU,cAAc,MAAQ,EAAA,SAAA,EAAW,WAAW,SAAS,CAAA;AAGzF,MAAA,cAAA,GAAiB,iBAAkB,CAAA,wBAAA,EAAiC,cAAc"}
@@ -0,0 +1,21 @@
1
+ import {cleanEnv,str}from'envalid';const env = process.APP_ENV || process.env;
2
+ const config = cleanEnv(env, {
3
+ APP_NAME: str({
4
+ default: "Clockbook"
5
+ }),
6
+ APP_URL: str({
7
+ default: "https://clockbook.com"
8
+ }),
9
+ BUSINESS_URL: str({
10
+ default: "https://clockbook.com/business"
11
+ }),
12
+ YANTRA_APP_URL: str({
13
+ default: "https://yantra.app"
14
+ }),
15
+ COMPUTER_LINK_URL: str({
16
+ default: (env.NODE_ENV || "production") === "production" ? "https://computer-link.yantra.app" : "https://computer-link.cdebase.dev"
17
+ }),
18
+ CDECLI_AGENT_URL: str({
19
+ default: (env.NODE_ENV || "production") === "production" ? "https://cdecli-agent.yantra.app" : "https://cdecli-agent.cdebase.dev"
20
+ })
21
+ });export{config};//# sourceMappingURL=env-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":["import { str, cleanEnv } from 'envalid';\n\n// The app (portable-devices/mobile config/public-config.js) publishes its @env values on process.APP_ENV.\nconst env = (process as { APP_ENV?: NodeJS.ProcessEnv; env?: NodeJS.ProcessEnv }).APP_ENV || process.env;\n\nexport const config = cleanEnv(env, {\n APP_NAME: str({ default: 'Clockbook' }),\n /** The Clockbook app: chores open its new-chat page with the chore pre-typed; Sign in opens it. */\n APP_URL: str({ default: 'https://clockbook.com' }),\n /**\n * Clockbook for business (the web page's VITE_BUSINESS_URL). Empty hides every business link,\n * as on the web page.\n */\n BUSINESS_URL: str({ default: 'https://clockbook.com/business' }),\n /** The Yantra app Clockbook runs on (the web page's YANTRA_APP_URL): \"For business\" and iMessage texting open it. */\n YANTRA_APP_URL: str({ default: 'https://yantra.app' }),\n /**\n * The service a person's own computer links to, so the chat can show it once it is connected: our own address\n * (kube-orchestration computer-link-proxy) on the same plane as the agent below, never the Worker's Cloudflare one.\n */\n COMPUTER_LINK_URL: str({\n default:\n (env.NODE_ENV || 'production') === 'production'\n ? 'https://computer-link.yantra.app'\n : 'https://computer-link.cdebase.dev',\n }),\n /**\n * Lucy's agent (the web chat's cdecli agent): the native chat opens its sessions and streams its turns here. It names\n * the Yantra backend it trusts at GET /v1/auth/context, and that is where the chat's token is minted.\n */\n CDECLI_AGENT_URL: str({\n default:\n (env.NODE_ENV || 'production') === 'production'\n ? 'https://cdecli-agent.yantra.app'\n : 'https://cdecli-agent.cdebase.dev',\n }),\n});\n"],"names":[],"mappings":"mCAGA,MAAM,GAAA,GAAO,OAGV,CAAA,OAAA,IAAW,OAAQ,CAAA,GAAA;AACT,MAAA,MAAA,GAAS,SAAS,GAAK,EAAA;AAAA,EAClC,UAAU,GAAI,CAAA;AAAA,IACZ,OAAS,EAAA;AAAA,GACV,CAAA;AAAA,EAED,SAAS,GAAI,CAAA;AAAA,IACX,OAAS,EAAA;AAAA,GACV,CAAA;AAAA,EAKD,cAAc,GAAI,CAAA;AAAA,IAChB,OAAS,EAAA;AAAA,GACV,CAAA;AAAA,EAED,gBAAgB,GAAI,CAAA;AAAA,IAClB,OAAS,EAAA;AAAA,GACV,CAAA;AAAA,EAKD,mBAAmB,GAAI,CAAA;AAAA,IACrB,OAAU,EAAA,CAAA,GAAA,CAAI,QAAY,IAAA,YAAA,MAAkB,eAAe,kCAAqC,GAAA;AAAA,GACjG,CAAA;AAAA,EAKD,kBAAkB,GAAI,CAAA;AAAA,IACpB,OAAU,EAAA,CAAA,GAAA,CAAI,QAAY,IAAA,YAAA,MAAkB,eAAe,iCAAoC,GAAA;AAAA,GAChG;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ function drawerRoute(screen, params) {
2
+ return ["MainStack", {
3
+ screen,
4
+ params
5
+ }];
6
+ }
7
+ const CLOCKBOOK_ROUTES = {
8
+ HOME: "MainStack.Layout.Home",
9
+ CHORES: "MainStack.Layout.Chores",
10
+ CONNECTORS: "MainStack.Layout.Connectors",
11
+ CHAT: "MainStack.Layout.Chat",
12
+ ACCOUNT: "MainStack.Account",
13
+ HISTORY: "MainStack.History",
14
+ WELCOME: "MainStack.Welcome"
15
+ };export{CLOCKBOOK_ROUTES,drawerRoute};//# sourceMappingURL=routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.js","sources":["../../src/config/routes.ts"],"sourcesContent":["/**\n * Navigator names the generated navigation gives the routes in compute.ts: routes whose\n * path starts with `/l/` live in the drawer, under `MainStack.Layout`; the rest directly under `MainStack`.\n * Keep the two files in step.\n */\n/**\n * A drawer screen reached from a screen pushed over the drawer (Account, History): the drawer is the root stack's\n * `MainStack` screen, so the route goes through it (React Navigation's nested navigate).\n */\nexport function drawerRoute(screen: string, params?: object): [string, object] {\n return ['MainStack', { screen, params }];\n}\n\nexport const CLOCKBOOK_ROUTES = {\n HOME: 'MainStack.Layout.Home',\n /** Lucy's chores, a drawer screen. */\n CHORES: 'MainStack.Layout.Chores',\n /** The apps Lucy can use, a drawer screen. */\n CONNECTORS: 'MainStack.Layout.Connectors',\n /** Lucy's chat, a drawer screen. Params: `prompt` (a chore to send now) and `at`. */\n CHAT: 'MainStack.Layout.Chat',\n /** Account: profile, Lucy's chores, connected apps, help, sign out. Opened from the drawer's profile card. */\n ACCOUNT: 'MainStack.Account',\n /** Lucy's past chats, pushed from the chat's header. */\n HISTORY: 'MainStack.History',\n /** The welcome, opened by Home on a phone's first launch. */\n WELCOME: 'MainStack.Welcome',\n} as const;\n"],"names":[],"mappings":"AASgB,SAAA,WAAA,CAAY,QAAgB,MAAmC,EAAA;AAC7E,EAAA,OAAO,CAAC,WAAa,EAAA;AAAA,IACnB,MAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH;AACO,MAAM,gBAAmB,GAAA;AAAA,EAC9B,IAAM,EAAA,uBAAA;AAAA,EAEN,MAAQ,EAAA,yBAAA;AAAA,EAER,UAAY,EAAA,6BAAA;AAAA,EAEZ,IAAM,EAAA,uBAAA;AAAA,EAEN,OAAS,EAAA,mBAAA;AAAA,EAET,OAAS,EAAA,mBAAA;AAAA,EAET,OAAS,EAAA;AACX"}
package/lib/content.js ADDED
@@ -0,0 +1,25 @@
1
+ const HERO_CHORES = [{
2
+ label: "Cancel my gym",
3
+ prompt: "Cancel my gym membership. They say I have to call or come in."
4
+ }, {
5
+ label: "Lower my internet bill",
6
+ prompt: "My internet bill went up. Call my provider and ask for a better rate."
7
+ }, {
8
+ label: "Plan dinners + a grocery list",
9
+ prompt: "Plan five easy dinners for this week and make me a grocery list."
10
+ }, {
11
+ label: "Book the dentist",
12
+ prompt: "Book a dentist appointment for my kids next week, after school."
13
+ }, {
14
+ label: "Get my flight refund",
15
+ prompt: "My flight was cancelled. Ask the airline for a refund instead of a voucher."
16
+ }, {
17
+ label: "Fight a bank fee",
18
+ prompt: "My bank charged me overdraft fees. Ask them to refund them."
19
+ }, {
20
+ label: "Return a package",
21
+ prompt: "Help me return an online order and get my money back."
22
+ }, {
23
+ label: "Track my bills",
24
+ prompt: "Track my household bills this month and remind me before each one is due."
25
+ }];export{HERO_CHORES};//# sourceMappingURL=content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sources":["../src/content.ts"],"sourcesContent":["/**\n * The same copy as the web Clockbook home (clockbook-home content.ts): keep the two in step.\n */\n/**\n * Everything the landing says, in one place. Chore `prompt`s are what the app receives pre-typed:\n * written the way a person would text them, never promising an outcome the business decides.\n *\n * Minutes are the deck's illustrative assumptions over the U.S. BLS American Time Use Survey 2025:\n * ~169 minutes a day of addressable life admin, ~38 of them handed back (~22%). Keep the footnote\n * wherever a number shows.\n */\n\nexport interface Chore {\n label: string;\n prompt: string;\n}\n\n/** Hero \"Try one\" buttons. */\nexport const HERO_CHORES: Chore[] = [\n { label: 'Cancel my gym', prompt: 'Cancel my gym membership. They say I have to call or come in.' },\n {\n label: 'Lower my internet bill',\n prompt: 'My internet bill went up. Call my provider and ask for a better rate.',\n },\n {\n label: 'Plan dinners + a grocery list',\n prompt: 'Plan five easy dinners for this week and make me a grocery list.',\n },\n { label: 'Book the dentist', prompt: 'Book a dentist appointment for my kids next week, after school.' },\n {\n label: 'Get my flight refund',\n prompt: 'My flight was cancelled. Ask the airline for a refund instead of a voucher.',\n },\n { label: 'Fight a bank fee', prompt: 'My bank charged me overdraft fees. Ask them to refund them.' },\n { label: 'Return a package', prompt: 'Help me return an online order and get my money back.' },\n { label: 'Track my bills', prompt: 'Track my household bills this month and remind me before each one is due.' },\n];\n\nexport interface Area {\n key: 'bills' | 'subscriptions' | 'groceries' | 'family' | 'home' | 'travel';\n title: string;\n blurb: string;\n chores: Chore[];\n}\n\n/** \"Every corner of home life\": each example is a button into the app. */\nexport const AREAS: Area[] = [\n {\n key: 'bills',\n title: 'Bills & money',\n blurb: 'Rates, fees and due dates, handled before they cost you.',\n chores: [\n {\n label: 'Lower a bill',\n prompt: 'Help me lower one of my household bills. Start with the one that went up most.',\n },\n { label: 'Dispute a charge', prompt: 'I was charged for something I did not order. Help me dispute it.' },\n { label: 'Remind me before bills are due', prompt: 'Remind me by text before each of my bills is due.' },\n ],\n },\n {\n key: 'subscriptions',\n title: 'Subscriptions',\n blurb: 'Cancel the ones that make you call. Find the ones you forgot.',\n chores: [\n {\n label: 'Cancel a subscription',\n prompt: 'Cancel a subscription for me. It says I have to call to cancel.',\n },\n {\n label: \"Find what I'm paying for\",\n prompt: 'Help me list every subscription I am paying for each month.',\n },\n { label: 'Pause a membership', prompt: 'Pause my membership for two months instead of cancelling it.' },\n ],\n },\n {\n key: 'groceries',\n title: 'Groceries & shopping',\n blurb: 'Meals planned, lists made, prices compared, returns sorted.',\n chores: [\n {\n label: \"Plan the week's meals\",\n prompt: 'Plan this week’s dinners for a family of four and make the grocery list.',\n },\n {\n label: 'Compare prices',\n prompt: 'Compare prices for the things on my shopping list and tell me where it is cheapest.',\n },\n { label: 'Return an order', prompt: 'Help me return an online order and get a refund.' },\n ],\n },\n {\n key: 'family',\n title: 'Family logistics',\n blurb: 'Appointments, forms and reminders for everyone at home.',\n chores: [\n {\n label: 'Book appointments',\n prompt: 'Book a doctor and a dentist appointment for my kids in the next two weeks.',\n },\n { label: 'Fill in a school form', prompt: 'Help me fill in a school form for my child.' },\n { label: 'Remind me by text', prompt: 'Text me reminders for this week’s school pickups and activities.' },\n ],\n },\n {\n key: 'home',\n title: 'Home & repairs',\n blurb: 'Find the right person, book the visit, chase the warranty.',\n chores: [\n { label: 'Find a plumber', prompt: 'Find a well-reviewed plumber near me who can come this week.' },\n { label: 'Book a cleaner', prompt: 'Book a home cleaner for this Saturday morning.' },\n {\n label: 'Claim a warranty',\n prompt: 'My appliance stopped working and is under warranty. Help me get it repaired or replaced.',\n },\n ],\n },\n {\n key: 'travel',\n title: 'Travel',\n blurb: 'Refunds, rebookings and cheaper fares without the hold music.',\n chores: [\n {\n label: 'Get a refund',\n prompt: 'My flight was cancelled. Get me a refund to my card instead of a voucher.',\n },\n { label: 'Rebook a flight', prompt: 'Rebook my cancelled flight on the next one with seats.' },\n { label: 'Find a cheaper fare', prompt: 'Find me a cheaper flight for my trip next month.' },\n ],\n },\n];\n\n/** Where the minutes come from (per day). Housework stays at zero on purpose: it is physical. */\nexport const MINUTES: { label: string; min: number; of: number; color: string }[] = [\n { label: 'Shopping', min: 17, of: 41, color: '#FFE4D2' },\n { label: 'Meals & groceries', min: 6, of: 43, color: '#FFC29C' },\n { label: 'Bills & paperwork', min: 6, of: 10, color: '#FFA36B' },\n { label: 'Calls, mail & email', min: 6, of: 11, color: '#FF8840' },\n { label: 'Family logistics', min: 3, of: 29, color: '#B53F00' },\n];\nexport const HOUSEWORK_MIN = 34;\n\nexport const STEPS: { title: string; body: string }[] = [\n { title: 'Text it', body: 'In iMessage, WhatsApp or the app. Say it the way you would tell a friend.' },\n {\n title: 'Clockbook handles it',\n body: 'Lucy makes the calls, works the forms, compares the prices and keeps track.',\n },\n {\n title: 'You approve what matters',\n body: 'Payments and account changes wait for your yes. When a company needs to hear from you, Lucy rings you in.',\n },\n];\n\nexport const FOOTNOTE =\n 'Illustrative estimate: about 38 of the roughly 169 minutes of daily life admin, based on the U.S. BLS American Time Use Survey 2025. Results vary by household.';\nexport const VIDEO_NOTE = 'Videos are dramatizations with AI voices and fictional companies.';\n\n/** \"Clockbook for business\": what the business site offers teams, each linking into it. */\nexport interface BusinessProduct {\n key: 'time' | 'hr' | 'books' | 'workflows';\n title: string;\n blurb: string;\n /** Path on the business site (see appLink.ts businessLink). */\n path: string;\n}\n\nexport const BUSINESS_PRODUCTS: BusinessProduct[] = [\n {\n key: 'time',\n title: 'Time tracking',\n blurb: 'One-click timers, projects and tasks, activity screenshots, and timesheets that stay in sync across the desktop bar and the browser.',\n path: '/products/time-tracker',\n },\n {\n key: 'hr',\n title: 'HR',\n blurb: 'Onboarding, attendance, time off and the paperwork of a growing team, with approvals that learn your decisions.',\n path: '/products/hrm',\n },\n {\n key: 'books',\n title: 'Books',\n blurb: 'Invoices, expenses, payroll and the complete financial toolkit for a growing business.',\n path: '/products/books',\n },\n {\n key: 'workflows',\n title: 'Workflows',\n blurb: 'Automate the back office with visual workflows and agents that flag what needs a human, with you always in control.',\n path: '/products/workflow',\n },\n];\n\n/**\n * The web home's header nav (clock-tik-browser pages/Home/HomePage.tsx `cbh-links`), in its order. Each one is a\n * section of the home: the web page jumps to `#<key>`, the app's drawer scrolls Home to it. \"For business\" follows\n * them there as a link out to the Yantra app (links.ts yantraAppUrl), as on the web.\n */\n/** Home's in-page anchors; `faq` is only reached from the footer. */\nexport type SectionKey = 'how' | 'calls' | 'imessage' | 'areas' | 'faq';\n\nexport const NAV_SECTIONS: { key: SectionKey; label: string }[] = [\n { key: 'how', label: 'How it works' },\n { key: 'calls', label: 'Lucy calls' },\n { key: 'imessage', label: 'iMessage' },\n { key: 'areas', label: 'What it handles' },\n];\n\nexport const BUSINESS_LINKS = {\n home: '',\n pricing: '/pricing',\n demo: '/demo',\n freelancers: '/freelancers',\n helpCenter: '/help-center',\n} as const;\n"],"names":[],"mappings":"AAkBO,MAAM,cAAuB,CAAC;AAAA,EACnC,KAAO,EAAA,eAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,KAAO,EAAA,wBAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,KAAO,EAAA,+BAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,KAAO,EAAA,kBAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,KAAO,EAAA,sBAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,KAAO,EAAA,kBAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,KAAO,EAAA,kBAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,KAAO,EAAA,gBAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAC"}
@@ -0,0 +1,39 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ function keyboardCover({
8
+ keyboard,
9
+ navBar = 0,
10
+ madeBySystem = 0
11
+ }) {
12
+ if (keyboard <= 0)
13
+ return 0;
14
+ return Math.max(0, Math.round(keyboard + navBar - Math.max(0, madeBySystem)));
15
+ }
16
+ function windowShrinksGuess(seen, insets) {
17
+ return seen != null ? seen : insets.top === 0 && insets.bottom === 0;
18
+ }
19
+ const JUST_BEFORE_MS = 250;
20
+ const SAME_HEIGHT = 2;
21
+ class RestHeight {
22
+ constructor() {
23
+ __publicField(this, "height", 0);
24
+ __publicField(this, "before", 0);
25
+ __publicField(this, "at", Number.NEGATIVE_INFINITY);
26
+ }
27
+ seen(height, at) {
28
+ if (height === this.height)
29
+ return;
30
+ this.before = this.height;
31
+ this.height = height;
32
+ this.at = at;
33
+ }
34
+ base(keyboard, at) {
35
+ const shrink = this.before - this.height;
36
+ const keyboardsOwn = at - this.at <= JUST_BEFORE_MS && Math.abs(shrink - keyboard) <= SAME_HEIGHT;
37
+ return keyboardsOwn ? this.before : this.height;
38
+ }
39
+ }export{RestHeight,keyboardCover,windowShrinksGuess};//# sourceMappingURL=keyboardCover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboardCover.js","sources":["../../src/hooks/keyboardCover.ts"],"sourcesContent":["/**\n * How much of a view that runs to the bottom of the screen the keyboard still covers, in points.\n *\n * Android does one of two things when the keyboard comes up. An app drawn edge to edge (Android 16, which no longer\n * lets an app opt out) keeps its full height and the keyboard lies over its bottom. An app that is not (Android 15\n * and older: Expo 53 leaves edge to edge off and the app asks for `resize`) has its window shrunk to end at the\n * keyboard: the system has made the room already. Padding by the whole keyboard on such a phone made the room twice\n * and pushed the chat's composer up under the header.\n */\nexport function keyboardCover({\n keyboard,\n navBar = 0,\n madeBySystem = 0,\n}: {\n /** The keyboard's height (0 while it is down). */\n keyboard: number;\n /** Android's navigation bar: the keyboard covers it too, but leaves it out of its height. */\n navBar?: number;\n /** How much the system shrank the view for the keyboard. */\n madeBySystem?: number;\n}): number {\n if (keyboard <= 0) return 0;\n return Math.max(0, Math.round(keyboard + navBar - Math.max(0, madeBySystem)));\n}\n\n/**\n * Before the view has been measured with the keyboard up: whether the window shrinks for it. What it did the last time\n * the keyboard came up decides; before that, whether the app is drawn under the system bars, as a window that is not\n * (no insets at all) is the one Android shrinks.\n */\nexport function windowShrinksGuess(seen: boolean | null, insets: { top: number; bottom: number }): boolean {\n return seen ?? (insets.top === 0 && insets.bottom === 0);\n}\n\n/** A layout this soon before the keyboard's event can be the window already shrinking for it. */\nconst JUST_BEFORE_MS = 250;\n/** Points of rounding between the keyboard's height and the shrink it causes. */\nconst SAME_HEIGHT = 2;\n\n/**\n * A view's height with the keyboard down, kept from its layouts, so the room the system made is that height less the\n * view's height with the keyboard up.\n *\n * The latest height counts, not the tallest: the first layouts of a screen can be taller for a moment (before the\n * status bar's inset arrives), and that was taken for 49 points of room the system never made. One exception: the\n * shrunk layout can arrive just before the keyboard's own event, so a shrink of exactly the keyboard's height a moment\n * before it is the keyboard's, and the height before it counts.\n */\nexport class RestHeight {\n private height = 0;\n\n private before = 0;\n\n private at = Number.NEGATIVE_INFINITY;\n\n /** A layout while the keyboard is down. */\n seen(height: number, at: number): void {\n if (height === this.height) return;\n this.before = this.height;\n this.height = height;\n this.at = at;\n }\n\n /** The height to count from when a keyboard of this height came up at `at`; 0 before any layout. */\n base(keyboard: number, at: number): number {\n const shrink = this.before - this.height;\n const keyboardsOwn = at - this.at <= JUST_BEFORE_MS && Math.abs(shrink - keyboard) <= SAME_HEIGH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;AAClC,IAAM,MAAA,YAAA,GAAe,KAAK,IAAK,CAAA,EAAA,IAAM,kBAAkB,IAAK,CAAA,GAAA,CAAI,MAAS,GAAA,QAAQ,CAAK,IAAA,WAAA;AACtF,IAAO,OAAA,YAAA,GAAe,IAAK,CAAA,MAAA,GAAS,IAAK,CAAA,MAAA;AAAA;AAE7C"}
@@ -0,0 +1,121 @@
1
+ import {useState,useRef,useCallback,useEffect}from'react';import {Platform,Keyboard,Dimensions}from'react-native';import {useSafeAreaInsets}from'react-native-safe-area-context';import {RestHeight,windowShrinksGuess,keyboardCover}from'./keyboardCover.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
+ const DOWN = {
21
+ shown: false,
22
+ height: 0,
23
+ top: null,
24
+ duration: 0
25
+ };
26
+ const KEYBOARD_SHOW = Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow";
27
+ const KEYBOARD_HIDE = Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide";
28
+ function useKeyboard() {
29
+ const [state, setState] = useState(DOWN);
30
+ const navBar = useSafeAreaInsets().bottom;
31
+ useEffect(() => {
32
+ const show = Keyboard.addListener(KEYBOARD_SHOW, (e) => {
33
+ var _a;
34
+ return setState({
35
+ shown: true,
36
+ height: e.endCoordinates.height,
37
+ top: Platform.OS === "android" ? Dimensions.get("screen").height - e.endCoordinates.height - navBar : e.endCoordinates.screenY,
38
+ duration: (_a = e.duration) != null ? _a : 0
39
+ });
40
+ });
41
+ const change = Platform.OS === "ios" ? Keyboard.addListener("keyboardWillChangeFrame", (e) => setState((prev) => {
42
+ var _a;
43
+ return prev.shown ? {
44
+ shown: true,
45
+ height: e.endCoordinates.height,
46
+ top: e.endCoordinates.screenY,
47
+ duration: (_a = e.duration) != null ? _a : 0
48
+ } : prev;
49
+ })) : null;
50
+ const hide = Keyboard.addListener(KEYBOARD_HIDE, (e) => {
51
+ var _a;
52
+ return setState(__spreadProps(__spreadValues({}, DOWN), {
53
+ duration: (_a = e == null ? void 0 : e.duration) != null ? _a : 0
54
+ }));
55
+ });
56
+ return () => {
57
+ show.remove();
58
+ change == null ? void 0 : change.remove();
59
+ hide.remove();
60
+ };
61
+ }, [navBar]);
62
+ return state;
63
+ }
64
+ let shrinksSeen = null;
65
+ function useKeyboardCover(view) {
66
+ const keyboard = useKeyboard();
67
+ const insets = useSafeAreaInsets();
68
+ const android = Platform.OS === "android";
69
+ const [measured, setMeasured] = useState(null);
70
+ const rest = useRef(new RestHeight());
71
+ const up = useRef(null);
72
+ const madeFrom = useCallback((height) => {
73
+ const shown = up.current;
74
+ if (!shown || height <= 0)
75
+ return;
76
+ const made2 = Math.max(0, rest.current.base(shown.keyboard, shown.at) - height);
77
+ shrinksSeen = made2 >= shown.keyboard / 2;
78
+ setMeasured(made2);
79
+ }, []);
80
+ const onLayout = useCallback((e) => {
81
+ const {
82
+ height
83
+ } = e.nativeEvent.layout;
84
+ if (up.current)
85
+ madeFrom(height);
86
+ else
87
+ rest.current.seen(height, Date.now());
88
+ }, [madeFrom]);
89
+ useEffect(() => {
90
+ if (!android)
91
+ return void 0;
92
+ const show = Keyboard.addListener(KEYBOARD_SHOW, (e) => {
93
+ var _a;
94
+ up.current = {
95
+ keyboard: e.endCoordinates.height,
96
+ at: Date.now()
97
+ };
98
+ setMeasured(null);
99
+ (_a = view.current) == null ? void 0 : _a.measure((_x, _y, _width, height) => madeFrom(height));
100
+ });
101
+ const hide = Keyboard.addListener(KEYBOARD_HIDE, () => {
102
+ up.current = null;
103
+ setMeasured(null);
104
+ });
105
+ return () => {
106
+ show.remove();
107
+ hide.remove();
108
+ };
109
+ }, [android, view, madeFrom]);
110
+ const made = measured != null ? measured : windowShrinksGuess(shrinksSeen, insets) ? keyboard.height : 0;
111
+ const covers = keyboardCover({
112
+ keyboard: keyboard.shown ? keyboard.height : 0,
113
+ navBar: android ? insets.bottom : 0,
114
+ madeBySystem: android ? made : 0
115
+ });
116
+ return {
117
+ keyboard,
118
+ covers,
119
+ onLayout
120
+ };
121
+ }export{KEYBOARD_HIDE,KEYBOARD_SHOW,useKeyboard,useKeyboardCover};//# sourceMappingURL=useKeyboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyboard.js","sources":["../../src/hooks/useKeyboard.ts"],"sourcesContent":["/**\n * Where the on-screen keyboard is. iOS says so as it starts to move (`keyboardWill…`), Android only once it has\n * (`keyboardDid…`: it sends no \"will\" events).\n *\n * Each screen makes its own room, with `useKeyboardCover`: on Android the system sometimes has made it already (see\n * `keyboardCover`).\n */\nimport { useCallback, useEffect, useRef, useState, type RefObject } from 'react';\nimport { Dimensions, Keyboard, Platform, type KeyboardEvent, type LayoutChangeEvent, type View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { keyboardCover, RestHeight, windowShrinksGuess } from './keyboardCover';\n\nexport interface KeyboardState {\n /** The keyboard is up. */\n shown: boolean;\n /** How tall it is, in points; 0 when it is down. */\n height: number;\n /** Where its top edge sits on the screen, in points; null when it is down. */\n top: number | null;\n /** How long it takes to move (iOS; 0 on Android). */\n duration: number;\n}\n\nconst DOWN: KeyboardState = { shown: false, height: 0, top: null, duration: 0 };\n\nexport const KEYBOARD_SHOW = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';\nexport const KEYBOARD_HIDE = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';\n\nexport function useKeyboard(): KeyboardState {\n const [state, setState] = useState<KeyboardState>(DOWN);\n // Android leaves the navigation bar out of the keyboard's height and puts its top that much too low: the keyboard\n // also covers the bar, so its real top is the screen's bottom less both.\n const navBar = useSafeAreaInsets().bottom;\n useEffect(() => {\n const show = Keyboard.addListener(KEYBOARD_SHOW, (e: KeyboardEvent) =>\n setState({\n shown: true,\n height: e.endCoordinates.height,\n top:\n Platform.OS === 'android'\n ? Dimensions.get('screen').height - e.endCoordinates.height - navBar\n : e.endCoordinates.screenY,\n duration: e.duration ?? 0,\n }),\n );\n // iOS also moves it without hiding (another keyboard, the suggestion bar): keep up with that.\n const change =\n Platform.OS === 'ios'\n ? Keyboard.addListener('keyboardWillChangeFrame', (e: KeyboardEvent) =>\n setState((prev) =>\n prev.shown\n ? {\n shown: true,\n height: e.endCoordinates.height,\n top: e.endCoordinates.screenY,\n duration: e.duration ?? 0,\n }\n : prev,\n ),\n )\n : null;\n const hide = Keyboard.addListener(KEYBOARD_HIDE, (e: KeyboardEvent) =>\n setState({ ...DOWN, duration: e?.duration ?? 0 }),\n );\n return () => {\n show.remove();\n change?.remove();\n hide.remove();\n };\n }, [navBar]);\n return state;\n}\n\n/** Whether this app's window shrinks for the keyboard, once a keyboard has shown it (one answer for the whole app). */\nlet shrinksSeen: boolean | null = null;\n\n/**\n * How much of one view the keyboard covers, in points (0 while it is down), for a view that runs to the bottom of the\n * screen: pad or scroll by `covers`. `view` is that view, and `onLayout` goes on it. Some Android phones shrink the\n * window for the keyboard and some do not; the view's own height says which, and only what the system has not made\n * room for counts (iOS never shrinks it).\n */\nexport function useKeyboardCover(view: RefObject<View | null>): {\n keyboard: KeyboardState;\n covers: number;\n onLayout: (e: LayoutChangeEvent) => void;\n} {\n const keyboard = useKeyboard();\n const insets = useSafeAreaInsets();\n const android = Platform.OS === 'android';\n // How much the system shrank the view for the keyboard now up, once measured.\n const [measured, setMeasured] = useState<number | null>(null);\n const rest = useRef(new RestHeight());\n const up = useRef<{ keyboard: number; at: number } | null>(null);\n const madeFrom = useCallback((height: number) => {\n const shown = up.current;\n if (!shown || height <= 0) return;\n const made = Math.max(0, rest.current.base(shown.keyboard, shown.at) - height);\n shrinksSeen = made >= shown.keyboard / 2;\n setMeasured(made);\n }, []);\n const onLayout = useCallback(\n (e: LayoutChangeEvent) => {\n const { height } = e.nativeEvent.layout;\n if (up.current) madeFrom(height);\n else rest.current.seen(height, Date.now());\n },\n [madeFrom],\n );\n useEffect(() => {\n if (!android) return undefined;\n const show = Keyboard.addListener(KEYBOARD_SHOW, (e: KeyboardEvent) => {\n up.current = { keyboard: e.endCoordinates.height, at: Date.now() };\n setMeasured(null);\n view.current?.measure((_x, _y, _width, height) => madeFrom(height));\n });\n const hide = Keyboard.addListener(KEYBOARD_HIDE, () => {\n up.current = null;\n setMeasured(null);\n });\n return () => {\n show.remove();\n hide.remove();\n };\n }, [android, view, madeFrom]);\n // The view's new height reaches JS a few frames after the keyboard's event; until it does, the room goes by what\n // the window did before (or by the system bars), so the composer does not jump up under the header meanwhile.\n const made = measured ?? (windowShrinksGuess(shrinksSeen, insets) ? keyboard.height : 0);\n const covers = keyboardCover({\n keyboard: keyboard.shown ? keyboard.height : 0,\n navBar: android ? insets.bottom : 0,\n madeBySystem: android ? made : 0,\n });\n return { keyboard, covers, onLayout };\n}\n"],"names":["made"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAM,IAAsB,GAAA;AAAA,EAC1B,KAAO,EAAA,KAAA;AAAA,EACP,MAAQ,EAAA,CAAA;AAAA,EACR,GAAK,EAAA,IAAA;AAAA,EACL,QAAU,EAAA;AACZ,CAAA;AACO,MAAM,aAAgB,GAAA,QAAA,CAAS,EAAO,KAAA,KAAA,GAAQ,kBAA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