@adminide-stack/yantra-mobile 12.0.196-alpha.0 → 12.0.196

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
@@ -1,22 +1,194 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';import {StyleSheet,ScrollView,View,Text}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap,DIM}from'../../inbox/components/Tap.js';import {relativeTime}from'../buildFragments.js';import {Sheet,Pill}from'./ui.js';function VersionsSheet({
2
- visible,
1
+ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState,useRef,useMemo,useCallback,useEffect}from'react';import {StyleSheet,View,Text,ScrollView,ActivityIndicator,Modal,TextInput}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap,DIM}from'../../inbox/components/Tap.js';import {useSafeInsets}from'../../canvas/withRemoteSafeArea.js';import {relativeTime}from'../buildFragments.js';import {stopVersionPreview,readVersionPreviewStatus,startVersionPreview,listVersionTimeline}from'../web/history/diffActions.js';import {pageNativeSupport,restoreVersion,bookmarkVersion}from'../web/history/versionActions.js';import {versionPreviewUrl}from'../web/history/versionPreview.js';import {isPreviewLive,createVersionPreview}from'../web/history/versionPreviewMachine.js';import {DEFAULT_VERSION_LIMIT,MAX_VERSION_LIMIT,versionRow,bookmarkLabel,versionActionLabel}from'../web/history/versions.js';import {publicSandboxDomain}from'../publicSandboxDomain.js';import {Sheet,IconButton,Pill}from'./ui.js';import {VersionChangesView}from'./VersionChangesView.js';import {VersionPreviewView}from'./VersionPreviewView.js';var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ const BUSY_TITLE = "Wait for the AI to finish";
21
+ const KIND_ICON = {
22
+ ai: "robot-outline",
23
+ manual: "pencil-outline",
24
+ restore: "restore",
25
+ backup: "content-save-outline",
26
+ other: "history"
27
+ };
28
+ function previewPhase(state) {
29
+ if (state === "ready") return "ready";
30
+ if (state === "failed") return "failed";
31
+ return "starting";
32
+ }
33
+ function useVersionPreview(ops) {
34
+ const actorRef = useRef(null);
35
+ if (!actorRef.current) actorRef.current = createVersionPreview({
36
+ ops
37
+ });
38
+ const actor = actorRef.current;
39
+ const [snap, setSnap] = useState(actor.getSnapshot());
40
+ useEffect(() => actor.subscribe(setSnap), [actor]);
41
+ useEffect(() => () => {
42
+ if (isPreviewLive(actor.getSnapshot().value)) ops.stop().catch(() => void 0);
43
+ actor.stop();
44
+ }, [actor, ops]);
45
+ return [snap, actor];
46
+ }
47
+ function RowAction({
48
+ label,
49
+ icon,
50
+ onPress,
51
+ named,
52
+ theme,
53
+ disabled = false,
54
+ hint,
55
+ active = false,
56
+ testID
57
+ }) {
58
+ return /* @__PURE__ */ jsxs(Tap, { onPress, disabled, accessibilityRole: "button", accessibilityLabel: named, accessibilityHint: hint, accessibilityState: {
59
+ disabled,
60
+ selected: active
61
+ }, style: [styles.rowAction, {
62
+ backgroundColor: active ? theme.accentSoft : theme.chip
63
+ }, disabled ? styles.disabled : null], pressedStyle: DIM, testID, children: [
64
+ /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 15, color: active ? theme.accent : theme.ink }),
65
+ /* @__PURE__ */ jsx(Text, { style: [styles.rowActionLabel, {
66
+ color: active ? theme.accent : theme.ink
67
+ }], children: label })
68
+ ] });
69
+ }
70
+ function SmallButton({
71
+ label,
72
+ onPress,
73
+ theme,
74
+ primary = false,
75
+ disabled = false,
76
+ busy = false,
77
+ named
78
+ }) {
79
+ const ink = primary ? theme.accentInk : theme.ink;
80
+ return /* @__PURE__ */ jsxs(Tap, { onPress, disabled: disabled || busy, accessibilityRole: "button", accessibilityLabel: named != null ? named : label, style: [styles.smallButton, primary ? {
81
+ backgroundColor: theme.accent
82
+ } : {
83
+ borderColor: theme.border,
84
+ borderWidth: 1
85
+ }, disabled ? styles.disabled : null], pressedStyle: DIM, children: [
86
+ busy ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: ink }) : null,
87
+ /* @__PURE__ */ jsx(Text, { style: [styles.smallButtonLabel, {
88
+ color: ink
89
+ }], children: label })
90
+ ] });
91
+ }
92
+ function VersionRow({
93
+ version: v,
94
+ now,
95
+ theme,
96
+ readOnly,
97
+ locked,
98
+ busy,
99
+ working,
100
+ confirming,
101
+ draft,
102
+ staged,
103
+ previewDisabled,
104
+ onStar,
105
+ onDraft,
106
+ onSaveBookmark,
107
+ onChanges,
108
+ onPreview,
109
+ onAskRestore,
110
+ onRestore,
111
+ onCancelRestore
112
+ }) {
113
+ const {
114
+ kind,
115
+ title,
116
+ meta
117
+ } = versionRow(v, now);
118
+ const rowWorking = working === v.sha;
119
+ const named = (action) => versionActionLabel(action, title, meta);
120
+ const starLabel = v.bookmark ? "Remove bookmark" : "Bookmark";
121
+ return /* @__PURE__ */ jsxs(View, { style: [styles.row, {
122
+ borderColor: staged ? theme.accent : theme.border,
123
+ backgroundColor: theme.card
124
+ }], testID: `webbuilder-history-row-${v.shortSha}`, children: [
125
+ /* @__PURE__ */ jsxs(View, { style: styles.rowTop, children: [
126
+ /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: KIND_ICON[kind], size: 18, color: theme.muted, style: styles.kind }),
127
+ /* @__PURE__ */ jsxs(View, { style: styles.rowText, children: [
128
+ /* @__PURE__ */ jsx(Text, { style: [styles.title, {
129
+ color: theme.ink
130
+ }], numberOfLines: 2, children: title }),
131
+ /* @__PURE__ */ jsxs(View, { style: styles.metaRow, children: [
132
+ meta.length ? /* @__PURE__ */ jsx(Text, { style: [styles.meta, {
133
+ color: theme.muted
134
+ }], children: meta.join(" \xB7 ") }) : null,
135
+ v.isHead ? /* @__PURE__ */ jsx(View, { style: [styles.badge, {
136
+ backgroundColor: theme.accentSoft
137
+ }], children: /* @__PURE__ */ jsx(Text, { style: [styles.badgeText, {
138
+ color: theme.accent
139
+ }], children: "current" }) }) : null,
140
+ v.bookmark ? /* @__PURE__ */ jsx(View, { style: [styles.badge, {
141
+ backgroundColor: theme.warnSoft
142
+ }], children: /* @__PURE__ */ jsx(Text, { style: [styles.badgeText, {
143
+ color: theme.warn
144
+ }], children: bookmarkLabel(v.bookmark) }) }) : null
145
+ ] })
146
+ ] }),
147
+ readOnly ? null : /* @__PURE__ */ jsx(IconButton, { icon: v.bookmark ? "star" : "star-outline", label: named(starLabel), onPress: onStar, disabled: locked, tint: v.bookmark ? theme.warn : theme.muted, theme, testID: `webbuilder-history-star-${v.shortSha}` })
148
+ ] }),
149
+ draft !== null && !readOnly ? /* @__PURE__ */ jsxs(View, { style: styles.draftRow, children: [
150
+ /* @__PURE__ */ jsx(TextInput, { autoFocus: true, value: draft, onChangeText: (text) => onDraft(text), onSubmitEditing: onSaveBookmark, maxLength: 60, placeholder: "Bookmark name", placeholderTextColor: theme.faint, accessibilityLabel: "Bookmark name", returnKeyType: "done", style: [styles.input, {
151
+ color: theme.ink,
152
+ borderColor: theme.border,
153
+ backgroundColor: theme.chip
154
+ }], testID: "webbuilder-history-bookmark-name" }),
155
+ /* @__PURE__ */ jsx(SmallButton, { label: "Save", primary: true, onPress: onSaveBookmark, disabled: locked || !draft.trim(), theme }),
156
+ /* @__PURE__ */ jsx(SmallButton, { label: "Cancel", onPress: () => onDraft(null), theme })
157
+ ] }) : null,
158
+ confirming && !v.isHead && !readOnly ? /* @__PURE__ */ jsxs(View, { style: [styles.confirm, {
159
+ backgroundColor: theme.chip
160
+ }], children: [
161
+ /* @__PURE__ */ jsx(Text, { style: [styles.confirmText, {
162
+ color: theme.ink
163
+ }], children: "Restore this version? Your files go back to how they were here. The current version stays in the history, so you can come back to it." }),
164
+ /* @__PURE__ */ jsxs(View, { style: styles.confirmButtons, children: [
165
+ /* @__PURE__ */ jsx(SmallButton, { label: rowWorking ? "Restoring\u2026" : "Restore", named: named(rowWorking ? "Restoring" : "Restore"), primary: true, busy: rowWorking, onPress: onRestore, disabled: locked, theme }),
166
+ /* @__PURE__ */ jsx(SmallButton, { label: "Cancel", onPress: onCancelRestore, disabled: rowWorking, theme })
167
+ ] })
168
+ ] }) : /* @__PURE__ */ jsxs(View, { style: styles.actions, children: [
169
+ /* @__PURE__ */ jsx(RowAction, { label: "What changed", icon: "file-compare", named: named("What changed"), onPress: onChanges, active: staged === "changes", theme, testID: `webbuilder-history-changes-${v.shortSha}` }),
170
+ !v.isHead ? /* @__PURE__ */ jsx(RowAction, { label: "Preview", icon: "eye-outline", named: named("Preview"), onPress: onPreview, disabled: Boolean(previewDisabled), hint: previewDisabled || "See this version without restoring it", active: staged === "preview", theme, testID: `webbuilder-history-preview-${v.shortSha}` }) : null,
171
+ !v.isHead && !readOnly ? /* @__PURE__ */ jsx(RowAction, { label: "Restore", icon: "restore", named: named("Restore"), onPress: onAskRestore, disabled: locked, hint: busy ? BUSY_TITLE : void 0, theme, testID: `webbuilder-history-restore-${v.shortSha}` }) : null
172
+ ] })
173
+ ] });
174
+ }
175
+ function BuildsList({
3
176
  builds,
4
177
  selectedKey,
5
178
  onSelect,
6
- onClose,
7
179
  theme
8
180
  }) {
9
- return /* @__PURE__ */ jsx(Sheet, { visible, title: "Versions", onClose, theme, testID: "webbuilder-versions", children: /* @__PURE__ */ jsx(ScrollView, { style: styles.list, contentContainerStyle: styles.content, children: builds.map((build, index) => {
181
+ return /* @__PURE__ */ jsx(Fragment, { children: builds.map((build, index) => {
10
182
  const selected = build.key === selectedKey || !selectedKey && index === 0;
11
183
  return /* @__PURE__ */ jsxs(Tap, { onPress: () => onSelect(build), accessibilityRole: "button", accessibilityState: {
12
184
  selected
13
- }, accessibilityLabel: `Version ${builds.length - index}, ${relativeTime(build.updatedAt)}`, style: [styles.row, {
185
+ }, accessibilityLabel: `Version ${builds.length - index}, ${relativeTime(build.updatedAt)}`, style: [styles.buildRow, {
14
186
  borderColor: selected ? theme.accent : theme.border,
15
187
  backgroundColor: theme.card
16
188
  }], pressedStyle: DIM, testID: `webbuilder-version-${index}`, children: [
17
189
  /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: selected ? "radiobox-marked" : "radiobox-blank", size: 20, color: selected ? theme.accent : theme.faint }),
18
- /* @__PURE__ */ jsxs(View, { style: styles.text, children: [
19
- /* @__PURE__ */ jsx(Text, { style: [styles.title, {
190
+ /* @__PURE__ */ jsxs(View, { style: styles.rowText, children: [
191
+ /* @__PURE__ */ jsx(Text, { style: [styles.buildTitle, {
20
192
  color: theme.ink
21
193
  }], numberOfLines: 1, children: index === 0 ? "Latest" : `Version ${builds.length - index}` }),
22
194
  /* @__PURE__ */ jsx(Text, { style: [styles.meta, {
@@ -25,33 +197,518 @@ import {jsx,jsxs}from'react/jsx-runtime';import {StyleSheet,ScrollView,View,Text
25
197
  ] }),
26
198
  build.liveUrl ? /* @__PURE__ */ jsx(Pill, { label: "Published", tone: "live", theme }) : null
27
199
  ] }, build.key);
28
- }) }) });
200
+ }) });
201
+ }
202
+ function VersionsSheet({
203
+ visible,
204
+ builds,
205
+ selectedKey,
206
+ onSelect,
207
+ onClose,
208
+ theme,
209
+ build = null,
210
+ run,
211
+ busy = false,
212
+ readOnly = false,
213
+ imported = false,
214
+ onRestored
215
+ }) {
216
+ var _a;
217
+ const insets = useSafeInsets();
218
+ const sandboxId = ((build == null ? void 0 : build.sandboxId) || "").trim();
219
+ const historyOn = Boolean(run && sandboxId);
220
+ const [list, setList] = useState(null);
221
+ const [loading, setLoading] = useState(false);
222
+ const [error, setError] = useState(null);
223
+ const [loadingMore, setLoadingMore] = useState(false);
224
+ const [moreError, setMoreError] = useState(null);
225
+ const limitRef = useRef(DEFAULT_VERSION_LIMIT);
226
+ const [notice, setNotice] = useState(null);
227
+ const [working, setWorking] = useState(null);
228
+ const [confirmSha, setConfirmSha] = useState(null);
229
+ const [bookmarkDraft, setBookmarkDraft] = useState(null);
230
+ const [now, setNow] = useState(() => Date.now());
231
+ const [stage, setStage] = useState(null);
232
+ const [filter, setFilter] = useState("all");
233
+ const requestRef = useRef(0);
234
+ const runRef = useRef({
235
+ run,
236
+ sandboxId
237
+ });
238
+ runRef.current = {
239
+ run,
240
+ sandboxId
241
+ };
242
+ const ops = useMemo(() => ({
243
+ start: (sha) => runRef.current.run ? startVersionPreview(runRef.current.run, runRef.current.sandboxId, sha) : Promise.resolve("failed"),
244
+ status: () => runRef.current.run ? readVersionPreviewStatus(runRef.current.run, runRef.current.sandboxId) : Promise.resolve(null),
245
+ stop: () => runRef.current.run ? stopVersionPreview(runRef.current.run, runRef.current.sandboxId) : Promise.resolve(false)
246
+ }), []);
247
+ const [preview, previewActor] = useVersionPreview(ops);
248
+ const load = useCallback(async (opts) => {
249
+ if (!run || !sandboxId) return;
250
+ const more = Boolean(opts == null ? void 0 : opts.more);
251
+ requestRef.current += 1;
252
+ const id = requestRef.current;
253
+ const limit = more ? Math.min(MAX_VERSION_LIMIT, limitRef.current + DEFAULT_VERSION_LIMIT) : limitRef.current;
254
+ const setBusy = more ? setLoadingMore : setLoading;
255
+ setBusy(true);
256
+ if (more) setMoreError(null);
257
+ else setError(null);
258
+ try {
259
+ const r = await listVersionTimeline(run, sandboxId, {
260
+ keepEarlier: imported,
261
+ support: pageNativeSupport,
262
+ limit
263
+ });
264
+ if (id !== requestRef.current) return;
265
+ if (r.ok === true) {
266
+ limitRef.current = limit;
267
+ setList(r.value);
268
+ } else if (more) setMoreError("Couldn't load older versions.");
269
+ else setError(r.message);
270
+ setNow(Date.now());
271
+ } catch (e) {
272
+ if (id === requestRef.current) {
273
+ if (more) setMoreError("Couldn't load older versions.");
274
+ else setError("Could not load the history.");
275
+ }
276
+ } finally {
277
+ if (id === requestRef.current) setBusy(false);
278
+ else if (more) setLoadingMore(false);
279
+ }
280
+ }, [run, sandboxId, imported]);
281
+ useEffect(() => {
282
+ setList(null);
283
+ setError(null);
284
+ setNotice(null);
285
+ setStage(null);
286
+ setFilter("all");
287
+ limitRef.current = DEFAULT_VERSION_LIMIT;
288
+ }, [sandboxId]);
289
+ const closeStage = useCallback(() => {
290
+ setStage(null);
291
+ if (isPreviewLive(previewActor.getSnapshot().value) || previewActor.getSnapshot().value === "failed") {
292
+ previewActor.send({
293
+ type: "CLOSE"
294
+ });
295
+ }
296
+ }, [previewActor]);
297
+ const loadRef = useRef(load);
298
+ loadRef.current = load;
299
+ useEffect(() => {
300
+ if (visible) {
301
+ setNow(Date.now());
302
+ loadRef.current().catch(() => void 0);
303
+ } else {
304
+ setConfirmSha(null);
305
+ setBookmarkDraft(null);
306
+ closeStage();
307
+ }
308
+ }, [visible, sandboxId, closeStage]);
309
+ const wasBusy = useRef(busy);
310
+ useEffect(() => {
311
+ if (wasBusy.current && !busy && visible) loadRef.current().catch(() => void 0);
312
+ wasBusy.current = busy;
313
+ }, [busy, visible]);
314
+ const locked = busy || working !== null;
315
+ const doRestore = useCallback(async (v) => {
316
+ if (locked || !run) return false;
317
+ setWorking(v.sha);
318
+ setError(null);
319
+ setNotice(null);
320
+ try {
321
+ const r = await restoreVersion(run, sandboxId, v, {
322
+ support: pageNativeSupport
323
+ });
324
+ if (r.ok === false) {
325
+ setError(r.message);
326
+ return false;
327
+ }
328
+ setConfirmSha(null);
329
+ onRestored == null ? void 0 : onRestored(v);
330
+ setNotice(`Restored \u201C${versionRow(v).title}\u201D.`);
331
+ await load();
332
+ return true;
333
+ } catch (e) {
334
+ setError("Could not restore that version.");
335
+ return false;
336
+ } finally {
337
+ setWorking(null);
338
+ }
339
+ }, [locked, run, sandboxId, onRestored, load]);
340
+ const doBookmark = useCallback(async (v, name) => {
341
+ if (locked || !run) return;
342
+ setWorking(v.sha);
343
+ setError(null);
344
+ try {
345
+ const r = await bookmarkVersion(run, sandboxId, v.sha, name, {
346
+ support: pageNativeSupport,
347
+ current: v.bookmark
348
+ });
349
+ if (r.ok === false) {
350
+ setError(r.message);
351
+ return;
352
+ }
353
+ setBookmarkDraft(null);
354
+ const {
355
+ bookmark
356
+ } = r.value;
357
+ setList((prev) => prev ? __spreadProps(__spreadValues({}, prev), {
358
+ versions: prev.versions.map((x) => x.sha === v.sha ? __spreadProps(__spreadValues({}, x), {
359
+ bookmark: bookmark || void 0
360
+ }) : x)
361
+ }) : prev);
362
+ } catch (e) {
363
+ setError("Could not save the bookmark.");
364
+ } finally {
365
+ setWorking(null);
366
+ }
367
+ }, [locked, run, sandboxId]);
368
+ const openPreview = useCallback((v) => {
369
+ setStage({
370
+ kind: "preview",
371
+ sha: v.sha
372
+ });
373
+ setNotice(null);
374
+ setError(null);
375
+ const snap = previewActor.getSnapshot();
376
+ if (!isPreviewLive(snap.value) || snap.context.sha !== v.sha) previewActor.send({
377
+ type: "OPEN",
378
+ sha: v.sha
379
+ });
380
+ }, [previewActor]);
381
+ const restoreFromPreview = useCallback(async (v) => {
382
+ if (await doRestore(v)) closeStage();
383
+ }, [closeStage, doRestore]);
384
+ const versions = useMemo(() => {
385
+ var _a2;
386
+ return (_a2 = list == null ? void 0 : list.versions) != null ? _a2 : [];
387
+ }, [list]);
388
+ const starredCount = versions.filter((v) => v.bookmark).length;
389
+ const shown = filter === "starred" ? versions.filter((v) => v.bookmark) : versions;
390
+ const stageVersion = stage ? (_a = versions.find((v) => v.sha === stage.sha)) != null ? _a : null : null;
391
+ const previewDisabled = busy ? BUSY_TITLE : null;
392
+ useEffect(() => {
393
+ if (filter === "starred" && list && !starredCount) setFilter("all");
394
+ }, [filter, list, starredCount]);
395
+ const restoreDisabled = busy ? BUSY_TITLE : null;
396
+ const stageRestoreDisabled = working !== null ? "Wait for the current change" : restoreDisabled;
397
+ const footer = () => {
398
+ if (!list) return null;
399
+ if (filter === "all" && list.templateCommits) {
400
+ return /* @__PURE__ */ jsxs(View, { style: styles.footerRow, accessibilityHint: "Changes made to the template before your site are not listed", children: [
401
+ /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "view-dashboard-outline", size: 16, color: theme.muted }),
402
+ /* @__PURE__ */ jsx(Text, { style: [styles.note, {
403
+ color: theme.muted
404
+ }], children: "Started from a template" })
405
+ ] });
406
+ }
407
+ if (list.hasMore) return null;
408
+ if (list.partial) {
409
+ return /* @__PURE__ */ jsx(Text, { style: [styles.note, styles.footerRow, {
410
+ color: theme.muted
411
+ }], children: "Older versions aren't shown: this preview only has the recent history." });
412
+ }
413
+ return null;
414
+ };
415
+ return /* @__PURE__ */ jsxs(Sheet, { visible, title: "History", onClose, theme, testID: "webbuilder-versions", children: [
416
+ historyOn ? /* @__PURE__ */ jsxs(View, { style: styles.toolbar, children: [
417
+ versions.length ? /* @__PURE__ */ jsx(View, { style: styles.filters, accessibilityLabel: "Show versions", children: ["all", "starred"].map((f) => {
418
+ const on = filter === f;
419
+ const off = f === "starred" && !starredCount;
420
+ const label = f === "all" ? "All" : `Starred${starredCount ? ` (${starredCount})` : ""}`;
421
+ return /* @__PURE__ */ jsxs(Tap, { onPress: () => setFilter(f), disabled: off, accessibilityRole: "button", accessibilityLabel: label, accessibilityHint: off ? "Star a version to find it here" : void 0, accessibilityState: {
422
+ selected: on,
423
+ disabled: off
424
+ }, style: [styles.filter, {
425
+ backgroundColor: on ? theme.accentSoft : theme.chip
426
+ }, off ? styles.disabled : null], pressedStyle: DIM, testID: `webbuilder-history-filter-${f}`, children: [
427
+ f === "starred" ? /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "star", size: 13, color: on ? theme.accent : theme.muted }) : null,
428
+ /* @__PURE__ */ jsx(Text, { style: [styles.filterLabel, {
429
+ color: on ? theme.accent : theme.ink
430
+ }], children: label })
431
+ ] }, f);
432
+ }) }) : /* @__PURE__ */ jsx(View, { style: styles.filters }),
433
+ /* @__PURE__ */ jsx(IconButton, { icon: "refresh", label: "Refresh history", onPress: () => load().catch(() => void 0), disabled: loading, tint: theme.muted, theme, testID: "webbuilder-history-refresh" })
434
+ ] }) : null,
435
+ /* @__PURE__ */ jsxs(ScrollView, { style: styles.list, contentContainerStyle: styles.content, keyboardShouldPersistTaps: "handled", children: [
436
+ historyOn && busy && working === null ? /* @__PURE__ */ jsx(Text, { style: [styles.banner, {
437
+ backgroundColor: theme.chip,
438
+ color: theme.muted
439
+ }], children: "The AI is working. History is read-only until it finishes." }) : null,
440
+ (list == null ? void 0 : list.dirty) ? /* @__PURE__ */ jsx(Text, { style: [styles.banner, {
441
+ backgroundColor: theme.chip,
442
+ color: theme.muted
443
+ }], children: "This site has changes that aren't in a version yet. A restore saves them as a version first, so nothing is lost." }) : null,
444
+ error ? /* @__PURE__ */ jsx(Text, { style: [styles.banner, {
445
+ backgroundColor: theme.critSoft,
446
+ color: theme.crit
447
+ }], accessibilityRole: "alert", testID: "webbuilder-history-error", children: error }) : null,
448
+ notice ? /* @__PURE__ */ jsx(Text, { style: [styles.banner, {
449
+ backgroundColor: theme.chip,
450
+ color: theme.ink
451
+ }], accessibilityLiveRegion: "polite", testID: "webbuilder-history-notice", children: notice }) : null,
452
+ historyOn && !list && loading ? /* @__PURE__ */ jsxs(View, { style: styles.loading, children: [
453
+ /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: theme.muted }),
454
+ /* @__PURE__ */ jsx(Text, { style: [styles.note, {
455
+ color: theme.muted
456
+ }], children: "Loading versions\u2026" })
457
+ ] }) : null,
458
+ list && !list.versions.length ? /* @__PURE__ */ jsxs(View, { style: styles.empty, children: [
459
+ /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "history", size: 26, color: theme.faint }),
460
+ /* @__PURE__ */ jsx(Text, { style: [styles.emptyTitle, {
461
+ color: theme.ink
462
+ }], children: "No versions yet" }),
463
+ /* @__PURE__ */ jsx(Text, { style: [styles.note, styles.center, {
464
+ color: theme.muted
465
+ }], children: "Each AI change saves a version here, so you can go back to it." })
466
+ ] }) : null,
467
+ shown.map((v) => /* @__PURE__ */ jsx(VersionRow, { version: v, now, theme, readOnly, locked, busy, working, confirming: confirmSha === v.sha, draft: (bookmarkDraft == null ? void 0 : bookmarkDraft.sha) === v.sha ? bookmarkDraft.name : null, staged: (stage == null ? void 0 : stage.sha) === v.sha ? stage.kind : null, previewDisabled, onStar: () => v.bookmark ? doBookmark(v, null).catch(() => void 0) : setBookmarkDraft({
468
+ sha: v.sha,
469
+ name: versionRow(v, now).title.slice(0, 30)
470
+ }), onDraft: (name) => setBookmarkDraft(name === null ? null : {
471
+ sha: v.sha,
472
+ name
473
+ }), onSaveBookmark: () => {
474
+ var _a2;
475
+ return doBookmark(v, (_a2 = bookmarkDraft == null ? void 0 : bookmarkDraft.name) != null ? _a2 : "").catch(() => void 0);
476
+ }, onChanges: () => setStage({
477
+ kind: "changes",
478
+ sha: v.sha
479
+ }), onPreview: () => openPreview(v), onAskRestore: () => setConfirmSha(v.sha), onRestore: () => doRestore(v).catch(() => void 0), onCancelRestore: () => setConfirmSha(null) }, v.sha)),
480
+ footer(),
481
+ (list == null ? void 0 : list.hasMore) ? /* @__PURE__ */ jsxs(Tap, { onPress: () => !loading && load({
482
+ more: true
483
+ }).catch(() => void 0), disabled: loadingMore || loading, accessibilityRole: "button", accessibilityLabel: "Load older versions", style: [styles.more, {
484
+ borderColor: theme.border
485
+ }], pressedStyle: DIM, testID: "webbuilder-history-more", children: [
486
+ loadingMore ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: theme.muted }) : null,
487
+ /* @__PURE__ */ jsx(Text, { style: [styles.moreLabel, {
488
+ color: theme.ink
489
+ }], children: "Load older versions" })
490
+ ] }) : null,
491
+ moreError ? /* @__PURE__ */ jsx(Text, { style: [styles.note, styles.center, {
492
+ color: theme.crit
493
+ }], children: moreError }) : null,
494
+ builds.length > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
495
+ historyOn ? /* @__PURE__ */ jsx(Text, { style: [styles.section, {
496
+ color: theme.muted
497
+ }], children: "Builds on this phone" }) : null,
498
+ /* @__PURE__ */ jsx(BuildsList, { builds, selectedKey, onSelect, theme })
499
+ ] }) : null
500
+ ] }),
501
+ /* @__PURE__ */ jsxs(Modal, { visible: Boolean(stage && stageVersion && run), animationType: "slide", presentationStyle: "fullScreen", onRequestClose: closeStage, children: [
502
+ stage && stageVersion && run && stage.kind === "changes" ? /* @__PURE__ */ jsx(VersionChangesView, { run, sandboxId, version: stageVersion, now, onBack: closeStage, onPreview: stageVersion.isHead ? void 0 : () => openPreview(stageVersion), previewDisabled, theme, topInset: insets.top, bottomInset: insets.bottom }, stageVersion.sha) : null,
503
+ stage && stageVersion && run && stage.kind === "preview" ? /* @__PURE__ */ jsx(VersionPreviewView, { version: stageVersion, now, phase: previewPhase(preview.value), url: versionPreviewUrl(build == null ? void 0 : build.previewUrl, sandboxId, void 0, publicSandboxDomain()), frameKey: preview.context.epoch, error: preview.context.error, message: error || notice, onRestore: readOnly ? void 0 : () => restoreFromPreview(stageVersion).catch(() => void 0), restoring: working === stageVersion.sha, restoreDisabled: stageRestoreDisabled, onBack: closeStage, onRetry: () => previewActor.send({
504
+ type: "RETRY"
505
+ }), onShowChanges: () => setStage({
506
+ kind: "changes",
507
+ sha: stageVersion.sha
508
+ }), theme, topInset: insets.top, bottomInset: insets.bottom }, stageVersion.sha) : null
509
+ ] })
510
+ ] });
29
511
  }
30
512
  const styles = StyleSheet.create({
513
+ toolbar: {
514
+ flexDirection: "row",
515
+ alignItems: "center",
516
+ gap: 8,
517
+ paddingBottom: 8
518
+ },
519
+ filters: {
520
+ flex: 1,
521
+ flexDirection: "row",
522
+ gap: 6
523
+ },
524
+ filter: {
525
+ flexDirection: "row",
526
+ alignItems: "center",
527
+ gap: 4,
528
+ minHeight: 36,
529
+ paddingHorizontal: 14,
530
+ borderRadius: 18
531
+ },
532
+ filterLabel: {
533
+ fontSize: 13,
534
+ fontWeight: "600"
535
+ },
31
536
  list: {
32
- maxHeight: 420
537
+ flexShrink: 1
33
538
  },
34
539
  content: {
35
540
  gap: 8,
36
541
  paddingBottom: 8
37
542
  },
38
- row: {
543
+ banner: {
544
+ fontSize: 13,
545
+ lineHeight: 18,
546
+ paddingHorizontal: 12,
547
+ paddingVertical: 8,
548
+ borderRadius: 10
549
+ },
550
+ loading: {
39
551
  flexDirection: "row",
40
552
  alignItems: "center",
41
- gap: 12,
42
- padding: 14,
553
+ gap: 8,
554
+ paddingVertical: 14
555
+ },
556
+ note: {
557
+ fontSize: 13,
558
+ lineHeight: 18
559
+ },
560
+ center: {
561
+ textAlign: "center"
562
+ },
563
+ empty: {
564
+ alignItems: "center",
565
+ gap: 6,
566
+ paddingVertical: 24,
567
+ paddingHorizontal: 24
568
+ },
569
+ emptyTitle: {
570
+ fontSize: 15,
571
+ fontWeight: "600"
572
+ },
573
+ row: {
574
+ padding: 12,
43
575
  borderRadius: 12,
44
- borderWidth: 1
576
+ borderWidth: 1,
577
+ gap: 8
578
+ },
579
+ rowTop: {
580
+ flexDirection: "row",
581
+ alignItems: "flex-start",
582
+ gap: 10
583
+ },
584
+ kind: {
585
+ marginTop: 1
45
586
  },
46
- text: {
47
- flex: 1
587
+ rowText: {
588
+ flex: 1,
589
+ minWidth: 0
48
590
  },
49
591
  title: {
50
592
  fontSize: 15,
51
593
  fontWeight: "600"
52
594
  },
595
+ metaRow: {
596
+ flexDirection: "row",
597
+ flexWrap: "wrap",
598
+ alignItems: "center",
599
+ gap: 6,
600
+ marginTop: 3
601
+ },
53
602
  meta: {
603
+ fontSize: 13
604
+ },
605
+ badge: {
606
+ borderRadius: 999,
607
+ paddingHorizontal: 7,
608
+ paddingVertical: 1
609
+ },
610
+ badgeText: {
611
+ fontSize: 11,
612
+ fontWeight: "600"
613
+ },
614
+ actions: {
615
+ flexDirection: "row",
616
+ flexWrap: "wrap",
617
+ gap: 6,
618
+ paddingLeft: 28
619
+ },
620
+ rowAction: {
621
+ flexDirection: "row",
622
+ alignItems: "center",
623
+ gap: 5,
624
+ minHeight: 36,
625
+ paddingHorizontal: 12,
626
+ borderRadius: 18
627
+ },
628
+ rowActionLabel: {
629
+ fontSize: 13,
630
+ fontWeight: "600"
631
+ },
632
+ disabled: {
633
+ opacity: 0.45
634
+ },
635
+ draftRow: {
636
+ flexDirection: "row",
637
+ alignItems: "center",
638
+ gap: 6,
639
+ paddingLeft: 28
640
+ },
641
+ input: {
642
+ flex: 1,
643
+ minHeight: 40,
644
+ borderWidth: 1,
645
+ borderRadius: 10,
646
+ paddingHorizontal: 10,
647
+ fontSize: 14
648
+ },
649
+ smallButton: {
650
+ flexDirection: "row",
651
+ alignItems: "center",
652
+ justifyContent: "center",
653
+ gap: 6,
654
+ minHeight: 40,
655
+ paddingHorizontal: 14,
656
+ borderRadius: 20
657
+ },
658
+ smallButtonLabel: {
659
+ fontSize: 14,
660
+ fontWeight: "600"
661
+ },
662
+ confirm: {
663
+ borderRadius: 10,
664
+ padding: 10,
665
+ gap: 8,
666
+ marginLeft: 28
667
+ },
668
+ confirmText: {
54
669
  fontSize: 13,
55
- marginTop: 2
670
+ lineHeight: 18
671
+ },
672
+ confirmButtons: {
673
+ flexDirection: "row",
674
+ gap: 8
675
+ },
676
+ footerRow: {
677
+ flexDirection: "row",
678
+ alignItems: "center",
679
+ gap: 8,
680
+ paddingVertical: 8,
681
+ paddingHorizontal: 4
682
+ },
683
+ more: {
684
+ flexDirection: "row",
685
+ alignItems: "center",
686
+ justifyContent: "center",
687
+ gap: 8,
688
+ minHeight: 44,
689
+ borderRadius: 12,
690
+ borderWidth: 1
691
+ },
692
+ moreLabel: {
693
+ fontSize: 14,
694
+ fontWeight: "600"
695
+ },
696
+ section: {
697
+ fontSize: 12,
698
+ fontWeight: "700",
699
+ textTransform: "uppercase",
700
+ marginTop: 8
701
+ },
702
+ buildRow: {
703
+ flexDirection: "row",
704
+ alignItems: "center",
705
+ gap: 12,
706
+ padding: 14,
707
+ borderRadius: 12,
708
+ borderWidth: 1
709
+ },
710
+ buildTitle: {
711
+ fontSize: 15,
712
+ fontWeight: "600"
56
713
  }
57
714
  });export{VersionsSheet};//# sourceMappingURL=VersionsSheet.js.map