@repzo/widget-react-native 1.0.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 (448) hide show
  1. package/README.md +482 -0
  2. package/lib/commonjs/agent-ui-blocks.js +159 -0
  3. package/lib/commonjs/agent-ui-blocks.js.map +1 -0
  4. package/lib/commonjs/api/client.js +267 -0
  5. package/lib/commonjs/api/client.js.map +1 -0
  6. package/lib/commonjs/api/realtime.js +193 -0
  7. package/lib/commonjs/api/realtime.js.map +1 -0
  8. package/lib/commonjs/api/sse-parser.js +58 -0
  9. package/lib/commonjs/api/sse-parser.js.map +1 -0
  10. package/lib/commonjs/controller.js +23 -0
  11. package/lib/commonjs/controller.js.map +1 -0
  12. package/lib/commonjs/device-id.js +75 -0
  13. package/lib/commonjs/device-id.js.map +1 -0
  14. package/lib/commonjs/events.js +49 -0
  15. package/lib/commonjs/events.js.map +1 -0
  16. package/lib/commonjs/i18n.js +106 -0
  17. package/lib/commonjs/i18n.js.map +1 -0
  18. package/lib/commonjs/index.js +98 -0
  19. package/lib/commonjs/index.js.map +1 -0
  20. package/lib/commonjs/locales.js +85 -0
  21. package/lib/commonjs/locales.js.map +1 -0
  22. package/lib/commonjs/package.json +1 -0
  23. package/lib/commonjs/push/push-notifications.js +208 -0
  24. package/lib/commonjs/push/push-notifications.js.map +1 -0
  25. package/lib/commonjs/state/use-widget-state.js +23 -0
  26. package/lib/commonjs/state/use-widget-state.js.map +1 -0
  27. package/lib/commonjs/state/widget-store.js +1682 -0
  28. package/lib/commonjs/state/widget-store.js.map +1 -0
  29. package/lib/commonjs/storage.js +147 -0
  30. package/lib/commonjs/storage.js.map +1 -0
  31. package/lib/commonjs/types.js +44 -0
  32. package/lib/commonjs/types.js.map +1 -0
  33. package/lib/commonjs/ui/WidgetProvider.js +404 -0
  34. package/lib/commonjs/ui/WidgetProvider.js.map +1 -0
  35. package/lib/commonjs/ui/components/AgentUiBlocks.js +864 -0
  36. package/lib/commonjs/ui/components/AgentUiBlocks.js.map +1 -0
  37. package/lib/commonjs/ui/components/Avatar.js +76 -0
  38. package/lib/commonjs/ui/components/Avatar.js.map +1 -0
  39. package/lib/commonjs/ui/components/ConversationRow.js +155 -0
  40. package/lib/commonjs/ui/components/ConversationRow.js.map +1 -0
  41. package/lib/commonjs/ui/components/ErrorBoundary.js +44 -0
  42. package/lib/commonjs/ui/components/ErrorBoundary.js.map +1 -0
  43. package/lib/commonjs/ui/components/Gradient.js +168 -0
  44. package/lib/commonjs/ui/components/Gradient.js.map +1 -0
  45. package/lib/commonjs/ui/components/Launcher.js +125 -0
  46. package/lib/commonjs/ui/components/Launcher.js.map +1 -0
  47. package/lib/commonjs/ui/components/Markdown.js +257 -0
  48. package/lib/commonjs/ui/components/Markdown.js.map +1 -0
  49. package/lib/commonjs/ui/components/OutboundMessageCard.js +157 -0
  50. package/lib/commonjs/ui/components/OutboundMessageCard.js.map +1 -0
  51. package/lib/commonjs/ui/components/WidgetPanel.js +131 -0
  52. package/lib/commonjs/ui/components/WidgetPanel.js.map +1 -0
  53. package/lib/commonjs/ui/components/icons.js +383 -0
  54. package/lib/commonjs/ui/components/icons.js.map +1 -0
  55. package/lib/commonjs/ui/hooks/use-keyboard-overlap.js +113 -0
  56. package/lib/commonjs/ui/hooks/use-keyboard-overlap.js.map +1 -0
  57. package/lib/commonjs/ui/hooks/use-reduce-motion.js +38 -0
  58. package/lib/commonjs/ui/hooks/use-reduce-motion.js.map +1 -0
  59. package/lib/commonjs/ui/hooks/use-widget-insets.js +41 -0
  60. package/lib/commonjs/ui/hooks/use-widget-insets.js.map +1 -0
  61. package/lib/commonjs/ui/screens/chat/ChatView.js +590 -0
  62. package/lib/commonjs/ui/screens/chat/ChatView.js.map +1 -0
  63. package/lib/commonjs/ui/screens/chat/ChatView.styles.js +362 -0
  64. package/lib/commonjs/ui/screens/chat/ChatView.styles.js.map +1 -0
  65. package/lib/commonjs/ui/screens/chat/ChatView.types.js +6 -0
  66. package/lib/commonjs/ui/screens/chat/ChatView.types.js.map +1 -0
  67. package/lib/commonjs/ui/screens/conversations/ConversationsList.js +150 -0
  68. package/lib/commonjs/ui/screens/conversations/ConversationsList.js.map +1 -0
  69. package/lib/commonjs/ui/screens/conversations/ConversationsList.styles.js +118 -0
  70. package/lib/commonjs/ui/screens/conversations/ConversationsList.styles.js.map +1 -0
  71. package/lib/commonjs/ui/screens/conversations/ConversationsList.types.js +6 -0
  72. package/lib/commonjs/ui/screens/conversations/ConversationsList.types.js.map +1 -0
  73. package/lib/commonjs/ui/screens/home/HomeView.js +336 -0
  74. package/lib/commonjs/ui/screens/home/HomeView.js.map +1 -0
  75. package/lib/commonjs/ui/screens/home/HomeView.styles.js +245 -0
  76. package/lib/commonjs/ui/screens/home/HomeView.styles.js.map +1 -0
  77. package/lib/commonjs/ui/screens/home/HomeView.types.js +6 -0
  78. package/lib/commonjs/ui/screens/home/HomeView.types.js.map +1 -0
  79. package/lib/commonjs/ui/screens/home/greeting.js +49 -0
  80. package/lib/commonjs/ui/screens/home/greeting.js.map +1 -0
  81. package/lib/commonjs/ui/screens/pre-chat/PreChatForm.js +229 -0
  82. package/lib/commonjs/ui/screens/pre-chat/PreChatForm.js.map +1 -0
  83. package/lib/commonjs/ui/screens/pre-chat/PreChatForm.styles.js +125 -0
  84. package/lib/commonjs/ui/screens/pre-chat/PreChatForm.styles.js.map +1 -0
  85. package/lib/commonjs/ui/screens/pre-chat/PreChatForm.types.js +6 -0
  86. package/lib/commonjs/ui/screens/pre-chat/PreChatForm.types.js.map +1 -0
  87. package/lib/commonjs/ui/styles/global.js +55 -0
  88. package/lib/commonjs/ui/styles/global.js.map +1 -0
  89. package/lib/commonjs/ui/styles/theme.js +148 -0
  90. package/lib/commonjs/ui/styles/theme.js.map +1 -0
  91. package/lib/commonjs/ui/utils/conversations.js +125 -0
  92. package/lib/commonjs/ui/utils/conversations.js.map +1 -0
  93. package/lib/commonjs/ui/utils/html.js +44 -0
  94. package/lib/commonjs/ui/utils/html.js.map +1 -0
  95. package/lib/commonjs/ui/utils/native-gradient.js +65 -0
  96. package/lib/commonjs/ui/utils/native-gradient.js.map +1 -0
  97. package/lib/commonjs/ui/utils/rtl.js +56 -0
  98. package/lib/commonjs/ui/utils/rtl.js.map +1 -0
  99. package/lib/commonjs/ui/utils/safe-url.js +67 -0
  100. package/lib/commonjs/ui/utils/safe-url.js.map +1 -0
  101. package/lib/module/agent-ui-blocks.js +152 -0
  102. package/lib/module/agent-ui-blocks.js.map +1 -0
  103. package/lib/module/api/client.js +261 -0
  104. package/lib/module/api/client.js.map +1 -0
  105. package/lib/module/api/realtime.js +189 -0
  106. package/lib/module/api/realtime.js.map +1 -0
  107. package/lib/module/api/sse-parser.js +53 -0
  108. package/lib/module/api/sse-parser.js.map +1 -0
  109. package/lib/module/controller.js +19 -0
  110. package/lib/module/controller.js.map +1 -0
  111. package/lib/module/device-id.js +69 -0
  112. package/lib/module/device-id.js.map +1 -0
  113. package/lib/module/events.js +44 -0
  114. package/lib/module/events.js.map +1 -0
  115. package/lib/module/i18n.js +99 -0
  116. package/lib/module/i18n.js.map +1 -0
  117. package/lib/module/index.js +55 -0
  118. package/lib/module/index.js.map +1 -0
  119. package/lib/module/locales.js +80 -0
  120. package/lib/module/locales.js.map +1 -0
  121. package/lib/module/package.json +1 -0
  122. package/lib/module/push/push-notifications.js +204 -0
  123. package/lib/module/push/push-notifications.js.map +1 -0
  124. package/lib/module/state/use-widget-state.js +18 -0
  125. package/lib/module/state/use-widget-state.js.map +1 -0
  126. package/lib/module/state/widget-store.js +1677 -0
  127. package/lib/module/state/widget-store.js.map +1 -0
  128. package/lib/module/storage.js +141 -0
  129. package/lib/module/storage.js.map +1 -0
  130. package/lib/module/types.js +40 -0
  131. package/lib/module/types.js.map +1 -0
  132. package/lib/module/ui/WidgetProvider.js +400 -0
  133. package/lib/module/ui/WidgetProvider.js.map +1 -0
  134. package/lib/module/ui/components/AgentUiBlocks.js +857 -0
  135. package/lib/module/ui/components/AgentUiBlocks.js.map +1 -0
  136. package/lib/module/ui/components/Avatar.js +71 -0
  137. package/lib/module/ui/components/Avatar.js.map +1 -0
  138. package/lib/module/ui/components/ConversationRow.js +150 -0
  139. package/lib/module/ui/components/ConversationRow.js.map +1 -0
  140. package/lib/module/ui/components/ErrorBoundary.js +39 -0
  141. package/lib/module/ui/components/ErrorBoundary.js.map +1 -0
  142. package/lib/module/ui/components/Gradient.js +165 -0
  143. package/lib/module/ui/components/Gradient.js.map +1 -0
  144. package/lib/module/ui/components/Launcher.js +121 -0
  145. package/lib/module/ui/components/Launcher.js.map +1 -0
  146. package/lib/module/ui/components/Markdown.js +253 -0
  147. package/lib/module/ui/components/Markdown.js.map +1 -0
  148. package/lib/module/ui/components/OutboundMessageCard.js +153 -0
  149. package/lib/module/ui/components/OutboundMessageCard.js.map +1 -0
  150. package/lib/module/ui/components/WidgetPanel.js +127 -0
  151. package/lib/module/ui/components/WidgetPanel.js.map +1 -0
  152. package/lib/module/ui/components/icons.js +370 -0
  153. package/lib/module/ui/components/icons.js.map +1 -0
  154. package/lib/module/ui/hooks/use-keyboard-overlap.js +109 -0
  155. package/lib/module/ui/hooks/use-keyboard-overlap.js.map +1 -0
  156. package/lib/module/ui/hooks/use-reduce-motion.js +34 -0
  157. package/lib/module/ui/hooks/use-reduce-motion.js.map +1 -0
  158. package/lib/module/ui/hooks/use-widget-insets.js +37 -0
  159. package/lib/module/ui/hooks/use-widget-insets.js.map +1 -0
  160. package/lib/module/ui/screens/chat/ChatView.js +586 -0
  161. package/lib/module/ui/screens/chat/ChatView.js.map +1 -0
  162. package/lib/module/ui/screens/chat/ChatView.styles.js +358 -0
  163. package/lib/module/ui/screens/chat/ChatView.styles.js.map +1 -0
  164. package/lib/module/ui/screens/chat/ChatView.types.js +4 -0
  165. package/lib/module/ui/screens/chat/ChatView.types.js.map +1 -0
  166. package/lib/module/ui/screens/conversations/ConversationsList.js +146 -0
  167. package/lib/module/ui/screens/conversations/ConversationsList.js.map +1 -0
  168. package/lib/module/ui/screens/conversations/ConversationsList.styles.js +114 -0
  169. package/lib/module/ui/screens/conversations/ConversationsList.styles.js.map +1 -0
  170. package/lib/module/ui/screens/conversations/ConversationsList.types.js +4 -0
  171. package/lib/module/ui/screens/conversations/ConversationsList.types.js.map +1 -0
  172. package/lib/module/ui/screens/home/HomeView.js +332 -0
  173. package/lib/module/ui/screens/home/HomeView.js.map +1 -0
  174. package/lib/module/ui/screens/home/HomeView.styles.js +242 -0
  175. package/lib/module/ui/screens/home/HomeView.styles.js.map +1 -0
  176. package/lib/module/ui/screens/home/HomeView.types.js +4 -0
  177. package/lib/module/ui/screens/home/HomeView.types.js.map +1 -0
  178. package/lib/module/ui/screens/home/greeting.js +44 -0
  179. package/lib/module/ui/screens/home/greeting.js.map +1 -0
  180. package/lib/module/ui/screens/pre-chat/PreChatForm.js +225 -0
  181. package/lib/module/ui/screens/pre-chat/PreChatForm.js.map +1 -0
  182. package/lib/module/ui/screens/pre-chat/PreChatForm.styles.js +121 -0
  183. package/lib/module/ui/screens/pre-chat/PreChatForm.styles.js.map +1 -0
  184. package/lib/module/ui/screens/pre-chat/PreChatForm.types.js +4 -0
  185. package/lib/module/ui/screens/pre-chat/PreChatForm.types.js.map +1 -0
  186. package/lib/module/ui/styles/global.js +51 -0
  187. package/lib/module/ui/styles/global.js.map +1 -0
  188. package/lib/module/ui/styles/theme.js +137 -0
  189. package/lib/module/ui/styles/theme.js.map +1 -0
  190. package/lib/module/ui/utils/conversations.js +115 -0
  191. package/lib/module/ui/utils/conversations.js.map +1 -0
  192. package/lib/module/ui/utils/html.js +39 -0
  193. package/lib/module/ui/utils/html.js.map +1 -0
  194. package/lib/module/ui/utils/native-gradient.js +60 -0
  195. package/lib/module/ui/utils/native-gradient.js.map +1 -0
  196. package/lib/module/ui/utils/rtl.js +49 -0
  197. package/lib/module/ui/utils/rtl.js.map +1 -0
  198. package/lib/module/ui/utils/safe-url.js +59 -0
  199. package/lib/module/ui/utils/safe-url.js.map +1 -0
  200. package/lib/typescript/commonjs/agent-ui-blocks.d.ts +20 -0
  201. package/lib/typescript/commonjs/agent-ui-blocks.d.ts.map +1 -0
  202. package/lib/typescript/commonjs/api/client.d.ts +115 -0
  203. package/lib/typescript/commonjs/api/client.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/api/realtime.d.ts +39 -0
  205. package/lib/typescript/commonjs/api/realtime.d.ts.map +1 -0
  206. package/lib/typescript/commonjs/api/sse-parser.d.ts +13 -0
  207. package/lib/typescript/commonjs/api/sse-parser.d.ts.map +1 -0
  208. package/lib/typescript/commonjs/controller.d.ts +15 -0
  209. package/lib/typescript/commonjs/controller.d.ts.map +1 -0
  210. package/lib/typescript/commonjs/device-id.d.ts +15 -0
  211. package/lib/typescript/commonjs/device-id.d.ts.map +1 -0
  212. package/lib/typescript/commonjs/events.d.ts +41 -0
  213. package/lib/typescript/commonjs/events.d.ts.map +1 -0
  214. package/lib/typescript/commonjs/i18n.d.ts +78 -0
  215. package/lib/typescript/commonjs/i18n.d.ts.map +1 -0
  216. package/lib/typescript/commonjs/index.d.ts +103 -0
  217. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  218. package/lib/typescript/commonjs/locales.d.ts +18 -0
  219. package/lib/typescript/commonjs/locales.d.ts.map +1 -0
  220. package/lib/typescript/commonjs/package.json +1 -0
  221. package/lib/typescript/commonjs/push/push-notifications.d.ts +71 -0
  222. package/lib/typescript/commonjs/push/push-notifications.d.ts.map +1 -0
  223. package/lib/typescript/commonjs/state/use-widget-state.d.ts +10 -0
  224. package/lib/typescript/commonjs/state/use-widget-state.d.ts.map +1 -0
  225. package/lib/typescript/commonjs/state/widget-store.d.ts +227 -0
  226. package/lib/typescript/commonjs/state/widget-store.d.ts.map +1 -0
  227. package/lib/typescript/commonjs/storage.d.ts +42 -0
  228. package/lib/typescript/commonjs/storage.d.ts.map +1 -0
  229. package/lib/typescript/commonjs/types.d.ts +391 -0
  230. package/lib/typescript/commonjs/types.d.ts.map +1 -0
  231. package/lib/typescript/commonjs/ui/WidgetProvider.d.ts +15 -0
  232. package/lib/typescript/commonjs/ui/WidgetProvider.d.ts.map +1 -0
  233. package/lib/typescript/commonjs/ui/components/AgentUiBlocks.d.ts +27 -0
  234. package/lib/typescript/commonjs/ui/components/AgentUiBlocks.d.ts.map +1 -0
  235. package/lib/typescript/commonjs/ui/components/Avatar.d.ts +19 -0
  236. package/lib/typescript/commonjs/ui/components/Avatar.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/ui/components/ConversationRow.d.ts +26 -0
  238. package/lib/typescript/commonjs/ui/components/ConversationRow.d.ts.map +1 -0
  239. package/lib/typescript/commonjs/ui/components/ErrorBoundary.d.ts +27 -0
  240. package/lib/typescript/commonjs/ui/components/ErrorBoundary.d.ts.map +1 -0
  241. package/lib/typescript/commonjs/ui/components/Gradient.d.ts +33 -0
  242. package/lib/typescript/commonjs/ui/components/Gradient.d.ts.map +1 -0
  243. package/lib/typescript/commonjs/ui/components/Launcher.d.ts +18 -0
  244. package/lib/typescript/commonjs/ui/components/Launcher.d.ts.map +1 -0
  245. package/lib/typescript/commonjs/ui/components/Markdown.d.ts +19 -0
  246. package/lib/typescript/commonjs/ui/components/Markdown.d.ts.map +1 -0
  247. package/lib/typescript/commonjs/ui/components/OutboundMessageCard.d.ts +20 -0
  248. package/lib/typescript/commonjs/ui/components/OutboundMessageCard.d.ts.map +1 -0
  249. package/lib/typescript/commonjs/ui/components/WidgetPanel.d.ts +26 -0
  250. package/lib/typescript/commonjs/ui/components/WidgetPanel.d.ts.map +1 -0
  251. package/lib/typescript/commonjs/ui/components/icons.d.ts +38 -0
  252. package/lib/typescript/commonjs/ui/components/icons.d.ts.map +1 -0
  253. package/lib/typescript/commonjs/ui/hooks/use-keyboard-overlap.d.ts +33 -0
  254. package/lib/typescript/commonjs/ui/hooks/use-keyboard-overlap.d.ts.map +1 -0
  255. package/lib/typescript/commonjs/ui/hooks/use-reduce-motion.d.ts +11 -0
  256. package/lib/typescript/commonjs/ui/hooks/use-reduce-motion.d.ts.map +1 -0
  257. package/lib/typescript/commonjs/ui/hooks/use-widget-insets.d.ts +16 -0
  258. package/lib/typescript/commonjs/ui/hooks/use-widget-insets.d.ts.map +1 -0
  259. package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts +11 -0
  260. package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts.map +1 -0
  261. package/lib/typescript/commonjs/ui/screens/chat/ChatView.styles.d.ts +349 -0
  262. package/lib/typescript/commonjs/ui/screens/chat/ChatView.styles.d.ts.map +1 -0
  263. package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts +48 -0
  264. package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts.map +1 -0
  265. package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.d.ts +10 -0
  266. package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.d.ts.map +1 -0
  267. package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.styles.d.ts +113 -0
  268. package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.styles.d.ts.map +1 -0
  269. package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.types.d.ts +31 -0
  270. package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.types.d.ts.map +1 -0
  271. package/lib/typescript/commonjs/ui/screens/home/HomeView.d.ts +17 -0
  272. package/lib/typescript/commonjs/ui/screens/home/HomeView.d.ts.map +1 -0
  273. package/lib/typescript/commonjs/ui/screens/home/HomeView.styles.d.ts +227 -0
  274. package/lib/typescript/commonjs/ui/screens/home/HomeView.styles.d.ts.map +1 -0
  275. package/lib/typescript/commonjs/ui/screens/home/HomeView.types.d.ts +40 -0
  276. package/lib/typescript/commonjs/ui/screens/home/HomeView.types.d.ts.map +1 -0
  277. package/lib/typescript/commonjs/ui/screens/home/greeting.d.ts +19 -0
  278. package/lib/typescript/commonjs/ui/screens/home/greeting.d.ts.map +1 -0
  279. package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.d.ts +7 -0
  280. package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.d.ts.map +1 -0
  281. package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.styles.d.ts +115 -0
  282. package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.styles.d.ts.map +1 -0
  283. package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.types.d.ts +20 -0
  284. package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.types.d.ts.map +1 -0
  285. package/lib/typescript/commonjs/ui/styles/global.d.ts +46 -0
  286. package/lib/typescript/commonjs/ui/styles/global.d.ts.map +1 -0
  287. package/lib/typescript/commonjs/ui/styles/theme.d.ts +103 -0
  288. package/lib/typescript/commonjs/ui/styles/theme.d.ts.map +1 -0
  289. package/lib/typescript/commonjs/ui/utils/conversations.d.ts +41 -0
  290. package/lib/typescript/commonjs/ui/utils/conversations.d.ts.map +1 -0
  291. package/lib/typescript/commonjs/ui/utils/html.d.ts +10 -0
  292. package/lib/typescript/commonjs/ui/utils/html.d.ts.map +1 -0
  293. package/lib/typescript/commonjs/ui/utils/native-gradient.d.ts +61 -0
  294. package/lib/typescript/commonjs/ui/utils/native-gradient.d.ts.map +1 -0
  295. package/lib/typescript/commonjs/ui/utils/rtl.d.ts +33 -0
  296. package/lib/typescript/commonjs/ui/utils/rtl.d.ts.map +1 -0
  297. package/lib/typescript/commonjs/ui/utils/safe-url.d.ts +21 -0
  298. package/lib/typescript/commonjs/ui/utils/safe-url.d.ts.map +1 -0
  299. package/lib/typescript/module/agent-ui-blocks.d.ts +20 -0
  300. package/lib/typescript/module/agent-ui-blocks.d.ts.map +1 -0
  301. package/lib/typescript/module/api/client.d.ts +115 -0
  302. package/lib/typescript/module/api/client.d.ts.map +1 -0
  303. package/lib/typescript/module/api/realtime.d.ts +39 -0
  304. package/lib/typescript/module/api/realtime.d.ts.map +1 -0
  305. package/lib/typescript/module/api/sse-parser.d.ts +13 -0
  306. package/lib/typescript/module/api/sse-parser.d.ts.map +1 -0
  307. package/lib/typescript/module/controller.d.ts +15 -0
  308. package/lib/typescript/module/controller.d.ts.map +1 -0
  309. package/lib/typescript/module/device-id.d.ts +15 -0
  310. package/lib/typescript/module/device-id.d.ts.map +1 -0
  311. package/lib/typescript/module/events.d.ts +41 -0
  312. package/lib/typescript/module/events.d.ts.map +1 -0
  313. package/lib/typescript/module/i18n.d.ts +78 -0
  314. package/lib/typescript/module/i18n.d.ts.map +1 -0
  315. package/lib/typescript/module/index.d.ts +103 -0
  316. package/lib/typescript/module/index.d.ts.map +1 -0
  317. package/lib/typescript/module/locales.d.ts +18 -0
  318. package/lib/typescript/module/locales.d.ts.map +1 -0
  319. package/lib/typescript/module/package.json +1 -0
  320. package/lib/typescript/module/push/push-notifications.d.ts +71 -0
  321. package/lib/typescript/module/push/push-notifications.d.ts.map +1 -0
  322. package/lib/typescript/module/state/use-widget-state.d.ts +10 -0
  323. package/lib/typescript/module/state/use-widget-state.d.ts.map +1 -0
  324. package/lib/typescript/module/state/widget-store.d.ts +227 -0
  325. package/lib/typescript/module/state/widget-store.d.ts.map +1 -0
  326. package/lib/typescript/module/storage.d.ts +42 -0
  327. package/lib/typescript/module/storage.d.ts.map +1 -0
  328. package/lib/typescript/module/types.d.ts +391 -0
  329. package/lib/typescript/module/types.d.ts.map +1 -0
  330. package/lib/typescript/module/ui/WidgetProvider.d.ts +15 -0
  331. package/lib/typescript/module/ui/WidgetProvider.d.ts.map +1 -0
  332. package/lib/typescript/module/ui/components/AgentUiBlocks.d.ts +27 -0
  333. package/lib/typescript/module/ui/components/AgentUiBlocks.d.ts.map +1 -0
  334. package/lib/typescript/module/ui/components/Avatar.d.ts +19 -0
  335. package/lib/typescript/module/ui/components/Avatar.d.ts.map +1 -0
  336. package/lib/typescript/module/ui/components/ConversationRow.d.ts +26 -0
  337. package/lib/typescript/module/ui/components/ConversationRow.d.ts.map +1 -0
  338. package/lib/typescript/module/ui/components/ErrorBoundary.d.ts +27 -0
  339. package/lib/typescript/module/ui/components/ErrorBoundary.d.ts.map +1 -0
  340. package/lib/typescript/module/ui/components/Gradient.d.ts +33 -0
  341. package/lib/typescript/module/ui/components/Gradient.d.ts.map +1 -0
  342. package/lib/typescript/module/ui/components/Launcher.d.ts +18 -0
  343. package/lib/typescript/module/ui/components/Launcher.d.ts.map +1 -0
  344. package/lib/typescript/module/ui/components/Markdown.d.ts +19 -0
  345. package/lib/typescript/module/ui/components/Markdown.d.ts.map +1 -0
  346. package/lib/typescript/module/ui/components/OutboundMessageCard.d.ts +20 -0
  347. package/lib/typescript/module/ui/components/OutboundMessageCard.d.ts.map +1 -0
  348. package/lib/typescript/module/ui/components/WidgetPanel.d.ts +26 -0
  349. package/lib/typescript/module/ui/components/WidgetPanel.d.ts.map +1 -0
  350. package/lib/typescript/module/ui/components/icons.d.ts +38 -0
  351. package/lib/typescript/module/ui/components/icons.d.ts.map +1 -0
  352. package/lib/typescript/module/ui/hooks/use-keyboard-overlap.d.ts +33 -0
  353. package/lib/typescript/module/ui/hooks/use-keyboard-overlap.d.ts.map +1 -0
  354. package/lib/typescript/module/ui/hooks/use-reduce-motion.d.ts +11 -0
  355. package/lib/typescript/module/ui/hooks/use-reduce-motion.d.ts.map +1 -0
  356. package/lib/typescript/module/ui/hooks/use-widget-insets.d.ts +16 -0
  357. package/lib/typescript/module/ui/hooks/use-widget-insets.d.ts.map +1 -0
  358. package/lib/typescript/module/ui/screens/chat/ChatView.d.ts +11 -0
  359. package/lib/typescript/module/ui/screens/chat/ChatView.d.ts.map +1 -0
  360. package/lib/typescript/module/ui/screens/chat/ChatView.styles.d.ts +349 -0
  361. package/lib/typescript/module/ui/screens/chat/ChatView.styles.d.ts.map +1 -0
  362. package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts +48 -0
  363. package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts.map +1 -0
  364. package/lib/typescript/module/ui/screens/conversations/ConversationsList.d.ts +10 -0
  365. package/lib/typescript/module/ui/screens/conversations/ConversationsList.d.ts.map +1 -0
  366. package/lib/typescript/module/ui/screens/conversations/ConversationsList.styles.d.ts +113 -0
  367. package/lib/typescript/module/ui/screens/conversations/ConversationsList.styles.d.ts.map +1 -0
  368. package/lib/typescript/module/ui/screens/conversations/ConversationsList.types.d.ts +31 -0
  369. package/lib/typescript/module/ui/screens/conversations/ConversationsList.types.d.ts.map +1 -0
  370. package/lib/typescript/module/ui/screens/home/HomeView.d.ts +17 -0
  371. package/lib/typescript/module/ui/screens/home/HomeView.d.ts.map +1 -0
  372. package/lib/typescript/module/ui/screens/home/HomeView.styles.d.ts +227 -0
  373. package/lib/typescript/module/ui/screens/home/HomeView.styles.d.ts.map +1 -0
  374. package/lib/typescript/module/ui/screens/home/HomeView.types.d.ts +40 -0
  375. package/lib/typescript/module/ui/screens/home/HomeView.types.d.ts.map +1 -0
  376. package/lib/typescript/module/ui/screens/home/greeting.d.ts +19 -0
  377. package/lib/typescript/module/ui/screens/home/greeting.d.ts.map +1 -0
  378. package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.d.ts +7 -0
  379. package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.d.ts.map +1 -0
  380. package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.styles.d.ts +115 -0
  381. package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.styles.d.ts.map +1 -0
  382. package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.types.d.ts +20 -0
  383. package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.types.d.ts.map +1 -0
  384. package/lib/typescript/module/ui/styles/global.d.ts +46 -0
  385. package/lib/typescript/module/ui/styles/global.d.ts.map +1 -0
  386. package/lib/typescript/module/ui/styles/theme.d.ts +103 -0
  387. package/lib/typescript/module/ui/styles/theme.d.ts.map +1 -0
  388. package/lib/typescript/module/ui/utils/conversations.d.ts +41 -0
  389. package/lib/typescript/module/ui/utils/conversations.d.ts.map +1 -0
  390. package/lib/typescript/module/ui/utils/html.d.ts +10 -0
  391. package/lib/typescript/module/ui/utils/html.d.ts.map +1 -0
  392. package/lib/typescript/module/ui/utils/native-gradient.d.ts +61 -0
  393. package/lib/typescript/module/ui/utils/native-gradient.d.ts.map +1 -0
  394. package/lib/typescript/module/ui/utils/rtl.d.ts +33 -0
  395. package/lib/typescript/module/ui/utils/rtl.d.ts.map +1 -0
  396. package/lib/typescript/module/ui/utils/safe-url.d.ts +21 -0
  397. package/lib/typescript/module/ui/utils/safe-url.d.ts.map +1 -0
  398. package/metro.js +40 -0
  399. package/package.json +116 -0
  400. package/src/agent-ui-blocks.ts +302 -0
  401. package/src/api/client.ts +332 -0
  402. package/src/api/realtime.ts +225 -0
  403. package/src/api/sse-parser.ts +51 -0
  404. package/src/controller.ts +20 -0
  405. package/src/device-id.ts +71 -0
  406. package/src/events.ts +74 -0
  407. package/src/i18n.ts +114 -0
  408. package/src/index.tsx +199 -0
  409. package/src/locales.ts +80 -0
  410. package/src/push/push-notifications.ts +254 -0
  411. package/src/state/use-widget-state.ts +20 -0
  412. package/src/state/widget-store.ts +1815 -0
  413. package/src/storage.ts +153 -0
  414. package/src/types.ts +445 -0
  415. package/src/ui/WidgetProvider.tsx +434 -0
  416. package/src/ui/components/AgentUiBlocks.tsx +912 -0
  417. package/src/ui/components/Avatar.tsx +86 -0
  418. package/src/ui/components/ConversationRow.tsx +163 -0
  419. package/src/ui/components/ErrorBoundary.tsx +49 -0
  420. package/src/ui/components/Gradient.tsx +165 -0
  421. package/src/ui/components/Launcher.tsx +128 -0
  422. package/src/ui/components/Markdown.tsx +291 -0
  423. package/src/ui/components/OutboundMessageCard.tsx +154 -0
  424. package/src/ui/components/WidgetPanel.tsx +133 -0
  425. package/src/ui/components/icons.tsx +315 -0
  426. package/src/ui/hooks/use-keyboard-overlap.ts +134 -0
  427. package/src/ui/hooks/use-reduce-motion.ts +39 -0
  428. package/src/ui/hooks/use-widget-insets.ts +44 -0
  429. package/src/ui/screens/chat/ChatView.styles.ts +357 -0
  430. package/src/ui/screens/chat/ChatView.tsx +690 -0
  431. package/src/ui/screens/chat/ChatView.types.ts +46 -0
  432. package/src/ui/screens/conversations/ConversationsList.styles.ts +111 -0
  433. package/src/ui/screens/conversations/ConversationsList.tsx +144 -0
  434. package/src/ui/screens/conversations/ConversationsList.types.ts +33 -0
  435. package/src/ui/screens/home/HomeView.styles.ts +246 -0
  436. package/src/ui/screens/home/HomeView.tsx +336 -0
  437. package/src/ui/screens/home/HomeView.types.ts +42 -0
  438. package/src/ui/screens/home/greeting.ts +50 -0
  439. package/src/ui/screens/pre-chat/PreChatForm.styles.ts +120 -0
  440. package/src/ui/screens/pre-chat/PreChatForm.tsx +221 -0
  441. package/src/ui/screens/pre-chat/PreChatForm.types.ts +22 -0
  442. package/src/ui/styles/global.ts +50 -0
  443. package/src/ui/styles/theme.ts +155 -0
  444. package/src/ui/utils/conversations.ts +122 -0
  445. package/src/ui/utils/html.ts +58 -0
  446. package/src/ui/utils/native-gradient.ts +60 -0
  447. package/src/ui/utils/rtl.ts +43 -0
  448. package/src/ui/utils/safe-url.ts +63 -0
@@ -0,0 +1,370 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Geometric icons drawn with plain Views.
5
+ *
6
+ * The library ships zero native dependencies, so `react-native-svg` is off the
7
+ * table; every glyph here is a rotated border or triangle, which renders
8
+ * identically on both platforms and scales with the `size` prop.
9
+ */
10
+
11
+ import { StyleSheet, View } from 'react-native';
12
+ import { palette } from "../styles/theme.js";
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ /** Two crossed bars. */
15
+ export function CloseIcon({
16
+ size = 18,
17
+ color = palette.textMuted,
18
+ style
19
+ }) {
20
+ const bar = {
21
+ position: 'absolute',
22
+ width: size,
23
+ height: Math.max(2, size * 0.11),
24
+ borderRadius: 2,
25
+ backgroundColor: color
26
+ };
27
+ return /*#__PURE__*/_jsxs(View, {
28
+ style: [{
29
+ width: size,
30
+ height: size
31
+ }, styles.center, style],
32
+ children: [/*#__PURE__*/_jsx(View, {
33
+ style: [bar, {
34
+ transform: [{
35
+ rotate: '45deg'
36
+ }]
37
+ }]
38
+ }), /*#__PURE__*/_jsx(View, {
39
+ style: [bar, {
40
+ transform: [{
41
+ rotate: '-45deg'
42
+ }]
43
+ }]
44
+ })]
45
+ });
46
+ }
47
+ const CHEVRON_ROTATION = {
48
+ left: '45deg',
49
+ right: '-135deg',
50
+ up: '135deg',
51
+ down: '-45deg'
52
+ };
53
+
54
+ /** A square with two adjacent borders, rotated into an arrow head. */
55
+ export function ChevronIcon({
56
+ size = 16,
57
+ color = palette.textMuted,
58
+ direction = 'left',
59
+ style
60
+ }) {
61
+ const box = size * 0.62;
62
+ return /*#__PURE__*/_jsx(View, {
63
+ style: [{
64
+ width: size,
65
+ height: size
66
+ }, styles.center, style],
67
+ children: /*#__PURE__*/_jsx(View, {
68
+ style: {
69
+ width: box,
70
+ height: box,
71
+ borderLeftWidth: Math.max(2, size * 0.13),
72
+ borderBottomWidth: Math.max(2, size * 0.13),
73
+ borderColor: color,
74
+ transform: [{
75
+ rotate: CHEVRON_ROTATION[direction]
76
+ }]
77
+ }
78
+ })
79
+ });
80
+ }
81
+
82
+ /** Arrow with a shaft — used for the "start a conversation" affordance. */
83
+ export function ArrowRightIcon({
84
+ size = 16,
85
+ color = palette.textMuted,
86
+ style
87
+ }) {
88
+ const thickness = Math.max(2, size * 0.12);
89
+ return /*#__PURE__*/_jsxs(View, {
90
+ style: [{
91
+ width: size,
92
+ height: size
93
+ }, styles.center, style],
94
+ children: [/*#__PURE__*/_jsx(View, {
95
+ style: {
96
+ position: 'absolute',
97
+ width: size * 0.8,
98
+ height: thickness,
99
+ borderRadius: thickness,
100
+ backgroundColor: color
101
+ }
102
+ }), /*#__PURE__*/_jsx(View, {
103
+ style: {
104
+ position: 'absolute',
105
+ right: size * 0.12,
106
+ width: size * 0.42,
107
+ height: size * 0.42,
108
+ borderTopWidth: thickness,
109
+ borderRightWidth: thickness,
110
+ borderColor: color,
111
+ transform: [{
112
+ rotate: '45deg'
113
+ }]
114
+ }
115
+ })]
116
+ });
117
+ }
118
+
119
+ /** Right-pointing triangle for the send button. */
120
+ /** Upward arrow — the send affordance inside the composer's round button. */
121
+ export function ArrowUpIcon({
122
+ size = 16,
123
+ color = palette.white,
124
+ style
125
+ }) {
126
+ const thickness = Math.max(2, size * 0.12);
127
+ return /*#__PURE__*/_jsxs(View, {
128
+ style: [{
129
+ width: size,
130
+ height: size
131
+ }, styles.center, style],
132
+ children: [/*#__PURE__*/_jsx(View, {
133
+ style: {
134
+ position: 'absolute',
135
+ width: thickness,
136
+ height: size * 0.78,
137
+ borderRadius: thickness,
138
+ backgroundColor: color
139
+ }
140
+ }), /*#__PURE__*/_jsx(View, {
141
+ style: {
142
+ position: 'absolute',
143
+ top: size * 0.14,
144
+ width: size * 0.42,
145
+ height: size * 0.42,
146
+ borderTopWidth: thickness,
147
+ borderRightWidth: thickness,
148
+ borderColor: color,
149
+ transform: [{
150
+ rotate: '-45deg'
151
+ }]
152
+ }
153
+ })]
154
+ });
155
+ }
156
+
157
+ /** Rounded speech bubble with a tail. */
158
+ export function ChatIcon({
159
+ size = 24,
160
+ color = palette.white,
161
+ style
162
+ }) {
163
+ return /*#__PURE__*/_jsxs(View, {
164
+ style: [{
165
+ width: size,
166
+ height: size
167
+ }, style],
168
+ children: [/*#__PURE__*/_jsx(View, {
169
+ style: {
170
+ width: size,
171
+ height: size * 0.78,
172
+ borderRadius: size * 0.26,
173
+ backgroundColor: color
174
+ }
175
+ }), /*#__PURE__*/_jsx(View, {
176
+ style: {
177
+ position: 'absolute',
178
+ left: size * 0.18,
179
+ bottom: 0,
180
+ width: 0,
181
+ height: 0,
182
+ borderLeftWidth: size * 0.14,
183
+ borderRightWidth: size * 0.14,
184
+ borderTopWidth: size * 0.26,
185
+ borderLeftColor: 'transparent',
186
+ borderRightColor: 'transparent',
187
+ borderTopColor: color
188
+ }
189
+ })]
190
+ });
191
+ }
192
+
193
+ /** Outlined speech bubble — the Messages tab + empty state. */
194
+ export function ChatOutlineIcon({
195
+ size = 22,
196
+ color = palette.textSubtle,
197
+ style
198
+ }) {
199
+ const thickness = Math.max(1.5, size * 0.09);
200
+ return /*#__PURE__*/_jsxs(View, {
201
+ style: [{
202
+ width: size,
203
+ height: size
204
+ }, style],
205
+ children: [/*#__PURE__*/_jsx(View, {
206
+ style: {
207
+ width: size,
208
+ height: size * 0.76,
209
+ borderRadius: size * 0.24,
210
+ borderWidth: thickness,
211
+ borderColor: color
212
+ }
213
+ }), /*#__PURE__*/_jsx(View, {
214
+ style: {
215
+ position: 'absolute',
216
+ left: size * 0.2,
217
+ bottom: size * 0.02,
218
+ width: size * 0.22,
219
+ height: size * 0.22,
220
+ borderLeftWidth: thickness,
221
+ borderBottomWidth: thickness,
222
+ borderColor: color,
223
+ backgroundColor: palette.white,
224
+ transform: [{
225
+ rotate: '-45deg'
226
+ }]
227
+ }
228
+ })]
229
+ });
230
+ }
231
+
232
+ /** House outline — the Home tab. */
233
+ export function HomeIcon({
234
+ size = 22,
235
+ color = palette.textSubtle,
236
+ style
237
+ }) {
238
+ const thickness = Math.max(1.5, size * 0.09);
239
+ return /*#__PURE__*/_jsxs(View, {
240
+ style: [{
241
+ width: size,
242
+ height: size
243
+ }, styles.center, style],
244
+ children: [/*#__PURE__*/_jsx(View, {
245
+ style: {
246
+ position: 'absolute',
247
+ top: size * 0.04,
248
+ width: size * 0.56,
249
+ height: size * 0.56,
250
+ borderTopWidth: thickness,
251
+ borderLeftWidth: thickness,
252
+ borderColor: color,
253
+ transform: [{
254
+ rotate: '45deg'
255
+ }]
256
+ }
257
+ }), /*#__PURE__*/_jsx(View, {
258
+ style: {
259
+ position: 'absolute',
260
+ bottom: size * 0.08,
261
+ width: size * 0.7,
262
+ height: size * 0.44,
263
+ borderWidth: thickness,
264
+ borderTopWidth: 0,
265
+ borderColor: color
266
+ }
267
+ })]
268
+ });
269
+ }
270
+
271
+ /** Person glyph for conversations with no assigned agent. */
272
+ export function PersonIcon({
273
+ size = 18,
274
+ color = palette.white,
275
+ style
276
+ }) {
277
+ const thickness = Math.max(1.5, size * 0.11);
278
+ return /*#__PURE__*/_jsxs(View, {
279
+ style: [{
280
+ width: size,
281
+ height: size
282
+ }, styles.center, style],
283
+ children: [/*#__PURE__*/_jsx(View, {
284
+ style: {
285
+ position: 'absolute',
286
+ top: size * 0.06,
287
+ width: size * 0.42,
288
+ height: size * 0.42,
289
+ borderRadius: size * 0.21,
290
+ borderWidth: thickness,
291
+ borderColor: color
292
+ }
293
+ }), /*#__PURE__*/_jsx(View, {
294
+ style: {
295
+ position: 'absolute',
296
+ bottom: size * 0.06,
297
+ width: size * 0.74,
298
+ height: size * 0.3,
299
+ borderTopLeftRadius: size * 0.37,
300
+ borderTopRightRadius: size * 0.37,
301
+ borderWidth: thickness,
302
+ borderBottomWidth: 0,
303
+ borderColor: color
304
+ }
305
+ })]
306
+ });
307
+ }
308
+
309
+ /** Circle-with-bang used on the offline notice. */
310
+ export function AlertIcon({
311
+ size = 16,
312
+ color = palette.warningIcon,
313
+ style
314
+ }) {
315
+ return /*#__PURE__*/_jsxs(View, {
316
+ style: [{
317
+ width: size,
318
+ height: size,
319
+ borderRadius: size / 2,
320
+ borderWidth: Math.max(1.5, size * 0.12),
321
+ borderColor: color
322
+ }, styles.center, style],
323
+ children: [/*#__PURE__*/_jsx(View, {
324
+ style: {
325
+ width: Math.max(1.5, size * 0.12),
326
+ height: size * 0.34,
327
+ backgroundColor: color,
328
+ marginBottom: 1
329
+ }
330
+ }), /*#__PURE__*/_jsx(View, {
331
+ style: {
332
+ width: Math.max(1.5, size * 0.12),
333
+ height: Math.max(1.5, size * 0.12),
334
+ backgroundColor: color
335
+ }
336
+ })]
337
+ });
338
+ }
339
+ export function PaperclipIcon({
340
+ size = 18,
341
+ color = palette.textMuted,
342
+ style
343
+ }) {
344
+ const thickness = Math.max(1.5, size * 0.1);
345
+ return /*#__PURE__*/_jsx(View, {
346
+ style: [{
347
+ width: size,
348
+ height: size
349
+ }, styles.center, style],
350
+ children: /*#__PURE__*/_jsx(View, {
351
+ style: {
352
+ width: size * 0.42,
353
+ height: size * 0.82,
354
+ borderRadius: size * 0.21,
355
+ borderWidth: thickness,
356
+ borderColor: color,
357
+ transform: [{
358
+ rotate: '35deg'
359
+ }]
360
+ }
361
+ })
362
+ });
363
+ }
364
+ const styles = StyleSheet.create({
365
+ center: {
366
+ alignItems: 'center',
367
+ justifyContent: 'center'
368
+ }
369
+ });
370
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","View","palette","jsx","_jsx","jsxs","_jsxs","CloseIcon","size","color","textMuted","style","bar","position","width","height","Math","max","borderRadius","backgroundColor","styles","center","children","transform","rotate","CHEVRON_ROTATION","left","right","up","down","ChevronIcon","direction","box","borderLeftWidth","borderBottomWidth","borderColor","ArrowRightIcon","thickness","borderTopWidth","borderRightWidth","ArrowUpIcon","white","top","ChatIcon","bottom","borderLeftColor","borderRightColor","borderTopColor","ChatOutlineIcon","textSubtle","borderWidth","HomeIcon","PersonIcon","borderTopLeftRadius","borderTopRightRadius","AlertIcon","warningIcon","marginBottom","PaperclipIcon","create","alignItems","justifyContent"],"sourceRoot":"../../../../src","sources":["ui/components/icons.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAwB,cAAc;AAE/D,SAASC,OAAO,QAAQ,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQ1C;AACA,OAAO,SAASC,SAASA,CAAC;EAAEC,IAAI,GAAG,EAAE;EAAEC,KAAK,GAAGP,OAAO,CAACQ,SAAS;EAAEC;AAAiB,CAAC,EAAE;EACpF,MAAMC,GAAc,GAAG;IACrBC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAEN,IAAI;IACXO,MAAM,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAET,IAAI,GAAG,IAAI,CAAC;I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,CAAC,GAAG,EAAET,IAAI,GAAG,GAAG,CAAC;EAC3C,oBACEJ,IAAA,CAACH,IAAI;IAACU,KAAK,EAAE,CAAC;MAAEG,KAAK,EAAEN,IAAI;MAAEO,MAAM,EAAEP;IAAK,CAAC,EAAEY,MAAM,CAACC,MAAM,EAAEV,KAAK,CAAE;IAAAW,QAAA,eACjElB,IAAA,CAACH,IAAI;MACHU,KAAK,EAAE;QACLG,KAAK,EAAEN,IAAI,GAAG,IAAI;QAClBO,MAAM,EAAEP,IAAI,GAAG,IAAI;QACnBU,YAAY,EAAEV,IAAI,GAAG,IAAI;QACzB0C,WAAW,EAAEb,SAAS;QACtBF,WAAW,EAAE1B,KAAK;QAClBc,SAAS,EAAE,CAAC;UAAEC,MAAM,EAAE;QAAQ,CAAC;MACjC;IAAE,CACH;EAAC,CACE,CAAC;AAEX;AAEA,MAAMJ,MAAM,GAAGpB,UAAU,CAAC2D,MAAM,CAAC;EAC/BtC,MAAM,EAAE;IACNuC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * How far the keyboard covers the widget panel, in dp.
5
+ *
6
+ * The panel is a `<Modal>` that reaches the bottom of the screen, so the
7
+ * keyboard's own height is the whole story: what it reports is what has to be
8
+ * given back, less whatever the layout has already conceded down there.
9
+ *
10
+ * Measuring the panel does not work, and neither does RN's
11
+ * `<KeyboardAvoidingView>`, which is built on the same measurement. Both read a
12
+ * view's position out of the shadow tree, which places it relative to the
13
+ * surface root, while the keyboard frame arrives in screen coordinates. An iOS
14
+ * page sheet starts some 60dp down the screen, so the two disagree by exactly
15
+ * that much and the composer ends up under the keyboard with only its top
16
+ * border showing.
17
+ *
18
+ * What counts as already conceded differs by platform. iOS never resizes its
19
+ * window for the keyboard, so it is the safe-area padding the panel already
20
+ * keeps below itself. Android modals ask for `adjustResize`, so the window
21
+ * usually gives up the height itself and nothing more is owed; when it does not
22
+ * — an edge-to-edge window stays put — the whole keyboard still is. Either way
23
+ * the difference shows up in the panel's own height, so that is where the
24
+ * shrink is read from. RN already nets the navigation bar out of the height it
25
+ * reports on Android, so the safe-area inset must not come off twice there.
26
+ */
27
+
28
+ import { useCallback, useEffect, useRef, useState } from 'react';
29
+ import { Keyboard, LayoutAnimation, Platform } from 'react-native';
30
+ // iOS announces the keyboard before it moves, so the layout can travel with
31
+ // it; Android only reports the keyboard once it has settled.
32
+ const SHOW_EVENT = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
33
+ const HIDE_EVENT = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
34
+
35
+ /** Android is the only platform whose window gives up height to the keyboard. */
36
+ const WINDOW_RESIZES = Platform.OS === 'android';
37
+ export function useKeyboardOverlap(enabled, bottomInset) {
38
+ const [overlap, setOverlap] = useState(0);
39
+ // Mirrors `overlap` for the handlers, which must not re-subscribe on it.
40
+ const applied = useRef(0);
41
+ const keyboardHeight = useRef(0);
42
+ // The panel's height with no keyboard, and its height now. Taking the tallest
43
+ // seen keeps an Android resize that lands before the keyboard event from
44
+ // being mistaken for the resting height.
45
+ const restingHeight = useRef(0);
46
+ const currentHeight = useRef(0);
47
+ const apply = useCallback((next, event) => {
48
+ if (Math.abs(next - applied.current) < 1) return;
49
+ applied.current = next;
50
+
51
+ // Riding the keyboard's own duration and curve keeps the composer glued to
52
+ // it, and leaves the work in the native layout pass instead of re-laying
53
+ // out the message list from JS on every frame. Android reports a duration
54
+ // of 0 and animates nothing, which is what the guard falls through to.
55
+ const duration = event?.duration ?? 0;
56
+ const easing = event?.easing;
57
+ if (duration > 10 && easing) {
58
+ LayoutAnimation.configureNext({
59
+ duration,
60
+ update: {
61
+ duration,
62
+ type: LayoutAnimation.Types[easing] ?? LayoutAnimation.Types.keyboard
63
+ }
64
+ });
65
+ }
66
+ setOverlap(next);
67
+ }, []);
68
+ const recompute = useCallback(event => {
69
+ const alreadyClear = WINDOW_RESIZES ? Math.max(restingHeight.current - currentHeight.current, 0) : bottomInset;
70
+ const height = keyboardHeight.current;
71
+ apply(Math.min(Math.max(height - alreadyClear, 0), height), event);
72
+ }, [apply, bottomInset]);
73
+ const onLayout = useCallback(event => {
74
+ // Only Android has a shrink to read, and only there can it land after the
75
+ // keyboard event and leave the first answer stale.
76
+ if (!WINDOW_RESIZES) return;
77
+ const {
78
+ height
79
+ } = event.nativeEvent.layout;
80
+ currentHeight.current = height;
81
+ restingHeight.current = Math.max(restingHeight.current, height);
82
+ if (keyboardHeight.current > 0) recompute();
83
+ }, [recompute]);
84
+ useEffect(() => {
85
+ if (!enabled) {
86
+ keyboardHeight.current = 0;
87
+ restingHeight.current = 0;
88
+ apply(0);
89
+ return undefined;
90
+ }
91
+ const handleShow = event => {
92
+ keyboardHeight.current = event.endCoordinates?.height ?? 0;
93
+ recompute(event);
94
+ };
95
+ const handleHide = event => {
96
+ keyboardHeight.current = 0;
97
+ recompute(event);
98
+ };
99
+ const subscriptions = [Keyboard.addListener(SHOW_EVENT, handleShow), Keyboard.addListener(HIDE_EVENT, handleHide)];
100
+ return () => {
101
+ subscriptions.forEach(subscription => subscription.remove());
102
+ };
103
+ }, [apply, enabled, recompute]);
104
+ return {
105
+ overlap,
106
+ onLayout
107
+ };
108
+ }
109
+ //# sourceMappingURL=use-keyboard-overlap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useEffect","useRef","useState","Keyboard","LayoutAnimation","Platform","SHOW_EVENT","OS","HIDE_EVENT","WINDOW_RESIZES","useKeyboardOverlap","enabled","bottomInset","overlap","setOverlap","applied","keyboardHeight","restingHeight","currentHeight","apply","next","event","Math","abs","current","duration","easing","configureNext","update","type","Types","keyboard","recompute","alreadyClear","max","height","min","onLayout","nativeEvent","layout","undefined","handleShow","endCoordinates","handleHide","subscriptions","addListener","forEach","subscription","remove"],"sourceRoot":"../../../../src","sources":["ui/hooks/use-keyboard-overlap.ts"],"mappings":";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CAACQ,OAAO,GAAG,CAAC;MAC1BP,aAAa,CAACO,OAAO,GAAG,CAAC;MACzBL,KAAK,CAAC,CAAC,CAAC;MACR,OAAOqB,SAAS;IAClB;IAEA,MAAMC,UAAU,GAAIpB,KAAoB,IAAK;MAC3CL,cAAc,CAACQ,OAAO,GAAGH,KAAK,CAACqB,cAAc,EAAEP,MAAM,IAAI,CAAC;MAC1DH,SAAS,CAACX,KAAK,CAAC;IAClB,CAAC;IAED,MAAMsB,UAAU,GAAItB,KAAoB,IAAK;MAC3CL,cAAc,CAACQ,OAAO,GAAG,CAAC;MAC1BQ,SAAS,CAACX,KAAK,CAAC;IAClB,CAAC;IAED,MAAMuB,aAAa,GAAG,CACpBzC,QAAQ,CAAC0C,WAAW,CAACvC,UAAU,EAAEmC,UAAU,CAAC,EAC5CtC,QAAQ,CAAC0C,WAAW,CAACrC,UAAU,EAAEmC,UAAU,CAAC,CAC7C;IAED,OAAO,MAAM;MACXC,aAAa,CAACE,OAAO,CAAEC,YAAY,IAAKA,YAAY,CAACC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;EACH,CAAC,EAAE,CAAC7B,KAAK,EAAER,OAAO,EAAEqB,SAAS,CAAC,CAAC;EAE/B,OAAO;IAAEnB,OAAO;IAAEwB;EAAS,CAAC;AAC9B","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Shared reduce-motion check. The query is async, so the answer is cached for
5
+ * the process: the setting rarely changes mid-session, and re-asking on every
6
+ * mount would let the first frame animate before the answer arrives.
7
+ *
8
+ * Returns `null` until resolved, which callers should read as "hold still" —
9
+ * starting an animation and snapping it away a frame later is the flicker this
10
+ * is meant to avoid.
11
+ */
12
+
13
+ import { useEffect, useState } from 'react';
14
+ import { AccessibilityInfo } from 'react-native';
15
+ let cached = null;
16
+ export function useReduceMotion() {
17
+ const [value, setValue] = useState(cached);
18
+ useEffect(() => {
19
+ if (cached !== null) return undefined;
20
+ let alive = true;
21
+ AccessibilityInfo.isReduceMotionEnabled().then(enabled => {
22
+ cached = enabled;
23
+ if (alive) setValue(enabled);
24
+ }).catch(() => {
25
+ cached = false;
26
+ if (alive) setValue(false);
27
+ });
28
+ return () => {
29
+ alive = false;
30
+ };
31
+ }, []);
32
+ return value;
33
+ }
34
+ //# sourceMappingURL=use-reduce-motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","AccessibilityInfo","cached","useReduceMotion","value","setValue","undefined","alive","isReduceMotionEnabled","then","enabled","catch"],"sourceRoot":"../../../../src","sources":["ui/hooks/use-reduce-motion.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,iBAAiB,QAAQ,cAAc;AAEhD,IAAIC,MAAsB,GAAG,IAAI;AAEjC,OAAO,SAASC,eAAeA,CAAA,EAAmB;EAChD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGL,QAAQ,CAAiBE,MAAM,CAAC;EAE1DH,SAAS,CAAC,MAAM;IACd,IAAIG,MAAM,KAAK,IAAI,EAAE,OAAOI,SAAS;IACrC,IAAIC,KAAK,GAAG,IAAI;IAEhBN,iBAAiB,CAACO,qBAAqB,CAAC,CAAC,CACtCC,IAAI,CAAEC,OAAO,IAAK;MACjBR,MAAM,GAAGQ,OAAO;MAChB,IAAIH,KAAK,EAAEF,QAAQ,CAACK,OAAO,CAAC;IAC9B,CAAC,CAAC,CACDC,KAAK,CAAC,MAAM;MACXT,MAAM,GAAG,KAAK;MACd,IAAIK,KAAK,EAAEF,QAAQ,CAAC,KAAK,CAAC;IAC5B,CAAC,CAAC;IAEJ,OAAO,MAAM;MACXE,KAAK,GAAG,KAAK;IACf,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOH,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Safe-area insets without a hard dependency.
5
+ *
6
+ * RN's own `SafeAreaView` is deprecated (and iOS-only), so we use the host
7
+ * app's `react-native-safe-area-context` when it is installed and fall back to
8
+ * platform constants otherwise. Resolution happens once at module load, so the
9
+ * hook call order is stable across renders.
10
+ */
11
+
12
+ import { Platform, StatusBar } from 'react-native';
13
+ const FALLBACK_INSETS = {
14
+ top: Platform.OS === 'android' ? StatusBar.currentHeight ?? 0 : 0,
15
+ bottom: 0,
16
+ left: 0,
17
+ right: 0
18
+ };
19
+ let insetsHook = null;
20
+ try {
21
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
22
+ const mod = require('react-native-safe-area-context');
23
+ if (typeof mod?.useSafeAreaInsets === 'function') insetsHook = mod.useSafeAreaInsets;
24
+ } catch {
25
+ insetsHook = null;
26
+ }
27
+ export function useWidgetInsets() {
28
+ if (!insetsHook) return FALLBACK_INSETS;
29
+ try {
30
+ return insetsHook();
31
+ } catch {
32
+ // The host mounted no <SafeAreaProvider>; the hook itself still ran, so
33
+ // React's hook order is unchanged.
34
+ return FALLBACK_INSETS;
35
+ }
36
+ }
37
+ //# sourceMappingURL=use-widget-insets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","StatusBar","FALLBACK_INSETS","top","OS","currentHeight","bottom","left","right","insetsHook","mod","require","useSafeAreaInsets","useWidgetInsets"],"sourceRoot":"../../../../src","sources":["ui/hooks/use-widget-insets.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,cAAc;AASlD,MAAMC,eAA6B,GAAG;EACpCC,GAAG,EAAEH,QAAQ,CAACI,EAAE,KAAK,SAAS,GAAIH,SAAS,CAACI,aAAa,IAAI,CAAC,GAAI,CAAC;EACnEC,MAAM,EAAE,CAAC;EACTC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE;AACT,CAAC;AAED,IAAIC,UAAuC,GAAG,IAAI;AAClD,IAAI;EACF;EACA,MAAMC,GAAG,GAAGC,OAAO,CAAC,gCAAgC,CAAC;EACrD,IAAI,OAAOD,GAAG,EAAEE,iBAAiB,KAAK,UAAU,EAAEH,UAAU,GAAGC,GAAG,CAACE,iBAAiB;AACtF,CAAC,CAAC,MAAM;EACNH,UAAU,GAAG,IAAI;AACnB;AAEA,OAAO,SAASI,eAAeA,CAAA,EAAiB;EAC9C,IAAI,CAACJ,UAAU,EAAE,OAAOP,eAAe;EACvC,IAAI;IACF,OAAOO,UAAU,CAAC,CAAC;EACrB,CAAC,CAAC,MAAM;IACN;IACA;IACA,OAAOP,eAAe;EACxB;AACF","ignoreList":[]}