@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,125 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.styles = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _theme = require("../../styles/theme.js");
9
+ var _rtl = require("../../utils/rtl.js");
10
+ /** Styles for the pre-chat form: brand header, fields and the skip/submit row. */
11
+
12
+ const styles = exports.styles = _reactNative.StyleSheet.create({
13
+ header: {
14
+ flexDirection: 'row',
15
+ alignItems: 'flex-start',
16
+ gap: _theme.spacing.md,
17
+ paddingHorizontal: _theme.spacing.xl,
18
+ paddingVertical: _theme.spacing.lg,
19
+ minHeight: 96
20
+ },
21
+ headerCopy: {
22
+ flex: 1,
23
+ minWidth: 0
24
+ },
25
+ headerTitle: {
26
+ textAlign: _rtl.START_ALIGN,
27
+ fontSize: _theme.fontSize.heading,
28
+ fontWeight: '700',
29
+ marginBottom: _theme.spacing.xs
30
+ },
31
+ headerSubtitle: {
32
+ textAlign: _rtl.START_ALIGN,
33
+ fontSize: _theme.fontSize.meta,
34
+ lineHeight: _theme.fontSize.meta * 1.4
35
+ },
36
+ content: {
37
+ flexGrow: 1,
38
+ padding: _theme.spacing.xxl
39
+ },
40
+ field: {
41
+ marginBottom: _theme.spacing.lg
42
+ },
43
+ label: {
44
+ textAlign: _rtl.START_ALIGN,
45
+ fontSize: _theme.fontSize.meta,
46
+ fontWeight: '600',
47
+ color: '#374151',
48
+ marginBottom: _theme.spacing.xs
49
+ },
50
+ required: {
51
+ color: _theme.palette.danger
52
+ },
53
+ input: {
54
+ textAlign: _rtl.START_ALIGN,
55
+ borderWidth: _reactNative.StyleSheet.hairlineWidth,
56
+ borderColor: _theme.palette.disabled,
57
+ borderRadius: _theme.radius.sm,
58
+ paddingHorizontal: _theme.spacing.md,
59
+ paddingVertical: _theme.spacing.sm + 2,
60
+ fontSize: _theme.fontSize.input,
61
+ color: _theme.palette.ink,
62
+ minHeight: 46
63
+ },
64
+ inputError: {
65
+ borderColor: _theme.palette.danger
66
+ },
67
+ options: {
68
+ gap: _theme.spacing.sm
69
+ },
70
+ option: {
71
+ flexDirection: 'row',
72
+ alignItems: 'center',
73
+ justifyContent: 'space-between',
74
+ borderWidth: _reactNative.StyleSheet.hairlineWidth,
75
+ borderColor: _theme.palette.disabled,
76
+ borderRadius: _theme.radius.sm,
77
+ paddingHorizontal: _theme.spacing.md,
78
+ paddingVertical: _theme.spacing.md,
79
+ minHeight: 46
80
+ },
81
+ optionLabel: {
82
+ fontSize: _theme.fontSize.body,
83
+ color: _theme.palette.ink
84
+ },
85
+ errorText: {
86
+ textAlign: _rtl.START_ALIGN,
87
+ fontSize: _theme.fontSize.caption,
88
+ color: _theme.palette.danger,
89
+ marginTop: _theme.spacing.xs
90
+ },
91
+ actions: {
92
+ flexDirection: 'row',
93
+ gap: _theme.spacing.sm,
94
+ marginTop: _theme.spacing.lg
95
+ },
96
+ skipButton: {
97
+ flex: 1,
98
+ alignItems: 'center',
99
+ justifyContent: 'center',
100
+ borderWidth: _reactNative.StyleSheet.hairlineWidth,
101
+ borderColor: _theme.palette.disabled,
102
+ borderRadius: _theme.radius.sm,
103
+ paddingVertical: _theme.spacing.md,
104
+ minHeight: 46
105
+ },
106
+ skipLabel: {
107
+ fontSize: _theme.fontSize.body,
108
+ fontWeight: '600',
109
+ color: '#374151'
110
+ },
111
+ submitButton: {
112
+ flex: 1,
113
+ alignItems: 'center',
114
+ justifyContent: 'center',
115
+ borderRadius: _theme.radius.sm,
116
+ paddingVertical: _theme.spacing.md,
117
+ minHeight: 46
118
+ },
119
+ submitLabel: {
120
+ fontSize: _theme.fontSize.body,
121
+ fontWeight: '600',
122
+ color: _theme.palette.white
123
+ }
124
+ });
125
+ //# sourceMappingURL=PreChatForm.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_theme","_rtl","styles","exports","StyleSheet","create","header","flexDirection","alignItems","gap","spacing","md","paddingHorizontal","xl","paddingVertical","lg","minHeight","headerCopy","flex","minWidth","headerTitle","textAlign","START_ALIGN","fontSize","heading","fontWeight","marginBottom","xs","headerSubtitle","meta","lineHeight","content","flexGrow","padding","xxl","field","label","color","required","palette","danger","input","borderWidth","hairlineWidth","borderColor","disabled","borderRadius","radius","sm","ink","inputError","options","option","justifyContent","optionLabel","body","errorText","caption","marginTop","actions","skipButton","skipLabel","submitButton","submitLabel","white"],"sourceRoot":"../../../../../src","sources":["ui/screens/pre-chat/PreChatForm.styles.ts"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AALA;;AAOO,MAAMG,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,uBAAU,CAACC,MAAM,CAAC;EACtCC,MAAM,EAAE;IACNC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,YAAY;IACxBC,GAAG,EAAEC,cAAO,CAACC,EAAE;IACf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EA,eAAQ,CAACgC,IAAI;IACvB9B,UAAU,EAAE,KAAK;IACjBY,KAAK,EAAE;EACT,CAAC;EACDyB,YAAY,EAAE;IACZ5C,IAAI,EAAE,CAAC;IACPV,UAAU,EAAE,QAAQ;IACpB6C,cAAc,EAAE,QAAQ;IACxBP,YAAY,EAAEC,aAAM,CAACC,EAAE;IACvBlC,eAAe,EAAEJ,cAAO,CAACC,EAAE;IAC3BK,SAAS,EAAE;EACb,CAAC;EACD+C,WAAW,EAAE;IACXxC,QAAQ,EAAEA,eAAQ,CAACgC,IAAI;IACvB9B,UAAU,EAAE,KAAK;IACjBY,KAAK,EAAEE,cAAO,CAACyB;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=PreChatForm.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["ui/screens/pre-chat/PreChatForm.types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.globalStyles = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _theme = require("./theme.js");
9
+ /**
10
+ * Style rules shared by more than one screen or component, so a fingertip-sized
11
+ * icon button or a hairline divider is written once and looks the same
12
+ * everywhere. Screens layer their own sheet on top:
13
+ * `style={[globalStyles.divider, styles.inset]}`.
14
+ *
15
+ * Only rules that are identical at every call site belong here. A style that is
16
+ * "almost the same" stays with its screen: hoisting it would either fork it
17
+ * into variants or quietly change one screen to match another.
18
+ */
19
+
20
+ const globalStyles = exports.globalStyles = _reactNative.StyleSheet.create({
21
+ /** Full-height white surface every screen starts from. */
22
+ screen: {
23
+ flex: 1,
24
+ backgroundColor: _theme.palette.white
25
+ },
26
+ /** Grows to take whatever space its parent has left. */
27
+ fill: {
28
+ flex: 1
29
+ },
30
+ /** Round icon target in a header bar, sized for a fingertip. */
31
+ iconButton: {
32
+ width: 34,
33
+ height: 34,
34
+ borderRadius: 17,
35
+ alignItems: 'center',
36
+ justifyContent: 'center'
37
+ },
38
+ /** Pressed feedback for icon buttons and text links. */
39
+ pressed: {
40
+ opacity: 0.6
41
+ },
42
+ /** Hairline between list rows; the caller adds the start inset. */
43
+ divider: {
44
+ height: _reactNative.StyleSheet.hairlineWidth,
45
+ backgroundColor: _theme.palette.borderSoft
46
+ },
47
+ /** Bordered white card that lists and previews sit in. */
48
+ card: {
49
+ borderRadius: _theme.radius.lg,
50
+ borderWidth: _reactNative.StyleSheet.hairlineWidth,
51
+ borderColor: _theme.palette.border,
52
+ backgroundColor: _theme.palette.white
53
+ }
54
+ });
55
+ //# sourceMappingURL=global.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_theme","globalStyles","exports","StyleSheet","create","screen","flex","backgroundColor","palette","white","fill","iconButton","width","height","borderRadius","alignItems","justifyContent","pressed","opacity","divider","hairlineWidth","borderSoft","card","radius","lg","borderWidth","borderColor","border"],"sourceRoot":"../../../../src","sources":["ui/styles/global.ts"],"mappings":";;;;;;AAWA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAME,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,uBAAU,CAACC,MAAM,CAAC;EAC5C;EACAC,MAAM,EAAE;IACNC,IAAI,EAAE,CAAC;IACPC,eAAe,EAAEC,cAAO,CAACC;EAC3B,CAAC;EACD;EACAC,IAAI,EAAE;IACJJ,IAAI,EAAE;EACR,CAAC;EACD;EACAK,UAAU,EAAE;IACVC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,EAAE;IAChBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACD;EACAC,OAAO,EAAE;IACPC,OAAO,EAAE;EACX,CAAC;EACD;EACAC,OAAO,EAAE;IACPN,MAAM,EAAEV,uBAAU,CAACiB,aAAa;IAChCb,eAAe,EAAEC,cAAO,CAACa;EAC3B,CAAC;EACD;EACAC,IAAI,EAAE;IACJR,YAAY,EAAES,aAAM,CAACC,EAAE;IACvBC,WAAW,EAAEtB,uBAAU,CAACiB,aAAa;IACrCM,WAAW,EAAElB,cAAO,CAACmB,MAAM;IAC3BpB,eAAe,EAAEC,cAAO,CAACC;EAC3B;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DEFAULT_PRIMARY_COLOR = void 0;
7
+ exports.buildTheme = buildTheme;
8
+ exports.contrastingTextColor = contrastingTextColor;
9
+ exports.fontSize = void 0;
10
+ exports.hexToRgb = hexToRgb;
11
+ exports.mixHex = mixHex;
12
+ exports.spacing = exports.shadows = exports.radius = exports.palette = void 0;
13
+ exports.withAlpha = withAlpha;
14
+ /**
15
+ * Maps the widget's `GET /config` theming fields onto React Native styles.
16
+ *
17
+ * The palette mirrors the web widget so a workspace looks the same on both
18
+ * surfaces; type scales are nudged up because 13px body copy is unreadable on
19
+ * a phone (minimum readable body size is 15–16px).
20
+ */
21
+
22
+ const palette = exports.palette = {
23
+ white: '#ffffff',
24
+ ink: '#1a1a1a',
25
+ text: '#111827',
26
+ textMuted: '#6b7280',
27
+ textSubtle: '#9ca3af',
28
+ textFaint: '#b0b0b0',
29
+ border: '#e5e7eb',
30
+ borderSoft: '#f3f4f6',
31
+ surface: '#f9fafb',
32
+ surfaceAlt: '#f3f4f6',
33
+ danger: '#ef4444',
34
+ warningBg: '#fef3c7',
35
+ warningBorder: '#fde68a',
36
+ warningText: '#92400e',
37
+ warningIcon: '#d97706',
38
+ online: '#22c55e',
39
+ disabled: '#d1d5db'
40
+ };
41
+ const radius = exports.radius = {
42
+ sm: 8,
43
+ md: 10,
44
+ lg: 12,
45
+ xl: 14,
46
+ pill: 999
47
+ };
48
+ const spacing = exports.spacing = {
49
+ xs: 4,
50
+ sm: 8,
51
+ md: 12,
52
+ lg: 16,
53
+ xl: 20,
54
+ xxl: 24
55
+ };
56
+
57
+ /** Mobile type scale — one step larger than the web widget's. */
58
+ const fontSize = exports.fontSize = {
59
+ micro: 10,
60
+ caption: 12,
61
+ meta: 13,
62
+ body: 15,
63
+ input: 16,
64
+ title: 17,
65
+ heading: 22,
66
+ display: 28
67
+ };
68
+ const DEFAULT_PRIMARY_COLOR = exports.DEFAULT_PRIMARY_COLOR = '#0d9488';
69
+
70
+ /**
71
+ * `override` supplies a translation for the active locale when one exists.
72
+ * Without it the workspace's single-language config fields are used, which is
73
+ * correct for the default locale and wrong for every other one.
74
+ */
75
+ // Copy the dashboard owns — the greeting, the card labels — is rendered
76
+ // exactly as the workspace typed it. Translating it is the dashboard's job.
77
+ function buildTheme(config) {
78
+ return {
79
+ primaryColor: config?.primaryColor || DEFAULT_PRIMARY_COLOR,
80
+ position: config?.position || 'right',
81
+ isOnline: config?.isOnline ?? true,
82
+ offlineMessage: config && !config.isOnline && config.businessHoursEnabled && config.offlineMessage ? config.offlineMessage : undefined,
83
+ startConversationLabel: config?.startConversationLabel || 'Send us a message',
84
+ replyTimeLabel: config?.replyTimeLabel || 'We usually reply within a few minutes',
85
+ allowNewConversations: config?.allowNewConversations ?? true,
86
+ showPreviousConversations: config?.showPreviousConversations ?? true,
87
+ attachmentsEnabled: config?.attachmentsEnabled ?? true,
88
+ preChatEnabled: config?.preChatEnabled ?? false
89
+ };
90
+ }
91
+
92
+ /** `#rrggbb` → `rgba(r, g, b, alpha)`; passes non-hex colors straight through. */
93
+ function withAlpha(color, alpha) {
94
+ const rgb = hexToRgb(color);
95
+ if (!rgb) return color;
96
+ return `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${alpha})`;
97
+ }
98
+ function hexToRgb(color) {
99
+ const match = /^#?([a-f\d]{3}|[a-f\d]{6})$/i.exec(color.trim());
100
+ if (!match) return null;
101
+ let hex = match[1];
102
+ if (hex.length === 3) {
103
+ hex = hex.split('').map(char => char + char).join('');
104
+ }
105
+ const value = parseInt(hex, 16);
106
+ return [value >> 16 & 255, value >> 8 & 255, value & 255];
107
+ }
108
+
109
+ /** Linear blend between two hex colors, used to fake gradients without a native lib. */
110
+ function mixHex(from, to, ratio) {
111
+ const a = hexToRgb(from);
112
+ const b = hexToRgb(to);
113
+ if (!a || !b) return from;
114
+ const channel = index => Math.round(a[index] + (b[index] - a[index]) * ratio);
115
+ return `rgb(${channel(0)}, ${channel(1)}, ${channel(2)})`;
116
+ }
117
+
118
+ /** Pick readable foreground text for an arbitrary brand color. */
119
+ function contrastingTextColor(background) {
120
+ const rgb = hexToRgb(background);
121
+ if (!rgb) return palette.white;
122
+ const [r, g, b] = rgb;
123
+ const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
124
+ return luminance > 0.7 ? palette.ink : palette.white;
125
+ }
126
+ const shadows = exports.shadows = {
127
+ card: {
128
+ shadowColor: '#0f172a',
129
+ shadowOffset: {
130
+ width: 0,
131
+ height: 4
132
+ },
133
+ shadowOpacity: 0.08,
134
+ shadowRadius: 14,
135
+ elevation: 3
136
+ },
137
+ floating: {
138
+ shadowColor: '#000000',
139
+ shadowOffset: {
140
+ width: 0,
141
+ height: 4
142
+ },
143
+ shadowOpacity: 0.15,
144
+ shadowRadius: 12,
145
+ elevation: 6
146
+ }
147
+ };
148
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["palette","exports","white","ink","text","textMuted","textSubtle","textFaint","border","borderSoft","surface","surfaceAlt","danger","warningBg","warningBorder","warningText","warningIcon","online","disabled","radius","sm","md","lg","xl","pill","spacing","xs","xxl","fontSize","micro","caption","meta","body","input","title","heading","display","DEFAULT_PRIMARY_COLOR","buildTheme","config","primaryColor","position","isOnline","offlineMessage","businessHoursEnabled","undefined","startConversationLabel","replyTimeLabel","allowNewConversations","showPreviousConversations","attachmentsEnabled","preChatEnabled","withAlpha","color","alpha","rgb","hexToRgb","match","exec","trim","hex","length","split","map","char","join","value","parseInt","mixHex","from","to","ratio","a","b","channel","index","Math","round","contrastingTextColor","background","r","g","luminance","shadows","card","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","floating"],"sourceRoot":"../../../../src","sources":["ui/styles/theme.ts"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG;EACrBE,KAAK,EAAE,SAAS;EAChBC,GAAG,EAAE,SAAS;EACdC,IAAI,EAAE,SAAS;EACfC,SAAS,EAAE,SAAS;EACpBC,UAAU,EAAE,SAAS;EACrBC,SAAS,EAAE,SAAS;EACpBC,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,UAAU,EAAE,SAAS;EACrBC,MAAM,EAAE,SAAS;EACjBC,SAAS,EAAE,SAAS;EACpBC,aAAa,EAAE,SAAS;EACxBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,MAAM,EAAE,SAAS;EACjBC,QAAQ,EAAE;AACZ,CAAU;AAEH,MAAMC,MAAM,GAAAlB,OAAA,CAAAkB,MAAA,GAAG;EACpBC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,IAAI,EAAE;AACR,CAAU;AAEH,MAAMC,OAAO,GAAAxB,OAAA,CAAAwB,OAAA,GAAG;EACrBC,EAAE,EAAE,CAAC;EACLN,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNI,GAAG,EAAE;AACP,CAAU;;AAEV;AAC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,CAAC,CAAC,GAAG;AAC3D;;AAEA;AACO,SAASI,oBAAoBA,CAACC,UAAkB,EAAU;EAC/D,MAAMxB,GAAG,GAAGC,QAAQ,CAACuB,UAAU,CAAC;EAChC,IAAI,CAACxB,GAAG,EAAE,OAAOvD,OAAO,CAACE,KAAK;EAC9B,MAAM,CAAC8E,CAAC,EAAEC,CAAC,EAAER,CAAC,CAAC,GAAGlB,GAAG;EACrB,MAAM2B,SAAS,GAAG,CAAC,KAAK,GAAGF,CAAC,GAAG,KAAK,GAAGC,CAAC,GAAG,KAAK,GAAGR,CAAC,IAAI,GAAG;EAC3D,OAAOS,SAAS,GAAG,GAAG,GAAGlF,OAAO,CAACG,GAAG,GAAGH,OAAO,CAACE,KAAK;AACtD;AAEO,MAAMiF,OAAO,GAAAlF,OAAA,CAAAkF,OAAA,GAAG;EACrBC,IAAI,EAAE;IACJC,WAAW,EAAE,SAAS;IACtBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE;EACb,CAAC;EACDC,QAAQ,EAAE;IACRP,WAAW,EAAE,SAAS;IACtBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE;EACb;AACF,CAAU","ignoreList":[]}
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatClockTime = formatClockTime;
7
+ exports.formatDayLabel = formatDayLabel;
8
+ exports.formatRelativeTime = formatRelativeTime;
9
+ exports.isSameDay = isSameDay;
10
+ exports.pickRecentConversations = pickRecentConversations;
11
+ exports.pickTeamAgents = pickTeamAgents;
12
+ exports.sortByRecency = sortByRecency;
13
+ var _i18n = require("../../i18n.js");
14
+ /**
15
+ * Conversation selectors and formatting shared by the Home and Messages
16
+ * spaces, so the two can never disagree about ordering or wording.
17
+ * Pure and free of React so they stay trivial to test.
18
+ */
19
+
20
+ const conversationTime = conversation => {
21
+ const parsed = Date.parse(conversation.lastMessageAt || conversation.createdAt || '');
22
+ return Number.isNaN(parsed) ? 0 : parsed;
23
+ };
24
+
25
+ /**
26
+ * Newest first. The store patches a conversation in place when a message
27
+ * arrives and never reorders the array, so position is not recency — every
28
+ * surface that lists conversations has to sort for itself.
29
+ */
30
+ function sortByRecency(conversations) {
31
+ return [...conversations].sort((a, b) => conversationTime(b) - conversationTime(a));
32
+ }
33
+ function pickRecentConversations(conversations, limit = 2) {
34
+ return sortByRecency(conversations).slice(0, limit);
35
+ }
36
+
37
+ /** Distinct agents the visitor has spoken to, most recent conversation first. */
38
+ function pickTeamAgents(conversations, limit = 3) {
39
+ const seen = new Set();
40
+ const agents = [];
41
+ for (const conversation of sortByRecency(conversations)) {
42
+ const name = conversation.agentName?.trim();
43
+ if (!name) continue;
44
+ const key = name.toLowerCase();
45
+ if (seen.has(key)) continue;
46
+ seen.add(key);
47
+ agents.push({
48
+ name,
49
+ avatar: conversation.agentAvatar
50
+ });
51
+ if (agents.length >= limit) break;
52
+ }
53
+ return agents;
54
+ }
55
+
56
+ /** Every unit is a translated template, so `2h` can become `منذ ساعتين`. */
57
+
58
+ function formatRelativeTime(dateStr, labels) {
59
+ const date = new Date(dateStr);
60
+ const diffMs = Date.now() - date.getTime();
61
+ const diffMin = Math.floor(diffMs / 60000);
62
+ if (diffMin < 1) return labels.justNow;
63
+ if (diffMin < 60) return (0, _i18n.formatLabel)(labels.minutes, {
64
+ count: diffMin
65
+ });
66
+ const diffHrs = Math.floor(diffMin / 60);
67
+ if (diffHrs < 24) return (0, _i18n.formatLabel)(labels.hours, {
68
+ count: diffHrs
69
+ });
70
+ const diffDays = Math.floor(diffHrs / 24);
71
+ if (diffDays < 30) return (0, _i18n.formatLabel)(labels.days, {
72
+ count: diffDays
73
+ });
74
+ const diffMonths = Math.floor(diffDays / 30);
75
+ if (diffMonths < 12) return (0, _i18n.formatLabel)(labels.months, {
76
+ count: diffMonths
77
+ });
78
+ return (0, _i18n.formatLabel)(labels.years, {
79
+ count: Math.floor(diffDays / 365)
80
+ });
81
+ }
82
+ const startOfDay = date => new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
83
+ function isSameDay(a, b) {
84
+ return startOfDay(new Date(a)) === startOfDay(new Date(b));
85
+ }
86
+
87
+ /**
88
+ * Clock time beside a message. Intl ships with Hermes but is guarded anyway —
89
+ * a missing implementation should not blank out every timestamp in the thread.
90
+ */
91
+ function formatClockTime(dateStr, locale) {
92
+ const date = new Date(dateStr);
93
+ if (Number.isNaN(date.getTime())) return '';
94
+ try {
95
+ return new Intl.DateTimeFormat(locale, {
96
+ hour: 'numeric',
97
+ minute: '2-digit'
98
+ }).format(date);
99
+ } catch {
100
+ return `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;
101
+ }
102
+ }
103
+
104
+ /** "Today", "Yesterday", then a real date once it is older than that. */
105
+ function formatDayLabel(dateStr, locale, labels) {
106
+ const date = new Date(dateStr);
107
+ if (Number.isNaN(date.getTime())) return '';
108
+ const today = startOfDay(new Date());
109
+ const day = startOfDay(date);
110
+ if (day === today) return labels.today;
111
+ if (today - day === 86400000) return labels.yesterday;
112
+ const sameYear = date.getFullYear() === new Date().getFullYear();
113
+ try {
114
+ return new Intl.DateTimeFormat(locale, {
115
+ day: 'numeric',
116
+ month: 'short',
117
+ ...(sameYear ? {} : {
118
+ year: 'numeric'
119
+ })
120
+ }).format(date);
121
+ } catch {
122
+ return date.toDateString();
123
+ }
124
+ }
125
+ //# sourceMappingURL=conversations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_i18n","require","conversationTime","conversation","parsed","Date","parse","lastMessageAt","createdAt","Number","isNaN","sortByRecency","conversations","sort","a","b","pickRecentConversations","limit","slice","pickTeamAgents","seen","Set","agents","name","agentName","trim","key","toLowerCase","has","add","push","avatar","agentAvatar","length","formatRelativeTime","dateStr","labels","date","diffMs","now","getTime","diffMin","Math","floor","justNow","formatLabel","minutes","count","diffHrs","hours","diffDays","days","diffMonths","months","years","startOfDay","getFullYear","getMonth","getDate","isSameDay","formatClockTime","locale","Intl","DateTimeFormat","hour","minute","format","String","getHours","padStart","getMinutes","formatDayLabel","today","day","yesterday","sameYear","month","year","toDateString"],"sourceRoot":"../../../../src","sources":["ui/utils/conversations.ts"],"mappings":";;;;;;;;;;;;AAMA,IAAAA,KAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;;AAUA,MAAMC,gBAAgB,GAAIC,YAA0B,IAAa;EAC/D,MAAMC,MAAM,GAAGC,IAAI,CAACC,KAAK,CAACH,YAAY,CAACI,aAAa,IAAIJ,YAAY,CAACK,SAAS,IAAI,EAAE,CAAC;EACrF,OAAOC,MAAM,CAACC,KAAK,CAACN,MAAM,CAAC,GAAG,CAAC,GAAGA,MAAM;AAC1C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACO,SAASO,aAAaA,CAACC,aAA6B,EAAkB;EAC3E,OAAO,CAAC,GAAGA,aAAa,CAAC,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKb,gBAAgB,CAACa,CAAC,CAAC,GAAGb,gBAAgB,CAACY,CAAC,CAAC,CAAC;AACrF;AAEO,SAASE,uBAAuBA,CAACJ,aAA6B,EAAEK,KAAK,GAAG,CAAC,EAAkB;EAChG,OAAON,aAAa,CAACC,aAAa,CAAC,CAACM,KAAK,CAAC,CAAC,EAAED,KAAK,CAAC;AACrD;;AAEA;AACO,SAASE,cAAcA,CAACP,aAA6B,EAAEK,KAAK,GAAG,CAAC,EAAe;EACpF,MAAMG,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;EAC9B,MAAMC,MAAmB,GAAG,EAAE;EAE9B,KAAK,MAAMnB,YAAY,IAAIQ,aAAa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B;AACF","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.htmlToText = htmlToText;
7
+ exports.stripHtml = stripHtml;
8
+ /**
9
+ * HTML → text helpers. The CRM stores message bodies as HTML and campaign
10
+ * payloads as rich text; React Native has no DOMParser, so these are the
11
+ * regex equivalents of the web widget's `stripHtml` / `htmlToText`.
12
+ */
13
+
14
+ const ENTITIES = {
15
+ '&amp;': '&',
16
+ '&lt;': '<',
17
+ '&gt;': '>',
18
+ '&quot;': '"',
19
+ '&#39;': "'",
20
+ '&apos;': "'",
21
+ '&nbsp;': ' '
22
+ };
23
+ function decodeEntities(text) {
24
+ return text.replace(/&(amp|lt|gt|quot|#39|apos|nbsp);/g, match => ENTITIES[match] ?? match).replace(/&#(\d+);/g, (_match, code) => String.fromCharCode(Number(code)));
25
+ }
26
+
27
+ /** Block-level tags become newlines so paragraphs survive the strip. */
28
+ function stripHtml(html) {
29
+ if (!html) return '';
30
+ return decodeEntities(html.replace(/<br\s*\/?>/gi, '\n').replace(/<\/(p|div|li|h[1-6]|blockquote|tr)>/gi, '\n').replace(/<li[^>]*>/gi, '• ').replace(/<[^>]+>/g, '')).replace(/\n{3,}/g, '\n\n').trim();
31
+ }
32
+
33
+ /** Single-line flattening used for campaign cards and list snippets. */
34
+ function htmlToText(html) {
35
+ if (!html) return '';
36
+ const spaced = html.replace(/<\/(p|div|li|h[1-6]|blockquote)>/gi, ' $&').replace(/<br\s*\/?>/gi, ' ');
37
+ return renderFallbackTokens(decodeEntities(spaced.replace(/<[^>]+>/g, ' ')).replace(/\s+/g, ' ').trim());
38
+ }
39
+
40
+ /** Unresolved merge tags would otherwise leak `{{ contact.firstName }}` to visitors. */
41
+ function renderFallbackTokens(text) {
42
+ return text.replace(/\{\{\s*contact\.firstName\s*\}\}/g, 'there').replace(/\{\{\s*contact\.fullName\s*\}\}/g, 'there').replace(/\{\{\s*contact\.[^}]+\s*\}\}/g, '').replace(/\s+/g, ' ').trim();
43
+ }
44
+ //# sourceMappingURL=html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ENTITIES","decodeEntities","text","replace","match","_match","code","String","fromCharCode","Number","stripHtml","html","trim","htmlToText","spaced","renderFallbackTokens"],"sourceRoot":"../../../../src","sources":["ui/utils/html.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,QAAgC,GAAG;EACvC,OAAO,EAAE,GAAG;EACZ,MAAM,EAAE,GAAG;EACX,MAAM,EAAE,GAAG;EACX,QAAQ,EAAE,GAAG;EACb,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,GAAG;EACb,QAAQ,EAAE;AACZ,CAAC;AAED,SAASC,cAAcA,CAACC,IAAY,EAAU;EAC5C,OAAOA,IAAI,CACRC,OAAO,CAAC,mCAAmC,EAAGC,KAAK,IAAKJ,QAAQ,CAACI,KAAK,CAAC,IAAIA,KAAK,CAAC,CACjFD,OAAO,CAAC,WAAW,EAAE,CAACE,MAAM,EAAEC,IAAI,KAAKC,MAAM,CAACC,YAAY,CAACC,MAAM,CAACH,IAAI,CAAC,CAAC,CAAC;AAC9E;;AAEA;AACO,SAASI,SAASA,CAACC,IAAY,EAAU;EAC9C,IAAI,CAACA,IAAI,EAAE,OAAO,EAAE;EACpB,OAAOV,cAAc,CACnBU,IAAI,CACDR,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAC7BA,OAAO,CAAC,uCAAuC,EAAE,IAAI,CAAC,CACtDA,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAC5BA,OAAO,CAAC,UAAU,EAAE,EAAE,CAC3B,CAAC,CACEA,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAC1BS,IAAI,CAAC,CAAC;AACX;;AAEA;AACO,SAASC,UAAUA,CAACF,IAAY,EAAU;EAC/C,IAAI,CAACA,IAAI,EAAE,OAAO,EAAE;EACpB,MAAMG,MAAM,GAAGH,IAAI,CAChBR,OAAO,CAAC,oCAAoC,EAAE,KAAK,CAAC,CACpDA,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;EAC/B,OAAOY,oBAAoB,CACzBd,cAAc,CAACa,MAAM,CAACX,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAC5CA,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CACpBS,IAAI,CAAC,CACV,CAAC;AACH;;AAEA;AACA,SAASG,oBAAoBA,CAACb,IAAY,EAAU;EAClD,OAAOA,IAAI,CACRC,OAAO,CAAC,mCAAmC,EAAE,OAAO,CAAC,CACrDA,OAAO,CAAC,kCAAkC,EAAE,OAAO,CAAC,CACpDA,OAAO,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAC5CA,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CACpBS,IAAI,CAAC,CAAC;AACX","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VERTICAL = exports.DIAGONAL = void 0;
7
+ exports.getNativeGradient = getNativeGradient;
8
+ /**
9
+ * A real gradient when the host app happens to ship one, stacked bands when it
10
+ * does not.
11
+ *
12
+ * Stacked bands can only ever approximate a ramp: each strip is a solid fill,
13
+ * and once the strips are thin enough to hide the colour steps their heights
14
+ * start landing on fractional pixels, which shows up as faint seams. A native
15
+ * gradient has neither problem, so we use one where it exists — the same
16
+ * "borrow it from the host" approach as `safe-area.ts` and `storage.ts`.
17
+ *
18
+ * Resolution happens once at module load so component identity stays stable
19
+ * across renders.
20
+ */
21
+
22
+ let nativeGradient = null;
23
+ try {
24
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
25
+ const mod = require('react-native-linear-gradient');
26
+ const component = mod?.default ?? mod?.LinearGradient;
27
+ if (component) nativeGradient = component;
28
+ } catch {
29
+ nativeGradient = null;
30
+ }
31
+
32
+ /** Null when the host installed no gradient library; callers fall back to bands. */
33
+ function getNativeGradient() {
34
+ return nativeGradient;
35
+ }
36
+
37
+ /** Top-to-bottom. The only direction the band fallback can draw. */
38
+ const VERTICAL = exports.VERTICAL = {
39
+ start: {
40
+ x: 0.5,
41
+ y: 0
42
+ },
43
+ end: {
44
+ x: 0.5,
45
+ y: 1
46
+ }
47
+ };
48
+
49
+ /**
50
+ * Top-left to bottom-right, the same way round in every language. A brand
51
+ * ramp is a visual, not a sentence, so it does not mirror with the reading
52
+ * direction. Needs a native gradient: stacked bands are horizontal strips and
53
+ * can only ever run top to bottom.
54
+ */
55
+ const DIAGONAL = exports.DIAGONAL = {
56
+ start: {
57
+ x: 0,
58
+ y: 0
59
+ },
60
+ end: {
61
+ x: 1,
62
+ y: 1
63
+ }
64
+ };
65
+ //# sourceMappingURL=native-gradient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["nativeGradient","mod","require","component","default","LinearGradient","getNativeGradient","VERTICAL","exports","start","x","y","end","DIAGONAL"],"sourceRoot":"../../../../src","sources":["ui/utils/native-gradient.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,IAAIA,cAAyD,GAAG,IAAI;AAEpE,IAAI;EACF;EACA,MAAMC,GAAG,GAAGC,OAAO,CAAC,8BAA8B,CAAC;EACnD,MAAMC,SAAS,GAAGF,GAAG,EAAEG,OAAO,IAAIH,GAAG,EAAEI,cAAc;EACrD,IAAIF,SAAS,EAAEH,cAAc,GAAGG,SAA+C;AACjF,CAAC,CAAC,MAAM;EACNH,cAAc,GAAG,IAAI;AACvB;;AAEA;AACO,SAASM,iBAAiBA,CAAA,EAA8C;EAC7E,OAAON,cAAc;AACvB;;AAEA;AACO,MAAMO,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG;EACtBE,KAAK,EAAE;IAAEC,CAAC,EAAE,GAAG;IAAEC,CAAC,EAAE;EAAE,CAAC;EACvBC,GAAG,EAAE;IAAEF,CAAC,EAAE,GAAG;IAAEC,CAAC,EAAE;EAAE;AACtB,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,QAAQ,GAAAL,OAAA,CAAAK,QAAA,GAAG;EACtBJ,KAAK,EAAE;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC;EACrBC,GAAG,EAAE;IAAEF,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE;AACpB,CAAU","ignoreList":[]}