@adminide-stack/yantra-mobile 12.0.195 → 12.0.196-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (382) hide show
  1. package/lib/components/CustomDrawer.js +17 -1
  2. package/lib/components/CustomDrawer.js.map +1 -1
  3. package/lib/compute.js +57 -1
  4. package/lib/compute.js.map +1 -1
  5. package/lib/config/env-config.js +11 -1
  6. package/lib/config/env-config.js.map +1 -1
  7. package/lib/features/agent-chat/NativeAgentChat.js +7 -0
  8. package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
  9. package/lib/features/canvas/extendVideo.js +5 -1
  10. package/lib/features/canvas/extendVideo.js.map +1 -1
  11. package/lib/features/canvas/workflow/StepSheet.js +18 -1
  12. package/lib/features/canvas/workflow/StepSheet.js.map +1 -1
  13. package/lib/features/canvas/workflow/workflowSteps.js +102 -31
  14. package/lib/features/canvas/workflow/workflowSteps.js.map +1 -1
  15. package/lib/features/chat/ComposerMicSend.js +35 -0
  16. package/lib/features/chat/ComposerMicSend.js.map +1 -0
  17. package/lib/features/chat/ComposerModeSwitch.js +64 -1
  18. package/lib/features/chat/ComposerModeSwitch.js.map +1 -1
  19. package/lib/features/chat/askUser.js +6 -1
  20. package/lib/features/chat/askUser.js.map +1 -1
  21. package/lib/features/connectors/ConnectorSheet.js +443 -0
  22. package/lib/features/connectors/ConnectorSheet.js.map +1 -0
  23. package/lib/features/connectors/ConnectorsPage.js +320 -0
  24. package/lib/features/connectors/ConnectorsPage.js.map +1 -0
  25. package/lib/features/connectors/connectConnector.js +278 -0
  26. package/lib/features/connectors/connectConnector.js.map +1 -0
  27. package/lib/features/connectors/connectorCatalog.js +222 -0
  28. package/lib/features/connectors/connectorCatalog.js.map +1 -0
  29. package/lib/features/connectors/useConnectorCatalog.js +153 -0
  30. package/lib/features/connectors/useConnectorCatalog.js.map +1 -0
  31. package/lib/features/home/needsYou/HomeNeedsYou.js +618 -0
  32. package/lib/features/home/needsYou/HomeNeedsYou.js.map +1 -0
  33. package/lib/features/home/needsYou/chatFollowUps.js +333 -0
  34. package/lib/features/home/needsYou/chatFollowUps.js.map +1 -0
  35. package/lib/features/home/needsYou/format.js +47 -0
  36. package/lib/features/home/needsYou/format.js.map +1 -0
  37. package/lib/features/home/needsYou/historyText.js +40 -0
  38. package/lib/features/home/needsYou/historyText.js.map +1 -0
  39. package/lib/features/home/needsYou/inboxHighlights.js +152 -0
  40. package/lib/features/home/needsYou/inboxHighlights.js.map +1 -0
  41. package/lib/features/home/needsYou/panelsSettings.js +71 -0
  42. package/lib/features/home/needsYou/panelsSettings.js.map +1 -0
  43. package/lib/features/home/needsYou/ported/commandConfirmProtocol.js +13 -0
  44. package/lib/features/home/needsYou/ported/commandConfirmProtocol.js.map +1 -0
  45. package/lib/features/home/needsYou/ported/paymentApprovalProtocol.js +91 -0
  46. package/lib/features/home/needsYou/ported/paymentApprovalProtocol.js.map +1 -0
  47. package/lib/features/home/needsYou/ported/resultCardModels.js +659 -0
  48. package/lib/features/home/needsYou/ported/resultCardModels.js.map +1 -0
  49. package/lib/features/home/needsYou/types.js +1 -0
  50. package/lib/features/home/needsYou/types.js.map +1 -0
  51. package/lib/features/home/needsYou/useChatFollowUps.js +149 -0
  52. package/lib/features/home/needsYou/useChatFollowUps.js.map +1 -0
  53. package/lib/features/home/needsYou/useHomeBriefing.js +68 -0
  54. package/lib/features/home/needsYou/useHomeBriefing.js.map +1 -0
  55. package/lib/features/home/needsYou/useInboxHighlights.js +173 -0
  56. package/lib/features/home/needsYou/useInboxHighlights.js.map +1 -0
  57. package/lib/features/home/needsYou/usePanelsSettings.js +105 -0
  58. package/lib/features/home/needsYou/usePanelsSettings.js.map +1 -0
  59. package/lib/features/shopping/DealCard.js +8 -1
  60. package/lib/features/shopping/DealCard.js.map +1 -1
  61. package/lib/features/shopping/DealRails.js +24 -7
  62. package/lib/features/shopping/DealRails.js.map +1 -1
  63. package/lib/features/shopping/DealsPanel.js +1 -1
  64. package/lib/features/shopping/DealsPanel.js.map +1 -1
  65. package/lib/features/shopping/HolidayDealsPanel.js +529 -0
  66. package/lib/features/shopping/HolidayDealsPanel.js.map +1 -0
  67. package/lib/features/shopping/HolidayDealsParts.js +954 -0
  68. package/lib/features/shopping/HolidayDealsParts.js.map +1 -0
  69. package/lib/features/shopping/HolidayOffers.js +351 -0
  70. package/lib/features/shopping/HolidayOffers.js.map +1 -0
  71. package/lib/features/shopping/ProductCard.js +80 -14
  72. package/lib/features/shopping/ProductCard.js.map +1 -1
  73. package/lib/features/shopping/ProductDetailSheet.js +22 -3
  74. package/lib/features/shopping/ProductDetailSheet.js.map +1 -1
  75. package/lib/features/shopping/SavedPanel.js +341 -5
  76. package/lib/features/shopping/SavedPanel.js.map +1 -1
  77. package/lib/features/shopping/SearchResults.js +8 -2
  78. package/lib/features/shopping/SearchResults.js.map +1 -1
  79. package/lib/features/shopping/ShoppingAgentChatPane.js +12 -0
  80. package/lib/features/shopping/ShoppingAgentChatPane.js.map +1 -1
  81. package/lib/features/shopping/ShoppingExperience.js +56 -19
  82. package/lib/features/shopping/ShoppingExperience.js.map +1 -1
  83. package/lib/features/shopping/TrendingSections.js +13 -4
  84. package/lib/features/shopping/TrendingSections.js.map +1 -1
  85. package/lib/features/shopping/WatchlistPanel.js +61 -5
  86. package/lib/features/shopping/WatchlistPanel.js.map +1 -1
  87. package/lib/features/shopping/catalog.js +41 -2
  88. package/lib/features/shopping/catalog.js.map +1 -1
  89. package/lib/features/shopping/chat/brainRouter.js +14 -0
  90. package/lib/features/shopping/chat/brainRouter.js.map +1 -1
  91. package/lib/features/shopping/chat/shoppingTurn.js +88 -16
  92. package/lib/features/shopping/chat/shoppingTurn.js.map +1 -1
  93. package/lib/features/shopping/hooks/useHolidayDeals.js +388 -0
  94. package/lib/features/shopping/hooks/useHolidayDeals.js.map +1 -0
  95. package/lib/features/shopping/hooks/useProductMedia.js +33 -6
  96. package/lib/features/shopping/hooks/useProductMedia.js.map +1 -1
  97. package/lib/features/shopping/hooks/useShoppingHistorySync.js +8 -4
  98. package/lib/features/shopping/hooks/useShoppingHistorySync.js.map +1 -1
  99. package/lib/features/shopping/hooks/useTrendingProducts.js +11 -3
  100. package/lib/features/shopping/hooks/useTrendingProducts.js.map +1 -1
  101. package/lib/features/shopping/savedProducts.js +76 -6
  102. package/lib/features/shopping/savedProducts.js.map +1 -1
  103. package/lib/features/shopping/services/aiRelevance.js +212 -0
  104. package/lib/features/shopping/services/aiRelevance.js.map +1 -0
  105. package/lib/features/shopping/services/blackFriday.js +301 -0
  106. package/lib/features/shopping/services/blackFriday.js.map +1 -0
  107. package/lib/features/shopping/services/blackFridayBrowserSites.js +137 -0
  108. package/lib/features/shopping/services/blackFridayBrowserSites.js.map +1 -0
  109. package/lib/features/shopping/services/catalogProductSearch.js +21 -3
  110. package/lib/features/shopping/services/catalogProductSearch.js.map +1 -1
  111. package/lib/features/shopping/services/holidayDeals.js +143 -0
  112. package/lib/features/shopping/services/holidayDeals.js.map +1 -0
  113. package/lib/features/shopping/services/mediaShape.js +7 -0
  114. package/lib/features/shopping/services/mediaShape.js.map +1 -0
  115. package/lib/features/shopping/services/modelStep.js +95 -0
  116. package/lib/features/shopping/services/modelStep.js.map +1 -0
  117. package/lib/features/shopping/services/modelWords.js +14 -0
  118. package/lib/features/shopping/services/modelWords.js.map +1 -0
  119. package/lib/features/shopping/services/productAvailability.js +5 -1
  120. package/lib/features/shopping/services/productAvailability.js.map +1 -1
  121. package/lib/features/shopping/services/productFilters.js +2 -2
  122. package/lib/features/shopping/services/productFilters.js.map +1 -1
  123. package/lib/features/shopping/services/productMedia.js +103 -18
  124. package/lib/features/shopping/services/productMedia.js.map +1 -1
  125. package/lib/features/shopping/services/retailerUrl.js +11 -8
  126. package/lib/features/shopping/services/retailerUrl.js.map +1 -1
  127. package/lib/features/shopping/services/salesDealsStore.js +3 -2
  128. package/lib/features/shopping/services/salesDealsStore.js.map +1 -1
  129. package/lib/features/shopping/services/savedReads.js +82 -0
  130. package/lib/features/shopping/services/savedReads.js.map +1 -0
  131. package/lib/features/shopping/services/searchCardFields.js +2 -0
  132. package/lib/features/shopping/services/searchCardFields.js.map +1 -1
  133. package/lib/features/shopping/services/searchRelevance.js +154 -24
  134. package/lib/features/shopping/services/searchRelevance.js.map +1 -1
  135. package/lib/features/shopping/services/secondHand.js +12 -0
  136. package/lib/features/shopping/services/secondHand.js.map +1 -0
  137. package/lib/features/shopping/services/shoppingProductSearch.js +82 -10
  138. package/lib/features/shopping/services/shoppingProductSearch.js.map +1 -1
  139. package/lib/features/shopping/services/shoppingSearchConnectorClient.js +14 -1
  140. package/lib/features/shopping/services/shoppingSearchConnectorClient.js.map +1 -1
  141. package/lib/features/shopping/services/shoppingSubgraph.js +2 -1
  142. package/lib/features/shopping/services/shoppingSubgraph.js.map +1 -1
  143. package/lib/features/shopping/services/storedGalleries.js +130 -0
  144. package/lib/features/shopping/services/storedGalleries.js.map +1 -0
  145. package/lib/features/shopping/services/usedSites.js +263 -0
  146. package/lib/features/shopping/services/usedSites.js.map +1 -0
  147. package/lib/features/shopping/services/verifyProducts.js +3 -3
  148. package/lib/features/shopping/services/verifyProducts.js.map +1 -1
  149. package/lib/features/shopping/services/watchDeal.js +61 -0
  150. package/lib/features/shopping/services/watchDeal.js.map +1 -0
  151. package/lib/features/shopping/shoppingRuntime.js +7 -2
  152. package/lib/features/shopping/shoppingRuntime.js.map +1 -1
  153. package/lib/features/shopping/state/accountCaches.js +20 -0
  154. package/lib/features/shopping/state/accountCaches.js.map +1 -0
  155. package/lib/features/shopping/state/holidayDealsRequest.js +22 -0
  156. package/lib/features/shopping/state/holidayDealsRequest.js.map +1 -0
  157. package/lib/features/shopping/tutorials/ShoppingTutorialDock.js +1 -1
  158. package/lib/features/shopping/tutorials/ShoppingTutorialDock.js.map +1 -1
  159. package/lib/features/shopping/tutorials/shoppingTutorials.js +2 -0
  160. package/lib/features/shopping/tutorials/shoppingTutorials.js.map +1 -1
  161. package/lib/features/shopping/useShoppingSearch.js +74 -18
  162. package/lib/features/shopping/useShoppingSearch.js.map +1 -1
  163. package/lib/features/team-chat/TeamChatExperience.js +474 -0
  164. package/lib/features/team-chat/TeamChatExperience.js.map +1 -0
  165. package/lib/features/team-chat/api/client.js +198 -0
  166. package/lib/features/team-chat/api/client.js.map +1 -0
  167. package/lib/features/team-chat/api/live.js +160 -0
  168. package/lib/features/team-chat/api/live.js.map +1 -0
  169. package/lib/features/team-chat/api/ops.js +241 -0
  170. package/lib/features/team-chat/api/ops.js.map +1 -0
  171. package/lib/features/team-chat/app.js +12 -0
  172. package/lib/features/team-chat/app.js.map +1 -0
  173. package/lib/features/team-chat/components/Avatar.js +107 -0
  174. package/lib/features/team-chat/components/Avatar.js.map +1 -0
  175. package/lib/features/team-chat/components/Composer.js +641 -0
  176. package/lib/features/team-chat/components/Composer.js.map +1 -0
  177. package/lib/features/team-chat/components/Dialogs.js +598 -0
  178. package/lib/features/team-chat/components/Dialogs.js.map +1 -0
  179. package/lib/features/team-chat/components/EmojiPicker.js +165 -0
  180. package/lib/features/team-chat/components/EmojiPicker.js.map +1 -0
  181. package/lib/features/team-chat/components/MessageItem.js +658 -0
  182. package/lib/features/team-chat/components/MessageItem.js.map +1 -0
  183. package/lib/features/team-chat/components/MessageList.js +248 -0
  184. package/lib/features/team-chat/components/MessageList.js.map +1 -0
  185. package/lib/features/team-chat/components/Mrkdwn.js +228 -0
  186. package/lib/features/team-chat/components/Mrkdwn.js.map +1 -0
  187. package/lib/features/team-chat/components/QuickSwitcher.js +215 -0
  188. package/lib/features/team-chat/components/QuickSwitcher.js.map +1 -0
  189. package/lib/features/team-chat/components/ui.js +662 -0
  190. package/lib/features/team-chat/components/ui.js.map +1 -0
  191. package/lib/features/team-chat/nativeTeamChatRegistry.js +15 -0
  192. package/lib/features/team-chat/nativeTeamChatRegistry.js.map +1 -0
  193. package/lib/features/team-chat/state/fetched.js +39 -0
  194. package/lib/features/team-chat/state/fetched.js.map +1 -0
  195. package/lib/features/team-chat/state/lists.js +230 -0
  196. package/lib/features/team-chat/state/lists.js.map +1 -0
  197. package/lib/features/team-chat/state/store.js +1108 -0
  198. package/lib/features/team-chat/state/store.js.map +1 -0
  199. package/lib/features/team-chat/state/useChannelDirectory.js +21 -0
  200. package/lib/features/team-chat/state/useChannelDirectory.js.map +1 -0
  201. package/lib/features/team-chat/theme.js +77 -0
  202. package/lib/features/team-chat/theme.js.map +1 -0
  203. package/lib/features/team-chat/utils/composeText.js +72 -0
  204. package/lib/features/team-chat/utils/composeText.js.map +1 -0
  205. package/lib/features/team-chat/utils/emoji.js +369 -0
  206. package/lib/features/team-chat/utils/emoji.js.map +1 -0
  207. package/lib/features/team-chat/utils/format.js +109 -0
  208. package/lib/features/team-chat/utils/format.js.map +1 -0
  209. package/lib/features/team-chat/utils/messageRows.js +24 -0
  210. package/lib/features/team-chat/utils/messageRows.js.map +1 -0
  211. package/lib/features/team-chat/utils/mrkdwn.js +222 -0
  212. package/lib/features/team-chat/utils/mrkdwn.js.map +1 -0
  213. package/lib/features/team-chat/utils/notify.js +47 -0
  214. package/lib/features/team-chat/utils/notify.js.map +1 -0
  215. package/lib/features/team-chat/utils/pickFiles.js +81 -0
  216. package/lib/features/team-chat/utils/pickFiles.js.map +1 -0
  217. package/lib/features/team-chat/views/ActivityView.js +235 -0
  218. package/lib/features/team-chat/views/ActivityView.js.map +1 -0
  219. package/lib/features/team-chat/views/BrowseView.js +179 -0
  220. package/lib/features/team-chat/views/BrowseView.js.map +1 -0
  221. package/lib/features/team-chat/views/ChannelView.js +475 -0
  222. package/lib/features/team-chat/views/ChannelView.js.map +1 -0
  223. package/lib/features/team-chat/views/DetailsPane.js +816 -0
  224. package/lib/features/team-chat/views/DetailsPane.js.map +1 -0
  225. package/lib/features/team-chat/views/DraftsView.js +212 -0
  226. package/lib/features/team-chat/views/DraftsView.js.map +1 -0
  227. package/lib/features/team-chat/views/FilesView.js +152 -0
  228. package/lib/features/team-chat/views/FilesView.js.map +1 -0
  229. package/lib/features/team-chat/views/NewMessageView.js +286 -0
  230. package/lib/features/team-chat/views/NewMessageView.js.map +1 -0
  231. package/lib/features/team-chat/views/PeopleView.js +118 -0
  232. package/lib/features/team-chat/views/PeopleView.js.map +1 -0
  233. package/lib/features/team-chat/views/ProfilePane.js +220 -0
  234. package/lib/features/team-chat/views/ProfilePane.js.map +1 -0
  235. package/lib/features/team-chat/views/SavedView.js +113 -0
  236. package/lib/features/team-chat/views/SavedView.js.map +1 -0
  237. package/lib/features/team-chat/views/SearchView.js +307 -0
  238. package/lib/features/team-chat/views/SearchView.js.map +1 -0
  239. package/lib/features/team-chat/views/Sidebar.js +368 -0
  240. package/lib/features/team-chat/views/Sidebar.js.map +1 -0
  241. package/lib/features/team-chat/views/ThreadPane.js +139 -0
  242. package/lib/features/team-chat/views/ThreadPane.js.map +1 -0
  243. package/lib/features/team-chat/views/ThreadsView.js +157 -0
  244. package/lib/features/team-chat/views/ThreadsView.js.map +1 -0
  245. package/lib/features/webbuilder/WebBuilderExperience.js +276 -42
  246. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  247. package/lib/features/webbuilder/buildFragments.js +10 -4
  248. package/lib/features/webbuilder/buildFragments.js.map +1 -1
  249. package/lib/features/webbuilder/components/AssetChips.js +61 -0
  250. package/lib/features/webbuilder/components/AssetChips.js.map +1 -0
  251. package/lib/features/webbuilder/components/AssetSiteChooser.js +100 -0
  252. package/lib/features/webbuilder/components/AssetSiteChooser.js.map +1 -0
  253. package/lib/features/webbuilder/components/CommentsLayer.js +485 -0
  254. package/lib/features/webbuilder/components/CommentsLayer.js.map +1 -0
  255. package/lib/features/webbuilder/components/Composer.js +16 -2
  256. package/lib/features/webbuilder/components/Composer.js.map +1 -1
  257. package/lib/features/webbuilder/components/ComposerModeSwitch.js +71 -0
  258. package/lib/features/webbuilder/components/ComposerModeSwitch.js.map +1 -0
  259. package/lib/features/webbuilder/components/MyAssetsPicker.js +500 -0
  260. package/lib/features/webbuilder/components/MyAssetsPicker.js.map +1 -0
  261. package/lib/features/webbuilder/components/PlanDocument.js +165 -0
  262. package/lib/features/webbuilder/components/PlanDocument.js.map +1 -0
  263. package/lib/features/webbuilder/components/PlanDraftCard.js +205 -0
  264. package/lib/features/webbuilder/components/PlanDraftCard.js.map +1 -0
  265. package/lib/features/webbuilder/components/PlanView.js +788 -0
  266. package/lib/features/webbuilder/components/PlanView.js.map +1 -0
  267. package/lib/features/webbuilder/components/PreviewConsoleSheet.js +334 -0
  268. package/lib/features/webbuilder/components/PreviewConsoleSheet.js.map +1 -0
  269. package/lib/features/webbuilder/components/PreviewFrame.js +45 -3
  270. package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
  271. package/lib/features/webbuilder/components/PreviewScreen.js +94 -10
  272. package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
  273. package/lib/features/webbuilder/components/ProjectChat.js +84 -14
  274. package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
  275. package/lib/features/webbuilder/components/StudioHome.js +69 -6
  276. package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
  277. package/lib/features/webbuilder/components/StyleDirectionsSheet.js +291 -0
  278. package/lib/features/webbuilder/components/StyleDirectionsSheet.js.map +1 -0
  279. package/lib/features/webbuilder/components/VersionChangesView.js +574 -0
  280. package/lib/features/webbuilder/components/VersionChangesView.js.map +1 -0
  281. package/lib/features/webbuilder/components/VersionPreviewView.js +186 -0
  282. package/lib/features/webbuilder/components/VersionPreviewView.js.map +1 -0
  283. package/lib/features/webbuilder/components/VersionsSheet.js +673 -16
  284. package/lib/features/webbuilder/components/VersionsSheet.js.map +1 -1
  285. package/lib/features/webbuilder/connectorTemplates.js +6 -1
  286. package/lib/features/webbuilder/connectorTemplates.js.map +1 -1
  287. package/lib/features/webbuilder/myAssets.js +101 -0
  288. package/lib/features/webbuilder/myAssets.js.map +1 -0
  289. package/lib/features/webbuilder/planChat.js +146 -0
  290. package/lib/features/webbuilder/planChat.js.map +1 -0
  291. package/lib/features/webbuilder/planDocument.js +89 -0
  292. package/lib/features/webbuilder/planDocument.js.map +1 -0
  293. package/lib/features/webbuilder/planStore.js +55 -0
  294. package/lib/features/webbuilder/planStore.js.map +1 -0
  295. package/lib/features/webbuilder/previewCommentsScript.js +218 -0
  296. package/lib/features/webbuilder/previewCommentsScript.js.map +1 -0
  297. package/lib/features/webbuilder/previewConsoleScript.js +39 -0
  298. package/lib/features/webbuilder/previewConsoleScript.js.map +1 -0
  299. package/lib/features/webbuilder/styleDirections.js +85 -0
  300. package/lib/features/webbuilder/styleDirections.js.map +1 -0
  301. package/lib/features/webbuilder/useCanvasComments.js +335 -0
  302. package/lib/features/webbuilder/useCanvasComments.js.map +1 -0
  303. package/lib/features/webbuilder/useCatalogTemplates.js +37 -0
  304. package/lib/features/webbuilder/useCatalogTemplates.js.map +1 -0
  305. package/lib/features/webbuilder/usePlanMode.js +145 -0
  306. package/lib/features/webbuilder/usePlanMode.js.map +1 -0
  307. package/lib/features/webbuilder/useStyleDirections.js +112 -0
  308. package/lib/features/webbuilder/useStyleDirections.js.map +1 -0
  309. package/lib/features/webbuilder/web/assets/assetsApi.js +174 -0
  310. package/lib/features/webbuilder/web/assets/assetsApi.js.map +1 -0
  311. package/lib/features/webbuilder/web/assets/assetsApi.ts +173 -0
  312. package/lib/features/webbuilder/web/assets/myAssets.js +341 -0
  313. package/lib/features/webbuilder/web/assets/myAssets.js.map +1 -0
  314. package/lib/features/webbuilder/web/assets/myAssets.ts +396 -0
  315. package/lib/features/webbuilder/web/canvas/elementName.js +46 -0
  316. package/lib/features/webbuilder/web/canvas/elementName.js.map +1 -0
  317. package/lib/features/webbuilder/web/canvas/visualEditorBridge.js +95 -0
  318. package/lib/features/webbuilder/web/canvas/visualEditorBridge.js.map +1 -0
  319. package/lib/features/webbuilder/web/chat/agentTurn.js +24 -0
  320. package/lib/features/webbuilder/web/chat/agentTurn.js.map +1 -0
  321. package/lib/features/webbuilder/web/chat/planMode.js +164 -0
  322. package/lib/features/webbuilder/web/chat/planMode.js.map +1 -0
  323. package/lib/features/webbuilder/web/chat/realPlans.js +66 -0
  324. package/lib/features/webbuilder/web/chat/realPlans.js.map +1 -0
  325. package/lib/features/webbuilder/web/comments/comments.js +336 -0
  326. package/lib/features/webbuilder/web/comments/comments.js.map +1 -0
  327. package/lib/features/webbuilder/web/comments/commentsApi.js +59 -0
  328. package/lib/features/webbuilder/web/comments/commentsApi.js.map +1 -0
  329. package/lib/features/webbuilder/web/components/planView.js +21 -0
  330. package/lib/features/webbuilder/web/components/planView.js.map +1 -0
  331. package/lib/features/webbuilder/web/console/consolePanel.js +43 -0
  332. package/lib/features/webbuilder/web/console/consolePanel.js.map +1 -0
  333. package/lib/features/webbuilder/web/console/previewConsole.js +256 -0
  334. package/lib/features/webbuilder/web/console/previewConsole.js.map +1 -0
  335. package/lib/features/webbuilder/web/console/usePreviewConsole.js +147 -0
  336. package/lib/features/webbuilder/web/console/usePreviewConsole.js.map +1 -0
  337. package/lib/features/webbuilder/web/design/directions.js +419 -1
  338. package/lib/features/webbuilder/web/design/directions.js.map +1 -1
  339. package/lib/features/webbuilder/web/history/diffActions.js +222 -0
  340. package/lib/features/webbuilder/web/history/diffActions.js.map +1 -0
  341. package/lib/features/webbuilder/web/history/diffHighlight.js +18 -0
  342. package/lib/features/webbuilder/web/history/diffHighlight.js.map +1 -0
  343. package/lib/features/webbuilder/web/history/versionActions.js +272 -0
  344. package/lib/features/webbuilder/web/history/versionActions.js.map +1 -0
  345. package/lib/features/webbuilder/web/history/versionDiff.js +338 -0
  346. package/lib/features/webbuilder/web/history/versionDiff.js.map +1 -0
  347. package/lib/features/webbuilder/web/history/versionPreview.js +83 -0
  348. package/lib/features/webbuilder/web/history/versionPreview.js.map +1 -0
  349. package/lib/features/webbuilder/web/history/versionPreviewMachine.js +150 -0
  350. package/lib/features/webbuilder/web/history/versionPreviewMachine.js.map +1 -0
  351. package/lib/features/webbuilder/web/history/versions.js +326 -1
  352. package/lib/features/webbuilder/web/history/versions.js.map +1 -1
  353. package/lib/features/webbuilder/web/hosted/hostedTurn.js +36 -0
  354. package/lib/features/webbuilder/web/hosted/hostedTurn.js.map +1 -0
  355. package/lib/features/webbuilder/web/studio/brandKit.js +25 -0
  356. package/lib/features/webbuilder/web/studio/brandKit.js.map +1 -0
  357. package/lib/features/webbuilder/web/utils/promptSafe.js +15 -0
  358. package/lib/features/webbuilder/web/utils/promptSafe.js.map +1 -0
  359. package/lib/features/webbuilder/web/webServices.js +3 -1
  360. package/lib/features/webbuilder/web/webServices.js.map +1 -1
  361. package/lib/index.js +1 -1
  362. package/lib/index.js.map +1 -1
  363. package/lib/routes.json +55 -0
  364. package/lib/screens/Account/index.js +13 -5
  365. package/lib/screens/Account/index.js.map +1 -1
  366. package/lib/screens/Chat/index.js +16 -0
  367. package/lib/screens/Chat/index.js.map +1 -1
  368. package/lib/screens/Home/HomeScreen.js +202 -39
  369. package/lib/screens/Home/HomeScreen.js.map +1 -1
  370. package/lib/screens/Home/components/HomeHero.js +52 -38
  371. package/lib/screens/Home/components/HomeHero.js.map +1 -1
  372. package/lib/screens/Home/components/homeCatalog.js +8 -1
  373. package/lib/screens/Home/components/homeCatalog.js.map +1 -1
  374. package/lib/screens/TeamChat/index.js +41 -0
  375. package/lib/screens/TeamChat/index.js.map +1 -0
  376. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +9 -2
  377. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -1
  378. package/lib/screens/WebBuilderNative/index.js +13 -3
  379. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  380. package/lib/screens/WebBuilderNative/useConnectorTemplates.js +2 -2
  381. package/lib/screens/WebBuilderNative/useConnectorTemplates.js.map +1 -1
  382. package/package.json +4 -4
@@ -0,0 +1,641 @@
1
+ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useMemo,useState,useRef,useEffect,useCallback}from'react';import {View,StyleSheet,Text,ScrollView,Pressable,TextInput,Platform,ActionSheetIOS,Alert}from'react-native';import {Ionicons}from'@expo/vector-icons';import {api}from'../api/ops.js';import {uploadFile}from'../api/client.js';import {useApp,usePalette,useChat}from'../app.js';import {fromTokens,emptyPicks,toTokens,completionAt,wrapSelection}from'../utils/composeText.js';import {searchEmoji}from'../utils/emoji.js';import {nameOf,fileSize,channelTitle}from'../utils/format.js';import {pickPhotos,pickDocuments}from'../utils/pickFiles.js';import {Avatar}from'./Avatar.js';import {personRank}from'./Dialogs.js';import {EmojiPicker,rememberEmoji}from'./EmojiPicker.js';import {ChannelGlyph,Sheet,Field,Input,Button}from'./ui.js';var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ function Composer({
21
+ channel,
22
+ threadRootId,
23
+ placeholder,
24
+ initialDraft
25
+ }) {
26
+ const app = useApp();
27
+ const p = usePalette();
28
+ const {
29
+ actions
30
+ } = app.store;
31
+ const people = useChat((s) => s.people);
32
+ const channels = useChat((s) => s.channels);
33
+ const me = useChat((s) => s.me);
34
+ const filesOn = Boolean(me == null ? void 0 : me.capabilities.files);
35
+ const names = useMemo(() => ({
36
+ user: (id) => people[id] ? nameOf(people[id]) : null,
37
+ channel: (id) => {
38
+ var _a, _b;
39
+ return (_b = (_a = channels[id]) == null ? void 0 : _a.name) != null ? _b : null;
40
+ }
41
+ }), [people, channels]);
42
+ const [{
43
+ text: startText,
44
+ picks: startPicks
45
+ }] = useState(() => initialDraft ? fromTokens(initialDraft, names) : {
46
+ text: "",
47
+ picks: emptyPicks()
48
+ });
49
+ const [text, setText] = useState(startText);
50
+ const picks = useRef(startPicks);
51
+ const [uploads, setUploads] = useState([]);
52
+ const [alsoToChannel, setAlsoToChannel] = useState(false);
53
+ const [sel, setSel] = useState({
54
+ start: startText.length,
55
+ end: startText.length
56
+ });
57
+ const [forcedSel, setForcedSel] = useState(void 0);
58
+ const [dismissed, setDismissed] = useState(null);
59
+ const [emojiOpen, setEmojiOpen] = useState(false);
60
+ const [formatting, setFormatting] = useState(false);
61
+ const [linkOpen, setLinkOpen] = useState(false);
62
+ const box = useRef(null);
63
+ const isConversation = channel.kind === "dm" || channel.kind === "group";
64
+ const touched = useRef(false);
65
+ useEffect(() => {
66
+ if (touched.current || !initialDraft) return;
67
+ const next = fromTokens(initialDraft, names);
68
+ setText(next.text);
69
+ picks.current = next.picks;
70
+ }, [initialDraft, names]);
71
+ useEffect(() => {
72
+ if (!forcedSel) return void 0;
73
+ const t = setTimeout(() => setForcedSel(void 0), 50);
74
+ return () => clearTimeout(t);
75
+ }, [forcedSel]);
76
+ const draftTimer = useRef(null);
77
+ const pendingDraft = useRef(null);
78
+ const flushDraft = useCallback(() => {
79
+ if (draftTimer.current) clearTimeout(draftTimer.current);
80
+ draftTimer.current = null;
81
+ const value = pendingDraft.current;
82
+ pendingDraft.current = null;
83
+ if (value != null) void api.setDraft(channel.id, threadRootId != null ? threadRootId : null, toTokens(value, picks.current)).catch(() => void 0);
84
+ }, [channel.id, threadRootId]);
85
+ const saveDraft = useCallback((value) => {
86
+ pendingDraft.current = value;
87
+ if (draftTimer.current) clearTimeout(draftTimer.current);
88
+ draftTimer.current = setTimeout(flushDraft, 800);
89
+ }, [flushDraft]);
90
+ useEffect(() => flushDraft, [flushDraft]);
91
+ const change = (value, caret) => {
92
+ touched.current = true;
93
+ setText(value);
94
+ saveDraft(value);
95
+ if (value.trim()) actions.typing(channel.id, threadRootId);
96
+ if (caret) {
97
+ setSel(caret);
98
+ setForcedSel(caret);
99
+ }
100
+ };
101
+ const completion = useMemo(() => {
102
+ const c = completionAt(text, sel.end);
103
+ return c && c.start !== dismissed ? c : null;
104
+ }, [text, sel.end, dismissed]);
105
+ const options = useMemo(() => {
106
+ if (!completion) return [];
107
+ const q = completion.query.toLowerCase();
108
+ if (completion.kind === "@") {
109
+ const list = Object.values(people).map((u) => ({
110
+ u,
111
+ rank: u.active ? personRank(u, q) : null
112
+ })).filter((x) => x.rank != null).sort((a, b) => a.rank - b.rank || Number(b.u.id === (me == null ? void 0 : me.user.id)) - Number(a.u.id === (me == null ? void 0 : me.user.id)) || nameOf(a.u).localeCompare(nameOf(b.u))).slice(0, 8).map(({
113
+ u
114
+ }) => ({
115
+ key: u.id,
116
+ insert: `@${nameOf(u)} `,
117
+ pick: {
118
+ kind: "user",
119
+ label: nameOf(u),
120
+ id: u.id
121
+ },
122
+ user: u
123
+ }));
124
+ const specials = isConversation ? [] : [["here", "Notify everyone online in this channel"], ["channel", "Notify everyone in this channel"]].filter(([w]) => !q || w.startsWith(q)).map(([w, d]) => ({
125
+ key: `!${w}`,
126
+ insert: `@${w} `,
127
+ special: {
128
+ word: w,
129
+ hint: d
130
+ }
131
+ }));
132
+ return [...list, ...specials];
133
+ }
134
+ if (completion.kind === "#") {
135
+ return Object.values(channels).filter((c) => (c.kind === "public" || c.kind === "private" && c.membership) && !c.archivedAt && c.name && (!q || c.name.includes(q))).sort((a, b) => Number(Boolean(b.membership)) - Number(Boolean(a.membership)) || a.name.localeCompare(b.name)).slice(0, 8).map((c) => ({
136
+ key: c.id,
137
+ insert: `#${c.name} `,
138
+ pick: {
139
+ kind: "channel",
140
+ label: c.name,
141
+ id: c.id
142
+ },
143
+ channel: c
144
+ }));
145
+ }
146
+ return searchEmoji(completion.query, 8).map((e) => ({
147
+ key: e.char,
148
+ insert: `${e.char} `,
149
+ emoji: e
150
+ }));
151
+ }, [completion, people, channels, me == null ? void 0 : me.user.id, isConversation]);
152
+ const choose = (opt) => {
153
+ var _a, _b;
154
+ if (!completion) return;
155
+ const before = text.slice(0, completion.start);
156
+ const after = text.slice(sel.end);
157
+ if (((_a = opt.pick) == null ? void 0 : _a.kind) === "user") picks.current.users.set(opt.pick.label, opt.pick.id);
158
+ if (((_b = opt.pick) == null ? void 0 : _b.kind) === "channel") picks.current.channels.set(opt.pick.label, opt.pick.id);
159
+ if (completion.kind === ":") rememberEmoji(opt.key);
160
+ const pos = before.length + opt.insert.length;
161
+ change(`${before}${opt.insert}${after}`, {
162
+ start: pos,
163
+ end: pos
164
+ });
165
+ };
166
+ const format = (marker) => {
167
+ const r = wrapSelection(text, sel.start, sel.end, marker);
168
+ change(r.text, {
169
+ start: r.start,
170
+ end: r.end
171
+ });
172
+ };
173
+ const linePrefix = (prefix) => {
174
+ const start = text.lastIndexOf("\n", sel.start - 1) + 1;
175
+ const next = `${text.slice(0, start)}${prefix}${text.slice(start)}`;
176
+ const pos = sel.start + prefix.length;
177
+ change(next, {
178
+ start: pos,
179
+ end: pos
180
+ });
181
+ };
182
+ const insertAt = (snippet) => {
183
+ const next = `${text.slice(0, sel.start)}${snippet}${text.slice(sel.end)}`;
184
+ const pos = sel.start + snippet.length;
185
+ change(next, {
186
+ start: pos,
187
+ end: pos
188
+ });
189
+ };
190
+ const addFiles = (files) => {
191
+ var _a, _b;
192
+ if (!filesOn) return app.toast("Attachments are not available yet.", "error");
193
+ const max = (_a = me == null ? void 0 : me.capabilities.maxFileBytes) != null ? _a : 0;
194
+ for (const file of files.slice(0, 10)) {
195
+ if (max && file.size && file.size > max) {
196
+ app.toast(`${file.name} is larger than ${fileSize(max)}.`, "error");
197
+ continue;
198
+ }
199
+ const key = `${file.name}-${(_b = file.size) != null ? _b : 0}-${Math.random().toString(36).slice(2, 7)}`;
200
+ const job = uploadFile(channel.id, file, (prog) => setUploads((u) => u.map((x) => x.key === key ? __spreadProps(__spreadValues({}, x), {
201
+ progress: prog
202
+ }) : x)));
203
+ setUploads((u) => [...u, {
204
+ key,
205
+ file,
206
+ progress: 0,
207
+ abort: job.abort
208
+ }]);
209
+ job.promise.then((done) => setUploads((u) => u.map((x) => x.key === key ? __spreadProps(__spreadValues({}, x), {
210
+ done,
211
+ progress: 1
212
+ }) : x)), (err) => setUploads((u) => u.map((x) => x.key === key ? __spreadProps(__spreadValues({}, x), {
213
+ error: err.message
214
+ }) : x)));
215
+ }
216
+ };
217
+ const attach = () => {
218
+ const fromPhotos = () => pickPhotos().then(addFiles, (e) => app.toast(e.message, "error"));
219
+ const fromFiles = () => pickDocuments().then(addFiles, (e) => app.toast(e.message, "error"));
220
+ if (Platform.OS === "ios") {
221
+ ActionSheetIOS.showActionSheetWithOptions({
222
+ options: ["Photo library", "Files", "Cancel"],
223
+ cancelButtonIndex: 2
224
+ }, (i) => {
225
+ if (i === 0) void fromPhotos();
226
+ if (i === 1) void fromFiles();
227
+ });
228
+ } else {
229
+ Alert.alert("Attach", void 0, [{
230
+ text: "Photo library",
231
+ onPress: () => void fromPhotos()
232
+ }, {
233
+ text: "Files",
234
+ onPress: () => void fromFiles()
235
+ }, {
236
+ text: "Cancel",
237
+ style: "cancel"
238
+ }]);
239
+ }
240
+ };
241
+ const uploading = uploads.some((u) => !u.done && !u.error);
242
+ const ready = uploads.filter((u) => u.done);
243
+ const canSend = (text.trim().length > 0 || ready.length > 0) && !uploading;
244
+ const send = () => {
245
+ if (!canSend) return;
246
+ const body = toTokens(text.trim(), picks.current);
247
+ const files = ready.map((u) => __spreadProps(__spreadValues({}, u.done), {
248
+ url: null
249
+ }));
250
+ void actions.send({
251
+ channelId: channel.id,
252
+ body,
253
+ threadRootId,
254
+ alsoSendToChannel: threadRootId ? alsoToChannel : void 0,
255
+ fileIds: files.map((f) => f.id),
256
+ files
257
+ }).catch((err) => app.toast(err.message || "Not sent.", "error"));
258
+ if (draftTimer.current) clearTimeout(draftTimer.current);
259
+ pendingDraft.current = null;
260
+ touched.current = true;
261
+ setText("");
262
+ setUploads([]);
263
+ setAlsoToChannel(false);
264
+ picks.current = emptyPicks();
265
+ setSel({
266
+ start: 0,
267
+ end: 0
268
+ });
269
+ };
270
+ const FORMATS = [{
271
+ icon: "text",
272
+ glyph: "B",
273
+ label: "Bold",
274
+ run: () => format("*")
275
+ }, {
276
+ icon: "text",
277
+ glyph: "I",
278
+ label: "Italic",
279
+ run: () => format("_")
280
+ }, {
281
+ icon: "text",
282
+ glyph: "S",
283
+ label: "Strikethrough",
284
+ run: () => format("~")
285
+ }, {
286
+ icon: "link",
287
+ label: "Link",
288
+ run: () => setLinkOpen(true)
289
+ }, {
290
+ icon: "list",
291
+ label: "Bulleted list",
292
+ run: () => linePrefix("- ")
293
+ }, {
294
+ icon: "list-circle-outline",
295
+ label: "Numbered list",
296
+ run: () => linePrefix("1. ")
297
+ }, {
298
+ icon: "chatbox-ellipses-outline",
299
+ label: "Quote",
300
+ run: () => linePrefix("> ")
301
+ }, {
302
+ icon: "code",
303
+ label: "Code",
304
+ run: () => format("`")
305
+ }, {
306
+ icon: "code-slash",
307
+ label: "Code block",
308
+ run: () => format("```")
309
+ }];
310
+ return /* @__PURE__ */ jsxs(View, { children: [
311
+ options.length ? /* @__PURE__ */ jsxs(View, { style: [styles.suggest, {
312
+ borderColor: p.border,
313
+ backgroundColor: p.popover
314
+ }], accessibilityLabel: "Suggestions", children: [
315
+ /* @__PURE__ */ jsx(Text, { style: [styles.suggestTitle, {
316
+ color: p.mutedForeground
317
+ }], children: (completion == null ? void 0 : completion.kind) === "@" ? "People" : (completion == null ? void 0 : completion.kind) === "#" ? "Channels" : "Emoji" }),
318
+ /* @__PURE__ */ jsx(ScrollView, { keyboardShouldPersistTaps: "always", style: styles.suggestList, children: options.map((o) => /* @__PURE__ */ jsx(Pressable, { onPress: () => choose(o), style: ({
319
+ pressed
320
+ }) => [styles.option, pressed && {
321
+ backgroundColor: p.muted
322
+ }], children: o.user ? /* @__PURE__ */ jsxs(Fragment, { children: [
323
+ /* @__PURE__ */ jsx(Avatar, { user: o.user, size: "sm", presence: true, ring: p.popover }),
324
+ /* @__PURE__ */ jsx(Text, { style: [styles.optionMain, {
325
+ color: p.foreground
326
+ }], numberOfLines: 1, children: nameOf(o.user) }),
327
+ o.user.realName && o.user.realName !== nameOf(o.user) ? /* @__PURE__ */ jsx(Text, { style: [styles.optionSub, {
328
+ color: p.mutedForeground
329
+ }], numberOfLines: 1, children: o.user.realName }) : null,
330
+ o.user.isSelf ? /* @__PURE__ */ jsx(Text, { style: [styles.optionSub, {
331
+ color: p.mutedForeground
332
+ }], children: "(you)" }) : null
333
+ ] }) : o.special ? /* @__PURE__ */ jsxs(Fragment, { children: [
334
+ /* @__PURE__ */ jsx(View, { style: [styles.optionIcon, {
335
+ backgroundColor: p.muted
336
+ }], children: /* @__PURE__ */ jsx(Ionicons, { name: "at", size: 14, color: p.foreground }) }),
337
+ /* @__PURE__ */ jsxs(Text, { style: [styles.optionMain, {
338
+ color: p.foreground
339
+ }], children: [
340
+ "@",
341
+ o.special.word
342
+ ] }),
343
+ /* @__PURE__ */ jsx(Text, { style: [styles.optionSub, {
344
+ color: p.mutedForeground
345
+ }], numberOfLines: 1, children: o.special.hint })
346
+ ] }) : o.channel ? /* @__PURE__ */ jsxs(Fragment, { children: [
347
+ /* @__PURE__ */ jsx(ChannelGlyph, { kind: o.channel.kind }),
348
+ /* @__PURE__ */ jsx(Text, { style: [styles.optionMain, {
349
+ color: p.foreground
350
+ }], numberOfLines: 1, children: o.channel.name }),
351
+ o.channel.purpose ? /* @__PURE__ */ jsx(Text, { style: [styles.optionSub, {
352
+ color: p.mutedForeground
353
+ }], numberOfLines: 1, children: o.channel.purpose }) : null
354
+ ] }) : o.emoji ? /* @__PURE__ */ jsxs(Fragment, { children: [
355
+ /* @__PURE__ */ jsx(Text, { style: styles.optionEmoji, children: o.emoji.char }),
356
+ /* @__PURE__ */ jsxs(Text, { style: [styles.optionMain, {
357
+ color: p.foreground
358
+ }], children: [
359
+ ":",
360
+ o.emoji.name,
361
+ ":"
362
+ ] })
363
+ ] }) : null }, o.key)) }),
364
+ /* @__PURE__ */ jsx(Pressable, { onPress: () => {
365
+ var _a;
366
+ return setDismissed((_a = completion == null ? void 0 : completion.start) != null ? _a : null);
367
+ }, style: styles.suggestClose, accessibilityLabel: "Close suggestions", children: /* @__PURE__ */ jsx(Ionicons, { name: "close", size: 16, color: p.mutedForeground }) })
368
+ ] }) : null,
369
+ /* @__PURE__ */ jsxs(View, { style: [styles.box, {
370
+ borderColor: p.input,
371
+ backgroundColor: p.background
372
+ }], children: [
373
+ formatting ? /* @__PURE__ */ jsx(ScrollView, { horizontal: true, keyboardShouldPersistTaps: "always", showsHorizontalScrollIndicator: false, contentContainerStyle: styles.formats, accessibilityRole: "toolbar", accessibilityLabel: "Formatting", children: FORMATS.map((f) => /* @__PURE__ */ jsx(Pressable, { onPress: f.run, accessibilityLabel: f.label, style: ({
374
+ pressed
375
+ }) => [styles.tool, pressed && {
376
+ backgroundColor: p.muted
377
+ }], children: f.icon === "text" ? /* @__PURE__ */ jsx(Text, { style: [styles.glyph, {
378
+ color: p.mutedForeground
379
+ }, f.glyph === "B" && styles.bold, f.glyph === "I" && styles.italic, f.glyph === "S" && styles.strike], children: f.glyph }) : /* @__PURE__ */ jsx(Ionicons, { name: f.icon, size: 18, color: p.mutedForeground }) }, f.label)) }) : null,
380
+ /* @__PURE__ */ jsx(TextInput, { ref: box, value: text, multiline: true, placeholder, placeholderTextColor: p.mutedForeground, accessibilityLabel: placeholder, selection: forcedSel, onChangeText: (v) => change(v), onSelectionChange: (e) => setSel(e.nativeEvent.selection), style: [styles.input, {
381
+ color: p.foreground
382
+ }] }),
383
+ uploads.length ? /* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, contentContainerStyle: styles.uploads, children: uploads.map((u) => {
384
+ var _a, _b;
385
+ return /* @__PURE__ */ jsxs(View, { style: [styles.upload, {
386
+ borderColor: u.error ? p.destructive : p.border,
387
+ backgroundColor: p.muted
388
+ }], children: [
389
+ /* @__PURE__ */ jsx(View, { style: [styles.uploadIcon, {
390
+ backgroundColor: p.accent
391
+ }], children: /* @__PURE__ */ jsx(Ionicons, { name: !u.done && !u.error ? "cloud-upload-outline" : "document-text-outline", size: 16, color: p.accentForeground }) }),
392
+ /* @__PURE__ */ jsxs(View, { style: styles.uploadText, children: [
393
+ /* @__PURE__ */ jsx(Text, { style: [styles.uploadName, {
394
+ color: p.foreground
395
+ }], numberOfLines: 1, children: u.file.name }),
396
+ /* @__PURE__ */ jsx(Text, { style: [styles.uploadMeta, {
397
+ color: u.error ? p.destructive : p.mutedForeground
398
+ }], numberOfLines: 1, children: (_b = u.error) != null ? _b : u.done ? fileSize((_a = u.file.size) != null ? _a : u.done.size) : `Uploading\u2026 ${Math.round(u.progress * 100)}%` })
399
+ ] }),
400
+ /* @__PURE__ */ jsx(Pressable, { accessibilityLabel: `Remove ${u.file.name}`, hitSlop: 8, onPress: () => {
401
+ if (!u.done && !u.error) u.abort();
402
+ setUploads((list) => list.filter((x) => x.key !== u.key));
403
+ }, children: /* @__PURE__ */ jsx(Ionicons, { name: "close", size: 15, color: p.mutedForeground }) }),
404
+ !u.done && !u.error ? /* @__PURE__ */ jsx(View, { style: [styles.progress, {
405
+ backgroundColor: p.primary,
406
+ width: `${Math.round(u.progress * 100)}%`
407
+ }] }) : null
408
+ ] }, u.key);
409
+ }) }) : null,
410
+ /* @__PURE__ */ jsxs(View, { style: styles.bar, children: [
411
+ filesOn ? /* @__PURE__ */ jsx(BarButton, { icon: "add-circle-outline", label: "Attach files", onPress: attach }) : null,
412
+ /* @__PURE__ */ jsx(BarButton, { icon: "text", label: "Formatting", active: formatting, onPress: () => setFormatting((f) => !f) }),
413
+ /* @__PURE__ */ jsx(BarButton, { icon: "happy-outline", label: "Emoji", onPress: () => setEmojiOpen(true) }),
414
+ /* @__PURE__ */ jsx(BarButton, { icon: "at", label: "Mention someone", onPress: () => {
415
+ const pos = sel.start;
416
+ const lead = pos > 0 && !/\s/.test(text[pos - 1]) ? " @" : "@";
417
+ insertAt(lead);
418
+ } }),
419
+ threadRootId && (isConversation || channel.name) ? /* @__PURE__ */ jsxs(Pressable, { onPress: () => setAlsoToChannel((v) => !v), accessibilityRole: "checkbox", accessibilityState: {
420
+ checked: alsoToChannel
421
+ }, style: styles.also, children: [
422
+ /* @__PURE__ */ jsx(Ionicons, { name: alsoToChannel ? "checkbox" : "square-outline", size: 17, color: alsoToChannel ? p.primary : p.mutedForeground }),
423
+ /* @__PURE__ */ jsx(Text, { style: [styles.alsoText, {
424
+ color: p.mutedForeground
425
+ }], numberOfLines: 1, children: isConversation ? "Also send as a direct message" : `Also send to #${channel.name}` })
426
+ ] }) : /* @__PURE__ */ jsx(View, { style: styles.spacer }),
427
+ /* @__PURE__ */ jsx(Pressable, { onPress: send, disabled: !canSend, accessibilityLabel: uploading ? "Waiting for uploads" : "Send", style: [styles.send, {
428
+ backgroundColor: canSend ? p.primary : "transparent"
429
+ }], children: /* @__PURE__ */ jsx(Ionicons, { name: "send", size: 16, color: canSend ? p.primaryForeground : p.mutedForeground }) })
430
+ ] })
431
+ ] }),
432
+ /* @__PURE__ */ jsx(EmojiPicker, { open: emojiOpen, onClose: () => setEmojiOpen(false), onPick: (char) => insertAt(char) }),
433
+ /* @__PURE__ */ jsx(LinkSheet, { open: linkOpen, selected: text.slice(sel.start, sel.end), onClose: () => setLinkOpen(false), onInsert: (url, label) => {
434
+ setLinkOpen(false);
435
+ insertAt(label ? `<${url}|${label}>` : url);
436
+ } })
437
+ ] });
438
+ }
439
+ function BarButton({
440
+ icon,
441
+ label,
442
+ onPress,
443
+ active
444
+ }) {
445
+ const p = usePalette();
446
+ return /* @__PURE__ */ jsx(Pressable, { onPress, accessibilityLabel: label, accessibilityState: {
447
+ selected: Boolean(active)
448
+ }, hitSlop: 4, style: [styles.tool, active && {
449
+ backgroundColor: p.accent
450
+ }], children: icon === "text" ? /* @__PURE__ */ jsx(Text, { style: [styles.aa, {
451
+ color: active ? p.accentForeground : p.mutedForeground
452
+ }], children: "Aa" }) : /* @__PURE__ */ jsx(Ionicons, { name: icon, size: 21, color: p.mutedForeground }) });
453
+ }
454
+ function LinkSheet({
455
+ open,
456
+ selected,
457
+ onClose,
458
+ onInsert
459
+ }) {
460
+ const [url, setUrl] = useState("https://");
461
+ const [label, setLabel] = useState("");
462
+ useEffect(() => {
463
+ if (!open) return;
464
+ setUrl("https://");
465
+ setLabel(selected);
466
+ }, [open, selected]);
467
+ const valid = /^https?:\/\/\S+\.\S+$/i.test(url.trim());
468
+ return /* @__PURE__ */ jsxs(Sheet, { visible: open, onClose, title: "Add a link", footer: /* @__PURE__ */ jsxs(Fragment, { children: [
469
+ /* @__PURE__ */ jsx(Button, { label: "Cancel", onPress: onClose }),
470
+ /* @__PURE__ */ jsx(Button, { label: "Add", variant: "primary", disabled: !valid, onPress: () => onInsert(url.trim(), label.trim()) })
471
+ ] }), children: [
472
+ /* @__PURE__ */ jsx(Field, { label: "Text (optional)", children: /* @__PURE__ */ jsx(Input, { value: label, onChangeText: setLabel, placeholder: "What the link says", accessibilityLabel: "Link text" }) }),
473
+ /* @__PURE__ */ jsx(Field, { label: "Link", children: /* @__PURE__ */ jsx(Input, { value: url, onChangeText: setUrl, autoCapitalize: "none", autoCorrect: false, keyboardType: "url", autoFocus: true, accessibilityLabel: "Link address" }) })
474
+ ] });
475
+ }
476
+ function composerPlaceholder(channel, people, meId) {
477
+ if (channel.kind === "public" || channel.kind === "private") return `Message #${channel.name}`;
478
+ return `Message ${channelTitle(channel, people, meId)}`;
479
+ }
480
+ const styles = StyleSheet.create({
481
+ suggest: {
482
+ borderWidth: StyleSheet.hairlineWidth,
483
+ borderRadius: 12,
484
+ marginBottom: 6,
485
+ paddingTop: 6,
486
+ maxHeight: 260
487
+ },
488
+ suggestTitle: {
489
+ fontSize: 12,
490
+ fontWeight: "700",
491
+ paddingHorizontal: 12,
492
+ paddingBottom: 2
493
+ },
494
+ suggestList: {
495
+ flexGrow: 0
496
+ },
497
+ suggestClose: {
498
+ position: "absolute",
499
+ top: 4,
500
+ right: 6,
501
+ padding: 4
502
+ },
503
+ option: {
504
+ flexDirection: "row",
505
+ alignItems: "center",
506
+ gap: 10,
507
+ paddingHorizontal: 12,
508
+ height: 42
509
+ },
510
+ optionIcon: {
511
+ width: 24,
512
+ height: 24,
513
+ borderRadius: 6,
514
+ alignItems: "center",
515
+ justifyContent: "center"
516
+ },
517
+ optionMain: {
518
+ fontSize: 15,
519
+ fontWeight: "700",
520
+ flexShrink: 1
521
+ },
522
+ optionSub: {
523
+ fontSize: 13,
524
+ flexShrink: 1
525
+ },
526
+ optionEmoji: {
527
+ fontSize: 20
528
+ },
529
+ box: {
530
+ borderWidth: 1,
531
+ borderRadius: 14
532
+ },
533
+ formats: {
534
+ paddingHorizontal: 6,
535
+ paddingTop: 4,
536
+ gap: 2
537
+ },
538
+ input: {
539
+ fontSize: 16,
540
+ lineHeight: 21,
541
+ minHeight: 42,
542
+ maxHeight: 160,
543
+ paddingHorizontal: 12,
544
+ paddingTop: 10,
545
+ paddingBottom: 6,
546
+ textAlignVertical: "top"
547
+ },
548
+ uploads: {
549
+ paddingHorizontal: 10,
550
+ paddingBottom: 6,
551
+ gap: 8
552
+ },
553
+ upload: {
554
+ width: 210,
555
+ flexDirection: "row",
556
+ alignItems: "center",
557
+ gap: 8,
558
+ borderWidth: StyleSheet.hairlineWidth,
559
+ borderRadius: 10,
560
+ padding: 8,
561
+ overflow: "hidden"
562
+ },
563
+ uploadIcon: {
564
+ width: 30,
565
+ height: 30,
566
+ borderRadius: 7,
567
+ alignItems: "center",
568
+ justifyContent: "center"
569
+ },
570
+ uploadText: {
571
+ flex: 1,
572
+ minWidth: 0
573
+ },
574
+ uploadName: {
575
+ fontSize: 12,
576
+ fontWeight: "700"
577
+ },
578
+ uploadMeta: {
579
+ fontSize: 11
580
+ },
581
+ progress: {
582
+ position: "absolute",
583
+ left: 0,
584
+ bottom: 0,
585
+ height: 2
586
+ },
587
+ bar: {
588
+ flexDirection: "row",
589
+ alignItems: "center",
590
+ paddingHorizontal: 4,
591
+ paddingBottom: 4,
592
+ gap: 2
593
+ },
594
+ tool: {
595
+ width: 36,
596
+ height: 36,
597
+ borderRadius: 8,
598
+ alignItems: "center",
599
+ justifyContent: "center"
600
+ },
601
+ glyph: {
602
+ fontSize: 17
603
+ },
604
+ bold: {
605
+ fontWeight: "900"
606
+ },
607
+ italic: {
608
+ fontStyle: "italic",
609
+ fontWeight: "600"
610
+ },
611
+ strike: {
612
+ textDecorationLine: "line-through",
613
+ fontWeight: "600"
614
+ },
615
+ aa: {
616
+ fontSize: 15,
617
+ fontWeight: "700"
618
+ },
619
+ also: {
620
+ flex: 1,
621
+ flexDirection: "row",
622
+ alignItems: "center",
623
+ gap: 5,
624
+ paddingHorizontal: 4,
625
+ minWidth: 0
626
+ },
627
+ alsoText: {
628
+ fontSize: 12,
629
+ flexShrink: 1
630
+ },
631
+ spacer: {
632
+ flex: 1
633
+ },
634
+ send: {
635
+ width: 40,
636
+ height: 34,
637
+ borderRadius: 9,
638
+ alignItems: "center",
639
+ justifyContent: "center"
640
+ }
641
+ });export{Composer,composerPlaceholder};//# sourceMappingURL=Composer.js.map